Companies report good, bad, ugly second-quarter earnings