Skip to content

Instantly share code, notes, and snippets.

@vmxdev
vmxdev / shent.c
Created June 6, 2015 10:37
calculate entropy of file
/*
Shannon entropy calculation
$ cc -Wall shent.c -o shent -lm
$ ./shent shent.c
*/
#include <stdio.h>
#include <stdint.h>
#include <math.h>
int
@vmxdev
vmxdev / wcg.cpp
Created May 26, 2015 18:46
wildcard function - search for longest common subsequence and make string with wildcards, e.g. wildcard("hello", "elo") returns "*e*lo"
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
string
wildcard(const string& a, const string& b)
{