This file contains hidden or 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
class StreamingBufferObject | |
{ | |
public: | |
StreamingBufferObject() : vbohandle(0), cursor(0) {} | |
~StreamingBufferObject() | |
{ | |
if (vbohandle != 0) glDeleteBuffers(1, &vbohandle); | |
} | |
template<typename T> |
This file contains hidden or 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 <queue> | |
#include <mutex> | |
#include <condition_variable> | |
template<typename T> | |
class LockingQueue | |
{ | |
public: | |
void push(T const& _data) |
This file contains hidden or 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
open System | |
open System.Collections.Generic | |
let brainfuck raw = | |
let code = [for c in raw -> c] |> Array.ofList | |
let memory = Array.create 1024 0 | |
let createJumpTable = | |
let mutable stack = new Stack<char*int>() | |
let mutable jumpTable = new Map<int,int>([]) | |
for i = 0 to (code.Length-1) do |
This file contains hidden or 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
let START = [] | |
let STOP = [] | |
let _ = [] | |
let inline morse c left right = left @ c::[] @ right | |
let inline SPACE left right = morse ' ' left right | |
let inline (.-) left right = morse 'A' left right | |
let inline (-...) left right = morse 'B' left right | |
let inline (-.-.) left right = morse 'C' left right | |
let inline (-..) left right = morse 'D' left right |
This file contains hidden or 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
let split input = | |
let n = ((List.length input)/2) | |
let rec splitHelper cur cont = function | |
| head::tail when cur < n -> | |
splitHelper (cur+1) (fun acc -> | |
cont (head::acc)) tail | |
| rest -> cont [], rest | |
splitHelper 0 id input | |
let merge xs ys = |