This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdarg> | |
#include <string> | |
#include <sstream> | |
#include <stdio.h> | |
using namespace std; | |
#include "POLYNOMIAL.cpp" | |
int POLYNOMIAL::overloaded = 0; |