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.

Advertisements

std::lock_guard simple idiom]coding IV

Since this data type is designed as a stack object i.e. scoped variable, simply declare (and initialize) this object within curly brackets. When this variable goes out of scope, the object behind the variable gets destructed.

In fact, the compiler sets up this sequence of events.

{
std::lock_guard<std::mutex> aLocalLock(sharedMutex);
someMutableShared ++;
}

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.

[12]MS IV:func2back-scan any container,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 };
	printAlternateItemBackward(cont);
	printAlternateItemBackward(cont2);
	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 and 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 tech roles
* Some kind of managerial role ? I guess I am mediocre but could possibly do it, but i feel hands-on work is easier and safer.
* Teach in a Poly or private school ? possibly not my strength
* Run some small business such as Kindergarten with wife

pre-retirement planning: work till70]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 beyond 55, towards 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.

https://bintanvictor.wordpress.com/2014/11/03/technology-churn-ccjava-letter-to-many/ 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.