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
#!/bin/bash | |
inventarnummer="$1" | |
beschreibung="$2" | |
if [ -z "$inventarnummer" ] | |
then | |
read -p "Inventarnummer: " inventarnummer | |
fi |
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
from __future__ import annotations | |
from typing import * | |
@no_type_check | |
def forward(f): | |
resolved = None | |
def c(*args, **kwargs): | |
if not resolved: | |
resolved = f() | |
return resolved(*args, **kwargs) |
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 STL | |
where | |
import qualified Data.List as L | |
data K3 f = K3 f f f | |
deriving (Show, Eq) | |
data Void |
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/python3 | |
import sys | |
zk_code = sys.argv[-1].rjust(20, "0") | |
print("ZK Code: {}".format(zk_code)) | |
result = "" | |
# Iterate though bytes | |
for i in range(0, 20, 4): | |
nibble1 = bin(int(zk_code[i:i+2]))[2:].rjust(4, "0") |
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
newtype Vector2 a = Vector2 (a, a) | |
instance Eq a => Eq (Vector2 a) where | |
Vector2 x == Vector2 y = x == y | |
instance Functor Vector2 where | |
fmap f (Vector2 (a, b)) = Vector2 (f a, f b) | |
instance Applicative Vector2 where | |
pure x = Vector2 (x, x) |
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.Foldable (fold) | |
import Data.Monoid (Endo(Endo, appEndo)) | |
-- | @replicateEndo n f@ replicates n times an endomorphism f and folds them using | |
-- function composition to an endomorphism @a -> a@. | |
-- | |
-- Propositions: | |
-- > replicateEndo _ id == id | |
-- > replicateEndo _ (const x) == const x | |
-- > replicateEndo 0 _ == id |
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
* Pascal | |
* PHP | |
* Algol 60 | |
* Fortran | |
* Alles andere von Niklaus Wirth | |
* WEB | |
* CWEB | |
* C++ | |
* C# | |
* F# |
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
# License: CC0 | |
class Digraph(object): | |
""" Digraph is a simple and more or less efficient implementation of a | |
directed graph. It aims to provide all necessary methods for digraphs and to | |
be simple to understand. Therefore, Digraph isn't efficient in any way. When | |
you are looking for an efficient digraph implementation, look at FastDigraph. | |
""" | |
def __init__(self, data=None): | |
self.arcs = set() |
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.Applicative | |
import Control.Monad | |
import Data.Monoid | |
data List a = Nil | (:::) a (List a) deriving (Show, Read) | |
infixr 5 ::: | |
instance Functor List where | |
fmap f (x ::: xs) = (f x) ::: (fmap f xs) | |
fmap _ Nil = Nil |
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
var ( | |
// Zustand des endlichen Automatens | |
state int | |
// Ergebnis™ | |
resistorsPerContainer = 0 | |
containerCount = 0 | |
) | |
for _, arg := range os.Args { |
NewerOlder