Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #22375 > unrolled thread
| Started by | emf <emfril@gmail.com> |
|---|---|
| First post | 2013-12-23 14:31 -0500 |
| Last post | 2013-12-31 21:44 +0000 |
| Articles | 9 on this page of 49 — 13 participants |
Back to article view | Back to comp.lang.javascript
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
Page 3 of 3 — ← Prev page 1 2 [3]
| From | wolfgang zeidler <invalid@invalid.invalid> |
|---|---|
| Date | 2013-12-29 20:27 +0100 |
| Message-ID | <l9pt35$m3b$1@news.m-online.net> |
| In reply to | #22477 |
wolfgang zeidler wrote:
> [...]
> Storing the differences inside table ephem for 5 planets:
> - you can use an integer with 6 bits for every planet
> 32 values = range 0 .. 31 or e.g. -10 .. 21
> - you can follow the advice of Evertjan using 36-based numbers
> and store the values of 5 planets in a five char string
> 36 values = range 0 .. 36 or e.g. -10 .. 26
> - if this range isn't enough you may write your own
> n_based_digit-function with e.g. ...
> ... n ~ 90 // printables of ascii-7
> ... n ~ 190 // printables of latin-1
>
[...]
As an example a simple and - I hope so - fast example
for digits in the range from -26 to +26:
<html><head><title>test: pm_26</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
function pm_26 ( c ) {
var v = c.charCodeAt ( 0 )
return ( v & 0x20 ) ? ( v & 0x1F ) : - ( v & 0x1F )
}
function test () {
var s = '@abcdefghijklmnopqrstuvwxyz'
var d = document.getElementById ( 'left' )
d.innerHTML = test_res ( s )
d = document.getElementById ( 'right' )
d.innerHTML = test_res ( s.toUpperCase () )
}
function test_res ( s ) {
var a = []
for ( var i = 0 ; i < s.length ; i++ ) {
var c = s.charAt ( i )
a.push ( c + ' → ' + pm_26 ( c ) )
}
return a.join ( '<br>' )
}
</script>
<style type="text/css">
* { font-family:"Courier New",Courier,monospace; }
</style>
</head><body onLoad="test()">
<table><tr><td>
<span id="left"></span>
</td><td> </td><td>
<span id="right"></span>
</td></tr></table>
</body></html>
--
http://wzwz.de/mail
---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
http://www.avast.com
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> |
|---|---|
| Date | 2013-12-29 18:02 +0000 |
| Message-ID | <MC8FLdVDPGwSFwyU@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #22446 |
In comp.lang.javascript message <XnsA2A472386F7ECeejj99@194.109.133.133>
, Sat, 28 Dec 2013 11:13:41, Evertjan. <exxjxw.hannivoort@inter.nl.net>
posted:
>While I do not see much use in compression,
>integer math is fun,
>so if you want it, try to compress/decompress to/from base 36,
>using the functions Javascript has in store,
>toString() and parseInt():
Historically, routines to uncommon bases have not been safe - though
that may have only been the case for non-integer number-to-string.
If I recall correctly, in one browser when converting non-integer to
binary there was a 50% chance of getting a final digit 2 and when to
base 36 about a 3% chance of getting probably [ otherwise { . The
details are no doubt on my Web site somewhere ... at the end of js-
randm.htm, and in js-flaws.htm#TtSR.
--
(c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2013-12-30 18:17 +0100 |
| Message-ID | <XnsA2A6B9FED2852eejj99@194.109.133.133> |
| In reply to | #22486 |
Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> wrote on 29 dec 2013 in comp.lang.javascript: > Historically, routines to uncommon bases have not been safe - though > that may have only been the case for non-integer number-to-string. Indeed, it would not be easy [very smart or very dumb?] to devise a routine that is not exact in integer mathematics for all bases that are well defined. So I suspect there will not be errors between base 2 and base 36 inclusive. However one could easily envision a base 62 encoding having 0-9a-zA-Z, but that is not trivial as 0-9A-Za-z could also a be feasable definition. What would base 1 and base 0 realy mean, btw? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | John Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2013-12-31 10:52 +0000 |
| Message-ID | <cd85c9d4ndpidfch87dubb0upqjsmntdsn@4ax.com> |
| In reply to | #22492 |
On Mon, 30 Dec 2013 18:17:02 +0100, "Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote: <snip> >What would base 1 and base 0 realy mean, btw? Base 1 : i, ii, iii, iiii, etc But not V, X, C, M, etc. Base 1 is inefficient, but does have occasional uses and not just on clocks. John
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2013-12-31 13:38 +0000 |
| Message-ID | <0.4e7ba3599ce060b3cfc5.20131231133824GMT.87txdp3zu7.fsf@bsb.me.uk> |
| In reply to | #22492 |
"Evertjan." <exxjxw.hannivoort@inter.nl.net> writes: <snip> > What would base 1 and base 0 realy mean, btw? Unary notation is usually interpreted to be a string of marks: /, //, /// or whatever. It's a bit like a base in that you can consider the various digit positions as having values of 1^0, 1^1, 1^2 and so on, but it's not really base 1. If it were, it would use the digits from zero up to one less than the base, with zero meaning "none of these" at a particular power of the base. The result would be that you can't represent any number other than zero! Even as it is usually understood, you can't represent zero by anything but the empty string, and you can't represent anything but whole numbers. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | John Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2013-12-31 15:02 +0000 |
| Message-ID | <sum5c91u159a0clslc6jkesbkae7ksd47b@4ax.com> |
| In reply to | #22494 |
On Tue, 31 Dec 2013 13:38:24 +0000, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote: >"Evertjan." <exxjxw.hannivoort@inter.nl.net> writes: ><snip> >> What would base 1 and base 0 realy mean, btw? > >Unary notation is usually interpreted to be a string of marks: /, //, >/// or whatever. It's a bit like a base in that you can consider the >various digit positions as having values of 1^0, 1^1, 1^2 and so on, but >it's not really base 1. If it were, it would use the digits from zero >up to one less than the base, with zero meaning "none of these" at a >particular power of the base. The result would be that you can't >represent any number other than zero! It's not as different as all that. You can use 000 as another way of representing 3, and so on for other numbers. >Even as it is usually understood, >you can't represent zero by anything but the empty string, If you know where the sequence starts and finishes then zero is not a problem. <000> is another way of representing 3; <> is another way of representing zero. >and you can't >represent anything but whole numbers. Binary also has problems representing anything but whole numbers. Look at the way negative numbers are represented in different computers (negative zero anyone?). Now squint at the way pi is represented. As for 1/10, there's a whole thread on that :-( John
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2014-01-01 16:42 +0000 |
| Message-ID | <0.96d469bfd97bdc3226df.20140101164258GMT.87wqij3b71.fsf@bsb.me.uk> |
| In reply to | #22495 |
John Harris <niam@jghnorth.org.uk.invalid> writes: > On Tue, 31 Dec 2013 13:38:24 +0000, Ben Bacarisse > <ben.usenet@bsb.me.uk> wrote: > >>"Evertjan." <exxjxw.hannivoort@inter.nl.net> writes: >><snip> >>> What would base 1 and base 0 realy mean, btw? >> >>Unary notation is usually interpreted to be a string of marks: /, //, >>/// or whatever. It's a bit like a base in that you can consider the >>various digit positions as having values of 1^0, 1^1, 1^2 and so on, but >>it's not really base 1. If it were, it would use the digits from zero >>up to one less than the base, with zero meaning "none of these" at a >>particular power of the base. The result would be that you can't >>represent any number other than zero! > > It's not as different as all that. You can use > 000 as another way of representing 3, and so on for other numbers. Eh? The symbol has no significance of itself but you have to ignore it's usual meaning. That's why unary is so different. The first digit used for some base (whatever symbol we use for that) means "none of this power" and the last digit means "base-1 of this power". 0 could be either the first digit of the base or the last digit of the base, but in either case it does not mean what it usually means. <snip> >>and you can't >>represent anything but whole numbers. > > Binary also has problems representing anything but whole numbers. Look > at the way negative numbers are represented in different computers > (negative zero anyone?). Now squint at the way pi is represented. As > for 1/10, there's a whole thread on that :-( Sure, but unary is different in having more problems in this regard. You can represent a wide range of rationals using, say, binary fractions, but you can't do that in any natural way with unary. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> |
|---|---|
| Date | 2014-01-01 21:32 +0000 |
| Message-ID | <9tj5wyQ5lIxSFwe2@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #22495 |
In comp.lang.javascript message <sum5c91u159a0clslc6jkesbkae7ksd47b@4ax.
com>, Tue, 31 Dec 2013 15:02:29, John Harris
<niam@jghnorth.org.uk.invalid> posted:
>Binary also has problems representing anything but whole numbers. Look
>at the way negative numbers are represented in different computers
>(negative zero anyone?).
"Negative zero everyone here", I hope. However, the local idiot savant
has appeared inadequately aware in the past (as you may recall) that the
result of parseInt() is *always* signed. Another example :
Math.trunc(-0.7) == Math.trunc(+0.7) // true
1/Math.trunc(-0.7) == 1/Math.trunc(+0.7) // false (very)
The sign of a general Number X is AFAICS best determined by considering
that of y = x + 1/x, _after_ considering isNaN(y).
Jibbering is silent.
--
(c) John Stockton, nr London UK Reply address via Merlyn Home Page.
news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>.
<http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> |
|---|---|
| Date | 2013-12-31 21:44 +0000 |
| Message-ID | <lvgfAu1yqzwSFwFO@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #22492 |
In comp.lang.javascript message <XnsA2A6B9FED2852eejj99@194.109.133.133>
, Mon, 30 Dec 2013 18:17:02, Evertjan. <exxjxw.hannivoort@inter.nl.net>
posted:
>Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> wrote on 29 dec 2013
>in comp.lang.javascript:
>
>> Historically, routines to uncommon bases have not been safe - though
>> that may have only been the case for non-integer number-to-string.
>
>Indeed, it would not be easy [very smart or very dumb?] to devise a routine
>that is not exact in integer mathematics for all bases that are well
>defined. So I suspect there will not be errors between base 2 and base 36
>inclusive.
I feel sure that Microsoft could do it wrong. Have you read my
<http://www.merlyn.demon.co.uk/vb-date2.htm#DP>? They are not alone :
in one or more other browsers, for most fractions F and some bases R,
F.toString(R) gave a string of about a thousand digits. In Google Chrome
Version 31.0.1650.63 m, using Windows XP sp3,
Math.PI.toString(7).length gives 1101
which seems unreasonable. Firefox 26.0 gives 20 .
>However one could easily envision a base 62 encoding having 0-9a-zA-Z,
>but that is not trivial as 0-9A-Za-z could also a be feasable definition.
One must distinguish between doing arithmetic and I/O to a given base
and the choice of the representation of the digits.
For example, \x0031 - \x0039 is not the only representation of the
values one to nine in UniCode; there are also \u2160 ... , \u2170 ... ,
\u10E61 ... , \u3021 ... , \u0BE7 ... , \u1369 ... , and others.
>What would base 1 and base 0 realy mean, btw?
In Base 1, the J'th digit is multiplied by 1^(J-1) to determine its
contribution to the value. The only allowable ASCII digit is 0, so Base
1 merely supplies aleph-zero distinguishable representations of +zero.
In Base 0, no digits are allowed, so the only possibility is an empty
string.
Have you considered negative bases?
--
(c) John Stockton, nr London UK. Mail, see homepage. DOS 3.3, 6.20; WinXP, 7.
Web <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
[toc] | [prev] | [standalone]
Page 3 of 3 — ← Prev page 1 2 [3]
Back to top | Article view | comp.lang.javascript
csiph-web