I was reading this notes to learn more about Stone-Weierstrass theorem and there is a remark I do not understand:
It says that Stone-Weierstrass theorem applies but not every continuous function on $[0,\pi]$ has uniformly convergent cosine series? Isn't it contradictory?

As in peek-a-boo's and Cameron Williams' comments: the incredible thing is that, apparently, the sequence of finite Fourier (or "cosine", or whatever) series that do converge uniformly to a continuous functions are not generally the partial sums of the Fourier series of the function (with coefficients determined by inner products...)
(The Fejer kernel (using a Cesaro summation...) approach shows the density very nicely, and illustrates that the finite Fourier series guaranteed to uniformly approach the function are not the finite partial sums of the Fourier series, but, rather, are some weighted partial sums...)
This is crazy, in my opinion! Yes. :)
As with many of these things, I guess a Baire category argument shows that this craziness is what happens generically. :)