Dynamics and statistics of spiking neural networks