Near optimal online algorithms and fast approximation algorithms for resource allocation problems | Synapse