Skip to content

Instantly share code, notes, and snippets.

@mokele
mokele / capnp.erl
Last active January 27, 2016 12:06
% struct FooBar {
% union {
% foo @0 :Foo
% bar @1 :Bar
% }
% }
% struct Foo {
% foo @0 :Text
% }
% struct Bar {
OfferOperation =
#'Offer.Operation'{
type = mesos_pb:enum_symbol_by_value('Offer.Operation.Type', 4), % CREATE
create =
#'Offer.Operation.Create'{
volumes = [
#'Resource'{
name = "disk",
type = ScalarType,
scalar = #'Value.Scalar'{value = 100},

Keybase proof

I hereby claim:

  • I am mokele on github.
  • I am mokele (https://keybase.io/mokele) on keybase.
  • I have a public key whose fingerprint is B574 5EB5 EC67 03F7 060E FC18 A182 F230 7AE4 1718

To claim this, I am signing this object:

-module(gos_geometry).
% run: io:format("~p~n", [gos_geometry:square(9)]).
%% API.
-export([square/1]).
-record(geometry_point, {id, neighbours}).
-spec square(pos_integer()) -> list(#geometry_point{}).
(function() {
Gyle.kit({
points: [{
id: -1,
neighbours: [-7],
hasHose: true,
hose: {}
}, {
id: -2,
name: "Mash Tun",
27> [pie:gpio_init(Pin, input) || Pin <- Pins].
["R15B03/lib/runtime_tools-1.8.9/ebin",
"R15B03/lib/runtime_tools-1.8.9/ebin",
"R15B03/lib/runtime_tools-1.8.9/ebin"]
static ERL_NIF_TERM
gpio_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
int pin, mode;
if (!enif_get_int(env, argv[0], &pin) ||
static ERL_NIF_TERM
gpio_read_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
int pin;
if (!enif_get_int(env, argv[0], &pin))
{
return enif_make_badarg(env);
}
int read = gpio_read(pin);
if(read == -1) {
1> Pins = [23, 24, 25].
[23,24,25]
2> [pie:gpio_init(Pin, input) || Pin <- Pins].
[ok,ok,ok]
3> io:format("~p~n", [{[[pie:gpio_read(Pin) || Pin <- Pins] || _ <- lists:seq(1, 100)]}]).
{[[0,0,0],
[0,0,0],
...
ok
4> io:format("~p~n", [{[[pie:gpio_read(Pin) || Pin <- Pins] || _ <- lists:seq(1, 100)]}]).
#0 0x0006c838 in size_object ()
#1 0x0008b2a8 in erts_send_message ()
#2 0x0007781c in do_send ()
#3 0x00078554 in erl_send ()
FORALL({Name, OG, ABV, EBU, Grains, Additions}, available_brews(),
begin
Brew = brew(Name, Grains, Additions),
ABV = Brew#brew.abv,
EBU = Brew#brew.ebu,
OG = Brew#brew.og,
ok
end
).