🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
110 messages
110 total messages Page 2 of 3 Started by Liyang Hu Sat, 16 Feb 2002 01:20
Page 2 of 3 • 110 total messages
Re: [yEnc] some newbie questions
#56749
Author: Curt Welch
Date: Thu, 21 Feb 2002 22:45
118 lines
6785 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:
> The Archiver <archiver@i3w.com> wrote:
> > JanC <usenet_spam@janc.cjb.net.invalid> wrote:
> >>Please... No integrated compression!
> > People are talkign about a better encoding (RLE-encoding,
> > compression) again and again. If we do something into this
> > direction then I want to propose to use a _real_ compression -
> > once !
>
> I don't think any of the people who will be doing the actual
> implementation want to do this though. As JanC said, this is a
> application-level issue, and we should not bloat the encoding format
> because of it.

The zlib stuff is already there and is free and is ported to just about
everything and seems simple as hell to hook in.  I don't think we will get
a lot of flak about it.  And if it is "required" only on the decoding side
and is optional on the encoding side, it's even easier to deal with at the
application level.  It basically means only adding one extra call to the
decompress() function for each block of data you decode if the yEnc file
was marked as "compressed".  On the encoding side, supporting it might be a
bit harder.

> >>What you gonna do when there comes a new (free) compression method
> >>that has better compression (maybe on certain popular filetypes)?
> > The performance of compression did not change very much in the
> > last 5 years. So we dont have to expect a drastical improvement in
> > a short time.
>
> And in the long term? I fail to see any widespread usage of the
> Burrow-Wheeler Transform being used outside of the UN*X world.
> Should that eventually catch on under Windows? Will you adopt it?
>
> Research in compression methods is still ongoing, it's most
> definitely not a `done' subject. You never know, we might get a
> drastic improvement in the next couple of years.

The only way to get losless compression much better is to use more CPU
power and more memory.  That IS likely to happen over any extended period
of time, like 50 years.  But I don't see that as a good argument for not
including compression in a yEnc standard.

It is an argument however for makeing it optional on the encoding side, and
potentailly leaving a system open for including different algorithms in
future versions of the standard.

> > However yEnc would be subject to improvement and changes as well
> > as any other format/standard/...
>
> I don't think uuencode has been modified since it was proposed.

Proposed? It was just created.  Much like yEnc :). And yes, it's changed
many times.  There were probaly 20 different versions of it in use at one
time (though it was all minor issues of what characters to use for the
base-64 alphabit).  The big change was replacing space with ` to prevent
systems which trimmed trailing spaces from corrupting uuencoded files.

The decoding was defined as simply (ch-' ') & 0x3f so that meant there
were two possible ASCII characters to use for every character in the base64
character set.  So, to "fix" various character set problems, people
made a lot of minor changes to the "standard" which ended up breaking
a lot of decoders.

> I
> don't think the gzip format has changed since it was originally
> designed either.

gzip was a replacement for compress which was a replacement for compact
which was a replacement for pack.

I don't know if gzip changed, but it was basicly version 4 in a series that
changed every few years.

> Well-designed formats *do not change*. If there's a
> need for change, then it simply shows it wasn't thought out well
> enough to begin with.

Well, that's the point.  yEnc was not well designed was it. :)

If it had been, we wouldn't be talking about version II already. :)

> Think about it: if you keep modifying it, then it won't be the same
> standard anymore. If that's what you propose, then I seriously
> question your use of the word `standard'. Surely you mean `format'?

Yeah, one argument is to try and fix whatever needs to be fixed now
that it's getting a good beta test, and then freeze it.  But maybe
you are right, it might already be too late to create a version
II and get it accepted... :)

> > Compression is something people need and want. And if we give them
> > an efficient, free compressed encoding then life would be far
> > easier than before.
>
> And we'll see this new /encoding/ `standard' being obsoleted every
> couple of years.

Not because of compression.  It's just not going to happen.

Big gains in compression can happen in application specific areas using
lossy compression algorithms, but general purpose loss-less compression is
just not something that is likely to get much better very quickly.  It's
mostly reached it limit already.  To go further, you simply need to be
willing to dedicate a lot more CPU power and memory to the problem.  You
need orders of magnatude improvements in CPU power and memory to get even
minor improvements in compression.

Thinking that lossless compression standards are going to improve every few
years is as silly as assuming that sort algorithms are going to get faster
and faster every few years.

Now, the issue of not getting yEnc II right and needing to fix it again in
a year is another issue...

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56750
Author: JanC
Date: Thu, 21 Feb 2002 22:46
13 lines
1600 bytes
J.B. Moreno <planb@newsreaders.com> wrote:

> Nope, I told you that Luc Van der Veken had created such an encoding
> (b-news).  I believe yEnc is better/faster.

yEnc *is* faster (personal experience) and Luc thinks yEnc is (or could 
be) better than b-news.

-- 
JanC

Petition against spam in the EU: <http://www.politik-digital.de/spam/>
Re: [yEnc] some newbie questions
#56757
Author: Francois Petillon
Date: Thu, 21 Feb 2002 23:16
16 lines
1985 bytes
"J.B. Moreno" a �crit :
> > After a quick look, the encoding/decoding algorithm seems much
> > nicer than yenc one. And a base-224 decoder should be a little
> > more CPU-friendly than yenc (which can be important for webnews
> > interfaces when decoding files or for news feeders to filter
> > corrupted articles).
> The encoder is (according to the author) CPU intensive.

I am afraid my first look was to quick... :-(
I had simply forgotten working on base224 was not as
simple as base64 or UUE ! (well, as long as you can't
build a 2^41 * 40 bytes array without worrying about
memory)

  Fran�ois
Re: [yEnc] some newbie questions
#56759
Author: Liyang Hu
Date: Thu, 21 Feb 2002 23:29
20 lines
1846 bytes
The Archiver <archiver@i3w.com> wrote:
> Whenever someone told me that he wanted compression in yEnc then I
> told him that most formats on Usenet today are already compressed
> formats.

I believe compression was mentioned as an alternative to +42 modulo
256. I think you're misinterpreting the aim as trying to reduce the
size of the post -- it wasn't: the aim was to remove skew in the
character distribution.

> yEnc is an 8-bit-encoding

<pedant>Not so much 8-bit as opposed to 7.977-bit.</pedant>

mata ne,
/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| Never underestimate stupid people in large numbers.                    |
Re: [yEnc] some newbie questions
#56761
Author: Liyang Hu
Date: Thu, 21 Feb 2002 23:38
17 lines
1944 bytes
J.B. Moreno <planb@newsreaders.com> wrote:
> In article <3C74D21B.F49E2F9F@proxad.net>, Francois Petillon
> <fanch@proxad.net> wrote:
>> After a quick look, the encoding/decoding algorithm seems much
>> nicer than yenc one.
> The encoder is (according to the author) CPU intensive.

It shouldn't be. (Not to the extent where it can slow down your
download speed!) It must not have been implemented correctly.

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| "Up your butt with a coconut!"                                         |
| "You've got facial hair like a polar bear!"                            |
|   -- Daphne and Celeste: "Ooh Stick You"                               |
Re: [yEnc] some newbie questions
#56764
Author: Liyang Hu
Date: Thu, 21 Feb 2002 23:51
37 lines
2415 bytes
Curt Welch <curt@kcwc.com> wrote:
> usenet@janc.cjb.net wrote:
>> A sort of BASE-224 encoding for Usenet already exists:
>> <http://b-news.sf.net/>
> Base 251 encoding would be a lot of math overhead

Computers are a lot of maths (and logic). It's about time some
programmers realised this.

> and produce almost exactly the same expansion as the escape
> expansion already defined for yEnc.

No.

> For each 256 random characters now, yenc would need to expand about 5
> characters in that set to twice their size, giving you a 256 to 261
> expansion.

> Base 251 encodng would turn 256 characters into 256 * 256 / 251 or 261.09
> characters giving you a 256 to 261.09 expansion.

No, you're not doing your maths correctly:

Each Base-251 digit[1] gives you (log to base 2[0])
    log_2(251) == 7.972 bits.
256 bytes comes out as 256.91 digits.

(Note that I'm proposing base-224.)

/Liyang
[0] That'll be log(n)/log(2), if you're trying to use your calculator.
[1] Each digit fits in a byte, of course.
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| drug, n: A substance that, when injected into a rat,                   |
|          produces a scientific paper.                                  |
Re: [yEnc] some newbie questions
#56765
Author: JanC
Date: Fri, 22 Feb 2002 00:33
19 lines
1992 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:

>> The encoder is (according to the author) CPU intensive.
> 
> It shouldn't be. (Not to the extent where it can slow down your
> download speed!) It must not have been implemented correctly.

It's slower than yEnc I think, but you can find the code on the 
SourceForge site.  It doesn't slow down my download speed though:
600 KiB/sec from my ISP's local news server is no problem with my
P3 @ 666MHz (download speed measured at 3am ;-).
But people with old Pentium CPU's have problems doing anything else 
when downloading with B-News.

-- 
JanC

Petition against spam in the EU: <http://www.politik-digital.de/spam/>
Re: [yEnc] some newbie questions
#56766
Author: Liyang Hu
Date: Fri, 22 Feb 2002 00:35
96 lines
4774 bytes
The Archiver <archiver@i3w.com> wrote:
> Liyang Hu <newsgroups@nerv.cx> wrote:
>>> People are talkign about a better encoding (RLE-encoding,
>>> compression) again and again.

RLE is compression, not encoding.

> - and I used this argument whenever someone wanted RLE or arith-enc
> or compression. 

Arithmetic coding is not compression. It's only if you perform
statistical analysis on the input data, and adapt your code to it.
This is not what I'm proposing.

> But - as we see - the wish for even more effiency comes back all
> the time.

Yes, and you should tell those people to go and pester compression
software developers.

>> Well-designed formats *do not change*. 
> What is the actual version number of HTML ?
> What is the actual version number of HTTP ?
> What is the actual version of JAVA ?

I think you're confusing `well-designed' with `commonly-used'.

<pedantic>And only the first is a format. Between the other two, the
first is a protocol, and the second a programming language.</pedantic>

> <sarcasm on>

It's OK, you don't need to use sarcasm tags -- I'm British. ^_-

>>Think about it: if you keep modifying it, then it won't be the
>>same standard anymore. If that's what you propose, then I
>>seriously question your use of the word `standard'. Surely you
>>mean `format'?
> Actually I mean "draft".

And by definition, a draft is not ready for real-world deployment.

>>And we'll see this new /encoding/ `standard' being obsoleted every
>>couple of years.
> USEFOR is releasing a new standard for Usenet messages.

Not a new standard. It's an update to document and formalise current
practices.

> NNTP-EXT is releasing a new standard for NNTP/RFC977.

As above.

> Should we stick with UUencode and BASE64 for the rest of our live
> just because they are "standards" ?

Did I ever propose such a thing? Either way, they've both survived
for more than `a couple of years' (read my last post carefully!).

>>Yes, I can't speak for everyone here, but at least I understand you
>>perfectly. But this does not mean we all agree with you. ^_-
> Some people want compression (or RLE or ARITH or ..) in yEnc.
> Some people dont like compression but XXX, YYY, ZZZ in yEnc.
> Some people want to leave it as it is.

> The last time _I_ was the one who made the decisions.

That was the problem. You made *all*[0] the decisions. There was no
peer review or commentary (at least).

This is not a personal attack in any way -- there's a good reason
why all scientific articles go through a system of peer review
before they get published. After all, we're all mortals, and we make
mistakes / bad decisions. Often it does take a group of people to
point out those mistakes for one to realise them.

> I simply did it. And I've been attacked often enough for the
> "badly designed" format.

Well, now that you've heard all this constructive criticism, would
you still say it was perfectly engineered from the start?

> As I dont believe that votes can help us here and I dont like to
> be the "lonely wolf" again I'd prefer to add compression as an
> option.

I don't think indifference or apathy is a good thing. Make a firm
decision, stand by it, and make sure you can justify it when others
begin to question you about it.

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
|  A [programming] language that doesn't affect the way you think        |
|  about programming is not worth knowing.                               |
Re: [yEnc] some newbie questions
#56771
Author: J.B. Moreno
Date: Fri, 22 Feb 2002 02:20
15 lines
1857 bytes
In article <a540dn$7i4$7@pegasus.csx.cam.ac.uk>, 
 Liyang Hu <newsgroups@nerv.cx> wrote:

> J.B. Moreno <planb@newsreaders.com> wrote:
> > Francois Petillon <fanch@proxad.net> wrote:
> >> After a quick look, the encoding/decoding algorithm seems much
> >> nicer than yenc one.
> > The encoder is (according to the author) CPU intensive.
> 
> It shouldn't be. (Not to the extent where it can slow down your
> download speed!) It must not have been implemented correctly.

Not the download speed, the upload speed -- don't know the details, but
encoding takes longer than decoding.
Re: [yEnc] some newbie questions
#56772
Author: J.B. Moreno
Date: Fri, 22 Feb 2002 02:58
27 lines
2349 bytes
In article <a53vse$7i4$6@pegasus.csx.cam.ac.uk>, 
 Liyang Hu <newsgroups@nerv.cx> wrote:

> The Archiver <archiver@i3w.com> wrote:
> > Whenever someone told me that he wanted compression in yEnc then I
> > told him that most formats on Usenet today are already compressed
> > formats.
> 
> I believe compression was mentioned as an alternative to +42 modulo
> 256. I think you're misinterpreting the aim as trying to reduce the
> size of the post -- it wasn't: the aim was to remove skew in the
> character distribution.

Right.  If the characters that are escaped appear more often (and it
appears that they do, or at least that NUL does), then it's at least
possible that they appear frequently enough as a sequence so that RLE
avoids the overhead imposed by the fact that they appear more often.

I.e., for a file w/o CR/LF's and where 10% of the file consists of
"triple" NULs
   No offset, no RLE -- needs to be escaped, overhead 10%
   42 offset, no RLE -- no escape, overhead 0%
   No offset, w/RLE  -- needs to be escaped, overhead 0%

Of course that's artificial -- but my hope was that runs of NULs were
common enough to combat the fact that byte-values aren't random.
Re: [yEnc] some newbie questions
#56777
Author: Curt Welch
Date: Fri, 22 Feb 2002 04:40
24 lines
2336 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:
> > Base 251 encodng would turn 256 characters into 256 * 256 / 251 or
> > 261.09 characters giving you a 256 to 261.09 expansion.
>
> No, you're not doing your maths correctly:
>
> Each Base-251 digit[1] gives you (log to base 2[0])
>     log_2(251) == 7.972 bits.
> 256 bytes comes out as 256.91 digits.

Ah quite right. log_251(256^256) is the correct math for what I was trying
to do with my bogus math above, which is log_2(2^(8*256))/log_2(251) which
is 8*256/7.97154 which as you say, is 256.91 digits!

Which makes a lot more sense.  I first assumed that base-251 would produce
much better encoding than the escape character encoding used by yEnc and
had written a reply about that but then threw it away when I did the "math"
and found out I was wrong. :)  Glad to see my first assumption was right
after all. :)

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56783
Author: The Archiver
Date: Fri, 22 Feb 2002 07:29
33 lines
2343 bytes
Francois Petillon <fanch@proxad.net> wrote:

>A CRC is a good idea but a few things are
>bugging me on yenc way to manage it :
>- you should not have to decode the part to process it

In any way it is necessary to calculate the CRC for the body.
Even if it is global to the message-body.
So there are no savings (or just tiny savings).

Your solution is no longer applicable if the host is generating
trailer lines to a post automatically (common practice) - and the
CRC-header is created by the posting program.

>- it should be global to the body of an article (adding a new
>X-Body-CRC field to the header ?) and, thus, CR/LF insensitive

People can today join a message and save it to disk. 
This is very important for the transistion phase.
Your method removes the headers and gives external decoders 
no chance to find corruption.


Be sure that all your ideas have been evaluated during the 
creation of the yEnc-draft. A lot of people believe that the spec
is bad. But I did bother this (and other) newsgroup for a very long 
time to get all facts together which are needed to make a 
thing that works. 

--
Juergen

Re: [yEnc] some newbie questions
#56784
Author: The Archiver
Date: Fri, 22 Feb 2002 07:32
19 lines
1801 bytes
curt@kcwc.com (Curt Welch) wrote:

>Base 251 encoding would be a lot of math overhead and produce almost
>exactly the same expansion as the escape expansion already defined for
>yEnc.

Just a short comment here:
During the design of yEnc I was not sure which characters really needed
to be encoded - and I still have no idea about leading/trailing spaces/tabs
or other special characters when it comes to eMail or XML.

In yEnc you simply add another escape code - and still use the same
method. I'd be really curious how you want to make Base251 as 
flexible as yEnc.

-- 
Juergen

Re: [yEnc] some newbie questions
#56785
Author: The Archiver
Date: Fri, 22 Feb 2002 07:44
54 lines
3316 bytes
Dirk Nimmich <nimmich@muenster.de> wrote:

>>>> Another future application will be to post an HTML PAGE together
>>>> with all pics and parts as one message (to news or mail).
>>>
>>>You can already do it, and FWIW, it's already done. Read the MIME
>>>specs.
>> 
>> I have never seen a MIME encoding which supports compression.
>
>I didn't talk about compression but about the possibility to send a
>"HTML page together with all pics and parts as one message".

I was talking about compression and understood your reply
as a proposal to use MIME when it comes to compressed 
multi-file postings. Sorry for the confusion.

>There's a Content-Encoding header that could be used for it if
>USENET was binary clean. (HTTP uses it.) But if this was possible
>we would also be able to send messages with Content-Transfer-
>Encoding: binary and also would not need yenc.

This was an approach I tried last year before I began the work on yEnc:
True binary transport of bodies.
I was told that this would be impossible.
So this was one of the reasons (or the true one) for creating yEnc.

>> yEnc is an 8-bit-encoding which is especially designed
>> to be transported with NNTP.
>
>Ah. I thought yenc was to be used on complete USENET, not just
>sites using NNTP for carrying articles. Sorry.

Until now I've had no problems to transmit yEncoded articles through
moderation gateways, by eMail or by UUCP-Bags.
If you have any information about parts of Usenet which will definitely
_not_ work with yEnc then I would be very thankful. 
Such information could be at least added to the yEnc-spec as a warning.

Today binaries are getting more and more seperated from "regular"
Usenet - so I dont really care if "Usenet->Lotus" gateway would have  
problems with yEnc (while the warning would be still nice in the spec).

So if you have valueable experience then please share it with us.

I believe that yEnc will also spread quickly to eMail - and perhaps
other areas where encoding is used (XML). Especially for XML the
'>' must  be also an encoded character.

TIA
-- 
Juergen

Re: [yEnc] some newbie questions
#56786
Author: The Archiver
Date: Fri, 22 Feb 2002 07:54
39 lines
2497 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:

>> Whenever someone told me that he wanted compression in yEnc then I
>> told him that most formats on Usenet today are already compressed
>> formats.
>
>I believe compression was mentioned as an alternative to +42 modulo
>256. I think you're misinterpreting the aim as trying to reduce the
>size of the post -- it wasn't: the aim was to remove skew in the
>character distribution.

I believe compression was mentioned as an alternative to the
RLE encoding and to avoid extreme cases (200% overhead).
(And you are doomed if the compressor creates a lot of NUL,CR,LF).

My very personal approach would be to place compression
not _inside_ the yEnc-coding but strictly seperate it:

File -> Compressor -> yEncoder.

This would avoid all extreme cases, avoid the need for RLE,
still leaves actual yEnc decoders compatible 
and even permits external de-compression.

>> yEnc is an 8-bit-encoding
>
><pedant>Not so much 8-bit as opposed to 7.977-bit.</pedant>

<scientific joke>
LOL - I wrote a very similar number to another message :-)
But I believe I did use the formula:  252/256*8 -> 7.875 bit.
And if I assume that the 4 encoded chars are duplicated then
248/256*8 gives me an 7.75 bit encoding.
</scientific joke>

-- 
Juergen

Re: [yEnc] some newbie questions
#56789
Author: The Archiver
Date: Fri, 22 Feb 2002 08:19
50 lines
3040 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:

>>>Yes, I can't speak for everyone here, but at least I understand you
>>>perfectly. But this does not mean we all agree with you. ^_-
>> Some people want compression (or RLE or ARITH or ..) in yEnc.
>> Some people dont like compression but XXX, YYY, ZZZ in yEnc.
>> Some people want to leave it as it is.
>
>> The last time _I_ was the one who made the decisions.
>
>That was the problem. You made *all*[0] the decisions. There was no
>peer review or commentary (at least).

The first draft (from July 2001) was heavily discussed here - 
and and three other guys discussed it with me by eMail.
The result are the "implementation notes" (Nov, 7th 2001).

What I wanted to say if things are controversial after 4 months
then someone must make a decision.


>> I simply did it. And I've been attacked often enough for the
>> "badly designed" format.
>
>Well, now that you've heard all this constructive criticism, would
>you still say it was perfectly engineered from the start?

yEnc is not perfect in theory - if there would be no Internet and 
no history at all then it could be far better.

But add the fact that we had to consider the existing 
infrastructure (Usenet), transition phase, compatibility (with 
existing news-readers) and the design targets "minimum overhead"
and "crc-protection" and "ease of implementation" and "second
source".
 
No other method fits so perfectly into the current environment.
(However we forgot three minor things :-)


>I don't think indifference or apathy is a good thing. Make a firm
>decision, stand by it, and make sure you can justify it when others
>begin to question you about it.

I am doing my very best.

-- 
Juergen

Re: [yEnc] some newbie questions
#56790
Author: The Archiver
Date: Fri, 22 Feb 2002 08:34
27 lines
2115 bytes
curt@kcwc.com (Curt Welch) wrote:

>Yeah, one argument is to try and fix whatever needs to be fixed now
>that it's getting a good beta test, and then freeze it.  

I agree - this is my current strategy.

>Now, the issue of not getting yEnc II right and needing to fix it again in
>a year is another issue...

I believe that "unexpected success" of yEnc did awake enough people
to deal now seriously with the topic.
So the chances to make yEnc II acceptbale are good :-)


Thanks for sharing your knowledge about the past.
But sometimes I believe that carrying the burden of the entire
history makes new decisions too difficult - or impossible.

If both ways failed in the past (here: UUenc & MIME) then people
tend to seek endlessly for a third (perfect) way - and are no 
longer able to do anything (blocking themselves).

-- 
Juergen

Re: [yEnc] some newbie questions
#56844
Author: Liyang Hu
Date: Sat, 23 Feb 2002 11:21
27 lines
2383 bytes
The Archiver <archiver@i3w.com> wrote:
> curt@kcwc.com (Curt Welch) wrote:
>>Base 251 encoding would be a lot of math overhead and produce
>>almost exactly the same expansion as the escape expansion already
>>defined for yEnc.
> Just a short comment here:
> During the design of yEnc I was not sure which characters really needed
> to be encoded - and I still have no idea about leading/trailing spaces/tabs
> or other special characters when it comes to eMail or XML.

> In yEnc you simply add another escape code - and still use the same
> method. I'd be really curious how you want to make Base251 as 
> flexible as yEnc.

Not sure what Curt meant, but going with base 224, you can take any
arbitrary map (injection) of the symbols 0 to 223 to any subset of 0
to 255, as long that subset only contains permitted characters.

Of course, I'm making the assumption that we have at least 224
permitted characters.

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| Real programmers don't comment their code.                             |
| It was hard to write, it should be hard to understand.                 |
Re: [yEnc] some newbie questions
#56845
Author: Liyang Hu
Date: Sat, 23 Feb 2002 11:25
24 lines
2331 bytes
J.B. Moreno <planb@newsreaders.com> wrote:
> In article <a540dn$7i4$7@pegasus.csx.cam.ac.uk>, Liyang Hu
> <newsgroups@nerv.cx> wrote:
>> J.B. Moreno <planb@newsreaders.com> wrote:
>> > The encoder is (according to the author) CPU intensive.
>> It shouldn't be. (Not to the extent where it can slow down your
>> download speed!) It must not have been implemented correctly.
> Not the download speed, the upload speed -- don't know the
> details, but encoding takes longer than decoding.

So I meant to say `upload', cheers.

But the point remains -- the encoder and decoder should be of the
same level of complexity, ie. O(N). I don't see how one could be
significantly slower than the other, provided they were implemented
correctly.

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| ``Computer games don't affect kids, I mean if Pac Man affected us as   |
| kids, we'd all be running around in darkened rooms, munching pills and |
| listening to repetitive music.''                                       |
Re: [yEnc] some newbie questions
#56846
Author: Liyang Hu
Date: Sat, 23 Feb 2002 11:29
19 lines
1967 bytes
=-lordsnow-= <lordsnow@home.nl> wrote:
>> That was the problem. You made *all*[0] the decisions. There was
>> no peer review or commentary (at least).
> Liyang, you forgot your [0] footnote :)

Ah, right. The footnote got moved to right below that line, and I
forgot to remove the marker. ^_^;;

> Just checking if we were awake, eh?

Glad to see that some people are. ^_- (Although I might not have
been at the time of that post ...)

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| There are two major products that came from Berkeley: LSD & UNIX.      |
| We don't believe this to be a coincidence.       -- Jeremy S. Anderson |
Re: [yEnc] some newbie questions
#56847
Author: Liyang Hu
Date: Sat, 23 Feb 2002 11:33
17 lines
1808 bytes
J.B. Moreno <planb@newsreaders.com> wrote:
> In article <a4ko92$3ol$2@pegasus.csx.cam.ac.uk>, Liyang Hu
> <newsgroups@nerv.cx> wrote:
>> Then you might want to mention this in the yEnc specs, surely?
> I'd expect people implementing newsreaders to be aware of things
> like that -- but given the problem with the leading period, I
> guess so.

I'm not a `person implementing newsreaders'; I'm a frustrated user
who woke up to find that he suddenly couldn't download half of the
posts on his favorite newsgroups anymore. ^_-

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| Never underestimate stupid people in large numbers.                    |
Re: [yEnc] some newbie questions
#56848
Author: Yume no Hikari
Date: Sat, 23 Feb 2002 11:33
9 lines
1797 bytes
On Sun, 17 Feb 2002 19:35:53 -0700, Andrew Gierth wrote:
> All widely deployed news transport software is 8-bit clean.
Would it were so easy in the user agents.  Pan pitches a fit (as I
discovered a few weeks ago) about high-bit characters in filenames (maybe
it's just this case, but I ran across it a few weeks ago while trying to
grab some attachments that had SJIS-encoded text in the filenames).

-hikari/Joel
Re: [yEnc] some newbie questions
#56851
Author: Curt Welch
Date: Sat, 23 Feb 2002 18:52
53 lines
3989 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:
> J.B. Moreno <planb@newsreaders.com> wrote:
> > In article <a540dn$7i4$7@pegasus.csx.cam.ac.uk>, Liyang Hu
> > <newsgroups@nerv.cx> wrote:
> >> J.B. Moreno <planb@newsreaders.com> wrote:
> >> > The encoder is (according to the author) CPU intensive.
> >> It shouldn't be. (Not to the extent where it can slow down your
> >> download speed!) It must not have been implemented correctly.
> > Not the download speed, the upload speed -- don't know the
> > details, but encoding takes longer than decoding.
>
> So I meant to say `upload', cheers.
>
> But the point remains -- the encoder and decoder should be of the
> same level of complexity, ie. O(N). I don't see how one could be
> significantly slower than the other, provided they were implemented
> correctly.

Yes, 100*O(N) is still O(N) but it's 100 times slower.  Do you not
see something that takes 100 times longer as significant?  The fact that
both algorithms are O(N)is mostly meaningless to this type of discussion.

The b-news system which uses base 224 has to convert 320 bit (40 byte)
binary numbers into 41 character base224 numbers.  That required a lot of
CPU time for a simple "encoding".

If you wanted to do base 251 encoding, the first best-fit between Base2
numbers and Base251 numbers happens at 280 bytes or 2240 bits.  So to
convert each 280 bytes of raw data into 281 characters of encoded data, you
have to do 281 divisions of a 2240 bit binary number by 251.  That's a lot
of CPU work.  You are talking something on the order of 100 integer
divisions plus subtractions plus data shuffling for
_each_character_encoded_.  That's probably at least 100 times slower than
yEnc.

And that's not true base 251 encoding.  It's just a close fit to allow the
algorithm to remain O(N).  If you wanted true base 251 encoding you would
have to treat the entire input file as one huge binary numbers and the
problem would become O(N^2).

Maybe there is a way to do that quicker, but I don't know what it is.  Feel
free to code it and let us do a few timing tests on it and see how
significant it is or it isn't.

CPU speed these days vs. download speed gives us a lot of extra CPU power
to work with, but I suspect base251 encoding would eat up more CPU than
most people would be willing to give to the problem.  It's likely to be at
least 100 times slower than yEnc.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56856
Author: J.B. Moreno
Date: Sat, 23 Feb 2002 22:18
19 lines
1855 bytes
In article <a57um4$86r$4@pegasus.csx.cam.ac.uk>, 
 Liyang Hu <newsgroups@nerv.cx> wrote:

> J.B. Moreno <planb@newsreaders.com> wrote:
> > Liyang Hu <newsgroups@nerv.cx> wrote:
> >> Then you might want to mention this in the yEnc specs, surely?
> > I'd expect people implementing newsreaders to be aware of things
> > like that -- but given the problem with the leading period, I
> > guess so.
> 
> I'm not a `person implementing newsreaders'; I'm a frustrated user
> who woke up to find that he suddenly couldn't download half of the
> posts on his favorite newsgroups anymore. ^_-

Well, that wasn't a problem with line lengths...

-- 
J.B. Moreno
Re: [yEnc] some newbie questions
#56862
Author: Liyang Hu
Date: Sun, 24 Feb 2002 02:00
26 lines
2428 bytes
Curt Welch <curt@kcwc.com> wrote:
> > [snip stupid reference to O notation -- brain wasn't switched on]

> And that's not true base 251 encoding.  It's just a close fit to
> allow the algorithm to remain O(N).  If you wanted true base 251
> encoding you would have to treat the entire input file as one huge
> binary numbers and the problem would become O(N^2).

No, you don't need to do that. Google for `Arithmetic Coding', and
ignore any references to statistical modelling.

Hence why I was saying it had not been implemented correctly!

> Maybe there is a way to do that quicker, but I don't know what it
> is.  Feel free to code it and let us do a few timing tests on it
> and see how significant it is or it isn't.

Working on it.

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| "Up your butt with a coconut!"                                         |
| "You've got facial hair like a polar bear!"                            |
|   -- Daphne and Celeste: "Ooh Stick You"                               |
Re: [yEnc] some newbie questions
#56863
Author: Curt Welch
Date: Sun, 24 Feb 2002 05:21
10 lines
1640 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:

> Working on it.

Cool.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56864
Author: The Archiver
Date: Sun, 24 Feb 2002 09:47
22 lines
1993 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:

>> In yEnc you simply add another escape code - and still use the same
>> method. I'd be really curious how you want to make Base251 as 
>> flexible as yEnc.
>
>Not sure what Curt meant, but going with base 224, you can take any
>arbitrary map (injection) of the symbols 0 to 223 to any subset of 0
>to 255, as long that subset only contains permitted characters.

I must admit that I never took base224 into serious consideration.
Bit shifting is hard to program platform independent.

I've already got the first complaint that my sourcecode CRC32
calculation does not work on a 64 bit Platform ;-)

Furtunately adding 64 and 42 modulo 256 seems to work there.

-- 
The Archiver

Re: [yEnc] some newbie questions
#56878
Author: Dirk Nimmich
Date: Sun, 24 Feb 2002 18:52
86 lines
5384 bytes
The Archiver wrote:
> Dirk Nimmich <nimmich@muenster.de> wrote:
>>There's a Content-Encoding header that could be used for it if
>>USENET was binary clean. (HTTP uses it.) But if this was possible
>>we would also be able to send messages with Content-Transfer-
>>Encoding: binary and also would not need yenc.
> 
> This was an approach I tried last year before I began the work on yEnc:
> True binary transport of bodies.
> I was told that this would be impossible.

Well, it is difficult but not impossible.

First of all, news server have to be made binary clean. They must
be able to carry and store true binary files. That is one of the
easier problems. Some servers are already binary clean, AFAIK.
  
Then the protocol used between servers and clients must be made
binary clean. This can be done with extensions to the protocol
(such as announcing the byte size of the following article,
obsoleting much of the line oriented handling of NNTP today); there
are provisions in the lastest NNTP-draft how to do it.

The main problem here is, however, that you must have fall back
solutions in the case the other end does not announce it is able to
handle these extensions.

Two solutions are possible: Don't send the binary article or do a
conversion to another transfer encoding that is known to work. The
last one is done in e-mail transport: if the other end does not
announce it is able to handle 8BITMIME, an 8bit encoded message
will be reencoded using quoted-printable or base64. But then you
have to fight against the "don't touch a body after injection"
fraction of USENET despite the fact that you are only changing a
transport encoding and not the content.

Unfortunately, this fraction is very loud, so your conclusion may
be that it will actually be impossible to introduce this handling.

>>> yEnc is an 8-bit-encoding which is especially designed
>>> to be transported with NNTP.
>>
>>Ah. I thought yenc was to be used on complete USENET, not just
>>sites using NNTP for carrying articles. Sorry.
> 
> Until now I've had no problems to transmit yEncoded articles through
> moderation gateways, by eMail or by UUCP-Bags.

I didn't say there are problems. I just wanted to point out that
this encoding has nothing to do with NNTP except that NNTP must be
able to transport articles using this encoding (as any other
transport protocol for USENET articles).

NNTP is transport. Yenc is format. I already told you this last
year, but you did not want to hear it.

> Today binaries are getting more and more seperated from "regular"
> Usenet - so I dont really care if "Usenet->Lotus" gateway would have  
> problems with yEnc (while the warning would be still nice in the spec).

Well, there would be problems in the other direction rather than
from USENET to Lotus Notes; Lotus Notes _can_ handle binary files.
That is one of its main purposes.

> I believe that yEnc will also spread quickly to eMail - and perhaps
> other areas where encoding is used (XML). Especially for XML the
> '>' must  be also an encoded character.

I don't share your opinion that yenc will spread to e-mail quickly,
at least not as a genuine transfer encoding. MTAs do reconversion
on a regular basis, for example from 8bit to quoted-printable and
back, and it is very likely that a file sent in yenc format will be
reencoded in quoted-printable or base64. Most advantages of yenc
will be lost if this is done.

Regarding your XML "problem": You still don't make distinctions
between different application levels. If you want to transport XML
files using yenc format, you don't need an encoding of special XML
characters; the yenc encoding would have been undone before the XML
parser will see the file. If you think of embedding yenc encoded
files in XML, then the creator of the file has to take care of
special XML characters (you obviously mean '<' and not '>', '&' is
another special character); the XML parser reading the file will
automatically remove any XML encoding before passing the contents
to any processing instance.
Re: [yEnc] some newbie questions
#56887
Author: Curt Welch
Date: Sun, 24 Feb 2002 21:22
40 lines
3183 bytes
Dirk Nimmich <nimmich@muenster.de> wrote:
> First of all, news server have to be made binary clean. They must
> be able to carry and store true binary files. That is one of the
> easier problems. Some servers are already binary clean, AFAIK.

Most do it now, not just "some".  And if you take out the CR LF issue,
the percentage is so close to "all" that its fairly safe to put
binary articles on usenet already.

> Then the protocol used between servers and clients must be made
> binary clean. This can be done with extensions to the protocol
> (such as announcing the byte size of the following article,
> obsoleting much of the line oriented handling of NNTP today); there
> are provisions in the lastest NNTP-draft how to do it.

A total waste of time.  NNTP is good enough already and the huge amount
of conversion work required to remove the lone trailing CR LF problem is
pointless because the problem is easily solved at the article format
level.  The only thing that needs to be changed in the NNTP standard
is to make 8 bit transport with unlimited line lengths a MUST.

> The main problem here is, however, that you must have fall back
> solutions in the case the other end does not announce it is able to
> handle these extensions.

Exactly why it's a total waste of time to mess with NNTP.

> Two solutions are possible: Don't send the binary article or do a
> conversion to another transfer encoding that is known to work.

Three solutions are possible.  The third is do nothing to the protocol
and that makes your two options stupid to even consider.

I think your comments on yEnc are valid, I'm just reacting to your
comments about makeing NNTP news servers binary clean.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56890
Author: The Archiver
Date: Mon, 25 Feb 2002 08:12
55 lines
3092 bytes
Dirk Nimmich <nimmich@muenster.de> wrote:

>> This was an approach I tried last year before I began the work on yEnc:
>> True binary transport of bodies.
>> I was told that this would be impossible.
>
>Well, it is difficult but not impossible.
>
>First of all, 
>[...]
>Then the protocol 
>[...]
>The main problem here is, 
>[...]

It is impossible because it is necessary to change two things:
1) NNTP
2) The message format

I did contact both task-forces and every group forwarded me to the
other one. None would make the first step - because they are waiting
for the other group - a typical deadlock situation.

And after the "minor" change of introducting yEnc (you can see actually
what this minor step is) I am now absolutely sure that it is not just
impossible but _absolutely_ _definitely_ _unbelieveable_ impossible.


>I don't share your opinion that yenc will spread to e-mail quickly,
>at least not as a genuine transfer encoding. 

If Forte Agent and Outlook Express would support yEnc 
as a MIME embedding from the first day then they could 
do this also for eMail.
I propose you lean back and wait until this happens.

The mail people are still sleeping very well.... ;-)
Introducing yEnc (with integrated compression) for sending
WinWord-DOCs by eMail will wake them up.

>Regarding your XML "problem": You still don't make distinctions
>between different application levels. If you want to transport XML
>files using yenc format, you don't need an encoding of special XML
>characters; 

Did you ever try to include a binary into an XML file ?
AFAIR this is done by encoding the binary......   ;-)

I am not talking about sending XML-files but using yEnc
within XML files.

-- 
Juergen

Re: [yEnc] some newbie questions
#56902
Author: Russ Allbery
Date: Mon, 25 Feb 2002 19:17
35 lines
2886 bytes
The Archiver <archiver@i3w.com> writes:

> It is impossible because it is necessary to change two things:
> 1) NNTP
> 2) The message format

> I did contact both task-forces and every group forwarded me to the other
> one. None would make the first step - because they are waiting for the
> other group - a typical deadlock situation.

I'm sorry, I don't agree... binary transport of Usenet is *not*
deadlocked.  It *is* however, really hard, and it's waiting on the
completion of the RFC 977 revision before anyone is going to start on it
since it requires an NNTP extension, which requires that we first specify
an extension mechanism.

Which reminds me; I need to get back to work on NNTP standardization
stuff.

If you want binary transport on Usenet to happen faster, the way to do
that would be to help the NNTP draft get out faster.  Just ignore USEFOR;
they're irrelevant to the problem, and you don't need their blessing to
send binary articles.  I've sketched out a few times the way I think is
best for adding binary transit to Usenet, namely to follow a route very
similar to how binary transit was added to mail.  If you don't feel like
you can contribute to the current NNTP work, you could alternately start
an implementation of that and see what you run into and have an extension
design ready when the extension mechanism is ready.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: [yEnc] some newbie questions
#56911
Author: Dirk Nimmich
Date: Mon, 25 Feb 2002 21:06
30 lines
2331 bytes
The Archiver wrote:
> Dirk Nimmich <nimmich@muenster.de> wrote:
>> I don't share your opinion that yenc will spread to e-mail
>> quickly, at least not as a genuine transfer encoding.
> 
> If Forte Agent and Outlook Express would support yEnc 
> as a MIME embedding from the first day then they could 
> do this also for eMail.

I did not talk about MUAs, but MTAs converting between transfer
encodings. Agent and OE are completely irrelevant on this issue.

> I propose you lean back and wait until this happens.

I do. I'm really looking forward to that.

> Did you ever try to include a binary into an XML file ?

No. I have not have to yet, and I'm sure I won't.

> AFAIR this is done by encoding the binary......   ;-)

XML is almost binary clean (thanks to Unicode), and there are
standard mechanisms to encode problematic characters (&#).

> I am not talking about sending XML-files but using yEnc
> within XML files.

You mean using one transfer format for another.
Re: [yEnc] some newbie questions
#56913
Author: Dirk Nimmich
Date: Mon, 25 Feb 2002 21:17
13 lines
1914 bytes
Curt Welch wrote:
> Dirk Nimmich <nimmich@muenster.de> wrote:
>> First of all, news server have to be made binary clean. They must
>> be able to carry and store true binary files. That is one of the
>> easier problems. Some servers are already binary clean, AFAIK.
> 
> Most do it now, not just "some".  And if you take out the CR LF issue,
> the percentage is so close to "all" that its fairly safe to put
> binary articles on usenet already.

I wasn't aware of this. Fine. I think I will do some tests when
there is more time.
Re: [yEnc] some newbie questions
#56915
Author: Russ Allbery
Date: Mon, 25 Feb 2002 22:10
24 lines
2295 bytes
Dirk Nimmich <nimmich@muenster.de> writes:
> Curt Welch wrote:
>> Dirk Nimmich <nimmich@muenster.de> wrote:

>>> First of all, news server have to be made binary clean. They must
>>> be able to carry and store true binary files. That is one of the
>>> easier problems. Some servers are already binary clean, AFAIK.

>> Most do it now, not just "some".  And if you take out the CR LF issue,
>> the percentage is so close to "all" that its fairly safe to put binary
>> articles on usenet already.

> I wasn't aware of this. Fine. I think I will do some tests when there is
> more time.

The biggest problem is with NUL characters, which many servers don't
handle, including all versions of INN.  CRLF issues are secondary to that.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: [yEnc] some newbie questions
#56916
Author: J.B. Moreno
Date: Tue, 26 Feb 2002 00:04
31 lines
2639 bytes
In article <yln0xxb4bw.fsf@windlord.stanford.edu>,
 Russ Allbery <rra@stanford.edu> wrote:

> Dirk Nimmich <nimmich@muenster.de> writes:
> > Curt Welch wrote:
> >> Dirk Nimmich <nimmich@muenster.de> wrote:
> 
> >>> First of all, news server have to be made binary clean. They must
> >>> be able to carry and store true binary files. That is one of the
> >>> easier problems. Some servers are already binary clean, AFAIK.
> 
> >> Most do it now, not just "some".  And if you take out the CR LF issue,
> >> the percentage is so close to "all" that its fairly safe to put binary
> >> articles on usenet already.
> 
> > I wasn't aware of this. Fine. I think I will do some tests when there is
> > more time.
> 
> The biggest problem is with NUL characters, which many servers don't
> handle, including all versions of INN.  CRLF issues are secondary to that.

Well, yes and no -- there is still a problem with CR and LF that is at
least as serious, namely that some servers will convert bare CRs and/or
LFs to CRLF pairs.

But of course the basic point is correct -- take those three characters
out of the equation and servers are binary clean.

-- 
J.B. Moreno
Re: [yEnc] some newbie questions
#56919
Author: Kjetil Torgrim Homme
Date: Tue, 26 Feb 2002 02:28
12 lines
1736 bytes
[Russ Allbery]

>   The biggest problem is with NUL characters, which many servers
>   don't handle, including all versions of INN.  CRLF issues are
>   secondary to that.

Depends on your viewpoint.  CRLF is a protocol limitation.  NUL is a
server limitation.

-- 
Kjetil T.
Re: [yEnc] some newbie questions
#56920
Author: Russ Allbery
Date: Tue, 26 Feb 2002 04:35
19 lines
2084 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> writes:
> [Russ Allbery]

>>   The biggest problem is with NUL characters, which many servers
>>   don't handle, including all versions of INN.  CRLF issues are
>>   secondary to that.

> Depends on your viewpoint.  CRLF is a protocol limitation.  NUL is a
> server limitation.

How so?  RFC 977 doesn't require that servers mangle CRLF, and the new
NNTP draft outlaws both NUL and unpaired CR or LF.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: [yEnc] some newbie questions
#56922
Author: The Archiver
Date: Tue, 26 Feb 2002 07:39
40 lines
2502 bytes
Russ Allbery <rra@stanford.edu> wrote:

>I'm sorry, I don't agree... binary transport of Usenet is *not*
>deadlocked.  It *is* however, really hard, and it's waiting on the
>completion of the RFC 977 revision before anyone is going to start on it
>since it requires an NNTP extension, which requires that we first specify
>an extension mechanism.

Here we agree to disagree.
Transporting true binaries on Usenet is impossible without
changes in the message-format _and_ the nntp-protocol.

But I agree in the sequence:
First NNTP must be extended to permit true binaries.
Then the message format can be changed to use it.

>If you want binary transport on Usenet to happen faster, the way to do
>that would be to help the NNTP draft get out faster.  

"True binary transport" was on my list last year before the discussion
about QP-lite and yEnc started. I gave it up completely.

yEnc gave me a lesson I will never forget about speed and difficulty 
of invention on Usenet.

>If you don't feel like
>you can contribute to the current NNTP work, you could alternately start
>an implementation of that and see what you run into and have an extension
>design ready when the extension mechanism is ready.

Before I'm going to invest time and effort into the next direction 
I would like to be sure that it matches the "global future plan" 
for Binary Usenet.

Did someone already write a "roadmap 2010" ?

-- 
Juergen

Re: [yEnc] some newbie questions
#56928
Author: Kjetil Torgrim Homme
Date: Tue, 26 Feb 2002 19:01
16 lines
2094 bytes
[Russ Allbery]

>   Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> writes:
>   > Depends on your viewpoint.  CRLF is a protocol limitation.  NUL is a
>   > server limitation.
>   
>   How so?  RFC 977 doesn't require that servers mangle CRLF, and the
>   new NNTP draft outlaws both NUL and unpaired CR or LF.

How do you propose to send a single CR?  There is a problem due to the
limited line length of NNTP.  There is no question how NUL should be
sent, even if it is outlawed for practical reasons.

-- 
Kjetil T.
Re: [yEnc] some newbie questions
#56929
Author: Russ Allbery
Date: Tue, 26 Feb 2002 19:18
30 lines
2583 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> writes:
> [Russ Allbery]

>>   How so?  RFC 977 doesn't require that servers mangle CRLF, and the
>>   new NNTP draft outlaws both NUL and unpaired CR or LF.

> How do you propose to send a single CR?

As a single CR.

> There is a problem due to the limited line length of NNTP.

Where does NNTP set a line length limit?

The only problem that I'm aware of in RFC 977 as written with sending
binaries is that you're required to add a CRLF . CRLF to the end of the
article and the last CRLF is specified as being part of the article.  So
you have to have some provision such that that trailing CRLF doesn't
mangle the article.  Other than that, I don't see anything in RFC 977
inconsistent with binary articles.

For the purposes of RFC 977, a binary is (not necessarily but highly
likely to be) a single long line.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: [yEnc] some newbie questions
#56930
Author: Liyang Hu
Date: Tue, 26 Feb 2002 19:51
18 lines
1873 bytes
=-lordsnow-= <lordsnow@home.nl> wrote:
>> Without using arithmetic coding, isn't a uniform distribution the
>> best we can hope to get? (and just cope with having to escape the
>> three special cases?)
> Is having a uniform distribution better than making use of the
> skew tho? It all depends if, on average, the totals of Byte0 +
> Byte10 + Byte13 after arithmetic coding is less than the 'normal'?

After arithmetic coding, the number of \000, \012 and \016 bytes
will add up to zero.

/Liyang
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| C makes it easy for you to shoot yourself in the foot.                 |
| C++ makes that harder, but when you do, it blows away your whole leg.  |
|                                                   -- Bjarne Stroustrup |
Re: [yEnc] some newbie questions
#56931
Author: Curt Welch
Date: Tue, 26 Feb 2002 20:21
40 lines
3222 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:
> =-lordsnow-= <lordsnow@home.nl> wrote:
> >> Without using arithmetic coding, isn't a uniform distribution the
> >> best we can hope to get? (and just cope with having to escape the
> >> three special cases?)
> > Is having a uniform distribution better than making use of the
> > skew tho? It all depends if, on average, the totals of Byte0 +
> > Byte10 + Byte13 after arithmetic coding is less than the 'normal'?
>
> After arithmetic coding, the number of \000, \012 and \016 bytes
> will add up to zero.

But if the skew before encoding meant it had none of those bytes to begin
with, then there will be no expansion using escape characters, but with
arithmetic coding, there will always be a fixed expansion.

So the question becomes, instead of using artihmetic coding to flaten the
skew (at the cost of expansion) might it be better to use some of the skew
already in the data?

However, that argument (which I've made before here) is not so valid once
it was pointed out my math was wrong and it became clear that the expected
expansion of arithmetic coding (+.55 chars per 256 when using Base253) is
normally a lot less than the expected expansion from yEnc (+3 per 256).

If arithmetic coding can be done effecently for this problem (as rumor has
it), then it would clearly be better in terms of both reducing the expected
expansion, and eliminating the problems caused by worse-case date.

However, because we already are forced to add CR LF to keep lines a
reasonable length every few hundred characters (we are forced to do that
aren't we?), then the savings is is more like 5 to 2.5 chars per 256(line).
So it might cut the overhead down by another 50% from where it is now.  But
it's so low now as to make the change questionable - but worth looking into
if you do create any type of yEnc II standard.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56932
Author: J.B. Moreno
Date: Tue, 26 Feb 2002 20:46
22 lines
2036 bytes
In article <20020226152108.753$EN@newsreader.com>,
 Curt Welch <curt@kcwc.com> wrote:

> However, because we already are forced to add CR LF to keep lines a
> reasonable length every few hundred characters (we are forced to do that
> aren't we?),

I think we are for all practical purposes, whether or not it's called
for by any standard.

> then the savings is is more like 5 to 2.5 chars per 256(line). So it
> might cut the overhead down by another 50% from where it is now.  But
> it's so low now as to make the change questionable - but worth
> looking into if you do create any type of yEnc II standard.

And the overhead for yEnc could be reduced by nearly 50% by using a
longer line length -- it's currently using 128, but 996 would work just
as well.

-- 
J.B. Moreno
Re: [yEnc] some newbie questions
#56934
Author: Curt Welch
Date: Tue, 26 Feb 2002 21:37
33 lines
2786 bytes
"J.B. Moreno" <planb@newsreaders.com> wrote:
> In article <20020226152108.753$EN@newsreader.com>,
>  Curt Welch <curt@kcwc.com> wrote:

> > then the savings is is more like 5 to 2.5 chars per 256(line). So it
> > might cut the overhead down by another 50% from where it is now.  But
> > it's so low now as to make the change questionable - but worth
> > looking into if you do create any type of yEnc II standard.
>
> And the overhead for yEnc could be reduced by nearly 50% by using a
> longer line length -- it's currently using 128, but 996 would work just
> as well.

Ah, if 128 is the default, then the current overhead is more like 7 (4+3)
characters per 256 and switching to arithmetic coding would bring it down
to 4.5 (4 + .5) to 256, which is a 36% reduction in an overhead which isn't
very high to begin with.

If we could justify throwing out the CR LFs, then switching to arithmetic
coding would be a big win if the altogrithm was fast.

Has anyone done many tests with long lines?  How many news servers have
problems with that?  It seems to me that most servers that are 8 bit
clean also have removed the line length restrictions (in the body).

But I guess we also have newsreaders to consider which might not be
able to save the body of an article with long lines and others which
might even crash just trying to display such a beast...

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56937
Author: Curt Welch
Date: Wed, 27 Feb 2002 00:01
53 lines
3890 bytes
Liyang Hu <newsgroups@nerv.cx> wrote:
> Curt Welch <curt@kcwc.com> wrote:
> > > [snip stupid reference to O notation -- brain wasn't switched on]
>
> > And that's not true base 251 encoding.  It's just a close fit to
> > allow the algorithm to remain O(N).  If you wanted true base 251
> > encoding you would have to treat the entire input file as one huge
> > binary numbers and the problem would become O(N^2).
>
> No, you don't need to do that. Google for `Arithmetic Coding', and
> ignore any references to statistical modelling.

Ok, I've read a few links and understand it now. (Always good to learn
something new) For this application, we would have to actually do it
backwards.  To encode the binary file, we would have to to Aritimetic
de-coding.  And for decoding the article, we would have to use Arithmetic
coding.  Dealing with the last byte or so when doing the encoding would
have to be special cased.

And yes, even though it's a heavy bit-shifting type of encoding, it
would probably be very workable speed-wise.

> Hence why I was saying it had not been implemented correctly!

I think it's questionable whether that would have been the right way to do
it anyway.

Yes, Arithmetic Coding is optimal, but it makes the algorithm too complex
to expect most newsreader authors to re-implement it correctly from a spec.
So you have to give them the code - which is fine of course - but then you
are going to have performance and porting issues to face.  And the
complexity of having to use a magic "block box" of code is going to turn
some people off to the idea.

And, if you want to give the encoder the option of adding extra characters
to the exclusion set, you have to add more complex paramaters to the meta
data so the encoder can pass that information along to the decoder.

> > Maybe there is a way to do that quicker, but I don't know what it
> > is.  Feel free to code it and let us do a few timing tests on it
> > and see how significant it is or it isn't.
>
> Working on it.

No need unless you want to do just to find the answer as too how fast it
will be.  I wouldn't mind know the answer to that.  I'm guessing it will be
within an order of magnatude of the yEnc speed and that would be fast
enough.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56938
Author: The Archiver
Date: Wed, 27 Feb 2002 07:10
21 lines
2292 bytes
curt@kcwc.com (Curt Welch) wrote:

>And yes, even though it's a heavy bit-shifting type of encoding, it
>would probably be very workable speed-wise.
>[...]
>Yes, Arithmetic Coding is optimal, but it makes the algorithm too complex
>to expect most newsreader authors to re-implement it correctly from a spec.
>So you have to give them the code - which is fine of course - but then you
>are going to have performance and porting issues to face.  And the
>complexity of having to use a magic "block box" of code is going to turn
>some people off to the idea.

Just for completeness:
Whoever wants to write such code should be aware of the fact that
64 bit CPUs are also used. So the "bit-shifting" should be done
with properly platform independent "typedef" variables.

-- 
Juergen

Re: [yEnc] some newbie questions
#56939
Author: Nuutti Kotivuori
Date: Wed, 27 Feb 2002 07:52
67 lines
4599 bytes
Curt Welch wrote:
> Ok, I've read a few links and understand it now. (Always good to
> learn something new) For this application, we would have to actually
> do it backwards.  To encode the binary file, we would have to to
> Aritimetic de-coding.  And for decoding the article, we would have
> to use Arithmetic coding.  Dealing with the last byte or so when
> doing the encoding would have to be special cased.

Not necessarily - we can also do a few math operations with base224
bytes. But the implementation is irrelevant.

> And yes, even though it's a heavy bit-shifting type of encoding, it
> would probably be very workable speed-wise.

> I think it's questionable whether that would have been the right way
> to do it anyway.
> 
> Yes, Arithmetic Coding is optimal, but it makes the algorithm too
> complex to expect most newsreader authors to re-implement it
> correctly from a spec.  So you have to give them the code - which is
> fine of course - but then you are going to have performance and
> porting issues to face.  And the complexity of having to use a magic
> "block box" of code is going to turn some people off to the idea.

Eh? You read the algorithm and understood it? Would really newsreader
authors be unable to do it? Jesus, arithmetic coding is what makes
this whole thing easily hand written from pseudocode in 5 minutes. In
my opinion, it's handwritten from pseudocode even if it contains an
adaptive model. If the encoding contains compression, then it won't be
hand written (though it is no black box either considering the
availability of the compression algorithm).

The thing is, understanding arithmetic coding might not happen in 2
minutes from the newsreader authors. But understanding is not
required. A simple pseudocode of "add this to this" is quite enough
for writing the algorithm.

Though ofcourse this is only my opinion.

> And, if you want to give the encoder the option of adding extra
> characters to the exclusion set, you have to add more complex
> paramaters to the meta data so the encoder can pass that information
> along to the decoder.

You are correct, adding characters to the exclusion set requires the
receiving end to know exactly the same exclusion set. Additional
excluded bytes would have to be added to the metadata.

However, I do not think that we should even have the possibility of
adding more characters to the exclusion set so easily. yEnc is
yEnc. It specifies an encoding suitable for usenet. If we need
additional excluded characters, we can make yEnc-for-MIME - or
something.

In my opinion, being flexible is good, but the encoded form produced
by an encoder should be exactly equal to the encoded form produced by
another encoder. Decoding should be possible without the metadata. All
encoded files should behave the same - so no "oh this file can't be
transmitted here because it has less excludes that allowed for 0.05
improvement in filesize".

We are past proof of concept already - let's just make one version
which works.

-- Naked

Re: [yEnc] some newbie questions
#56940
Author: Nuutti Kotivuori
Date: Wed, 27 Feb 2002 08:05
41 lines
3072 bytes
Curt Welch wrote:
> Liyang Hu <newsgroups@nerv.cx> wrote:
>> After arithmetic coding, the number of \000, \012 and \016 bytes
>> will add up to zero.
> 
> But if the skew before encoding meant it had none of those bytes to
> begin with, then there will be no expansion using escape characters,
> but with arithmetic coding, there will always be a fixed expansion.
> 
> So the question becomes, instead of using artihmetic coding to
> flaten the skew (at the cost of expansion) might it be better to use
> some of the skew already in the data?

Actually, you assume that we do the arithmetic coding with a flat
1/251 table of probabilities. Then what you say will be true.

But if we, for example, use adaptive coding, the table will shape
itself to respect the actual distribution of bytes in the input
data. When decoding, we start with the original table and let it adapt
exactly the same way as it did on encoding. This ofcourse means that
in the beginning, we might lose a bit because the table is
non-optimal, but those losses will come back fast.

Doing this is not ofcourse as trivial as arithmetic coding normally
is, but still quite easily hand written. But ofcourse this is already
the realm of compression.

So what I was trying to say is that arithmetic encoding encodes the
symbols with the optimal number of bits if we have an exact
probability table for the appearance of the different characters in
the stream. This table can either be generated by scanning the data
first and then prepending it to the message - or by using adaptive
coding.

But all in all - the discussion is academic - the gains gained from
optimally encoding the few files that happen to have a lot of zero
bytes are not worth the added complexity.

-- Naked

Re: [yEnc] some newbie questions
#56947
Author: Curt Welch
Date: Wed, 27 Feb 2002 18:57
105 lines
6243 bytes
Nuutti Kotivuori <naked@iki.fi> wrote:
> Curt Welch wrote:

> > I think it's questionable whether that would have been the right way
> > to do it anyway.
> >
> > Yes, Arithmetic Coding is optimal, but it makes the algorithm too
> > complex to expect most newsreader authors to re-implement it
> > correctly from a spec.  So you have to give them the code - which is
> > fine of course - but then you are going to have performance and
> > porting issues to face.  And the complexity of having to use a magic
> > "block box" of code is going to turn some people off to the idea.
>
> Eh? You read the algorithm and understood it? Would really newsreader
> authors be unable to do it?

They are dumb you know.

Speaking of which, I've now gotten enought "what's this yenc stuff and why
can't I read the files" questions that I'm going to be forced to add it to
my code now.

> Jesus, arithmetic coding is what makes
> this whole thing easily hand written from pseudocode in 5 minutes.

Yeah, but it only takes 2 minutes without it.

There is such a thing as an algorithm that is simple to understand but
very hard to code correctly.  Quick sort is the example that comes to mind.
I remember talk of a study once which collected as many published examples
of the quick sort algorthm they could find and some huge percentage, as
published, were wrong.  They had a least one bug in the code.  Some were
only pseudo code versions, but some were also real code which ran and
seemed to work, but which, none the less, had bugs.  Some algorthms are
simple, but yet have some special cases which you have to get right before
it will be correct in all cases.  quick-sort is clearly one of these
algorithms.

I haven't tried to code the arithmetic coding algorithm, so I don't have
any real experence with that.  But from what I read, it sure looked
like another quicksort problem.  It's structure is very similar to
quick-sort in an abstract way and it has special cases for almost the
same reason as quick sort has.

The real-number definition of the algortham is trivial.  But when you map
that to fixed length intergers, it generates special cases.  The underflow
problem for example.  To guarantee the precision of the math stays within
the precision of your numbers, you have to deal with the underflow problem
by simulating a number which is much larger than the precision of the
intergers you are working with.  If you get that wrong with a simple
mistake like a > instead of a >=, the code may "seem" to work fine but
yet will fail when given just the right input stream to code.

That sure looks just like the quick sort problem to me.  I'd be willing to
bet that MOST newsreader authors would get it wrong if they tried to code
it themself.  But, if you gave them pseudo code which was step for stop
translatable into a real language, AND, you gave then a very good
set of test data to test the special cases correctly, then I'd say
there would be a good chance of most getting it right.   But the best
way to do that is give them real code in a common language like C
and let them translate that to other languages if need be.

> The thing is, understanding arithmetic coding might not happen in 2
> minutes from the newsreader authors. But understanding is not
> required. A simple pseudocode of "add this to this" is quite enough
> for writing the algorithm.

Maybe.  But like quicksort, I think the odds of that being "easy" is
less than you think.  All the authors that published broken versions
of the quick-sort algorthm though just like you are doing now.

> Though ofcourse this is only my opinion.

No one is allowed to have their own opinion here.  Only my opinions may
be used in this group. :)

> In my opinion, being flexible is good, but the encoded form produced
> by an encoder should be exactly equal to the encoded form produced by
> another encoder.

Flexibility to change is normally seen as more important that consistency.
Even more so on Usenet.

> All
> encoded files should behave the same - so no "oh this file can't be
> transmitted here because it has less excludes that allowed for 0.05
> improvement in filesize".

No one is doing that with yEnc now are they?

> We are past proof of concept already - let's just make one version
> which works.

Are there problems with the current version not working?  I wasn't aware
of that.  I thought we were just talking about ways to make life hard
for everyone by "improving" it.

> -- Naked

-- Dressed

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56948
Author: Curt Welch
Date: Wed, 27 Feb 2002 19:07
40 lines
2970 bytes
Nuutti Kotivuori <naked@iki.fi> wrote:
> Curt Welch wrote:
> > Liyang Hu <newsgroups@nerv.cx> wrote:
> >> After arithmetic coding, the number of \000, \012 and \016 bytes
> >> will add up to zero.
> >
> > But if the skew before encoding meant it had none of those bytes to
> > begin with, then there will be no expansion using escape characters,
> > but with arithmetic coding, there will always be a fixed expansion.
> >
> > So the question becomes, instead of using artihmetic coding to
> > flaten the skew (at the cost of expansion) might it be better to use
> > some of the skew already in the data?
>
> Actually, you assume that we do the arithmetic coding with a flat
> 1/251 table of probabilities. Then what you say will be true.

Yes.

> But if we, for example, use adaptive coding, the table will shape
> itself to respect the actual distribution of bytes in the input
> data.

No.  At least I don't see how to do that. Maybe you can teach me something
else new?

Remeber, to use arithmetic encoding to solve the binary to base251
translation problem, we have to use the arithmetic DEcoding algorithm to do
our ENcoding work.  I don't see how you can use the skew in the binary data
to any advantage when going in that direction.  The only option I see is to
simply make one pass over the data with any compression algorithm (of which
adaptive coding would be a poor choice), and then use arithmetic coding to
convert from binary to baseX.

Do you see what I'm saying?

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Page 2 of 3 • 110 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads