US stocks end midweek mostly higher, led by tech stocks