The Parting of the Ways
According to Steven Moffat, the squareness gun used by Song to help the party escape from the impending Vashta Nerada is intended to be the same sonic blaster that was used by Jack Harkness (John Barrowman) in the episode "The Doctor Dances". Moffat suggests that it was left in the TARDIS after "The Parting of the Ways", and taken by Song in the Doctor's future. The name "squareness gun" was coined by Rose Tyler (Billie Piper) in the former episode.