A simple method of calculating eigenvalues and resonances in domains with infinite regular ends