Afsctool – apply transparent LZ compression to files/folders on OS X
github.com2 ポイント投稿者 dschoon1 コメント
var o = { a:13, add:function(b){ return this.a + b; } };
o.add(42); // => `55`
var add = o.add;
add(42); // => `NaN`, because `this.a` is (presumably) `undefined`
var a = 3;
add(42); // => `45`, because `this.a` is resolved to `window.a`, as `window` is the global variable used as the method context when we call an unbound function (which is stupid (`null` would have been a way better choice, Brandon)).
This is the sort of thing you learn and just get over to reach the level of javascript mastery. Yeah, some things are silly. But you know what? You only get to write one language to access the dynamic web. #define sin(d) ((double)sinf(d))
Which yields... double i = 10
--> i = 10.0000000000
sin(i) = -0.5440211109
sinf(i) = -0.5440211296
delta = 0.0000000187
double i = 0.25
--> i = 0.2500000000
sin(i) = 0.2474039593
sinf(i) = 0.2474039644
delta = -0.0000000051
double i = 9999999.999999
--> i = 9999999.9999989998
sin(i) = 0.4205487007
sinf(i) = 0.4205478132
delta = 0.0000008875
(Format string was %25.10f, fwiw.) Compressor Size Ratio Time
gzip -1 23MB 88% 1.18s
gzip -2 23MB 87% 1.38s
bzip2 23MB 87% 5.57s
xz -1 23MB 87% 5.35s
xz -9 11MB 43% 10.58s
bmz 13MB 45% 0.95s