From ed0c3b7ab2fd148fb767dc5630ffaabb9bafe3fe Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 29 Nov 2024 19:38:44 -0600 Subject: [PATCH] feat(posts): remove folds --- posts/algorithms/extrema-circular-buffer.html | 10 +-- posts/algorithms/leetcode-daily.html | 72 +++++++++---------- posts/algorithms/two-pointers.html | 4 +- posts/economics/models-of-production.html | 28 ++++---- scripts/invalidate.sh | 9 --- scripts/post.js | 24 ------- styles/index.css | 1 - styles/post.css | 12 ---- 8 files changed, 49 insertions(+), 111 deletions(-) delete mode 100755 scripts/invalidate.sh diff --git a/posts/algorithms/extrema-circular-buffer.html b/posts/algorithms/extrema-circular-buffer.html index 9025bd1..ef70f0c 100644 --- a/posts/algorithms/extrema-circular-buffer.html +++ b/posts/algorithms/extrema-circular-buffer.html @@ -157,9 +157,7 @@ private: size_t capacity; }; -
-

optimizing the approach

-
+

optimizing the approach

Rather than bear the brunt of the work finding extrema in calls to @@ -246,9 +244,7 @@ private: size_t capacity; };

-
-

monotonic queues deques

-
+

monotonic queues deques

Thinking a bit deeper about the problem constraints, it is clear @@ -370,7 +366,7 @@ private: std::deque<std::pair<double, size_t>> maxs; size_t capacity; }; -

further improvements

+

further improvements

  1. While the final approach is theoretically faster than the diff --git a/posts/algorithms/leetcode-daily.html b/posts/algorithms/leetcode-daily.html index ae7534c..878ce47 100644 --- a/posts/algorithms/leetcode-daily.html +++ b/posts/algorithms/leetcode-daily.html @@ -38,16 +38,14 @@

    Leetcode Daily

    -
    -

    - count the number of fair pairs - — 9/13/24 -

    -
    +

    + count the number of fair pairs + — 9/13/24 +

    problem statement

    @@ -238,16 +236,14 @@

    Space Complexity: \(\Theta(1)\) for both.

    -
    -

    - most beautiful item for each query - — 9/12/24 -

    -
    +

    + most beautiful item for each query + — 9/12/24 +

    problem statement

    @@ -373,16 +369,14 @@ \(m\)/\(n\) respectively.

    - +

    + shortest subarray with or at least k ii + — 9/11/24 +

    problem statement

    @@ -555,16 +549,14 @@ OR.

    -
    -

    - minimum array end - — 9/10/24 -

    -
    +

    + minimum array end + — 9/10/24 +

    -

    romer-solow

    +

    romer-solow

    -

    introduction

    +

    introduction

    While the Romer Model provides an avenue for long-run economic @@ -601,7 +597,7 @@

-

solving the model

+

solving the model

Based on the the motivations for creating this model, it is more @@ -657,7 +653,7 @@ Y_t^*={(A_0(1+\bar{z}\bar{l}\bar{L})^t})^\frac{1}{1-\alpha}(\frac{\bar{s}}{\frac{\bar{z}\bar{l}\bar{L}}{1-\alpha}+\bar{d}})^\frac{\alpha}{1-\alpha}(1-\bar{l})\bar{L}\]

-

analysis

+

analysis

First looking at the growth rate of output, diff --git a/scripts/invalidate.sh b/scripts/invalidate.sh deleted file mode 100755 index 4183f79..0000000 --- a/scripts/invalidate.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -[ "$#" -lt 1 ] && echo "Usage: $0 [path2 ...]" && exit 1 - -DISTRIBUTION_ID="$1" - -shift - -aws cloudfront create-invalidation --distribution-id "$DISTRIBUTION_ID" --paths "$*" diff --git a/scripts/post.js b/scripts/post.js index f55cabe..7d3d4d6 100644 --- a/scripts/post.js +++ b/scripts/post.js @@ -8,28 +8,6 @@ const tagToHeader = new Map([ ["H3", "##"], ]); -const makeFold = (h, i) => { - const toggle = document.createElement("span"); - toggle.style.fontStyle = "normal"; - toggle.textContent = ">"; - - // only unfold first algorithm problem - if (urlToTopic() === "algorithms" && i === 0) toggle.textContent = "v"; - - h.parentElement.nextElementSibling.style.display = - toggle.textContent === ">" ? "none" : "block"; - h.parentE; - toggle.classList.add("fold-toggle"); - toggle.addEventListener("click", () => { - const content = h.parentElement.nextElementSibling; - toggle.textContent = toggle.textContent === ">" ? "v" : ">"; - content.style.display = toggle.textContent === ">" ? "none" : "block"; - }); - toggle.style.color = getTopicColor(urlToTopic()); - - h.prepend(toggle); -}; - const setStyle = (h) => { const mdHeading = document.createElement("span"); const header = tagToHeader.has(h.tagName) ? tagToHeader.get(h.tagName) : ""; @@ -41,6 +19,4 @@ const setStyle = (h) => { document.addEventListener("DOMContentLoaded", () => { document.querySelectorAll(".post-article h2").forEach(setStyle); document.querySelectorAll(".post-article h3").forEach(setStyle); - document.querySelectorAll(".fold h2").forEach(makeFold); - document.querySelectorAll(".fold h3").forEach(makeFold); }); diff --git a/styles/index.css b/styles/index.css index 47e70a4..a4f1480 100644 --- a/styles/index.css +++ b/styles/index.css @@ -57,7 +57,6 @@ ul { } .post { - font-style: italic; margin-bottom: 25px; } diff --git a/styles/post.css b/styles/post.css index 8cc5540..8c558d1 100644 --- a/styles/post.css +++ b/styles/post.css @@ -77,7 +77,6 @@ li { .post-article h2 { font-weight: normal; - font-style: italic; } .post-article h3 { @@ -98,14 +97,3 @@ li { /* override prism.js styles */ font-size: 0.85em !important; } - -.fold { - position: relative; -} - -.fold-toggle { - font-family: monospace; - position: absolute; - cursor: pointer; - left: -25px; -}