repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/whs/typst-govdoc | https://raw.githubusercontent.com/whs/typst-govdoc/master/govdoc.typ | typst | #import "thai.typ": thai, thnum
#let gov(body) = {
// TODO: Add comma
set enum(numbering: n => thnum(n) + ".")
set par(first-line-indent: 2.5cm, justify: true, leading: 0.6em)
show par: set block(spacing: 1em)
set page(
"a4",
margin: (
top: 2.5cm,
left: 3cm,
right: 2cm,
bottom: 2cm,
),
)
thai(body)
}
#let center-left(body) = {
style(styles => {
let size = measure(body, styles)
align(center, move(dx: size.width/2, body))
})
}
#let stamp(body) = {
text(red, size: 36pt, weight: "bold", body)
}
#let govhead(
secrecy: "",
urgency: "",
id: "",
address: "",
date: "",
title: "",
attention: "",
refer-to: "",
attachments: (),
) = thai({
{
grid(
columns: (2fr, auto, 2fr),
column-gutter: 1.2cm,
align(left + bottom, [
#if urgency.len() > 0 {
block(stamp(urgency))
}
ที่#h(0.3cm)#thnum(id)
]),
align(center + top, {
if secrecy.len() > 0 {
place(top + center, dy: -2em, stamp(secrecy))
}
block(image("garuda.svg", height: 3cm))
}),
align(left + bottom, address)
)
v(6pt)
// Date is aligned to Garuda's leg. We measure the center of page then go from there
center-left({
h(1cm)
date
})
if title.len() > 0 {
block([เรื่อง#h(0.3cm)#title])
}
if attention.len() > 0 {
block([เรียน#h(0.3cm)#attention])
}
if refer-to.len() > 0 {
block([อ้างถึง#h(0.3cm)#refer-to])
}
if attachments.len() > 0 {
grid(
columns: 2,
column-gutter: 0.3cm,
[ สิ่งที่ส่งมาด้วย ],
{
for attachment in attachments [
+ #attachment
]
},
)
}
parbreak()
}
})
#let govsign(
signoff: "ขอแสดงความนับถือ",
name: "",
position: "",
) = {
set par(first-line-indent: 0cm)
set block(breakable: false)
v(16pt)
center-left([
#signoff
#v(44pt)
(#name)\
#position
])
}
#let govsender(body) = {
set par(first-line-indent: 0cm)
v(16pt*4)
block(breakable: false, body)
}
|
|
https://github.com/sspu-cryptography-research-group/cv-template | https://raw.githubusercontent.com/sspu-cryptography-research-group/cv-template/main/README.md | markdown | # Typst CV Template
A simple CV template for [typst.app](https://typst.app).
### Sample CV

|
|
https://github.com/lxl66566/my-college-files | https://raw.githubusercontent.com/lxl66566/my-college-files/main/信息科学与工程学院/操作系统(选修)/实验/2.typ | typst | The Unlicense | #import "template.typ": *
#show: project.with(
title: "实验二 进程的创建与控制",
authors: (
"absolutex",
)
)
#align(right)[]
+ *实验目的*
+ 加深对进程概念的理解,明确进程和程序的区别;
+ 进一步认识并发执行的实质;
+ 熟悉C语言程序在Linux系统中的编辑,编译,执行;
+ 理解Linux系统中进程控制的基本原理。
+ 实验内容:
+ 使用vi编辑如下C程序,然后进行调试,编译,多次执行,分析和思考执行结果。
+ #include_code("src/2.1.c")
fork 了一个子线程,父子线程打印不同的输出,并且不作任何顺序要求。
+ #include_code("src/2.2.c")
先打印 `ONE`,然后再 fork 出一个子线程,父子线程同时执行打印 `TWO`,因此最终结果一定是 `ONE,TWO,TWO,`
+ #include_code("src/2.3.c")
首先 fork 出一个子进程,此时有两个进程(本题中未区分父子进程),分别打印 `ONE` 后,每个进程再 fork 出一个子进程,(此时有四个进程)打印 `TWO`。因此合法的输出有很多,只需要保证开头是 `ONE`,并且第二个 `ONE` 的位置在下标 $<= 3$ 时都可以。
+ #include_code("src/2.4.c")
同理子进程打印 `ac`,父进程打印 `bc`,因此合法的输出可以是 `c` 不在开头,并且如果两个连着的 `c` 不在 (1,2) 的位置即可。但是可能是因为未刷新输出缓冲区,导致没有出现其他的结果。
+ 请编写一段程序,该程序将使用系统调用`fork()`来创建一个子进程。当这个程序运行时,系统中将有一个父进程和一个子进程活动。请让每个进程在屏幕上显示一个字符:父进程显示字符`A`,子进程显示字符`B`。同时,程序需要输出两个进程的进程标识符。为了达到预期的效果,我们需要首先显示子进程的输出字符`B`,然后显示父进程的输出字符`A`。
#include_code("src/2.5.c")
+ 请编写另一段程序,该程序将使用系统调用`fork()`来创建两个子进程。当这个程序运行时,系统中将有一个父进程和两个子进程活动。请让每个进程在屏幕上显示一个字符:父进程显示字符`A`,两个子进程分别显示字符`B`和字符`C`。请多次执行这个程序,并观察记录屏幕上的显示结果,然后分析原因。
#include_code("src/2.6.c")
在 `handle_fork` 里,对于父进程将什么也不做,而对于子进程将打印字符。由于打印三个字符是不同的进程,没有任何顺序要求,因此 `ABC` 的任意输出顺序皆合法。
+ 请修改第二个实验中编写的程序,将每个进程输出一个字符改为每个进程输出一个字符50000次。请观察程序执行时屏幕上出现的现象,并分析原因。
#include_code("src/2.7.c")
由于有 wait 的存在,父进程会等待子进程打印结束再打印,因此 `B` 和 `A` 的出现顺序是固定的。
另外,本报告用到了一个 python 小脚本来多次运行程序并统计结果的频次:
#include_code("collect.py") |
https://github.com/01mf02/jq-lang-spec | https://raw.githubusercontent.com/01mf02/jq-lang-spec/main/semantics.typ | typst | #import "common.typ": *
= Evaluation Semantics <semantics>
In this section, we will define a function $phi|^c_v$ that returns
the output of the filter $phi$ in the context $c$ on the input value $v$.
Let us start with a few definitions.
A _context_ $c$ is a mapping
from variables $var(x)$ to values and
from identifier-arity pairs $(x, n)$ to triples $(a, f, c)$, where
$a$ is an identifier sequence with length $n$,
$f$ is a filter, and
$c$ is a context.
Contexts store what variables and filters are bound to.
We are now going to introduce a few helper functions.
The first function helps define filters such as if-then-else and alternation ($f alt g$):
$ "ite"(v, i, t, e) = cases(
t & "if" v = i,
e & "otherwise"
) $
Next, we define a function that is used to define alternation.
$"trues"(l)$ returns those elements of $l$ whose boolean values are not false.
Note that in our context, "not false" is _not_ the same as "true", because
the former includes exceptions, whereas the latter excludes them,
and $"bool"(x)$ _can_ return exceptions, in particular if $x$ is an exception.
$ "trues"(l) := sum_(x in l, "bool"(x) != "false") stream(x) $
#figure(caption: "Evaluation semantics.", table(columns: 2,
$phi$, $phi|^c_v$,
$.$, $stream(v)$,
$n "or" s$, $stream(phi)$,
$var(x)$, $stream(c(var(x)))$,
$[f]$, $stream([f|^c_v])$,
${}$, $stream({})$,
${var(x): var(y)}$, $stream({c(var(x)): c(var(y))})$,
$f, g$, $f|^c_v + g|^c_v$,
$f | g$, $sum_(x in f|^c_v) g|^c_x$,
$f alt g$, $"ite"("trues"(f|^c_v), stream(), g|^c_v, "trues"(f|^c_v))$,
$f "as" var(x) | g$, $sum_(x in f|^c_v) g|^(c{var(x) |-> x})_v$,
$var(x) cartesian var(y)$, $stream(c(var(x)) cartesian c(var(y)))$,
$"try" f "catch" g$, $sum_(x in f|^c_v) cases(
g|^c_e & "if" x = "error"(e),
stream(x) & "otherwise"
)$,
$"label" var(x) | f$, $"label"(f[var(x') / var(x)]|^c_v, var(x'))$,
$"break" var(x)$, $stream("break"(var(x)))$,
$"if" var(x) "then" f "else" g$, $"ite"("bool"(c(var(x))), "true", f|^c_v, g|^c_v)$,
$.[p]^?$, $v[c(p)]^?$,
$fold x "as" var(x) (.; f)$, $fold^c_v (x|^c_v, var(x), f)$,
$"def" x(x_1; ...; x_n) defas f defend g$, $g|^(c union {(x, n) |-> ([x_1, ..., x_n], f, c)})_v$,
$x(f_1; ...; f_n)$, $f|^(c' union union.big_i {x_i |-> (f_i, c)})_v "if" c((x, n)) = ([x_1, ..., x_n], f, c')$,
$f update g$, [see @updates]
)) <tab:eval-semantics>
The evaluation semantics are given in @tab:eval-semantics.
Let us discuss its different cases:
- "$.$": Returns its input value. This is the identity filter.
- $n$ or $s$: Returns the value corresponding to the number $n$ or string $s$.
- $var(x)$: Returns the value currently bound to the variable $var(x)$,
by looking it up in the context.
Wellformedness of the filter (as defined in @mir) ensures that such a value always exists.
- $[f]$: Creates an array from the output of $f$, using the operator defined in @values.
- ${}$: Creates an empty object.
- ${var(x): var(y)}$: Creates an object from the values bound to $var(x)$ and $var(y)$,
using the operator defined in @values.
- $f, g$: Concatenates the outputs of $f$ and $g$.
- $f | g$: Composes $f$ and $g$, returning the outputs of $g$ applied to all outputs of $f$.
- $f alt g$: Returns $l$ if $l$ is not empty, else the outputs of $g$, where
$l$ are the outputs of $f$ whose boolean values are not false.
- $f "as" var(x) | g$: For every output of $f$, binds it to the variable $var(x)$ and
returns the output of $g$, where $g$ may reference $var(x)$.
Unlike $f | g$, this runs $g$ with the original input value instead of an output of $f$.
We can show that the evaluation of $f | g$ is equivalent to that of
$f "as" var(x') | var(x') | g$, where $var(x')$ is a fresh variable.
Therefore, we could be tempted to lower $f | g$ to
$floor(f) "as" var(x') | var(x') | floor(g)$ in @tab:lowering.
However, we cannot do this because we will see in @updates that
this equivalence does _not_ hold for updates; that is,
$(f | g) update sigma$ is _not_ equal to $(f "as" var(x') | var(x') | g) update sigma$.
- $var(x) cartesian var(y)$: Returns the output of a Cartesian operation "$cartesian$"
(any of $eq.quest$, $eq.not$, $<$, $<=$, $>$, $>=$, $+$, $-$, $times$, $div$, and $mod$,
as given in @tab:binops) on the values bound to $var(x)$ and $var(y)$.
The semantics of the arithmetic operators are given in @arithmetic,
the comparison operators are defined by the value order (see @value-ops),
$l eq.quest r$ returns whether $l$ equals $r$, and
$l eq.not r$ returns its negation.
- $"try" f "catch" g$: Replaces all outputs of $f$ that equal $"error"(e)$ for some $e$
by the output of $g$ on the input $e$.
At first sight, this seems to diverge from jq, which
aborts the evaluation of $f$ after the first error.
However, because lowering to MIR replaces
$"try" f "catch" g$ with
$"label" var(x') | "try" f "catch" (g, "break" var(x'))$ (see @tab:lowering),
the overall behaviour described here corresponds to jq after all.
- $"label" var(x) | f$: Returns all values yielded by $f$ until $f$ yields
an exception $"break"(var(x))$.
This uses the function $"label"(l, var(x))$, which returns all elements of $l$ until
the current element is an exception of the form $"break"(var(x))$:
$ "label"(l, var(x)) := cases(
stream(h) + "label"(t, var(x)) & "if" l = stream(h) + t "and" h != "break"(var(x)),
stream() & "otherwise",
) $
Here, we substitute occurrences of $var(x)$ by a fresh label $var(x')$ as given by @tab:subst.
To see that this is necessary, consider the example
$ "def" f(x) defas ("label" var(x) | x), 0 defend "label" var(x) | f("break" var(x)). $
With substitution, this is equivalent to
$"label" var(x') | ("label" var(x'') | "break" var(x')), 0$
and yields $stream(0)$, whereas
without substitution, this would be equivalent to
$"label" var(x) | ("label" var(x) | "break" var(x)), 0$
and would yield $stream()$.#footnote[
Would renaming all labels during lowering make the substitution step obsolete?
Alas, no, because filter execution may generate an arbitrary number of labels.
Consider the example $"def" f(x) defas "label" var(x) | f(x | "break" var(x)); f(.)$.
This evaluates to
$"label" var(x_1) | ... | "label" var(x_n) | f(. |
"break" var(x_1) | ... | "break" var(x_n))$
after $n$ evaluations of $f$, involving $n$ different labels.
]
- $"break" var(x)$: Returns a value $"break"(var(x))$.
Similarly to the evaluation of variables $var(x)$ described above,
wellformedness of the filter (as defined in @hir) ensures that
the returned value $"break"(var(x))$ will be
eventually handled by a corresponding filter
$"label" var(x) | f$.
That means that the evaluation of a wellformed filter can only yield
values and errors, but never $"break"(var(x))$.
- $"if" var(x) "then" f "else" g$: Returns the output of $f$ if $var(x)$ is bound to either null or false, else returns the output of $g$.
- $.[p]$: Accesses parts of the input value;
see @value-ops for the definitions of the operators.
We apply $c$ to the path indices (which are variables)
to replace them by their corresponding values.
- $fold x "as" var(x) (.; f)$: Folds $f$ over the values returned by $x$,
starting with the current input as accumulator.
The current accumulator value is provided to $f$ as input value and
$f$ can access the current value of $x$ by $var(x)$.
If $fold = "reduce" $, this returns only the final values of the accumulator, whereas
if $fold = "foreach"$, this returns also the intermediate values of the accumulator.
We will define the functions
$"reduce" ^c_v (l, var(x), f)$ and
$"foreach"^c_v (l, var(x), f)$ in @folding.
- $x(f_1; ...; f_n)$: Calls an $n$-ary filter $x$.
This also handles the case of calling nullary filters such as $"empty"$.
- $f update g$: Updates the input at positions returned by $f$ by $g$.
We will discuss this in @updates.
#figure(caption: [Substitution of break label $var(y)$ by $var(z)$ in filter $phi$.], table(columns: 2,
$phi$, $phi[var(z) / var(y)]$,
[$., n, s, {}, .[p]^?, var(x),$ \ ${var(x): var(y)}, "or" var(x) cartesian var(y)$], $phi$,
$"label" var(x) | f$, $"label" var(x) | "ite"(var(x), var(y), f, f[var(z) / var(y)])$,
$"break" var(x)$, $"break" "ite"(var(x), var(y), var(z), var(x))$,
$[f]$, $[f[var(z) / var(y)]]$,
$f star g$, $f[var(z) / var(y)] star g[var(z) / var(y)]$,
$f "as" var(x) | g$, $f[var(z) / var(y)] "as" var(x) | g[var(z) / var(y)]$,
$"try" f "catch" g$, $"try" f[var(z) / var(y)] "catch" g[var(z) / var(y)]$,
$"if" var(x) "then" f "else" g$, $"if" var(x) "then" f[var(z) / var(y)] "else" g[var(z) / var(y)]$,
$fold x "as" var(x) (.; f; g)$, $fold x[var(z) / var(y)] "as" var(x) (.; f[var(z) / var(y)]; g[var(z) / var(y)])$,
$"def" x(x_1; ...; x_n) defas f defend g$, $"def" x(x_1; ...; x_n) defas f[var(z) / var(y)] defend g[var(z) / var(y)]$,
$x(f_1; ...; f_n)$, $x(f_1 [var(z) / var(y)]; ...; f_n [var(z) / var(y)])$,
)) <tab:subst>
An implementation may also define custom semantics for named filters.
For example, an implementation may define
$"error"|^c_v := "error"(v)$ and
$"keys"|^c_v := "keys"(v)$, see @simple-fns.
In the case of $"keys"$, for example, there is no obvious way to implement it by definition,
in particular because there is no simple way to obtain the domain of an object ${...}$
using only the filters for which we gave semantics in @tab:eval-semantics.
/*
For $"length"$, we could give a definition, using
$"reduce" .[] "as" var(x) (0; . + 1)$ to obtain the length of arrays and objects, but
this would inherently require linear time to yield a result, instead of
constant time that can be achieved by a proper jq implementation.
*/
== Folding <folding>
In this subsection, we will define the functions
$"reduce" ^c_v (l, var(x), f)$ and
$"foreach"^c_v (l, var(x), f, g)$
which underlie the semantics for the folding operators
$"reduce" x "as" var(x) (.; f)$ and
$"foreach" x "as" var(x) (.; f; g)$.
Let us start by defining a general folding function
$"fold"^c_v (l, var(x), f, g, o)$:
It takes
a stream of value results $l$,
a variable $var(x)$,
two filters $f$ and $g$, and
a function $o(x)$ from a value $x$ to a stream of values.
This function folds over the elements in $l$, starting from the accumulator value $v$.
For every element in $l$,
$f$ is evaluated with the current accumulator value as input and
with the variable $var(x)$ bound to the current element in $l$.
Every output of $f$ is output after passing through $g$, then
used as new accumulator value with the remaining list.
If $l$ is empty, then $v$ is called a _final_ accumulator value and $o(v)$ is returned.
$ "fold"^c_v (l, var(x), f, g, o) := cases(
sum_(y in f|^(c{var(x) |-> h})_v) g|^(c{var(x) |-> h})_y + "fold"^c_y (t, var(x), f, g, o) & "if" l = stream(h) + t,
o(v) & "otherwise" (l = stream())
) $
We use two different functions for $o(v)$;
the first returns just $v$, corresponding to $"reduce"$ which returns a final value, and
the second returns nothing, corresponding to $"foreach"$.
Instantiating $"fold"$ with these two functions, we obtain the following:
$ "reduce"^c_v &(l, var(x), f&) &:= "fold"^c_v (l, var(x), f, "empty"&, o) "where" o(v) = stream(v) \
"foreach"^c_v &(l, var(x), f, g&) &:= "fold"^c_v (l, var(x), f, g&, o) "where" o(v) = stream(#hide[v])
$
Here,
$"reduce" ^c_v (l, var(x), f)$ and
$"foreach"^c_v (l, var(x), f, g)$ are the functions that are used in @tab:eval-semantics.
We will now look at what the evaluation of the various folding filters expands to.
Assuming that the filter $x$ evaluates to $stream(x_0, ..., x_n)$,
then $"reduce"$ and $"foreach"$ expand to
$ "reduce" x "as" var(x) (.; f ) =& x_0 "as" var(x) | f & wide
"foreach" x "as" var(x) (.; f; g) =& x_0 "as" var(x) | f | g, ( \
|& ... &
& ... \
|& x_n "as" var(x) | f &
& x_n "as" var(x) | f | g, ( \
&&
& "empty")...)
$
Note that jq implements only restricted versions of these folding operators
that consider only the last output of $f$ for the next iteration.
That means that in jq,
$"reduce" x "as" var(x) (.; f)$ is equivalent to
$"reduce" x "as" var(x) (.; "last"(f))$.
Here, we assume that the filter $"last"(f)$
returns the last output of $f$ if $f$ yields any output, else nothing.
= Update Semantics <updates>
In this section, we will discuss how to evaluate updates $f update g$.
First, we will show how the original jq implementation executes such updates,
and show which problems this approach entails.
Then, we will give alternative semantics for updates that avoids these problems,
while enabling faster performance by forgoing the construction of temporary path data.
== jq updates via paths <jq-updates>
jq's update mechanism works with _paths_.
A path is a sequence of indices $i_j$ that can be written as $.[i_1]...[i_n]$.
It refers to a value that can be retrieved by the filter "$.[i_1] | ... | .[i_n]$".
Note that "$.$" is a valid path, referring to the input value.
The update operation "$f update g$" attempts to
first obtain the paths of all values returned by $f$,
then for each path, it replaces the value at the path by $g$ applied to it.
Note that $f$ is not allowed to produce new values; it may only return paths.
#example[
Consider the input value $[[1, 2], [3, 4]]$.
We can retrieve the arrays $[1, 2]$ and $[3, 4]$ from the input with the filter "$.[]$", and
we can retrieve the numbers 1, 2, 3, 4 from the input with the filter "$.[] | .[]$".
To replace each number with its successor, we run "$(.[] | .[]) update .+1$",
obtaining $[[2, 3], [4, 5]]$.
Internally, in jq, this first builds the paths
$.[0][0]$, $.[0][1]$, $.[1][0]$, $.[1][1]$,
then updates the value at each of these paths with $g$.
] <ex:arr-update>
This approach can yield surprising results when the execution of the filter $g$
changes the input value in a way that the set of paths changes midway.
In such cases, only the paths constructed from the initial input are considered.
This can lead to
paths pointing to the wrong data,
paths pointing to non-existent data, and
missing paths.
#example[
Consider the input value ${qs(a) |-> {qs(b) |-> 1}}$ and the filter
$(.[], .[][]) update g$, where $g$ is $[]$.
Executing this filter in jq first builds the path
$.[qs(a)]$ stemming from "$.[]$", then
$.[qs(a)][qs(b)]$ stemming from "$.[][]$".
Next, jq folds over the paths,
using the input value as initial accumulator and
updating the accumulator at each path with $g$.
The final output is thus the output of $(.[qs(a)] update g) | (.[qs(a)][qs(b)] update g)$.
The output of the first step $.[qs(a)] update g$ is ${qs(a) |-> []}$.
This value is the input to the second step $.[qs(a)][qs(b)] update g$,
which yields an error because
we cannot index the array $[]$ at the path $.[qs(a)]$ by $.[qs(b)]$.
] <ex:obj-update-arr>
/*
// TODO: this actually returns [1, 3] in jq 1.7
One of these problems is that if $g$ returns no output,
the collected paths may point to values that do not exist any more.
#example[
Consider the input value $[1, 2, 2, 3]$ and the filter
// '.[] |= (if . == 2 then empty else . end)'
"$.[] update g$", where $g$ is "$"if" . eq.quest 2 "then" "empty"() "else" .$",
which we might suppose to delete all values equal to 2 from the input list.
However, the output of jq is $[1, 2, 3]$.
What happens here is perhaps unexpected,
but consistent with the above explanation of jq's semantics:
jq builds the paths $.[0]$, $.[1]$, $.[2]$, and $.[3]$.
Next, it applies $g$ to all paths.
Applying $g$ to $.[1]$ removes the first occurrence of the number 2 from the list,
leaving the list $[1, 2, 3]$ and the paths $.[2]$, $.[3]$ to update.
However, $.[2]$ now refers to the number 3, and $.[3]$ points beyond the list.
] <ex:update>
*/
We can also have surprising behaviour that does not manifest any error.
#example[
Consider the same input value and filter as in @ex:obj-update-arr,
but now with $g$ set to ${qs(c): 2}$.
The output of the first step $.[qs(a)] update g$ is ${qs(a) |-> {qs(c) |-> 2}}$.
This value is the input to the second step $.[qs(a)][qs(b)] update g$, which yields
${qs(a) |-> {qs(c) |-> 2, qs(b) |-> {qs(c) |-> 2}}}$.
Here, the remaining path ($.[qs(a)][qs(b)]$) pointed to
data that was removed by the update on the first path,
so this data gets reintroduced by the update.
On the other hand, the data introduced by the first update step
(at the path $.[qs(a)][qs(c)]$) is not part of the original path,
so it is _not_ updated.
] <ex:obj-update-obj>
We found that we can interpret many update filters by simpler filters,
yielding the same output as jq in most common cases, but avoiding the problems shown above.
To see this, let us see what would happen if we would interpret
$(f_1, f_2) update g$ as $(f_1 update g) | (f_2 update g)$.
That way, the paths of $f_2$ would point precisely to the data returned by
$f_1 update g$, thus avoiding the problems depicted by the examples above.
In particular, with such an approach,
@ex:obj-update-arr would yield ${qs(a) |-> []}$ instead of an error, and
@ex:obj-update-obj would yield ${qs(a) |-> {qs(c) |-> {qs(c) |-> 2}}}$.
In the remainder of this section, we will show
semantics that extend this idea to all update operations.
The resulting update semantics can be understood to _interleave_ calls to $f$ and $g$.
By doing so, these semantics can abandon the construction of paths altogether,
which results in higher performance when evaluating updates.
== Properties of new semantics <update-props>
// μονοπάτι = path
// συνάρτηση = function
#figure(caption: [Update semantics properties.], table(columns: 2,
$mu$, $mu update sigma$,
$"empty"()$, $.$,
$.$, $sigma$,
$f | g$, $f update (g update sigma)$,
$f, g$, $(f update sigma) | (g update sigma)$,
$"if" var(x) "then" f "else" g$, $"if" var(x) "then" f update sigma "else" g update sigma$,
$f alt g$, $"if" "first"(f alt "null") "then" f update sigma "else" g update sigma$,
)) <tab:update-props>
@tab:update-props gives a few properties that we want to hold for updates $mu update sigma$.
Let us discuss these for the different filters $mu$:
- $"empty"()$: Returns the input unchanged.
- "$.$": Returns the output of the update filter $sigma$ applied to the current input.
Note that while jq only returns at most one output of $sigma$,
these semantics return an arbitrary number of outputs.
- $f | g$: Updates at $f$ with the update of $sigma$ at $g$.
This allows us to interpret
$(.[] | .[]) update sigma$ in @ex:arr-update by
$.[] update (.[] update sigma)$, yielding the same output as in the example.
- $f, g$: Applies the update of $sigma$ at $g$ to the output of the update of $sigma$ at $f$.
We have already seen this at the end of @jq-updates.
- $"if" var(x) "then" f "else" g$: Applies $sigma$ at $f$ if $var(x)$ holds, else at $g$.
- $f alt g$: Applies $sigma$ at $f$ if $f$ yields some output whose boolean value (see @simple-fns) is not false, else applies $sigma$ at $g$.
See @folding for the definition of $"first"$.
While @tab:update-props allows us to define the behaviour of several filters
by reducing them to more primitive filters,
there are several filters $mu$ which cannot be defined this way.
We will therefore give the actual update semantics of $mu update sigma$ in @new-semantics
by defining $(mu update sigma)|^c_v$, not
by translating $mu update sigma$ to equivalent filters.
== Limiting interactions <limiting-interactions>
To define $(mu update sigma)|^c_v$, we first have to understand
how to prevent unwanted interactions between $mu$ and $sigma$.
In particular, we have to look at variable bindings/* and error catching*/.
//=== Variable bindings <var-bindings>
We can bind variables in $mu$; that is, $mu$ can have the shape $f "as" var(x) | g$.
Here, the intent is that $g$ has access to $var(x)$, whereas $sigma$ does not!
This is to ensure compatibility with jq's original semantics,
which execute $mu$ and $sigma$ independently,
so $sigma$ should not be able to access variables bound in $mu$.
#example[
Consider the filter $0 "as" var(x) | mu update sigma$, where
$mu$ is $(1 "as" var(x) | .[var(x)])$ and $sigma$ is $var(x)$.
This updates the input array at index $1$.
If $sigma$ had access to variables bound in $mu$,
then the array element would be replaced by $1$,
because the variable binding $0 "as" var(x)$ would be shadowed by $1 "as" var(x)$.
However, in jq, $sigma$ does not have access to variables bound in $mu$, so
the array element is replaced by $0$, which is the value originally bound to $var(x)$.
Given the input array $[1, 2, 3]$, the filter yields the final result $[1, 0, 3]$.
]
We take the following approach to prevent variables bound in $mu$ to "leak" into $sigma$:
When evaluating $(mu update sigma)|^c_v$, we want
$sigma$ to always be executed with the same $c$.
That is, evaluating $(mu update sigma)|^c_v$ should never
evaluate $sigma$ with any context other than $c$.
In order to ensure that, we will define
$(mu update sigma)|^c_v$ not for a _filter_ $sigma$,
but for a _function_ $sigma(x)$, where
$sigma(x)$ returns the output of the filter $sigma|^c_x$.
This allows us to extend the context $c$ with bindings on the left-hand side of the update,
while executing the update filter $sigma$ always with the same original context $c$.
/*
=== Error catching <error-catching>
We can catch errors in $mu$; that is, $mu$ can have the shape $"try" f "catch" g$.
However, this should catch only errors that occur in $mu$,
_not_ errors that are returned by $sigma$.
#example[
Consider the filter $mu update sigma$, where $mu$ is $.[]?$ and $sigma$ is $.+1$.
The filter $mu$ is lowered to the MIR filter $"try" .[] "catch" "empty"()$.
The intention of $mu update sigma$ is to
update all elements $.[]$ of the input value, and if $.[]$ returns an error
(which occurs when the input is neither an array nor an object, see @accessing),
to just return the input value unchanged.
When we run $mu update sigma$ with the input $0$,
the filter $.[]$ fails with an error, but
because the error is caught immediately afterwards,
$mu update sigma$ consequently just returns the original input value $0$.
The interesting part is what happens when $sigma$ throws an error:
This occurs for example when running the filter with the input $[{}]$.
This would run $. + 1$ with the input ${}$, which yields an error (see @arithmetic).
This error _is_ returned by $mu update sigma$.
]
This raises the question:
How can we execute $("try" f "catch" g) update sigma$ and distinguish
errors stemming from $f$ from errors stemming from $sigma$?
We came up with the solution of _polarised exceptions_.
In a nutshell, we want every exception that is returned by $sigma$ to be
marked in a special way such that it can be ignored by a try-catch in $mu$.
For this, we assume the existence of two functions
$"polarise"(x)$ and $"depolarise"(x)$ from a value result $x$ to a value result.
If $x$ is an exception, then
$"polarise"(x)$ should return a polarised version of it, whereas
$"depolarise"(x)$ should return an unpolarised version of it, i.e. it should
remove any polarisation from an exception.
Every exception created by $"error"(e)$ is unpolarised.
With this method, when we evaluate an expression $"try" f "catch" g$ in $mu$,
we can analyse the output of $f update sigma$, and only catch _unpolarised_ errors.
That way, errors stemming from $mu$ are propagated,
whereas errors stemming from $f$ are caught.
*/
== New semantics <new-semantics>
We will now give semantics that define the output of
$(f update g)|^c_v$ as referred to in @semantics.
We will first combine the techniques in @limiting-interactions to define
$(f update g)|^c_v$ for two _filters_ $f$ and $g$ by
$(f update sigma)|^c_v$, where
$sigma$ now is a _function_ from a value to a stream of value results:
$ (f update g)|^c_v := (f update sigma)|^c_v", where"
sigma(x) = g|^c_x. $
We use a function instead of a filter on the right-hand side to
limit the scope of variable bindings as explained in @limiting-interactions/*, and
we use $"polarise"$ to
restrict the scope of caught exceptions, as discussed in @error-catching.
Note that we $"depolarise"$ the final outputs of $f update g$ in order to
prevent leaking polarisation information outside the update*/.
#figure(caption: [Update semantics. Here, $mu$ is a filter and $sigma(v)$ is a function from a value $v$ to a stream of value results.], table(columns: 2,
$mu$, $(mu update sigma)|^c_v$,
$.$, $sigma(v)$,
$f | g$, $(f update sigma')|^c_v "where" sigma'(x) = (g update sigma)|^c_x$,
$f, g$, $sum_(x in (f update sigma)|^c_v) (g update sigma)|^c_x$,
$f alt g$, $"ite"("trues"(f|^c_v), stream(), (g update sigma)|^c_v, (f update sigma)|^c_v)$,
$.[p]^?$, $stream(v[c(p)]^? update sigma)$,
$f "as" var(x) | g$, $"reduce"^c_v (f|^c_v, var(x), (g update sigma))$,
$"if" var(x) "then" f "else" g$, $"ite"(c(var(x)), "true", (f update sigma)|^c_v, (g update sigma)|^c_v)$,
//$"try" f "catch" g$, $sum_(x in (f update sigma)|^c_v) "catch"(x, g, c, v)$,
$"break" var(x)$, $stream("break"(var(x)))$,
$fold x "as" var(x) (.; f)$, $fold^c_v (x|^c_v, var(x), f, sigma)$,
$"def" x(x_1; ...; x_n) defas f defend g$, $(g update sigma)|^(c union {(x, n) |-> ([x_1, ..., x_n], f, c)})_v$,
$x(f_1; ...; f_n)$, $(f update sigma)|^(c' union union.big_i {x_i |-> (f_i, c)})_v "if" c((x, n)) = ([x_1, ..., x_n], f, c')$,
)) <tab:update-semantics>
@tab:update-semantics shows the definition of $(mu update sigma)|^c_v$.
Several of the cases for $mu$, like
"$.$", "$f | g$", "$f, g$", and "$"if" var(x) "then" f "else" g$"
are simply relatively straightforward consequences of the properties in @tab:update-props.
We discuss the remaining cases for $mu$:
- $f alt g$: Updates using $f$ if $f$ yields some non-false value, else updates using $g$.
Here, $f$ is called as a "probe" first.
If it yields at least one output that is considered "true"
(see @semantics for the definition of $"trues"$),
then we update at $f$, else at $g$.
This filter is unusual because is the only kind where a subexpression is both
updated with ($(f update sigma)|^c_v$) and evaluated ($f|^c_v$).
- $.[p]^?$: Applies $sigma$ to the current value at the path part $p$
using the update operators in @value-ops.
- $f "as" var(x) | g$:
Folds over all outputs of $f$, using the input value $v$ as initial accumulator and
updating the accumulator by $g update sigma$, where
$var(x)$ is bound to the current output of $f$.
The definition of $"reduce"$ is given in @folding.
/*
- $"try" f "catch" g$: Returns the output of $f update sigma$,
mapping errors occurring in $f$ to $g$. The definition of the function $"catch"$ is
$ "catch"(x, g, c, v) := cases(
sum_(y in g|^c_(e)) stream("error"(y)) & "if" x = "error"(e)", " x "is unpolarised, and" g|^c_x != stream(),
stream(v) & "if" x = "error"(e)", " x "is unpolarised, and" g|^c_x = stream(),
stream(x) & "otherwise"
) $
The function $"catch"(x, g, c, v)$ analyses $x$ (the current output of $f$):
If $x$ is no unpolarised error, $x$ is returned.
For example, that is the case if the original right-hand side of the update
returns an error, in which case we do not want this error to be caught here.
However, if $x$ is an unpolarised error, that is,
an error that was caused on the left-hand side of the update,
it has to be caught here.
In that case, $"catch"$ analyses the output of $g$ with input $x$:
If $g$ yields no output, then it returns the original input value $v$,
and if $g$ yields output, all its output is mapped to errors!
This behaviour might seem peculiar,
but it makes sense when we consider the jq way of implementing updates via paths:
When evaluating some update $mu update sigma$ with an input value $v$,
the filter $mu$ may only return paths to data contained within $v$.
When $mu$ is $"try" f "catch" g$,
the filter $g$ only receives inputs that stem from errors,
and because $v$ cannot contain errors, these inputs cannot be contained in $v$.
Consequentially, $g$ can never return any path pointing to $v$.
The only way, therefore, to get out alive from a $"catch"$ is for $g$ to return ... nothing.
- $"break"(var(x))$: Breaks out from the update.#footnote[
Note that unlike in @semantics, we do not define the update semantics of
$"label" var(x) | f$, which could be used to resume an update after a $"break"$.
The reason for this is that this requires
an additional type of $"break"$ exceptions that
carries the current value alongside the variable, as well as
variants of the value update operators in @updating that can handle unpolarised breaks.
Because making update operators handle unpolarised breaks
renders them considerably more complex and
we estimate that label expressions are
rarely used in the left-hand side of updates anyway,
we think it more beneficial for the presentation to forgo label expressions here.
]
*/
- $fold x "as" var(x) (.; f)$: Folds $f$ over the values returned by $var(x)$.
We will discuss this in @folding-update.
- $x(f_1; ...; f_n)$, $x$: Calls filters.
This is defined analogously to @tab:eval-semantics.
There are many filters $mu$ for which
$(mu update sigma)|^c_v$ is not defined,
for example $var(x)$, $[f]$, and ${}$.
In such cases, we assume that $(mu update sigma)|^c_v$ returns an error just like jq,
because these filters do not return paths to their input data.
Our semantics support all kinds of filters $mu$ that are supported by jq, except for
$"label" var(x) | g$ and $"try" f "catch" g$.
#example("The Curious Case of Alternation")[
The semantics of $(f alt g) update sigma$ can be rather surprising:
For the input
${qs(a) |-> "true"}$, the filter
$(oat(a) alt oat(b)) update 1$ yields
${qs(a) |-> 1}$.
This is what we might expect, because the input has an entry for $qs(a)$.
Now let us evaluate the same filter on the input
${qs(a) |-> "false"}$, which yields ${qs(a) |-> "false", qs(b) |-> 1}$.
Here, while the input still has an entry for $qs(a)$ like above,
its boolean value is _not_ true, so $oat(b) update 1$ is executed.
In the same spirit, for the input ${}$ the filter yields ${qs(b) |-> 1}$,
because $oat(a)$ yields $"null"$ for the input,
which also has the boolean value $"false"$, therefore $oat(b) update 1$ is executed.
For the input
${}$, the filter
$("false" alt oat(b)) update 1$ yields
${qs(b) |-> 1}$.
This is remarkable insofar as $"false"$ is not a valid path expression
because it returns a value that does not refer to any part of the original input,
yet the filter does not return an error.
This is because
$"false"$ triggers $oat(b) update 1$, so
$"false"$ is never used as path expression.
However, running the filter $("true" alt oat(b)) update 1$
_does_ yield an error, because
$"true"$ triggers $"true" update 1$, and
$"true"$ is not a valid path expression.
Finally, on the input
$[]$, the filter
$(.[] alt "error") update 1$ yields
$"error"([])$.
That is because $.[]$ does not yield any value for the input,
so $"error" update 1$ is executed, which yields an error.
]
== Folding <folding-update>
// TODO: update this for `foreach/3` and remove `for`
In @folding, we have seen how to evaluate folding filters of the shape
$fold x "as" var(x) (.; f)$, where $fold$ is either $"reduce"$ or $"foreach"$.
Here, we will define update semantics for these filters.
These update operations are _not_ supported in jq 1.7; however,
we will show that they arise quite naturally from previous definitions.
Let us start with an example to understand folding on the left-hand side of an update.
#example[
Let $v = [[[2], 1], 0]$ be our input value
and $mu$ be the filter $fold (0, 0) "as" var(x) (.; .[var(x)])$.
The regular evaluation of $mu$ with the input value as described in @semantics yields
$ mu|^{}_v = cases(
stream(#hide($[[2], 1], $) [2]) & "if" fold = "reduce",
stream( [[2], 1], [2]) & "if" fold = "foreach",
) $
When $fold = "foreach"$, the paths corresponding to the output are $.[0]$ and $.[0][0]$, and
when $fold = "reduce"$, the paths are just $.[0][0]$.
Given that all outputs have corresponding paths, we can update over them.
For example, taking $. + [3]$ as filter $sigma$, we should obtain the output
#let h3 = hide($, 3$)
$ (mu update sigma)^{}_v = cases(
stream([[[2, 3], 1#h3], 0]) & "if" fold = "reduce",
stream([[[2, 3], 1, 3], 0]) & "if" fold = "foreach",
) $
] <ex:folding-update>
First, note that for folding filters,
the lowering in @tab:lowering and
the defining equations in @folding
only make use of filters for which we have already introduced update semantics in @tab:update-semantics.
This should not be taken for granted; for example, we originally lowered
$fold f_x "as" var(x) (f_y; f)$ to
$ floor(f_y) "as" var(y) | fold floor(f_x) "as" var(x) (var(y); floor(f)) $
instead of the more complicated lowering found in @tab:lowering, namely
$ . "as" var(x') | floor(f_y) | fold floor(var(x') | f_x) "as" var(x) (.; floor(f)). $
While both lowerings produce the same output for regular evaluation,
we cannot use the original lowering for updates, because the defining equations for
$fold x "as" var(x) (var(y); f)$ would have the shape $var(y) | ...$,
which is undefined on the left-hand side of an update.
However, the lowering in @tab:lowering avoids this issue
by not binding the output of $f_y$ to a variable,
so it can be used on the left-hand side of updates.
To obtain an intuition about how the update evaluation of a fold looks like, we can take
$fold x "as" var(x) (.; f; g) update sigma$,
substitute the left-hand side by the defining equations in @folding and
expand everything using the properties in @update-props.
This yields
$ "reduce" x "as" var(x) (.; f ) update sigma
=& x_0 "as" var(x) | (f update ( \
& ... \
& x_n "as" var(x) | (f update ( \
& sigma))...)) \
"foreach" x "as" var(x) (.; f; g) update sigma
=& x_0 "as" var(x) | (f update ((g update sigma) | \
& ... \
& x_n "as" var(x) | (f update ((g update sigma) | \
& .))...)).
$
#example[
To see the effect of above equations, let us reconsider
the input value and the filters from @ex:folding-update.
Using some liberty to write $.[0]$ instead of $0 "as" var(x) | .[var(x)]$, we have:
#let hs = hide($sigma | ($)
$ mu update sigma = cases(
.[0] update #hs .[0] update sigma & "if" fold = "reduce",
.[0] update sigma | (.[0] update sigma) & "if" fold = "foreach",
) $
]
We will now formally define the functions used in @tab:update-semantics.
For this, we first introduce a function $"fold"^c_v (l, var(x), f, g, sigma, o)$,
which resembles its corresponding function in @folding,
but which adds an argument for the update filter $sigma$:
$ "fold"^c_v (l, var(x), f, g, sigma, o) := cases(
(f update sigma')|^(c{var(x) |-> h})_v & "if" l = stream(h) + t,
o(v) & "otherwise" (l = stream()),
) $
where
$ sigma'(x) = sum_(y in (g update sigma)|^(c{var(x) |-> h})_x) "fold"^c_y (t, var(x), f, g, sigma, o). $
Using this function, we can now define
$ "reduce"^c_v & (l, var(x), f, &sigma) :=& "fold"^c_v (l, var(x), f, "empty", &sigma, o) "where" o(v) = sigma(v) \
"foreach"^c_v & (l, var(x), f, g, &sigma) :=& "fold"^c_v (l, var(x), f, g, &sigma, o) "where" o(v) = #hide($sigma$)stream(v)
$
|
|
https://github.com/chendaohan/bevy_tutorials_typ | https://raw.githubusercontent.com/chendaohan/bevy_tutorials_typ/main/12_time_and_timers/time_and_timers.typ | typst | #set page(fill: rgb(35, 35, 38, 255), height: auto, paper: "a3")
#set text(fill: color.hsv(0deg, 0%, 90%, 100%), size: 22pt, font: "Microsoft YaHei")
#set raw(theme: "themes/Material-Theme.tmTheme")
= 1. Time (时间)
Time 是你主要的全局计时信息源,你可以在任何需要操作时间的系统中访问该资源。Bevy 在每帧开始时更新时间。
= 2. 增量时间
最常见的用例是“增量时间”(delta time)——即前一帧更新和当前帧更新之间经过的时间。这告诉你游戏运行的速度,以便你可以调整诸如移动和动画之类的内容。这样一来,无论游戏的帧率如何,一切都可以顺畅地进行并以相同的速度运行。
```Rust
fn move_blue_circle(mut blue_circle: Query<&mut Transform, With<BlueCircle>>, time: Res<Time>) {
let Ok(mut transform) = blue_circle.get_single_mut() else {
return;
};
transform.translation.x += 200. * time.delta_seconds();
}
```
= 3. 计时器和秒表
还有一些工具可以帮助你跟踪特定的间隔或计时:Timer 和 Stopwatch 。你可以创建许多此类实例,以跟踪你想要的任何内容。你可以在自己的组件或资源中使用它们。
计时器和秒表需要 tick。你需要有一些系统调用 .tick(delta) 才能使它们前进,否则它将处于非活动状态。增量应该来自 Time 资源。
```Rust
fn tick_timers(mut timers: Query<&mut BigCircleTimer>, time: Res<Time>) {
for mut timer in &mut timers {
timer.0.tick(time.delta());
}
}
fn tick_stopwatches(mut stopwatches: Query<&mut SmallCircleStopwatch>, time: Res<Time>) {
for mut stopwatch in &mut stopwatches {
stopwatch.0.tick(time.delta());
}
}
```
= 4. Timer (计时器)
Timer 允许你检测特定时间间隔何时过去。计时器有设定的持续时间。计时器可以是重复或不重复的。
两种类型都可以手动“重置”(从头开始计算时间间隔)和暂停(即使你继续 tick 它们也不会前进)。
重复计时器在达到设定的持续时间后会自动重置。
使用 .finished() 来检测计时器是否已达到设定的持续时间。如果需要仅在达到持续时间的确切时刻进行检测,请使用 .just_finished()。
```Rust
fn spawn_small_circle(
mut commands: Commands,
big_circle_timers: Query<(Entity, &BigCircleTimer)>,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
for (entity, BigCircleTimer(timer)) in &big_circle_timers {
if timer.just_finished() {
let small_circle_handle = Mesh2dHandle(meshes.add(Circle::new(30.)));
for index in 0..12 {
let mut transform = Transform::from_translation(Vec3::X * 160.);
transform.translate_around(
Vec3::ZERO,
Quat::from_rotation_z(std::f32::consts::TAU * index as f32 / 12.),
);
let small_circle = commands
.spawn((
MaterialMesh2dBundle {
mesh: small_circle_handle.clone(),
material: materials.add(Color::Srgba(Srgba::interpolate(
&css::RED,
&css::BLUE,
index as f32 / 12.,
))),
transform,
..default()
},
SmallCircleStopwatch(Stopwatch::new()),
Name::new("Small Circle"),
))
.id();
commands.entity(entity).add_child(small_circle);
}
}
}
}
```
请注意,Bevy 的计时器与典型的现实生活中的计时器(倒计时至零)不同。Bevy 的计时器从零开始计时,并向设定的持续时间计时。它们基本上就像带有额外功能的秒表:最大持续时间和可选的自动重置功能。
= 5. Stopwatch (秒表)
Stopwatch 可以让你跟踪自某一点以来已经过去了多少时间。
它只会不断累积时间,你可以使用 .elapsed() / .elapsed_secs() 检查,你可以随时手动重置它。
```Rust
fn despawn_small_circles(
mut commands: Commands,
small_circles: Query<(Entity, &SmallCircleStopwatch)>,
) {
for (entity, SmallCircleStopwatch(stopwatch)) in &small_circles {
if stopwatch.elapsed_secs() > 3. {
commands.entity(entity).despawn();
}
}
}
``` |
|
https://github.com/mismorgano/UG-FunctionalAnalyisis-24 | https://raw.githubusercontent.com/mismorgano/UG-FunctionalAnalyisis-24/main/tareas/Tarea-08/Tarea-08.typ | typst | #import "../../config.typ": config, exercise, proof, cls, ip, conv
#show: doc => config([Tarea 8], doc)
#exercise[2.10][Sea $X$ un e.B, $f in S_(X^*)$. Muestra que para todo $x in X$ tenemos que $"dist"(x, f^(-1)(0)) = abs(f(x))$. ]
#proof[
Sea $x in X$, notemos que $f^(-1)(0) = {y in S_X: f(y) = 0}$
]
#exercise[2.11][Sea ${x_i}_(i=1)^n$ un conjunto linealmente independiente en un e.B y ${alpha_i}$ un conjunto de números reales.
Muestra que existe $f in X^*$ tal que $f(x_i)=alpha_i$ para $i = 1, dots, n$. ]
#exercise[2.14][Sea $A, B$ conjuntos convexos en un e.B $X$. Muestra que si $A subset B$ entonces $mu_B subset mu_A$.
Muestra que $mu_(c A)(x)= 1/c mu_A(x)$ para $c>0$. ]
#exercise[2.15][Sea $C$ un subconjunto convexo de un e.B real $X$ que contiene una vecindad del $0$ (entonces $mu_C$ es un).
Prueba lo siguiente:
+ Si $C$ es abierto, entonces $C = {x; mu_C(x) < 1}.$ Si $C$ también es cerrado, entonces $C = {x; mu_C(x) <= 1}$.
+ Existe $c>0$ tal que $mu_C(x) <= c norm(x)$.
+ Si $C$ es ademas simetrico, entonces $mu_C$ es una seminorma, es decir,
+ Si $C$ es ademas simetrico y acotado, entonces $mu_C$ es una norma equivalente a $norm(dot)_X$.
En particular, es completo, es decir, $(X, mu_C)$ es un e.B.]
#exercise[2.16][Sea $Y$ un subespacio de un e.B $X$ y $norm(dot)$ es una norma equivalente en $Y$.
Muestra que $norm(dot)$ puede ser extendida a una norma equivalente en $X$.]
#exercise[2.18][Muestra que si $Y$ es un subespacio de un e.B $X$ y $X^*$ es separable, entonces $Y^*$ también.]
#exercise[2.19][Muestra que $l_1$ no es isomorfo a un subespacio de $c_0$.] |
|
https://github.com/HarryLuoo/sp24 | https://raw.githubusercontent.com/HarryLuoo/sp24/main/431/hw/1/hw9.typ | typst | #set math.equation(numbering: "(1)")
#set page(margin: (x: 1cm, y: 1cm))
= HW 9, <NAME>
// 8.6 (d), 8.12, 8.22, 8.23, 8.36, 8.40 (a), 8.42, 8.48, 8.54
// Hints:
// For many of these problems the indicator method will help: write your random variable as a sum of (suitably chosen) indicators.
// 8.12 (a): Try to rewrite the integral as the integral of a PDF.
// 8.42: expand the fourth power of the sum and use independence and exchangeability to simplify the expression. You will have several types of terms, but many of them will have zero expectation.
= 8.6 (d)
$ E[(X+Y)^2] = E[X^2 + 2 X Y + Y ^2] &= E[X^2]+E[X Y] +E[Y^2] \
& = (2-p )/(p^2) + (2 n r)/(p) + n(n-1) r^2 + n r $
= 8.12
(a)
By definition, the MGF can be found by $
M_Z (t) = E(e^(t Z) ) &= integral_(0)^(infinity) e^(t z) lambda^2 z e^(- lambda z) dif z \
& = lambda^2 integral_(0)^(infinity) z e^((t - lambda) z) dif z \
$ <eq.8.12>
- if $lambda - t >0$, noticing the following expectation of an exp r.v. with parameter $lambda - t $ : $ integral_(0)^(infinity) z(lambda -t)e^(-(lambda -t))z dif z = 1/(lambda -t) $ @eq.8.12 becomes: $
M_Z (t) = lambda^2/(lambda - t)^2 $
- if $lambda - t <= 0$, the integral converges to infinity.
$
=> M_Z = cases((lambda)/(lambda - t) quad t < lambda, infinity quad t >= lambda )
$ <eq.1>
(b)
for X and Y, example 5.6 on textbook suggests that $
M_X (t) = M_Y (t) = cases(lambda/(lambda - t) quad t < lambda, infinity quad t >= lambda )
$
Given that X and Y are independent, $
M_(X+Y) = M_X(t) M_Y(t) = cases(lambda^2/(lambda - t)^2 quad t < lambda, infinity quad t >= lambda )
$ <eq.2>It is obvious that @eq.2 is the same as @eq.1, so the MGF of X+Y is the same as the MGF of Z. Thus X+Y has the same distribution as Z.
= 8.22
Considering the indicator method: let $I_j = 1 "or" 0 , j in [1,89]$ be the indicator of "among the five numbers, both j and j+1 are chosen".\ Since every time $j "and" j+1$ are chosen, they are next to each other in the ordered sample, so
$X = sum_(j=1)^(89) I_j $
$ E[X] = E[sum_(j=1)^(89) I_j ] = sum_(j=1)^(89) E[I_j] $
recognizing that
$
E[I_j] = P(j "and" j+1 "are chosen") = (binom(88,3))/(binom(90,5)) = 2/801
$
$ E[X] = (89*2)/(801) = 20/89 $
= 8.23
(a) Denote the color of the ith pick as $C_i$, then $C_1, C_2, ..., C_(50)$ are exchangeable. Thus, $
P(C_(28) eq.not C_(29)) = P(C_(28) = R, C_(29) = G) = 2P(C_1 = R, C_2 = G) = 2* (20*30)/(50*49) = 24/49
$
(b) Let $I_j$ be the indicator that $Y_j eq.not Y_(j+1), j= 1,2,...,49$
$X = I_1 + ... + I_(49)$, thus, $
E[X] = E[I_1] + ... + E[I_49] = 49* P(C_1 eq.not C_2) =49 * 24/49 = 24
$
= 8.36
(a) let $I_j$ be the indicator that the number j appears at least once in the four rolls. Then $X = I_1 + ... + I_6$. By exchangeability,$
E[X] = E[I_1] + ... + E[I_6] = 6 * E[I_1]
$ Since, $E[I_1] = P("1 appears in roll") = 1- P("no rolls with 1") = 1- (5/6)^4$, we have $
E[X] = 6 * (1- (5/6)^4) =671/216
$
(b) noticing that $I_j^2 = 1$ since I is either 1 or zero, and using exchangeability, $
E[X^2] = E[(I_1 + ... + I_6)^2] = E[I_1^2 + ... + I_6^2 + 2 I_1 I_2 + ... + 2 I_5 I_6] \ = sum_(j=1)^(6)E[I_j^2]+2 sum_(i<j<=6) E[I_i I_j]\ = 6 E[I_1^2] + 30 E[I_1 I_2]
$
TO find $E[I_1I_2]$, we use the inclusion-disclusion principle, $
E[I_1I_2] = P("1 and 2 both show up at least onece") \
= 1- P("1 does not show up") - P("2 does not show up") + P("1 and 2 both do not show up") \
= 1- ((5/6)^4 + (5/6)^4 - (4/6)^4) = 151/648
$
Thus, $ E[X^2] = 671/216 + 151/648 = 541/162 \
"var"[X] = E[X^2] - E[X]^2 approx 0.447 $
= 8.40 (a)
Using indiator method, let $I_k$ is the indicator for the event thta hte number k is drawn at least once in the 4 weeks. Then $X = I_1 + ... + I_90$. By exchangeability, $
E[X] = E[I_1] + ... + E[I_90] = 90 E[I_1] $
Considering that $
E[I_1] = P("1 is drawn at least once in 4 weeks") = 1 - P("1 is not drawn in 4 weeks") = 1 - (85/90)^4
$
$
=> E[X] = 90 (1 - (85/90)^4) approx 18.39
$
= 8.42
the fourth moment can be found as $
E[overline(X_n^4) ] = E[((X_1 + X_2 +...+X_n)/(n)) ^4] = 1/n^3 E[(X_1 + ... X_n)^4]
$
According to binomial theorem, $
E[overline(X_n^4)] &= 1/n^4 E[sum_k=1^n X_k^4 + 24 sum_(i<j< k < l) X_i X_j X_k X_l + 12 sum_(k<l, j eq.not k, j eq.not l) X_j^2 X_k^2 + 4 sum_(j eq.not k) X_j^3 X_k ] \
& = 1/n^3 E[X_1^4] + 24 binom(n,4) E[X_1X_2X_3X_4] + 12 binom(n,3) E[X_1^2 X_2 X_3] + 4 binom(n,2) E[X_1^3 X_2] + 6 binom(n,2) E[X_1^2 X_2^2]
$
by independence, we know $
E[X_1X_2X_3X_4] = E[X_1] E[X_2] E[X_3] E[X_4] = (E[X_1])^4=0\
E[X_1^2 X_2 X_3] = E[X_1^2] E[X_2] E[X_3] = 0\
E[X_1^3 X_2] = E[X_1^3] E[X_2] = 0\
E[X_1^2 X_2^2] = E[X_1^2] E[X_2^2] = E[X_1^2]^2
$
Therefore, $ E[overline(X_n^4)] = 1/n^3 E[X_1^4]+ (3n(n-1))/(n^4) E[X_1^2]^2 \
#rect(inset: 8pt)[
$ display(= (c)/(n^3)+ (3(n-1)a^2)/(n^3) )$
]
$
= 8.48
We can graph the joint pmf as follows:
#image("assets/2024-04-23-22-33-23.png")
From which we can find the marginals:
$
p_X (1) = 9/100, p_X (2) = 90/100, p_X (3) = 1/100\
p_Y (0) = 90/100, p_Y (1) = 9/100, p_Y (2) = 1/100
$
The expectance can be naturally found as $
E[X] = 48/25, E[Y] = 11/100, E[X Y] = 6/25\
"Cov" (X,Y) = E[X Y] - E[X] E[Y]= 18/625
$
= 8.54
(a) $
"var" (X) = E[X^2] - E[X]^2 = 5- 2^2 =1\
"var" (Y) = E[Y^2] - E[Y]^2 = 10-1 =9\
"Cov" (X,Y) = E[X Y] - E[X] E[Y] = 1- 2 = -1\
=> "Corr" (X,Y) = "Cov" (X,Y)/ sqrt("var" (X) "var" (Y)) = -1/3
$
(b)
Noticing $
"Cov" (X, X+c Y) = "Var" (X) + c "Cov"(X,Y) = 1+c
$ so when c = -1, the covariance is 0, and the r.v. $X$ and $X +c Y$ are not correlated
|
|
https://github.com/Godalin/Typst-Notations | https://raw.githubusercontent.com/Godalin/Typst-Notations/main/Short.typ | typst | // Shorthands for convenience
#let lam = math.lambda
#let eps = math.epsilon |
|
https://github.com/jamesrswift/typst-chem-par | https://raw.githubusercontent.com/jamesrswift/typst-chem-par/main/src/rules/greek.typ | typst | MIT License | #import "../stateful.typ": *
#import "../constants.typ"
#let greek(body) = context {
if-state-enabled( body , {
show: it => {
for (k, v) in constants.greek {
it = {show k + "-": v + "-"; it}
}
it
}
body
})
} |
https://github.com/MatheSchool/typst-g-exam | https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/manual/util.typ | typst | MIT License | #import "/src/lib.typ" as g-exam
/// Make the title-page
#let make-title() = {
let left-fringe = 39%
let left-color = blue.darken(30%)
let right-color = white
let url = "https://github.com/MatheSchool/typst-g-exam"
let authors = (
([<NAME>], "<EMAIL>"),
)
set page(
numbering: none,
background: place(
top + left,
rect(
width: left-fringe,
height: 100%,
fill: left-color
)
),
margin: (
left: left-fringe * 22cm,
top: 12% * 29cm
),
header: none,
footer: none
)
set text(weight: "bold", left-color)
show link: set text(left-color)
block(
place(
top + left,
dx: -left-fringe * 22cm + 5mm,
text(3cm, right-color)[g-exam]
) +
text(29pt)[exam template for Typst]
)
block(
v(1cm) +
text(
20pt,
authors.map(v => link(v.at(1), [#v.at(0)])).join("\n")
)
)
block(
v(2cm) +
text(
20pt,
link(
url,
[Version ] + [#g-exam.version]
)
)
)
pagebreak(weak: true)
}
/// Make chapter title-page
#let make-chapter-title(left-text, right-text, sub-title: none) = {
let left-fringe = 39%
let left-color = blue.darken(30%)
let right-color = white
set page(numbering: none, background: {
place(top + left, rect(width: left-fringe, height: 100%, fill: left-color))
}, margin: (left: left-fringe * 22cm, top: 12% * 29cm), header: none, footer: none)
set text(weight: "bold", left-color)
show link: set text(left-color)
block(
place(top + left, dx: -left-fringe * 22cm + 5mm,
text(3cm, right-color, left-text)) +
text(29pt, right-text))
block(
v(1cm) +
text(20pt, if sub-title != none { sub-title } else { [] }))
pagebreak(weak: true)
}
#let def-arg(term, t, default: none, description) = {
if type(t) == str {
t = t.replace("?", "|none")
t = `<` + t.split("|").map(s => {
if s == "b" {
`boolean`
} else if s == "s" {
`string`
} else if s == "i" {
`integer`
} else if s == "f" {
`float`
} else if s == "c" {
`coordinate`
} else if s == "d" {
`dictionary`
} else if s == "a" {
`array`
} else if s == "n" {
`number`
} else {
raw(s)
}
}).join(`|`) + `>`
}
stack(dir: ltr, [/ #term: #t \ #description], align(right, if default != none {[(default: #default)]}))
}
|
https://github.com/tingerrr/hydra | https://raw.githubusercontent.com/tingerrr/hydra/main/doc/examples/book/b.typ | typst | MIT License | #import "/doc/examples/template.typ": example
#show: example.with(book: true)
#include "content.typ"
|
https://github.com/linsyking/messenger-manual | https://raw.githubusercontent.com/linsyking/messenger-manual/main/sceneproto.typ | typst | #pagebreak()
= Scene Prototype <sceneproto>
It's common that there are multiple scenes and their contents are similar. For example, in the game #link("https://github.com/linsyking/Reweave/")[Reweave], there are many _levels_ and all of them are scenes with very similar functionalities. Do we really need to create a separate scene for every level?
Messenger scenes are flexible enough to make a scene virtual, or a _prototype_. Here prototype means that users can create real scene by calling a `genScene` function in the prototype by giving it some parameters it needs.
Take _Reweave_ as an example, all the game levels are generated from a single `SceneProto`. The data used to instantiate a scene prototype includes all the components, background items, player data, etc.
`SceneProto` is so useful that Messenger core provides some type sugar and helper functions, and Messenger CLI provides a handy command to create scene prototypes (sceneproto in short).
All the CLI commands we used before may add an extra `--proto` or `-p` argument to indicate that this scene/layer/component is created in `SceneProtos` directory instead of `Scenes` directory.
Besides, CLI adds a new command called "level". Users can create levels of sceneprotos:
```bash
messenger level <SceneProto Name> <Level Name>
```
This will create a scene added to `Scenes` directory and `AllScenes.elm` file.
== Example: Space Shooter
The source code is available at #link("https://github.com/linsyking/messenger-examples/tree/main/spaceshooter")[messenger examples].
Now let's design a space shooter game that have several levels but with the same type of player, enemy with different parameters.
We will only go through the most important part, other details are in the code.
=== Sceneproto and Layer Initialization
First, run the following commands to initialize the project:
```bash
messenger init spaceshooter
cd spaceshooter
messenger scene Game -p
messenger component Game Bullet -i -p
messenger component Game Enemy -i -p
messenger component Game Ship -i -p
messenger layer Game Main -c -i -p
messenger level Game Level1
```
Next, add layer `Main` to `Game`:
```elm
...
, layers =
[ Main.layer NullLayerMsg envcd
]
```
Let's first design the `InitData` of our scene and layer. Since we want each level to have different enemies and parameters, we may want to directly use a list of components as the `InitData`.
Add `InitData` in `SceneProtos/Game/Main/Init.elm`:
```elm
type alias InitData cdata scenemsg =
{ components : List (AbstractComponent cdata UserData ComponentTarget ComponentMsg BaseData scenemsg)
}
```
Note that we cannot use `SceneCommonData` or `SceneMsg`. The reason is cycle import explained in @init. Please read that diagram carefully.
Then we add this `InitData` to the `LayerMsg` of `Game` (`SceneProtos/Game/SceneBase.elm`):
```elm
import SceneProtos.Game.Main.Init as MainInit
...
type LayerMsg scenemsg
= MainInitData (MainInit.InitData SceneCommonData scenemsg)
| NullLayerMsg
```
For the same reason, we cannot use `SceneMsg`.
Define the `InitData` of the scene. Here it should be almost the same with the layer `InitData` (`SceneProtos/Game/Init.elm`).
```elm
type alias InitData scenemsg =
{ objects : List (LevelComponentStorage SceneCommonData UserData ComponentTarget ComponentMsg BaseData scenemsg)
}
```
Here `LevelComponentStorage` is a type sugar to store components that have initialized `Msg` but not `Env`. See the difference from its definition:
```elm
type alias ComponentStorage cdata userdata tar msg bdata scenemsg =
msg -> LevelComponentStorage cdata userdata tar msg bdata scenemsg
type alias LevelComponentStorage cdata userdata tar msg bdata scenemsg =
Env cdata userdata -> AbstractComponent cdata userdata tar msg bdata scenemsg
```
Finally, let's modify `Lib/Base.elm` to add the scene `InitData`:
```elm
import SceneProtos.Game.Init as GameInit
...
type SceneMsg
= GameInitData (GameInit.InitData SceneMsg)
| NullSceneMsg
```
It is here to use `SceneMsg`.
=== Component Base
After writing `Init` and `Base` for layers and scenes, let's deal with components.
We first define the `InitData` for all the components. For enemy, edit `SceneProtos/Game/Components/Enemy/Init.elm`:
```elm
type alias InitData =
{ id : Int
, velocity : Float
, position : ( Float, Float )
, sinF : Float
, sinA : Float
, bulletInterval : Int
}
```
Other two components are similar.
For bullet, the `CreateInitData` is used to create a new bullet during the game running. The `id` is determined by the layer so it's not in `CreateInitData`.
Finally, we write `SceneProtos.Game.Components.ComponentBase`:
```elm
import SceneProtos.Game.Components.Bullet.Init as Bullet
import SceneProtos.Game.Components.Enemy.Init as Enemy
import SceneProtos.Game.Components.Ship.Init as Ship
type ComponentMsg
= NewBulletMsg Bullet.CreateInitData
| CollisionMsg String
| GameOverMsg
| BulletInitMsg Bullet.InitData
| EnemyInitMsg Enemy.InitData
| ShipInitMsg Ship.InitData
| NullComponentMsg
-- You may add more here
type ComponentTarget
= Type String
| Id Int
type alias BaseData =
{ id : Int
, ty : String
, position : ( Float, Float )
, velocity : Float
, collisionBox : ( Float, Float )
, alive : Bool
}
```
Here we define the message type, target and the base data type.
=== Component Models
Now let's write model files for components. Here we only write the bullet model. Others are similar.
First, define the data type and `init` function:
```elm
type alias Data =
{ color : Color
}
init env initMsg =
case initMsg of
BulletInitMsg msg ->
( { color = msg.color }
, { id = msg.id
, position = msg.position
, velocity = msg.velocity
, alive = True
, collisionBox = ( 20, 10 )
, ty = "Bullet"
}
)
_ ->
( { color = Color.black }, emptyBaseData )
```
We need to initialize the base data in `init` function.
Then, for `update` function, we want the moving bullet to move a small step on every `Tick`.
```elm
update env evnt data basedata =
case evnt of
Tick dt ->
let
newBullet =
{ basedata | position = ( Tuple.first basedata.position + basedata.velocity * toFloat dt, Tuple.second basedata.position ) }
in
( ( data, newBullet ), [], ( env, False ) )
_ ->
( ( data, basedata ), [], ( env, False ) )
```
For `updaterec`, when a bullet hits a bullet, they should all disappear.
```elm
updaterec env msg data basedata =
case msg of
CollisionMsg "Bullet" ->
( ( data, { basedata | alive = False } ), [], env )
_ ->
( ( data, basedata ), [], env )
```
For `view`, we render a round rectangle with a given color. The `matcher` can match both `Id` and `Type`.
```elm
view env data basedata =
let
gd =
env.globalData
in
( Canvas.shapes [ fill data.color ]
[ roundRect (posToReal gd basedata.position) (lengthToReal gd 20) (lengthToReal gd 10) [ 10, 10, 10, 10 ]
]
, 0
)
matcher data basedata tar =
tar == Type basedata.ty || tar == Id basedata.id
```
=== Layer Model
The layer needs to manage all the components and handle the collisions.
Therefore, we first write a collision handler to deal with collisions. `updateCollision` will send `CollisionMsg` to components that have collisions. See the source code for how to implementing the collision updater.
```elm
updateCollision : Env SceneCommonData UserData -> List GameComponent -> ( List GameComponent, List (MMsgBase ComponentMsg SceneMsg UserData), Env SceneCommonData UserData )
```
Three helper functions are also used:
- `removeDead`: remove dead components
- `removeOutOfBound`: remove components that are out of bound
- `genUID`: generate a new unique ID from the list of components
In `SceneProtos.Game.Main.Model`, most part is easy to write. The `handleComponentMsg` that handles messages from component might be tricky. It needs to create new component if received `NewBulletMsg`.
```elm
import SceneProtos.Game.Components.Bullet.Model as Bullet
...
handleComponentMsg env compmsg data =
case compmsg of
SOMMsg som ->
( data, [ Parent <| SOMMsg som ], env )
OtherMsg msg ->
case msg of
NewBulletMsg initData ->
let
objs =
data.components
newBulletInitMsg =
BulletInitMsg
{ id = genUID objs
, position = initData.position
, velocity = initData.velocity
, color = initData.color
}
newBullet =
Bullet.component newBulletInitMsg env
newObjs =
newBullet :: objs
in
( { data | components = newObjs }, [], env )
_ ->
( data, [], env )
```
=== Sceneproto Model
We need to update the sceneproto model to initialize the components. See the source code for deatails.
=== Level Model
Lastly, we can implement a level:
```elm
import SceneProtos.Game.Components.Enemy.Model as Enemy
import SceneProtos.Game.Components.Enemy.Init as EnemyInit
import SceneProtos.Game.Components.Ship.Model as Ship
import SceneProtos.Game.Components.Ship.Init as ShipInit
import SceneProtos.Game.Init exposing (InitData)
import SceneProtos.Game.Model exposing (genScene)
...
init : RawSceneProtoLevelInit UserData SceneMsg (InitData SceneMsg)
init env msg =
Just (initData env msg)
initData : Env () UserData -> Maybe SceneMsg -> InitData SceneMsg
initData env msg =
{ objects =
[ Ship.component (ShipInitMsg <| ShipInit.InitData 0 ( 100, 500 ) 15)
, Enemy.component (EnemyInitMsg <| EnemyInit.InitData 1 ( -1 / 15 ) ( 1920, 1000 ) 50 10 25)
]
}
```
Note that `env` is not used to initialize the components. This is because component initialization needs common data and that should happen during the initialization of the sceneproto. |
|
https://github.com/barddust/Kuafu | https://raw.githubusercontent.com/barddust/Kuafu/main/src/Analysis/build.typ | typst | #{
import "/config.typ": project
import "/mathenv.typ": *
show: mathenv-init
project(
"夸父:数学分析",
"0.1",
"Analysis",
(
"intro.typ",
"natural.typ",
"integer.typ",
"rational.typ",
"real.typ",
"sequence.typ"
),
bio: false
)
}
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/raw-08.typ | typst | Other | // Unterminated.
// Error: 2:1 expected 1 backtick
`endless
|
https://github.com/hrmnjt/resume | https://raw.githubusercontent.com/hrmnjt/resume/main/cover-letter.typ | typst | Apache License 2.0 | // Copyright 2020-2023 <NAME>
// This work is licensed under a Creative Commons
// Attribution-NonCommercial-ShareAlike 4.0 International License.
// Terms - https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
// GLOBAL STYLING
// using A4 page size and setting a 1.5cm square margin
#set page(
paper: "a4",
margin: (x: 1.5cm, y: 1.5cm),
)
// all links are underlined
#show link: underline
<NAME> \
<EMAIL>`@`<EMAIL> \
+971-50-393-7005
2023-05-06
Hiring Manager \
Canonical
Dear Hiring Manager,
I am writing to apply for the X position at Y. With a Bachelor's degree in Engineering and over 9 years of experience in data engineering, data science, AI/ML, software development, and team leadership, I am confident that I have the qualifications and expertise required to excel in this role.
In my current position as an Engineering Manager (Data) at Majid Al Futtaim, I lead Core Data team responsible to manage central data infrastructure for MAF. I've a knack for building and scaling highly productive teams, systems and data products. I'm passionate about open source, developer experience and systems engineering. Consistently promoted and selected among top 1% performers, resulting in continious development and role expansion.
What sets me apart as an engineering manager is my ability to balance technical expertise with strong leadership and communication skills. I am passionate about mentoring and developing team members to reach their full potential, and have a reputation for creating a positive and productive work environment. I believe that my ability to build strong relationships with cross-functional teams, stakeholders, and clients would enable me to drive success at Y.
I am excited about the opportunity to bring my skills and experience to Y and contribute to its growth and success. Thank you for your time and consideration, and I look forward to hearing from you soon.
Sincerely,\
<NAME> (Harman)
|
https://github.com/MALossov/YunMo_Doc | https://raw.githubusercontent.com/MALossov/YunMo_Doc/main/template/report_title.typ | typst | Apache License 2.0 | #import "font.typ": *
#import "../contents/info.typ": *
#let report_title(title: "", authors: (), body) = {
// Set the document's basic properties.
set document(author: authors, title: title)
// Set run-in subheadings, starting at level 3.
show heading: it => {
if it.level > 2 {
parbreak()
text(11pt, style: "italic", weight: "regular", it.body + ".")
} else {
it
}
}
// Title row.
align(center)[
#block(text(font: songti, weight: 700, 1.75em, title))
]
// Author information.
set text(font: songti, weight: 400, 1.25em)
pad(
top: 0.5em,
bottom: 0.5em,
x: 2em,
grid(
columns: (1fr,) * (calc.min(3, authors.len())),
gutter: 1em,
..authors.map(author => align(center, strong(author)+";")),
),
)
}
#show: report_title.with(
title: ReportTitle,
authors: Authors,
) |
https://github.com/AU-Master-Thesis/thesis | https://raw.githubusercontent.com/AU-Master-Thesis/thesis/main/sections/3-methodology/study-1/mod.typ | typst | MIT License | #import "../../../lib/mod.typ": *
== #study.H-1.full.n <s.m.study-1>
// This section will cover the approach chosen for reproducing the software implementation in the gbpplanner paper@gbpplanner. Focus is put on arguing for places where the internal workings of the reimplementation differs. Why the difference is either deemed necessary due to inherent differences in the capabilities of the programming languages, or why they are seen as desireable/ an improvement. Where multiple different solutions are feasible to solve the same issue comparative arguments are presented to reason for the selected solution.
// #jonas[Do you think it is very important in these "Study" (or "Contribution" as Andryi might want us to call it) which Hypothesis it tries to answer, even though it is made clear earlier that Study 1 = Hypothesis 1]
// This sections outlines the methodology for the fourth study; #study.H-4.name. Firstly, @s.m.configuration describes how the simulation tool, environment, and robot spawning has been parameterized through several configuration files. Thereafter, @s.m.simulation-tool details the developed simulation tool itself, and how to interact with it.
// #jonas[The ordering of these subsections might be confusing as the merge has been done somewhat crudely. No need to read it all again, but it would be nice to get feedback on what order to do what in. The configuration and tooling/user experience aspects first or the reproduction aspects?]
// OLD
// The methodology for developing an extensive simulation tool is outlined in this section. It is described how this tool is made capable of replicating the software implementation described in the #gbpplanner paper@gbpplanner. The section details the differences in the reimplementation, justifying necessary deviations due to distinct capabilities or limitations of the programming language used as well as the chosen framework and libraries. For issues where multiple solutions are viable, comparative analyses are provided to justify the choice of the selected solution. As such _Research Objectives_ #boxed(color: theme.teal, [*O-1.1.1*]) through #boxed(color: theme.teal, [*O-1.6.1*])#note.j[make sure these are correct] are addressed in this section. The extensive usability and configurability improvements are described in sections #numref(<s.m.configuration>) and #numref(<s.m.simulation-tool>), respectively.
// Re-formulate with this order:
// Introduce things in this order:
// 1. talk about the simulation tool and its capabilities
// 2. talk about the configuration and how it is used to set up the simulation tool and integrated with it
// 3. talk about the mathematics of the reproduction
// 4. introduce the chosen language and why before talking about more code-heavy stuff
// 5. more code-heavy stuff -> architecture, data structures such as the graph representation and factor structure
// Re-formulation:
The methodology for developing the extensive simulation tool #acr("MAGICS"); with the goal of being capable of replicating the results of the #gbpplanner, is explained in this section. First, in sections #numref(<s.m.simulation-tool>) and #numref(<s.m.configuration>), the simulator, its internal and external design, and the configuration of it are described, providing closure for #boxed(color: theme.green, [*O-1.2.1*])-#boxed(color: theme.green, [*O-1.4.1*]). Then in @s.m.factor-graph, the mathematical methodology for the factor graph representation is detailed, thus answering #boxed(color: theme.green, [*O-1.1.2*]). Finally, @s.m.language introduces the chosen programming language, and presents arguments for the choice, completing #boxed(color: theme.green, [*O-1.1.1*]). After the language is introduced, some important implementation decision are detailed in #numref(<s.m.factor-structure>). This part also details the differences in the reimplementation, justifying necessary deviations due to distinct capabilities or limitations of the programming language used as well as the chosen frameworks and libraries. For issues where multiple solutions are viable, comparative analyses are provided to justify the choice of the selected solution. Research objective #boxed(color: theme.green, [*O-1.1.3*]) depends on the results and will be answered in @s.r.study-1, and the corresponding discussion.
// As such _Research Objectives_ #boxed(color: theme.green, [*O-1.1.1*])#att[Maybe explain exactly which objectives are done by each subsection] through #boxed(color: theme.green, [*O-1.4.1*]) are addressed in this section.
#include "simulation.typ"
#include "configuration.typ"
#include "factors.typ"
#include "language.typ"
// #include "architecture.typ"
// #include "graph-representation.typ"
#include "factor-structure.typ"
#include "variable-structure.typ"
#include "algorithm.typ"
|
https://github.com/WhiteBlackGoose/typst-hello-world | https://raw.githubusercontent.com/WhiteBlackGoose/typst-hello-world/master/README.md | markdown | ## Get typst and make
Either by whatever or just with
```
nix develop
```
## Make
```
make
```
|
|
https://github.com/lonkaars/typst-metalogo | https://raw.githubusercontent.com/lonkaars/typst-metalogo/master/README.md | markdown | MIT License | # typst-metalogo
Typeset LaTeX compiler logos in [typst](https://github.com/typst/typst).
## usage
From [./demo.typ](./demo.typ):
```typ
#import "@preview/metalogo:1.0.2": TeX, LaTeX, XeLaTeX, XeTeX, LuaLaTeX
#LaTeX is a typestting program based on #TeX. Some people use #XeLaTeX
(sometimes #XeTeX), or #LuaLaTeX to typeset their documents.
People who are afraid of #LaTeX and its complex macro system may use typst
instead.
```
Output:

|
https://github.com/ohmycloud/computer-science-notes | https://raw.githubusercontent.com/ohmycloud/computer-science-notes/main/Misc/two_columns.typ | typst | // #set par(first-line-indent: 2em)
#show heading.where(level: 2): it => {
[#it.body]
}
#let boxed_text(body: none, color: luma(240)) = {
set text(weight: "regular")
show: box.with(
fill: color,
inset: 0.4em,
radius: 3pt,
baseline: 0.4em,
width: 100%,
)
[#body]
}
#show heading.where(level: 1): it => {
align(left)[#boxed_text(body: text(red)[ *#it*])]
v(0.75em)
}
#let h = locate(loc => {
let heading1 = query(
selector(heading.where(level: 1)).after(loc),
loc,
)
let p = heading1.first().location().position()
let pos = (
x: p.x,
y: p.y
)
pos
})
// 分隔线
#let separator_line() = {
line(
start: (0pt, 0pt),
end: (0pt, 600pt),
length: 0pt,
angle: -270deg,
stroke: (paint: rgb(167, 178, 189), thickness: 1pt, dash: ("dot", 1pt, 2pt, 2pt))
)
}
#let multi_row_items(array) = grid(
columns: 1fr,
rows: (1fr,) * (array.len() - 1),
..array.map(x => boxed_text(body: x))
)
// 左侧页面
#let left_page(body) = {
show heading.where(level: 1): it => {
boxed_text(body: it.body)
}
locate(loc => {
let titles = query(heading.where(level: 1).before(loc), loc)
let titles = titles.map(x => x.body)
if (titles.len() > 0) {
multi_row_items(titles)
}
else {
multi_row_items(("第一", "第二", "谁"))
}
})
}
// 右侧页面
#let right_page(body) = {
show heading.where(level: 1): it => {
boxed_text(body: it.body)
}
locate(loc => {
let titles = query(heading.where(level: 1).before(loc), loc)
let titles = titles.map(x => x.body)
if (titles.len() > 0) {
multi_row_items(titles)
}
else {
multi_row_items(("第一", "第二", "谁"))
}
})
}
#let header(title: none) = {
set text(size: 18pt, fill: red)
boxed_text(body: title)
show label("b"): set text(red)
}
#let make_pages(title: none, body) = {
header(title: title)
grid(
columns: (6fr, -1fr, 4fr),
column-gutter: (6fr, 1fr),
left_page(body),
separator_line(),
right_page(body)
)
}
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/chronos/0.1.0/src/group.typ | typst | Apache License 2.0 | #import "@preview/cetz:0.2.2": draw
#import "consts.typ": *
#let _grp(name, desc: none, type: "default", elmts) = {
return ((
type: "grp",
name: name,
desc: desc,
grp-type: type,
elmts: elmts
),)
}
#let render(x0, x1, y0, y1, group) = {
let shapes = ()
let name = text(group.name, weight: "bold")
let m = measure(box(name))
let w = m.width / 1pt + 15
let h = m.height / 1pt + 6
shapes += draw.rect(
(x0, y0),
(x1, y1)
)
shapes += draw.merge-path(
fill: COL-GRP-NAME,
close: true,
{
draw.line(
(x0, y0),
(x0 + w, y0),
(x0 + w, y0 - h / 2),
(x0 + w - 5, y0 - h),
(x0, y0 - h)
)
}
)
shapes += draw.content(
(x0, y0),
name,
anchor: "north-west",
padding: (left: 5pt, right: 10pt, top: 3pt, bottom: 3pt)
)
if group.desc != none {
shapes += draw.content(
(x0 + w, y0),
text([\[#group.desc\]], weight: "bold", size: .8em),
anchor: "north-west",
padding: 3pt
)
}
return shapes
} |
https://github.com/k0tran/typst | https://raw.githubusercontent.com/k0tran/typst/sisyphus/vendor/svg2pdf/CHANGELOG.md | markdown | # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.10.0]
### Added
- Added ability to list the available fonts found by svg2pdf. Thanks to [@rgreinho](https://github.com/rgreinho).
- Added support for filter rendering.
- `usvg` is now reexported to prevent version mismatches.
### Fixed
- Fixed dpi ratio calculation. Thanks to [@Ultraxime](https://github.com/Ultraxime).
### Changed
- Bumped resvg to v0.38 and fontdb to 0.16.
- (Internal) reworked the test suite.
- (Internal) synced test suite with resvg test suite.
[Unreleased]: https://github.com/typst/svg2pdf/compare/v0.10.0...HEAD
[0.10.0]: https://github.com/typst/svg2pdf/compare/v0.9.1...v0.10.0
|
|
https://github.com/dashuai009/dashuai009.github.io | https://raw.githubusercontent.com/dashuai009/dashuai009.github.io/main/src/content/blog/022.typ | typst | #let date = datetime(
year: 2022,
month: 3,
day: 14,
)
#metadata((
title: "生成函数",
subtitle: [生成函数,math],
author: "dashuai009",
description: "生成函数",
pubDate: date.display(),
))<frontmatter>
#import "../__template/style.typ": conf
#show: conf
== 普通生成函数
<普通生成函数>
$ F (x) = sum_n a_n a^n (n gt.eq 0) $
=== 等比数列
<等比数列>
数列$< 1 , p , p^2 , p^3 , . . . , p^n , . . . >$的生产成函数$F (x) = sum_(n gt.eq 0) p^n x^n$的封闭式为$F (x) = frac(1, 1 - p x)$
=== $a = < 1 , 2 , 3 , 4 . . . >$
<a1234...>
生成函数 $ F (x) & = sum_(n gt.eq 0) (n + 1) x^n\
& = sum_(n gt.eq 1) n x^(n - 1)\
& = sum_(n gt.eq 0) (x^n) prime\
& = (frac(1, 1 - x)) prime\
& = 1 / (1 - x)^2 $
=== $binom(m, n)$,($n gt.eq 0 , m$是常数)
<m-choose-nngeq-0m是常数>
$ F (x) = sum_(n gt.eq 0) binom(m, n) x^n = (1 + x)^m $
=== $binom(m + n, n)$
<mn-choose-n>
$ F (x) = sum_(n gt.eq 0) binom(m + n, n) x^n = 1 / (1 - x)^(m + 1) $
=== 斐波那其数列 $a_0 = 0 , a_1 = 1 , a_n = a_(n - 1) + a_(n - 2) (n > 1)$
<斐波那其数列-a_00a_11a_na_n-1a_n-2n1>
$
F (x) & = x F (x) + x^2 F (x) - a_0 x + a_1 x + a_0\
& = frac(x, 1 - x - x^2)
$
通过求解 $ frac(A, 1 - a x) + frac(B, 1 - b x) = frac(x, 1 - x - x^2) $
得
$ frac(x, 1 - x - x^2) = sum_(n gt.eq 0) x^n 1 / sqrt(5) ((frac(1 + sqrt(5), 2))^n - (frac(1 - sqrt(5), 2))^n) $
== 指数生产成函数(exponential generating function,EGF)
<指数生产成函数exponential-generating-functionegf>
$ hat(F) (x) = sum_(n gt.eq 0) a_n frac(x^n, n !) $ \#\#\# 运算
$
hat(F) (x) hat(G) (x) & = sum_(i gt.eq 0) a_i frac(x^i, i !) sum_(j gt.eq 0) b_j frac(x^j, j !)\
& = sum_(n gt.eq 0) x^n sum_(i = 1)^n a_i b_(n - i) frac(1, i ! (n - i) !)\
& = sum_(n gt.eq 0) frac(x^n, n !) sum_(i = 0)^n binom(n, i) a_i b_(n - i)
$
因此 $hat(F) (x) hat(G) (x)$ 是序列
$< sum_(i = 0)^n binom(n, i) a_i b_(n - i) >$ 的指数生成函数。
=== $< 1 , 1 , 1 , 1 , . . . >$
<section>
$ sum_(n gt.eq 1) frac(x^n, n !) = e^x $
=== $< 1 , p , p^2 , . . . >$
<pp2...>
$ sum_(n gt.eq 1) frac(p^n x^n, n !) = e^(p x) $
=== $a_n = n !$
<a_nn>
$ hat(P) (x) = sum_(n gt.eq 0) frac(n ! x^n, n !) = sum_(n gt.eq 0) x^n = frac(1, 1 - x) $
=== 圆排列
<圆排列>
$ hat(Q) (x) = sum_(n gt.eq 1) frac((n - 1) ! x^n, n !) = sum_(n gt.eq 1) x^n / n = - ln (1 - x) = ln (frac(1, 1 - x)) $
=== 圆排列与排列的关系
<圆排列与排列的关系>
=== 生成树计数
<生成树计数>
如果 $n$ 个点 #strong[带标号] 生成树的 EGF 是 $hat(F) (x)$ ,那么 $n$
个点 #strong[带标号] 生成森林的 EGF 就是$e x p hat(F) (x)$
——直观理解为,将 $n$
个点分成若干个集合,每个集合构成一个生成树的方案数之积。
=== 图
<图>
如果 $n$ 个点带标号无向连通图的 EGF 是 $hat(F) (x)$,那么 $n$
个点带标号无向图的 EGF 就是 $e x p hat(F) (x)$,后者可以很容易计算得到
$e x p hat(F) (x) = sum_(n gt.eq 0) 2^(binom(n, 2)) frac(x^n, n !)$。因此要计算前者,只需要一次多项式 $ln$ 即可。
=== 错排数:长度为 $n$ 的一个错排是满足 $p_i eq.not i$ 的排列。
<错排数长度为-n-的一个错排是满足-p_ine-i-的排列>
=== 不动点:
<不动点>
有多少个映射
$f : 1 , 2 , dots.h.c , n arrow.r 1 , 2 , dots.h.c , n$,使得
$
underbrace(f circle.stroked.tiny f circle.stroked.tiny dots.h.c circle.stroked.tiny f, k) = underbrace(f circle.stroked.tiny f circle.stroked.tiny dots.h.c circle.stroked.tiny f, k - 1)
$
$n k lt.eq 2 times 10^6 , 1 lt.eq k lt.eq 3$。
考虑 $i$ 向 $f (i)$ 连边。相当于我们从任意一个 $i$ 走 $k$ 步和走 $k - 1$
步到达的是同一个点。也就是说基环树的环是自环且深度不超过
$k$(根结点深度为
$1$)。把这个基环树当成有根树是一样的。因此我们的问题转化为:$n$
个点带标号,深度不超过 $k$ 的有根树森林的计数。
考虑 $n$ 个点带标号深度不超过 $k$ 的有根树,假设它的生成函数是
$hat(F_k) (x) = sum_(n gt.eq 0) f_(n , k) frac(x^n, n !)$。
考虑递推求 $hat(F_k) (x)$。深度不超过 $k$ 的有根树,实际上就是深度不超过
$k - 1$ 的若干棵有根树,把它们的根结点全部连到一个结点上去。因此
$ hat(F_k) (x) = x exp hat(F)_(k - 1) (x) $
那么答案的指数生成函数就是 $exp hat(F)_k (x)$。求它的第 $n$ 项即可。
=== Lust
<lust>
给你一个 $n$ 个数的序列 $a_1 , a_2 , dots.h.c , a_n$,和一个初值为 $0$
的变量 $s$,要求你重复以下操作 $k$ 次:
- 在 $1 , 2 , dots.h.c , n$ 中等概率随机选择一个 $x$。
- 令 $s$ 加上 $product_(i eq.not x) a_i$。
- 令 $a_x$ 减一。
求 $k$ 次操作后 $s$ 的期望。
$1 lt.eq n lt.eq 5000 , 1 lt.eq k lt.eq 10^9 , 0 lt.eq a_i lt.eq 10^9$。
假设 $k$ 次操作后 $a_i$ 减少了 $b_i$,那么实际上
$ s = product_(i = 1)^n a_i - product_(i = 1)^n (a_i - b_i) $
因此实际上我们的问题转化为,求 $k$ 次操作后
$product_(i = 1)^n (a_i - b_i)$ 的期望。
不妨考虑计算每种方案的的 $product_(i = 1)^n (a_i - b_i)$ 的和,最后除以
$n^k$。
而 $k$ 次操作序列中,要使得 $i$ 出现了 $b_i$ 次的方案数是
$ frac(k !, b_1 ! b_2 ! dots.h.c b_n !) $
这与指数生成函数乘法的系数类似。
设 $a_j$ 的指数生成函数是
$ F_j (x) = sum_(i gt.eq 0) (a_j - i) frac(x^i, i !) $
那么答案就是
$ [x^k] product_(j = 1)^n F_j (x) $
为了快速计算答案,我们需要将 $F_j (x)$ 转化为封闭形式:
$
F_j (
x
) & = sum_(i gt.eq 0) a_j frac(x^i, i !) - sum_(i gt.eq 1) frac(x^i, (i - 1) !) med & = a_j e^x - x e^x med & = (
a_j - x
) e^x
$
因此我们得到
$ product_(j = 1)^n F_j (x) = e^(n x) product_(j = 1)^n (a_j - x) $
其中 $product_(j = 1)^n (a_j - x)$ 是一个 $n$
次多项式,可以暴力计算出来。假设它的展开式是
$sum_(i = 0)^n c_i x^i$,那么
$
product_(j = 1)^n F_j (x) & = (sum_(i gt.eq 0) frac(n^i x^i, i !)) (sum_(i = 0)^n c_i x^i) med \
& = sum_(i gt.eq 0) sum_(j = 0)^i c_j x^j frac(n^(i - j) x^(i - j), (i - j) !) med \
& = sum_(i gt.eq 0) frac(x^i, i !) sum_(j = 0)^i n^(i - j) i^(underline(j)) c_j
$
计算这个多项式的 $x^k$ 项系数即可。 |
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/04-opentype/exploring/exploring.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/components.typ": note
#import "/lib/glossary.typ": tr
#show: web-page-template
// ## Exploring OpenType with `ttx`
== 借助 `ttx` 探索 OpenType 字体
// To begin investigating how OpenType works, I started by creating a completely empty font in Glyphs, turned off exporting all glyphs apart from the letter "A" - which has no paths - and exported it as an OpenType file. Now let's prod at it with `ttx`.
在开始研究OpenType的工作原理之前,我使用 Glyphs 软件制作了一个完全空白的OpenType字体文件,它除了一个空白的A之外不包含任何其他#tr[glyph]。我们就把它作为`ttx`工具的第一个目标。
// First, let's list what tables we have present in the font:
首先,我们列出这个字体中的所有数据表:
```bash
$ ttx -l TTXTest-Regular.otf
Listing table info for "TTXTest-Regular.otf":
tag checksum length offset
---- ---------- ------- -------
CFF 0x187D42BC 292 1088
GSUB 0x00010000 10 1380
OS/2 0x683D6751 96 280
cmap 0x00140127 72 984
head 0x091C432A 54 180
hhea 0x05E10189 36 244
hmtx 0x044C005D 8 236
maxp 0x00025000 6 172
name 0x6BFD9C8F 606 376
post 0xFFB80032 32 1056
```
// All apart from the first two tables in our file are required in every TrueType and OpenType font. Here is what these tables are for:
除了最上面的两个之外,其他所有数据表对于所有TrueType和OpenType字体来说都是必须的。这些数据表的作用如下:
#align(center, table(
columns: 2,
align: left,
[`OS/2`], [
// glyph metrics used historically by OS/2 and Windows platforms
因为历史原因,OS/2和Windows平台使用此表中的#tr[glyph]#tr[metrics]
],
[`cmap`], [
// mapping between characters and glyphs
#tr[character]到#tr[glyph]的映射表
],
[`head`], [
// basic font metadata
字体的基础元数据
],
[`hhea`], [
// basic information for horizontal typesetting
用于水平#tr[typeset]的基础信息
],
[`hmtx`], [
// horizontal metrics (width and left sidebearing) of each character
每个#tr[character]的水平#tr[metrics](比如宽度和左#tr[sidebearing])
],
[`maxp`], [
// information used by for the font processor when loading the font
字体处理器加载这个字体时的所需信息
],
[`name`], [
// a table of "names" - textual descriptions and information about the font
名称表,储存了关于这个字体的各种文本描述信息
],
[`post`], [
// information used when downloading fonts to PostScript printers
当字体加载到PostScript打印机上时使用的信息
]
))
// OpenType fonts have two distinct ways of representing glyph outline data: PostScript strings and TrueType outlines. In general, PostScript strings are used, but TrueType is also an option. (You will see a lot of this dual nature of OpenType throughout the chapter, based on the dual heritage of OpenType fonts.)
OpenType 字体支持使用两种不同的方式来表达#tr[glyph]#tr[outline]数据,分别是PostScript表示法和TrueType表示法,其中PostScript表示法更加常用。(你会在后文中看到,由于OpenType同时继承了两种古老的技术遗产,所以存在大量的这种双标准共存现象。)
//So the first table, `CFF`, is required if the outlines of the font are represented as PostScript CFF strings; a font using TrueType outlines will have a different set of tables instead (`cvt`, `fpgm`, `glyf`, `loca` and `prep`, which we will look at later).
`ttx`工具列出的第一个数据表`CFF`在使用PostScript表示法时是必须的,它使用PostScript CFF 字符串来储存#tr[outline]信息。如果使用的是TrueType表示法,则会有一系列其他的数据表(具体来说有`cvt`、`fpgm`、`glyf`、`loca`和`prep`,后文会进行介绍)。
// The second table in our list, `GSUB`, is one of the more exciting ones; it's the *glyph substitution* table which, together with `GPOS` (*glyph positioning*), stores most of the OpenType smarts. We will discuss these two tables and what they can do in the next chapter.
第二个数据表叫做`GSUB`,它是这些表中比较有趣的一个。它的全称是#tr[glyph]#tr[substitution](glyph substitution)表,和另一个#tr[glyph]#tr[positioning](glyph positioning)表一起完成了OpenType的绝大多数智能特性。这两个表我们会单独在下一章中介绍。
// So those are the tables in our completely empty font. Now let us examine those tables by turning the whole font into an XML document:
这就是我们自制的空白字体里的所有数据表了。现在我们将其转化为XML文档:
```bash
$ ttx TTXTest-Regular.otf
Dumping "TTXTest-Regular.otf" to "TTXTest-Regular.ttx"...
Dumping 'GlyphOrder' table...
Dumping 'head' table...
Dumping 'hhea' table...
Dumping 'maxp' table...
Dumping 'OS/2' table...
Dumping 'name' table...
Dumping 'cmap' table...
Dumping 'post' table...
Dumping 'CFF ' table...
Dumping 'GSUB' table...
Dumping 'hmtx' table...
```
// This produces a `ttx` file, which is the XML representation of the font, containing the tables mentioned above. But first, notice we have a new table, which did not appear in our list - `GlyphOrder`. This is not actually part of the font; it's an artefact of TTX, but it's pretty helpful. It tells us the mapping that TTX has used between the Glyph IDs in the font and some human readable names. Looking at the file we see the table as follows:
这个命令生成了一个后缀为`ttx`的文件,他就是整个字体的XML形式,上述所有数据表的信息都包含在内。但首先我们发现这里出现了一个我们没见过的数据表,`GlyphOrder`。这个表并不是字体文件的内容,它是由`ttx`生成的。但它很有用,它能告诉我们字体中每个#tr[glyph]的人类可读名称对应的ID是多少。文件中这个表的内容如下:
```xml
<GlyphOrder>
<!-- id 属性仅供人类阅读使用,当程序解析时将被忽略 -->
<GlyphID id="0" name=".notdef"/>
<GlyphID id="1" name="A"/>
</GlyphOrder>
```
#let line-height-image = f => context {
let line-height = measure([X]).height
box(height: line-height)[#image(f)]
}
// Here we see our exported glyph `A`, and the special glyph `.notdef` which is used when the font is called upon to display a glyph that is not present. The Glyphs software provides us with a default `.notdef` which looks like this: 
这里我们看到#tr[glyph]`A`被导出了,除此之外还有一个特殊的#tr[glyph]`.notdef`。这个特殊#tr[glyph]会在字体里没有某个#tr[glyph]时使用。Glyphs 软件为我们提供了一个默认的 `.notdef` #tr[glyph],显示出来会是这样:#text(font: ("TTX Test", ))[?]
// The `post` and `maxp` tables are essentially *aides memoire* for the computer; they are a compilation of values automatically computed from other parts of the font, so we will skip over them. The `GSUB` table in our font is empty, so we will not deal with it here, but will return to it when we consider OpenType features.
`post`和`maxp`表在计算机上没什么作用,它们基本上只是根据字体的其他部分计算出来的一堆数值,这里略过不介绍。我们字体的`GSUB`表是空的,所以也没有什么能讲解的,但后面介绍OpenType特性时我们会再用到它。
|
https://github.com/PhilChodrow/cv | https://raw.githubusercontent.com/PhilChodrow/cv/main/src/content/talks.typ | typst | #import "../template.typ": *
#cvSection("Invited Talks")
#box(height: 55em,
columns(2, gutter: 16pt)[
#miniheader("Dynamics of Gender Representation in Professional Mathematics")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2024], [Tufts University Applied Mathematics Seminar],
)
#miniheader("Connection, Computation, and Complex Systems in Undergraduate Education")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2024], [Conference on Network Science (NetSci)],
)
#miniheader("Edge-Correlated Growing Hypergraphs")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2024], [BRAINS Seminar: Bridging AI, Networks and Hypergraphs],
)
#miniheader("Challenges and Opportunities in Hypergraph Network Data Science")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2023], [Vermont-KIAS Workshop on Group Interactions in Network Science],
[2023], [Joint Math Meetings: Special Session on Hypergraph Data Science]
)
#miniheader("Feedback Loops from Ranking in Networks")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2023], [Smith College Mathematics Seminar],
[2021], [REU on Kaczmarz Methods for Large‑Scale Data Analysis, Claremont Colleges],
[2021], [UCLA Undergraduate Mathematics Student Association],
)
#miniheader("Eigenvector Methods for Clustering Nonuniform Hypergraphs")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2024], [Toronto Metropolitan University Network Science Seminar],
[2023], [University of Vermont Joint Lab Seminar],
[2022], [Oxford University Networks Seminar],
[2022], [Swarthmore College Mathematics Seminar],
[2021], [Canadian Mathematical Society Winter Meeting],
[2021], [UCLA Undergraduate Mathematics Student Association],
[2021], [Claremont Center for the Mathematical Sciences],
)
#miniheader("Generative Hypergraph Clustering: Scalable Hueristics and Sparse Thresholds")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2023], [University of Edinburgh Informatics Seminar],
[2023], [University of Glasgow Computer Science Seminar],
[2022], [Middlebury College Computer Science Seminar],
[2022], [Colgate University Computer Science Seminar],
[2022], [Wesleyan University Computer Science Seminar],
[2021], [Grinnell College Computer Science Seminar],
[2021], [Conference on Network Science (NetSci): Satellite on Higher-Order Models in Network Science],
[2021], [Association for the Advancement of Artificial Intelligence (AAAI): Workshop on Graphs and Complex Structures for Learning and Reasoning]
)
#miniheader("Random Graphs for Data Science")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2020], [UCLA Network Science Seminar],
[2020], [MIT ORC Student Seminar],
[2019], [Northeastern University Network Science Seminar],
)
#miniheader("Public Talks: Data Science and AI")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2023], [Middlebury DLINQ Summer Workshop],
[2023], [Middlebury TEDx],
[2023], [Middlebury Faculty At Home]
)
]
)
#set rect(
inset: 8pt,
fill: rgb("ffffff"),
width: 100%,
)
#pagebreak()
#cvSection("Other Professional Events")
#grid(
columns: (50%, 50%),
rows: (auto),
gutter: 3pt,
rect[
#miniheader("Invited Panels")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2022], [Panel on Academic Job Interviews \ _Pomona REU_],
[2022], [Data Science and the Social Sciences \ _UCLA Data Science Union_ ],
[2021], [Early-Career Research Panel \ _Northeastern Regional Conference on Complex Systems_],
[2021], [Perspectives on Graphs and Complex Structures for Learning and Reasoning \ _AAAI_]
)
],
rect[
#miniheader("Workshop Participation")
#table(
columns: 2,
stroke: none,
align: (right, left),
[2023], [Data Science and Social Justice: Networks, Policy, and Education \ _ICERM_],
[2023], [AMS Mathemematics Research Community: Mathematics of Complex Social Systems],
[2022], [Data Science and Social Justice: Networks, Policy, and Education \ _ICERM_],
[2022], [AMS Mathemematics Research Community: Models and Methods for Sparse (Hyper)Network Science]
)
]
) |
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas2/2_Utorok.typ | typst | #let V = (
"HV": (
("", "Jehdá ot dréva", "Jedíne bezhríšne Christé, jedíne nezlóbivyj, jedíne istóčniče bláhosti, vížď mojé sťisnénije, vížď skórb mojú: i jázvy strúp mojích očísti vsjá i mílostiju tvojéju spasí rabá tvojehó: jáko da ľínosti óblaki daléče othnáv, slávľu ťá prebláháho Spása mojehó."),
("", "", "Prízri, o dušé mojá smirénnaja! Vížď tvojá ďilá, kája súť vseskvérnaja: vížď tvojú nahotú, ole i jedínstvo! Íbo ímaši razlučítisja ot Bóha i ánhelov, i k bezkonéčnomu vmetátisja mučéniju. Vosprjaní, vostáni, potščísja, vozopíj: sohriších Spáse, dážď mí proščénije, i spasí mja."),
("", "", "Télo oskverních ľúťi, rastlích dúšu i sérdce pomyšléňmi skvérnymi: vsjá čúvstva mojá ujazvích, óči oskverních, okaľách ušesá slovesý, jazýk oskverních, i vsjá imíju stúdna. Ťímže tí pripádajaj zovú, Vladýko Christé: sohriších tí, sohriších, prostí, i spasí mja."),
("", "Jehdá ot dréva", "Potščísja, izmí mja o iskušénij slávnyj Hospódeň Predtéče, moľúsja tí: vsúje bo podvihóšasja na mjá borjúščiji mjá hórcyi démoni, íščušče voschítiti dúšu rabá tvojehó, jákože ptícu bídnuju. Ne ostávi mjá do koncá: da razumíjut že páče vseblažénne, jáko tý mojé jesí pribížišče."),
("", "", "Neplódy vsesvjatýj ótrasľ, prozjabénije krásnoje pustýnnoje, lástovica krásnaja, slavíj blahohlásnyj, holubíce zlatája, neplódstvujuščuju vsehdá okajánnuju dúšu mojú blahoplódnu pokaží blahích ďíl, jáko da prozjabájušči klás storíčestvujuščij blažénne, božéstvennuju prinósit tí pochvalú."),
("", "", "Izbávi víčnaho mjá ohňá, ťmý nesvítlyja i núždy i vsjákija skórbi, i vsjákaho zlostradánija, vsjákaho sťisnénija, moľú ťa predtéče, i pokaží části spasájemych samoosuždénnaho súšča prehrišéňmi blažénne, molítvami tvojími, iďíže svjatých likovánija i rádosť jésť neskazánnaja."),
("Bohoródičen", "", "Skórbi, ľútych naviďínija, strásti že razlíčnyja oburevájut smirénnuju mojú dúšu otrokovíce neiskusobráčnaja, Máti Christá Bóha, pravíteľnica mí javísja v móri žitéjsťim, i naležáščuju ukrotí búrju k pristániščem tíchim pokajánija i prochlaždénija nastavľájušči, k božéstvennomu pokróvu tvojemú pritekájušča."),
),
"S": (
("", "", "Sohriších tí Christé Spáse, jáko blúdnyj sýn: prijimí mja ótče kájuščasja, i pomíluj mjá Bóže."),
("", "", "Vopijú ti Christé Spáse mytarévym hlásom: očísti mjá jákože ónaho, i pomíluj mjá Bóže."),
("Múčeničen", "", "Svjátým múčenikom moľáščymsja o nás, i Christá pojúščym, vsjáka prélesť prestá, i čelovíčeskij ród víroju spasájetsja."),
("Bohoródičen", "", "Vsé upovánije mojé na ťá vozlaháju, Máti Bóžija, sochraní mja pod króvom tvojím."),
),
)
#let P = (
"1": (
("", "", "Vo hlubiňí postlá inohdá faraonítskoje vsevójinstvo preoružénnaja síla, voplóščšejesja že Slóvo vsezlóbnyj hrích potrebílo jésť, preproslávlennyj Hospóď, slávno bo proslávisja."),
("", "", "Pochvalénija tí prisnocvitúščij vinéc, jehóže prozjabé Dúchom cérkov čístaja, prinósit písnenno tebí so archánhelom Havrijílom Bohonevístňij, rádujasja pojúšči, i ťá čéstno vinčájušči."),
("", "", "Vozďílavši živonósnyj vinohrád, Máti Bóžija prepítaja Christá Bóha, zemlé svjatája Ótča javísja, páče smýsla Bohoblahodátnaja, i vés mír napojí píva živonósnaho čístaja."),
("", "", "Volnújuščahosja ľúťi prehrišéniji vsehó míra, i potopľájemaho, rodilá jesí prečístaja Bóha i Hóspoda vsích nás, i okormíteľa Christá, ko spasíteľnomu pristánišču nás napravľájušča vírno."),
("", "", "Pribížišče i spasénija hráde, vsí vírno mólim ťá, Maríje <NAME>ja, i míli ďíjemsja tépľi: prijimí moľbý náša tvojích vírnych ráb, i razriší vsjá ný ot prehrišénij osuždénija."),
),
"3": (
("", "", "Utverdí nás v tebí Hóspodi, drévom umerščvéj hrích, i strách tvój vsadí v serdcá nás pojúščich ťá."),
("", "", "Načálo otvraščénija Bóha býsť k čelovíkom, Jévino preľščénije: svjatája že Bohoródica privedé páki Bóha k nám."),
("", "", "Žízni ťá sokróvišče prepítaja raždájet mírovi, i rádujetsja blahočádiju slávnyj Joakím o tebí, jáko neplódnymi otcý prišédši nadéžda."),
("", "", "Ot Ánny rádosť ródu procvité, raždáješi dvojú carjá: i srádujutsja roždestvú tvojemú žený, razríššasja tobóju kľátvy."),
("", "", "Kupiná v Sináji proobražáše tvojé Ďívo, preslávnoje roždestvó: íbo ohném Božestvá ne opalísja, v ložesnách prijémši čístaja."),
),
"4": (
("", "", "Uslýšach Hóspodi, slávnoje tvojé smotrénije, i proslávich čelovikoľúbče, nepostižímuju tvojú sílu."),
("", "", "Jákov ťá jáko ľístvicu Bohoľípno províďaše Ďívo, na jejáže versí Bóh utverždášesja."),
("", "", "Ánheľskoje snítije, jéže k nám Slóva prišéstvije tobóju prečístaja projavísja."),
("", "", "Utróba tvojá prepítaja, i soscá blažénna Ďívo: ťích bo rádi žízň vsí obritóchom."),
("", "", "Tájno vospivájem ťá Máti Bóžija, hlásy pravoslávnymi, ímže cérkov bľudóma jésť molítvami tvojími."),
),
"5": (
("", "", "Prosviščénije vo ťmí ležáščich, spasénije otčájannych Christé Spáse mój, k tebí útreňuju carjú míra, prosvití mja sijánijem tvojím: inóho bo rázvi tebé Bóha ne znáju."),
("", "", "Zakóna i kovčéha čestňíjšu ťá vospivájem, Bohoródice Maríje: íbo vsích ziždíteľa i Bóha, jáko skrižáli nosíla jesí prepítaja."),
("", "", "Prestól Bóžija Bóžija Slóva, proslavľájem Bohoródice, na némže jáko čelovík Bóh siďá javísja, i býsť Cheruvímov prevýšši."),
("", "", "Razrišíla jesí Ďívo, ot hórkija rabóty vés ród čelovíč, i svobódoju Christóvoju jestestvó žénskoje počtíla jesí, v božéstvenňim tvojém roždeství."),
("", "", "Rodilá jesí Sýna Ďíva, i pobiždájut žený vrahá jávi: ťímže i pritekájut otrokovíce, ďívstvo deržášče."),
),
"6": (
("", "", "V bézdňi hrichóvňij vaľájasja, neizsľídnuju milosérdija tvojehó prizyváju bézdnu: ot tlí Bóže mjá vozvedí."),
("", "", "Jáže míru rádosť Bohoródice čístaja, rádujsja, tebí Ďívo zovém so ánhelom vírno, tvojejá rádosti spodóbi, i pečáľ nášu razorí."),
("", "", "Rádosti neotjémlemyja žilíšče ťá voschvaľájušče vírno Máti prisnoďívo, tvojejá rádosti spodóbi, i pečáľ nášu razorí."),
("", "", "Nébo nebés výššeje javílasja jesí Bohonevístnaja, božéstvennoju tvojéju slávoju: v ťá Bóh náš vselívsja, javísja mí."),
("", "", "Nýňi jestestvó žénskoje vozrádovasja, nýňi pečáľ prestá, rádosť procvité: jáko Maríja rodí rádosť, Spása Christá Bóha."),
),
"S": (
("", "<NAME>", "Duší mojejá ľínosť ľútuju, i sérdca mojehó prenemohánije, Máti Bóžija vozzrívši, iscilí molítvami tvojími, i spasénnych mjá části spodóbi, izbavľájušči mjá ťmý i mučénija, jáko jedína upovánije mojé i uťišénije."),
),
"7": (
("", "", "Óbrazu zlatómu na póli Deíri služímu, trijé tvojí ótrocy nebrehóša bezbóžnaho veľínija, posreďí že ohňá vvérženi, orošájemi pojáchu: blahoslovén jesí Bóže otéc nášich."),
("", "", "Runó inohdá Hedeónovo, jéže na ťá čístaja Bóžija Slóva proobrazí snítije: jákože bo rósu začátije priját, netľínnaja Ďívo. Ťímže vsí tebí zovém: blahoslovén plód tvojehó čréva čístaja."),
("", "", "Nóva i strášna, i vírna i čúdna tvojá táinstva, Maríje Máti Christá Bóha nášeho: jáko tobóju primiríchomsja vsí Bóhovi i Vladýci, i so ánhely nýňi pojém: blahoslovén plód tvojehó čréva čístaja."),
("", "", "Íže préžde Hedeón predvistvújet tebé čístaja, božéstvennoje roždestvó jávi: okrín prinošájet ispólnen vodý ot ocyždénija runóvnaho: vés bo v ťá božéstvenno vselísja, prečístaja: blahoslovén plód tvojehó čréva čístaja."),
("", "", "Róždši Bóha i Spása vsjáčeskich Maríje, bylá jesí otčájannych ispravlénije, hríšnikov obnovlénije, i nenadéžnych nadéžda, i pojúščich pómošč: blahoslovén plód tvojehó čréva, čístaja."),
),
"8": (
("", "", "V péšč óhnennuju ko otrokóm jevréjskim snizšédšaho, i plámeň na rósu prelóžšaho Bóha, pójte ďilá jáko Hóspoda, i prevoznosíte vo vsjá víki."),
("", "", "Nóv ráj nám javílasja jesí presvjatája Bohoródice, ne smértnoje drévo, no živótnoje, jáko sád bez símene prorastívši Hóspoda, ímže bezsmértnoju žízniju pitájemsja vsí."),
("", "", "Vospivájet vsjá Christóva cérkov Bohoródice, tvojé roždestvó, jáko spasájutsja hríšniji vsí i níščiji, íže ľubóviju k tebí pribihájušče: priíde bo Christós na zémľu, čelovíki spastí."),
("", "", "Svoboždájetsja osuždénija prábaba tobóju Bohoródice Ďívo: i sé nýňi žený stráždut po Chrisťí, i rádujetsja jestestvó žénskoje, jákože pervomúčenca vopijét Thékla."),
("", "", "Niktóže pohíbe čístaja, íže víry nadéždu sťažá k tebí pravoslávno, Ďívo Máti Bóžija, rázvi tóčiju závistiju otmetájajsja, tvojemú ne poklaňátisja óbrazu načertánnomu."),
),
"9": (
("", "", "Jáže préžde sólnca svitíľnika Bóha vozsijávšaho, plótski k nám prišédšaho iz bokú ďivíču, neizrečénno voplotívšaja, blahoslovénnaja vsečístaja, ťá Bohoródice veličájem."),
("", "", "Prikloní mi úcho tvojé Ďívo presvjatája, vospivájuščemu vírno pochváľnymi slovesý tvojé roždestvó: i jáko dáry vdovíči, písň ustén mojích prijémši, prosí hrichóv mojích proščénija."),
("", "", "Sijájet dobróta tvojá, blistájet čistotý svítlosť, čístaja, i presijájet páče sích tvojé roždestvó: Bóh bo tvoréc sólnca i tvári vsejá, iz tebé rodísja: ťímže ťá vsí veličájem."),
("", "", "Svít ťá čistotý, i žézl ďívstva, i <NAME>, Bohoľípno v písnech pojúšče Bohoródice, so hlásom chvalénija mólimsja tí: v ďívstvi utverdí nás, i v čistoťí sochraní."),
("", "", "Ťílo i dúšu neskvérnu Bóhovi sobľúdši čístaja, cár voschoťí tvojejá dobróty Christós, i Máter svojehó voploščénija pokazá, Maríje preslávnaja, spasénije mojé soveršája."),
),
)
#let U = (
"S1": (
("", "", "Pomyšľájušči dušé mojá, strášnaho dné ispytánija, trepéšči vozdajánija víčnyja múki, i pokajánijem vozopíj slezjášči: Bóže sohriších, pomíluj mjá."),
("", "", "Ispytújaj mojú sóvisť osuždénnuju, bojúsja tvojehó strášnaho sudíšča Hóspodi, jáko ňísť mí ot ďíl spasénija: no jáko imíjaj bohátstvo blahoutróbija, uščédri mjá Christé Bóže i spasí mja."),
("Bohoródičen", "", "Ťá veličájem Bohoródice vopijúšče: rádujsja žézle, ot nehóže bezsímenno Bóh prozjabýj, pohubí na drévi smérť."),
),
"S2": (
("", "", "Pomíluj mjá, rečé Davíd, i áz tebí zovú: sohriších Spáse, mojá hrichí pokajánijem očístiv, pomíluj mjá."),
("", "", "Pomíluj mjá Bóže, pomíluj mjá, o dvojú hrichú plákaše Davíd, o ťmách áz sohrišénijich vopijú ti: ón postéľu slezámi omočaváše, áz že ni kápli jedínyja ímam, otčájachsja i moľú: pomíluj mjá Bóže, po velícij mílosti tvojéj."),
("Múčeničen", "", "Prosvitívyj svjatýja tvojá páče zláta, i proslávivyj prepodóbnyja tvojá, jáko bláh, ťími umoľájem byvája Christé Bóže, živót náš uprávi, jáko čelovikoľúbec, i molítvu naprávi jáko kadílo, jedíne vo svjatých počivájaj."),
("Bohoródičen", "", "Bohoródice ne prézri mené trébujušča zastuplénija, jéže ot tebé: na ťá bo upová dušá mojá, pomíluj mjá."),
),
"S3": (
("", "Blahoutróbija", "Blahoutróbija nezavístnyj istóčnik, vo Jordáňi pohruzíl jesí strují Joánne otňúduže priľížno moľú ťa: strasťmí mnóhimi potopľájema, pučínoju mjá žitéjskoju, na vsjákij déň ľúto, blahoprijátnymi tvojími molítvami, k životá pristánišču rukovodí."),
("", "", "Blahoutróbija rádi mílosti bláže, spastí tvojé sozdánije Christé prišél jesí, preklóň nebesá schoždénijem tvojím. Ťímže strášnoje smotrénije tvojé pojúšče, vopijém tí: moľbámi Predtéči tvojehó očiščénije hrichóv podážď nám, jáko jedín blahoutróben."),
("Bohoródičen", "", "Któ víďi, któ slýša Máter raždájuščuju svojehó soďíteľa neiskusomúžno, dojáščuju dajúščaho píšču vsjákoj plóti? Ole čudesé! prestól cheruvímskij javísja črévo tvojé Bohoródice blahodátnaja, molí o dušách nášich."),
),
"K": (
"P1": (
"1": (
("", "", "Moiséjskuju písň vospriímši, vozopíj dušé: pomóščnik i pokrovítel býsť mňí vo spasénije, séj mój Bóh, i proslávľu jehó."),
("", "", "Sebé brátije préžde ischóda vospláčim hórko, jáko da slezámi dóbrymi ubižím tohdá sléz mučénija, ničtóže imúščich polézno."),
("", "", "Ťmámi Christé, zaviščách pokájatisja, i nečúvstvennu dúšu imíjaj, v prehrišénija vpádaju: uščédri Spáse némošč mojú."),
("Múčeničen", "", "Íže mučénija óhň preterpívše, božéstvennym orošénijem strastotérpcy Christóvy, ohňá hejénny izbávite mjá, v strastéch ľútych sležáščaho."),
("Múčeničen", "", "Krípcy na vrahí jávľšesja síloju božéstvennoju, nekrípostnuju ích nizložíste sílu, múčenicy Christóvy dostochváľniji."),
("Bohoródičen", "", "Plamenonósnaja kleščé, júže Isáia víďi inohdá, veščéstvennyja sérdca mojehó strásti Bohorodíteľnice popalí, i do koncá potrebí."),
),
"2": (
("", "", "Vo hlubiňí postlá inohdá faraonítskoje vsevóinstvo preoružénnaja síla, voplóščšejesja že Slóvo vsezlóbnyj hrích potrebílo jésť, preproslávlennyj Hospóď, slávno bo proslávisja."),
("", "", "Krestíteľu i Predtéče Christóv, pohružájemyj vsehdá slasťmí ťilésnymi, úm mój uprávi, i vólny strastéj ukrotí: jáko da v tišiňí božéstvenňij býv, pisnoslóvľu ťá."),
("", "", "Nedoumínnym prosvitívsja prosviščénijem, jáko mnohosvítlaja zvizdá, mýslennomu vostóku predtékl jesí: ímže ozarítisja sérdcu mojemú Krestíteľu, molí, omračénnomu vsími bisóvskimi priložéniji."),
("", "", "V ricí bézdnu inohdá vsemúdre pohruzíl jesí, potóp soďivájuščuju blahodátiju, vsehó prestuplénija. No moľúsja, potóki blažénne mojích prehrišénij izsuší, božéstvennym chodátajstvom tvojím."),
("Bohoródičen", "", "Čístyja Ďívy, Bóha voplotívšija, sródnik býl jesí blažénne Predtéče, s néjuže ťá čtím i mólim, íže v božéstvenňim chrámi tvojém nýňi živúšče: chrámy i nás sotvorí Dúcha svjatáho."),
),
),
"P3": (
"1": (
("", "", "Neplódstvovavšij mój úm, plodonósen Bóže pokaží mi, ďílateľu dóbrych, nasadíteľu blahích, blahoutróbijem tvojím."),
("", "", "Ľínostnym dremánijem oťahotích dúšu: vozdvíhni Christé ko bďíniju pokajánija, tvoríti tvojá poveľínija."),
("", "", "Ne javí mené Iisúse, v déň strášnyj otčájanna: no préžde koncá obratív, ľútyja izbávi múki."),
("Múčeničen", "", "Íže strásti Christóvy podražávše dóbri, božéstvennymi óbrazy strastotérpcy Christóvy, duší mojejá ľútyja strásti iscilíte."),
("Múčeničen", "", "Da íže na nebesích prisnosúščnym blahím spodóbitesja vsjákoje iskušénije ľútych, strastotérpcy, na zemlí tvérdo preterpíste."),
("Bohoródičen", "", "Doíši materoľípno pitáteľa vsích, i nósiši sehó na objátijach čístaja, vsjáčeskaja rukóju nosjáščaho vsehdá."),
),
"2": (
("", "", "Na kámeni mjá víry utverdív, razširíl jesí ustá mojá na vrahí mojá. Vozveselí bo sja dúch mój, vnehdá píti: ňísť svját, jákože Bóh náš, i ňísť práveden páče tebé Hóspodi."),
("", "", "Iscilí strúpy duší mojejá, úm mój, omračénnyj nebrežénijem, ozarí božéstvennym tvojím chodátajstvom Hospódeň Predtéče, i vsjákaho izbávi mjá soprotívnaho obstojánija, moľúsja."),
("", "", "Neplódstvije razrišíl jesí róždšija, rodívsja Bóžijim promyšlénijem premúdre proróče: neplódnoje úbo sérdce mojé, plodonósno nýňi soďílaj Hospódeň Predtéče, chodátajstvom tvojím, dobroďítelej prinosíti prozjabénija."),
("", "", "Ľubóviju tvojéju sozidájuščaho božéstvennyj dóm, výšňaho žitijá ulučíti molí, íže víroju chrámu tvojemú služáščyja, chrámy Dúcha božéstvennaho sotvorí, Krestíteľu i Predtéče, chodátajstvy tvojími."),
("Bohoródičen", "", "Veseľášesja predtéča v ložesnách nosím máternich, i poklaňášesja Hóspodu, nosímu v ložesnách blahodátnyja, jehóže molí, ot vsjákija skórbi izbáviti mjá."),
),
),
"P4": (
"1": (
("", "", "Jéže ot Ďívy tvojé roždestvó prorók predzrjá, vospropovídaše vopijá: slúch tvój uslýšach, i ubojáchsja, jáko ot júha, i iz horý svjatýja priosinénnyja prišél jesí Christé."),
("", "", "Okrádena mjá otvsjúdu, i obniščávša Slóve, zrjá vráh, o pohíbeli mojéj rádujetsja, ľstívyj mudréc: Hóspodi slávy, obohatíteľu ubóhich, tohó mja zloďíjstvija izmí."),
("", "", "Rúci i óči oskverních Hóspodi, soďíjav jáže neľípo jésť tvoríti, i v hňív podvihóch ščedróty tvojá, iždív tvojé dolhoterpínije: prizrív uščédri mjá bláže."),
("Múčeničen", "", "Kóľ díven Bóh náš vo svjatých jésť, poslúšavšich jehó, i nizlahájuščich istukánnyja pohíbeli, i nasľídovavšich rajá prostránstvo, ot nehóže drévle izhnán býsť Adám."),
("Múčeničen", "", "Strujámi krovéj blažénniji ustáviste króv, prinosímuju inohdá démonom, vsím pohíbeľnuju, na páhubu prinosjáščym čelovíkom. Sehó rádi ublažájemi jesté prísno."),
("Bohoródičen", "", "Naučívsja Dúchom proróčeskij preslávnyj lík, jéže páče umá tvojéj tájňi Bohoródice, različnoobrázno sijú prednačertájet svjaščénnymi obrazý, íchže konéc zrím svítlo."),
),
"2": (
("", "", "Prišél jesí ot Ďívy, ne chodátaj, ni ánhel, no sám Hóspodi voplóščsja, i spásl jesí vsehó mja čelovíka. Ťím zovú ti: sláva síľi tvojéj Hóspodi."),
("", "", "Preklónšemu nebesá i čelovíkom besídovavšu, hlavú prikloníl jesí, desníceju tvojéju preboháte: jéjuže mjá sobľudí, vo smiréniji sobľudája sérdce mojé."),
("", "", "Pustýňa tebé hraždanína neprochódnaja imjáše, blažénne Predtéče. Ťímže vopijú ti: pústu vsjákaho božéstvennaho ďijánija bývšu dúšu mojú snabdí."),
("", "", "Zakón božéstvennyj upravľája, bezzakónno zaklán býl jesí. Ťímže moľúsja tebí: bezzakónnujušča mjá vsehdá, i preľščájema bisóvskimi preľščéňmi, isprávi."),
("", "", "Sozdáv sám sebé chrám Vladýci carjú, k božéstvennym selénijem nýňi prešél jesí Predtéče: íchže polučíti molí, tebí presvjatýj dóm vozdvíhšaho."),
("Bohoródičen", "", "Prízri na mjá nedúhujuščaho vseneporóčnaja, i razriší strásti mojá ľútyja i neudoboiscíľnyja: jáko da veličáju ťá vozvelíčivšuju vsé čelovíčestvo."),
),
),
"P5": (
"1": (
("", "", "Mhlú duší mojejá Spáse mój razhnáv, svítom zápovidej tvojích ozarí mja, jáko jedín cár míra."),
("", "", "Hrichí sovokupľáju bezúmno hrichóm, i vosklonénija ňísť v smérti mojéj: uvý mňí, káko javľúsja Christóvi?"),
("", "", "Bidú prijémľu jáko korábľ, pohubích mojé brémja, jéže mí dál jesí ščédre, i nýňi obniščáv zovú: ne prézri mené Christé."),
("Múčeničen", "", "Jáko slávu prezrívše dóľňuju i popirájemuju, nebésňij strastotérpcy spodóbistesja slávi, soprebyvájušče Christú."),
("Múčeničen", "", "Ľubvé jáže k plóti úm otlučívše, víroju múki usvóiste ľubézno strastotérpcy, usvojájemi Christú."),
("Bohoródičen", "", "Danijíl ťá hóru véliju dúchom zrjášče Bohoródice: ot nejáže kámeň otsíksja, sokrušájet démonov istukánnaja."),
),
"2": (
("", "", "Prosviščénije vo ťmí ležáščich, spasénije otčájannych Christé Spáse mój, k tebí útreňuju carjú míra, prosvití mja sijánijem tvojím: inóho bo rázvi tebé Bóha ne znáju."),
("", "", "V tečénijich Jordánskich strujá netľínija Predtéče, krestív Christá molí istekánija strastéj mojích izsušíti, i potóki sládostnyja nasľídovati, i právednych krásnaho rádovanija."),
("", "", "Užé rydáju, i sodrahájusja stráchom, i nedoumínijem vsehdá soderžím jésm, pomyšľája mojá soďílannaja, i búduščij súd užásnyj: blahoutróbne Hóspodi, poščadí mja tvojehó krestíteľa moľbámi."),
("", "", "Zakonopolahájaj ľúdem spasénije, v raskájaniji Predtéče prehrišénij bývšeje, posreďí zakóna i blahodáti stál jesí. Sehó rádi mólim ťá: obrazmí pokajánija nás prosvití."),
("", "", "Dážď mí vrémja pokajánija, unýnno prešédšeje, vsé iždívšemu, blahoďíteľu, imíja na sijé moľáščaho ťá Slóve, Joánna velíkaho Predtéču, i pokajánija vsemírnaho propovídnika."),
("Bohoródičen", "", "Navíty i lovléniji ľstívaho umertvíchsja, Vladýčice vseneporóčnaja, oživí mja, jáže róždšaja živót vsích Bohoródice ipostásnyj, da ťá pojú blahočéstno vseneporóčnuju."),
),
),
"P6": (
"1": (
("", "", "Vo hlubiňí hrichóvňij soderžím jésm Spáse, i v pučíňi žitéjsťij oburevájem: no jákože Jónu ot zvírja, i mené ot strastéj vozvedí, i spasí mja."),
("", "", "Jákože drévle chananéja zovú ti Spáse, Sýne Bóžij, pomílovav mjá uščédri: dúšu bo stráždušču ímam v ľútych, i samú v čúvstvo prijití ne choťáščuju."),
("", "", "Smuščájet mjá bezmírnych strastéj búrja: jákože mórju inohdá zapretíl jesí, i spásl jesí svjatýja učenikí tvojá, i mené Iisúse vozvedí, i spasí Christé."),
("Múčeničen", "", "Udivíšasja ánheľstiji bezplótniji lícy terpíniju vášemu, jéže v ťilesí: i pochvalíša podajúščaho vám čestníji stradáľcy, i sílu i trudóv vozdajánija."),
("Múčeničen", "", "Okropľájemi krovéj svoích tečéňmi, i óčiju izbodájemi múčenicy, pomerzájemi stúdeniju ľútoju, k teploťí žízni preidóste, vospivájušče Christá."),
("Bohoródičen", "", "Jáko trapéza chľíb vmiščáješi tájnyj, ot nehóže jádše ne ktomú álčem vsepítaja, víduščiji ťá Christá vsích Bóha rodíteľnicu, i pitáteľnicu jáko voístinnu."),
),
"2": (
("", "", "V bézdňi hrichóvňij vaľájasja, neizsľídnuju milosérdija tvojehó prizyváju bézdnu: ot tlí Bóže mjá vozvedí."),
("", "", "Hlás Slóvo propovídavyj, vsích hlásy vosprijém, prosí hrichóv proščénije darováti, víroju pojúščym ťá."),
("", "", "Sokrušénije duší mojejá iscilí, i hrichóv bréma razreší, i páče nadéždy spasí mja molítvami tvojími, blažénne predtéče."),
("", "", "Iisúsa, jehóže rukóju tvojéju krestíl jesí, Predtéče molí, rukí mja izbáviti hrichá, vzimájušča k nemú rúci prísno, vseslávne."),
("Bohoródičen", "", "Dremánijem ľínostnym oderžím jésm, són hrichóvnyj ťahotít sérdce mojé: tvojím prečístaja bďínnym chodátajstvom vozdvíhni, i spasí mja."),
),
),
"P7": (
"1": (
("", "", "Cheruvímy podražájušče ótrocy v peščí, likovstvováchu vopijúšče: blahoslovén jesí Bóže, jáko ístinoju i sudóm navél jesí sijá vsjá hrích rádi nášich, prepítyj i preproslávlennyj vo vsjá víki."),
("", "", "Zakónov tvojích otverhóchsja, i pokoríchsja bezslovésnym pochotém, ďíja neľípaja Christé, jáko osujetíchsja v bezúmiji mojém, jákože ín niktóže ot čelovík na zemlí: ne ostávi úbo mené Spáse, pohíbnuti, čelovikoľúbija rádi."),
("", "", "V bezzakónijich, Hóspodi, sé áz začát jésm, jákože Davíd zovú, i jáko bludníca slezjú, i jáko preohorčevájaj ráb, preohorčích ťá jedínaho súščaho Bóha blaháho: ne ostávi úbo mené Spáse pohíbnuti, čelovikoľúbija rádi."),
("Múčeničen", "", "Múčeničeskij podvizásja sobór strastotérpec, múčeničeski vinčásja živonósnoju desníceju: jáko voístinnu Bóha vozľubí, vsjá sotvóršaho slóvom. I nýňi na nebesích rádujasja, naslaždájetsja božéstvennaho nasľídija."),
("Múčeničen", "", "Óčiju izbodájemi, i otjémlemi rukámi i nohámi, blahotéčno k nebésnomu blahoslávniji posyláchusja šéstviju, prepinájušče šéstvija jedinobórca: ťích molítvami spasí vsjá Slóve, tebé slavoslóvjaščyja."),
("Bohoródičen", "", "Cheruvímy slávjat, Serafímy vospivájut, prestóli, i vlásti, i Hospóďstvija prísno, jéže páče umá tvojé roždestvó, Maríje vsepítaja, jáko jedína Bóha raždáješi plótiju. Jehóže molí čístaja, vsím nám spastísja, ľubóviju počitájuščym ťá."),
),
"2": (
("", "", "Bohoprotívnoje veľínije bezzakónnujuščaho mučíteľa, vysók plámeň voznesló jésť: Christós že prostré Bohočestívym otrokóm rósu dúchóvnuju, sýj blahoslovén i preproslávlen."),
("", "", "Iz kórene sikíroju tvojehó pokajánija, istórh jázvy strástnaho sérdca mojehó, vsadí Predtéče božéstvennoje bezstrástije, i strách čisťíjšij Bóžij, vsjákija zlóby otčuždájuščij mjá."),
("", "", "Vo strujách Jordánskich, jáko krestíl jesí pokryvájuščaho vodámi prevýsprenňaja Hóspoda: tohó molí vódu darováti božéstvennaho umilénija prísno očíma moíma, slávnyj Predtéče."),
("", "", "Íže míru vzémľuščaho hrích áhnca Bóžija, Predtéče propovídav, tohó molí ot kózlišč části javíti mjá čúžda, i desným jehó ovcám i mené sočetáti, slávne."),
("Bohoródičen", "", "Neplódnaja utróba nosjáše ťá Ďívo: vo črévi nosívšuju Slóvo voploščénno, jehóže božéstvennymi vzyhrániji, velíkij predtéča, neplódnyj vsesvjatýj plód pozná rádujasja, i poklonísja."),
),
),
"P8": (
"1": (
("", "", "V kupiňí Moiséju Ďívy čúdo, na sinájsťij horí proobrazívšaho inohdá, pójte, blahoslovíte, i prevoznosíte vo vsjá víki."),
("", "", "Da obožíši nás, voplotílsja jesí za mílosť, nikákože razumích, poraboščén slasťmí: tvojéju bláhostiju obratí mja Christé, vsích spasénije."),
("", "", "Tý pástyrju dóbryj Slóve, zablúždšuju na horách prestuplénija, okajánnuju mojú dúšu obratí i spasí: da ne do koncá mja vráh ľstívyj požrét."),
("Múčeničen", "", "Stánem múžeski vkúpi, vopijáchu drúh drúhu krásniji stradáľcy, uraňájemi ľúťi: sé Christós prostirájet pobídy vincý vo vsjá víki."),
("Múčeničen", "", "Krípkimi žílami, tvérdymi vášimi boľízňmi udavíste zmíja, choťáščaho vás zlokovárno preľstíti: i rájskija píšči javístesja nasľídnicy."),
("Bohoródičen", "", "Da obožít nás Bóh, voplotísja iz čístych krovéj tvojích, i býsť čelovík Ďívo Bohoródice: jehóže molí prísno o čtúščich ťá."),
),
"2": (
("", "", "Péšč inohdá óhnennaja vo Vavilóňi ďíjstva razďiľáše, Bóžijim veľínijem chaldéji opaľájuščaja, vírnyja že orošájuščaja, pojúščyja: blahoslovíte vsjá ďilá Hospódňa Hóspoda."),
("", "", "Dážď desnícu mňí na zemlí ležáščemu, Predtéče, íže desnícu prostér, i omýl jesí vodámi neskvérnaho: i izbávi mjá skvérny ťilésnyja, vsehó mja očiščája pokajánijem, i spasí mja."),
("", "", "Imúšči dušé vrémja pokájatisja, ľínosti ťažčájšij són ottrjasí, i spíšno pobdí vopijúšči Vladýci tvojemú: milosérde, uščédri mjá, Krestíteľa tvojehó moľbámi."),
("", "", "Potócy strastéj, i vódy zlóby do duší mojejá vnidóša, blažénne Predtéče: potščísja skóro izjáti mjá, íže ríčnymi strujámi izmýv bezstrástija tišájšuju pučínu."),
("", "", "Uvý mňí, mnóha zlá sotvóršemu! uvý mňí, jedínomu prohňívavšemu Bóha preblaháho! Krestíteľu Christóv, pomozí mi, i podážď prehrišénij mojích razrišénije, i dolhóv mojích otsičénije tvojími chodátajstvy."),
("Bohoródičen", "", "Výšňaho Bóhu plótiju róždšaja, ot hnója mjá vozstávi strastéj oskorbľájuščich mjá, i ľúťi vsehó obniščávša, božéstvennymi obohatí prečístaja dobroďítelmi, jáko da vospojú ťa spasájem."),
),
),
"P9": (
"1": (
("", "", "Ot zemnoródnych któ slýša takovóje, ilí któ víďi kohdá? Jáko Ďíva obrítesja vo črévi imúščaja, i bezboľíznenno mladénca poróždšaja? Takovóe tvojé čúdo, i ťá čístaja Bohoródice veličájem."),
("", "", "O káko strášno jésť tvojé sudíšče, na némže Christé ožidáju sudítisja, i ne čúvstvuju otňúd sehó strácha, v ľínosti vsjá ľíta provoždája! Obratí mja jedíne soďíteľu, íže Manassíju obraščéj sohrišívšaho."),
("", "", "Ustávi Christé potóki, vopijú ti, bezmírnych mojích zól, tóki mňí dajáj sléz umyvájuščyja skvérnu, jáže podjách bezúmijem: i spasí mja, spasýj bludnícu ot duší pokájavšujusja, mílostiju tvojéju."),
("Múčeničen", "", "Svitozárnaja božéstvennych strastotérpec pámjať, jáko sólnce nám vozsijávši, vsjá koncý zemnýja svitovódit, i ťmú prohoňájet božéstvennym Dúchom idoloneístovstva, i strastéj dušetľínnych pomračénije."),
("Múčeničen", "", "Pólk čésten, vóinstvo pobidonósnoje, i izbránnoje opolčénije, sobór svjatých múčenik, lík blažénnyj, likostojánijem sočetásja bezplótnych. Ťích molítvami Christé, vsjá ný cárstviju tvojemú pričástniki sotvorí."),
("Bohoródičen", "", "Svítlymi zarjámi, iz čréva tvojehó vozsijávšaho nám, i bezbóžija nóšč potrébľšaho, Ďívo Máti Maríje, prosvití vsjá víroju tebí čtúščyja, i ot nesvitímyja ťmý izbávi v čás osuždénija."),
),
"2": (
("", "", "Beznačáľna rodíteľa Sýn, Bóh i Hospóď, voplóščsja ot Ďívy nám javísja, omračénnaja prosvitíti, sobráti rastočénnaja. Ťím vsepítuju Bohoródicu veličájem."),
("", "", "Kála mjá izbávi hrichóvnaho Hóspodi, bezhríšne jedíne i mnohomílostive, Krestíteľa moľbámi, íže tebé propovídavyj vsemú míru áhnca Bóžija, vzémľuščaho čelovíkov hrichí."),
("", "", "Jáko šípok blahovónen, jáko blahouchánnyj kiparís, jáko neuvjadájemyj krín, jáko míro čéstno imíjaj ťá Hospódeň Predtéče, mojích ďíl zlosmrádija izbavľájusja molítvami tvojími, pritekája k pokróvu tvojemú."),
("", "", "Neplódstvujušča mjá neplódnymi ďíly vseblažénne sotvorí, dobroďítelej blahoplódije prísno prinosjášča, čádo mjá Hospódne tvorjá, i pričástnika božéstvennomu cárstviju, i svjatých sobóru kupnožíteľa."),
("", "", "Nám ľúbjaščym ťá, i ľubóviju počitájuščym, i v božéstvenňim chrámi tvojém likújuščym, dážď s nebesé razrišénije ľútych Predtéče Hospódeň, i žitijá ispravlénije, i prehrišénij izbavlénije."),
("Bohoródičen", "", "Nosímu vo utróbi Bohomáterni, vsjá nosjáščemu mánijem, poklonílsja jesí proróče: s néjuže molí smirénňij spastísja duší mojéj, vo mnóhaja vpádajuščej po vsjá dní sohrišénija."),
),
),
),
"ST": (
("", "", "Vsích prevoschoždú hrichóm, kohó naučú pokajániju? Ášče vozdochnú jáko mytár, nepščúju oťahčíti nebesá: ášče slezjú jákože bludníca, oskverňáju slezámi zémľu. No dážď mí ostavlénije hrichóv Bóže, i pomíluj mjá."),
("", "", "Bezzakónija mojá prézri Hóspodi, ot Ďívy roždéjsja, i sérdce mojé očísti, chrám sijé tvorjá svjatáho tvojehó Dúcha: ne otvérži mené ot tvojehó licá, bezmírnuju imíjaj véliju mílosť."),
("", "", "<NAME> vzémše svjatíji múčenicy, orúžije nepobidímoje, vsjú diávoľu sílu uprazdníša, i prijémše vincý nebésnyja, steťiná nám býša, o nás tomú moľáščesja."),
("Bohoródičen", "", "Rádujsja <NAME>, chráme nerazrušímyj, páče že svjatýj, jákože vopijét prorók: svját chrám tvój, díven v právďi."),
)
)
#let L = (
"B": (
("", "", "Hlás tí prinósim razbójnič, i vopijém tí: pomjaní nás Hóspodi vo cárstviji tvojém."),
("", "", "Razbójnika prevzydóch, i bludnícu strasťmí: uščédri mjá Spáse samoosuždénnaho."),
("", "", "Pohruzívyj bézdnu blahoutróbija vo voďí Predtéče, tvojími molítvami strásti mojá umáli."),
("", "", "Íže preléstnaja tečénija, krovéj tečéňmi izsušívše, Christóvy strástotérpcy, dostójno slávimi jesté."),
("", "", "Vitíjstvujaj, jákože písano jésť, úm čelovíčeskij ne móžet Božestvá jedíno načálo píti triipostásnoje."),
("", "", "Jáže neopáľno róždšuju Bóha prebeznačáľna, pochváľnymi vsí písňmi neprestánno vospojím."),
)
) |
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/let-03.typ | typst | Other | // Ref: false
// Simple destructuring.
#let (a, b) = (1, 2)
#test(a, 1)
#test(b, 2)
|
https://github.com/Thumuss/brainfuck | https://raw.githubusercontent.com/Thumuss/brainfuck/main/README.md | markdown | MIT License | # Brainf
> A brainfuck implementation in pure Typst
# Examples
## In pure brainfuck
```typst
#import "@preview/brainf:1.0.0": brainf;
#brainf("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.");
```
Into

## With inputs
```typst
#import "@preview/brainf:1.0.0": brainf;
#brainf("++++++++++++++[->,.<]", inp: "Goodbye World!");
```
Into

# Links
I've based my implementation from theses documents:
- [Wikipedia](https://en.wikipedia.org/wiki/Brainfuck)
- [Github](https://github.com/sunjay/brainfuck)
- [A compiler of Brainfuck in c](https://onestepcode.com/brainfuck-compiler-c/) |
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/type_check/text_font.typ | typst | Apache License 2.0 | #text(font: "Test")[]
#text(font: ())[]
#text(font: ("Test",))[]
#let x = "Test"
#text(font: x)[]
#let y = ("Test",)
#text(font: y)[] |
https://github.com/MrToWy/Bachelorarbeit | https://raw.githubusercontent.com/MrToWy/Bachelorarbeit/master/Code/sassMain.typ | typst | ```sass
.centerText
text-align: center
.clickable
cursor: pointer
.flex
display: flex
justify-content: center
align-items: center
``` |
|
https://github.com/SkytAsul/INSA-Typst-Template | https://raw.githubusercontent.com/SkytAsul/INSA-Typst-Template/main/README.md | markdown | MIT License | <p align="center">
<img alt="Typst" src="https://img.shields.io/badge/Typst-239DAD?style=for-the-badge&logo=typst&logoColor=FFFFFF"/>
<img alt="GitHub License" src="https://img.shields.io/github/license/SkytAsul/INSA-Typst-Template?style=for-the-badge"/>
</p>
<p align="center">
<a href="https://typst.app/universe/package/silky-report-insa">
<img alt="Report Version" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpackages.typst.org%2Fpreview%2Findex.json&query=%24%5B%3F(%40.name%3D%3D%22silky-report-insa%22)%5D.version&style=for-the-badge&label=Report%20Version&color=red"/>
</a>
<a href="https://typst.app/universe/package/silky-letter-insa">
<img alt="Report Version" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpackages.typst.org%2Fpreview%2Findex.json&query=%24%5B%3F(%40.name%3D%3D%22silky-letter-insa%22)%5D.version&style=for-the-badge&label=Letter%20Version&color=orange"/>
</a>
</p>
# INSA - Typst Template
Typst Template for documents from the french engineering school INSA.
It was primarily made for INSA Rennes, but it now includes INSA HdF assets and should be easily modified to suit other INSA schools.
## Examples
You can find examples for the all the document types [in the `exemples` folder](exemples).
## Usage
### From the online package
Templates are available in the official Typst templates repository (Typst Universe):
- `insa-report`, `insa-stage` and `insa-document` are under the name [`silky-report-insa`](https://typst.app/universe/template/silky-report-insa).
- `insa-letter` is under the name [`silky-letter-insa`](https://typst.app/universe/template/silky-letter-insa).
There are multiple ways to use them:
- From the [Typst web application](https://typst.app/), click on the "Start from template" button and search for the template you want in the list. Click on it, select a name, and click on "Create". Voilà!
- If you want to initialize a new project through the CLI, use
```sh
$ typst init @preview/<template-name>:<version>
```
- If you want to add it to an existing project, copy the `#show` rule from an example [in the `exemples` folder](exemples) *but* replace the `import` by this line:
```typst
#import "@preview/<template-name>:<version>": *
```
> [!IMPORTANT]
> Replace `<template-name>` by the one you need and `<version>` by the latest version available, see at the top.
### From sources (editable version)
1. Create a Typst project, either from the CLI (`typst init`) or from the Web application.
1. Download the code from GitHub. To do that, click on the green "Code" button and then "Download ZIP".

1. Open the ZIP archive file and copy the `insa-template` folder in the directory with your Typst project.
1. (*OPTIONAL*) If you are using the Typst web application, you have to first *create* the `insa-template` folder by clicking on the little folder button in the "Files" panel.

1. (*OPTIONAL*) After creating the folder, simply drag all the files from `insa-template` that you downloaded in it
1. At this point, your file hierarchy should look like this:
```
insa-template/
├── document-template.typ
├── letter-template.typ
└── assets/
├── back-cover1.png
├── ...
└── logo.png
main.typ
```
1. Choose between the available templates: `insa-document`, `insa-report`, `insa-stage` or `insa-letter`.
1. Add this line at the beginning of your Typst file (by default, `main.typ`):
```typst
#import "insa-template/letter-template.typ" : * // for letters and short documents
#import "insa-template/document-template.typ" : * // for reports, stages and full documents
```
1. Copy the `#show` rule from the example document of the template you chose to your Typst file. In example:
```typst
#show: doc => insa-letter(
author: [
<NAME>\
3 INFO G2.1
],
doc
)
````
1. Enjoy!
## Fonts (polices)
The graphic charter recommends the fonts **League Spartan** for headings and **Source Serif** for regular text. To have the best look, you should install those fonts.
To behave correctly on computers lacking those specific fonts, this template will automatically fallback to similar ones:
- **League Spartan** -> **Arial** (approved by INSA's graphic charter, by default in Windows) -> **Liberation Sans** (by default in most Linux)
- **Source Serif** -> **Source Serif 4** (downloadable for free) -> **Georgia** (approved by the graphic charter) -> **Linux Libertine** (default Typst font)
The recommended fonts are included in this repository under `/fonts`.
### Note on variable fonts
If you want to install those fonts on your computer, Typst might not recognize them if you install their _Variable_ versions. You should install the static versions: **League Spartan Bold** and most versions of **Source Serif** (**Regular**, **Bold** and **Italic**).
Keep an eye on [the issue in Typst bug tracker](https://github.com/typst/typst/issues/185) to see when variable fonts will be used!
## Platforms
The template can be used in the web Typst editor *and* in a local environment.
I personnally prefer to use it in Visual Studio Code with the `Tinymist Typst` extension.
You can also directly edit your Typst files with a simple text editor and compile it with the Typst CLI.
See [Installation](https://github.com/typst/typst?tab=readme-ov-file#installation) and [Usage](https://github.com/typst/typst?tab=readme-ov-file#usage) sections on the official Typst repository.
## License
The typst templates (`.typ` files) are licensed under MIT.
This license does _not_ apply to:
- The assets under `/insa-template/assets`. Those image files are property of Groupe INSA, INSA Rennes and INSA HdF.
- The fonts file under `/fonts`. Those files are property of their respective authors. |
https://github.com/cetz-package/cetz-venn | https://raw.githubusercontent.com/cetz-package/cetz-venn/master/src/lib.typ | typst | Apache License 2.0 | #let version = version(0,1,1)
#import "/src/venn.typ": venn2, venn3
|
https://github.com/MaxAtoms/T-705-ASDS | https://raw.githubusercontent.com/MaxAtoms/T-705-ASDS/main/main.typ | typst | #import "template.typ": project, example, note
#import "boxes.typ": definition
#show: project.with(
title: "Applied Statistics\nfor Data Science",
header-title: "T-705 Applied Statistics for Data Science",
subtitle: "Lecture Notes",
university: [Reyjkavík University],
faculty: [Department of Computer Science],
lecturer: [María Óskarsdóttir],
author: "<NAME>",
email: "<EMAIL>",
semester: "Fall Semester 2024"
)
// TODO ToC
These are the notes for the Master part of the lecture T-705 Applied Statistics for Data Science (ASDS).
The lectures held together with T-305 Applied Statistics and introduction to Data Science (ASID) are not included.
No guarantee is given for the correctness of the notes.
Should you find typos, errors or have general suggestions for improvements, please open an issue or pull request in the GitHub repository: https://github.com/MaxAtoms/T-705-ASDS/.
Alternatively, you can contact me via e-mail: #link("<EMAIL>").
// TODO Tag Explanation
// TODO Barron Source
#pagebreak()
#outline(indent:auto, depth:3)
#pagebreak()
#include "content/probability.typ"
// TODO Glossary
|
|
https://github.com/hei-templates/hevs-typsttemplate-thesis | https://raw.githubusercontent.com/hei-templates/hevs-typsttemplate-thesis/main/03-tail/glossary.typ | typst | MIT License | //-----------------------------------------------------------------------------
// Glossary
//
#let gls-scrum=(name:[Scrum], description:[Scrum is an agile process framework for managing complex knowledge work, with an initial emphasis on software development, although it has been used in other fields and is slowly starting to be explored for other complex work, research and advanced technologies.])
//-----------------------------------------------------------------------------
// Acronyms
//
#let acr-ar=(abbr:[AR], long:[Augmented Reality])
|
https://github.com/DashieTM/ost-5semester | https://raw.githubusercontent.com/DashieTM/ost-5semester/main/patterns/weeks/week1.typ | typst | #import "../../utils.typ": *
#section("Pattern Definition")
- addresses a common problem
- specifically why a problem is hard (*forces*)
- *generic solutions* that can be adapted
- describes benefits and liabilities
- gets a name, so we can talk about it
Note:
- patterns often depend on each other
- sometimes extend each other
- or implement parts of it
- are never completely alone -> always exist in environment
#section("GoF Great of Four")
#align(
center, [#image("../../Screenshots/2023_09_22_09_30_09.png", width: 70%)],
)
#subsection("Mediator")
#set text(size: 14pt)
Problem | *Coupling* -> too many objects interact with each other\
Category | *Behavioral*
#align(
center, [#image("../../Screenshots/2023_09_29_09_12_31.png", width: 80%)],
)
#align(
center, [#image("../../Screenshots/2023_09_29_09_15_48.png", width: 80%)],
)
#set text(size: 11pt)
- Be careful with static, the structure can quickly become a too large monolith
with too many colleagues.
- Mediator can be implemented as _Observer_ as well, the mediator is the
observable and the colleagues are the observers.
```java
// Mediator
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface Mediator {
void addDataReceivedListener(@NotNull MediatorEventListener listener);
void addDataSentListener(@NotNull MediatorEventListener listener);
void receiveData(@Nullable String name);
void sendData(@Nullable String name);
}
// MediatorEventListener
import org.jetbrains.annotations.Nullable;
import java.util.EventListener;
@FunctionalInterface
public interface MediatorEventListener extends EventListener {
void change(@Nullable String name);
}
// ConcreteMediator
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.LinkedList;
import java.util.List;
public class ConcreteMediator implements Mediator {
private final List<MediatorEventListener> dataReceivedListeners = new LinkedList<>();
private final List<MediatorEventListener> dataSentListeners = new LinkedList<>();
public void addDataReceivedListener(@NotNull MediatorEventListener listener) {
dataReceivedListeners.add(listener);
}
public void addDataSentListener(@NotNull MediatorEventListener listener) {
dataSentListeners.add(listener);
}
@Override
public void receiveData(@Nullable String name) {
dataReceivedListeners.forEach(l -> l.change(name));
}
@Override
public void sendData(@Nullable String name) {
dataSentListeners.forEach(l -> l.change(name));
}
}
```
#columns(2, [
#text(green)[Benefits]
- Colleague classes may become more reusable, low coupling
- Centralizes control of communication between objects
- Encapsulates protocols
- Liabilities
#colbreak()
#text(red)[Liabilities]
- Adds complexity
- Single point of failure
- Limits subclassing (of mediator class)
- May result in hard maintainable monoliths
])
|
|
https://github.com/Wybxc/typst-nix | https://raw.githubusercontent.com/Wybxc/typst-nix/main/examples/slide.typ | typst | Apache License 2.0 | #import "@preview/polylux:0.3.1": *
#import themes.university: *
#show: university-theme.with(
short-author: "Short author",
short-title: "Short title",
short-date: "Short date",
)
#title-slide(
authors: ("<NAME>", "<NAME>"),
title: "Title",
subtitle: "Subtitle",
date: "Date",
institution-name: "University Name",
)
#slide(title: [Slide title], new-section: [The section])[
#lorem(40)
]
#focus-slide()[
*Another variant with an image in background...*
]
#matrix-slide[
left
][
middle
][
right
]
#matrix-slide(columns: 1)[
top
][
bottom
]
#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)
|
https://github.com/AU-Master-Thesis/thesis | https://raw.githubusercontent.com/AU-Master-Thesis/thesis/main/sections/2-background/mod.typ | typst | MIT License | #import "../../lib/mod.typ": *
= Background <background>
// This section presents the relevant theory made use of for the thesis. First a technical introduction to the underlying theory is covered. In @s.b.gaussian-models and #numref(<s.b.probabilistic-inference>), Gaussian models and probabilistic inference are introduced, respectively. These two topics are the theoretical base for understanding factor graphs and the corresponding methods for inference and reasoning about them, as detailed in sections #numref(<s.b.factor-graphs>)-#numref(<s.b.gaussian-belief-propagation>). Lastly the central concepts of the #acr("ECS") computing architecture is introduced. Each subsection is accompanied with clear examples to help in comprehending the use of the theory.
This section outlines the theory relevant to the thesis. It begins with a technical introduction to the underlying concepts. Gaussian models and probabilistic inference are introduced in @s.b.gaussian-models and #numref(<s.b.probabilistic-inference>), respectively. These topics form the theoretical foundation for understanding factor graphs and their associated inference methods, detailed in sections #numref(<s.b.factor-graphs>) to #numref(<s.b.gaussian-belief-propagation>). Lastly, the central concepts of the #acr("ECS") computing architecture are presented in @s.b.ecs. Each subsection includes clear examples to aid comprehension.
// #include "related-works.typ"
#include "technical-introduction.typ"
#include "factor-graphs.typ"
#include "rrt.typ"
#include "ecs.typ"
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/let-00.typ | typst | Other | // Automatically initialized with none.
#let x
#test(x, none)
// Manually initialized with one.
#let z = 1
#test(z, 1)
// Syntax sugar for function definitions.
#let fill = green
#let f(body) = rect(width: 2cm, fill: fill, inset: 5pt, body)
#f[Hi!]
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-25A0.typ | typst | Apache License 2.0 | #let data = (
("BLACK SQUARE", "So", 0),
("WHITE SQUARE", "So", 0),
("WHITE SQUARE WITH ROUNDED CORNERS", "So", 0),
("WHITE SQUARE CONTAINING BLACK SMALL SQUARE", "So", 0),
("SQUARE WITH HORIZONTAL FILL", "So", 0),
("SQUARE WITH VERTICAL FILL", "So", 0),
("SQUARE WITH ORTHOGONAL CROSSHATCH FILL", "So", 0),
("SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL", "So", 0),
("SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL", "So", 0),
("SQUARE WITH DIAGONAL CROSSHATCH FILL", "So", 0),
("BLACK SMALL SQUARE", "So", 0),
("WHITE SMALL SQUARE", "So", 0),
("BLACK RECTANGLE", "So", 0),
("WHITE RECTANGLE", "So", 0),
("BLACK VERTICAL RECTANGLE", "So", 0),
("WHITE VERTICAL RECTANGLE", "So", 0),
("BLACK PARALLELOGRAM", "So", 0),
("WHITE PARALLELOGRAM", "So", 0),
("BLACK UP-POINTING TRIANGLE", "So", 0),
("WHITE UP-POINTING TRIANGLE", "So", 0),
("BLACK UP-POINTING SMALL TRIANGLE", "So", 0),
("WHITE UP-POINTING SMALL TRIANGLE", "So", 0),
("BLACK RIGHT-POINTING TRIANGLE", "So", 0),
("WHITE RIGHT-POINTING TRIANGLE", "Sm", 0),
("BLACK RIGHT-POINTING SMALL TRIANGLE", "So", 0),
("WHITE RIGHT-POINTING SMALL TRIANGLE", "So", 0),
("BLACK RIGHT-POINTING POINTER", "So", 0),
("WHITE RIGHT-POINTING POINTER", "So", 0),
("BLACK DOWN-POINTING TRIANGLE", "So", 0),
("WHITE DOWN-POINTING TRIANGLE", "So", 0),
("BLACK DOWN-POINTING SMALL TRIANGLE", "So", 0),
("WHITE DOWN-POINTING SMALL TRIANGLE", "So", 0),
("BLACK LEFT-POINTING TRIANGLE", "So", 0),
("WHITE LEFT-POINTING TRIANGLE", "Sm", 0),
("BLACK LEFT-POINTING SMALL TRIANGLE", "So", 0),
("WHITE LEFT-POINTING SMALL TRIANGLE", "So", 0),
("BLACK LEFT-POINTING POINTER", "So", 0),
("WHITE LEFT-POINTING POINTER", "So", 0),
("BLACK DIAMOND", "So", 0),
("WHITE DIAMOND", "So", 0),
("WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND", "So", 0),
("FISHEYE", "So", 0),
("LOZENGE", "So", 0),
("WHITE CIRCLE", "So", 0),
("DOTTED CIRCLE", "So", 0),
("CIRCLE WITH VERTICAL FILL", "So", 0),
("BULLSEYE", "So", 0),
("BLACK CIRCLE", "So", 0),
("CIRCLE WITH LEFT HALF BLACK", "So", 0),
("CIRCLE WITH RIGHT HALF BLACK", "So", 0),
("CIRCLE WITH LOWER HALF BLACK", "So", 0),
("CIRCLE WITH UPPER HALF BLACK", "So", 0),
("CIRCLE WITH UPPER RIGHT QUADRANT BLACK", "So", 0),
("CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK", "So", 0),
("LEFT HALF BLACK CIRCLE", "So", 0),
("RIGHT HALF BLACK CIRCLE", "So", 0),
("INVERSE BULLET", "So", 0),
("INVERSE WHITE CIRCLE", "So", 0),
("UPPER HALF INVERSE WHITE CIRCLE", "So", 0),
("LOWER HALF INVERSE WHITE CIRCLE", "So", 0),
("UPPER LEFT QUADRANT CIRCULAR ARC", "So", 0),
("UPPER RIGHT QUADRANT CIRCULAR ARC", "So", 0),
("LOWER RIGHT QUADRANT CIRCULAR ARC", "So", 0),
("LOWER LEFT QUADRANT CIRCULAR ARC", "So", 0),
("UPPER HALF CIRCLE", "So", 0),
("LOWER HALF CIRCLE", "So", 0),
("BLACK LOWER RIGHT TRIANGLE", "So", 0),
("BLACK LOWER LEFT TRIANGLE", "So", 0),
("BLACK UPPER LEFT TRIANGLE", "So", 0),
("BLACK UPPER RIGHT TRIANGLE", "So", 0),
("WHITE BULLET", "So", 0),
("SQUARE WITH LEFT HALF BLACK", "So", 0),
("SQUARE WITH RIGHT HALF BLACK", "So", 0),
("SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK", "So", 0),
("SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK", "So", 0),
("WHITE SQUARE WITH VERTICAL BISECTING LINE", "So", 0),
("WHITE UP-POINTING TRIANGLE WITH DOT", "So", 0),
("UP-POINTING TRIANGLE WITH LEFT HALF BLACK", "So", 0),
("UP-POINTING TRIANGLE WITH RIGHT HALF BLACK", "So", 0),
("LARGE CIRCLE", "So", 0),
("WHITE SQUARE WITH UPPER LEFT QUADRANT", "So", 0),
("WHITE SQUARE WITH LOWER LEFT QUADRANT", "So", 0),
("WHITE SQUARE WITH LOWER RIGHT QUADRANT", "So", 0),
("WHITE SQUARE WITH UPPER RIGHT QUADRANT", "So", 0),
("WHITE CIRCLE WITH UPPER LEFT QUADRANT", "So", 0),
("WHITE CIRCLE WITH LOWER LEFT QUADRANT", "So", 0),
("WHITE CIRCLE WITH LOWER RIGHT QUADRANT", "So", 0),
("WHITE CIRCLE WITH UPPER RIGHT QUADRANT", "So", 0),
("UPPER LEFT TRIANGLE", "Sm", 0),
("UPPER RIGHT TRIANGLE", "Sm", 0),
("LOWER LEFT TRIANGLE", "Sm", 0),
("WHITE MEDIUM SQUARE", "Sm", 0),
("BLACK MEDIUM SQUARE", "Sm", 0),
("WHITE MEDIUM SMALL SQUARE", "Sm", 0),
("BLACK MEDIUM SMALL SQUARE", "Sm", 0),
("LOWER RIGHT TRIANGLE", "Sm", 0),
)
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/docs/roadmap.md | markdown | Apache License 2.0 | ---
description: What we have planned for Typst.
---
# Roadmap
This page lists planned features for the Typst language, compiler, library and
web app. Since priorities and development realities change, this roadmap is not
set in stone. Features that are listed here will not necessarily be implemented
and features that will be implemented might be missing here. As for bug fixes,
this roadmap will only list larger, more fundamental ones.
Are you missing something on the roadmap? Typst relies on your feedback as a
user to plan for and prioritize new features. Get started by filing a new issue
on [GitHub](https://github.com/typst/typst/issues) or discuss your feature
request with the [community]($community).
## Language and Compiler
- **Structure and Styling**
- Fix show rule recursion
- Fix show-set order
- Fix show-set where both show and set affect the same kind of element
(to set properties on elements that match a selector)
- Ancestry selectors (e.g., within)
- Custom elements (that work with set and show rules)
- Possibly a capability system, e.g. to make your own element referenceable
- **Layout**
- Advanced floating layout
- Rework layout engine to a more flexible model that has first-class support
for both "normal" text layout and more canvas-like layout
- Unified layout primitives across normal content and math
- Named alignment to synchronize alignment across different layout hierarchies
- Chained layout regions
- Page adjustment from within flow
- Advanced page break optimization
- Grid-based typesetting
- Layout with collision
- **Export**
- Implement emoji export
- HTML export
- EPUB export
- Tagged PDF for Accessibility
- PDF/A and PDF/X support
- **Text and Fonts**
- Font fallback warnings
- Fix SVG font fallback
- Proper foundations for i18n
- Bold, italic, and smallcaps synthesis
- Variable fonts support
- Ruby and Warichu
- Kashida justification
- **Scripting**
- Allow expressions as dictionary keys
- Function hoisting if possible
- Get values of set rules
- Doc comments
- Type hints
- **Visualization**
- Arrows
- Gradients
- Better path drawing
- Color management
- **Tooling**
- Autoformatter
- Linter
- Documentation generator
- **Development**
- Benchmarking
- Better contributor documentation
## Library
- **Customization**
- Integrate CSL (Citation Style Language)
- Bibliography and citation customization
- Outline customization
- Table stroke customization
- **Numbering**
- Relative counters, e.g. for figure numbering per section
- Improve equation numbering
- Fix issues with numbering patterns
- Enum continuation
- **Layout**
- Row span and column span in table
- Balanced columns
- Drop caps
- End notes, maybe margin notes
- **Math**
- Fix syntactic quirks
- Fix font handling
- Provide more primitives
- Smarter automatic delimiter sizing
- Big fractions
- **Other**
- Plotting
## Web App
- **Editing**
- Smarter & more action buttons
- Basic, built-in image editor (cropping, etc.)
- Color Picker
- Symbol picker
- GUI inspector for editing function calls
- Preview autocomplete entry
- Cursor in preview
- Inline documentation
- More export options
- Preview in a separate window
- **Writing**
- Spell check
- Word count
- Structure view
- Pomodoro
- Text completion by LLM
- **Collaboration**
- Chat-like comments
- Change tracking
- Version history
- Git integration
- **Project management**
- Drag-and-drop for projects
- Thumbnails for projects
- Template generation by LLM
- LaTeX, Word, Markdown import
- **Settings**
- Keyboard shortcuts configuration
- Better project settings
- System Theme setting
- Avatar Cropping
- **Other**
- Offline PWA
- Single sign-on
- Two-Factor Authentication
- Advanced search in projects
- Private packages in teams
- On-Premise deployment
- Mobile improvements
|
https://github.com/sitandr/typst-examples-book | https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/packages/math.md | markdown | MIT License | # Math
## General
### `physica`
> Physica (Latin for _natural sciences_) provides utilities that simplify
> otherwise complex and repetitive mathematical expressions in natural sciences.
> Its [manual](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf)
> provides a full set of demonstrations of how the package could be helpful.
#### Common notations
* Calculus: differential, ordinary and partial derivatives
* Optional function name,
* Optional order number or an array of thereof,
* Customizable "d" symbol and product joiner (say, exterior product),
* Overridable total order calculation,
* Vectors and vector fields: div, grad, curl,
* Taylor expansion,
* Dirac braket notations,
* Tensors with abstract index notations,
* Matrix transpose and dagger (conjugate transpose).
* Special matrices: determinant, (anti-)diagonal, identity, zero, Jacobian,
Hessian, etc. <!-- TODO Add rotation and gram matrices in physica:0.9.2 -->
Below is a preview of those notations.
```typ
#import "@preview/physica:0.9.1": * // Symbol names annotated below
#table(
columns: 4, align: horizon, stroke: none, gutter: 1em,
// vectors: bold, unit, arrow
[$ vb(a), vb(e_i), vu(a), vu(e_i), va(a), va(e_i) $],
// dprod (dot product), cprod (cross product), iprod (innerproduct)
[$ a dprod b, a cprod b, iprod(a, b) $],
// laplacian (different from built-in laplace)
[$ dot.double(u) = laplacian u =: laplace u $],
// grad, div, curl (vector fields)
[$ grad phi, div vb(E), \ curl vb(B) $],
)
```
```typ
#import "@preview/physica:0.9.1": * // Symbol names annotated below
#table(
columns: 4, align: horizon, stroke: none, gutter: 1em,
// Row 1.
// dd (differential), var (variation), difference
[$ dd(f), var(f), difference(f) $],
// dd, with an order number or an array thereof
[$ dd(x,y), dd(x,y,2), \ dd(x,y,[1,n]), dd(vb(x),t,[3,]) $],
// dd, with custom "d" symbol and joiner
[$ dd(x,y,p:and), dd(x,y,d:Delta), \ dd(x,y,z,[1,1,n+1],d:d,p:dot) $],
// dv (ordinary derivative), with custom "d" symbol and joiner
[$ dv(phi,t,d:Delta), dv(phi,t,d:upright(D)), dv(phi,t,d:delta) $],
// Row 2.
// dv, with optional function name and order
[$ dv(,t) (dv(x,t)) = dv(x,t,2) $],
// pdv (partial derivative)
[$ pdv(f,x,y,2), pdv(,x,y,[k,]) $],
// pdv, with auto-added overridable total
[$ pdv(,x,y,[i+2,i+1]), pdv(,y,x,[i+1,i+2],total:3+2i) $],
// In a flat form
[$ dv(u,x,s:slash), \ pdv(u,x,y,2,s:slash) $],
)
```
<!--
// TODO Add Order/order once physica:0.9.2 is merged.
// TODO Demo expval(A, phi) once physica:0.9.2 is merged.
-->
```typ
#import "@preview/physica:0.9.1": * // Symbol names annotated below
#table(
columns: 3, align: horizon, stroke: none, gutter: 1em,
// tensor
[$ tensor(T,+a,-b,-c) != tensor(T,-b,-c,+a) != tensor(T,+a',-b,-c) $],
// Set builder notation
[$ Set(p, {q^*, p} = 1) $],
// taylorterm (Taylor series term)
[$ taylorterm(f,x,x_0,1) \ taylorterm(f,x,x_0,(n+1)) $],
)
```
```typ
#import "@preview/physica:0.9.1": * // Symbol names annotated below
#table(
columns: 3, align: horizon, stroke: none, gutter: 1em,
// expval (mean/expectation value), eval (evaluation boundary)
[$ expval(X) = eval(f(x)/g(x))^oo_1 $],
// Dirac braket notations
[$
bra(u), braket(u), braket(u, v), \
ket(u), ketbra(u), ketbra(u, v), \
mel(phi, hat(p), psi) $],
// Superscript show rules that need to be enabled explicitly.
// If put in a content block, they only control that block's scope.
[
#show: super-T-as-transpose // "..^T" just like handwriting
#show: super-plus-as-dagger // "..^+" just like handwriting
$ op("conj")A^T =^"def" A^+ \
e^scripts(T), e^scripts(+) $ ], // Override with scripts()
)
```
#### Matrices
In addition to Typst's built-in `mat()` to write a matrix, physica provides a
number of handy tools to make it even easier.
```typ
#import "@preview/physica:0.9.1": TT, mdet
$
// Matrix transpose with "TT", though it is recommended to
// use super-T-as-transpose so that "A^T" also works (more on that later).
A^TT,
// Determinant with "mdet(...)".
det mat(a, b; c, d) := mdet(a, b; c, d)
$
```
Diagonal matrix `dmat(...)`, antidiagonal matrix `admat(...)`,
identity matrix `imat(n)`, and zero matrix `zmat(n)`.
```typ
#import "@preview/physica:0.9.1": dmat, admat, imat, zmat
$ dmat(1, 2) dmat(1, a_1, xi, fill:0) quad
admat(1, 2) admat(1, a_1, xi, fill:dot, delim:"[") quad
imat(2) imat(3, delim:"{",fill:*) quad
zmat(2) zmat(3, delim:"|") $
```
Jacobian matrix with `jmat(func; ...)` or the longer name `jacobianmatrix`,
Hessian matrix with `hmat(func; ...)` or the longer name `hessianmatrix`, and
finally `xmat(row, col, func)` to build a matrix.
```typ
#import "@preview/physica:0.9.1": jmat, hmat, xmat
$
jmat(f_1,f_2; x,y) jmat(f,g; x,y,z; delim:"[") quad
hmat(f; x,y) hmat(; x,y; big:#true) quad
#let elem-ij = (i,j) => $g^(#(i - 1)#(j - 1)) = #calc.pow(i,j)$
xmat(2, 2, #elem-ij)
$
```
### `mitex`
> MiTeX provides LaTeX support powered by WASM in Typst, including real-time rendering of LaTeX math equations.
> You can also use LaTeX syntax to write `\ref` and `\label`.
> Please refer to the [manual](https://github.com/mitex-rs/mitex) for more details.
```typ
#import "@preview/mitex:0.2.4": *
Write inline equations like #mi("x") or #mi[y].
Also block equations:
#mitex(`
\newcommand{\f}[2]{#1f(#2)}
\f\relax{x} = \int_{-\infty}^\infty
\f\hat\xi\,e^{2 \pi i \xi x}
\,d\xi
`)
Text mode:
#mitext(`
\iftypst
#set math.equation(numbering: "(1)", supplement: "equation")
\fi
An inline equation $x + y$ and block \eqref{eq:pythagoras}.
\begin{equation}
a^2 + b^2 = c^2 \label{eq:pythagoras}
\end{equation}
`)
```
### `i-figured`
Configurable equation numbering per section in Typst.
There is also figure numbering per section, see more examples in its [manual](https://github.com/RubixDev/typst-i-figured).
```typ
#import "@preview/i-figured:0.2.3"
// make sure you have some heading numbering set
#set heading(numbering: "1.1")
// apply the show rules (these can be customized)
#show heading: i-figured.reset-counters
#show math.equation: i-figured.show-equation.with(
level: 1,
zero-fill: true,
leading-zero: true,
numbering: "(1.1)",
prefix: "eqt:",
only-labeled: false, // numbering all block equations implicitly
unnumbered-label: "-",
)
= Introduction
You can write inline equations such as $x + y$, and numbered block equations like:
$ phi.alt := (1 + sqrt(5)) / 2 $ <ratio>
To reference a math equation, please use the `eqt:` prefix. For example, with @eqt:ratio, we have:
$ F_n = floor(1 / sqrt(5) phi.alt^n) $
= Appdendix
Additionally, you can use the <-> tag to indicate that a block formula should not be numbered:
$ y = integral_1^2 x^2 dif x $ <->
Subsequent math equations will continue to be numbered as usual:
$ F_n = floor(1 / sqrt(5) phi.alt^n) $
```
## Theorems
### `ctheorem`
A numbered theorem environment in Typst. See more examples in its
[manual](https://github.com/sahasatvik/typst-theorems/blob/main/manual.pdf).
```typ
#import "@preview/ctheorems:1.1.0": *
#show: thmrules
#set page(width: 16cm, height: auto, margin: 1.5cm)
#set heading(numbering: "1.1")
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
#let corollary = thmplain("corollary", "Corollary", base: "theorem", titlefmt: strong)
#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
#let example = thmplain("example", "Example").with(numbering: none)
#let proof = thmplain(
"proof", "Proof", base: "theorem",
bodyfmt: body => [#body #h(1fr) $square$]
).with(numbering: none)
= Prime Numbers
#lorem(7)
#definition[ A natural number is called a #highlight[_prime number_] if ... ]
#example[
The numbers $2$, $3$, and $17$ are prime. See @cor_largest_prime shows that
this list is not exhaustive!
]
#theorem("Euclid")[There are infinitely many primes.]
#proof[
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
of all primes. ... a contradiction.
]
#corollary[
There is no largest prime number.
] <cor_largest_prime>
#corollary[There are infinitely many composite numbers.]
```
### `lemmify`
Lemmify is another theorem evironment generator with many selector and numbering
capabilities. See documentations in its [readme](https://github.com/Marmare314/lemmify).
```typ
#import "@preview/lemmify:0.1.5": *
#let my-thm-style(
thm-type, name, number, body
) = grid(
columns: (1fr, 3fr),
column-gutter: 1em,
stack(spacing: .5em, [#strong(thm-type) #number], emph(name)),
body
)
#let my-styling = ( thm-styling: my-thm-style )
#let (
definition, theorem, proof, lemma, rules
) = default-theorems("thm-group", lang: "en", ..my-styling)
#show: rules
#show thm-selector("thm-group"): box.with(inset: 0.8em)
#show thm-selector("thm-group", subgroup: "theorem"): it => box(
it, fill: rgb("#eeffee"))
#set heading(numbering: "1.1")
= Prime numbers
#lorem(7) @proof and @thm[theorem]
#definition[ A natural number is called a #highlight[_prime number_] if ... ]
#theorem(name: "Theorem name")[There are infinitely many primes.]<thm>
#proof[
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
of all primes. ... #highlight[_a contradiction_].]<proof>
#lemma[There are infinitely many composite numbers.]
```
|
https://github.com/dadn-dream-home/documents | https://raw.githubusercontent.com/dadn-dream-home/documents/main/contents/02-phan-tich-yeu-cau/index.typ | typst | = Phân tích yêu cầu
Nhóm chia làm các yêu cầu chức năng và yêu cầu phi chức năng.
== Yêu cầu chức năng
Nhóm đề xuất các yêu cầu phi chức năng như sau:
- Đo độ sáng, độ ẩm, nhiệt độ trong phòng.
- Hiển thị các giá trị đo được trên màn hình LCD.
- Điều khiển thiết bị trong phòng.
- Hiển thị các giá trị đo được trên app.
- Thêm, bớt các thiết bị.
- Điều chỉnh ngưỡng cảm biến thông báo.
- Kích hoạt các thiết bị khác khi vượt ngưỡng.
- Lưu lịch sử hoạt động của thiết bị.
== Yêu cầu phi chức năng
Nhóm đề xuất các yêu cầu phi chức năng như sau:
- Số liệu update liên tục trong ít nhất 2 phút.
- Số liệu lưu trên server ít nhất 1 năm.
- Ứng dụng chạy được trên Android.
- Người dùng có thể self-host hệ thống.
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/array-31.typ | typst | Other | // Error: 2-20 cannot join string with integer
#("a", "b").join(1)
|
https://github.com/wangjiezhe/typst-syntax | https://raw.githubusercontent.com/wangjiezhe/typst-syntax/main/README.md | markdown | Apache License 2.0 | # Typst Syntax
This is seperated from [tinymist](https://github.com/Myriad-Dreamin/tinymist).
What I need is to work with [Shift-IM-for-VSCode](https://github.com/wangjiezhe/Shift-IM-for-VSCode) to automatically change IME condition in Typst file. It does work on Windows, but when I use WSL, it does not!
The reason is that Shift-IM must work on as an UI extension, whereas tinymist can only work as a workspace extension. Shift-IM use `vscode.extensions.all` to get all installed extensions, but it only gives extensions running on the same matchine.
So I separate the grammar part of tinymist, to make it work as an UI extension.
|
https://github.com/VisualFP/docs | https://raw.githubusercontent.com/VisualFP/docs/main/SA/design_concept/content/introduction/goals.typ | typst | #import "../../../acronyms.typ": *
= Goals <goals>
The goal of this student research project is to design a tool, VisualFP, that allows the
graphical development of functional code and is block-based.
The target audience of VisualFP are students learning to program.
The core functionality of VisualFP will be implemented in a #ac("PoC") to
prove the feasibility of the design.
The central part of this project is to document the design process used to
create VisualFP transparently to allow others to better understand the decisions
made during the project, which alternatives were considered, and to evaluate
whether they want to follow the same path.
Due to the time constraints of this project, the goals deviate from the initial task description in @appendix_task_description.
While support for experienced programmers who want to view
their code in a visual context is included in @functional_requirements, interoperability with Haskell isn't a goal for this project.
In addition, the #ac("PoC") is treated as a sample application to prove that the design concept works and not necessarily as a starting point for fully implementing the VisualFP application. |
|
https://github.com/jujimeizuo/ZJSU-typst-template | https://raw.githubusercontent.com/jujimeizuo/ZJSU-typst-template/master/contents/acknowledgement.typ | typst | Apache License 2.0 | 完成本篇论文之际,我要向许多人表达我的感激之情。
首先,我要感谢我的指导教师,他/她对本文提供的宝贵建议和指导。所有这些支持和指导都是无私的,而且让我受益匪浅。
其次,我还要感谢我的家人和朋友们,他们一直以来都是我的支持和鼓励者。他们从未停止鼓舞我,勉励我继续前行,感谢你们一直在我身边,给我幸福和力量。
此外,我还要感谢我的同学们,大家一起度过了很长时间的学习时光,互相支持和鼓励,共同进步。因为有你们的支持,我才能不断地成长、进步。
最后,我想感谢笔者各位,你们的阅读和评价对我非常重要,这也让我意识到了自己写作方面的不足,同时更加明白了自己的研究方向。谢谢大家!
再次向所有支持和鼓励我的人表达我的谢意和感激之情。
本致谢生成自 ChatGPT。 |
https://github.com/tymbalodeon/job-application | https://raw.githubusercontent.com/tymbalodeon/job-application/main/src/cover-letter.typ | typst | #import "_content.typ": cover-letter-content, name
#set page(paper: "us-letter")
#set text(11pt)
#set par(justify: true)
#include "_header.typ"
#v(-0.5em)
#line(length: 100%)
#v(0.5em)
Dear Hiring Manager,
\
\
#cover-letter-content
\
Sincerely,\
#emph(name)
|
|
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/VerbaliInterni/VerbaleInterno_231124/meta.typ | typst | MIT License | #let data_incontro = "24-11-2023"
#let inizio_incontro = "11:00"
#let fine_incontro = "11:30"
#let luogo_incontro = "Chiamata Discord" |
https://github.com/0xPARC/0xparc-intro-book | https://raw.githubusercontent.com/0xPARC/0xparc-intro-book/main/summer-notes-evan/src/0812-math-seminar.typ | typst | #import "@local/evan:1.0.0":*
= Math seminar for August 12: Binius (<NAME>)
== Synopsis
One of the annoyances about our cryptographic ecosystem right now is they
often have different underlying base fields.
For example, one system might use a 128-bit prime while the other uses a 256-bit prime.
And then you have to figure out how to interact between them,
and there may not be a great way to do this in general.
So why don't we just use a two-element field $FF_2$?
Well, the problem is that most of our protocols rely on $q$ over $FF_q$,
say $q approx 2^256$.
This is an important criteria because, for example, a random challenge comes from a huge space,
so two polynomials that differ are unlikely to have many common roots.
Over $FF_2$, we don't have this, $2$-element fields are too small.
So in this math talk we're going to try to build a _finite extension_ of $FF_2$ that's big.
== Review of complex numbers
Recall that the way we extend $RR$ to $CC$ by adjoining a single element,
traditionally named $i$, which is imagined as a root of the (irreducible) polynomial $X^2+1$.
Our tower looks like
$
i in& CC
& RR
$
After we do this, we can do addition, e.g.
$ (a + b i)(c + d i) = (a c - b d) + (b c + a d) i. $
Division can be done too since
$ a + b i = a/(a^2+b^2) + b/(a^2+b^2) i. $
== Construction of $FF_4$, the field with four elements
We'd like to do the same thing by taking an irreducible quadratic polynomial over $FF_2$.
There are four possible quadratic polynomials ($X^2$, $X^2+1$, $X^2+X$, $X^2+X+1$),
and of these only the fourth one is irreducible.
So let us agree to take $p_0$ to be a root of $X^2+X+1$.
Then $FF_4$ will consist of our four elements
$ FF_4 = { a p_0 + b | a in {0,1}, b in {0,1} }. $
Our tower of fields now has two links in it:
$
p_0 in& FF_4 \
& FF_2
$
As some practice with arithmetic in this fields:
$
p_0^2 &= p_0 + 1 \
p_0 + p_0 &= (1+1) p_0 = 0 \
1/p_0 &= p_0 + 1 \
1/(p_0+1) &= p_0.
$
(Right now, this third identity might be easiest to find by guessing all four,
since there are only four elements. The fourth one follows from the third identity.)
Now for $FF_4$ we're going to imagine we encode our four elements using binary strings:
$
0 &-> 00 \
1 &-> 10 \
p_0 &-> 01 \
p_0+1 &-> 11.
$
In other words, we encode $a+b p_0$ by simply writing $a b$.
Then
- Addition corresponds to just bitwise XOR; but
- Multiplication is more annoying: $(a + b p_0)(c + d p_0) = (a c + b d) + (a d + b c + b d) p_0$.
We could imagine implementing this in a circuit.
== Moving on to $FF_16$, the field with eight elements
To extend $FF_4$ to $FF_16$,
we need to guess a quadratic polynomial with coefficients in $FF_4$ which is irreducible.
It turns out that about half of the choices will factor and half won't.
But we standardize one particular choice to make things easier.
Recall that $p_0 in F_4$.
Ur next element $p_1$ will be chosen so that
$ p_1 + 1/p_1 = p_0. $
Indeed, we can check $ X + 1/X $ has no roots of $FF_4$ by trying them all.
(Note that $p_0 + 1/p_0 = 1$ and $(p_0+1) + 1/(p_0+1) = 1$.)
In still other words, $p_1$ is chosen to be one root of the quadratic
$ X^2 - p_0 X + 1 = 0. $
We then write
$ FF_16 = { a p_1 + b | a in FF_4, b in FF_4 } $
which indeed has $4^2 = 16$ elements.
Our tower of fields now reads
$
p_1 in& FF_16 \
p_0 in& FF_4 \
& FF_2
$
Multiplication can be done, e.g.
$ p_1^2 = p_0 p_1 + 1. $
As a more complicated example, we can calculate
$
&#hide[=] (p_0 p_1 + 1)^2 \
&= p_0^2 p_1^2 + 1 \
&= p_0^2 (p_0 p_1 + 1) + 1 \
&= p_0^3 p_1 + (p_0^2 + 1) \
&= p_0 + p_1.
$
Division can be done by a system of equations or a "multiply-by-conjugate" trick,
but we won't cover that here.
== Keep going
Now $16$ elements is still not good enough for cryptographic security,
so we now have to show how we keep going.
We go one level higher from $FF_16$ to $FF_256$ by introducing $p_2$ such that
$ p_2 + 1 / p_2 = p_1 <=> p_2^2 + 1 = p_1 p_2. $
(We won't prove that $t + 1/t != p_1$ for any $t in FF_16$,
i.e. that $X^2 - p_1 X + 1$ does not factor in $FF_16$.
I think a high-powered proof is to use the fact that the
Chebyshev polynomials are irreducible modulo $2$.)
Our tower now looks like:
$
p_2 in& FF_256 \
p_1 in& FF_16 \
p_0 in& FF_4 \
& FF_2.
$
The pattern continues
$ FF_256 = { a p_2 + b | a in FF_16, b in FF_16 } $
Multiplication can be done in an analogous way, by induction:
$ (a p_2 + b)(c p_2 + d)
&= a c p_2^2 + (b c + a d) p_2 + b d \
&= (b c + a d + a c) p_2 + (b d + a c) $
Bit representations can done by induction as well.
An $FF_16$ element could be written as
$ a_0 + a_1 p _0 + a_2 p_1 + a_3 p_0 p_1 $
and hence a four-bit string.
An $FF_256$ element could be written with $8$ bits as you need.
|
|
https://github.com/Az-21/typst-components | https://raw.githubusercontent.com/Az-21/typst-components/main/style/1.0.0/style.typ | typst | Creative Commons Zero v1.0 Universal | #import "dependencies.typ": *
#import "Colors/m3.typ": *
#import "Components/_components.typ": *
// @override default style
#import "override.typ": *
|
https://github.com/m4cey/mace-typst | https://raw.githubusercontent.com/m4cey/mace-typst/main/math.typ | typst | #import "./math/logic.typ" as logic
|
|
https://github.com/teamdailypractice/pdf-tools | https://raw.githubusercontent.com/teamdailypractice/pdf-tools/main/typst-pdf/examples/example-07.typ | typst | #image("images/Glacier-640px.jpg", width: 70%)
|
|
https://github.com/herbhuang/utdallas-thesis-template-typst | https://raw.githubusercontent.com/herbhuang/utdallas-thesis-template-typst/main/content/proposal/problem.typ | typst | MIT License | #import "/utils/todo.typ": TODO
= Problem
#TODO[ // Remove this block
*Problem description*
- What is/are the problem(s)?
- Identify the actors and use these to describe how the problem negatively influences them.
- Do not present solutions or alternatives yet!
- Present the negative consequences in detail
]
|
https://github.com/herbhuang/utdallas-thesis-template-typst | https://raw.githubusercontent.com/herbhuang/utdallas-thesis-template-typst/main/content/evaluation.typ | typst | MIT License | #import "/utils/todo.typ": TODO
= Case Study / Evaluation
#TODO[
If you did an evaluation / case study, describe it here.
]
== Design
#TODO[
Describe the design / methodology of the evaluation and why you did it like that. e.g. what kind of evaluation have you done (e.g. questionnaire, personal interviews, simulation, quantitative analysis of metrics), what kind of participants, what kind of questions, what was the procedure?
]
== Objectives
#TODO[
Derive concrete objectives / hypotheses for this evaluation from the general ones in the introduction.
]
== Results
#TODO[
Summarize the most interesting results of your evaluation (without interpretation). Additional results can be put into the appendix.
]
== Findings
#TODO[
Interpret the results and conclude interesting findings
]
== Discussion
#TODO[
Discuss the findings in more detail and also review possible disadvantages that you found
]
== Limitations
#TODO[
Describe limitations and threats to validity of your evaluation, e.g. reliability, generalizability, selection bias, researcher bias
] |
https://github.com/VectorFrankenstein/Resume | https://raw.githubusercontent.com/VectorFrankenstein/Resume/main/README.md | markdown | # Resume
My resume in typst, could be your too (: !
This code-base was heavily inspired by [this repo](https://github.com/jskherman/imprecv) from [jskherman](https://github.com/jskherman).
Ever since I was introduced to LaTeX, I had an idea in the back of my mind: a resume setup that separates the information from the typesetting code. Due to various reasons, I was unable to achieve this in LaTeX, but in this repo, I have realized my idea.
Using the code in this repo, you can easily update your resume. The information stays in the YAML file, and the code stays in the typ file. The code and data are structured with an eye towards reusability, extensibility, and readability.
Not perfect, but very usable. I'm happy to receive feedback to make it even better.
|
|
https://github.com/xkevio/parcio-typst | https://raw.githubusercontent.com/xkevio/parcio-typst/main/parcio-slides/main.typ | typst | MIT License | #import "template/parcio.typ": *
// See template file > Helper Functions for extra stuff!
#show: parcio-theme.with()
#set text(size: 20pt)
#title-slide(
title: "Title",
subtitle: "Subtitle",
author: (name: "Author", mail: "<EMAIL>"),
date: datetime.today().display("[month repr:long] [day], [year]"),
extra: [
#set text(0.825em)
Faculty of Computer Science\
Otto von Guericke University Magdeburg
],
)
#outline-slide()
#slide(title: "Template", new-section: "Introduction")[
- This presentation template is available at
https://github.com/xkevio/parcio-typst and consists of Sections 1 to 4.
]
#slide(
title: "Figures",
)[
#subfigure(
caption: "Test",
columns: 2,
label: <fig1>,
figure(caption: "Left")[
#image(alt: "Blue OVGU logo", width: 75%, "template/ovgu.svg")
],<fig1a>,
figure(caption: "Right")[
#image(alt: "Blue OVGU logo", width: 75%, "template/ovgu.svg")
],<fig1b>
)
\
- You can refer to the subfigures (Figures @fig1a[] and
@fig1b[]) or the figure (@fig1).
]
#slide(
title: "References",
new-section: "Background",
)[
- You can comfortably reference literature @DuweLMSF0B020 #footnote[This is a footnote.]
]
#slide(title: "Tables")[
// You can also create normal tables with `#table`,
// this one just has some styling preapplied.
#figure(caption: "Caption", parcio-table(4, columns: 3,
[*Header 1*], [*Header 2*], [*Header 3*],
[Row 1], [Row 1], [Row 1],
[Row 2], [Row 2], [Row 2],
[Row 3], [Row 3], [Row 3],
))<tbl>
- You can also refer to tables (@tbl)
]
#slide(
title: "Math",
)[
$ (diff T) / (diff x)(0, t) = (diff T) / (diff x)(L, t) = 0\ "where" forall t > 0 "with" L = "length". $
\
#figure(caption: "Lots of fun math!", kind: math.equation)[
$&sum_(k = 0)^n pi dot k \
<=> &sum_(k = 1)^n pi dot k \
<=> &sum_(k = 2)^n (pi dot k) + pi
$
]
]
#s(t: "Listings", ns: "Evaluation")[
#figure(caption: "Caption")[
```c
printf("Hello World\n");
// Comment
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
sum += 'a';
}
}
```
]<lst>
- You can also refer to listings (@lst)
]
#s(t: "Columns")[
#grid(columns: (1fr, 1fr), column-gutter: 1em)[
- Slides can be split into columns
][
```c
printf("Hello World\n");
// Comment
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
sum += 'a';
}
}
```
]
]
#slide(title: "Todos", new-section: "Conclusion")[
#todo("FIXME")
#lorem(125)
]
#bib-slide("../bibliography/report.bib") |
https://github.com/Tiggax/zakljucna_naloga | https://raw.githubusercontent.com/Tiggax/zakljucna_naloga/main/src/sec/2namen.typ | typst | #set heading(offset: 2)
The purpose of this thesis is to investigate the application of mathematical modeling in the optimization of bioreactors, a critical component in the field of biotechnology.
The primary focus will be on elucidating the effectiveness of this interdisciplinary approach in improving bioreactors efficiency, reducing operational costs, and mitigating associated environmental impacts.
The thesis aims to develop an in-depth understanding of how mathematical methodologies can assist in predicting, controlling, and enhancing the performance of bioreactors, which will ultimately lead to significant advancements in sectors of pharmaceuticals.
Further, this work would deliver a comprehensive perspective on how to integrate mathematical modeling into the bioreactor design process, thereby promoting sustainability and resilience in bio-based production systems.
|
|
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/PianoDiProgetto/sections/Consuntivo.typ | typst | MIT License | #import "../functions.typ": glossary, team
= Consuntivo
Si esaminano attentamente le risorse effettivamente impiegate durante ciascuno #glossary[sprint], confrontandole con le previsioni iniziali. Attraverso questa analisi, si vogliono identificare eventuali scostamenti dal piano iniziale e reagire di conseguenza, in modo tale da apportare un miglioramento continuo.
Si riportano inoltre gli elementi positivi e negativi emersi all'interno delle retrospettive di ogni #glossary[sprint], eventuali rischi incorsi e la valutazione del relativo processo di mitigazione, in modo tale da portare eventuali miglioramenti alla sezione *Analisi dei rischi*.
#include "ConsuntivoSprint/PrimoSprint.typ"
#include "ConsuntivoSprint/SecondoSprint.typ"
#include "ConsuntivoSprint/TerzoSprint.typ"
#include "ConsuntivoSprint/QuartoSprint.typ"
#include "ConsuntivoSprint/QuintoSprint.typ"
#include "ConsuntivoSprint/SestoSprint.typ"
#include "ConsuntivoSprint/SettimoSprint.typ"
#include "ConsuntivoSprint/OttavoSprint.typ" |
https://github.com/jneug/typst-nassi | https://raw.githubusercontent.com/jneug/typst-nassi/main/assets/example-cetz-2.typ | typst | MIT License | #import "@preview/cetz:0.2.2"
#import "../src/nassi.typ"
#set page(width: 13cm, height:auto, margin: 5mm)
#cetz.canvas({
import nassi.draw: diagram
import nassi.elements: *
import cetz.draw: *
diagram((4,4), {
function("ggt(a, b)", {
loop("a > b and b > 0", {
branch("a > b", {
assign("a", "a - b")
}, {
assign("b", "b - a")
})
})
branch("b == 0", { process("return a") }, { process("return b") })
})
})
for i in range(8) {
content(
"nassi.e" + str(i+1) + ".north-west",
stroke:red,
fill:red.transparentize(50%),
frame:"circle",
padding:.05,
anchor:"north-west",
text(white, weight:"bold", "e"+str(i)),
)
}
})
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/053%20-%20Wilds%20of%20Eldraine/005_Episode%205%20Broken%20Oaths.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Episode 5 Broken Oaths",
set_name: "Wilds of Eldraine",
story_date: datetime(day: 14, month: 08, year: 2023),
author: "<NAME>",
doc
)
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Child Kellan to the castle ruins comes. Though his and Ruby's deeds have merited them the recent gift of ponies, he does not feel heroic astride his new steed. Far from it. As he surveys the once-proud hills and valleys around Castle Ardenvale, all he feels is resignation.
"Are you ready?" he asks Ruby.
She's atop her own pony, kitted in her namesake color, her cloak billowing out over its flank. There is good reason for such showmanship: a blade of eternal ice hides beneath the fabric. Hylda found Ruby's request for a sword "as big as she was" endearing rather than ridiculous. With the last bit of the crown's magic she'd granted Ruby the boon—and Ruby was only too happy, in most cases, to brag about it.
She is not bragging about it now. Who could, seeing the gloom upon Kellan's face? "Yeah, I am. But if you need more time to talk about it—"
"I don't," Kellan says. "We're going to do the right thing, and that's that."
Nary an enemy challenges them along the way to Ardenvale's gates. An eerie quiet rolls across the plains. Kellan's felt this before in the lead-up to a storm, the livestock all retreating hours before the people knew why.
When they see the battered state of the doors before them it is a sensible thing, a reasonable one: the proverbial storm that will consume them has torn the door from its hinges; the rotted, corrupted heart of the curse has eaten away at the wood; the dreamers that lurk behind it are the nightmares that plagued Kellan during their journey here.
This is not a place of succor or rest, nor a place of glory.
It is a place where wounds fester.
Kellan doesn't want to enter it. But he has given his word that he will, and something in his blood has affixed itself to this oath like enamel to a knight's shield.
"We can't go through the sleeping guards," he says. "We'll just be hurting them."
Ruby raises a brow. "Got a better idea?"
Kellan reaches in his cloak. In his hand, held aloft: the second bottle of frogification Troyan lent them.
Ruby grins. "You know, I like the way you think," she says. "But this time, #emph[you] hold onto#emph[ me] ."
There is something in Ruby's smile that reminds Kellan of better times. "All right, all right. Just bring us down easy."
"No promises," Ruby answers.
Kellan lashes the horses to a post. With two sacks of feed, they'll be set for the rest of the day—hopefully he and Ruby won't need any more time than that. After giving the horses a quick goodbye, he meets Ruby at the base of the castle walls.
They're in the air seconds later. Ruby isn't one to wait around for a cue.
Her landing skills are better than Kellan's, landing on her powerful amphibian legs only moments before she starts to revert to her human shape. Eriette must not have been expecting anyone to bypass the castle gates. There are no sleepers here standing guard, no closed eyes to watch them.
"Okay, okay, maybe Troyan wasn't so bad," Ruby says. She keeps her voice as hushed as their footsteps. "Where to?"
Kellan's brows meet as he thinks. "If I were a witch, I'd want to have the throne room to myself."
"Hylda said Eriette loved attention," Ruby says with a nod. "Probably got a whole bunch of people in there feeding her grapes and stuff."
Kellan tilts his head at her, but opens the first door he sees, all the same. "Why grapes?"
"I don't know. It's always grapes, though," Ruby says.
Ahead of them: a yawning hallway, dark and dreary, festooned with faded and defaced portraits. The stone floors and walls leave the air cooler within. Though there are plenty of torches in their holders, not one is lit. The only light granted them is that which filters in through the door—and the light of the curse along the floor.
Together the two heroes follow the winding cords of violet through the halls of Castle Ardenvale. Past empty bedrooms, ransacked war rooms, and raided armories they skulk. So open are their ears that the passing squeaks of mice are as loud as a dragon's dying cry.
It is thus no wonder that they hear the woman's footsteps before they see her. Soft, they are, but not soft enough: the creak of her leather boots, the scuff of sole against stone, even her belabored sigh gives her away.
Kellan and Ruby press themselves on either side of the door. Ruby is the first to peek, blade held at her side. When she gestures for him to do the same, it is with a stunned look.
He understands why. Standing before a lectern and surrounded by swirls of curse-clouds is a woman known even in Orrinshire. <NAME>, the daughter of the High King herself, has come to Castle Ardenvale.
Kellan cannot stop himself from smiling. She must have figured it out the same as they did. He can't believe their luck.
The glad tidings overwhelm his good sense. Kellan dashes into the room, and Ruby follows, her sword hanging toylike at her side. "Rowan!" he calls. Then, his cheeks reddening with embarrassment when she looks up, he sputters. "I-I mean, L-<NAME>! Be careful with the curse—"
"Who are you? What are you doing here?" she answers. Strange—Rowan's frowning.
"We came to defeat the witch, the same as you," Ruby says. "Is there some kind of spell keeping you in place?"
Kellan hadn't thought of that. Good thing Ruby came along; she's always thinking on her feet. There must be #emph[something ] binding Rowan in place—the curse, maybe. The way it's swirling around her, that must be it.
"We can find some way to break the spell," Kellan offers. There are no cauldrons here, no unmelting ice, no sigils he can spot. Only books, wands, loose pages and ink wells. He scans these for answers. "Me and Ruby have gotten really good at that."
"We're heroes," Ruby adds, helpfully.
But <NAME> neither laughs nor smiles, nor even thanks them for their assistance. She lays her hands on either edge of the lectern. Sparks crackle along her fingers.
"I think the two of you should leave," she says, her voice cool and level.
"Ha, I mean, you probably #emph[could ] handle it on your own. But I need to be with you, at least," Kellan says. "I promised I'd help end this curse."
"You can do that from outside," Rowan says. "It'd be best if you weren't here."
Something in her voice raises Kellan's hackles. His tongue sticks to the roof of his mouth, and he looks once more at the page before him. In red-brown ink, jagged handwriting spells the truth.
#emph[Attempt 23. Haven't been able to put anyone to sleep yet except the old-fashioned way. ]
He has no time to process what he's just read, for when he looks up at Rowan, she's wreathed in sparking light.
Kellan's vision goes white.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"Kellan! Kellan, wake up! Don't make me get the prison water, I swear I will!"
... What?
Before he can sort out what's going on, he's hit in the face with something very, very cold; Ruby is standing before him with an empty bucket at her feet.
"Are you back?" she says.
Kellan clears his throat. The rope keeping his hands together has been severed already, likely the work of Ruby's frosty sword. But wait ...
"Where are we? And how did you get that sword back?"
"Take a look around, hero. <NAME> knocked us both out. She was trying to work some kind of dream magic on you when I woke up, but then ..."
Kellan's eyes land on sleeping guards face down on the ground. Clattering metal and creaking wood echo down the stone stairs into their small cell.
" . . .the cavalry arrived. She went off to deal with it, so I got my sword and woke you up."
Kellan stands. He hefts the chains overhead and drops them to the ground, all save the shortest, only long enough to wrap around his palm. "She really turned on us?"
"She thought she was helping you," Ruby says, frowning. "Kept saying that while she was working. That if she got the spell right, you'd be thanking her for what she was doing."
"Yeah, well, that wasn't a very good dream," Kellan says. He lets out a breath. "She's up there?"
"I think the witch is too," Ruby says. "Someone shouted Rowan's name, and it sure sounded ominous."
"Then let's get up there," he says.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
In her heart of hearts, <NAME> knew this dream could not last. Just as no amount of training prepared her to save her family, no amount of wishful thinking could extend this respite into eternity. Her time with Eriette, studying the magic that would save Eldraine, had always been fated to end.
But she hoped she'd have longer than a few weeks.
As her brother's knights burst through the gates, sparks crackle along Rowan's forearm. Eriette, seated upon her throne, strains to control the dozens of sleepers among the ruins, violet strands flying from her hands to warriors' limbs. Rowan struggled just to keep the children asleep and weave a dream for #emph[them] . Eriette is doing it for a whole army.
The last thing she needs are distractions, but what she can use is help. Ashiok had left the Realm to attend to business elsewhere. Rowan is the only person Eriette has left. At least until Ashiok returns.
A phalanx of knights breach the doors. To counter them, Eriette fields her dreamers, positioned in two ranks before the throne. Eriette might be her better when it comes to dream magic, but Rowan's taken enough tactics lessons to know this is going to end badly. Two ranks won't be enough to counter a phalanx of that size.
"Under order of His Majesty the High King of Eldraine, stand down!" shouts a woman in the vanguard. Rowan narrows her eyes; the voice is familiar. Is that a wooden arm? Ah—the jet of fire over the heads of the sleepers confirms her suspicions. Imodane. Of course someone that foolish would think shooting fire at innocent sleepers is a good idea. She was careless at the mountain and she's careless here.
Rowan focuses on the sparks in her blood, lets them grow, lets them build. All of this energy she unleashes in a fearsome bolt aimed at Imodane's feet. Stone shatters; smoke rises from a newly made crater in the castle's flooring.
"There is no High King in Eldraine," she booms. "Turn tail and return to the pretender, Imodane, or I'll dash you across the rocks."
"You!" says Imodane. "What are #emph[you] doing here?"
"Ahh, Rowan," says Eriette from the throne. "Will you keep the vermin away for me, child?"
"They won't get in our way," Rowan promises. As she steps to the raised dais, she spots her brother, and knows that—one way or another—all of this is going to end today.
#figure(image("005_Episode 5 Broken Oaths/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
He rides atop his white horse behind the vanguard, his sword drawn. Rime coats his pauldrons, his vambraces. Despite riding into battle, he hasn't the sense to don a helmet. Seeing him ... Seeing him is seeing all the parts she least likes of herself externalized into someone else.
Worse still when he narrows his eyes, when he calls with his voice full of disbelief and ache, "Rowan? What are you doing?"
There is a lump in her throat, a pain unspeakable, when her brother looks at her like this. Like he's afraid of her. Like he wants her to be something other than she is, to wake up one day and return to being the woman he knew before. When will he realize the Rowan he knew is dead?
"I'm learning how to save the Realm," she says.
"Listen to yourself. Working with witches? Cursing the Realm? This isn't like you," he says. Is this what he thinks a High King should be—a man who is on the verge of tears atop his warhorse? "Please come home."
She wants him to understand. She wants so badly for him to understand that she's never going to be all right again.
But he won't.
She's charging them before she knows what else to do. Her sword beats back shields and snaps lances. In the thick of the melee her blood sings. Here, surrounded by steel's blooming petals, she is free from any thought save that which animates her limbs. Parry, riposte; dodge, blast.
When she reaches her brother, there is already blood on her armor. She levels her sword at him, he on his horse, and dares him to dismount. "Home is gone, Will!"
Cool eyes study her. When his feet finally touch the ground, his shoulders are doubled with the weight of his worries. He draws no weapon. "No, it isn't. Hazel and Erec need us—"
He's talking to her the way he talked to Imodane. His own sister. She can't stand another second of it. "Our parents are dead, the Realm is shattered, and you're acting like talking about it will help. It won't! Talking is #emph[never] going to help!"
A rough slash to his chest will convince him to raise his sword. Even Will cannot compete with such a compelling argument—he raises his own blade to parry. It doesn't help him much. Rowan is stronger than he is. She's always been stronger.
Under a relentless barrage of blows he's beaten back, step by step, his warriors parting to let him pass. Whether because he'd given an order or because they fear her, the other knights do little to stop Rowan.
The only thing that #emph[does ] stop her is a bolt of ice. Will manages it between blows: she doesn't realize her feet are frozen to the floor until she tries to move them once more.
Rowan catches her breath. As the battle rages on around them—knight against dreamer, friend against friend—her brother fights back tears.
"Ro, I'm sorry," he says. "I didn't help you when you needed it."
It isn't what she was expecting from him. There's a sharp feeling at the corner of her eyes, a pain in her chest. An arrow flies over her head, landing in a dreamer behind her. She cannot look at Will for too long, or she's not going to be able to speak. She glances over her shoulder toward Eriette.
But it isn't just Eriette she sees. Rowan's heart sinks. The children must have gotten loose. Worse than that, they're attacking the throne. The girl in red is swinging a sword twice her size at Eriette; the boy fights with a whip of golden vine.
Eriette may be a powerful witch, but she's no fighter. She can't deal with the children and animate the dreamers at the same time.
Rowan looks to Will again. He's frowning, now. "You want to save #emph[her] ?"
"She's our aunt. This magic was always in our blood, Will," Rowan says. She's surprised at how young she sounds. "We can use it to save Eldraine. No one has to suffer anymore, no one has to die. We can keep them safe."
For a moment, she mistakes the hurt in his expression for sympathy. It is the longest moment of her life—a length of hope tied around her neck, a box kicked out from under her.
"I don't know you anymore," he says.
Sparks coalesce at her fingertips. Rowan blasts the vanguard again, creating another rend across the floor. Another wave of anger, another wave of frustration, another wave of hurt. Over and over she fires at her faithless former friends. All these people who knew how badly she was hurting and left her to rot, all these people who saw her bleeding and rubbed salt in the wound—let them know her power.
Only when the dust of her rage settles does Rowan let out a breath.
And there, where she expects to see them laid low, she sees a cocoon of ice. Pitted, cracked, and scarred, it yet stands in the face of her onslaught.
Will dismisses it with a wave of his hand. "This isn't going to work," he says.
"You don't know that!" Rowan answers. Winded and desperate, she cannot hold herself back from charging at him. Her sword arm will succeed where her magic failed—she's sure of it. Will could never match her on the field.
She slashes at him, only for a familiar hardwood hand to catch her blade. Imodane shoves her back and Rowan stumbles.
"You don't get it, do you, girl?" Imodane growls. Losing a weapon hasn't seemed to stop her. She punches her wooden fist into her fleshy palm. "He's going to be the one to reunify the Realm. Even I can see that now."
"Don't be so certain."
Ice against the nape of her neck; smoke in her lungs; a haze that threatens to carry her to somewhere beautiful and far. Veils of black coalesce into Ashiok's elegant form before the gathered army.
#figure(image("005_Episode 5 Broken Oaths/02.jpg", width: 100%), caption: [Art by: <NAME>anland], supplement: none, numbering: none)
Rowan can't help but smirk. Eriette might have had trouble controlling so many at once, but for Ashiok it's second nature. The gathered dreamers attack with new grace, swaying out of the way of incoming blows, and dealing their own with vicious precision.
"Will isn't the only one with friends," Rowan answers Imodane.
They can't easily fight this off. Ashiok, at the center, is surrounded on all sides by their dreamers, and their dreamers are all too happy to defend. The phalanx must break if they're to attack.
Imodane sends a haymaker Rowan's way. She doesn't bother to dodge—her nose cracks, the world around her spins, copper floods her mouth. Worth it, if it gets her closer. Because there is something Rowan understands, something they don't know: the gathered knights cannot win against Ashiok. All she has to do is hold out long enough for Eriette to send all of them to sleep.
Rowan drives the pommel of her sword into Imodane's face. A moment's concentration is enough to channel sparks through the knight's armor. She howls, splitting off from the fight to try to tear off her plate mail, but she isn't the only enemy Rowan faces. A dozen knights at least have gathered to defend her brother while the others hold off the dreamers.
Thirteen to one.
Rowan likes those odds.
"All of these people are here because they believe in the same thing our parents believed in: a united Eldraine. You can't just make people do whatever you want!" Will says.
"You're only saying that because you've always been too weak to do it," Rowan answers. "Would #emph[diplomacy] have stopped Oko? The Oriq?"
Three of Will's guards collapse around him, their bodies joining the pile of the slumbering. An incoming slash from one of the others gives her another chance. Rowan lunges into the blow, turning aside at the last second. With the distance closed she can crack her pommel on the knight's temple. Blood coats her knuckles as her opponent crumbles.
Halfway there.
In the distance she spots a flash of gold among Ashiok's smoke. The boy from earlier, swinging some kind of golden chain. Small as he is, he's managed to slip between the ranks.
#figure(image("005_Episode 5 Broken Oaths/03.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
Lot of good that will do. He's one boy against Ashiok—what can he possibly do? The golden arcs of his makeshift whip might be flashy, but they won't save him. Talking wouldn't help him either. She turns her attention back to Will.
"If you'd #emph[talked ] to the Phyrexians, Will, do you think our parents would be alive right now?" She launches herself at Will once more.
For years they've sparred, for years they've known each other's minds. She knows every trick he has, but he, too, knows hers. And with his back to the wall, he's desperate. Chilling the air around her, conjuring shields at the last second, icing the ground to throw her off balance. "Does power matter that much to you?"
"Power is the only thing that matters," Rowan says. She clips his elbow with a slash; he drops his sword. A lance comes her way, but one of the dreamers throws themselves in its path. Their counterstrike—a hammer to the knee—sees their killer fall, too. "Do you see that now? Bring as many people as you want, Will. It won't matter. Look around you, your army's fallen asleep."
Will, the follower he is, does as he's told. Rowan watches him as he realizes there's no escaping them. He lets out one last, hopeless bolt of ice, one she easily avoids.
"It's over."
But then Will begins to smile. "What was the line? 'Don't be so certain'?"
It's the oldest trick in the book, yet she falls for it, turning to look behind her.
The bolt has struck its true target: Ashiok's chest.
The boy wasn't trying to beat Ashiok at all. Rowan sees that now. He only ever meant to lash them in place long enough for Will to land a strike. A potent one, too; Rowan's rarely seen Will put so much of himself into a bolt.
Ashiok lets out a howl of pain as the ice spreads through their body. Smoke swallows them, and then they are gone. #emph[They still had their spark, ] realizes Rowan suddenly, with a lurching sensation.
The smoke clears just in time to see the girl press her blade to Eriette's throat.
Rowan's heart leaps to her throat.
In this moment of distress, Eriette remains calm and collected. Across the ruins of the throne room her eyes meet Rowan's. A single thread of the curse—hardly enough to be noticed—links them.
#emph[Go from this place, ] Eriette says to her. #emph[When the time is right, we will meet again. ]
Rowan steps toward her. #emph[But I can't lose anyone else. ]
#emph[You aren't losing anyone. They won't kill me, darling. They're too soft. We bide our time. ]
The thread snaps. In the recesses of her mind she is alone, watching once more as someone she cares about is held at sword point.
If she does not heed Eriette's advice, then her brother will surely take her in. He will imprison her, and there will be an endless parade of healers and tender-hearted fools to speak with her. To try to understand her. Meanwhile Eldraine will remain splintered, for though Will has gathered an army of many colors here, he has not gathered them all. And if she finally gives in, if she pretends to be all right, he will remain High King and she ...
She will always be the woman who rebelled. Worse, she will always be the woman he#emph[ graciously forgave] .
No—there is no going back now, no returning home.
She has enough left for one more blast.
<NAME> takes a breath. As she had on Strixhaven, she lets her power crackle through her. Light surges.
"Rowan!" Will shouts.
He reaches for her, too. But he's still afraid of her, and that's the problem.
Difficult to control her power when there's this much of it. Still, she has to try. Wrenching her brows, gritting her teeth, she twists the energy as it leaves her—instead of aiming outward, she aims it all down.
A boom louder than the fall of a giant.
Rowan's in the air.
From up here she can see the threads of the curse coming together, a spiderweb centered around the castle.
What was it Royse had said to her?#emph[ If you do not make time for rest, it will come to you when you least expect. ]
It is the same for Eldraine. How many blows have they weathered by now? How many shattered dreams? If they are to be strong again—if they are to be unified—they need to forge those dreams a new.
They need to rest.
As does Rowan.
One day, she'll bring that blessed slumber to the rest of Eldraine.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Afterward, there's much for Kellan to sort through.
High King Kenrith takes him and Ruby aside. He tells them he's never met children braver than they are, that they are invited to come to the palace whenever they like, that they will be welcomed like members of the family. But his eyes are stormclouds when he says all this, and he cannot stop looking to the horizon. Kellan thinks he's looking for Rowan. If it were him—if that were #emph[his] sister who had done all that—that's what Kellan would do. So he doesn't blame King Kenrith for being a little distant. He must be hurting.
Ruby takes him up on the offer, on the condition she can bring her brother. The king's smile cracks. He agrees. Yes, he would love to have her and her brother visit, the both of them.
As they make their plans, Kellan slips away. There's something else he has to do. His friend deserves all the awards she could get. Facing down a witch with a sword of ice? That sort of thing sang well in a story. Edgewall will be out of red cloaks ere long. Let her revel; what he has to do will only lead her away from the glory she deserves.
Outside of Castle Ardenvale he steps into the Fae World.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
A sleepy farm outside a sleepier village. A place that knows struggle only against the weather and soil. Here, among the paddocks and pastures of Orrinshire, there is no talk of heroes.
The quiet sits strangely in Kellan's ears as he walks the beaten path to his family farm. He's never been so grateful for distant bleats and wood-chopping axes. After everything he's been through, silence fits him like a shrunken coat. This whole place does.
When he walks by the Cotter boys, they glare at him just the same. The terrible thing is that part of him still fears them, even when he knows he shouldn't. But he knows he's strong enough now. He holds himself taller. He walks by them, and when they do nothing to harm him, he lets out a breath.
Hex is the first of his family to greet him. Bounding across the rows of neatly planted turnips he goes, dripping a trail of drool, yowling his familiar yowl. When Hex licks his cheek, Kellan lets out a small sigh of relief. No matter where he's been or what he's discovered about himself, Hex still knows who he is.
Kellan hefts the dog onto his shoulders as he makes his way up the hill. Hex won't stop barking, of course, so it isn't long before his family hears something's going on. Ronald emerges from around the farmhouse, an axe slung across his shoulder. He drops it upon spotting Kellan. "Honey! Honey, he's home, our boy's home!" he shouts.
Ronald runs to him, and Kellan is so wrapped up in his stepfather's arms that he does not notice his mother's arrival until she's embraced them both. Turning about on the fields, the gentle bleating of the sheep in his ears and the faint taste of earth on his tongue, his mother's voice and his stepfather's strong grip—yes, after all of that, he is finally home.
They welcome him in. Insist on it. Happy tears stream down his mother's face. She presents him with a coat she has made for him. How long has she been spinning thread for this? How could she have possibly finished it in the time he was away? For every thread is vibrant and beautiful, from the deepest azures to the brightest yellows. Where gold is called for he is shocked to find thread-of-gold itself. Colors and material alone would beggar the village—but the details would beggar even a city like Edgewall. Embroidered throughout are elks frolicking among the elms and beeches surrounding Orrinshire. Along the cuffs are primroses in bloom; below one pocket, a girl sits before a pond of clear water, her reflection staring back at her. And the lining! Here he sees the girl again, following a man whose skin is streaked with blue.
Kellan's jaw hangs slack. He throws his arms around his mother again. "This is so beautiful, Mom, but I can't accept it. I can't wear this outside! It might get ruined!"
She laughs, smoothing his hair away from his face. "That's thoughtful of you to say, Kellan, but I enchanted it."
Kellan turns to the coat again. He presses his fingers to the fabric, as if magic is a thing that can be felt like grooves on an instrument. "Really?"
"Well, your mother didn't spend five years as a witch's apprentice for nothing," she says with a smile. "Ronald, will you make us some tea?"
"Of course. But first I'll have to go get it from the Browns, I heard Gretchen just got this new stuff in ..."
He's already throwing on his own coat—far less fancifully made—and heading out the door. When it closes behind him, Kellan raises a brow at his mother. "Something's up."
"You've gotten cleverer, haven't you?" his mother says. She looks over to the coat.
Kellan takes a seat across from her at the dinner table. He doesn't feel much cleverer, but he thinks he has an idea what's going on. Still, he wants her to be comfortable. "What did you want to tell me?"
"About your father and I," she says. "Your birth father. I'm sure the Fae Lord told you what they know of him, but I thought you could get to know him as I did."
Kellan smiles. His heart's pounding, too. "The Fae Lord didn't tell me anything about him, actually."
"He didn't? But your quest—"
"I told him I wanted to go home, to hear the story from you," Kellan says. "Whenever you thought I was ready."
Silence passes as tears well in his mother's eyes. She squeezes his hand, and he squeezes hers, and when she is ready, she begins.
"I met your father during my training," she says. "I was out in the woods, gathering nightshade, when I found a man lying among the blossoms as if they posed no harm at all. When he invited me to sit with him I thought he must have been joking, but he offered to give me all the nightshade I wanted in exchange for only a conversation. Knowing him for a fae, I made him promise that it was only a conversation, and with that ... I spoke with him. He told me his name was Oko, and he told me that he was newly arrived in Eldraine. That he was not from any of the Realms I'd ever seen. He wanted to know more of the place, and from a pretty girl it was all the better."
The blue-streaked man on the coat's lining catches his attention anew. Oko. His father. A man among the nightshade blossoms.
His mother sighs with a hint of a dream. "It was the first time that anyone had ever said I was pretty. And I found the idea of Realms beyond our own so thrilling that, naturally, I asked him a thousand questions. Graciously he entertained them with answers, so long as I told him something of Eldraine in exchange. For hours we sat like that, talking among the flowers, until ... we realized we'd need to meet again."
"Another Realm ... Did he say what it was called?"
"He did, though if I am honest, the name's long since escaped me," his mother says. "But he said it was a land where fae ruled supreme. He found the idea that humans should challenge them very amusing indeed and lamented that he couldn't confront Lord Talion directly. Of course, all young men talk that way, and we were both young then."
She leans back in her seat.
"Over the next few years, I would hear his voice from crows, or trees, or sometimes even baked goods, and I would know it meant to meet him at the nightshade glen. He came to me in many forms and told me many things. Showed me many things. Without your father's aid I never would have escaped my mistress—he made me feel so bold and clever.
"For a while, it was wonderful. The two of us went wherever we liked and did whatever we pleased. I learned more of magic from him than I ever did from her. He whispered to me the secrets of the land and promised me a throne.
"The trouble started afterward. Though I'd been freed, no one in town wanted anything to do with me. Once a witch, always a witch, the saying went.
"Your father ... was very upset by this," says his mother. "Part of me found it charming that a man should care so much about me. I wanted to go away with him, but he couldn't take me. And staying here was wearing on him. Eventually, he ... hurt people who had been unkind to me, and I realized that we couldn't continue as we were. No matter how much I loved him.
"I wasn't meant to be a queen, you see. After all that struggle, I wanted peace—but he wanted to raze this place to the ground for offending me."
"He visited again three years ago. I heard him calling to me while I was spinning one night. And though the girl within me wanted to go to him, the woman I've become knew what I'd be giving up if I did. I'm far happier here with you."
Kellan listens, too intent to interrupt, looking over the coat again and again.
"Could you tell me more about him?" Kellan says. "About what he was like."
His mother's smile is only a little sad. "Of course. Whatever you'd like to know."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
He cannot sleep. There is too much story inside his head. Too many of his father's faces looking back on him. He wonders how many times he's seen him already. Mother said he was fond of changing shapes, so maybe they've already met.
But if so, why hasn't his father introduced himself?
That is the question that keeps him from rest, like a horseshoe badly struck keeps a mount from running. It hurts. The question keeps coming to him: #emph[W] #emph[hy haven't you spoken to me? Am I not good enough?]
He hadn't been brave enough to ask his mother.
With little use for sleep, he decides on a walk, instead. Perhaps it will dislodge the thought from his traitorous head. Perhaps it will hurt less. Down he goes, wrapping himself in his fine new coat, out into the darkness and the wilds.
They used to frighten him. He knows better now. The woods will never betray him, so long as his blood smells of pine.
Hex follows him. Unlike other nights, Kellan can think of nothing to say to his old friend. To talk would be to make things worse; if he opens his mouth, he's sure he'll have nothing but questions. And he shouldn't ask questions of an old bloodhound.
But Hex has his own ways of helping. Only five minutes in he bolts off, as if he's caught a scent. Kellan can do little save run after him. His breath mists against the cool of the night; moonlight plays upon his skin.
Over the boughs, past a copse of yew that prickles his skin, he finally catches up to Hex. He barks once and assumes his pointing posture, aiming straight for ... a portal?
That must be what it is—a swirling series of interlocking triangles, something like a cloudy mirror, standing free beneath the swaying branches of the trees. It looks nothing like the portals into Talion's realm. The other side looks nothing like Eldraine.
Kellan's breath catches in his chest. Troyan told him about other Realms. His mother had, too, repeating the things his father had told her of them.
What if this is his way of reaching out? What if this is a test? His father dwelled somewhere other than Eldraine. What if he lives there, on the other side? Kellan could ask him why it's been so long without them ever meeting. Maybe they'll know of him there.
He steps forward.
It'll just be a quick look around. And he'll remember the way he came in. It should be fine, right? He isn't really leaving home, he's just taking a trip somewhere. It's no different than going to the market.
He isn't leaving home. He'll be right back.
Kellan pets Hex, and steps through the portal.
#figure(image("005_Episode 5 Broken Oaths/04.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#emph[Awake. All is not yet lost. I have returned for you.]
The voice is cool, familiar. Eriette wonders why it took this long before she heard it once more. When she opens her eyes, the jail cell stares back at her, but so, too, does Ashiok. Smoke billows from their evanescent shrouds, despite the lack of wind in the room.
"What took you so long?" she asks. Her chains rattle when she stands. If the guards outside hear, they say nothing, nor even stir. No doubt they're dreaming of something far more pleasant than guarding her.
"Preparations needed to be made," Ashiok answers.
"Where's Rowan?" she asks. "Waiting outside?"
Ashiok's lips purse. "She is not yet ready for what must be done."
Eriette frowns. "If you give her a chance to learn, I'm sure—"
"Opportunity calls us in a new direction. One far from here. You will learn much, and if you wish, you may return to educate her. By then you will have a host of servants to tend your new queendom."
Well. That certainly soothed matters. Rowan would be all right on her own for a while—and if Eriette secured new land for them, all the better. She holds up her chained hands.
Ashiok's hand hovers over the shackles. "You will be far from here, Eriette. Very far."
"Far from a jail cell? Darling, that's a good thing," she says.
They do not laugh. They never laugh.
Darkness falls on the cell. Shackles fall to the stone ground. In the morning, when they search the cell, she will be gone.
|
|
https://github.com/tingerrr/subpar | https://raw.githubusercontent.com/tingerrr/subpar/main/src/default.typ | typst | MIT License | // NOTE: we avoid a possible syntax error in the future when custom elements are added and self may become a keyword by appending an underscore
#let _resolve(elem, it, field) = {
if it.has(field) {
it.at(field)
} else {
// we can't func.at(field) to resolve the field
// eval(repr(elem) + "." + field)
elem.at(field)
}
}
/// The default figure show rule. The active set rules will be used.
///
/// This function is contextual.
///
/// - self_ (content): The figure to show using the defualt show rule.
/// -> content
#let show-figure(self_) = {
// NOTE: this is written to be close to the rust impl to make changes easier to compare
let realized = self_.body
let caption = _resolve(figure, self_, "caption")
if caption != none {
let v = v(self_.gap, weak: true)
let position = _resolve(figure.caption, caption, "position")
realized = if position == top {
caption + v + realized
} else {
realized + v + caption
}
}
realized = {
set align(center)
block(realized)
}
let placement = _resolve(figure, self_, "placement")
if placement != none {
realized = place(placement, float: true)
}
realized
}
|
https://github.com/barddust/Kuafu | https://raw.githubusercontent.com/barddust/Kuafu/main/src/Meta/intro.typ | typst | = 前言
元认知是“对认知的认知”或“关于知识的知识”,它考查的是我们如何去思考等关于思维本身的问题,我们常说的“学习方法”、“学习习惯”等就属于元认知类知识。
然而我把一些生活习惯或者技巧一并归类至此,理由是我认为那些方法论都是为学习服务,它们可以指导或者优化我们的学习过程。比方说关于睡觉、饮食,合理调控使得我们的心情愉悦,更容易集中注意,进入心流#footnote[并没有查过相关的资料,我理解的心流就是一种完全专注的状态,此时能够全神贯注,不易受环境的干扰]的状态,提高我们的学习效率。
事实上,学习方法是可以学的,而学习习惯也是基于这些方法去培养,在学习的过程中时刻提醒自己。这也是各种各样的讲座、座谈会的由来,讨论的问题就是如何更好地提高学习效率等问题。
元认知是最难学习和掌握的,它是对思考过程的思考,例如,在听课的时候,我需要 (1) 不停提醒自己去思考“如何听课” (2) 还要不停地去检索如何听课的相关知识。前者需要强迫自己在听课的时候分析,然后养成习惯;后者需要多加练习,把知识内化,进而做到几乎无意识索引。
无论何者,都强调习惯,都是用时间去沉淀,这个也是最容易使人失去信心的地方,最后回到原点,用一些可能比较低效的方式去学习和生活。
本书内容涉及方方面面,可能是一些使人状态更好的习惯,可能是一些学习方法,可能是一些工具的使用。故当为索引,需要的时候翻一翻。
|
|
https://github.com/Karolinskis/KTU-typst | https://raw.githubusercontent.com/Karolinskis/KTU-typst/main/mainPages/TableList.typ | typst | #page(header: none)[
#align(center)[
= Lentelių sąrašas
]
#outline(
title: "", target: figure.where(kind: table)
)
] |
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/041%20-%20Kaldheim/008_Direction.%20Purpose.%20Honor.%20Glory..typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Direction. Purpose. Honor. Glory.",
set_name: "Kaldheim",
story_date: datetime(day: 29, month: 01, year: 2021),
author: "<NAME>",
doc
)
Ranar opened his eyes to find himself in an inglorious place. The old warrior lay on his back, though he had not been asleep. He stood. Around him stretched a sparse and endless tundra, a pale green fading to black as the frigid earth gave way to lightless sky. He was alone. He leaned on his axe, taking a moment. He noticed then that his chest bristled with dark arrows fletched with greasy feathers.
#emph[Ah] , Ranar thought. #emph[I am dead and taken by the Valkyries.]
A memory, fading: the last of the children he had trained, stepping through a rift between realms just as it stitched shut. The gray bulk of raiders, their horns black and stinking, trailing smoke as they charged. Snow on a cold stone courtyard, the clash and scrape of hobnail boots, a wet thunk of his axe on demonflesh, and the vile, steaming blood. A pile of demonic dead, and Ranar's duty complete.
A name, given to him by the Valkyries. But what was it?
Ranar tugged the arrows from his chest, regarding the holes left behind in his breastplate. Nothing issued from them but a faint green wisp, and there was no pain. After a moment, even the faint green stopped as the holes flowed closed. His armor was part of him now. Without horror, he realized he was in an afterlife unexpected: Istfell.
Istfell was the judgement the Valkyries handed down to those who lived mundane lives. Ranar had thought his lonely saga was glorious enough to grant entry to Starnheim, but it appears the Valkyries disagreed. There was no bitterness to Ranar's revelation: his armor and weapon were still with him. If he had not proved his worth in life, then he would prove his worth in Istfell.
Much to do yet—but where to begin?
Ranar lifted his axe. With two hands, he flung it into the air. He stepped aside as it fell, blade landing with a soft thunk into the pale sand. The haft pointed the way. Ranar tugged the axe free, shouldered it, and started walking.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Ranar walked for an era or an eyeblink. He felt no hunger or thirst. Fatigue lingered, but here in Istfell, it was a little weight gently carried. Time in this viridescent desert slipped away and stilled. In the living world, time passing was the progress of the sun across the sky or up from the night. When no sun climbed or scraped, then no time passed at all.
Ranar put one boot in front of the other and stalked across sere dunes, dull and cold. He did not breathe—as it did not seem that he had to—but surely his breath would have steamed in the dead air. Alone with the crunch of his boots on frigid sand he tried to recall the names and faces of his life but could not. Eyes fixed forward on the withered emerald horizon, he stalked. He felt a chill of the spirit, though would not freeze. He could feel fatigue settling across his soul, but it was not ruining. He could feel the weight of his armor and axe, but it was not oppressive. As Istfell held the souls of the living, so too did it hold some reminder of their tribulations. Pain, exhaustion, thirst, ache—burdens that the living carried, but mirrored by their cousins. If this realm had room for the bad, then surely it had room for the good; would a spirit in Istfell not care more for their fellows if they knew that others felt the cold, too? Was there room in Starnheim for solidarity?
Ranar had never been a scholar or wise man, but in life, he knew enough to know Istfell was a realm of the numberless dead. The unremarkable dead. Wander far enough, and he would find them. With them, surely he would find purpose on this humble plain. With them, he would see what arc his life-after-life would take when refracted through meaning's prism.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Throughout his searching, Ranar marveled at the light of Starnheim high above. Though diluted by the lattice of the World Tree's roots, its glory was evident. A northern star that encompassed the realm.
A mystery, far ahead: the twin green suns of Istfell, low on the horizon. It was only when they moved that Ranar realized they were not suns but the reflecting eyes of a titan lurking in the Cosmos. The titan blinked and stretched, and in Istfell's boreal light, Ranar could see the silhouette of a wolf, as large as a world. The wolf stood atop a forest of legs below which a faint light filtered. The wolf at the end of the world did not move; it simply observed.
Ranar did not feel fear, as he was already dead and did not think he could be killed again. He lifted his axe into a ready guard. Maybe this was it: his test and challenge, to fight the wolf at the end of the world. Ranar decided he would face it with courage, and if he died in this realm, he would surely be greeted by Valkyries eager to usher him into that golden hall of Starnheim above. Axe in hand, its blade heavy and sharp, he knew this was his moment of glory.
The wolf at the end of the world exhaled, and a realm-swallowing ice storm burst up along the distant horizon. In that moment he knew; fighting a thing of that size was a challenge for gods—many gods, not just one. Ranar may have been virtuous (surely he had been virtuous, at least?) in life, but he was not divine. Was it valorous for the fool to lift an axe and take to the woods, hewing at trees and thinking them ogres? No. Stupidity would not convince the Valkyries to usher him into Starnheim.
So, instead of charging, Ranar raised his axe above his head in quiet salute and trudged along toward his own destination. The wolf at the end of the world watched Ranar for a long, long time, then turned and walked away into the Cosmos.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The tundra fell away to a vast basin of cracked clay crossed by bristled gnarls of undead vegetation and wandering stones. Here the pale green rime faded to bone white. Though it brightened the land, the bleached clay and stones only served to deepen the sky's darkness.
Ranar was not alone here. Across the basin, as far as Ranar could see, stood lonely stone cairns. The smallest was easily twice as tall as Ranar, and all seemed spaced from their neighbor by a distance equal to their height. The effect was disorienting, creating an entropic regularity that gave the landscape a sense of system; ordered chaos, a statuary garden erupting from raw nature.
A wind moaned between the cairns, ice and fine clay dust whistling high. Ranar imagined ragged banners flapping in that wind. He imagined the light dancing at the edge of burning houses that served as watchfires. He realized he did not imagine these things but remembered them. The wind, the cairns, the burning homes—it was a memory of the village that he had once kept his own watch over, as excised from its realm as this statue garden was from Istfell.
Ranar marched deeper into the statuary garden, recalling his patrols through the sliver of taiga that the Omenpath swallowed. Ranar passed cairns and saw instead mighty pines, heavy with snow, dying as their roots had been cut when the realms collided. Though he walked alone in Istfell now, once he had walked at the head of a small column of children, the only refugees of that transported village. Hardy as any tree that aged knuckled to the wind but did not fall, Ranar held the line he drew. He raised those few survivors from children to formidable youths and saw them off to safety. Among the cairns, Ranar wandered an echo of his death in the living realm—the children, the village, the light around them, and the flames—and he lost himself in it.
A hand grabbed his ankle. Ranar did not attack—if the hand had meant to strike him down it would have done so instead of grabbing him—but raised his axe all the same. A withered, rag-wrapped spirit, little more than parchment skin stretched over bones, sat cross-legged next to him. They raised a finger to their lips and wheezed.
#emph[Silence.]
Ranar obeyed. The spirit pointed ahead.
#emph[Danger.]
Ranar followed its gesture to see that the cairns ahead had been reduced, the places where they once stood sunk into depression. Few remained at the terminating line, where thousands of spirits worked together to tear them down. This labor spread out across the whole of the visible horizon: spirits advanced across an empty plain, tearing down cairns, throwing the constituent rocks into open pits dug by other spirits. The features of this world, slowly eaten.
#emph[They will never stop. I have] #emph[fled them for an eternity.]
Ranar watched the slow progress of the cairn-eaters.
#emph[I realized for EGON this tribute, and my reward was the hatred of these most lost souls, animated to tear my great work down. He will do the same to you.]
Ranar hefted his axe. He would continue. Behind him, the tribute-builder persisted in its whispering, muttering to no one.
#emph[Was I not great enough? Did I not shape the land in veneration of your glory? Where is my reward EGON?]
Ranar skirted the deep pits and the cairn-eaters, some so thin on this plain that they were all but invisible. One he only saw when he stopped to examine a floating rock—a cairn-eater, he realized, invisible to his eye and only strong enough to lift the rock a mere inch from its stack. Was this his fate, if he were to linger in this realm for too long? The strength of his own being sapped from him, the light he cast dimmed to little more than background scatter. Less than a shadow, but still not gone.
#emph[I would build you all a tower to Starnheim if you would only obey. You would walk behind me on a golden stair to glory.]
Ranar looked closer: the cairn-eaters all wore the broken remains of fetters, some even dragging chains behind them. They worked together to tear down these stone monuments. Ranar realized they had not been sent to ruin a great work by a great artist: they were tearing down the greedy monument of one who thought they alone deserved reward.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Ranar came upon a green river. As he approached, he saw it was not a river, but a winding march of spirits conforming to some unknown contours of this listless land. Their passage made little sound—the hush of rain on stone, or mist as it slips over a still and rocky coast. Most spirits were indistinct smears, fog-like and discernible only as spirits by others of their number less far along the process of phantasmic decay. Ranar could see limbs and heads, silhouettes seated on ghostly mounts—themselves in myriad states of being wiped away—and others in almost sharp relief, their faces twisted into scowls, different only from their living bodies in that they were rendered translucent in soft green rather than living flesh.
Ranar did not join the river. He walked up its current and alongside it; there would be a point at which he could ford. He did not think it wise to step through, for he remembered how the cairn-eaters could move stone; if those spirits working together could move stone, then surely this river of spirits moving as one could move him.
Ranar followed the marching river around a wide bend and saw on its banks a pair of figures who stood apart. They wore foul armor, layered leathers and furs cured and matted. They held long black glass spears. Each stood with a shield strapped to their back, draped in little garlands of small bones and teeth. These were not spirits but demons of some kind. The two noticed Ranar's approach and turned to face him, revealing faces twisted into the fearsome approximation of faces under war helms, horned and plated, with deep-set eyes in boiling red.
#emph[STOP.]
Ranar did.
#emph[WHY ARE YOU HERE?]
The two beings stalked toward him. Ranar stood straight-backed before the two, his axe at rest, as they evaluated him.
#emph[ARMOR AND AXE.]
#emph[ONE OF US?]
#emph[HE CANNOT BE. HE WOULD NOT WALK ALONE.]
#emph[YES. HE IS NOT FOR THE FEED.]
They swept their spears aside.
#emph[CONTINUE, SPIRIT.]
Ranar did not. He looked to the river of marching spirits. He could see some carrying sheep across their backs. Children swaddled in their arms. Packs laden with goods not to sell but to make a life from. The fear in their eyes could not be hidden. The fear and the fatigue, furtive looks toward the wicked glass weapons and ebon leather armor. New arrivals to the realm—but where were they being led? And what had that one spirit said—not for the feed?
#emph[IGNORE THEM.]
The pair swung their spears back around.
#emph[WE TAKE OUR DUE.]
#emph[MOVE ALONG, SPIRIT.]
#emph[OUR TRANSACTION IS APPROVED.]
Ranar did not move along. The demons looked between each other. Ranar thought he saw a smile form on one face, but recognizing a face that could smile out from under all that chitinous plating was all but impossible. The cruelty and joy emanating from the demon, though, washed over Ranar in curdling waves. These two reeked of power granted by possession, of respect given to wicked weapons and what they could do to a body.
#emph[MOVE ALONG.]
#emph[LEAVE YOUR WEAPON LOW.]
#emph[MOVE ALONG.]
The demons advanced toward him, spears leveled. Ranar did not know if he could die again in the afterlife, but this place was Istfell and the realm of the ignoble; if there were any afterlife one could die in and find themselves worse than before, it would be here. Ranar dragged one foot back, shifting his weight.
One demon lunged, spear tip lancing toward Ranar. The other dashed to the side, spear tip tracing an ember wound through the air, couched to strike.
Ranar was a good warrior. Swift in life, even in his advanced age. A single strike was all he needed: one movement flowing from three steps.
First, he stepped around the lunged spear, driving the heavy, metal-capped end of his axe haft into the attacking demon's faceless helm. The impact was far less than he expected—the weight of dragging a stick through cold water.
Then, as the first demon fell, Ranar turned, axe lifted in a two-handed guard; he had tracked the other demon as it darted to his side to stab at him from his flank. He parried the second's spear with his axe haft, completing this second motion.
Finally, using the momentum of his guard, he spun, bringing his axe around and up high into the demon's side, catching the beast just under its leading arm. Ranar's axe snagged on the demon for a moment, then carried through. The strength of Ranar's swing threw the demon away from the column, where it landed with a heavy thud on the ground, dead.
Ranar choked up on his axe and wiped the blade edge clean. No others accosted him or charged from the slow, shuffling column of souls. He was, but for a river of fading humanity, alone once more. Ranar intended to dive in, to wade across and continue on, but when he approached, the marchers nearest him stopped, and one began to shove him away.
#emph[You have done your duty to us.]
#emph[Go.] #emph[Trouble us no more. We are free now.]
#emph[We desire only peace. We are content to wander.]
#emph[Peace is not for you. Not yet.]
Ranar stepped back from the river of people, and the entirety of it began to drift into mist, what solid shapes he could discern dissolving to haze and fog. In some time, the river was gone.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The gates of Istfell stood open, a starry gap in the curtain wall that hid the horizon and Cosmos beyond. Ranar felt no cold as he crunched down to the gates, crossing under their mighty arch to stand in the middle of a wide marble boulevard: the bridge of Istfell, broad as a city plaza and empty of anything but fingers of rime. The grand crossing reached another hundred feet or so before it ended abruptly; there, it met the opalescent darkness of the Cosmos, and depths that Ranar would not hazard to explore. He had followed his axe and could go no farther. So, Ranar waited.
A river ran underneath the bridge. Ranar could see it flowing parallel to the great wall, arcing away to either side, yet another feature marking the edge of the realm. The river and the wall—did Istfell conspire to keep spirits within, or turn invaders away? Despite the wide-open gates, Ranar saw no steady trickle of spirits ushered in from the Cosmos by Valkyries. There was no procession of the newly dead crossing into the humble and empty realm. Alone, axe in hand, did he too become a marking of the edge of Istfell? A sentinel against invasion, or a warden against escape?
Some centuries passed and Ranar came to understand what he had long ago known: Istfell was where he was meant to be. No vaunted halls of Starnheim, no crowded tables with only just enough space for Ranar and his boasts. No river of mead, giving blessed ignorance of sorrow. A decade after this revelation, Ranar crouched, tugged off one glove, and touched the cold marble of the bridge. Would he feel cold in Starnheim? Would he even think to try?
The darkness at the edge of the realm shivered, and a youth walked into Istfell. Deposited onto the bridge, he wore fine but dirty clothing, a sword belted to his waist, and a scowl. He walked with a noble bearing, and as he drew closer, Ranar could see he wore a fine, though simple, circlet. Some small noble, or a second son of a wealthy jarl, no more than a handful of years past his decade. Curious.
"Are you Ranar of Istfell?" The youth spoke. He looked #emph[alive] , flush with the full color of the living.
Ranar nodded.
"Good," he said. He dropped to a knee, drew his sword, and held it out to Ranar, hilt first. "My name is <NAME>, and I am not supposed to be here," the youth said. "I was told to find Ranar of Istfell, who would help me on my quest. I ask for your axe and your strength to help me in this endeavor. Protect me, and I will see you rewarded."
This. Ranar stood to his full height, unaware that he had curled to a slouch. This was something new.
"'<NAME>," Ranar said. He paused. Interesting that he could talk—it appeared that Bjorn had brought something of life to Istfell. "You are young for this realm."
"I am, sir."
"How did you know to ask for me?"
"From the tales my father told me," Bjorn said. "You are the guardian of Istfell, a great warrior who is said to be honorable and steadfast—a guide to the lost. My people speak of your legend—the Omenpath and the children you protected." Bjorn looked up to Ranar, tucking his sword back in its scabbard. "My people say you should have been granted entry into Starnheim."
Ranar laughed. "That's enough then, boy. Stand up."
Bjorn furrowed his brows, confused for a moment before the realization set in. "You're a hero," Bjorn said, standing. He composed himself, tamping down on his excitement. "Will you accept this quest, Ranar of Istfell, and help me reach Starnheim?"
Ranar of Istfell, who could speak once more, felt a chill go through him. At first, he did not register the novelty of the feeling, but a heartbeat later he realized—he could #emph[feel] again. His heart beat again. Life, distant, nevertheless had begun to fill him like liquid fills a vessel.
"I will," Ranar said.
"Good," Bjorn said. His demeanor changed, but Ranar did not notice—as life hummed through him again, it clouded his perception. Bjorn strode past Ranar and struck out for the interior. Ranar turned to watch the youth cross under the Gates, then followed, axe in hand.
Bjorn led him by a hundred yards. He was the only feature in the rolling tundra, and so Ranar was content with the distance. He seemed tireless, striding ahead through the rolling dunes with one hand on the hilt of his sword and the other swinging at his side. He walked with a purpose, assured in his step if not in the knowledge of where he was bound. Better for Ranar to ask than to wonder; even in Istfell, wanderers seemed to always have purpose.
"Bjorn," Ranar called out.
Bjorn did not respond.
"Bjorn, where are you going?"
"To Starnheim," Bjorn shouted. "Are you coming with me or not?"
Ranar stepped up his pace. Of course he would. Istfell in his wanderings had proven a far richer tapestry than he had first thought it to be, and though he had come to accept it as his realm, the gods often changed their minds. Never ignore a sign, especially if it demanded you to follow.
"How do you mean to reach Starnheim?" Ranar asked, pulling alongside Bjorn. "Surely not by walking?"
"With this sword and your help," Bjorn said. "There already exists a wound in the Cosmos; I'll find it and cut open my own door."
"The two of us could never accomplish such a feat. I do not mean to be unkind, but I worry this is a fool's errand," Ranar said.
"No," Bjorn barked. He rounded on Ranar and shoved him back. "I am Bjorn of the #emph[Beskir] , who should be alive, and I will not languish in serene waste." Bjorn stomped his foot. "I will carve my way into Starnheim, and you will help me."
"How?" Ranar was taken aback at the sudden change in tone. The hopeful youth on the bridge had gone cruel.
"My augurs told me my great-grandfather came here," Bjorn said. "To the center of Istfell under the roots of the World Tree. There, he laid the foundations of a tower. Then his son built upon it, as did his son, all for me. Now I will climb it, and with this sword cut open a passage to Starnheim." Bjorn said. He stabbed a finger at Ranar. "You are Ranar of Istfell. In life, you guarded the children of one of my vassals. Now, you will be my first axe, who will lead the way."
Ranar considered this, weighed what he knew of Istfell, Starnheim, and his own desires. Though he felt new to this realm, time was a river with many eddies in the afterlife; perhaps this realm was not where he was meant to reside. Perhaps—arrogant as this young nobleman appeared to be—this quest was his purpose. A focus for his duty beyond stoic wandering. Ranar nodded his assent.
"Good," Bjorn said. "Now, follow me. We have kings to kill."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Ranar carved what would in life had been a blood-soaked path through the keep of a petty Istfellian king, and Bjorn followed. The youth had more than just training—he was a consummate warrior, his sword quick, lethal, and precise. The King's Guard, shimmering borealis armor and form distinct from the base spirits of the realm, were hewn to viridian gore. They had been mighty, but old Ranar and young Bjorn were buoyed, fighting for entry rather than defending what was jealously held.
Bjorn requested he deal the coup de grâce to the king. He walked up to the throne where the thin and wounded noble slumped, pleading with breathless voice for mercy. Bjorn showed him none. He plunged his dagger into the spirit's neck and levered him to the floor. The king's crown bounced and rolled to a stop at Ranar's feet.
"Don't touch it," Bjorn said. "That is my key to Starnheim."
"What about me?" Ranar asked.
"We'll find you another." Bjorn said. He scooped up the fallen crown. "Before I came here, my augurs read the organs of a bear, a crow, and an elk." He held the crown up to Ranar, showing him the intricate jewelwork, how the circlet was woven from braided iron bands, worked in the shape of elk antlers. "We take the crow next, and last the bear, and then Starnheim opens to me." Bjorn said, grinning, eyes bright.
Ranar could feel the heat of life coming back to him. The pounding, slack-jawed hunger of a greed that pumped hot through him. He could take and take and claw and climb, and Starnheim would be his. Ranar's hunger spoke: Bjorn was his key, the boy only thought himself in command—so #emph[take] .
A sudden, splitting headache caused Ranar to flinch as if slapped. Ranar shook his head, the ache sudden and overwhelming, and then gone. He stepped back from the youth.
"Good," Bjorn said. "Remember that. This is #emph[my] saga." He threaded the Elk King's crown onto his belt.
"How will we find the Crow King?" Ranar asked Bjorn.
"The dead will point the way," he said. Bjorn hefted a short spear from one of the fallen King's Guard, examined it, and then tossed it among the fallen spirits. It landed with a clatter, and when it came to a rest it acted as the focus around which the hidden pattern of the room revealed itself. The slain King's Guard, indistinct, broken, and scattered, nevertheless conformed to a grim cartography. Severed or whole, they all pointed in the same direction, toward the same wall of the king's chambers and beyond.
"Istfell is not without direction," Bjorn said. "Or reward." The youth pointed to Ranar's own hands.
Ranar looked down. His hands, once the faded green of spiritflesh, were made whole. He held one before his face, marveling.
"You and I must be alive to enter Starnheim," Bjorn said. "I need to strike down three kings of myth; you, my guardian, need only to obey."
Ranar squeezed the haft of his axe, felt the well-worn leather wrappings, heard the creak of his grip. Already the young hero's presence had blessed Ranar with life, and each kill had flushed him further with the red blood of the living. Trust in the youth had rewarded him—what prize waited for perseverance?
They left the hollowed keep of the late Elk King and made for the mists of Istfell's deep interior. Neither Ranar nor Bjorn noticed the disturbance in the Cosmos far above them. The wolf at the end of the world had returned from its wandering. Silent, it watched the two of them with intense curiosity, its eyes hanging once more like twin suns above Istfell.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Atop the Crow King's perch, Ranar and Bjorn battled the Crow King's Feather Guard. The wind snapped through the airy castle, rattling the layered-feather cloaks that gave the Feather Guard their name. In pairs, they dove at Ranar and Bjorn, wielding their wicked, curve-bladed swords with raptor-like fury. Back to back, Ranar and Bjorn fought the Crow King's most loyal murder, axe and straight blade clashing and singing in the flame-lit hall of the perch. Tenacious and sturdy, Ranar weathered the Feather Guards' black blades, muscling through their alacrity to cut them down with his heavy axe.
The last of the black-cloaked Feather Guard died with a screech. Their armor and cloaks, dark as the sky above Istfell when Starnheim's light could not break through, grew darker yet. In the dying moments of the melee, the Crow King himself managed to score one strike on Ranar, cutting a gouge through his armor with a wicked talon before Ranar landed a mortal blow with his axe, sending the Crow King to the ground. Ranar raised his axe, bloodlust raging through him, and—
"Stop," Bjorn commanded.
Ranar stopped. Every ghost of every muscle that once composed his body—and the reanimated ones that now did—hummed with power, with the howling desire to bring his war-blunted axe down on the Crow King's exposed neck. But he stopped. Bjorn's voice fettered him.
"The king is mine." Bjorn had not so much as a spot of blood on himself, though he had been in the thick of the fighting with his sword. "Go and bar the doors before the rest of his warriors arrive."
Ranar did as he was commanded, holding the door to the king's chambers shut against the clamor of his subjects outside. Bjorn wrapped himself in a one of the fallen Feather Guard cloaks and approached the wounded Crow King.
"Throw down your mask and crown. Flee with your people, and I will spare you," Bjorn said. "I am on a quest to break free from this realm to which I was cast, and you stand in my way."
"Child," the Crow King spat, voice a croak from behind his beaked, black steel casque. "No one who finds themselves in Istfell thinks they were judged correctly. It is as it is in the realms of the living—you must find a way to live despite your fate."
Bjorn plunged his sword into the Crow King's belly. The king did not resist. He grabbed the blade and folded over, his helm and crown falling to the floor. Under the dark armor, he was a green and thin spirit, and he did not cry out. His face was a mask of stoic resolve. He had been a king in this land of the ignoble dead—what did Bjorn know that he did not?
"No," Bjorn growled. "I reject my fate." He tugged his sword free. The king slipped to the ground. The clamor outside died. The city fell silent.
Ranar stepped back from the doors, axe in hand. They groaned open, pushed by the gentle wind at the airy heights of the Crow King's castle. The spirits that had been there were gone. Cautious, Ranar stepped out of the perch and walked to the vertiginous edge of the clifftop fortress. The city below was empty.
"Where did they go?" Ranar asked.
Wrapped in one of the Feather Guard's dark cloaks, Bjorn was a child wearing his elders' clothing. He tugged on the Crow King's helm and did not answer.
"Bjorn," Ranar said, raising his voice. "What happened to the people? Where did they go?"
"Elsewhere," Bjorn said. "As we must."
Ranar felt a deep twisting in his gut as the bloodlust faded. The worry. Was this how a grand quest should feel? Like he was doing something wrong?
"The Bear King," Ranar asked. "He is your father."
"Is that a question or an accusation?" Bjorn said, his voice low.
"A question," Ranar said. "Did you know this Crow King? The Elk? Were they your kin as well?"
"No more than I knew the Bear in life," Bjorn said.
"Fratricide cannot be valorous," Ranar said.
"Lack of valor does not make a feat any less grand," Bjorn said. "Cunning is its own virtue, as is arrogance."
Ranar looked at the youth with horror. "How did you come to Istfell?"
Bjorn did not answer.
"You did this on purpose, didn't you?" Ranar said. "Your augurs, your prophecies—you came here by your own hand."
"I make my own fate," Bjorn said. He showed his blade to Ranar. "You think a sword that could cut a door into Starnheim couldn't easily tear passage into Istfell?" He laughed. "Come. This conversation will take us in loops I don't care to wander."
The wolf at the end of the world watched them go, curious. As Ranar and Bjorn walked deeper into Istfell, the wolf wandered off into the Cosmos to tell certain beings of certain things, and the approach of certain events to come.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Bjorn and Ranar came to the center of Istfell, having been steered through the mist by the unerring sight granted to Bjorn by the Crow King's helm. Across a tumblestone field split by a razor-straight road, the umbral bulk of a great tower loomed from the fog. Its heights were lost in the thick mist, and what features defined its stone face were only discernable by the deeper shadows they cast from the light high above. Bjorn led the two of them down the broad and straight road, the eyes of the Crow King's helm glowing a feeble yellow in the darkness. Megaliths lined the road. Between the standing stones and the fog that drifted over and between them, it was as if they walked through a tunnel.
Ranar walked behind, the many wounds collected from the Feather Guard aching, the pain on his living skin an ever-burning flame, but none of them mortal. He made a great effort to carry his axe, though fatigue bade him drag it along in the sand. He would not be showed up by a youth who barely had any beard. That, and he had begun to wonder if the Valkyries would hear of their exploits; should they show, Ranar would rather be dead clutching his axe than alive dragging it. Dead, Ranar thought, or whatever happened to the spirits that were struck down in Istfell.
"Bjorn," Ranar called out. "Bjorn, what awaits us in the tower?"
"The Bear King," Bjorn said. "The jealous guardian who crouches at the way into Starnheim."
"I thought the only way in was by the Valkyries?" Ranar said.
"There are more ways in than what you are told. Do you know how Istfell came to be?" Bjorn asked.
"I do not," Ranar said.
"I'll tell you: the world was born from a seed," Bjorn began. "That seed grew into the World Tree, and everything else grew from it." Bjorn's voice changed, and Ranar realized he had been quoting something from memory. "The First Saga," Bjorn said. "The first time humans tried to condense the wonder of creation into words."
"What else are we to do with our time?" Ranar said. He spoke only to himself: Bjorn conversed in the same manner that he marched.
"Istfell," Bjorn continued, "was ignored long enough by those with the strength to destroy it that it grew in the shadow of the Tree, under the light of Starnheim." Bjorn grinned. "This realm has always held the castoffs and the forgotten; those above never think to look down—we will use this to our advantage."
The two reached the doors of the Bear King's tower. No one accosted them or attempted to bar their entry. The doors groaned open under their shoulders, revealing a dark and austere interior. The tower was large enough at its base to hold a town inside of its walls. Instead, there was nothing but a standing pool of water and a body at the foot of a grand staircase leading up into the tower's heights.
Stabbed into the fallen body—a mummified form from a time long past—was a spear of ancient make. Wrapped around the spear was a cloth, a banner. Unraveled, it had a single word painted upon it: #emph[CLIMB.]
And, so, Bjorn and Ranar ascended the tower, climbing through the fog and soup-like gloom on the wide and winding stair. As they progressed, the tower aged in reverse: the lowest floors were dark and crumbling, crude-hewn stone worn smooth by countless eons of passage; as they climbed, such raw stone gave way to finely chiseled stone, which gave way to mortared stone, then brick, marble, and on through materials as-yet unknown to Ranar. The strata made it clear: the first builders of this tower must have preceded Bjorn's great grandfather by millennia, and its most recent builders were far more accomplished than any craftsman Ranar was familiar with.
"What age is this," Ranar muttered, a question Bjorn ignored. The walls of this floor of the tower were made from some hammered metal, cold to the touch. "Bjorn, how far do we climb?"
"We are nearly there," Bjorn said. He pointed to the walls. "These are formed from the same metal that the Valkyries use to make their spears. The light outside," Bjorn said, indicating the tall, narrow windows ringing in the floor. They were white, blinding, and it pained Ranar to look. "That light is the light of Starnheim itself. Be ready. We are close."
This close to the realm of legends, in a tower built from the metals wielded by the Valkyries themselves. Ranar's humble axe seemed all the more mundane. Wood and iron, not iridescent, not gold, not crafted from some material of legend, plucked from the Cosmos. He held it forward and ready, though he knew that only when he met the keepers of the path to Starnheim would he learn how useful his old axe truly was.
As best he could, Ranar made himself ready.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Atop the roof of Istfell, below the blinding light of the rent into Starnheim, Ranar and Bjorn stood before the Bear King and his final Ursan Guard. The final floor of the Bear King's tower was a flat and featureless plateau formed of seamless black glass. The air was still. At this height, the light of the heroes' realm obliterated any shadow. The Bear King was younger than Ranar had thought he would be—a man who bore all resemblance to his title, heroic in size and profile. Standing in rank with his Ursan Guard, he towered over the largest of them by a head, his shoulders broad under shaggy, fur-covered pauldrons. His sword was a slab of steel as large as he, a killer of giants, jötunn, and demons.
"Bear," Bjorn began. "You know why I am here."
The Bear King nodded. "Indeed."
"And you know who I am."
The Bear King nodded. He rolled his shoulders. "Indeed."
"So then why do you block my path?"
"We are guardians of this realm," the Bear King said, "and we stand against those who would send it to ruin."
"I demand you stand aside," Bjorn said, his voice rising.
"No, my lord," the Bear King said. "We stand against all threats to Istfell—threats from within and without."
"So be it," Bjorn said. "You'll find the Cosmos far less kind than I." With that, Bjorn strode forward, sword ready, and charged.
The fight to follow was balanced between elegance and the gutter. Bjorn, with grace, followed his blade through and around, up under the guards and between the plated armors. He was a flash of dark lightning, untouched. The Ursan Guard were better equipped to fight Ranar, and the crash of their clashing weapons rang out like thunder across Istfell. Axe to slab-sword, the impact of blade on blade cracking the black glass under the warriors' boots.
Ranar was the battering ram that smashed the gate aside; Bjorn, the sniper's arrow that would bring down the king. Together they slew the Ursan Guard. When the last fell, nothing stood between them and the Bear King.
"There is still time to cease this grim work," the Bear King said. "Leave my tower. Give the lands of the Elk and the Crow to your champion. Make him a loyal vassal," the Bear King said. Though his voice was level and calm, it was tinged with sadness. "Istfell is already yours. Tend to this garden as a humble steward. Be happy with its fruits and flowers, and with the pilgrims called to this land."
Bjorn spat, and his spit sizzled on the black glass plateau. He stabbed his sword toward the sky. "I am come for what is owed to me by strength and song," he bellowed. "Starnheim and all the realms of the World Tree will be mine."
"It will not," The Bear King said.
Bjorn charged, Ranar only a step behind. Across the black glass they thundered, and the wind around them began to rise, and as they reached the Bear King, Bjorn slid under the king's opening swing, leaving Ranar to take the blow. Ranar—as fast as he could, though it felt in the moment to be slow as sap on a winter's morning—brought his axe around into an awkward guard, enough to intercept what otherwise would have been a killing blow. The haft of his axe snapped, the hungry edge of the Bear King's blade crunched into Ranar's mail, and Ranar was thrown to the side, a mix of blood and pale green spirit essence trailing through the air behind.
Ranar crashed to the black glass ground and rolled to a stop near the tower's vertiginous edge. From where he lay, Ranar watched as Bjorn scored a quick cut to the Bear King's leg. The king fell to a knee, and Bjorn was able to circle around him. With a quick strike, Bjorn drove his sword up through a layer of the Bear King's mail and into his chest. The king gasped and dropped his sword. The fight was over.
Ranar groaned, held his wound, and tried to stand. Blood and green essence dribbled out from between his fingers. It was all he could do to struggle up to a knee, using the broken haft of his axe as support. He watched as Bjorn and the king spoke their last words to each other, father and son in a patricidal embrace.
"You may have fooled the Elk and the Crow, but you cannot fool me," the Bear King said. "If you mean to send me to the Cosmos, grant me the honor of seeing your true form."
Bjorn grinned, and as his smile grew so too did the form of the young man peel away from him like dirt rising off of a beaten fur. The dirty-but-fine noble clothing shimmered and shifted, darkening into a cloak and vestments of pure stygian night. His tanned skin paled to an exsanguinated gray, and his hair turned white as bleached bone. Bjorn was gone. In his place stood the very lord of Istfell himself, Egon, god of the dead, old as the bleached rock under Istfell's tundra frost.
"Egon," the Bear King whispered. "My Lord."
"You were a good servant," the God of Death said. Egon held the Bear King from behind. His sword had transformed with him, flowing from steel to form a wicked scythe of smoking glass. Egon pressed the black edge to the Bear King's neck. "Go, voyage," Egon said. "And when you return here, tell me what demons threaten my realm."
Before the Bear King could respond, Egon pressed the king forward into the blade of his scythe. The Bear King's body tipped forward, falling with a heavy, inglorious thud onto the glass. Egon held the Bear King's head up, high above his own, stabbing it toward the glowing sky above.
"Starnheim," Egon bellowed, his voice loud as thunder. "You are mine. Open!"
Ranar watched from the ground, in awe, as the sky above opened, green-white reality peeling away to reveal a golden substrate beyond. A vista resolved, showing a lake of glossy ink, still, with grand longships gliding across its surface. Starnheim was open before them. Ranar reached for the glorious realm, closing his eyes against the light.
"Egon," a voice like a choir, a war cry, split the moment. The light of Starnheim vanished, the rent in the cosmos sealed shut. "Again?"
Egon dropped the Bear King's head and raised his scythe, baring his teeth in a soundless snarl.
The speaker was a Valkyrie of singular authority. She drifted to the tower, carried down by two sets of wings, one alabaster and the other as dark as Egon's vestments. In one hand she held a fine spear, and across her armored form was strapped a mighty herald's horn. Light as dust, she landed before Egon.
"Firja," Egon yelped. "I demand—"
"You may not," Firja said, curt. "Starnheim is not open to the gods without judgement; it is not yet your time Egon. You will remain in Istfell."
"You have no authority," Egon sneered. "I am grand. My quest was glorious. I am mighty. Per your own laws, you must let me in."
Firja laughed. "I make no laws, Egon. I am its judge, and I use my own discretion. Allowing you into my realm would speak the end. So, I will not allow it."
Egon raised his scythe to strike but Firja slapped it away. It skipped across the glossy surface of the tower before flying out into the open air. Egon watched it, groaned, and fell to his knees. The fight quit him. He punched the ground, cracking the glass.
"Spirit," Firja said, turning to Ranar. "Look at me."
Ranar did as commanded. Firja was terrible and grand, without equal. Terrified, heartened, but suffused with hope, Ranar stood. He clutched his halved axe—a warrior, always.
"If any here deserve entry on merit it is you, old man," Firja said. "Though I question your judgement; following this one on such an endeavor, and all the while not knowing who he was." Firja shook her head. "Desire for glory is blinding."
"The God of Death led me, aye," Ranar said. "But I made my own choice. If I did not harbor the same desire as he, I would not have followed."
Firja raised an eyebrow. "Be honest," she said. "What will you do if I refuse you entry and urge you to remain in Istfell?"
Ranar looked between Firja, radiant, and Egon, seething. "I know how to serve," Ranar said. "And I know how to humble myself when I have made a mistake." He offered Firja his broken axe. "In life, I stood guard, and in death, I did the same. This quest has tested me, and I failed. I ask for your grace so that I may guard others from my same failure."
"Good answer," Firja said. "It is done."
Ranar stood, marveling as his axe repaired itself in his hands. Though battle-worn as before, veins of Valkyrie metal flowed through the wood and etched themselves into knots on the axe head.
"I will return, Firja," Egon sneered. "I will find my way into Starnheim."
"I'm sure you will try," Firja said. "Ranar, guard your realm. Strike him down."
Ranar considered for a moment, then made his decision. Against Egon's protestations, he swung his axe, striking down the God of Death in a single blow.
"Good," Firja said.
"Will he live again?"
"Oh, of course," Firja said. She clapped a hand on Ranar's shoulder. "This is his own realm, and for now, it follows his own rules. He will wander the Cosmos for a time, and then come to his body and raiment and armaments, sit at his throne, and rule again." Firja untucked her wings and stretched them wide, preparing to depart.
Ranar watched Egon's body turn a whiter pale, crack, and blow away to dust.
"Egon has done this before," Ranar said. "Have I?"
The Valkyrie nodded. "For eons he has tried. I have seen you many times, though not always," she said. "You are an integral part of this cycle. If you reach the end, you are always helpful," Firja said. "Though you never remember until I name you guardian again—that is the difficulty with this place. Istfell is the realm of the forgotten and unknown. All who find themselves here fade in time; those who keep it are not immune from the realm's power either." Firja spoke without sentiment, level in a way that might sound harsh to those with tender ears, but not Ranar. He had only ever known the winter bite of a jarl's command, or the braying howl of a raider demon's war cry: he could read when cold was cruel and when cold was only cold.
"How am I to guard a realm when I forget my own duties?" Ranar asked.
Firja directed his gaze back to the ash-white ghost of Egon. A bare outline of his collapsed form remained on the dark glass surface of the tower floor, the rest blown away by the wind.
"Before it comes to that, I mean," Ranar grunted.
"You are a guardian," Firja said. "In your soul, you are steady in your task. Whether your duty looks like this or is simple in its execution, you will shape to it." Firja beckoned Ranar over to the edge of the tower, where they could look out over the whole of Istfell. She pointed toward the far horizon, where Ranar knew the realm to end, bordered in by the river. "Consider the river," Firja said. "Though the water that gives it its body may change—is it not always a river?"
"I suppose so," Ranar said. "Though that river is well kept."
"Isn't it?" Firja grinned, a rare sight. "Serve this realm and its people well, Ranar of Istfell." She flapped her wings once, and then lifted up from the tower top. Golden light broke through the cloud cover. Starnheim's distant shore opened above them. Ranar lifted his axe in salute. With it, he shielded his eyes, and watched Firja fly into the light. Alone, like he was, in duty.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Sometime later, the corporeal green of Istfell fell over Ranar's body once more, and he found himself walking along the pale, hard ground of the realm's vast tundra. The glow of the fog-blotted light above fell soft on the sparkling ice below, and there were no shadows.
Ranar felt no thirst, pain, hunger, or ache. He was, once more, a phantasm. A spirit in a realm set aside for spirits. It was his duty to stand guard, but where to begin? Hold vigil at the Gates of Istfell, where entering souls would meet him? Seek news or rumors of raiders from this realm or another? Ranar carried his axe made whole by Firja. As before, he knew it to hold the answer.
Ranar heaved his axe into the sky, stepped to the side, and marked where it fell. The haft pointed the way, far away to a distance unfathomable, where the very Cosmos itself swirled. Across Istfell, where spirits unsung still cried out for heroes.
"Good," Ranar said. Direction. Purpose. Glory. Alone, the guardian of Istfell pulled his axe free and set off toward the far horizon.
|
|
https://github.com/Rhinemann/mage-hack | https://raw.githubusercontent.com/Rhinemann/mage-hack/main/src/chapters/Paradox.typ | typst | #import "../templates/interior_template.typ": *
#show: chapter.with(chapter_name: "Paradox")
= Paradox
#show: columns.with(2, gutter: 1em)
Paradox is the collective force of consensual reality fighting back against the enlightened will of the mage.
A useful analogy is to imagine the Tellurian as a huge body of water. Most people move with the currents of reality, floating along on a cushion of their own belief. Some of these sleepers, Hedge magicians or simply the heroically lucky, learn to dip their hands in and alter the flow, but they cannot redirect the river. Vampires and werewolves are predators, fast and agile in the waters of reality, but still confined by the flow of belief. The Mage, however, sees the river for what it is, and can push the water around as they choose.
Paradox is the inertia of 6 million gallons of belief. Mages who change reality with vulgar magic are pushing the river in ways it does not want to go, and risk being drowned by the current. Coincidental magic uses the flow of reality, rather than fighting against it, and can easily avoid Paradox, but even coincidence can risk paradox if it is unbelievable to the local sleepers.
Paradox can take a variety of forms. Backlash, reality directly attacking the offensive mage, can cause temporary, long term, or even permanent wounds, flaws, or oddities. Quiet, a magical form of madness, forces the offending mage to resolve their guilt over disjointing reality. Exceptionally offensive mages can be catapulted into Paradox Realms, or hounded by Paradox spirits.
#block(breakable: false)[
== Paradox Pool
Mages accumulate Paradox into a pool from different sources, they are as follows:
]
/ Casting vulgar magick: Whenever a Sleeper witnesses you using Magick in obvious ways, the player adds #spec_c.d6 to the pool and gains a #spec_c.pp.
/ Hitching while casting a spell: Whenever a player rolls a hitch, the Storyteller may add that die to a Paradox pool instead of the Doom pool, paying for it as normal.
/ Special circumstances: Certain special circumstances like encounters with Mad Ones may inflict Paradox in unusual ways too.
#sidebar()[
#block(breakable: false)[
=== Optional Rule: Harsh Paradox
If a Storyteller wants the vulgar magick to be more punishing they may decide to add the effect die of the spell to the pool instead of a #spec_c.d6.
]
]
The Storyteller is able to use Paradox dice from the pool to cause different effects. The most common uses for Paradox dice are:
/ Burn: Roll the Paradox pool or a part of it to inflict stress of your choice.
/ Paradox Flaw: Spend a die from the Paradox pool and create a Complication attached to the character equal in size to the die spent.
/ Paradox Spirit: Spend a die from the Paradox pool equal to the spirit's highest rated trait, and any number of dice in addition, and drop them into the scene, ready to act when the action order gets to them (which could be right away, if the Storyteller is the one deciding who goes next). All additional dice spent will constitute the Spirit's boss pool.
/ Quiet: Spend any number of dice from the Paradox pool to create a crisis pool of the same dice value representing the character's Quiet.
/ Paradox Realm: Spend a #spec_c.d10 or a #spec_c.d12, and any additional number of dice from the Paradox pool to separate one player into a Paradox realm, every additional die spent will constitute the Realm's crisis pool. |
|
https://github.com/pedrofp4444/BD | https://raw.githubusercontent.com/pedrofp4444/BD/main/report/content/[2] Levantamento e Análise de Requisitos/main.typ | typst | #import "metodo.typ": metodo
#import "organizacao.typ": organizacao
#import "validacao.typ": validacao
#let requisitos = {
[
= Levantamento e Análise de Requisitos
Na sequência do decorrer das etapas do desenvolvimento, surge a necessidade de um levantamento, organização e efetivação concreta dos requisitos que sustentarão a totalidade do sistema de gestão de base de dados.
#metodo
#organizacao
#validacao
]
}
|
|
https://github.com/SidneyLYZhang/learnTypst | https://raw.githubusercontent.com/SidneyLYZhang/learnTypst/main/README.md | markdown | # README
主体由 [Typst](https://typst.app) 的官方教程翻译而来。以及一部分我自己觉得有用/常用的脚本和模板。
同时,这个仓库也是我练习Typst的一个记录。
## 翻译内容
翻译以下内容:
1. [Tutorial > Writing in Typst](https://typst.app/docs/tutorial/writing-in-typst/) - [001_使用Typst写作](Documentation/Sources/001_writing-in-typst.typ) ([PDF-草稿](Documentation/PDF/001_使用Typst写作.pdf)) _last@20240717_
2. [Tutorial > Formatting](https://typst.app/docs/tutorial/formatting/) - [002_把文档格式化处理](Documentation/Sources/002_formatting.typ) ([PDF-草稿](Documentation/PDF/002_文档格式化.pdf))_last@20240723_
3. [Tutorial > Advanced Styling](https://typst.app/docs/tutorial/advanced-styling/) - [003_高级排版样式](Documentation/Sources/003_advanced-styling.typ) ([PDF-草稿](Documentation/PDF/003_高级排版样式.pdf))_last@20240818_
4. [Tutorial > Making a Template](https://typst.app/docs/tutorial/making-a-template/) - [004_制作模板](Documentation/Sources/004_making-a-template.typ) ([PDF-草稿](Documentation/PDF/004_制作模板.pdf))_last@20240818_
5. [Guides > Guide for LaTeX users](https://typst.app/docs/guides/guide-for-latex-users/) - [011_LaTeX用户指南](Documentation/Sources/011_guide-for-latex-users.typ) ([PDF-草稿](Documentation/PDF/011_LaTeX用户指南.pdf))_@20240818_
## My Favorites
1. [教程参考 - 草稿](MyFavorites/001_tutorial-reference.typ) : 一些额外的我认为很有价值的参考信息。
## From Typst Offical
### Overview
Typst是一种新型的基于标记的科学排版系统。它旨在成为高级工具如LaTeX和更简单工具如Word和Google文档的替代品。我们的目标是构建一个功能强大且使用愉悦的排版工具。
本文档分为两部分:一个面向初学者的教程,通过实际用例介绍Typst,以及一个全面的参考,讲解Typst的所有概念和功能。
我们还邀请您加入我们围绕Typst建立的社区。Typst仍然是一个非常年轻的项目,因此您的反馈非常宝贵。 → [_原文_](https://typst.app/docs/)
### 何时使用Typst
在我们开始之前,让我们了解一下Typst是什么以及何时使用它。Typst是一种用于文档排版的标记语言。它旨在易于学习、快速且多功能。Typst接受带有标记的文本文件并输出PDF文件。
Typst是撰写任何长篇文本的好选择,例如文章、论文、科学论文、书籍、报告和家庭作业。此外,Typst非常适合包含数学符号的文件,如数学、物理和工程领域的论文。最后,由于其强大的样式和自动化功能,它是任何共享通用样式的文档集合的绝佳选择,例如系列书籍。 → [_原文_](https://typst.app/docs/tutorial/#when-typst) |
|
https://github.com/kotfind/hse-se-2-notes | https://raw.githubusercontent.com/kotfind/hse-se-2-notes/master/edu/lectures/2024-09-04.typ | typst | = Введение
<NAME>
`<EMAIL>`
Будем изучать образование сверху вниз (от ВУЗа до детского сада)
Психологию обручения разных возрастов будем изучать в порядке от младших к
старшим
|
|
https://github.com/HarryLuoo/sp24 | https://raw.githubusercontent.com/HarryLuoo/sp24/main/Physics311/reviewNotes/part2.typ | typst | #set math.equation(numbering:"1",)
#import "@preview/wrap-it:0.1.0": wrap-content
= Small Oscillations
- Motion near a point of stable equilibrium.
== DOF= 1 (one dimension)
- For a system of DOF = 1, with potential $U(q)$:
- *stable equilibrium* at $U(q)_min$, upward parabola, where $F = -(dif U)/(dif q )= 0 $
- restoring force for small displacements $q-q_0$ is $F = -(dif U(q-q_0))/(dif q)$
- *Unstable equilibrium* at $U(q)_max$, downward parabola, where $F = -(dif U)/(dif q )= 0 $ as well.
- Consider small deviation from point of stable equilibrium, we use taylor expansion to show that it is really a small displacement. that is,
$
U approx U(q_0) + (dif U(q_0))/(dif q)(q-q_0) + (dif^2 U(q_0))/(2 dif q^2)(q-q_0)^2\
"while" (dif U(q_0))/(dif q)(q-q_0) = 0
$
letting $x = q- q_0$, we have $
cases(U(x) = U(q_0) + (1/2)(dif^2 U(q_0))/(dif q^2)x^2,
"putting into the form of" U(x) = U(x_0) +(1/2)k x^2.)\
=> #rect(inset: 8pt)[ $ display(k = (dif^2 U(q_0))/(dif q^2) > 0 )$ ]
$
we get KE, while choosing $U(q_0) = 0$:\
$ T = 1/2 a(q)^2 dot(q)^2 = 1/2 a(q_0+x)dot(x)^2 approx 1/2 m dot(x)^2 , =>^(m = a(q_0))\
#rect(inset: 8pt)[ $ display(L = T - U = 1/2 m dot(x)^2 - 1/2 k x^2 )$ ] $ <eq.1DSO.largrangian>
=== EOM for DOF = 1 small Oscillations
using EL on @eq.1DSO.largrangian, we can get the EOM for one dimensional small Oscillations:
$
m dot.double(x) = -k x \ => dot.double(x) + omega_0 ^2x = 0, "where" #rect(inset: 8pt)[ $ display(omega_0 = sqrt(k/m) ) "freq of osc."$ ]
$
by magic of ODE, EOM reduces down to: $
#rect(inset: 8pt)[$x(t) = C_1 cos(omega_0 t) + C_2 sin(omega_0 t)$] \ "where" C_1,C_2 "are constants"
$
by trig magic, this could also be written as $
x(t ) = a cos (omega_0 t +alpha),\ " where" cases(a = sqrt(C_1^2 + C_2^2) &"amplitude of oscillation" , omega_0 &"frequency of oscillation", tan alpha = C_2 slash C_1 &"phase at t=0" )
$
=== energy for 1D small Oscillation
checking $(diff L )/(diff t) = 0 =>$ energy-conservation:
$
E = T + U &= 1/2 m dot(x)^2 + 1/2 k x^2\ & = 1/2 m a^2 omega_0^2 , [ " constant"]
$
=== Damped 1D oscillation, and Complex representation
- when there is damping (friction, resistence, etc) $F_"fric" = - beta dot(x)$, the EOM becomes:$
dot.double(x) + 2 gamma dot(x) + omega_0^2 x = 0,\ "where" 2 gamma = beta/m , omega_0 = sqrt(k/m) $ <eq.1DSO.damped>
with ansatz $x(t) = e ^(r t), dot(x) = r e ^(r t ), dot.double(x) = r^2 e ^(r t) $, the solution to @eq.1DSO.damped is:
$
r^2 + 2 gamma r + omega_0^2 = 0,\ "which has solution" r_+, r_- = -gamma plus.minus sqrt(gamma^2 - omega_0^2)\
=>x(t) = C_1 e^(r_+ t) + C_2 e^(r_- t),\
$<eq.1DSO.sol>
notice the r subscripts here: $r_+ , r_-$
=== underdamped, overdamped, and critically damped
Recall from your ODE class...
@eq.1DSO.sol has the following 3 cases, each with different physical interpretation:
+ underdamped:
$ gamma < omega_0 => "2 complex roots: " cases( r_(plus.minus) = - gamma plus.minus i sqrt(omega_0^2 - gamma ^2)\ = - gamma plus.minus i omega, omega = sqrt(omega_0^2 - gamma^2) ) $
The EOM is thus a linear combination of two complex expoentials:
$
x(t) &= e ^(-gamma t)(C_1 e ^(i omega t) + C_2 e ^(-i omega t)) \
&= e ^(-gamma t)(A cos(omega t) + B sin(omega t)) \
&"-- where" cases(A = C_1 + C_2, B = i(C_1 - C_2))\
&= a e ^(- gamma t) cos (omega t + alpha)\
&a, alpha "are constants"
$
"The solution is a damped oscillation with frequency$omega$, and amplitude expoentially decaying with time."
+ Overdameped
$
gamma > omega => x(t) =\ c_1e^(-gamma+sqrt(gamma^2-omega^2)t )+c_2e^(-gamma-sqrt(gamma^2-omega^2) t) $
$
"when"gamma >> omega_0, => display(cases(gamma+sqrt(gamma^2-omega_0^2) approx 2gamma, gamma - sqrt(gamma^2-omega^2)=(omega^2)/(2gamma)))\
x(t) = c_1 e^(-2gamma t)+ c_2e^((-omega_0^2slash 2gamma)t)
$
+ Critically damped
$ gamma = omega_0 => x(t) = c_1e^(-gamma t) + c_2 t e^(-gamma t)
$
#figure(
grid(
columns: 2, // 2 means 2 auto-sized columns
gutter: 2mm, // space between columns
image("damped.png",width: 60%),
image("overdamped.png",width: 60%),
))
#line(length: 100%)
=== Forced Oscillations
When external force (F) is applied to the system, the largrangian becomes
$
L = 1/2 m dot(x)^2 - 1/2 k x^2 + F(t)x \
"EL"=> dot.double(x) + omega_0^2x = F(t)/m, "where" omega_0 = sqrt(k/m)
$ <eq.forced>
- Example: Simple pendulum with moving pivot
#figure(
grid(
columns: 2, // 2 means 2 auto-sized columns
gutter: 2mm, // space between columns
image("pivotPendulum.png",width: 50%),
$
cases(x = X+l sin phi,
y = l cos phi)
=> cases(dot(x)=dot(X)+l dot(phi) cos phi,
dot(y) = -l dot(phi) sin phi)\
=> L = T-U $ ,
))
$ L= 1/2 m l^2 dot(phi)^2-m g l(1-cos phi)- m l dot.double(X)sin phi\
"Expand ab." phi = 0 => L = 1/2 m l^2 dot(phi)^2 - 1/2 m g l phi^2 - m l dot.double(X) phi\
"EL" =>
#rect(inset: 8pt)[ $ display( dot.double(phi) + omega_0^2 phi = -dot.double(X)/l ",where" omega_0 = sqrt(g/l) )$ ] $
=== reintroducing damping via external forcing
$ dot.double(x)+ 2gamma dot(x)+omega_0^2x = f(t), f(t)=F(t)/m $
When damping $f(t) = f_0 cos(Omega t)$, solution via complex number:
$
dot.double(z)+2gamma dot(z) + omega_0^2 = f_0 e^(i Omega t) \
"ansatz" z(t) = z_0 e^(i Omega t)=> z_0=(f_0)/(omega_0^2+2i gamma Omega + Omega_0^2) \
#rect(inset: 8pt)[ $ display( z_0=a(Omega) cos(Omega t+ delta(Omega))f_0 )$ ]
"is a partcular solution,where"\ cases(a(Omega) = 1/(sqrt((omega_0^2-Omega^2)^2 + (2gamma Omega)^2)), delta(Omega) = arctan(2gamma Omega/(omega_0^2-Omega^2)) )
$
We can study the properties of the system by looking at the amplitude and phase of the solution.
- Amplitude: $ a_((Omega)) = 1/(sqrt((omega_0^2-Omega^2)^2 + (2gamma Omega)^2)) $,
when $gamma << omega_0$, response strongest and amplitude largest when $omega_r = omega_0$.
#figure(
grid(
columns: 2, // 2 means 2 auto-sized columns
gutter: 2mm, // space between columns
image("response.png",width : 50%),
image("phaseLag.png",width: 50%),
))
- Phase lag: $tan delta(Omega) = 2gamma Omega/(Omega^2-omega_0^2)$
in phase as $Omega -> 0$, and out of phase as $Omega -> omega_0$.
- Genral solution to sinusoidal forcing: $ x(t) = a(Omega)f_0cos(Omega t + delta(Omega)) + a_0e^(-gamma t) cos(omega t+ alpha) \ ->^(t>1/r) a(Omega)f_0cos(Omega t + delta(Omega)) $ Forgets initial condition after time.
- Power obsorbed by oscillation
$p = F dot(x) = m f dot(x)$
Avg power of oscillation $
P_"avg" = 1/T integral_(0)^(T) m f dot(x) dif t = -1/2 m f_0 a(Omega) Omega sin delta(Omega)\ "simplifies to"
P_"avg" (Omega) = gamma m f_0^2Omega^2 a^2_((Omega))
$
Absorption around resonance frequency $Omega = omega_0+epsilon$ is maximum:
$
P=(gamma m f_0^2)/(4(epsilon^2+gamma^2)) approx (m f_0^2)/(4gamma)
$
== Oscillations DOF>1
For a system with n DOF: $q=(q_1,q_2,...,q_n),"PE"=U(q)$
- Stable equilibrium $(diff U(q))/(diff q_i)mid(|_(q=0)) $
=== Example: Oscillation with 2 mass and 3 springs
#let EOM = $L = 1/2 m dot(x_1) +1/2 m dot(x_2) - 1/2 k x_1^2\ - 1/2 k x_2^2 - 1/2 k' (x_1-x_2)^2$
#figure(
grid(
columns: 3, // 2 means 2 auto-sized columns
gutter: 1mm, // space between columns
image("2m3s.png",width : 50%),
EOM, align: left,$quad quad quad quad quad quad$,
))
EOM: $
M dot dot.double(arrow(x)) = -K arrow(x) " , where" M = mat(m,0;0,m),\ arrow(x) = mat(x_1;x_2), K = mat(k+k',-k';-k',k+k')\
$
ansatz: $arrow(x)="Re"[arrow(a)e^(i omega t) ]$ Then the EOM eq becomes solving the eigenvalue problem: $
det mat(omega^2 M - K) = 0\
=> cases(omega_-^2=k/m, omega_+^2=(k+2k')/m) cases(arrow(x_-)= a_- mat(1;1)cos(omega_- t + delta_-), arrow(x_+)= a_+ mat(1;-1)cos(omega_+ t + delta_+))
$ with constants $a_-,a_+,delta_-,delta_+$.
=== New Coords
$
cases(Q_1=sqrt(m/2)(x_1+x_2) , Q_2=sqrt(m/2)(x_1-x_2))\
=>L = 1/2 (dot(Q_1)^2 + dot(Q_2)^2) - 1/2 (omega_-^2 Q_1^2 + omega_+^2 Q_2^2)\ =>^("E-L") dot.double(Q_1) = -omega_-^2 Q_1, dot.double(Q_2) = -omega_+^2 Q_2
$ Decoupled oscillators with coords $Q_1,Q_2$.
=== General Coords
for general coords $q_i$, let $x_i = q_i-q_i^((0))$
$
U=1/2 sum_(i,j)k_(i j)x_i x_j,quad k_(i j) = k_(j i)= (diff ^2U(q))/(diff q_i partial q_j) "symm mat"\
T = 1/2 sum_(i,j)m_(i j)dot(x_i)dot(x_j), quad m_(i j) = m_(j i) = a_(i j) (q^((0)))\
$
the largrangian, in Matix form:
$
L = 1/2 dot(arrow(x))^T dot M dot dot(arrow(x)) - 1/2 arrow(x)^T dot K arrow(x) ==>^("EL") (omega^2M-K)dot arrow(a) = 0 $ <eq.Oscillation.matrix>
$ =>det (omega^2M -K)=0$ Solving the det for omega gives the normal freq (Eigenvalues)of system $omega_alpha^2$ .
plug in Evalue into @eq.Oscillation.matrix for eigenvec(normal modes) $arrow(a^alpha)$ of system.
- General motion $
x_i (t) = sum_(alpha)a^alpha_i"Re"[C_alpha e^(i omega_alpha t) ]
$
- EXAMPLE: Normal freq is given $ omega={0,sqrt(2)omega_0,sqrt(3) omega_0 }.\ omega=sqrt(2)omega_0 => a_1=-a_3=-a_2 = a e^(i delta) =>\ arrow(theta)= a mat(1,-1,-1)^T cos(sqrt(2) omega_0 t + delta)\
omega=sqrt(3 omega_0) => a_1=0, a_2=-a_3 = a e^(i delta) =>\ arrow(theta)= a mat(0,1,-1)^T cos(sqrt(3) omega_0 t + delta)\
$
- EXAMPLE: double pendulum
$
cases(x_1 = l_1 sin phi_1 quad y_1 = -l_1 cos phi_1, x_2 = l_1 sin phi_1 + l_2 sin phi_2 quad y_2 = l_1 cos phi_1 + l_2 cos phi_2) $$
=>T = 1/2 m_1 l_1 dot(phi)^2+1/2m_2(l_1^2 dot(phi_1)^2 + l_2^2 dot(phi_2)^2 \ + 2l_1 l_2 dot(phi_1)dot(phi_2)cos(phi_1-phi_2))\
U = -m_1 g l_1 cos phi_1 - m_2 g(l_1 cos phi_1 + l_2 cos phi_2)\
$ using $cos phi approx 1-phi^2/2$
$ L = 1/2 mat(dot(phi_1), dot(phi_2)) mat((m_1+m_2)l_1^2, m_2l_1l_2; m_2l_1l_2, m_2l_2^2) mat(dot(phi_1), dot(phi_2))\ quad- 1/2 mat(phi_1, phi_2) mat((m_1+m_2)l_1g,0;0,m_2g l_2) mat(phi_1, phi_2)\ = 1/2 dot(arrow(phi))^T M dot dot(arrow(phi)) - 1/2 arrow(phi)^T K arrow(phi)\
$
When $m_1=m_2=m, quad l_1=l_2=l => quad
M=m l^2 mat(2,1;1,1), K=m g l mat(2,0;0,1)$ $
det mat((omega^2M-K)) = 0 => omega^2 = (2 plus.minus sqrt(2)omega_0^2 )\
mat(a_1^-;a_2^-) = C_-mat(1;sqrt(2) ), quad mat(a_1^+;a_2^+) = C_+mat(1;-sqrt(2) )\
$
== Normal Coords
${x_i} = {Q_alpha}, "where" x_i = sum_(alpha=1)^(n)A_(i alpha) Q_alpha => \ sum_(j)(omega_alpha^2 m_(i j) - k_(i j) A_(j x))=0 \ => L = 1/2 sum_(alpha=1)^(n)(dot(Q^2)_alpha - omega_alpha^2 Q_alpha^2) ==>^"EL" dot.double(Q_alpha)+omega_alpha^2Q_alpha =0 $
= Motion of Rigid Body
- EXample: rotor
rotation with constraint $abs(arrow(r_i)-arrow(r_j))$ .COM coords are useful here $
cases(arrow(r)=arrow(r_1)-arrow(r_2),arrow(R)=(m_1 arrow(r_1)+ m_2 arrow(r_2))/(m_1+m_2))=>cases(arrow(r_1)=arrow(R)+ m_2arrow(r)slash M , arrow(r_2)=arrow(R)- m_1arrow(r)slash M) $ $
L = 1/2 M dot(arrow(R))^2 + mu dot(arrow(r))^2, quad mu = m_1 m_2/(m_1+m_2) \ ==>^"polar" L = 1/2 M dot(arrow(R))^2+ 1/2 mu a^2 (dot(theta)^2 + dot(phi)^2 sin ^2 theta)
$
== frames of reference
#figure(
grid(
columns: 2, // 2 means 2 auto-sized columns
gutter: 2mm, // space between columns
image("RigidFrame.png",width: 50%),
($(X Y Z)==>^(R(theta,phi,psi))(x_1,x_2,x_3)$
)))
Velocity of pt in body: $arrow(v) = arrow(V) + arrow(Omega) times arrow(r)$, where V is Translational vel, Omega is angular vel, r is position vector.
== Largrangian for Rigid Body
$
T = 1/2 M V^2 + 1/2 sum_(a) m_a [Omega^2 r_a^2 - (arrow(Omega) ) arrow(r_a))^2)] \ T"translational" +T"rotational"
$
consider rotation, $ Omega^2 = sum_(i) Omega_i^2, quad arrow(Omega) dot arrow(r_a) = sum_(i) Omega_i x_(a,i)\ => T_("rot") = 1/2 sum_("i,j") Omega_i Omega_j I_("i,j"). quad I_(i j) equiv sum_(a)m_a(delta_(i j)r_a^2 - x_(a,i)x_(a,j)) $
$=> L = 1/2 M V^2 + 1/2 sum_(i,j)I_(i,j)Omega_i Omega_j -U$
=== Inertial Tensor
- Discrete
$
I = mat(sum m(y^2+z^2), -sum m x y, -sum m x z; -sum m x y, sum m(x^2+z^2), -sum m y z; -sum m x z, -sum m y z, sum m(x^2+y^2)))
$
- Continuous
$
I_(i j) = integral rho(x) (delta_(i j) r^2 - x_i x_j) dif V\
I_(x x)= integral rho(x) (y^2+z^2) dif V, I_(x y) = I_(y x) = -integral rho(x) x y dif V\
I_(y y)= integral rho(x) (x^2+z^2) dif V, I_(y z) = I_(z y) = -integral rho(x) y z dif V\
I_(z z)= integral rho(x) (x^2+y^2) dif V, I_(z x) = I_(x z) = -integral rho(x) z x dif V\
$
example: #image("ex.inertia1.png", width: 70%)
- Example: coplanar system
principal axis: Z $=> I_(13) = I_(23) =0$ \
$I_3 = I_1+I_2$
== Principle axis and principal moments of inertia
In the principal frame: $ T_"rot" = 1/2 (I_1 Omega_1^2 + I_2 Omega_2^2 + I_3 Omega_3^2) $
- spherical top $I_1=I_2=I_3$
- Symmetric top $I_1=I_2 eq.not I_3$
- Asymmetric top $I_1 eq.not I_2 eq.not I_3$\
- EXample: $
det mat(I - lambda bold(1)) = 0 => lambda "prncp. mom."\ arrow(v)="eigenvec.= prncp. axis"\
$
- EXample: continuous with axis of symmetry
$rho(arrow(r))=rho=(r,x_3)=> I_(i j) = integral rho(arrow(r))(r^2 delta - x_i x_j) dif V $
== Parallel axis theorem
when changing Origin diff. from COM(O),
#figure(
grid(
columns: 2, // 2 means 2 auto-sized columns
gutter: 2mm, // space between columns
image("parallelAxis.png",width : 50%),
$I_(i j) =\ I'_(i j) - M(a^2 delta_(i j) - a_i a_j)$
,
))
For a cube, when finding I at corner, first find I at COM, and
$
I'_(x x) = I_(x x) + M(b^2 +c^2) = 4/3 M(b^2)+c^2\
I'_(y y) = I_(y y) + M(a^2 + c^2) = 4/3 M (a^2 + c^2) \
I'_(z z) = I_(z z) + M(a^2 + b^2)= 4/3 M(a^2 + b^2) \
$
#image("ex.symm1.png",width : 70%)
#image("ex.symm2.png",width: 70%)
#image("ex.symm3.png", width: 70%)
|
|
https://github.com/SkytAsul/fletchart | https://raw.githubusercontent.com/SkytAsul/fletchart/main/src/deps.typ | typst | #import "@preview/fletcher:0.5.1" as fletcher
#import fletcher.deps.cetz as cetz |
|
https://github.com/Tweoss/math_scratch | https://raw.githubusercontent.com/Tweoss/math_scratch/main/example/example.typ | typst | #import "../template.typ": *
#show: homework.with(
class: "MATH 62CM",
number: 9,
date: "March 2023"
)
#problem[
Let $gamma = (gamma_1, gamma_2): [0, 2pi] -> RR^2 \\ {(-1, 0), (1, 0)}$ be a loop such that its winding number around the point $(-1, 0)$ is equal to $2$, and its winding number around the point $(1, 0)$ is equal to $-3$. Compute the linking number $op("lk")(phi.alt, psi)$ of the loops $ phi.alt(s) = (cos s, sin s, 0) "and" psi(gamma_1(t), 0, gamma_2(t))|s,t in [0, 2pi] $
]
#solution[
We have that the linking number is the degree of a map $f(phi.alt, psi) : sq(T) -> sq(S)$ given by $f(phi.alt, psi) = (gamma_1(phi.alt) - gamma_2(psi)) / (|gamma_1(phi.alt) - gamma_2(psi)|)$. To determine the linking number, we take the sum of the sign of the preimages of some point on the sphere.
Take the ray coming out of the page, along the y-axis as below. We conclude the linking nunber is $+5$. There are $5$ crossings where we can cast a ray form the red curve through the blue curve such that the ray comes out of the page. We have that the orientation of these curves matches, and that the sign is positive.
#figure(image("linking.png", width: 80%),
caption: [
View of loops from the positive y-axis
]) <linking>
]
#problem[
Prove that any Morse function (i.e. a function with non-degenerate critical points) $f: sq(T) -> RR$ has at least $4$ critical points.
]
#solution[
Parametrize the torus by $theta, phi.alt$. Take $f_theta(phi.alt) = f(theta, phi.alt)$. Then, we can maximize or minimize $f_theta(phi.alt)$ with respect to $phi.alt$ and with respect to $theta$ individually.
We have that $limits(max)_theta (limits(max)_phi.alt f_theta) = limits(max)_(sq(T)) f = f(p_(++))$ for some point $p_(++)$. Define $p_(+-)$ to be a point such that $f(p_(+-)) = limits(max)_theta(limits(min)_phi.alt f_theta)$ and vice versa for $p_(-+)$. Define $p_(--)$ to be the global minimum on the torus. By definition, there exists at least one point for us to choose for each of these combinations.
If we have that for two of these points $p_1 = p_2$, then we have that $limits(min)_phi.alt f_theta = limits(max)_phi.alt f_theta$, $limits(max)_theta (min " or " max f_theta) = limits(min)_theta(min " or " max f_theta)$, or both. Intuitively, this would mean that along some path, $f$ is constant and thus not Morse.
If the first is true, then for some $theta$, the function $f_theta$ is constant with respect to $phi.alt$. Then, the Jacobian has entry $0$ for the partial with respect to $theta$, and thus the Hessian has determinant $0$. This means the function is degenerate and thus not Morse.
If the second is true, then one of $min f_theta$, or $max f_theta$ with respect to $phi.alt$ is constant with respect to $theta$. Then, again, we have a $0$ for the partial with respect to $theta$ in the Jacobian and $f$ is thus not Morse.
]
#problem[
+ Find a vector field $Z$ tangent to $sq(S)$ which has exactly $1$ zero of index $2$.
+ Find a vector field tangent to $S^(2n-1)$ which has no zeroes.
]
#solution(level: 1)[
Define a vector field on $sq(RR)$ as $(1/(x^2+y^2+1), 0)$. This vector field always points to the right and has magnitude that goes to $0$ at infinity. Then, take the map from $RR^2$ to $S^2$ as the projection by the north pole. This is a diffeomorphism, and we use it to map the vector field onto the sphere. At the north pole, the projection is undefined, so we take the vector field to be $0$ there. Because the vector field on $RR^2$ decreases to $0$ at infinity, the vector field on $S^2$ decreases to $0$ near the north pole.
The vectors near the north pole look as in below.
#figure(image("projection.png", width: 80%),
caption: [
Vector field near the north pole
]) <projection>
We can see that the vector field wraps around twice counterclockwise near the $0$ that is the north pole. Everywhere else, the vector field is defined to be nonzero, so there is exactly one $0$ of index $2$ on the sphere.
]
#solution(level: 1)[
Take the vector field $(-y_1, x_1, -y_2, x_2, dots)$. Evidently, this is perpendicular to the vector $(x_1, y_1, x_2, y_2, dots)$ since the dot product of the two is $0$. Therefore, the vector field is tangent to $S^(2n-1)$. Since we are on the sphere, at least one of these coordinates must be nonzero for $x^2_1 + y^2_1 + x^2_2 + y^2_2 + ... = 1$ to be true. Therefore, the vector field is also nonzero on the sphere.
]
#pagebreak()
#problem[Show that there are no degree $1$ maps $f: S^2 -> T^2$.]
#solution[
Take the area form $d theta and d phi.alt$. Then, we can scale this form to obtain a form $alpha and beta$ such that $integral_(T^2) alpha and beta = 1$. Then, for any $f$ from $S^2->T^2$, we have that $integral_(S^2) f^*(alpha and beta) = integral_(S^2) f^*(alpha) and f^*(beta)$. The value of this integral is the degree of $f$. Because the sphere is a compact orientable and connected manifold with an empty boundary, we have that the first Betti number of the sphere is $0$ from notes. Therefore, the closed form $f^*(alpha) and f^*(beta) = d omega$, an exact form for some $omega$. Then, we can take the integral over the boundary of the sphere of $omega$ by Stokes' Theorem. Then, we can take the integral over the boundary of the sphere by Stokes' Theorem of $omega$. The boundary is empty, so the integral is $0$, and thus the degree of the map $f$ is not $1$.
]
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/dict-08.typ | typst | Other | // Simple expression after already being identified as a dictionary.
// Error: 9-10 expected named or keyed pair, found identifier
#(a: 1, b)
// Identified as dictionary due to initial colon.
// Error: 4-5 expected named or keyed pair, found integer
// Error: 5 expected comma
// Error: 12-16 expected identifier or string, found boolean
// Error: 17 expected expression
#(:1 b:"", true:)
// Error: 3-8 expected identifier or string, found binary expression
#(a + b: "hey")
|
https://github.com/Jollywatt/typst-fletcher | https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/tests/edge-poly/test.typ | typst | MIT License | #set page(width: auto, height: auto, margin: 1em)
#import "/src/exports.typ" as fletcher: diagram, node, edge
#for radius in (none, 0pt, 10pt) {
diagram(
mark-scale: 150%,
node((0,0), $A$),
edge(">->", vertices: (
(0,0),
(1.1,0),
(1,1),
(3,2),
(4,1),
(1.3,2),
(2,0),
(3,0),
(2,1),
), kind: "poly",
corner-radius: radius,
extrude: (4, 0, -4)
),
node((2,1), $B$),
)
}
#pagebreak()
#for dash in ("dashed", "loosely-dashed", "dotted") {
diagram(
edge(
"r,ddd,r,u,ll,u,rr",
"<->",
corner-radius: 5mm,
stroke: (dash: dash)
)
)
}
#pagebreak()
Dynamic corner radius
#let c = gradient.linear(..color.map.rainbow)
#diagram(
edge-corner-radius: 6pt,
for t in range(13).map(i => i/12) {
let a = t*180deg
edge("r", (rel: (-a, 1)), "->", stroke: c.sample(t*100%))
}
) |
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas3/5_Piatok.typ | typst | #let V = (
"HV": (
("", "Postáviša", "Hóspodi bezstrásten sýj božéstvennym jestestvóm tvojím, strásť preterpíl jesí, po jestestvú čelovíčeskomu tvojemú, na kresťí úbo prihvoždájem, kopijém že iskopovájem v rébra, istočája mňí dví ricí ot ních táinstv neizrečénnych."),
("", "", "Vincém ot térnija ispleténnym uvjázlsja jesí poruhánno carjú vsích, zapreščénije Spáse, ternóvnaho hrichá isterzája: rukáma že tvojíma trósť prijém, v hórňij knízi napisál jesí vsích nás: v ťá vírovavšich."),
("", "", "Nikákože prestá jevréjov závisť neprávednaja, nižé raspénšich ťá nezlóbive, nižé uméršu tí Christé: no i táko okletáchu, jákože lestcá, u Piláta ľútiji prosíša streščí hrób tvój. o hňíva neiscíľnaho!"),
("", "", "Jehdá iz tvojehó čréva vozsijávšaho, na kresťí zachoďášča víďivši sólnca nezachodímaho, sólnca zarjú soderžáščaho, vozopíla jesí oťahčénoju dušéju ťmóju pečálej, vóleju zašéd, i páki vozsijáv, v mojé prosviščénije, i mírovi."),
("", "", "Vladýčice róždšaja hrjadúščaho živým že i mértvym sudíti, umerščvlénuju mojú dúšu boľízniju, pokajánijem oživí, i božéstvennoju króviju iz rébr Sýna tvojehó istékšeju: i živým jehó zápovidem ďílateľa javí mja."),
("", "", "Jehdá ťa čádo neboľíznenno raždách, áhnica i Máti hlahólaše: skórbi izbižách i pečálej mhlý: no nýňi ťá vozdvížena na kresťí zrjášči, utróbo mojá, hórkimi strilámi sérdce oblaháju, i pečáliju bezmírnoju pohružájusja Vladýko."),
("Krestobohoródičen", "", "Mír pomílovan býsť Slóve, raspjátijem tvojím, tvár prosvitísja, jazýcy spasénije obritóša, Vladýko, vopijáše prečístaja: áz že nýňi rasterzájusja, zrjášči tvojú vóľnuju strásť."),
),
"S": (
("", "", "Krestú tvojemú poklaňájemsja, Christé, čestnómu, chraníteľu míra, spaséniju nás hríšnych, velíkomu očiščéniju, pochvaľí vsejá vselénnyja."),
("", "", "Krestoobrázno Moiséj na horí rúci rasprostér k vysoťí, Amalíka pobiždáše. Tý že Spáse, dláni rasprostér na kresťí čestňím, objém mjá spásl jesí ot rabóty vrážija: i dál mí jesí známenije životá bižáti ot lúka soprotívnych mí. Sehó rádi Slóve, poklaňájusja krestú tvojemú čestnómu."),
("", "", "Vélija krestá tvojehó Hóspodi síla: vodruzísja bo na mísťi, i ďíjstvujet v míri, i pokazá ot rýbarej apóstoly, i ot jazýk múčenki, da móľatsja o dušách nášich."),
("Krestobohoródičen", "", "Zrjášči ťá vseneporóčnaja vozdvížena na drévo, Christé mój preblahíj, pláčušči vopijáše Máterski: Sýne mój vseľubéznyj! Káko sónm bezzakónnyj na kresťí ťa vozdvíže?"),
),
)
#let P = (
"1": (
("", "", "Vódy drévle, mánijem božéstvennym, vo jedíno sónmišče sovokupívyj, i razďilívyj móre Izráiľteskim ľúdem, séj Bóh náš, preproslávlen jésť: tomú jedínomu poím, jáko proslávisja."),
("", "", "Prisínnuju ťá hóru, júže províďi Dúchom Avvakúm prorók, moľú, prečístaja osiníti mjá strasťmí oznojénaho, i ot síni smértnyja ľútych bíd izbávitisja."),
("", "", "Okroplénijem božéstvennyja króve, izlijánnyja ot božéstvennych rébr čístaja, Sýna tvojehó, mojehó sérdca omýj rány, jáko da veličáju ťá, i po dólhu slávľu prisnoblažénnuju i preneporóčnuju."),
("", "", "Ravnoďíteľnoje Otcú rodilá jesí Slóvo, obožívšeje čelovíkov suščestvó: tohó molí, nedoumínnaho mjá i iznemóhšaho vrážijimi kovárstvy, božéstvennyja uťíchi spodóbiti čístaja."),
("", "", "Očiščénije mí podážď prehrišénij božéstvennymi tvojími molítvami Ďívo, síľnuju bo ímaši molítvu Vladýčice: i tebé pojúščyja izbávi ot prehrišénij, i strastéj, i skorbéj, i obstojánija"),
),
"3": (
("", "", "Íže ot ne súščich vsjá privedýj, slóvom sozidájemaja, soveršájemaja Dúchom, vsederžíteľu výšnij, v ľubví tvojéj utverdí mené."),
("", "", "V mílosti neizrečénnaho, i v ščedrótach súšča bohátaho, mílostiva súšči prečístaja pomolí uščédriti ný ozlóblenyja."),
("", "", "Chrám súšči vsjáčeskich tvorcá, pomolísja vselítisja v mjá Uťíšiteľu, bývša mjá vertép dušetľínnych razbójnikov, čístaja Ďívo."),
("", "", "Mánijem vsjá nosjáščaho bóžeski, na rukú jáko nosíla jesí Bohoródice, prízri na mjá, i izbávi mjá, jéže k strastém zrínija nepodóbnaho."),
("", "", "Milosérdije mílosti tvojejá moľú, otvérzi mí Bohoródice prečístaja, i téplaja mí javísja v napástech pomóščnica i spasénije."),
),
"4": (
("", "", "Položíl jesí k nám tvérduju ľubóv Hóspodi, jedinoródnaho bo tvojehó Sýna za ný na smérť dál jesí. Ťímže tí zovém blahodarjášče: sláva síľi tvojéj Hóspodi."),
("", "", "<NAME> i zakolénije, vóleju jáko Bóh preterpívyj, uránenuju mojú dúšu razbójmi bisóvskich ozloblénij, molítvami tebé róždšija iscilí, jedíne mnohomílostive."),
("", "", "Ďílo tvojéju rukú ziždíteľu jésm i tvorénije: zlóba že zmijína slasťmí žitijá sokruší mja. Ťímže Christé obnoví mja, tebé róždšija Slóve moľbámi."),
("", "", "Slóvo Ótčeje páče slóva rodilá jesí, rišáščeje vsjákaho bezslovésija čelovíki: jehóže priľížno molí, bezslovésnymi mjá slasťmí poraboščénna svobodíti, jedína prisnoďívo."),
("", "", "Iscilénije nám ot dláni tóčiši vsehdá, vseosvjáščénnaja síne, vsjá svíta súšči ispólnena, vsím istočájušči míro blahovónno, vsečístaja Bohonevísto."),
),
"5": (
("", "", "Jáko víďi Isáia obrázno na prestóľi prevozneséna Bóha, ot ánhel slávy dorinosíma, o okajánnyj, vopijáše áz: províďich bo voploščájema Bóha, svíta nevečérňa, i mírom vladýčestvujušča."),
("", "", "Plóti mojejá boľízni, i dušévnuju mí pečáľ pretvorí i unýnija óblaki otžení Ďívo, svíta óblače, i zdrávije i boľíznej preminénije dážď mí pojúščemu, i ľubóviju ťá slávjaščemu."),
("", "", "Ťá chodátaicu, i molítvennicu, ko iz tebé róždšemusja nýňi predlaháju, vsjákaho hrichá ispólnen sýj: Ďívo, búdi mí žitijá ispravlénije, i nastávnica k stezí božéstvennaho rázuma."),
("", "", "Osvjatí úm mój Ďívo, i dúšu prosvití, i božéstvennyja slávy pričástnika sotvorí: sé bo zól napólnichsja, i vsjákimi porabótichsja slasťmí, i oskvernénu prinošú sóvisť."),
("", "", "Vinohrád božéstvennyj, jáže krásnyj hrózd vozrastívšaja, íže dušám dajúščij pitijé nezavístnoje: Ďívo svjatája otrokovíce, tý mja napój sládosti jehó i slastéj pijánstvo otimí, i spasí mja."),
),
"6": (
("", "", "Íže v koncý vikóv došédšyja čelovikoľúbče, i trevolnéňmi napástej pohíbnuti bídstvujuščyja, vopijúščyja ne prézri: spasí Spáse, jákože spásl jesí ot zvírja proróka."),
("", "", "Fariséja voznesénaho umóm prevzydóch voznošájem prísno, i própastem sojediníchsja bezmírnych prehrišénij: smirívšahosja ľúťi, jedína čístaja, izbávi i uščédri mjá."),
("", "", "Íže prečúdnoje začátije imívši i roždestvó, tvojá mílosti na mňí okajánňim nýňi udiví: íbo v bezzakónijich začáchsja, i rodíchsja, i slasťmí porabotíchsja."),
("", "", "Rydáju, i pláču, i steňú, jehdá sudíšče strášnoje vospomjanú: lukávaja bo ďilá sťažách: no tý mi neiskusomúžnaja Ďívo Máti Bóžija, v čás strášnyj predstáni."),
("", "", "Razumíti i hlahólati ne móžet vsják úm, Ďívo čístaja, soďíjannoje na tebí čúdo stránnoje i preslávnoje: káko rodilá jesí, i prebyváješi páki čístá? Bóh jésť roždéjsja po suščestvú."),
),
"S": (
("", "", "Neiskusobráčnaja čístaja Máti tvojá Christé, zrjášči ťá mértva povíšena na drévi, máterski rydájušči, hlahólaše: čtó tí vozdadé jevréjskij bezzakónnyj sobór i bezblahodátnyj, íže mnóhich i velíkich tvojích daróv nasladívyjsja Sýne mój? Pojú tvojé božéstvennoje snítije."),
),
"7": (
("", "", "Trijé ótrocy v peščí Tróicu proobrazívše, preščénije óhnennoje popráša, i pojúšče vopijáchu: blahoslovén jesí Bóže otéc nášich."),
("", "", "Ot ďíl spasénija ňísť mí Vladýčice, hrichí bo prilaháju ko hrichóm, i k zlóbi zlóbu: molítvoju úbo tvojéju čístaja, predvarí i spasí mja."),
("", "", "Súd pri dvérich, i sudíšče hotóvo, hotóvisja smirénnaja dušé, i vozopíj: jehdá súdiši mí Slóve, ne osudí mené, molítvami róždšija ťá."),
("", "", "Objém hrichóvnyja plodý, umertvíchsja, i prinošáju dúšu neplódnu, i zovú ti prečístaja: plodonósna mjá pokaží, jáže plodóm tvojím tľú potrébľšaja."),
("", "", "O stránnaho táinstva! o užásnaho rázuma! Káko Bóh na zemlí javísja jáko čelovík? Jáko vísť, jáko chóščet, jáko blahovolít, i ďíjstvujet, jákože i chóščet."),
),
"8": (
("", "", "Nesterpímomu ohňú sojedinívšesja, Bohočéstija predstojášče júnoši, plámenem že nevreždéni, božéstvennuju písň pojáchu: blahoslovíte vsjá ďilá Hospódňa Hóspoda, i prevoznosíte vo vsjá víki."),
("", "", "Vsjá jáko dobrá, jáko blížňaja vsích carjú bývši Bohoródice, napólni mjá bláhích ďíl v zlóbi požívšaho, i v ľínosti vsé žitijé skončávšaho, jáko da ťá slávľu vo vsjá víki."),
("", "", "Kítovy utróby, jákože izbávil jesí drévle proróka preslávno, Bóžij Slóve: táko izbávi Spáse nýňi dúšu mojú popólzšujusja vo hlubinú pohíbeli, imíja moľáščuju ťá, neiskusobráčno róždšuju ťá Ďívu."),
("", "", "Krásnoju odéždeju oblečéna, obrítše mjá zlóby ďílateli, i sejá sovlekóša mjá: no samá mja Bohorodíteľnice Ďívo, božéstvennymi odéždami ujasní pokajánijem, molítvami tvojími Bohoródice."),
("", "", "Tóže trepéščet vsjáko sozdánije, sehó čístaja na rukú imíla jesí, za milosérdije nás rádi mladénca bývša, sehó molí spastí vsjá víroju zovúščyja: ťá prevoznósim prečístaja vo vsjá víki."),
),
"9": (
("", "", "V zakóňi síni i pisánij, óbraz vídim vírniji, vsják múžeskij pól ložesná razverzája, svját Bóhu: ťím pervoroždénnoje Slóvo, Otcá beznačáľna, Sýna pervoroďáščasja Máteriju neiskusomúžno, veličájem."),
("", "", "Istľívša umóm, i dušéju, i sóvisť zlóboju oskvernívša, i náha vsích bláhích jávľšahosja, Ďívo netľínnaja, neporóčnaja, ne prézri mené, no ďíly blahočéstija ukrasí."),
("", "", "Napólnichsja zól, napólnichsja pomyšlénij otčuždájuščich mjá ot tebé čelovikoľúbca, sehó rádi steňú i vopijú: kájuščasja prijimí mja, i ne otríni mené tebé róždšija moľbámi, blahodáteľu mnohomílostive."),
("", "", "Da izbávľusja tvojími molítvami vseneporóčnaja otrokovíce ot vsjákaho hňíva, i strastéj smertonósnych ľútaho hejénskaho ohňá, ot čelovík neprávednych, i ot vráh zlých, pribihíj v króv tvój, i zovýj ťá na pómošč."),
("", "", "Krasnú dušéju, krasnú pomyšléňmi, krasnú ťílom, obrít ťá prekrásnyj, ot črésl tvojích ďivíčeskich voplotísja, jákože vísť, bezobrázije náše ukrašája Ďívo, jehóže molí spastísja nám."),
),
)
#let U = (
"S1": (
("", "", "Krest vodruzísja na zemlí, i kosnúsja nebesé, ne jáko drévu dosjáhšu vysotú, no tebí na ném, ispolňájuščemu vsjáčeskaja: sláva tebi."),
("", "", "Krest i smérť postradáti izvólivyj, posreďí tvárej sijá preterpíl jesí, jehdá blahoizvólil jesí Spáse, ťílo tvojé prihvozdíti, tohdá i sólnce lučý skrý: tohdá i razbójnik sijá zrjá, na kresťí ťa vospít, vopijá blahohovíjno: pomjaní mja Hóspodi: i vírovav, priját ráj."),
("Krestobohoródičen", "", "Neskvérnaja áhnica Slóva, netľínnaja Ďíva Máti, na kresťí zrjášči povíšena iz nejá bez boľízni prozjábšaho, máterski podóbno rydájušči, vopijáše: uvý mňí čádo mojé, káko stráždeši vóleju, choťá izbáviti ot strastéj bezčéstija čelovíka?"),
),
"S2": (
("", "", "Na kiparísi, i pévki, i kédri, voznéslsja jesí Áhnče Bóžij: da spaséši íže víroju poklaňájuščyjasja vóľnomu tvojemú raspjátiju. Christé Bóže, sláva tebí."),
("", "", "Neizčétňij vlásti tvojéj, i vóľnomu tvojemú raspjátiju, ánheľskaja vójinstva divľáchusja zrjášče, káko íže nevídimyj plótiju rány priját, choťá izbáviti ot istľínija čelovíčestvo? Ťímže jáko blahodáteľu vopijém tí: sláva, Christé, blahoutróbiju tvojemú."),
("", "", "Blahodúšstvennoje terpínija vášeho pobidí kózni zlonačáľnaho vrahá, múčenicy prechváľniji: sehó rádi víčnaho spodóbistesja blažénstva. No molítesja Hóspodevi, Christoľubívych ľudéj spastí stádo, sviďíteľije súšče ístiny."),
("Krestobohoródičen", "", "Ponósnuju, ščédre, smérť v raspjátiji vóleju preterpíl jesí: tebí že róždšaja Christé, zrjášči ujazvľášesja: jejáže moľbámi za milosérdije mílosti tvojejá, jedíne preblahíj čelovikoľúbče Hóspodi, uščédri i spasí mír, vzémľaj míra hrichí."),
),
"S3": (
("", "", "Krest preterpíl jesí bezhríšne, kľátvy sosúd, za milosérdije neizrečénnoje: pervozdánnaho pérvyja kľátvy svobodíl jesí. Ťímže tvojím čestným poklaňájemsja strastém, smotrénije tvojé svjatóje slávjašče: jéže jedín za milosérdije mílosti ispólniv, sozdánije tvojé spásl jesí."),
("", "", "V lanítu udáren býv za ród čelovíčeskij, i ne razhňívalsja jesí: svobodí iz istľínija živót náš Hóspodi, i pomíluj nás jáko čelovikoľúbec."),
("Krestobohoródičen", "", "Žézl síly sťažávšiji krest Sýna tvojehó Bohoródice, ťím nizlahájem vrahóv šatánija, ľubóviju ťá neprestánno veličájušče."),
),
"K": (
"P1": (
"1": (
("", "", "Súšu hluborodíteľnuju zémľu sólnce našéstvova inohdá, jáko sťiná bo ohusťí obapóly vodá, ľúdem pišomorechoďáščym, i Bohouhódno pojúščym: pojím Hóspodevi, slávno bo proslávisja."),
("", "", "Vólny morskíja žezlóm ohustív, i provél jesí ľúdi, proobrazúja krest tvój, ímže ssíkl jesí vódu léstnuju, i k zemlí ščédre, Bohorazúmija spásl jesí vsích, víroju pojúščich tvojú sílu."),
("", "", "Bézdnu sotvorívyj poveľínijem, íže vodámi prevýsprenňaja síľne pokryvájaj, i íže na vodách zémľu povísivyj, vísiši na drévi, i kolébleši vsjú tvár mánijem: vsích že serdcá utverždáješi v strási tvojém."),
("Múčeničen", "", "Sýnove pričástijem byvájete božéstvenniji múčenicy Christóvy, i žítelije výšnaho Sijóna i nasľídnicy, v némže i vincý nosjášče vzyvájete svítlo: pojím Hóspodevi, slávno bo proslávisja."),
("Múčeničen", "", "Rúk otsičénija i nóh podjáste múčenicy, i strúžemi ľúťi, i ohňú primišájuščesja, ne otverhóstesja otňúd Christá Bóha súšča vsích, no tépľi vopijáste: pojím Hóspodevi, slávno bo proslávisja."),
("Bohoródičen", "", "Predóbraja i Ďívo Vladýčice, jehóže rodilá jesí Sýna, zrjášči na drévi vozdvížena vóleju, pláčušči vosklicála jesí, vopijúšči boľíznenno: Bóže vsích blahoutróbne, Hospóď sýj slávy, káko sijá stráždeši Vladýko?"),
),
"2": (
("", "", "Vódy drévle, mánijem božéstvennym, vo jedíno sónmišče sovokupívyj, i razďilívyj móre Izráiľteskim ľúdem, séj Bóh náš, preproslávlen jésť: tomú jedínomu poím, jáko proslávisja."),
("", "", "Očiščénije mí podážď prehrišénij, božéstvennymi tvojími moľbámi Ďívo: síľnu bo ímaši molítvu prečístaja, i tebé čtúščyja izbavľáješi ot sohrišénij, i strastéj, i skorbéj, i obstojánij."),
("", "", "Vodámi molítv tvojích Ďívo, istájavšuju znójem bezmírnych mojích sohrišénij i strastéj, orosí dúšu mojú smirénnuju: jáko da prochlaždénije božéstvenno ulučív, písňmi ťá veličáju, jáko predstáteľnicu tépluju."),
("", "", "Vsehó pohružájema hrichmí i vsehó otčájanna mjá súšča, tý čístaja Vladýčice, milosérdija tvojehó rúku prostérši, k pokajánija mjá vysoťí privlecý, podajúšči mí istóčnik sléz."),
("", "", "Razderí prečístaja, hrichóvnoje rukopisánije mojích prehrišénij tvojími molítvami, jáko imúšči k Sýnu tvojemú derznovénije za ný molíti priľížno: ťá bo jedínu ímamy christijáne zastúpnicu."),
),
),
"P3": (
"1": (
("", "", "Utverždénije na ťá naďíjuščichsja, utverdí Hóspodi cérkov, íže sťažál jesí čestnóju tvojéju króviju."),
("", "", "Jedín složén nosjá sostáv Slóve, preterpíl jesí raspjátije bezčéstňijšeje: čtúščyja ťá čésti spodóbi súščija."),
("", "", "Razrišéni býša zemnoródniji ot kľátvy, kľátvi tebí Vladýko bývšu, i krestóm blahoslovénije istočívšemu."),
("Múčeničen", "", "Prišélcy vo vsjú zémľu bývše, i nebésniji voístinnu hráždane javístesja, i Christú snasľídnicy vsechváľniji."),
("Múčeničen", "", "Kripčájšeje orúžije, krest sťažávše múčenicy, vsjú sílu hubíteľa vrahá do koncá pobidíša."),
("Bohoródičen", "", "Tý sobľulásja jesí i po roždeství Ďíva, jáže Bóha čístaja róždši voploščéna, na kresťí prihvóždšasja choťínijem."),
),
"2": (
("", "", "Íže ot ne súščich vsjá privedýj slóvom sozidájemaja, soveršájemaja Dúchom vsederžíteľu výšnij, v ľubví tvojéj utverdí mené."),
("", "", "Blahoutróbija milosérdija tvojehó, moľúsja, otvérzi mí vskóri Bohoródice prečístaja, i téplaja mňí javísja vo iskušénijich pomóščnica, i spasénije."),
("", "", "Izbávi mjá ot vsjákija soderžáščija ľútyja hrichóvnyja búri, rabá tvojehó prečístaja, i ko spasíteľnomu mjá pristánišču naprávi, molítvami tvojími."),
("", "", "Spasí mja Máti Ďívo čístaja, ot strastéj mojích mútnych slijánij, i obchoďáščich nýňi smirénnuju mojú dúšu, i oskorbľájuščich."),
("", "", "Sléz túču podážď mí blahája, i sími uhasí strastéj mojích péšč, i vsjákija omýj dušévnyja mojá skvérny Bohoródice."),
),
),
"P4": (
"1": (
("", "", "Pokrýla jésť nebesá dobroďíteľ tvojá Christé, iz kivóta bo prošéd svjatýni tvojejá netľínnyja Mátere: v chrámi slávy tvojejá javílsja jesí jáko mladénec rukonosím, i ispólnišasja vsjá tvojehó chvalénija."),
("", "", "Padénije Adámovo jedín vozdvíhl jesí Christé, nóv býv Adám, na kresťí rúci prihvoždéj, tróstiju že bijén choťá, i ócta i žélči vkušája, prevoznošájemyj vysotóju cárstvija tvojehó."),
("", "", "Jáko ovčá na zakolénije ťá prorók predzrít, i jáko áhnca Slóve Bóžij, ne protívjaščasja otňúd, nižé vopijúšča: íbo choťínijem preterpíl jesí raspjátisja, jáko da íže vóleju sohrišívšyja izbáviši, i spaséši milosérde Hóspodi."),
("Múčeničen", "", "Obnóvľše dúšy rálom víry, múčenicy Christóvy, símja terpínijem múk vsíjaša, i klás mučénija hobzújuščij objáša, vírnych sostavlénija pitájušč. Ťímže prísno slávimi súť."),
("Múčeničen", "", "Uťisňájemi stužénijem nesterpímych ľút, čájanijem krásnych, k prostránstvu výšňaho cárstvija jávi múčenicy dostihóša, jáko da razširját náša ustá, ťích neprestánno píti borénija."),
("Bohoródičen", "", "Jáže úhľ božéstvennyj prijémši, jákože kleščá, ne opaľájušč otňúd, orošájušč že páče, Máti Ďívo, bezsímennuju i božéstvennuju utróbu tvojú: jehóže víďašči plótiju povíšena vóleju na dréve, písňmi slávľaše."),
),
"2": (
("", "", "Položíl jesí k nám tvérduju ľubóv Hóspodi, jedinoródnaho bo tvojehó Sýna za ný na smérť dál jesí. Ťímže tí zovém blahodarjášče: sláva síľi tvojéj Hóspodi."),
("", "", "Vsjú na ťá nadéždu vozložích Vladýčice, moľúsja pripádaja ot duší: smertonósnyja izbávi boľízni, k žízni spasénija vozvoďášči mjá, jáže žízň róždšaja."),
("", "", "Vladýčice čístaja, krípkaja míru pomóščnica, ne otvérži mené ot sebé, nižé posrámlena otsléši mjá ot licá tvojehó, nižé bisóm pokaží mja obrádovanije."),
("", "", "Vés obnažén bých okajánnyj božéstvennych ďíl, i ujazvíchsja slastéj óstrymi strilámi, i ostruplén bých. Ťímže vopijú ti Vladýčice: spasí mja prečístaja."),
("", "", "Prijidóša čístaja, bezmístnych ďijánij vódy do okajánnyja mojejá duší, i pómysly brénnymi oderžím, vopijú ti s boľízniju: ne prézri Vladýčice rabá tvojehó."),
),
),
"P5": (
"1": (
("", "", "Jáko víďi Isáia obrázno na prestóľi prevozneséna Bóha, ot ánhel slávy dorinosíma, o okajánnyj, vopijáše, áz: províďich bo voploščájema Bóha, svíta nevečérňa, i mírom vladýčestvujušča."),
("", "", "Upokóil mjá jesí Slóve, pretruždénaho trudóm prehrišénij, prepočivája na dréve Vladýko, i vzját ponošénije mojé, ímiže postradál jesí Iisúse ponošéňmi. Pojú tvojú deržávu i božéstvennaja stradánija."),
("", "", "Vozžéh jákože svíščnik na kresťí plóť tvojú, i poiskál jesí pohíbšuju dráchmu čelovikoľúbče, i vsjá prizyváješi drúhi tvojá síly, na sejá obrítenije: pojém deržávu Christé, cárstvija tvojehó."),
("Múčeničen", "", "Povéržen ľstéc, pri nohách neľstívych strastotérpec Christóvych, mértv zrím jésť i neďíjstven: sámi že neľstívno sopričitájemi súť so ánhely, neizrečénnyja rádosti ispolňájuščesja."),
("Múčeničen", "", "Svjatíji stúdeniju, i ľútymi múkami i skorbmí, i ránami veľmí pomerzájemi, k teploťí preidóša božéstvenňij nebésnaho cárstvija voístinnu, i tépliji predstáteli vírnym prísno javľájutsja."),
("Bohoródičen", "", "Raspinájema na drévi, i rébra kopijém iskopovájema, ot rébr drévle sozdávšaho Jévu, prečístaja Ďívo zrjášči, vopijáše Máterski: káko umiráješi Sýne mój životé bezsmértnyj?"),
),
"2": (
("", "", "Jáko víďi Isáia obrázno na prestóľi prevozneséna Bóha, ot ánhel slávy dorinosíma, o okajánnyj, vopijáše, áz: províďich bo voploščájema Bóha, svíta nevečérňa, i mírom vladýčestvujušča."),
("", "", "Vinohráde božéstvennyj, íže krásnyj hrózd prozjábšaja, i dušám podajúšč pitijé božéstvennoje Ďívo, napojénija hórkaho, i pijánstva strastéj, i slastéj izbávi dúšu mojú, i ohňá víčnaho."),
("", "", "Timínija istórhni mjá hrichóv, prečístaja Bohonevísto, pádšaho v kál strastéj: i strujámi molítv tvojích omývši mjá strastéj skvérn, rízoju spasénija svitovídnoju odeží."),
("", "", "Jáže mírovi mír, i spasénije vsím podávšaja, jáko božéstvennyj mír poróždši Ďívo čístaja, nastojáščuju bráň strastéj duší mojejá i ťíla umirí, stráchom i ľubóviju Spása Christá."),
("", "", "Boľívšuju dúšu mojú hrichmí prečístaja, iscilí tvojím milosérdijem, i spodóbi nastavľájušči mjá tvoríti vo smiréniji Sýna tvojehó poveľínija prísno, jáko da vosprijimú sehó bláhosť."),
),
),
"P6": (
"1": (
("", "", "Vozopí k tebí, víďiv stárec očíma spasénije, jéže ľúdem priíde ot Bóha: Christé, tý Bóh mój."),
("", "", "Vóleju zaklálsja jesí jáko áhnec, sňídiju dréva uméršaho vóleju, páki k žízni Christé vozvoďá."),
("", "", "Na krest vozdvíhlsja jesí, i nizpadésja bisóvskaja prélesť: voznesésja že vírnych mnóžestvo, vospivájušče ťá živodávče."),
("Múčeničen", "", "Bahrjaníceju jáže ot krovéj ispeščréni múčenicy, carjú vsích nýňi predstoját, vincý svítlymi ukrašájemi."),
("Múčeničen", "", "Iscilénije vsím pristupájuščym istočájut móšči svjatých múčenik, i strastéj mnóžestvo potopľájut."),
("Bohoródičen", "", "Razumíti ne móžet úm čelovíčeskij otrokovíce, páče jestestvá roždestvá tvojehó tájnu: páče bo umá Bóha rodilá jesí."),
),
"2": (
("", "", "Bézdna posľídňaja hrichóv obýde mjá, i isčezájet dúch mój: no prostrýj Vladýko vysókuju tvojú mýšcu, jáko Petrá mja upráviteľu spasí."),
("", "", "Izbavlénije prehrišénij podážď jáko blahája, tvojemú rabú prečístaja, tvojehó zastuplénija prosjáščemu s víroju, i búduščaho mjá sudá ischití."),
("", "", "Vladýčice i Máti izbáviteľa, tý predstáni mí v čás ischóda mojehó, isťazájemu mňí ot vozdúšnych duchóv, o jáže nesmýslennoju mýsliju soďíjach."),
("", "", "Okajánen javíchsja vés áz, nečistotámi vsehdá obját: i prozrjá nýňi sozadí nohú mojéju smérť, vzyváju tí Bohoródice, pomozí mi."),
("", "", "Vólny strástnych pomyšlénij, vsehdá mjá smuščájut prečístaja, i lukávych duchóv búrja pohružájet mjá: no utverdí na kámeni bezstrástija."),
),
),
"P7": (
"1": (
("", "", "Tebé vo ohní orosívšaho ótroki Bohoslóvivšyja, i v Ďívu netľínnu vséľšahosja, Bóha Slóva poím, blahočéstno pojúšče: blahoslovén Bóh otéc nášich."),
("", "", "Na kédri voznéslsja jesí, i pévki, i kiparísi Vladýko, ot Tróicy jedín sýj, i voznésl jesí súščyja vo hlubinú mnóhich slastéj vpádšyja: blahoslovén Bóh otéc nášich."),
("", "", "Króviju čéstnóju Hóspodi, tvár očístil jesí ot króve, prinosímyja mérzkim bisóm, i razrušíl jesí žértvy skvérnyja Slóve Bóžij, požérsja jáko nezlóbiv áhnec: sláva deržávi tvojéj."),
("Múčeničen", "", "Stojáchu pred mučíteli, jáko stolpí nepodvížimiji, pokolebájušče prélesť, i utverždájušče vírnych serdcá, stradáľcy pojúšče: blahoslovén jesí Hóspodi Bóže otéc nášich."),
("Múčeničen", "", "Ne opalístesja ohném, ohňá tepľíjšeje proizvolénije sťažávše, strastotérpcy Christóvy vincenóscy, vopijáše: blahoslovén jesí Hóspodi Bóže otéc nášich."),
("Bohoródičen", "", "Začátije nesravnéno, i roždestvó neskazánno imíla jesí čístaja jedína, Vladýku voplóščši plótiju raspénšahosja, jemúže pojúšče vopijém: blahoslovén jesí Hóspodi Bóže otéc nášich."),
),
"2": (
("", "", "Jákože drévle blahočestívyja trí ótroki orosíl jesí v plámeni chaldéjsťim, svítlym Božestvá ohném i nás ozarí: blahoslovén jesí, vzyvájuščyja, Bóže otéc nášich."),
("", "", "Tebí Máteri Bóžiji, čísťij i neporóčňij moľúsja, oskvernénnyj ťílom i dušéju, i okaľánnyj ďijániji nečístymi, i naďíjusja Vladýčice, na mílosť tvojú, tý mja uščédri, prečístaja."),
("", "", "Prehrišénij mojích mnóžestvo, i zlých ispytánije, nedoumínijem mjá prepirájet ziló, i vo otčájanija vlečét hlubinú: prečístaja Vladýčice, spasí mja pohibájuščaho, i ľúťi potopľájema."),
("", "", "Pomíluj blahája smirívšujusja dúšu mojú lukávymi ďijáňmi, i k pokajánija mjá putí nastávi, i tvoríti choťínija tvojehó Sýna isprávi, i ot múki izbávi."),
("", "", "Mnóžestvom ščedrót tvojejá bláhosti, hrichóv nášich mnóžestvo prézri blahája, i blahopreminítelna búdi, nemólčno zovúščym: blahoslovén, prečístaja, plód tvojehó čréva."),
),
),
"P8": (
"1": (
("", "", "Nesterpímomu ohňú sojedinívšesja, Bohočéstija predstojášče júnoši, plámenem že nevreždéni, božéstvennuju písň pojáchu: blahoslovíte vsjá ďilá Hospódňa Hóspoda, i prevoznosíte vo vsjá víki."),
("", "", "Ľúdije nepokoríviji i nerazúmniji, ťá nrávom blahopokórnym voschoťívša raspjátisja, osuždájut umréti: jáko da choťínijem umerščvlénnyja Slóve, oživíši, pojúščyja ťá i prevoznosjáščyja vo víki."),
("", "", "Rasprostér na kresťí dláni, rúci neuderžánno prostértyja ko drévu sňídnomu pervozdánnaho isciľája Vladýko: i zrjášči ťá stráchom sólnce, lučý skryváše, i vsjá tvár pokolebásja."),
("Múčeničen", "", "Lučámi svjaščénnych borénij strují nečéstija, izlijánija bezbóžija izsušíša strastotérpcy, i istóčniki istočíša iscilénij, skvérnu strastéj omyvájuščyja, i vírnych serdcá napajájuščyja bohátno."),
("Múčeničen", "", "Soobrázno čestných strastéj, i božéstvennych zápovidej ispolnítelije strástotérpcy, sohráždane bezplótnym: napisátisja nýňi v výšňim hráďi, Bóha molíte, vás čtúščym vo vsjá víki."),
("Bohoródičen", "", "Rúčku ťá zlatúju i svíščnik, trapézu i žézl, božéstvennuju hóru i óblak, palátu carévu i prestól ohneobrázen, Bohoródicu vsí vírniji imenújem, po roždeství Ďívoju sochránšujusja."),
),
"2": (
("", "", "V plámeň ko otrokóm jevréjskim snizšédšaho, Bóžijeju síloju, i jávľšahosja Hóspoda, svjaščénnicy blahoslovíte, i prevoznosíte vo vsjá víki."),
("", "", "Slastéj hóresť, čúvstva vsjá ťilésnaja prošédši, dúšu mojú bezmístno okaľájet, i v smérť vlečét: Vladýčice míra, búdi mí spasénije."),
("", "", "Na ťá vozložích Vladýčice, sérdce, i dúšu, i ťílo: ne ímam bo inýja nadéždi, rázvi tebé, jéjuže polučú mílosť. Ťímže podážď mí bohátuju tvojú blahodáť."),
("", "", "Zmíj mňí jádom pripolzé, i plotskóju sládostiju okajánnuju dúšu mojú ľúťi umorí: no oživí sijú soprotívnymi ľičbámi, čístaja, tvojími molítvami."),
("", "", "Ľútaja mjá nóšč pokryvájet prehrišénij, svjatája Vladýčice: ne ímam bo sviščí, dúšu prosviščájuščija blahoďijánija jeléjem. Ťímže iz čertóha izrinúchsja výšňaho."),
),
),
"P9": (
"1": (
("", "", "V zakóňi síni i pisánij óbraz vídim vírniji: vsják múžeskij pól ložesná razverzája, svját Bóhu: ťím pervoroždénnoje Slóvo, Otcá beznačáľna, Sýna pervoroďáščasja Máteriju neiskusomúžno, veličájem."),
("", "", "Na kresťí prihvóždsja Iisúse, íže osnovávyj na ničémže vsjú zémľu, uhľíbšaho mjá v káľi hrichóvňim nrávom lukávym, jáko bláh uščédriv Christé, i izvlék, i bezčéstnoju tvojéju smértiju počtíl jesí, mnohomílostive."),
("", "", "Víďin býl jesí Bóh nevídimyj jestestvóm, plótiju vozvyšájem, jáko da ot vrahóv nevídimych izbáviši mír vídimyj, i súščyja nízu, nebésny sotvoríši Christé, slavoslóvjaščyja deržávu velíkija vlásti tvojejá."),
("Múčeničen", "", "Vóinstvo svjaščénnoje, svjatým ánhelom podóbno izbránnoje, ráj, posreďí imýj živótnoje drévo, Christá, Bohokrásnyja cérkve soslóvije čestnóje, vseslávniji strástotérpcy Spásovy javístesja."),
("Múčeničen", "", "Nás na zemlí vás pominájuščich, pominájte svjatíji prestólu Vladýčnemu predstojášče rádostno: i jáže otonúdu zarjámi bohátno svjaščénniji prosviščájte ný, jáko da dolhóv razrišénije priímem."),
("Bohoródičen", "", "Svitíla, tvojé zrjášče Sýne mój raspjátije, zaidósta: i káko jevréjskij sónm ne zájde nevírnyj, predáv ťá na smérť načáľnika žízni? Bohoródica vopijáše. Júže neprestánno veličájem."),
),
"2": (
("", "", "Tebé neopalímuju kupinú, i svjatúju Ďívu, Máter svíta, i Bohoródicu, nadéždu vsích nás, veličájem."),
("", "", "Skvérnu strástnych pomyšlénij mojehó umá očístivši čístaja, bezstrástija svítloju rízoju odeží mja."),
("", "", "Otvérzi mí božéstvennyja vchódy pokajánija Ďívo, vchódy strastéj i slastéj mojích zahraždájušči, i vozbraňájušči síloju tvojéju."),
("", "", "Uslýši hlás stenánija mojehó, i hlás pláča mojehó, Ďívo vseneporóčnaja, i podážď očiščénije i spasénije okajánňij mojéj duší."),
("", "", "Vés otčájachsja okajánnyj, i nedoumíjusja, pomyšľája lukávaja mojá ďijánija: túne uščédri Vladýčice, i spasí mja."),
),
),
),
"ST": (
("", "", "Drévo preslušánija mírovi smérť prozjabé, drévo že krestnoje živót i netľínije. Ťímže tebé mólim raspénšahosja Hóspoda: da známenajetsja na nás svít licá tvojehó."),
("", "", "Závistiju ot píšči izhnán bých, padénijem padóchsja ľútym: no ne prezrív Vladýko, i vosprijém mené rádi jéže po mňí raspjátije tvojé, i spasáješi mjá, i v slávu vvódiši, izbáviteľu mój, sláva tebí."),
("", "", "Svjatých strastotérpec pámjať, prijidíte ľúdije vsí počtím: jáko pozór bývše ánhelom i čelovíkom, pobídy vincý ot Christá prijáša, i móľatsja o dušách nášich."),
("Krestobohoródičen", "", "Zrjášči iz tebé roždénnaho vseneporóčnaja, povíšena na drévi, vosklicáše vopijúšči: sládkoje mojé čádo, hďí tvojá zájde dobróta svitonósnaja, dobró sotvorívšaho ródu čelovíčeskomu?"),
)
)
#let L = (
"B": (
("", "", "Otvérhša Christé zápoviď tvojú, práotca Adáma iz rajá izhnál jesí: razbójnika že ščédre, ispovídavša ťá na kresťí, vóň vselíl jesí, zovúšča: pomjaní mja Spáse vo cárstviji tvojém."),
("", "", "Zrjášči ťá na kresťí sólnca nezachodímaho, pomračí svít sólnce: kámenije raspadésja Vladýko, zemľá pokolebásja vsjá, zavísa že cerkóvnaja razdrásja posreďí, neprávedno stráždušča víďašči ťá Spáse, vsími nedomýslimaho."),
("", "", "Za vsích Iisúse vedén býl jesí na smérť, živých životé: jáko da božéstvennymi tvojími strasťmí, jáže drévneju snédiju umerščvlényja spaséši jáko Bóh, i rajá pokážeši žíteli. Ťímže víroju tvojá strásti nýňi slávim."),
("", "", "Postradávšaho vóleju nás rádi, i ponošénija otjémšaho čelovíkov, strastém upodóbľšesja múčenicy, mnóhich rádi múk nizložíste vrahá, i výšňuju slávu polučíste. Ťímže Bohoľípno slávimi jesté."),
("", "", "Otcú, i Sýnu, i Uťíšiteľnomu Dúchu právomu, vsí vírniji poklonímsja: jedíno načálo, i slávu Bohoľípno pojúšče, blahočéstno pravoslávnym rázumom vozopijím: pomjaní nás vo cárstviji tvojém."),
("", "", "Strásti terpjášča plótiju choťínijem, zrjášči na kresťí svojehó Sýna vseneporóčnaja, smutísja vsjá, i pláčušči vzyváše čístaja: uvý mňí čádo mojé, káko umerščvlén jesí, íže uméršyja ľúťi oživíti choťá?"),
)
) |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/tuhi-booklet-vuw/0.1.0/template/main.typ | typst | Apache License 2.0 | #import "@preview/tuhi-booklet-vuw:0.1.0": course-info, tuhi-booklet-vuw, sentence-case, fmt-email, fmt-person
#let info = json("teas.json")
#let info_school = yaml("info.yaml")
#show: tuhi-booklet-vuw.with(
author: "SPIRIT",
title: "Undergraduate courses",
date: datetime(year: 2024,month: 7, day: 3),
school: "School of Brewing and Steeping",
alternate: "千と千尋の神隠し",
address: "The Tea house",
phone: info_school.spirit_tea_school.phone,
web: info_school.spirit_tea_school.website,
email: info_school.spirit_tea_school.email,
illustration: image("figures/illustration.jpg",width: 100%))
= Teaware & gong fu cha
#lorem(100)
== Major requirements for Tea
<major-requirements>
+ (TEAS 142, 151) or (GAIW 121 and B+ or better in GAIW 122), COFF 142, 145
+ HEAT 241, 242; one of (FIRE 243, 245); 15 further points from (FIRE 201–204, FIRE 201–259, LEAF 205 - 206); 15 further points from (LEAF 200-299, STEM 241, FORK 292, CUPS 261)
+ HEAT 304, 305, 307, 345.
== Entry to 100-level tea courses
<entry-to-100-level-courses>
- #lorem(50)
- #lorem(50)
== Who to contact
<who-to-contact>
#let pc_gf = info_school.at(info_school.cha_gong_fu.ug_coordinator)
#let pc_tw = info_school.at(info_school.teapot_care.ug_coordinator)
All enquiries about undergraduate courses should be directed to the Programme Director:
- For gong fu: #fmt-person(pc_gf) (#fmt-email(pc_gf))
- For teaware: #fmt-person(pc_tw) (#fmt-email(pc_tw))
#pagebreak(weak: true)
// #info
// #info.keys()
== 100-level courses
#course-info(info.teas101)
#course-info(info.teas102)
#course-info(info.teas103)
== 200-level courses
#course-info(info.teas202)
#course-info(info.teas204)
== 300-level courses
#course-info(info.teas301)
#course-info(info.teas302)
#course-info(info.teas305)
== 400-level courses
#course-info(info.teas401)
#course-info(info.teas402)
#course-info(info.teas403)
== 500-level courses
#course-info(info.teas502)
#pagebreak()
#set text(11pt, number-type: "lining",weight: 400,font: "Fira Sans")
= Who to contact
#let info-row(x) = ([#fmt-person(x)], [#x.office], [#x.phone])
== Student Success Team
#grid(columns: (2cm,1fr),
rows: auto,
row-gutter: 9pt,
// [],[],
[Address:], [#info_school.address],
[Phone:] , [#info_school.phone],
[Email: ] , [#info_school.email],
[Website:] , [#info_school.website],
[Hours:] , [#info_school.hours],
)
#lorem(50)
== School Staff contacts
#grid(columns: (1fr,0.5fr, 0.8fr,0.4fr),
column-gutter: 10pt,
rows: auto,
row-gutter: 9pt,
// [Contact],[Name],[Room],[Phone],
[Head of School] , ..info-row(info_school.haku),
[Deputy Head of School (tea)],..info-row(info_school.kamaji),
[Deputy Head of School (pots)],..info-row(info_school.no_face),
[School Manager ], ..info-row(info_school.lin),
[General Enquiries], ..info-row(info_school.yubaaba),
)
== Brewing Enquiries
#grid(columns: (1fr,0.5fr, 0.8fr,0.4fr),
column-gutter: 10pt,
rows: auto,
row-gutter: 9pt,
// [Contact],[Name],[Room],[Phone],
[Undergraduate teaspoon-level], ..info-row(info_school.zeniba),
[Undergraduate teacup-level], ..info-row(info_school.kamaji)
)
|
https://github.com/mariunaise/HDA-Thesis | https://raw.githubusercontent.com/mariunaise/HDA-Thesis/master/graphics/quantizers/s-metric/2_2_find_quantizer.typ | typst | #import "@preview/cetz:0.2.2": canvas, plot, draw, decorations, vector
#let line_style = (stroke: (paint: black, thickness: 2pt))
#let dashed = (stroke: (dash: "dashed"))
#let dashed2 = (stroke: (dash: "dotted"))
#let markings = (stroke: (paint: red, thickness: 2pt), fill: red)
#canvas({
plot.plot(size: (8,6), name: "plot",
x-tick-step: none,
x-ticks: ((3/16, [3/16]), (7/16, [7/16]), (11/16, [11/16]), (15/16, [15/16])),
y-label: $cal(E)(2, 2, tilde(x))$,
x-label: $tilde(x)$,
y-tick-step: none,
y-ticks: ((0.125, [M1]) ,(0.25, [M2]),(0.375, [M1]) ,(0.5, [M2]),(0.625, [M1]) ,(0.75, [M2]),(0.875, [M1]) ,(1, [M2])),
axis-style: "left",
x-min: 0,
x-max: 1,
y-min: 0,
y-max: 1,{
plot.add(((0,0), (0.125, 0.125), (0.25,0.25), (0.375, 0.375),(0.5,0.5), (0.625, 0.625),(0.75,0.75), (0.875, 0.875),(1, 1)), line: "vh", style: line_style)
plot.add-hline(0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, style: dashed)
plot.add-vline(3/16, 7/16, 11/16, 15/16, style: dashed2)
plot.add-anchor("q00", (1/16, 1/8))
plot.add-anchor("h00", (1/16, 0))
plot.add-anchor("q01", (5/16, 3/8))
plot.add-anchor("h01", (5/16, 0))
plot.add-anchor("q10", (9/16, 5/8))
plot.add-anchor("h10", (9/16, 0))
plot.add-anchor("q11", (13/16, 7/8))
plot.add-anchor("h11", (13/16, 0))
})
decorations.brace((-0.9,0.63), (-0.9,1.63), name: "00")
decorations.brace((-0.9,2.13), (-0.9,3.13), name: "01")
decorations.brace((-0.9,3.63), (-0.9,4.63), name: "10")
decorations.brace((-0.9,5.13), (-0.9,6.13), name: "11")
draw.content((v => vector.add(v, (-0.3, 0)), "00.west"), [00])
draw.content((v => vector.add(v, (-0.3, 0)), "01.west"), [01])
draw.content((v => vector.add(v, (-0.3, 0)), "10.west"), [10])
draw.content((v => vector.add(v, (-0.3, 0)), "11.west"), [11])
draw.line("plot.q00", ((), "|-", "plot.h00"), mark: (end: ">"))
draw.line("plot.q01", ((), "|-", "plot.h01"), mark: (end: ">"))
draw.line("plot.q10", ((), "|-", "plot.h10"), mark: (end: ">"))
draw.line("plot.q11", ((), "|-", "plot.h11"), mark: (end: ">"))
})
|
|
https://github.com/binhtran432k/ungrammar-docs | https://raw.githubusercontent.com/binhtran432k/ungrammar-docs/main/contents/literature-review/monaco.typ | typst | #import "/components/glossary.typ": gls
== Monaco Editor
<sec-monaco>
The Monaco Editor, renowned as the foundation of #gls("vscode") (@sec-vscode),
has emerged as a versatile and performant text editing component. While
primarily recognized for its role within the #gls("vscode") ecosystem, the
Monaco Editor offers a standalone solution for embedding code editing
capabilities into web applications @bib-monaco.
To effectively leverage the Monaco Editor for building custom language support,
a solid understanding of its underlying architecture and core concepts is
essential. This paper delves into the intricacies of the Monaco Editor,
exploring its key components, functionalities, and integration possibilities.
By examining the Monaco Editor's capabilities, we aim to establish a foundation
for implementing a robust code playground that showcases the power of our
#gls("lsp") implementation.
=== Models
At the core of the Monaco Editor lies the concept of models. A model represents a virtual document, encapsulating the text content, language information, and edit history. While models can be associated with files on the local file system, they are not strictly tied to physical storage. This flexibility allows the Monaco Editor to handle a wide range of content, including in-memory buffers, remote files, or even generated content.
By abstracting the underlying storage mechanism, models provide a consistent interface for interacting with text content. This approach enables features like undo/redo, diffing, and collaboration to be implemented efficiently. Additionally, models play a crucial role in supporting language-specific features, as they provide the necessary context for syntax highlighting, code completion, and other language-aware functionalities.
=== URIs
Each model within the Monaco Editor is uniquely identified by a #gls("uri", mode: "full"). This mechanism prevents ambiguity and ensures that multiple models can coexist within the editor without conflicts.
By adopting a virtual file system approach, developers can map models to physical files on the local system using #gls("uri", mode: "short")s starting with `file:///`. This convention provides a familiar and intuitive way to represent files within the editor. However, it's essential to note that the Monaco Editor is not restricted to file-based models.
For models that do not have a corresponding file system path, Monaco assigns a generic in-memory #gls("uri") in the format `inmemory://model/<number>`. This allows for the creation of temporary or dynamically generated content without requiring a physical file. The numerical suffix ensures uniqueness and enables tracking of in-memory models.
=== Editors
Editors in the Monaco Editor serve as the visual representation of underlying models. They are responsible for rendering text content, handling user interactions, and managing view state.
Key functions of editors include:
- *Rendering*: Transforming the model's text content into a visually presentable format, incorporating syntax highlighting, code folding, and other formatting elements.
- *User interaction*: Handling keyboard and mouse input, enabling text selection, editing, and navigation.
- *View state management*: Preserving user preferences such as zoom level, line wrapping, and cursor position.
- *Collaboration*: Supporting real-time collaboration features, such as co-editing and conflict resolution.
=== Providers
Providers are essential components of the Monaco Editor that enrich the editing experience by offering intelligent features. These features typically involve interactions with the underlying model and often leverage language server protocols for advanced language support.
==== Types of Providers
*Completion Provider*: Offers suggestions for code completion based on context, including keywords, variable names, and function calls.
*Hover Provider*: Displays additional information or documentation when the cursor hovers over code elements.
*Document Formatting Provider*: Automatically formats code according to defined style guidelines.
*Document Symbol Provider*: Provides an outline of the code structure, including classes, functions, and variables.
*Definition Provider*: Enables navigation to the definition of symbols.
*References Provider*: Finds all references to a specific symbol within the codebase.
*Code Action Provider*: Suggests code improvements or refactoring options.
==== Provider Interactions
Providers often collaborate with language servers to deliver comprehensive language support. For example, a TypeScript language server can provide code completion suggestions based on the analyzed codebase. The Monaco Editor's provider framework then presents these suggestions to the user in an appropriate format.
To ensure accurate and relevant feature delivery, providers typically operate on specific models. By correctly associating models with file #gls("uri", mode: "short")s, providers can access the appropriate language services and provide context-aware features. For instance, a #gls("json") schema provider can determine the applicable schema based on the file #gls("uri"), enabling intelligent code completion and validation for #gls("json") documents.
=== Disposables
The Monaco Editor employs a disposable pattern to manage resources efficiently. Many components, including models, editors, and providers, implement a `dispose()` method. This method is invoked when a component is no longer required, allowing for the release of associated resources.
Key benefits of the disposable pattern:
- *Memory management*: By disposing of unused components, the editor can prevent memory leaks and improve performance.
- *Resource optimization*: Releasing file handles, network connections, and other resources when they are no longer needed.
- *Dependency management*: Ensuring that dependent components are also disposed of to avoid resource leaks.
Examples of disposable objects:
- *Models*: When a model is closed or no longer needed, calling `model.dispose()` releases the associated memory and resources.
- *Editors*: Disposing of an editor removes it from the #gls("dom", mode: "short") and unregisters listeners.
- *Providers*: Disposing of providers stops background tasks and releases any held resources.
By effectively utilizing the `dispose()` method, developers can write clean and efficient Monaco Editor applications that manage resources responsibly.
|
|
https://github.com/sitandr/typst-examples-book | https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/typstonomicon/word_count.md | markdown | MIT License | # Word count
<div class="warning">This chapter is deprecated now. It will be removed soon.</div>
## Recommended solution
Use `wordometr` [package](https://github.com/Jollywatt/typst-wordometer):
```typ
#import "@preview/wordometer:0.1.0": word-count, total-words
#show: word-count
In this document, there are #total-words words all up.
#word-count(total => [
The number of words in this block is #total.words
and there are #total.characters letters.
])
```
## Just count _all_ words in document
```typ
// original author: laurmaedje
#let words = counter("words")
#show regex("\p{L}+"): it => it + words.step()
== A heading
#lorem(50)
=== Strong chapter
#strong(lorem(25))
// it is ignoring comments
#align(right)[(#words.display() words)]
```
## Count only some elements, ignore others
```typ
// original author: jollywatt
#let count-words(it) = {
let fn = repr(it.func())
if fn == "sequence" { it.children.map(count-words).sum() }
else if fn == "text" { it.text.split().len() }
else if fn in ("styled") { count-words(it.child) }
else if fn in ("highlight", "item", "strong", "link") { count-words(it.body) }
else if fn in ("footnote", "heading", "equation") { 0 }
else { 0 }
}
#show: rest => {
let n = count-words(rest)
rest + align(right, [(#n words)])
}
== A heading (shouldn't be counted)
#lorem(50)
=== Strong chapter
#strong(lorem(25)) // counted too!
``` |
https://github.com/5eqn/osa-fp-talk | https://raw.githubusercontent.com/5eqn/osa-fp-talk/main/show.typ | typst | #import "template.typ": *
#show: project.with(
title: "如何用 143 行代码搓出新编程语言?",
authors: (
"5eqn",
),
)
= 前言
#figure(
image("res/tenet.png", width: 80%),
caption: [
《信条》剧照 / 不要试图理解它,要感受它
],
)
#pagebreak()
== 导语
#figure(
image("res/lang.png", width: 80%),
caption: [
?
],
)
#pagebreak()
#figure(
image("res/code.png", width: 80%),
caption: [
!
],
)
#pagebreak()
#figure(
image("res/pi.png", width: 80%),
caption: [
两步
],
)
#pagebreak()
#figure(
image("res/cpp.png", width: 10%),
caption: [
这只是部分代码 #footnote[https://github.com/drmenguin/minilang-interpreter/blob/master/src/parser/parser.cpp]
],
)
#pagebreak()
#figure(
image("res/parser.png", width: 80%),
caption: [
我的程序 #footnote[https://github.com/5eqn/osa-fp-talk/blob/main/defect-lang/src/main/scala/Main.scala]
],
)
#pagebreak()
#figure(
image("res/python.png", width: 50%),
caption: [
keleshev/mini #footnote[https://github.com/keleshev/mini/blob/master/mini.py]
],
)
#pagebreak()
#figure(
image("res/carbon.png", width: 80%),
caption: [
我的程序
],
)
#pagebreak()
= 第一部分 / 横看成岭侧成峰
#figure(
image("res/swap.png", width: 80%),
caption: [
C 语言和函数式编程解决交换问题
],
)
#pagebreak()
== 1 / 4 什么是函数式编程?
#figure(
image("res/group.jpg", width: 50%),
caption: [
FP Talk 群聊
],
)
#pagebreak()
#sect(title: "目标", color: "blue")[
+ 请写一个函数 `isNumeric`,判断一个字符是不是数字。
+ 请写一个函数 `isAlphabetic`,判断一个字符是不是字母。
答案在 GitHub #footnote[https://github.com/5eqn/osa-fp-talk/blob/ab7c09acf7e7ac38242d675984cb2888edccbcb4/defect-lang/src/main/scala/Main.scala#L6-L7],我在 Talk 里也会讲。]
#sect(title: "例题", color: "red")[如何实现 `isAlphabetic`?]
#pagebreak()
== 2 / 4 来点更难的问题
#figure(
image("res/string.png", width: 80%),
caption: [
C 和函数式编程对字符串的不同处理方式
],
)
#pagebreak()
#figure(
image("res/option.png", width: 80%),
caption: [
str.headOption 有两种可能:存在或不存在
],
)
#pagebreak()
#sect(title: "目标", color: "blue")[
+ 实现 `collectWord`,读取一个字符串,返回这个字符串以什么单词开头。
+ 实现 `collectNumber`,读取一个字符串,返回这个字符串以什么数字开头。
]
#sect(title: "例题", color: "red")[如何实现 `collectNumber`?]
#pagebreak()
== 3 / 4 再难一点
#figure(
image("res/recycle.png", width: 80%),
caption: [
你不想这样做
],
)
#pagebreak()
#sect(title: "目标", color: "blue")[
+ 修改 `collectWord`,使其额外返回剩余的字符串。
+ 修改 `collectNumber`,使其额外返回剩余的字符串。
]
#sect(title: "例题", color: "red")[如何修改 `collectNumber`?]
#pagebreak()
== 4 / 4 现实是有失败的
#sect[```c
#include <studio.h>
int mian() {
printf("Hell Word!")
remake 0;
}
```]
#pagebreak()
#figure(
image("res/cases.png", width: 80%),
caption: [
无论成功还是失败,都是结果!
],
)
#pagebreak()
#sect(title: "目标", color: "blue")[
+ 请写一个函数 `word`,提取字符串的第一个单词,单词为空则失败。
+ 请写一个函数 `exactChar(expect)`,判断字符串是否以字符 `expect` 开头。
+ 请写一个函数 `exactString(expect)`,判断字符串是否以字符串 `expect` 开头。
+ 请写一个函数 `number`,读入字符串开头的非负数字,可能有多位。
]
#sect(title: "例题", color: "red")[
如何实现 `exactChar(expect)`?
]
#pagebreak()
= 第二部分:只用 143 行的秘密
#figure(
image("res/reduce.png", width: 80%),
caption: [
提取共同逻辑
],
)
#pagebreak()
== 1 / 4 提取!
#figure(
image("res/term.png", width: 80%),
caption: [
要读入的东西有两种可能:是数字或是变量
],
)
#pagebreak()
#figure(
image("res/map.png", width: 80%),
caption: [
截胡的过程
],
)
#pagebreak()
#figure(
image("res/box.png", width: 80%),
caption: [
`Parser[A]` 封装 `String => Result[A]`
],
)
#pagebreak()
#sect(title: "目标", color: "blue")[
+ 封装 `word`。
+ 封装 `exactChar(exp)`。
+ 封装 `exactString(exp)`。
+ 封装 `number`。
]
#sect(title: "例题", color: "red")[
如何封装 `number`?
]
#pagebreak()
== 2 / 4 截胡
#figure(
image("res/map.png", width: 80%),
caption: [
截胡的过程
],
)
#pagebreak()
#sect(title: "目标", color: "blue")[
+ 实现 `pos`,用于读取一个正数并转化为 `Term.Num`。
+ 实现 `atom`,用于读取一个单词并转化为 `Term.Var`。
]
#sect(title: "例题", color: "red")[
如何实现 `atom`?
]
#pagebreak()
== 3 / 4 第二条命
#figure(
image("res/flatmap.png", width: 80%),
caption: [
第二条命
],
)
#pagebreak()
#sect(title: "目标", color: "blue")[
实现 `neg`,用于读取一个负数并转化为 `Term.Num`。
]
#pagebreak()
== 4 / 4 神说,要有加
#figure(
image("res/for.png", width: 80%),
caption: [
对应关系
],
)
#pagebreak()
#sect(title: "目标:读取以下程序", color: "blue")[
+ `add(x, 1)`,加法,记为 `Term.Add(Term.Var("x"), Term.Num(1))`
+ `if a == b then c else d`,选择分支,记为 `Term.Alt(Term.Var("a"), ...)`
+ `let x = 1 in x`,定义新值,记为 `Term.Let("x", Term.Num(1), Term.Var("x"))`
+ `(x) => add(x, 1)`,创建匿名函数,记为 `Term.Lam("x", Term.Add(...))`
+ `app(f, x)`,函数调用,记为 `Term.App(Term.Var("f"), ...)`
]
#sect(title: "例题", color: "red")[
如何读取“创建匿名函数”?
]
#pagebreak()
= 第三部分 / 搓出编程语言!
#figure(
image("res/defect.jpg", width: 80%),
caption: [
The Defect
],
)
#pagebreak()
== 1 / 2 神说,要有或
#figure(
image("res/alt.png", width: 80%),
caption: [
尝试多条路径读入 `-2`
],
)
#pagebreak()
== 2 / 2 怎么求值?
#figure(
image("res/enum.png", width: 80%),
caption: [
程序的数据结构
],
)
#pagebreak()
== 鸣谢
#columns(3)[
- Anqur
- AntibodyGame
- Clouder
- harpsichord
- launchd
#colbreak()
- N3M0
- Origami404
- San_Cai
- SeparateWings
- SoraShu
#colbreak()
- toaster
- yyx
- zc
- zly
- ...
]
#pagebreak()
#figure(
image("res/osa.jpg", width: 80%),
caption: [
开源技术协会群二维码
],
)
|
|
https://github.com/RaphGL/ElectronicsFromBasics | https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/DC/chap3/3_shock_current_path.typ | typst | Other | #import "../../core/core.typ"
=== Shock Current Path
As we've already learned, electricity requires a complete path (circuit) to continuously flow.
This is why the shock received from static electricity is only a momentary jolt: the flow of electrons is necessarily brief when static charges are equalized between two objects.
Shocks of self-limited duration like this are rarely hazardous.
Without two contact points on the body for current to enter and exit, respectively, there is no hazard of shock.
This is why birds can safely rest on high-voltage power lines without getting shocked: they make contact with the circuit at only one point.
#image("static/3-circuit-1.png")
In order for electrons to flow through a conductor, there must be a voltage present to motivate them. Voltage, as you should recall, is _always relative between two points_.
There is no such thing as voltage "on" or "at" a single point in the circuit, and so the bird contacting a single point in the above circuit has no voltage applied across its body to establish a current through it.
Yes, even though they rest on _two_ feet, both feet are touching the same wire, making them _electrically common_.
Electrically speaking, both of the bird's feet touch the same point, hence there is no voltage between them to motivate current through the bird's body.
This might lend one to believe that its impossible to be shocked by electricity by only touching a single wire.
Like the birds, if we're sure to touch only one wire at a time, we'll be safe, right? Unfortunately, this is not correct.
Unlike birds, people are usually standing on the ground when they contact a "live" wire.
Many times, one side of a power system will be intentionally connected to earth ground, and so the person touching a single wire is actually making contact between two points in the circuit (the wire and earth ground):
#image("static/3-circuit-2.png")
The ground symbol is that set of three horizontal bars of decreasing width located at the lower-left of the circuit shown, and also at the foot of the person being shocked. In real life the power system ground consists of some kind of metallic conductor buried deep in the ground for making maximum contact with the earth. That conductor is electrically connected to an appropriate connection point on the circuit with thick wire. The victim's ground connection is through their feet, which are touching the earth.
A few questions usually arise at this point in the mind of the student:
- If the presence of a ground point in the circuit provides an easy point of contact for someone to get shocked, why have it in the circuit at all? Wouldn't a ground-less circuit be safer?
- The person getting shocked probably isn't bare-footed. If rubber and fabric are insulating materials, then why aren't their shoes protecting them by preventing a circuit from forming?
- How good of a conductor can dirt be? If you can get shocked by current through the earth, why not use the earth as a conductor in our power circuits?
In answer to the first question, the presence of an intentional "grounding" point in an electric circuit is intended to ensure that one side of it is safe to come in contact with. Note that if our victim in the above diagram were to touch the bottom side of the resistor, nothing would happen even though their feet would still be contacting ground:
#image("static/3-circuit-3.png")
Because the bottom side of the circuit is firmly connected to ground through the grounding point on the lower-left of the circuit, the lower conductor of the circuit is made electrically common with earth ground.
Since there can be no voltage between _electrically common_ points, there will be no voltage applied across the person contacting the lower wire, and they will not receive a shock.
For the same reason, the wire connecting the circuit to the grounding rod/plates is usually left bare (no insulation), so that any metal object it brushes up against will similarly be electrically common with the earth.
Circuit grounding ensures that at least one point in the circuit will be safe to touch.
But what about leaving a circuit completely ungrounded? Wouldn't that make any person touching just a single wire as safe as the bird sitting on just one? Ideally, yes.
Practically, no.
Observe what happens with no ground at all:
#image("static/3-circuit-4.png")
Despite the fact that the person's feet are still contacting ground, any single point in the circuit should be safe to touch. Since there is no complete path (circuit) formed through the person's body from the bottom side of the voltage source to the top, there is no way for a current to be established through the person.
However, this could all change with an accidental ground, such as a tree branch touching a power line and providing connection to earth ground:
#image("static/3-circuit-5.png")
Such an accidental connection between a power system conductor and the earth (ground) is called a ground fault.
Ground faults may be caused by many things, including dirt buildup on power line insulators (creating a dirty-water path for current from the conductor to the pole, and to the ground, when it rains), ground water infiltration in buried power line conductors, and birds landing on power lines, bridging the line to the pole with their wings.
Given the many causes of ground faults, they tend to be unpredicatable.
In the case of trees, no one can guarantee which wire their branches might touch.
If a tree were to brush up against the top wire in the circuit, it would make the top wire safe to touch and the bottom one dangerous -- just the opposite of the previous scenario where the tree contacts the bottom wire:
#image("static/3-circuit-6.png")
With a tree branch contacting the top wire, that wire becomes the grounded conductor in the circuit, electrically common with earth ground.
Therefore, there is no voltage between that wire and ground, but full (high) voltage between the bottom wire and ground.
As mentioned previously, tree branches are only one potential source of ground faults in a power system.
Consider an ungrounded power system with no trees in contact, but this time with two people touching single wires:
#image("static/3-circuit-7.png")
With each person standing on the ground, contacting different points in the circuit, a path for shock current is made through one person, through the earth, and through the other person.
Even though each person thinks they're safe in only touching a single point in the circuit, their combined actions create a deadly scenario.
In effect, one person acts as the ground fault which makes it unsafe for the other person.
This is exactly why ungrounded power systems are dangerous: the voltage between any point in the circuit and ground (earth) is unpredictable, because a ground fault could appear at any point in the circuit at any time.
The only character guaranteed to be safe in these scenarios is the bird, who has no connection to earth ground at all! By firmly connecting a designated point in the circuit to earth ground ("grounding" the circuit), at least safety can be assured at that one point.
This is more assurance of safety than having no ground connection at all.
In answer to the second question, rubber-soled shoes do indeed provide some electrical insulation to help protect someone from conducting shock current through their feet.
However, most common shoe designs are not intended to be electrically "safe," their soles being too thin and not of the right substance.
Also, any moisture, dirt, or conductive salts from body sweat on the surface of or permeated through the soles of shoes will compromise what little insulating value the shoe had to begin with.
There are shoes specifically made for dangerous electrical work, as well as thick rubber mats made to stand on while working on live circuits, but these special pieces of gear must be in absolutely clean, dry condition in order to be effective.
Suffice it to say, normal footwear is not enough to guarantee protection against electric shock from a power system.
Research conducted on contact resistance between parts of the human body and points of contact (such as the ground) shows a wide range of figures (see end of chapter for information on the source of this data):
- Hand or foot contact, insulated with rubber: $20 M Omega$ typical.
- Foot contact through leather shoe sole (dry): $100 M Omega$ to $500 k Omega$
- Foot contact through leather shoe sole (wet): $5 k Omega$ to $20 k Omega$
As you can see, not only is rubber a far better insulating material than leather, but the presence of water in a porous substance such as leather _greatly_ reduces electrical resistance.
In answer to the third question, dirt is not a very good conductor (at least not when its dry!).
It is too poor of a conductor to support continuous current for powering a load.
However, as we will see in the next section, it takes very little current to injure or kill a human being, so even the poor conductivity of dirt is enough to provide a path for deadly current when there is sufficient voltage available, as there usually is in power systems.
Some ground surfaces are better insulators than others.
Asphalt, for instance, being oil-based, has a much greater resistance than most forms of dirt or rock.
Concrete, on the other hand, tends to have fairly low resistance due to its intrinsic water and electrolyte (conductive chemical) content.
#core.review[
- Electric shock can only occur when contact is made between two points of a circuit; when voltage is applied across a victim's body.
- Power circuits usually have a designated point that is "grounded:" firmly connected to metal rods or plates buried in the dirt to ensure that one side of the circuit is always at ground potential (zero voltage between that point and earth ground).
- A ground fault is an accidental connection between a circuit conductor and the earth (ground).
- Special, insulated shoes and mats are made to protect persons from shock via ground conduction, but even these pieces of gear must be in clean, dry condition to be effective. Normal footwear is not good enough to provide protection from shock by insulating its wearer from the earth.
- Though dirt is a poor conductor, it can conduct enough current to injure or kill a human being.
]
|
https://github.com/wenzlawski/typst-cv | https://raw.githubusercontent.com/wenzlawski/typst-cv/main/modules/education.typ | typst | Apache License 2.0 | #import "../brilliant-CV/template.typ": *
#cvSection("Education")
#cvEntry(
title: [Bachelors of Science in Computer Science],
society: [University of Manchester],
date: [2020 - 2023],
location: [Manchester, UK],
description: list(
[Thesis: Language Models as Tutors: Grading Argument Quality in Student Argumentative Writing],
[Course: Software Engineering #hBar() Artificial Intelligence #hBar() Machine Learning #hBar() Data Science #hBar() Algorithms and Data Structures]
)
)
#cvEntry(
title: [Cambridge International A Level Certification],
society: [Auckland Grammar School],
date: [2018 - 2020],
location: [Auckland, New Zealand],
description: list(
[Mathematics, Physics, Geography, Economics],
[Awards: 1st in class Mathematics, National Disk Ultimate Team]
)
)
|
https://github.com/kaarmu/typst.vim | https://raw.githubusercontent.com/kaarmu/typst.vim/main/README.md | markdown | MIT License | # typst.vim
*OBS: Work In Progress*
(Neo)vim plugin for [Typst](https://typst.app).
I am applying the 80/20 rule in this project since I prefer to have
something now rather than waiting for everything later.
## Features

*Editing [typst-palette](https://github.com/kaarmu/typst-palette) in Vim with the gruvbox colorscheme*
**Existing**
- Vim syntax highlighting.
- Compile the active document with `:make`.
- Concealing for italic, bold. Can be enabled with `g:typst_conceal`.
- Concealing symbols in math mode. Can be enabled with `g:typst_conceal_math`.
- Emojis! Can be enabled with `g:typst_conceal_emoji`.
- Syntax highlighting of code blocks. See `g:typst_embedded_languages`.
**Possible features**
- Formatting using [this](https://github.com/astrale-sharp/typst-fmt/)?
- Even better highlighting for neovim using treesitter?
Do you miss anything from other packages, e.g. `vimtex`, create an issue
and I'll probably add it! Also feel free to make a PR!
## Installation
### packer.nvim
```lua
require('packer').startup(function(use)
use {'kaarmu/typst.vim', ft = {'typst'}}
end)
```
- Call `:so %` or restart neovim to reload config
- Call `:PackerSync`
### lazy.nvim
```lua
return {
'kaarmu/typst.vim',
ft = 'typst',
lazy=false,
}
```
### vim-plug
```vim
call plug#begin('~/.vim/plugged')
Plug 'kaarmu/typst.vim'
call plug#end()
```
- Restart (neo)vim to reload config
- Call `:PlugInstall`
## Usage
### Options
- `g:typst_syntax_highlight`:
Enable syntax highlighting.
*Default:* `1`
- `g:typst_cmd`:
Specifies the location of the Typst executable.
*Default:* `'typst'`
- `g:typst_pdf_viewer`:
Specifies pdf viewer that `typst watch --open` will use.
*Default:* `''`
- `g:typst_conceal`:
Enable concealment.
*Default:* `0`
- `g:typst_conceal_math`:
Enable concealment for math symbols in math mode (i.e. replaces symbols
with their actual unicode character). **OBS**: this can affect performance,
see issue [#64](https://github.com/kaarmu/typst.vim/issues/64).
*Default:* `g:typst_conceal`
- `g:typst_conceal_emoji`:
Enable concealing emojis, e.g. `#emoji.alien` becomes 👽.
*Default:* `g:typst_conceal`
- `g:typst_auto_close_toc`:
Specifies whether TOC will be automatically closed after using it.
*Default:* `0`
- `g:typst_auto_open_quickfix`:
Specifies whether the quickfix list should automatically open when there are errors from typst.
*Default:* `1`
- `g:typst_embedded_languages`:
A list of languages that will be highlighted in code blocks. Typst is always highlighted.
*Default:* `[]`
### Commands
- `:TypstWatch`:
Watches your document and recompiles on change; also opens the document with your default pdf viewer.
## Tips
If you are using `neovim` you can install [typst-lsp](https://github.com/nvarner/typst-lsp).
There exist a server configuration in `nvim-lspconfig` so it should be easy to set it up. The
config currently requires that you're working in a git repo. Once the neovim+LSP recognizes
the file the LSP will compile your document while you write (almost like a wysiwyg!). By default
it will compile on save but you can set it to compile-on-write as well.
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-sustech-thesis/0.1.0/sections/content.typ | typst | Apache License 2.0 | // #import "../lib.typ": sustech-thesis
#import "@preview/modern-sustech-thesis:0.1.0": sustech-thesis
// #import "@local/modern-sustech-thesis:0.1.0": sustech-thesis
#let indent = h(2em)
#show: sustech-thesis.with(
isCN: true,
information: (
title: (
[第一行],
[第二行],
[第三行],
),
subtitle: [副标题],
abstract-content: (
[#lorem(40)],
[#lorem(40)],
),
keywords: (
[Keyword1],
[关键词2],
[啦啦啦],
[你好]
),
author: [慕青QAQ],
department: [数学系],
major: [数学],
advisor: [木木],
),
bibliography: bibliography(
"refer.bib",
title: [参考文献],
style: "gb-7714-2015-numeric",
),
)
= Ch1. 测试
== 我的 test 1.1
#indent
#lorem(49)
#lorem(40)
= Ch2. 测试
== 我的 test 1.2
#indent
#lorem(20).@wang2010guide
#lorem(20).
=== 我的 test 1.3
// 附录
#pagebreak()
#set heading(numbering: none)
= Appendix
== Appendix A. 一段代码
#lorem(100)
#pagebreak()
== Appendix B. 我的评注
谢谢 |
https://github.com/PhilChodrow/cv | https://raw.githubusercontent.com/PhilChodrow/cv/main/src/content/college-service.typ | typst | #import "../template.typ": *
#cvSection("Institutional Service")
#cvSubSection("Committee Membership")
#cvEntry(
title: [Ad Hoc Committee on Curricular Requirements],
organisation: [Middlebury College],
logo: "",
date: [2024-],
location: [Middlebury, VT]
)
#cvEntry(
title: [Steering Committee of Midd.Data],
organisation: [Middlebury College],
logo: "",
date: [2023-],
location: [Middlebury, VT]
)
|
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/compiler/modules/chap1.typ | typst | Apache License 2.0 | // Ref: false
#let name = "Klaus"
== Chapter 1
#name stood in a field of wheat. There was nothing of particular interest about
the field #name just casually surveyed for any paths on which the corn would not
totally ruin his semi-new outdorsy jacket but then again, most of us spend
considerable time in non-descript environments.
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/042%20-%20Strixhaven%3A%20School%20of%20Mages/004_Episode%203%3A%20Extracurriculars.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Episode 3: Extracurriculars",
set_name: "Strixhaven: School of Mages",
story_date: datetime(day: 07, month: 04, year: 2021),
author: "<NAME>",
doc
)
Looking out the window over his desk, Will could see the winds of autumn stirring fallen leaves across the courtyard. Students in the blue and red of Prismari passed by, laughing and chatting, sipping on hot drinks. When his eyes finally drifted back to the #emph[Ethics of Aetheric Manipulation ] assignment, the questions had yet to complete themselves. He sighed and picked up his pencil again just as the door to his dorm room creaked open. Rowan came in, her hair windblown and disordered, smiling about who-knew-what.
#figure(image("004_Episode 3: Extracurriculars/01.jpg", width: 100%), caption: [Explosive Welcome | Art by: Mathias Kollros], supplement: none, numbering: none)
"Hey," said Will, already annoyed.
"Oh! Hey."
"Where have you been?"
"With Auvernine and Plink," Rowan responded, her smile departing.
"Your Witherbloom friends?"
"That's right." She crossed the room to their closet and dug through it. They shared that closet, of course, but Rowan's half was little better than a bird's nest of assorted garments.
Will stood up from his desk. "Already finished your #emph[Ethics of Aetheric Manipulation] assignment?"
"Yep," said Rowan, tossing out bits and pieces of her winter uniform.
"And you're ready for the end of the week? They say Professor Onyx's exams are notoriously difficult."
Rowan fiddled with a buckle. "Her what?"
"The exam. You know, the one that's in two days?"
"Oh. Right."
Will threw his hands up. "Rowan, you're not taking any of this seriously! It's a privilege for us to be here. Don't you get that?"
She whirled on him, anger clear in her eyes. "Oh, you think I'm just too dumb to understand the #emph[grand significance ] of all this, is that it?"
"Rowan, I didn't say—"
"I think there are plenty of lecturers at Strixhaven without you joining them!"
It wasn't the words or the sudden, surprising anger that made Will step back—it was the coils of electricity jumping between loose strands of hair on his sister's face.
"Rowan," was all he could manage.
He watched her cycle past anger, to confusion, then embarrassment. She scrunched up her features and the sparks faded into nothing.
"Are you okay?" he asked.
"I'm fine," she said bitterly. Before he could say another word, she grabbed the cloak of her winter uniform and stormed out the door.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Two days later, he was no closer to completing Professor Onyx's assignment, despite moving from his room to one of the communal study areas of the Biblioplex. Will slumped down in his chair, kneading his palms into his eyes. "If someone would just turn me into a newt or something it would probably save us all a lot of trouble."
Across the table, Quint looked up from his own reading, his hands folded around a cup of tea, his long snout sniffing with delight at the rising steam. "Is it about the aetheric tether?"
Will nodded weakly. "I hate aether. I hate tethers. I hate the whole idea."
"Tricky concept," agreed Quint. "Have you tried consulting Il-Samar's—"
Will only raised the book he was reading so his friend could see the title.
"#emph[Treatise on Corporeal Manipulation] . Hm."
"Thanks for trying," said Will.
"Well, I'm sure something will come to you," said Quint cheerily.
For a while, the only sound between them was the flipping of pages and the occasional sipping of tea. "Oh my," Quint said, after some time had passed. "This is—wait, I've seen this before." He grabbed another book, flipping until he found the page he wanted, and traced a line of text, comparing the two tomes in front of him. "I knew it! Arthelas the Magnificent and Bairod Horizon-Seeker were the #emph[same person] ."
Will nodded absently, still stuck on Professor Onyx's unsolvable riddle.
Quint let out a breathless laugh. "There's just no mistaking this arcane sigil! This is astounding—it means the histories of the Kingdoms Below have to be rewritten from scratch, or at the very least reordered to account for—oops!"
Will jumped as Quint's tea sloshed from his cup and landed on the books in front of him, splashing across the ancient vellum. His eyes went wide. "What are we going to—? Isabough will have us in Detention Bog for a month!"
"Not if she doesn't see it." Quint set down his teacup next to the stained pages.
"You can't lift it," Will said. "It'll take the ink with it."
"True, but if I call like to like—"
Quint's finger began to glow. He dipped it in his teacup, then touched it to the book. The spilled tea began to rise, small droplets floating from the page to fall back into Quint's cup. He looked up with a grin. "It's one of the spells we use to help us find scattered pieces during our digs."
Quint took another sip of his collected tea as Will chuckled and ran a hand over the pages, finding them smooth and dry to the touch. "Impressive."
Quint only shrugged. "There's always a spell."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Rowan looked around the Bow's End from the table she shared with Auvernine and Plink. She had been meeting the Witherbloom witches there after classes for a week now, and it was quickly becoming one of her favorite places on the campus. She took a sip of the fizzing potion, pleased with the sharp fruity taste.
"Did you hear about the duel yesterday? Dinsley's exam construct was destroyed," Plink said around a bite of food. "That Silverquill mage might as well have just set him on fire. Would have hurt less."
"Not if she did it right," said Rowan, grinning.
"I don't understand why they can't just wait until the Mage Tower match. Prismari, Silverquill—they can blast each other as much as they want, then. All these duels are just pointless posturing," said Auvernine.
The other girls laughed and agreed, but Rowan's smile slipped. A duel sounded like just the thing to blow off some steam. Ever since the deans had broken up the duel she and Will had stumbled into on their first day at Strixhaven, she'd been itching for another chance to let loose. That had been the only worthwhile part of coming here so far—well, that and her friends from Witherbloom. Will, of course, seemed to be having the time of his life.
As if she'd summoned him herself, Will walked through the door. He scanned the room until he met her gaze, then made a beeline for the table. Rowan sighed and slumped over her potion. "Oh, great."
"What?" Plink looked up just as Will made it to the table. "Oh, it's your brother! Hello, Will."
Will nodded to her before turning to Rowan. "Professor Onyx posted the exam scores."
Rowan shrugged. "And?"
"You barely passed, Rowan," Will said, his voice hard. "I thought you said you didn't need any help."
"I passed, didn't I?" Rowan shook her head. "Not that it's any of your business."
"We had weeks to prepare." Will frowned. "You should know this stuff by now. And I could have helped you with the rest, if you hadn't been so busy running around with your friends. Do they even know about how your powers—"
"Outside. Now," said Rowan, interrupting him.
Will shot a glance at the Witherbloom witches, then turned on his heels and stalked toward the door. When she caught up with him, Rowan grabbed her brother's arm. "Where do you get off embarrassing me like that?"
"So they don't know about your magic sparking up any time you get angry." Will shook his head. "Rowan, we're here to learn #emph[better ] control of our powers, not to get worse! And we're definitely not here to just have fun. We're Kenriths! That still means something here."
"Actually, Will, it doesn't," said Rowan. "Nobody here's even #emph[heard ] of Eldraine. I'm not here to represent anybody or anything but myself!"
Will scoffed. "And you say you don't want to be like our birth mother."
Rowan's eyes turned flinty, hard. "What did you say?"
Will could feel the hair on his arms stand up as an electric charge coursed through the air around him. "Calm down," he said carefully. "I didn't mean—"
Rowan took a step toward her brother. "No, Will. Say it again. Tell me how I'm like our mother."
The door of the Bow's End opened, and Auvernine and Plink rushed toward them with wide grins. "We figured out the conversion! We're going to Widdershins to get supplies."
Rowan glanced at them and plastered a friendly smile on her face. "Wait up. I'll come with you."
The Witherbloom witches nodded and fell into a frantic exchange as they headed off. When they were out of earshot, Rowan turned back to Will, the smile gone. "Leave me alone, Will. You can't tell me what to do."
Will grimaced. "I—"
Before he could finish, Rowan pushed past him and went to catch up with her friends.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Despite sharing a room, he barely saw Rowan after that. Every day, by the time Will woke, his sister would already be gone, out to do whatever it was she did besides study. By the time the much-anticipated Mage Tower match between the Prismari and Silverquill teams came along, he hadn't spoken to her in weeks. As the players rushed across the field, whipping the elements into one another's paths, Will found himself wondering how she was doing.
Next to him, Quint gasped and jumped up in his seat. "Unreal! Wickel's using the fourth earth-concept out there, in the middle of all that chaos! He's making it look #emph[easy] !"
Will watched along with Quint as the Prismari player shifted great mounds of dirt and grass in circular formations, shoving them in the way of opponents and intercepting spells. Downfield, a Silverquill player suddenly turned and leapt into the air, an arc of black flame propelling her upward as she caught the floating mascot for her team, a blob-like, shapeshifting inkling. Cheers erupted in the stands around them. Will turned to Quint. "What about that one?"
Quint frowned. "I'm not sure. Maybe a variation on Arnault's Combustion?"
Across the field, another wave of Silverquill spells sent the crowd into a frenzy. Memories of the duel they had witnessed on their first day floated through Will's mind, with thoughts of Rowan inevitably trailing behind them. He'd heard that she'd gotten into a few duels around campus since their fight at Bow's End.
Suddenly, Quint grew tense next to him, leaning forward in his seat.
"No"—Quint sat up even straighter, his eyes glued to the field—"no way is that going to work."
Will followed his gaze to where a Prismari player barreled toward the opposite team, charging right at the player holding the mascot.
All the crowd watched as the Prismari player threw out a hand wreathed in a circle of crimson light. The inkling began to glow, a halo of red light appearing over its shifting black head. Suddenly, it leaned over and sunk two long liquid fangs into the Silverquill player's hand.
"#emph[Ow] !" she yelped, dropping the inkling—just in time for the Prismari player to scoop it up.
The entire arena exploded in cheers.
#figure(image("004_Episode 3: Extracurriculars/02.jpg", width: 100%), caption: [Team Pennant | Art by: <NAME>], supplement: none, numbering: none)
"Mascot interception! Brilliant!" Quint grabbed Will and wrapped him in a hug as they both cheered with the rest of the crowd.
"So he hypnotized it?" said Will, delighted but confused.
"He took control of it altogether. It's a simple trick, you understand—only works on summoned creatures—but wow!"
Will turned, looking at the students and professors and even some villagers in the stands. He took in their excitement, a smile crossing his face—but it wilted as he spotted Rowan across the aisle, staring directly at him.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"Let's get out of here," said Rowan.
"But the game isn't ov—"
Plink grunted as Auvernine elbowed her into silence. She nodded toward the other side of the aisle, and Plink followed her gaze. "Oh."
"You should at least say hello," said Auvernine.
"Oh, should I?"
Plink patted her arm. "He's your brother. That's not something to take for granted."
Rowan scowled, but her resolve crumbled under the attention of both her friends. "Fine."
She sidled past the others seated in her row and stepped into the aisle. A moment later, Will met her there. They both stood there for a moment, awkward, unsure what to say.
"So," said Will. "How are things?"
"You know," said Rowan. "Fine."
"Still hanging out with your Witherbloom friends?" said Will, gesturing behind her.
Rowan's lip stiffened. "That's not a problem, is it?"
"No. Maybe you just chose the wrong college, is all."
"What's that supposed to mean?"
"Well, you clearly have no interest in really learning. And they're nature mages—it's not like they'd care that you can't control your powers."
"I can control them," said Rowan, scowling now. "See me, right now, not blasting you with lightning?"
"Oh, so you didn't brawl enough around campus these last few weeks? Then what exactly have you been doing, because I know 'studying' hasn't made the list!" Will knew better than to needle her like this, but he couldn't help himself—he was angry at her for shutting him out, for leaving him on his own these last few weeks. "If all you wanted to do was fight, I wish you had just stayed on Kylem!"
He didn't mean it, but that didn't matter. He saw, from the strands of hair that began to stand up on Rowan's head, twitching and crackling with energy, that he had gone too far. "Oh, I'll show you what I've been learning."
Will felt the spark jump from her outstretched hand and pass through his whole body in an instant. His muscles jerked and seized, and he pitched over sideways, collapsing.
"You wish I'd stayed on Kylem? Well~I wish you'd stayed #emph[dead] !" yelled Rowan.
"Hey!" he heard Quint shout, somewhere behind him.
Will could barely move his arms—but he could reach out with his other senses. Rowan gasped as a rime of frost suddenly solidified around her boots, freezing her feet in place.
He muttered under his breath, fog puffing around his face. Rowan extended another hand, crackling with energy, but before she could discharge it, a layer of ice condensed around her fist. She cried out from the sudden cold and pain.
"Stop!"
In an instant, the crowd went silent. Rowan glanced toward the students around them, only to see Auvernine and Plink back away. More students moved, clearing a path as a shadow fell over Will. He squinted as he looked up, meeting Professor Onyx's gaze.
"All of you will return to your seats," she said in a commanding voice. "You two, however, are to come with me."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Will and Rowan followed Professor Onyx through the dark halls of one of the Witherbloom buildings. The shadows here were too deep to make out details, but something organic grew from the joined stone of the hallway, and a scent somewhere between floral and rot surrounded them on all sides.
By all accounts, you didn't want to end up on the wrong side of Professor Onyx. All sorts of horror stories about her passed through the Prismari dorms, and while Will didn't think it was #emph[likely ] that they'd end up incubators for some carnivorous undead fungus, he wasn't ready to completely rule it out. Worse, what if they got kicked out?
They followed her into her office. With a gesture, Professor Onyx ignited a few candles, which burned with purple flame. "What was all of that about?"
#figure(image("004_Episode 3: Extracurriculars/03.jpg", width: 100%), caption: [Professor's Warning | Art by: <NAME>], supplement: none, numbering: none)
"Nothing," Rowan said, taking a casual tone. "Just two siblings blowing off steam."
"Last I checked, tossing around bolts of lightning is more than ordinary sibling rivalry," said the professor. She glared at Rowan. "Strife between brother and sister is a special kind of pain. And it takes a special kind of fool to foment it."
Will saw Rowan bristle at the insult. He cleared his throat. "It's my fault. I started the fight."
He felt Rowan's eyes on him but kept his gaze forward.
Professor Onyx looked between them, then shook her head. She sat down in her chair. For a moment, Will could have sworn she looked very tired. "There are those who wish this place—and all who call it home—great harm. If we're fighting amongst ourselves, they'll find that task far easier."
"Professor," said Will. "Who exactly are you talking about?"
She regarded him for a moment, holding him with those violet eyes. "Have you heard of the Oriq?"
"Losers who couldn't pass the entrance exam," said Rowan, before Will could answer. "Or who flunked out. Right?"
Professor Onyx chuckled, but it sounded far from happy to Will. "That's one way to put it. But underestimating them would be foolish. For all we might think otherwise, Strixhaven doesn't have a monopoly on power in this plane."
That made Will sit straight up in his seat. #emph[This plane? Then Professor Onyx is] ~
But all she did was smile.
Rowan must have missed it. She was still chewing over the comment about the Oriq. "But if they were actually planning some sort of attack, the professors would do something about it. Wouldn't they?"
"Maybe," said Professor Onyx. "And maybe not. The question to consider is: what would #emph[you] do about it?"
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The fresh air hit Will's lungs, cold and clear, as he followed Rowan out of the Witherbloom building. His sister was already halfway down the path, headed for the cafe. "Later."
"What? Didn't you hear what the professor just said? We have to do something!"
"Like what?" Rowan asked, turning back. "It's their college. Let them deal with it."
Will shook his head. "What if that's not enough? There are only so many professors here, Rowan. And we can't rely on them to be able to defend us all. There has to be a way that we can protect ourselves—protect the other students."
"For the last time, Will, this isn't Eldraine. We're not royalty here. We can't just," she waved her hands, "order problems away!"
"Being royalty didn't stop us from nearly being killed back home, either." Will shook his head. "At least here we have the Biblioplex. All that knowledge—there has to be something that will help us. I don't want to be helpless again."
Will didn't miss the shudder that went over Rowan. She squared her shoulders and clenched her jaw. She must have been remembering Oko and their father. Even now, it wasn't something that either of them could completely forget.
Rowan looked back at him, over her shoulder. "You dig through all the old books you want, Will. I'll prepare my own way for whatever's coming."
Will sighed as Rowan turned on her heels and left. #emph[On my own, then. Again.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kasmina sat still among the trees outside campus as her owl showed her a small courtyard just outside the Biblioplex. Below, she could see the Kenrith girl sending forked lightning across the lawn. Nearby, two Witherbloom students watched. One applauded; the other said something she couldn't make out.
The vision of the courtyard blurred at the edges, fading into a vastly different landscape. Kasmina switched her focus to a different owl. The twins disappeared as shadows and red stone filled her vision instead.
She watched as Lukka stood with a masked Oriq agent. The agent shifted, pulling something from beneath their cloak and holding it out to the planeswalker. Kasmina's owl turned its head to get a better view.
It was a silver mask, shaped like a human skull.
Lukka shook his head. His face shifted, his skin darkening, and his ears stretching to points as he took on the markings of his fox companion. He watched the Oriq agent leave—then, suddenly, turned to stare right at the owl, causing Kasmina to lean back on reflex.
She sent a mental command to the bird, and it took flight, soaring up and out of the Oriq caves. She'd seen more than enough.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Rowan sat in Auvernine's room, watching absently as the girl poured and stirred a glowing potion at her desk. She was exhausted; she'd been training for weeks, working out the best ways to channel the power that seemed to be flowing through her day and night now. For all that, though, she'd made little progress.
A high screech pulled Rowan from her thoughts. She frowned as Auvernine lifted a squirming worm-like creature from a glass jar. "What is that?"
Auvernine's focus stayed on the creature as she placed it in a metal dish. "Common saltgobbler. Took me an hour to find one this big."
"What are you—"
Rowan's words died as Auvernine began to chant, her hands held over the pest.
The creature went still, its bunches of beady black eyes wide. As Auvernine's voice filled the room, the worm began to rise from the plate, twisting and shivering as glimmering energy rose from its plump body.
Rowan's hand went to her mouth as she watched the creature's life force flow through the air and into her friend's potion. The liquid flared and bubbled, the color fading from a deep purple to a vibrant red. As Auvernine finished the spell, the saltgobbler flopped onto the dish, its body heaving as it struggled to breathe. Rowan grimaced. "That is just creepy."
"A little," Auvernine said with a nod. She picked up her potion and inspected it. "The potion requires more power than I can get from pure herbology. But if I can get it right, this could help a lot of people. Some sacrifices are necessary for the greater good, don't you think?"
Rowan only shrugged, her gaze falling back to the pest. Unpleasant memories of her mother welled to the surface; she willed them right back down. #emph[Sacrifices. Right.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Rowan found Will in the Biblioplex, surrounded by a pile of tomes and scrolls. Will reached for another book, flipping through its pages as he mumbled under his breath.
"This isn't exactly what I'd call training."
He looked up at her, clearly surprised. After a moment, his attention dropped back to the texts in front of him. "If the Oriq are as dangerous as people say they are, then the spells we know may not be enough," Will said, shaking his head. "We should focus on adding more to our arsenal."
"Or we could find a way to put more power behind what we already have."
But Will only turned another page, his eyes scanning the text.
Ignoring his dismissal, Rowan looked around. Across the room, next to a diligently studying Prismari student, floated a jellyfish-looking creature—an elemental, a construct of enchanted water shot through with glowing veins of pure arcane energy. Rowan swallowed some of the disgust she'd felt at what Auvernine had done. #emph[It's just a spell, like any other.]
"Rowan, what are you doing?" Will asked, finally looking up from his books.
She shushed him; her focus narrowed to the elemental. Electricity crackled and leapt across her fingers as she pulled the veins of power out of its watery surface, toward her. It collapsed, finally, into a puddle on the stone floor. The energy gathered in her palm, sparking and roiling, before suddenly exploding in a burst of lightning that stood her hair on end. The Prismari student nearly fell out of his chair, scooping up his books and glaring back at Rowan as he fled.
"Rowan!" hissed Will. "You can't just—pull the magic out of whatever you feel like! Besides, we haven't taken any classes on siphoning theory! You'll hurt yourself, or somebody else."
"Will, the Oriq aren't worried about following syllabi, and they aren't going to follow campus guidelines," said Rowan. For the first time in what felt like forever, she was speaking calmly and evenly. "They're going to do whatever it takes. That means we've got to do the same."
"Having these powers is a responsibility, Rowan. That's part of what being here is all about. Otherwise we might use them for"—Will struggled to put his fears into words—"for selfish purposes. For dark ones. Didn't you learn anything from our mother, or from Oko?"
"Yeah," she shot back. "I learned that when you're not afraid to break the rules, you can get a whole lot done. Good luck with your books." She left him there. When a Lorehold librarian came by a few minutes later to ask about the lightning bolt that had briefly illuminated the stacks, Will didn't have much of an answer.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kasmina felt her owl land on the top of her staff, but her gaze was fixed on the horizon. A figure appeared at the edge of the courtyard, silhouetted by the light of the setting suns. She recognized the set to his shoulders—the rigid, military way he carried himself. She recognized the fox that stood at his feet, too. "It's a shame to see a man like you fallen so far. What would your unit think of their former leader becoming a pawn in someone else's scheme?"
"They wouldn't think much of it, I imagine," said Lukka. "Considering half are in the ground and the other half want me dead. Just how long have you and your fake birds been watching me?"
"Long enough to know that this path will only lead to more pain," Kasmina said. "For you and many others. I'm not going to let you do that, Lukka." Her voice, in that moment, was neither wise nor benevolent—it was icy cold.
"I'm done being told how to live," he growled. "And I'm nobody's pawn. The mages who run this school think they're better than anyone else—and the whole damn world just nods and goes along with it. I'm going to show them they're wrong."
"I had hoped you might yet become an ally. That you could use those gifts of yours for the common good." Kasmina sighed. "But I see I have overestimated you."
Before Lukka could respond, Kasmina's owl shot off her shoulder, launching itself into the air. With a flap of its wings, the air around Lukka's fox suddenly condensed into a raging sphere. As the wind spun and swirled around the animal, Kasmina sent a scythe of pressurized air straight at Lukka's chest.
He narrowly ducked under the invisible blade, and it went straight past him, slicing through a stand of trees. Lukka glanced at Mila, his face growing sharper and leaner as he tried to connect with her, but the animalistic features faded almost as soon as they surfaced.
With a slash of her arm, Kasmina sent another blast of wind toward him, this one narrow and pointed like a lance. Lukka rolled to one side, then came up unsheathing his blade.
He charged Kasmina with bestial speed. She brought up her staff just in time to catch the sword on the wooden shaft. Her eyes lit up silver, but before she could unleash another spell, Lukka spun away, snatching his blade free and sending her stumbling forward.
"These dragons," Lukka said, his voice a growl. "Those Dragonsguard. They've held power over these people for too long. They've made them fearful of every shadow, every unfamiliar face. What happens when it's not just the Oriq they're hunting down—when it's anyone who practices magic in a way they don't like?"
Kasmina turned and threw out her hand as Lukka swung again. A wall of blue light went up between them, curving around her. "You can't see beyond your own pain, Lukka. Do you think Extus is going to change all that? Do you think he's going to share power with you? He only fights for himself."
Lukka slammed his weapon against the wall of light, his face contorted with rage. "Frankly? I don't give a damn what he does after all this is burned to the ground."
#figure(image("004_Episode 3: Extracurriculars/04.jpg", width: 100%), caption: [Test of Talents | Art by: <NAME>], supplement: none, numbering: none)
She took a step forward, her shield forcing Lukka back. He swung his blade again and again, trying to force his way through with brute strength, until Kasmina flicked her hand. The light shifted, beams of it shooting out and catching Lukka in the stomach. He flew back and landed next to his trapped fox. Before he could get up, Kasmina was there, the point of her staff held just under his chin.
"Yield," she said. "It's over."
Lukka's snarl burst into a savage laugh. "Over? Oh, no—it's only beginning."
Kasmina paused. In the rush of combat, she'd stopped keeping track of her owls. What she saw now, what had crept up to the very outskirts of the school, sent cold shocks through her.
"I didn't come here to beat you," said Lukka, grinning. "I'm not dumb enough to believe I could do that yet. But they sure can."
The ground trembled beneath them. The horizon began to crawl and shift with movement as a swarm of chitinous, chittering forms scurried between the trees. From their segmented bodies rose a sickly purple glow—it was as if the whole forest burned with unnatural fire.
"Mage hunters," whispered Kasmina. "What have you done?"
"Done? I told you," Lukka turned his head and spat blood from his mouth. He smiled, baring his stained teeth. "We're just getting started."
The mage hunters' glow was even brighter now as they closed in. Kasmina closed her eyes and concentrated on another plane, another place; a cloud of white feathers whipped over her, and she was gone.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Lukka got to his feet and dusted himself off. Light footsteps approached, and soon Extus stood next to him.
"Are you sure you're in control?" asked the Oriq leader. "No Oriq has ever tried to control this many at once."
Lukka nodded. "I'm not like your other mages."
There was movement behind him: the rest of the Oriq, coming to a stop at the edge of the courtyard. The agents stood ready, waiting for Extus's command. Extus squared his shoulders and nodded. "Commence the attack."
|
|
https://github.com/deadManAlive/ui-thesis-typst-template | https://raw.githubusercontent.com/deadManAlive/ui-thesis-typst-template/master/chapters/ch1.typ | typst | = Pendahuluan <intro>
== <NAME>
#lorem(100)
#figure(
image("assets/feynman_diagram.png", width: 50%),
caption: [Feynman Diagram],
) <feynman>
#lorem(100) @lamport1986latex
#lorem(50)
#lorem(100)
$ L=L_0 + N log_10 d/d_0 + L_f (n) $
$ L=L_0 + 10 gamma log_10 d/d_0 + chi $ |
|
https://github.com/lukejcollins/cv | https://raw.githubusercontent.com/lukejcollins/cv/main/english.typ | typst | MIT License | #import "cv.typ": cv, experience, skill, list_interests
#import "@preview/fontawesome:0.1.0": *
#cv(
name: "<NAME>",
links: (
(link: "mailto:<EMAIL>", icon: fa-at()),
(link: "https://github.com/lukejcollins", display: "lukejcollins", icon: fa-github()),
(link: "https://www.linkedin.com/in/luke-j-collins/", display: "<NAME>", icon: fa-linkedin()),
),
occupation: "Senior Solutions Engineer",
tagline: [Solving problems for IT teams. Check out my Github #link("https://github.com/lukejcollins/lukejcollins", "here").],
left_column: [
== Work Experience
#experience("images/ovoenergy.png")[Senior Solutions Engineer][OVO Energy][2022 --- present][Bristol, UK]
In my role as Senior Solutions Engineer with OVO, I champion the development and implementation of advanced IT solutions that elevate business processes and infrastructure. Building on my expertise in automation and systems integration, I architect resilient and efficient systems tailored to enable scalable and fault-tolerant IT frameworks.
My remit involves orchestrating cross-disciplinary collaboration to devise innovative solutions that underpin robust, adaptable infrastructures, ensuring an uninterrupted continuum of operational excellence and system reliability.
#experience("images/ovoenergy.png")[Process Improvement Specialist][OVO Energy][2021 --- 2022][Bristol, UK]
In my role as a Process Improvement Specialist, I played a hands-on part in advancing IT processes, focusing on streamlining operations and bolstering system stability in our end-user focused tech function.
My work involved direct involvement in coding, refining deployment practices, and automating routine tasks. I contributed to enhancing team agility and system uptime, employing a meticulous approach to troubleshoot and optimise IT infrastructure.
#experience("images/ovoenergy.png")[IT Support Engineer][OVO Energy][2019 --- 2021][Bristol, UK]
As an IT Support Engineer, I provided first and second line support, ensuring system availability and swift resolution of technical issues. My role involved proactive monitoring, troubleshooting, and refining incident management processes.
I contributed to the development and implementation of automation tools for more efficient problem-solving, laying the groundwork for improved operational practices and system resilience.
== Education
#experience("images/uwe.png")[BA International Relations (First Class Honours)][University of the West of England][2007 --- 2010][Bristol, UK]
Earned a degree in International Relations, gaining skills in analysis, negotiation, and cross-cultural communication. This foundation enriches my approach to problem-solving and team collaboration in any professional setting.
#experience("images/teflplus.png")[TEFL Certificate][TEFLPlus][2011][Phuket, Thailand]
Completed a TEFL Certificate in Phuket, enhancing my communication, teaching, and adaptability skills in diverse environments, valuable for engaging effectively in any professional context.
== Interests
#list_interests((
"Emacs",
"Open source",
"Python",
"Tooling",
"Music",
"Video games",
"Keyboards",
"Board games",
"Cycling",
"Home labbing",
"Travelling"
))
],
right_column_header: "Skills",
languages_header: "Platforms",
other_technologies_header: "Languages",
right_column: [
=== Methodologies
#skill("Architecture", 4)
#skill("Agile", 4)
#skill("DevOps", 3)
#skill("Solutions", 5)
== Spoken Languages
#skill("English", 5)
#skill("French", 1)
#skill("Thai", 1)
== Other Merits
- #link("https://www.credly.com/badges/6b251816-89ab-4b48-aa66-3c2debc47b32/public_url", "AWS Solutions Architect Professional")
- #link("https://www.credly.com/badges/6a0580b0-bb06-45fd-b60f-f831a75fa24c/public_url", "AWS Developer Associate")
- #link("https://www.credly.com/badges/604c2a30-8ea2-4327-8eb0-1b2a888793f6/public_url", "AWS SysOps Administrator Assosicate")
],
footer_content: [My CV is open-source. If you're curious, its source code is available at #link("https://github.com/lukejcollins/cv").]
)
|
https://github.com/N4tus/uf_algo | https://raw.githubusercontent.com/N4tus/uf_algo/main/algo.typ | typst | MIT License | #import "algo_base.typ": control_flow, expr, constant, algo, append_content
#let For(vars, container) = control_flow("for", vars, container)
#let While( condition) = control_flow("while", condition)
#let If( condition) = control_flow("if", condition)
#let Switch(condition) = control_flow("switch", condition)
#let Case( condition) = control_flow("case", condition, with_body: append_content(after: expr("case", format_name: "break")))
#let Fn(name, param, ret) = control_flow("function", name, param, ret)
#let Assign(name, content) = expr("assign", name, content)
#let Return(content) = expr("return", content)
#let Break(content) = expr("break", content)
#let Continue(content) = expr("continue", content)
#let Statement(content) = expr("statement", content)
#let Comment(comment) = expr("comment", comment)
#let FnCall(fn, ..args) = expr("fn_call", fn, args.pos())
#let MethodCall(obj, method, ..args) = expr("method_call", obj, method, args.pos())
#let Index(obj, ..index) = expr("index", obj, index.pos())
#let Str(s) = expr("str", s)
#let Num(num) = expr("num", num)
#let Ident(ident) = expr("ident", ident)
#let Tuple(..terms) = expr("tuple", terms.pos())
#let List(..terms) = expr("list", terms.pos())
#let Seq(..terms) = expr("seq", terms.pos())
#let Eq = constant("eq")
#let NotEq = constant("not_eq")
#let And = constant("and")
#let Or = constant("or")
#let Not = constant("not")
#let Gt = constant("gt")
#let Lt = constant("lt")
#let GtEq = constant("gteq")
#let LtEq = constant("lteq")
#let Plus = constant("plus")
#let Minus = constant("minus")
#let Mul = constant("mul")
#let Div = constant("div")
#let Mod = constant("mod")
|
https://github.com/gongke6642/tuling | https://raw.githubusercontent.com/gongke6642/tuling/main/布局/length/length.typ | typst | = length
大小或距离,可能用上下文单位表示。
Typst 支持以下长度单位:
- 点:72pt
- 毫米:254mm
- 厘米:2.54cm
- 英寸:1in
- 相对于字体大小:2.5em
您可以将长度与整数和浮点数相乘,也可以将它们除以整数和浮点数。
-- 例
#image("屏幕截图 2024-04-16 155815.png")
#image("屏幕截图 2024-04-16 155922.png")
#image("屏幕截图 2024-04-16 155958.png") |
|
https://github.com/Scriptor25/Seminararbeit | https://raw.githubusercontent.com/Scriptor25/Seminararbeit/master/main.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Die biologischen Wirkungen radioaktiver Strahlung",
author: "<NAME>",
school: "Willibald-Gluck-Gymnasium",
location: "Neumarkt in der Oberpfalz",
years: "2022/24",
subject: "Kerntechnik und Kernchemie",
teacher: "<NAME>, StR",
deadline: "07. November 2023",
)
#counter(page).update(1)
= Einleitung
Strahlung - Ein sehr simples Wort, auf den ersten Blick. Daraus könnte man den
zunächst nicht sonderlich falschen Schluss ziehen, die Thematik dahinter sei
ebenso "einfach". Aber wäre das der Fall, dann würde diese Arbeit nicht
existieren. Doch was ist nun diese "Strahlung"? Der Begriff ist sehr vielfältig:
elektromagnetische Strahlung wie Licht, Mikrowellenstrahlung in, wie
wahrscheinlich schon vermutet, Mirkrowellen-Öfen, und natürlich auch die
radioaktive Strahlung, um die es in diesem Werk hauptsächlich geht. Entdeckt
wurde Radioaktivität bereits vor etwa 128 Jahren, also Ende des 19ten
Jahrhunderts duch <NAME>, der durch Zufall darauf stieß und erhielt
dafür, zusammen mit dem Curie-Ehepaar, den Physik-Nobelpreis. Damals waren
jedoch die Auswirkungen der Strahlung auf biologische Organismen wie den
Menschen noch nicht erforscht, was unter anderem in Dingen wie "Uran-Zahnpasta"
resultierte. Mittlerweile ist die Forschung zur Strahlenwirkung etwas
fortgeschrittener und somit sind auch Wecker mit Uranfarbe für einen schönen
Leuchteffekt glücklicherweise nichts alltägliches mehr. Die Gründe dafür und wie
genau Bestrahlung mit radioaktiven Teilchen sich auf diverse Organismen auswirkt
ist das Thema dieser Arbeit und damit der folgenden Kapitel.
#pagebreak()
= Dosisgrößen: Einordnung von Strahlungswirkung
Als Grundlage für das Einordnen unterschiedlicher Strahlungsarten und deren
Auswirkungen dienen die so genannten "Dosisgrößen"
@umbw@medphwiki@volkmer[Kapitel 5]. Diese ermöglichen es, allgemeine Aussagen
über die Interaktion zwischen Materie und Strahlung zu treffen. Es gibt
verschiedene Möglichkeiten, Strahlenwirkung damit darzustellen: Die Energiedosis
(@energiedosis), Äquivalentdosis (@aequivalentdosis), Organdosis (@organdosis)
und die effektive Dosis (@effektivedosis). @let beschäftigt sich mit dem
linearen Energietransfer (LET) und dem Phänomen des "Bragg-Peak".
== Energiedosis <energiedosis>
Die Energiedosis, angegeben in Gray ($"Gy"$), beschreibt die aufgenommene
Energie pro Masse @umbw:
$ D = E / m $
Bei Abhängigkeit von der Strahlungsart $R$ wird mit dem
Strahlungs-Wichtungsfaktor $w_R$ multipliziert, und bei einbeziehen des
Gewebetyps muss zusätzlich mit dem Gewebe-Wichtungsfaktor $w_T$ skaliert werden.
== Äquivalentdosis <aequivalentdosis>
Allein mit der Energiedosis (@energiedosis) lässt sich noch keine Aussage über
die Interaktion von Strahlung mit Materie treffen, weswegen man diese mit dem
Qualitätsfaktor $Q$, abhängig von der Art der Strahlung $R$, skalieren muss.
Somit ergibt sich die Äquivalentdosis, gemessen in Sievert ($"Sv"$):
$ H_R = Q_R * D_R $
Zu beachten ist, dass auch die Energiedosis ($D$) hier ebenfalls von $R$ abhängig
ist.
== Organdosis <organdosis>
Die in @aequivalentdosis beschriebene Äquivalentdosis kann noch mit einem vom
jeweiligen Organ abhängigen Gewebe-Wichtungsfaktor ($w_T$) multipliziert werden
@giide. Damit kann die Wirkung einer gewissen Energiedosis auf ein bestimmtes
Organ dargestellt werden, auch die Organdosis oder Organ-Äquivalentdosis
genannt:
$ H_(T,R) = w_R * D_(T,R) $
wobei $w_R$ der jeweilige Strahlungs-Wichtungsfaktor ist. Bei mehreren
verschiedenen Strahlungsarten bildet sich die Organdosis aus der Summe aller
Organdosen der unterschiedlichen Strahlungsarten:
$ H_T = sum_R H_(T,R) = sum_R w_R * D_(T,R) $
== Effektive Dosis <effektivedosis>
Die so genannte effektive Dosis, oder auch effektive Äquivalentdosis lässt sich
durch das Summieren aller Organdosen (@organdosis) errechnen. Dadurch wird die
Gesamtwirkung auf den menschlichen Organismus näherungsweise modelliert:
$ E = sum_T w_T * H_T $
== LET und Bragg-Peak <let>
Der LET (lineare Energietransfer) $L$ beschreibt die Energie $Delta E$ entlang
des Weges des "Primärstrahls" über der zurückgelegten Strecke $Delta s$:
$ L = ( Delta E ) / ( Delta s ) $
Angegeben wird $L$ normalerweise in $"kEv"/ ( µ m )$ @radiobio[S. 104].
Ein mit dem LET verbundener Effekt, der häufig für medizinische Zwecke angewandt
wird, wird als "Bragg-Peak" bezeichnet. Dieses Phänomen tritt beim Abbremsen des
Strahlungsteilchens in Materie auf, wobei ein Großteil der Energie abgegeben
wird. Praktische Anwendung findet sich hierbei in der Partikeltherapie: das
Teilchen gibt beim Eindringen fast keine Energie ab; erst beim Verlangsamen im
Zielpunkt ergibt sich eine höhere Dosis.
#pagebreak()
= Eindringen von Strahlung in den Organismus
Um sich auf Materie oder einen Organismus auswirken zu können muss Strahlung in
denselben zunächst eindringen @umb<EMAIL>[Kapitel 7.5]. Hierbei
unterscheidet man zwischen zwei Ausgangssituation: Eindringen von Außen oder von
Innen. In Bezug auf den menschlichen Körper kann die Strahlung von Außen durch
die Haut eindringen. Dabei ist der Effekt stark von der Art der Strahlung
abhängig: während $alpha$-Teilchen nicht in die Haut eindringen können,
durchdringt $beta$-Strahlung diese wenige Millimeter. $gamma$- und
Neutronen-Strahlung hingegen können tief in den Körper eindringen, wobei sie
Prozesse wie Zellteilung u.ä. beeinflussen können. Die Aufnahme von Strahlung
von innerhalb wird als "Inkorporation" bezeichnet: Hierbei wird zwischen "Ingestion"
und "Inhalation" unterschieden. Bei der Ingestion nimmt man Strahlung bzw.
radioaktive Teilchen über die Nahrung auf; bei der Inhalation über die Atemluft
und damit über die Lunge. In beiden Fällen ist die Wirkung extremer als bei der
reinen äußeren Einwirkung, da hier der Weg zu vitalen Organen verkürzt ist.
Außerdem können $alpha$-Teilchen, die energiereicher sind als $beta$- oder $gamma$-Strahlung,
aufgrund des "Bragg-Peaks" (@let) viel mehr Schaden anrichten als von außerhalb.
#pagebreak()
= Unterscheidung der Auswirkungen
== Deterministische Strahlenwirkung <deterministisch>
Auswirkungen radioaktiver Strahlung, die erst ab einem gewissen Schwellwert
auftreten, werden "deterministisch" genannt <EMAIL>["Wie wirkt
Strahlung?"]. So sind unter diesem Wert keine beobachtbaren Schäden oder
sonstige Auswirkungen erkennbar, ab dem Grenzwert steigt die Ausprägung mit der
Dosis. Außerdem ist die Wahrscheinlichkeit, dass Schäden entstehen, unabhängig
vom Volumen bzw. der Oberfläche, die bestrahlt wird. Beispiele für
deterministische Strahlenschäden sind Katarakte (grauer Star) und Hautrötung.
Ein typischer Schwellwert für menschliches Gewebe liegt bei etwa 500$"mSv"$. Die
Auswirkungen sind schon nach relativ kurzer Zeit sichtbar, im Vergleich zu
stochastischen (@stochastisch) oder somatischen Schäden (@somatisch).
== Stochastische Strahlenwirkung <stochastisch>
Wenn Strahlenschäden zufällig, also nicht einem Muster oder irgendwelchen
Faktoren folgend auftreten, so spricht man von stochastischer Strahlenwirkung
@umbw@medphwiki@<EMAIL>["Wie wirkt Strahlung?"]. Hier ist im Gegensatz zu den
deterministischen Auswirkungen (@deterministisch) die Wahrscheinlichkeit direkt
von der bestrahlten Fläche bzw. vom bestrahlten Volumen abhängig und dazu
proportional, jedoch ist die Schwere der Schäden davon unabhängig. Es gibt
keinen Schwellwert, und das Auftreten kann um Monate bis Jahre verzögert sein,
weswegen man auch von Langzeitschäden spricht. Dazu zählen Krebserkrankungen
("Karzinogenese" und somatische Schäden, @somatisch) und vererbbare genetische
Schäden ("hereditär").
== Somatische Strahlenwirkung <somatisch>
Als Unterklasse der stochastischen Strahlenschäden (@stochastisch) existieren
neben den genetisch vererbbaren Auswirkungen noch die somatischen
Strahlenschäden @volkmer[Kapitel 6.5]. Hierbei wird noch einmal in Früh- und
Spätschäden unterschieden, wobei die Frühschäden gleichbedeutend mit
deterministischen Wirkungen sind (siehe @deterministisch). Unter spät
auftretende Auswirkungen fallen Krebserkrankungen und Leukämie; und wie schon in
@stochastisch erwähnt treten diese unabhängig vom bestrahlten Volumen oder einem
Schwellwert auf.
#pagebreak()
= Auswirkungen auf den Menschlichen Körper
== Bezogen auf den ganzen Körper
Im Bezug auf den gesamten Körper gibt es verschiedene Symptome
@leifi@volkmer[Kapitel 6.5]@bfs["Folgen eines Strahlenunfalls"]@epa["Radiation
Health Effects"]: wenn man von deterministischen Schäden spricht
(@deterministisch), hängen die Auswirkungen von der Strahlenmenge ab. Bei einer
Dosis von etwa 0,25 Sv sinkt die Zahl der Lymphozyten, das Blutbild verändert
sich für kurze Zeit. Ab 1 $"Sv"$ kommt es zur vorrübergehenden
Strahlenkrankheit, auch "Strahlenkater" genannt. In dieser Phase kann es nach
ein paar Wochen zu Haarausfall, Hautrötungen und weiteren deterministischen
Schäden kommen. Zur schweren Strahlenkrankheit kommt es ab etwa 4 Sv, die in
etwa 50% der Fälle bei Nicht-Behandlung zum Tod führt. Dabei verschwinden fast
alle Lymphozyten wodurch das Infektionsrisiko mit herkömmlichen Krankheiten
steigt. Des Weiteren kann es zu inneren Blutungen, Fieber, Sterilität (Männer)
oder Zyklusstörungen (Frauen) kommen. Die letale Dosis liegt bei etwa 7 Sv.
Diese Menge Strahlung führt, selbst bei medizinischer Behandlung, in fast allen
Fällen zum Tod. Zunächst kommt es wie bei den vorherigen Schwellwerten in den
ersten Tagen zu Übelkeit und Erbrechen, dann zu großflächigen Entzündungen in
der Schleimhaut, zu Fieber und schnellem verlieren der Kräfte und schließlich
zum Tod.
== Strahlenwirkungen auf Organe
Die Auswirkungen auf einzelne Organe @volkmer[Kapitel 6.6] werden mitunter durch
spezifische Milieufaktoren und relative Strahlenempfindlichkeit bestimmt: Somit
sind Organe wie rotes Knochenmark, Lunge und Keimdrüsen für Strahlung
empfindlicher als zum Beispiel die Haut.
== Strahlenwirkungen auf einzelne Zellen
Auf der Zellebene @medphwiki lässt sich der Prozess von Strahlenschäden in 4
Phasen unterteilen: die *physikalische*, *physikochemische*, *chemische* und
*biologische* Phase. In der physikalischen Phase werden durch Interaktion mit
Strahlung Biomoleküle ionisiert, was zur Modifikation oder Zerstörung des
Moleküls führt. Bei einer Modifikation kommt es in der physikochemischen Phase
entweder zur Rekombination, oder zur Ausbildung freier Radikale, die dann
weitere Prozesse anstoßen. In der chemischen Phase wird durch
Wechselwirkungsprozesse unter anderem auch das Zellwasser verändert. Hierbei
entstehen wieder freie Radikale und andere Spaltprodukte. Dieser Prozess wird
Radiolyse genannt. In der letzten, der biologischen Phase, kommt es schließlich
zur Zerstörung von DNS, Proteinen und Aminosäuren, was zu Mutationen oder dem
Tod der Zelle führen kann. Die Zelle kann jedoch auch wieder vollständig durch
Prozesse wie Glykosylase, Endonuklease, Polymerase und Ligase repariert werden.
Das muss keine Folgen nach sich ziehen, kann aber auch zu den in @somatisch
beschriebenen Spätfolgen führen.
#pagebreak()
= Hormesis: Mögliche positive Wirkungen
Die als Hormesis @bfs["Mögliche positive Wirkungen ionisierender Strahlung -
Hormesis"] bezeichneten positiven Wirkungen radioaktiver Strahlung ist ein noch
sehr unerforschtes Gebiet der Strahlenwirkungen und zusätzlich sehr umstritten.
So wurden in wenigen Fällen positive Auswirkungen von Bestrahlung beobachtet,
wie eine Beschleunigung von Wachstums- und Entwicklungsprozessen, Anregung von
Reparaturvorgängen auf Zellebene oder die Konditionierung von Zellen auf
Radioaktivität. Wie schon gesagt bleibt Hormesis jedoch stark umstritten, da
diese positiven Wirkungen nur in Einzelfällen zu beobachten sind und in
vergangenen Studien nur sehr selten aufgetreten sind, und wenn dann meistens in
künstlichen Umgebungen, wie zum Beispiel das Entnehmen von Lymphozyten um diese
im Labor zu testen.
#pagebreak()
= Schlusswort
Zusammenfassend lässt sich sagen, dass Strahlenwirkungen sehr variabel auftreten
können, sich vielfältig Auswirken und sehr oft nicht mit Sicherheit vorhersagbar
sind. Zwar kann man in Fällen von deterministischen oder Frühschäden sehr genau
sagen ab wann und ab welchem Strahlungs-Wert welche Wirkungen auftreten, wenn es
jedoch zu stochastischen oder genetischen, vererbbaren Schäden kommt wird es
beinahe unmöglich sichere Vorhersagen zu treffen. Die Schäden, die durch
Strahlung entstehen können von einfachen Hautrötungen und Haarausfall bis hin zu
Krebserkrankungen und Leukämie reichen können und, zumindest bei Frühschäden,
bis zu einem bestimmten Punkt auch noch medizinisch behandelt werden können. Und
es könnte zwar auch mögliche positive Auswirkungen geben, diese sind jedoch
nicht nachweisbar, geschweige denn erforscht.
#pagebreak()
= Anhang
Hier im Anhang möchte ich mich noch für die doch sehr kurz geratene Arbeit
entschuldigen; man fängt schnell an, die eigene verfügbare Zeit und
Konzentration maßlos zu überschätzen. Dazu kommt noch, das die Motivation um
einiges sinkt, wenn man nicht wirktlich viel Interesse an einem Thema hat. Da
hab in erster Linie nur ich selbst Schuld daran, ich hatte aber von Anfang an
schon, also bei der Wahl der Themen, keine wirkliche Idee, in welche thematische
Richtung die Seminararbeit gehen sollte, was nicht wenig daran lag, dass ich mir
nicht richtig überlegt hatte, ob dieses W-Seminar wirklich das richtige für mich
wäre. Trotz allem habe ich mir (beim Exposé viel zu viel) Mühe gegeben, richtig
zu recherchieren und keine falschen Fakten mit aufzunehmen und mich so gut es
ging an die Vorgaben zu halten.
Die digitale Version der Arbeit finden Sie unter folgendem Link:
#text(navy)[#align(center)[https://github.com/Scriptor25/Seminararbeit]]
(Geschrieben wurde die Seminararbeit in Typst (#text(navy)[https://github.com/typst/typst]))
|
|
https://github.com/RaphGL/ElectronicsFromBasics | https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/DC/chap1/7_conventional_electron_flow.typ | typst | Other | === Conventional electron flow
#quote(attribution: [<NAME>, computer science professor], block: true)[
The nice thing about standards is that there are so many of them to choose from.
]
When <NAME> made his conjecture regarding the direction of charge flow (from the smooth wax to the rough wool), he set a precedent for electrical notation that exists to this day, despite the fact that we know electrons are the constituent units of charge, and that they are displaced from the wool to the wax -- not from the wax to the wool -- when those two substances are rubbed together. This is why electrons are said to have a negative charge: because Franklin assumed electric charge moved in the opposite direction that it actually does, and so objects he called "negative" (representing a deficiency of charge) actually have a surplus of electrons.
By the time the true direction of electron flow was discovered, the nomenclature of "positive" and "negative" had already been so well established in the scientific community that no effort was made to change it, although calling electrons "positive" would make more sense in referring to "excess" charge. You see, the terms "positive" and "negative" are human inventions, and as such have no absolute meaning beyond our own conventions of language and scientific description. Franklin could have just as easily referred to a surplus of charge as "black" and a deficiency as "white," in which case scientists would speak of electrons having a "white" charge (assuming the same incorrect conjecture of charge position between wax and wool).
However, because we tend to associate the word "positive" with "surplus" and "negative" with "deficiency," the standard label for electron charge does seem backward. Because of this, many engineers decided to retain the old concept of electricity with "positive" referring to a surplus of charge, and label charge flow (current) accordingly. This became known as conventional _flow_ notation:
#image("static/7-conventional-flow-notation.png")
Others chose to designate charge flow according to the actual motion of electrons in a circuit. This form of symbology became known as electron _flow_ notation:
#image("static/7-electron-flow-notation.png")
In conventional flow notation, we show the motion of charge according to the (technically incorrect) labels of + and -. This way the labels make sense, but the direction of charge flow is incorrect. In electron flow notation, we follow the actual motion of electrons in the circuit, but the + and - labels seem backward. Does it matter, really, how we designate charge flow in a circuit? Not really, so long as we're consistent in the use of our symbols. You may follow an imagined direction of current (conventional flow) or the actual (electron flow) with equal success insofar as circuit analysis is concerned. Concepts of voltage, current, resistance, continuity, and even mathematical treatments such as Ohm's Law (chapter 2) and Kirchhoff's Laws (chapter 6) remain just as valid with either style of notation.
You will find conventional flow notation followed by most electrical engineers, and illustrated in most engineering textbooks. Electron flow is most often seen in introductory textbooks (this one included) and in the writings of professional scientists, especially solid-state physicists who are concerned with the actual motion of electrons in substances. These preferences are cultural, in the sense that certain groups of people have found it advantageous to envision electric current motion in certain ways. Being that most analyses of electric circuits do not depend on a technically accurate depiction of charge flow, the choice between conventional flow notation and electron flow notation is arbitrary . . . almost.
Many electrical devices tolerate real currents of either direction with no difference in operation. Incandescent lamps (the type utilizing a thin metal filament that glows white-hot with sufficient current), for example, produce light with equal efficiency regardless of current direction. They even function well on alternating current (AC), where the direction changes rapidly over time. Conductors and switches operate irrespective of current direction, as well. The technical term for this irrelevance of charge flow is nonpolarization. We could say then, that incandescent lamps, switches, and wires are nonpolarized components. Conversely, any device that functions differently on currents of different direction would be called a polarized device.
There are many such polarized devices used in electric circuits. Most of them are made of so-called semiconductor substances, and as such aren't examined in detail until the third volume of this book series. Like switches, lamps, and batteries, each of these devices is represented in a schematic diagram by a unique symbol. As one might guess, polarized device symbols typically contain an arrow within them, somewhere, to designate a preferred or exclusive direction of current. This is where the competing notations of conventional and electron flow really matter. Because engineers from long ago have settled on conventional flow as their "culture's" standard notation, and because engineers are the same people who invent electrical devices and the symbols representing them, the arrows used in these devices' symbols _all point in the direction of conventional flow, not electron flow_. That is to say, all of these devices' symbols have arrow marks that point _against_ the actual flow of electrons through them.
Perhaps the best example of a polarized device is the diode. A diode is a one-way "valve" for electric current, analogous to a _check valve_ for those familiar with plumbing and hydraulic systems. Ideally, a diode provides unimpeded flow for current in one direction (little or no resistance), but prevents flow in the other direction (infinite resistance). Its schematic symbol looks like this:
#image("static/7-diode-symbol.png")
Placed within a battery/lamp circuit, its operation is as such:
#image("static/7-diode-operation.png")
When the diode is facing in the proper direction to permit current, the lamp glows. Otherwise, the diode blocks all electron flow just like a break in the circuit, and the lamp will not glow.
If we label the circuit current using conventional flow notation, the arrow symbol of the diode makes perfect sense: the triangular arrowhead points in the direction of charge flow, from positive to negative:
#image("static/7-current-conventional-flow.png")
On the other hand, if we use electron flow notation to show the true direction of electron travel around the circuit, the diode's arrow symbology seems backward:
#image("static/7-current-electron-flow.png")
For this reason alone, many people choose to make conventional flow their notation of choice when drawing the direction of charge motion in a circuit. If for no other reason, the symbols associated with semiconductor components like diodes make more sense this way. However, others choose to show the true direction of electron travel so as to avoid having to tell themselves, "just remember the electrons are actually moving the other way" whenever the true direction of electron motion becomes an issue.
In this series of textbooks, I have committed to using electron flow notation. Ironically, this was not my first choice. I found it much easier when I was first learning electronics to use conventional flow notation, primarily because of the directions of semiconductor device symbol arrows. Later, when I began my first formal training in electronics, my instructor insisted on using electron flow notation in his lectures. In fact, he asked that we take our textbooks (which were illustrated using conventional flow notation) and use our pens to change the directions of all the current arrows so as to point the "correct" way! His preference was not arbitrary, though. In his 20-year career as a U.S. Navy electronics technician, he worked on a lot of vacuum-tube equipment. Before the advent of semiconductor components like transistors, devices known as vacuum tubes or electron tubes were used to amplify small electrical signals. These devices work on the phenomenon of electrons hurtling through a vacuum, their rate of flow controlled by voltages applied between metal plates and grids placed within their path, and are best understood when visualized using electron flow notation.
When I graduated from that training program, I went back to my old habit of conventional flow notation, primarily for the sake of minimizing confusion with component symbols, since vacuum tubes are all but obsolete except in special applications. Collecting notes for the writing of this book, I had full intention of illustrating it using conventional flow.
Years later, when I became a teacher of electronics, the curriculum for the program I was going to teach had already been established around the notation of electron flow. Oddly enough, this was due in part to the legacy of my first electronics instructor (the 20-year Navy veteran), but that's another story entirely! Not wanting to confuse students by teaching "differently" from the other instructors, I had to overcome my habit and get used to visualizing electron flow instead of conventional. Because I wanted my book to be a useful resource for my students, I begrudgingly changed plans and illustrated it with all the arrows pointing the "correct" way. Oh well, sometimes you just can't win!
On a positive note (no pun intended), I have subsequently discovered that some students prefer electron flow notation when first learning about the behavior of semiconductive substances. Also, the habit of visualizing electrons flowing against the arrows of polarized device symbols isn't that difficult to learn, and in the end I've found that I can follow the operation of a circuit equally well using either mode of notation. Still, I sometimes wonder if it would all be much easier if we went back to the source of the confusion -- <NAME>'s errant conjecture -- and fixed the problem there, calling electrons "positive" and protons "negative."
|
https://github.com/crd2333/crd2333.github.io | https://raw.githubusercontent.com/crd2333/crd2333.github.io/main/src/docs/Reading/跟李沐学AI(论文)/DALLE2.typ | typst | // ---
// order: 32
// ---
#import "/src/components/TypstTemplate/lib.typ": *
#show: project.with(
title: "d2l_paper",
lang: "zh",
)
= Hierarchical Text-Conditional Image Generation with CLIP Latents
- 时间:2022.4
== 标题 & 摘要 & 引言
- 技术路线:DALLE $->$ CogView $->$ NVWA $->$ GLIDE(OpenAI) $->$ ERNIE-ViLG $->$ DALLE2 $->$ CogView2 $->$ CogVideo $->$ Imagen(Google)
- DALLE 沿用了 OpenAI 擅长的基于 GPT 的技术路线(GPT+VQ-VAE)。在此之前,OpenAI 已于 2020 年 6 月发布了 Image-GPT,在图像生成大模型上小试牛刀。但是 DALEE2 采用了不同的技术方案:扩散模型。其效果比 DALLE 提升很多。
- 标题:使用 CLIP 特征,基于文本信息层次化地生成图像。其实 DALLE2 就是 CLIP + GLIDE,后者就是基于 difussion 的图像生成模型
- 摘要
- 用一种 two-stage 的方法,先 prior 显式地生成 image embedding,再用 decoder 生成 image,这种显式方式可以显著增强 diversity 而不会影响写实程度和文本图像匹配程度;而且用 CLIP 得到的 embedding space 允许 DALLE2 通过文本来修改图像,而且是 zero-shot 的
#diagram(
node((-4.5,0), [Text]),
edge([CLIP encoder]),
node((-1.5,0), [Text embedding]),
edge([prior]),
node((1.5,0), [Image embedding]),
edge([decoder]),
node((4.5,0), [Image]),
)
- 引言
- 首先说最近的 CV 领域进展主要是在 captioned images 上训练 scaling models,比如 CLIP。
- CLIP 可以看之前的论文阅读笔记
- 然后是说扩散模型成为 CV 领域图像和视频生成最好的工具
- difussion 是从一个分布里去采样,它的多样性非常好,但是保真度比不过 GAN。但后来各种 technique 比如 guidance 不断地去优化它,逐渐就成为 SOTA
- 接着就是用一个图片九宫格卖一卖结果,又多样又逼真巴拉巴拉
- 最后简单介绍一下模型。其实它就是 CLIP 和 GLIDE 的融合,prior 模型通过把 CLIP text encoder 的结果作为输入,CLIP image encoder 的结果作为 ground truth 进行训练,这样显式地得到图像的特征,然后再送入 decoder 生成图像
- 论文的主体方法部分只有两页,默认读者有一定的了解,细节透露的也不多(CloseAI 一贯作风)。所以下面先去了解一下图像生成领域以前的方法和 difussion 的做法等
- 其实在论文发布的时候,GPT 已经在文本生成领域取得巨大成功,但是图像生成任务依然没有很好地解决,文本生成和图像生成有何不同?
- 之前的图像生成模型都是基于 GAN 的,但是 DALLE2 采用了扩散模型,这两者有何不同?
+ 相对而言,文本生成是“一对一”的任务,而图像生成是“一对多”的任务。如机器翻译,有比较确定性的正确答案;而图像生成,一个文本描述可以对应很多图像,图像生成时机器需要大量“脑补”(一文对多图)
- 更本质地说,一般的机器学习任务,一个输入有一个确定性的标签(label);图像生成任务不一样,对一个输入,其输出是一个分布
- 因此 Image-GPT 这种直接拿 GPT 做图像生成效果相对不好。因为每个 pixel 单独生成,无法表达分布的约束。画一幅图,前一个 pixel 可能往左跑,后一个 pixel 可能往右跑,单独看每个都没有问题,但是放在一起就不协调(其实感觉用 patch 思想能一定程度解决这个问题)
+ “一图胜千言”,图像的信息量远远大于文本,同一张图片可以有不同的文本描述、包含多个视觉概念,生成任务需要把它们有机地融合在一起(一图对多文)
+ 再者,文本生成任务的基本概念单元 —— token,是有限的、离散的、可枚举的;而图片任务不一样,它是无限的、连续的、不可穷举的。
- 图像的像素表征有很多冗余,图像概念更像是在一个连续、渐变空间。例如,同一张图片,可以稍微做一点变换,生成一个大体相似,但有细微差别的图片。
- 凡此种种,可以通过扩散模型比较好地解决
- 扩散模型在文本之外引入额外的输入:随机噪声分布。使得输入变成了一个分布,输出也是一个分布。有了分布就有了约束,使得输出的视觉概念满足概率约束
- 扩散模型的输出不是一步到位,而是多步到位。中间过程生成了大体相似却又有所差异的图片
== 图像生成技术的演进
=== GAN
- GAN 的核心思想是“左右手互搏”,有两个网络,一个生成器(Generator) $G$,一个判别器(Discrimitor) $D$。它刚提出时,被认为是深度学习领域当时最具创意的思想
- 生成器的输入是随机噪声,输出是图像 $x'$。判别器的输入是 $x'$ 和真实图像 $x$,输出是二分类,表示 $x'$ 是否是真实图片。生成器的目标是以假乱真,糊弄判别器。而判别器的目标是练就一双火眼金睛,识别伪造的图片。训练过程中 $G$ 和 $D$ 不断提升,最后 $G$ 能生成非常逼真的图片
- GAN 的目标函数就是为了以假乱真,所以 GAN 生成的图片保真度非常高,即便人眼也很难区分真假,使用 GAN 的 DeepFake 曾经十分火爆。
- 经过多年的优化,GAN 现在很好用,但是它还有一些缺点
+ 训练不稳定。因为它要训练两个网络,不太好平衡
+ GAN 生成过程的随机性来自初始的随机噪声,导致生成的图片缺乏多样性和创造性
+ GAN 不是一个概率模型。它的生成都是隐式的、通过一个网络完成的。我们没法知道它具体做了什么,遵循什么分布。GAN 在数学上不如后期的 VAE,diffusion 模型优美
- 接下来是 AE 大家族
=== AE & DAE
#fig("/public/assets/Reading/limu_paper/DALLE2/2024-10-09-09-28-49.png")
- AE
- 原始图片 $x$,经过 encoder $E$ 得到中间向量 $z$,再经过 decoder $D$,输出图片 $x'$。$z$ 的维度通常比原始图片小很多,所以又被称为 bottleneck
- 训练目标:$x'$ 尽量逼近 $x$。即重构原始图片
- DAE
- DAE 与 AE 只有一个差别:输入的原始图片 $x$ 先加噪变成 $x_c$,再接入后续流程。训练目标仍是使输出 $x'$ 逼近原始图片 $x$
- 事实证明,加噪声很有用。它使得模型更稳健,鲁棒性更强,不容易过拟合
- 究其原因,可能在于,图片信息冗余很大。即使原始图片被污染了,模型仍然能够抓住它的本质,把它重构出来。这一思想与扩散模型以及何恺明的 MAE 有异曲同工之妙
- 无论是 AE, DAE 还是 MAE,都是为了学习中间的 bottleneck 特征。然后再拿 bottleneck 特征做分类等任务。它并不是为了做生成式任务。原因是它学到的是固定的特征向量,而不是一个概率分布,不能用来做采样。于是,顺着这条思路衍生出来 VAE
=== VAE & VQ-VAE
#fig("/public/assets/Reading/limu_paper/DALLE2/2024-10-09-11-40-22.png")
- VAE
- VAE 学习概率分布,它先假设这个分布符合高斯分布(有点添加语义先验的意思),于是 VAE 的 encoder 部分的学习目标简化成学习高斯分布的均值和方差
- 具体方法如下:
+ 原始图片 $x$ encode 之后经过 FC 层预测得到均值 $mu$、方差 $sigma$
+ 从该高斯分布采样得到 $z$
+ 通过 decoder 生成 $x'$,训练目标是 $x'$ 逼近 $x$
- 整个过程从数学上看比较优雅。第一步,从 $x$ 得到 $z$,可以写作 $P(z|x)$,是($z$ 的)后验概率。中间的 $P(z)$ 是先验概率 prior。后面一步可以写作 $P(x'|z)$,是 likelihood
- VAE 提出之后,有很多基于它的工作,包括 VQ-VAE、VQ-VAE2 等。DALLE-1 就是在 VQ-VAE 的基础上做的
- VQ-VAE
- VQ 的含义是 Vector Quantised,就是把 VAE 做量化
- 虽然现实世界的很多信号,例如语音、图像等都是连续信号,但是我们在计算机处理它们时大多已经把它们处理成离散信号,那不如干脆就做离散任务。VQ-VAE 把针对连续信号的回归任务转化成针对离散信号的分类任务,把高斯连续分布的先验转化成 codebook 的离散分布先验
- 在 VQ-VAE 中,不是直接学习中间变量的分布,而是用一个 codebook 代替它。codebook 的大小是 $K * D$(e.g. $8192 * 512$)。codebook 存储的向量可以理解为聚类的中心,也可以看作是 embedding($K$ 个长度为 $D$ 的 embedding向量)
- $x$ encode 之后得到特征图 $f$,$f$ 中的每一维向量都从 codebook 中找一个离它最近的向量 $D$ 替换,这样得到量化之后的特征向量 $f_c$,和原始特征图 $f$ 维度一样,语义相似,只不过它的元素取值只能从 codebook 中来,相当于缩小了空间
=== DALLE
#fig("/public/assets/Reading/limu_paper/DALLE2/2024-10-09-11-45-44.png")
- DALLE 的模型十分简洁。输入文本通过编码(BPE)得到文本向量(256),图像通过事先训练好的 VQVAE 编码得到图片向量($32 * 32 = 1024$)。二者 concat 到一起得到一个序列(1280 token)。有了输入序列接下来就是很常规的操作,接入 GPT,并通过 mask 等方式训练
- 推理的时候,输入文本,得到文本序列,输入 GPT,用自回归的方式生成图像 token 序列,得到图片
- DALLE 自回归输出得到多张图片,将图片的 CLIP embedding 与输入文本的 CLIP embedding 做对比,找到最相似的图片作为最终输出
=== Diffusion
#fig("/public/assets/Reading/limu_paper/DALLE2/2024-10-09-11-57-36.png", width: 70%)
- 部分参考 #link("https://mp.weixin.qq.com/s?__biz=MzkwODI1OTE1Nw==&mid=2247484415&idx=1&sn=a8c642342c579997367060b54fec218a&chksm=c0cdf9c5f7ba70d371<KEY>&token=1945802926&lang=zh_CN#rd")[AI论文精读-10:深入理解扩散模型和DALLE2]
- 扩散的概念
- 来自物理学中的扩散过程。将一滴墨汁滴到一瓶清水中,它会逐渐扩散开来,最后墨汁和清水浑然一体,达到“各向同性的正态分布”
- 对一张原始图片,逐步加噪声,它最终会变成面目全非的白噪声。这个过程比作上述扩散过程。称作前向扩散,forward diffusion
- 生成图片可以看作,输入高斯白噪声,然后一步一步地对它去噪,最后生成清晰的图片。这一过程称作反向扩散,reverse diffusion,是前向扩散的逆过程
- 但从深度学习的角度来看,加噪声是为了构造自监督学习的 label。它和 BERT 及 GPT 通过 mask 或者预测下一个单词等方式构造 label 有异曲同工之妙。有了稳健的自监督 label,我们才能构造模型消费取之不尽、用之不竭的图片、文本等数据集,才能实现“大力出奇迹”
- 图像生成及推理过程,就是逐步去噪。模型推理时不是一步到位,而是步步为营 $N$ 次完成
- 输入是白噪声(或者 prior 网络得到的分布,例如 DALLE2)以及步数 $t$,模型推理预测上一个时间步的图片。重复这一过程 $N$ 次,最终得到输出图片。而这个图片跟前向过程的输入图片已经有很大不同了
- 对于反向过程中的预测网络,选用了非常常规的 U-Net
- U-Net 最早是 2015 年提出,它是一种 CNN 网络。输入图片 $x$ 经过 encode 逐步下采样,压缩到一个中间结果,然后经过 decoder 逐步上采样恢复到和输入同样维度的 $x'$
- 为了恢复得更好,encoder 和 decoder 间有一些 skip connection。U-Net 输入和输出维度一致,刚好非常适合 diffusion 的场景
- 几个疑问
+ 为何每一步的噪声预测网络参数可以共享?
+ 为何不同图片的噪声预测网络参数可以共享?
+ 噪声预测网络本质上学习并且存储的是什么?
- GPT 中不同序列能共享相同的网络参数是假设输入的文本数据集中同一个 token 不管在哪个句子出现,它遵循相同的生成概率。模型学习并存储(所有)token 以及 token 组合(句子)的生成概率。那 Diffusion Model 呢?
==== 扩散模型的演进
- DDPM
- 扩散模型早在 2015 年就提出来了,但是它真正产生好的效果走入人们的视野是 2020 年 DDPM 论文之后。DDPM 由 Berkeley 的三位大佬提出,算是扩散模型在图像生成领域的开山之作。
- 它的贡献主要有两个:
+ 之前人们在扩散过程中想直接实现 $X_t$ 到 $X_(t-1)$,即图像到图像的转换。DDPM 认为直接预测图像比较困难,它转而预测噪声,类似 ResNet 的思想。模型推理预测(前一步添加的)噪声,从输入中减去预测噪声得到一个稍微清晰一点的图片
+ 如果要预测正态分布(噪声),只需要学习它的均值和方差。DDPM 发现甚至连方差都不用学习(设置成一个常数),只学习均值就能取得很好的效果,再次降低模型优化的难度
- 比较 VAE 与 DDPM,有以下差别:
+ DDPM 这种扩散模型其实和 VAE 有点像,看成是 encoder-decoder 的架构
+ DDPM encoder 是一步步走过来固定的过程,而 VAE encoder 是学习的
+ 扩散过程每一步中间结果的维度都和输入一样,而 VAE 的中间结果 bottleneck 维度比输入小
+ 扩散模型有 time step, time embedding 的概念。每一步的 U-Net 模型共享参数
- 伪代码
#fig("/public/assets/Reading/limu_paper/DALLE2/2024-10-15-19-11-18.png", width: 80%)
- 两个注意点
+ 训练时并没有迭代 $T$ 步,即没有扩散 $T$ 步。从数学上可以证明,前向过程中,$X_T$ 可以直接从 $X_0$ 叠加高斯噪声一步得到,无需 $T$ 步迭代。
+ 推理时,每一步去噪之后,又叠加了一个高斯噪声扰动项 $bz$。这个小小扰动是为了增加 noise,增加不确定性,实验证明它非常有效(正如在文本生成时只选取概率最大的 token 输出效果不好,需要采样增加随机性和多样性)
- improved DDPM
- 把 DDPM 的常数方差也学了
- 把产生噪声的 schedule 从线性改成余弦(可以类比学习率的线性 $->$ 余弦)
- Diffusion beats GAN
- OpenAI 祭出传统艺能,把模型做得又大又宽
- 用新的归一化方式 adaptive group normalization
- 引入 classify guidance 引导图像生成,不仅让图像更逼真,也加速了反向采样速度
- classify guidance
- 额外训练一个 classifier(在加噪图片上),把反向过程的每一步输入传给它,结果去做交叉熵损失函数然后反传得到梯度。
- 这个梯度暗含了图片是否包含物体或物体是否真实的信息,能够帮助模型训练。它告诉 U-Net 网络,去噪得到的图像不仅仅是意思到了就行,而是真的要包含这样一个逼真的物体
- 某种程度上是牺牲一点多样性(但依旧比 GAN 好),换取逼真效果
- 这个 guidance 的方法比较灵活,大家马上就想到使用 CLIP,不光可以用梯度去引导,甚至可以将文本联系起来进行控制。而分开来,也分别可以用 image 去做特征和图像风格层面的引导,用 LLM 去做引导。所有的这些 guidance,都可以被视为是一个条件变量
- 更进一步,又有人提出 classifer free guidance,在没有另一个模型作为分类器的情况下自己指导自己。训练时要求两个输出 $f_th (x_t,t,y)$ 和 $f_th (x_t,t,emptyset)$,相减得到差距,然后在推理时就大概能知道有条件的结果在哪个方向。这个方法进一步提高了训练开销,但确实是好用的方法
- GLIDE
- 在之前工作的基础上引入 classifier free guidance,只用 3.5B 就直逼之前 12B 的 DALLE 模型
== DALEE2
- 现在回到 DALEE2
#fig("/public/assets/Reading/limu_paper/DALLE2/2024-10-15-19-14-49.png", width: 70%)
- 虚线上方是 CLIP 模型,下面是 Text2Image 文生图模型。CLIP 模型参数冻结,而文生图模型包含 prior 和 decoder 两个部分
- 输入文本 $y$ 通过 CLIP text encoder 模型得到 text embedding $bz_t$
- Prior 模型根据 $bz_t$ 生成 image embedding $bz_i$,记作 $P(bz_i|y)$,Decoder 再根据 $bz_i$ 生成图片 $x$。
- 文生图的过程像是 CLIP 的逆过程,所以在原论文中 DALLE2 被称为 unCLIP。另外,上面这样变化的合理性有如下保证
$ P(x|y) = P(x, bz_i|y) = P(x|bz_i, y)P(bz_i|y) $
- Decoder
- Decoder 继承自 GLIDE 模型。它同时采用了 CLIP guidance 和 classifier free guidance,随机生效
- 为了生成高清晰度的图片,文章采用了级联的方式,训练了两个上采样模型。一个模型负责从 $64 * 64$ 到 $256 * 256$,另一个模型负责从 $256 * 256$ 到 $1024 * 1024$
- 另外由于扩散模型使用 U-Net 而不是 Transformer,所以可以不用担心序列长度是否一致的问题,是直接可以去生成更清晰的图片的
- Prior
- Prior 从输入文本生成一个符合 CLIP 多模态空间的图片向量。文章探索了 AR 和 diffusion 两种方式(两种方式都使用了 classifer free guidance),前者比较贵而不予采用,这里主要介绍 diffusion 方式
- 输入:encoded text, CLIP text embedding, timestep embedding, noised CLIP image embedding, 占位符 embedding(cls token) 用于做输出
- label:unnoised CLIP image embedding
- 模型结构:decoder-only Transformer
- 从 DDPM 开始大家发现预测 Diffusion 预测残差比较好,但这里最终目标不是图片而是 CLIP image embedding $bz_i$,所以没有用残差
- 其实,模型结构部分文章介绍很少。各种技术细节如果不看源代码很难解释清楚。在此只能简要介绍。另外,图像生成有很多技巧,有些有用有些没用。例如 AR 方式到底好不好用,到底预测噪声好还是预测原始图片好,不同的文章结论不完全一样。其实,这些奇技淫巧不是最重要的,最重要的是规模(scale),只要能把规模做上去,模型结构上的差异没有那么重要。
== 结果 & 讨论
- 文生图、图生图、图之间内插、文本图像内插
- 局限性
- DALLE2 不能很好地把物体和它的属性结合起来。例如,输入 prompt "a red cube on top of a blue cube",DALLE2 不能识别 "on top of" 的语义
- 其原因可能在于 CLIP 模型只考虑了文本和图片的相似性,而没法学习 "on top of" 这种属性信息
- 另一个例子,输入 prompt "a sign that says deep learning",生成的图片确实像一个标语牌,但是上面的文字五花八门,基本都是错误的
- 其原因可能是文本编码采用了 BPE,是编码词根词缀,不是编码整个单词
- 后面的讨论提到,这个问题反映了 DALEE2 有一套自己的“方言”,跟人类语言映射错位。DALLE2 发明的这些黑话使得监管更加困难
- 其它,例如公平性、伦理性、安全性等生成模型老生常谈的问题不再赘述
- 脑洞:自动数据增强,无限套娃
- 给 GPT-3 输入一段 prompt,用它生成一段文本,再将文本扔给 DALLE2 生成图片,得到无穷无尽的图像文本对,接下来可以用它们训练 CLIP 和 DALLE2。怀疑大公司早就在做了
- 该领域后续发展飞快,google 马上提出 imagen,然后又有开源的 stable diffusion 等……
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/docs/cookery/direction/main.typ | typst | Apache License 2.0 | #import "mod.typ": *
#show: book-page.with(title: "Technical Directions")
#include "main-content.typ"
|
https://github.com/rabotaem-incorporated/algebra-conspect-1course | https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/01-number-theory/09-fundamental-th-of-arithm.typ | typst | Other | #import "../../utils/core.typ": *
== Основная теорема арифметики
#th[
Пусть $n >= 2$. Тогда $n$ можно представить в виде произведения простых чисел, и такое представление единственно с точностью до порядка сомножителей.
]
#proof[
"Существование":
Пусть $n_0$ --- наименьшее число $(>= 2)$, для которого такого представления нету.
$n_0$ --- составное число $==> n_0 = a b, space 2 <= a, b < n_0$
Это число минимальное $==> a = p_1 ... p_k, space b = q_1 ... q_l$, где все $p_i, q_j$ --- простые.
Но тогда, $ n_0 = p_1 ... p_k q_1 ... q_l$, где все $p_i, q_j$ --- простые $==>$ такое представление существует, противоречие.
"Единственность":
$n = p_1 ... p_k = q_1 ... q_l, space.quad p_i, q_j$ --- простые.
Нужно доказать, что $k = l$ и что $q_1 ..., q_k$ совпадают с $p_1, ..., p_k$ с точностью до порядка.
Не умаляя общности можно считать: $k <= l$.
Индукция по $k$:
"База": $k = 1: space p_1 = q_1 ... q_l, space p_1$ --- простое $==> l = 1, space p_1 = q_1$
"Переход": $k > 1: space p_k divides n ==> p_k divides (q_1 ... q_l) ==> exists j : p_k divides q_j ==> p_k sim q_j ==> p_k = q_j$
А значит $p_1 ... p_(k-1) = q_1 ... hat(q_j) ... q_l$, где $k-1 <= l-1$
$k-1 < k ==>$ применим индукционный переход:
$k-1 = l-1$ и $q_1, ..., hat(q_j), ..., q_k$ --- это $p_1, ..., p_(k-1)$ с точностью до порядка. $==>$
$q_1, ..., (q_j = p_k), ..., q_k$ --- это $p_1, ..., p_k$ с точностью до порядка.
]
#def[
_Каноническое разложение (факторизация)_ числа $n$ --- это представление $n$ в виде $p_1^(r_1) ... p_s^(r_s)$, где $forall i: space p_i in PP, space r_i in NN$
]
#examples[
- $n = 112 = 2^4 dot.c 7$
- $n = 6006 = 2^1 dot.c 3^1 dot.c 7^1 dot.c 11^1 dot.c 13^1$
]
#pr[
Пусть $a = p_1^(r_1) ... p_s^(r_s), space b = p_1^(t_1) ... p_s^(t_s)$
Тогда $a divides b <==> r_i <= t_i space forall i in {1, ..., s}$
]
#proof[
"$arrow.l.double$":
$b = a dot.c p_1^(t_1 - r_1) ... p_s^(t_s - r_s) ==> a divides b$
"$arrow.r.double$":
$a divides b ==> b = a c, space c = p_1^(m_1) ... p_s^(m_s) p_(s+1)^(m_(s+1)) ... p_n^(m_n)$
$b = p_1^(t_1) ... p_s^(t_s) = p_1^(r_1 + m_1) ... p_s^(r_s + m_s) p_(s+1)^(m_(s+1)) ... p_n^(m_n) ==>$
$cases(
t_i = r_i + m_i\, space.quad forall i in {1, ..., s},
m_(s+1) = ... = m_n = 0
) ==> t_i >= r_i, space.quad forall i in {1, ..., s}$
]
#follow[
Пусть $a = p_1^(r_1) ... p_s^(r_s)$
Тогда ${d > 0 divides a dots.v d} = \{p_1^(t_1) ... p_s^(t_s) divides 0 <= t_i <= r_i, space forall i in {1, ..., s}\}$
]
#follow[
Пусть $a = p_1^(r_1) ... p_s^(r_s), space b = p_1^(t_1) ... p_s^(t_s)$
Тогда $gcd(a, b) = p_1^(min(r_1, t_1)) ... p_s^(min(r_s, t_s))$
]
#def[
Пусть $a, b in ZZ$. Число $c in ZZ$ называется _наименьшим общим кратным_ чисел $a$ и $b$, если:
+ $a divides c, space b divides c$
+ $a divides c', space b divides c' ==> c divides c'$
]
#pr[
Пусть $a = p_1^(r_1) ... p_s^(r_s), space b = p_1^(t_1) ... p_s^(t_s)$
Тогда $c = p_1^(max(r_1, t_1)) ... p_s^(max(r_s, t_s))$ --- наименьшее общее кратное чисел $a$ и $b$
]
#proof[
+ $a divides c, space b divides c$ --- очевидно
+ Пусть $a divides c', space b divides c', space c' = p_1^(m_1) ... p_s^(m_s) p_(s+1)^(m_(s+1)) ... p_n^(m_n)$
$a divides c', space b divides c' ==> r_i <= m_i, space t_i <= m_i, space forall i in {1, ..., s} ==>$
$max(r_i, t_i) <= m_i, space forall i in {1, ..., s} ==> c divides c'$
]
#def[
НОК($a, b$) $<==> lcm(a, b)$ --- положительное значение наименьшего общего кратного чисел $a$ и $b$.
]
#follow[
Пусть $a, b in NN$
Тогда $lcm(a, b) dot.c gcd(a, b) = a b$
]
#proof[
$min(r_i, t_i) + max(r_i, t_i) = r_i + t_i$
] |
https://github.com/julius2718/entempura | https://raw.githubusercontent.com/julius2718/entempura/main/0.0.1/template/template.typ | typst | MIT License | #import "../main.typ": *
|
https://github.com/yhtq/Notes | https://raw.githubusercontent.com/yhtq/Notes/main/复变函数/作业/hw10.typ | typst | #import "../../template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: note.with(
title: "作业10",
author: "YHTQ",
date: none,
logo: none,
withOutlined : false,
withTitle :false,
withHeadingNumbering: false
)
= p154
== 4
由条件知 ${f_n}$ 是正规族,因此有收敛子列。只需证明任意收敛子列都收敛于 $f$ 即可。注意到题中所述性质对子列也成立,不妨就设 $f_n -> f'$,性质表明 $A = {z in G | f' = f}$ 有聚点,且 $f, f'$ 都是解析函数,进而 $f' = f$,证毕!
== 7
往证 $g compose FF$ 局部有界。任取 $z in G$,由 $FF$ 正规知局部有界,进而存在 $r, M$ 使得:
$
norm(f(B(z, r))) subset [0, M], forall f in FF
$
上式表明 $f(B(z, r))$ 是有界集,由条件 $g$ 将在其上有界 $M'$,也即:
$
norm((g compose f) (B(z, r))) subset [0, M'], forall f in FF
$
这就表明 $g compose FF$ 局部有界,证毕!
= p163
== 1
用反证法,假设 $w in.not diff Q$,则 $w in Q$ 是内点。无妨设 $w in overline(B(w, delta)) subset Omega$,并设 $f(z_n) in B(w, delta)$\
由上述假设知:
$
z_n in Inv(f)(overline(B(w, delta)))
$
上式右端是含于 $Omega$ 的闭集,这将导致 $z_n$ 的极限必须含于 $Inv(f)(overline(B(w, delta))) subset Omega$,与条件矛盾!
== 4
考虑:
$
f(z) = (1 + z)/(1 - z)
$
它把 $B(0, 1)$ 映成右半平面,把上半圆盘映成第一象限。
- $e^(pi/2 i) z$ 给出右半圆盘到上半圆盘的解析同胚
- $f(z)$ 给出上半圆盘到第一象限的解析同胚
- $z^2$ 给出第一象限到右半平面的解析同胚(不难验证是单射)
- $Inv(f) (z)$ 给出右半圆盘到圆盘的解析同胚
四者复合即得所求
== 9
- 先用:
$
h_1 (z) = (1-z)/(z + 1)
$
把 $G$ 映成右半平面除去 $1$
- 可以在右半平面中取对数 $ln$,将右半平面映成 ${z | Re z > 0, Im z subset [0, 2 pi i)}$,将右半平面除去 $1$ 映成 ${z | Re z > 0, Im z subset [0, 2 pi i)} - {e}$
- 在上面的区域取 $e^(-z)$,将上面的区域映成 $B(0, 1) - {0, e^(-e)}$
- 以上步骤都是单射,最后,令:
$
f(z) = integral_0^z w(w - e^(-e)) dif w = z^3/3 - 1/2 e^(-e) z^2
$
不难发现 $f'(z)$ 在 $B(0, 1) - {0, e^(-e)}$ 非零,同时:
$
f(z) = f(z_0) <=> z^3/3 - 1/2 e^(-e) z^2 = z_0^3/3 - 1/2 e^(-e) z_0^2\
<=> (z - z_0)(z^2 + z z_0 + z_0^2 - 1/2 e^(-e)(z + z_0)) = 0\
<=> (z - z_0)(z^2 + (z_0 -1/2 e^(-e))z + z_0^2 - 1/2 e^(-e) z_0) = 0\
$
对 $z_0 = 0, e^(-e)$ 均可验证上式在 $B(0, 1) - {0, e^(-e)}$ 中还有一根,进而:
$
f(B(0, 1) - {0, e^(-e)}) = f(B(0, 1))
$
而 $f(B(0, 1))$ 是单连通区域,利用 Riemann 映射定理,得证! |
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/while-03.typ | typst | Other | // Error: 8-25 condition is always true
#while 2 < "hello".len() {}
|
https://github.com/kotfind/hse-se-2-notes | https://raw.githubusercontent.com/kotfind/hse-se-2-notes/master/edu/seminars/2024-10-16.typ | typst | = Обратная связь в учебном процессе
Программа "genially"
== Что такое обратная связь?
<NAME> "Видимое Обучение"
Обратная связь --- коммуникативный обмен информацией о процессе достижения
поставленных целей
Обратная связь --- "правильно ли мы идем к цели"
Для того, чтобы давать нормальную обратную связь, нужно поставить цель
== Что мешает воспринимать обратную связь?
*Три вида триггеров*:
- *Триггер истины*: когда нам кажется, что сказанное несправедливо; сказано
слишком общо
- *Триггер отношений*: когда мы не доверяем источнику обратной связи
- *Триггер идентичности*: когда критика работы воспринимается, как критика
личности
== Роль обратной связи
- Мотивирует учиться
- Уменьшает когнитивную нагрузку
- Снижает тревожность
- Способствует развитию и росту
- Помогает настроить конструктивную коммуникацию
- Помогает понять сильные и слабые стороны
- Помогает определить дальнейшие цели
== Типы обратной связи
- По месту представления:
- До занятия
- После занятия
- По времени:
- Немедленная
- Отсроченная
- По адресату:
- Ученик ученики
- Ученик учителю
- Учитель ученику
- Учитель учителю
- По уровню когнитивной сложности:
- К задаче
- К саморегуляции
- К процессу
- К самому себе
- По форме:
- Устная
- Письменная
- По уровню когнитивной сложности:
- Мотивирующая
- Позитивная
- Корректирующая
- Информирующая
== Виды обратной связи
- *Признание*: благодарность
Цель: поддержка отношений, мотивация
- *Коучинг*: совет и наставление
Цель: помочь освоить, совершенствовать навыки
- *Оценка*: рейтинг, отметка, аттестация
Цель: демонстрация текущего положения дел
Нельзя смешивать эти виды, так как один обесценивает другой
== Формирующая обратная связь
Обратная связь должна помогать в достижении цели, дать информацию о том, что
можно изменить, а не просто констатировать факт плохого знания
== Как давать обратную связь?
- Фокусировка на конкретной работе, процессе, а не о общих знаниях, личности
человека и т.д.
- Предоставить необходимую информацию
- Проработать ложные представления (чтобы каждый раз не давать обратную связь по
одному и тому же вопросу)
- Давать обратную связь своевременно
- Структурировать обратную связь
== Техники обратной связи
=== Бутерброд
- *Похвала*: выделить положительные аспекты в работе (конкретно)
- *Критика*:
- Собственные наблюдения
- Предложения
- *Похвала*: окончание на приятной ноте (довольно абстрактно и не конкретно)
Универсальная техника: для всех типов работ и для всех возрастов
=== BOFF
- *Behaviour*: перечисляем действия ученика, которые привели к проблеме
- *Outcome*: описываем возникшую проблему
- *Feelings*: описываем:
- последствия проблемы
- эмоции, которые она вызывает
- почему этот момент важен
Для точных наук не так актуально
- *Future*: обсуждаем поведение или действия ученика в будущем
Практика пришла из бизнеса
Можно сочетать с бутербродом
=== SOR
- *Standard*: о том, как достичь правильного результата
- *Observation*: рассказ о проблеме
- *Result*: описание последствий проблемы
Тоже из бизнеса
=== Ещё техники обратной связи
- *Билет на выход*:
Ответить на вопрос: "Что было полезного на уроке? Какие вопросы остались?"
- *Примени в жизни*:
Ответить на вопрос: "Что нового я узнал? Как я могу применить в жизни?"
- *Опросник для само-диагностики*:
Заполнить чек-лист: "Что знаю/ не знаю?"
- *3 -- 2 -- 1*:
Назвать:
- 3 факта, которые не знал ранее
- 2 неожиданных факта
- 1 факт, который применим в жизни, учебе
- *Поделись ошибкой*:
Ученики клеют на работы друг друга стикеры с комментариями, что можно
улучшить
- *Карусель*:
Ученики в конкретном порядке дают друг другу обратную связь за конкретное
время
- *Карта понятий*:
Ученик должен вспомнить все основные понятия по теме, выстроить иерархию и
связи
=== Анкета обратной связи
Как создать хорошую анкету:
- Определить цели и задачи анкеты
Понять, что дальше мы будет делать с этой информацией
- Написать вступление к анкете
С информацией:
- сколько времени уйдет на заполнение
- зачем нужно это заполнять
- Разработать понятную инструкцию к вопросам (особенно к открытым)
- Не задавать слишком много вопросов
- Дать достаточно времени
- Сначала общие, а потом конкретные вопросы
- Оставить место для свободных комментариев, предложений
|
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/text/font.typ | typst | // Test configuring font properties.
--- text-font-properties ---
// Set same font size in three different ways.
#text(20pt)[A]
#text(2em)[A]
#text(size: 15pt + 0.5em)[A]
// Do nothing.
#text()[Normal]
// Set style (is available).
#text(style: "italic")[Italic]
// Set weight (is available).
#text(weight: "bold")[Bold]
// Set stretch (not available, matching closest).
#text(stretch: 50%)[Condensed]
// Set font family.
#text(font: "IBM Plex Serif")[Serif]
// Emoji.
Emoji: 🐪, 🌋, 🏞
// Colors.
#[
#set text(fill: eastern)
This is #text(rgb("FA644B"))[way more] colorful.
]
// Transparency.
#block(fill: green)[
#set text(fill: rgb("FF000080"))
This text is transparent.
]
// Disable font fallback beyond the user-specified list.
// Without disabling, New Computer Modern Math would come to the rescue.
#set text(font: ("PT Sans", "Twitter Color Emoji"), fallback: false)
2π = 𝛼 + 𝛽. ✅
--- text-call-body ---
// Test string body.
#text("Text") \
#text(red, "Text") \
#text(font: "Ubuntu", blue, "Text") \
#text([Text], teal, font: "IBM Plex Serif") \
#text(forest, font: "New Computer Modern", [Text]) \
--- text-bad-argument ---
// Error: 11-16 unexpected argument
#set text(false)
--- text-style-bad ---
// Error: 18-24 expected "normal", "italic", or "oblique"
#set text(style: "bold", weight: "thin")
--- text-bad-extra-argument ---
// Error: 23-27 unexpected argument
#set text(size: 10pt, 12pt)
--- text-bad-named-argument ---
// Error: 11-31 unexpected argument: something
#set text(something: "invalid")
--- text-unknown-font-family-warning ---
#text(font: "libertinus serif")[I exist,]
// Warning: 13-26 unknown font family: nonexistent
#text(font: "nonexistent")[but]
// Warning: 17-35 unknown font family: also-nonexistent
#set text(font: "also-nonexistent")
I
// Warning: 23-55 unknown font family: list-of
// Warning: 23-55 unknown font family: nonexistent-fonts
#let var = text(font: ("list-of", "nonexistent-fonts"))[don't]
#var
--- text-font-linux-libertine ---
// Warning: 17-34 Typst's default font has changed from Linux Libertine to its successor Libertinus Serif
// Hint: 17-34 please set the font to `"Libertinus Serif"` instead
#set text(font: "Linux Libertine")
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.