the base Delegate class isn’t a delegate type

Q: Why is the base Enum class not a enum type?
I feel an instance of this particular class has no integer representation, unlike an enum instance.

Q: Why is the ValueType class not a value type?
I feel this class exists to provide a suitable Equals() and GetHashCode() suitable for most structs. I feel this is like an empty abstract class. I feel it has no field, so copying a ValueType instance should not be a copy by value.

Q: why is the Delegate class not a delegate type?
I feel this type doesn’t specify a method signature and doesn’t have an inv list

what kind of entity is "str" in a python script

(Warning — for a novice introspection is overly powerful and complex in dynamic languages like python. You won’t get to the bottom any time soon.)

Everything (except literals and operators) you see in a python script is usually one of

– a variable name
– a reserved keyword like for/while, import, in,
– module name like re, string, os. I think these are actually dictionaries
– a type-friendly builtin function — you can put the identifier into type() and dir() — like round, type.
– a type-unfriendly builtin function — print, ..

* “str” is a very strange animal. It’s a function, but type(str) says it’s a typename
* “print” is a strange animal. You can’t examine it using dir(), type()

Python docs list all builtin functions, but a few won’t “type” as builtin function — str, print, type, tuple…

For this sort of investigation, you need a few instrumentation tools — str(), repr(), type(), dir(). I call these meta-functions. They operate on other functions, variables ….

print dir(type)
print dir(str)
print dir(dir)

factory-method vs in Spring

I feel there’s deeper and richer support for Notes from spring doc —

— “factory bean” vs FactoryBean —
When the Spring documentation makes mention of a ‘factory bean’, this will be a reference to a bean that is configured in the Spring container that will create objects via an instance or static factory method. When the documentation mentions a FactoryBean (notice the capitalization) this is a reference to a Spring-specific FactoryBean.

— getting the FactoryBean object itself —
Finally, there is sometimes a need to ask a container for an actual FactoryBean instance itself, not the bean it produces. This may be achieved by prepending the bean id with ‘&’ when calling the getBean method of the BeanFactory (such as the ApplicationContext bean factory).

So for a given FactoryBean with an id of myBean, invoking getBean(“myBean”) on the container will return the product of the FactoryBean, but invoking getBean(“&myBean”) will return the FactoryBean instance itself.

which city is at the spearhead of finance IT

Even if Asia IT jobs were to pay higher than US, US is still spearheading industry best practices. I’m in the financial IT space, but see similar patterns in other IT sectors.

It’s revenue share, stupid.

The more revenue a country office generates, the more budget it controls. The office usually prefers onsite development team, so that team tends to become the hotbed of innovation. For a foreseeable future, NY and London will be the hotbeds.

American vs European call option valuation

Hey Hai Tao,

My CFA textbook had a conclusion I don't believe.

Say there is a microsoft stock call option expiring 7/1/2011, X = $20, in-the-money, American style
Say there is an identical microsoft call but European style.

Assumption: the underlying stock makes no dividend or other cash payment before expiration.

Under this assumption, textbook says both call options are worth the same.

Earlier the same author said that an American option is worth at least the same as an European style option, but under this Assumption, he claims they have equal valuation.

As a Layman, my intuition tells me the American option is more valuable. Suppose my analysis tells me Microsoft might drop to $19, then the American option lets me pay $2000 today for 100 shares and sell today at $2467, earning a profit of $467. The European option may expire out of the money and worthless.

Do you agree?

some trading system modules are more necessary than others

“non-optional + non-trivial” is the key.

Context – trading systems.

I feel trade booking/capture is among the “least optional”. Similarly, settlement, cash mgmt, GL, position database, daily pnl (incl. unrealized). Even the smallest trading shops have these automated. Reasons – automation, reliability, volume. Relational Database is necessary and proven. These are Generally the very first wave of boring, low-pay IT systems. In contrast a lot of new, hot technologies look experimental, evolving and not undoubtedly necessary or proven —

* Sophisticated risk engine is less proven. I don’t know if traders really trust it.
* Pre-trade analysis is less proven.
* huge Market data often feed into research department, risk/analysis systems. I feel some small portion of market data is necessary.
* models
* Algo trading, often based on market data and models
* object DB, dist cache, cloud aren’t always needed
* MOM? i guess many trading systems don’t use MOM but very rare.

Quiz: who to "intercept" returns from a java method

Jolt: When you put in a “return”, you think “method would exit right here and bypass everything below”, but think again! If you use a return in a try{} or catch{}, it is at the /mercy/ of finally{}.

P477 [[ thinking in java ]] Only one guy can stop a return statement from exiting a method. This guy is finally, also mentioned in one of my posts on try-catch-finally execution order.

Same deal for break, continue.

equity-linked notes, briefly

From the dealer/issuer’s stand point, ELN is a debt issue. ELN is a note i.e. a short-term bond, therefore a debt to be repaid. The issuer Borrows money from the Investor and will pay it back upon maturity.

So far, this sounds like a regular bond. What’s the difference? Well, ELN is a debt issue + an equity option written by the issuer.

I believe an ELN contract typically stipulates a reference stock index. If the index gains 50% and participation rate is 80%, then investor receives $1.40 for each dollar invested — an example from This is a contractual agreement. Issuer doesn’t invest in the index.

However, if the index doesn’t gain, the investor is protected 100% but receives no interest — like a zero-coupon bond. Therefore the investor effectively buys a zero-coupon bond + an option from the issuer.

Q: How does the issuer profit?
– if index falls, issuer borrows money interest-free
– if index gains, issuer could invest the money in higher-return securities and only pass a small portion of the gain. Even if issuer invests in the reference index directly, only part of the gain need to be returned to investor.

Q: How can a retail investor replicate an ELN of $10,000 + 80% participation? I guess you can buy a discount note + an index option.
+ buy a note with face value $10,000 matching the target maturity. Current price is by definition a discount below $10,000
+ suppose index is $1000 now, just buy 8 ATM call options with the same maturity. Premium might be $400. If index falls they expire worthless but we still get the $10,000 from the note.

single-threaded UI update – wpf vs swing

In a WPF app every visual “element” object has a “owning” thread. It can be modified only by the owning thread. This sounds like “every child has a mother”. Indeed WPF lets you have 2 owning threads if you have 2 unrelated window instances in one Process[3]. In practice, most developers avoid that unnecessary flexibility, and use a single owning thread — known as a dispatcher thread.

[3] each having a bunch of visuals.

In WPF, Anytime you update a Visual “element”, the work is sent through the Dispatcher to the UI thread. The control itself can only be touched by it’s owning thread. If you try to do anything with a control from another thread, you’ll get a runtime exception.

new Action(
delegate(){myCheckBox.IsChecked = true;}

Very similar to invokeAndWait(new Runnable()…. There’s also a counterpart for invokeLater().

market data is primarily collected for … quants in research dept

(background — there are many paper designs to process market data. The chosen designs on wall street reflect the intended use of this data.)

I won’t say “by traders” since it’s too much data for human consumption. It must be digested. Filtering is one of many (primitive) form of digestion.

I won’t say “by trading systems” as that’s vague. Which part of the trading system?

I won’t say “by algo trading engines”. What’s the algo? The abstract algo (before the implementation) is designed by quants based on models, not designed by IT. Traders may design too.

Q:Who has the knowledge to interpret/analyze such flood of market data?
A: not IT. We don’t have the product knowledge
A: not traders. In its raw form such market data is probably unusable.
A: quantitative researchers by definition are responsible for analyzing quantitative data.
A: data scientist also need to understand the domain and can use the data to extract insight.