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
| #!/bin/bash | |
| cd $1 | |
| convertdir=`pwd` | |
| cd "$convertdir" | |
| mkdir results |
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 math import cos, sin, pi | |
| def rotate(pos, theta): | |
| x,y = pos | |
| c = cos(theta) | |
| s = sin(theta) | |
| return (x*c + y*s, x*s - y*c) | |
| # example |
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 BinaryLogic where | |
| type PVar = Int | |
| data Boolean = T | F deriving Show | |
| data Logic a = Boole Boolean | Var PVar | Conn a (Logic a) (Logic a) deriving Show | |
| type Assignment = (PVar -> Boolean) | |
| foldLogic :: Connective b => (Boolean -> a) -> (PVar -> a) -> (b -> a -> a -> a) -> (Logic b) -> a |
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
| subFormulas :: PL -> [PL] | |
| subFormulas = foldLogic | |
| ((:[]) . Boole) | |
| ((:[]) . Var) | |
| (\p -> Not (head p) : p) | |
| (\c p q -> Conn c (head p) (head q) : (p ++ q)) |
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 Prelude hiding (print, negate) | |
| import Data.List (nub) | |
| data PVar = X Int deriving (Eq,Ord) | |
| x = Var . X | |
| data Connective = And | Or | Imp | Bi | |
| data Boolean = T | F deriving Eq | |
| data PL = Boole Boolean | Var PVar | Not PL | Conn Connective PL PL | |
| type Substitution = (PVar -> PL) |
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 exp; | |
| IMPORT Out; | |
| PROCEDURE exponent*(x,n: INTEGER):INTEGER; | |
| VAR | |
| y,z,k: INTEGER; | |
| BEGIN | |
| y := 1; |
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
| nub :: Eq a => [a] -> [a] | |
| nub = foldr (\x ys->if x `elem` ys then ys else (x:ys)) [] |
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
| type Perm = [Int] | |
| data Parity = Odd | Even deriving Show | |
| oddtest = [1,3,2,4,5] :: Perm | |
| eventest = [1,4,2,3,5] :: Perm | |
| genPairs :: Int -> [(Int, Int)] | |
| genPairs l = [(a,b) | a <- [1..l], b <- [1..l], a < b] | |
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
| <html> | |
| <head> | |
| <title>* Gwent Energy CIC *</title> | |
| <link href="gecss.css" rel="stylesheet" type="text/css"> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
| </head> | |
| <body> | |
| <div id="wrap"> | |
| <div id="header"> | |
| <img class="logo" |
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
| html, body { | |
| background-color: #a0c060; | |
| padding: 0; | |
| } | |
| #wrap { | |
| width: 800px; | |
| margin: 0 auto; | |
| background-color: #80a020; | |
| border: 1px solid black; |