Principles and Applications of Brain-Computer Interfaces