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
#include <SFML/Graphics.hpp> | |
#include <cmath> | |
class prog | |
{ | |
public: | |
prog(); | |
prog(const float&, const float&, const sf::String&); | |
void open(const float&, const float&, const sf::String&); |
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
#!/usr/bin/env python3 | |
import random, itertools | |
from sys import argv | |
def main(): | |
num_color_hue, num_brightness, min_color, max_color = 12, 6, 16, 76 | |
color_hue, brightness = random.randint(0, num_color_hue - 1), random.randint(0, num_brightness - 1) | |
direction1, direction2 = random.choice([ -1, 1 ]), random.choice([-1, 1]) | |
color = next(itertools.islice(range(min_color + color_hue, max_color + 1 + color_hue, num_color_hue), |
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
#include <SFML/Graphics.hpp> | |
#include <cmath> | |
#include <utility> | |
#include <vector> | |
#include <functional> | |
class prog | |
{ | |
public: |
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
#!/usr/bin/env python3 | |
import sys, requests | |
from bs4 import BeautifulSoup | |
from random import choice | |
def main(argv): | |
if len(argv) < 2: | |
sys.exit("Invalid argument(s)\nSyntax: [optional: -n [n definition/examples]] [search term]") | |
if len(argv) > 3: |
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
f :: Num a => [a] -> [a] | |
f [] = [] | |
f [x] = [] | |
f [x1,x2] = [x2-x1] | |
f (x1:x2:xs) = x2-x1:f (x2:xs) |
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
average :: Fractional a => [a] -> a | |
average xs = sum xs / fromIntegral (length xs) | |
range :: (Num a, Ord a) => [a] -> a | |
range xs = maximum xs - minimum xs | |
meanNormalize :: (Fractional a, Ord a) => [a] -> a -> a | |
meanNormalize xs = (/ range xs) . subtract (average xs) | |
-- GHCI |
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
module Main where | |
import Data.List (genericTake) | |
{- | |
let p(i) be the i(th) prime number starting from 2 | |
[p1,p2,p3,p4,p5...] | |
[(p2-p1),(p3-p2),(p4-p3),(p5-p4)...] | |
[{(p3-p2)-(p2-p1)},{(p4-p3)-(p3-p2)},{(p5-p4)-(p4-p3)}...] | |
... etc. applied n times |
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
#include <iostream> | |
#include <utility> | |
#include <string> | |
#include <algorithm> | |
#include <cctype> | |
#include <map> | |
#include <random> | |
#include <chrono> | |
#include <stdexcept> |
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 FlexibleInstances #-} | |
{-# LANGUAGE OverlappingInstances #-} | |
module Main where | |
import Data.Map (fromListWith, toList) | |
main :: IO () | |
main = do | |
let log = "date time Zerock henlo\n\ |
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 OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import qualified Data.Text as T | |
import qualified Data.Text.IO as T | |
import qualified Data.List as L (intersperse) | |
import Data.List (maximumBy) | |
import Data.Ord (comparing) |
OlderNewer