The stock market held near highs this week as Intel and chipmakers offset ServiceNow and software woes. Apple CEO Tim Cook is leaving.