Is the number, which is shown above a hero's head when he receives damage, calculated with armor and magic resistance, or is it the damage before any calculations?
There are three types of damage numbers shown: Strong physical attacks, strong spells and damage ticks. Both physical and magical attacks displays the "after calculation" values, but the damage ticks displays "before calculation" values. If I have missed any kind of damage, please post in comments so I can test it and add to this answer.
Strong physical attacks
When strong physical attacks are applied on a target, normally because of a Critical Strike happening, a damage is shown on the target of the damage. The number is the post calculation value, as proved by the following screenshot.
When strong magical damage is applied on a target, specially Lion's and Lina's ult, a damage is shown on the target of the spell. The number is the post calculation value, as proved by the following screenshot.
No donkeys were harmed in the making of this answer.
Damage ticks are a whole different matter. There are spells like Venomancer's Poison Sting which deal damage per second or over time. For each damage tick, a damage number is shown on the affected hero. However, this number is before any calculation. If a hero is affected with a level 4 Poison Sting, "20" will be shown on the hero's head every damage tick. We can see that this is true by the next screenshot. Skeleton King has a 25% magic resistance. "20" is shown above his head. In the combat log, he received 15 damage.