theoretical complexity: %%strength

Some peers (such as Lu) are good at climbing the corporate ladder. Someone must play the leadership roles in those MNC Asia offices, so if Lu has a strong track record he would get it. In Asia, I feel left behind on the slow track – painful, disappointing. In the US, immigrant techies are less likely to climb up (except some Indians). I often feel an inner competitive strength due to those competences that my peers are usually lacking, such as
– Threading,
– algos and data structures
– SQL hacks
– Perl/linux hacks
– math
– (non-trivial) jargon

These are among my top 3 competitive strengths. My sweet spot domains are typically

  • Complex
  • theoretically, and academically demanding, at least for the uninitiated
  • entry barrier
  • High value and high impact on the project
  • portable, unlike Quartz knowhow

In the US I have such opportunities, though nothing guaranteed.

BS-E is PDE not SDE

I believe BS-equation ( a famous PDE) is not a Stoch differential equation, simply because there’s no dW term in it.

A SDE is really about two integrals on the left and right. At least one integral must be a stochastic integral.

Some (not all) of the derivations of BS-E uses stochastic integrals.

2012MS IV:func2back-scan any container n print every Other item

The umbrella question — write a utility function to iterate any container and print out every Other element backwards?

Good coding practice! I think this is all about iterator syntax knowledge (my weakness) not algorithm (my strength)!

Note this is really about knowledge not  coding abilities. QQ not ZZ.

Iterator declaration is a can of worm 😦 I might need to give up on this.

#include <iostream>
#include <vector>
#include 	<list>
#include <set>
using namespace std;

template<class _InIt>  void printAlternateItem2itr(_InIt _First, _InIt _Last){
	bool flag = true;
	// if the iterator is from rbegin, then ++ would reverse it!
	for (_InIt it = _First; it != _Last; ++it, flag=!flag) {
		if (flag) cout << *it << ' ';
	cout << endl;
template <typename CONT> void printAlternateItemBackward(CONT cont) {
	printAlternateItem2itr(cont.rbegin(), cont.rend());
int main() {
	//vector<int> cont = { 11,2,3,4,5,6,7,18 };
	//list<int> cont = { 11,2,3,4,5,6,7,18 };
	string cont = "0123456789a";
	set<int> cont2 = { 11,2,33,44,55,66,77,88,99 };
	int arr[] = { 11,2,3,4,5,6,7,18,9 };
	int size = sizeof(arr) / sizeof(arr[0]);
	printAlternateItem2itr(arr, arr + size); //forward only

Q: is comparison defined on all iterators?
A: now I think linked list doesn’t. Now I think only random access itr does.

%%Q: what’s the signature of STL find()? I will use those declarations of iterators in my function. (Actually the map ans set containers have member functions find() outperforming std::find)

%%Q: from a const container, can u get a non-const iterator?

Q: why don’t you take a container as input? Why must you take iterators?
%%A: it’s more common to take iterator, but in this case container will do. All containers provide rbegin() or begin() including string. Raw array doesn’t but the iterator increment won’t work for raw arrays anyway.

Separate question
Q: OO design — how would you represent Order state transition graph in an OMS?

semi-retirement jobs:Plan B#if!U.S.

I had blogged about this before, such as the blogger-pripri post on “many long term career options”

Hongzhi asked what if you can’t go to the US.

* Some Singapore companies simply keep their older staff since they still can do the job, and the cost of layoff is too high.
* Support and maintenance roles
* Some kind of managerial role – not my strength
* Teach in a Poly or private school
* Run some small business such as Kindergarten with wife

pre-retirement planning – work till 70 in U.S.

Bigger than property investment, bigger than CPF annuity, bigger than my unit trusts is … healthy working condition.

Remember Connie’s PR chart? My Prime years could extend to 70.

In the US I could work till 70 and possibly branch out to other domains of specialization. Singapore only respects medical specialists.

Q: what aspects of health?
A: diet, fitness
A: weight
A: cardio
A: sleep

low-churn professions often pay lower#le2Henry

category – skillist, gzThreat

I blogged about several slow-changing professions — medical, civil engineers, network engineers, teachers, quants, academic researchers, accountants (including financial controllers in banks).

My overall impression is, with notable exceptions, many of the slow-changing domains don’t pay so well. We will restrict ourselves to white-collar, knowledge intensive professions.

Sometime between 2013 to 2015, a tech author commented — compared to the newer languages of javascript, ruby, objective-C etc, java programmers are a more traditional, more mature, more stable, more enterprise community. is my comparison of java, c#, c++. Basically I’m after the rare combination of

– mainstream,
– sustained, robust demand over 15 to 30 years
– low churn

Someone mentioned entry barrier. Valuable feature, but I think it is neither necessary nor sufficient a condition.

SQL and shell scripting are good examples. Very low churn; robust demand, mainstream. Salary isn’t highest, but decent.

app owner^contractor#German6Y

Q: Look at my current per-hour value-add to the team. How many percent of that value-add is portable to next 2 jobs?
%%A: I feel it’s usually rather low. Mostly about local system knowledge.
%%A: current value-add/hour increases over the years and grows with relationship.

In the big banks, many team managers really need a owner-developer, a system expert ( …as German said) to remain with the system for 3-6 years. However, on Wall St and London, there’s a long tradition of hiring (proven) high-caliber contractors as the big guns to get through a tough project.

eg: Song Jun
eg: Rob in the Stirt tech team

Also, from budgeting point of view, a system needs a long-term owner (like BAU), whereas a project needs temporary manpower. So that’s one difference between a lead developer vs a contractor.

The owner-developer often earns more, but ownership is not guaranteed simply by staying for x years because

  • there may be other old-timers
  • even after 4 years some parts of the system may still be unfamiliar to you
  • even after 10Y on the system, you have below 50/50 chance to build credibility and position to convince everyone to follow your suggestions. Look at Kevin’s influence after just a few years on the system.

For me, it doesn’t make sense to get very familiar with a local system and become efficient and a “powerful” local system expert. Yes the manager would appreciate my value but

  • it often takes 2+ years and a lot of learning effort (Does it cause aging? Only if excessive stress.)
  • Still, for many years the existing experts may remain more powerful than you, so manager may not appreciate your value as much as you expected.
  • the learning effort takes away from my “body-building”
  • Depending on context, it offers only 50% protection from job loss. Sadly, due to lack of body-building, you may become weaker on the new job market.
  • the appreciation seldom translate to meaningful compensation

Tower property i.e. law of iterated expectations

cat: mathStat

E Y = E [ E Y|X ]

I find this "theorem" too abstract and can be presented more intuitively.

Key – the E is unconditional expectation except in the inner context.

Discrete Example — I invest in 6 funds from Vanguard; wife invests 3 funds; grandma invests 2 funds. Each fund posted a return over the last calendar year. What’s the average return across my family? For simplicity assume $1k in each investment.

One way to look at is "how often does each value of Y contribute to the average"

The "E Y" method counts how many times FundA shows up in our combined portfolios, regardless the individual.

The E [ E Y|X ] method counts the relative weight of FundA within my portfolio first, then multiplied by the relative weight of my portfolio within the family.