Skip to content

Instantly share code, notes, and snippets.

@Radcliffe
Radcliffe / banned-books-krause-tx.csv
Last active February 10, 2022 22:57
List of books targeted by TX Rep Matt Krause because they could make students feel uneasy - https://www.npr.org/2021/10/28/1050013664/texas-lawmaker-matt-krause-launches-inquiry-into-850-books
Id Title Author Published
1 2020 Black Lives Matter marches Markovics, Joyce L. 2021
2 A complicated love story set in space Hutchinson, Shaun David 2021
3 A lesson in vengeance Lee, Victoria 2021
4 As far as you'll take me Stamper, Phil 2021
5 Be dazzled La Sala, Ryan 2021
6 Black Lives Matter: from hashtag to the streets Tyner, Artika R. 2021
7 Can't take that away Salvatore, Steven 2021
8 Follow your arrow Verdi, Jessica 2021
9 Have I ever told you Black lives matter King, Shani M. 2021
@Radcliffe
Radcliffe / million-digits-of-e-factorial-number-system.txt
Created August 11, 2021 13:26
A million digits of e in the factorial number system
This file has been truncated, but you can view the full file.
10.1111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111 1111111111
1111111111 1111111111 1111111111 1
@Radcliffe
Radcliffe / umn-open-textbook-library.json
Created August 10, 2021 04:02
UMN Open Textbook Library
This file has been truncated, but you can view the full file.
[
{
"category": "Business",
"description": [
"Principles of Accounting is designed to meet the scope and sequence requirements of a two-semester accounting course that covers the fundamentals of financial and managerial accounting. Due to the comprehensive nature of the material, we are offering the book in two volumes. This book is specifically designed to appeal to both accounting and non-accounting majors, exposing students to the core concepts of accounting in familiar ways to build a strong foundation that can be applied across business fields. Each chapter opens with a relatable real-life scenario for today\u2019s college student. Thoughtfully designed examples are presented throughout each chapter, allowing students to build on emerging accounting knowledge. Concepts are further reinforced through applicable connections to more detailed business processes. Students are immersed in the \u201cwhy\u201d as well as the \u201chow\u201d aspects of accounting in order to reinfo
@Radcliffe
Radcliffe / a049463.py
Last active August 2, 2021 04:11
Python script for sequence A049463, Number of basic interval orders of length n.
# See https://oeis.org/A049463
from functools import lru_cache
@lru_cache(maxsize = None)
def binom(n, k):
return 1 if k == 0 else n * binom(n - 1, k - 1) // k
@Radcliffe
Radcliffe / check-security-updates.sh
Created November 28, 2020 05:15
Check for security updates on an Ubuntu server and send email notifications via Sendgrid
#!/bin/bash
# Script to send an email notification via Sendgrid when there are security updates pending for an Ubuntu server.
# Sendgrid API reference
# https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html
# Bash Guide on if-statements
# https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html
@Radcliffe
Radcliffe / covid19report.py
Created March 17, 2020 18:41
Python script to display a Covid-19 report
# This Python 3 script displays a Covid-19 report.
#
# Usage: Type the following command in a terminal window.
# python3 covidreport.py
#
# Author: David Radcliffe ([email protected])
# License: Public domain
# Date: 17 March 2020
from datetime import datetime
@Radcliffe
Radcliffe / circle_plot.py
Last active January 27, 2020 16:22
Circle plot for the state vector of a quantum register
# File: plot_circles.py
#
# This code is used with Qiskit to display the circle plot representation of the state vector
# of a quantum register. The state vector for an N-qubit quantum register has 2^N components,
# which are called amplitudes. Each amplitude is a complex number, and the squared magnitudes
# add up to 1.
#
# The circle plot has a circle of radius 1 for each amplitude, with a filled-in circle inside it.
# The radius of the filled-in circle is equal to the magnitude. The circle also contains a line
# segment from the center of the circle to the circumference. The line segment is rotated to show
@Radcliffe
Radcliffe / sperner2020.txt
Created December 28, 2019 03:08
Happy 2020, Emanuel Sperner!
There are 2020 ways to choose 4 nonempty subsets of {1,2,3,4,5} so that no set contains another.
(Sperner systems with 4 blocks)
{{1}, {2}, {3}, {4}}
{{1}, {2}, {3}, {5}}
{{1}, {2}, {3}, {4, 5}}
{{1}, {2}, {4}, {5}}
{{1}, {2}, {4}, {3, 5}}
{{1}, {2}, {3, 4}, {5}}
@Radcliffe
Radcliffe / circular_sudoku_graph.py
Created December 26, 2019 05:32
Draw the Sudoku graph with a circular layout
"""
This script draws a Sudoku graph with the vertices arranged in a circle.
David Radcliffe
[email protected]
25 December 2019
The sudoku_graph() function below is being considered for a future version of NetworkX.
"""
@Radcliffe
Radcliffe / generalized-coupon.py
Created October 25, 2019 21:06
Coupon Collector problem with unequal probabilities
"""
A generalized coupon collector problem.
An experiment with n possible outcomes is repeated until each of the possible
outcomes is observed at least once. Each outcome i has a fixed non-zero
probability p[i], and each trial is independent of the previous trials.
What is the expected number of trials?
For example, what is the expected number of times that two dice must be rolled
until all of the possible totals (from 2 to 12) have appeared at least once?