Skip to content

Instantly share code, notes, and snippets.

View willf's full-sized avatar
✒️
pondering

Will Fitzgerald willf

✒️
pondering
View GitHub Profile
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 / 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
@willf
willf / Five_Sevens.md
Last active August 9, 2019 18:04
The introductory section of Hugh of St Victor's _On the Five Sevens_ as a table and a list

See: https://en.wikisource.org/wiki/On_the_Five_Sevens

Number Vice Request Gift Virtue Blessing
1 Pride Hallowed be your name Fear of the Lord Humility Kingdom of Heaven
2 Envy Your kingdom come Godliness Kindness Land of the Living
3 Anger Your will be done Knowledge Remorse Consolation
4 Sadness Give us daily bread Strength Hunger for Good Satisfaction
5 Greed Forgive us our debts Counsel Mercy Mercy
6 Gluttony Lead us not into temptation Understanding Cleanness of Heart Vision of God
@willf
willf / chat_transcript.log
Created July 27, 2017 17:37
Chat with Adobe
Did you know you can get answers to most of your Adobe-related questions at help.adobe.com? Find helpful video tutorials, tips for troubleshooting, and user guides for all our products. You can even get answers from members of our vibrant forums community. Visit help.adobe.com. Please hold for the next available agent.
info: You are now chatting with Aishwarya.
Please don’t close the chat window or browser tab since it will end our chat session.
Aishwarya: Hello! Welcome to Adobe support.
Aishwarya: How are you Asher?
Asher Williams: Did you see my question?
Aishwarya: Yes, as I have understood you want to know about the amount that were charged to your account. Right?
Asher Williams: I want to know if you (1) are charging me monthly or annually
Aishwarya: Okay.
Aishwarya: Please allow me 1-2 minutes to review your account details.
@willf
willf / redirect.rb
Last active June 6, 2017 06:13
Follow redirect links
require 'net/https'
require 'uri'
=begin
This simple module provides two methods to follow, and return, the redirects of a URL
It goes to a depth of 10 unless specified otherwise.
Redirect.redirect_urls(<url>) returns a dictionary with the following keys:
:completed : true if reached final direct before hitting limit
:uris : a list of URI structures. The first will be the final destination
:urls: a string version of the above
https://cpa.ds.npr.org/wvpn/audio/2016/12/2016-11-25_aoife_o_donovan-magic_hour.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/12/2016-10-28_billy_bragg___joe_henry-gentle_on_my_mind.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/12/2016-04-29_bottle_rockets-dog.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/06/2016-06-03_brett_dennen-cassidy_0.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/12/2016-12-06_cheryl_wheeler-estate_sale.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/12/mtnstage161028_chris_smither-leave_the_light_on.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/12/mtnstage160610_darrell_scott-desperados_waiting_for_a_train.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/11/2016-11-11_foy_vance-children_of_the_revolution.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/06/2016-06-10_hayes_carll-sake_of_the_song.mp3
https://cpa.ds.npr.org/wvpn/audio/2016/12/2016-12-06_indigo_girls-shame_on_you.mp3
@willf
willf / gschsc_2016.m3u
Created December 19, 2016 20:53
Georgia State Christian Harmony Convention 2016
http://shapenote.com/recordings/gschsc/2016/sat/session1/01-67T-notes.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/01-67T-words.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/02-359.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/03-319.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/04-61T.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/05-310.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/06-493.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/07-4.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/08-316.mp3
http://shapenote.com/recordings/gschsc/2016/sat/session1/09-543-notes.mp3
@willf
willf / stats.rb
Created November 14, 2016 20:54
Basic descriptive statistics using Ruby
# The _percentile_sorted function is adapted from similar code
# released under the Academic Free License, 3.0, written by
# Derrick Pallas, which used to be available at http://derrick.pallas.us/ruby-stats/
# it fixes a bug that can occur if the list of numbers is small.
# Other code more or less from my [first ever gist](https://gist.github.com/willf/187846)
def _percentile_sorted(p, ns)
r = p / 100.00 * (ns.size + 1)
i, fr = r.divmod(1)

Practice Resurrection

Luke 20:27-40
Will Fitzgerald
Kalamazoo Mennonite Fellowship
November 6, 2016

Some Sadducees, those who say there is no resurrection, came to him and asked him a question, "Teacher, Moses wrote for us that if a man's brother dies, leaving a wife but no children, the man shall marry the widow and raise up children for his brother. Now there were seven brothers; the first married, and died childless; then the second and the third married her, and so in the same way all seven died childless. Finally the woman also died. In the resurrection, therefore, whose wife will the woman be? For the seven had married her."

Jesus said to them, "Those who belong to this age marry and are given in marriage; but those who are considered worthy of a place in that age and in the resurrection from the dead neither marry nor are given in marriage. Indeed they cannot die anymore, because they are like angels and are children of God, being children of the resurrection.

The first number is the *base*, The first list is the list of prime rotations in that base, and the third are those rotations in base 10.
For example, in base 4, the numbers {113, 131, 311} (written in base 4) are all prime rotations, representing the prime numbers
{23, 29, 53} (written in base 10).
This is the complete list created from the first 2 million primes.
2 [11] [3]
2 [111] [7]
2 [11111] [31]
2 [1111111] [127]