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 re | |
import shutil | |
import argparse | |
from os import path | |
from sys import stderr | |
# | |
# Author: Daxda | |
# Date: 02.04.2014 | |
# WTF: This is a quick tool I've hacked together to easily remove the meta |
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
# | |
# Generic .zshenv file for zsh | |
# | |
# .zshenv is sourced on ALL invocations of the shell, unless the -f option is | |
# set. It should NOT normally contain commands to set the command search path, | |
# or other common environment variables unless you really know what you're | |
# doing. E.g. running "PATH=/custom/path gdb program" sources this file (when | |
# gdb runs the program via $SHELL), so you want to be sure not to override a | |
# custom environment in such cases. Note also that .zshenv should not contain | |
# commands that produce output or assume the shell is attached to a tty. |
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 ex51 | |
import StdEnv | |
// Exercises | |
// 1. Write a recursive function that computes the n-th multiple of an x. | |
// I am not sure if this means power or multiplication, I did for multiplication | |
f1 :: Int Int -> Int | |
f1 x 1 = x | |
f1 x 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
a1 :: {Int} | |
a1 = { x \\ x <- f1 100} | |
where | |
f1 :: Int -> [Int] | |
f1 0 = [0] | |
f1 n = [n] ++ f1(n/2) | |
Start = a1 |
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 hw7 | |
import StdEnv | |
occurences :: [Int] Int -> [[Int]] | |
occurences [] i = [] | |
occurences x i = [[hd x] ++ [count] ++ [freq] ] ++ occurences ( filter ( (<>) (hd x) ) (tl x) ) i | |
where | |
count = length( filter( (==) (hd x) ) x ) | |
freq = count * 100 / i |