Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
Center Key People Type URL
Leverhume Centre for Future of Intelligence Price - Ghahramani - Boström - Russell - Shanahan Funding http://lcfi.ac.uk/
Center for Human Compatible AI Russell Academic (UC Berkeley) http://humancompatible.ai/
Centre for Study of Existential Risk Price - Ó hÉigeartaigh Academic (Cambridge) http://cser.org/
Future of Life Institute Tallinn - Tegmark Funding https://futureoflife.org
Future of Humanity Institute Boström Academic (Oxford) https://www.fhi.ox.ac.uk/
OpenAI Sutskever - Brockman Corporate (Y Research - InfoSys - Amazon - Microsoft - Open Philantrophic Project) https://openai.com/
AI Now Institute Crawford - Whittaker Academic (NYU) https://ainowinstitute.org/
Machine Intelligence Research Institute Soares - Yudkowsky Corporate https://intelligence.org/
@AndrasKovacs
AndrasKovacs / STLCSubst.agda
Last active November 12, 2017 13:59
Example of complete STLC substitution calculus
{-# OPTIONS --without-K #-}
{-
Below is an example of proving *everything* about the substitution calculus of a
simple TT with Bool.
The more challenging solution:
- If substitutions are defined as lists of terms, then if you manage to
prove that substitutions form a category, almost certainly you're done,
since you can only prove this is you have all relevant lemmas.
@dorchard
dorchard / Category.agda
Last active August 17, 2017 14:13
Definition of a category as an Agda record: level polymorphic in the objects and arrows
module Category where
open import Level
open import Relation.Binary.PropositionalEquality
open Level
record Category {lobj : Level} {larr : Level} : Set (suc (lobj ⊔ larr)) where
field obj : Set lobj
arr : (src : obj) -> (trg : obj) -> Set larr
@gelisam
gelisam / Main.agda
Last active June 21, 2018 19:45
cat in Agda using copatterns
{-# OPTIONS --copatterns #-}
module Main where
-- A simple cat program which echoes stdin back to stdout, but implemented using copatterns
-- instead of musical notation, as requested by Miëtek Bak (https://twitter.com/mietek/status/806314271747481600).
open import Data.Nat
open import Data.Unit
open import Data.Bool
open import Data.Char
@puffnfresh
puffnfresh / Main.agda
Last active July 30, 2017 01:59
cat in Agda
module Main where
import IO.Primitive as Prim
open import Coinduction
open import Data.Unit
open import IO
cat : IO ⊤
cat = ♯ getContents >>= (\cs → ♯ (putStr∞ cs))
@puffnfresh
puffnfresh / Main.agda
Created December 6, 2016 23:47
Non-terminating IO data type in Agda
module Main where
import IO.Primitive as Prim
open import Data.Unit
open import IO
open import Coinduction
nonTerminatingIO : IO ⊤
nonTerminatingIO = ♯ nonTerminatingIO >> ♯ return tt
@gallais
gallais / State.agda
Last active August 4, 2016 11:18
Based on the material discussed in https://www.youtube.com/watch?v=9v4_FQm-b4I
module State where
open import Data.Unit
open import Data.Product
open import Function
open import Relation.Binary.PropositionalEquality
_⟶_ : {I : Set} (X Y : I → Set) → Set
X ⟶ Y = ∀ {i} → X i → Y i
{-# language DataKinds, PolyKinds, ScopedTypeVariables, UndecidableInstances,
FlexibleInstances, FlexibleContexts, GADTs, TypeFamilies, RankNTypes,
LambdaCase, TypeOperators, ConstraintKinds #-}
import GHC.TypeLits
import Data.Proxy
import Data.Singletons.Prelude
import Data.Singletons.Decide
import Data.Constraint
module Scratch where
postulate
Inf : ∀ {a} (A : Set a) → Set a
delay : ∀ {a} {A : Set a} → A → Inf A
force : ∀ {a} {A : Set a} → Inf A → A
{-# BUILTIN INFINITY Inf #-}
{-# BUILTIN SHARP delay #-}
{-# BUILTIN FLAT force #-}