Skip to content

Instantly share code, notes, and snippets.

View willf's full-sized avatar
✒️
pondering

Will Fitzgerald willf

✒️
pondering
View GitHub Profile
@willf
willf / buses.py
Last active November 10, 2017 15:07
# I was sitting on a bus whose number's prime
# factorization was 37 x 113. The prime factorization of the
# number of the bus in front of me was 11 x 373.
# I wonder how many other four-digit bus numbers
# have a prime factorization with exactly those digits?
# pip install sympy
from itertools import chain
from sympy.ntheory import factorint
from itertools import chain
from sympy.ntheory import factorint
def strp(n,p):
if p == 1:
return str(n)
return str(n) + "^" + str(p)
def strf(f):
return "*".join([strp(k, f[k]) for k in sorted(f.keys())])
@willf
willf / non_love_songs.txt
Last active June 23, 2018 19:53
Beatle songs that don't contain a variant on 'love'
(A) Face In The Crowd
(Wish I Could Fly Like) Superman
1822!
20th Century Man
A Gallon Of Gas
A Hard Day's Night
A Little Rhyme
A Long Way From Home
A Rock 'N' Roll Fantasy
A Taste Of Honey
@willf
willf / words.tsv
Last active June 23, 2018 19:49
Document frequency of words in Beatles lyrics. `LOVE` is all forms of the word 'love'
word count percentage of 688 songs
stirring 2 0.29069767441860467
semoc 1 0.14534883720930233
rag 1 0.14534883720930233
digital 1 0.14534883720930233
doctor 7 1.0174418604651163
mammie 1 0.14534883720930233
lear 1 0.14534883720930233
patsy 1 0.14534883720930233
march 2 0.29069767441860467
refaccimentos
recaH
retardance
rosyn
reluisoient
reesarch
recognosces
rhizophagous
roledistance
regularisee
@willf
willf / pitching.md
Last active January 7, 2020 20:42
How to pitch a little bit

Learning to pitch a little bit

More honestly: How I learned to pitch, a little bit, for the 1991 Denson book

I will use a minimum of muical jargon, because I just don’t know that much.

Here’s what you probably need to know first:

  1. The shapes,
  2. Major vs minor keys
@willf
willf / PY0101EN-1-1-Types.ipynb
Created June 20, 2019 14:53
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@willf
willf / PY0101EN-1-1-Types.ipynb
Created June 20, 2019 14:53
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@willf
willf / spamelotrc.rb
Created August 16, 2019 21:21
Let us ride ....
def save_hashes(out_file, data)
CSV.open(out_file, "wb") do |csv|
keys = data.first.keys
csv << keys
data.each do |hash|
csv << hash.values_at(*keys)
end
end
end
@willf
willf / prob.md
Last active November 12, 2019 21:34
Probability of 200,000 people, each with 50,000 images, tripping a False Positive if thee FP rate is 1/10 billion
Denominator False Positive
Rate
Images People Chances
(Images*People)
Prob of at least one FP
1-(1-p)^n
10,000,000,000 1E-10 50,000 200,000 1,000,000,000 63.2%