Based on an idea by Andread Arnold-Bos. Instead of having two files the template instantiations are done within the same file as the template.
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
/*-----------------------------------------------------------. | |
/ ColorBlind correction / | |
'-----------------------------------------------------------*/ | |
// Daltonize (source http://www.daltonize.org/search/label/Daltonize) | |
// Modified to simulate color blindness. | |
float4 Daltonize( float4 input, float2 tex ) | |
{ | |
// RGB to LMS matrix conversion | |
float3 L = (17.8824f * input.r) + (43.5161f * input.g) + (4.11935f * input.b); | |
float3 M = (3.45565f * input.r) + (27.1554f * input.g) + (3.86714f * input.b); |
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
// Example | |
State { | |
x | |
cond | |
} | |
local a = state.x + 1 | |
text a |
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
// Does not reject invalid data. define NO_OVERFLOW to avoid values | |
// larger than 15, but it will still accept invalid characters. | |
// MSN(x) = Most-significant nibble | |
// LSN(x) = Least-significant nibble | |
// SHL(x, y) = Shift left | |
// SHR(x, y) = Shift right | |
// MSN(Digits) = 0011 | |
// MSN(Upper) = 0100 |
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
/// <summary> | |
/// Represents a way to manage random events that should | |
/// occur a certain percentage of the time. | |
/// </summary> | |
/// <remarks> | |
/// This generator will correct unfair samples; for example, if it is set up | |
/// with a 50% chance to proc and 5 nonprocs are sampled; there is a good | |
/// chance that the next 5 samples will proc. | |
/// </remarks> | |
public class ProcNumberGenerator |
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
#pragma once | |
#include <atomic> | |
// A lock-free stack. | |
// Push = single producer | |
// Pop = single consumer (same thread as push) | |
// Steal = multiple consumer | |
// All methods, including Push, may fail. Re-issue the request | |
// if that occurs (spinwait). |
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
#!/usr/bin/env bash | |
set -e | |
STEAM_DIR=$HOME/.steam/steam/steamapps | |
if [ ! -e "$STEAM_DIR" ]; then | |
# Possibly flatpak | |
STEAM_DIR=/var/home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps | |
fi |
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
uniform extern texture Texture : TXSOURCE; | |
uniform extern texture ShadowMapTexture : TXSHADOWMAP; | |
uniform extern float2 RenderTargetSize : SZRT; | |
sampler inputSampler = sampler_state | |
{ | |
Texture = <Texture>; | |
MipFilter = Point; | |
MinFilter = Linear; | |
MagFilter = Linear; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Patterns | |
{ | |
/// <summary> | |
/// Represents an array dimension. | |
/// </summary> |
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
const fetchMachine = Machine({ | |
initial: "dragging", | |
context: {}, | |
entry: "log", | |
states: { | |
dragging: { | |
on: { | |
pointerup: "drop", | |
pointermove: { |
NewerOlder