What is principal value in delta function integral? The delta function may have different forms of definition. One related to Fourier transform is shown below,
$$\int_{-\infty}^{\infty}\!dt ~e^{i\omega t}~=~2\pi\delta(\omega).$$
then I wonder what if only the positive (or negative) frequency part be considered. We may run into singularity for the integral below, 
$$\int_{0}^{\infty}\!dt ~e^{i\omega t}~=~?$$
I find it's related to principal value. Can anyone give a solid explanation and derivation for this integral?
 A: 
my question is how to derive the second integral in the original
  question.

Try using the unit step function $u(t)$ to rewrite the integral as a Fourier transform:
$$\int_{0}^\infty\mathrm{d}t\,e^{i\omega t} = \int_{-\infty}^\infty\mathrm{d}t\,e^{i\omega t}\,u(t) = \int_{-\infty}^\infty\mathrm{d}\tau\,e^{-i\omega \tau}\,u(-\tau),\quad \tau = -t$$
So, the second integral is Fourier transform of the time reversed unit step function.  The Fourier transform of the unit step function can be looked up in a table of Fourier transform pairs:
$$u(t) \leftrightarrow \left(\frac{1}{i\omega} + \pi\delta(\omega) \right) $$
Using the time reversal property, $\mathcal{F}\{x(-t)\} = X(-\omega)$, we have
$$\int_{0}^\infty\mathrm{d}t\,e^{i\omega t} = \frac{i}{\omega} + \pi\delta(\omega)$$
A: So what does it mean to be a delta function? It means that something is a mathematical object which satisfies for all other nice $f$,
$$\int_{-\infty}^{\infty} d\omega~f(\omega)~\delta(\omega) = f(0).$$
More formally, it turns out that the $\delta(\omega)$ can never truly be separated from the $\int_{-\infty}^\infty d\omega$ sign: our writing of $\delta(\omega)$ is really a failure of notation where we would want to actually describe something more like, $$\int_{\mathbb R} dt~\left[f \mapsto \int_{\mathbb R} d\omega ~e^{i\omega t} f(\omega)\right] = f\mapsto 2\pi~f(0),$$ where $\mapsto$ denotes a function which accepts a smooth function as input and integration (really, addition and multiplication) of such functions is done "pointwise" (so that $f + g = x\mapsto f(x) + g(x)$ for example).
Setting up the integral
Anyway the general approach to this problem is to shift the subproblems off the real axis by an infinitesimal amount, so that $$\int_{-\infty}^\infty dt~e^{i\omega t} = 
\lim_{\epsilon\to 0^+}\left(\int_{-\infty}^0 dt~e^{i(\omega - i \epsilon) t} + \int_0^{\infty} dt~e^{i(\omega + i\epsilon)t }\right),$$hence your question is actually one of the "stepping stones" we need to address in order to handle the above integrals. One finds of course,$$\int_0^\infty dt~ e^{(i\omega - \epsilon) t} = -\frac 1{i\omega - \epsilon} = \frac{i}{\omega + i \epsilon}, ~~\epsilon > 0,$$ or substituting in the fuller expression using $\mapsto$ we would find that this half-integral is, $$\int_0^\infty dt~\left[f \mapsto \int_{\mathbb R} d\omega~e^{i\omega t} f(\omega)\right] = f\mapsto \lim_{\epsilon\to 0^+}\int_{\mathbb R} d\omega~\frac{i}{\omega + i \epsilon}~f(\omega). $$ It is when we try to evaluate this with complex analysis that we need the Cauchy principal value. 
Contour deformation
Cauchy's integral theorem allows us to deform contours off the real line into the complex plane without changing the value. If we do this before we take the limit of $\epsilon \to 0$ we can make taking that limit very easy. So we deform the contour a little into the positive imaginary half of the plane around $\omega = 0$, a half-circle with radius $r$, which we will later shrink to zero size. So on this circle $\omega = r~e^{i\theta}$ with $\theta: \pi \to 0$ and thus $d\omega = i~r~e^{i\theta}~d\theta.$ To save some space let $k_\epsilon(\omega) = \frac i{\omega + i\epsilon},$ the resulting expression for the right-hand-side is,
$$f \mapsto \lim_{r\to 0^+}\lim_{\epsilon\to 0^+} \left(\int_{-\infty}^{-r}d\omega ~k_\epsilon(\omega)~f(\omega) + \int_{r}^{\infty}d\omega ~k_\epsilon(\omega)~f(\omega) + \int_{\pi}^{0} i~r~e^{i\theta} d\theta~k_\epsilon(re^{i\theta})~f(r~e^{i\theta}) \right).$$
We can now take the limit $\epsilon \to 0^+$ by simply substituting $\epsilon = 0$ in here; this contour does not hit any singularities when we do so. We find that $k_0 = i/\omega$ and the first term in the limit as $r\to 0^+$ is just the Cauchy principal value of an integrand, while the rightmost term is also interesting due to cancellation of the a term $r e^{i\theta}$ from $d\omega$ with the term $1/(r e^{i\theta})$ from $k_0$: 
$$
f \mapsto \operatorname{PV}\int_{-\infty}^\infty d\omega ~\frac i\omega ~f(\omega) - \lim_{r\to 0^+} \int_{\pi}^{0} d\theta~f(r~e^{i\theta}).$$
So we can also take this limit as $r\to 0^+$ by direct substitution and we find,
$$\int_0^\infty dt~\left[f \mapsto \int_{\mathbb R} d\omega~e^{i\omega t} f(\omega)\right] = 
f \mapsto \operatorname{PV}\int_{-\infty}^\infty d\omega ~\frac i\omega ~f(\omega) + \pi~f(0).$$
If the principal value is understood as implied, one might instead write, $$ \int_0^\infty d\omega~ e^{i\omega t} = \frac{i}{\omega} + \pi~\delta(\omega).$$
What about the other side of the original integral?
As one might imagine, the integral for negative $t$ is largely the reverse of this. Indeed one has $$\int_{-\infty}^0 dt~e^{(i\omega + \epsilon)t} = \frac{1}{i\omega + \epsilon} = \frac {-i}{\omega - i \epsilon}.$$ The principal value analysis is absolutely identical except that the numerator contains $-i$ rather than $+i$, but the semicircle must dip into the negative half-plane rather than the positive half plane, yielding:
$$f \mapsto \operatorname{PV}\int_{-\infty}^\infty d\omega ~\frac {-i}\omega ~f(\omega) + 
\lim_{r\to 0^+} \int_{-\pi}^{0} i~r~e^{i\theta} d\theta~\frac{-i}{r e^{i\theta}} ~f(r~e^{i\theta}).$$
Thus we have, perhaps surprisingly,
$$\int_{-\infty}^0 dt~e^{i\omega t} = - \frac{i}{\omega} + \pi~\delta(\omega).$$The sum of these then proves our original statement: $$
\int_{-\infty}^\infty dt~e^{i\omega t} = 2\pi~\delta(\omega).
$$
Where were your intuitions failing you?
You perhaps thought that since $\delta(\omega)$ was even in $\omega$, it meant that $e^{i\omega t}$ was even in $t$. That is somewhat dubious reasoning in general: usually the (indefinite) integral of an even function is an odd function. However that reasoning is not 100% bad, it is just targeted at the wrong domain: it needs to be directed at a function of $t$. The real part of $e^{i\omega t}$ is indeed even and hence we can expect that the real part of the integral $0\to\infty$ is $\pi~\delta(\omega)$ just as we eventually derived. But the imaginary part is odd in $t$ and hence, we would think, it's doomed to cancel on the domain $-\infty \to \infty.$ Accordingly we could have expected that the integral $0 \to \infty$ contains some imaginary term which is the precise negative of the integral $-\infty \to 0$ such that they both cancel in the end.
A: 
why the half of the integral is not half of delta function?

Because the function is not even.
To illustrate why, consider:
$$
\int_{-\infty}^{\infty} dt e^{i\omega t}
=
\int_{-\infty}^{0} dt e^{i\omega t}+\int_{0}^{\infty} dt e^{i\omega t}
$$
$$
=
\int_0^{\infty} dse^{-i\omega s} + \int_{0}^{\infty} dt e^{i\omega t}\;,
$$
where I made the change of variable $s=-t$ in the first integral of the lower line. 
But since $s$ is just a dummy variable, I can also write:
$$
=\int_0^{\infty} dte^{-i\omega t} + \int_{0}^{\infty} dt e^{i\omega t}
$$
$$
\neq 2\int_{0}^{\infty} dt e^{i\omega t}
$$
