No cows shall be stabled, gated, or picketed closer than 100 feet to a residence in the city limits with the exception of uses that would violate this provision that existed prior to the effective date of the ordinance from which this section is derived.