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.
I feel it’s sometimes useful to create java objects with everything static, but use private/protected to control access.
Object state is implemented using struct. Operations on objects are implemented in static functions. C++ back to C.
I feel function pointers add lots of power.
+++ 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++
+++ [d] DB tuning
+++ bond math
+++ complex query
+ concurrent package
+ [d] low latency techniques + theory
+ java mem mgmt
+ pre-trade quote pricing
+ trade execution, order matching
+ marking, pnl
+ design patterns
– unix tuning for low latency
— mkt data
— c#. Many candidates have c# and c++
[d = details]
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)
** 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
** 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
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
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
– 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