Intelligent alarm clock