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.Maybe (catMaybes) | |
import qualified Data.Set as Set | |
(|>) = flip ($) | |
between :: Ord a => a -> (a, a) -> Bool | |
between x (a, b) = a <= x && x <= b | |
class Clamp a where | |
clampedBy :: a -> (a, a) -> a |
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 Control.Monad (guard, when) | |
import Data.Array (Array, (!), (//), bounds, listArray) | |
import System.Console.ANSI | |
import System.IO (stdin, hReady) | |
import System.Random | |
import System.Timeout (timeout) | |
import Debug.Trace | |
data Pos | |
= Pos |
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
package com.company; | |
import java.util.Optional; | |
import java.util.function.Function; | |
class Validity { } | |
class Valid extends Validity { } |
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 ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} |
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 ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} | |
import Control.Arrow | |
import Control.Monad | |
import Data.Array | |
import Data.Function | |
import Data.List | |
import Data.Maybe | |
import System.Environment |
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 TupleSections #-} | |
import Control.Monad.State (State, evalState, get, gets, modify, put) | |
import Data.Function (on) | |
import Data.List (unionBy) | |
import Data.Map (Map) | |
import Data.Maybe (fromMaybe) | |
import qualified Data.Map as Map |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Fireworks</title> | |
</head> | |
<body> | |
<script> | |
const SCRW = 800; | |
const SCRH = 800; |
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
class Vec2(object): | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
def dot(v, w): | |
return v.x * w.x + v.y * w.y | |
class Mat22(object): | |
def __init__(self, a, b, c, d): |
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
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Ondulator</title> | |
<script> | |
const PI = Math.PI; | |
const TAU = 2 * PI; |
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.SBV | |
fruits :: SInteger -> SInteger -> SInteger -> SBool | |
fruits a b c = equation &&& positive | |
where | |
x = sFromIntegral a :: SReal | |
y = sFromIntegral b :: SReal | |
z = sFromIntegral c :: SReal | |
equation = x / (y + z) + y / (x + z) + z / (x + y) .== 4 |