My main blog
Labels
Monday, May 18, 2015
[[api design for c++]]
scripting support by boost::python
API wrapping/layering -- extremely common technique
api styles:
- flat C style
- OO
- template
Saturday, April 25, 2015
[[21st century c]] - unusually practical update on C
a sub-chapter on robust Macros in the new world
a sub-chapter on function to report errors in the new world
a full chapter on pointer in the new world
a full chapter on C api to be consumed by other languages like python
a full chapter on struct syntax improvement to support returning multiple values + status code
a sub-chapter on pthreads
a sub-chapter on [[numerical recipes in C]] and the implementation – the GNU scientific library
a sub-chapter on SQLite
briefly on valgrind
function returning 2 values + status code
many innovative macro tricks
innovative and concise explanation of auto(i.e. stack) vs static vs malloc memory
Note a sub-chapter is very short, in a concise book. A remarkably practical update on C, somewhat similar to [[safe c++]]. Content isn't theoretical, and not so relevant to interviews, but relevant to real projects and GTD
[[spring data]]
chapter on redis (integration with spring data)
chapter on mongoDB (integration with spring data)
chapter on gemfire
chapter on JPA
multiple chapters on Hadoop
sub-chapter on job scheduling in the Hadoop context.
Thursday, April 23, 2015
[[c++common knowledge]]
* placement new
* class-specific op-new
* restrict heap allocation of my class
Saturday, April 18, 2015
[[java performance]] by Scott Oaks
--[[java performance]] by Scott Oaks
best of breed..see chapter details on
[jvm] heap memory
[jvm] threading
[jvm] instrumentation
JPA
serialization
lambda, stream (java 8 interviews!)
The Introduction chapter outlines 3 broad aspects
* JVM – like memory tuning
* java language – like threading, collections
* Java API -- like xml parser, JDBC, serialization, Json...
JVM tuning is done by "system engineers" who may not be developers.
Friday, February 7, 2014
[[all about HFT]]
Monday, January 27, 2014
[[Quatitative Trading]] by E.P.Chan
Saturday, January 18, 2014
[[practical api design]] java
[[ModernC++]] - learning notes
Primitive language constructs at the foundation –
* preprocessor tricks, not those quick and dirty types
* (partial) template specializations
* non-type template arguments
* sizeof
compile-time programming
Monday, December 30, 2013
[[inside windows debugging]]
^ MSVS – dev environment, with source code available
^ windbg – production environment. For post-coding, without source code.
** script/SQL debugging – only MSVS
P38 points out the free MSVS-express lacks certain debugging features. WinDBG is Completely free.
Q: does "windows debugger" mean windbg + minor tools?
--symbol files, symbol servers, *.pdb files
P53
P54 - "public symbols" and the microsoft online public symbol server.
Sunday, December 22, 2013
[[c++without fear]] tips (fuxi in 12M)
Monday, November 25, 2013
string,debugging + other tips - [[moving from c to c++]]
P167 just when we could hit "missing default ctor" error. It's a bit complicated.
--P102 offers practical tips on c++ debugging
[[linux programmer's toolbox]]
--debugger on optimized code
can show per-process performance data
Tuesday, October 1, 2013
[[Hull]] estimating default probability from bond prices - learning notes
arithmetic on P524-525 could be expanded into a 5-pager. It's a good
example worth study.
There are 2 parts to the math. Using bond prices, Part A computes the
"expected" (probabilistic) loss from default to be $8.75 for a
notional/face value of $100. Alternatively assuming a constant hazard
rate, Part B computes the same to be $288.48*Q. Equating the 2 parts
gives Q =3.03%.
Q3: How is the 7% market yield used? Where in which part?
Q4: why assume defaults happen right before coupon date?
%%A: borrower would not declare "in 2 days I will fail to pay that
coupon" because it may receive help in the 11th hour.
--The continuous discounting in Table 23.3 is confusing
Q: Hull explained how the 3.5Y row in Table 23.3 is computed. But Why
discount to the T=3.5Y and not discounting to T=0Y ? Here's my long
answer.
The "risk-free value" (Column 4) has a confusing meaning. Hull
mentioned earlier a "similar risk-free bond" (a TBond). Right before
the 3.5Y moment, we know this risk-free bond is scheduled to pay all
cash flows at future times T=3.5Y, 4Y, 4.5Y, 5Y. That's 4 coupons +
principal. We use risk-free rate 5% to discount all 4+1 cash flows to
T=3.5Y. We get $104.34 as the value of the TBond cash flows
"discounted to T=3.5Y"
Column 5 builds on it giving the "loss due to default@3.5Y, discounted
to T=3.5Y". Iin Column 6, This value is further discounted from 3.5Y
to T=0Y.
---
Part B computes a PV relative to the TBond's value. Actually Part A is
also relative to the TBond's value.
In the model of Part B, there are 5 coin flips occurring every
mid-year at T=0.5Y 1.5Y 2.5Y 3.5Y 4.5Y with Pr(default_0.5) =
Pr(default_1.5) = … = Pr(default_4.5) = Q. Concretely, imagine that
Pr(flip = Tail) is 25%. Now Law of total prob states
100% = Pr(d05) + Pr(d15) + Pr(d25) + Pr(d35) + Pr(d45) + Pr(no d). If
we factor in the amount of loss at each flip we get
Pr(d05) * $65.08 + Pr(d15) * $61.20 + Pr(d25) * $57.52 + Pr(d35) *
$54.01 + Pr(d45) * $50.67 + Pr(no d, no loss) + $0 == $288.48*Q