What I learned this week

I’ve decided to build a habit around recording interesting things I learn/refresh my memory on each week.

I believe this will be a collection of random facts, statements, and quotes. I’ll attempt to organize them into broad categories, and add categories as the week goes on. I have no idea what does/does not make the cut of being included it will mostly be random, at least for now.

Initial strategy is to make a note of concepts as they come up and spend fewer then 60 minutes at the end of the week.

I short reminder to myself: You do not care how this looks, this does not have to be comprehensive, and there should zero mental burden on what is added to this list.

“And now that you don’t have to be perfect, you can be good.” ― John Steinbeck, East of Eden

Software

Smithy is a language for defining services and SDKs. Basically set of tools for defining clients and/or servers for a particular service.

curl --verbose --silent google.com Use curl to inspect HTTP exchange

Mockito is a popular Java mocking framework that is widely used in unit testing. The primary purpose of Mockito is to simplify the process of creating and managing mock objects, which are simulated objects that mimic the behavior of real objects in a controlled way.

If you’re cloning a git repo that uses submodules you’ll need to: git submodule init & git submodule update … spent a bit longer than I’d like to admit figuring that out.

Border Gateway Protocol

Pipe Syntax in SQL Google introduces an extension of SQL using pipes

Business/Finance

Games people play with Cashflows - Interesting article on forming opinions, cash flows, and borrowing.

Anatomy of a 2AM mental breakdown - Well written piece and good discussion on HN

What’s Really Going On in Machine Learning? Some Minimal Models - Amazing visuals still reading through

Math/Stats

Multi Arm Bandit - Explore vs Exploit and minimize regret.

Sampling with SQL

Variance for a binomial distribution can be calculated as n * p(1-p), thus the varaince of a coin flip over five trials is 5 * 0.5 (1 - 0.5) = 1.25 the SQRT of 1.25 = 1.118. We know the mean of 5 trials is 0.5 * 5 = 2.5. With this information we can use a normal distribution to approximate a binomial distirbution to get the probability of something occuring… say <=4 out of 5 flips being heads. We get a z-score of (4 - 2.5) / 1.118 = 1.34, and looking up 1.34 in a z table we see the area tot he left of 1.34 constitiutes ~90% a.k.a there’s approx a 90% chance that <=4 out of 5 flips are heads.

As noted above we can use a noraml distirbution to APPROXIMATE a binomial distirbution, at lower numbers of trials this approxmation rears its head. A simple way to solve this problem would just be to find the inverse of the probability that all 5 trials would be heads as that is the only scenario not accounted by <= 4 heads. Thus, 1 - (0.5*0.5*0.5*0.5*0.5) = .9686 which is the true probability of <=4 out of 5 flips are heads.

We can also calulate the Binomial probability: P(X=x), say of exactly 4 out of 5 flips being heads. P{x} = {n \choose x} * p^{x} * q^{n-x}. Under the hood {n \choose x} is really just the number of combinations n! / (n-x)!*x!. In our case this becomes 5! / (5-4)!*4! = 120/24 = 5 and then our second piece is just .5^4 *.5^1 = .03125 thus we get 5 * .03125 = .15625 the chance of getting exaclty 4 heads out of 5 flips.

Travel

Encinitas, CA is very nice. The Comedy Store in LA is great, saw Andrew Santino, Bill Burr, Craig Robinson, David Spade, and Ron White. Be careful riding bikes on the PCH on Sat/Sun during the summer… maybe choose a different route/time.

Other

Generally, it is required that police officers have a GED.