Thanks for posting this. Your code combines two successful approachs : a latent factor model (SVD) and a neighborhood model :)
Here's my implementation of a recommender algorithm in C if someone is interested : https://github.com/GHamrouni/Recommender