From a hint on stackoverflow, a very convenient way of typing in code examples into blogger is to first enter the code as a gist on github and then find the ’embed’ code and paste that into the ‘html’ tab of your post, like so: https://gist.github.com/kghose/3355901.js