Live data from Hacker News

A file that’s both an acceptable HTML page and a JPEG (2012)

lcamtuf.coredump.cx

31–40 of 72 posts

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#31

Cool, but it's a chipmunk not a squirrel. Just saying!

Hey - I'm the author of that page. Your comment is a common misconception, but the animal pictured is actually a golden-mantled ground squirrel. You can tell because the stripe doesn't extend to the eye. Thank you for subscribing to squirrel facts!

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#32
post #29

Earlier quoted context omitted.

https://animalsake.com/how-is-chipmunk-different-from-squirr... (TLDR, Chipmunks are not Squirrels)

https://en.wikipedia.org/wiki/Squirrel > Squirrels are members of the family Sciuridae, a family that includes small or medium-size rodents. The squirrel family includes tree squirrels, ground squirrels, chipmunks , marmots (including woodchucks), flying squirrels, and prairie dogs amongst other rodents. (TLDR, chipmunks are squirrels)

[deleted]

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#34
post #29

Earlier quoted context omitted.

https://animalsake.com/how-is-chipmunk-different-from-squirr... (TLDR, Chipmunks are not Squirrels)

https://en.wikipedia.org/wiki/Squirrel > Squirrels are members of the family Sciuridae, a family that includes small or medium-size rodents. The squirrel family includes tree squirrels, ground squirrels, chipmunks , marmots (including woodchucks), flying squirrels, and prairie dogs amongst other rodents. (TLDR, chipmunks are squirrels)

The Sciuridae family includes chipmunks; that doesn't mean chupmunks are squirrels, nor that marmots are squirrels.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#35
post #30

The last week i found this [1] thread by Notch. He is working in an entry to js13k [2] (a game jam about html5 games restricted to 13 KBs). He bundled the whole source code and binary data used in the game/tech demo to use the in browser image decompression, avoiding to write a custom (de)compression code, saving KBs this way. Then he just eval() the needed parts for each thing. I found this extremely clever, game ja…

While definitely cool, I wonder how effective this is. Code/random binary data should have different characteristics than image data.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#36
post #14

If you think that this is interesting, you should check out Daeken's Magister: http://demoseen.com/windowpane/magister.png.html It's a PNG that's interpreted as HTML and loads itself as compressed JavaScript!

https://news.ycombinator.com/item?id=4209168 So, literally copying previous top comments on old posts is now a popular thing?

That's indeed weird. Please don't do that, GP!

It seems to have been a one-off, so we won't ban the account.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#37
post #35
post #30

The last week i found this [1] thread by Notch. He is working in an entry to js13k [2] (a game jam about html5 games restricted to 13 KBs). He bundled the whole source code and binary data used in the game/tech demo to use the in browser image decompression, avoiding to write a custom (de)compression code, saving KBs this way. Then he just eval() the needed parts for each thing. I found this extremely clever, game ja…

While definitely cool, I wonder how effective this is. Code/random binary data should have different characteristics than image data.

It's very effective, because it means you get a really good compression algorithm for free (because it's already there in the browser).

You definitely won't save enough bytes with better input heuristics than the amount of code needed to decompress them if you're only working with 13Kb of data.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#38
post #35
post #30

The last week i found this [1] thread by Notch. He is working in an entry to js13k [2] (a game jam about html5 games restricted to 13 KBs). He bundled the whole source code and binary data used in the game/tech demo to use the in browser image decompression, avoiding to write a custom (de)compression code, saving KBs this way. Then he just eval() the needed parts for each thing. I found this extremely clever, game ja…

While definitely cool, I wonder how effective this is. Code/random binary data should have different characteristics than image data.

DEFLATE, which is used by PNG, is a general purpose LZ77-like compression algorithm suitable for all kinds of repetitive data.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#39
post #30

The last week i found this [1] thread by Notch. He is working in an entry to js13k [2] (a game jam about html5 games restricted to 13 KBs). He bundled the whole source code and binary data used in the game/tech demo to use the in browser image decompression, avoiding to write a custom (de)compression code, saving KBs this way. Then he just eval() the needed parts for each thing. I found this extremely clever, game ja…

Just so other readers don't mistake this for what it is: this is a pretty common technique in JS sizecoding and it's by no means Notch's invention (and he doesn't claim that it is).
Post reply on HN