central features of WPF

After studying (50%?) of the most popular wpf features at a superficial level, I now feel at the “center” of the features are
– data binding from VM to visuals
– DProp

Many important features grow (extend, borrow) from the center
– 2-way data binding
– binding from visual to visual
– data triggers
– property triggers? based on DProp
– AProp? based on DProp
– command binding? borrows from data binding
– Most controls rely on data binding
– Most controls expose a lot of dependency properties, and these are easily programmable in mere xaml
– a huge variety of requirements are now achievable in xaml without any c# code, largely due to the simple ideas in the “center”.

itemsControl.Items ^ ItemsSource ^ itemsCollection

Any time you have a collection to show, ItemsControl and subtypes ListBox/ListView are the most popular choices. ItemsControl.Items is a property, whose type is ItemsCollection. By the way, ItemsCollection is a subtype of CollectionView — sorting, filter etc.

For Data binding, the target must be this.ItemsSource, not this.Items. Once using that, Items.Add() will trigger *runtime* exception. Instead, add to the data-bound physical collection instead. That collection is usually an ObservableCollection. After you add to it, the screen will auto-refresh, without any intervention.

Under the hood, I believe After the add/remove, the data binding engine queries the physical data and refreshes the display. Just put a breakpoint on the getter of the added item.

strength/weakness in SG dev talent pool

+++ core trading engine green field development, not just maintenance
+++ [d] java keywords and syntax nitty gritty
+++ [d] threading, data structure, STL
+++ [d] integration of MOM, dispatchers, queues, threads in a high volume design
+++ java and c++
+++ sybase
+++ [d] DB tuning
+++ unix
+++ bond math
+++ tibrv
+++ complex query
+ MOM
+ concurrent package
+ [d] low latency techniques + theory
+ swing
+ java mem mgmt
+ pre-trade quote pricing
+ trade execution, order matching
+ marking, pnl
+ design patterns
+ ECN

– greeks
– unix tuning for low latency
– python
— mkt data
— FIX
— c#. Many candidates have c# and c++

[d = details]

## low latency – key expertise4GTD

I talked to a few big and small low-latency shops. I feel latency optimization is “low-logic, high speed, high throughput”. Below are the Expertise required, but in any real system, you will see diminishing return on each aspect, so remember to prioritize the cost-effective areas to optimize. See my post on 80/20 (http://bigblog.tanbin.com/2012/03/8020-rule-dimishing-return.html)

* threading
** parallel lock free threading but sometimes we can’t avoid inter-thread-comm (condVar)
** [L] try every technique to avoid locking (such as immmutables)

* [L] low-level memory management — custom allocators, custom (or disabled) garbage collectors
** care and feeding of java GC
** try every way to avoid non-deterministic garbage collection

* in-memory data stores — KDB etc
** This is how secDB compensates for some of the performance drawbacks
** state maintenance in memory — important in many OMS, DMA, exchange connectivity engines.

* try every techniques to avoid RDBMS
** use flat files

* low-latency messaging — 29West, tibrv messaging appliance …
** [H] async MOM is the only choice for high volume systems
** multicast is the de-facto standard

* OS monitoring and optimization
** dtrace
** network utilization
** paging activity
** cpu utilization

* [L] socket programming customized
* avoid ethernet collisions
* [H] avoid choke points, promote multi-lane highways
* [H] connectivity, collocation
* [L] serialization – customized
* [L] powerful hardware, FPGA
* [H] scale out – important
* 64 bit
* realtime java vs C++
[L] = low-level
[H] = high-level architectural feature

c++tough MS commodity desk IV – Aug 2010

Q: when would u turn on dirty read?????

Q: You have been consulting… Any reason you are coming back to S’pore?

Q: can you tell me some of the drawbacks of stored-proc?

Q: challenges in database refactor?

Q: technical/project challenges you faced in your career?

Q: how do you put across your argument in that challenging situation?

Q: when I enter some.pl in a shell, what happens?

Q: 3 threads are adding/remove/reading single elements in a hashmap. How do you optimize synchronization?
A (now i think): i guess lockfree is perhaps the best
A: concurrent hashmap with each segment holding multiple keys
Q: but if remover and reader use different keys, then why should they wait for each other?
A: perhaps segment should hold just one key?

Q: what other maps beside hashmap?
A: treemap, a red-black tree
Q: what’s a red-black tree?
A: perhaps a balanced tree
Q: how is it balanced?
A: perhaps by shifting the root?

Q: What are the list implementations?

Q: is insertion faster in linked list or array-based list

Q: is insertion faster in linked list or hashmap

Where is c++ used? quant lib for risk, PnL and trade booking. Is c++ going away? no.

2 main specializations — physical scheduling + risk including pnl attribution

smart ptr is 50% similar to a raw ptr

I’d say it’s 90% different and 10% similar to a raw ptr. Smart pointers are class objects, way beyond 32-bit pointers. smart pointers overload de-referencer and many other operators to “look like” a raw pointer, but it’s really a class-template (Avoid the non-standard “template-class” jargon)

– pbclone? A raw pointer is always passed by clone (bitwise clone), just as in java. Smart pointers override copier (and op=), so a new instance is created based on the RHS smart pointer instance. Is this pbclone or pbref? I’d say more like pbclone.
– When you use a star to dereference a raw ptr, you simply dereference (unwrap) the real pointer. Smart pointer dereference is a high-level user-defined operation. There’s a get() method to return the  real pointer, but I think we seldom need it.
– Similarly, you use an arrow to access a member of the pointee object, without the get() method.
– You can up/down cast raw pointers, not smart pointers.
– a raw ptr can be cast to void ptr. A smart ptr can’t.
– Raw pointers are key to virtual functions, not smart pointers.
– Creation and initialization is simple for raw pointers.
– size? A Smart pointer exceeds 32 bits except intrusive_ptr
– raw ptr has tight integration with arrays, with pointer arithmetic. Not smart ptr.
– double ptr sematics with 2 stars is natural for raw ptr, not smart ptr
– delete
– new? we can put raw ptr as lvalue of a “new” expression
– null assignment

In conclusion, raw pointers are such a part of the fabric. As a crude analogy, an e-book can feel like a paper book, but you can’t fold corners; can’t write anywhere using any pen; can’t spread 3 books out on your table; can’t tear off a page; can’t feel the thickness