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 NoImplicitPrelude #-} | |
module TreeAlgorithms where | |
import ClassyPrelude | |
main :: IO () | |
main = do | |
let tree = binTree 5 -- create binary tree with depth 5 | |
print (dfs tree 1) -- list nodes with depth first search |
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 NoImplicitPrelude #-} | |
-- | N-Queens Problem: Place n queens on a chess board so that neither of them is threatened | |
-- This program will find a solution using a genetic algorithm | |
module GeneticAlgorithms where | |
import ClassyPrelude | |
import Data.Vector.Unboxed (ifoldl',update) | |
import System.Random |
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
# Backup frontend for borg | |
# | |
# Usage: ./backup.sh <repository> [--backup|--restore <path>|--unmount <path>] | |
# | |
# Dependencies: borg, fuse | |
################################################################################ | |
# # | |
# Backup Configuration # |
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
/** | |
* This is an infinite prime sequence that's memoized in a linked list. | |
* | |
* Why? ... because I wanted to see what Kotlin is like. And who doesn't like prime numbers. | |
*/ | |
import kotlin.system.measureTimeMillis | |
object Primes : Sequence<Long> { |