I try to prove that the language $L$ is not regular: $$ L = \{w\in(a+b)^*:\#_a(u)>2009\#_b(u)\ \text{for every nonempty prefix u of word w} \} $$ Note: $\#_a(u)$ means the number of symbols $a$ in the word $u$.
Let $p$ let be the length in pumping lemma. Let $w=(a^{2009p}ab^{p})^*\in L$

Let according to lemma $w=xyz$, where $|y|>0, |xy|\le p$. And now, look at $s'=xy^0z$. Since $y=aa...aa$ and $ 1\le|y|\le p$, the word $s'$ has no more than $2009p$ symbols $a$ in some prefix. Therefore $s'\notin L$ - so the language is not regular (thanks to the pumping lemma). What about this solution ?