This file contains hidden or 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 collections import Counter | |
| import tensorflow as tf | |
| import tensorflow.keras as keras | |
| import tensorflow.keras.layers as layers | |
| from nltk import word_tokenize | |
| class BengioModel(keras.Model): | |
| ''' Model that replicates the architecture of Bengio et al. ''' |
This file contains hidden or 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
| module Lib | |
| where | |
| import Graphics.Gloss | |
| density :: Float | |
| density = 0.1 | |
| spiral :: [Float] -> [(Float, Float)] | |
| spiral pts = map f pts |
This file contains hidden or 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 enum import Enum, auto | |
| class HeadMove(Enum): | |
| LEFT = -1 | |
| RIGHT = 1 | |
| NOTHING = 0 | |
| class TuringMachine: |
This file contains hidden or 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
| program := 0; | |
| i := 0; | |
| read program; | |
| read i; | |
| j := i; | |
| l := 0; | |
| data := 0; | |
| while j >= 0 do | |
| pow := 1; | |
| k := 0; |
This file contains hidden or 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
| #!/usr/bin/env python | |
| def sort_of(numbers): | |
| """ Old bad code. | |
| Computes the minimum element of each sublist from i..n where n is the length of the list. """ | |
| result = [] | |
| for i in range(len(numbers)): | |
| sub = sorted(numbers[i:]) |
This file contains hidden or 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 Data.Foldable | |
| import qualified Data.List as L | |
| data Tree a = Node Integer (Tree a) (Tree a) a | Leaf deriving (Show, Eq) | |
| data Direction a = L Integer a (Tree a) | R Integer a (Tree a) | |
| newtype Zipper a = (Tree a, [Direction]) | |
| left :: Zipper a -> Zipper a | |
| left z@(Zipper Leaf directions) = z | |
| left (Zipper (Node lvl left right val) directions) = Zipper left $ (Left lvl val right):directions |
This file contains hidden or 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 Data.Foldable | |
| import qualified Data.List as L | |
| data Tree a = Node Integer (Tree a) (Tree a) a | Leaf deriving (Show, Eq) | |
| data Path = LeftP | RightP | |
| instance Foldable Tree where | |
| foldMap f Leaf = mempty | |
| foldMap f (Node _ l r v) = foldMap f l `mappend` f v `mappend` foldMap f r |
This file contains hidden or 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
| #!/usr/bin/env fish | |
| set -l maths (cat) | |
| echo 'stem:[' (string trim -- "$maths" ) ']' | |
| asciiTeX "$maths" |
This file contains hidden or 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
| color cursor black white | |
| color status white default bold | |
| color header black white | |
| color title-blur white black | |
| color title-focus white black bold |
This file contains hidden or 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
| -- load standard vis module, providing parts of the Lua API | |
| require('vis') | |
| require('surround') | |
| require('vis-commentary') | |
| vis.events.subscribe(vis.events.INIT, function() | |
| -- Your global configuration options | |
| vis:command('set theme default-16') | |
| vis:command('set ai on') | |
| vis:command('set expandtab true') |