Question: I have several weather servers uploading reports to a central server with separate pages for each station's report showing gauges. The cycle on the uploads is at H+00 and H+30. I need the pages to auto refresh at H+03 and H+33 (24x7x365) to insure the page has current information.

I have tried several suggested JS solutions for auto refreshing pages particularly the Auto Refresh at the top of every hour discussion, but I can't get it quite right. I would appreciate any suggestions or code examples.

Answer: 
In addition to the previous answer, here's a suggestion how to prepare the ranges to optimize the subsequent lookup. The idea boils down to precomputing the result for all significantly different input values, but being smart about when values don't differ significantly.

To illustrate what I mean, let's consider this sequence of ranges:

```
1, 3
1, 8
2, 4
2, 6

```

The prepared output structure then looks like this:

```
1, 2 -> 2
2, 3 -> 4
3, 4 -> 3
4, 6 -> 2
6, 8 -> 1

```

For any number in the range `1, 2`, there are two matching ranges in the initial sequence. For any number in the range `2, 3`, there are four matches, etc. Note that there are five ranges here now, because some of the input ranges partially overlapped. Since for every range here the end value is also the start value of the next range, the end value can be optimized out. The result then looks like a simple map:

```
1 -> 2
2 -> 4
3 -> 3
4 -> 2
6 -> 1
8 -> 0

```

Note here that the last range didn't have one following, so the explicit zero becomes necessary. For the values before the first, that is implied. In order to find the result for a value, just find the key that is less than or equal to that value. This is a simple O(log n) lookup.
For each pair a,b you can decompose so that a=+1 and b=-1 for the number of ranges valid for a particular value. Then in becomes a simple O(log n) lookup to see how many ranges encompass the search value.