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