My main blog
Labels
Tuesday, October 25, 2016
stick~unix command names in blog titles
"find" / "less" / "make" are hard to include in blog titles
Suggestion: use qc(...), inspired by perl qq(), qx(), qw().
More specific (and searchable) than the other solutions
Suggestion: use quotes
Suggestion: use all caps
Monday, June 13, 2016
sticky~shorthand used in blog titles
"`" backtick without a trading space means "-ing"
"@" means on or of or at
"]" means in
"+" means and or with
2 means to
"=" means "is" or "are"
Sunday, November 29, 2015
sticky%% imprints/reputation - java ^ c++
Venkat can often stand out within a short conversation, due to his imprints.
My java interview experience – I managed to impress interviewers and stood out although my coding/design may not stand out. Am I a stronger java guy than my friends? I guess only if you quiz me on those special topics
- lock free
- wait/notify intricacies
- condition variable as replacement of wait/notify
- custom thread pool
- volatile keyword intricacies
- skip list (sorted set)
- concurrent hash map
- special singletons
Targets (memory/threading helps efficiency) --
* subvert the virtual mechanism P928[[primer]]
* dtrace
* placement new - real use cases
* replacement of RTTI
* data alignment in market data wire format
* memory page locking
* alloca()
* custom new() and free list in [[eff c++]]
* lock free - real code not concept
* template partial specialization but I don't know the use cases?
* various custom-made smart pointers with special features -- [[safe c++]]
* memory leak detectors - home made (eff c++?)
* comma operator
Saturday, November 28, 2015
## c++ know-how for coding IV
Monday, November 23, 2015
## c++topics seldom quizzed
* pimp
-- "mid-level"
Friday, November 13, 2015
Sunday, November 8, 2015
typical US job agency CEO doesn't sponsor new H1b
Date: Fri, Jun 19, 2015 at 6:12 AM
His firm seldom sponsors new H1b because Sans doesn't have a system to bring in people like me to sit on the bench for a while before placing me. I said I could return part of the bench salary but Alex knows those "backdoor" practices and he's not keen.
He said some agencies (I guess mostly South Asia) are in the business of bringing people in, and in their established process the candidate and the agency are both protected. "Protected" is the Alex's choice of word. I guess it means financial, legal and other protections.
Saturday, November 7, 2015
Most algo interviews don't care about efficiency
Monday, November 2, 2015
Tuesday, October 20, 2015
hibernate - config properties 4 ways to set
1) xml -- Traditional
2) properties file -- Traditional
3) set programmatically in source code
4) pass in on java command line as -D
maven + nexus
A vanilla Maven repository is just a web server with a directory structure of versioned jars... While you can use any old web server as a Maven repository, there are many administrative headaches to consider.
Friday, October 16, 2015
[[automate the boring stuff with python]]
non-essentials are left out.
--sub chapter on selenium
the easiest way to use selenium and drive a browser, IMO.
--Chapter on Excel
text file <-> spreadsheet converter
merge/unmerge
setting font in a cell
--Chapter on PDF:
combine select pages from many files
----
Chapter on CSV + json
Chapter on task scheduler
Chapter on keyboard/mouse control -- powerful
Sunday, September 27, 2015
quant developer requirement
plugin) or build infrastructure code modules around quant lib, but
they don't touch c++ quant business logic classes. C++ quant lib
(model) programming is reserved for the mathematicians, typically
PhD's.
Many of these non-C++ quant developers have good product knowledge and
can sometimes move into business side of trading.
I was told these quant developers don't need advanced math knowledge.
----quant interviews
Mostly C++ questions. Most candidates are filtered out here.
2nd group – probability, (different from statistics)
Some finance intuitions (eg -- each item in the BS formula)
Some brain teasers
-- some typical C++ questions (everything can be found from the Scott
Meyers books)
exceptions during ctor/dtor
virtual ctor
Given a codebase, how do you detect memory leak
multiple inheritance (fairly common in practice)
threading
-----
[[heard on the street]] and [[A Practical Guide To Quantitative
Finance Interviews]]
Another book by Shreve.
get any city's local time from google
without Enter. Wait for a second for google to build up its cache. It
will then show you the current local time.
Now I think you can also hit Enter.
Make sure the 'search tools' is enabled. I think browser toolbar fails
for this reason.
some benefits of learning c++, even if no salary increase
c# in a few (4?) months and start passing interviews. C++ is
inherently tougher than java and C#. Java and C# both have large
libraries, but the core languages are significantly simpler/cleaner
than c++.
2) After learning C++, i have found python and perl easier to
understand and master since both are written in C/C++. I now believe
some people who claim they could pick up a new language in a few
months. Those languages have their roots in C/C++.
- The basic challenges of scope+namespace, object lifetime,
heap/stack, pointers, memory allocation, object construction,
pass-by-ref/value, arrays, function pointer, exceptions, nested
struct+array+pointer... are faced by every language designer. Many of
these challenges depend on basic library, which is invariably C.
- The common OO challenges of inheritance, virtual, static/non-static,
HAS-A/IS-A, constructor, downcast, ... are faced by every OO language
designer. Many of them borrow from java, which borrows from C++ and
smalltalk
3) c++ gave me insight into java, esp. GC, JVM, overriding,
references, heap/stack, sizeof, ...
why front office
* closer to traders and their decision support
* closer to profit center
Tuesday, August 11, 2015
Saturday, August 8, 2015
Fwd: memorize passwords - tips
Password hint questions -- I'm yet to work out the best practice. How about
* all questions about places - hangzhou
--stock password
By using the same stock password on 5 sites, we might remember it more easily. However, when we change password on one of these sites, we have to remember which site
If you already came up with a unique password for a site and use it long enough, then you can stick to that forever. However, there's a risk of theft.
As a widely useful stock password, there should be numbers and letters (not asdf....) I'd put no caps and no meta characters.
If a site requires caps, I use London
--Classify the sites :
* Those sites with 2-factor: ok to have a stock password.
* xp: Some sites are fragile -- would lock you out after very few failures. I'd avoid caps.
* A few (like 10) sites I access frequently. Easy to commit to memory. Better work out a solution for those infrequent sites.
* Obviously some accounts are critical. I tend to feel a large number (like 30) of sites are critical, but I had better pick no more than 10 as really critical, and think carefully about them.
* Some really critical sites have a 24-hour hotline but they may not be able to authenticate you over phone
* hsbc site is notoriously difficult, so I would use the simplest password, without caps.
Thursday, August 6, 2015
combine audio songs from 2 CDs to 1
First I start Nero express audio CD -> audio CD. Then I select the songs from 1st source cdROM. Then put in 2nd source cdROM and select more.
Then put in Writable disk and burn. You get an Audio CD that you can play directly in windows media player (and hopefully a discman).
Sunday, July 26, 2015
MSVS solution is more than a folder of MSVS projects
I agree the project is a more important development concept, but the solution also has unique, important functionalities. I found many of these functionalities from [[MSVS 2010 unleashed]].
* project dependency is described in the sln file.
* you can build an entire solution, according to the predefined build order
* a solution can contain so-called non-project items such as documentation. All such files are by default put into the "Solution Items" virtual folder.
Saturday, July 11, 2015
Tuesday, June 30, 2015
MSVSE 2008 initial experience
I downloaded from http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso ( according to http://stackoverflow.com/questions/15318560/visual-c-2008-express-download-link-dead )
· Only the "... with SP1" is needed.
· I used hidownload (nice downloader to keep) to download the 700M file.
· I used 7zip to open the *.iso
· I ran the seup.hta
· I didn't install the bundled SQL server express
Saturday, June 27, 2015
py dict serialize - 2 ways
import pickle
print pickle.dumps(myDict)
---------
import json
print json.dumps(myDict, indent = 4)
# to verify
print eval( json.dumps(myDict) ) == myDict
a new prob measure is defined by ... a new PDF - Ahsan
Lida's lecture notes have a bit more details.
Sunday, June 21, 2015
c# ^ quartz dev skill
Friday, June 19, 2015
even swap in FX swap lingo
even swap must have the same ccy1 amount between near and far legs.
laptop sleep, hibernate, shutdown ....
* physical power button => sleep
* sleep button => sleep
* close lid => nothing
To power down completely, use start menu -> shutdown drop-down
Thursday, June 18, 2015
cpp compiler flags -I (capital) -L -l (small)
Wednesday, June 17, 2015
linker option -l vs -L
Linker option –l (small ell) for the lib file name; -L for to specify the search path
----------
Finally, you must tell the linker where to find the library files. The ST-Developer Windows installation contains programming libraries built for use with Visual C++ 2005 (VC8) and 2008 (VC9) with the /MD flag, as well as versions that are link compatible with other compilers. These are kept in different subdirectories under the ST-Developer "lib" directory. The library directories available for Visual Studio 2005 and 2008 are as follows:
- $(ROSE)/lib/i86_win32_vc8_md (2005, 32bit platform, /MD)
- $(ROSE)/lib/x64_win64_vc8_md (2005, 64bit platform, /MD)
- $(ROSE)/lib/i86_win32_vc9_md (2008, 32bit platform, /MD)
- $(ROSE)/lib/x64_win64_vc9_md (2008, 64bit platform, /MD)
Select the Linker category of properties and, pick the General options under that. In the Additional Library Directories property, add the appropriate ST-Developer library directory.
victor.tan@macquarie.com (+65)660-10851
NOTICE
The information contained in this email is confidential. If you are not the intended recipient, you must not disclose or use the information in this email in any way. If you received it in error, please tell us immediately by return email and delete the document. We do not guarantee the integrity of any e-mails or attached files and are not responsible for any changes made to them by any other person.
Monday, June 15, 2015
CEV, very briefly
Sunday, June 14, 2015
understand "signing a cert" #open_q
B) understand the content of a cert
your name, your pub key
?
C) understand what it means to "sign a cert"
"treat the cert content as a message, and generate a digsig of it"
--
validate]biz obj ^ validation@user input
I think sometimes you need extra "information" that's unavailable at UI layer. Example? zed credit check; credit card address check
Generally, we validate asap.
--
pointer in C and other lang - (early) learning notes
int x;
x = 7;
the variable x now has two values:
Left value: 1000
Right value: 7
Here the left value, 1000, is the address of the memory location reserved for x. The right value, 7, is the content stored in the memory location.
----
Now a few simple rules on & and *
rule -- &var1 returns address of var1.
rule -- I don't think &var1 can be on the left side of =
rule -- var1 must be a L-value expression. See http://bigblog.tanbin.com/2011/11/c-func-call-as-l-value-key-points.html
Now suppose we assign ptr1 = &var1
rule -- *ptr1 returns the content of var1. If you print *ptr1, and print var1, you get same.
rule -- *ptr1 can be on the left side of =
I believe *ptr1 == *(&var1) == var1
telco dnlg:inventory,parser
In Verizon, a complete circuit descriptor is known as a DESIGN or a LINE RECORD, to be PARSEd.
Databases can be relational or non-relational. In Verizon, most if not all of these disparate databases (NSDB, iview, Virtual Inventory ..) are accessed through their FT (flow through?). An FT is the proxy sitting in front of a database. Any system to query the cdd must go through the FT, load the line record and parse it.
circuit descriptors are stored in different INVENTORIES according to regions/states and "services" such as FTTP, Layer-1...
telco dnlg: fttp=fiber *to-the-home*
or coax cable (to re-use existing coax in the home)
--
Posted By familyman to learning finance,c++,py... <http://bigblog.tanbin.com/2007/07/fttpfiber-to-home.html> at 4/06/2007 11:24:00 AM
circuit modeling: data-driven, bottom-up, multiphase
* retrieve line record
* determine Protocol -- GigE or ATM
* build element filter for efficiency
* pre-fabricate common building blocks in anticipation of needs
* try a first template
* .... determine the best template
* instantiate connectors based on template
* propagate shared properties across circuit elements
* set AID and TID
* validate
* define previous and next
* define start and end
* (unfamiliar) add state descriptors
* record physical locations of circuit elements
* add layout for GUI
--
Posted By familyman to learning finance,c++,py... <http://bigblog.tanbin.com/2007/09/circuit-modeling-data-driven-bottom-up.html> at 9/02/2007 11:13:00 AM
to a novice programmer -- the importance of data structures in financial IT systems
algorithms
* sort python dict or tuple
* internals of hash table and ConcurrentHashMap
* STL container holding pointers
* STL pair
* STL stream iterators
* customize a sorted set/map for MyClass in C++, which is harder than java
* sort a map by value (real interview question) in java. Perl and python is easy.
* whiteboard-implement a blocking stack/queue (UBS)
* whiteboard-implement a basic hash table (MS)
* find top 99 in a large array (Barc) but no need to return them sorted
* choose array vs circular array vs linked list, in terms of memory efficiency (JPM).
* given 2 nodes in a binary tree, with no pointers except pointer-to-parent, find lowest common ancestor (Google)
* iterative tree walk (Barc)
* filtering iterator (MS)
* STL transform(), erase(), partition() etc
* STL allocators
* STL functors, binders
* STL iterator adaptors (back_inserter etc)
--
Posted By familyman to learning finance,c++,py... <http://bigblog.tanbin.com/2011/05/to-novice-programmer-importance-of-data.html> at 5/03/2011 07:34:00 PM
+= is the shortcut operator
b = -3 ;
I think they mean the same. Yes confirmed.
=- or =+ can only have one, unambiguous meaning. Therefore, if u want to subtract 3 from $c, you need
"c -= 3"
--
Posted By familyman to learning finance,c++,py... <http://bigblog.tanbin.com/2007/08/is-shortcut-operator.html> at 8/22/2007 12:17:00 AM
telco dnlg: GPON
Passive = unpowered.
GPON is used exensively in FIOS.
fttp /contexx/ && trec
* Right at the heart of a telco, not a peripheral system like CRM, self-care
* If you think online banking is shallow dnlg, then network testing is deep dnlg.
* standardized, portable dnlg
* needed in every telco
* FIOS glamour. u can ride on the wave.
* verizon is a market leader
* high entry barrier. Many telco-enthusiast develoeprs can gain some web or sms experience but no way to get this xp.
* deeper, higher complexity. u can ask why but i don't want to answer it.
* high volume
* high perf
* large team
--
Posted By familyman to learning finance,c++,py... <http://bigblog.tanbin.com/2007/07/thank-god-for-fttp-contexx-trec.html> at 4/05/2007 05:12:00 PM
weblogic server910_generic.jar
A: according to google: go to bea download site, select "solaris 10 x86" and u will get server910_generic.jar
Q: Working on solaris on sparc hardware?
A: yes. Tested many times with T2000 servers.
Q: The jar can work on win32?
A: jdk150_08 will break weblogic910. Confirmed: jdk150_04 supports weblogic insalled from weblogic910_generic.jar
--
Posted By familyman to learning finance,c++,py... <http://bigblog.tanbin.com/2006/09/weblogic-server910genericjar.html> at 9/23/2006 12:53:00 AM
telco dnlg:expert system maintenance
Q: is a mistake always easy to recognize by a human?
A: usually yes for sscfi
q: example of an obvious mistake in sccfi?
A: wrong diagnosis
Q: what other mistakes?
A: slowness
Q: How do u reduce recurring mistakes?
A: reviews by human experts
Q: how many such reviews each month?
A: about 1/day
hard edit vs soft edit when submitting order to mainframe
In one order entry system (A big European megabank), new orders are sent to mainframe. Upon validation, mainframe can return a message to the order entry system.
If the message is a hard edit, the order is rejected by mainframe validation module.
If the message is a soft edit, the order is accepted by mainframe validation module. The soft edit is purely informational. Not necessarily a warning. No action is required on the user of the order entry system. I guess the soft edit is just "FYI".
--
Posted By familyman to learning finance,c++,py... at 3/15/2011 11:52:00 PM
cobol copybook = input format spec
a cobol-copybook is "a file describing an input data format".
"cobol copybook" is the standard term ("cobol-layout" is less common) for files like that mentioned in https://ssl.kundenserver.de/shop.softproject.de/downloads/CobolCopybookToolkitForJava.pdf
"copybook-datatypes"
"copybook-dataclauses"
-- based on http://edocs.bea.com/JAM/v51/program/egenapp.html
A COBOL CICS or IMS mainframe application typically uses a copybook source file to define its data layout. This file is specified in a COPY directive within the LINKAGE SECTION of the source program for a CICS application, or in the WORKING-STORAGE SECTION of an IMS program. If the CICS or IMS application does not use a copybook file, you will have to create one from the data definition contained in the program source.
A copybook is conceptually (not technically) part of a cobol program. Usually this copybook is a standalone file, included from its parent-program.
--
Posted By familyman to learning finance,c++,py... at 1/20/2008 08:53:00 PM
zed transaction volume - 50 tx/sec
Hi Tan,
Good to hear from you. We would have done close to 50 tps second during the
peak time.
Partha
----- Original Message -----
Sent: Wednesday, June 13, 2007 11:52 AM
Subject: interview question
> Hi Partha,
>
> How's your wife and daughter?
>
> I'm preparing for some interviews. One interviewer asked "how many
> transactions per minute at your (zed's) peak load". I said more than
> 50/minute and he laughed.
>
> Any idea about the peak volume in 2002?
>
> Thanks
>
>
>
JMV tuning top 2 topics GC ^ JIT
[[Java Performance: The Definitive Guide]] clearly hints that these are top 2 topics for the jvm performance experts.
Hul White -- learning notes
LMM has too many factors. Hull White can be one-factor or 2-factor.
disable python stdout buffering
python -u # didn't work for me...
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) # worked
Friday, June 12, 2015
OIS instruments in YC bootstrapping - Jeff
*
fwd libor rate != instantaneous rate
Fwd libor rate , like a 20Y forward start 3-month Libor has an accrual period of 3 months. The inst fwd rate has an underlying loan with accrual period shrunk to 1 picosecond...
zero curve doesn't mean discount curve
Zero curve usually means the zero bond yield curve. I think it's usually upward sloping.
I think in STIRT/Sprite zero curve means the discount factor curve, so it's decreasing with maturity and always below 1.0.
A YC can be interchangeably represented as zero curve, discount curve, fwd curve (i.e. inst fwd rate) etc.
recombining tree requires Markov
Thursday, June 11, 2015
Gaussian HJM, briefly
An HJM model is Gaussian HJM if vol term is deterministic. Note "vol" term means the coefficient of the dW term. Every Brownian motion must always refer to an implicit measure. In this case, the RN measure.
[1] I would say "quasi constant"
Language is not yet precise so not ready to publish on recrec...
modified duration vs duration, briefly
fwd contract arbitrage concept - less useful
The basic relationship (between spot price, fwd contract price, T-maturity bond price..) is intuitive, low-math, quite accessible to the layman, so I decided to really understand it, but failed repeatedly. Now I feel it's not worth any further effort. It's not quitting. It's saving effort.
- interviewers won't ask this
- real projects won't deal with it, because the (arbitrage-enforced) precision mathematics simply doesn't manifest in the real data, perhaps due to bid/ask spread
- Only financial math literature makes extensive use of it
I think this is like the trigonometry or the integration techniques -- you seldom need them outside academics.
Tuesday, June 9, 2015
FX carry trade
http://www.investopedia.com/articles/forex/07/carry_trade.asp - shows example of rollover interest calc
victor.tan@macquarie.com (+65)660-10851
NOTICE
The information contained in this email is confidential. If you are not the intended recipient, you must not disclose or use the information in this email in any way. If you received it in error, please tell us immediately by return email and delete the document. We do not guarantee the integrity of any e-mails or attached files and are not responsible for any changes made to them by any other person.
Friday, June 5, 2015
arb-free IR model
... must model the (evolution of) entire YC, rather than some points on it, like (the evolution of) one Libor rate. This is a main theme of the lectures on Black's model, forward measure, HJM etc.
For more details, See the post on HJM
desktop search - full text, free
Sunday, May 24, 2015
non-static const member - is politically correct but impractical
label - cppReal
See http://stackoverflow.com/questions/634662/non-static-const-member-cant-use-default-assignment-operator. My take is that a non-static const member will break the standard assignment operation. You could mess around operator= but non-trivial.
Wednesday, May 20, 2015
RE: don't buy too many fin math books
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
Sunday, May 17, 2015
London bbg IV
Q: given a string of characters, find the longest "run" of any repeating character.
Q: given an array of integers, and a target, determine if there's any pair that add up to the target. Return true/false.
Q: maximum profit problem. Given a time series of historical spot FX rates, find the maximum possible trading profit by exactly one buy one sell.
Tuesday, May 12, 2015
DRW IV
a vector needs to allocate N instances of Account but Account has no default ctor. How does the compiler achieve it?
A: indeed the call to array new would prevent the vector<Account> concrete class from compiling due to SFINE rule or something like that. (Java and c# would use type constraints instead.) The compiler must be using 2 separate lines – one to allocate raw memory, the other to initialize the object.
However, when is vector internal array allocated by array new? I discussed with Ashish but found no answer.
Q: why do you need to write your own smart ptr?
A: super simple one, just to deal with some issue of the raw ptr... probably dangle pointer, by overriding the deref operator?
Q: why use unique ptr when shared ptr is general purpose
A: threading...
Q: is the lambda functionality doable in c++98? what is the c++98 equivalent?
Q: OK you don't use c++11 at work, but do you hack around at home?
Q: why is the bid/ask spread much wider in options than the underlier?
A: must be the risk to the writer. Competition didn't drive down the bid/ask spread like it did in FX and cash equities.
AA: delta hedge adjustment can't be done every second. Before the next adjust, the risk to the writer (market maker and quoter) would be quite high.
Wednesday, May 6, 2015
sticky## c++weakness revealed by interviews(+projects)
Relative to java/c#, c++ questions are more low-level (often using non-OO constructs). This is generally my strength.
I used to feel confident I can see patterns in tech interview questions and figure out what specific types of knowledge is required at a certain seniority. I was fairly successful with java/SQL/c#, but less so with c++. Based on the past questions i'm trying to make out the patterns.
=======weaknesses revealed by interviews. Probably need more work experience
(No one tested me on MI, template wizardry, etc)
STL useful tricks (like swing) -- Shanghai, synechron, Jap, WQ
specific threading constructs/techniques -- sapient, jump, SCB
boost -- jump, Jap, synechron,
mem management/optimization (like heap-only classes) -- barc-mtg, nQuant
[lg] socket -- nquant
firm grasp of language features (like rvalue ref) -- 3Arrow, bbg
essential class-based techniques/constructs (eg ref counting) -- Miami, espeed, nQuant,
[lg] COM - Barc RnA
c++11 features - DRW, 3arrow
initializing common data structures like arrays, vectors, classes -- needed in a lot of coding challenges
==These are harder to self-study -- too specialized and no pointers
linux (instrumentation) tools like truss, LD_library_path -- jump, Miami, nQuant
[lg] essential/deeper know-how (signals, OOM, stack size) not expected of a junior developer ...-- jump, Japanese, nQuant, 3Arrow, barc-mtg
[lg] extreme low-level optimization (CPU cache, custom-RTTI, byte alignment, placement new) ..-- Miami, nquant, jump
=========much-needed practical skills not quizzed by IV
pre-processor tricks
python integration
makefiles, continuous build
pthreads
debuggers,
memory leak detectors,
Tuesday, May 5, 2015
pass individual instances of MyClass to initialize an array of MyClass
Context/Requirement is quite clumsy to describe.
Suppose you have an array field Student[40] in Professor object and you need to write a Professor ctor, and use initializer list for that field. It's tricky, but I did it in the Tetris code...
Friday, May 1, 2015
sticky~why re-enter c++ if salary could be lower and jobs fewer@@
[1] find some reason to critically weaken
* Mtv: To broaden my base, I have invested in php, py, javascript, swing, FIX, tibco, Sybase... many of them got me jobs but none has the power (#1), complexity (#1), value-add, entry barrier as c++ has.
* Mtv: doldrums -- if u sit still for 12 months, then no growth in java skill, but another guy will pick up c++, Some will acquire zbs and a real competitiveeedge. b_u_t c# is more popular than c++.
* mtv: initial orgradient is fastest -- my java (not c#) growth has slowed down. My C++ is still at the fast-learning phase
* Mtv: get in the door -- I will soon become expert* mtv: SG -- Relative to US, SG java talent is even more of a commidity. c++ talent is more rare and more highly valued than in US, b_u_t the positions seem to be limited.
* Mtv: entry barrier -- c++ is higher than java? b_u_t some jobs require just basic C programming
* Mtv: commodity vs differentiation -- the java skill on wall street is a commodity. You are no different from the next java guy. (B_u_t most outsiders simply don't know how to come in.) What differentiations? c#, swing, threading...
* Mtv: xp wasted -- i have many years of professional experience in c/c++. Why not build it up to a critical mass and get a real edge?
* Mtv: cross-pollination -- threading, data structure (among other core topics) benefit from cross-pollination.
* Mtv: latency insight -- latency sensitive eq often benefit from memory knowledge of c++. If you work on such a java system, c++ insight is an advantage.
* Mtv: performance trend -- as more asset classes follow Eq, as competition heats up, low-latency will become more important. c++ is for "demanding" systems -- Scott Meyers. I would think the white-hot fields are still dominated by c++. b_u_t java is encroaching
* Mtv: lead -- need to extend the lead over non-trading developers.
* Mtv: A+B years -- many guys have A years java + B years c++ ? b_u_t they may not earn more.
* Mtv: strongest developers -- often know c++ in-depth. b_u_t look at Piroz, Yang, Avichal Gupta, Sundip Jangi...
* Mtv: older developers -- c++ is better for older guys? b_u_t many older guys are learning java, probably due to shrinking demand
* mtv: cost-amortization -- In terms of investment, i already invested so many years on threading, containers, regex, OO, design patterns... Learning c++ or c# lets me amortize this huge cost. In 1 year i can reach a 3-year proficiency level. About 20% of my core java insight can double as my c++ insight.
* Mtv: outside financial -- a lot of infrastructure and core components are in c/c++, where java isn't fast enough. Many of the most important software's are in c/c++. Consider google, facebook... http://www.lextrait.com/vincent/implementations.html
* Mtv: foundation expanded -- like DBA, c#... I prefer to expand my foundation not by learning spring, gemfire, ION … b_u_t these latter category perhaps enjoy more demand
* Mtv: low-level -- than java/c#. Look at the standard books. Low-level is my comfort zone.
* Mtv: churn and volatile -- less rapid than java and c#. Best books were 90’s. b_u_t that's a sign of investment by major vendors.
* Mtv: crowded -- java is crowded talent pool? b_u_t there are also more jobs
Tuesday, April 28, 2015
to get fwd points on a broken date
Sunday, April 26, 2015
sticky~how many years C experience...unimportant!
It's possible to code C++ for years without using virtual, new/delete, template, operator overloading or even class.
It's possible to code java/c# for years without any threading (beyond locking), or reflection
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.
Boost Any ^ Variant - self-quiz
See also my books on boost...
What's the best way to remember this? Blogging can help but books are more convenient...
Q: Which of the 2 is more common?
Q: What's the use case for each?
Q: Is there any context both can be used?
Q: Any way to combine them?
Thursday, April 23, 2015
vector initializer -- disallowed in field declaration
in a field declaration, you can't do
vector<int> vec; //acceptable
vector<int> vec(9); // field initialization, disallowed
You can do it in a *local* variable definition though.
cstr - remove trailing comments
My order book (irage) :
void processMsg(char const * cstr) {
char * commStart = strstr(cstr, "//");
if (commStart) {//found
* commStart = '\0';
redirect stdin/stdout to files, then restore
Needed in HackerEarth coing tests!
http://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files
swaps illustration diagrams -- how to read
These block diagrams are popular and partially useful, but beginners often don't realize:
* initial context -- typically a corporation has a periodic liability, or an investor has a periodic income.
** We had better ignore all the other arrows first.
* the motivation -- typically to convert the initial single arrow to other arrows. The swap contract adds 2 arrows, one of them cancelling out the pre-existing arrow.
** we had better focus on the 3 arrows and ignore other parts of the diagram.
[[c++common knowledge]]
* placement new
* class-specific op-new
* restrict heap allocation of my class
x-ccy swap - basis swap dominates
Most tutorials talk about fixed/fixed swap, but Tony's lecture seems to suggest the market makers always convert it into a x-ccy basis swap.
I think it's more standard, more liquid than other x-ccy swaps.
I think market makers use it for hedging once they execute any x-ccy swap.
yield curve , according to Jeff
1) EUR OIS YC bootstrapping using specific OIS instruments
2) Libor YC under OIS discounting -- so OIS curve + libor curve needed.
3) Libor curve for a non-default tenor, such as 6M or 2M
lots of "root-finding"... but not too hard.
a YC (or a term structure) can be represented as a series of
* spot disc factors
* fwd disc factors
* spot interest rates
* fwd interest rates
Wednesday, April 22, 2015
Rebanato - good author on fixed income models
most fx op traders don't know Am style
buying (i.e. long) a given interest rate
Tuesday, April 21, 2015
fuxi) bid side of fx swap point means@@
A: dealer is sell/Buy ccy1. The spot leg is sell ccy1. The far leg is Buy ccy1.
Note we are taking the dealer's position, not the market-taker's.
Note "bid" refers to the far leg, not the near leg.
Note ccy1 (not ccy2) is the asset being traded.
enough c# mileage accummulated@@
- - I still feel less familiar with some everyday tasks than my c# veteran colleagues.
- - i did rather few complete projects like Guardian and many enhancement projects. In contrast, veteran c# guys did more big projects. The number of years isn't as important as complexity and variety of challenges. VARIETY -- for eg a web dev expert (or a DB-centric c# coder) isn't really a complete c# expert.
- - assembly, appdomain, GAC
= = people agree that I can get my job done and meet most technical challenges, even if non-trivial. ("tactical")
= = explaining, justifying my design choices - not always convincing. Not only c#, but java too.
+ + on some of the hot but purely theoretical IV topics (fake mileage), I have read up quite a bit and appreciate their nuances. I can follow most discussions on these topics -
*GC, dtor, finalizer
*threading
*value/reference types
*dynamic type
deleting base class ptr -- non-virt dtor
This correct code produces " ~B ~A" i.e. reverse construction sequence. But what if "virtual" removed?
I said it's undefined behavior, but what if we know it does do something? I correctly predicted " ~A". My bloomberg interviewer predicted " ~B" but failed my test.
class A{
public: virtual ~A(){ cout<<" ~ A"<<endl; }
};
class B: public A{
public: ~B(){ cout<<" ~ B "; }
};
int main(){
A * p = new B;
delete p;
cin.get();
}
Morris - inorder traversal running O(N), without extra storage
is the detailed.
https://codeoverflow.wordpress.com/tag/morris-inorder-traversal/ has explanations + full c++ code
http://www.geeksforgeeks.org/inorder-tree-traversal-without-recursion-and-without-stack/ has C code
Sunday, April 19, 2015
c++ coding drill - books + online
RESTful - phrase book
agile –
coupling – less coupling between client and server, so server side changes are easier. I think SOAP requires client rebuild.
b2b – still dominated by SOAP
resource-oriented services –
object – each URL logically represents an object, which you can Get (query), POST (create), PUT (update its content) or DELETE
AOC c++ iv (Jens/Ruban)
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.
bbg C++ Standard IV Questions { Zack
2. Does better O() algorithm always works faster in real cases?
3. Between pre-increment (++i) and post-increment (i++) operator, which one is more efficient in both built-in and overloading case? ........ [[more eff c++]] item 6
4. Please compare array and linked-list in terms of insertion and access
5. Please name some sorting algorithms and their time complexity
6. Can you tell me the difference between stack and heap?
7. What Linux command do I use the find a file in a directory recursively?
8. what is the virtual functions and destructors
9. what is the constructor destructor orders of a class then an inherited class
10. what is the most known sort algorithms , and what is the complexity of each
11. Smart Pointer, how does it work.
12. Templates, when use instead of inheritance........ [[eff c++]] Item 41
13. Polymorphism, when use multi inheritance, problems that can happen, ....... [[eff c++]]
14. Sockets, monitoring sockets.
15. Multithreading, give a small example of Producer, Consumer.
16. Debugging issues, using GDB
17. Linux (Windows doesn't work, it's difficult to test the person since we don't know Windows)
18. Multithreading
19. TCP/IP and Multicast
20. STL and Boost libraries
par swap rate drop means ...@@
For a given tenor (say 1Y)
I think treasury yield rise (or drop) has a simpler interpretation....
I think Libor ED deposit rate drop (or rise) has another simple interpretation .... and has a credit element.
Libor par swap rate drop has a non-trivial interpretation....
OIS swap rate is even more complicated...
yield curves - y-axis defaults to fwd rates
In theory inst fwd rates, actually discrete fwd rates...
fwd rate is a better choice than zero bond rates or par swap rates...
See Jeff's lecture notes
Wednesday, April 15, 2015
Tuesday, April 14, 2015
destructors should be simple.. really?
* exception
* dtor sequence - DCBC
* virtual dtor
* synthesized dtor is usually no good if there's any pointer field
* lots of undefined behaviors
* there are guidelines for dtor in a base class vs leaf class -- never mindless
* objects put into containers need a reasonable dtor
* when the best practice is to leave the dtor to the compiler, you could look stupid by writing one, esp. in an interview.
* smart pointer classes is all about dtor
* RAII is all about dtor
* interplay with delete
*** placement new, array-delete vs delete
*** override operator delete
*** double-delete
*** ownership !
entity means ...in ORM lingo
It means an object in memory, backed by a DB record... see [[beginning java EE 7]]
Sunday, April 12, 2015
noexcept -- c++11
http://en.cppreference.com/w/cpp/language/noexcept has good examples of noexcept operator
DOM and other components of ajax
• DOM
• xhtml as "final data format" to render the page on browser
• xml or json or plan text as payload
data types in jason
numbers, strings, booleans
arrays
object – basically associative array of name-value pairs
socket monitor -- resources
My Dtrace book covers this topic. Many solaris tools, including snoop, dtrace and lots of network statistics
the linux "ss" command -- http://www.binarytides.com/linux-ss-command/. can track down pid, among other things
http://www.javaspecialists.eu/archive/Issue169.html is a solution in the java world
Saturday, April 11, 2015
option math : thin -> thick -> thin
Many topics I may have to give up for lack of bandwidth. For the rest of the topics, let's try to grow the "book" from thin to thick then to thin.
-----
+ PCP
+ delta hedging
+ graphs of greeks
+ arbitrage constraints on prices of European calls, puts etc. Intuition to be developed
+ basic strategies like straddle
LG American options
LG GBM
LG binary options but ..
+ Roger's summary on N(d1) and N(d2)
LG div
LG most of the stoch calc math but ..
LG vol surface models
+ some of the IV questions on martingale and BM
I know more about c++ than c#
Here's a paradox -- i spent 2 years in a full time c# job, arguably longer than my full time c++ experience. However, sometimes I feel I understand dotnet less than C++. Reason? Many aspects of the languages are never used in-depth on work projects, so length of experience != depth of experience. We need spare time self-exploration to learn those aspects like:
- template meta programming
- custom operator new/delete
- memory tuning
- memory leak detection
- threading
- async communications
- pure virtual
- ++i vs i++
(... not a complete list by any measure.) Interviewers are notorious for testing these obscure or advanced, theoretical topics.
## some of my c# dotnet achievements
GUI - full ownership
stability improvement in the microagent and Guardian server
Bloomberg piece - no one dared to touch it given the complexity
Excel add-in
Created many windows services
Friday, April 10, 2015
bbg algo IV - binary tree inorder walk
1. Elements are visited in ascending order (i.e. an inorder traversal)
2. next() and hasNext() queries run in O(1) time.
3. Memory usage is O(1)
-------
I feel O(1) memory is impossible since this is recursive (though all recursions can convert to iteration), with a stack data structure of size H := height of tree.
Similarly, hasNext() need to work through the stack of size H, so O(1) run time impossible
academic route as a long term career option (Sam)
Hi Sam
(This is more like a personal blog, to record my thoughts and conversations.)
I never considered those options you posed today
Q: 2nd master's degree?
A: I liked the part time study experience so far. Will take a 2nd Masters if someone pays for me.
Q: I did think about teaching at polytechnic level, but teach what subject?
A: Either IT or financial math, or perhaps data science -- after I spoke to Bernie.
Thursday, April 9, 2015
simplest java web server using thread pool
https://github.com/epibook/epibook.github.io/blob/master/solutions/java/concurrency/TaskExecutionWebServer.java Also described in the book [[elements of programming interviews]]
hazard rate, a few pointers
For life insurance, hazard rate is increasing with age
Jostein's lecture notes gives a good definition.
http://en.wikipedia.org/wiki/Survival_analysis#Hazard_function_and_cumulative_hazard_function is similar, but I prefer books. I think other books I have may also have a good definition.
kernel time > 25% (linux tuning
Here's a rule of thumb from P244 [[optimizing linux performance]].
"time" command can show it. If kernel time > 25%, then it's excessive and warrants investigation. The investigation is relatively standard – use strace to rank the most time-consuming system calls.
aync architecture - some examples
In each case there's a data buffer holding the "details" of the pending operation.
async – DB query
async - disk IO
async - http request
async - unix signal processing. Signal is "stored" in the kernel and the callback is invoked at a later time.
async - UDP read and write?
buying home ] US
If staying 5Y+ then buy not rent...
Prop tax - $8k/year for a 500k home
Most wood houses need lots of maintenance... Condos may also need maintenance and require have maintenance fees...
If you are forced to leave US, you can find a management firm to rent it out and maintain the house. Common in Florida.
T+0 settled FX is a ... derivative contract
NDF fixing - multiple alternative publishers
Central banks (like Chinese gov) compete with private agencies... An NDF contract could reference any one of them.
Sunday, April 5, 2015
green card process
(If re-apply again under another employer, then another 2Y to get 140 approval.)
Another 3Y or so to get 485. 180 days later, free to change job with EAD.
For job stability, I will go with a contract agency. Some companies tend to retrench and terminate the green card process.
IV c++11 (3arrow)
Q: What's an rvalue reference actually?
Q: mutable keyword's usage? How about in c++11?
AA: closure - captured variables can be modified if "mutable".
http://stackoverflow.com/questions/105014/does-the-mutable-keyword-have-any-purpose-other-than-allowing-the-variable-to
Translation lookaside buffer
What part of the boost thread library did you use?
for-loop in c++11?
Why did you implement your own smart pointer?
A: to avoid uninitialized primitives? That's a wrapper not a smart ptr
noexcept
AA: both an operator and a function specifier...
Can ctor throw exception? Why do you say it's not best practice?
How does a vector resize?
A: after copying the objects, destroy the old objects. (move ctor?)
What kind of algo is qsort? Average and worst runtime complexity?
A: average nLog(n), worse n^2
Recursive vs iterative, which is faster?
A: comparable, but space complexity lower for iterative?
what's lockfree? How did you make it work in your projects?
How did you use parallel processing in GS?
A: data parallellism, threading, and other techniques. Coarse-grained is ideal.
A: i guess pipelining parallellism is also relevant, using task queues