operator<<() needs2be declared(!defined) ]header

(no need to publish on main blog…)

I spent many hours debugging because my operator<<() for my custom class is not picked up at run time. Some default operator<<() was picked up.

It turned out my code is defined in a cpp file but needed in the header file to be picked up.

Would nm or gdb have helped?

## c++topics seldom quizzed

(master -> pearl)

 

some low-level details I thought would be popular but seldom asked:

* L-value

* iterator types and implementations

* static variables outside classes

* implicit acts of magic by compiler

* array and cStr – syntax, memory, … the gory details beyond the basics

* template specialization

* ref/pointer typedef inside  templates

* non-dummy-type args in template

* MI

* enum

* exception spec

* C integration
* pimp

* fwd declaration

* namespace

* linker

* extern

* double pointers

* hiding rule

* swap – all the important usages and no-fail

* overloading and  method resolution

* casting and conversion

*** OOC and  conversion ctor

— “mid-level”

* boost Any vs Variant

* i/o stream

* regex

* file access (including random)

* serialization

* memory leak detection

* details of boost thread

* boost smart pointer beyond the shared_ptr

* std::string details

 

 

non-intrusive test – if current process has admin privilege

Just run qq(openfiles) command.

See https://groups.google.com/forum/#!topic/alt.msdos.batch.nt/1dnlamNqZ7U

==============================

Information in this message is confidential. It is intended solely for the person or the entity to whom it is addressed. If you are not the intended recipient, you are not to disseminate, distribute or copy this communication. Please notify the sender and delete the message and any other record of it from your system immediately.

==============================

Fwd: Ubuntu laptop you set up for me

(See also post on “why invest so much in c# and detailed technical knowledge” in the 610610 blog.)

I often feel a persistent self-doubt about the hands-on learning curve. It often feels too stiff and time-consuming and I wonder whether it’s worth the effort. I mean, will I ever use this c++@linux PPS skill?

(Luckily, the algorithm type of coding IV doesn’t involve a lot of infrastructure set-up…..)

Well, I see no better directions for professional growth. The few good directions are quant and c#. I feel c++ is more strategic. IF this is indeed strategic (as mentioned in the earlier mail), then this effort would give me a real edge over my competitors. Every one of them must go through the same learning curve but very few are willing to.

Perhaps most important of all, this c++ skill opens up a new area of job opportunities as we age.

In interviews and work projects, hands-on coding ability is essential.

I believe some hardcore interviewers (esp. in the US) are very picky about hands-on coding capabilities esp. in algorithms. Beside that, candidates may need IDE familiarity. The Other PPS skills (see earlier mail) may not be easy to test during interviews.

Is there a self-improvement free of self-doubt? I feel the reality is that most serious self-improvement efforts have an element of uncertainty, so when the going gets tough self-doubt is inevitable.

———- Forwarded message ———-
From: Bin TAN (Victor) <tiger40490@gmail.com>
Subject: Ubuntu laptop you set up for me – thanks

Ubuntu laptop you set up for me – thanks

c++ testbed linux laptop requires

* socket lib
* pthreads
* STL
* USB drive
* browser – to download/backup code
** windowing system
** ideally wireless connectivity

———- Forwarded message ———-
From: Bin TAN (Victor) <tiger40490@gmail.com>
Date: 18 May 2013 00:19
Subject: Ubuntu laptop you set up for me – thanks

Hi XR,

I have now used “your” Ubuntu laptop a few times. I am grateful that you helped set it up in you Warren St home back in 2012. Before asking you I thought over and over for months. After the installation I was hoping that I could one day find the energy and motivation to practice linux programming on it, which was a big big dream given my unfamiliarity with linux dev tools and and with practical c++ dev. Finally i'm able to realize my big dream. I now feel a bit comfortable coding c++ on linux. A tiny step is a giant step!

I had previously hit so many hard times “taming” eclipse and Visual Studio in my last 15 years. Painful experience. A much nicer “fast-track” to get hands-on c++@linux practice would be a full time job, where all tools are already set up, and you have colleagues to help with those basic get-up-to-speed problems.  In fact, my recent c# work was such a fast-track. On my own, any one of these basic problem could kill my entire endeavor. But this endeavor is a strategic investment for me.

Conceptually, I divide my c++ “investment” between theory and practical-problem-solving (PPS). I always have a deep respect for practical problems – like permission-triggered misleading errors, IDE mis-config, connectivity, hangs, registry, jar/dll version issues, event log tracking … A problem is easy problem if you find the real error message in 30 minutes. Learning PPS takes a lot of time and frustration but isn't useful for interviews. Most interviews cover no PPS. The most I had was a 2-hour onsite coding, but it only involved “easy” problems.

However, for various reasons, to grow up as a c++ guy I have to allocate some “investment” (10%?) into PPS. Right now it's just 3% — i spend the other 97% of my c++ time reading and writing toy programs in a sandbox.

Most (perhaps 60-90 out of 100) of the c++ trading apps use linux.( Also 30 – 60% of them use windows. Some use both linux and windows.)

You are also right about visual studio being the dominant c++ IDE on windows. Earlier I was using eclipse and other IDEs on windows c++ but now I have also tried visual studio c++.

— TAN, Bin (Victor) http://blog.tanbin.com

STL algorithms — for IV

Many essential IV tasks are container methods, but this post is about STL algorithms.

— Tier 1: custom for() loop. More heavily quizzed than all other algorithms

— Tier 2:
find()
find_if() + filter
copy() + back_inserter
copy() + ostream_iterator
swap()
reverse()
sort() + comparitor. For random access iterators only i.e. vector/deque. Only these 2 containers. Yet sort() is important to IV because … hold your breath… because vector commands 50% “market share” among all IV containers.

— Tier 3:
container.erase + remove()
count()
for_each()

— Tier 9:
transform()? I guess interviewer can't assume all candidates use it regularly
all the rest

recent C++ benchmarking

3/10 – whiteboard coding, esp. with STL
This is one area my blogging is less effective

7/10 – syntax details — challenged only in one online test. Failed only on mostly stupid unrealistic context.

9/10 – internals, deep under, the drill-down WHYs

8/10 – comp science algo + data structure

– practical design?

Self-Rating is against my peers. Even if i'm 9/10 on something, I could come up against 2 candidates stronger than me, and I would then feel like 7/10.

STL – what to study, what to avoid

— practice/master
printing
construction
add/remove/update
search
sort
find()
copy()
back_inserter
? nested containers? time-consuming to memorize. Similar to java
— study
thread safety
stack/queue — container adapters
container of pointer
container of RTTI objects
specialize a container for a given type?
use const liberally

— avoid:
priority queue
deque
hashset/map
custom allocators
custom iterators?
the least important 80% of algorithms

latency – additive

…. (see post in pearl blog)
[1] with the latest FX rate applied.

At time 140+3x, the same execution msg could be “enriched” then routed to the FX dealer. The dealer earlier gave a quote of USD/JPY of 100.50/1 to the exchange, and the exchange marks up to 100.00/99. Now the trade is already executed in a Japanese exchange to buy a stock for JPY 1 mio. The US broker needs to pay for it by selling USD. As market taker, broker sells USD at the “worse” price of 100.00. Between time 50+x and 190+3x, the dealer may have a new FX rate, but let's hope dealer can accept the earlier rate.

In this flow, the Japanese exchange makes money by buying USD (from broker) at 100 and selling (to bank) at 100.50. JPY amount is fixed 1 mio.

This is all trade execution time, not settlement time. At this stage, exchange, broker, and FX bank need to record the trade prices, in order to settle latter.