REG Realized Gains/Recognized Gains/Basis

Does anyone have a brief synopsis on these rules for contributions to C-Corps/S-Corps and Partnerships? I feel like Becker's material is pathetic at explaining what is included or not and my lack of FAR knowledge seems to hinder me grasping this concept. Specifically, when is Cancellation of Debt included in a realized gain, and do cash contributions and receipts (by Corp/Shareholder) offset each other? This is one of the last things I really need to wrap my head around as I've all but convinced myself I'll get a simulation that asks for: Realized Gain Recognized Gain Individual Basis Corp/Partnership Basis When that happens I will panic and fail. At least this is how my dreams go. Any help is appreciated.