Skip to content

Instantly share code, notes, and snippets.

View blt's full-sized avatar

Brian L. Troutwine blt

View GitHub Profile

Lunar Base Airlock Problem

Your goal is to design a control-system for a lunar base, this one:

Overview

In particular, we're going to focus on the airlock system, consisting of three doors A, B and C. Each internal segment AB and BC may be variably pressurized.

Airlock Detail

@blt
blt / lolspeed.erl
Last active December 31, 2015 04:29
-module(lolspeed).
-export([main/0]).
-define(LOLEND, 1000000).
%% > lolspeed:main().
%% = {10354,ok}
%% == {10991,ok}
%% =:= {8509,ok}
(setq tempo-interactive t)
(require 'tempo)
(tempo-define-template "erl-module"
'(
"-module()." n>
n>
"-ifdef(TEST)."n>
"-include_lib(\"eunit/include/eunit.hrl\")."n>
@blt
blt / Dockerfile
Created September 23, 2013 21:46
Dockerfile for troutwine/erlang: https://index.docker.io/u/troutwine/erlang/
FROM base
MAINTAINER Brian L. Troutwine "brian@troutwine.us"
RUN apt-get update
RUN apt-get install -y curl
RUN curl -O https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
RUN dpkg -i erlang-solutions_1.0_all.deb
RUN apt-get update
@blt
blt / results.md
Created September 20, 2013 07:33

I modified the appropriate section of v1to2.sh to look like:

echo "UPGRADING NODE TO 0.1.1"
./bin/beat-0.1.0 upgrade "0.1.1/beat"

echo "DOWNGRADE NODE TO 0.1.0"
./bin/beat-0.1.0 upgrade "0.1.0/beat"
FROM ubuntu
MAINTAINER Brian L. Troutwine "brian@troutwine.us"
RUN apt-get update
RUN apt-get install -y curl
RUN curl https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb --remote-name
RUN dpkg -i erlang-solutions_1.0_all.deb
RUN apt-get update

I run v1to2.sh, included in this gist, to get everything in place in /tmp/beat

> sh v1to2.sh 
Switched to branch 'v1'
==> beat_core (clean)
==> beat_tcp_api (clean)
==> beat (clean)
... 99 skip a few ...
a ./erts-5.9.3/bin/typer
> erl
Erlang R15B03 (erts-5.9.3) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.3 (abort with ^G)
1> Foo = <<"foo">>.
<<"foo">>
2> ets:new(list_to_atom(binary_to_list(Foo)), [set, named_table]).
foo
3> ets:i().
id name type size mem owner
@blt
blt / sfml.rb
Last active December 17, 2015 11:59 — forked from juniorz/sfml.rb
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Sfml < Formula
homepage 'http://www.sfml-dev.org'
version '2.0'
url 'http://www.sfml-dev.org/download/sfml/2.0/SFML-2.0-sources.zip'
(walden) ~/projects/com/github/mindreframer/riemann-vagrant
blt> vagrant destroy
Are you sure you want to destroy the 'default' VM? [Y/N] Y
[default] Destroying VM and associated drives...
(walden) ~/projects/com/github/mindreframer/riemann-vagrant
blt> vagrant status
Current VM states:
default not created