Article View: news.software.nntp
Article #56947Re: [yEnc] some newbie questions
From: Curt Welch
Date: Wed, 27 Feb 2002 18:57
Date: Wed, 27 Feb 2002 18:57
105 lines
6243 bytes
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/
Technical Details
Message-ID:
<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!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed2.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <yleljh722r.fsf@windlord.stanford.edu> <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>Show Full Headers
Complete Article Headers
Message-ID: <20020227135723.611$Sy@newsreader.com>
Subject: Re: [yEnc] some newbie questions
Date: Wed, 27 Feb 2002 18:57:23 +0000
From: curt@kcwc.com (Curt Welch)
References: <a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <yleljh722r.fsf@windlord.stanford.edu> <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>
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!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed2.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com RXdAz19=Ztfqy35KLisRwddRa/LLd9+-Zw_XO5DCFl+Te_PsM
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
%IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 104