In section 300.4(A) the NEC® has general rules about drilling and notching through wood members. The concern is protecting the cable or raceway from physical damage by nails or screws which might penetrate the wood member and pierce the conductors.
The exercises above are concerned with weakening the building structure and refer to the 2006 edition of the International Residential Code®, published by the International Code Council.