EOG Resources has quarterly profit compared with year-ago loss