r/programming • • Jun 05 '18

Code golfing challenge leads to discovery of string concatenation bug in JDK 9+ compiler

https://stackoverflow.com/questions/50683786/why-does-arrayin-i-give-different-results-in-java-8-and-java-10
2.2k Upvotes

355 comments sorted by

View all comments

Show parent comment

7

u/adrianmonk Jun 05 '18

This trick is also used in data compression contests by people who want to be irritating.

7

u/nakilon Jun 05 '18

There was a cool contest two years ago. You had to make a classifier that would tell if the word is from the dictionary (exact "English words" dictionary was given) of 4 megabytes. The whole solution (code + data) had to fit into 48 kilobytes. https://habr.com/company/hola/blog/282624/
IIRC guys who won with amazing accuracy (mine was only 71%) were using Bloom filter.

3

u/zenflux Jun 06 '18

I usually see those kind contests score the sum of output size and decoder executable size. Or maybe I'm only seeing these contests after someone decided to be cheeky with storing the file in it's path and they made the rule.