Article View: news.software.nntp
Article #56955Re: [yEnc] some newbie questions
From: Nuutti Kotivuori
Date: Wed, 27 Feb 2002 20:37
Date: Wed, 27 Feb 2002 20:37
139 lines
7478 bytes
7478 bytes
Curt Welch wrote: > Nuutti Kotivuori <naked@iki.fi> wrote: >> Curt Welch wrote: > They are dumb you know. Ah well, maybe you know better. > 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. My friends are bitching that just when they are getting some groups to accept yEnc stuff, another version is coming out. And then they talk about revering back to uuencode until it's stabilized :) >> 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. Well, true. > There is such a thing as an algorithm that is simple to understand > but very hard to code correctly. True. [...] > 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. Well, there's room for error everywhere. Good test streams that try to spark errors in encoders and decoders would be a must. I think they would be a must with any type of encoder. But agreed, arithmetic coding has more room for errors than a simple escaping has. But on the other hand, I think that arithmetic coding has less room for exploits and crashers due to illegal escaping and other malicious things. Maybe I don't just see it from the common coders perspective. I did get quick sort right the first time so maybe I shouldn't talk about how other people should be able to do it as well. >> 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. Well I think the quick sort algorithm is more complex than this is. And I do think that broken encoders and decoders would be caught pretty fast, unless there is exactly one implementation of both used at all. >> 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. :) Well so it seems. >> 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. Well flexibility is a good goal if everyone is required to implement the full feature set. If there is room to make shortcuts, people will usually make them and in the end, create incompatible versions of the same specification. >> 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? I just meant that for example if '-' is allowed as an additional escape. Then some posts possibly have that as an escape and some don't. If that is escaped, then the file will most likely transfer cleanly over MIME - if not, then problems might occur. This is just a hypothesis, but I still think that the encoding should be as strict as possible. Every flexibility adds more testcases to test for in the implementation both the encoder and the decoder. And we don't want implementations that are not tested for all possible combinations out there, do we? ;) >> 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. Oh I did not mean to say that the original version would not work. It works - as in, it gets the job done. What I meant was that let's just make one version of yEnc, that is well-defined and optimal, given the circumstances - and then make sure that that works in all the possible cases. In actuality, I don't even know if yEnc should be changed in itself - sure, it's not how I would've done it, but it's one solution - just that it is specified down to the last gritty detail about character sets and header fields and everything. -- Naked
Technical Details
Message-ID:
<877koy3blw.fsf@iki.fi>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!news.stealth.net!news.cc.tut.fi!uutiset.saunalahti.fi!localhostReferences:
<04477.k22202@archiver.winews.net> <a500oj$736$1@pegasus.csx.cam.ac.uk> <Xns91BC3666AD674JanC@213.119.4.20> <3C74D21B.F49E2F9F@proxad.net> <210220021418431479%planb@newsreaders.com> <a540dn$7i4$7@pegasus.csx.cam.ac.uk> <210220022120391303%planb@newsreaders.com> <a57u73$86r$2@pegasus.csx.cam.ac.uk> <20020223135211.154$cg@newsreader.com> <a59hgh$pk0$2@pegasus.csx.cam.ac.uk> <20020226190106.351$w9@newsreader.com> <87n0xv2wgp.fsf@iki.fi> <20020227135723.611$Sy@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <877koy3blw.fsf@iki.fi> Subject: Re: [yEnc] some newbie questions Date: Wed, 27 Feb 2002 22:37:15 +0200 From: Nuutti Kotivuori <naked@iki.fi> References: <04477.k22202@archiver.winews.net> <a500oj$736$1@pegasus.csx.cam.ac.uk> <Xns91BC3666AD674JanC@213.119.4.20> <3C74D21B.F49E2F9F@proxad.net> <210220021418431479%planb@newsreaders.com> <a540dn$7i4$7@pegasus.csx.cam.ac.uk> <210220022120391303%planb@newsreaders.com> <a57u73$86r$2@pegasus.csx.cam.ac.uk> <20020223135211.154$cg@newsreader.com> <a59hgh$pk0$2@pegasus.csx.cam.ac.uk> <20020226190106.351$w9@newsreader.com> <87n0xv2wgp.fsf@iki.fi> <20020227135723.611$Sy@newsreader.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!news.stealth.net!news.cc.tut.fi!uutiset.saunalahti.fi!localhost Newsgroups: news.software.nntp Organization: SAUNALAHDEN asiakas Lines: 138 NNTP-Posting-Host: cs183115.pp.htv.fi Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: tron.sci.fi 1014842263 6360 213.243.183.115 (27 Feb 2002 20:37:43 GMT) X-Complaints-To: newsmaster@saunalahti.fi NNTP-Posting-Date: 27 Feb 2002 20:37:43 GMT User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux) Cancel-Lock: sha1:XW8HiWO3XYvCvzmC1ha1Xfp+fRk=