Skip to content

Instantly share code, notes, and snippets.

View cdyk's full-sized avatar

Christopher Dyken cdyk

View GitHub Profile
@cdyk
cdyk / bytesinwasm.md
Last active February 12, 2021 06:53
Who to blame for the bytes in the WASM?

Who to blame for the bytes in the WASM?

Christopher Dyken

Recently, I've worked with Emscripten, producing web-assembly from C++. As a result, I've become curious of how much the wasm-binary grows by including this or that code. Even though caring about code size seems to be out of fashion since we stopped using floppy disks to move programs around, it does matter somewhat on the web, as every client has to download the binary, maybe over a cellular connection etc.

@cdyk
cdyk / lsb_radix_sort.py
Created March 7, 2020 20:26
Radix sort starting with least significant bit
from itertools import chain
def radixSortLsb(a):
for b in range(0,10):
a = list(chain(filter(lambda x: ((x>>b)&1) == 0, a),
filter(lambda x: ((x>>b)&1) != 0, a)))
return a
ai =[503, 87, 512, 61, 908, 170, 897, 275, 653, 426, 154, 509, 612, 677, 765, 703]
radixSortLsb(ai)
@cdyk
cdyk / ducttape_onnx.md
Created May 31, 2020 19:33
Duct-taping onnx-models into a composite onnx-model

Duct-taping onnx-models into a composite onnx-model

Christopher Dyken

Recently, I have played around a bit with onnx-models. One thing I wanted to do was to piece together multiple small models into one large model. I didn´t find any utility to do this (though it might be the issue that I didn´t look hard enough), so I decided to figure out how hard it was to do by hand. This little post details that little adventure. _Please be warned that I am definitely no expert on onnx-models, so don´t take anything I write here as