scala sample codes.