< :the previous in number
^ :the list in numerical order
> :the next in number
P :the previous (in thread)
N :the next (in thread)
|<:the top of this thread
>|:the next thread
^ :the parent (reply-to)
_:the child (an article replying to this)
>:the elder article having the same parent
<:the youger article having the same parent
---:split window and show thread lists
| :split window (vertically) and show thread lists
~ :close the thread frame
.:the index
..:the index of indices
I guess no one cares, but there is an even shorter version
(and it should still be O(log n)):
-------------------------------------------------------------
data = [3, 4, 5, 6, 7, 8, 9, 15, 38, 39, 40, 41, 6789, 6790, 9998, 9999]
p1, p2, ranges = 0, (data.size - 1) * 2, [data[0]..data[0]]
until p1 == data.size
if (d2 = data[p2 = (p1 + p2) / 2]) - (d1 = data[p1]) == p2 - p1
ranges << ((ranges.last.end+1 >= d1 ? ranges.pop.first :
d1)..d2)
p1, p2 = p2+1, data.size - 1
end
end
puts ranges
-------------------------------------------------------------
I get some odd satisfaction from shrinking stuff, call me stupid...
Simon