An unemployed computer programmer has appeared in court accused of attacking a man with a machete.