https://github.com/cellulose/examples/blob/master/stop_watch/test/stop_watch_test.exs#L4
@cell_prefix :
** (SyntaxError) test/stop_watch_test.exs:4: invalid token: :
https://github.com/cellulose/examples/blob/master/stop_watch/test/stop_watch_test.exs#L4
@cell_prefix :
** (SyntaxError) test/stop_watch_test.exs:4: invalid token: :
I hereby claim:
To claim this, I am signing this object:
defmodule Turnstyle do | |
@moduledoc """ | |
This state machine emulates a turnstyle gate that has a rotating bar | |
and a coin slot. If the gate is locked a coin must be inserted to unlock | |
it, and then the bar will rotate to let you through when it is pushed. | |
The bar will then lock back in position. | |
""" | |
@behaviour :gen_statem |
# Binary search tree | |
defmodule Leaf do | |
@type t :: %__MODULE__{ | |
value: integer, | |
left: t | nil, | |
right: t | nil | |
} | |
defstruct [:left, :right, :value] |
defmodule MergeSort do | |
@spec sort([number]) :: [number] | |
def sort(list) do | |
case Enum.count(list) do | |
0 -> list | |
1 -> list | |
_ -> | |
midpoint = Enum.count(list) / 2 |> ceil() | |
{head_list, tail_list} = Enum.split(list, midpoint) |
# Connect and subscribe | |
def init(_args) do | |
Logger.info "Starting emqtt..." | |
{:ok, pid} = :emqtt.start_link( | |
clientid: "emqtt", | |
host: 'localhost', | |
# clean_start: false, | |
) |