Skip to content

Instantly share code, notes, and snippets.

-- get all drugs, their side effects, and the frequencies of those side effects
select
drugs.drug_id as drugId,
drugs.name as drugName,
side_effects.name as sideEffectName,
drug_side_effects.frequency as sideEffectFrequency
from drugs
left join drug_side_effects on drug_side_effects.drug_id = drugs.drug_id
left join side_effects on drug_side_effects.side_effect_id = side_effects.side_effect_id
@mostlind
mostlind / excel-cheat-sheet.md
Created January 26, 2018 20:50
Cheat sheet of excel functions for Intro Stats

Excel functions

Chapter 2

Mean

=AVERAGE(array)
@mostlind
mostlind / stats-ch2-formulas.js
Last active January 23, 2018 20:03
These are the formulas from chapter 2 of the stats textbook turned into code
function sum(arr) {
// adds all the measurements in the sample
return arr.reduce((a, b) => a + b);
}
function isWholeNumber(n) {
// helper function
return n % 1 === 0;
}
@mostlind
mostlind / crackle_pop.clj
Created October 23, 2017 16:14
Crackle Pop in Clojure
(defn crackle-pop [n]
(cond-> nil
(zero? (mod n 3)) (str "Crackle")
(zero? (mod n 5)) (str "Pop")
:then ((fnil str n))))
(defn crackle-pop-range [start end]
(map crackle-pop (range start (inc end))))
(doseq