Skip to content

Instantly share code, notes, and snippets.

View bryanedds's full-sized avatar

Bryan Edds bryanedds

View GitHub Profile
@bryanedds
bryanedds / gist:3f7d60169a8316835bfa
Created November 6, 2014 16:05
And yet somehow I'm confident that this will actually run properly the first time...
let product address (observable : 'a Observable) : ('a * 'b) Observable =
let subscribe = fun world ->
let subscriptionKey = World.makeSubscriptionKey ()
let subscriptionKey' = World.makeSubscriptionKey ()
let subscriptionAddress = !+ [acstring subscriptionKey]
let subscriptionAddress' = !+ [acstring subscriptionKey']
let (address', unsubscribe, world) = observable.Subscribe world
let unsubscribe = fun world ->
let world = unsubscribe world
let world = World.unsubscribe subscriptionKey world
namespace Prime
open System
[<AutoOpen>]
module RandModule =
/// Implements an immutable random number generator using the xorshift* algorithm.
/// NOTE: this is POORLY tested - would not recommend using until tested properly!
type [<StructuralEquality; NoComparison>] Rand =
{ Current : uint64 }
@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.
// 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 / 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 / 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 / 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 / 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 / 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 / Tmap.fs
Last active June 23, 2016 04:07
Transactional map prototype. I consider this one in a class of 'convergence-biased persistent data structures', that is, a persistent data structure biased to perform well only when divergence of it timelines is minimal.
// Prime - A PRIMitivEs code library.
// Copyright (C) Bryan Edds, 2012-2016.
namespace Prime
open System
open System.Collections.Generic
[<AutoOpen>]
module TexprModule =