Skip to content

Instantly share code, notes, and snippets.

@delfigamer
delfigamer / 1) wm_char.cpp
Created December 3, 2023 23:30
Examples of using WM_CHAR for text input in a Win32 application, a simple and a partially IME-aware version
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <Windows.h>
#include <cstdio>
#include <utility>
#include <string>
#include <vector>
@delfigamer
delfigamer / 1-plot.md
Last active December 12, 2023 00:39
Proof-of-concept of an array-of-arrays implementations of an ordered multi-set

ListLogLogPlot[
 {{{2^16, 0.017},
   {2^17, 0.039},
   {2^18, 0.091},
   {2^19, 0.236},
   {2^20, 0.631},
   {2^21, 1.745},
 {2^22, 5.034},
@delfigamer
delfigamer / stable_map.cpp
Created December 15, 2023 01:34
An implementation of an insertion-ordered stable hash map
// Toggle the `if constexpr` at line 382 to switch between stable_map and std::unordered_multimap
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <functional>
#include <memory>
#include <unordered_map>