Skip to content

Commit

Permalink
notes: add graphviz-based images
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrsk committed Oct 13, 2024
1 parent 7d6ec46 commit 692ec68
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 9 deletions.
2 changes: 1 addition & 1 deletion generate-graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from networkx.drawing.nx_pydot import read_dot
from networkx.readwrite import json_graph

N_MISSING = 8 # Number of predicted missing links
N_MISSING = 10 # Number of predicted missing links
MAX_NODES = 200 # Number of nodes in the final graph

def to_rellink(inp: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/graph.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions notes/20240928181517-otp.org
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ complexity: things that are difficult because you picked inadequate
tools. [cite:@cesarini2016designing p.20]
#+END_QUOTE

* Behaviors

+ [[id:1cd8fd81-a7c4-44ea-8b7a-d803e9b491af][gen_server]]
+ [[id:2daf1307-afb4-49e4-98cb-66ac7eb27cf0][supervisor]]
+ ~gen_statem~: State Machines
+ ~gen_fsm~: Finite State Machine
+ ~gen_event~

#+print_bibliography:
4 changes: 2 additions & 2 deletions notes/20241001192402-error_handling_in_erlang.org
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ A process ~Pid1~ can create a monitor for ~Pid2~ by calling the BIF
sep = 1;

pid1 [label="Pid 1", fontsize="10pt", style=filled, fillcolor=grey];
pid2 [label="Pid 2", fontsize="10pt", style=filled, fillcolor=grey, shape=square];
pid2 [label="Pid 2", fontsize="10pt", style=filled, fillcolor=green, shape=square];

pid1 -> pid2 [fontsize="10pt", minlen=2, style=dashed];
}
Expand All @@ -246,7 +246,7 @@ A process ~Pid1~ can create a monitor for ~Pid2~ by calling the BIF
sep = 1;

pid1 [label="💥", fontsize="10pt", style=filled, fillcolor=red];
pid2 [label="Pid 2", fontsize="10pt", style=filled, fillcolor=grey, shape=square];
pid2 [label="Pid 2", fontsize="10pt", style=filled, fillcolor=green, shape=square];

pid1 -> pid2 [label="{'DOWN', Ref, process, Pid1, Reason}", fontsize="10pt", minlen=1, style=dashed];
}
Expand Down
10 changes: 10 additions & 0 deletions notes/20241010094109-gen_server.org
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
#+HUGO_CATEGORIES: "Functional Programming"
#+HUGO_TAGS: "Erlang" "Elixir" "OTP"

#+begin_quote
Much of the work you think of as the core of a program - calculating results,
storing information, and preparing replies - will fit neatly into the ~gen_server~
behavior. It provides a core set of methods that let you set up a process,
respond to requests, end the process gracefully, and even pass state to a new
process if this one needs to be upgraded in place. [cite:@laurent2017 p.148]
#+end_quote

~gen_server~ is a generic server process that implements a standard set of
interface functions and functionality for tracing and error reporting, it also
fits an [[id:6ed3a191-0128-453e-b0b6-37c48593a6f0][OTP]] supervision tree.

#+print_bibliography:
7 changes: 7 additions & 0 deletions notes/20241013103835-supervisor.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:PROPERTIES:
:ID: 2daf1307-afb4-49e4-98cb-66ac7eb27cf0
:END:
#+title: supervisor
#+HUGO_CATEGORIES: "Functional Programming"
#+HUGO_TAGS: "OTP"

18 changes: 18 additions & 0 deletions notes/20241013113437-relation.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:PROPERTIES:
:ID: efd79527-1cfb-48da-868e-6286cff21c34
:END:
#+title: Relation
#+HUGO_CATEGORIES: "Math"
#+HUGO_TAGS: "Set Theory"

A relation is any subset of a Cartesian product. For instance, a relation $R$
over any subset of $X \times X$ is called a "Relation on $X$".

+ A Relation $R$ is said to be *reflexive* if $\forall x \in X: (x,x) \in R$.
+ A Relation $R$ is said to be *symmetric* if $\forall x,y \in X: (x,y) \in R \implies (y,x)
\in R$.
+ A Relation $R$ is *antisymmetric* if $\forall x,y \in X: (x,y) \in R \land (y,x) \in R \implies x
= y$.
+ A Relation $R$ is *transitive* if $\forall x,y,z \in X: (x,y) \in R \land (y,z) \in R \implies
(x,z) \in R$.
+ A Relation $R$ is an *equivalence relation* if it is *reflexive*, *symmetric* and *transitive*.
9 changes: 9 additions & 0 deletions notes/20241013114603-partial_order.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:PROPERTIES:
:ID: ce27d04b-aa7b-4fd5-98d3-30aa645f0d46
:END:
#+title: Partial Order
#+HUGO_CATEGORIES: "Math"
#+HUGO_TAGS: "Set Theory"

+ A [[id:efd79527-1cfb-48da-868e-6286cff21c34][Relation]] $R$ is said to be a *reflexive partial order* if its *reflexive*,
*antisymmetric*, and *transitive*.
9 changes: 9 additions & 0 deletions notes/20241013114603-partial_orders.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:PROPERTIES:
:ID: ce27d04b-aa7b-4fd5-98d3-30aa645f0d46
:END:
#+title: Partial Order
#+HUGO_CATEGORIES: "Math"
#+HUGO_TAGS: "Set Theory"

+ A [[id:efd79527-1cfb-48da-868e-6286cff21c34][Relation]] $R$ is said to be a *reflexive partial order* if its *reflexive*,
*antisymmetric*, and *transitive*.
2 changes: 1 addition & 1 deletion static/graph.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions static/img/notes/erlang_monitor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions static/img/notes/erlang_monitor_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 692ec68

Please sign in to comment.