top | item 5696798

The Archive of Interesting Code

158 points| objectivefs | 13 years ago |keithschwarz.com | reply

24 comments

order
[+] bigfoot|13 years ago|reply
Under what license may I reuse those snippets -- or are they too short to provoke legal issues anyways?
[+] dsuth|13 years ago|reply
From the page:

"If you're interested in using any of this code in your applications, feel free to do so! You don't need to cite me or this website as a source, though I would appreciate it if you did. However, please don't plagiarize the code here by claiming authorship - that would just be dishonest. I also caution you that while I'm fairly confident that the code on this site is correct, I haven't mercilessly tested every line, and so there may be a lurking bug or two here."

[+] txet|13 years ago|reply
nice collection of things to study in one place. Any other similar..?
[+] hoka|13 years ago|reply
Nice and simple; I like it! Also, you just made every introductory CS teacher cringe, unless they import all of these into their cheating detection system.
[+] ddp26|13 years ago|reply
Actually Keith Schwarz is an introductory CS teacher :-).
[+] CountHackulus|13 years ago|reply
Lots of really interesting things here. The most valuable is definitely having some reference implementations.
[+] webo|13 years ago|reply
Bidirectional Map can be implemented in less than 20 lines (put, get, remove).
[+] optiminimalist|13 years ago|reply
Fantastic list. A great way to supplement the theory from CLRS, etc.
[+] abcd_f|13 years ago|reply
Some are interesting, but there's lots of mundane and generally boring stuff too, e.g. [1]

[1] http://www.keithschwarz.com/interesting/code/?dir=argmax

[+] stiff|13 years ago|reply
Wow, what a sad place has HN become that this kind of comment is getting upvoted. There are tons of interesting stuff in there, very exhaustively commented, and you say "some are interesting, lots are mundane" quoting a single goddamn example. Wouldn't linking the interesting ones be, like, more interesting? What a fucking weak attitude!