Three lessons from the curious case of Hachemi Hamdi, a TV magnate who came in fourth out of 100-plus parties despite little expectation of success