Hacker News new | past | comments | ask | show | jobs | submit login
What's your greatest hack?
5 points by fnazeeri on Oct 21, 2011 | hide | past | favorite | 4 comments



With only 17 hours caffeinated to go before a weekly meeting with my research advisor, and desperate to create some results to show, I accidentally reinvented the Rabin-Karp algorithm for string search:

http://stanford.edu/~jonr1/software-faire-poster.jpg (see center panel)

My thought process at the time was: Shit, brute force string search takes over ten minutes on my data! There must be a way to speed this up. Hm. It probably involves hashing somehow...


Was it the caffeine or the time constraint? :) Great hack nevertheless!

I wonder if the data in question was indexed, it'd have solved your problem in an instant?


Mostly the time constraint.

Nah, it wasn't indexed, hence the necessity to build up such an index as the first step of the algorithm.


Yes I realized that, my question was more like, "couldn't you just put the data in a relational database or a full text search engine and avoid reinventing?".

Depends on the scenario, of course, and judging by how you solved it, yours seems like an exception, and not rule.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: