Skip to content

Instantly share code, notes, and snippets.

View BekaValentine's full-sized avatar

Rebecca Valentine BekaValentine

View GitHub Profile

Keybase proof

I hereby claim:

  • I am bekavalentine on github.
  • I am beka_valentine (https://keybase.io/beka_valentine) on keybase.
  • I have a public key ASCzOGe_wKybqN0_bwuuuvUhnRAdeVfHhB4y-UwQgVtLnQo

To claim this, I am signing this object:

use std::fmt;
#[derive(Debug)]
enum Type {
Number,
Prod(Box<Type>, Box<Type>),
Fun(Box<Type>, Box<Type>)
}
#[derive(Debug)]
$fn = 100;
module radius_gauge(min_radius, max_radius, radius_step, vertical_step_size, padding) {
gauge_side = max_radius + padding;
vertical_step_count = (max_radius - min_radius) / radius_step;
gauge_height = vertical_step_count * vertical_step_size + 2*padding;
difference() {
cube([gauge_side,gauge_side,gauge_height]);
module FinPow where
open import Data.Bool
open import Data.Nat renaming (ℕ to Nat)
open import Data.Fin renaming (zero to fzero ; suc to fsuc)
open import Data.Product renaming (Σ to Sg ; proj₁ to proj1 ; proj₂ to proj2)
open import Relation.Binary.PropositionalEquality renaming (_≡_ to _==_)
record Iso (X Y : Set) : Set where
field
@BekaValentine
BekaValentine / medsets.hs
Created December 24, 2020 08:42
Kathryn's Med Set Problem
-- Problem
--
-- Given a set of people P, and for each person p in P, a set of meds M_p that the person takes
-- Find the partitions of P for which every set t in the partition, every medication that some person in t takes
-- is taken at least two people in t, and the partition has the maximum number of subsets.
--
-- Rephrased: the set of largest partitions of a set of people P, for which each set in the partition
-- consists of people who share each medication w/ someone else in the set.
--
-- Example
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
main = print ()
-- generic types
data Zero r
data One r = Unit
data X r = Rec r
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
module ASTs where
-- Let's do Hutton's Razor. Here's the version with a standard
Q) What's the stack graph for the following program
def foo(x):
return x
foo(1)
Q) What are the stack graph analogs of the following scope graph programs
1.
beka@ultralaser:~/Projects/RetroUI/src$ mypy --strict retroui/terminal/colorswatch.py
Traceback (most recent call last):
File "/home/beka/.local/bin/mypy", line 10, in <module>
sys.exit(console_entry())
File "/home/beka/.local/lib/python3.7/site-packages/mypy/__main__.py", line 8, in console_entry
main(None, sys.stdout, sys.stderr)
File "mypy/main.py", line 89, in main
File "mypy/build.py", line 180, in build
File "mypy/build.py", line 249, in _build
File "mypy/build.py", line 2649, in dispatch