Applications of the principle of maximum entropy: from physics to ecology