This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
from typing import Optional | |
class Term: | |
pass | |
@dataclass | |
class Var(Term): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for c2 in {a..z}; do | |
if ping -c 1 $c1$c2 > /dev/null 2>&1; then | |
echo $c1$c2 | |
fi | |
done | |
for c1 in {a..z}; do | |
for c2 in {a..z}; do | |
if ping -c 1 $c1$c2 > /dev/null 2>&1; then | |
echo $c1$c2 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import language.implicitConversions | |
import compiletime.ops.int.* | |
import compiletime.ops.string.* | |
object Relationships: | |
protected sealed trait Theorem | |
protected class ==>[P, Q] | |
type Has[T <: Theorem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector=(x,y,V=Vector,M=f=>V(f(x),f(y)),P=f=>v=>V(f(v.x,x),f(v.y,y)),C=c=>M(_=>c),I=v=>x*v.x+y*v.y,A=()=>Math.sqrt(I(V(x, y))))=>({ | |
x:x, | |
y:y, | |
toString:()=>`Vector(${x}, ${y})`, | |
[Symbol.iterator]:()=>[x,y].values(), | |
fromPolar:(r,a)=>V(r*Math.cos(a),r*Math.sin(a)), | |
map:M, | |
partial:M, | |
const:C, | |
zero:()=>C(0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stackless(body, max_depth=10_000, cached_results=None): | |
class RecursiveCall(Exception): pass | |
def surface(*args): | |
queue = [args] | |
results = cached_results or {} | |
def store_argument(_, *xs): | |
queue.append(xs) | |
raise RecursiveCall() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ana(coalgebra): | |
def ana_(seed, alg=coalgebra): | |
return alg(seed).map(ana_) | |
return ana_ | |
def apo(coalgebra): | |
def apo_(seed, alg=coalgebra): | |
stop, v = alg(seed) | |
return v if stop else v.map(apo_) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import kivy.core.window.window_sdl2 | |
from kivy.input.motionevent import MotionEvent | |
from kivy.uix.widget import Widget | |
from kivy.uix.label import Label | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.graphics import Line, Mesh, Rectangle, Ellipse | |
from kivy.app import App | |
from kivy.clock import Clock | |