feat(posts): remove folds

This commit is contained in:
Barrett Ruth 2024-11-29 19:38:44 -06:00
parent 0e6cc1de7a
commit ed0c3b7ab2
8 changed files with 49 additions and 111 deletions

View file

@ -157,9 +157,7 @@ private:
size_t capacity; size_t capacity;
};</code></pre> };</code></pre>
</div> </div>
<div class="fold"> <h3>optimizing the approach</h3>
<h3>optimizing the approach</h3>
</div>
<div class="problem-content"> <div class="problem-content">
<p> <p>
Rather than bear the brunt of the work finding extrema in calls to Rather than bear the brunt of the work finding extrema in calls to
@ -246,9 +244,7 @@ private:
size_t capacity; size_t capacity;
};</code></pre> };</code></pre>
</div> </div>
<div class="fold"> <h3>monotonic <s>queues</s> deques</h3>
<h3>monotonic <s>queues</s> deques</h3>
</div>
<div class="problem-content"> <div class="problem-content">
<p> <p>
Thinking a bit deeper about the problem constraints, it is clear Thinking a bit deeper about the problem constraints, it is clear
@ -370,7 +366,7 @@ private:
std::deque&lt;std::pair&lt;double, size_t&gt;&gt; maxs; std::deque&lt;std::pair&lt;double, size_t&gt;&gt; maxs;
size_t capacity; size_t capacity;
};</code></pre> };</code></pre>
<div class="fold"><h3>further improvements</h3></div> <h3>further improvements</h3>
<ol> <ol>
<li> <li>
While the final approach is <i>theoretically</i> faster than the While the final approach is <i>theoretically</i> faster than the

View file

@ -38,16 +38,14 @@
<h1 class="post-title">Leetcode Daily</h1> <h1 class="post-title">Leetcode Daily</h1>
</header> </header>
<article class="post-article"> <article class="post-article">
<div class="fold"> <h2>
<h2> <a
<a target="blank"
target="blank" href="https://leetcode.com/problems/count-the-number-of-fair-pairs/"
href="https://leetcode.com/problems/count-the-number-of-fair-pairs/" >count the number of fair pairs</a
>count the number of fair pairs</a >
> &mdash; 9/13/24
&mdash; 9/13/24 </h2>
</h2>
</div>
<div class="problem-content"> <div class="problem-content">
<h3>problem statement</h3> <h3>problem statement</h3>
<p> <p>
@ -238,16 +236,14 @@
</p> </p>
<p><u>Space Complexity</u>: \(\Theta(1)\) for both.</p> <p><u>Space Complexity</u>: \(\Theta(1)\) for both.</p>
</div> </div>
<div class="fold"> <h2>
<h2> <a
<a target="blank"
target="blank" href="https://leetcode.com/problems/most-beautiful-item-for-each-query/description/"
href="https://leetcode.com/problems/most-beautiful-item-for-each-query/description/" >most beautiful item for each query</a
>most beautiful item for each query</a >
> &mdash; 9/12/24
&mdash; 9/12/24 </h2>
</h2>
</div>
<div class="problem-content"> <div class="problem-content">
<h3>problem statement</h3> <h3>problem statement</h3>
<p> <p>
@ -373,16 +369,14 @@
\(m\)/\(n\) respectively. \(m\)/\(n\) respectively.
</p> </p>
</div> </div>
<div class="fold"> <h2>
<h2> <a
<a target="blank"
target="blank" href="https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-ii/description/"
href="https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-ii/description/" >shortest subarray with or at least k ii</a
>shortest subarray with or at least k ii</a >
> &mdash; 9/11/24
&mdash; 9/11/24 </h2>
</h2>
</div>
<div class="problem-content"> <div class="problem-content">
<h3>problem statement</h3> <h3>problem statement</h3>
<p> <p>
@ -555,16 +549,14 @@
OR. OR.
</p> </p>
</div> </div>
<div class="fold"> <h2>
<h2> <a
<a target="blank"
target="blank" href="https://leetcode.com/problems/minimum-array-end/"
href="https://leetcode.com/problems/minimum-array-end/" >minimum array end</a
>minimum array end</a >
> &mdash; 9/10/24
&mdash; 9/10/24 </h2>
</h2>
</div>
<div class="problem-content"> <div class="problem-content">
<h3>problem statement</h3> <h3>problem statement</h3>
<p> <p>

View file

@ -42,7 +42,7 @@
</header> </header>
<article class="post-article"> <article class="post-article">
<h2>technique overview</h2> <h2>technique overview</h2>
<div class="fold"> <div>
<h3> <h3>
<a <a
target="blank" target="blank"
@ -91,7 +91,7 @@
return ans</code></pre> return ans</code></pre>
</div> </div>
</div> </div>
<div class="fold"> <div>
<h3> <h3>
<a <a
target="blank" target="blank"

View file

@ -53,9 +53,9 @@
in Intermediate Macroeconomics (ECON 3020) during the Spring in Intermediate Macroeconomics (ECON 3020) during the Spring
semester of 2024 at the University of Virginia. semester of 2024 at the University of Virginia.
</p> </p>
<div class="fold"><h2>solow</h2></div> <h2>solow</h2>
<div> <div>
<div class="fold"><h3>introduction</h3></div> <h3>introduction</h3>
<div> <div>
<p> <p>
The Solow Model is an economic model of production that The Solow Model is an economic model of production that
@ -118,9 +118,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="fold"> <h3>solving the model</h3>
<h3>solving the model</h3>
</div>
<div> <div>
<p> <p>
Visualizing the model, namely output as a function of capital, Visualizing the model, namely output as a function of capital,
@ -225,9 +223,7 @@
\bar{A}^\frac{1}{1-\alpha}(\frac{\bar{s}}{\bar{d}})^\frac{\alpha}{1-\alpha})\] \bar{A}^\frac{1}{1-\alpha}(\frac{\bar{s}}{\bar{d}})^\frac{\alpha}{1-\alpha})\]
</p> </p>
</div> </div>
<div class="fold"> <h3>analysis</h3>
<h3>analysis</h3>
</div>
<div> <div>
<p> <p>
Using both mathematical intuition and manipulating the Using both mathematical intuition and manipulating the
@ -280,9 +276,9 @@
</p> </p>
</div> </div>
</div> </div>
<div class="fold"><h2>romer</h2></div> <h2>romer</h2>
<div> <div>
<div class="fold"><h3>introduction</h3></div> <h3>introduction</h3>
<div> <div>
<p>How, then, can we address these shortcomings?</p> <p>How, then, can we address these shortcomings?</p>
<p> <p>
@ -454,7 +450,7 @@
</table> </table>
</div> </div>
</div> </div>
<div class="fold"><h3>solving the model</h3></div> <h3>solving the model</h3>
<div> <div>
<p> <p>
To find the output in terms of exogenous parameters, first note To find the output in terms of exogenous parameters, first note
@ -474,7 +470,7 @@
L_{yt}=A_0(1+\bar{z}\bar{l}\bar{L})^t(1-\bar{l})\bar{L}\] L_{yt}=A_0(1+\bar{z}\bar{l}\bar{L})^t(1-\bar{l})\bar{L}\]
</p> </p>
</div> </div>
<div class="fold"><h3>analysis</h3></div> <h3>analysis</h3>
<div> <div>
<p> <p>
We see the Romer model exhibits long-run growth because ideas We see the Romer model exhibits long-run growth because ideas
@ -550,9 +546,9 @@
</p> </p>
</div> </div>
</div> </div>
<div class="fold"><h2>romer-solow</h2></div> <h2>romer-solow</h2>
<div> <div>
<div class="fold"><h3>introduction</h3></div> <h3>introduction</h3>
<div> <div>
<p> <p>
While the Romer Model provides an avenue for long-run economic While the Romer Model provides an avenue for long-run economic
@ -601,7 +597,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="fold"><h3>solving the model</h3></div> <h3>solving the model</h3>
<div> <div>
<p> <p>
Based on the the motivations for creating this model, it is more 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}\] 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}\]
</p> </p>
</div> </div>
<div class="fold"><h3>analysis</h3></div> <h3>analysis</h3>
<div> <div>
<p> <p>
First looking at the growth rate of output, First looking at the growth rate of output,

View file

@ -1,9 +0,0 @@
#!/bin/sh
[ "$#" -lt 1 ] && echo "Usage: $0 <distribution-id> <path1> [path2 ...]" && exit 1
DISTRIBUTION_ID="$1"
shift
aws cloudfront create-invalidation --distribution-id "$DISTRIBUTION_ID" --paths "$*"

View file

@ -8,28 +8,6 @@ const tagToHeader = new Map([
["H3", "##"], ["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 setStyle = (h) => {
const mdHeading = document.createElement("span"); const mdHeading = document.createElement("span");
const header = tagToHeader.has(h.tagName) ? tagToHeader.get(h.tagName) : ""; const header = tagToHeader.has(h.tagName) ? tagToHeader.get(h.tagName) : "";
@ -41,6 +19,4 @@ const setStyle = (h) => {
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll(".post-article h2").forEach(setStyle); document.querySelectorAll(".post-article h2").forEach(setStyle);
document.querySelectorAll(".post-article h3").forEach(setStyle); document.querySelectorAll(".post-article h3").forEach(setStyle);
document.querySelectorAll(".fold h2").forEach(makeFold);
document.querySelectorAll(".fold h3").forEach(makeFold);
}); });

View file

@ -57,7 +57,6 @@ ul {
} }
.post { .post {
font-style: italic;
margin-bottom: 25px; margin-bottom: 25px;
} }

View file

@ -77,7 +77,6 @@ li {
.post-article h2 { .post-article h2 {
font-weight: normal; font-weight: normal;
font-style: italic;
} }
.post-article h3 { .post-article h3 {
@ -98,14 +97,3 @@ li {
/* override prism.js styles */ /* override prism.js styles */
font-size: 0.85em !important; font-size: 0.85em !important;
} }
.fold {
position: relative;
}
.fold-toggle {
font-family: monospace;
position: absolute;
cursor: pointer;
left: -25px;
}