Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Night cosmologicon

View GitHub Profile
@cosmologicon
cosmologicon / pickle-local-error.py
Created Sep 27, 2020
PyWeek 30 pickle edge case: minimal example
View pickle-local-error.py
# Minimal example of pickling error encountered in my PyWeek 30 entry.
# Unpickling a function fails when it can't be referred to by the name in its __name__ attribute,
# such as when the function is locally defined within a callback.
# This is unlikely to come up in general unless you explicitly set the __name__ attribute, because
# you can't pickle local objects. However, it occurs when you pickle the method of an instance and
# the method of that instance's class is a local object.
import pickle
@cosmologicon
cosmologicon / crossword-grid-validity-examples.txt
Last active Jan 24, 2020
Examples of crossword grid requirements for Daily Programmer #382
View crossword-grid-validity-examples.txt
7x7 valid
. . . # . . .
. . . # . . .
. . . . . . .
# # . . . # #
. . . . . . .
. . . # . . .
. . . # . . .
@cosmologicon
cosmologicon / yahtzee-upper-1.txt
Created Nov 11, 2019
Yahtzee upper section scoring bonus challenge input
View yahtzee-upper-1.txt
579066766
3846016
567281940
3354341
3219931
4750791
34780459
233097105
32052310
486792205
@cosmologicon
cosmologicon / smorse2-bonus1.in
Created Aug 7, 2019
Input for r/dailyprogrammer Intermediate #380 bonus 1
View smorse2-bonus1.in
------.-...-..--.-...-.-..-.-..-...---.--...-.-....---..-...-.-......--..---.-.---
-----.-----.--..--.-..--..-..--...--.-.....-..-.--...-.-.-......--.-...-..-..---..
-----.--.--.-...---.--..-..--..-.-.-.....-.-.-.--.-.-..--..--.--.-.......--......-
-----.--..---.--.-..-....--.....---.-.---.-..-....-.-.-...-.-......-...-.---..--.-
-----.-.--.---..--.---.-....-.........-.-....----..-..-.-..--..--..--.-.--....--..
-----.-.--...--.----..--.-....-......--...-..--.....-.-.--.....----.-..-.-...---.-
-----.-..--......-.-.-......-...-.---.--..-.-.----.-...-..-...--.-...---.--.-.--..
-----.-...---..-....--......--.-.----..---..--.-.--.-..-.-.-.---.-.........-..--..
-----.-....---.--..-..-..-....-.-...---..-.--....-...-.-.-.-.-.....-----.--.--.-..
-----...-.-.-.-...---.--..---.-.-....-.---..-...-.--..--.......-.-..---.--.....--.
@cosmologicon
cosmologicon / tree-equal.txt
Created Jan 25, 2019
Pairs of tree representations for Daily Programmer #373: which ones are equal?
View tree-equal.txt
(()) (())
(()()) (()())
(()()()) (()()())
(()()()()) ((())()())
((())()(())) ((())()(()))
((())()()(())) ((())()()(()))
((()())()()()()) (()()(()())()())
((())()()()()()()) (()()()()()(())())
((()())(()())()(())) ((())()(()())(()()))
((())()()()((())()())) ((()())()(()(())())())
@cosmologicon
cosmologicon / tree-embed.txt
Created Jan 25, 2019
Pairs of tree representations for Daily Programmer #373: which ones are embeddable?
View tree-embed.txt
(((()(())(()))()(()())()())((())(()())(()()())(()()()()()(()()))(())())(()()()())((())()()()()()(()))(((())()((())())(()))(()())(()((())()())())((())())(()()(())(())())(()()())(()))(()(()()()()())(()()()(()())()())()()()(())((())()()(()()())))((()(())(()))()())((()()())((()())(()())(()))(()())()((())()())(()()()((()(()))())(()(())()())(())(((())())()()()))(()())(()()()(((()))())))(()(())(())(()))) ((((())()(())())()((())()()())(())()(()())(())(()(()())()(()()())()())(()(())((())()(()))))((())(()())()()(()(())())()(())(()(())()))(()(()()())(()()(())()())(())()(()()(()())(()()))(()())(()))((())(()(()())())((()())()())(()(())())((())(())()(())())((())(())(()())(()())(()(())(()()())()()())(())(())(()()(()())()(())()))((()()())(()()()())()(())(())())(()()())(()(())()))((()()(())(())()())(()((())(((())))()())(())(()(()())()()()(()))(())(()))(()()())(()(())()()())(()()(()(())()(()()()())()(())())()()(()()(()()()())()(())()()())(()()()())(()())(()()))(()()()()(()(())()))(()()(()(()()))()()()(())((())()()(()))())((())
@cosmologicon
cosmologicon / 363-hard-words.txt
Created Jun 15, 2018
Challenge input for dailyprogrammer #363 [Hard]
View 363-hard-words.txt
abed
abet
achy
acid
ados
agar
agha
ague
ahem
ains
@cosmologicon
cosmologicon / tex-hyphenation-patterns.txt
Created Jun 14, 2018
Hyphenation pattern list from hyphen.tex (not the complete file!)
View tex-hyphenation-patterns.txt
.ach4
.ad4der
.af1t
.al3t
.am5at
.an5c
.ang4
.ani5m
.ant4
.an3te
@cosmologicon
cosmologicon / elise.txt
Created Dec 8, 2017
Für Elise by Beethoven, for 2017-12-08 r/dailyprogrammer challenge
View elise.txt
76 0 0.25
75 0.25 0.25
76 0.5 0.25
75 0.75 0.25
76 1 0.25
71 1.25 0.25
74 1.5 0.25
72 1.75 0.25
69 2 0.75
60 2.75 0.25
@cosmologicon
cosmologicon / clair-de-lune.txt
Created Dec 8, 2017
Clair de Lune by Debussy, for 2017-12-08 r/dailyprogrammer challenge
View clair-de-lune.txt
80 0 2
77 2 2
75 4 0.5
77 4.5 0.5
75 5 3.5
73 8.5 0.5
75 9 0.5
73 9.5 0.75
77 10.25 1.5
73 11.75 1.25
You can’t perform that action at this time.