Skip to content

Instantly share code, notes, and snippets.

View pauldreik's full-sized avatar

Paul Dreik pauldreik

View GitHub Profile
@pauldreik
pauldreik / parse_ossfuzz_coverage.py
Last active July 4, 2021 20:39
Converts ossfuzz html coverage page into markdown
#!/usr/bin/python3
#
# reads a coverage report from oss-fuzz and outputs a markdown formatted
# table, sorted on uncovered lines.
#
# By Paul Dreik 20201117
import requests
from bs4 import BeautifulSoup # apt install python3-bs4
import sys
@pauldreik
pauldreik / main.cpp
Created December 29, 2019 16:21
use of the fisher yates
int
main()
{
std::random_device r;
std::minstd_rand rnd(r());
std::cout << "Let's randomly print 0 through 4:\n";
lazy_fisher_yates(5, rnd, [](auto i) { std::cout << i << '\n'; });
@pauldreik
pauldreik / fisher_yates_stepping.h
Created December 29, 2019 16:18
fisher yates stepping
/*
*
* Lazy Fisher-Yates iteration
*
* This steps through a range randomly, using the idea from the Fisher Yates
* shuffle. It does not shuffle the range and then iterate, instead it
* stores a sparse representation of the index range.
*
* The amount of memory reguired increases the closer to the middle one is.
* Experimentally, it seems like the expected amount of memory at step i