Skip to content

Instantly share code, notes, and snippets.

use "lib:SDL2"
use "lib:SDL2main"
use "time"
use "debug"
use @SDL_Init[I32](flags: U32)
use @SDL_CreateWindow[Pointer[_SDLWindow val] ref](title: Pointer[U8] tag, x: I32, y: I32, w: I32, h: I32, flags: U32)
use @SDL_CreateRenderer[Pointer[_SDLRenderer val] ref](window: Pointer[_SDLWindow val] box, index: I32, flags: U32)
use @SDL_DestroyRenderer[None](renderer: Pointer[_SDLRenderer val] box)
use @SDL_DestroyWindow[None](window: Pointer[_SDLWindow val] box)
use "itertools"
use "promises"
use "collections"
use "debug"
class val ComputationResult
let input : USize
let output : USize
new create(input' : USize, output' : USize) =>
use "files"
use "collections"
use "format"
primitive NoOp
fun noop() =>
let a = "noop"
primitive FileReader
fun read_file_lines(path : String, env : Env) : List[String]? =>
use "collections"
primitive ErrorHelper
fun orNone[A](getter : {(): A?}): (A | None) =>
try
getter()?
else
None
end
@codec-abc
codec-abc / Main.cs
Created August 24, 2017 13:21
Test Lib Camera Rust
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApp3
{
class Program
{
const string dllPath = @"C:\DEV\Escapi\escapi\target\debug\escapi_rust.dll";
@codec-abc
codec-abc / floatBitOperations.fs
Last active August 12, 2017 14:52
4 bits floating point number manipulation
//F# Compiler for F# 4.0 (Open Source Edition), Mono 4.2.1
open System
let u : byte = (byte) 0b11110000
let highMask : byte = (byte) 0b11110000
let lowMask : byte = (byte) 0b00001111
let uHigh : byte = u &&& highMask
let nv21ToPPM() =
let clampBetween0And255 v =
if v < 0.0 then
0.0
else if v >= 255.0 then
255.0
else
v
let width = 1280
https://jsfiddle.net/undwk7g2/
#r "../fsharp-formatting/RazorEngine.dll"
#r "../fsharp-formatting/FSharp.MetadataFormat.dll"
#r "../fsharp-formatting/FSharp.CodeFormat.dll"
#r "../fsharp-formatting/FSharp.Formatting.Common.dll"
#load "../fsharp-formatting/FSharp.Formatting.fsx"
open FSharp.MetadataFormat
open System.IO
https://ellie-app.com/v3HGgh8cyra1/0