Symmetric functions, codes of partitions and the KP hierarchy