<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: asc-gzip/.xfd compression</title>
	<atom:link href="http://www.ourada.org/blog/archives/375/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ourada.org/blog/archives/375</link>
	<description></description>
	<lastBuildDate>Wed, 26 May 2010 20:30:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Steven&#8217;s weblog &#187; asc-gzip/.xfd decompression</title>
		<link>http://www.ourada.org/blog/archives/375/comment-page-1#comment-25712</link>
		<dc:creator>Steven&#8217;s weblog &#187; asc-gzip/.xfd decompression</dc:creator>
		<pubDate>Thu, 10 Dec 2009 17:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.ourada.org/blog/?p=375#comment-25712</guid>
		<description>[...] to post code for asc-gzip/.xfd decompression to go with my asc-gzip/.xfd compression code. See this comment. I&#8217;m also reposting it here because the comment formatting is a little more bad than the [...]</description>
		<content:encoded><![CDATA[<p>[...] to post code for asc-gzip/.xfd decompression to go with my asc-gzip/.xfd compression code. See this comment. I&#8217;m also reposting it here because the comment formatting is a little more bad than the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Stafford</title>
		<link>http://www.ourada.org/blog/archives/375/comment-page-1#comment-25711</link>
		<dc:creator>Scott Stafford</dc:creator>
		<pubDate>Thu, 10 Dec 2009 17:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.ourada.org/blog/?p=375#comment-25711</guid>
		<description>Thanks for your post.  Of course, I needed the opposite, I had one I needed to decompress.  So I backwarded your algorithm and here is the result:

&lt;pre&gt;
def decompress(fc):
    fc2 = fc.splitlines(True)
    fc3 = &quot;&quot;.join(fc2[1:]) # could verify that it&#039;s asc-gzip here if we wanted to...
    unb64 = base64.standard_b64decode(fc3)
    
    ctr = 0
    ret = []
    while 1:
        if ctr == len(unb64): break
        
        ccltop = ord(unb64[ctr])
        ctr += 1
        cclbottom = ord(unb64[ctr])
        ctr += 1
        compressedchunklen = ccltop * 256 + cclbottom
        
        cltop = ord(unb64[ctr])
        ctr += 1
        clbottom = ord(unb64[ctr])
        ctr += 1
        chunklen = cltop * 256 + clbottom
        #~ print compressedchunklen, chunklen
        
        compressedchunk = unb64[ctr:ctr+compressedchunklen]
        ctr += compressedchunklen
        
        chunk = zlib.decompress(compressedchunk)
        assert(len(chunk) ==  chunklen)
        ret.append(chunk)
    
    return &quot;&quot;.join(ret)
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for your post.  Of course, I needed the opposite, I had one I needed to decompress.  So I backwarded your algorithm and here is the result:</p>
<pre>
def decompress(fc):
    fc2 = fc.splitlines(True)
    fc3 = "".join(fc2[1:]) # could verify that it's asc-gzip here if we wanted to...
    unb64 = base64.standard_b64decode(fc3)

    ctr = 0
    ret = []
    while 1:
        if ctr == len(unb64): break

        ccltop = ord(unb64[ctr])
        ctr += 1
        cclbottom = ord(unb64[ctr])
        ctr += 1
        compressedchunklen = ccltop * 256 + cclbottom

        cltop = ord(unb64[ctr])
        ctr += 1
        clbottom = ord(unb64[ctr])
        ctr += 1
        chunklen = cltop * 256 + clbottom
        #~ print compressedchunklen, chunklen

        compressedchunk = unb64[ctr:ctr+compressedchunklen]
        ctr += compressedchunklen

        chunk = zlib.decompress(compressedchunk)
        assert(len(chunk) ==  chunklen)
        ret.append(chunk)

    return "".join(ret)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: anna</title>
		<link>http://www.ourada.org/blog/archives/375/comment-page-1#comment-25551</link>
		<dc:creator>anna</dc:creator>
		<pubDate>Wed, 21 Oct 2009 18:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.ourada.org/blog/?p=375#comment-25551</guid>
		<description>ahhh, code beautiful code!  Remember the night I &quot;watched you write code&quot;?  OO</description>
		<content:encoded><![CDATA[<p>ahhh, code beautiful code!  Remember the night I &#8220;watched you write code&#8221;?  OO</p>
]]></content:encoded>
	</item>
</channel>
</rss>
