Nasdaq Q2 profit beats estimates with record $1.07 EPS