Neural Network: implementing Hopfield NN

In this post i report a simple implementation of a Hopfield Neural Network.
As for the following examples i will post the goal is character recognition on a grid of pixels. 
Noise is introduce to evaluate robustness of the approach.
  Here we will present both implementation and performance eval- 
uation of an artificial neural network, namely the Hopfield network 
applied to characters recognition.
 
This documentation provide full description of the approach and the results.
This is the source code for the neural network