About the conserved charge for the ghost number current in $bc$ conformal field theory (skip disclaimer)
I have a question about the conserved charge for the ghost number current in $bc$ conformal field theory in Polchinski's string theory p62. It is said

For the ghost number current (2.5.14), $j=-:bc:$, the charge is 
  $$ N^g= \frac{1}{2 \pi i} \int_0^{2 \pi} dw j_w  = \sum_{n=1}^{\infty} (  c_{-n} b_n -b_{-n} c_n ) + c_0 b_0 - \frac{1}{2} \,\,\,\, (2.7.22) $$

First, what is $j_w$? Seems it haven't been defined before. Is current (2.5.14) in variable w, i.e. $z=\exp(-iw)$?  Then how to derive Eq. (2.7.22)? I tried to derive it but differs the constant term and lots of (conformal) normal ordering
$$ N^g= \frac{1}{2 \pi i} \int_0^{2 \pi} dw j_w =   \frac{1}{2 \pi i} \oint dz j_z $$
$$ = -\frac{1}{2 \pi i} \oint dz :bc: =\frac{-1}{2 \pi i} \oint dz   \sum_{m=-\infty}^{\infty}  \sum_{n=-\infty}^{\infty} \frac{ : b_m c_n:}{z^{m+n+1}} (\mathrm{omit} \,\,\, \lambda  \,\,\, \mathrm{in} \,\,\, \mathrm{2.7.16})$$
$$  = - \sum_{m=-\infty}^{\infty} \sum_{n=-\infty}^{\infty}  : b_m c_n: \delta_{m+n,0}   = - \sum_{m=-\infty}^{\infty} : b_m c_{-m}: $$
$$ =- :b_0 c_0: - \sum_{m=-\infty}^{-1} : b_m c_{-m}: - \sum_{m=1}^{\infty} : b_m c_{-m}: = -:b_0 c_0: - \sum_{m=1}^{\infty} : b_{-m} c_{m}: - \sum_{m=1}^{\infty} : b_m c_{-m}: $$
$$ =  :c_0b_0: - 1 - \sum_{m=1}^{\infty}: b_{-m} c_{m}: - : c_{-m} b_{m}: -  \sum_{m=1}^{\infty} \{ :b_{m},c_{-m}: \} $$
$$ =  \sum_{n=1}^{\infty} (:c_{-n} b_n: - :b_n c_{-n}:) + :c_0b_0: - \infty$$ 
$$ =  \sum_{n=1}^{\infty} (\circ :c_{-n} b_n: \circ- \circ :b_n c_{-n}: \circ) + \circ :c_0b_0: \circ - \infty$$ 
$\circ \cdots \circ$ indicates creation-annihilation normal ordering
I guess there is huge problem in my derivation, but how to get (2.7.22) correctly?
 A: Except for the last line with the ludicrous term that you wrote as $-\infty$, something that has no place in a proper physics calculation because $\infty$ is a physically ill-defined number, your calculation is exactly correct, including the $c$-number additive shift.
Yes, $j_w$ is just the simple holomorphic component of the current $j$ in the coordinate $w$.
Concerning the additive term, note that the anticommutator
$$\{b_m,c_{-m}\}=1$$
so the last sum on the second line from the end is
$$-\sum_{m=1}^\infty 1 = -(-\frac 12) = \frac 12$$
and when you add this $+1/2$ with the previous term $-1$, you get the correct additive shift $-1/2$ that appears in (2.7.22) along with the normal-ordered bilinear expression.
The fact that
$$\sum_{m=1}^\infty 1 = -\frac 12$$
may be proved e.g. by the zeta-function regularization. Just like
$$\sum_{m=1}^\infty = 1+2+3+4+\dots = \zeta(-1)  = -\frac{1}{12},$$
the sum of $1$ over positive integers is $\zeta(0)=-1/2$. Note that the sum of $1$ over negative integers is also $-1/2$ because $1$ is an even function of $m$. If you add $1$ from $m=0$, it's clear that the sum of $1$ over all integers is $(-1/2)+1+(-1/2)=0$, as it should be by various other arguments.
If you feel bad whenever you assign a finite value to a naively divergent sum, then you must treat the coefficient of the divergent term $1$ as an amplitude that needs to be renormalized. A counterterm has to be added in the definition of $N^{gh}$ and the value of the finite leftover has to be determined by the conformal invariance. Conformal invariance determines the finite additive shift unambiguously. Of course, one may also change what we mean by the ghost number (adding an additive shift to the integral).
A: I believe you are both missing something. As $z$ is related to $w$ by a conformal transformation you need to use (2.5.17) to relate $j_w(w)$ and $j_z(z)$. This is a my derivation:
\begin{align}
N^\mathrm{g} =  \frac{1}{2\pi i } \int_0^{2\pi}dw j(w) 
\end{align}
From (2.5.17) we have
\begin{align}
(\partial_w z) j_z(z) = j_w(w) + \frac{2\lambda-1}{2} \frac{\partial^2_wz}{\partial_w z}
\end{align}
with $z= e^{-iw}$ we have $\partial_w z = -i z$ and $\partial^2_wz = -z$ so that
\begin{align}
-i z j_z(z) = j_w(w) + \frac{2\lambda-1}{2}  \frac{-z}{-iz} \Rightarrow j_w (w) = -i z j(z) +i  \frac{2\lambda-1}{2}  
\end{align}
Using this and $dw= idz/z$ we have
\begin{align}
N^\mathrm{g} =&\,   \frac{1}{2\pi i } \oint \frac{idz}{z} i \left( - z j(z) +  \frac{2\lambda-1}{2}  \right) \nonumber\\
=&\, -\frac{1}{2\pi i} \oint dz \, \left( - j(z) +  \frac{2\lambda-1}{2z}  \right) 
\end{align}
We now have
\begin{align}
N^\mathrm{g} =&\, - \frac{1}{2\pi i} \oint dz\, \left( :bc:(z) +  \frac{2\lambda-1}{2}  \right) = - \frac{1}{2\pi i} \oint dz\, \left( \substack{\circ\\\circ}  b c \substack{\circ\\\circ}(z)  +\frac{1-\lambda}{z}+  \frac{2\lambda-1}{2z}  \right) 
\end{align}
where we used that
\begin{align}
:bc:(z) =&\, \lim_{z'\rightarrow z} :b(z) c(z'): = \lim_{z'\rightarrow z} \substack{\circ\\\circ} b(z) c(z') \substack{\circ\\\circ}+  \lim_{z'\rightarrow z}\frac{(z/z')^{1-\lambda} -1}{z-z'} \nonumber\\
=&\,  \substack{\circ\\\circ}b c \substack{\circ\\\circ} (z)  +\frac{1-\lambda}{z} \end{align}
Let us first quickly do the last two terms of $N^\mathrm{g}$. They give
\begin{align}
-\frac{1}{2\pi i} \oint dz \frac{1}{2z} =-\frac{1}{2}
\end{align}
The first terms gives
\begin{align}
& \, -\frac{1}{2\pi i} \oint \sum_{m=-\infty}^\infty  \sum_{n=-\infty}^\infty \frac{\substack{\circ\\\circ} b_m c_n \substack{\circ\\\circ} }{z^{m+\lambda +n+1-\lambda}} = 
-\frac{1}{2\pi i} \oint \sum_{m=-\infty}^\infty  \sum_{n=-\infty}^\infty \frac{\substack{\circ\\\circ} b_m c_n \substack{\circ\\\circ} }{z^{m+ +n+1} }\nonumber\\
=&\, -\sum_{m=-\infty}^\infty \ \sum_{n=-\infty}^\infty \substack{\circ\\\circ}b_m c_n \substack{\circ\\\circ}\delta_{m+n,0} = -\sum_{m=-\infty}^\infty \substack{\circ\\\circ} b_m c_{-m} \substack{\circ\\\circ}\nonumber\\
=& \, -\sum_{m=-\infty}^{-1} \substack{\circ\\\circ}b_m c_{-m} \substack{\circ\\\circ} -\substack{\circ\\\circ} b_0 c_0 \substack{\circ\\\circ} -\sum_{m=1}^{\infty} \substack{\circ\\\circ} b_m c_{-m} \substack{\circ\\\circ} \nonumber\\
=&  \, -\sum_{m=-\infty}^{-1} b_m c_{-m}  + c_0 b_0   +\sum_{m=1}^{\infty} c_{-m} b_m  =  \sum_{m=1}^{\infty} (c_{-m}b_m- b_{-m} c_{m}  ) + c_0 b_0  
\end{align}
Combining both contributions we find
\begin{align}
N^\mathrm{g} =&\, \sum_{m=1}^{\infty} (c_{-m}b_m- b_{-m} c_{m}  ) + c_0 b_0    - \frac{1}{2}
\end{align}
