Archive for June, 2019

Got Started on Robinhood

Thursday, June 20th, 2019

Robinhood

This morning I finally downloaded the Robinhood app, and funded my account, and put in an order for AAPL, and a little Bitcoin. What brought this all out is a couple of things:

  1. I interviewed with Robinhood - it was a few years ago, and it was with one of the Google's Founders brothers, which I thought was interesting, but it is a sound business model for retail trading, and I really liked the guys I talked to. It would have required relocation, and that was a problem for me at the time.
  2. I have wanted to own AAPL stock for a while - and while I was in Finance, that wasn't possible, and then the divorce, etc. and it really hasn't been reasonable to get into the market until very recently. Sure, I've been doing ETFs and the like for my retirement, and that has gone very well indeed, but not straight-up retail trades.
  3. I have wanted to have a little Bitcoin - I don't think this is anything more than a fancy, but I like the idea of a digital currency that's traded based on some idea of value... but I'm not really sure that Bitcoin or Facebook's Libra is going to really replace dollars.

What I found was a beautiful UI for the Robinhood app. And the ability to use 2FA and/or Face ID, I think it's just fantastic. I don't mind 2FA, but I prefer to be able to use the better (less friction) Face ID, and I think the new "Sign in with Apple" should go a long way to making this a preferred way to get the job done in more places.

Also, making it possible on a MacBook Pro wouldn't hurt. 🙂

So now, I can have a little fun with investing. Nothing I can't afford to loose, that's for sure... but it's not about the win/loss, it's about the participation in the Markets. For so long, I was working in them, and I'd like to again, but then I couldn't do this... so it's a trade-off, and if I can't work in them, at least I can participate in them. 🙂

Tiny Optimization on Potentials

Wednesday, June 19th, 2019

Speed

This morning I was looking for a little something in the Potentials code, and looked at the following code:

  x = MAX( MAX(_values[r+1][c], _values[r+1][c+1]),
           MAX(_values[r][c], _values[r][c+1]) );

And while it wasn't bad code, the MAX function will execute each argument, and then the winner will be executed again. So while the inner MAX implementations were not really doing any extra work, the outer MAX is causing each of them to be doing more work than necessary.

If we switched from that to the C function fmax:

  x = fmax(fmax(_values[r+1][c], _values[r+1][c+1]),
           fmax(_values[r][c], _values[r][c+1]));

we now know that the inner calls will be executed once, and then the outer is now working with doubles as opposed to macro expansions, and that will make things a little faster - without compromising the readability of the code.

For the traditional test case, the original code reported:

2019-06-19 ...-0500 Potentials[...] [ResultsView -drawRect:] - plot drawn in 18.533 msec

and with the fmax, the results were:

2019-06-19 ...-0500 Potentials[...] [ResultsView -drawRect:] - plot drawn in 16.382 msec

which was a repeatable difference. Now this isn't huge, but it's more than a 10% drop in the execution, so it's not trivial, and more to the point - the redundancy was just unnecessary. Good enough.