Apple, H-P gains give a boost to tech stocks