Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22488

Re: Compressing js file?

From emf <emfril@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Compressing js file?
Date 2013-12-29 21:47 -0500
Organization Aioe.org NNTP Server
Message-ID <l9qms1$3oc$1@speranza.aioe.org> (permalink)
References (2 earlier) <l9lmri$4kp$1@speranza.aioe.org> <XnsA2A472386F7ECeejj99@194.109.133.133> <l9mu33$v8d$1@speranza.aioe.org> <l9n6np$kh3$1@speranza.aioe.org> <XnsA2A4D5AEECAAEeejj99@194.109.133.133>

Show all headers | View raw


On 2013-12-28 15:00 Evertjan. wrote:
> emf <emfril@gmail.com> wrote on 28 dec 2013 in comp.lang.javascript:
>
>> Sorry for mu rush reply. I replied before thinking about it. Of course,
>> with a 36 base system the planetary positions can be expressed with a 3
>> digit string. So
>>
>> [19000101,"27i43","10i08"],.
>>
>> can become
>>
>> ["xyz","syz"],
>>
>> which is 50$ smaller, or
>>
>> xyz,xyz.
>>
>> which is only 8 characters compared to 27, that's less than 33% of the
>> cs file.
>>
>> I hadn't thought that this is what compression does. I'll come back to
>> this when I solve the double clicking problem.
>
> 369 * 60 = 21600
> 2 ^ 15 = 32768
> So you can express your postion easily with 15 bits.
> 2 8-bit-bytes is 16 bits.
>
> So if you use a binary type file, without "defined" characters,
> you would only need 2 bytes/characters per position.
>
> You can construct a line of those 2-byte-positions
> where the first bit of the 16 is always a 0,
> with a occasional [say one in 16?] synchronizing 2-byte
> being at the same time a numbered pointer,
> with the top bit a 1.

All these messages on compression I've been reading are interesting and 
terra incognita yet for me, but let me update you to the point I have 
reached so far.

I have updated

https://files.nyu.edu/emf202/public/nt/nataltransits.html

so that it now uses

https://files.nyu.edu/emf202/public/nt/ephemeris.csv

which contains on each line only the 2 planetary positions:

27i43	10i08
...

Instead of the loop to find the correct line, I calculate directly the 
index of the array, which is actually a cleaner way to go after it.

(Note for other poster: the letters represent the signs of the zodiac in 
ASCII characters. For example 27i43 means 27° ♐ 43', and hence they can 
be changed to minutes from the beginning of the zodiac. I have no idea 
how they could be calculated, since sometimes the planets appear to 
retrograde, that is they seem to move backwards on the celestial sphere.)

The programs runs OK (I am still testing locally at this stage) except 
for the original double-click, which I suppose nobody is exactly sure 
why it is necessary. The size of the csv file is 696 KB (remember that 
my original js was 1606 KB) and hence less than the total jar of the 
Java program. Of course the Java program could calculate the transits of 
5 planets, but of these only 2 are actually important for my current 
purposes, and besides with the the JavaScript program I am able to use 
Unicode symbols, something that was problematic in Java and I had 
avoided it.

Now, using my 7zip I've made a gz file of the csv and it is only 153 KB:

https://files.nyu.edu/emf202/public/nt/ephemeris.csv.gz

153 KB would be great. But how do I access the csv inside the gz?

Thanks,

Eustace

-- 
Natal Transits Calculator
https://files.nyu.edu/emf202/public/nt/nataltransits.html

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Compressing js file? emf <emfril@gmail.com> - 2013-12-23 14:31 -0500
  Re: Compressing js file? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-12-23 22:08 -0200
  Re: Compressing js file? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-12-23 16:40 -0800
    Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-24 13:23 -0500
    Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-26 21:56 -0500
      Re: Compressing js file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-27 09:52 +0100
        Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-27 08:18 -0500
          Re: Compressing js file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-27 16:59 +0100
            Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-27 15:32 -0500
              Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-28 15:12 -0500
                Re: Compressing js file? emf <emfril@gmail.com> - 2014-01-01 02:17 -0500
        Re: Compressing js file? Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-12-28 20:20 +0000
      XHR with timing issues (was: Compressing js file?) Christoph Michael Becker <cmbecker69@arcor.de> - 2013-12-27 22:33 +0100
        Re: XHR with timing issues (was: Compressing js file?) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-27 23:26 +0100
          Re: XHR with timing issues Christoph Michael Becker <cmbecker69@arcor.de> - 2013-12-28 12:08 +0100
            Re: XHR with timing issues emf <emfril@gmail.com> - 2013-12-28 09:04 -0500
  Re: Compressing js file? wolfgang zeidler <invalid@invalid.invalid> - 2013-12-27 22:33 +0100
    Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-28 00:16 -0500
      Re: Compressing js file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-28 11:13 +0100
        Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-28 11:26 -0500
          Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-28 13:53 -0500
            Re: Compressing js file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-28 21:00 +0100
              Re: Compressing js file? emf <emfril@gmail.com> - 2013-12-29 21:47 -0500
                Re: Compressing js file? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-12-31 14:05 -0800
                Re: Compressing js file? emf <emfril@gmail.com> - 2014-01-01 02:50 -0500
                Re: Compressing js file? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-01-01 01:16 -0800
                Re: Compressing js file? emf <emfril@gmail.com> - 2014-01-01 08:13 -0500
                Re: Compressing js file? Tim Streater <timstreater@greenbee.net> - 2014-01-01 14:17 +0000
                Re: Compressing js file? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-01-01 15:31 -0800
                Re: Compressing js file? emf <emfril@gmail.com> - 2014-01-01 18:38 -0500
                Re: Compressing js file? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-01-01 15:45 -0800
                Re: Compressing js file? emf <emfril@gmail.com> - 2014-01-02 11:43 -0500
                Re: Compressing js file? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-01-02 09:34 -0800
                OT: Compressing js file? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-02 19:52 +0100
                Re: Compressing js file? emf <emfril@gmail.com> - 2014-01-03 07:19 -0500
                Re: Compressing js file? emf <emfril@gmail.com> - 2014-01-03 07:31 -0500
                Re: Compressing js file? Tim Streater <timstreater@greenbee.net> - 2014-01-02 09:14 +0000
                Re: Compressing js file? Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-01 16:25 +0000
                Re: Compressing js file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-01 21:36 +0100
          Re: Compressing js file? wolfgang zeidler <invalid@invalid.invalid> - 2013-12-29 20:06 +0100
            Re: Compressing js file? wolfgang zeidler <invalid@invalid.invalid> - 2013-12-29 20:27 +0100
        Re: Compressing js file? Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-12-29 18:02 +0000
          Re: Compressing js file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-30 18:17 +0100
            Re: Compressing js file? John Harris <niam@jghnorth.org.uk.invalid> - 2013-12-31 10:52 +0000
            Re: Compressing js file? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-12-31 13:38 +0000
              Re: Compressing js file? John Harris <niam@jghnorth.org.uk.invalid> - 2013-12-31 15:02 +0000
                Re: Compressing js file? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-01-01 16:42 +0000
                Re: Compressing js file? Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-01-01 21:32 +0000
            Re: Compressing js file? Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-12-31 21:44 +0000

csiph-web