Saturday, November 27, 2010

potato-powered web server

when i see pages like this, it scares me a little to think how similar i am to this person.

Tuesday, November 23, 2010

15.433

from ocw 3 harry markowitz, 'portfolio selection', journal of finance, march 1952, u. of chicago (grad student) 'the process of selecting a portfolio may be divided into two stages. the first stage starts with observation and experience and ends with beliefs about the future performances of available securities. the second stage starts with the relevant beliefs about future performances and ends with the choice of portfolio' my code concerns second part for computation, but could also guide quantitative, rational, unemotional thought and validate assumptions made in the first part. s&p 500 returns look nearly bimodal, with a larger positive mode and smaller negative mode 10 year treasury bills returns have small tails 9 fama french three-factor model connections to other ratio patterns estimates for the factors 1963-2000 momentum (short-term positive correlation, long-term reversals) most studied anomaly in finance (2000) 10 equity option valuation risk neutral pricing binomial trees put/call parity black scholes formula implied volatility survey: why do institutions use options? at page 200, printed landscape (should be portrait)

Monday, November 22, 2010

thinking in c++

both volumes of the 2nd edition are freely available online, as is a draft version of 'thinking in python'. they're all a bit old, though they look like worthwhile reads.

the office

dwight cracks me up: http://www.noob.us/humor/the-office-fire-drill/ http://www.youtube.com/watch?v=zthtgZNJ5sc&feature=related http://www.youtube.com/watch?v=oLsOS362hkM http://www.youtube.com/watch?v=cbm5EoAm1bI

Wednesday, November 17, 2010

c++ design patterns and derivatives pricing (2nd ed)

just finished a nice quant book by mark joshi. still need to go back through the exercises, but it was a nice taste of some basic but real quantitative finance data structures and their c++ implementation, as well as more general c++ and oo issues. here are a few points that i think i should remember: open-closed principle open for extension, closed for modification (don't require editing files to extend their functionality) const good for discipline, safety, and optimization rule of three with no declared copy constructor, the compiler will do a shallow copy if destructor, assignment operator, or copy constructor is defined, define the other two, too rule of almost zero almost never declare any of destructor, assignment, or copy use smart pointers instead: shared_ptr, scoped_ptr, or Wrapper to avoid memory leaks 'almost': class with abstract methods is likely to be deleted by pointer to the base class, so it needs a virtual destructor stlport.org provides an stl with range checking, useful if you're not using visual c++ 8.0 (it already has debug mode) boost.org is intended to become part of c++ standard quantlib and xlw commands never to use malloc free new [] delete [] throw exception: ok in constructor, never in a destructor new is slow floating point errors do not cause exceptions by default, but they can be made to pimpl private implementation: one class is visible to clients with no data except a pointer to another class, which is defined in the source file in an unnamed namespace difference between encapsulation and insulation: private changes do not affect classes protected by encapsulation, but fail to insulate because all clients have to recompile lots of good refs like 7, 11, and 18

Tuesday, November 2, 2010

ath5k woes

okay, is everyone else out there as bugged as i am about the ath5k driver? it seems like every ubuntu maintenance update i've done over the last couple of months on my acer aspire one has made it worse. i just downgraded back to 2.6.32-21-generic, which works pretty well (though i did get a bunch of 'ath5k phy0: failed to wake up the MAC Chip' and 'ath5k phy0: can't reset hardware (-5)' after i let it run for a while). i've been have other hardware problems with the ssd drive and the web cam, but i think this one is a driver issue given the chatter i've found on mail lists and bug reports. i know it's oss, so i can't really complain, but i'm really looking forward to this being resolved. i wonder if i should lag my kernel updates and/or switch to madwifi or something.... EDIT: don't think madwifi is the answer, since it looks like their dev effort got folded back into the ath5k. at least, i couldn't find a madwifi version that would both compile with my kernel and work with my pci-e wifi. but i seem to recall looking at the L0s, L1 ASPM stuff before with the unsupported jumbo problems, and i noticed that now all aspm support is turned off by default on my card. (dmesg even says the pci driver explicitly decides to do it.) this change was apparently made because junky old pcie wireless cards, like i have in my acer aspire, get the unsupported jumbos in L0s. but L1 is supposed to be a mandatory part of the standard (L0s is optional). so maybe something is trying to shove it into L1 without checking that that's enabled. i tried turning L1 back on with the enable-aspm script (with root complex 00:1c.2 and endpoint 03:00.0) but it didn't seem to do anything. so i put the pcie_aspm=force kernel option into /boot/grub/grub.cfg, and that worked. in fact, it only enabled aspm for the atheros and its pci-e port, and only L1 for that. i guess the ath5k devs or somebody actually put code in to check if it can do it. so that's good; shouldn't get any of the jumbo problems, even with the =force. so now we'll just see if this helps with the 'ath5k phy0: failed to wakeup the MAC Chip' and 'ath5k phy0:can't reset hardware (-5)' problems.