Hacker Newsnew | past | comments | ask | show | jobs | submit | jacksontale's commentslogin

Edited the post and added your comment


Good thought, and also if k < N / 2


This blog post is about using OCaml to solve the Pearl No. 4 in the book of "Pearls of Functional Algorithm Design, by Richard Bird".

I am very keen to OCaml and so using OCaml to solve various algorithm problems to have some fun.


Sorry for the confusion. You are absolutely right. I just copy/paste the original problem statement in the book.

Will change


Could you add "disjoint" to the title? It's so close to containing the gist of the problem. If anyone else goes from the title to the solution, it'll save some confusion.


Can I know why?


The way JPEG works is by dividing up the image into 8x8 pixel blocks, then transforming each block using the discrete cosine transform (DCT). If you look closely at a JPEG file, especially at low quality settings, you can see the edges of the blocks. This means that artifacts have been introduced during the compression of the image. PNG however, is a lossless image compression format, meaning that no artifacts will be introduced by saving and loading an image in PNG.



You have a very high quality JPEG in this case, even bigger than the PNG. So there aren't visible artifacts in this case. It's more of a general principle.


But anyway, I updated teh post, so people could be aware of this diff.


ah ok, thanks.


Yeah, factoradic is awesome.


I think its SML in the book


Yeah that book is one of the most important book in functional world


Yeah, you are right, the example number list in the post was not that awesome. If I am free at any time, i will modify the example. Just refining the diagram will be quite painful.


Yeah, I formally introduced the book when I presented the pearl 1: http://typeocaml.com/2015/02/02/functional-pearl-no-1-the-mi...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: