Competitive ratio versus regret minimization: achieving the best of both worlds