# Start the GenServer process
MyApp.Queue.start_link([])
MyApp.Queue.len() |> IO.inspect(label: "Initial length")
# Add some data to the queue
for idx <- 4..6, do: MyApp.Queue.push(idx)
MyApp.Queue.len() |> IO.inspect(label: "Length after adding elements")
:sys.get_state(MyApp.Queue) |> IO.inspect(label: "Introspection with :sys module")
GenServer.stop(MyApp.Queue)defmodule Formulas do
import Nx.Defn
defn softm
defn sigmoid(x) do
1 / (1 + Nx.exp(-x))
end
defn relu(x) do
Nx.m
end
endKino.Process.render_seq_trace(fn ->
parent = self()
child =
spawn(fn ->
receive do
:ping -> send(parent, :pong)
end
end)
send(child, :ping)
receive do
:pong -> :ponged!
end
end)"Elixir is cool!"
|> String.trim_trailing("!")
|> String.split()
|> List.first()
|> dbg()my_app_root = Path.join(__DIR__, "..")
Mix.install(
[
{:my_app, path: my_app_root, env: :dev}
],
config_path: Path.join(my_app_root, "config/config.exs"),
lockfile: Path.join(my_app_root, "mix.lock")
)MyApp.Repo.aggregate(MyApp.Orders.Order, :count)Find external packages for your notebook
Connect the session to an already running node and evaluate code in the context of that node. Make sure to give the node a name and a cookie, for example:
Then enter the connection information below:
led_pin = 20Now that we've selected a pin, connect the LED to led_pin through a 220Ω resistor, then to ground.
