Consider a spell checker program: a user is entering input, and for whatever reason they miss some white space while entering input, so that something like The Sun Also Rises is entered as The Sun AlsoRises.
more
It’s often useful to time aspects of your applications. In environments without access to profiling tools like xdebug, it is necessary to roll your own. Here’s one that relies heavily on calls to microtime
. Unfortunately making many thousands of calls to microtime
takes a significant amount of time on its own.
more
Java has a nifty class named NavigableMap
. It abstracts away some of the logic for mapping ranges to values. Java is reknowned for it’s ridiculously large library of collections.
more