$\textbf{Problem 1:} \\\\
\text{Using Cauchy's Integral Formula or Residue Theorem to calculate}$
$$I:= \int_{\gamma}{\frac{z-1}{z^2-4z+5}} \,dz $$
$\text{where } \gamma \text{ is a contour on the picture with the shown direction; poles are shown like colored dots.}$
$
\textbf{Solution:} \\\\
\text{Since contour } \gamma \text{ is not a simple closed curve, then denote the contour } c_1 ,\ c_2 \text{ as following (pic is attached below)}$
$\text{Let }$ $$f(z) = z^2-4z+5 = 0$$
$\text{Then }$$$z=\frac{4 \pm \sqrt{4^2-4\cdot5}}{2} = 2 \pm i$$
$\text{For clockwise, simple closed contour } c_2 \text{, there is no pole. By Cauchy Theorem: }$
$$\int_{c_2}{\frac{z-1}{z^2-4z+5}} \,dz = 0$$
$\text{For clockwise, simple closed contour } c_1 \text{, there is two poles} z_1 = 2 + i ,\ z_2 = 2-i \text{. Then by Residual Theorem, we have:}$
$
\begin{gather}
\begin{aligned}
\int_{c_1}{\frac{z-1}{z^2-4z+5}} \,dz &= -2 \pi i \sum{Res} \\\\
&= -2 \pi i \cdot (\frac{z-1}{z-2+i}|_{z=2+i} + \frac{z-1}{z-2-i}|_{z=2-i}) \\\\
&= -2 \pi i \cdot (\frac{1+i}{2i} + \frac{1-i}{-2i}) \\\\
&= -2 \pi i
\end{aligned}
\end{gather}
$
$\text{Therefore we have}$
$\begin{gather}
\begin{aligned}
\int_{\gamma}{\frac{z-1}{z^2-4z+5}} \,dz &=\int_{c_1}{\frac{z-1}{z^2-4z+5}} \,dz + \int_{c_2}{\frac{z-1}{z^2-4z+5}} \,dz \\\\ &= -2\pi i
\end{aligned}
\end{gather}
$