I believe the quotes you list are not merely *anthropomorphism* (aka *personification/prosopopoeia*). There's something else there, additional kinds of *figure of speech*: I think that in the language of rhetoric, these are *transpositional rhetorical operations*.

**Synecdoche** is using a part of a thing to refer to the whole; such as referring to a singer by speaking only of his voice.

**Metonymy** is speaking of a thing by referring to a related thing; such as speaking of the function, rather than the designer of the function.

****

Figures of speech are perfectly valid in informal speech, but beware of using them in more formal writing, where you should aim to be more literal. At least until your papers are being graded by someone who doesn't care so much about it, at least!