From 171649ac36e3e81f9ff1633a39fe12b89204a534 Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 8 Nov 2023 18:16:01 +0000 Subject: [PATCH 1/8] [07/11/23] Removing old index.html --- index_old.html | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 index_old.html diff --git a/index_old.html b/index_old.html deleted file mode 100644 index 0164acd..0000000 --- a/index_old.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -layout: default -title: about me ---- - -
- -
-Hi! My name is Andrew Conlin. I am a software engineer and photographer, currently based in Cambridge, England. -
-
-My main hobbies are film photography and running. I love watching movies, especially in the cinema. I love post-punk, dreampop and experimental hip hop. I love drinking good coffee, good beer and good whisky. I am also a passionate self-hoster, and like to think that I'm at least somewhat privacy conscious. -
-
-I mainly use this site as a space for my blog, where I post interesting things I've found, and some of my (not so interesting) thoughts. Inspired by Simon Willison, I also post my TIL series here. Any time I run into a weird error while programming, I post the full error message and the fix that I found, to hopefully help someone down the line. -
-
-

contact

-
-You can email me, or use any of the socials in the nav menu. \ No newline at end of file From 80084d7155bea08725762f31286c79ac19c2ce7c Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 8 Nov 2023 18:18:49 +0000 Subject: [PATCH 2/8] [07/11/23] Adding .gitignore to not track draft posts --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..288aa32 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +_drafts/ From 0408b374e782a451692971a10561a3f3f0f32bb2 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 12 Nov 2023 17:30:46 +0000 Subject: [PATCH 3/8] [12/11/23] Updating .gitignore to remove _site directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 288aa32..f9d4643 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ _drafts/ +_site/ From 059878220a99c28b9c3aa34e47ca3ff6ed52ba70 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 12 Nov 2023 17:34:07 +0000 Subject: [PATCH 4/8] [12/11/23] Adding CSS and JS for new post --- _layouts/default.html | 8 +- assets/css/default.css | 5 + assets/js/typograms.js | 418 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 427 insertions(+), 4 deletions(-) create mode 100644 assets/js/typograms.js diff --git a/_layouts/default.html b/_layouts/default.html index 79cf129..fd4330b 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -17,12 +17,12 @@
{% include nav.html %}
-

- {{ page.title }} +

+ {{ page.title }}

{{ page.subtitle }} -

+

{{ content }}

@@ -31,4 +31,4 @@ - \ No newline at end of file + diff --git a/assets/css/default.css b/assets/css/default.css index 779ccfd..2b7ab50 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -94,3 +94,8 @@ img.letterboxd { background-color: gold; color: black; } + +table, th, td { + border: 1px solid; + padding: 5px; +}| diff --git a/assets/js/typograms.js b/assets/js/typograms.js new file mode 100644 index 0000000..a969e78 --- /dev/null +++ b/assets/js/typograms.js @@ -0,0 +1,418 @@ +! function() { + var t; + const e = { + "|": ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"); + if ("_" == e) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", "18"), t.setAttribute("y1", "51"), t.setAttribute("x2", "30"), t.setAttribute("y2", "51"), t.setAttribute("class", "part"), u.appendChild(t) + } + if ("_" == s) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", "0"), t.setAttribute("y1", "51"), t.setAttribute("x2", "12"), t.setAttribute("y2", "51"), t.setAttribute("class", "part"), u.appendChild(t) + } + if ("_" == i) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", "12"), t.setAttribute("y1", "-3"), t.setAttribute("x2", "30"), t.setAttribute("y2", "-3"), t.setAttribute("class", "part"), u.appendChild(t) + } + if ("_" == c) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", "0"), t.setAttribute("y1", "-3"), t.setAttribute("x2", "18"), t.setAttribute("y2", "-3"), t.setAttribute("class", "part"), u.appendChild(t) + } + return u.appendChild(r([!("/" == i && "\\" == c), ["-"].includes(e), !("/" == l && "\\" == o), ["-"].includes(s), "/" == i, "\\" == o, "/" == l, "\\" == c])), u + }, + "-": ([t, e, n, s, i, o, l, c]) => r([ + ["|"].includes(t), !0, ["|"].includes(n), !0, !1, !1, !1, !1 + ]), + "~": ([t, e, n, r, s, i, o, l]) => { + const c = document.createElementNS("http://www.w3.org/2000/svg", "g"), + u = document.createElementNS("http://www.w3.org/2000/svg", "line"); + return u.setAttribute("x1", "9"), u.setAttribute("y1", "27"), u.setAttribute("x2", "24"), u.setAttribute("y2", "27"), u.setAttribute("class", "part"), c.appendChild(u), c + }, + _: t => { + const n = e["-"](t); + return n.setAttribute("transform", "translate(0 24)"), n + }, + ":": ([t, e, n, r, s, i, o, l]) => { + const c = document.createElementNS("http://www.w3.org/2000/svg", "g"), + u = document.createElementNS("http://www.w3.org/2000/svg", "line"); + if (u.setAttribute("x1", "15"), u.setAttribute("y1", "0"), u.setAttribute("x2", "15"), u.setAttribute("y2", "60"), u.setAttribute("class", "part"), u.setAttribute("style", "stroke-dasharray: 15; stroke-dashoffset: 0;"), c.appendChild(u), "+" == t) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", "15"), t.setAttribute("y1", "-24"), t.setAttribute("x2", "15"), t.setAttribute("y2", "-15"), t.setAttribute("class", "part"), c.appendChild(t) + } + if ("+" == n) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", "15"), t.setAttribute("y1", "60"), t.setAttribute("x2", "15"), t.setAttribute("y2", "78"), t.setAttribute("class", "part"), c.appendChild(t) + } + return c + }, + "=": t => { + const e = document.createElementNS("http://www.w3.org/2000/svg", "g"), + n = document.createElementNS("http://www.w3.org/2000/svg", "line"); + n.setAttribute("x1", "0"), n.setAttribute("y1", "21"), n.setAttribute("x2", "30"), n.setAttribute("y2", "21"), n.setAttribute("class", "part"), e.appendChild(n); + const r = document.createElementNS("http://www.w3.org/2000/svg", "line"); + return r.setAttribute("x1", "0"), r.setAttribute("y1", "30"), r.setAttribute("x2", "30"), r.setAttribute("y2", "30"), r.setAttribute("class", "part"), e.appendChild(r), e + }, + "*": ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"), + p = document.createElementNS("http://www.w3.org/2000/svg", "circle"); + return p.setAttribute("cx", "0"), p.setAttribute("cy", "0"), p.setAttribute("r", "21"), p.setAttribute("stroke", "none"), p.setAttribute("transform", "translate(15, 27)"), u.appendChild(p), u.appendChild(r([ + ["+", "|"].includes(t), ["+", "-"].includes(e), ["+", "|"].includes(n), ["+", "-"].includes(s), ["/"].includes(i), ["\\"].includes(o), ["/"].includes(l), ["\\"].includes(c) + ])), u + }, + o: ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"), + p = document.createElementNS("http://www.w3.org/2000/svg", "circle"); + p.setAttribute("cx", "0"), p.setAttribute("cy", "0"), p.setAttribute("r", "18"), p.setAttribute("stroke-width", "6"), p.setAttribute("fill", "none"), p.setAttribute("stroke", "white"), p.setAttribute("transform", "translate(15, 27)"), u.appendChild(p); + const a = r([ + ["+", "|"].includes(t), ["+", "-"].includes(e), ["+", "|"].includes(n), ["+", "-"].includes(s), ["/"].includes(i), ["\\"].includes(o), ["/"].includes(l), ["\\"].includes(c) + ]); + u.appendChild(a); + const d = document.createElementNS("http://www.w3.org/2000/svg", "circle"); + return d.setAttribute("cx", "0"), d.setAttribute("cy", "0"), d.setAttribute("r", "15"), d.setAttribute("fill", "white"), d.setAttribute("opacity", "100%"), d.setAttribute("transform", "translate(15, 27)"), u.appendChild(d), u + }, + "/": t => { + const [n, s, i, o, l, c, u, p] = t, a = document.createElementNS("http://www.w3.org/2000/svg", "g"); + if (a.appendChild(r([ + ["|"].includes(n), !1, ["|"].includes(i), !1, !0, !1, !0, !1 + ])), "\\" == s) { + const t = r([!1, !1, !1, !1, !1, !1, !0, !1]); + t.setAttribute("transform", "translate(30 -54)"), t.setAttribute("clip-path", "polygon(-3 0, 0 0, 0 54, -3 54)"), a.appendChild(t) + } + if ("\\" == o) { + const t = r([!1, !1, !1, !1, !0, !1, !1, !1]); + t.setAttribute("transform", "translate(-30 54)"), t.setAttribute("clip-path", "polygon(15 -6, 33 -6, 33 6, 15 6)"), a.appendChild(t) + } + if ("_" == s) { + const n = e._(t); + a.appendChild(n) + } + return a + }, + "\\": t => { + const [n, s, i, o, l, c, u, p] = t, a = document.createElementNS("http://www.w3.org/2000/svg", "g"); + if (a.appendChild(r([ + ["|"].includes(n), !1, ["|"].includes(i), !1, !1, !0, !1, !0 + ])), "/" == o) { + const t = r([!1, !1, !1, !1, !1, !0, !1, !1]); + t.setAttribute("transform", "translate(-30 -54)"), t.setAttribute("clip-path", "polygon(15 0, 30 0, 30 54, 15 54)"), a.appendChild(t) + } + if ("/" == s) { + const t = r([!1, !1, !1, !1, !1, !1, !1, !0]); + t.setAttribute("transform", "translate(30 54)"), t.setAttribute("clip-path", "polygon(-3 0, 0 0, 0 6, -3 6)"), a.appendChild(t) + } + if ("_" == o) { + const n = e._(t); + a.appendChild(n) + } + return a + }, + "#": ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"), + p = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); + return p.setAttribute("points", [ + [0, 0], + [42, 0], + [42, 42], + [0, 42] + ].map(([t, e]) => `${t},${e}`).join(" ")), p.setAttribute("transform", "translate(-6, 6)"), u.appendChild(p), u.appendChild(r([ + ["+", "|"].includes(t), ["+", "-"].includes(e), ["+", "|"].includes(n), ["+", "-"].includes(s), ["/"].includes(i), ["\\"].includes(o), ["/"].includes(l), ["\\"].includes(c) + ])), u + }, + "+": ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"), + p = ["*", "#", "-", "+", "~", ">", ".", "'", "`"].includes(e), + a = ["*", "#", "-", "+", "~", "<", ".", "'", "`"].includes(s), + d = ["*", "#", "|", "+", ".", "`", "^"].includes(t), + w = ["*", "#", "|", "+", "'", "`", "v"].includes(n), + g = ["/", "*", "#"].includes(i), + b = ["\\", "*", "#"].includes(o), + A = ["\\", "*", "#"].includes(c), + h = ["/", "*", "#"].includes(l); + if (u.appendChild(r([d, p, w, a, g, b, h, A])), (a || p) && (w || d)) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); + t.setAttribute("points", "0,0 6,0 6,6 0,6"), t.setAttribute("transform", "translate(-3 -3) translate(15 27)"), u.appendChild(t) + } + if (g || A) { + const t = r([!1, !1, !1, !1, !1, A, g, !1]); + t.setAttribute("clip-path", "polygon(0 -3, 30 -3, 30 0, 0 0)"), u.appendChild(t) + } + if (b || h) { + const t = r([!1, !1, !1, !1, h, !1, !1, b]); + t.setAttribute("clip-path", "polygon(0 27, 15 27, 15 30, 0 30)"), u.appendChild(t) + } + if (h || A) { + const t = r([!1, !1, !1, !1, h && b, A && g, !1, !1]); + t.setAttribute("clip-path", "polygon(-3 0, 0 0, 0 54, -3 54)"), u.appendChild(t) + } + if (b || g) { + const t = r([!1, !1, !1, !1, !1, !1, g && A, b && h]); + t.setAttribute("clip-path", "polygon(15 0, 30 0, 30 54, 15 54)"), u.appendChild(t) + } + if (p || a) { + const t = r([!1, !1, !1, !1, p || h, A, g, a || b]); + t.setAttribute("clip-path", "polygon(-3 24, 30 24, 30 30, -3 30)"), u.appendChild(t) + } + return u + }, + ".": ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"); + if (!("-" != e && "+" != e || "|" != n && "'" != n && "`" != n && "+" != n)) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 30 24\n A 18 18, 0, 0, 0, 12 42\n L 12 54\n L 18 54\n L 18 42\n A 12 12, 0, 0, 1, 30 30\n Z"), u.appendChild(t) + } + if (!("-" != s && "+" != s || "|" != n && "'" != n && "`" != n && "+" != n)) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 24\n A 18 18, 0, 0, 1, 18 42\n L 18 54\n L 12 54\n L 12 42\n A 12 12, 0, 0, 0, 0 30 \n Z"), u.appendChild(t) + } + if (!("-" != e && "+" != e || "|" != t && "." != t && "+" != t)) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 30 30\n A 18 18, 0, 0, 1, 12 12\n L 12 0\n L 18 0\n L 18 12\n A 12 12, 0, 0, 0, 30 24\n Z"), u.appendChild(t) + } + if (!("-" != s && "+" != s || "|" != t && "." != t && "+" != t)) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 30\n A 18 18, 0, 0, 0, 18 12\n L 18 0\n L 12 0\n L 12 12\n A 12 12, 0, 0, 1, 0 24\n Z"), u.appendChild(t) + } + if ("-" == e && "/" == i) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 30 30\n A 12 12, 0, 0, 1, 18 18\n L 18 15\n L 24 15\n L 24 18\n A 6 6, 0, 0, 0, 30 24\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !0, !1, !1, !1]); + e.setAttribute("clip-path", "polygon(15px -10px, 30px -10px, 30px 30px, 2px 15px)"), u.appendChild(e) + } + if ("-" == e && "\\" == c) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M -3 0\n A 60 60, 0, 0, 0, 30 30\n L 30 24\n A 60 60, 0, 0, 1, 0 -6\n Z"), u.appendChild(t) + } + if ("-" == s && "/" == i) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 30\n A 60 60, 0, 0, 0, 33 0\n L 30 -6\n A 60 60, 0, 0, 1, 0 24\n Z"), u.appendChild(t) + } + if ("-" == s && "\\" == c) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 30\n A 12 12, 0, 0, 0, 12 18\n L 12 15\n L 6 15\n L 6 18\n A 6 6, 0, 0, 1, 0 24\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !1, !1, !1, !0]); + e.setAttribute("clip-path", "polygon(-3 -3, 12 -3, 12 18, -3 18)"), u.appendChild(e) + } + if ("|" == n && "/" == i) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 12 54\n A 120 120, 0, 0, 1, 30 -6\n L 37 -6\n A 120 120, 0, 0, 0, 18 54\n Z"), u.appendChild(t) + } + if ("|" == t && "\\" == o) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 30 60\n A 120 120, 0, 0, 1, 12 0\n L 18 0\n A 120 120, 0, 0, 0, 37 60\n Z"), u.appendChild(t) + } + if ("|" == t && "/" == l) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 60\n A 120 120, 0, 0, 0, 18 0\n L 12 0\n A 120 120, 0, 0, 1, -7 60\n Z"), u.appendChild(t) + } + if ("|" == n && "\\" == c) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 12 54\n A 120 120, 0, 0, 0, -7 -6\n L 0 -6\n A 120 120, 0, 0, 1, 18 54\n Z"), u.appendChild(t) + } + if ("-" == e && "/" == l) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 48\n A 42 42, 0, 0, 1, 30 24\n L 30 30\n A 42 42, 0, 0, 0, 6 48\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !1, !1, !0, !1]); + e.setAttribute("clip-path", "polygon(-3 15, 12 15, 12 30, -3 30)"), u.appendChild(e) + } + if ("-" == s && "\\" == o) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 24\n A 42 42, 0, 0, 1, 30 48\n L 24 48\n A 42 42, 0, 0, 0, 0 30\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !1, !0, !1, !1]); + e.setAttribute("clip-path", "polygon(-3 15, 12 15, 21 30, -3 30)"), u.appendChild(e) + } + if ("-" == s && "/" == l) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 0 24\n A 12 12, 0, 0, 1, 12 39\n L 6 39\n A 6 6, 0, 0, 0, 0 30\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !1, !1, !0, !1]); + e.setAttribute("clip-path", "polygon(-3 6, 12 6, 12 30, -3 30)"), u.appendChild(e) + } + if ("-" == e && "\\" == o) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 30 24\n A 12 12, 0, 0, 0, 18 39\n L 24 39\n A 6 6, 0, 0, 1, 30 30 \n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !1, !0, !1, !1]); + e.setAttribute("clip-path", "polygon(3 6, 18 6, 18 30, 3 30)"), u.appendChild(e) + } + if ("/" == l && "\\" == o) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 3 42\n A 15 15, 0, 0, 1, 27 42\n L 25 51\n A 9 9, 0, 0, 0, 5 51\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !1, !0, !0, !1]); + e.setAttribute("clip-path", "polygon(-3 15, 33 15, 33 30, -3 30)"), u.appendChild(e) + } + if ("\\" == c && "/" == i) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 3 12\n A 15 15, 0, 0, 0, 27 12\n L 22 9\n A 9 9, 0, 0, 1, 8 9\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !0, !1, !1, !0]); + e.setAttribute("clip-path", "polygon(-3 -3, 33 -3, 33 12, -3 12)"), u.appendChild(e) + } + if ("/" == i && "\\" == o) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 22 9\n A 30 30, 0, 0, 0, 22 45\n L 28 45\n A 30 30, 0, 0, 1, 28 9\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !0, !0, !1, !1]); + e.setAttribute("clip-path", "polygon(6 -3, 33 -3, 33 57, 6 57)"), u.appendChild(e) + } + if ("\\" == c && "/" == l) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "path"); + t.setAttribute("d", "\n M 8 9\n A 30 30, 0, 0, 1, 8 45\n L 2 45\n A 30 30, 0, 0, 0, 2 9\n Z"), u.appendChild(t); + const e = r([!1, !1, !1, !1, !1, !1, !0, !0]); + e.setAttribute("clip-path", "polygon(-3 -3, 9 -3, 9 57, -3 57)"), u.appendChild(e) + } + return u + } + }, + n = { + "\u250c": "+", + "\u2510": "+", + "\u2514": "+", + "\u2518": "+", + "\u2500": "-", + "\u25ba": ">", + "'": ".", + "`": ".", + V: "v" + }; + for (const [o, l] of Object.entries(n)) e[o] = t => e[l](t); + + function r([t, e, n, r, s, i, o, l]) { + const c = document.createElementNS("http://www.w3.org/2000/svg", "g"); + if (t) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 15), t.setAttribute("y1", 0), t.setAttribute("x2", 15), t.setAttribute("y2", 27), t.setAttribute("class", "part"), c.appendChild(t) + } + if (e) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 15), t.setAttribute("y1", 27), t.setAttribute("x2", 30), t.setAttribute("y2", 27), t.setAttribute("class", "part"), c.appendChild(t) + } + if (n) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 15), t.setAttribute("y1", 27), t.setAttribute("x2", 15), t.setAttribute("y2", 54), t.setAttribute("class", "part"), c.appendChild(t) + } + if (r) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 0), t.setAttribute("y1", 27), t.setAttribute("x2", 15), t.setAttribute("y2", 27), t.setAttribute("class", "part"), c.appendChild(t) + } + if (document.createElementNS("http://www.w3.org/2000/svg", "polygon").setAttribute("points", [ + [0, 0], + [20.6, 0], + [20.6, 3], + [0, 3] + ].map(([t, e]) => `${t},${e}`).join(" ")), s) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 30), t.setAttribute("y1", 0), t.setAttribute("x2", 15), t.setAttribute("y2", 27), t.setAttribute("class", "part"), c.appendChild(t) + } + if (i) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 15), t.setAttribute("y1", 27), t.setAttribute("x2", 30), t.setAttribute("y2", 54), t.setAttribute("class", "part"), c.appendChild(t) + } + if (o) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 15), t.setAttribute("y1", 27), t.setAttribute("x2", 0), t.setAttribute("y2", 54), t.setAttribute("class", "part"), c.appendChild(t) + } + if (l) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", 0), t.setAttribute("y1", 0), t.setAttribute("x2", 15), t.setAttribute("y2", 27), t.setAttribute("class", "part"), c.appendChild(t) + } + return c + } + + function s(t, e) { + const n = document.createElementNS("http://www.w3.org/2000/svg", "g"), + r = document.createElementNS("http://www.w3.org/2000/svg", "text"), + s = document.createTextNode(t); + return r.appendChild(s), e && r.setAttribute("class", "reserved"), r.setAttribute("transform", [ + [15, 24] + ].map(([t, e]) => `translate(${t}, ${e})`).join(" ")), n.appendChild(r), n + } + + function i(t, [e, n]) { + let r = " ", + s = " ", + i = " ", + o = " ", + l = " ", + c = " ", + u = " ", + p = " "; + return n > 0 && (s = t[n - 1][e] || " "), e < t[n].length - 1 && (i = t[n][e + 1] || " "), n < t.length - 1 && (o = t[n + 1][e] || " "), e > 0 && (r = t[n][e - 1] || " "), n > 0 && e < t[n - 1].length - 1 && (l = t[n - 1][e + 1] || " "), n + 1 < t.length && e < t[n + 1].length && (c = t[n + 1][e + 1] || " "), n < t.length - 1 && e > 0 && (u = t[n + 1][e - 1] || " "), n > 0 && e > 0 && (p = t[n - 1][e - 1] || " "), [s, i, o, r, l, c, u, p] + } + e[">"] = ([t, e, n, r, s, i, o, l]) => { + const c = document.createElementNS("http://www.w3.org/2000/svg", "g"), + u = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); + u.setAttribute("points", "0,0 42,18 0,36"); + let p = 0; + return "*" != e && "o" != e && "#" != e || (p -= 18), u.setAttribute("transform", `translate(${p} 9)`), c.appendChild(u), c + }, e["<"] = ([t, e, n, r, s, i, o, l]) => { + const c = document.createElementNS("http://www.w3.org/2000/svg", "g"), + u = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); + u.setAttribute("points", "0,0 42,18 0,36"); + let p = 30; + return "*" != r && "o" != r && "#" != r || (p += 18), u.setAttribute("transform", `translate(${p} 9) translate(0 36) rotate(180)`), c.appendChild(u), c + }, e.v = ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"), + p = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); + p.setAttribute("points", "0,0 42,18 0,36"); + let a = 36; + return " " == n ? a = 12 : "_" == n ? a += 18 : "*" != n && "o" != n && "#" != n || (a -= 18), "/" == i ? p.setAttribute("transform", "translate(-36 33) rotate(112.5, 42, 18)") : "\\" == c ? p.setAttribute("transform", "translate(-18 33) rotate(67.5, 42, 18)") : p.setAttribute("transform", `translate(33 ${a}) rotate(90)`), u.appendChild(p), u.appendChild(r([ + ["|", "+"].includes(t), !1, ["|", "+"].includes(t), !1, ["/"].includes(i), !1, !1, ["\\"].includes(c) + ])), u + }, e["^"] = ([t, e, n, s, i, o, l, c]) => { + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"), + p = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); + p.setAttribute("points", "0,0 42,18 0,36"); + let a = 42; + return "-" == t && (a -= 15), "/" == l ? p.setAttribute("transform", "translate(-18 -15) rotate(-67.5, 42, 18)") : "\\" == o ? p.setAttribute("transform", "translate(-36 -15) rotate(-112.5, 42, 18)") : p.setAttribute("transform", `translate(-3 ${a}) rotate(-90)`), u.appendChild(p), u.appendChild(r([!1, !1, ["+", "|"].includes(n), !1, !1, ["\\"].includes(o), ["/"].includes(l), !1])), u + }, t = function(t, n, r) { + const o = t.split("\n").map(t => t.trimEnd().split("")); + o.shift(), o.splice(-1); + let l = 0; + const c = o.length; + for (let e = 0; e < o.length; e++) + for (let t = 0; t < o[e].length; t++) o[e].length > l && (l = o[t].length); + var u = document.createElementNS("http://www.w3.org/2000/svg", "svg"); + u.setAttribute("width", 30 * l * n), u.setAttribute("height", 54 * c * n), u.setAttribute("debug", r), u.setAttribute("viewBox", `0 0 ${30*l+0} ${54*c+0}`), u.setAttribute("class", "debug"); + var p = document.createElementNS("http://www.w3.org/2000/svg", "style"); + return p.innerHTML = '\n.diagram {\n display: block;\n}\n\n.diagram line, .diagram circle, .diagram rect {\n stroke: white;\n}\n\n.diagram line {\n stroke-width: 2;\n}\n\n.diagram circle {\n r: 3.5;\n}\n\n.diagram rect {\n width: 6px;\n height: 6px;\n}\n\ntext {\n fill:white;\n}\n\n.diagram text, .glyph, .debug text {\n /** font-family: Consolas, Monaco, \'Andale Mono\', \'Ubuntu Mono\', monospace; **/\n font-family: Iosevka Fixed, monospace;\n font-size: 3em;\n text-anchor: middle;\n alignment-baseline: central;\n white-space: pre;\n}\n\n.reserved {\n fill: transparent;\n white-space: pre;\n}\n\n.debug[debug="true"] .reserved {\n fill: white;\n opacity: 0.5;\n}\n\n.debug[debug="true"] line.grid {\n stroke: white;\n stroke-width: 0.2;\n stroke-linecap: butt;\n fill: white;\n opacity: 1%;\n}\n\npolygon {\n stroke-width: 0;\n}\n\n.debug[debug="true"] polygon.inner {\n fill: white;\n stroke: white;\n opacity: 5%;\n}\n\npolygon {\n stroke: white;\n /** stroke-width: 0.2; **/\n stroke-linecap: butt;\n fill: white;\n}\n\n.debug[debug="true"] polygon,\n.debug[debug="true"] line.grid\n{\n opacity: 10%;\n}\n\n.debug[debug="true"] polygon,\n.debug[debug="true"] path,\n.debug[debug="true"] circle\n{\n opacity: 50%;\n}\n\n.debug[debug="true"] polygon {\n fill: red;\n stroke: red;\n}\n\n/**\ncircle {\n fill: white;\n}\n**/\n\n.debug[debug="true"] circle,\n.debug[debug="true"] path\n{\n opacity: 50%;\n fill: red;\n}\n\n.debug[debug="true"] circle {\n stroke: red;\n}\n\n.debug[debug="true"] .inner {\n stroke-width: 0.2;\n}\n\nline.part {\n stroke-width: 6;\n stroke-linecap: butt;\n stroke: white;\n}\n\n.debug[debug="true"] line.part {\n opacity: 50%;\n stroke: red;\n}\n\n.debug[debug="true"] line.center {\n stroke-width: 3;\n stroke-linecap: butt;\n opacity: 10%;\n stroke: white;\n}\n\ntext::selection {\n fill: white;\n background-color: #EEE;\n}\n ', u.appendChild(p), u.appendChild(function(t) { + const n = document.createElementNS("http://www.w3.org/2000/svg", "g"); + for (let r = 0; r < t.length; r++) + for (let o = 0; o < t[r].length; o++) { + const l = t[r][o]; + if (" " == l || '"' == l) continue; + let c = e[l]; + const u = document.createElementNS("http://www.w3.org/2000/svg", "g"); + let p = !1; + for (let e = 0; e < o; e++) '"' == t[r][e] && (p = !p); + const a = i(t, [o, r]); + if (l.match(/[A-Za-z0-9]/)) { + const [, t, , e] = a; + p = p || e.match(/[A-Za-uw-z0-9]/) || t.match(/[A-Za-uw-z0-9]/) + } + c = c && !p, c && u.appendChild(e[l](a)), u.appendChild(s(l, c)), u.setAttribute("transform", `translate(${30*o} ${54*r})`), n.appendChild(u) + } + return n + }(o)), r && u.appendChild(function(t, e) { + const n = document.createElementNS("http://www.w3.org/2000/svg", "g"), + r = document.createElementNS("http://www.w3.org/2000/svg", "line"); + r.setAttribute("x1", 15), r.setAttribute("y1", 0), r.setAttribute("x2", 15), r.setAttribute("y2", 54), r.setAttribute("class", "center"); + const s = document.createElementNS("http://www.w3.org/2000/svg", "line"); + s.setAttribute("x1", 0), s.setAttribute("y1", 30), s.setAttribute("x2", 30), s.setAttribute("y2", 54), s.setAttribute("class", "center"); + for (let i = 0; i <= 30 * t; i += 3) { + const t = document.createElementNS("http://www.w3.org/2000/svg", "line"); + t.setAttribute("x1", i), t.setAttribute("y1", 0), t.setAttribute("x2", i), t.setAttribute("y2", 54 * e), t.setAttribute("class", "grid"), n.appendChild(t) + } + for (let i = 0; i <= 54 * e; i += 3) { + const e = document.createElementNS("http://www.w3.org/2000/svg", "line"); + e.setAttribute("x1", 0), e.setAttribute("y1", i), e.setAttribute("x2", 30 * t), e.setAttribute("y2", i), e.setAttribute("class", "grid"), n.appendChild(e) + } + return n + }(l, c)), u + }, document.addEventListener("DOMContentLoaded", (function() { + for (const e of document.querySelectorAll("script[type='text/typogram']")) { + if (e.hasAttribute("disabled")) continue; + const n = e.innerText, + r = Number(e.getAttribute("zoom") || .3), + s = e.hasAttribute("grid"), + i = t(n, r, s); + e.parentNode.insertBefore(i, e.nextSibling) + } + })) +}(); \ No newline at end of file From 7f8ee1eafd993bcf417f4f6f81017cb0a28be7e9 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 12 Nov 2023 17:37:44 +0000 Subject: [PATCH 5/8] [12/11/23] Removing site directory --- _site/assets/css/default.css | 5 + .../01/14/musings-on-the-cinema/index.html | 9 +- .../2023/03/05/yuri-felsen-on-love/index.html | 9 +- .../putting-thoughts-into-action/index.html | 9 +- .../04/29/links-arent-performances/index.html | 9 +- _site/feed.xml | 205 +++++++++++++++++- _site/feed/blog.xml | 146 ++++++++++++- _site/feed/til.xml | 2 +- _site/index.html | 25 ++- _site/index_old/index.html | 137 ------------ _site/sitemap.xml | 9 +- _site/til/index.html | 15 +- _site/til/nextcloud-php-errors/index.html | 9 +- .../index.html | 9 +- 14 files changed, 424 insertions(+), 174 deletions(-) delete mode 100644 _site/index_old/index.html diff --git a/_site/assets/css/default.css b/_site/assets/css/default.css index 779ccfd..2b7ab50 100644 --- a/_site/assets/css/default.css +++ b/_site/assets/css/default.css @@ -94,3 +94,8 @@ img.letterboxd { background-color: gold; color: black; } + +table, th, td { + border: 1px solid; + padding: 5px; +}| diff --git a/_site/blog/2023/01/14/musings-on-the-cinema/index.html b/_site/blog/2023/01/14/musings-on-the-cinema/index.html index cf669f3..0caa0f4 100644 --- a/_site/blog/2023/01/14/musings-on-the-cinema/index.html +++ b/_site/blog/2023/01/14/musings-on-the-cinema/index.html @@ -10,6 +10,7 @@ + @@ -106,12 +107,12 @@ -->
-

- Musings on the power of cinema +

+ Musings on the power of cinema

-

+

 14 Jan 2023   @@ -129,4 +130,4 @@ - \ No newline at end of file + diff --git a/_site/blog/2023/03/05/yuri-felsen-on-love/index.html b/_site/blog/2023/03/05/yuri-felsen-on-love/index.html index 18b696c..7030268 100644 --- a/_site/blog/2023/03/05/yuri-felsen-on-love/index.html +++ b/_site/blog/2023/03/05/yuri-felsen-on-love/index.html @@ -10,6 +10,7 @@ + @@ -106,12 +107,12 @@ -->

-

- Yuri Felsen on love +

+ Yuri Felsen on love

-

+

 05 Mar 2023   @@ -133,4 +134,4 @@ - \ No newline at end of file + diff --git a/_site/blog/2023/03/10/putting-thoughts-into-action/index.html b/_site/blog/2023/03/10/putting-thoughts-into-action/index.html index bf56699..f7f3570 100644 --- a/_site/blog/2023/03/10/putting-thoughts-into-action/index.html +++ b/_site/blog/2023/03/10/putting-thoughts-into-action/index.html @@ -10,6 +10,7 @@ + @@ -106,12 +107,12 @@ -->

-

- A measure of how easily thoughts can be translated to action +

+ A measure of how easily thoughts can be translated to action

-

+

 10 Mar 2023   @@ -149,4 +150,4 @@ - \ No newline at end of file + diff --git a/_site/blog/2023/04/29/links-arent-performances/index.html b/_site/blog/2023/04/29/links-arent-performances/index.html index 3e78e81..8a33a4f 100644 --- a/_site/blog/2023/04/29/links-arent-performances/index.html +++ b/_site/blog/2023/04/29/links-arent-performances/index.html @@ -10,6 +10,7 @@ + @@ -106,12 +107,12 @@ -->

-

- Links aren't performances +

+ Links aren't performances

-

+

 29 Apr 2023   @@ -133,4 +134,4 @@ - \ No newline at end of file + diff --git a/_site/feed.xml b/_site/feed.xml index 4e52663..e0aef21 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1,4 +1,207 @@ -Jekyll2023-11-06T13:57:50+00:00http://localhost:4000/feed.xmlAndrew ConlinLinks aren’t performances2023-04-29T00:00:00+01:002023-04-29T00:00:00+01:00http://localhost:4000/blog/2023/04/29/links-arent-performances“For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had posted, he infringed on copyright.

+Jekyll2023-11-12T17:37:09+00:00http://localhost:4000/feed.xmlAndrew ConlinEnhancing Rock Paper Scissors2023-11-12T17:27:35+00:002023-11-12T17:27:35+00:00http://localhost:4000/blog/2023/11/12/rock-paper-scissorsAt least where I live, Rock Paper Scissors (henceforth referred to as RPS) is still the dominant way of quickly making a decision between friends. However, it is in desperate need of an update.

+ +

In this post, I will set out the existing problems with the game, then how I aim to resolve them, and conclude with a summary of the amazing of the brand-spanking new edition.

+ +

For the record, I am writing this post because the game is bad, not because I always lose to my girlfriend and have decided to change the rules rather than accept defeat1.

+ +

1. The problems

+
    +
  1. Lack of options
  2. +
  3. Scissors picked disproportionately
  4. +
  5. General lack of whimsy
  6. +
+ +

2. Fixing the problems

+

How many extra options should we add?

+

Graph theory

+

Before we dive in, let me give you some Graph Theory 101. First some terms:

+
    +
  • vertex: a point in space
  • +
  • edge: connects any two points
  • +
  • vertices are joined with edges to create graphs
  • +
  • to begin with, we will have undirected graphs, where edges have no direction associated with them
  • +
+ +

Therefore, to represent the current setup for RPS, we can have the following

+ + + + + +

Each possible hand is a vertex, and each edge is a game. In graph theory, a complete graph is one where every pair of vertices is connected by a unique edge. Intuitively you can see that rock, paper scissors is complete, otherwise there would be combinations that couldn’t be played against each other.

+ +

Another concept that I now need to introduce is that of degree. The degree of a vertex is the total number of edges it is connected to. This is the second criterion that we need to fulfill: Every vertex must have the same degree. This is known as a regular graph. The exisiting RPS graph is also regular, with degree 2 (2-regular). We need to satisfy this with our new graph.

+ +

It is now time to introduce direction to our graph, used to represent winners and losers. Here is the RPS graph with directions representing who will win each game, also known as a digraph.

+ + + +

Rock beats scissors etc. etc.

+ +

More specifically, we want an oriented graph. There shouldn’t be any bidirectionality between vertices, which would indicate a draw.

+ +

A complete, oriented graph is called a tournament.

+ +

Buidling on out definition of regularity from the non-directed graphs, we have directional regularity (indegree = outdegree). A tournament where each of the vertices is regular is called a “regular tournament”. This specific type of digraph satisfies all our criteria, and any new game that we create must be regular tournament.

+ +
    +
  1. complete (every hand can play every hand)
  2. +
  3. regular (every hand can participate in the same number of possible games)
  4. +
  5. oriented (every game results in a winner)
  6. +
  7. indegree = outdegree for all vertices (each hand wins as many as it loses)
  8. +
+ +

Number of regular tournaments for numbers of nodes (even no. of nodes excluded because they have an odd degree, and therefore no regular tournaments):

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NodesDegreeRegular Tournaments
101
322
5424
762640
...
...
+ +

as much as I would love to look at all of the possible 2640 combinations for a 7 player tournament, 5 possible hands looks like our sweetspot here, both in terms of the possible winner/loser combinations and in terms of the brain capacity of people playing the game.

+ + + +

This took me so long to figure out2

+ +
+
    +
  1. +

    It’s like she’s in my head it’s crazy 

    +
  2. +
  3. +

    The notebook of a crazed madman 

    +
  4. +
+
]]>
Andrew Conlin
Rock Paper Scissors2023-11-08T18:36:46+00:002023-11-08T18:36:46+00:00http://localhost:4000/2023/11/08/rock-paper-scissorsIntro +

Background

+

Rock, Paper, Scissors needs an update. +In this post I will set out the threory behind

+

How many extra options should we add?

+

Graph theory

+

Before we dive in, let me give you some Graph Theory 101. FIrst some terms:

+
    +
  • vertex: a point in space
  • +
  • edge: connects any two points
  • +
  • vertices are joined with edges to create graphs
  • +
  • to begin with, we will have undirected graphs, where edges have no direction associated with them
  • +
+ +

Therefore, to represent the current setup for RPS, we can have the following + “rock” + o + /
+ /
+ /
+ paper o——-o scissors

+ +

Each possible hand is a vertex, and each edge is a game. In graph theory, a complete graph is one where every pair of vertices is connected by a unique edge. Intuitively you can see that rock, paper scissors is complete, otherwise there would be combinations that couldn’t be played against each other.

+ +

Another concept that I now need to introduce is that of degree. The degree of a vertex is the total number of edges it is connected to. This is the second criterion that we need to fulfill: Every vertex must have the same degree. This is known as a regular graph. The exisiting RPS graph is also regular, with degree 2 (2-regular). We need to satisfy this with our new graph.

+ +

It is now time to introduce direction to our graph, used to represent winners and losers. Here is the RPS graph with directions representing who will win each game, also known as a digraph.

+ +
     "rock" 
+       o
+      ^ \
+     /   \
+    /     v  paper o <------o scissors
+
+ +

Rock beats scissors etc. etc.

+ +

More specifically, we want an oriented graph. There shouldn’t be any bidirectionality between vertices, which would indicate a draw.

+ +

A complete, oriented graph is called a tournament.

+ +

Buidling on out definition of regularity from the non-directed graphs, we have directional regularity (indegree = outdegree). A tournament where each of the vertices is regular is called a “regular tournament”. This specific type of digraph satisfies all our criteria, and any new game that we create must be regular tournament.

+ +
    +
  1. complete (every hand can play every hand)
  2. +
  3. regular (every hand can participate in the same number of possible games)
  4. +
  5. oriented (every game results in a winner)
  6. +
  7. indegree = outdegree for all vertices (each hand wins as many as it loses)
  8. +
+ +

Number of regular tournaments for numbers of nodes (even no. of nodes excluded because they have an odd degree, and therefore no regular tournaments): +| Nodes | Degree | Regular Tournaments | +|—————- | ————— | ————— | +| 1 | 0 | 1 | +| 3 | 2 | 2 | +| 5 | 4 | 24 | +| 7 | 6 | 2640 | +and so on…

+ +

as much as I would love to look at all of the possible 2640 combinations for a 7 player tournament, 5 possible hands looks like our sweetspot here, both in terms of the possble winner/loser combinations and in terms of the brain capacity of people playing the game.

]]>
Andrew Conlin
Links aren’t performances2023-04-29T00:00:00+01:002023-04-29T00:00:00+01:00http://localhost:4000/blog/2023/04/29/links-arent-performances“For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had posted, he infringed on copyright.

This is a perverse, even surreal take on copyright. The court rejects Linkletter’s argument that even Youtube’s terms of service warned Proctorio that publishing world-viewable material on its site constituted permission for people to link to and watch that material.”

diff --git a/_site/feed/blog.xml b/_site/feed/blog.xml index 6c42d47..8b560b2 100644 --- a/_site/feed/blog.xml +++ b/_site/feed/blog.xml @@ -1,4 +1,148 @@ -Jekyll2023-11-06T13:57:50+00:00http://localhost:4000/feed/blog.xml | BlogAndrew ConlinLinks aren’t performances2023-04-29T00:00:00+01:002023-04-29T00:00:00+01:00http://localhost:4000/blog/2023/04/29/links-arent-performances“For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had posted, he infringed on copyright.

+Jekyll2023-11-12T17:37:09+00:00http://localhost:4000/feed/blog.xml | BlogAndrew ConlinEnhancing Rock Paper Scissors2023-11-12T17:27:35+00:002023-11-12T17:27:35+00:00http://localhost:4000/blog/2023/11/12/rock-paper-scissorsAt least where I live, Rock Paper Scissors (henceforth referred to as RPS) is still the dominant way of quickly making a decision between friends. However, it is in desperate need of an update.

+ +

In this post, I will set out the existing problems with the game, then how I aim to resolve them, and conclude with a summary of the amazing of the brand-spanking new edition.

+ +

For the record, I am writing this post because the game is bad, not because I always lose to my girlfriend and have decided to change the rules rather than accept defeat1.

+ +

1. The problems

+
    +
  1. Lack of options
  2. +
  3. Scissors picked disproportionately
  4. +
  5. General lack of whimsy
  6. +
+ +

2. Fixing the problems

+

How many extra options should we add?

+

Graph theory

+

Before we dive in, let me give you some Graph Theory 101. First some terms:

+
    +
  • vertex: a point in space
  • +
  • edge: connects any two points
  • +
  • vertices are joined with edges to create graphs
  • +
  • to begin with, we will have undirected graphs, where edges have no direction associated with them
  • +
+ +

Therefore, to represent the current setup for RPS, we can have the following

+ + + + + +

Each possible hand is a vertex, and each edge is a game. In graph theory, a complete graph is one where every pair of vertices is connected by a unique edge. Intuitively you can see that rock, paper scissors is complete, otherwise there would be combinations that couldn’t be played against each other.

+ +

Another concept that I now need to introduce is that of degree. The degree of a vertex is the total number of edges it is connected to. This is the second criterion that we need to fulfill: Every vertex must have the same degree. This is known as a regular graph. The exisiting RPS graph is also regular, with degree 2 (2-regular). We need to satisfy this with our new graph.

+ +

It is now time to introduce direction to our graph, used to represent winners and losers. Here is the RPS graph with directions representing who will win each game, also known as a digraph.

+ + + +

Rock beats scissors etc. etc.

+ +

More specifically, we want an oriented graph. There shouldn’t be any bidirectionality between vertices, which would indicate a draw.

+ +

A complete, oriented graph is called a tournament.

+ +

Buidling on out definition of regularity from the non-directed graphs, we have directional regularity (indegree = outdegree). A tournament where each of the vertices is regular is called a “regular tournament”. This specific type of digraph satisfies all our criteria, and any new game that we create must be regular tournament.

+ +
    +
  1. complete (every hand can play every hand)
  2. +
  3. regular (every hand can participate in the same number of possible games)
  4. +
  5. oriented (every game results in a winner)
  6. +
  7. indegree = outdegree for all vertices (each hand wins as many as it loses)
  8. +
+ +

Number of regular tournaments for numbers of nodes (even no. of nodes excluded because they have an odd degree, and therefore no regular tournaments):

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NodesDegreeRegular Tournaments
101
322
5424
762640
...
...
+ +

as much as I would love to look at all of the possible 2640 combinations for a 7 player tournament, 5 possible hands looks like our sweetspot here, both in terms of the possible winner/loser combinations and in terms of the brain capacity of people playing the game.

+ + + +

This took me so long to figure out2

+ +
+
    +
  1. +

    It’s like she’s in my head it’s crazy 

    +
  2. +
  3. +

    The notebook of a crazed madman 

    +
  4. +
+
]]>
Andrew Conlin
Links aren’t performances2023-04-29T00:00:00+01:002023-04-29T00:00:00+01:00http://localhost:4000/blog/2023/04/29/links-arent-performances“For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had posted, he infringed on copyright.

This is a perverse, even surreal take on copyright. The court rejects Linkletter’s argument that even Youtube’s terms of service warned Proctorio that publishing world-viewable material on its site constituted permission for people to link to and watch that material.”

diff --git a/_site/feed/til.xml b/_site/feed/til.xml index 4e13108..e48e535 100644 --- a/_site/feed/til.xml +++ b/_site/feed/til.xml @@ -1,4 +1,4 @@ -Jekyll2023-11-06T13:57:50+00:00http://localhost:4000/feed/til.xml | TilAndrew ConlinRunning a Python script periodically in a Docker container using cron2023-04-19T00:00:00+01:002023-04-19T00:00:00+01:00http://localhost:4000/til/running-python-in-cron-in-dockerRecently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using “Send-to-Kindle” feature (a blog post about this project is in the works).

+Jekyll2023-11-12T17:37:09+00:00http://localhost:4000/feed/til.xml | TilAndrew ConlinRunning a Python script periodically in a Docker container using cron2023-04-19T00:00:00+01:002023-04-19T00:00:00+01:00http://localhost:4000/til/running-python-in-cron-in-dockerRecently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using “Send-to-Kindle” feature (a blog post about this project is in the works).

I loved this idea, and thought it would be no problem to get a Python script up and running periodically on my Raspberry Pi home server using cron. However, I ran into various issues along the way (some of which were not so easy to resolve), so I’m collating all the configuration changes I made in the hopes that it will be useful to someone one day. You can find the full repo for this project here, and I have also included my Dockerfile, docker-compose.yml and crontab at the end of this TIL.

diff --git a/_site/index.html b/_site/index.html index 03136f5..d41cd09 100644 --- a/_site/index.html +++ b/_site/index.html @@ -10,6 +10,7 @@ + @@ -106,17 +107,33 @@ -->
-

- latest posts +

+ latest posts

all the posts, in reverse chronological. there is an atom feed above. -

+