Nerd Story

Here’s a fantastically nerdy fact that I need to record: during a bout of insomnia (after he had slept for most of the day, due to illness), Justin found himself awake in bed at midnight. After a lot of tossing and turning for a few hours, he attempted to bore himself to sleep by conjuring up database scenarios and trying to come up with solutions.

Yeah.

So one “problem” he concocted was trying to re-order a series of, say, 25 entries/rows. The big challenge here was coming up with a way to re-organize them, re-rank them. The instant you took say #15 and made it #1, you’d end up having two different items ranked #1. The solution he discovered (again, keep in mind he’s doing this late at night as a way to bore his brain to sleep) was to apply the following steps:

  1. Take the item’s current rank/number, and mutiply it by -1
  2. Add to this result the total number of items in question.
  3. Add 1

Even now, several hours and drinks afterwards… I’m still shaking my head. Justin does this shit for fun, as a way to kill time and try to deaden his brain. I’m mocking him here, mainly because I’m in awe (and maybe just a little bit jealous). Big brains on that boy.

This Post Has 0 Comments

Leave A Reply