Total Compensation Calculator

This calculator is so handy!

https://www.levels.fyi/calculator/

COVID-19 Vaccine Tracker

Here is a website to track the vaccine progress.

https://biorender.com/covid-vaccine-tracker

Create diagrams with code

Graphviz is powerful! It can visualize dependency with input from code, that means we can programmatically generate visual output.

digraph MyGraph {
  a -> b
  b -> c
  a -> d
  a -> c
}

graphviz-top-bottom

Ref:
https://ncona.com/2020/06/create-diagrams-with-code-using-graphviz/
http://www.webgraphviz.com/
http://magjac.com/graphviz-visual-editor/
https://forum.graphviz.org/

Monty Hall Problem

Interesting brain teaser.

Suppose you’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?

320px-monty_open_door.svg_

Ref:
https://en.wikipedia.org/wiki/Monty_Hall_problem
https://betterexplained.com/articles/understanding-the-monty-hall-problem/

Docker Compose vs Docker Stack

They are very similar, but if you are upgrading from docker compose to docker stack, you may need to modify your existing docker compose yaml file. From what I noticed, here are the obvious pain points

  • No build. If you have build and args, you will need to do that outside of the yaml file. Docker stack expects to see image.
  • No container_name. If you have other services (e.g. nginx) that depend on container_name, you will need to use some workarounds.

Since there are too many sample docker compose yaml files out there, chances are that you will need to modify them if you want to stick with docker stack. I spent too much time playing with nginx, caddy, and traefik, all had some unexpected weird issues with docker stack. The moment I switched back to docker compose, all issues are gone. I will stick with docker compose for now.

ref:
https://stackoverflow.com/questions/46485066/docker-compose-set-container-name-for-stacks

Rule of 72

This is interesting.

Say, if I have $100, and the saving account rate is 2%. Assuming compound interest, how long does it take to double the money?

An easy way to estimate that is to simply calculate: 72 / 2, which is 36. So it will take 36 years to double my money.

Really? Let’s see… 100 * (1+0.02)^(36) = 100 * 2.0398… = 203.98 !!! WTF !!!

How about SPY? Based on trailing 10-year data, the fund generated average annual returns of 11.04%. So how long does SPY take to double my money? 72 / 11 = 6.54.

OK, just 6 and a half year. That’s all it takes. =)

Now you know how to do these kinds of estimates.

The math behind this shortcut is actually quite simple: https://web.stanford.edu/class/ee204/TheRuleof72.html

Covid-19 tests

Apparently there are 3 types of Covid 19 tests.

1. Nucleic acid amplification tests (molecular tests)
  – also known as genetic, RNA or PCR tests.
2. Antibody tests – also known as serology tests.
3. Antigen test

Diagnostic or PCR test. This is the one with the long stick getting mucus from your nose. Even though it takes a few days for the virus to replicate in the nose, this method is so far the most reliable one.

Antibody test. This is a blood test to look for antibodies to the virus. Since it takes time (at least 4 days) for your body to generate antibodies, and without FDA authorization, the result may not mean much.

Antigen test. This method tries to detect proteins from the virus in nose. It is a quick screening test for just a few minutes, but accuracy is still to be determined.

ref:
https://asm.org/Articles/2020/April/COVID-19-Testing-FAQs
https://www.npr.org/sections/health-shots/2020/05/01/847368012/how-reliable-are-covid-19-tests-depends-which-one-you-mean

WordPress hosting on AWS

I am glad my blog is on wordpress.com.

EVwf9tRUMAATNy1

Seems like there are better ways now (not necessarily easy):
https://aws.amazon.com/getting-started/hands-on/launch-a-wordpress-website/
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html

Unemployment

The number of Americans who applied for unemployment benefits last week rocketed to a record 3.28 million

Screen Shot 2020-03-26 at 10.42.40 AM

Why is the market still going up? Don’t fool me. People don’t have jobs, government is printing money, where are we going? This is probably just the first wave of unemployment numbers, wait until the next wave.

Link: https://www.marketwatch.com/story/a-record-328-million-americans-applied-for-unemployment-benefits-last-week-due-to-coronavirus-2020-03-26

Social distancing?

Would social distancing work? The available hospital beds line is way down there. I kinda understand now why China built new hospitals in 7 days and locked down cities. It was really to minimize casualties. Social distancing could only delay the spike. I wonder if we spent the trillion dollars to pay everyone to stay home instead, would that be a better alternative.

Screen Shot 2020-03-26 at 8.28.42 AM

Screen Shot 2020-03-26 at 8.29.27 AM

Link: https://covidactnow.org/state/WA