Hewlett-Packard earnings top expectations even though revenue dips