Browse Source

copyediting, typesetting, and rethemeing, 2021 edition

nora.codes
Leonora Tindall 9 months ago
parent
commit
4763ed1a04
Signed by: nora GPG Key ID: 7A8B52EC67E09AAF
  1. 3
      content/post/improved_user_interface_0.3.0.md
  2. 17
      content/tutorial/A-Gentle-Introduction-To-Practical-Types.md
  3. 2
      content/tutorial/Locking-Down-Firefox.md
  4. 1
      content/tutorial/additional-exercises-in-reverse-engineering.md
  5. 5
      content/tutorial/an-intro-to-x86_64-reverse-engineering.markdown
  6. 2
      content/tutorial/chaining_fallible_operations_with_combinators.md
  7. 7
      content/tutorial/piston-a-game-library-in-rust.markdown
  8. 15
      content/tutorial/rust-abstracting-the-fsm.markdown
  9. 16
      content/tutorial/using-enums-and-match-expressionsstatements.markdown
  10. 21
      themes/oaktrough/static/css/style.css

3
content/post/improved_user_interface_0.3.0.md

@ -22,5 +22,6 @@ I want to give a huge shoutout to several GitHub users who helped with the proje
From the project management side, we have a vastly improved README, a CONTRIBUTING guideline file, and have resolved to keep a changelog.
I'd like to extend a huge thank you to all my [patrons](https://patreon.com/noracodes) for keeping this ball rolling. I'm excited to see where we go from here.
I'd like to extend a huge thank you to all of y'all for keeping this ball rolling.
I'm excited to see where we go from here.

17
content/tutorial/A-Gentle-Introduction-To-Practical-Types.md

@ -190,22 +190,11 @@ IntegerListNode {
We do run into a bit of a problem, though, when looking at the size of this type. Clearly, the IntegerListNode type has as many possible values as a BoundedInteger times as many possible values as an IntegerListLink. We know that the BoundedInteger type has 2^65 values, but how many does IntegerListLink have? Well, it's the sum of 1 (for NoNextNode) plus... however many possible values IntegerListNode has! This list type is a type with infinitely many possible values, because the nesting of nodes and links can go on for arbitrarily long.
> **Sidebar: Representing Infinite Types in Real Computers**
>
> The property just described actually causes the Rust compiler (which sadly must exist in the real world) to reject this type as invalid, because it cannot generate a representation that would fit into a computer's memory. Because each node contains all subsequent nodes, and because one of the things that makes Rust programs fast is that values are, by default, allocated all at once, the compiler would have to ask the computer to allocate the _maximum number of nodes that could ever exist_. Since we didn't introduce any limit to the number of nodes, that would require an infinite amount of memory. This is where _indirection_ via pointers comes in; see the Rust Book[^rustbook] for more info.
>
> Any programming language that puts values on the stack by default will have this problem; for instance, C and Rust will require explicit indirection, while e.g. Python and Java do it for you, at a bit of a speed cost.
>
> The correct types look like this. Note the added `Box<...>` in the first variant of IntegerListLink; if you are unfamiliar with Rust, it is sufficient to know that this annotation tells the compiler to allocate some memory for the next IntegerListNode and store only the address of that memory inside the IntegerListLink.
> <pre><code class="rs">
struct IntegerListNode {
value: BoundedInteger,
link: IntegerListLink,
}
enum IntegerListLink {
HasNextNode(Box&lt;IntegerListNode&gt;),
NoNextNode,
}
></code></pre>
>
> It's important to remember that while the current Rust _implementation_ doesn't like this type, there's no reason that Rust as a _language_ can't handle it. It's a very useful type, and a good logical description of how linked lists work, even though we have to add some incantations to get them to work in the real world.
### Zero Sized or Single Value Types
@ -252,7 +241,7 @@ It's been a long journey. We've gone from nothing, through finite lists of possi
To help you in actually understanding how to use the type system of Rust specifically, I suggest the excellent Rust Book[^rustbook] and Sean Griffin's talk on the type system[^seangriffin] from RustConf 2017. Traits and lifetimes are the next topics I'd look into in order to develop a better understanding of how Rust leverages the type system to make guarantees about your programs. Most of these ideas are applicable to other languages, like TypeScript, Java, and of course OCaml-like and Haskell-like languages.
NOTE: The examples here will not compile on their own; I have elided `use` statements and other such language-specific constructs to make a point. Refer to the Rust Book for information on how to actually use the types.
> The examples here will not compile on their own; I have elided `use` statements and other such language-specific constructs to make a point. Refer to the Rust Book for information on how to actually use the types.
[^rustbook]: [The Rust Programming Language](https://doc.rust-lang.org/stable/book/), 2nd Edition, by S. Klabnik and C. Nichols. 2018. O'Reilly.
[^seangriffin]: [Type System Tips for the Real World](https://www.youtube.com/watch?v=wxPehGkoNOw), by Sean Griffin at RustConf 2017.

2
content/tutorial/Locking-Down-Firefox.md

@ -80,6 +80,6 @@ Search for the setting `privacy.firstparty.isolate` and go ahead and set it to `
## Done!
Congratulations! Your browser is now pretty dang difficult to track. If you have suggestions for more hardening methods, please contact me.
I'd like to give a shoutout to @david_ross@mastodon.social and @gemlog@mastodon.sdf.org for some suggestions I used here.
I'd like to give a shoutout to `@david_ross@mastodon.social` and `@gemlog@mastodon.sdf.org` for some suggestions I used here.
> Note: This post has been edited to correct errors in the spelling and description of operation of Decentraleyes and HTTPSEverywhere.

1
content/tutorial/additional-exercises-in-reverse-engineering.md

@ -207,4 +207,3 @@ This is the first of many crackmes that will have different solutions on differe
Thank you for reading this second tutorial! I hope it's been instructive. My next priority is to create some more real-world use cases, such as reverse engineering nontrivial C applications, looking at minified JavaScript, and doing some more in-depth dynamic analysis with GDB.
If you enjoyed these crackmes, please consider contributing to my Patreon! For those of you who are already patrons, thank you so much for supporting my work.

5
content/tutorial/an-intro-to-x86_64-reverse-engineering.markdown

@ -15,8 +15,6 @@ There are a lot of excellent tutorials out there, but they mostly focus on the 3
A CrackMe is an executable file which takes (typically) a single argument, does some check on it, and returns a message informing the user if it's correct or not. The challenge is to determine the correct argument _without_ looking at the source code. Here, I present some CrackMe programs which I wrote, and demonstrate how to arrive at their solutions.
If you enjoy this tutorial, please consider contributing to my [Patreon](https://www.patreon.com/noracodes) so I can make more like it.
# Prerequisites
## Knowledge
@ -872,4 +870,5 @@ The files named `crackme01e.c`, `crackme02e.c`, et cetera are modified versions
## Media
Saturday, Jan. 6, 2018: This tutorial was featured on Hackaday, which briefly brought down my server. Hi to all of you who make it here from there. Please consider checking out my other tutorials and, if you want more content like this to be created, contributing to my [Patreon](https://noracodes.com).
Saturday, Jan. 6, 2018: This tutorial was featured on Hackaday, which briefly brought down my server. Hi to all of you who make it here from there. Please consider checking out my other tutorials!

2
content/tutorial/chaining_fallible_operations_with_combinators.md

@ -170,5 +170,5 @@ Thanks for reading, and a huge thanks to [CUViper](https://www.reddit.com/r/rust
2. Design around fallibility. Pretending that fallible operations can't fail is a recipe for convoluted, type-weird code.
3. When a problem can't be solved at one level, step back and look a the level above it. I spent hours trying to work out the types for the `.collect::<>()` call when I should have reexamined the whole pipeline.
If you enjoyed this tutorial, you might like to read [more about Rust types](/tutorial/a-gentle-introduction-to-practical-types/), or perhaps learn how [session types](/tutorial/session-types/) can make your code better. Also, please consider supporting me on Patreon.
If you enjoyed this tutorial, you might like to read [more about Rust types](/tutorial/a-gentle-introduction-to-practical-types/), or perhaps learn how [session types](/tutorial/session-types/) can make your code better.

7
content/tutorial/piston-a-game-library-in-rust.markdown

@ -6,9 +6,14 @@ categories:
- Programming
- Rust
- Graphics
description: A comprehensive tutorial for a basic Piston 0.64 application which draws a spinning square on the screen.
---
I've been interested in game programming for a while, and I periodically sample the Rust ecosystem's offerings around game programming. Piston seems like the most promising candidate, but the tutorials are out of date, so here's a simple one. Last update: March 2017.
> Author's note: Piston has moved on since March of 2017. This tutorial, for `0.64`, is
preserved for posterity; I suggest you look instead at
[the official getting started guide](https://github.com/PistonDevelopers/Piston-Tutorials/tree/master/getting-started).
I've been interested in game programming for a while, and I periodically sample the Rust ecosystem's offerings around game programming. Piston seems like the most promising candidate, but the tutorials are out of date, so here's a simple one.
This tutorial will show you how to build a simple windowed application with a time-locked update rate and keyboard controls. You can extend it with image loading, music, and many other features of the Piston library.

15
content/tutorial/rust-abstracting-the-fsm.markdown

@ -1,15 +0,0 @@
---
date: 2016-07-08 15:20:03+00:00
slug: rust-abstracting-the-fsm
title: Rust - Abstracting the FSM
categories:
- Programming
- Rust
---
This is a followup to my [previous tutorial](/post/2016/07/06/rust-using-enums-and-match-expressionsstatements/) on creating a finite state machine in Rust.
As usual, you can find the video version at [YouTube](https://youtu.be/b8slVcXtg3k).
<script src="https://gist.github.com/noracodes/34fb1a452f2e9a1bc29ff61587c2ecac.js"></script>

16
content/tutorial/using-enums-and-match-expressionsstatements.markdown

@ -1,16 +0,0 @@
---
date: 2016-07-06 15:03:39+00:00
slug: rust-using-enums-and-match-expressionsstatements
title: Rust - Using Enums and Match Expressions/Statements
categories:
- Programming
- Rust
---
This is the source code from a screencast I did the other day on using enums and match expressions in Rust.
You can check out the screencast on [Youtube](https://www.youtube.com/watch?v=7D9GE3-o54o).
<script src="https://gist.github.com/noracodes/0cf24631f56ff3f7918b73eb543d1f1c.js"></script>

21
themes/oaktrough/static/css/style.css

@ -7,17 +7,17 @@
--red-violet: #943246;
--lavender-blush: #ffedef;
/* The background of the page backdrop. */
--bg-color: var(--floral-white);
--bg-color: white;
/* The color of text on the backdrop. */
--fg-color: var(--black-coffee);
/* The color used for borders and highlights. */
--offset-border-color: var(--charcoal);
/* The background used to encapsulate off-set text areas of the page. */
--offset-bg-color: var(--lavender-blush);
--offset-bg-color: var(--floral-white);
/* The color used for cards and callouts. */
--callout-bg-color: var(--lavender-blush);
--callout-bg-color: var(--floral-white);
--callout-fg-color: var(--fg-color);
--callout-dropshadow-color: var(--charcoal-light);
@ -98,12 +98,10 @@ main h3 {
/* Make section into cards. */
section {
margin: 16px;
padding: 1px 8px 4px;
border-radius: 8px;
margin: 0px;
padding: 0px 8px 0px;
color: var(--callout-fg-color);
background-color: var(--callout-bg-color);
box-shadow: 2px 4px var(--callout-dropshadow-color);
background-color: var(--bg-color);
}
/* Remove the disclosure triangle, per
@ -113,14 +111,15 @@ summary {
display: block;
}
/* Makes the content cascade downwards nicely */
/* Makes the content cascade downwards nicely.
* Details summary is flush, but details content is one em right. */
details {
padding: 0 1em;
padding: 0 0em;
}
details > :not(summary) {
margin-left: 1em;
margin-right: 1em;
margin-right: 0em;
}
/* Show a textual prompt for opening details (shown after the summary) */

Loading…
Cancel
Save