Skip to content

Instantly share code, notes, and snippets.

View mwyborski's full-sized avatar

Marek Wyborski mwyborski

View GitHub Profile
@mwyborski
mwyborski / benford_distribution.py
Last active January 23, 2023 16:44
Example for benford distribution
import numpy as np
max_rnd_value = 100000
num_samples = 100000
# do benford or uniform distribution
do_benford = True
if do_benford:
num_factors = int(np.floor(np.log10(max_rnd_value)))
@TakaoNarikawa
TakaoNarikawa / convert.py
Created April 24, 2020 21:27
Convert darknet pre-trained model to CoreML model
#! /usr/bin/env python
"""
Reads Darknet config and weights and creates Keras model with TF backend.
"""
import argparse
import configparser
import io
import os
@tomtor
tomtor / ESP32-ULP-Blink-DHT22.ino
Last active August 19, 2020 08:53
ESP32: ULP LED Hart beat and read DHT22 sensor
@ngryman
ngryman / usleep.c
Created September 8, 2013 07:07
usleep for Windows.
void usleep(DWORD waitTime){
LARGE_INTEGER perfCnt, start, now;
QueryPerformanceFrequency(&perfCnt);
QueryPerformanceCounter(&start);
do {
QueryPerformanceCounter((LARGE_INTEGER*) &now);
} while ((now.QuadPart - start.QuadPart) / float(perfCnt.QuadPart) * 1000 * 1000 < waitTime);
}