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
what does this do, exaclty? |
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
# fuzsli.py | |
# use python 3 so that floats are used | |
##################################### | |
### INTERNAL DEFINITIONS AND SETUP | |
from pprint import pprint |
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
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import pylab | |
import numpy |
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
bar |
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
-- Maybe Just Nothing | |
data Smurf a = Foo a | Bar deriving (Eq, Ord, Show) | |
-- fmap :: Functor f => (a -> b) -> f a -> f b | |
instance Functor Smurf where | |
fmap f (Foo x) = Foo (f x) | |
fmap f Bar = Bar | |
-- fmap (+ 2) (Foo 10) => Foo 12 | |
-- fmap (+ 2) Bar => Bar |
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
In Bird-style you have to leave a blank before the code. | |
> fact :: Integer -> Integer | |
> fact 0 = 1 | |
> fact n = n * fact (n-1) | |
And you have to leave a blank line after the code as well. | |
Lorem ipsum dolor sit amet, ea per vitae mentitum, mei ne latine vocibus docendi. Te vim odio dolore, nec facete vocibus ex, in aeque alienum eum. In vel saepe nostrud. Hendrerit suscipiantur in vel, ex adhuc aliquam vocibus pro. Eu zril civibus mei. |
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
Exploring Haskell monads using Either | |
Stephan Boyer explained it well why you would want to use monads: | |
http://www.stephanboyer.com/post/9/monads-part-1-a-design-pattern | |
"In each example, we had some functions which we wanted to compose, | |
but their type signatures were incompatible. Our functions took a | |
value of some type and returned a value in the corresponding monadic | |
type." |
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
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA54AAAIsCAYAAACa+nYtAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3woeEwoRW/XpBgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAgAElEQVR42uy9W5OkyXEldtwjvszqnmsPhuAAWJAEl+CCFxMlGU3L5er6sra7WpleZLb6xTLTgyTTix5oRhMpYEFiMJx7d1XmF+GuB/e4fHmpyqyu6q7qCjdrYPpSmd8lwsP9+PHjwLBhw4YNGzZs2LBhw4YNGzZs2LBhw4YNGzZs2LBhw4Y9VqPyH8/ef6HjcTxWk2teL43H86RM/ddYC8PGWhg21sSwsRaG3XYtjPUw1sTdrYXL778iAODxcIcNGzZs2LBhw4YNGzZs2H3aSDyHDRs2bNiwYcOGDRs2bNhIPIcNGzZs2LBhw4YNGzZs2Eg8hw0bNmzYsGHDhg0bNmzYsJF4Dhs2bNiwYcOGDRs2bNiwN2/xyT+BQyJN1wl8DRs2bNiwYePsXJ6dD+HcLNd0yrWc82+HjVhq2LDX2RNjL1QbFc9hw4YNGzZs2PlB1XW/fwjXdFf/dtj9v49hw8ZeeBI2Kp4DhRg2bNiwYcPOM3nk1yTjFY5YatiwsSfetI2K57Bhw4YNGzZs2LBhw4YNG4nnsGHDhg0bNmzYsGHDhg17vNZRbQWHu8PfdTtUCx/P4Wk/i0PP5ak+h6d+/8Nu9hHA08Qw5YnvC3mAZ0W/Rq+7Hnnia/cprYlhI5Ycz+GBJp7YcdgP4aXhxOvRO75mfUcXxm3e70NZE6dcx11eqx5Yh4/B6MTr1hP3lT7QPXHq9dzFdes1z/ld8gun7q/H6tvuwj/oA/WPb3PNPOVn8a77hsfuH8699rs+K0Yc+WBjSaIjirPvavz/ts/do4nnQ0w0Trmp+7jmd23x6ZnJ/EN6Fqdc++ |
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
[[tabview]] | |
[[tab Set]] | |
[[>]] | |
[[module Rate]] | |
[[/>]] | |
[[include component:image-block | |
name=https://pbs.twimg.com/media/CSqxueMWUAEuHbK.png| | |
caption=SCP-XXXX in operation |
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 Data.Array | |
import Data.Char | |
outputs text = | |
let arr = accumArray (+) 0 (0, 255) $ map (\c -> (ord c, 1)) text | |
hits = filter (\(c, qty) -> (isAlpha $ chr c) && (qty > 0) ) $ assocs arr | |
in | |
map (\(c, qty) -> [chr c] ++ " (" ++ (show qty) ++")") hits | |
main = do |
OlderNewer