Skip to content

Instantly share code, notes, and snippets.

@kamthecham
kamthecham / springer-free-maths-books.md
Created July 10, 2020 10:04 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links
@kamthecham
kamthecham / springer-free-maths-books.md
Created July 10, 2020 10:04 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links
@kamthecham
kamthecham / springer-free-maths-books.md
Created July 10, 2020 10:04 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links
@kamthecham
kamthecham / springer-free-maths-books.md
Created July 10, 2020 10:04 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links
@kamthecham
kamthecham / best.R
Created July 10, 2020 09:51 — forked from timmyshen/best.R
Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv le and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specied outcome in that state. The hospital name is the…
best <- function(state, outcome) {
data <- read.csv(file='outcome-of-care-measures.csv', colClasses = 'character')
if(!any(state == data$State)) {
stop('invalid state')
}
if(outcome == 'heart attack') {
i <- 11
@kamthecham
kamthecham / best.R
Created July 10, 2020 09:51 — forked from timmyshen/best.R
Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv le and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specied outcome in that state. The hospital name is the…
best <- function(state, outcome) {
data <- read.csv(file='outcome-of-care-measures.csv', colClasses = 'character')
if(!any(state == data$State)) {
stop('invalid state')
}
if(outcome == 'heart attack') {
i <- 11
@kamthecham
kamthecham / best.R
Created July 10, 2020 09:51 — forked from timmyshen/best.R
Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv le and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specied outcome in that state. The hospital name is the…
best <- function(state, outcome) {
data <- read.csv(file='outcome-of-care-measures.csv', colClasses = 'character')
if(!any(state == data$State)) {
stop('invalid state')
}
if(outcome == 'heart attack') {
i <- 11
from pathlib import Path
import dataclasses
import typing
import re
import ebooklib
from ebooklib import epub
import html2text
import m2r