And

http://www.brynmawr.edu/socialwork/GSSW/Vartanian/Handouts/Residual.pdf

This site says it is observed-expected/sqrt(expected (1-row proportion)(1-column proportion)

The only difference is that the second formula subtracts the proportions from 1.

So which one is correct?