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
// Yoneda states that | |
// (1) f a | |
// is isomorphic to: | |
// (2) forall b. (a -> f b) -> f b | |
// | |
// You can read this as "an interface that lets me run any function on an 'a' and get its result is isomorphic to having the a itself. | |
// The f here is a functor, for this example we can remove generality and say `f a` is "an async computation that returns an a". | |
// | |
// So here's (1) if JS allowed me to just call async functions without handlers: |
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
# Double Pendulum Simulation | |
# Run with academy.cs.cmu sandbox | |
from math import * | |
import random | |
g = 0.78 | |
dt = 0.008 | |
app.stepsPerSecond = 60 |
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
https://www.youtube.com/watch?v=3v9XdhVJLHg |
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
keyLabel = Label('>',100, 50, font='monospace', align='center') | |
def onKeyPress(key): | |
if key == 'backspace': | |
keyLabel.value = keyLabel.value[0:-1] | |
elif key == 'space': | |
keyLabel.value += ' ' | |
elif key == 'enter': | |
eval(keyLabel.value[1:]) | |
keyLabel.value = '>' | |
else: |
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
include"../node_modules/circomlib/circuits/mimcsponge.circom"; | |
template Main() { | |
signal private input leaf ; | |
signal input root ; | |
signal private input pathElements[2] ; | |
signal private input pathIndices[2] ; | |
signal output out ; | |
signal sig__temp0 ; | |
signal sig__temp1 ; | |
sig__temp0 <-- (((pathElements[0])-(leaf))*(pathIndices[0]))+(leaf); |
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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
module Circom where |
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
Rect(0,0,400,200, fill='skyBlue') | |
Rect(0,200,400,200, fill='Blue') | |
def drawFish(x,y): | |
Rect(x,y,30,10,fill='gold') | |
RegularPolygon(x-5, y+5, 10, 3, rotateAngle=90, fill='gold') | |
def drawBird(x,y): | |
Rect(x,y,30,10,fill='white') | |
RegularPolygon(x+15, y+15, 10, 3, fill='white', rotateAngle=180) |