Ab initio density-functional calculations in materials science: from quasicrystals over microporous catalysts to spintronics