Skip to content

Instantly share code, notes, and snippets.

View maciejczyzewski's full-sized avatar

Maciej A. Czyzewski maciejczyzewski

View GitHub Profile
def f(l, o='{}'):
s=[[]]
def x(): s[-1].append([]); s.append(s[-1][-1])
def y(): return -1 if len(s) == 1 else s.pop()
for c in l:
try:
if { o[0]: x, o[1]: y }[c]() == -1: return False
except KeyError: s[-1].append(c)
return s[0] if len(s) == 1 else False
import numpy as np
import pandas as pd
df = pd.read_csv('wach2.csv') # case 1: wach.csv, case 2: wach2.csv
pd.set_option('display.width', 1000)
m1 = 149.8; m2 = 199.6
df.columns = ['m1', 'm2']
m1_avg = df['m1'].mean()
https://dl.dropboxusercontent.com/u/103345209/Computerwissenschaften.pdf
@maciejczyzewski
maciejczyzewski / __.md
Last active January 12, 2017 21:28
Appendix from https://eprint.iacr.org/2016/468 rewritten to C++
@maciejczyzewski
maciejczyzewski / heap.c
Last active December 10, 2017 17:00
Randomized meldable heap in C. (dynamic/pointer-based tree) https://en.wikipedia.org/wiki/Randomized_meldable_heap
#include <stdio.h>
#include <stdlib.h>
#define pf printf
#define nodeptr struct node_t*
struct node_t {
int val;
nodeptr rr;
nodeptr ll;
@maciejczyzewski
maciejczyzewski / list.c
Last active December 11, 2017 10:21
Doubly linked list in C. (dynamic/pointer-based tree) https://en.wikipedia.org/wiki/Doubly_linked_list
#include <stdio.h>
#include <stdlib.h>
#define pf printf
#define oo 0x7FFFFFFF
#define nodeptr struct node_t*
struct node_t {
int val;
nodeptr rr;
@maciejczyzewski
maciejczyzewski / classifier.py
Created December 28, 2019 10:22
[python] Gender Recognition by Voice (.wav) Using Harmonic Product Spectrum (frequency estimation method)
from os import environ
from sys import argv
from warnings import filterwarnings
from numpy.fft import rfft
from numpy.random import seed
from numpy import log1p, pi, polymul, mean, argmax
from scipy.signal import decimate, bilinear, lfilter, parzen
from soundfile import read as _read_audio
from copy import copy