Tag: calculation

Dec

Bezier curves prefer tea

My maths professor was hammering on the fact that Citroen used Bezier curves to make sure their cars have aesthetically pleasing curves. Again. (This is not a sponsored post from the automaker). While I appreciate his effort in trying to make what I’m learning relevant to the real world, I kinda got the idea that […]

Aug

Negative sales targets and percentage commissions

A while ago, I received an email from a distraught salesman. He believed his sales commissions were wrongly calculated, and asked me to shed some light. Note that I’m not using the exact numbers he gave in his email. The story goes that Michael (as I’ll call him) and his colleagues were given sales targets […]

Jul

Revenue sharing and operations research – part 3

This is a mini-series on how revenue sharing and operations research are linked. You might want to read part 1 on the specific business problem I was solving, and part 2 for the mathematical formulation of the problem. In this final part, I’ll tell you what was the solution eventually used. First, although I said […]

Jan

Calculating column widths in Excel Open XML

Commenter Roie said that the formula for calculating column widths in Excel Open XML should still be manageable. This is despite the scary formula mentioned before: width = Truncate([{Number of Characters} * {Maximum Digit Width} + {5 pixel padding}] / {Maximum Digit Width} * 256) / 256 So I put on my explorer’s hat, and […]

Jan

Remember to change the year too

There were occasions when I was to increment or decrement some date value by one month. For example, “200806” to “200807”. No, I don’t have any disaster-insider-programmer stories to share. Although there was this fellow who forgot to change the year which resulted in a financial fiasco… Anyway, this is more like a reminder to […]