A note on the diagonalization of quadratic boson and fermion hamiltonians