I can see where she is coming from, but I think that this can only be resolved when many more women work as programmers than they do now.
It's just a fact that men think a lot about sex, if you are the only female person around for like 9 hours of the day, and if you are likeable and somewhat attractive, then all these men will think a lot about having sex with you (and trying to impress you as a result). It is obvious that this might have its effect on workplace interactions, and usually not in a good way.