You can look up the mean and variance of a distribution on Wikipedia. This is the distribution of a single visitor and whether this visitor signs up (1) or not (0).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION my_count_state(state integer, value anyelement) | |
| RETURNS integer AS $$ | |
| BEGIN | |
| IF value IS NOT NULL THEN | |
| RETURN state + 1; | |
| ELSE | |
| RETURN state; | |
| END IF; | |
| END; | |
| $$ LANGUAGE plpgsql; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TYPE avg_state AS ( | |
| total numeric, | |
| count integer | |
| ); | |
| CREATE OR REPLACE FUNCTION my_avg_state(state avg_state, value numeric) | |
| RETURNS avg_state AS $$ | |
| BEGIN | |
| IF value IS NOT NULL THEN | |
| state.total := state.total + value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A pure Javscript implementation of binomial distribution | |
| // This is for educational purposes. These numbers can become unreliable | |
| // when the numerators and denominators get too big. This is because | |
| // of floating point arithmetic. | |
| // | |
| // Use a more robust statistical library for mission critical calculations | |
| function factorial(n) { | |
| let total = 1; | |
| for(let i=n; i>1; i--) { |
We're assuming the opposite, so we're assuming there's one average click through rate for both pages:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # red-green-refactor-validator.sh | |
| # Validates test-driven development red-green-refactor workflow | |
| # | |
| # Exit codes: | |
| # 0 - Validation successful (tests failed on old code, passed on new code) | |
| # 1 - Validation failed (no tests changed, or tests didn't follow red-green pattern) | |
| # 2 - Precondition failed (unstaged changes exist) | |
| # 3 - Script error (stash/restore failed) |
When I was a kid I thought I was going to grow up to be an automotive engineer. I read Car and Driver cover to cover every month. One ad that stuck with me for 30 years was for a brand of tires. The Pirelli "Power is Nothing Without Control" campaign. A barefoot sprinter making a tight corner, angled so steeply he's nearly horizontal to the ground. Raw capability at its limit — and the only thing keeping him from becoming a skid mark is the interface between his foot and the ground. That interface is what this talk is about.
OlderNewer