Skip to content

Instantly share code, notes, and snippets.

View bryanedds's full-sized avatar

Bryan Edds bryanedds

View GitHub Profile
@bryanedds
bryanedds / Vsrl.fs
Last active June 8, 2016 23:03
Visually-Scripted Reactive Language (VSRL) - Prototype
// Nu Game Engine.
// Copyright (C) Bryan Edds, 2012-2016.
namespace Nu
open System
open System.Collections.Generic
open System.Runtime.InteropServices
open OpenTK
open Prime
@bryanedds
bryanedds / Errors.txt
Created February 13, 2016 01:10
peverify errors in debug build of Prime.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0>peverify C:\Development\NuGa
meEngine\Prime\Prime\Prime\bin\Debug\Prime.exe
Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.
[IL]: Error: [C:\Development\NuGameEngine\Prime\Prime\Prime\bin\Debug\Prime.exe
: Prime.Observation::observe[a,o,w]][offset 0x00000003] Unable to resolve token.
[HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect
@bryanedds
bryanedds / container.hpp
Last active January 22, 2016 07:33
C++ map, filter, fold
#ifndef xtd_container_hpp
#define xtd_container_hpp
#include <cstddef>
#include <initializer_list>
#include <vector>
#include "prelude.hpp"
template<typename Cr, typename Fn>
@bryanedds
bryanedds / general_rules.txt
Created January 5, 2016 23:42
Rule's for Bryan's various chat rooms and stuff.
Rule 1: No unprovoked abuse, where abuse is defined as statements intended to belittle someone personally.
As clarification, unintentional belittling is tolerated, since we don't all want to walk on egg-shells. For example, we do not care about'microaggressions' or 'exclusive speech' or whatever.
Rule 2: If someone if trying to get specific on-topic help, please avoid drowning out the conversation with off-topic stuff.
Otherwise, off-topic stuff is fine.
@bryanedds
bryanedds / rules.md
Last active January 27, 2016 10:31
Bryan Edds's Moderation Rules

Rule 1: No unprovoked abuse, where abuse is defined as statements intended to belittle someone personally.

As clarification, unintentional belittling is tolerated, since we don't all want to walk on egg-shells. For example, we do not care about 'microaggressions' or 'exclusive speech' or whatever.

Rule 2: If someone is trying to get specific on-topic help, please avoid drowning out the conversation with off-topic stuff.

Otherwise, off-topic stuff is fine.

Rule 3: (Owners only): Owners please monitor Lounge for unwanted questions, then redirect (or bin) them here.

@bryanedds
bryanedds / Injection.cpp
Last active April 19, 2023 11:52
Abstract Data Types and Dependency Injection in C++
#include "functional"
#include "iostream"
#include "string"
namespace proj
{
/// For background on the discussed subject matter, first see this gist article on Abstract Data
/// Types and Alternative Forms of Polymorphism in C++ - https://gist.github.com/bryanedds/6a8ea281bb4a3d8b559e
/// Dependency injection in C++ is easy, if you do it carefully. The quickest way to do it
@bryanedds
bryanedds / Alternative.cpp
Last active August 10, 2020 01:56
Abstract Data Types and Alternative Forms of Polymorphism in C++
#include "functional"
#include "iostream"
namespace proj
{
/// Polymorphism in C++ is typically implemented with dynamic dispatch. On the plus side, it's
/// easy to grasp (initially), well-understood, and works retroactively. On the minus side, it
/// sucks you into OOP quagmires too easily and is not terribly efficient. Knowing about other
/// types of polymorphims may lead you to avoid this approach wherever practical. Places where
/// it's practically unavoidable are those that require user-defined subtypes, such as plugins
// Nu Game Engine.
// Copyright (C) Bryan Edds, 2013-2015.
namespace Nu
open System
open System.IO
open System.Xml
open OpenTK
open Prime
open Nu
@bryanedds
bryanedds / gist:b07244c4215ebf38b5dd
Last active September 6, 2015 23:49
Fuck... 118 TODOs...
Find all "TODO", Match case, Whole word, Subfolders, Find Results 1, Entire Solution, ""
C:\FPWorks\Nu\Nu\Nu\RQueue.fs(12): /// TODO: replace all usage with Queue from FSharpx.Collections.
C:\FPWorks\Nu\Nu\Nu\Address.fs(15):/// TODO: implement custom comparison.
C:\FPWorks\Nu\Nu\Nu\Math.fs(12):/// TODO: for consistency with other math constructs, consider making this a struct.
C:\FPWorks\Nu\Nu\Nu\Math.fs(118): /// TODO: See if we can expose an SDL_RenderCopyEx from SDL2(#) that takes floats instead.
C:\FPWorks\Nu\Nu\Nu\Overlay.fs(116): // TODO: see if this can be decomposed
C:\FPWorks\Nu\Nu\Nu\Assets.fs(28):/// TODO: consider if we could / should use a TypeCarrier (phantom type) here.
C:\FPWorks\Nu\Nu\Nu\Assets.fs(200): /// TODO: test this function!
C:\FPWorks\Nu\Nu\Nu\Assets.fs(241): /// TODO: test this function!
C:\FPWorks\Nu\Nu\Nu\Physics.fs(538): /// TODO: see if AlgebraicConverter can be used here instead of this shitty custom syntax.
@bryanedds
bryanedds / Vsync.fs
Last active October 25, 2022 19:49
Vsync rewritten as a monad.
namespace Marvel
open System
open System.Diagnostics
open System.Threading
open System.Threading.Tasks
open Marvel
/// The 'Vsync' (AKA, 'Variable Synchrony') monad.
/// Runs code synchronously when the 'Venom/System/Sync' Consul variable is 'True', in parallel otherwise.
/// NOTE: to reference how all this stuff works in F#, see here - https://msdn.microsoft.com/en-us/library/dd233182.aspx