Total number of posts in last year

All you need to do is modify the SQL query. Using the code you linked as a base:

$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status="publish" AND year(post_date) = 2010");
if (0 < $numposts) $numposts = number_format($numposts); 

The ‘AND’ I added basically gives you all the posts of 2010. Change the year accordingly