online logistic and linear regression, bits&bobs