Posts

Showing posts from February, 2021

Stream oriented processing

Here is a presentation on designing stream processing systems which I uploaded to YouTube today . Recorded in ~2014, and given in one form or another a few times since about 2005, it is how I "model with streams", something I learned designing market making and algo systems. What I like most about this old deck is how it stays aligned with modern abstraction expressed in higher-order FP semantics. I wrote a bit on stream processing here in 2011 .  I see also that I have a draft for publishing this presentation in 2013. Yet I had wanted to add Scala or Haskell code that captured the "nice figures" of this presentation, and that is why I held back from sharing it earlier.  All original content copyright James Litsios, 2021.

Single class refactoring exercise (in Python)

This week I needed to extract a little piece of computational geometry, imbedded in a single Python class of application specific logic. Therefore I proceeded to create a second class and migrate the computation geometry code over to it. On of the pleasures of Python is the ability to do this type of refactoring at low cost, and pretty much follow a recipe. Which I include here:  Start with class A Create new class B, derive A from B Move part of A.__init__ to B.__init__ Move initial subset of member functions A to B, implicitly creating a first API between A and B (API A-B) Iterate and apply one or more of: Split / merge methods within API A-B For A still accessed directly (through  self ) by B,  extend API A-B to provide additional A content. Find flow/bundle/fiber/ data of A and B, refactor these to be within new classes C0, C1, .... Alternatively refactor them to be within additional Numpy axes (e.g. for ML applications). Move selected Cs to from A to B or B to A. If ...