There is no difference in the example you have provided, but the second sentence (using by) is much clearer.
In some cases, it may cause ambiguity if you do not use by, for example:
You can avoid a lot of problems travelling on a train
This sounds like there are a lot of a problems when you travel on a train, and it is possible to avoid them.
You can avoid a lot of problems by travelling on a train
This sounds like there are a lot of problems which you can avoid if you travel on a train.
So there is some difference.
Also your last example, we don't say playing fireworks. We usually say watching fireworks, or launching fireworks depending on if we are just watching or actually participating. Also fireworks is one word.
By is optional in that case:
He celebrates the Chinese New Year by watching fireworks.
He celebrates the Chinese New Year watching fireworks.
Although they have the same meaning there is always a little more emphasis when we use by. In fact, in the case of the fireworks, using by makes it sound like a ritual or habit, whereas without by, it sounds like he is less concerned with how he celebrates.
The sentence ""That bridge has been being repaired for the past ten years" is ambiguous. It is unclear if the work started 10 years ago and has not been completed, or if multiple repairs have been made over the ten year span. Furthermore if multiple repairs have been made, it is unclear if the bridge is now repaired or not.
The sentence "That bridge has been repaired for the past ten years" is ambiguous to me too. It definitely means that the bridge is now repaired. But it is unclear if the repairs were completed 10 years ago or if the bridge has been repaired multiple times within the ten year span.
Ok, let's beat this to death so more.
The bridge was repaired 10 years ago.
It is isn't clear if this was the first repair of the bridge, the last, or some intermediate repair. It is also unclear if the bridge needs repair now or not. But 10 years some repairs were made and completed.
The bridge was last repaired 10 years ago.
The last time the bridge was repaired was 10 years ago and those repairs were completed. There may have been previous repairs. It is unclear if the bridge needs repair now or not.
The bridge was last repaired 10 years ago and it is still serviceable.
The last time the bridge was repaired was 10 years ago. There may have been previous repairs. The bridge does not need repair now.
The bridge, now repaired, ...
The bridge does not need repairs now.
The repairs on that bridge started ten years ago and the repairs are still are not finished.
The repairs started 10 years ago and were never completed over the 10 year span.
That bridge started "being repaired" ten years ago.
Repairs were started 10 years ago and have never been finished.
That bridge has been being repaired multiple times over the past ten years.
Over the last 10 years multiple repairs have been completed on the bridge. It is unclear if the bridge needs repair now or not.
Best Answer
The first thing I noticed is the poor grammar used in the explanatory text. However, let's put that aside and address your question.
This doesn't work overall. In a comparison sentence such as this one, you must use the tenses and moods consistently:
But is "The manager is having his problems" grammatical? Here, it starts getting complicated.
These are both fine and correct. You can replace "having" with "experiencing" without changing the meaning of the sentence.
However, "his problems" indicates that the problems are his, therefore he owns or possesses them, not that he is experiencing them.
When we add the matching clause, we must either repeat "problems" or skip "having":
Compare this with:
Whose fun am I having? This is a nonsensical question. I'm just having fun, not someone's fun.
However, as a counter example:
This is a correct way to say that he is experiencing his childhood. A childhood is a period of life that is experienced. A problem (in the sense of a difficulty) is not something specific, so his problems are constantly changing. I think that's why "having his problems" doesn't work, because the problems are not definite and fixed. They're not (all) the problems he has, they're just some problems he has.