Skip to content

Commit aad4ba5

Browse files
committed
Spelling fixes
1 parent 0262e51 commit aad4ba5

9 files changed

Lines changed: 63 additions & 63 deletions

File tree

src/blog/2021-07-03-mocking-in-jest-with-typescript-and-react/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ import { ThirdPartyWidget } from "third-party-library";
324324

325325
jest.mock("third-party-library");
326326

327-
describe("User copmonent", () => {
327+
describe("User component", () => {
328328
const mockThirdPartyWidget = ThirdPartyWidget as jest.MockedFunction<
329329
typeof ThirdPartyWidget
330330
>;

src/blog/2021-10-09-eslint-vs-prettier/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ But automated tools do still provide value.
2121

2222
## The Good News
2323

24-
Rice's Theorem makes a distinction between _syntatic_ and _semantic_ properties of programs. Roughly speaking _syntactic_ is "how it is written", whereas _semantic_ is "how it behaves".
24+
Rice's Theorem makes a distinction between _syntactic_ and _semantic_ properties of programs. Roughly speaking _syntactic_ is "how it is written", whereas _semantic_ is "how it behaves".
2525

2626
Most syntactic problems can be trivially identified and fixed. The most well-known of these are things like indentation and linebreaks. These things do not affect the _behavior_ of the program, but do create a consistent _syntactic_ standard for programmers.
2727

src/blog/2021-12-04-react-testing-library-recipes/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ In this test suite, we simulate two different cases, one in which the API reject
194194

195195
- `getBy*` verifies that something is rendered.
196196
- `queryBy*` can be used to verify that something is _not_ rendered.
197-
- `findyBy*` verifies that something is _eventually_ rendered.
197+
- `findBy*` verifies that something is _eventually_ rendered.
198198
- Prefer `*ByRole` wherever possible to encourage the use of semantic HTML and better accessibility.
199199
- Use the companion library [testing-library/user-event](https://github.com/testing-library/user-event) to simulate realistic user actions.
200200

src/blog/2022-01-03-what-is-a-number/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ To demonstrate this, consider the following numbers:
146146
- Mantissa: 1.11
147147
- Exponent: -11
148148

149-
This format has the advantage of being very flexible in accomodating both very large and very small numbers. It is called `Floating Point` because the _point_ in the number can _float_ up or down to wherever the first leading bit will be, e.g. in the last example we _float_ the point down by three places by using a -3 exponent. Now let's consider what happens when we try to evaluate the expression:
149+
This format has the advantage of being very flexible in accommodating both very large and very small numbers. It is called `Floating Point` because the _point_ in the number can _float_ up or down to wherever the first leading bit will be, e.g. in the last example we _float_ the point down by three places by using a -3 exponent. Now let's consider what happens when we try to evaluate the expression:
150150

151151
`0.1 * 0.2`
152152

src/blog/2022-08-13-simulating-dice/index.md

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -110,36 +110,36 @@ See below for an implementation of this process in TypeScript.
110110
const d = (n: number) => Math.floor(n * Math.random()) + 1;
111111

112112
const produceOneResult = (n: number, repeatCount: number) => {
113-
const rollResults = new Array(repeatCount).fill(0).map(() => d(n));
113+
const rollResults = new Array(repeatCount).fill(0).map(() => d(n));
114114

115-
// This reads the results as a single number in base `n`
116-
const result = rollResults
117-
.map((roll, i) => (roll - 1) * n ** (repeatCount - i - 1))
118-
.reduce((a, b) => a + b, 0);
115+
// This reads the results as a single number in base `n`
116+
const result = rollResults
117+
.map((roll, i) => (roll - 1) * n ** (repeatCount - i - 1))
118+
.reduce((a, b) => a + b, 0);
119119

120-
return result;
120+
return result;
121121
};
122122

123123
/**
124124
* Given a `dn`, simulate the outcomes of a `dm`
125125
*/
126126
const simulateMwithN = (m: number, n: number) => {
127-
/**
128-
* `repeatCount` is the number of times we will need to roll the smaller die.
129-
*/
130-
const repeatCount = Math.ceil(Math.log(m) / Math.log(n));
131-
/**
132-
* The maximum valid result is the largest multiple of n that is
133-
* less than or equal to the size of our target space
134-
*/
135-
const maxValidResult = Math.floor(n ** repeatCount / m) * m - 1;
136-
137-
let result: number;
138-
do {
139-
result = produceOneResult(n, repeatCount);
140-
} while (result > maxValidResult);
141-
142-
return (result % m) + 1;
127+
/**
128+
* `repeatCount` is the number of times we will need to roll the smaller die.
129+
*/
130+
const repeatCount = Math.ceil(Math.log(m) / Math.log(n));
131+
/**
132+
* The maximum valid result is the largest multiple of n that is
133+
* less than or equal to the size of our target space
134+
*/
135+
const maxValidResult = Math.floor(n ** repeatCount / m) * m - 1;
136+
137+
let result: number;
138+
do {
139+
result = produceOneResult(n, repeatCount);
140+
} while (result > maxValidResult);
141+
142+
return (result % m) + 1;
143143
};
144144

145145
simulateMwithN(6, 4);
@@ -192,72 +192,72 @@ const d = (n: number) => Math.floor(n * Math.random()) + 1;
192192
* Then given some `n` on the unit interval, output which segment of `m` it belongs to.
193193
*/
194194
const fromUnitNtoSegmentsM = (m: number) => (n: number) => {
195-
if (n === 0) return 1;
196-
return Math.ceil(n * m);
195+
if (n === 0) return 1;
196+
return Math.ceil(n * m);
197197
};
198198

199199
/**
200200
* Given a die, map a single result to the unit interval
201201
*/
202202
const fromDNtoInterval = (n: number) => {
203-
const dieResult = d(n);
203+
const dieResult = d(n);
204204

205-
const lowerBound = (dieResult - 1) * (1 / n);
206-
const upperBound = lowerBound + 1 / n;
205+
const lowerBound = (dieResult - 1) * (1 / n);
206+
const upperBound = lowerBound + 1 / n;
207207

208-
return [lowerBound, upperBound];
208+
return [lowerBound, upperBound];
209209
};
210210

211211
/**
212212
* Given an interval and a die size,
213213
* narrow the interval using a single role of the die
214214
*/
215215
const narrowIntervalWithDN =
216-
(n: number) =>
217-
(interval: Interval): Interval => {
218-
// This generates a new unit interval
219-
const [innerLower, innerUpper] = fromDNtoInterval(n);
216+
(n: number) =>
217+
(interval: Interval): Interval => {
218+
// This generates a new unit interval
219+
const [innerLower, innerUpper] = fromDNtoInterval(n);
220220

221-
// But we need to map it into our existing interval
222-
const currentIntervalSize = interval[1] - interval[0];
223-
const newLowerBound = interval[0] + innerLower * currentIntervalSize;
224-
const newUpperBound = interval[0] + innerUpper * currentIntervalSize;
221+
// But we need to map it into our existing interval
222+
const currentIntervalSize = interval[1] - interval[0];
223+
const newLowerBound = interval[0] + innerLower * currentIntervalSize;
224+
const newUpperBound = interval[0] + innerUpper * currentIntervalSize;
225225

226-
return [newLowerBound, newUpperBound];
227-
};
226+
return [newLowerBound, newUpperBound];
227+
};
228228

229229
/**
230230
* Given a `dn`, simulate the outcomes of a `dm`
231231
*/
232232
const simulateMwithN = (m: number, n: number) => {
233-
// We'll use a tuple to track a range on the unit interval
234-
let interval: Interval = [0, 1];
233+
// We'll use a tuple to track a range on the unit interval
234+
let interval: Interval = [0, 1];
235235

236-
const mapToDM = fromUnitNtoSegmentsM(m);
237-
const mapFromDN = narrowIntervalWithDN(n);
236+
const mapToDM = fromUnitNtoSegmentsM(m);
237+
const mapFromDN = narrowIntervalWithDN(n);
238238

239-
// In this loop we repeatedly narrow our output interval
240-
// Until its lower and upper bounds fit within the same segment of `dm`
241-
while (mapToDM(interval[0]) !== mapToDM(interval[1])) {
242-
interval = mapFromDN(interval);
243-
}
239+
// In this loop we repeatedly narrow our output interval
240+
// Until its lower and upper bounds fit within the same segment of `dm`
241+
while (mapToDM(interval[0]) !== mapToDM(interval[1])) {
242+
interval = mapFromDN(interval);
243+
}
244244

245-
return mapToDM(interval[0]);
245+
return mapToDM(interval[0]);
246246
};
247247

248248
/**
249249
* A test of the distribution of a simulated dice
250250
*
251251
* Outputs a record where each key is a die result,
252-
* and each value is how often that result occured
252+
* and each value is how often that result occurred
253253
*/
254254
const test = new Array(10000)
255-
.fill(0)
256-
.map(() => simulateMwithN(6, 4))
257-
.reduce<Record<number, number>>(
258-
(acc, curr) => ({ ...acc, [curr]: (acc[curr] ?? 0) + 1 }),
259-
{}
260-
);
255+
.fill(0)
256+
.map(() => simulateMwithN(6, 4))
257+
.reduce<Record<number, number>>(
258+
(acc, curr) => ({ ...acc, [curr]: (acc[curr] ?? 0) + 1 }),
259+
{},
260+
);
261261

262262
/**
263263
* If the test is successful, each value should be roughly equal

src/blog/2022-11-21-langtons-ant-and-unanswerable-questions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ We might have guessed that this chaos would proceed forever. But then at around
3737

3838
The Ant has begun to build a structure known as the highway. The highway is an infinitely repeating pattern. It takes the ant 104 steps for each iteration of the highway, and each iteration extends the pattern along a diagonal trajectory.
3939

40-
But we can change things. Instead of starting with a blank grid, we could set some cells to black at the begginning. If we then run the Ant it will generate different patterns. When people try this, they find that the highway _always seems to emerge sooner or later_. It is widely believed that the highway is inevitable, and yet this conjecture has never been proven nor disproven, despite many years of effort.
40+
But we can change things. Instead of starting with a blank grid, we could set some cells to black at the beginning. If we then run the Ant it will generate different patterns. When people try this, they find that the highway _always seems to emerge sooner or later_. It is widely believed that the highway is inevitable, and yet this conjecture has never been proven nor disproven, despite many years of effort.
4141

4242
Such a simple system to define, and yet we are unable to answer the question "Does the highway always appear, no matter the starting state?"
4343

src/blog/2023-09-23-the-skull/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ So there it was. A skull.
2121

2222
No one else wanted it. They ummed and ahhed. It couldn't possibly be thrown away, but no one had the stomach to keep it. I had been respectfully silent all day. I'm not a blood relative after all, and was only there as a spare pair of hands. But finally I suggested that I could take it. To my surprise no one disagreed.
2323

24-
Since then the skull has stayed with me. First I had I took it in hand luggage to England, and then it travelled with me again when I moved to the Netherlands permanantly. On both occasions I did not declare it and security never seemed to notice it.
24+
Since then the skull has stayed with me. First I had I took it in hand luggage to England, and then it travelled with me again when I moved to the Netherlands permanently. On both occasions I did not declare it and security never seemed to notice it.
2525

2626
The skull still sits on my shelf. Some nights before I go to bed, I'll rest my hand on the crown. I'm not sure what I intend by this. But I have this almost desperate sense of wanting to understand what it means for this artefact to represent the remains of a human story. I know nothing about this story. I do not know the skull's age, gender or origin. But as I rest my hand on the crown, I will sometimes rest my other hand on my own head. In that moment I try to capture the feeling that I'm just a big bag of bones. That my two hands contain only superficially different contents. Somehow this calms me. I sleep easier when I can clear my mind of the day to day.

src/blog/2024-03-24-death/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The call was put out to all friends and family, _this is it, come say your goodb
7070
> Spoke to mum in private on one occasion (you cant speak with, only to) and cried alot. Becky came back down late in the day and Dad came.
7171
> I’ve been at the hospital since 10 and up til now. (12 hours) Toni and Simon are staying the night with mum.
7272
73-
I remember speaking to her that day. I was left alone in the room with her. I told her about school, and my saxophone lessons. I tried to keep talking, because I was afraid of what would happen when I ran out of things to say. But I didn't know what to say. I couldn't bare my own silence. But I couldn't bare to leave the room either. I needed someone to come in and relieve me from having to confront this reality. Eventually, with great guilt I left the room, just briefly to tell the others in the waiting room, that someone else should go be with her now. Immediately afterwards I stepped to one side in the corridoor, and weeped facing the wall. I couldn't see through my own hands and tears. But an anonymous nurse slipped in to hug me. I never saw their face. In that moment they were literally just a shoulder that I cried into. I owe them so much for that moment in which I was able to sob. Neither of us said a word during. I hope I at least mumbled a "thank you" afterwards, but I don't remember.
73+
I remember speaking to her that day. I was left alone in the room with her. I told her about school, and my saxophone lessons. I tried to keep talking, because I was afraid of what would happen when I ran out of things to say. But I didn't know what to say. I couldn't bare my own silence. But I couldn't bare to leave the room either. I needed someone to come in and relieve me from having to confront this reality. Eventually, with great guilt I left the room, just briefly to tell the others in the waiting room, that someone else should go be with her now. Immediately afterwards I stepped to one side in the corridor, and wept facing the wall. I couldn't see through my own hands and tears. But an anonymous nurse slipped in to hug me. I never saw their face. In that moment they were literally just a shoulder that I cried into. I owe them so much for that moment in which I was able to sob. Neither of us said a word during. I hope I at least mumbled a "thank you" afterwards, but I don't remember.
7474

7575
> 9th of November 2005 Wednesday 03:03
7676
>

src/landingpage/index.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ description: Explore interactive coding projects including Boids artificial life
2020
<p>
2121
An implementation of an artificial life program, first developed in the
2222
1980s. In brief, just three simple rules lead to intelligent flocking
23-
behaviour. Implemented all my own tooling from the groundup, including
23+
behaviour. Implemented all my own tooling from the ground up, including
2424
vector algebra and dynamic frame loop adjustments.
2525
</p>
2626
</article>

0 commit comments

Comments
 (0)