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
from mpvclient as mpv import nil | |
proc mpv_check_error(status: cint) = | |
if status < 0: | |
echo "mpv API error: ", mpv.mpv_error_string(status) | |
quit(1) | |
proc main: int = | |
result = 1 |
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
include karax / prelude | |
import strutils | |
type | |
Model = object | |
counter*: int | |
Dispatch = proc(model: Model): void | |
proc init(): Model = | |
result = Model(counter: 0) |
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
//!HOOK MAINPRESUB | |
//!BIND HOOKED | |
//!DESC un360 | |
#define M_PI 3.1415926535897932384626433832795 | |
const float fov = M_PI/2; // [0 to M_PI] horizontal field of view, range is exclusive | |
const float yaw = M_PI*1; // [any float] polar angle, one full revolution is 2*M_PI | |
const float pitch = M_PI*0; // [any float] vertical tilt, positive is up | |
const float roll = M_PI*0; // [any float] view rotation, positive is clockwise |
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
var webrtc = require('webrtc-swarm') | |
var signalhub = require('signalhub') | |
var hyperdrive = require('hyperdrive') | |
var memdb = require('memdb') | |
var pump = require('pump') | |
var DEFAULT_SIGNALHUBS = 'https://signalhub.mafintosh.com' | |
var drive = hyperdrive(memdb()) |
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
type Cell[T] = ref object | |
car: T | |
cdr: Cell[T] | |
type List[T, N] = distinct Cell[T] | |
proc makeNil[T]: List[T, range[0..0]] = nil | |
proc makeCons[T, N](car: T; cdr: List[T, N]): auto = | |
type N1 = range[0..high(N)+1] |
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
def activate_virtualenv(name): | |
"""Activate given virtualenv. | |
Virtualenv home folder is given by environment variable ``WORKON_HOME`` or | |
``~/Envs`. | |
""" | |
if 'WORKON_HOME' in os.environ: | |
home = os.environ['WORKON_HOME'] | |
else: | |
home = os.path.expanduser(os.path.join('~', 'Envs')) |
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
(ns evolvefn) ;; Lee Spector (lspector@hampshire.edu) 20111018 | |
;; This code defines and runs a genetic programming system on the problem | |
;; of finding a function that fits a particular set of [x y] pairs. | |
;; The aim here is mostly to demonstrate how genetic programming can be | |
;; implemented in Clojure simply and clearly, and several things are | |
;; done in somewhat inefficient and/or non-standard ways. But this should | |
;; provide a reasonable starting point for developing more efficient/ | |
;; standard/capable systems. |
NewerOlder