Skip to content

Instantly share code, notes, and snippets.

View zelinskiy's full-sized avatar

Nikita M. Yurchenko zelinskiy

View GitHub Profile
<< front >>
13 12
4 5
1 8
16 9
back
11 14
6 3
7 2
10 15
package org.jmlspecs.samples.jmltutorial;
public class Person {
private /*@ spec_public non_null @*/ String name;
private /*@ spec_public @*/ int weight;
/*@ public invariant !name.equals("")
@ && weight >= 0; @*/
/*@ also
@zelinskiy
zelinskiy / LambdaPiToSKUP.hs
Created September 13, 2019 13:03
LambdaPiToSKUP.hs
{-# LANGUAGE DeriveFunctor #-}
-- https://stackoverflow.com/questions/11406786/what-is-the-combinatory-logic-equivalent-of-intuitionistic-type-theory
data SKUP = S | K | U | P deriving (Show, Eq)
data Unty a
= C SKUP
| Unty a :. Unty a
| V a
from cltk.corpus.utils.importer import CorpusImporter
from cltk.stem.lemma import LemmaReplacer
from cltk.tokenize.latin.sentence import SentenceTokenizer
from nltk.tokenize.punkt import PunktLanguageVars
from pystardict import Dictionary
from open_words.parse import Parse
import cltk.prosody.latin.string_utils as string_utils
from cltk.lemmatize.latin.backoff import BackoffLatinLemmatizer
from cltk.tag.pos import POSTag
import cv2
import numpy as np
from math import sin, cos, pi, sqrt
import random as rand
from time import time
def drawCuttedEllipse(frame, ellipse, cut_coeff, color):
(cx, cy), (a, b), angle = ellipse
if a > b:
#!/bin/bash
COUNTER=1
PAGES=1168
while [ $COUNTER -lt $PAGES ]; do
TO=$((COUNTER+100))
if [ $TO -gt $PAGES ]
then
let TO=$PAGES
fi
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains thelatinlibrary.com --no-parent http://thelatinlibrary.com/christian.html
ebook-convert index.html ../test.epub --max-levels 3
import cv2
import numpy as np
import itertools
import random as rnd
# TODO:
# swap so that img1 always over img2
def fix_overlap(res, img1, x1, y1, img2, x2, y2):
h1, w1, _ = img1.shape
encrypt :: Integer -> Integer -> String -> String
encrypt 0 0 msg =
let primes = take 90 $ filter isPrime [1..]
p1 = last primes
p2 = last $ init primes
tot = totient p1 p2
e = myE tot
n = p1 * p2
rsa_encoded = rsa_encode n e $ encode msg
encrypted = show rsa_encoded
@zelinskiy
zelinskiy / BoolExpr.elm
Last active June 26, 2019 16:05
Elm vs ANTLR javascript
module BoolExpr where
type BExpr
= BTrue
| BFalse
| BAnd BExpr BExpr
| BOr BExpr BExpr
-- Example of (1 /\ (0 \/ 1)) AST:
expr = BAnd BTrue (BOr BFalse BTrue)