Skip to content

Instantly share code, notes, and snippets.

View fardinshikhiyev's full-sized avatar

Fardin Shikhiyev fardinshikhiyev

View GitHub Profile
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
a1 :: {Int}
a1 = { x \\ x <- f1 100}
where
f1 :: Int -> [Int]
f1 0 = [0]
f1 n = [n] ++ f1(n/2)
Start = a1
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
@fardinshikhiyev
fardinshikhiyev / .zshenv
Created August 22, 2016 22:13
sample .zshenv file with speed-up modification
#
# 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.
@fardinshikhiyev
fardinshikhiyev / uNoWatermark.py
Last active June 14, 2017 20:30
Removes the annoying watermarks of it-ebooks.info's downloaded eBooks
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