1,163 karma · joined April 12, 2013
Thy operate on a simple concept of trisecting a cam lobe so that, as the device is retracted, the cam unfolds and permits an amazing range for a unit of its size.
There are good arguments against a service locator - one of them is presented here: http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Patte...
Another argument again the service locator pattern is this: If you ask the locator for a service which has dependencies you have to resolve those dependencies yourself. So you need to know about the specific implemntation of this service interface which defeats the purpse. If you work around that, you end up with something that is pretty close to a DI container.
1. Take all the start x-coordinates of a buildings (=start events).
2. Take all the end x-coodinates of the buildings (=end events).
3. Sort all the events the by the value of the coordinate.
4. Now walk over all the events and keep count of how many there currently are (or in this case: how high the building is) by adding one for a start event and substracting one for a end event.