Skip to content

Instantly share code, notes, and snippets.

#include <Windows.h>
#include <atlbase.h>
#include <mmdeviceapi.h>
#include <audiopolicy.h>
#define AUDCLNT_S_NO_SINGLE_PROCESS AUDCLNT_SUCCESS (0x00d)
#include "include/print.h"
@jedwardsol
jedwardsol / print.h
Created February 10, 2022 18:13
print
#pragma once
#include <iostream>
#include <string_view>
#include <format>
#include <utility>
// 1 : intermediate string
template <typename ...ARGS>
void print(std::string_view format, ARGS &&...args)
@jedwardsol
jedwardsol / w2e.cpp
Last active November 17, 2021 16:09
Word to elements
#include <iostream>
#include <format>
#include <vector>
#include <sstream>
#include <string_view>
#include <set>
#include <map>
extern std::map<std::string_view,std::string_view> elementNames;
@jedwardsol
jedwardsol / Simd
Created November 3, 2021 03:43
Simd
xmm 128-bit 4 floats
ymm 256-bit 8 floats
zmm 512-bit 16 floats
float data[4096]; { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p} 256 times
sum of all values
#include <Windows.h>
#include <iostream>
#include <thread>
struct pipe
{
pipe()
{
SECURITY_ATTRIBUTES sa = { sizeof(sa), nullptr,true};
CreatePipe(&read, &write, &sa, 0);
#include <windows.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <limits>
std::ostream &operator<<(std::ostream &out,const MEMORY_BASIC_INFORMATION &region)
{
std::ostringstream string;
@jedwardsol
jedwardsol / optional.cpp
Last active November 29, 2018 20:54
Optional heuristic
struct Edge;
struct Vertex;
void enqueue(Edge *, double);
double someHeuristic(Vertex*, Vertex *);
// -----------------