Carry out the following integrals, counterclockwise, around the indicated contour

For the first integral, z = π/4 is a pole of order 3 and lies inside the contour |z| = 1. Compute the residue:
[tex]\displaystyle \mathrm{Res}\left(\frac{e^z\cos(z)}{\left(z-\frac\pi4\right)^3}, z=\frac\pi4\right) = \lim_{z\to\frac\pi4}\frac1{(3-1)!} \frac{d^{3-1}}{dz^{3-1}}\left[e^z\cos(z)\right][/tex]
We have
[tex]\dfrac{d^2}{dz^2}[e^z\cos(z)] = -2e^z \sin(z)[/tex]
and so
[tex]\displaystyle \mathrm{Res}\left(\frac{e^z\cos(z)}{\left(z-\frac\pi4\right)^3}, z=\frac\pi4\right) = - \lim_{z\to\frac\pi4} e^z \sin(z) = -\frac{e^{\pi/4}}{\sqrt2}[/tex]
Then by the residue theorem,
[tex]\displaystyle \int_C \frac{e^z\cos(z)}{\left(z-\frac\pi4\right)^3} \, dz = 2\pi j \left(-\frac{e^{\pi/4}}{\sqrt2}\right) = \boxed{-\sqrt2\,\pi e^{\pi/4} j}[/tex]
For the second integral, z = 2j and z = j/2 are both poles of order 2. The second poles lies inside the rectangle, so just compute the residue there as usual:
[tex]\displaystyle \mathrm{Res}\left(\frac{\cosh(2z)}{(z-2j)^2\left(z-\frac j2\right)^2}, z=\frac j2\right) = \lim_{z\to\frac j2}\frac1{(2-1)!} \frac{d^{2-1}}{dz^{2-1}}\left[\frac{\cosh(2z)}{(z-2j)^2}\right] = \frac{16\cos(1)-24\sin(1)}{27}j[/tex]
The other pole lies on the rectangle itself, and I'm not so sure how to handle it... You may be able to deform the contour and consider a principal value integral around the pole at z = 2j. The details elude me at the moment, however.