Prepaid Postpaid Convergence

What’s one of the most important concerns of any business? Getting paid.

What’s the next most important concern of any business? Getting paid on time.

There’s this concept called the “prepaid postpaid convergence”, which hailed from the telecommunications industry (where I spent the majority of my professional life in). You’re probably on a postpaid mobile phone plan, where you’re charged for what you used in the previous month. Or you might be on a prepaid plan, where you dump a bunch of cash into your plan/phone/card/thingy and you can text and call until your money runs out.

This is a particular problem in the telecommunications industry because billing customers is challenging. It’s difficult to bill in one generic way to handle both prepaid and postpaid charges.

Think of it this way. I could dump $50 into my prepaid card and not use my phone for 6 months. But for 6 months, the company has to keep track of that $50. The worst thing is, depending on the billing requirements and laws in the country, the company may not include that $50 as “revenue earned”. The company can only include any monetary amount after I used some of that prepaid cash. Say I used $11.25, then the company “earned” $11.25 (even though I’ve paid $50 upfront).

Prepaid billed amounts are “future money”. Postpaid billed amounts are “past money”.

There are 3 general payment modes:

  • You used a product/service but haven’t paid yet.
  • You pay at the point of usage.
  • You pay first, but haven’t used the product/service.

The timing is important. For the purposes of this article, we won’t be strict about the point of usage and point of payment. In some restaurants, you get to eat first before you pay. I will consider that as “payment at the point of usage”, unless you intend to get a free meal and bolt the moment you get a chance to.

So why is this important to you?

The business models are different

Let’s consider the Apple App Store. You find an app you like. You purchase it. 2 business models come into play.

First, Apple charges you immediately on your credit card. You pay immediately upon purchasing the app. Apple gets the $0.99 from the credit card company, and can report that $0.99 on their profit/revenue report.

Second, the credit card company bills you the next month, including that $0.99 app you bought. You’ve enjoyed using the app first, before actually paying for it.

Apple and the credit card company have 2 different business models, even though the “product” is the same. (technically, the credit card company isn’t selling the app, they’re selling you the service of having a credit card, but to you it’s the same thing)

Web hosting companies use the prepaid model (that I know of). They may charge you for 3 years worth of hosting your website. You pay for 3 years first, then you get to have your website hosted. Even if you decide to cancel after 6 months, and you might get a 2.5 year refund back (depending on whether the web hosting company has this policy. Please check), but you still had to have paid for 3 years upfront.

I’m assuming you’re a developer. The trend is that the Internet is going to be a big thing. Let’s say you’re a startup founder. Choose your business model wisely, because it’s going to be hard to change it.

The Amazon S3 service lets you store stuff. You pay for what you use (the more data transfers made, the more you pay). This is postpaid.

iStockphoto lets you buy credits which you can then use to buy images. You pay first (in a large lump sum) then you buy images with the credits (that were bought with cash). This is prepaid.

Prepaid has this annoying thing…

It’s called “keeping track”.

Let’s say a text message costs $0.10, and you bought a prepaid card for $10. That means you can make 100 text messages.

A postpaid customer will be billed $0.70 for the 7 messages she sent in the last month. She will also be billed $1.00 for the 10 messages she sent this month (in the next month).

You on the other hand, won’t be billed. Because you already paid $10. Theoretically, you could hold onto that $10 value in your phone card for eternity. Depending on the billing requirements, the telecommunications company might include that $10 as revenue. But since you haven’t actually sent any text messages (or phone calls), it’s kinda shady since the company hasn’t rendered any services to you yet they “earned” $10 for nothing. In any case, you’ve paid $10 for nothing (since you didn’t use it).

The worst part is the telecommunications company has to store that $10 as a line entry in a database somewhere. And without any corresponding entries to “deduct” that amount. That database entry will stay there forever without resolution. The telecommunications company now officially hates you.

This is why most prepaid items have an expiry date, even if they’re virtual products and won’t decay over time. For example, iStockphoto credits last 1 year. Vouchers from movie theatres, supermarkets, restaurants also typically have a 1 year expiry date. They’re vouchers, it’s not like they’re going to wither away. But companies need to keep track of them.

When the prepaid items expire, the companies can then include the value of the items into revenue, because the customer at that point can no longer use the item, hence it’s taken as the customer had already used it.

Imagine you have to write a program and design a database to support the prepaid billing structure. Your program has to keep track of anything the prepaid customer does, and deduct the corresponding amount from the stored value in a database. Every single text message and phone call the customer makes, the program has to go check if there’s enough in customer’s stored value. Technically, there’s a switchboard that bars the customer from making a text message or phone call before the text message or phone call can be made (that’s the hardware check). Then your program breathes a sigh of relief when the stored value is gone or expired… And then the customer tops up his stored value with $50. Your program grows an unreasonable hatred for this customer.

Final thoughts

A postpaid model requires you to trust that the customer will pay you. A prepaid model lets you get money first, but keeping track might pose a small challenge.

With the Internet being real-time, the better model for online products and services is the “pay immediately” model. You don’t have to keep track of inventory (if at all) and you get the money immediately to your bottom line.

I know there’s also the subscription model. But do you charge customers for the month they haven’t yet used, or for the month they’ve already used?

I’m pretty sure I left something out, or haven’t explained something properly, so leave a comment or send me an email.

Students don’t graduate because…

… because they’ve lost hope.

They’ve lost hope that:

  • they can fulfill degree requirements (some subjects are tough!)
  • they can actually graduate
  • (more importantly) they can graduate in a shorter time so they pay less tuition fees
  • they can get a good job with that degree

And so they give up. They’ve lost hope. They don’t believe anymore.

A degree can still be useful. But the current educational and economic outlook doesn’t exactly inspire a lot of confidence in the immediate use of a degree.

Educational institutes mostly teach students towards knowledge that’s known. I mean, your professor won’t set a question that he can’t answer, right? The world we now live in rewards those who solve the unknown, possibly even seeking questions that weren’t ever asked.

Teachers need to start teaching students to face the unknowable. They need to instill hope in the next generation.

Congratulations on becoming rich!

In which I teach you 3 Chinese New Year greetings. Also, this was unscripted (mostly). I also can’t do one-take videos…

Belief is everything

You might be surprised that I’ve learnt many life lessons from books. Specifically, fantasy fiction. Today, I’m going to tell you one of them.

Warning: There will be spoilers, even though I’ve summarised a fair chunk of the book. The following comes from the book Sword of Shannara by Terry Brooks. If you don’t want spoilers, you should stop reading… now.

Gifted wrongly

I will be summarising extensively. There was this great druid. There was also this great evil (isn’t there always…). With some thought, the druid figured out how to defeat the great evil, and he forged a sword with which to do battle.

The druid decided to give the sword to another. I can’t remember why, whether out of sacrifice (didn’t want to get all the credit), or that he couldn’t fight anymore (old age). I’m sure a Shannara fan will happily correct me in the comments…

But the druid made a fatal mistake. He gifted the magic sword to the king of the elven people.

The king himself wasn’t the mistake. The position of kingship was.

The king went to do battle with the great evil and won. But a quiet cloak of belief had already settled onto the elven people. That the magic sword will only work for the king.

As a consequence of that belief, the elven people also believed that only the heirs of the king could successfully wield the great magic sword. This was wrong. The magic sword would work for any elf with the right purpose of heart. The druid had not forged any special condition into the sword.

But with mass belief, the unintended condition wrapped itself together with the magic. And eventually, it became true. Only heirs from the line of the original king could wield the magic sword.

Belief is everything

And that was one of my first life lessons. Belief is everything. Beliefs are powerful.

If you don’t believe that something will work, then it probably won’t.

If you believe you can fashion a database to support the technical aspects of your program, then yes, you probably will come up with a design to suit your needs.

Disbelief closes off possibilities.

A corollary of that is about mass belief. If many people believe in something, then that something has a lot of power. Religion, superstitions, doomsday announcements, electromagnetic waves. I’m not talking about proofs and so on, particularly with science. I’m talking purely about beliefs. Say some scientific experiment can be replicated with the same results. That convinces people of the validity of the theory behind the experiment, and thus belief in that theory. It’s still belief.

This gave me confidence and understanding of certain human endeavors. Why do some people succeed at businesses? Many people believe that starting your own business is risky. And they’d be right. And those people who succeed? Those people believe they can succeed in making their business work, overriding the disbelief from the people around them.

Belief is everything.

It’s how I’ve upheld my own beliefs in the face of every belief thrown at me from everyone around me. My family. My friends. Even strangers.

Of course, you don’t have to listen to me. “Everything” is an absolute term. But that means you do believe in something, just not my version.

Just in case you’re interested in what the magic sword can do, it does one thing only. It reveals the truth. That great evil grew powerful because of the fear from the people. Yes, the belief that the great evil is indeed very powerful and can do great harm, made the evil even more powerful. The magic sword unveiled the truth, that the great evil was simply a malevolent shadow of a man.

Politicians, scammers and liars of all sorts would fear the Sword of Shannara indeed.

Nobody told me to do that

Nobody told me to write a guide on Open XML spreadsheets, but I did it anyway.

Nobody told me I could continue publishing my own magazine, without any revenue, and armed only with the passion to spread my ideas and finding like-minded individuals, but I did it anyway.

Nobody told me to start making videos, but I did it anyway.

Nobody told me to help people with maths questions, but I did it anyway (for free).

Nobody told me to help people for free when I offer a programming guide for purchase, but I did it anyway.

Nobody told me to write a thank you email to customers when they buy from me, but I did it anyway.

Nobody told me to write blog posts here, but I did it anyway (because I enjoy writing here).

You don’t need anyone to tell you to do anything. Losing weight. Gaining muscle. Be a better speaker. Be a better programmer. Learn to dance. Learn a new language. Travel the world. Travel the world on a budget. Start a new business. Have children. Teach children. Teach someone a skill.

You don’t need the year to end, and a new year to begin, to start. If you don’t need permission from someone to start, you certainly don’t need permission from the Earth rotating about the Sun to start.

Say “I will do that.” Then go do that.

Absolutes are relative

I came upon a realisation in my first year of university. There are very few absolutes in the universe.

I was sitting in the lecture theatre, taking notes of the professor’s lesson. I was in my first year, and in my first semester, and I haven’t any friends I knew there. “Friends” were people I saw frequently (if you could call the first 2 weeks “frequently”). After two and a half years of being conscripted in the army, my brain was raring to go (about the most mentally strenuous activity I remember was figuring out how dBase IV and FoxPro work [those are database systems by the way]. Oh and how to make the records print nicely. That’s interesting, considering that I had to send letters to over 500 military personnel, and one choke of the printer sent hours and tons of paper to waste. Lining up address information on the paper could be quite challenging. Another story for another time…).

It was a maths lecture (not surprisingly…) about fundamental logic (I think). I learnt of the term “for all” (or “for every” or something similar), which is represented by an inverted capital A. For example, for all even numbers, one of the factors is 2.

This “for all” term is not used lightly. When you say, “for all”, it means for all conditions, circumstances, situations, universes, even alternate realities, that the next statement is true.

And as the professor said, all you need is one example of the statement being false, and the whole statement collapses.

A related concept is the negative. For example, “There is no such thing as a zombicorn.” First, there’s no such thing as a zombie. Second, there’s no such thing as a unicorn. Uh, I’m not going to contest you on that. Go Google it or something…

What you mean by “There is no such thing as XYZ”, is that for all conditions, circumstances, situations, universes, even alternate realities, that the statement is true. And all you need is the existence of XYZ for that statement to be false.

Because of this, the professor also said that it’s impossible to prove a negative. We just barely found Earth-sized, possibly habitable planets at the outer reaches of our exploration of space. How can anyone possibly search the entire known (and unknown) to find that one existence of proof? Have you searched all the planets out there? Do you know for sure, that there is absolutely no way that XYZ can possibly exist?

This is why I find maths interesting. Some of its concepts can be proven. For example, the statement “There is no such thing as an even number with a factor that’s 2.” All I need to disprove that statement is find the existence of an even number with 2 as a factor. For example, 6 (with 2 and 3 as factors).

Once I realised that about the only absolute statements are in maths (and possibly physics, but I suck at physics, so, yeah…), and even then those absolute statements are held in the strictest of scrutiny, I also realised that (almost?) everything is relative. Yes, I know I’m way behind some fellow named Einstein who mentioned some theory of relativity somewhat…

The notion that nothing is absolute scares the hashbrown out of some people. Those people need to know that this is right and that is wrong. That this is black and that is white. That there are clear cut lines with which they can stand behind of. That there are “right” arguments and opinions they can back themselves with.

For example, the statement “You’re always late.” really means the person is saying you’re always late in the person’s mind. Never mind the few times that you are early, because that person will conveniently forget about those instances (because of cognitive dissonance. The person had to convince herself that she’s right about you being always late, and thus fabricates proof that substantiates her opinion). Also, it presupposes that you will continue to always be late. And all you need is to be early once, and that statement is false (but cognitive dissonance will thwart your attempts at defending yourself).

This taught me to be tolerant of other people’s views. When nothing is absolute, then nothing is certain. Like I said, this scares the cranberry out of some people.

And this coming from a maths lecture. More interesting still, it came from a discipline that’s known for its strictness.

Optimising only for profit is a lousy strategy

I felt sorry for the woman when I heard she was going to be let go by the company. I felt even more sorry when I heard that she would be replaced by 3 graduates in China. Seriously, graduates were that cheap in China?

This reminds me of a Chinese phrase. “In the past, having a degree was a big deal. Now, the whole street’s filled with graduates.” Not all degrees are created equal.

Let’s start off with a few baseline understandings…

Infinity and beyond

John Cook said this about infinity,

Problems are often formulated in terms of infinity to make things easier and to solve realistic problems. Infinity is usually a simplification. Think of infinity as “so big I don’t have to worry about how big it is.”

(Emphasis mine)

Companies like infinity. Particularly when it comes to describing (theoretical) growths and market share. This is false. More on this later.

Basic economics

We will assume this simple generalised equation for the purpose of this article:

Profit (or earnings) = Revenue – Cost

You can think of revenue as the price of an item. Cost covers everything from the cost of manufacturing an item to storing the item, to paying employees, to paying rent (for use of space), to paying utilities.

Just keep in mind that profit is calculated from 2 components.

The gold standard and Bretton Woods

Back in the old days (way way back), the value of money was static. If you held on to a dollar, 10 years later, that dollar was still worth a dollar. That’s because the value of money was tied to gold.

Historically, a bank was legally responsible to give anyone gold in exchange for the money bill given. That means if you handed the bank 100 dollars, the bank had to give you 100 dollars worth of gold. This meant that banks had to keep large reserves of gold, just in case.

The invention of the money bill dollar note thingy just made it easier so you don’t have to carry around nuggets of gold. Gold’s heavy.

In July 1944, the Bretton Woods Agreement was signed. Basically, many countries agreed to tie their currency to the US dollar. The US dollar was tied to the gold standard, so this wasn’t a problem. (This was part of the reason why US rose to be a dominant force in the world in the early days, because practically everyone was using the US dollar as a reserve currency)

In August 1971, the United States stopped the convertibility of the US dollar to gold. It might have something to do with funding the battles of the Vietnam War. The US ran out of funds. To continue funding, the US needed to print money out of thin air. And you couldn’t do that if your currency was pegged to gold. (Note: I’m not bashing on Americans. I read this in an economics book. No I can’t remember which book… you should know me by now…).

This also “freed” the other countries from tying their currencies to the US dollar. Which (probably) gave rise to the idea of foreign currency exchange rates.

The dissolution of the Bretton Woods Agreement also meant the creation of fiat money. Meaning that dollar you have there is worth what the government say it’s worth. Printing money out of thin air also gave rise to the concept of inflation. Meaning that dollar you have there is probably worth less than a dollar a year ago.

Saturation limits

31 October 2011 was designated as the day when the world population became 7 billion. It’s a big number, but it’s not infinity.

Which is where the companies made their mistake.

In the post-World-War-2 era, everyone wanted a better life. We’ve sacrificed enough. We’ve suffered enough. We want a better life! (baby boomers, hello!)

Babies were made. Population grew. Household appliances made their ways into homes. Henry Ford created the automobile. Product categories multiplied. Industries boomed.

Revenue was up. Sales quintupled. Profits were up.

Just when local markets seemed exhausted, globalisation came and opened up the world. International trade continued the seemingly upward trend.

People started expecting growth as a natural consequence. Companies started paying more attention to Wall Street and upholding shareholder value.

“We just need to capture 1 more percent of market share!”

That started to get harder. The customers who wanted to buy your product had already bought your product.

I read that in America, there were more licensed vehicles than licensed drivers. Meaning there were more vehicles than people who could drive them. I understand there’s a surplus of 31 million of such vehicles. Supposedly, every man, woman and child in Canada could have a vehicle from this surplus.

There are probably more cell phones than cell phone users. There’s more food produced than needed to feed every person in the world (yet there are millions starving).

What happens if Microsoft succeeds in placing a computer (with Windows, naturally) on every desktop and in every home? What happens if Apple succeeds in placing an iPhone/iPad in everyone’s hands? What if everyone has already bought Angry Birds on their iPhone/iPad? What happens if McDonald’s succeeds in getting everyone to eat at their restaurants? What if everyone used an Oral B toothbrush? What if everyone used Body Shop products? What if every male used Old Spice?

What if every business person is already flying with your airline? What if every Harry Potter fan already has all 7 books? (that’s probably a rhetorical question…) What if every C# programmer already owns a copy of your C# programming book? What if every tea lover in your area is already frequenting your tea house?

What if every possible customer already has your product? What if every possible customer already maxed out his/her rate of consumption of your product?

The natural limit is population. The next limit is rate of consumption. Every company hits these 2 limits. The limits just weren’t as prominent a couple of decades ago.

Revenue started stalling

When you hit those natural limits, the company growth stalls. To give the illusion of growth, we go back to that equation again.

Profit = Revenue – Cost

The outside world (mainly Wall Street and the stock market) views growth in relation to profit. The assumption is that if a company is making a profit, it’s still healthy. As in it’s still bringing in revenue.

But if you’re not bringing in revenue, it means you’re not making any more sales. Maybe it’s because your customers switched brands. Maybe your customers switched to a cheaper version of your product (which cannibalises on your own sales, but hey at least you didn’t lose that customer).

But in today’s hyperconnected world, the reason is probably that your customer “market share” is already saturated. You might think 7 billion people is still a lot of people, but a large part of those people are in poverty. They simply cannot buy your product. Or those who can buy your product, don’t want your product.

Some new startup shows up and gets millions of users within a month. It continues at a steady pace and then… stops. The natural equilibrium is reached.

The company CEO has to do something to show that the company is still growing (because the people watching Dow Jones is breathing down her neck). So if revenue doesn’t increase as much, what can you do to increase profits? Reduce costs.

Cost reduction policies

I’d say as a broad generalisation, there’s only so much you can do to reduce costs. Rent space? Consolidate people and equipment in fewer locations. Equipment maintenance costs? Have less equipment, or more efficient equipment, or just get rid of the whole thing.

But one of the most costly line items (if not the most costly) is hiring people. (Be honest. Tell me when I said “cost reduction” you didn’t think of “layoffs”)

Let’s see. The world population is growing (albeit more slowly now). Generally speaking, more people are working (I know the current economy sucks with few jobs being created. Stay with me). Less people are dying. More people are having longer lives. Less opportunities to move up the corporate ladder (because the high level managers are still there).

Yet people still expect pay raises every year. I’m not pro-Malthusianism, but the supply of money is kinda limited… Wait, good thing the Bretton Woods Agreement was dissolved.

Since people have feelings (and machines and raw materials don’t), companies hesitate to fire people (in case of major backlashes). So something has to give.

Outsourcing (the bad kind). Mergers and acquisitions (probably where the term “wholly owned subsidiary” came from). Subtle changes in accounting books (which is illegal, don’t do it).

Anything to create the illusion of growth and profits. (And with the fiat currency system, money itself is kind of an illusion. But that’s another topic…)

It’s made people commit suicide to make an iPhone. It’s made people to over-consume (creating obesity as a problem and the dieting industry to exist). It’s made people buy houses they couldn’t really afford. It’s made people to allow those people who couldn’t afford houses to buy houses.

It’s made people look for shallower qualities in marriage partners (diamonds, big car, big house, big breasts [I hesitated on including this one], big paycheck), which caused increasing divorce rates, which increased the number of divorce lawyers needed, which increased the number of real estate agents needed (to split the property).

It’s caused the dot com bust. It’s caused tech startups to look for the fastest exit strategy, because the venture capitalists backing the startup forced the founders to do so (so the VCs could get their return on investment).

Optimising only for profit is a lousy strategy.

Pictures in Excel have way too much power…

You’d think inserting a picture into an Excel worksheet is pretty straightforward. If you’re just inserting the picture, then it is.

Then you check what other properties you can play with manipulating the picture. Woah amigo! There’s a whole plethora of options!

Excel picture format options

That’s like giving the typical user a (good enough) subset of rendering functions, including 3D. And here I thought you could just resize the picture, and maybe rotate it… If you’re not going for full 3D manipulation as in OpenGL or DirectX, Excel will do it for you.

Excel respects alpha/transparency of the picture (right now, I only know of PNG images that contain alpha information AND is fairly prevalent). And you can outline the picture and fill the transparent portions with a colour.

SpreadsheetLight picture fill and outline

You can even do shadows!

SpreadsheetLight picture shadows

Do you know it can take a phenomenal amount of work to get shadows working in 3D renderings? You’ve got to know the light source position, calculate the rays of light blocked by an object to create the illusion of a shadow (by creating a polygon that’s the outline of that object as described by those blocked rays of light). Well, technically speaking, Excel has got it easy, since the object is always a rectangle (an image).

Speaking of light, we can also do reflections. Let’s run a full gamut of the 3D power.

SpreadsheetLight 3D pictures

I lost the software keys to my 2 3D rendering software (Bryce 4 and TrueSpace). It sucked that I couldn’t render landscapes anymore… But, I’m seeing Excel as an alternative to getting some 3D-ish images.

Well, the above screenshots were from a spreadsheet generated by my software library, SpreadsheetLight. The library is based on the Open XML SDK, which in turn is based on what Excel can do. Here’s how the source code looks like:

SLDocument sl = new SLDocument(SLThemeTypeValues.Oriel);

SLPicture pic;

sl.SetCellValue(2, 2, "Accent 1");
sl.ApplyNamedCellStyle(2, 2, SLNamedCellStyleValues.Accent1);
sl.SetCellValue(2, 3, "Accent 2");
sl.ApplyNamedCellStyle(2, 3, SLNamedCellStyleValues.Accent2);
sl.SetCellValue(2, 4, "Accent 3");
sl.ApplyNamedCellStyle(2, 4, SLNamedCellStyleValues.Accent3);
sl.SetCellValue(2, 5, "Accent 4");
sl.ApplyNamedCellStyle(2, 5, SLNamedCellStyleValues.Accent4);
sl.SetCellValue(2, 6, "Accent 5");
sl.ApplyNamedCellStyle(2, 6, SLNamedCellStyleValues.Accent5);
sl.SetCellValue(2, 7, "Accent 6");
sl.ApplyNamedCellStyle(2, 7, SLNamedCellStyleValues.Accent6);

pic = new SLPicture("mandelbrot.png");
// anchor at cell (4,2) with 0 horizontal and vertical offsets.
pic.SetRelativePositionInPixels(4, 2, 0, 0);
sl.InsertPicture(pic);

pic = new SLPicture("mandelbrot.png");
pic.SetRelativePositionInPixels(4, 6, 0, 0);
pic.SetSolidFill(DocumentFormat.OpenXml.Drawing.SchemeColorValues.Accent3, 20);
pic.SetSolidOutline(DocumentFormat.OpenXml.Drawing.SchemeColorValues.Accent4, 0);
pic.SetOutlineStyle(4, DocumentFormat.OpenXml.Drawing.CompoundLineValues.Double, DocumentFormat.OpenXml.Drawing.PresetLineDashValues.LargeDash, DocumentFormat.OpenXml.Drawing.LineCapValues.Round, SLPicture.SLPictureJoinType.Bevel);
sl.InsertPicture(pic);

sl.AddWorksheet("Sheet2");

sl.SetCellValue(2, 2, "Accent 1");
sl.ApplyNamedCellStyle(2, 2, SLNamedCellStyleValues.Accent1);
sl.SetCellValue(2, 3, "Accent 2");
sl.ApplyNamedCellStyle(2, 3, SLNamedCellStyleValues.Accent2);
sl.SetCellValue(2, 4, "Accent 3");
sl.ApplyNamedCellStyle(2, 4, SLNamedCellStyleValues.Accent3);
sl.SetCellValue(2, 5, "Accent 4");
sl.ApplyNamedCellStyle(2, 5, SLNamedCellStyleValues.Accent4);
sl.SetCellValue(2, 6, "Accent 5");
sl.ApplyNamedCellStyle(2, 6, SLNamedCellStyleValues.Accent5);
sl.SetCellValue(2, 7, "Accent 6");
sl.ApplyNamedCellStyle(2, 7, SLNamedCellStyleValues.Accent6);

pic = new SLPicture("mandelbrot.png");
pic.SetRelativePositionInPixels(4, 2, 0, 0);
// transparency 0%, blur 6pt, angle 90 degrees, distance 3pt
pic.SetInnerShadow(DocumentFormat.OpenXml.Drawing.SchemeColorValues.Accent1, 0, 6, 90, 3);
sl.InsertPicture(pic);

pic = new SLPicture("mandelbrot.png");
pic.SetRelativePositionInPixels(4, 6, 0, 0);
// transparency 50%, horizontal size 100%, vertical size -23%, horizontal skew -13.34%, vertical skew 0%
// blur 6pt, angle 45 degrees, distance 3pt
// origin at picture's bottom left, don't rotate with picture.
pic.SetPerspectiveShadow(DocumentFormat.OpenXml.Drawing.SchemeColorValues.Accent2, 50, 100, -23, -13.34m, 0, 6, 45, 3, DocumentFormat.OpenXml.Drawing.RectangleAlignmentValues.BottomLeft, false);
sl.InsertPicture(pic);

sl.AddWorksheet("Sheet3");

sl.SetCellValue(2, 2, "Accent 1");
sl.ApplyNamedCellStyle(2, 2, SLNamedCellStyleValues.Accent1);
sl.SetCellValue(2, 3, "Accent 2");
sl.ApplyNamedCellStyle(2, 3, SLNamedCellStyleValues.Accent2);
sl.SetCellValue(2, 4, "Accent 3");
sl.ApplyNamedCellStyle(2, 4, SLNamedCellStyleValues.Accent3);
sl.SetCellValue(2, 5, "Accent 4");
sl.ApplyNamedCellStyle(2, 5, SLNamedCellStyleValues.Accent4);
sl.SetCellValue(2, 6, "Accent 5");
sl.ApplyNamedCellStyle(2, 6, SLNamedCellStyleValues.Accent5);
sl.SetCellValue(2, 7, "Accent 6");
sl.ApplyNamedCellStyle(2, 7, SLNamedCellStyleValues.Accent6);

pic = new SLPicture("mandelbrot.png");
pic.SetRelativePositionInPixels(6, 3, 0, 0);
pic.SetFullReflection();
// width 6pt, height 6pt
pic.Set3DBevelBottom(DocumentFormat.OpenXml.Drawing.BevelPresetValues.Convex, 6, 6);
// width 3pt, height 4pt
pic.Set3DBevelTop(DocumentFormat.OpenXml.Drawing.BevelPresetValues.ArtDeco, 3, 4);
// extrusion colour transparency 0%, extrusion (or depth) height 15 pt
pic.Set3DExtrusion(System.Drawing.Color.Green, 0, 15);
// contour colour transparency 40%, contour width 4pt
pic.Set3DContour(DocumentFormat.OpenXml.Drawing.SchemeColorValues.Accent3, 40, 4);
pic.Set3DMaterialType(DocumentFormat.OpenXml.Drawing.PresetMaterialTypeValues.TranslucentPowder);
// 5 pt above "ground"
pic.Set3DZDistance(5);
// field of view 105 degrees, zoom 100%
// camera latitude, longitude, revolution in degrees (50, 40, 30)
// light rig latitude, longitude, revolution in degrees (0, 0, 30)
pic.Set3DScene(DocumentFormat.OpenXml.Drawing.PresetCameraValues.PerspectiveFront, 105, 100, 50, 40, 30, DocumentFormat.OpenXml.Drawing.LightRigValues.Sunrise, DocumentFormat.OpenXml.Drawing.LightRigDirectionValues.TopLeft, 0, 0, 30);
sl.InsertPicture(pic);

sl.SaveAs("Pictures.xlsx");

I use the enumerations available in Open XML SDK as far as possible. This means you can sort of port over any programs you have written using Open XML SDK. And also that I don’t have to invent my own enumerations that are essentially copies of the SDK enumerations.

One thing that confused me was the 3D rotation options in Excel.

SpreadsheetLight 3D picture rotation options

Excel used the vertical “axis” as the X value, and the horizontal “axis” as the Y value. To the user, the X, Y and Z values are like the first, second and third values of … something.

To me, X, Y and Z have special meanings, particularly when applied to the context of 3D. Those values don’t even increase in a consistent manner. The X value decreases if you use the right-hand rule (the left button), but the Y and Z values increase when you use the right-hand rule (left and right buttons respectively).

The Open XML SDK then complicates matters by using the terms latitude, longitude and revolution. Each ranging from 0 degrees to 359.9 degrees (or strictly less than 360 degrees in other words).

And in case you’re wondering about the state of the spreadsheet library progress, I froze the feature set of SpreadsheetLight for version 1. Otherwise, I’d never get it shipped. I’m now documenting the hashbrown out of the source code. The point is to make it ridiculously easy for a programmer to pick up SpreadsheetLight and start using it (without having to refer to a manual, which I’ll also be writing).

Why do we bail out the big companies?

Because if those big companies can fall and die, it reminds us that we’re not immortal too. And we’re scared of dying.

Simplifying the difficult is itself difficult

“Vincent, you will lead the task force.”
“What?!?”

The annual survey results were just delivered by the respective company directors to their respective departments. The directors would gather their department staff together, and deliver a PowerPoint presentation about the various survey results. Typically, they would also discuss what the company plans were (when relevant), or major/foreseeable changes, since everyone was gathered.

I would be slightly fearful. Because my department director knew me by name. Not that I’m singled out, since he knew many of his staff by name too. The reason was that I’m the only one with a maths background (I think he hired me because I had a maths background. He’s in charge of the billing support arm of the IT department).

The survey was conducted by an external company, and the results would contain a couple of mathematically phrased terms. The most prominent one was “statistically insignificant”. At which point, the director would say something like, “Probably only Vincent knows what ‘statistically insignificant’ means, since he’s the mathematician.”. At which point, I’d hope he didn’t ask me to explain it, because I suck at statistics…

I believe the company CEO wanted something done about the worst 2 “complaints” from the survey results. One of the survey questions was “Do you feel safe at work?” What do you mean “safe”? It’s not like the copier machine was going to eat my hand. Do paper cuts count? My office was situated beside 2 large hydrogen containers (I could see them through the window. Hey, Large Hydrogen Container = LHC. Lol…). Does that count? And no, “Do you feel safe at work?” wasn’t one of the issues.

The task force I’m to lead was to address the issue, “Do you feel safe to speak up?”. Apparently, the answer was a statistically significant “No”.

I can’t remember what the other issue was, but I was to co-run the entire task force with another person, who’d be in charge of that other issue. One of the reasons cited was “There’s no point speaking up, since no one’s listening.” (or some such). I think the more interesting point is why the word “safe” was used.

Anyway, I presented the findings in a PowerPoint presentation to the director and the high level managers. I was actually asked to create a PowerPoint that reads like a report, and submit it beforehand. I resisted, and said I could write up a proper report (in Word) if it’s required, but the PowerPoint presentation was to remain. I won. (yay!)

The presentation went off fine. I even managed to insert “Law of Large Numbers” as a point on one of the slides. Hey, I am a mathematician (a couple of the managers chuckled). I even managed to squeeze in a joke about vacuum cleaners and how something sucks.

Presentation over. Task force assembled to tackle issue. Do something about 2 worst complaints. Check.

I believe it was a difficult problem. Not the task itself, but the issue. So it’s easier to speak up to me, than it was to speak up to management? That spells a fundamental problem that a small task force wasn’t going to solve.

Yet the problem was hoisted onto my shoulders, expecting me to simplify that difficult problem into a series of simple tasks to solve that problem. Simplifying things is hard.

You simplify things very often. Ever write a function? That’s simplification. You thought about a problem, came up with some code that does something, and that could be reused. The bad programmers write functions that could be used only in certain conditions, even though they could be rephrased for a more general use. The great programmers write functions that you feel confident using, even if you don’t really know the innards of the function (and if you did look, the code will be elegant or easy to follow).

Mathematicians come up with mathematical models to describe and solve a problem as best as they could. Programmers come up with a bunch of code to describe and solve a problem as best as they could. No model is infallible, nor is any program infallible.

That’s because simplifying the difficult is itself difficult. But we can still come up with a suitably close enough approximation to a solution.