Skip to content

Instantly share code, notes, and snippets.

View mkondratek's full-sized avatar

Mikołaj Kondratek mkondratek

View GitHub Profile
@mkondratek
mkondratek / BagOfWords.py
Created November 25, 2020 16:59
[lab06] Solution for BagOfWords exercise
from collections import defaultdict
from io import TextIOWrapper
class BagOfWords(object):
def __init__(self, input):
self.dict = defaultdict(int)
if not isinstance(input, defaultdict):
if isinstance(input, str):
@mkondratek
mkondratek / main.cpp
Last active December 10, 2019 19:11
Losowanie prezentów
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdlib.h>
int getRandom(int a, int b) {
return a + (rand() % (b - a));
}
bool isOk(std::vector<int> const& vec) {
#TODO place this file on gist
[1,openssl] openssl aes-256-cbc -salt -in secrets.txt -out secrets.txt.enc
[1,openssl] openssl aes-256-cbc -d -in secrets.txt.enc -out secrets.txt.new
[2,openssl] openssl dgst -sha256 -sign srvexam.key -out secret.txt.sha256 secret.txt
[2,openssl] openssl dgst -sha256 -verify <(openssl x509 -in srvexam.crt -pubkey -noout) -signature secret.txt.sha256 secret.txt
[x,openssl] openssl req -newkey rsa:4096 -nodes -keyout srvname.key -x509 -days 31 -out srvname.crt #gen key and crt
[x,openssl] openssl req -key srvname.key -new -x509 -days 31 -out srvname.crt #gen crt from key
@mkondratek
mkondratek / main.cpp
Last active June 10, 2018 10:07
zadanie_G_test
#include <iostream>
using namespace std;
#include "BST.h"
template <typename T>
void _assert(int line, T const& expected, T const& actual) {
if (expected != actual) {
std::cerr << "assert failed in line " << line
@mkondratek
mkondratek / main.cpp
Last active June 5, 2018 09:45
zadanie_F_test
#include <iostream>
#include <cstdarg>
#include <string>
#include <sstream>
#include <stdio.h>
using namespace std;
#include "POLYNOMIAL.cpp"
int POLYNOMIAL::overloaded = 0;