Skip to content

Instantly share code, notes, and snippets.

View kg583's full-sized avatar
💭
Just vibin'

KG kg583

💭
Just vibin'
View GitHub Profile
@kg583
kg583 / dock.py
Last active May 20, 2023 18:04
A simple system for adaptively loading different data types into a class
class Dock:
"""
Base class to inherit to implement the loader system
"""
loaders = {}
def load(self, data):
"""
Load some data based on the data's type
@kg583
kg583 / iopcc.py
Last active June 30, 2023 06:34
Logo for the 2023 IOPCC
c,o,d,e =[ 32],[95], [32,124],[124,32] ;vars(vars( ) [dir( )[1]])[
dir(vars() [dir( )[1]])[ 136] ]( vars( str) [dir( str)[56]]( str(1)[:~1],map(
vars(vars( )[dir()[1]])[dir( vars( )[dir( )[1]]) [92]],[*c*2,95,*c* 4,95,*c*10,95,*c*3
,95,*c*10, *o*2,*c*10,*o*2,*c* 15,95,*c *7,95,* c*3,95,32,10,*d*2,* c*2,*e,124,*c*8,*e*
4,* c* 8 ,92,32 ,92,*c*8 ,47,32 ,47,*c* 14,*e*2 ,*c*4, *e*3,124 ,10,*d
*2,*o* 2,*e*2, *c*2,*o *3,32, *d*4,* c*3,*o*3 ,*c* 4,
92,32, 92,*c*2, 47,92,* c*2,47,32,47,*c*2 ,*o*3,* c*4,95,
32,*o* 2,32,*d *2,*c*3 ,*o*2,*e*3, 124, 10,*d,* c*2,*o*
2, *c* 2,*e,32 ,47,32, 95,32,92,*d*4, *c*2,47 ,32,95,
32,92, *c*4,92 ,32,92, 47,*c* 2,92,47 ,32,47,
@kg583
kg583 / hello_world.py
Created August 7, 2022 22:42
Hello World! with only 2 distinct punctuation marks
from operator import attrgetter
from operator import itemgetter
@itemgetter
@slice
@int
@next
@reversed
@str
@kg583
kg583 / examples.sagews
Last active June 28, 2021 01:16
Supersingular loci from traces of Hecke Operators
# Cache to accelerate calculation of traces
from functools import cache
# Default power series ring and precision
# May need to increase for large weight traces
R.<q> = PowerSeriesRing(QQ)
PREC = 200
# Gets the coefficient of q^n in f
def coeff(f, n):
@kg583
kg583 / maxN.sage
Last active August 7, 2020 06:39
Bounds for Coefficients of the f(q) Mock Theta Function
# SageMath code used to calculate maxN(r,2;n) and generate Table 4
# Kevin Gomez -- 8/7/2020
# Rank of a partition p
def rank(p):
return max(p) - len(p)
# N(r,t;n), the r (mod t) rank counting function
def N(r,t,n):
return len(list(filter(lambda p: rank(p) % t == r, Partitions(n))))