1. When the gangster demanded money from me, I told him I was a policeman out of desperation.2. When the robber broke into his house he grabbed a knife in desperation and killed the robber.
 out of desperation in desperation請參考例句.
All the wok I've been putting into this project has been all for nothing because my boss is shutting it down.