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
import cv2 | |
from sklearn.cluster import KMeans | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import random | |
import argparse | |
# big thanks to this answer for the sketch | |
# https://stackoverflow.com/a/63647647/1176872 |
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
// This code demonstrates a simplified "stackification" algorithm to turn | |
// instructions in a basic block back into a tree. This is useful when | |
// generating WebAssembly code from assembly instructions in SSA form. | |
// | |
// It's the algorithm used by LLVM's WebAssembly backend, viewable here: | |
// https://github.com/llvm-mirror/llvm/blob/master/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp | |
type InsKind = | |
'Add' | | |
'LocalSet' | |
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
// Sample for reading a file asynchronously using libuv | |
// taken from https://www.snip2code.com/Snippet/247423/Sample-for-reading-a-file-asynchronously | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <uv.h> | |
static uv_fs_t openReq; | |
static uv_fs_t readReq; |