Add mathjax support

This commit is contained in:
Tyler 2024-12-21 19:17:40 -05:00
parent ba415b1af9
commit 3a21f34035
Signed by: tyler
GPG Key ID: 03B27509E17EFDC8
7 changed files with 74 additions and 35 deletions

View File

@ -1,7 +0,0 @@
baseURL = 'http://tylerperkins.xyx'
languageCode = 'en-us'
LanguageCode = 'en-us'
title = 'Tylers Website'
theme = "clortox"
[author]
name = 'Tyler'

21
config.yaml Normal file
View File

@ -0,0 +1,21 @@
baseURL: 'http://tylerperkins.xyx'
languageCode: 'en-us'
LanguageCode: 'en-us'
title: 'Tylers Website'
theme: "clortox"
markup:
goldmark:
extensions:
passthrough:
delimiters:
block:
- - \[
- \]
- - $$
- $$
inline:
- - \(
- \)
enable: true
params:
math: true

View File

@ -13,18 +13,20 @@ neat enough to talk about here. So through next few minutes, we will work up the
So why do we need any kind of special clock? Why won't a normal clock do? So why do we need any kind of special clock? Why won't a normal clock do?
Big surprise, but time is hard to keep. [Like really hard](https://en.wikipedia.org/wiki/History_of_timekeeping_devices). Big surprise, but time is hard to keep. [Like really hard](https://en.wikipedia.org/wiki/History_of_timekeeping_devices).
Therefore, in a large distributed system (of possibly tens, or hundreds of machines), we really don't want to try and keep all clocks in sync. Therefore, in a large distributed system (of possibly tens, or hundreds of machines), we really don't want to try and keep all clocks in sync.
Especially in the case of computer systems, where events happen on the scale of milliseconds down to microseconds or less. Given we are talking about computer systems, where events happen on the scale of milliseconds down to microseconds or less, makes precision especially important.
So lets just abandon the concept of real time all together. What is we instead use *logical time*? So lets just abandon the concept of real time all together. What is we instead use *logical time*?
*Logical Time* is a mechanism for determining the ordering of events, without the use of a real clock. So think of it more as a timer. *Logical Time* is a mechanism for determining the ordering of events, without the use of a real clock. So think of it more as a timer.
For example, event 1 happens *before* event 2. Simple enough, right? For example, event 1 happens *before* event 2. Simple enough, right?
We can be more formal and define a *Logical Clock* as some function, lets call it C(), that creates a *time stamp* that preserves this order. We can be more formal and define a *Logical Clock* as some function, lets call it \(C()\), that creates a *time stamp* that preserves this order.
So for a set of events e1 and e2, where e1 happened *before* e2, So for a set of events \(e1\) and \(e2\), where \(e1\) happened *before* \(e2\),
e1 -> e2 ==> C(e1) < C(e2) $$
e_1 \rightarrow e_2 \implies C(e_1) < C(e_2)
$$
(In case you haven't seem them before, '->' encapsulates that e1 happens first, then e2, while '==>' means implies). (In case you haven't seem them before, \(\rightarrow\) encapsulates that \(e_1\) happens first, then \(e_2\), while \(\implies\) means implies).
So our *Logical Clock* is a kind of function. A simple function that could do this, in java for example, would be, So our *Logical Clock* is a kind of function. A simple function that could do this, in java for example, would be,
@ -54,7 +56,9 @@ we just used real clocks instead! Therefore, we need to define a sense of *consi
A *Logical Clock* is said to be *consistent* if, A *Logical Clock* is said to be *consistent* if,
e1 -> e2 ==> C(e1) < C(e2) $$
e_1 \rightarrow e_2 \implies C(e_1) < C(e_2)
$$
This is exactly what we stated in the earlier section! This is because logical clocks are really only useful if they are at least *consistent*. This is exactly what we stated in the earlier section! This is because logical clocks are really only useful if they are at least *consistent*.
@ -74,7 +78,9 @@ This is exactly what we stated in the earlier section! This is because logical c
A *Logical Clock* that is *strongly consistent* is one where we can determine causality just from the timestamps alone, A *Logical Clock* that is *strongly consistent* is one where we can determine causality just from the timestamps alone,
C(e1) < C(e2) ==> e1 -> e2 $$
C(e_1) < C(e_2) \implies e_1 \rightarrow e_2
$$
A synchronous clock like the one we defined above is also *strongly consistent*, however this attribute is much harder to maintain in a distributed context. A synchronous clock like the one we defined above is also *strongly consistent*, however this attribute is much harder to maintain in a distributed context.
@ -84,11 +90,13 @@ A *Lamport Clock* is a type of *Logical Clock*, that guarantees *consistency*, b
we make each one of our timestamps a simple increment for the case of a single process/node generating events. Things get slightly more complex when we introduce we make each one of our timestamps a simple increment for the case of a single process/node generating events. Things get slightly more complex when we introduce
other processes. other processes.
If some process *pi* receives a message from *pj*, and it has some time stamp, called *t*, we set the time stamp of *pj* to be, If some process \(p_i\) receives a message from \(p_j\), and it has some time stamp, called \(t\), we set the time stamp of \(p_j\) to be,
MAX(time at *pj* + 1, *t* + 1) $$
\max(\text{time at} \ p_j, t + 1)
$$
This *guarantees* that the time at *pj* will be greater, ensuring that the timestamp both at *pj* is always larger, which means all things that happened before This *guarantees* that the time at \(p_j\) will be greater, ensuring that the timestamp both at \(p_j\) is always larger, which means all things that happened before
receiving this message (at least on the scale of this node), have smaller timestamps. Take a moment to convince yourself of this. receiving this message (at least on the scale of this node), have smaller timestamps. Take a moment to convince yourself of this.
This is an interesting concept, because by only adding some ever growing integer, we can determine some order to our events. This is going to grow into something far This is an interesting concept, because by only adding some ever growing integer, we can determine some order to our events. This is going to grow into something far

View File

@ -2,7 +2,7 @@
"About": { "About": {
"Content": [ "Content": [
{ {
"value": "Software developer with a passion for literally just about everything." "value": "Software developer with a passion for learning everything."
}, },
{ {
"value": "Employed as a full stack developer at Etactics Inc, with a focus on back end development and system architecture." "value": "Employed as a full stack developer at Etactics Inc, with a focus on back end development and system architecture."
@ -11,7 +11,7 @@
"value": "Aspiring polymath; Jack of all trades, master of few." "value": "Aspiring polymath; Jack of all trades, master of few."
}, },
{ {
"value": "Passion for software design, low level systems, and hyper-technical minute details. Love reading an RFC proposal to unwind for the night, or to start my day with my current textbook of choice." "value": "Passion for software design and architecture, pure math, and all forms of engineering."
}, },
{ {
"value": "Currently persuing a Masters in Computer Science at Georgia Tech." "value": "Currently persuing a Masters in Computer Science at Georgia Tech."
@ -22,23 +22,23 @@
"value": "Software Architecture" "value": "Software Architecture"
}, },
{ {
"value": "Web Development" "value": "Embedded Systems"
}, },
{ {
"value": "Welding" "value": "Computer Engineering"
}, },
{ {
"value": "Woodworking" "value": "Mechanical Engineering"
}, },
{ {
"value": "Aviation" "value": "Control Systems"
},
{
"value": "Fabrication (Welding, Woodworking, 3D Printing, Laser Cutting)"
}, },
{ {
"value": "Cars and Small Engines" "value": "Cars and Small Engines"
}, },
{
"value": "Philosophy"
},
{ {
"value": "Ham Radio (CQCQCQ KE8TIZ QRK?)" "value": "Ham Radio (CQCQCQ KE8TIZ QRK?)"
}, },
@ -51,9 +51,6 @@
{ {
"value": "Firearms" "value": "Firearms"
}, },
{
"value": "Coffee"
},
{ {
"value": "Botany" "value": "Botany"
}, },
@ -61,10 +58,7 @@
"value": "Homesteading" "value": "Homesteading"
}, },
{ {
"value": "Embedded Systems" "value": "Philosophy"
},
{
"value": "Computer Engineering"
} }
] ]
} }

View File

@ -3,7 +3,7 @@
<div class="intro-content"> <div class="intro-content">
<h1 data-value="Hi, I'm Tyler" data-show="intro-tagline" class="typewriter"></h1> <h1 data-value="Hi, I'm Tyler" data-show="intro-tagline" class="typewriter"></h1>
<div id="intro-tagline"> <div id="intro-tagline">
<p data-value="Software engineer, polymath"></p> <p data-value="Software engineer, aspiring polymath"></p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,18 @@
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<script>
MathJax = {
tex: {
displayMath: [['\\[', '\\]'], ['$$', '$$']], // block
inlineMath: [['\\(', '\\)']] // inline
},
chtml: {
scale: 1.2
}
};
</script>
<style>
.MathJax, .mjx-math {
color: white;
}
</style>

View File

@ -10,5 +10,10 @@
{{ range .AlternativeOutputFormats -}} {{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}} {{ end -}}
{{ if .Param "math" }}
{{ partialCached "math.html" . }}
{{ end }}
<title>Tylers Perkins - Software Engineer</title> <title>Tylers Perkins - Software Engineer</title>
</head> </head>