James Legge, translation (1893)
When you meet someone better than yourself, turn your thoughts to becoming his equal. When you meet someone not as good as you are, look within and examine your own self.
Dim Cheuk Lau translation (1979)
When you see a good person, think of becoming like her/him. When you see someone not so good, reflect on your own weak points.
As quoted in Liberating Faith : Religious Voices for Justice, Peace, and Ecological Wisdom (2003) by Roger S. Gottlieb, p. 24
The Analects, Chapter I, Chapter IV