Skip to content

Instantly share code, notes, and snippets.

View kupp1's full-sized avatar
🎓
ITMO

Dmitrii Kupershtein kupp1

🎓
ITMO
View GitHub Profile
@kupp1
kupp1 / s_eq.py
Last active June 10, 2019 19:58
Python hls histogram equalization
import sys
from PIL import Image
import numpy as np
import colorsys as cs
im = Image.open(sys.argv[1]).convert('RGB')
rgb_array = np.array(im)
shape = rgb_array.shape
#include <stdio.h>
#include <inttypes.h>
#define N 100000
uint_fast16_t f()
{
static uint_fast16_t last = 0, indxs[N] = {0}, i = 0;
i++;
uint_fast16_t tmp = last;
Aachener Printen
Abernethy
Acıbadem kurabiyesi
Afghan biscuits
Alfajor
Almond biscuit
Amaretti di Saronno
Animal cracker
ANZAC biscuit
Aparon
@kupp1
kupp1 / vgnr.py
Created July 5, 2019 17:24
Vigenere cipher
def vigenere(msg, key, crypt_flag=True):
"""
vigenere cipher for small latin letters
crypt_flag == True mean crypt
crypt_flag == False mean decrypt
"""
msg, key = list(map(ord, msg)), list(map(ord, key))
msglen, keylen = len(msg), len(key)
new_msg = ''
for i in range(msglen):
@kupp1
kupp1 / Makefile
Created July 10, 2019 12:31
Makefile for Love2d projects (make dist for windows and linux)
game=test
love_win=./.love_win
love_linux=./.love_linux
$(game): clean dirs love linux windows
.PHONY: clean dirs
clean:
-rm -r build
dirs:
@kupp1
kupp1 / solve.c
Created July 29, 2019 10:00
Capacity & multiplicity
#include <stdio.h>
#include <inttypes.h>
int main(int argc, char *argv[])
{
uint_fast16_t N, count = 0;
scanf("%" SCNuFAST16, &N);
uint_fast16_t cur_cap = 1, following = 10;
/* cur_cap - текущая разрядность числа
following - первое число большей разрядности */
@kupp1
kupp1 / main.py
Created September 23, 2019 13:23
calculate expected value & standard deviation of sequence of numbers
import math
values = {}
N = 0
while True:
inpt = input()
if inpt == 'stop':
break
N += 1
inpt = float(inpt)