repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/jomaway/typst-teacher-templates | https://raw.githubusercontent.com/jomaway/typst-teacher-templates/main/ttt-worksheet/lib.typ | typst | MIT License | #import "@preview/ttt-utils:0.1.0": components
#import "@preview/chic-hdr:0.4.0": *
#import "@preview/gentle-clues:0.8.0": *
#let worksheet(topic: "", subject: "", authors: "unknown", version: none, columns: 1, body) = {
// Set the document's basic properties.
set document(author: authors, title: topic)
set page(margin: (left: 20mm, right: 20mm, top: 15mm, bottom: 20mm))
authors = if (type(authors) == array) [
#authors.join(", ", last: " and ")
] else [
#authors
]
version = if version != none [
v#version
] else [
changed: #datetime.today().display("[year]-[month]-[day]")
]
// Settings
// Set text size, font and lang
set text(12pt, font: "Rubik", weight: 300, lang: "de")
// Set spacing between lines and Blocksatz.
set par(leading: 1em, justify: true)
// Set header numbering only on the level 1 and 2.
set heading(numbering: (..args) => {
let nums = args.pos()
if nums.len() < 3 {numbering("1.", ..nums)}
})
// Header settings
show: chic.with(
chic-header(
side-width: (auto, 1fr, auto),
left-side: [#components.tag(subject) - #emph(chic-heading-name(fill: true))],
right-side: smallcaps(topic)
),
chic-footer(
left-side: [ #sym.copyright; #datetime.today().display("[year]") #authors - #version],
right-side: counter(page).display("1 / 1", both: true)
),
chic-separator(1pt),
chic-offset(7pt),
chic-height(1.5cm)
)
// Show rules
show heading.where(level: 1): set block(below: 1.1em);
show heading.where(level: 1): set text(weight: 500);
show link: set text(blue);
show raw.where(block: false): it => components.tag(fill: luma(230))[#it]
// Content-Body
body
}
#let title(title) = align(center)[
#text(1.6em, weight: 500, title)
]
#let subtitle(title) = align(center)[
#text(1.2em, title)
]
|
https://github.com/Le-foucheur/Typst-VarTable | https://raw.githubusercontent.com/Le-foucheur/Typst-VarTable/main/examples/trigonometricFunction.typ | typst | MIT License | #set page(width: auto, height: auto, margin: 5pt)
#import "../tabvar.typ": tabvar
#tabvar(
init: (
variable: $x$,
label: (
([sign of cos’], "Sign"),
([variation of cos], "Variation"),
([sign of sin’], "Sign"),
([variation of sin], "Variation"),
),
),
domain: ($0$, $ pi / 2 $, $ pi $, $ (2pi) / 3 $, $ 2 pi $),
content: (
($-$, (), $+$, ()),
(
(top, $1$),
(),
(bottom, $-1$),
(),
(top, $1$),
),
($+$, $-$, (), $+$),
(
(center, $0$),
(top, $1$),
(),
(bottom, $-1$),
(center, $0$),
),
),
) |
https://github.com/kotfind/hse-se-2-notes | https://raw.githubusercontent.com/kotfind/hse-se-2-notes/master/prob/homeworks/to-2024-09-23.typ | typst | = ДЗ 2
== Задача 25 (17)
Нужно чтобы из 5-ти товаров либо 4, либо 5 были с купоном.
Если четыре:
$ P_4 = (C_10000^4 C_490000^1) / C^5_500000 $
Если пять:
$ P_5 = (C_10000^5 C_490000^0) / C^5_500000 = C_10000^5 / C^5_500000 $
Итого:
$ P = P_4 + P_5 = (C_10000^4 C_490000^1 + C_10000^5) / C^5_500000 $
*FIXME:* ответ не сходится
== Задача 26 (19)
Найдем $P(A), P(B), P(A B)$ перебором вариантов.
$ P(A) = 5/6 $
$ P(B) = 1/9 $
$ P(A B) = 1/6 $
Т.к. $ P(A B) = 1/6 != 5/54 = P(A) P(B)$, то *зависимы*
== Задача 17 (20)
$ P(A + B) = P(A) + P(B) - P(A B) $
$ P(A B) = P(A + B) - P(A) - P(B) <= 1 - 1/2 - 1/3 = 1/6 < 3/8 $
== Задача 28 (22)
$ p = 0.01 -> q = 0.99 $
$ 1 - q^n >= 0.95 $
$ 1 - 0.99^n >= 0.95 $
$ 0.05 >= 0.99^n $
$ log(0.05) >= n log(0.99) $
$ log(0.05)/log(0.99) <= n $
$ 298.07... <= n $
$ n = 299 $
== Задача 29 (23)
Студент должен вытянуть либо 3, либо 4, либо 5 счастливых билетов:
$ P = (C^3_20 C^2_5 + C^4_20 C^1_5 + C^5_20) / C^5_25 $
== Задача 30 (31)
$ P(A B) = P(A) P(B) = P(P) -> P(A) = 1 $
$ P(A + B) = 1 $
== Задача 31 (32)
$ P(A B) = P(A) + P(B) - P(A B) = 1/2 + 2/3 - P(A B)
= 7/6 - P(A B) <= 7/6 - 1 = 1/6 $
Верно
== Задача 32 (36)
Вероятность того, что подбросили $n$ раз равна:
$ P_n = 0.5^(n - 1) dot 0.5 = 0.5^n $
То есть $n - 1$ раз выпадала решка и один раз герб.
$ "argmin"_(1 <= n) P_n = 1 $
Ответ. 1
== Задача 33 (37)
$ P(A) = 1/4 $
$ P(B) = 1/2 dot 17/35 $
$ P(A B) = 0 $
$ P(A) P(B) = 17/280 != P(A B) $
Ответ. Зависимы
== Задача 34 (40)
Должны работать: первый и (второй или третий)
$ P = p_1 dot [1 - (1 - p_2)(1 - p_3)]
= 0.8 dot [1 - (1 - 0.7)(1 - 0.6)] = 0.704 $
== Задача 35 (43)
- (a)
$ P_(1 2) = 1 - (1 - p_1)(1 - p_2) = 1 - (1 - 0.8)(1 - 0.7) = 0.94 $
$ P_(1 2 3) = P_(1 2) dot p_3 = 0.564 $
$ P = 1 - (1 - P_(1 2 3))(1 - p_4) = 0.782 $
- (б)
$ P_(1 2) = 0.94 $
$ P_(3 4) = p_3 dot p_4 = 0.3 $
$ P_(3 4 5) = 1 - (1 - P_(3 4))(1 - p_5) = 0.58 $
$ P = P_(1 2) dot P_(3 4 5) dot p_6 = 0.16356 $
== Задача 36 (46)
$ cases(
0.05 = P(A B) = P(B | A) P(A),
0.079 = P(A overline(B)) = P(overline(B) | A) P(A) = (1 - P(B | A)) P(A),
0.089 = P(overline(A) B) = P(B | overline(A)) P(overline(A)),
0.782 = P(overline(A) overline(B))
= P(overline(B) | overline(A)) P(overline(A))
= (1 - P(B | overline(A))) P(overline(A)),
) $
Из (1, 2):
$ P(B | A) / (1 - P(B | A)) = 0.05/0.079 = 0.6329 -> P(B | A) = 0.3876 $
$ P(overline(B) | A) = 1 - P(B | A) = 1 - 0.3876 = 0.6124 $
Из (3, 4):
$ P(B | overline(A)) / (1 - P(B | overline(A))) = 0.089 / 0.782 = 0.1138 ->
P(B | overline(A)) = 0.1022 $
$ P(overline(B) | overline(A)) = 1 - P(B | overline(A)) = 1 - 0.1022 = 0.8978 $
== Задача 37 (47)
Игра закончится на $k$-ом шаге, если $k - 1$ раз выпадет решка и один раз
выпадет орел.
$ P_k = 0.5^(k - 1) dot 0.5 = 0.5^k $
Вероятность того, что игра закончится на четном ходу:
$ P_"чет" = P_2 + P_4 + ... = 0.5^2 + 0.5^4 + ... = 0.25^1 + 0.25^2 + ...
= 0.25 / (1 - 0.25) = 1/3 $
Вероятность того, что игра закончится на нечетном ходу:
$ P_"нечет" = 1 - P_"чет" = 2/3 $
== Задача 38 (85)
$H_1$ --- выбрана урна первого типа
$H_2$ --- выбрана урна второго типа
$A$ --- вытянули белый шар
$ P(A) = P(H_1) P(A | H_1) + P(H_2) P(A | H_2)
= 2/5 dot 1/4 + 3/5 dot 2/4 = 0.4 $
== Задача 39
Найдем значение перебором:
$ P(A) = P(B) = P(C) = 6/36 = 1/6 $
Любая пара или тройка событий означает "на всех выпала одна цифра":
$ P(A B) = P(B C) = P(A C) = P(A B C) = 1/(6^3) = 1 / 216$
События *попарно зависимы* т.к.
$ P(A) P(B) = P(A) P(C) = P(B) P(C) = 1/36 != 1/216$
Т.к. зависимы попарно, то и *совокупно зависимы*.
== Задача 40
- (а)
$A$ --- цель поражена
$ P = P(A) = 1 - (1 - p_1)(1 - p_2)(1 - p_3) $
- (б)
$B$ --- все заряды потрачены.
$B$ происходит, если 1-ый и 2-ой промазали
$ P(B) = (1 - p_1)(1 - p_2) $
$A B$ происходит, если 1-ый и 2-ой промазали, а 3-ий попал:
$ P(A B) = (1 - p_1)(1 - p_2)p_3 $
$ P(A | B) = P(A B) / P(B) = p_3 $
- (в)
$ P(B | A) = P(A B) / P(A) = ((1 - p_1)(1 - p_2)p_3) / (1 - (1 - p_1)(1 - p_2)(1 - p_3)) $
== Задача 41
$ P = 1 - ("все мимо") = 1 - (1 - 0.6)(1- 0.7)(1 - 0.8)
= 1 - 0.4 dot 0.3 dot 0.2 = 0.976 $
|
|
https://github.com/michelebanfi/typst-terraform | https://raw.githubusercontent.com/michelebanfi/typst-terraform/main/README.md | markdown | # Terraform new Typst projects
Simple and easy script to startup new Typst projects (we are not using the real Terraform though)
## Usage
As now, we can specify the name of the project and the name of the user. The script will create a new directory with the name of the project inside `Outputs`
```bash
% python3 terraform.py
Who are you? Miche-lino
What is the title of your new Typst project? Quantum Simulation
Project created successfully
```
Supporting templates:
- [x] Notes
- [x] Lab report
|
|
https://github.com/Treeniks/bachelor-thesis-isabelle-vscode | https://raw.githubusercontent.com/Treeniks/bachelor-thesis-isabelle-vscode/master/chapters/04-main-refinements/completions.typ | typst | #import "/utils/todo.typ": TODO
#import "/utils/isabelle.typ": *
== Completions
The LSP specification defines how completions are supposed to be handled. For this, it defines a `textDocument/completion` request sent by the client @lsp-spec. In particular, the choice of _when_ completions are triggered is up to the client. They typically trigger them automatically for certain trigger characters that were typed, although most of them also offer a keybind to manually request completions. The client may choose which characters count as such trigger characters, and many also offer the user the option to overwrite this set in their preferences. The language server can additionally send a list of trigger characters within its capabilities during the initialization stage described in @back:lsp-initialization.
Completions were already implemented in the Isabelle language server. The generation of the completions used the same internal system that #jedit uses, meaning the completions sent by the language server are identical to those offered by #jedit.
=== Completions Items Not Showing
Isabelle's completions concern primarily Isabelle symbols, although completions for other things, such as keywords, are also offered. We will differentiate Isabelle's completions into three different categories:
1. Symbol completions for abbreviations.
2. Symbol completions for ASCII representations.
3. Any other types of completions.
Curiously, in #vscode, only categories 2 and 3 worked; category 1 did not. In Neovim, categories 1 and 3 worked; category 2 did not. Since completions are part of the standard LSP spec, handling these completions is not done within the Isabelle extensions but instead in the standard language client implementations. Although, in Neovim, the standard language client does not offer completions out of the box, so an additional plugin is required, for which we used `nvim-cmp` #footnote[https://github.com/hrsh7th/nvim-cmp].
The core problem is that completions in the LSP are meant to work in an additive fashion. If the user writes `con` in JavaScript, it should be possible to complete to `console`. Note that the text the user wrote originally is a prefix of the completed text. This is not necessarily the case for Isabelle: In #jedit, the user can complete #isabelle(`\Longright`) to #isabelle(`\<Longrightarrow>`), which in turn gets displayed as #isabelle(`⟹`). An abbreviation like #isabelle(`<=`) should be completed to #isabelle(`\<le>`), which gets displayed as #isabelle(`≤`). For the language server, it may even be that the completion should insert #isabelle(`⟹`) or #isabelle(`≤`) directly, depending on the options described in @symbol-options. These non-prefix completions are called _flex_ completions, which the LSP does not intend to handle.
However, the Isabelle language server sends these flex completions anyway, and it is up to the client whether it wants to display them. Clients are supposed to implement a filter for these completions, and this filter is intentionally not defined in the LSP specification to allow consistency across languages within the editor. Therefore, different clients may use vastly different approaches for these filters, causing the aforementioned inconsistency issues.
There are discussions for supporting flex completions within the LSP #footnote[https://github.com/microsoft/language-server-protocol/issues/651]. For our case, we made use of the `filterText` string, which can optionally be provided for a completion item. This text is supposed to be used when filtering. Setting this text to be equivalent to what the user wrote so far (#isabelle(`\Longright`) in our previous example) should force all filters to show the completion no matter what.
This fixed the original issue but introduced a new problem specifically in #vscode: Now, while writing out #isabelle(`\Longright`), the completion overlay would fade in and out at every second keystroke. This meant that, while #isabelle(`\Longright`) could be completed, #isabelle(`\Longrigh`) could not. This only manifested within #vscode and was no problem in Neovim. To solve this, we modified some tangential values in #vscode's settings and its Isabelle grammar, although we could not figure out the actual source of the problem. #vscode is based on VSCode version `1.70.1`, released on 11 August 2022. It may be that by upgrading, the problem disappears as well. Unfortunately, we could not verify this hypothesis due to time constraints.
We also found certain other language clients reacting rather strangely to provided `filterText`s. In Sublime Text, for example, the `filterText` is not just used during filtering but is also displayed to the user as the completion item itself. This means that the user is shown the choice of completing #isabelle(`\Long`) with the three options #isabelle(`\Long`), #isabelle(`\Long`) or #isabelle(`\Long`), even though the completions are supposed to show #isabelle(`\<Longleftarrow>`) (#isabelle(`⟸`)), #isabelle(`\<Longrightarrow>`) (#isabelle(`⟹`)) and #isabelle(`\<Longleftrightarrow>`) (#isabelle(`⟺`)).
=== Immediate Completions and Commit Characters
Isabelle marks certain completions as _immediate_. If a completion is the only one available and marked as immediate, #jedit inserts the completion without further user intervention. That way, a user can write #isabelle(`==>`) and have it instantly replaced by #isabelle(`\<Longrightarrow>`) (#isabelle(`⟹`)).
To replicate this functionality in #vscode, we used the LSP's `commitCharacters` list, which can be added to a completion item. #cite(form: "prose", <lsp-spec>) describes this list as: #quote[An optional set of characters that when pressed while this completion is active will accept it first and then type that character.]
In the language server, we now check if the completion item is unique (i.e. there are no other completions) and immediate. If so, we set `commitCharacters` to a list containing _most_ writeable characters (the ASCII range `0x20`: Space to `0x7E`: \~ to be exact). That way, while the immediate insertion of the completion that #jedit does is not replicated, once the user types virtually any additional character, the completion is inserted.
Note that while VSCode supports this feature, that does not seem to be the case for all language clients. Both Neovim and Sublime Text ignored this list in our testing.
// === Previous Abbreviation Modules in #vscode
//
// Before the introduction of completions into the Isabelle language server, abbreviations were handled entirely from within the Isabelle VSCode extension.
//
// #TODO[
// - completions were reworked
// - due to lsp completions changes, client-sided abbreviation support is not needed
// - 3 whole modules could be outright removed
// ]
|
|
https://github.com/rabotaem-incorporated/calculus-notes-2course | https://raw.githubusercontent.com/rabotaem-incorporated/calculus-notes-2course/master/sections/05-complex-functions/03-analytical-continuation.typ | typst | #import "../../utils/core.typ": *
== Аналитическое продолжение
#def(label: "def-analitical-continuation")[
Пусть $f in H(Omega)$, $g in H(tilde(Omega))$. $Delta$ --- компонента связности $Omega sect tilde(Omega)$. Если $f(z) = g(z)$ на $Delta$, то $g$ --- _непосредсвенное аналитическое продолжение $f$ на $tilde(Omega)$ через $Delta$_.
#figure(
image("../../images/direct-analytical-continuation.svg", width: 10cm),
caption: [Пример функции, у которой, возможно, неоднозначно определено непосредственное аналитическое продолжение на $tilde(Omega)$.]
)
Под компонентой связности здесь подразумевается какое-то максимальное по включению связное подмножество, ну, или элемент факторизации множества по отношению достижимости.
]
#notice[
1. Если $Delta$ зафиксирована, то продолжение единственно#rf("uniqueness").
2. Если выбрать другую компоненту связности и продолжить, то может получиться другая функция.
]
#def(label: "def-chain-analitical-continuation")[
Пусть $f in H(Omega)$, $g in H(tilde(Omega))$. _$g$ --- аналитическое продолжение по цепочке областей_, если существуют области $Omega_0 = Omega$, $Omega_1$, $Omega_2$, ..., $Omega_n = tilde(Omega)$, такие, что $f_0 equiv f$, $f_1 in H(Omega_1)$, $f_2 in H(Omega_2)$, ..., $f_(n - 1) in H(Omega_(n - 1))$, $f_n = g$ и $f_k$ --- непосредственное аналитическое продолжение $f_(k - 1)$#rf("def-analitical-continuation").
#figure(
image("../../images/chain-analytical-continuation.svg"),
caption: [Подозрительное аналитическое продолжение по цепочке областей.]
)
]
#notice[
1. Продолжение по цепочке областей зависит от выбора областей связности в цепочке.
2. Все промежуточные области можно сделать кругами. Рассмотрим для этого кривую из одной области в другую, покроем эту кривую кругами, и выберем конечное подпокрытие.
]
#example(label: "gamma-continuation")[
$Gamma$-функция. Пусть $Gamma(z) := integral_0^(+oo) t^(z - 1) e^(-t) dif t$. Знаем $t^z := e^(z ln t)$, $ abs(t^z) = abs(e^(z ln t)) = e^(ln t dot Re z) = t^(Re z). $
Значит под интегралом стоит штука, которая по модулю ограничена $t^(Re z - 1) e^(-t)$, а при $Re z > 0$, интеграл абсолютно сходится. Значит $Gamma in H(Re z > 0)$, ведь $Gamma'(z) = integral_0^(+oo) t^(z - 1) ln(t) e^(-t) dif t$, так как $abs(t^(z - 1) ln t e^(-t)) = t^(Re z - 1) abs(ln t) e^(-t)$.
У нас есть формула $z Gamma(z) = Gamma(z + 1)$, она верна для $z > 0$, а значит, по теореме о единственности, верна для $Re z > 0$. Тогда $Gamma(z) = Gamma(z + 1) / z$. Рассмотрим функцию $Gamma_1(z) := Gamma(z + 1)/z in H(Re z > -1)$. Это лежит в $H({Re z > -1} without {0})$, и это аналитическое продолжение. Далее рассмотрим $Gamma_2(z) := Gamma(z + 2) / (z (z + 1)) in H({Re z > -2} without {0, -1})$. Ну и так далее. Можно дальше продолжать $Gamma$ на $CC without {0, -1, -2, ...}$
]
#example(label: "def-reimann-zeta")[
$zeta$-функция Римана.
$ zeta(z) = sum_(n = 1)^oo 1/(n^z). $
Так как $abs(n^z) = n^(Re z)$, при $Re z > 1$, ряд абсолютно сходится. Попробуем продифференцировать,
$
zeta'(z) = -sum_(n = 1)^oo ln(n)/n^z.
$
Так как $abs((ln n)/(n^z)) <= (ln z)/(n^a)$, для какого-то $1 < a < Re z$. По признаку Вейерштрасса, ряд сходится абсолютно равномерно при $Re z > a$, и можно дифференцировать. Значит $zeta in H(Re z > 1)$.
Заметим, что
$
(1 - 2/(2^z)) zeta(z) = sum_(n = 1)^oo (-1)^(n - 1)/(n^z) "при" Re z > 1.
$
Действительно,
$
(1 - 2/(2^z)) zeta(z) = sum_(n = 1)^oo 1/(n^z) - 2 sum_(n = 1)^oo 1/(2n)^z = sum_(n = 1)^oo (-1)^(n - 1)/(n^z).
$
А штука справа голоморфна, при $Re z > 0$, так как $1/(2n - 1)^z - 1/(2n)^z sim z/(2n)^(z + 1)$. Для производной тоже будет сходимость (опустим эти вычисления).
Формула
$
1/(1 - 2/(2^z)) sum_(n = 1)^oo (-1)^(n - 1)/(n^z) = zeta(z)
$
Задает продолжение в ${Re z > 0} without {1}$. Можно продолжать функцию и далее, до $CC without {"какое-то множество, разберитесь сами"}$.
]
#def(label: "def-complete-analytical-fn")[
Разобьем множество пар $(f, Omega)$, где $f in H(Omega)$ на классы эквивалентности по отношению эквивалентности --- аналитическое продолжение по цепочке. Назовем класс эквивалентности _полной аналитической функцией_.
Если $F$ --- полная аналитическая функция, то
множество $M := Union_((f, Omega) in F) Omega$ --- область существования $F$.
Обозначим ${f(z) : (f, Omega) in F and z in Omega}$ _значением полной аналитической функции в точке $z$_.
]
#pr[
$M$ --- область.
]
#proof[
Объединение открытых --- открыто.
Связность: пусть $z_0 in Omega_0$ ($(f_0, Omega_0) in F$), $z_* in Omega_*$ ($(f_*, Omega_*) in F$). Возьмем множества из аналитического продолжения $f_0$, и пойдем по этим множествам. Получили связность.
]
#notice[
Теорема Пуанкаре-Вольтерры: $F(z)$ --- не более чем счетное для любого $z in M$. (Пока?) не успели.
]
#example[
$f(z) = sum_(n = 0)^oo z^n in H({abs(z) < 1})$. Тогда $g(z) = 1/(1 - z) in H(CC without {1})$ --- аналитическое продолжение $f$.
$
1/(1 - z) = 1/(1 - a) dot 1/(1 - (z - a)/(1 - a)) = 1/(1 - a) dot sum_(n = 0)^oo ((z - a)/(1 - a))^n = sum_(n = 0)^oo (z - a)^n/(1 - a)^(n + 1).
$
Радиус сходимости в таком случае --- $abs(1 - a)$.
]
#def(label: "def-special-point")[
$f(z) = sum_(n = 0)^oo c_n (z - a)^n$, $abs(z - a) < R$. Рассмотрим точку $b$ такую, что $abs(b - a) = R$. Назовем $b$ --- _правильной_ точкой, если существует $g in H({abs(z - b) < r})$ такая, что она на пересечении ${abs(z - a) < R} sect {abs(z - b) < r}$ она совпадает с $f$. Иначе, назовем точку _особой_.
]
#th(label: "special-point-on-bound")[
На границе круга сходимости обязательно есть особая точка#rf("def-special-point").
]
#proof[
Пусть круг сходимости имеет центр центром в нуле, $R$ --- его радиус. Пусть все точки $abs(z) = R$ --- правильные#rf("def-special-point"). Берем $abs(a) = R$. Она правильная. Значит существует радиус $r_a > 0$ и $f_a in H(abs(z - a) < r_a)$ и совпадающая с $f$ на пересечении.
Такими кружочками мы покрыли окружность. Выберем конечное подпокрытие. ${abs(z) = R} subset Union_(k = 1)^n {abs(z - a_k) < r_(a_k)} =: Omega$. Построим
$
g(z) := cases(
f(z)\, abs(z) < R,
f_(a_k) (z)\, abs(z - a_k) < r_(a_k)
).
$
Эта функция голоморфна.
Осталось показать, что $Omega$ содержит круг ${abs(z) < R + eps}$ для некоторого $eps$. $g$ определена на $Union_(k = 1)^n {abs(z - a_k) < r_(a_k)} union {abs(z) < R}$. Возьмем в качестве $eps$ число из леммы Лебега. Напомню, что это такой радиус, что для любой точки $b$: $abs(b) = R$, шарик ${abs(z - b) < eps}$ полностью содержится в каком-то элементе покрытия. Нашли что хотели.
]
#examples[
1. $sum_(n = 1)^oo z^n / n^2$ сходится при $abs(z) <= 1$, но при $z = 1$ продолжения нет.
2. $sum_(n = 1)^oo z^(2^n)$ сходится при $abs(z) < 1$, но все точки на границе особые.
]
|
|
https://github.com/Dherse/masterproef | https://raw.githubusercontent.com/Dherse/masterproef/main/common/info.typ | typst | #import "./colors.typ": *
#let info-settings = (
info: (
prefix: none,
icon: "circle-info",
fill_color: ugent-blue.lighten(90%),
stroke_color: ugent-blue,
),
definition: (
prefix: [#underline(smallcaps[*Definition*])#smallcaps[:]],
icon: "highlighter-solid",
fill_color: caribbean-current.lighten(90%),
stroke_color: caribbean-current,
),
question: (
prefix: none,
icon: "circle-question",
fill_color: proper-purple.lighten(90%),
stroke_color: proper-purple,
),
important: (
prefix: none,
icon: "circle-exclamation",
fill_color: rgb("#228B22").lighten(90%),
stroke_color: rgb("#228B22").darken(20%),
),
conclusion: (
prefix: none,
icon: "lightbulb-solid",
fill_color: earth-yellow.lighten(90%),
stroke_color: earth-yellow,
),
good: (
prefix: none,
icon: "circle-check",
fill_color: rgb("#FFD700").lighten(90%),
stroke_color: rgb("#FFD700").darken(20%),
),
note: (
prefix: [ *Note:* ],
icon: "note-sticky",
fill_color: rgb("#FFD700").lighten(90%),
stroke_color: rgb("#FFD700").darken(20%),
),
);
#let info-stroke(kind: "good") = info-settings.at(kind).stroke_color
#let info-image(kind: "info", ..args) = {
let settings = info-settings.at(kind);
image(
"./assets/solid/" + settings.icon + ".svg", ..args,
alt: settings.icon,
)
}
#let __ubox(body, kind: "info", radius: 5pt, footer: none, icon: true) = {
show par: set block(spacing: 0pt)
let settings = info-settings.at(kind);
let extra = if footer == none {
none
} else {
linebreak()
h(1fr)
underline[#footer]
}
let contents = if icon {
(
image("./assets/" + settings.icon + ".svg", width: 32pt),
{
settings.prefix
body
extra
}
)
} else {
(
{
settings.prefix
body
extra
},
)
}
box(
width: 0.8fr,
fill: settings.fill_color,
stroke: 1pt + settings.stroke_color,
radius: radius,
inset: 0pt,
table(
columns: if icon { (38pt, 1fr) } else { 1 },
inset: 9.6pt,
stroke: none,
align: horizon,
..contents,
)
)
}
// An info box.
#let uinfo(body, footer: none) = __ubox(body, kind: "info", footer: footer)
// A definition box.
#let udefinition(body, footer: none) = __ubox(body, kind: "definition", footer: footer)
// A question box.
#let uquestion(body, footer: none) = __ubox(body, kind: "question", footer: footer)
// An important box.
#let uimportant(body, footer: none) = __ubox(body, kind: "important", footer: footer)
// A conclusion box.
#let uconclusion(body, footer: none) = __ubox(body, kind: "conclusion", footer: footer)
// A good box.
#let ugood(body, footer: none) = __ubox(body, kind: "good", footer: footer)
// A note box.
#let unote(body, footer: none) = __ubox(body, kind: "note", footer: footer) |
|
https://github.com/liuguangxi/erdos | https://raw.githubusercontent.com/liuguangxi/erdos/master/Problems/typstdoc/figures/p24_1.typ | typst | #import "@preview/cetz:0.2.1"
#cetz.canvas({
import cetz.draw: *
let a = 3
line((0, 0), (a, 0), (a/2, a/2*calc.sqrt(3)), close: true)
content((a/2, -a/6), box[LEVEL 1])
let os = 4
line((os+0, 0), (os+3, 0), (os+a/2, a/2*calc.sqrt(3)), close: true)
line((os+a/4, a/4*calc.sqrt(3)), (os+a*3/4, a/4*calc.sqrt(3)))
line((os+a/4, a/4*calc.sqrt(3)), (os+a/2, 0))
line((os+a/2, 0), (os+a*3/4, a/4*calc.sqrt(3)))
content((os+a/2, -a/6), box[LEVEL 2])
let os = 8
line((os+0, 0), (os+3, 0), (os+a/2, a/2*calc.sqrt(3)), close: true)
line((os+a*3/8, a*3/8*calc.sqrt(3)), (os+a*5/8, a*3/8*calc.sqrt(3)))
line((os+a/4, a/4*calc.sqrt(3)), (os+a*3/4, a/4*calc.sqrt(3)))
line((os+a/8, a/8*calc.sqrt(3)), (os+a*7/8, a/8*calc.sqrt(3)))
line((os+a*3/8, a*3/8*calc.sqrt(3)), (os+a*3/4, 0))
line((os+a/8, a/8*calc.sqrt(3)), (os+a/4, 0))
line((os+a/4, a/4*calc.sqrt(3)), (os+a/2, 0))
line((os+a/4, 0), (os+a*5/8, a*3/8*calc.sqrt(3)))
line((os+a/2, 0), (os+a*3/4, a/4*calc.sqrt(3)))
line((os+a*3/4, 0), (os+a*7/8, a/8*calc.sqrt(3)))
content((os+a/2, -a/6), box[LEVEL 4])
let os = 12
content((os+a/2, a/2), box[... ... ... ...])
})
|
|
https://github.com/PgBiel/typst-diagbox | https://raw.githubusercontent.com/PgBiel/typst-diagbox/main/examples/example.typ | typst | Apache License 2.0 | #import "../diagbox.typ": *
Using `auto` columns is very convenient when it is the largest cell
in that column:
```typ
#table(
columns: (auto, auto, auto),
align: horizon + center,
bdiagbox[Names][Properties], [*Can Walk*], [*Can Run*],
[*Character A*], [Yes], [No],
[*Character B*], [No], [No]
)
```
#table(
columns: (auto, auto, auto),
align: horizon + center,
bdiagbox[Names][Properties], [*Can Walk*], [*Can Run*],
[*Character A*], [Yes], [No],
[*Character B*], [No], [No]
)
\
Note that this fails when the diagbox is not the largest cell:
```typ
#table(
columns: (auto, auto, auto),
align: horizon + center,
bdiagbox[Names][Properties], [*Can Walk*], [*Can Run*],
[*Long Long Long Character A*], [Yes], [No],
[*Long Long Long Character B*], [No], [No]
)
```
#table(
columns: (auto, auto, auto),
align: horizon + center,
bdiagbox[Names][Properties], [*Can Walk*], [*Can Run*],
[*Long Long Long Character A*], [Yes], [No],
[*Long Long Long Character B*], [No], [No]
)
\
Instead, you will have to specify sizes manually in such cases:
```typ
#let fst_column_size = 15em;
#table(
columns: (fst_column_size, auto, auto),
align: horizon + center,
bdiagbox(width: fst_column_size)[Names][Properties], [*Can Walk*], [*Can Run*],
[*Long Long Long Character A*], [Yes], [No],
[*Long Long Long Character B*], [No], [No]
)
```
#[
#let fst_column_size = 15em;
#table(
columns: (fst_column_size, auto, auto),
align: horizon + center,
bdiagbox(width: fst_column_size)[Names][Properties], [*Can Walk*], [*Can Run*],
[*Long Long Long Character A*], [Yes], [No],
[*Long Long Long Character B*], [No], [No]
)
]
You can also have diagonal lines pointing in the opposite direction, using `tdiagbox`:
#block(breakable: false)[```typ
#let third_column_size = 5em;
#table(
columns: (auto, auto, third_column_size),
align: horizon + center,
bdiagbox[Names][Properties], [*Can Walk*], [*Can Run*],
[*Character A*], [Yes], [No],
[*Character B*], [No], tdiagbox(width: third_column_size)[A][B]
)
```]
#[
#let third_column_size = 5em;
#table(
columns: (auto, auto, third_column_size),
align: horizon + center,
bdiagbox[Names][Properties], [*Can Walk*], [*Can Run*],
[*Character A*], [Yes], [No],
[*Character B*], [No], tdiagbox(width: third_column_size)[A][B]
)
]
If your table has a custom `inset` (inner padding) property, make sure to pass it along:
```typ
#let third_column_size = 5em;
#let inset = 20pt;
#table(
columns: (auto, auto, third_column_size),
align: horizon + center,
inset: inset,
bdiagbox(inset: inset)[Names][Properties], [*Can Walk*], [*Can Run*],
[*Character A*], [Yes], [No],
[*Character B*], [No], tdiagbox(inset: inset, width: third_column_size)[A][B]
)
```
#[
#let third_column_size = 5em;
#let inset = 20pt;
#table(
columns: (auto, auto, third_column_size),
align: horizon + center,
inset: inset,
bdiagbox(inset: inset)[Names][Properties], [*Can Walk*], [*Can Run*],
[*Character A*], [Yes], [No],
[*Character B*], [No], tdiagbox(inset: inset, width: third_column_size)[A][B]
)
]
You may specify a standalone (table-less) diagbox with `inset: 0pt`
and `box_stroke: 1pt`:
```typ
#bdiagbox(inset: 0pt, box_stroke: 1pt)[Part A][Part B]
```
#bdiagbox(inset: 0pt, box_stroke: 1pt)[Part A][Part B]
Additionally, diagboxes have many more properties
which enable near-full customization. Most were inspired
by the `diagbox` LaTeX package.
For example, you may customize the box and line colors and sizes:
```typ
#bdiagbox(
inset: 0pt,
box_stroke: teal + 3pt, line_stroke: yellow + 2pt
)[Part A][Part B]
```
#bdiagbox(
inset: 0pt,
box_stroke: teal + 3pt, line_stroke: yellow + 2pt
)[Part A][Part B]
Use `left_sep` and `right_sep` to move text horizontally
without resizing the box:
```typ
#bdiagbox(
width: 10em,
inset: 0pt, box_stroke: 1pt, // standalone
left_sep: 3em, right_sep: -0.5em
)[Part A][Part B]
```
#bdiagbox(
width: 10em,
inset: 0pt, box_stroke: 1pt,
left_sep: 3em, right_sep: -0.5em
)[Part A][Part B]
Use `left_outer_sep` and `right_outer_sep` to move the diagonal line
horizontally (its start and its end, respectively):
```typ
#tdiagbox(
width: 10em,
inset: 0pt, box_stroke: 1pt, // standalone
left_outer_sep: 1.5em, right_outer_sep: 4em
)[Part A][Part B]
```
#tdiagbox(
width: 10em,
inset: 0pt, box_stroke: 1pt,
left_outer_sep: 1.5em, right_outer_sep: 4em
)[Part A][Part B]
Also note that the box's inner width (that is, total width minus
inset padding) is calculated with `width - 2*inset`; you may specify
the `inner_width` parameter to override that.
(But you will generally want to specify just `width`, as it corresponds
directly to the width of the table column the diagbox is in.)
You can also use `height` if you want to define a custom, fixed height
for your box:
```typ
#tdiagbox(
width: 10em, height: 5em,
inset: 0pt, box_stroke: 1pt, // standalone
)[Part A][Part B]
```
#tdiagbox(
width: 10em, height: 5em,
inset: 0pt, box_stroke: 1pt, // standalone
)[Part A][Part B]
|
https://github.com/syrkis/esch | https://raw.githubusercontent.com/syrkis/esch/main/typ/lib.typ | typst | MIT License | #import "@preview/touying:0.5.2": *
#let slide(
config: (:),
repeat: auto,
setting: body => body,
composer: auto,
..bodies,
) = touying-slide-wrapper(self => {
let header(self) = {
// text(utils.call-or-display(self, self.store.header))
set text(size: 1.3em)
place(left, dx: 1.5em, dy: 1.5em, utils.call-or-display(self, utils.call-or-display(self, self.store.header)))
}
let footer(self) = {
set text(size: 0.8em)
place(right, dx: -2em, utils.slide-counter.display() + " of " + utils.last-slide-number)
}
let self = utils.merge-dicts(
self,
config-page(
header: header,
footer: footer,
),
)
touying-slide(self: self, config: config, repeat: repeat, setting: setting, composer: composer, ..bodies)
})
/// Outline slide for the presentation.
#let cover-slide(leading: 50pt) = touying-slide-wrapper(self => {
set text(size: 28pt)
set par(leading: leading)
let body = {
grid(
columns: (1fr, 1fr),
rows: (1fr),
gutter: 3em,
align(
center + horizon,
{
set par(leading: 20pt)
context {
text(self.info.title)
v(1em)
text(size: 20pt, weight: "regular", self.info.author)
if self.info.institution != none {
v(0.1em)
text(size: 20pt, weight: "regular", self.info.institution)
}
if self.info.date != none {
v(0.1em)
text(
size: 14pt,
utils.display-info-date(self),
)
}
}
}
),
align(
left + horizon,
{
set par(leading: leading)
set text(size: 24pt)
components.custom-progressive-outline(
level: none,
depth: 1,
numbered: (true,),
)
},
),
)
}
self = utils.merge-dicts(
self,
config-common(freeze-slide-counter: true),
config-page(
margin: 0em,
),
)
touying-slide(self: self, body)
})
#let focus-slide(body) = touying-slide-wrapper(self => {
self = utils.merge-dicts(
self,
config-common(freeze-slide-counter: true),
)
touying-slide(self: self, align(horizon + center, body))
})
#let escher-theme(
aspect-ratio: "16-9",
header: self => utils.display-current-heading(depth: self.slide-level),
footer: context utils.slide-counter.display(),
..args,
body,
) = {
set text(size: 20pt)
// set heading(numbering: "1 |")
show heading.where(level: 1): set heading(numbering: "1 |")
show heading.where(level: 2): set heading(numbering: "1.1 |")
show: touying-slides.with(
config-page(
paper: "presentation-" + aspect-ratio,
margin: (x: 4em, top: 4.5em, bottom: 3em),
),
config-common(
slide-fn: slide,
datetime-format: "[month repr:long] [day padding:none], [year]"
),
config-methods(
init: (self: none, body) => {
show strong: self.methods.alert.with(self: self)
body
},
alert: utils.alert-with-primary-color,
),
// save the variables for later use
config-store(
align: align,
header: header,
footer: footer,
),
..args,
)
// Global style ////////////////////////////////////////////////
set text(font: "New Computer Modern")
set par(leading: 1.5em)
set align(horizon)
set list(marker: "▶")
/////////////////////////////////////////////////////////////////
body
}
|
https://github.com/daskol/typst-templates | https://raw.githubusercontent.com/daskol/typst-templates/main/cvpr/main.typ | typst | MIT License | #import "/cvpr.typ": cvpr2025, conf-name, conf-year, eg, etal, indent
#import "/logo.typ": LaTeX, TeX
#let affls = (
one: (institution: "Institution1", location: "Institution1 address"),
two: (
institution: "Institution2",
location: "First line of institution1 address"),
airi: ("AIRI", "Moscow", "Russia"),
skoltech: (
department: "AI Center",
institution: "Skoltech",
location: "Moscow",
country: "Russia"),
)
#let authors = (
(name: "<NAME>", affl: ("one", ), email: "<EMAIL>"),
(name: "<NAME>", affl: ("two", ), email: "<EMAIL>"),
)
#show: cvpr2025.with(
title: [#LaTeX Author Guidelines for #conf-name~Proceedings],
authors: (authors, affls),
keywords: (),
abstract: [
The ABSTRACT is to be in fully justified italicized text, at the top of the
left-hand column, below the author and affiliation information. Use the
word "Abstract" as the title, in 12-point Times, boldface type, centered
relative to the column, initially capitalized. The abstract is to be in
10-point, single-spaced type. Leave two blank lines after the Abstract,
then begin the main text. Look at previous CVPR abstracts to get a feel for
style and length.
],
bibliography: bibliography("main.bib"),
accepted: false,
id: none,
)
= Introduction <sec:intro>
Please follow the steps outlined below when submitting your manuscript to the
IEEE Computer Society Press. This style guide now has several important
modifications (for example, you are no longer warned against the use of sticky
tape to attach your artwork to the paper), so all authors should read this new
version.
== Language
All manuscripts must be in English.
== Dual submission
Please refer to the author guidelines on the #conf-name #conf-year web page for
a discussion of the policy on dual submissions.
== Paper length
Papers, excluding the references section, must be no longer than eight pages in
length. The references section will not be included in the page count, and
there is no limit on the length of the references section. For example, a paper
of eight pages with two pages of references would have a total length of 10
pages. *There will be no extra page charges for #conf-name #conf-year.*
Overlength papers will simply not be reviewed. This includes papers where the
margins and formatting are deemed to have been significantly altered from those
laid down by this style guide. Note that this #LaTeX guide already sets figure
captions and references in a smaller font. The reason such papers will not be
reviewed is that there is no provision for supervised revisions of manuscripts.
The reviewing process cannot determine the suitability of the paper for
presentation in eight pages if it is reviewed in eleven.
== The ruler
The #LaTeX style defines a printed ruler which should be present in the version
submitted for review. The ruler is provided in order that reviewers may comment
on particular lines in the paper without circumlocution. If you are preparing a
document using a non-#LaTeX document preparation system, please arrange for an
equivalent ruler to appear on the final output pages. The presence or absence
of the ruler should not change the appearance of any other content on the page.
The camera-ready copy should not contain a ruler. (#LaTeX users may use options
of `cvpr.sty` to switch between different versions.)
Reviewers: note that the ruler measurements do not align well with lines in the
paper --- this turns out to be very difficult to do well when the paper
contains many figures and equations, and, when done, looks ugly. Just use
fractional references (#eg., this line is $087.5$), although in most cases one
would expect that the approximate location will be adequate.
== Paper ID
Make sure that the Paper ID from the submission system is visible in the
version submitted for review (replacing the "\*\*\*\*\*" you see in this
document). If you are using the #LaTeX template, *make sure to update paper ID
in the appropriate place in the tex file*.
== Mathematics
Please number all of your sections and displayed equations as in these
examples:
$ E = m dot.c c^2 $ <eq:important>
and
$ v = a dot.c t. $ <eq:also-important>
It is important for readers to be able to refer to any particular equation.
Just because you did not refer to it in the text does not mean some future
reader might not need to refer to it. It is cumbersome to have to use
circumlocutions like "the equation second from the top of page 3 column 1".
(Note that the ruler will not be present in the final copy, so is not an
alternative to equation numbers). All authors will benefit from reading
Mermin's description of how to write mathematics:
#link("http://www.pamitc.org/documents/mermin.pdf").
== Blind review
Many authors misunderstand the concept of anonymizing for blind review. Blind
review does not mean that one must remove citations to one's own work --- in
fact it is often impossible to review a paper unless the previous citations are
known and available.
Blind review means that you do not use the words "my" or "our" when citing
previous work. That is all. (But see below for tech reports.)
Saying "this builds on the work of <NAME> [1]" does not say that you are
<NAME>; it says that you are building on her work. If you are <NAME>
Jones, do not say "as we show in [7]", say "as Smith and Jones show in [7]" and
at the end of the paper, include reference 7 as you would any other cited work.
An example of a bad paper just asking to be rejected:
#quote(block: true)[
#h(1.5em)
An analysis of the frobnicatable foo filter.
In this paper we present a performance analysis of our previous paper [1],
and show it to be inferior to all previously known methods. Why the previous
paper was accepted without this analysis is beyond me.
[1] Removed for blind review
]
An example of an acceptable paper:
#quote(block: true)[
#h(1.5em)
An analysis of the frobnicatable foo filter.
In this paper we present a performance analysis of the paper of Smith #etal
[1], and show it to be inferior to all previously known methods. Why the
previous paper was accepted without this analysis is beyond me.
[1] <NAME> and <NAME>. "The frobnicatable foo filter, a fundamental
contribution to human knowledge". Nature 381(12), 1-213.
]
#indent
If you are making a submission to another conference at the same time, which
covers similar or overlapping material, you may need to refer to that
submission in order to explain the differences, just as you would if you had
previously published related work. In such cases, include the anonymized
parallel submission~@Authors14 as supplemental material and cite it as
#quote(block: true)[
[1] Authors. "The frobnicatable foo filter", F\&G 2014 Submission ID 324,
Supplied as supplemental material `fg324.pdf`.
]
#indent
Finally, you may feel you need to tell the reader that more details can be
found elsewhere, and refer them to a technical report. For conference
submissions, the paper must stand on its own, and not _require_ the reviewer to
go to a tech report for further details. Thus, you may say in the body of the
paper "further details may be found in~@Authors14b". Then submit the tech
report as supplemental material. Again, you may not assume the reviewers will
read this material.
Sometimes your paper is about a problem which you tested using a tool that is
widely known to be restricted to a single institution. For example, let's say
it's 1969, you have solved a key problem on the Apollo lander, and you believe
that the CVPR70 audience would like to hear about your solution. The work is a
development of your celebrated 1968 paper entitled "Zero-g frobnication: How
being the only people in the world with access to the Apollo lander source code
makes us a wow at parties", by Zeus #etal.
You can handle this paper like any other. Do not write "We show how to improve
our previous work [Anonymous, 1968]. This time we tested the algorithm on a
lunar lander [name of lander removed for blind review]". That would be silly,
and would immediately identify the authors. Instead write the following:
#quote(block: true)[
We describe a system for zero-g frobnication. This system is new because it
handles the following cases: A, B. Previous systems [Zeus et al. 1968] did
not handle case B properly. Ours handles it by including a foo term in the
bar integral.
#linebreak()
#indent
...
#linebreak()
#indent
The proposed system was integrated with the Apollo lunar lander, and went all
the way to the moon, don't you know. It displayed the following behaviours,
which show how well we solved cases A and B: ...
]
As you can see, the above text follows standard scientific convention, reads
better than the first version, and does not explicitly name you as the authors.
A reviewer might think it likely that the new paper was written by Zeus #etal,
but cannot make any decision based on that guess. He or she would have to be
sure that no other authors could have been contracted to solve problem B.
#v(16pt, weak: true)
#block[
FAQ
\
*Q:* Are acknowledgements OK? \
*A:* No. Leave them for the final copy.
\
*Q:* How do I cite my results reported in open challenges? \
*A:* To conform with the double-blind review policy, you can report results of
other challenge participants together with your results in your paper. For your
results, however, you should not identify yourself and should not mention your
participation in the challenge. Instead present your results referring to the
method proposed in your paper and draw conclusions based on the experimental
comparison to other results.
]
#figure(
caption: [
Example of caption. It is set in Roman so that mathematics (always set in
Roman: $B sin A = A sin B$) may be included without an ugly clash.
],
placement: top,
kind: image,
rect(width: 0.9 * 3.25in - 0.8pt, height: 2.1in - 0.8pt, stroke: 0.4pt),
) <fig:onecol>
\
== Miscellaneous
Compare the following:
#align(center, grid(
columns: 2,
align: left,
gutter: 5pt,
`conf_a`, $c o n f_a$,
`\mathit{conf}_a`, $italic("conf")_a$,
))
See The #TeX book, p165.
The space after #eg, meaning "for example", should not be a sentence-ending
space. So #eg is correct, _e.g._ is not. The provided `\eg` macro takes care of
this.
When citing a multi-author paper, you may save space by using "et alia",
shortened to "#etal" (not "_et.~al._" as "_et_" is a complete word). If you use
the `\etal` macro provided, then you need not worry about double periods when
used at the end of a sentence as in Alpher #etal. However, use it only when
there are three or more authors. Thus, the following is correct: "Frobnication
has been trendy lately. It was introduced by Alpher~@Alpher02, and subsequently
developed by Alpher and Fotheringham-Smythe~@Alpher03, and Alpher
#etal~@Alpher04."
This is incorrect: "... subsequently developed by Alpher #etal~@Alpher03 ..."
because reference~@Alpher03 has just two authors.
#show figure.where(kind: "subfigure"): it => {
it.body
v(-9pt)
it.caption
}
#show figure.caption.where(kind: "subfigure"): it => {
let ix = counter(figure.where(kind: "subfigure")).display("(a)")
[#ix~#it.body]
}
#let fig2a = figure(
caption: [An example of a subfigure.],
supplement: [],
kind: "subfigure",
rect(width: 4in, height: 2in, stroke: 0.4pt))
#let fig2b = figure(
caption: [Another example of a subfigure.],
supplement: [],
kind: "subfigure",
rect(width: 2in, height: 2in, stroke: 0.4pt))
#let fig = block(width: 6.875in, height: 2.59in)[
#figure(
caption: [Example of a short caption, which should be centered.],
placement: top,
grid(
columns: 2,
column-gutter: 0.875in - 2 * 0.4pt,
[#fig2a <fig2a>], [#fig2b <fig2b>],
)
) <fig:short-a>
]
= Formatting your paper <sec:formatting>
All text must be in a two-column format. The total allowable size of the text
area is $6 7/8$ inches (17.46 cm) wide by $8 7/8$ inches (22.54 cm) high.
Columns are to be $3 1/4$ inches (8.25 cm) wide, with a $5/(16)$ inch (0.8 cm)
space between them. The main title (on the first page) should begin 1 inch
(2.54 cm) from the top edge of the page. The second and following pages should
begin 1 inch (2.54 cm) from the top edge. On all pages, the bottom margin
should be $1 1/8$ inches (2.86 cm) from the bottom edge of the page for $8.5
times 11$-inch paper; for A4 paper, approximately $1 5/8$ inches (4.13 cm) from
the bottom edge of the page.
== Margins and page numbering
All printed material, including text, illustrations, and charts, must be kept
within a print area $6 7/8$ inches (17.46 cm) wide by $8 7/8$ inches (22.54 cm)
high. Page numbers should be in the footer, centered and $3/4$ inches from the
bottom of the page. The review version should have page numbers, yet the final
version submitted as camera ready should not show any page numbers. The #LaTeX
template takes care of this when used properly.
== Type style and fonts
Wherever Times is specified, Times Roman may also be used. If neither is
available on your word processor, please use the font closest in appearance to
Times to which you have access.
MAIN TITLE. Center the title $1 3/8$ inches (3.49 cm) from the top edge of the
first page. The title should be in Times 14-point, boldface type. Capitalize
the first letter of nouns, pronouns, verbs, adjectives, and adverbs; do not
capitalize articles, coordinate conjunctions, or prepositions (unless the title
begins with such a word). Leave two blank lines after the title.
AUTHOR NAME(s) and AFFILIATION(s) are to be centered beneath the title and
printed in Times 12-point, non-boldface type. This information is to be
followed by two blank lines.
The ABSTRACT and MAIN TEXT are to be in a two-column format.
MAIN TEXT. Type main text in 10-point Times, single-spaced. Do NOT use
double-spacing. All paragraphs should be indented 1 pica (approx.~$1/6$ inch or
0.422 cm). Make sure your text is fully justified --- that is, flush left and
flush right. Please do not place any additional blank lines between paragraphs.
Figure and table captions should be 9-point Roman type as in
@fig:onecol[Figs.] and @fig:short-a[]. Short captions should be centred.\
Callouts should be 9-point Helvetica, non-boldface type. Initially
capitalize only the first word of section titles and first-, second-, and
third-order headings.
FIRST-ORDER HEADINGS. (For example, #box(text(size: 12pt)[*1. Introduction*]))
should be Times 12-point boldface, initially capitalized, flush left, with one
blank line before, and one blank line after.
SECOND-ORDER HEADINGS. (For example, #box(text(size: 11pt)[*1.1. Database
elements*])) should be Times 11-point boldface, initially capitalized, flush
left, with one blank line before, and one after. If you require a third-order
heading (we discourage it), use 10-point Times, boldface, initially
capitalized, flush left, preceded by one blank line, followed by a period and
your text on the same line.
#place(top, float: true, fig)
== Footnotes
Please use footnotes#footnote[This is what a footnote looks like. It often
distracts the reader from the main flow of the argument.] sparingly. Indeed,
try to avoid footnotes altogether and include necessary peripheral observations
in the text (within parentheses, if you prefer, as in this sentence). If you
wish to use a footnote, place it at the bottom of the column on the page on
which it is referenced. Use Times 8-point type, single-spaced.
== Cross-references
For the benefit of author(s) and readers, please use the
```tex
\cref{...}
```
command for cross-referencing to figures, tables, equations, or sections. This
will automatically insert the appropriate label alongside the cross-reference
as in this example:
#quote(block: true)[
#indent
To see how our method outperforms previous work, please see @fig:onecol[Fig.]
and @tab:example[Tab.]. It is also possible to refer to multiple targets as
once, #eg~to @fig:onecol[Figs.] and @fig:short-a[]. You may also return to
@sec:formatting[Sec.] or look at @eq:also-important.
]
If you do not wish to abbreviate the label, for example at the beginning of the
sentence, you can use the
```tex
\Cref{...}
```
#indent
command. Here is an example:
#quote(block: true)[
#indent
@fig:onecol[Figure] is also quite important.
]
#place(top, float: true,
block(width: 3.25in, height: fig.height)
)
== References
List and number all bibliographical references in 9-point Times, single-spaced,
at the end of your paper. When referenced in the text, enclose the citation
number in square brackets, for example~@Authors14. Where appropriate, include
page numbers and the name(s) of editors of referenced books. When you cite
multiple papers at once, please make sure that you cite them in numerical order
like this @Authors14 @Authors14b @Alpher02 @Alpher03 @Alpher05. If you use the
template as advised, this will be taken care of automatically.
#figure(
caption: [Results. Ours is better.],
placement: top,
table(
columns: 2,
align: (left, center),
row-gutter: 0pt,
stroke: none,
inset: (x, y) => (
top: if y == 0 or y == 1 { 5pt } else { 2.6pt },
bottom: if y == 0 or y == 3 { 5.4pt } else { 2.6pt },
left: if x == 0 { 0pt } else { 5pt },
right: if x == 1 { 5pt } else { 0pt },
),
table.hline(stroke: 0.9pt),
table.header([Method], [Frobnability]),
table.hline(stroke: 0.4pt),
[Theirs], [Frumpy],
[Yours], [Frobbly],
[Ours], [Makes one's heart Frob],
table.hline(stroke: 0.9pt),
)) <tab:example>
== Illustrations, graphs, and photographs
All graphics should be centered. In #LaTeX, avoid using the `center`
environment for this purpose, as this adds potentially unwanted whitespace.
Instead use
```tex
\centering
```
at the beginning of your figure. Please ensure that any point you wish to make
is resolvable in a printed copy of the paper. Resize fonts in figures to match
the font in the body text, and choose line widths that render effectively in
print. Readers (and reviewers), even of an electronic copy, may choose to print
your paper in order to read it. You cannot insist that they do otherwise, and
therefore must not assume that they can zoom in to see tiny details on a
graphic.
When placing figures in #LaTeX, it's almost always best to use
`\includegraphics`, and to specify the figure width as a multiple of the line
width as in the example below
```tex
\usepackage{graphicx} ...
\includegraphics[width=0.8\linewidth]
{myfile.pdf}
```
== Color
Please refer to the author guidelines on the #conf-name #conf-year web page for
a discussion of the use of color in your document.
If you use color in your plots, please keep in mind that a significant subset
of reviewers and readers may have a color vision deficiency; red-green
blindness is the most frequent kind. Hence avoid relying only on color as the
discriminative feature in plots (such as red \vs green lines), but add a second
discriminative feature to ease disambiguation.
= Final copy
You must include your signed IEEE copyright release form when you submit your
finished paper. We MUST have this form before your paper can be published in
the proceedings.
Please direct any questions to the production editor in charge of these
proceedings at the IEEE Computer Society Press:
#link("https://www.computer.org/about/contact").
|
https://github.com/frugal-10191/frugal-typst | https://raw.githubusercontent.com/frugal-10191/frugal-typst/main/examples/book-template/example_book.typ | typst | Apache License 2.0 | #import("/book-template/book_template.typ"): book, part, setChapterImage
#show: book.with(
title: "Typst Book Template Example",
subtitle: "now with parts",
author: "Frugal",
titleFont: "Lato",
headingFont: "Lato",
bodyFont: "Gentium Plus",
fontSize: 12pt,
leading: 0.65em,
cover: "/examples/book-template/rm175-noon-02.jpg",
logo: "/examples/book-template/vecteezy_free-vector-flat-graphic-designer-logo-collection_18716372.svg",
mainColor: rgb("#799a9c"),
copyright: [
Copyright © 2023 Frugal
PUBLISHED BY PUBLISHER
#link("https://github.com/frugal-10191/frugal-typst", "TEMPLATE-WEBSITE")
Licensed under the Apache 2.0 License (the “License”).
You may not use this file except in compliance with the License. You may obtain a copy of
the License at https://www.apache.org/licenses/LICENSE-2.0. Unless required by
applicable law or agreed to in writing, software distributed under the License is distributed on an
“AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
Logo by Vecteezy (#link("https://www.vecteezy.com/free-vector/logo-svg") Logo Svg Vectors by Vecteezy
Title background using assets from Freepik.com
Design insipration from the LaTeX Legrand Orange Book:
https://www.latextemplates.com/template/legrand-orange-book
Original Typst design based on: https://github.com/flavio20002/typst-orange-template
_First printing, September 2023_
]
)
#part("First Part")
This is the preamble to part 1
#lorem(243)
#setChapterImage(image("blue1.jpg"))
= Introduction
#lorem(50)
#lorem(120)
#lorem(90)
#lorem(200)
== Background
#lorem(50)
$ A = pi r^2 \
"area" = pi dot "radius"^2 $
$ cal(A) :=
{ x in RR | x "is natural" } $
#let x = 5
$ #x < 17 $
#lorem(320)
#lorem(150)
#setChapterImage(image("blue2.jpg"))
= Research Objectives
#lorem(50)
#lorem(120)
#lorem(90)
#lorem(200)
== Experimental Design
#lorem(50)
#lorem(320)
#lorem(150)
=== Racing aardvarks for fun and profit.
#lorem(50)
#lorem(50)
#lorem(120)
#part("Second Part")
#lorem(97)
#setChapterImage(image("blue3.jpg"))
= Results
#lorem(50)
#lorem(120)
#lorem(90)
#lorem(200)
== Aardvarks are faster than expected
#lorem(50)
#lorem(320)
#lorem(150)
=== I need to get fitter.
#lorem(50)
#lorem(50)
#lorem(120)
|
https://github.com/dyc3/senior-design | https://raw.githubusercontent.com/dyc3/senior-design/main/index.typ | typst | #import "@preview/in-dexter:0.0.5": *
#columns(3)[
#make-index(title: [Index], outlined: true)
] |
|
https://github.com/kdog3682/2024-typst | https://raw.githubusercontent.com/kdog3682/2024-typst/main/src/te-show.typ | typst | show "hi": "ahs"
show "hxi": "aa"
// show rules are cumulative
// and they follow order
show block: (val) => {
if type(val) == "content" {
if (repr(val).text() == "aaaa") {
val = "xxxxx"
}
// interesting ... this works
}
text(fill: red, val)
// this is a good example
#import "@preview/cetz:0.2.0"
#let typst-rotate = rotate
#let graph(data) = {
cetz.canvas({
import cetz.draw: *
import cetz.chart
// Left - Basic
let data = (("A", 10), ("B", 20), ("C", 13))
group(name: "a", {
chart.columnchart(
y-tick-step: 4,
// x-ticks: (1,2,3),
size: (4, 3), data,
y-label: {
v(-10pt)
typst-rotate(90deg, [hi])
},
x-label: {
}
block([hxiha])
v(10pt)
[*hi*]
},
outer-label-radius: 200%,
inner-label-radius: 200%,
x-inset: 2.5,
labels: (
[hi, bye $x^2$ \ ],
[hi, bye],
[hi, bye],
)
)
})
})
}
#{
let a = graph(1)
rect(inset: 20pt, stack(dir: ltr, spacing: 20pt, a, a))
}
|
|
https://github.com/fenjalien/metro | https://raw.githubusercontent.com/fenjalien/metro/main/tests/complex/print-complex-unity/test.typ | typst | Apache License 2.0 | #import "/src/lib.typ": *
#set page(width: auto, height: auto, margin: 1cm)
#complex(0, 1)
#complex(0, 1, print-complex-unity: true)
|
https://github.com/Enter-tainer/typstyle | https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/markup/raw.typ | typst | Apache License 2.0 | ```rs
let a = 1;
```
```rs
let a = 1;
```
#[
```rs
let a = 1;
```
]
#{
```rs
let a = 1;
```
}
#{
```rs
let a = 1;
let b = 1;
let c = 1;
let d = 1;
```
}
#[
```rs
let a = 1;
let b = 1;
let c = 1;
let d = 1;
```
]
```typ #link()```
```typ #link()
```
#[
```
underbrace(x + y, |A|)
```
]
#text[```typ
#import "@preview/cetz:0.2.1"
#cetz.canvas({
import cetz.draw: *
...
})
```]
|
https://github.com/janlauber/bachelor-thesis | https://raw.githubusercontent.com/janlauber/bachelor-thesis/main/thesis_typ/glossary.typ | typst | Creative Commons Zero v1.0 Universal | \
/ Kubernetes Operator: A software extension that uses custom resources to manage applications and their components.
/ CRD (Custom Resource Definition): A way to extend the Kubernetes API to create your own custom resources.
/ Rollout: The process of updating the instances of an application in a controlled manner.
/ ServiceAccount: An identity for processes that run in a Pod.
/ PersistentVolumeClaim (PVC): A request for storage by a user.
/ Secret: An object that contains a small amount of sensitive data such as a password, a token, or a key.
/ Deployment: Provides declarative updates to Pods and ReplicaSets.
/ Service: A networking Layer 3/4 load balancer that exposes the pods within the Kubernetes cluster.
/ Ingress: Similar to a Reverse Proxy, it exposes HTTP and HTTPS routes from outside the cluster to services within the cluster.
/ HorizontalPodAutoscaler (HPA): Automatically scales the number of pods in a deployment based on observed CPU utilization.
/ CronJob: Creates Jobs on a repeating schedule.
/ YAML: A human-readable data serialization standard that can be used in conjunction with all programming languages and is often used to write configuration files.
/ Blueprint: A template for creating new deployments based on predefined configurations.
/ Rollback: The action of reverting to a previous state of the deployment configuration.
/ CI/CD (Continuous Integration/Continuous Deployment): Practices that aim to improve software delivery using automated testing and deployment.
/ IaC (Infrastructure as Code): Managing and provisioning computing infrastructure through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.
/ PaaS (Platform as a Service): A category of cloud computing services that provides a platform allowing customers to develop, run, and manage applications without the complexity of building and maintaining the infrastructure typically associated with developing and launching an app.
/ SaaS (Software as a Service): A software distribution model in which applications are hosted by a service provider and made available to customers over the internet.
/ Namespace: A way to divide cluster resources between multiple users in Kubernetes.
/ Millicores: A unit of CPU measurement in Kubernetes, where 1000 millicores equals 1 CPU core.
/ One-Click Deployment: A system designed to simplify Kubernetes deployments by providing a user-friendly interface and automating complex tasks.
/ Open-Source Software (OSS): Software with source code that anyone can inspect, modify, and enhance.
/ Container Orchestration: Automated management of containerized applications across multiple clusters, typically using tools like Kubernetes.
/ Minikube: A tool that lets you run Kubernetes locally.
/ Docker: A platform used to develop, ship, and run applications inside containers.
/ Node.js: An open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside a web browser.
/ SSL (Secure Sockets Layer): A standard security technology for establishing an encrypted link between a server and a client.
/ RBAC (Role-Based Access Control): A method of regulating access to computer or network resources based on the roles of individual users within an enterprise.
/ Network Policies: Specifications that define how groups of pods are allowed to communicate with each other and other network endpoints.
|
https://github.com/El-Naizin/cv | https://raw.githubusercontent.com/El-Naizin/cv/main/modules_fr/projects.typ | typst | Apache License 2.0 | #import "../brilliant-CV/template.typ": *
#cvSection("Projets & Associations")
#cvEntry(
title: [Stagiaire en Analyse de Données],
society: [XYZ Corporation],
date: [été 2020],
location: [San Francisco, CA],
description: list(
[Aider à la préparation, au traitement et à l'analyse de données à l'aide de Python et Excel],
[Développer des visualisations et des rapports de données pour communiquer des insights aux parties prenantes],
)
)
#cvEntry(
title: [Analyste de Données Bénévole],
society: [ABC Organisation à But Non Lucratif],
date: [2019 - Présent],
location: [New York, NY],
description: list(
[Analyser les données de donateurs et de collecte de fonds pour identifier les tendances et les opportunités de croissance],
[Créer des visualisations de données et des tableaux de bord pour communiquer des insights au conseil d'administration],
)
)
|
https://github.com/pedrofp4444/BD | https://raw.githubusercontent.com/pedrofp4444/BD/main/report/content/[4] Modelação Lógica/explicação.typ | typst | #let explicação = {
[
== Apresentação e Explicação do Modelo Lógico Produzido
Para a correta construção do modelo lógico, a equipa da “Quatro em Linha” reuniu-se para considerar como proceder à execução do diagrama, apoiado, inicialmente, por uma ponderação sobre a quantidade de tabelas a utilizar. Procede-se à apresentação dos resultados:
- 4 tabelas, uma por entidade;
- 2 tabelas, uma por cada relacionamento N para M;
- 1 tabela de um atributo multivalorado;
- 1 tabela de um relacionamento unário.
A equipa iniciou a produção das 8 tabelas referidas acima de acordo com a ordem de formulação do modelo concetual. Para tal, inaugurou o diagrama com a criação da tabela de Funcionário ao herdar os atributos já definidos no diagrama de sustento, que se define pelas seguintes colunas:
#figure(
caption: "Caracterização da tabela lógica do Funcionário.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 7,
align: horizon,
rotate(-90deg, reflow: true)[
Funcionário
],
),
/* - */
["Funcionário_ID"],
[INT],
[-],
/* - */
["Nome"],
[VARCHAR(75)],
[-],
/* - */
[“Data_de_nascimento”],
[DATE],
[-],
/* - */
["Salário"],
[INT],
[-],
/* - */
["NIF"],
[VARCHAR(10)],
[-],
/* - */
["Fotografia"],
[VARCHAR(150)],
[-],
/* - */
["Função_ID"],
[INT],
[“Função_ID“ (Função)],
)
)
De acordo com esta decisão, surgiu a necessidade de criar 2 tabelas com um relacionamento associado, sendo elas, a tabela de Número de telemóvel, derivada do atributo multivalorado “Número de telemóvel” da entidade Funcionário, e Função, constituída pela “Designação” correspondente ao cargo de um determinado Funcionário:
#figure(
caption: "Caracterização da tabela lógica do Número de telemóvel.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 2,
align: horizon,
rotate(-90deg, reflow: true)[
Número de \ telemóvel /*AQUI DÁ PARA FICAR MELHOR*/
],
),
/* - */
[“Número_de_Telemóvel”],
[INT],
[-],
/* - */
[“Funcionário_ID”],
[INT],
["Funcionário_ID" (Funcionário)],
)
)
#figure(
caption: "Caracterização da tabela lógica da Função.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 2,
align: horizon,
rotate(-90deg, reflow: true)[
Função
],
),
/* - */
["Função_ID"],
[INT],
[-],
/* - */
["Designação"],
[ENUM(“Representante”, “Detetive”, “Operacional”)],
[-],
)
)
De acordo com os requisitos, torna-se necessário fazer surgir uma nova tabela denominada Gere, esta que deriva de um relacionamento unário da entidade Funcionário para a própria, permitindo assim a autogestão de informações:
#figure(
caption: "Caracterização da tabela lógica de Gere.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 2,
align: horizon,
rotate(-90deg, reflow: true)[
Gere
],
),
/* - */
["Funcionário_Gestor_ID"],
[INT],
[“Funcionário_ID” (Funcionário)],
/* - */
["Funcionário_ID"],
[INT],
[“Funcionário_ID” (Funcionário)],
)
)
Deu-se seguimento aos trabalhos com a conversão da entidade Terreno para uma tabela, à qual se associaram os atributos previamente definidos:
#figure(
caption: "Caracterização da tabela lógica do Terreno.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 3,
align: horizon,
rotate(-90deg, reflow: true)[
Terreno
],
),
/* - */
["Terreno_ID"],
[INT],
[-],
/* - */
["Minério_previsto"],
[INT],
[-],
/* - */
["Minério_coletado"],
[INT],
[-],
)
)
Na sequência da referência da tabela anterior, cria-se então a nova tabela Caso, que mais uma vez reflete os atributos definidos na modelação concetual:
#figure(
caption: "Caracterização da tabela lógica do Caso.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 6,
align: horizon,
rotate(-90deg, reflow: true)[
Caso
],
),
/* - */
["Caso_ID"],
[INT],
[-],
/* - */
["Data_de_abertura"],
[DATE],
[-],
/* - */
["Estado"],
[ENUM(“Aberto”, “Fechado”)],
[-],
/* - */
["Estimativa_de_roubo"],
[INT],
[-],
/* - */
["Data_de_encerramento"],
[DATE],
[-],
/*-*/
["Terreno_ID"],
[INT],
["Terreno_ID" (Terreno)],
)
)
Ao analisar o diagrama concetual, repara-se no relacionamento N para M entre as entidades de Funcionário e Terreno, este que, no processo de conversão, culmina com o aparecimento de uma nova tabela que estabelece o relacionamento:
#figure(
caption: "Caracterização da tabela lógica de Trabalha.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 2,
align: horizon,
rotate(-90deg, reflow: true)[
Trabalha
],
),
/* - */
["Funcionário_ID"],
[INT],
[“Funcionário_ID” (Funcionário)],
/* - */
["Terreno_ID"],
[INT],
[“Terreno_ID” (Terreno)],
)
)
Finalmente, finda-se o processo de obtenção do modelo lógico com a transfiguração do relacionamento fulcral entre as entidades Funcionário e Caso que, ao representar um relacionamento N para M com atributos associados, concebe a última tabela, Suspeito.
#figure(
caption: "Caracterização da tabela lógica do Suspeito.",
kind: table,
table(
columns: (0.3fr, 0.9fr, 0.6fr, 1.2fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Tabela*], [*Nome da coluna*], [*Tipo de dado*], [*Referência (tabela)*]),
table.cell(
rowspan: 5,
align: horizon,
rotate(-90deg, reflow: true)[
Suspeito
],
),
/* - */
["Funcionário_ID"],
[INT],
[“Funcianário_ID” (Funcionário)],
/* - */
["Caso_ID"],
[INT],
[“Caso_ID” (Caso)],
/* - */
["Estado"],
[ENUM(“Inocente”, “Em Investigação”, “Culpado”)],
[-],
/* - */
["Envolvimento"],
[INT],
[-],
/* - */
["Notas"],
[TEXT(256)],
[-],
)
)
Na modelação lógica, os relacionamentos entre entidades desempenham um papel crucial na representação da interação entre diferentes elementos de um sistema de gestão de base de dados:
#underline[*Relacionamento binário de grau 1:N com participação obrigatória do lado N:*] \
São necessárias duas entidades lógicas, uma para cada entidade, e a chave primária da entidade do lado 1 tem de ser usada como atributo na entidade correspondente à entidade do lado N.
Ocorrências:
- “tem” entre Caso(N) e Terreno(1)
- “desempenha” entre Funcionário(N) e Função(1)
#underline[*Relacionamento binário de grau N:M:*] \
São sempre necessárias três entidades lógicas neste tipo de relacionamentos, uma para cada entidade e uma para o relacionamento. As chaves primárias das entidades têm de ser atributos na entidade lógica do relacionamento.
Ocorrências:
- “trabalha” entre Funcionário e Terreno
- “pertence” entre Funcionário e Caso
#underline[*Relacionamento unário:*] \
Na ocorrência “gere”, entre a entidade Funcionário e a própria, surge um relacionamento unário, do grau N:M, pois um ou mais funcionários podem gerir outros funcionários. Isto representa uma estrutura hierárquica onde um funcionário é responsável pela gestão de outros, dentro da organização.
Com base nos parâmetros e nos relacionamentos estabelecidos anteriormente, foi desenvolvido um modelo lógico para representar de forma precisa e organizada as interações entre as entidades envolvidas. Este modelo visa proporcionar uma estrutura robusta para armazenar e gerir informações relacionadas aos diversos elementos do sistema de gestão de base de dados.
#figure(
caption: "Ilustração do modelo lógico produzido.",
kind: image,
image("../../images/Captura_ModeloLógico.png")
)
]
}
|
|
https://github.com/yhtq/Notes | https://raw.githubusercontent.com/yhtq/Notes/main/软件分析/hw/2100012990-郭子荀-软分第三次作业.typ | typst | #import "../../template.typ": proof, note, corollary, lemma, theorem, definition, example, remark
#import "../../template.typ": *
#show: note.with(
title: "作业12",
author: "YHTQ",
date: datetime.today().display(),
logo: none,
withOutlined : false,
withTitle : false,
withHeadingNumbering: false
)
```hs
import Data.Map (Map)
import Data.Map qualified as Map
import Data.Sequence (Seq (Empty))
type Variable = String
data Exp
= Lit Int
| Var Variable
| Add Exp Exp
| Sub Exp Exp
| Mul Exp Exp
deriving (Eq)
instance Show Exp where
show (Lit n) = show n
show (Var x) = x
show (Add e1 e2) = show e1 ++ " + " ++ show e2
show (Sub e1 e2) = show e1 ++ " - " ++ show e2
show (Mul e1 e2) = show e1 ++ " * " ++ show e2
data UnitCommand
= SkipU
| AssignU Variable Exp
| IfThenElseU Exp
| IfEnd
| WhileU Exp
| WhileEnd
deriving (Eq)
-- 判断稍后是否合并,Control Command 不合并
isControlCommand :: UnitCommand -> Bool
isControlCommand SkipU = False
isControlCommand (AssignU _ _) = False
isControlCommand _ = True
instance Show UnitCommand where
show SkipU = "Skip"
show (AssignU x e) = x ++ " := " ++ show e
show (IfThenElseU e) = "If " ++ show e
show IfEnd = "EndIf"
show (WhileU e) = "While " ++ show e
show WhileEnd = "EndWhile"
data Command
= Skip
| Assign Variable Exp
| Seq Command Command
| IfThenElse Exp Command Command
| While Exp Command
deriving (Eq, Show)
newtype Node = Node [UnitCommand] deriving (Eq)
instance Show Node where
show (Node cs) = join $ map show cs
where
join [] = ""
join (x : xs) = show x ++ ";" ++ join xs
data EdgeLabel = IfTrue | IfFalse | WhileTrue | WhileFalse | LoopBack | EmptyLabel deriving (Eq, Show) -- 用于标记边的类型
data Graph v = Graph
{ nodes :: Map Int v,
edges :: [(Int, Int, EdgeLabel)],
start_node :: Int,
end_node :: Int
}
deriving (Eq, Show, Functor)
succNodesExceptBack :: Graph v -> Int -> [Int]
succNodesExceptBack g n = [m | (n', m, l) <- edges g, n' == n && l /= LoopBack]
mergeNode :: (v -> v -> v) -> Graph v -> Int -> Int -> Graph v -- 将两个节点合并,将第二个节点的所有出边改为从第一个节点出
mergeNode f g n1 n2 =
let nodes1 = Map.insert n1 (f (nodes g Map.! n1) (nodes g Map.! n2)) (nodes g)
nodes2 = Map.delete n2 nodes1
in Graph
{ nodes = nodes2,
edges = [(if n' == n2 then n1 else n', if m == n2 then n1 else m, l) | (n', m, l) <- edges g, not ((n', m) == (n1, n2) || (n', m) == (n2, n1))], -- 防止自环
start_node = if start_node g == n2 then n1 else start_node g,
end_node = if end_node g == n2 then n1 else end_node g
}
updateNode :: v -> Graph v -> Int -> Graph v -- 更新节点的值
updateNode v g n = Graph {nodes = Map.insert n v (nodes g), edges = edges g, start_node = start_node g, end_node = end_node g}
data GraphR a = Plain a | Component (Graph (GraphR a)) deriving (Eq, Show, Functor) -- 课上的 Component 实现
type GraphC = Graph (GraphR Node)
mergeNodeC :: (Node -> Node -> Node) -> GraphC -> Int -> Int -> GraphC -- 假设 n1, n2 都是 plain 节点,将其合并
mergeNodeC f g n1 n2 = mergeNode (\(Plain (Node l1)) (Plain (Node l2)) -> Plain $ Node (l1 ++ l2)) g n1 n2
indexTrans :: Graph a -> (Int -> Int) -> Graph a -- 将图中的节点编号转换,需要保证 f 的单射性
indexTrans g f =
Graph
{ nodes = Map.mapKeys f (nodes g),
edges = [(f n, f m, l) | (n, m, l) <- edges g],
start_node = f (start_node g),
end_node = f (end_node g)
}
connectGraph :: Graph a -> Graph a -> EdgeLabel -> Graph a -- 将两个图连接起来,前者的 end 连接到后者的 start
connectGraph g1 g2 l =
Graph
{ nodes = Map.union (nodes g1) (nodes g2'),
edges = edges g1 ++ edges g2' ++ [(end_node g1, start_node g2', l)],
start_node = start_node g1,
end_node = end_node g2'
}
where
g2' = indexTrans g2 (\x -> x + (maximum $ Map.keysSet (nodes g1))) -- 为了避免节点编号冲突,将 g2 的节点编号加上一个偏移量,值为 g1 的节点编号的最大值(假设编号都正)
nodeToGraphC :: Node -> GraphC
nodeToGraphC n =
Graph
{ nodes = Map.fromList [(1, Plain n)],
edges = [],
start_node = 1,
end_node = 1
}
-- 构建控制流图
toCFG :: Command -> GraphC
toCFG Skip = nodeToGraphC (Node [SkipU])
toCFG (Assign s e) = nodeToGraphC (Node [AssignU s e])
toCFG (Seq c1 c2) =
let g1 = toCFG c1
g2 = toCFG c2
in connectGraph g1 g2 EmptyLabel -- 这里我们直接将两张图连接起来,不再创建更上层的图
toCFG (IfThenElse e c1 c2) =
let g1 = toCFG c1
g2 = toCFG c2
in Graph
{ nodes = Map.fromList [(1, Plain $ Node [IfThenElseU e]), (2, Component g1), (3, Component g2), (4, Plain $ Node [IfEnd])],
edges = [(1, 2, IfTrue), (1, 3, IfFalse), (2, 4, EmptyLabel), (3, 4, EmptyLabel)],
start_node = 1,
end_node = 4
}
toCFG (While e c) =
Graph
{ nodes = Map.fromList [(1, Plain $ Node [WhileU e]), (2, Component $ toCFG c), (3, Plain $ Node [WhileEnd])],
edges = [(1, 2, WhileTrue), (2, 1, LoopBack), (1, 3, WhileFalse)],
start_node = 1,
end_node = 3
}
-- 合并相邻的顺序语句,第一个参数是开始节点的编号
mergeSeq' :: Int -> GraphR Node -> GraphR Node
mergeSeq' _ (Plain n) = Plain n
mergeSeq' start (Component g) =
let start_point = (nodes g) Map.! start
in let succ_of_start = succNodesExceptBack g start -- 注意这里要丢掉 while loop 返回的边
in case start_point of
Plain (Node l) ->
if length succ_of_start == 1 -- 仅有一个后继节点,检查后继节点是否 plain
then
let next = (head succ_of_start)
next_point = (nodes g) Map.! next
in case next_point of
Plain (Node l') ->
-- 将两个 plain 节点合并
if isControlCommand (head l') -- 若下个节点是控制节点,无法合并
then mergeSeq' next (Component g) -- 当前无法合并,考虑向后移动
else
let new_graph = mergeNodeC (\(Node l1) (Node l2) -> Node (l1 ++ l2)) g start next
in mergeSeq' start (Component new_graph) -- 注意合并后 next 出边被移到 start 上,因此递归进行即可
_ -> mergeSeq' next (Component g) -- 当前无法合并,考虑向后移动
else foldr mergeSeq' (Component g) succ_of_start -- 有多个后继节点,从每个节点都开始对图更新一次
Component g' ->
let new_g = Component $ updateNode (mergeSeq (Component g')) g start -- 进入子 Component 处理并更新 start 节点
in foldr mergeSeq' new_g succ_of_start -- 再从后继的每个节点开始递归处理
mergeSeq :: GraphR Node -> GraphR Node
mergeSeq (Plain n) = Plain n
mergeSeq (Component g) = mergeSeq' (start_node g) (Component g)
seqs :: [Command] -> Command
seqs = foldr1 Seq
testC :: Command
testC =
seqs
[ Assign "x" (Lit 1),
Assign "y" (Lit 0),
While
(Var "x")
( seqs
[ Assign "x" (Sub (Var "x") (Lit 1)),
Assign "y" (Add (Var "y") (Lit 1)),
IfThenElse (Var "x") (Assign "y" (Lit 1)) (Assign "y" (Lit 2)),
Skip
]
)
]
main :: IO ()
main = do
print $ toCFG testC
print $ mergeSeq (Component $ toCFG testC)
-- Component (Graph {
-- nodes = fromList [(1,Plain "x := 1";"y := 0";),(3,Plain "While x";),(4,Component (Graph {nodes = fromList [(1,Plain "x := x - 1";"y := y + 1";),(3,Plain "If x";),(4,Component (Graph {nodes = fromList [(1,Plain "y := 1";)], edges = [], start_node = 1, end_node = 1})),(5,Component (Graph {nodes = fromList [(1,Plain "y := 2";)], edges = [], start_node = 1, end_node = 1})),(6,Plain "EndIf";"Skip";)], edges = [(3,4,IfTrue),(3,5,IfFalse),(4,6,EmptyLabel),(5,6,EmptyLabel),(1,3,EmptyLabel)], start_node = 1, end_node = 6})),(5,Plain "EndWhile";)], edges = [(3,4,WhileTrue),(4,3,LoopBack),(3,5,WhileFalse),(1,3,EmptyLabel)], start_node = 1, end_node = 5
-- })
``` |
|
https://github.com/qianxi0410/cv.typ | https://raw.githubusercontent.com/qianxi0410/cv.typ/master/template.typ | typst | MIT License | // url预处理
#let url(url-str) = {
let prefix = regex("http[s]?://")
// url必须以http:// 或 https://开头
if not url-str.starts-with(prefix) {
panic("url must start with http:// or https://")
}
url-str = url-str.replace(prefix, "")
// 去掉末尾的/
if url-str.ends-with("/") {
url-str = url-str.slice(0, url.len() - 1)
}
if url-str.starts-with("github.com/") {
url-str = url-str.replace("github.com/", "")
}
return url-str
}
// github 链接
#let github(url-str) = {
let prefix = regex("http[s]?://github.com/")
if not url-str.starts-with(prefix) {
panic("github url must start with http[s]://github.com/")
}
return link(url-str)[
#set box(height: 1em)
#box(image("./icons/github.svg"), baseline: 0.75pt)
#text(weight: "regular")[
#url(url-str)
]
]
}
// 分节信息
#let section-header(title: "", icon: "") = {
grid(
columns: (1fr),
row-gutter: 6pt,
align(left)[
#if icon != "" {
box(image(icon), height: 1.4em, baseline: 2pt)
h(1pt)
}
#text(weight: "black", 1.4em, title)
],
line(stroke: 0.5pt+gray, length: 100%)
)
}
#let cv(name: "", phone: "", email: "", birthday: "", website: "", avatar: "", body) = {
set document(title: name)
set page(paper: "a4", margin: (x: 2.1cm, y: 1.2cm))
set text(font: "LXGW WenKai", 0.9em, weight: "regular");
set par(justify: true, linebreaks: "optimized")
align(center)[
// 名字
#block(text(weight: "black", 2.4em, name))
#if avatar != "" {
place(top + right, dy: -3em)[
#block(image(avatar), height: 5em, width: 6em)
]
}
// 其他信息
#set text(size: 0.9em)
#set box(baseline: 0.1em, height: 1em)
#grid(
columns: (auto, auto, auto, auto, auto, auto, auto),
column-gutter: 0.8em,
link("")[
#box(image("./icons/phone.svg"))
#phone
],
text(weight: "regular", baseline: 2pt)[
·
],
link("mailto:" + email)[
#box(image("./icons/envelope.svg"))
#email
],
text(weight: "regular", baseline: 2pt)[
·
],
link("")[
#box(image("./icons/birth.svg"))
#birthday
],
text(weight: "regular", baseline: 2pt)[
·
],
link(website)[
#box(image("./icons/website.svg"))
#url(website)
]
)
]
body
}
// 教育背景
#let educations(educations) = {
section-header(title: "教育背景", icon: "./icons/education.svg")
set text(1.05em)
for education in educations {
block[
#text(weight: "black", education.school + ",")
#h(3pt)
#education.major
#h(1fr)
#text(education.degree)
#h(3pt)
#text(0.9em, weight: "thin", emph(education.date))
#v(-4pt)
]
}
v(3pt)
}
// 项目经历
#let projects(projects) = {
section-header(title: "项目经历", icon: "./icons/project.svg")
set list(indent: 1em, tight: true)
for project in projects {
block[
#text(1.25em, weight: "black", project.name)
#if project.url != "" {
h(3pt)
github(project.url)
}
#h(1fr)
#text(weight: "thin", emph(project.date))
#if project.desc != "" {
v(-5pt)
text(weight: "black", project.desc)
}
#for point in project.points.map(x => "[" + x + "]") {
list(eval(point))
}
#v(3pt)
]
}
}
// 实习经历
#let internships(internships) = {
section-header(title: "实习经历", icon: "./icons/internship.svg")
set list(indent: 1em, tight: true)
for internship in internships {
block[
#text(1.25em, weight: "black", internship.company)
#h(3pt)
#internship.jobtitle
#h(1fr)
#text(weight: "thin", emph(internship.date))
#for point in internship.points.map(x => "[" + x + "]") {
list(eval(point))
}
#v(3pt)
]
}
}
// 荣誉奖项
#let awards(awards) = {
section-header(title: "荣誉奖项", icon: "./icons/award.svg")
set list(tight: true, marker: none, body-indent: 0pt)
for award in awards {
list[
#award.name
#h(1fr)
#text(weight: "thin", emph(award.date))
#v(2pt)
]
}
}
// 个人技能
#let skills(skills) = {
section-header(title: "个人技能", icon: "./icons/skill.svg")
set list(tight: true, marker: none, body-indent: 0pt)
for skill in skills {
list[
#skill.name
#h(1fr)
#text(weight: "regular", emph(skill.desc))
#v(2pt)
]
}
} |
https://github.com/davidedellagiustina/uniud-slides | https://raw.githubusercontent.com/davidedellagiustina/uniud-slides/master/src/uniud-slides/template.typ | typst | MIT License | // Presentation slides templarte for the University of Udine (UniUD)
// Author: <NAME>
// Date: 02/2024
// This template uses [Polylux](https://github.com/andreasKroepelin/polylux) to render slides
#import "@preview/polylux:0.3.1": *
// Main configuration function
// Usually, it should be used with `#show`
#let uniud-slides(
lang: "en",
department: "dmif",
department-override: "",
course: "Computer Science",
academic-year: "2023-24",
date: datetime.today(),
title: "Presentation Title",
subtitle: "",
candidate: (
name: "<NAME>",
),
supervisor: (
title: "Prof.",
name: "<NAME>",
),
co-supervisor: (
title: "Dott.",
name: "",
),
body,
) = {
// +---------------------+
// | Argument validation |
// +---------------------+
let supported-languages = ("en", "it")
if lang not in supported-languages {
panic("unsupported language")
}
let supported-departments = ("dmed", "dill", "di4a", "dies", "disg", "dmif", "dium", "dpia")
if department-override == "" {
if department not in supported-departments {
panic("unsupported department")
}
}
// +---------+
// | Strings |
// +---------+
let course-desc = if lang == "en" { "Degree course in" }
else if lang == "it" { "Corso di laurea in" }
let candidate-desc = if lang == "en" { "Candidate" }
else if lang == "it" { "Candidato" }
let supervisor-desc = if lang == "en" { "Supervisor" }
else if lang == "it" { "Relatore" }
let co-supervisor-desc = if lang == "en" { "Co-supervisor" }
else if lang == "it" { "Correlatore" }
let academic-year-desc = if lang == "en" { "Academic year" }
else if lang == "it" { "Anno accademico" }
let department-desc = if department-override != "" { department-override }
else if department == "dmed" {
if lang == "en" { "Department of Medicine" }
else if lang == "it" { "Dipartimento di Medicina" }
} else if department == "dill" {
if lang == "en" { "Department of Languages and Literatures, Communication, Education and Society" }
else if lang == "it" { "Dipartimento di Lingue e Letterature, Comunicazione, Formazione e Società" }
} else if department == "di4a" {
if lang == "en" { "Department of Agricultural, Food, Environmental and Animal Sciences" }
else if lang == "it" { "Dipartimento di Scienze Agroalimentari, Ambientali e Animali" }
} else if department == "dies" {
if lang == "en" { "Department of Economics and Statistics" }
else if lang == "it" { "Dipartimento di Scienze Economiche e Statistiche" }
} else if department == "disg" {
if lang == "en" { "Department of Legal Studies" }
else if lang == "it" { "Dipartimento di Scienze Giuridiche" }
} else if department == "dmif" {
if lang == "en" { "Department of Mathematics, Computer Science and Physics" }
else if lang == "it" { "Dipartimento di Scienze Matematiche, Informatiche e Fisiche" }
} else if department == "dium" {
if lang == "en" { "Department of Humanities and Cultural Heritage" }
else if lang == "it" { "Dipartimento di Studi Umanistici e del Patrimonio Culturale" }
} else if department == "dpia" {
if lang == "en" { "Polytechnic Department of Engineering and Architecture" }
else if lang == "it" { "Dipartimento Politecnico di Ingegneria e Architettura" }
}
// +-------------------+
// | Document settings |
// +-------------------+
let title-raw = title.replace("\n", " ")
let subtitle-raw = subtitle.replace("\n", " ")
let uniud-banner = align(center + top, {
let banner = "./assets/images/banner.svg"
image(banner, width: 100%)
})
let in-banner(body) = place(
center + top,
dx: 233pt,
rect(
width: 100%, height: 89pt,
stroke: none,
align(left + horizon, text(
size: 13pt,
fill: white,
body,
)),
),
)
let department-in-banner = in-banner(upper(department-desc))
let thesis-data-in-banner = in-banner[
#upper(title-raw) \
#candidate.name --- #date.display("[day]/[month]/[year]")
]
set document(
title: title-raw + if subtitle != "" { " -- " + subtitle-raw },
author: candidate.name,
date: auto,
)
set page(
paper: "presentation-16-9",
background: uniud-banner + department-in-banner,
margin: (top: 118pt, bottom: 30pt),
)
set text(
font: "atkinson hyperlegible",
size: 20pt,
lang: lang,
)
// +---------+
// | Content |
// +---------+
// Title slide
polylux-slide({
set align(center + top)
// Degree course
text(
size: 20pt,
emph[#course-desc #course],
)
set align(center + horizon)
v(-.8cm)
// Title
text(size: 25pt)[= #title]
text(size: 23pt, {
if subtitle != "" { subtitle + v(.1cm) }
else { v(1em) }
})
// Authors
table(
stroke: none,
columns: (42%, 42%),
align: (left, right),
text(size: 18pt, upper[#candidate-desc:]), text(size: 18pt, upper[#supervisor-desc:]),
text(size: 20pt, candidate.name), text(size: 20pt)[#supervisor.title #supervisor.name],
)
if co-supervisor.name != "" {
v(-.7em)
table(
stroke: none,
columns: (42%, 42%),
align: (left, right),
[], text(size: 18pt, upper[#co-supervisor-desc:]),
[], text(size: 20pt)[#co-supervisor.title #co-supervisor.name],
)
}
set align(center + bottom)
// Academic year
text(
size: 18pt,
fill: gray,
emph[#academic-year-desc #academic-year],
)
})
// Update page style for following slides
set page(background: uniud-banner + thesis-data-in-banner)
// Content
body
}
// Function that creates a new slide
// Basically, a bare wrapper for `#polylux-slide` with added page number
#let slide(body) = {
polylux-slide()[
#place(bottom + right, dx: 37pt, dy: 10pt,
text(size: 12pt)[
#logic.logical-slide.display() / #utils.last-slide-number
],
)
#body
]
}
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/050%20-%20Phyrexia%3A%20All%20Will%20Be%20One/006_Hard%20as%20Anger%2C%20Bright%20as%20Joy.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Hard as Anger, Bright as Joy",
set_name: "Phyrexia: All Will Be One",
story_date: datetime(day: 14, month: 01, year: 2023),
author: "<NAME>",
doc
)
When Lukka stepped from the Blind Eternities, humidity and heat punched him in the gut. The green light lingering in the murky canopy, the rank taste of rotten flesh on the air, the metallic screeches of unseen beasts, the squelch underfoot of the sodden sphagnum—all these details told him he hadn't arrived in the correct location.
#figure(image("006_Hard as Anger, Bright as Joy/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
"For the life of every plane, we will keep watch." How could he do that from~ here?
He wasn't with the rest of the strike team. This wasn't the rendezvous location. The Phyrexians must've employed a new defense against the incoming Planeswalkers—they were one step ahead, yet again. He should've known that Jace and the others couldn't be trusted to get a military operation right. When the telepath had tracked him down, Lukka had been expecting an attack because of what he'd done on Ikoria and at Strixhaven. He'd been surprised when Jace had recruited him, arguing that Lukka's military expertise would be essential to the success of their infiltration mission. Lukka had been reluctant. Initially. But when Jace had told him Phyrexia threatened Ikoria, he couldn't stand by. He still cared too much about his home for that.
"So here I am," he murmured to himself, looking around. "Wherever that is."
Irritated, Lukka kicked a sodden lump of turf. It spattered across a nearby tree. The ground was riddled with water-swollen potholes and thick roots—practically impassable. Pulsing veins transported black oil through the dense undergrowth and small suckers protruded from the tree trunks, branches sprouting toward sunlight. He craned his head. The networks of branches above looked walkable.
Overabundant trees~ putrid, mechanized vegetation? It had to be that place they'd mentioned—the Hunter Maze?
He considered, briefly, trying to planeswalk back. But given that he'd arrived here unexpectedly, there was no guarantee that he'd end up where intended. He might land in an even worse situation. No, he'd go high, try to make it back to the others.
#emph[If I find a creature I can take and dominate, I'll be able to chart my route toward Elesh Norn's stronghold.] He might still have time to make the rendezvous and get back on mission.
He approached the tree trunk. Hand-like leaves curled into fists, cowering from him.
He removed his harpoon from the sheath on his left arm. He aimed, slung it upward. The harpoon caught on a branch overhead. The tree quivered, oozing reddish mucus from the wounds. Lukka tugged on the rope to make sure it was secure and braced his feet in grooves on the trunk. He levered himself upward and began to climb.
It wasn't much different from scaling the cliffs back home. Whatever others said, New Phyrexia was just another plane.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
An angry cry pierced the air, startling a flock of creatures from their nest in the tree's hollow. The creatures flapped, chaotic and panicked, their toothed beaks glistening silver and their wings the wet color of raw liver. The creatures wheeled—toward the source of the cry.
Lukka cursed. His body, already exhausted from the long climb, shook as he hesitated in place. His hands ached with forming blisters. But he couldn't leave anyone to fight alone in this place. Besides, this might be his opportunity to dominate the local wildlife.
Clenching his thighs around the tree, he removed the harpoon from the bough, untangled the rope, and stowed it away. Then he dropped down onto the platform below. The circling flying creatures gave him a hint as to direction, and he headed that way at a jog, leaping from bough to bough. Excitement flushed the fatigue from his body, turning his tremble into strength and preparing him for the upcoming battle.
On a broad bough, a willowy elf, swinging what looked like a wooden sword, fought alongside a woman dressed in white and gold whose long sword flowed like water. Lukka had seen them before: Nissa, and the woman was called~ the Wanderer.
#figure(image("006_Hard as Anger, Bright as Joy/02.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
A twisted construct that seemed to blend the worst parts of machine and organism attacked them. Its four legs were fused together at awkward angles, yet the Phyrexian had a lethal grace. The Wanderer, a quick blur of white garb and flashing sword, harried the Phyrexian hulk back to give Nissa some room to spellcast. Nissa's tattoos glowed a faint green. Her green cloak aswirl around her, she channeled a spell. Metallic leaves quivered, then were plucked from the tree as if by an invisible hand. The leaves whirled in the air and then descended in a tornado at the abomination. The sharp metal edges shredded the creature. Gray-green blood sprayed.
But the two women hadn't seen the second beast, creeping above them along a branch, ready to pounce.
Lukka reached out with the eludha, the bond he could forge between himself and another creature. He could feel the beast's mind, metallic-bright with pulpy, underused biological elements. He grabbed it and squeezed. Lukka could almost taste blood in his mouth, the tang of iron thick on his tongue. The Phyrexian froze, unable to proceed further. He could feel it rebel against his hold, a thrashing struggle inside his skull.
Nissa and the Wanderer pressed their advantage against their wounded centaur hulk, forward along the bough. It fell, its body draping over the bough and causing the entire tree to shudder. The Wanderer leaped atop its back, bringing her sword down to decapitate the beast. Then, with a strange flicker of light, the Wanderer vanished.
Did she planeswalk away? If so, the timing seemed odd.
Nissa strode forward. She kicked the centaur hulk. It slid from the bough and started its crashing descent to the forest floor below. She cleaned her blade on her cloak and sheathed it.
"Don't get too comfortable." Lukka strode toward her. "I subdued a second looking to ambush you from above."
"Thanks." Nissa turned. Her expression changed. "Lukka."
Lukka nodded up at the centaur hulk above them. It eased itself from the higher bough onto their platform, gentle enough that the branch underfoot did not even bob. "It intended to strip the meat from your bones."
"I don't know how we even ended up here," Nissa said.
"I plan on finding the surface," Lukka said. "Once we're higher we'll be able to get our bearings and plot a route to Elesh Norn's stronghold."
"And how do you plan on navigating this maze?"
Lukka nodded at the Phyrexian monstrosity. It had given into him utterly. He should've known that dominating a half-mechanical creature would be easy. It didn't have the same survival instinct or sense of self that an animal would. It was a mere construct.
"You're bonded with it?" Nissa asked.
She didn't seem happy that he'd saved her life. She eyed him with distrust and concern. He knew this look. He hated it. He'd gotten that look the first time he'd ever bonded with a monster. "It can guide and protect us until we reach the top."
"I don't think it's a good idea for you to bond with a Phyrexian," Nissa said, flatly. "Let's destroy it."
"I've fought monsters my entire life." Now frustrated, Lukka turned away from her. "I can handle it."
Nissa didn't say a word, which was telling enough.
"I promise you," Lukka said, "if I get so much as a stomachache, I'll end the creature."
Nissa stared at him, uncertainly, then she looked around herself at the Hunter Maze. He imagined she was gauging her ability to survive alone, without him, and finding herself lacking. Finally, she sighed.
"I don't like this," Nissa said.
"I am good for my word," he said, irritated.
Nissa nodded. "Let's find the best route out of here."
Lukka plunged his mind into the centaur hulk's consciousness. Its thoughts were jumbled, hard and bright with anger, thick and slimy with shrewdness. He sensed the shape of the thing's territory and frequently traveled paths.
"Ah," he said, with a sigh of soul-deep satisfaction. "We go up, of course."
Nissa seemed annoyed. "I could have told you that."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"Up" was easier said than done in the Hunter Maze. First, to get to a scalable "tree," Lukka and Nissa had to cross a cavernous gap between the monolithic boughs. Luckily, and as Lukka had expected, the Phyrexian became useful.
First, he forced it to stretch its massive body between the gaps in the branches. He and Nissa walked across the centaur hulk like a bridge. He could feel its flesh shift beneath his feet as it breathed. Nissa's feet felt like a sharp little patter along its spine. Did she #emph[want] him to feel her boots digging in?
When they reached the clearest route up—a limbless tree with few hiding spaces for ambush predators—Lukka boarded the centaur hulk. He extended his hand to Nissa. She ignored it and scrambled into place, clenching her legs around the centaur hulk's body like it was a horse. It irritated him. Even the smell of her, lemon-bright, bothered him. What, had she washed her long dark hair in citrus water as a preparation for battle?
But one did not choose their allies. He could follow orders and stay on mission, like any good soldier, and respect the bond that came from fighting alongside an ally.
With a flick of his mind, he urged the centaur hulk up the tree. He hardly even needed to guide it. It leaped upward in jumps, the extra joints in its limbs giving it a rocking, lurching motion. He couldn't brace himself against it. Nor could he move with it.
Nissa seemed uncomfortable.
He craned his head, glimpsing a gap between the boughs with his doubled vision, half his own and half the Phyrexian's. "Brace yourself."
"Braced."
The Phyrexian centaur hulk jumped. Freefall's momentary freedom plunged through Lukka, and they all lurched forward together as it landed. The impact rattled up Lukka's spine.
The centaur hulk swung forward to a platform that jutted from an otherwise limbless tree. The platform looked like a metal-bracket fungus, coated with glowing patches of green, lichen-like lamina.
The centaur hulk plunged its razor-sharp forelimbs into the tree and began its ascent. Lukka leaned forward, pressing his center of gravity close to the centaur hulk's back. He could feel every part of the beast straining as it climbed, its organic heart pounding with fervor, its metallic joints creaking from Lukka and Nissa's combined weight. Nissa clung to Lukka, her thin arm looped around his waist, her cheek to his back.
It was only her feet, he decided, that bothered him: her pointed heels dug into the centaur hulk's body, and he could feel their echo on his own ribs.
He hadn't always been as tall, as strong, as he was now. Once, before he'd hit his growth in adolescence, a group of older boys had cornered him. Already he'd known he was different, though he hadn't understood how. On some level, the other boys had sensed it: an invisible barrier that prevented him from being one of them. They'd cornered him. Five to one. He'd decided to retreat, but they'd tripped him. He'd had to choose while curled up against the blows raining down: head or ribs? He'd wrapped his arms over his skull, and he'd endured.
He'd shown them later, of course. They'd regretted it.
He wanted Nissa to stop. Stop digging her heels in. #emph[Stop.]
He knew she had to hold on. Of course, she did. They weren't his ribs. He said nothing.
The Hunter Maze seemed to murmur around him as if an invisible wind stirred its boughs. But no breath of air troubled the hairs along the nape of his neck. Spores drifted down, glowing green in swirling motes.
Small eyeballs, bulging like knots in the wood, rolled themselves open to watch Lukka and Nissa pass. Fern-like foliage unfurled its blades as if longing for his blood. Small metallic crab-like creatures scuttled between oily pools. He could feel its interconnectedness, the Phyrexians that ambulated through, connected to the Hunter Maze with metallic vines. Now, that would be something, wouldn't it, to dominate an entire ecosystem~
#emph[Imagine the power . . .]
A flash of white light.
"Watch out!" the Wanderer shouted. She'd blinked into existence on a tree across from them and now clung to its girth in a bear hug to keep herself from falling.
Lukka searched for the danger.
Leathery wings snapped open near his head. A Phyrexian monstrosity swooped downward, reaching toward Nissa's face with its oil-dripping claws. Nissa gripped him hard with one arm and reached for her sword with her free hand. Lukka tried to twist, to fend the creature off, but it was directly behind him. He couldn't hold onto the hulk and fight at the same time.
The monstrosity swung around, attacking the arm that Nissa gripped him with, ripping at her hand so that she couldn't draw her blade.
#figure(image("006_Hard as Anger, Bright as Joy/03.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
Lukka reached toward the Phyrexian centaur hulk with his mind, commanding it to #emph[secure me] . It did, but not in the way he intended. Veiny wires sprouted from its torso, plunging through his skin and wiggling through his gut to wrap around his spine. It should've hurt. It didn't. #emph[This isn't what I meant.] Each fiber left a cooling numbness behind it. Lukka felt one with it: his spine cradled, his bones held.
He twisted. His arms now free, he drew his harpoon. He slung it at their attacker. His harpoon pinned the surprised Phyrexian monstrosity to a tree. Oily blood sprayed across his face. He tugged the harpoon free, reeling it back in. The body tumbled to the ground.
The liver-colored scavengers dove after the falling corpse with happy cries. #emph[Only the fittest deserve to survive.]
The Wanderer watched Lukka from her own tree. "I'm useless over here," she muttered, and then, with another flicker, planeswalked away.
Nissa stared at him in horror, her green eyes wide. She had blood on her face. Did she have a head wound? Sometimes even shallow cuts to the scalp could bleed profusely, looking worse than they were. But if she had severe head trauma, she wouldn't be able to fight. He needed to know if he could count on her. He reached down to push her hair back. She recoiled, instinctively, and began to fall. He seized her. Her extra weight caused the centaur hulk to tighten its internal ties on him. It had rooted inside him.
Nissa stopped struggling. She searched their environment as if looking for a location where she could disembark. But there was nothing: only the slick metal trunk and a long drop down. She could either hang on or give up and planeswalk away. She hung on. Her lips grew taut with a frown.
The centaur hulk, and his bond with it, had saved them both.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
He and Nissa had reached a high point in the Hunter Maze's canopy. The light here was brighter, a hotter and richer yellow, like butter on his tongue. The "tree" the Phyrexian was scaling had narrowed, now thin enough that it trembled under their weight.
#emph[You deserve power. You are strong. Here, strength is rewarded. The weak are culled.]
He didn't know whether it was as obvious to Nissa as it was to him, but now they'd reached a height that they needed to move parallel to the ground again, perhaps even until they'd reached the forest's edge. The intertwining branches, gnarled as wood but made of metal and flesh, formed a network of roads that life traveled upon. Leaves glimmered, fist-size stomata opening and closing as the trees breathed. Berries, large as severed heads, dangled in bunches. Flowers, intestine-pink and rank as a butcher's shop, dripped black oil.
He hadn't noticed how beautiful it all was until now.
The centaur hulk leaped from their tree to the next, landing hard on another bracket mushroom platform. Lukka ordered it to withdraw its tendrils. It did so without protest. He disembarked. Nissa eyed his stomach but there was no sign the Phyrexian had ever been inside him except for a few tears in his shirt, which could have come from anything. Not even one drop of blood marred the fabric.
Nissa walked to the platform's edge. She looked around as if searching for the route. She shook her head, finding nothing. He had the sense that if the path had divided, she would've suggested that they part ways. But it didn't. The greenery was so dense he could see only one way forward. So, her choice was to go with him or planeswalk home. The Phyrexian's mind told him that this was the correct route.
Nissa fell into step beside him. She only twined her fingers together and stretched them, now gazing upward. "I still can't see the exit."
"It's there." He could feel the sun's life-giving warmth along his back. Really, when he thought about it, these trees were perfect organisms, so large and strong with so little to sustain them. #emph[You are like that, too. You have always taken what you've been given. You've made the best of what you had.]
The path led into a sphincter-like opening. It lay open, panting in the dimness.
"Come on." He headed into it.
"Wait—" Nissa pursued him, and then stopped.
The opening sucked shut behind them. Nissa pivoted toward him. She gave him a suspicious once-over but said nothing.
He resumed walking. The Phyrexian centaur hulk trotted ahead, obedient.
The passage's smell reminded him of a battlefield: the stink of blood and emptied bowels. The dim walls around him glowed with the lamina's sickly green light, and the passage's fronded surface waved them forward, like the cilia inside a gut.
Nissa followed him, reluctant. She was so ready to criticize him, but it wasn't like she had a better plan. He was the one who'd gotten them both this far, practically dragging her dead weight. He didn't even know why Nissa had chosen to participate in this attack.
#emph[The less deserving should perish to make way for those who are smarter and more ruthless.]
He'd always believed in meritocracy. Excellence, skill, training, talent: that's how he'd risen to captaincy of the Specials.
A motion between his shirt and his skin caught his attention. He poked his fingers through the holes in his clothing, expecting to find a trapped mosquito.
Something grabbed his finger, soft and sucker-like.
He cast a glance behind him, but Nissa searched the passage for danger. She wasn't looking at him.
He peeked through a hole in his shirt. Some Phyrexian rootlets had remained inside him. Now they kissed his fingers, like sea anemones.
#emph[What if you never felt pain or fear? What if you only ever felt certainty and belonging—the knowledge that what you do is right because you're the one who's doing it?]
"What is it?" Nissa asked.
Lukka pulled his fingers back guiltily. He'd told her that he would back down if he experienced any physical changes as a result of his bond with the Phyrexian abomination. But those delicate tendrils, pulsing at his fingertips wetly, didn't hurt. He felt healthier, stronger, more confident—more like himself than he'd felt in a long time.
He smiled at Nissa.
"I think you bruised my ribs during the climb," he said. "Holding onto me so tight. Scared, were you?"
Nissa frowned. "Are you sure we're going the right way?"
"Very."
Around him, the walls sighed in satisfaction. He headed in deeper, toward the sound. Did Nissa hear it, too? He thought maybe that he heard voices. Not whispers, but murmurs. Perhaps they were headed toward a group of fellow Planeswalkers, also separated during the initial attack. But more likely, he guessed, they walked toward the enemy.
He would've thought that after the climb, after several fights, he would've been achy—but he wasn't. His knees did feel different, as did the joints of his hips—like they'd reformed themselves into a stronger, more efficient shape.
#emph[There is strength in change and power in flexibility. Only winning matters.]
A swarm of leech-like creatures emerged from the cilia around them. Their bodies razor-sharp and glistening with teeth, they seethed toward Lukka with surprising speed. The Phyrexian centaur hulk lunged into action, squashing the pulpy creatures.
The Wanderer flickered into existence beside them. For a split second, she seemed confused but then launched herself into action, drawing her blade and slicing through the creatures in long, devastating arcs.
"Out of one danger, into another," she muttered.
Nissa chopped through the creatures with her own sword and kicked them away before they could scramble up her legs. Lukka didn't even draw his harpoon. It wouldn't be effective against creatures as insubstantial as these—they were so small he could grab them and rip them in two. His hands, his fingers, felt sharp, metallic. He couldn't remember when that change had occurred, but it must've been recent. He could slice the swarming creatures open with his fingernails, scattering pearls of purple guts to the ground. But they kept coming.
The ground beneath them heaved awake, and he realized they'd walked into the mother-creature, lodged on the floor of the passage, her babies buried in her flesh like pustules. The floor contorted again, teeth emerging, multiple mouths opening at his feet.
The Wanderer yelped and sprinted out of the beast's mouth.
Nissa grabbed his hand and pulled Lukka forward. The two leaped out of the beast's maw onto the flatter, dryer, and more metallic floor ahead.
Behind them, the mother-beast curled upward and around the Phyrexian centaur hulk to engulf it. Its anguished, furious pain roared through Lukka. How could he have ever thought that this creature was mechanical, emotionless? No, it had been subdued, lying in wait, evaluating him~ He ran forward.
"Don't!" Nissa said. "Just leave it!"
But strength like he'd never known before coursed through him and he sprang forward—in a leap that defied gravity, propelling himself into the creature's central maw. #emph[These changes don't seem so bad, Nissa. They're useful, more than anything.]
His fingernails, gleaming like metal, were so sharp, his hands were so sharp, he sliced right through the mother-monstrosity. He pulled apart a lip of flesh and freed his Phyrexian. The entrapping creature, split in two, shuddered with its gooey death throes. Its arterial spurts slowed as it died. Its children scattered and fled.
The Phyrexian centaur hulk staggered forward and lay down, prostrate with gratitude, at Lukka's feet.
The Wanderer had cut a strip of white fabric from her clothes to bind a wound in Nissa's forearm. One of the leech-like creatures must've removed a chunk of flesh.
"Are you strong enough to continue?" He tried to be sympathetic. #emph[Only survivors deserve to live. The strong have the right to slay the weak. The duty.]
"We should planeswalk out of here," Nissa said.
"We've almost reached the maze's center," Lukka said.
Nissa gave him a hard look. "We were trying to get #emph[out] . To the #emph[surface] ."
Lukka frowned. He couldn't remember when his goals had changed. Had they changed? He felt like he'd been headed in this direction all along. He pondered this, staring down at his arms and hands. The problem, of course, with sticking his hands into the creatures to fight them was that he'd gotten bite marks all over him. He hadn't noticed at the time, and they didn't hurt now. They'd already started to scab, thick blackish crusts forming over each wound.
"What do you think?" Lukka asked the Wanderer, finally. "Have you been in contact with the other Planeswalkers? Should we retreat?"
The Wanderer hesitated, then shook her head. "I've seen a lot of this plane as I've tried to remain stable. One of the things I saw was Vorinclex."
Lukka picked at a scab. When it came away, underneath, he saw wriggling, maggot-like motion. Beneath that, his ulna glistened—metallic. A bone-deep wound, he marveled, and it didn't even hurt.
"Vorinclex," Nissa repeated.
"Yes," the Wanderer said. "We're close. You're close. What's more, I think Vorinclex is recovered from his journey to Kaldheim. We need to take him down before he hurts anyone else."
"That's not what we're here to do," Nissa said. "We should get back to the others."
For once, Lukka agreed with her. "It's off mission."
"It's an opportunity," the Wanderer said—then, in a white flash of light, she planeswalked involuntarily away.
Nissa seemed to be thinking. "I don't know if we could find the others, even if we tried. If we killed one of the Norn's allies, though, it might give them a better chance."
Lukka considered. To get this close and not attack~ well, it would be cowardly. "You're right. So's the Wanderer. We take out Vorinclex."
Nissa scrutinized him as if gauging his worth as an ally. "Which way?"
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
It got easier as they approached the center of the maze—either it was unguarded or something greater and more predatory had devoured the smaller monstrosities. The thick susurrus of voices, all unintelligible, was so loud that it made thought impossible.
Lukka had to wonder why Nissa didn't show any signs of disturbance. Perhaps she was tougher than he'd thought.
The cilia lining the maze walls all waved as if an invisible current pulled them toward the center medallion. In Vorinclex's chamber, the cilia grew thicker and longer and paler, a glistening, yellowy white, and the floor depressed into a cavernous hole that resembled a starfish's mouth. He heard a metal clash, the unmistakable sound of blade on blade, followed by the harsh slide of a parry. Then he saw them.
Vorinclex fought a Phyrexian elf beneath the monstrous skulls that hung from the ceiling. The elf seemed fused with copper metal plates and needed no sword. Her arm was a blade. Glissa. That was her name. He'd met her, briefly. Vorinclex towered over her, twelve feet of metal, bone, and weeping flesh. He brought his muscular arms down onto Glissa as if trying to pin her to the floor with his massive talons. Glissa spun aside with an echoing laugh, the writhing copper cords of her hair flowing behind her.
Lukka couldn't tell if they battled or if they played.
Glissa flanked Vorinclex, bringing her bladed arm down across his furred shoulders, and Vorinclex met her, parrying her blow again. Lukka had never seen such a joyous expression of combat. The two of them danced—almost seemed to float—across the bobbing, pallid cilia on the floor.
#figure(image("006_Hard as Anger, Bright as Joy/04.jpg", width: 100%), caption: [Art by: Krharts], supplement: none, numbering: none)
Nissa grasped his wrist. She whispered, "The two of us could've taken Vorinclex. Maybe. But both Vorinclex #emph[and] Glissa."
"There's two of them and two of us," Lukka said.
Nissa gave him a sharp look. "Kaya said she could barely handle Vorinclex alone."
"We can do it."
"Are you listening to me?" Nissa hissed.
"We also have my ally. The Phyrexian abomination."
Without another word, Lukka charged in. Nissa, behind him, let out a string of curses that would've made even Chandra blush. But she followed right at his heels, like he knew she would. She would not let an ally face combat alone.
Lukka threw himself at Glissa while Nissa fought Vorinclex.
Glissa spun, with a hiss, and threw up her clawed hands in defense. Lukka didn't need a weapon to attack her—he, too, had his own claws. He exchanged blows with Glissa, and she grinned. They were perfectly matched. He hadn't felt like this in years, not since his last great sparring match in the Coppercoats. Glissa seemed to feel the same, and he could hear himself laughing—laughing with pure happiness.
But then Lukka stumbled.
Glissa lunged forward, ready to spear him through with her bladed arm. As if he'd let her! He didn't want this fight to end.
He used his eludha. His Phyrexian ally rushed into the fight. #emph[Join me] , he told it, craving its power, its strength. The Phyrexian flowed into him. Its tendrils writhed into his body. The rootlets inside him sprung out to meet it. He could feel the Phyrexian move into him and then #emph[become] him. His skin split like it was overripe, more than ready for this change. His body folded outward like a blossoming flower, his ribs opening as the Phyrexian lodged itself inside him, its arms becoming his arms.
It was ready to serve him until the end. To lose its life to save him. Such loyalty. It was his, obedient and submissive in every way.
His spine became its spine, and he stood now upon its legs, towering over Glissa. He had his arms, still, sharper and defter, but the Phyrexian's arms now formed a second set of arms with a greater reach. He'd always felt like his weapon was part of him—now it was. He stabbed at Glissa, and she danced back atop the cilia with a bright, encouraging laugh.
#figure(image("006_Hard as Anger, Bright as Joy/05.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
Lukka's match with Glissa had brought him closer to Nissa and Vorinclex's. Nissa hadn't done badly. The praetor bled ichor from a dozen slashes along its body.
"Get—the elf," Vorinclex rasped.
Nissa glanced at him. Then she glanced again: disgusted and horrified. She backed off. She was outnumbered and she knew it.
Lukka advanced on Nissa. He was one with the centaur hulk, and combined with it, they were both mightier. Nissa retreated cautiously, anger and fear overwriting the horror on her features. Finally, she feared him. Respected him.
#emph[This is how it's supposed to be. The strong triumphing over the weak. This is how life is. This is what living means. ] He learned that lesson well when his bond was revealed and his people had turned against him. He always knew he wanted to be the one who was hitting, not the one who was being hit, because there are only two types of people in this world.#emph[ There are those who take it, then there are those who deal it.] Nissa maintained her steady return toward the passage that they'd used to enter Vorinclex's chambers. Nissa had her sword up, guarding against a blow from him. It looked like she was thinking, trying to decide whether to stay in the Hunter Maze or planeswalk away. He had to get her now, before she escaped. He raised his hands and advanced on Nissa, reveling in their sharpness—he didn't need a weapon, he #emph[was] the weapon.
The Wanderer flickered back into existence between him and Nissa, and she instinctively raised her sword in a parry. His hands slammed down into it, but she caught the blow, gritting her teeth against the weight of it, and forcing him away.
"Lukka?" Then her battle anger, too, transformed into confusion. "Nissa, run!"
Nissa gave him a pained, furious look.
And she ran.
"By the Nine Hells, not this—" the Wanderer said and flickered away.
Glissa smiled at him, the visible mechanism along her jaw and cheek revealing her raw beauty. He'd earned this. He'd always known he was different, given his ability to bond with animals. He'd always known he was better. He could return home and there wasn't a monster on the plane that could challenge him now.
He'd finally become himself, who he was meant to be.
"Stop," Glissa said, and Lukka stopped, waiting for further instruction. "Find the elf, Lukka. But do not kill her. New Phyrexia will have a use for her in the war to come."
Beside him, he heard Vorinclex's low, growling laughter, he felt the vicarious pleasure that Glissa took in his confidence, and he felt himself smile. The Hunter Maze was expansive, and beautiful, and terrible—and it was time to go hunting.
|
|
https://github.com/maxgraw/bachelor | https://raw.githubusercontent.com/maxgraw/bachelor/main/apps/document/src/1-introduction/method.typ | typst | Diese Arbeit ist in mehrere Kapitel untergliedert, die den Prozess der Konzeption und Entwicklung einer Augmented Reality-Anwendung systematisch darstellen. Im ersten Teil werden die grundlegenden Begriffe definiert und erläutert. Diese sind essenziell für das Verständnis der gesamten Arbeit und unterstützen die Begründung der gewählten Technologie. Anschließend wird der aktuelle Stand der Technik beleuchtet. Es wird ein Überblick über moderne Verfahren im Bereich der Augmented Reality gegeben, ergänzt durch eine Vorstellung relevanter Frameworks und Anwendungen.
Aufbauend auf diesen Grundlagen widmet sich das nächste Kapitel der Entwicklung und fundierten Begründung des Konzepts für die Anwendung. Diese Phase verknüpft die theoretischen Ausführungen mit der praktischen Umsetzung. Nachdem das Konzept festgelegt ist, wird die Implementierung der Anwendung detailliert dargestellt. Dabei wird insbesondere auf die technische Realisierung und die Integration der vorher definierten Komponenten eingegangen.
Um die definierten Anforderungen zu überprüfen, folgt eine Evaluation der Anwendung. Der Fokus liegt dabei auf der Usability und der User Experience, um eine positive Benutzererfahrung und praktische Anwendbarkeit der entwickelten Lösung zu gewährleisten. Abschließend gibt die Arbeit einen Ausblick auf zukünftige Entwicklungen im Bereich der Augmented Reality. Die Ergebnisse der Arbeit werden zusammengefasst und reflektiert, wobei der Mehrwert der Anwendung für zukünftige Forschungen und praktische Anwendungen hervorgehoben wird. |
|
https://github.com/callumvh/cv | https://raw.githubusercontent.com/callumvh/cv/main/main.typ | typst | #show heading: set text(font: "Linux Biolinum")
#show link: underline
// Uncomment the following lines to adjust the size of text
// The recommended resume text size is from `10pt` to `12pt`
// #set text(
// size: 12pt,
// )
// Feel free to change the margin below to best fit your own CV
#set page(margin: (x: 0.9cm, y: 1.3cm))
// For more customizable options, please refer to official reference: https://typst.app/docs/reference/
#set par(justify: false)
#let chiline() = { v(-3pt); line(length: 100%); v(-5pt) }
= <NAME>
<EMAIL> | 081-794-7165 | #link("https://github.com/callumvh")[github.com/callumvh] | #link("https://www.callumvh.com/")[callumvh.com] |
Potchefstroom NW, South Africa
= Work Experience
#chiline()
#set rect(
inset: 5pt,
// fill: rgb("e4e5ea"),
width: 100%,
stroke: none,
)
#grid(
columns: (4fr, 1fr),
// rows: (auto, 60pt),
gutter: 0pt,
rect[
== Verishare Software (Junior Software Developer)
],
rect[
#align(end, text(1em)[2021/05 -- present])],
rect[
- *Telegram Chatbot*: I built a Telegram chatbot from scratch to production for
debtors to be able to see their accounts, pay their balance using PayAt, create
repayment plans and create debit orders, all without needing to talk to any humans. It has been utilized by nearly 400 distinct users to date. #h(1fr) \
- Java, Spring Boot
- Spring Statemachine
- SQL Server and Stored Procedures for Statemachine session persistence and
logging
- Excel report generator for observability
- E2E testing for the user flow
- Reactive streams with Spring Reactive, WebFlux, Mono, used with Spring
Statemachine and the TelegramBots library
- Built a PlantUML chart exporter for the Statemachine diagrams
- *Chatbot Frontend*: I also built a web-based frontend for the chatbot using React.js on the frontend, sharing the same Spring Statemachine backend. (Not in production yet)
- *Database as Code Project*: Worked on converting our largest database into an
idempotent "database project" using SSDT (SQL Server Data Tools), which allows
you to define your schema as code, allowing you to rebuild it from scratch and
use source control to track changes over time. The project is about 90% complete
so we have not yet made the migration. I created powershell scripts to parse \~4000 stored procedures to alter their format. #h(1fr)\
- *PayAt API integration*: I worked on upgrading a legacy SOAP integration with
PayAt to their new REST API using Spring Boot, utilized an OpenAPI/Swagger
Spring code generator #h(1fr)\
- *Business applications which I have worked on*:
- VPS (VeriShare Process Service), which is a scheduling application for C\#/dotnet applications,
used for handover imports, payment imports, etc.
- VeriWeb, which is a Java/Spring application for exposing and
consuming APIs, we also use it for many other things like managing recurring
card payments and our office dashboard monitoring tool.
- VeriNet, which is a large desktop application built using Clarion and
used by our agents when communicating with debtors.
- I created and maintained many SQL Server stored procedures (where most of our
business logic is stored), I also have a lot of experience with querying and
joining data, as well as creating reports in SQL.
- *VeriCred Credit Bureau (VCCB) API integration*: Integrated with the VCCB API to
retrieve personal data about certain debtors in VeriNet #h(1fr)\
- *VeriNet scripts using PowerShell*: Worked on improving the developer experience
by heavily utilizing PowerShell scripts to compile VeriNet (which requires a
32-bit VM), it reduced the feedback loop during local development. #h(1fr)\
- *Voyc.ai development*: I worked on importing prediction data from a third-party
integration called Voyc.ai; they converted our agent calls to text and tried to
measure how well they followed their script, etc. I worked on screens in VeriNet
which would show information about that data.
- *USA branch*: I worked on API integrations for our USA branch. I utilized the Merchant-E API and IntelliPay API for payment
imports.
],
)
= Projects
#chiline()
- *Homelab - callumvh.com*: This is an overkill home infrastructure for learning
about DevOps/GitOps concepts. I use the following technologies:
- *Kubernetes* (K3S distro)
- *Cloudflare tunnels* and *Traefik* as a reverse tunnel/proxy (to expose services
to the internet)
- *Flux CD* which is a "*GitOps* style" toolkit for Kubernetes deployments #h(1fr) \
- *GitHub Actions* & Flux CD allow for a smooth CI/CD pipeline where the
containers automatically get built and pushed to my container registry, flux cd
automatically updates the Kubernetes cluster by changing the version in the
source code via a bot.
- I also have private services running on subdomains such as
service1.callumvh.com, service2.callumvh.com, etc.
- It contains a *personal website* and *blog* which are both still under
development, created using Next.js Astro.js using the JAM stack, each running in
their own container.
- I would like to add dark launches, feature flagging, testing in production,
canary launches, blue-green deployments, A/B testing, and so on.
- *Reddit clone*: I created a clone of Reddit.com using their API. I used Python
and Flask to build the application; you could go to any subreddit and see all
the popular posts, but it was read-only. #h(1fr) \
- *Nand2Tetris*: I have successfully completed the first part of the Nand to Tetris course, where I systematically built a computer platform from the ground up, this involved progressing through distinct layers of abstraction, starting with fundamental Boolean logic in Chapter 1, where I learned and implemented basic logical components using Nand gates. Subsequent chapters introduced more complexities, covering Boolean arithmetic, sequential logic, and machine language. The transition to understanding computer architecture in Chapter 5 involved implementing the Hack hardware platform based on specifications, while Chapter 6 delved into creating an assembler for translating assembly code to machine code. This process not only equipped me with hands-on experience in constructing a computer system but also provided a profound understanding of the underlying principles governing each abstraction layer. I learned many foundational concepts in computing along the way.
- *Interest calculator*: This is a simple interest calculator which was a
tech-challenge required for landing my job at VeriShare #h(1fr) \
- *T Shirt Viewer*: This was a simple Vue.js project where you could design a
t-shirt by uploading an image and placing it on the front & back of a t-shirt #h(1fr) \
- *CV*: This CV was created using Typst, which is a markup-based typesetting
system and an alternative to LaTeX/MS Word for document creation. Here is the
link to the repo: #link("https://github.com/callumvh/cv")[callumvh/cv]
#h(1fr)
= Education
#chiline()
#grid(
columns: (4fr, 1fr),
// rows: (auto, 60pt),
gutter: 0pt,
rect[
#link("https://www.bhs.co.za/")[*Benoni High School*] \
Matric NSC - _Studied IT from Grade 10 - 12_
],
rect[
#align(end, text(1em)[2013 -- 2017])
],
rect[#link("https://www.unisa.ac.za/")[*UNISA (part-time)*] \ ],
rect[ ],
rect[
- _Diploma in Information Technology (discontinued to transition to BSc Computing)_
],
rect[
#align(end, text(1em)[2020 -- 2022])
],
rect[
- _Higher Certificate in Mathematics and Statistics (one module left) (working
towards BSc Computing)_
],
rect[
#align(end, text(1em)[2020 -- 2022])
],
rect[
- _Bachelor of Science in Computing (not started yet)_
],
rect[
#align(end, text(1em)[2024 --])
],
)
= Interests
- Kubernetes
- Distributed Computing & Cloud Computing
- Database Management
- API Integrations
- Development Tools and Scripts
- DevOps/GitOps Concepts
- Statistics
- Home Infrastructure Projects
- Progressive Delivery
- Document Creation and Typesetting
- Continuous Learning and Technology Exploration
// Dear Gail,
// I’m writing to express my interest in the Intermediate Software Developer position at Dream Tech Labs. With a background in software development and a passion for problem-solving, I’m excited about the opportunity to contribute to your team!
// Currently serving as a Junior Software Developer at VeriShare Software, I have experience with C#/.NET, Java, Javascript, Clarion SQL Server and more. Notable achievements include spearheading the development of a Telegram chatbot and contributing to database-as-code initiatives as well as many API integrations.
// I’m genuinely intrigued by your company and notably impressed with your dedication to fostering a distributed team culture. Your commitment to remote work aligns seamlessly with my skills and preferences which would create an ideal environment for professional development.
// I think my personal interests in topics like Kubernetes, DevOps, infrastructure and progressive delivery give me a unique blend of expertise and enthusiasm which would make me a valuable addition to your team.
// Thank you for considering my application. I look forward to discussing how my background aligns with the goals of Dream Tech Labs.
// Warm regards,
// Callum
|
|
https://github.com/liuguangxi/fractusist | https://raw.githubusercontent.com/liuguangxi/fractusist/main/src/util.typ | typst | MIT License | //==============================================================================
// Utilities for SVG code generation
//==============================================================================
// SVG template strings
#let SVG-HEADER = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"WIDTH\" height=\"HEIGHT\">\n"
#let SVG-TAIL = "</svg>\n"
#let SVG-DEFS = "<defs>\nDEFS</defs>\n"
#let SVG-PATH = "<path\nstyle=\"STYLE\" transform=\"TRANSFORM\" d=\"PATHD\"\n/>\n"
// Generate linear gradient code
#let gen-svg-lineargradient(grad, id) = {
let t = calc.rem-euclid(grad.angle().deg(), 360)
let t2 = calc.rem-euclid(t, 90)
if t2 > 45 {t2 = 90 - t2}
let k = 0.5 / calc.cos(t2 * 1deg)
let x1 = 0.5 - k * calc.cos(t * 1deg)
let y1 = 0.5 - k * calc.sin(t * 1deg)
let x2 = 1 - x1
let y2 = 1 - y1
let s = "<linearGradient id=\"ID\" x1=\"X1\" y1=\"Y1\" x2=\"X2\" y2=\"Y2\">".replace("ID", id).replace("X1", repr(x1)).replace("Y1", repr(y1)).replace("X2", repr(x2)).replace("Y2", repr(y2))
for (c, r) in grad.stops() {
s += "<stop offset=\"RATIO\" stop-color=\"COLOR\"/>".replace("RATIO", repr(r)).replace("COLOR", c.to-hex())
}
s += "</linearGradient>\n"
return s
}
// Generate radial gradient code
#let gen-svg-radialgradient(grad, id) = {
let cx = 0.5
let cy = 0.5
let r = 0.5
let fx = 0.5
let fy = 0.5
let cxy-match = repr(grad).match(regex("[^-]center:\s\(([\.\d]*)%,\s([\.\d]*)%\)"))
if cxy-match != none {
cx = float(cxy-match.captures.at(0)) / 100
cy = float(cxy-match.captures.at(1)) / 100
}
let r-match = repr(grad).match(regex("[^-]radius:\s([\.\d]*)%"))
if r-match != none {
r = float(r-match.captures.at(0)) / 100
}
let fxy-match = repr(grad).match(regex("focal-center:\s\(([\.\d]*)%,\s([\.\d]*)%\)"))
if fxy-match != none {
fx = float(fxy-match.captures.at(0)) / 100
fy = float(fxy-match.captures.at(1)) / 100
}
let s = "<radialGradient id=\"ID\" cx=\"CX\" cy=\"CY\" r=\"R\" fx=\"FX\" fy=\"FY\">".replace("ID", id).replace("CX", repr(cx)).replace("CY", repr(cy)).replace("R", repr(r)).replace("FX", repr(fx)).replace("FY", repr(fy))
for (c, r) in grad.stops() {
s += "<stop offset=\"RATIO\" stop-color=\"COLOR\"/>".replace("RATIO", repr(r)).replace("COLOR", c.to-hex())
}
s += "</radialGradient>\n"
return s
}
// Generate full code
#let gen-svg(path-d, bbox, fill-style, stroke-style) = {
let stroke-color = if (stroke-style == none) {none} else if (stroke-style.paint == auto) {black} else {stroke-style.paint}
let stroke-width = if (stroke-style == none) {none} else if (stroke-style.thickness == auto) {1} else {calc.abs(stroke-style.thickness.pt())}
let stroke-linecap = if (stroke-style == none or stroke-style.cap == auto) {none} else {stroke-style.cap}
let stroke-linejoin = if (stroke-style == none or stroke-style.join == auto) {none} else {stroke-style.join}
let stroke-miterlimit = if (stroke-style == none or stroke-style.miter-limit == auto) {none} else {stroke-style.miter-limit}
let fill-color-str = "none"
let stroke-color-str = "none"
let grad-str = ""
if type(fill-style) == color {
fill-color-str = fill-style.to-hex()
} else if type(fill-style) == gradient and repr(fill-style.kind()) == "linear" {
grad-str += gen-svg-lineargradient(fill-style, "GradFill")
fill-color-str = "url(#GradFill)"
} else if type(fill-style) == gradient and repr(fill-style.kind()) == "radial" {
grad-str += gen-svg-radialgradient(fill-style, "GradFill")
fill-color-str = "url(#GradFill)"
}
if type(stroke-color) == color {
stroke-color-str = stroke-color.to-hex()
} else if type(stroke-color) == gradient and repr(stroke-color.kind()) == "linear" {
grad-str += gen-svg-lineargradient(stroke-color, "GradStroke")
stroke-color-str = "url(#GradStroke)"
} else if type(stroke-color) == gradient and repr(stroke-color.kind()) == "radial" {
grad-str += gen-svg-radialgradient(stroke-color, "GradStroke")
stroke-color-str = "url(#GradStroke)"
}
let path-style = "fill:" + fill-color-str + ";stroke:" + stroke-color-str + ";stroke-width:" + repr(stroke-width)
if stroke-linecap != none {path-style += ";stroke-linecap:" + stroke-linecap}
if stroke-linejoin != none {path-style += ";stroke-linejoin:" + stroke-linejoin}
if stroke-miterlimit != none {path-style += ";stroke-miterlimit:" + repr(stroke-linejoin)}
let path-transform = "translate" + repr((-bbox.at(0), -bbox.at(2)))
let s = SVG-HEADER.replace("WIDTH", repr(bbox.at(1) - bbox.at(0))).replace("HEIGHT", repr(bbox.at(3) - bbox.at(2)))
if grad-str != "" {s += SVG-DEFS.replace("DEFS", grad-str)}
s += SVG-PATH.replace("STYLE", path-style).replace("TRANSFORM", path-transform).replace("PATHD", path-d)
s += SVG-TAIL
return s
}
|
https://github.com/An-314/Notes-of-DSA | https://raw.githubusercontent.com/An-314/Notes-of-DSA/main/vector.typ | typst | = 向量Vector
和数组一样,寻秩访问(Call by Rank):元素各由编号唯一指代,并可直接访问。为了使数组可以动态操作,引入`ADT::Vector`。
向量是数组的抽象与泛化,由一组元素按线性次序封装而成。
各元素与$[0, n)$内的秩(rank)一一对应:
```cpp
using Rank = unsigned int; //call-by-rank
```
提供接口:
```cpp
size() / empty() // 报告元素总数 / 判定是否为空 向量
get(r) / put(r, e) // 获取秩为r的元素 / 用e替换秩为r元素的数值 向量
insert(r, e) / insert(e) // 将e作为秩为r的 / 最后一个元素插入 向量
remove(lo, hi) / remove(r) // 删除秩为r / 区间内的元素 向量
disordered() / sort(lo, hi) / unsort(lo, hi) // 检测是否整体有序 / 整体排序 / 整体置乱 向量
find(e , lo, hi) / search(e, lo, hi) // 在指定区间内查找目标e 向量 / 有序向量
dedup() / uniquify() // 剔除重复元素 向量 / 有序向量
traverse( visit() ) // 遍历向量,统一按visit()处理所有元素 向量
```
*模板类:*
```cpp
template <typename T> class Vector { //向量模板类
private: Rank _size; Rank _capacity; T* _elem; //规模、容量、数据区
protected:
/* ... 内部函数 */
public:
/* ... 构造函数 */
/* ... 析构函数 */
/* ... 只读接口 */
/* ... 可写接口 */
/* ... 遍历接口 */
/* ... 遍历接口 */
};
```
构造 + 析构:重载
```cpp
#define DEFAULT_CAPACITY 3 //默认初始容量(实际应用中可设置为更大)
Vector( int c = DEFAULT_CAPACITY )
{ _elem = new T[ _capacity = c ]; _size = 0; } //默认构造
Vector( T const * A, Rank lo, Rank hi ) //数组区间复制
{ copyFrom( A, lo, hi ); }
Vector( Vector<T> const & V, Rank lo, Rank hi ) //向量区间复制
{ copyFrom( V._elem, lo, hi ); }
Vector( Vector<T> const & V ) //向量整体复制
{ copyFrom( V._elem, 0, V._size ); }
~Vector() { delete [] _elem; } //释放内部空间
```
基于复制的构造
```cpp
template <typename T> //T为基本类型,或已重载赋值操作符'='
void Vector<T>::copyFrom( T const * A, Rank lo, Rank hi ) { //A中元素不致被篡改
_elem = new T[ _capacity = max( DEFAULT_CAPACITY, 2*(hi − lo) ) ]; //分配空间
for ( _size = 0; lo < hi; _size++, lo++ ) //A[lo, hi)内的元素, 逐一
_elem[ _size ] = A[ lo ]; //复制至_elem[0, hi-lo)
} //O(hi – lo) = O(n)
```
== 可扩充向量
开辟内部数组`_elem[]`并使用一段地址连续的物理空间,`_capacity`:总容量,`_size`:当前的实际规模$n$。
定义*装填因子*(load factor): $lambda$ `= _size/_capacity`,分为:
- 上溢(overflow): `_elem[]`不足以存放所有元素,尽管此时系统往往仍有足够的空间
- 下溢(underflow): `_elem[]`中的元素寥寥无几
这种时候就要进行动态空间管理,扩容或缩容。
扩容:
```cpp
template <typename T> void Vector<T>::expand() { //向量空间不足时扩容
if ( _size < _capacity ) return; //尚未满员时,不必扩容
_capacity = max( _capacity, DEFAULT_CAPACITY ); //不低于最小容量
T* oldElem = _elem; _elem = new T[ _capacity <<= 1 ]; //容量加倍
for ( Rank i = 0; i < _size; i++ ) //复制原向量内容
_elem[i] = oldElem[i]; //T为基本类型,或已重载赋值操作符'='
delete [] oldElem; //释放原空间
} //得益于向量的封装,尽管扩容之后数据区的物理地址有所改变,却不致出现野指针
```
分析扩容的复杂度需要用到分摊想法,因为扩容本身不是每次都发生的,而是在一定条件下才发生的,所以要分析一系列操作的总体复杂度,而不是单纯的扩容操作。
考虑连续插入$n$次,扩容的次数不超过$log_2n$次,每次扩容的复杂度为$O(n)$,所以分摊杂度为$O(1)$。采取*装填因子比一半大就扩容*比每次都扩容好。
_平均(average complexity):根据各种操作出现概率的分布,将对应的成本加权平均_
- _各种可能的操作,作为独立事件分别考查_
- _割裂了操作之间的相关性和连贯性_
- _往往不能准确地评判数据结构和算法的真实性能_
_分摊(amortized complexity): 连续实施的足够多次操作,所需总体成本摊还至单次操作_
- _从实际可行的角度,对一系列操作做整体的考量_
- _更加忠实地刻画了可能出现的操作序列_
- _更为精准地评判数据结构和算法的真实性能_
== 无序向量
=== 基本操作
==== 元素访问
```cpp
template <typename T> //可作为左值: V[r] = (T) (2*x + 3)
T & Vector<T>::operator[]( Rank r ) { return _elem[ r ]; }
template <typename T> //仅限于右值: T x = V[r] + U[s] * W[t]
const T & Vector<T>::operator[]( Rank r ) const { return _elem[ r ]; }
// 这里采用了简易的方式处理意外和错误(比如,入口参数约定: 0 <= r < _size)
```
抛弃`V.get(r)``V.put(r,e)`接口,重载`[]`操作符。
==== 插入
在装填因子大于一半时扩容:
```cpp
template <typename T> Rank Vector<T>::insert( Rank r, T const & e ) { //0<=r<=size
expand(); //如必要,先扩容
for ( Rank i = _size; r < i; i-- ) //O(n-r): 自后向前
_elem[i] = _elem[i - 1]; //后继元素顺次后移一个单元
_elem[r] = e; _size++; return r; //置入新元素,更新容量,返回秩
}
```
插入操作的复杂度为$O(n)$。
==== 区间删除
在装填因子小于$1/4$时缩容:
```cpp
template <typename T> Rank Vector<T>::remove( Rank lo, Rank hi ) { //0<=lo<=hi<=n
if ( lo == hi ) return 0; //出于效率考虑,单独处理退化情况
while ( hi < _size ) _elem[ lo++ ] = _elem[ hi++ ]; //后缀[hi,n)前移
_size = lo; shrink(); //更新规模, lo = _size之后的内容无需清零;如必要,则缩容
return hi - lo; //返回被删除元素的数目
}
```
区间删除操作的复杂度为$O(n)$。选取$1/4$的界而不是$1/2$的界,是为了避免在连续删除操作中频繁地扩容和缩容。
==== 单元素删除
```cpp
template <typename T>
T Vector<T>::remove( Rank r ) {
T e = _elem[r]; //备份
remove( r, r+1 ); //“区间”删除
return e; //返回被删除元素
} //O(n-r)
```
要先定义`remove( Rank lo, Rank hi )`,再定义`remove( Rank r )`,否则如果用后者实现前者,会导致前者的复杂度为$O(n^2)$。
==== 查找
对于词条定义判等器和比较器,在无需向量中、判等器即可,有序向量中、可以定义比较器。
```cpp
template <typename K, typename V> struct Entry { //词条模板类
K key; V value; //关键码、数值
Entry ( K k = K(), V v = V() ) : key ( k ), value ( v ) {}; //默认构造函数
Entry ( Entry<K, V> const& e ) : key ( e.key ), value ( e.value ) {}; //克隆
bool operator== ( Entry<K, V> const& e ) { return key == e.key; } //等于
bool operator!= ( Entry<K, V> const& e ) { return key != e.key; } //不等于
bool operator< ( Entry<K, V> const& e ) { return key < e.key; } //小于
bool operator> ( Entry<K, V> const& e ) { return key > e.key; } //大于
}; //得益于比较器和判等器,从此往后, 不必严格区分词条及其对应的关键码
```
查找在无序向量中只能采用顺序查找:
```cpp
template <typename T> Rank Vector<T>:: //O(hi - lo) = O(n)
find( T const & e, Rank lo, Rank hi ) const { //0 <= lo < hi <= _size
while ( (lo < hi--) && (e != _elem[hi]) ); //逆向查找
return hi; //返回值小于lo即意味着失败;否则即命中者的秩(有多个时,返回最大者)
}
```
复杂度为$O(n)$。
==== 去重
```cpp
template <typename T> Rank Vector<T>::dedup() {
Rank oldSize = _size;
for ( Rank i = 1; i < _size; )
if ( -1 == find( _elem[i], 0, i ) ) //O(i)
i++;
else
remove(i); //O(_size - i)
return oldSize - _size;
} //O(n^2):对于每一个e, 只要find()不是最坏情况(查找成功),则remove()必执行
```
只要既运行`find()`又运行`remove()`,这一次严格$n$此操作,从而复杂度为$O(n^2)$。
==== 遍历
对向量中的每一元素,统一实施`visit()`操作,利用函数指针或者函数对象
```cpp
template <typename T> //函数指针,只读或局部性修改
void Vector<T>::traverse( void ( * visit )( T & ) )
{ for ( Rank i = 0; i < _size; i++ ) visit( _elem[i] ); }
template <typename T> template <typename VST> //函数对象,全局性修改更便捷
void Vector<T>::traverse( VST & visit )
{ for ( Rank i = 0; i < _size; i++ ) visit( _elem[i] ); }
```
例如遍历加一:
```cpp
/* 先实现一个可使单个T类型元素加一的类(结构) */
template <typename T> //假设T可直接递增或已重载操作符“++”
struct Increase //函数对象:通过重载操作符“()”实现
{ virtual void operator()( T & e ) { e++; } }; //加一
/* 再将其作为参数传递给遍历算法 */
template <typename T> void increase( Vector<T> & V )
{ V.traverse( Increase<T>() ); } //即可以之作为基本操作,遍历向量
```
== 有序向量:二分搜索
=== 有序性
通过计算逆序对的数量,可以统计向量的有序性:
```cpp
template <typename T> void checkOrder ( Vector<T> & V ) { //通过遍历
int unsorted = 0; V.traverse( CheckOrder<T>(unsorted, V[0]) ); //统计紧邻逆序对
if ( 0 < unsorted )
printf ( "Unsorted with %d adjacent inversion(s)\n", unsorted );
else
printf ( "Sorted\n" );
}
```
=== 基本操作
==== 唯一化
```cpp
/* 勤奋的低效算法 */
template <typename T> int Vector<T>::uniquify() {
int oldSize = _size; int i = 1;
while ( i < _size )
_elem[i-1] == _elem[i] ? remove( i ) : i++;
return oldSize - _size;
}
/* 懒惰的高效算法: Two-Pointer Technique */
template <typename T> int Vector<T>::uniquify() {
Rank i = 0, j = 0;
while ( ++j < _size )
if ( _elem[ i ] != _elem[ j ] )
_elem[ ++i ] = _elem[ j ]; //可能徒劳无益
_size = ++i;
shrink();
return j - i;
}
```
直接就地改写,而不是先统计再删除,这样可以避免多余的删除操作。
#figure(
image("fig\向量\1.png", width: 80%),
caption: "唯一化算法"
)
==== 查找
```cpp
template <typename T> //查找算法统一接口, 0 <= lo < hi <= _size
Rank Vector<T>::search( T const & e, Rank lo, Rank hi ) const {
return ( rand() % 2 ) ? //等概率地随机选用
binSearch( _elem, e, lo, hi ) //二分查找算法, 或
: fibSearch( _elem, e, lo, hi ); //Fibonacci查找算法
}
```
对于有序向量,利用序性,可以加速查找。最常见的方法就是二分查找。
二分查找的想法就是分治:将查找区间一分为二,然后判断目标元素在哪一部分,然后递归地在该部分中查找。二分查找的复杂度是$O(log n)$。
===== 版本A
第一种实现方式是分成三部分,如果命中,返回秩;如果小于,递归地在左侧查找;如果大于,递归地在右侧查找。
```cpp
template <typename T> //在有序向量[lo, hi)区间内查找元素e
static Rank binSearch( T * S, T const & e, Rank lo, Rank hi ) {
while ( lo < hi ) { //每步迭代可能要做两次比较判断,有三个分支
Rank mi = ( lo + hi ) >> 1; //以中点为轴点(区间宽度折半,其数值表示右移一位)
if ( e < S[mi] ) hi = mi; //深入前半段[lo, mi)
else if ( S[mi] < e ) lo = mi + 1; //深入后半段(mi, hi)
else return mi; //命中
}
return -1; //失败
}
```
每个元素都是轴点,每步迭代可能要做两次比较判断,有三个分支。可以分析关键码的比较次数,即*查找长度(search length)*:
需分别针对成功与失败查找,从最好、最坏、平均等角度评估,这种实现方式的成功、失败时的平均查找长度均大致为$O(1.5 log n)$。
#figure(
image("fig\向量\2.png", width: 80%),
caption: "二分查找算法的查找长度"
)
===== 版本B
二分查找中左、右分支转向代价不平衡的问题,也可直接解决,每次迭代仅做1次关键码比较;如此,所有分支只有2个方向,而不再是3个。
同样地,轴点`mi`取作中点,则查找每深入一层,问题规模依然会缩减一半
- `e < x`: 则深入左侧的`[lo, mi)`
- `x <= e`:则深入右侧的`[mi, hi)`
直到`hi - lo = 1`, 才明确判断是否命中。
相对于版本A,最好(坏)情况下更坏(好),整体性能更趋均衡。
```cpp
template <typename T>
static Rank binSearch( T * S, T const & e, Rank lo, Rank hi ) {
while ( 1 < hi - lo ) { //有效查找区间的宽度缩短至1时,算法才终止
Rank mi = (lo + hi) >> 1; //以中点为轴点,经比较后确定深入[lo, mi)或[mi, hi)
e < S[mi] ? hi = mi : lo = mi;
} //出口时hi = lo + 1
return e == S[lo] ? lo : -1 ;
}// 返回命中处的秩, 或失败标志
```
返回值可能不统一:
- 目标元素不存在
- 目标元素同时存在多个,可能返回的不是最后一个,对于`V.insert( 1 + V.search(e), e )`就不是合法的插入位置
希望做到
- 即便失败,也应给出新元素可安置的位置(有序性)
- 若有重复元素,也需按其插入的次序排列(稳定性)
*返回值的语义扩充*:`m = search(e) = M-1`,其中$-oo < m =max{k|S[k]<=e}$,$M = min{k|e<S[k]} <= +oo$,则
- 若查找成功,返回最后一个目标元素的秩
- 若查找失败,返回比它小的最大元素的秩
#figure(
image("fig\向量\3.png", width: 50%),
caption: "二分查找算法返回值的约定"
)
===== 版本C
```cpp
template <typename T>
static Rank binSearch( T * S, T const & e, Rank lo, Rank hi ) {
while ( lo < hi ) { //不变性: A[0, lo) <= e < A[hi, n)
Rank mi = (lo + hi) >> 1;
e < S[mi] ? hi = mi : lo = mi + 1; //[lo, mi)或(mi, hi), A[mi]或被遗漏?
} //出口时, 区间宽度缩短至0,且必有S[lo = hi] = M
return lo - 1; //至此, [lo]为大于e的最小者,故[lo-1] = m即为不大于e的最大者
} //留意与版本B的差异
```
这样就遵守了返回值的语义约定。
#figure(
image("fig\向量\4.png", width: 80%),
caption: "二分查找算法的正确性分析"
)
#figure(
image("fig\向量\5.png", width: 80%),
caption: "二分查找算法的正确性分析"
)
===== 插值查找
大数定律:越长的序列,元素的分布越有规律;最为常见:独立且均匀的随机分布。
于是 `[lo, hi]`内各元素应大致呈线性趋势增长,因此通过猜测轴点`mi`,可以极大地提高收敛速度。
$
&("mi"-"lo")/("hi"-"lo") = ("e"-"S[lo]")/("S[hi]"-"S[lo]")\
&"mi" = "lo" + ("hi"-"lo") ("e"-"S[lo]")/("S[hi]"-"S[lo]")
$
最坏:$O(n)$,平均:$O(log log n)$。
这是因为每次比较,待查找区间都会从宽度$n$缩短至$sqrt(n)$。
每经一次比较,查找区间宽度的数值$n$开方,有效字长$log n$减半
- 插值查找 = 在字长意义上的折半查找 $log(n^(1/2)) = 0.5 log n$
- 二分查找 = 在字长意义上的顺序查找 $log(n/2) = log n - 1$
从$O(log n)$到$O(log log n)$,优势并不明显
- 须引入乘法、 除法运算
- 易受畸形分布的干扰和“蒙骗”
- 实际可行的方法:算法接力
- 首先通过插值查找
迅速将查找范围缩小到一定的尺度
- 然后再改为二分查找
进一步缩小范围
- 最后(当数据项只有200~ 300时)
改用顺序查找
=== 排序
对于无序向量,可以排序成有序向量。
```cpp
template <typename T> void Vector<T>::sort( Rank lo, Rank hi ) {
switch ( rand() % 6 ) {
case 1 : bubbleSort( lo, hi ); break; //起泡排序
case 2 : selectionSort( lo, hi ); break; //选择排序
case 3 : mergeSort( lo, hi ); break; //归并排序
case 4 : heapSort( lo, hi ); break; //堆排序
case 5 : quickSort( lo, hi ); break; //快速排序
default : shellSort( lo, hi ); break; //希尔排序
} //随机选择算法,以尽可能充分地测试。应用时可视具体问题的特点, 灵活确定或扩充
}
```
== 起泡排序Bubble Sort
反复地扫描交换:
- 观察:有序/无序序列中,任何/总有一对相邻元素顺序/逆序
- 扫描交换:依次比较每一对相邻元素;如有必要,交换之。直至某趟扫描后,确认相邻元素均已顺序。
其复杂度是$O(n^2)$,但是可以通过优化来提高效率。
*基本版*:
```cpp
template <typename T> void Vector<T>::bubbleSort( Rank lo, Rank hi ) {
while ( lo < --hi ) //逐趟起泡扫描
for ( Rank i = lo; i < hi; i++ ) //逐对检查相邻元素
if ( _elem[i] > _elem[i + 1] ) //若逆序
swap( _elem[i], _elem[i + 1] ); //则交换
}
```
- Loop Invariant: 经$k$趟扫描交换后,最大的$k$个元素必然就位
- Convergence:经$k$趟扫描交换后,问题规模缩减至$n-k$
- Correctness: 经至多$n$趟扫描后,算法必然终止,且能给出正确解答
`[hi]`就位后, `[lo,hi)`可能已经有序(sorted) ——此时,应该可以*提前终止*算法。
```cpp
template <typename T> void Vector<T>::bubbleSort( Rank lo, Rank hi ) {
for ( bool sorted = false; sorted = !sorted; hi-- )
for ( Rank i = lo + 1; i < hi; i++ )
if ( _elem[i-1] > _elem[i] )
swap( _elem[i-1], _elem[i] ), sorted = false;
}
```
同样地,有可能某一后缀`[last,hi)`已然有序,继续优化:*跳跃版*
```cpp
template <typename T> void Vector<T>::bubbleSort( Rank lo, Rank hi ) {
for ( Rank last; lo < hi; hi = last )
for ( Rank i = (last = lo) + 1; i < hi; i++ )
if ( _elem[i-1] > _elem[i] )
swap( _elem[i-1], _elem[i] ), last = i;
}
```
#figure(
image("fig\向量\6.png", width: 30%),
caption: "起泡排序算法——跳跃版"
)
时间效率:最好$O(n)$,最坏$O(n^2)$
输入含重复元素时,算法的稳定性(stability)是更为细致的要求。重复元素在输入、输出序列中的相对次序,需要保持不变。
- 输入: 6, 7a, 3, 2, 7b, 1, 5, 8, 7c, 4
- 输出:
- 1, 2, 3, 4, 5, 6, 7a, 7b, 7c, 8 是stable的
- 1, 2, 3, 4, 5, 6, 7a, 7c, 7b, 8 是unstable的
起泡排序算法是稳定的,因为唯有相邻元素才可交换。
== 归并排序Merge Sort
向量与列表通用的一种分而治之的排序方法。
- 序列一分为二
- 子序列递归排序
- 合并有序子序列
$
T(n) = 2T(n/2) + O(n)
$
根据主定理,复杂度是$O(n log n)$。
#figure(
image("fig\向量\7.png", width: 70%),
caption: "归并排序算法"
)
```cpp
template <typename T> void Vector<T>::mergeSort( Rank lo, Rank hi ) {
if ( hi - lo < 2 ) return; //单元素区间自然有序,否则...
Rank mi = (lo + hi) >> 1; //以中点为界
mergeSort( lo, mi ); //对前半段排序
mergeSort( mi, hi ); //对后半段排序
merge( lo, mi, hi ); //归并
}
```
=== 二路归并
2-way merge:有序序列合二为一,保持有序
$
S["lo","mi") + S["mi","hi") -> S["lo","hi")
$
#figure(
image("fig\向量\8.png", width: 70%),
caption: "二路归并算法"
)
```cpp
template <typename T> //[lo, mi)和[mi, hi)各自有序
void Vector<T>::merge( Rank lo, Rank mi, Rank hi ) { //lo < mi < hi
Rank i = 0; T* A = _elem + lo; //A = _elem[lo, hi)
Rank j = 0, lb = mi - lo; T* B = new T[lb]; //B[0, lb) <-- _elem[lo, mi)
for ( Rank i = 0; i < lb; i++ ) B[i] = A[i]; //复制出A的前缀
Rank k = 0, lc = hi - mi; T* C = _elem + mi;
//后缀C[0, lc] = _elem[mi, hi), 就地
while ( ( j < lb ) && ( k < lc ) ) //反复地比较B、 C的首元素
A[i++] = ( B[j] <= C[k] ) ? B[j++] : C[k++]; //小者优先归入A中
while ( j < lb ) //若C先耗尽, 则
A[i++] = B[j++]; //将B残余的后缀归入A中——若B先耗尽呢?
delete[] B; //new和delete非常耗时,如何减少?
}
```
只需要$n/2$的辅助空间,这是因为保留后半段的,复制前半段的元素,每次选择元素后直接覆盖原数组,并不会覆盖到后半段未被复制的元素。
需要$O(n)$的时间复杂度。
=== 复杂度
优点
- 实现最坏情况下最优$O(n log n)$性能的第一个排序算法
- 不需随机读写,完全顺序访问——尤其适用于列表之类的序列、磁带之类的设备
- 只要实现恰当,可保证稳定——出现雷同元素时,左侧子向量优先
- 可扩展性极佳,十分适宜于外部排序——海量网页搜索结果的归并
- 易于并行化
缺点
- 非就地,需要对等规模的辅助空间
- 即便输入已是完全(或接近) 有序,仍需$Omega(n log n)$时间
== 位图Bitmap
对于有限整数集,直接用整数作为秩,可以将集合元素与秩一一对应,从而实现集合的快速查找。
```cpp
class Bitmap {
private:
unsigned char * M;
Rank N, _sz;
public:
Bitmap( Rank n = 8 )
{ M = new unsigned char[ N = (n+7)/8 ]; memset( M, 0, N ); _sz = 0; }
~Bitmap() { delete [] M; M = NULL; _sz = 0; }
void set( int k ); void clear( int k ); bool test( int k );
};
```
可以精简到就用1位表示true/false,这样一个8位的`unsigned char`就可以表示8个元素。
```cpp
bool test (int k) { expand( k ); return M[ k >> 3 ] & ( 0x80 >> (k & 0x07) ); }
void set (int k) { expand( k ); _sz++; M[ k >> 3 ] |= ( 0x80 >> (k & 0x07) ); }
void clear(int k) { expand( k ); _sz--; M[ k >> 3 ] &= ~( 0x80 >> (k & 0x07) ); }
```
#figure(
image("fig\向量\9.png", width: 80%),
caption: "位图的实现"
)
利用掩码`0x80`,可以将`M[k >> 3]`的第`k & 0x07`(是模余8,找到掩码移位数)位取出来,然后与`M[k >> 3]`(是寻找到对应的8位`unsigned char`)进行与或非操作,从而实现对位的操作。
=== 应用
_小集合 + 大数据:`int A[n]`的元素均取自`[0, m)`,如何剔除其中的重复者?_
仿照`Vector::dedup()`改进版,先排序,再扫描$O(n log n + n)$。
但对于大规模的数据,即便能够申请到这么多空间,频繁的I/O也将导致整体效率的低下。
利用位图可以有$O(n + m)$的解决方法。
_Eratosthenes筛法:_
从2开始,将所有2的倍数划去;再从3开始,将所有3的倍数划去;再从5开始,将所有5的倍数划去;……。
```cpp
void Eratosthenes( Rank n, char * file ) {
Bitmap B( n ); B.set( 0 ); B.set( 1 );
for ( Rank i = 2; i < n; i++ )
if ( ! B.test( i ) )
for ( Rank j = 2*i; j < n; j += i )
B.set( j );
B.dump( file );
}
```
效率:不计内循环,外循环自身每次仅一次加法、两次判断,累计$O(n)$;内循环每次$O(n /i )$,由素数定理,外循环至多$n/(log n)$次,累计是$O(n log n)$。
优化:内循环的起点`2*i`可改作`i*i`;外循环的终止条件`i < n`可改作`i*i < n`。这样内循环每次迭代$O(max(1, n/i-i))$,外循环至多$sqrt(n)/(log sqrt(n))$次。
=== 快速初始化
`Bitmap`的构造函数中, 通过 `memset(M,0,N)` 统一清零,需要$O(n)$时间。成为位图最大的瓶颈。
有时,对于大规模的散列表, 初始化的效率直接影响到实际性能
例如:字符串中(后续章节讲到)`bc[]`表的构造算法, 需要 $O(|Sigma|+m) = O(s+m)$ 时间,若能省去`bc[]`表各项的初始化,则可严格地保证是 $O(m)$。
这时候可以用*校验环*策略:
将`B[]`拆分成一对等长向量: `Rank F[m], T[m], top = 0;`
构成校验环:`T[F[k]] == k & F[T[i]] == i`
#figure(
image("fig\向量\10.png", width: 80%),
caption: "校验环"
)
检验:
```cpp
bool Bitmap::test( Rank k ) { return (0 <= F[k]) && (F[k] < top) && (k == T[F[k]]); }
```
#figure(
image("fig\向量\11.png", width: 80%),
caption: "校验环——检验"
)
复位:$O(1)$
```cpp
void Bitmap::reset() { top = 0; }
```
插入:$O(1)$
```cpp
void Bitmap::set( Rank k ) { if ( !test( k ) ) { T[top] = k; F[k] = top++; } }
```
#figure(
image("fig\向量\12.png", width: 80%),
caption: "校验环——插入"
)
删除:$O(1)$
```cpp
void Bitmap::clear( Rank k )
{ if ( test( k ) && ( --top ) ) { F[T[top]] = F[k]; T[F[k]] = T[top]; } }
```
#figure(
image("fig\向量\13.png", width: 80%),
caption: "校验环——删除"
)
删除的时候将最后一个元素放到被删除元素的位置,然后更新校验环。 |
|
https://github.com/veilkev/jvvslead | https://raw.githubusercontent.com/veilkev/jvvslead/Typst/sys/header.typ | typst | #import "./packages.typ": *
#import "./sys.typ": *
/***********************************************/
/* Header */
/***********************************************/
#page-number("1")
#move(dx: 0pt, dy: -10pt,
title
)
#move(dx: 0pt, dy: -10pt,
desc
)
// Spacing between title/header and content
#v(70pt)
#caution[
This document contains _internal_ company information and should *not* be read by any unauthorized personnel without the expressed approval of H-E-B.
]
|
|
https://github.com/htlwienwest/da-vorlage-typst | https://raw.githubusercontent.com/htlwienwest/da-vorlage-typst/main/template/diplomarbeit.typ | typst | MIT License | #import "@preview/htlwienwest-da:0.1.0": *
/// Diplomarbeits-Konfiurationen
///
/// Alle Parameter müssen ausgefüllt werden um das Dokument zu generieren
///
/// Parameter:
/// - titel: string
/// - schuljahr: string
/// - abteilung: string
/// - unterschrifts-datum: string
/// - autoren: list(dict)
/// - vorname: string
/// - nachname: string
/// - klasse: string
/// - betreuer: dict
/// - name: string | content
/// - geschlecht: "male" | "female"
/// - aufgaben: content
/// - kurzfassung: content
/// - abstract: content
/// - vorwort: content
/// - danksagung: content
/// - anhang: content | none
/// - literaturverzeichnis: function
#show: diplomarbeit.with(
titel: "Titel der Diplomarbeit",
abteilung: "Informationstechnologie",
schuljahr: "2023/24",
unterschrifts-datum: "20.04.2024",
autoren: (
(
vorname: "Hans", nachname: "Mustermann",
klasse: "5AHITN",
betreuer: (name: "Dr. <NAME>", geschlecht: "male"),
aufgaben: [
#lorem(100)
]
),
(
vorname: "Herta", nachname: "Musterfrau",
klasse: "5AHITN",
betreuer: (name: "Dipl.-Ing <NAME>", geschlecht: "male"),
aufgaben: [
#lorem(100)
]
),
(
vorname: "Daniel", nachname: "Düsentrieb",
klasse: "5AHITN",
betreuer: (name: "DI. <NAME>", geschlecht: "female"),
aufgaben: [
#lorem(100)
]
),
),
kurzfassung: [
Die Kurzfassung muss die folgenden Inhalte darlegen (§8, Absatz 5 Prüfungsordnung): Thema, Fragestellung, Problemformulierung, wesentliche Ergebnisse. Sie soll einen prägnanten Überblick über die Arbeit geben.
Umfang: maximal 1 Seite
Zur Aufgabenstellung: von welchem Wissens- oder Entwicklungsstand wird ausgegangen
bzw. welche Ergebnisse gibt es bereits? Welches Ziel soll erreicht werden? Warum und für wen ist das definierte Ziel von Interesse?
Zur Umsetzung: auf welche fachtheoretischen/-praktischen Grundlagen wurde zurückgegriffen? Welche Lösungsansätze/Methoden wurden gewählt? Warum gerade diese?
Zu den Ergebnissen: Worin besteht der Beitrag zur Lösung der Aufgabenstellung? Was wurdeerreicht? Wurde die Arbeit bei Wettbewerben eingereicht?
*Hinweis:* Falls die Diplomarbeits-Konfiuration wegen zu viel Text unübersichtlich wird, könnt ihr mit `include "<datei>.typ"` eine Typst-Datei inkludieren, in die der entsprechende Text steht. Als Beispiel dient die _anhang_ Konfiguration.
],
abstract: [
Englische Version der Kurzfassung (siehe #link(<Kurzfassung>)[_Kurzfassung_])
],
vorwort: [
Perönlicher Zugang zum Thema. Gründe für die Themenwahl.
],
danksagung: [
Dank an Personen, die bei der Erstellung der Arbeit unterstützt haben.
],
anhang: include "anhang.typ", // entfernen falls nicht benötigt
literaturverzeichnis: bibliography.with("literaturverzeichnis.bib")
)
// ---------------- Hauptdokument ------------------
= Einleitung
#autor[Name-1]
- Kurzbeschreibung: Wie lautet das Thema? Welche Hintergründe gibt es zu diesem Thema? Was ist schon darüber bekannt?
- Beschreibung der Leistung: Was ist das Ziel der Arbeit? Für wen hat die Arbeit Relevanz? Hinweis auf Kooperationspartner. Welche Themenstellung soll mit der Arbeit bearbeitet werden?
- Darstellung der Vorgehensweise: In welche Kapitel ist die Arbeit gegliedert? Wie ist sie aufgebaut? Was behandeln die einzelnen Kapitel (kurz)?
= Haupteil \#1
#autor[Name-2]
In den Kapiteln des Hauptteils legen die einzelnen Schüler*innen Ihre Vorgehensweise und Ergebnisse dar. Je nach Aufgabenstellung können die folgenden (aber auch andere) Punkte behandelt werden:
- Theorie
- Begriffe definieren und erklären
- Theorien beschreiben, kommentieren, miteinander vergleichen, evaluieren
- Ev. Vorhandene Ergebnisse beschreiben und interpretieren
- Empirischer Teil: Darstellung der Daten und Auswertungsmethoden
- Ausgewählte Daten beschreiben
- Erhebungsverfahren/-methoden beschreiben
- Eigene Ergebnisse darstellen, interpretieren, evaluieren
- Problemlösungen darstellen
- Auswirkungen der Ergebnisse diskutieren
- Praktischer Teil: Beschreibung des Produkterstellungsprozesses
- Zielgruppe und Methoden beschreiben
- Entwicklungsprozess beschreiben
- Schwierigkeiten beschreiben und Lösungswege aufzeigen
- Anwendungsaspekte des Produkts vorstellen
- Unterschiede zu anderen/ähnlichen Produkten herausarbeiten
Die konkrete Struktur des Hauptteils hängt von der jeweiligen Themenstellung ab.
= Haupteil \#2
Dieses Kapitel ist nur dazu da, um die gestalterischen Elemente (Überschriften, Tabellen, Abbildungen, Literaturverweise, etc.) beispielhaft darzustellen.
== Typst
#let typst = box(height: 12pt, baseline: 4pt, image("abbildungen/typst.svg"))
Ihr verwendet die Typesetting-Sprache #typst um die Diplomarbeit zu formatieren. Die Sprache ist äußerst mächtig, enthält jedoch auch sehr einfache Sprachkonstrukte um die gängigsten Formatierungen zu bewerkstelligen.
Falls ihr Dinge benötigt die über die kurze Beschreibung dieses Kapitels hinausgeht, seht euch die #link("https://typst.app/docs")[Dokumentation] an.
== Textgestaltung
#typst stellt folgende syntax für übliche Textgestaltung zur Verfügung:
- `*fetter Text*` wird zu *fetter Text*
- `_kursiver Text_` wird zu _kursiver Text_
- #raw("`raw Text`") wird zu `raw Text`
- `#underline[unterstrichener Text]` wird zu #underline[unterstrichener Text]
Weitere Funktionen findet ihr in der #link("https://typst.app/docs/reference/text/")[Dokumentation].
== Unterkapitel
Wenn möglich bitte nur maximal drei Ebenen an Gliederung verwenden, damit die Arbeit übersichtlich bleibt. Um eine Überschrift zu schreiben beginnt die Zeile mit ein oder mehreren `=` gefolgt von der Überschrift selbst. Z.B.: `== Überschrift der Ebene zwei`.
== Ausgearbeitet von
#autor[Name-1]
Unter den Kapiteln der Ebenen 1 und 2 muss angemerkt sein, wer dieses Kapitel erstellt hat.
Dafür direkt nach der Überschrift die Funktion `#autor[<name>]` aufrufen.
Der Autor/die Autorin eines Kapitels muss nur angegeben werden, wenn er sich vom vorherigen unterscheidet. Wenn zum Beispiel das komplette Kapitel 2 von <NAME> geschrieben wurde, dann muss bei 2.1, 2.2, etc. kein Name angegeben werden.
== Aufzählungen
Für Aufzählungen sollen die auch hier verwendeten Aufzählungspunkte verwendet werden:
- Ebene 1
- Ebene 2
- Ebene 2
- Ebene 3
- Ebene 1
Mehr dazu in der #link("https://typst.app/docs/reference/model/list/")[Typst-Dokumentation].
== Numerierung
Für Nummerierungen gilt dasselbe wie für Aufzählungen.
+ Ebene 1
+ Ebene 2
+ Ebene 2
+ Ebene 3
+ Ebene 1
Mehr dazu in der #link("https://typst.app/docs/reference/model/enum/")[Typst-Dokumentation].
== Tabellen <Tabellen>
Alle Tabellen müssen eine Abbildung sein. Daher muss eine die `table` Funktion innerhalb der `figure` funktion verwendet werden. Wird `figure` nicht verwendet, kommt die Tabelle nicht im Tabellen- und Abbildungsverzeichnis vor.
#figure(
table(
inset: 10pt,
columns: 4,
[t], [1], [2], [3],
[y], [0.3s], [0.4s], [0.8s],
),
caption: [Zeit Resultate],
)
Es lohnt sich die dazugehörige Dokumentation auf #link("https://typst.app/docs/reference/model/table/")[typst.app] durchzulesen.
== Abbildungen
Um eine Abbildung einzufügen verwendest die `image` Funktion. Es muss wie bei @Tabellen darauf geachtet werden, dass `figure` runterherum gesetzt wird.
#figure(
image("abbildungen/demoAbb.jpeg"),
caption: [Die `image` Funktion nimmt als Parameter den Pfad zur entsprechenden Datei.]
)
Alle `figure` elemente werden in den entsprechenden Verzeichnissen gelistet.
== Source Code
Generell gilt, dass Source Code Ausschnitte durchaus in der Diplomarbeit vorkommen dürfen – allerdings bitte nur wichtige und kurze Teile. Seitenweise Source Code ist nicht erwünscht.
Source Code wird mit `raw`-Blöcken, die mit *#"```"* gestartet werden, hinzugefügt. Um Syntax-Highlighting zu erhalten, muss die Dateiendung hinter *#"```"* angefügt werden.
Sieh dir das folgende C\# Beispiel an:
```cs
namespace MyCoolDiplomaProject
{
/// <summary>
/// MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private ObservableCollection<StorageContainer> st =
new ObservableCollection<StorageContainer>();
public MainWindow()
{
InitializeComponent();
lbliste.ItemsSource = st;
}
...
}
```
Mehr dazu in der #link("https://typst.app/docs/reference/text/raw/")[Typst-Dokumentation].
== Literaturverweise
Quellenangabe können in der Datei `literaturverzeichnis.bib` gespeichert werden. Es wird dabei das *BibTEX* Format verwendet.
Ein Beispiel für einen Online-Verweis:
```
@online{WinNT,
author = {MultiMedia LLC},
title = {{MS Windows NT} Kernel Description},
year = 1999,
url = {http://web.archive.org/web/20080207010024/http://www.808multimedia.com/winnt/kernel.htm},
urldate = {2010-09-30}
}
```
Dieser Verweis kann dann mit `@WinNT` @WinNT referenziert werden und ist dann im Literaturverzeichnis zu finden.
== Kreuzverweise
Neben allen `figure`-Elementen und zu allen Überschriften können `label`s hinzugefügt werden. Die syntax dafür ist `<name>`.
Beispiele sind
#figure(
```typ
== Überschrift <HeadingLabel>
#figure(...) <AbbLabel>
```,
caption: [Dieses Codebeispiel ist auch mit einem `label` versehen.]
) <KreuzverweisBeispiel>
Die Labels aus @KreuzverweisBeispiel können dann wie Literaturverweise mit `@HeadingLabel` und `@AbbLabel` referenziert werden.
|
https://github.com/kilpkonn/CV | https://raw.githubusercontent.com/kilpkonn/CV/master/modules_en/skills.typ | typst | // Imports
#import "@preview/brilliant-cv:2.0.3": cvSection, cvSkill, hBar
#let metadata = toml("../metadata.toml")
#let cvSection = cvSection.with(metadata: metadata)
#cvSection("Skills")
#cvSkill(
type: [Languages],
info: [Estonian #hBar() English #hBar() Russian (basic)],
)
#cvSkill(
type: [Tech Stack],
info: [Arch #hBar() Neovim #hBar() XMonad / Cosmic Epoch],
)
#cvSkill(
type: [Personal Interests],
info: [Sailing / Sports in general #hBar() Psychology #hBar() Investing #hBar() Open Source contributing],
)
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/grid-4_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test that auto and relative columns use the correct base.
#grid(
columns: (auto, 60%),
rows: (auto, auto),
rect(width: 50%, height: 0.5cm, fill: conifer),
rect(width: 100%, height: 0.5cm, fill: eastern),
rect(width: 50%, height: 0.5cm, fill: forest),
)
|
https://github.com/chilingg/kaiji | https://raw.githubusercontent.com/chilingg/kaiji/main/template/cover.typ | typst | Other | #let cover(part_sym, part) = {
set text(
font: "Source Han Serif",
weight: "medium",
size: 12pt,
tracking: 0.1em
)
[
#set page(
fill: color.cmyk(0%, 75%, 100%, 40%),
margin: (top: 4cm)
)
#set text(
weight: "extrabold",
fill: color.cmyk(0%, 20%, 60%, 40%)
)
#align(center)[
#par(leading: 20pt)[
#text(64pt, tracking: 0.4em)[汉字]\
#text(40pt)[KANJI]\
JAPANESE IDIOMATIC LETTER\
#text(40pt)[#part_sym]\
\
#text(weight: "medium")[文字设计丛书 ]#part
]
]
]
pagebreak()
align(right)[
#par(leading: 14pt)[
#text(40pt, weight: "extrabold")[汉字 #part_sym]\
文字设计丛书 第 #part 卷\
佐藤 敬之辅
]
]
align(right + bottom)[#text(9pt, weight: "regular")[丸善株式会社]]
} |
https://github.com/elpekenin/access_kb | https://raw.githubusercontent.com/elpekenin/access_kb/main/typst/glossary.typ | typst | #let entry-list = (
(
key: "hid",
short: "HID",
long: "Human Interface Device",
description: "Estándar para interfaces de usuario.",
),
(
key: "i2c",
short: "I2C",
long: "Inter Integrated Circuit",
description: "Bus serie de datos.",
),
(
key: "mcu",
short: "MCU",
long: "Micro Controller Unit",
),
(
key: "pcb",
short: "PCB",
long: "Printed Circuit Board",
),
(
key: "spi",
short: "SPI",
long: "Serial Peripheral Interface",
description: "Bus serie de datos.",
),
(
key: "usb",
short: "USB",
long: "Universal Serial Bus",
),
)
|
|
https://github.com/1taroh/typst_font_list | https://raw.githubusercontent.com/1taroh/typst_font_list/main/README.md | markdown | MIT License | # typst_font_list
typst で用いることができるフォントの一覧を表示する
## 使い方
typst をインストールしたのち,コマンドラインから以下を実行してフォント一覧を得る.
```bash
typst fonts > fonts.txt
```
python で適当にフォーマットし,jsonファイルにする.
```bash
python format.py
```
typ ファイルをコンパイルする.
```bash
typst compile fonts.typ fonts{n}.png
```
## 参考文献
* [typst フォント まとめ](https://qiita.com/1taroh/items/aee1043d366a4a7c3219)
|
https://github.com/kdkasad/typst-homework-template | https://raw.githubusercontent.com/kdkasad/typst-homework-template/master/examples/computer-science/main.typ | typst | BSD 3-Clause "New" or "Revised" License | #import "../../khw.typ": khw
#show: khw.with(
title: [Example Homework: Computer Science],
course: [CS 123],
author: "<NAME>",
newpages: true,
)
#include "problem1.typ"
#include "problem2.typ"
#include "problem3.typ"
#include "problem4.typ"
|
https://github.com/pedrofp4444/BD | https://raw.githubusercontent.com/pedrofp4444/BD/main/report/main.typ | typst | #import "cover.typ": cover
#import "templates/template.typ": *
#import "templates/index.typ": *
#import "content/[0] Resumo/main.typ": resumo
#import "content/[1] Definição do sistema/main.typ": definicao_do_sistema
#import "content/[2] Levantamento e Análise de Requisitos/main.typ": requisitos
#import "content/[3] Modelação Concetual/main.typ": concetual
#import "content/[4] Modelação Lógica/main.typ": lógico
#import "content/[5] Implementação Física/main.typ": físico
#import "content/[6] Conclusão e Trabalhos Futuros/main.typ": conclusão
#show: project
#cover(title: [Brigada de Espionagem e \ Localização Operacional], authors: (
(name: "<NAME>", number: "a104353"),
(name: "<NAME>", number: "a104100"),
(name: "<NAME>", number: "a104082"),
(name: "<NAME>", number: "a104089")),
"28 de maio de 2024")
#set page(numbering: "i", number-align: center)
#counter(page).update(1)
#resumo
#index
// Make the page counter reset to 1
#set page(numbering: "1", number-align: center)
#counter(page).update(1)
#definicao_do_sistema
#requisitos
#concetual
#lógico
#físico
#conclusão
#heading(numbering: none)[Referências]
- <NAME>., & <NAME>. (2005). Database systems: a practical approach to design, implementation, and management. Pearson Education.
- MySQL 8.0 Reference Manual. MySQL. (2024). https://dev.mysql.com/doc/refman/8.0/en/
#heading(numbering: none)[Lista de Siglas e Acrónimos]
/ B.E.L.O.: Brigada de Espionagem e Localização Operacional
/ SQL: Structured Query Language
#heading(numbering: none)[Anexos]
#align(center)[
#block(
breakable: true,
[
#attachment(caption: "Ata da primeira reunião", align(left)[
*Data de realização:* 1 de março de 2024
*Hora de início:* 09:37h
*Hora de término:* 11:56h
*Participantes*
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Representante da empresa
- <NAME> - Representante da empresa
- <NAME> - Representante da empresa
*Contextualização*
Ao primeiro dia do mês de março de dois mil e vinte e quatro, com início às nove horas e trinta e sete minutos da manhã, na sala de reuniões número doze, localizada na sede da Lusium, realizou-se uma primeira reunião com os representantes da empresa, <NAME>, <NAME> e <NAME>, com a principal meta de apresentar uma solução para a questão-problema apresentada à empresa “Quatro em Linha”.
*Levantamentos*
Iniciaram-se os trabalhos previstos com a apresentação dos representantes de ambas as valências, <NAME> começou por fazer uma *descrição da história da empresa*, como as motivações de fundação e os princípios laborais inerentes. Após a intervenção, <NAME> enumerou as *competências e habilidades* dos intervenientes associados aos vários projetos que a empresa já desenvolveu até ao momento com sucesso.
No decorrer da ordem de trabalhos, <NAME>, na qualidade de representante da Lusium, procedeu à *descrição e qualificação da questão-problema*, principiando com o enunciar dos inúmeros casos de furtos decorrentes da criação da empresa de minério e triunfo consequente. <NAME> completou a intervenção de <NAME>arda com uma preocupação pessoal sobre a empresa, mas principalmente sobre Vizela, a sua cidade natal.
Após as apresentações iniciais e discussão sobre os problemas enfrentados pela empresa e pela comunidade local, <NAME> e <NAME> *propuseram a implementação de um sistema de gestão de base de dados* como forma de controlar os novos furtos. A ideia foi bem recebida pelos participantes, que demonstraram entusiasmo com a proposta.
<NAME> agradeceu as contribuições de todos os presentes e destacou a *importância do diálogo* e da *colaboração* para encontrar soluções eficazes. Em resposta à proposta, foi decidido marcar outras reuniões para avaliar e desenvolver a viabilidade da ideia.
Em adição, ficou acordado formar um grupo de trabalho dedicado a abordar os desafios identificados e a elaborar estratégias para *melhorar a segurança e o bem-estar da comunidade*. <NAME> e <NAME> enfatizaram a eficácia de tal sistema de monitorização e registo para identificar padrões e *agir preventivamente contra os furtos*.
A proposta foi recebida com entusiasmo pelos participantes, que concordaram em participar ativamente no grupo de trabalho. Ficou agendada uma próxima reunião, com data prevista de 4 de março de 2024, às nove horas e trinta minutos da manhã, para dar continuidade às discussões e recolher as medidas e requisitos para a base de dados.
Para sumarizar, a reunião foi encerrada com a promessa de um *esforço conjunto* para enfrentar os desafios e promover o *crescimento saudável* da empresa e da comunidade.
*Assinaturas*
#image("images/AssinaturasAta1.png")
])
])
#label("Anexo1")
#block(
breakable: true,
[
#attachment(caption: "Ata da segunda reunião", align(left)[
*Data de realização:* 4 de março de 2024
*Hora de início:* 09:30h
*Hora de término:* 12:00h
*Contextualização*
Ao quarto dia do mês de março de dois mil e vinte e quatro, com início às nove horas e trinta minutos da manhã, na sala de reuniões número cinco, localizada na sede da Lusium, realizou-se uma segunda reunião com os representantes da empresa, <NAME>, <NAME> e <NAME>, com o objetivo de idealizar os requisitos mandatórios, relacionados com a gestão dos funcionários e dos terrenos onde trabalham, para o correto funcionamento do sistema de gestão de base de dados.
*Participantes*
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Representante da empresa
- <NAME> - Representante da empresa
- <NAME> - Representante da empresa
*Tópicos abordados*
No decorrer da reunião, foram esclarecidos quais os aspetos a ter em conta no domínio da gestão dos funcionários da empresa e dos terrenos de extração de minérios. Estes aspetos revelam-se cruciais e são dependentes de consistência e de uma boa ponderação.
*Levantamentos*
Com o desenrolar da reunião, foi possível recolher diversas propostas e sugestões relacionadas com o modelo de funcionamento dos funcionários e terrenos.
<NAME>, numa fase inicial, referiu que cada *funcionário* deveria ser *identificado de forma exclusiva*, acrescentando ainda que o *nome*, *data de nascimento*, *função*, *salário*, *números de identificação e números de telemóvel* seriam características importantes a associar ao mesmo. Além disso, mencionou que deveriam ter uma *fotografia* associada, ao passo que <NAME> manifestou a ideia de que a fotografia deveria ser algo *opcional* e nunca de carácter obrigatório.
A partir de uma primeira intervenção por parte da representante <NAME>, ficou definido que os funcionários deveriam ser designados para diferentes funções, como *operacional*, *detetive* ou *representante*, esclarecendo ainda que *nos terrenos* da empresa *trabalham vários operacionais* e que cada um destes pode estar atribuído a *mais do que um terreno*.
<NAME>, numa outra intervenção, destacou que cada *terreno* da empresa deveria ser *identificado de forma única*, tornando possível a distinção entre cada um deles. Complementarmente, os representantes reforçaram a ideia de que são levantadas suspeitas num terreno sempre que a quantidade de minério coletado não corresponde à quantidade prevista de minério a coletar no dia. Como resposta, <NAME> e <NAME> propuseram a ideia de que um terreno deveria conter informações sobre o *minério previsto* e o *minério coletado*, ideia esta que foi diretamente aprovada pelos representantes. O minério previsto representaria a *quantidade estimada de minério* que se espera coletar *diariamente*, enquanto que o *minério coletado* refletiria a *quantidade real de minério coletada por dia*. Deste modo, todos os intervenientes chegaram à conclusão que seria importante monitorizar todos esses dados para, posteriormente, ser possível *calcular e listar o prejuízo* de cada terreno, o que ajudaria na tomada de decisões estratégicas e no planeamento futuro das operações.
<NAME>, <NAME> e <NAME>, em conformidade, salientaram o facto de serem os únicos *responsáveis pela gestão dos funcionários operacionais*, coordenando todas as suas atividades e garantindo eficiência operacional. Assim sendo, por unanimidade de todos os participantes, chegou-se à conclusão que deveria ser possível fornecer permissões aos *representantes* na base de dados, de modo a que estes *consigam criar novos funcionários e, adicionalmente, terrenos*, bem como *modificar as informações adjacentes aos mesmos*. Em contrapartida, <NAME> enfatizou o facto de que os *funcionários operacionais não devem ter acesso direto às informações sensíveis* desta base de dados, de forma a manter a correta gestão da mesma e, consequentemente, da empresa.
Deste modo, após a formalização de todas estas condições, salientou-se a necessidade de agendar uma próxima reunião que garantisse, agora, a declaração das imprescindibilidades do modelo que abrange a gestão dos casos e dos suspeitos adjacentes. Esta nova reunião ficou marcada para o próximo dia 8 de março de 2024, às nove horas da manhã, da qual também fariam parte os detetives da B.E.L.O, visto serem os mais qualificados para descrever o modo como se deve correlacionar suspeitos e casos com funcionários e terrenos, perante o problema em questão.
*Assinaturas*
#image("images/AssinaturasAta2.png")
])
])
#label("Anexo2")
#block(
breakable: true,
[
#attachment(caption: "Ata da terceira reunião", align(left)[
Data de realização: 8 de março de 2024
Hora de início: 09:04h
Hora de término: 11:29h
*Contextualização*
Ao oitavo dia do mês de março de dois mil e vinte e quatro, com início às nove horas e quatro minutos da manhã, na sala de reuniões número sete, localizada no departamento B.E.L.O da Lusium, realizou-se uma terceira reunião com os detetives da empresa e um dos representantes da mesma, <NAME>. Nesta reunião, Ana, para além de trazer consigo ideias capazes de completar medidas estabelecidas na reunião anterior, teria, agora também, o cargo de autorizar os pedidos e decisões dos detetives, quando se apresentassem admissíveis. Deste modo, a reunião seguiria com o objetivo de elaborar os requisitos relacionados com a gestão dos casos e suspeitos adjacentes, necessários para um adequado desenvolvimento e consequente funcionamento do sistema de gestão de base de dados.
*Participantes*
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Representante da empresa
- <NAME> - Detetive da B.E.L.O.
- <NAME> - Detetive da B.E.L.O.
- <NAME> - Detetive da B.E.L.O.
- <NAME> - Detetive da B.E.L.O.
- <NAME> - Detetive da B.E.L.O.
- <NAME> - Detetive da B.E.L.O.
*Tópicos abordados*
Ao longo desta reunião, foram desenvolvidos vários pontos que têm por base todo o funcionamento da gestão dos casos com que lida a agência, bem como os suspeitos envolvidos nos mesmos. Estes pontos devem ser bem definidos e alvos de uma forte especificação, visando assegurar uma abordagem sólida que garanta a eficácia e integridade da base de dados.
*Levantamentos*
Com o decorrer da reunião, uma pluralidade de propostas e sugestões foram apresentadas, todas elas orientadas para o modelo de funcionamento dos casos e dos suspeitos relacionados com os mesmos.
O detetive Filipe Sousa fez a primeira intervenção na reunião, mencionando que um caso deveria ser *identificado de forma exclusiva* e, simultaneamente, incluir informações extra, como a sua *data de abertura, data de encerramento, se aplicável, o seu estado e a quantidade estimada de minério roubado*.
A detetive Lara Machado acabou por reforçar a ideia de que cada *caso* estaria *somente ligado a um terreno*, porém, cada *terreno* da empresa poderia *contar com vários casos*. De forma a complementar a intervenção de Lara Machado, <NAME> e <NAME> questionaram os detetives sobre de que forma é que um caso deveria ser *classificado* quanto ao seu *estado*, ao que Américo Costa respondeu que apenas seria necessário classificar o mesmo como *"aberto" ou "fechado"*.
Não deixando de parte o que foi referido na reunião anterior sobre o levantamento de suspeitas num terreno, a representante <NAME> incluiu agora que um *novo caso* deveria ser automaticamente *aberto* caso a *quantidade de minério coletada num terreno, num dado dia*, fosse *inferior à quantidade mínima prevista*. Consequentemente, *todos os funcionários* associados a esse terreno *tornar-se-iam suspeitos*, iniciando assim uma investigação para determinar qualquer possível atividade criminosa.
Todos os *detetives* concordaram, de forma unânime, que deveriam ser os únicos com permissão para *criar casos* e *alterar algumas informações* dos mesmos na base de dados, o que foi aceite pela representante presente. Ficou também confirmado que deveriam ser os únicos autorizados a *atribuir suspeitos a um caso e atualizar o estado desses suspeitos* conforme necessário.
Dentro do mesmo contexto, <NAME> achou por bem explicar que cada suspeito deveria ser bem caracterizado pelo seu *estado, nível de envolvimento e possíveis notas adicionais* sobre o mesmo. Esta aprimorou a sua intervenção esclarecendo que o *nível de envolvimento* deveria *variar de 1 a 10*, indicando o grau de participação do suspeito no caso, enquanto que o *estado* poderia variar entre *"inocente"* ou *"culpado"*, de forma a facilitar a análise de cada um deles.
Todos os intervenientes concordaram que o acompanhamento da atividade dos casos seria algo imprescindível e, para tal, os dois membros da “Quatro em Linha” propuseram a ideia de se poder *verificar quando é que um funcionário se tornou suspeito* de um determinado caso, *visualizar os suspeitos de um caso específico* e verificar a *data do último caso associado a um funcionário*, o que foi aprovado por todos os integrantes. Complementarmente, os detetives também consideraram relevante haver a possibilidade de se fazer uma *listagem dos casos associados a um determinado funcionário*, bem como uma verificação do *dia em que mais casos foram abertos*, o que poderia fornecer esclarecimentos valiosos para a gestão de segurança e operações da empresa.
<NAME>, numa fase final, ainda salientou que deveria ser possível organizar os diferentes suspeitos com base na quantidade de casos a que se associam, visto ser um informação/dado que auxiliaria na priorização das investigações e na identificação de padrões de comportamentos suspeitos. Assim, de modo a simplificar o processo descrito, foi acordado que deveria haver a possibilidade de se fazer uma *listagem específica dos cinco suspeitos com mais casos* de roubo de minérios associados.
Ao terminar a 3ª reunião, ficou acordado por <NAME>, que participou em nome de todos os representantes, e por todos os detetives presentes que seria pertinente agendar uma próxima reunião, que contaria com a informação referente à experiência dos trabalhadores da Lusium através de um inquérito estatístico de opinião. O propósito da mesma seria verificar a integridade de todas as ideias e sugestões recolhidas até ao momento, antes da implementação dos requisitos gerados pelas mesmas no sistema de gestão de base de dados.
*Assinaturas*
#image("images/AssinaturasAta3.png")
])
])
#label("Anexo3")
#block(
breakable: true,
[
#attachment(caption: "Ata da quarta reunião", align(left)[
*Data de realização:* 14 de março de 2024
*Hora de início:* 09:11h
*Hora de término:* 11:42h
*Contextualização*
Ao décimo quarto dia do mês de março de dois mil e vinte e quatro, com início às nove horas e onze minutos da manhã, na sala de reuniões número um, localizada no departamento B.E.L.O da Lusium, realizou-se uma quarta e última reunião com todos os detetives da empresa e todos os representantes da mesma, <NAME>, <NAME> e <NAME>. Nesta reunião, todos os requisitos anteriormente levantados foram reavaliados por todos os envolvidos com o intuito de os concluir.
*Participantes*
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Membro da “Quatro em Linha”
- <NAME> - Representante da empresa
- <NAME> - Representante da empresa
- <NAME> - Representante da empresa
- <NAME> - Detetive da B.E.L.O
- <NAME> - Detetive da B.E.L.O
- <NAME> - Detetive da B.E.L.O
- <NAME> - Detetive da B.E.L.O
- <NAME> - Detetive da B.E.L.O
- <NAME> - Detetive da B.E.L.O
*Tópicos abordados*
Durante o decorrer desta reunião, foram abordados todos os pontos anteriormente discutidos, para assim dar por concluída toda a base do funcionamento da base de dados. Estes pontos devem ser bem definidos e alvos de uma forte especificação, visando assegurar uma abordagem sólida que garanta a eficácia e integridade da base de dados.
*Levantamentos*
<NAME> deu início à reunião pedindo alguns esclarecimentos sobre requisitos levantados anteriormente. A primeira elucidação abordaria o que foi referido, inicialmente, por <NAME>, ao pedir que cada funcionário seja caracterizado por *números de identificação*, ao qual foi respondido que, depois de uma reunião onde apenas estiveram presentes os representantes, decidiram alterar esse pedido para apenas ter em conta o *número de identificação fiscal (NIF)*, dado o âmbito do projeto. As restantes características mantinham-se inalteradas, pelo que tanto os membros da “Quatro em Linha”, como da agência B.E.L.O concordaram.
<NAME> interpelou logo de seguida, pedindo aos detetives a confirmação sobre o funcionamento dos funcionários e como eles se relacionam com os terrenos, à qual <NAME> e <NAME> concordaram prontamente.
De seguida, <NAME> descreveu todas as características de um terreno, finalizando com um apelo à melhoria da eficiência da base de dados, sendo este a mudança da informação de *minério previsto* para *minério mínimo previsto*, ao qual João Guilherme respondeu que seria uma alteração possível, apenas teriam de comunicar essa alteração aos técnicos que iriam avaliar os terrenos. As restantes características foram aprovadas sem nenhum acréscimo.
Quanto às permissões da base de dados, <NAME> expôs os pedidos feitos pelos representantes. Os detetives demonstraram compreensão e concordaram que essa logística é a ideal para a integridade dos dados.
Ped<NAME> comunicou as características de um caso, sendo que, depois de uma pequena discussão entre representantes e detetives, decidiram manter como anteriormente definido.
<NAME> questionou se, caso o *minério coletado* fosse *igual* ao *minério mínimo* previsto, seria possível abrir um *caso para investigação*. Esse comentário proporcionou um momento de reflexão entre os presentes. Alguns expressaram a sua indignação de forma leve, mas a ponderação prevaleceu na decisão final. Ficou estabelecido que apenas o que for *coletado abaixo do mínimo estipulado será alvo de investigação*.
<NAME> solicitou uma modificação num requisito previamente estabelecido. Essa solicitação surgiu após uma breve reunião informal entre os membros da agência, na qual se chegou unanimemente à conclusão de que classificar o estado de um suspeito apenas como *"inocente"* ou *"culpado"* seria *insuficiente*. Propôs-se então a *adição de um terceiro estado, "em investigação"*. Todos os presentes concordaram com essa decisão.
No restante da reunião prevaleceu a *exposição dos requisitos* e a *aprovação* por parte de todos os presentes.
A reunião foi encerrada pelas onze horas e quarenta e dois minutos com todos os envolvidos a demonstrarem, de forma não verbal, a gratificação pelo início da implementação do sistema de gestão de base de dados.
*Assinaturas*
#image("images/AssinaturasAta4.png")
])
])
#label("Anexo4")
#block(
breakable: false,
[
#attachment(caption: "Logo da Universidade do Minho", image("images/uminho.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do diagrama de Gantt inicial.", image("images/Captura_GANTT_inicial.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do Relacionamento Funcionário - Funcionário.", image("images/[3] - 1.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do Relacionamento Funcionário - Função.", image("images/[3] - 2.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do Relacionamento Funcionário - Terreno.", image("images/[3] - 3.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do Relacionamento Funcionário - Caso.", image("images/[3] - 4.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do Relacionamento Terreno - Caso.", image("images/[3] - 5.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do diagrama ER produzido.", image("images/Captura_DiagramaER.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do modelo lógico produzido.", image("images/Captura_ModeloLógico.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do diagrama de Gantt real.", image("images/Captura_GANTT_real.png"))
])
#block(
breakable: false,
[
#attachment(caption: "Ilustração do Inquérito Estatistico de Opinião.", image("images/Formulário.png"))
])
#label("Anexo15")
//aaaaaaaaaaaaaaaaaaa
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica da Função.", image("images/FunçãoTabela.png", width: 20%))
])
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica do Funcionário.", image("images/FuncionárioTabela.png", width: 20%))
])
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica do Número de Telemóvel.", image("images/NumTelemóvelTabela.png", width: 20%))
])
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica do Gere.", image("images/GereTabela.png", width: 20%))
])
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica do Terreno.", image("images/TerrenoTabela.png", width: 20%))
])
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica do Trabalha.", image("images/TrabalhaTabela.png", width: 20%))
])
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica do Caso.", image("images/CasoTabela.png", width: 20%))
])
#block(
breakable: false,
[
#attachment(caption: "Tabela lógica do Suspeito.", image("images/SuspeitoTabela.png", width: 20%))
])
#attachment(caption: "Script de criação da base de dados em SQL.",[])
#block(
fill: rgb("#f2f2eb"),
inset: 8pt,
breakable: true,
```sql
CREATE DATABASE IF NOT EXISTS Lusium;
USE Lusium;
-- Criação da tabela Função
CREATE TABLE Função (
Função_ID INT AUTO_INCREMENT NOT NULL,
Designação ENUM('Operacional', 'Detetive', 'Representante') NOT NULL,
PRIMARY KEY (Função_ID)
);
-- Criação da tabela Funcionário
CREATE TABLE Funcionário (
Funcionário_ID INT AUTO_INCREMENT NOT NULL,
Nome VARCHAR(75) NOT NULL,
Data_de_nascimento DATE NOT NULL,
Salário INT NOT NULL,
NIF VARCHAR(10) NOT NULL,
Fotografia VARCHAR(150) NULL,
Função_ID INT NOT NULL,
PRIMARY KEY (Funcionário_ID),
FOREIGN KEY (Função_ID) REFERENCES Função(Função_ID)
);
-- Criação da tabela Número de telemóvel
CREATE TABLE Número_de_telemóvel (
Número_de_telemóvel_ID INT AUTO_INCREMENT NOT NULL,
Funcionário_ID INT NOT NULL,
PRIMARY KEY (Número_de_telemóvel_ID),
FOREIGN KEY (Funcionário_ID) REFERENCES Funcionário(Funcionário_ID)
);
-- Criação da tabela Gere
CREATE TABLE Gere (
Funcionário_Gestor_ID INT NOT NULL,
Funcionário_ID INT NOT NULL,
PRIMARY KEY (Funcionário_Gestor_ID, Funcionário_ID),
FOREIGN KEY (Funcionário_Gestor_ID) REFERENCES Funcionário(Funcionário_ID),
FOREIGN KEY (Funcionário_ID) REFERENCES Funcionário(Funcionário_ID)
);
-- Criação da tabela Terreno
CREATE TABLE Terreno (
Terreno_ID INT AUTO_INCREMENT NOT NULL,
Minério_previsto INT NOT NULL,
Minério_coletado INT NOT NULL,
PRIMARY KEY (Terreno_ID)
);
-- Criação da tabela Trabalha
CREATE TABLE Trabalha (
Funcionário_ID INT NOT NULL,
Terreno_ID INT NOT NULL,
PRIMARY KEY (Funcionário_ID, Terreno_ID),
FOREIGN KEY (Funcionário_ID) REFERENCES Funcionário(Funcionário_ID),
FOREIGN KEY (Terreno_ID) REFERENCES Terreno(Terreno_ID)
);
-- Criação da tabela Caso
CREATE TABLE Caso (
Caso_ID INT AUTO_INCREMENT NOT NULL,
Data_de_abertura DATE NOT NULL,
Estado ENUM('Aberto', 'Fechado') NOT NULL,
Estimativa_de_roubo INT NOT NULL,
Data_de_encerramento DATE NULL,
Terreno_ID INT NOT NULL,
PRIMARY KEY (Caso_ID),
FOREIGN KEY (Terreno_ID) REFERENCES Terreno(Terreno_ID)
);
-- Criação da tabela Suspeito
CREATE TABLE Suspeito (
Funcionário_ID INT NOT NULL,
Caso_ID INT NOT NULL,
Estado ENUM('Inocente', 'Em investigação', 'Culpado') NOT NULL,
Envolvimento INT NOT NULL,
Notas TEXT NULL,
PRIMARY KEY (Funcionário_ID, Caso_ID),
FOREIGN KEY (Funcionário_ID) REFERENCES Funcionário(Funcionário_ID),
FOREIGN KEY (Caso_ID) REFERENCES Caso(Caso_ID)
);
```
)
#attachment(caption: "Script de povoamento da base de dados em SQL.",[])
#block(
fill: rgb("#f2f2eb"),
inset: 8pt,
breakable: true,
```sql
-- Inserção de dados na tabela Função
INSERT INTO Função (Designação) VALUES
('Operacional'),
('Detetive'),
('Representante');
-- Inserção de dados na tabela Funcionário
INSERT INTO Funcionário (Nome, Data_de_nascimento, Salário, NIF, Fotografia, Função_ID) VALUES
('<NAME>', '1985-03-15', 1200, '123456789', 'foto_miguel.jpg', 1),
('<NAME>', '1990-07-21', 2800, '987654321', 'foto_ana.jpg', 2),
('<NAME>', '1982-12-10', 3000, '456789123', 'foto_pedro.jpg', 3),
('<NAME>', '1988-05-02', 1000, '789123456', 'foto_sofia.jpg', 1),
('<NAME>', '1995-09-18', 2600, '321654987', 'foto_rui.jpg', 2),
('<NAME>', '1980-11-30', 850, '654987321', 'foto_ines.jpg', 1),
('<NAME>', '1993-04-25', 2900, '987321654', 'foto_tiago.jpg', 3);
-- Inserção de dados na tabela Número_de_telemóvel
INSERT INTO Número_de_telemóvel (Número_de_telemóvel_ID, Funcionário_ID) VALUES
(934678592, 1),
(966492873, 2),
(922245762, 3),
(936457856, 4),
(926486516, 5),
(964884547, 6),
(964554178, 7);
-- Inserção de dados na tabela Gere
INSERT INTO Gere (Funcionário_Gestor_ID, Funcionário_ID) VALUES
(3, 1),
(3, 2),
(3, 4),
(6, 5),
(6, 6),
(6, 7);
-- Inserção de dados na tabela Terreno
INSERT INTO Terreno (Minério_previsto, Minério_coletado) VALUES
(1000, 800),
(1500, 1200),
(800, 600),
(2000, 1800),
(1200, 1000),
(1800, 1600),
(900, 700);
-- Inserção de dados na tabela Trabalha
INSERT INTO Trabalha (Funcionário_ID, Terreno_ID) VALUES
(1, 1),
(2, 2),
(3, 3),
(4, 4),
(5, 5),
(6, 6),
(7, 7);
-- Inserção de dados na tabela Caso
INSERT INTO Caso (Data_de_abertura, Estado, Estimativa_de_roubo, Data_de_encerramento, Terreno_ID) VALUES
('2024-01-10', 'Aberto', 500, NULL, 1),
('2024-02-15', 'Fechado', 1000, '2024-05-05', 2),
('2024-03-20', 'Aberto', 700, NULL, 3),
('2024-04-25', 'Aberto', 800, NULL, 4),
('2024-05-01', 'Aberto', 300, NULL, 5),
('2024-05-08', 'Aberto', 900, NULL, 6),
('2024-05-10', 'Aberto', 600, NULL, 7);
-- Inserção de dados na tabela Suspeito
INSERT INTO Suspeito (Funcionário_ID, Caso_ID, Estado, Envolvimento, Notas) VALUES
(1, 1, 'Inocente', 1, 'Nenhuma informação adicional.'),
(2, 2, 'Culpado', 9, 'Suspeito estava presente na cena do crime.'),
(3, 3, 'Em investigação', 5, 'Algumas pistas indicam possível envolvimento.'),
(4, 4, 'Em investigação', 3, 'Não há provas concretas.'),
(5, 5, 'Inocente', 2, 'Sem evidências contra o suspeito.'),
(6, 6, 'Culpado', 8, 'Fortes indícios de participação.'),
(7, 7, 'Em investigação', 4, 'Possível conexão com outras investigações.');
```
)
#attachment(caption: "Script de povoamento da base de dados em Pthon.",[])
#block(
fill: rgb("#f2f2eb"),
inset: 8pt,
breakable: true,
```python
import mysql.connector
from faker import Faker
import random
from datetime import timedelta
# Solicita ao utilizador o nome de utilizador e a senha para se conectar ao MySQL
user = input("Insira o nome de utilizador da base de dados MySQL: ")
password = input("Insira a senha da base de dados MySQL: ")
# Estabelece a conexão com a base de dados MySQL
conn = mysql.connector.connect(
host="localhost",
user=user,
password=<PASSWORD>,
database="Lusium"
)
# Verifica se a conexão foi bem-sucedida e imprime a versão do servidor
if conn.is_connected():
print("Conectado ao MySQL Server versão ", conn.get_server_info())
# Cria um cursor para executar comandos SQL
cursor = conn.cursor()
# Instancia o Faker configurado para gerar dados em português de Portugal
fake = Faker('pt_PT')
# Lista de funções para inserir na tabela Função
funcoes = ['Operacional', 'Detetive', 'Representante']
# Insere as 3 funções na tabela Função
for i, funcao in enumerate(funcoes, start=1):
cursor.execute("INSERT INTO Função (Função_ID, Designação) VALUES (%s, %s)", (i, funcao))
# Gera e insere dados fictícios para 100 funcionários na tabela Funcionário
for i in range(1, 101):
nome = fake.name()
data_nascimento = fake.date_of_birth(minimum_age=18, maximum_age=65)
salario = random.randint(1000, 5000)
nif = fake.random_number(digits=9)
fotografia = fake.image_url()
funcao_id = random.randint(1, len(funcoes))
cursor.execute("INSERT INTO Funcionário (Funcionário_ID, Nome, Data_de_nascimento, Salário, NIF, Fotografia, Função_ID) VALUES (%s, %s, %s, %s, %s, %s, %s)",
(i, nome, data_nascimento, salario, nif, fotografia, funcao_id))
# Gera e insere 100 números de telefone sequenciais na tabela Número_de_telemóvel
for i in range(1, 101):
num_telefone = 900000000 + i
funcionário_id = i
cursor.execute("INSERT INTO Número_de_telemóvel (Número_de_telemóvel_ID, Funcionário_ID) VALUES (%s, %s)", (num_telefone, funcionário_id))
# Gera e insere 50 dados de gestão aleatória na tabela Gere
for i in range(1, 51):
funcionário_gestor_id = i
funcionário_id = random.randint(1, 100)
cursor.execute("INSERT INTO Gere (Funcionário_Gestor_ID, Funcionário_ID) VALUES (%s, %s)", (funcionário_gestor_id, funcionário_id))
# Gera e insere dados fictícios para 20 terrenos na tabela Terreno
for i in range(1, 21):
minério_previsto = random.randint(1000, 10000)
minério_coletado = random.randint(0, minério_previsto)
cursor.execute("INSERT INTO Terreno (Terreno_ID, Minério_previsto, Minério_coletado) VALUES (%s, %s, %s)", (i, minério_previsto, minério_coletado))
# Gera e insere 100 dados de trabalho na tabela Trabalha
for i in range(1, 101):
funcionário_id = i
terreno_id = random.randint(1, 20)
cursor.execute("INSERT INTO Trabalha (Funcionário_ID, Terreno_ID) VALUES (%s, %s)", (funcionário_id, terreno_id))
# Gera e insere dados fictícios para 50 casos na tabela Caso
for i in range(1, 51):
data_abertura = fake.date_between(start_date='-1y', end_date='today')
estado = random.choice(['Aberto', 'Fechado'])
estimativa_roubo = random.randint(1000, 100000)
data_encerramento = data_abertura + timedelta(days=random.randint(10, 365)) if estado == 'Fechado' else None
terreno_id = random.randint(1, 20)
cursor.execute("INSERT INTO Caso (Caso_ID, Data_de_abertura, Estado, Estimativa_de_roubo, Data_de_encerramento, Terreno_ID) VALUES (%s, %s, %s, %s, %s, %s)",
(i, data_abertura, estado, estimativa_roubo, data_encerramento, terreno_id))
# Gera e insere dados fictícios de 100 suspeitos na tabela Suspeito
for i in range(1, 101):
funcionário_id = i
caso_id = random.randint(1, 50)
estado = random.choice(['Inocente', 'Em investigação', 'Culpado'])
envolvimento = random.randint(1, 10)
notas = fake.text()
cursor.execute("INSERT INTO Suspeito (Funcionário_ID, Caso_ID, Estado, Envolvimento, Notas) VALUES (%s, %s, %s, %s, %s)",
(funcionário_id, caso_id, estado, envolvimento, notas))
# Imprime a mensagem de sucesso
print("Dados inseridos com sucesso!")
# Confirma todas as transações e fecha a conexão com a base de dados
conn.commit()
conn.close()
```
)
#attachment(caption: "Script de procedimentos, funções e gatilhos da base de dados em SQL.",[])
#block(
fill: rgb("#f2f2eb"),
inset: 8pt,
breakable: true,
```sql
-- Trigger: Atualizar Data de Encerramento do Caso ao Fechar
DELIMITER $$
CREATE TRIGGER AtualizarDataEncerramento
BEFORE UPDATE ON Caso
FOR EACH ROW
BEGIN
IF NEW.Estado = 'Fechado' AND OLD.Estado != 'Fechado' THEN
SET NEW.Data_de_encerramento = CURDATE();
END IF;
END $$
DELIMITER ;
-- Function: Calcular Média Salarial por Função
DELIMITER $$
CREATE FUNCTION MediaSalarialPorFuncao(p_Função_ID INT) RETURNS DECIMAL(10, 2) DETERMINISTIC
BEGIN
DECLARE media_salarial DECIMAL(10, 2);
SELECT AVG(Salário) INTO media_salarial
FROM Funcionário
WHERE Função_ID = p_Função_ID;
RETURN media_salarial;
END $$
DELIMITER ;
DELIMITER $$
CREATE FUNCTION CalcularIdade(Data_de_nascimento DATE)
RETURNS INT DETERMINISTIC
BEGIN
DECLARE idade INT;
-- Calcula a idade considerando apenas o ano
SET idade = YEAR(CURDATE()) - YEAR(Data_de_nascimento);
-- Ajusta a idade se o aniversário ainda não ocorreu este ano
IF (MONTH(CURDATE()) < MONTH(Data_de_nascimento)) OR
(MONTH(CURDATE()) = MONTH(Data_de_nascimento) AND DAY(CURDATE()) < DAY(Data_de_nascimento)) THEN
SET idade = idade - 1;
END IF;
RETURN idade;
END $$
DELIMITER ;
DELIMITER $$
CREATE FUNCTION CalcularEstimativaDeRoubo(p_Terreno_ID INT)
RETURNS INT
DETERMINISTIC
BEGIN
DECLARE v_Estimativa_De_Roubo INT;
-- Obter o minério previsto e coletado para o terreno especificado
SELECT (Minério_previsto - Minério_coletado) INTO v_Estimativa_De_Roubo
FROM Terreno WHERE Terreno_ID = p_Terreno_ID;
RETURN v_Estimativa_De_Roubo;
END $$
DELIMITER ;
-- CALL CriarCasoETornarSuspeitos(TERRENO_ID, CURDATE());
DELIMITER $$
CREATE PROCEDURE CriarCasoETornarSuspeitos(
IN p_Terreno_ID INT,
IN p_Data_de_abertura DATE
)
BEGIN
DECLARE v_Caso_ID INT;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
-- Em caso de erro, reverter todas as operações
ROLLBACK;
END;
START TRANSACTION;
-- Insere um novo caso
INSERT INTO Caso (Data_de_abertura, Estado, Estimativa_de_roubo, Data_de_encerramento, Terreno_ID)
VALUES (p_Data_de_abertura, 'Aberto', CalcularEstimativaDeRoubo(p_Terreno_ID), NULL, p_Terreno_ID);
-- Obter o último ID do caso inserido
SET v_Caso_ID = LAST_INSERT_ID();
-- Seleciona todos os funcionários que trabalham no terreno especificado
INSERT INTO Suspeito (Funcionário_ID, Caso_ID, Estado, Envolvimento, Notas)
SELECT t.Funcionário_ID, v_Caso_ID, 'Em Investigação', 3, 'Funcionário estava presente no terreno no dia do roubo'
FROM Trabalha t
WHERE t.Terreno_ID = p_Terreno_ID;
COMMIT;
END $$
DELIMITER ;
```
)
#attachment(caption: "Script de índices em SQL.",[])
#block(
fill: rgb("#f2f2eb"),
inset: 8pt,
breakable: true,
```sql
-- Criação de um índice para a coluna Terreno_ID na tabela Caso
CREATE INDEX index_caso_terreno_id ON Caso(Terreno_ID);
-- Criação de um índice para a coluna Caso_ID na tabela Suspeito
CREATE INDEX idx_suspeito_caso_id ON Suspeito(Caso_ID);
-- Criação de um índice para a coluna Funcionário_ID na tabela Suspeito
CREATE INDEX idx_suspeito_funcionario_id ON Suspeito(Funcionário_ID);
```
)
#attachment(caption: "Script de vistas da base de dados em SQL.",[])
#block(
fill: rgb("#f2f2eb"),
inset: 8pt,
breakable: true,
```sql
-- View das informações dos funcionários e dos casos associados.
CREATE VIEW FuncionariosEmCasos AS
SELECT
Funcionário.Nome,
Número_de_telemóvel.Número_de_telemóvel_ID,
Caso.Caso_ID,
Caso.Data_de_abertura,
Caso.Estado,
Caso.Estimativa_de_roubo,
Caso.Data_de_encerramento,
Caso.Terreno_ID
FROM
Funcionário
INNER JOIN
Suspeito ON Funcionário.Funcionário_ID = Suspeito.Funcionário_ID
INNER JOIN
Caso ON Suspeito.Caso_ID = Caso.Caso_ID
LEFT JOIN
Número_de_telemóvel ON Funcionário.Funcionário_ID = Número_de_telemóvel.Funcionário_ID;
-- View das informações dos funcionários e dos terrenos associados.
CREATE VIEW FuncionariosEmTerrenos AS
SELECT
Funcionário.Nome,
Função.Designação,
Número_de_telemóvel.Número_de_telemóvel_ID,
CalcularIdade(Funcionário.Data_de_nascimento) AS Idade,
Funcionário.Salário,
Terreno.Terreno_ID,
Terreno.Minério_previsto,
Terreno.Minério_coletado
FROM
Funcionário
INNER JOIN
Trabalha ON Funcionário.Funcionário_ID = Trabalha.Funcionário_ID
INNER JOIN
Terreno ON Trabalha.Terreno_ID = Terreno.Terreno_ID
INNER JOIN
Função ON Funcionário.Função_ID = Função.Função_ID
LEFT JOIN
Número_de_telemóvel ON Funcionário.Funcionário_ID = Número_de_telemóvel.Funcionário_ID;
```
)
#attachment(caption: "Script de interrogações da base de dados em SQL.",[])
#block(
fill: rgb("#f2f2eb"),
inset: 8pt,
breakable: true,
```sql
-- Definir variáveis para utilizar nas queries
SET @Funcionario_ID = 3;
SET @Caso_ID = 3;
SET @Terreno_ID = 1;
-- Listar o prejuízo de um terreno
SELECT
Terreno_ID,
(Minério_previsto - Minério_coletado) AS Prejuízo
FROM
Terreno
WHERE Terreno_ID = @Terreno_ID;
-- Ver quando é que um funcionário se tornou suspeito de um determinado caso
SELECT
s.Funcionário_ID,
s.Caso_ID,
c.Data_de_abertura
FROM
Suspeito s
INNER JOIN
Caso c ON s.Caso_ID = c.Caso_ID
WHERE
s.Funcionário_ID = @Funcionario_ID
AND s.Caso_ID = @Caso_ID;
-- Listar os suspeitos de um determinado caso
SELECT
s.Funcionário_ID,
f.Nome,
s.Estado,
s.Envolvimento,
s.Notas
FROM
Suspeito s
INNER JOIN
Funcionário f ON s.Funcionário_ID = f.Funcionário_ID
WHERE
s.Caso_ID = @Caso_ID;
-- Ver a data do último caso de um determinado funcionário
SELECT
c.Caso_ID,
c.Data_de_abertura
FROM
Caso c
INNER JOIN
Suspeito s ON c.Caso_ID = s.Caso_ID
WHERE
s.Funcionário_ID = @Funcionario_ID
ORDER BY
c.Data_de_abertura DESC
LIMIT 1;
-- Listar os casos a que um determinado funcionário está associado
SELECT
c.Caso_ID,
c.Data_de_abertura,
c.Estado,
c.Estimativa_de_roubo,
c.Data_de_encerramento,
c.Terreno_ID
FROM
Caso c
INNER JOIN
Suspeito s ON c.Caso_ID = s.Caso_ID
WHERE
s.Funcionário_ID = @Funcionario_ID;
-- Ver o dia em que mais casos foram abertos
SELECT
Data_de_abertura,
COUNT(*) AS Total_de_Casos
FROM
Caso
GROUP BY
Data_de_abertura
ORDER BY
Total_de_Casos DESC
LIMIT 1;
-- Listar os top 5 funcionários por quantidade de casos
SELECT
s.Funcionário_ID,
f.Nome,
COUNT(s.Caso_ID) AS Total_de_Casos
FROM
Suspeito s
INNER JOIN
Funcionário f ON s.Funcionário_ID = f.Funcionário_ID
GROUP BY
s.Funcionário_ID, f.Nome
ORDER BY
Total_de_Casos DESC
LIMIT 5;
```
)
]
|
|
https://github.com/typst-community/mantodea | https://raw.githubusercontent.com/typst-community/mantodea/main/docs/manual.typ | typst | MIT License | #import "util.typ": mantys, package, issues
#import "/src/lib.typ" as mantodea
#import mantodea.link: footlink
#show: mantys.mantys.with(
..package,
title: [mantodea],
subtitle: [/mɑntɔdɛɑ/],
date: datetime.today().display(),
abstract: [
MANTODEA provides a template and tools for writing documents targeted at Typst developers, such as convenient bindings to Typst documentation pages, example rendering or source forge links.
It is primarily used as a package and template for technical documents such as guidelines, documentation or specifcations.
],
)
#show raw.line: it => {
show "{{VERSION}}": package.version
it
}
= Manifest
MANTODEA aims to be the following:
- simple to use
- the default template should provide an good user experience
- unsurprising
- parameters should have sensible names and behave as one would expect
- general
- provided features are not for specific use cases, but rather baseline utilities for more specific use cases
If you think its behvior is surprising, you believe you found a bug or you think its defaults or parameters are not sufficient for your use case, please open an issue at #issues.
Contributions are also welcome!
MANTODEA is a fork of #footlink("https://github.com/jneug/typst-mantys", mantys.package[Mantys]), a package for creating package documentation.
= Reference
== Stability
This package tries to adhere to #footlink("https://semver.org")[semantic versioning], please report unintended API breakage at #issues.
== Custom types
=== theme <type-theme>
Most functions take a `theme` argument, this type is a dictionary containign various style information to override, mainly colors and font configuration.
The default can be found at `mantodea.theme.default` and serves as the defacto schema.
#mantys.add-type("theme", target: <type-theme>, color: orange.lighten(75%))
== Modules
#let mods = (
("mantodea", "/src/lib.typ", [
The package entry point, containing the top level sub modules and the template main function.
]),
("author", "/src/author.typ", [
Utlities for handling author rendering.
]),
("component", "/src/component/table-of-contents.typ", [
Parts of the template's components, while usable independently, they assume certain styles found in the `style` module.
]),
("exmaple", "/src/example.typ", [
Utlities for rendering examples with and without evaluation of Typst code.
]),
("component/table-of-contents", "/src/component/table-of-contents.typ", [
Contains an outline implementation with improved alignment.
]),
("component/title-page", "/src/component/table-of-contents.typ", [
Contains the title page component.
]),
("link", "/src/link.typ", [
Utlities for linking to Typst resources or source forges.
]),
("theme", "/src/theme.typ", [
Theming related values, namely the default style dictionary used when not style is given.
]),
("util", "/src/util.typ", [
General utlities.
]),
("style", "/src/style.typ", [
Styles for the template, namely the default style in use for the template body.
]),
)
#let render-module(name, path, description) = [
#heading(depth: 3, name)
#description
#mantys.tidy-module(read(path), name: name)
]
#mods.map(x => render-module(..x)).join(pagebreak(weak: true))
|
https://github.com/piepert/philodidaktik-hro-phf-ifp | https://raw.githubusercontent.com/piepert/philodidaktik-hro-phf-ifp/main/src/parts/spue/leistungsmessung/formen.typ | typst | Other | #import "/src/template.typ": *
== Formen der Leistungsmessung
In der SPÜ werden Sie sehr wahrscheinlich Noten in Form von Lernerfolgskontrollen gewinnen müssen. Erinnern Sie sich an den Prinzipien auf S. #refpage(<ephid-bub>) ff.! Formulieren Sie nur Aufgaben, die Sich mit Hilfe der generierten Kompetenzen aus Ihren Unterrichtszielen lösen lassen. Erstellen Sie danach für jede Aufgabe eine Bewertungsmatrix inklusive einer Beispiellösung.
Für eine bestimmte Form der Bewertung wird wahrscheinlich der klassische "Test" sehr attraktiv sein. Behalten Sie jedoch im Hinterkopf, dass dies nicht die einzige und auch nicht die beste Prüfungsform sein muss! Die *Lektüre von <NAME> und <NAME>* ist hilfreich, um Bewertungsmatrizen und Hinweise für verschiedene Formen der Leistungsmessung zu erhalten.#en[@SchmidtRuthendorf2017_PhilosophierenMessen] Sie können dabei auch Hilfsmittel zulassen, wie etwa die eigenen Aufzeichnungen, je nach Form der Leistungsmessung.
#orange-list-with-body[*Schriftliche Formen*][
- klassischer #ix("Test", "Leistungskontrolle, schriftlich")
- #ix("Schriftlicher Dialog", "Dialog, schriftlich")
- #ix("Leserbrief")
- #ix("Portfolio")
- #ix("Multiple-Choice")
- #ix("Essay")
- #ix("Karikaturanalyse")
- #ix("Lexikonartikel")
- ...
][*Mündliche und interaktive Formen*][
- klassische #ix("mündliche Prüfung", "Leistungskontrolle, mündlich") (Aus Zeitgründen für die SPÜ wahrscheinlich ungeeignet!)
- #ix("Debatten", "Debatte") und #ix("Dispute", "Disput")
- #ix("Präsentation"), #ix("Vortrag"), #ix("Refarat")
- #ix("Sokratisches Gespräch")
- #ix("Rollenspiel")
- ...
][*Präsentative Formen*][
- #ix("Collage"), #ix("Plakat")
- #ix("Standbild")
- ...
]
Setzen Sie sich mit ihren betreuenden Dozierenden und Fachlehrpersonen in Verbindung um festzulegen, welche Formen geeignet und welche weniger geeignet sind. Achten Sie auf #ix([*Binnendifferenzierung*, d.h.], "Binnendifferenzierung") geben Sie den SuS die Möglichkeit sich anhand ihrer #ix("Heterogenität der SuS") und individuellen Ausstattung auszuleben. Die Verwendung von verschiedenen Anforderungsbereichen, Wahlaufgaben, etc. kann dabei hilfreich sein. Sie haben SuS mit unterschiedlichen Leistungsniveaus, Fähigkeiten und Interessen, diese sollten mit einbezogen werden. |
https://github.com/kdkasad/typst-homework-template | https://raw.githubusercontent.com/kdkasad/typst-homework-template/master/examples/computer-science/problem3.typ | typst | BSD 3-Clause "New" or "Revised" License | #import "../../khw.typ": problem, radialgraph
#problem[
#lorem(70)
]
Proof by cases.
Below, a node in a graph represents a TA and an edge between two nodes represents a handshake between the two TAs.
=== Case 1: Everyone shook hands
#lorem(50)
=== Case 2: Not everyone shook hands
#lorem(60)
#lorem(80)
#grid(
columns: 2,
column-gutter: 1cm,
[#figure(
radialgraph(
radius: 1.5cm,
nodes: ("A", "B", "C", "D"),
edges: (
("A", ("C", "D")),
("B", ("C", "D")),
)
),
caption: [
A graph which demonstrates that having two disjoint pairs of TAs who have not shaken hands contradicts UTA Bob's observation and thus is impossible.
${A, B}$ and ${C, D}$ are the pairs of TAs who have not shaken hands.
]
) <fig:two-disjoint-pairs>],
[#figure(
radialgraph(
radius: 1.5cm,
nodes: ("A", "B", "C", "D"),
edges: (
("C", ("A", "B", "D")),
)
),
caption: [
A graph which demonstrates that having two pairs of TAs who have not shaken hands is possible as long as one TA is in both pairs.
${A, B}$ and ${A, D}$ are the pairs of TAs who have not shaken hands.
]
) <fig:two-overlapping-pairs>]
)
#lorem(20)
@fig:two-overlapping-pairs demonstrates that this still satisfies UTA Bob's observation, so it can exist.
#lorem(50)
#lorem(40)
|
https://github.com/Otto-AA/definitely-not-tuw-thesis | https://raw.githubusercontent.com/Otto-AA/definitely-not-tuw-thesis/main/tests/dissertation/test.typ | typst | MIT No Attribution | #import "/src/thesis.typ": *
#show: general-styles
#show: thesis.with(
lang: "en",
title: (en: "An ode for Lord Ipsum", de: "Eine Ode an Lord Ipsum"),
subtitle: (en: "The origins", de: "The origins"),
thesis-type: (en: "Dissertation", de: "Dissertation"),
academic-title: (en: "Doktorin der Sozial- und Wirtschaftswissenschaften", de: "Doktorin der Sozial- und Wirtschaftswissenschaften"),
curriculum: none,
author: (name: "<NAME>", student-number: 11223344),
// TODO: second advisor
advisor: (name: "<NAME>", pre-title: "Univ.Prof.Dr."),
assistants: (),
reviewers: ((name: "<NAME>", pre-title: "Dr."), (name: "<NAME>")),
keywords: ("Lorem Ipsum"),
font: "DejaVu Sans",
date: datetime(year: 2024, month: 12, day: 1),
) |
https://github.com/leyan/cetzpenguins | https://raw.githubusercontent.com/leyan/cetzpenguins/main/gallery/customizedPenguin.typ | typst | MIT License | #import "@preview/cetz:0.2.2"
#import "../src/penguins.typ" :penguin,penguinInternal,anchor-coords
#set page(width: 3cm, height: 4cm)
#set align(center+horizon)
#penguin(
width:2cm,
body-color:blue,
head-color:aqua,
left-eye:(color:red,
shape:"shiny"),
right-eye:(
color:green,
shape:"wink")
) |
https://github.com/maucejo/book_template | https://raw.githubusercontent.com/maucejo/book_template/main/template/chapters/ch_main.typ | typst | MIT License | #include "intro.typ"
#include "ch1.typ"
#include "ch2.typ"
// #include "conclusion.typ" |
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/3_PB/PianoDiProgetto/sections/ConsuntivoSprint/TredicesimoSprint.typ | typst | MIT License | #import "../../const.typ": Re_cost, Am_cost, An_cost, Ve_cost, Pr_cost, Pt_cost
#import "../../functions.typ": rendicontazioneOreAPosteriori, rendicontazioneCostiAPosteriori, glossary
==== Tredicesimo consuntivo
*Inizio*: Venerdì 15/03/2024
*Fine*: Giovedì 21/03/2024
#rendicontazioneOreAPosteriori(sprintNumber: "13")
#rendicontazioneCostiAPosteriori(sprintNumber: "13")
===== Analisi a posteriori
Dalla retrospettiva si evince che l'impegno del team continua ad essere alto e costante avendo raggiunto le 56.5 ore produttive totali nell'ultimo #glossary[sprint],.
È rilevabile un distacco di un 13% tra le ore preventivate e quelle consuntivate, questo però dovuto non ad una mancanza di lavoro da parte del team, bensì ad una pianificazione più pessimista del necessario, in quanto tutte le attività pianificate sono state portate a termine ma con un discreto anticipo inaspettato.
Le ore da Programmatore e da Verificatore continuano ad essere le più numerose in quanto, avvicinandosi sempre più alla seconda revisione, è critica la costruzione di un buon prodotto che rispecchi quanto promesso alla Proponente.
===== Aggiornamento della pianificazione e gestione dei rischi
Durante lo #glossary[sprint] attuale, l'unico rischio che si è manifestato è stato il rischio RT1 - Conoscenze tecnologiche limitate. Questo #glossary[sprint] ha visto come problema principale l'implementazione del sistema di notifiche del prodotto, il quale è risultato particolarmente complesso da gestire e da configurare secondo le specifiche desiderate. Tuttavia, grazie a una stretta collaborazione tra Programmatori, è stato possibile superare tale ostacolo. |
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/meta/ref-03.typ | typst | Other |
#show ref: it => {
if it.element != none and it.element.func() == figure {
let element = it.element
"["
element.supplement
"-"
str(element.counter.at(element.location()).at(0))
"]"
// it
} else {
it
}
}
#figure(
image("test/assets/files/cylinder.svg", height: 3cm),
caption: [A sylinder.],
supplement: "Fig",
) <fig1>
#figure(
image("test/assets/files/tiger.jpg", height: 3cm),
caption: [A tiger.],
supplement: "Figg",
) <fig2>
#figure(
$ A = 1 $,
kind: "equation",
supplement: "Equa",
) <eq1>
@fig1
@fig2
@eq1
|
https://github.com/EunTilofy/NumComputationalMethods | https://raw.githubusercontent.com/EunTilofy/NumComputationalMethods/main/coding/task2/SC-report-1.typ | typst | #import "../../template.typ": *
#show: project.with(
course: "Computing Method",
title: "Computing Method - Programming 1",
date: "2024.4.23",
authors: "<NAME>, 3210106357",
has_cover: false
)
= 问题
\
函数 $f(x) = 1/(1 + 25 x^2), x in [-1, 1]$,利用下列条件做插值逼近,并与函数 $f(x)$ 的图像进行比较。($n=10$)
#set enum(numbering : "(a)")
+ 用等距节点 $x_i = -1 + 2/n i, i= 0, 1, 2, dots.c, n$,试建立 $n$ 次 Largrange 插值多项式和 Newtown 插值多项式,绘出插值多项式的图像;
+ 用节点 $x_i = cos ((2i+1)/42 pi), i= 0, 1, dots.c, 20$,绘出 20 次 Lagrange 插值多项式的图像;
+ 用等距节点 $x_i = -1 + 2/10 i, i = 0, 1, 2, dots.c, 10$,绘出它的分段线性插值函数的图像;
+ 用等距节点 $x_i = -1 + 2/10 i, i = 0, 1, 2, dots.c, 10$,绘出它的分段三次 Hermite 插值函数的图像。
= 公式与算法
#set enum(numbering: "(a)")
+ Lagrange 插值公式:$phi_n (x) = sum_(j=0)^n y_j (product_(i eq.not j, i = 0)^n (x - x_i))/(product_(i eq.not j, i = 0)^n (x_j - x_i))$。
\ Newton 插值公式:$phi_n (x) = f(x_0) + sum_(i = 1)^n f[x_1, dots, x_i] product_(j=0)^(i-1) (x-x_j)$。
+ 使用不均匀的节点进行 Lagrange 插值,公式同 (a)。
+ 分段线性插值,直接对于相邻两个节点进行线性拟合。
+ 分段三次 Hermite 插值:
#tablex(
columns: 5,
auto-hlines: false,
auto-vlines: false,
(), vlinex(), (), (), (),
$x_0$, $y_0$, [], [], [],
$x_0$, $y_0$, $y'_0$, [], [],
$x_1$, $y_1$, $f[x_0, x_1]$, $(y'_0-f[x_0, x_1])/(x_0 - x_1)$, [],
$x_1$, $y_1$, $y'_1$, $(y'_1 - f[x_0, x_1])/(x_1 - x_0)$, $(y'_1+y'_0-2f[x_0, x_1])/(x_1 - x_0)^2$,
)
所以,
$
f(x) = (y'_1+y'_0-2f[x_0, x_1])/(x_1 - x_0)^2 (x - x_0)^2(x-x_1) + (y'_0-f[x_0, x_1])/(x_0 - x_1) (x - x_0)^2 + y'_0 (x - x_0) + y_0
$
= 程序
== 调用接口
```matlab
f = @(x) 1./(1 + 25*x.^2);
xa = ((1:11)-6)./5;
ya = f(xa);
y1 = -50 * xa ./ (1 + 25 * xa.^2).^2;
xb = cos((2*(0:20) + 1)*pi/42);
yb = f(xb);
ans11 = @(x) lagrange(xa, ya, x);
Difftable = diffTable(xa, ya);
ans12 = @(x) newton(xa, Difftable, x);
ans2 = @(x) lagrange(xb, yb, x);
ans3 = @(x) linear(xa, ya, x);
ans4 = @(x) hermite(xa, ya, y1, x);
```
== 绘图
```matlab
x_ = ((1:1001)-501)./500;
ploto = f(x_);
plot11 = ans11(x_);
plot12 = ans12(x_);
plot2 = ans2(x_);
plot3 = ans3(x_);
plot4 = ans4(x_);
figure;
subplot(2,2,1);
plot(x_, ploto, 'b--', 'DisplayName', 'Original');
hold on;
plot(x_, plot11, 'k-', 'DisplayName', 'Lagrange-1');
plot(x_, plot12, 'r-.', 'DisplayName', 'Newton');
legend('show');
title('(a) Lagrange vs Newton');
xlabel('x');
ylabel('y');
subplot(2,2,2);
plot(x_, ploto, 'b--', 'DisplayName', 'Original');
hold on;
plot(x_, plot2, 'k-', 'DisplayName', 'Lagrange-2');
legend('show');
title('(b) Lagrange');
xlabel('x');
ylabel('y');
subplot(2,2,3);
plot(x_, ploto, 'b--', 'DisplayName', 'Original');
hold on;
plot(x_, plot3, 'k-', 'DisplayName', 'Linear');
legend('show');
title('(c) Linear');
xlabel('x');
ylabel('y');
subplot(2,2,4);
plot(x_, ploto, 'b--', 'DisplayName', 'Original');
hold on;
plot(x_, plot4, 'k-', 'DisplayName', 'Hermite');
legend('show');
title('(d) Hermite');
xlabel('x');
ylabel('y');
```
== 求解部分
```matlab
function P = lagrange(X, Y, x)
n = length(X);
L = ones(n, length(x));
for i = 1:n
for j = 1:n
if i ~= j
L(i,:) = L(i,:).*(x-X(j))./(X(i)-X(j));
end
end
end
P = Y*L;
end
function P = newton(X, Table, x)
n = length(X);
P(length(x)) = 0;
for ii = 1:length(x)
num = 1;
P(ii) = 0;
for i = 1:n
P(ii) = P(ii) + num * Table(i);
num = num * (x(ii) - X(i));
end
end
end
function table = diffTable(X, Y)
n = length(X);
table(n) = 0;
for i = 1:n
table(i) = Y(i);
end
for j = 2:n
for i = n+j-(j:n)
table(i) = (table(i) - table(i-1)) / (X(i)-X(i-j+1));
end
end
end
function P = linear(X, Y, x)
P(length(x)) = 0;
for i = 1:length(x)
for j = 1:length(X)-1
if x(i) >= X(j) && x(i) <= X(j+1)
P(i) = Y(j) + (Y(j+1) - Y(j)) / (X(j+1) - X(j)) * (x(i) - X(j));
break;
end
end
end
end
function P = hermite(X, Y, Y1, x)
P(length(x)) = 0;
for i = 1:length(x)
for j = 1:length(X)-1
if x(i) >= X(j) && x(i) <= X(j+1)
P(i) = hermite_(X(j), X(j+1), Y(j), Y(j+1), Y1(j), Y1(j+1), x(i));
end
end
end
end
function P = hermite_(x0, x1, y0, y1, y0p, y1p, x)
P = 0;
P = P + y0;
P = P + (x - x0) * y0p;
fx0x1 = (y1 - y0) / (x1 - x0);
P = P + (x - x0) * (x - x0) * (y0p - fx0x1) / (x0 - x1);
P = P + (x - x0) * (x - x0) * (x - x1) * (y1p + y0p - 2 * fx0x1) / (x1 - x0) / (x1 - x0);
end
```
= 数据与结果
输入函数为 $f(x) = 1 / (1 + 25 x^2), x in [-1, 1]$,四问的求解结果如下:
#figure(
image("plot.png", width: 90%),
)
= 结论
+ 对于相同的输入,Lagrange 和 Newton 的求解结果完全相同,这符合插值的唯一性。插值结果在两个端点处出现了明显的振荡,产生 Runge 现象。
+ 使用 $cos((2i + 1) / 42 pi), i = 0, 1, dots.c, 20$ 作为插值节点,插值点的数量相比之前变多了,并且在两个端点处的插值点更加密集,最后结果在 $[-0.5, 0.5]$ 上的拟合结果明显更好,且在两侧的振荡也减小了许多。
+ 线性插值结果为原函数的若干条割线相连接形成的分段函数。
+ 两点三次 Hermite 插值结果的拟合效果最好。 |
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/meta/bibliography-ordering.typ | typst | Apache License 2.0 | #set page(width: 300pt)
@mcintosh_anxiety
@psychology25
@netwok
@issue201
@arrgh
@quark
@distress,
@glacier-melt
@issue201
@tolkien54
@sharing
@restful
#bibliography("/files/works.bib")
|
https://github.com/binhtran432k/ungrammar-docs | https://raw.githubusercontent.com/binhtran432k/ungrammar-docs/main/contents/literature-review/index.typ | typst | = Literature Review
#include "./lsp.typ"
#include "./vscode.typ"
#include "./monaco.typ"
#include "./monaco-vs-vscode.typ"
#include "./ast.typ"
#include "./cst.typ"
#include "./lezer.typ"
#include "./ungrammar.typ"
#include "./bun.typ"
#include "./typescript.typ"
#include "./esbuild.typ"
#include "./lerna.typ"
#include "./gherkin.typ"
#include "./astro.typ"
#include "./preact.typ"
#include "./daisyui.typ"
#include "./tailwindcss.typ"
#include "./github-actions.typ"
#include "./bdd.typ"
#include "./tdd.typ"
|
|
https://github.com/christophermanning/typst-docker | https://raw.githubusercontent.com/christophermanning/typst-docker/main/examples/hello-world.typ | typst | MIT License | // make the compiled output idempotent
#set document(date: none)
#for _ in range(4) [
= Hello World
#lorem(125)
]
|
https://github.com/gongke6642/tuling | https://raw.githubusercontent.com/gongke6642/tuling/main/Math/underover.typ | typst | #set text(
size:10pt,
)
#set page(
paper:"a5",
margin:(x:1.8cm,y:1.5cm),
)
#set par(
justify: true,
leading: 0.52em,
)
= 上/下
等式各部分上方或下方的分隔符。
大括号和括号还允许您在自身下方或上方添加可选注释。
= 功能
= 下划线
内容下方的水平线。
#image("51.png")
= 内容
行上方的内容。
= 上划线
内容上方的水平线。
#image("52.png")
= 内容
行下方的内容。
= 下方大括号
内容下方的水平大括号,下方带有可选注释。
#image("53.png")
= 内容
大括号上方的内容。
= 注解
大括号下方的可选内容。
默认:none
= 上方大括号
内容上方的水平大括号,上方带有可选注释。
#image("54.png")
= 内容
大括号下方的内容。
= 注解
大括号上方的可选内容。
默认:none
= 下方中括号
内容下方的水平中括号,下方带有可选注释。
#image("55.png")
= 内容
中括号上方的内容。
= 注解
中括号下方的可选内容。
默认:none
= 上方中括号
内容上方的水平中括号,上方带有可选注释。
#image("56.png")
= 内容
中括号下方的内容。
= 注解
中括号上方的可选内容。
默认:none |
|
https://github.com/Hennzau/cv | https://raw.githubusercontent.com/Hennzau/cv/main/example/enzo.le-van.typ | typst | #import "../lib.typ": cv
#let gray = rgb("#303848")
#let orange = rgb("#BF9268")
#let light_gray = rgb("#F2F2F2")
#let cadre_photo() = {
align(right + bottom)[
#box(width: auto, height: 85%, stroke: gray + 4pt,)[
#image("enzo.le-van.photo.jpg")
]
]
}
#let cadre_nom() = {
align(center + bottom)[
#box(width: 85%, height: 80%, stroke: orange + 4pt, fill: white)[
#align(center + top)[
#move(dy: 25pt)[
#text(size: 30pt, weight: "extralight", spacing: 100%, tracking: 4pt)[
<NAME>
]
#linebreak()
#move(dy: 10pt)[
#text(size: 15pt, weight: "bold", tracking: 4pt)[
Elève en 2ème année à
]
#linebreak()
#text(size: 15pt, weight: "bold", tracking: 4pt)[
CentraleSupélec
]
]
]
]
]
]
}
#let cadre_contact() = {
align(center + horizon)[
#move(dy: 6pt)[
#text(size: 9pt, weight: "semibold")[
e-mail : <EMAIL> | #link("https://github.com/Hennzau")[GitHub : \@Hennzau] | #link("www.linkedin.com/in/enzo-le-van")[Linkedin : \@enzo-le-van]
]
]
]
}
#let cadre_recherche() = {
move(dx: 5%, dy: 14pt)[
#line(length: 90%, stroke: orange + 2pt)
]
align(center)[
#move(dy: 18pt)[
#text(size: 10pt, weight: "semibold")[
#par(justify: true)[
Je suis à la recherche d'un stage de césure de 6 mois à partir du mois de juillet/août 2024 dans le domaine
#linebreak(justify: true)
de l'informatique où je pourrai développer des applications logicielles pour de la robotique et/ou de l'embarqué.
]
]
]
]
}
#let cadre_divers() = {
let langues() = {
move(dx: 5%, dy: 15pt)[
#line(length: 90%, stroke: orange + 2pt)
]
align(center)[
#move(dx: 0pt, dy: -5pt)[
#highlight(fill: light_gray, extent: 8pt)[
#text(size: 15pt, weight: "semibold", tracking: 2pt)[
Langues
]
]
]
]
align(center)[
#move(dy: 0pt)[
#text(size: 11pt, weight: "semibold")[
Anglais : C1
]
#linebreak()
#text(size: 11pt, weight: "semibold")[
Espagnol : B2
]
#linebreak()
#text(size: 11pt, weight: "semibold")[
Japonais : A1
]
#linebreak()
#linebreak()
]
]
}
let loisirs() = {
move(dx: 5%, dy: 15pt)[
#line(length: 90%, stroke: orange + 2pt)
]
align(center)[
#move(dx: 0pt, dy: -5pt)[
#highlight(fill: light_gray, extent: 8pt)[
#text(size: 15pt, weight: "semibold", tracking: 2pt)[
Loisirs
]
]
]
]
align(center)[
#move(dy: 0pt)[
#text(size: 11pt, weight: "semibold")[
Piano depuis 6 ans
#linebreak()
Guitare depuis 7 ans
]
#linebreak()
#linebreak()
#text(size: 11pt, weight: "semibold")[
Wing Chun en club
#linebreak()
Escalade en EPS
]
#linebreak()
#linebreak()
#text(size: 11pt, weight: "semibold")[
Java & C++ depuis 10 ans
#linebreak()
Rust depuis 2 ans
]
#linebreak()
#linebreak()
]
]
}
let competences() = {
move(dx: 5%, dy: 15pt)[
#line(length: 90%, stroke: orange + 2pt)
]
align(center)[
#move(dx: 0pt, dy: -5pt)[
#highlight(fill: light_gray, extent: 8pt)[
#text(size: 15pt, weight: "semibold", tracking: 2pt)[
Compétences
]
]
]
]
align(center)[
#move(dy: 0pt)[
#text(size: 11pt, weight: "semibold")[
Electronique
#linebreak()
Rust C++ Python
#linebreak()
Logiciels JetBrains
#linebreak()
GitHub CI/CD
#linebreak()
Architecture de projets
]
#linebreak()
#linebreak()
]
]
}
align(right)[
#block(fill: light_gray, width: 90%, height: 100%)[
#align(left)[
#grid(
columns: (100%),
rows: (auto, auto, auto),
langues(),
loisirs(),
competences()
)
]
]
]
}
#let cadre_formation() = {
align(left + top)[
#box(fill: gray, width: 150pt, height: 30pt)[
#align(center + horizon)[
#text(size: 14pt, weight: "semibold", fill: white, tracking: 2pt)[
Formation
]
]
]
]
move(dx: 150pt, dy: -30pt)[
#line(length: 225pt, stroke: orange + 2pt)
]
move(dy: -16pt)[
#list(
indent: 15pt,
tight: false,
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[Echange universitaire] : Computer Science, 15/01/2025 - 7/06/2025
#linebreak()
#text(weight: "semibold")[Linköpings Universitet | Suède]
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[2ème année Ingénieur] : Energie électrique, systèmes électroniques, physique
des ondes, thermodynamique, thermique, véhicules autonomes
#linebreak()
#text(weight: "semibold")[Ecole CentraleSupélec | Gif-sur-Yvette]
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[MPSI/PSI\*] : Mathématiques, Physique, 30/08/2021 - 1/09/2023
#linebreak()
#text(weight: "semibold")[Lycée Privé Sainte-Geneviève | Versailles]
]
]
)
]
}
#let cadre_projet() = {
align(left + top)[
#box(fill: gray, width: 150pt, height: 30pt)[
#align(center + horizon)[
#text(size: 14pt, weight: "semibold", fill: white, tracking: 2pt)[
Projets
]
]
]
]
move(dx: 150pt, dy: -30pt)[
#line(length: 225pt, stroke: orange + 2pt)
]
move(dy: -16pt)[
#list(
indent: 15pt,
tight: false,
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold", size: 12pt)[`MarcsRover`] : Création d'une mini voiture autonome en équipe, 09/2024
#linebreak()
#text(weight: "semibold")[CoVAPSy | Python & Zenoh & Electronique]
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold", size: 12pt)[`fastformat`] : Bibliothèque de conversion de données réelles (capteurs)
#linebreak(justify: true)
vers un format générique utilisé par d'autres bibliothèques
#linebreak()
#text(weight: "semibold")[Organisation #text(weight: "semibold", size: 12pt)[`dora-rs`] | Rust & Python]
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold", size: 12pt)[`dora-rs`] : Contribution à une bibliothèque de robotique
#linebreak()
#text(weight: "semibold")[Organisation #text(weight: "semibold", size: 12pt)[`dora-rs`] | Rust & Python]
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold", size: 12pt)[`dora-lerobot`] : Intégration d'une bibliothèque de robotique et d'IA
#linebreak(justify: true)
sur des bras articulés
#linebreak()
#text(weight: "semibold")[HuggingFace | Python]
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold", size: 12pt)[`RoverCS`] : Création d'un rover autonome en équipe, 02/2024 - 06/2024
#linebreak()
#text(weight: "semibold")[NXP Cup | ROS2 & Python & C & Zephyr RTOS]
]
],
)
]
}
#let cadre_experience() = {
move(dx: 5%, dy: 28pt)[
#line(length: 90%, stroke: orange + 2pt)
]
move(dx: 50% - 75pt, dy: 0pt)[
#box(fill: gray, width: 150pt, height: 30pt)[
#align(center + horizon)[
#text(size: 14pt, weight: "semibold", fill: white, tracking: 2pt)[
Expérience
]
]
]
]
let pad = 3pt
let pad2 = 12pt
grid(
columns: (50%, 50%),
rows: (100%),
grid.cell(
x: 0,
y: 0,
rowspan: 1,
colspan: 1,
)[
#move(dy: pad, dx: pad2)[
#par(justify: true)[
#list(
indent: 15pt,
tight: false,
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[Staffeur anti VSS], 09/2023 - 01/2025
#linebreak()
Surveillance anti VSS lors des soirées étudiantes
#linebreak()
#text(weight: "semibold")[Gif-sur-Yvette] • Association çapèse
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[Staffeur commandes], 09/2023 - 01/2025
#linebreak()
Préparateur de commandes de produits locaux
#linebreak()
#text(weight: "semibold")[Gif-sur-Yvette] • Association Impact - Pépin
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[Aide aux devoirs], 09/2021 - 06/2022
#linebreak()
Aide aux devoirs du collège
#linebreak()
#text(weight: "semibold")[Versailles] • ARPEJ
]
]
)
]
]
],
grid.cell(
x: 1,
y: 0,
rowspan: 1,
colspan: 1,
)[
#move(dy: pad, dx: -pad2)[
#par(justify: true)[
#list(
indent: 15pt,
tight: false,
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[Contributeur robotique et IA], 05/2024 - 09/2024
#linebreak()
Création de #text(weight: "semibold", size: 12pt)[`dora-lerobot`] : programmation de bras
#linebreak()
articulés faible et gros budget pour de l'apprentissage
#linebreak()
par téléopération
#linebreak()
#text(weight: "semibold")[Paris] • 1ms.ai & HuggingFace
]
],
[
#text(size: 10pt, weight: "extralight")[
#text(weight: "semibold")[Stagiaire opérateur], 06/2024 - 07/2024
#linebreak()
Production de parafoudre basse tension
#linebreak()
#text(weight: "semibold")[Lyon] • Eurotect Electrical
]
],
)
]
]
]
)
}
#show: cv.with(
author: "<NAME>",
title: "CV de Enzo Le Van",
date: datetime(year: 2024, month: 9, day: 23),
main_color: gray,
secondary_color: orange,
third_color: light_gray,
frames: (
cadre_photo(),
cadre_nom(),
cadre_contact(),
cadre_recherche(),
cadre_divers(),
cadre_formation(),
cadre_projet(),
cadre_experience()
)
)
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/021%20-%20Battle%20for%20Zendikar/006_Nissa's%20Quest.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Nissa's Quest",
set_name: "Battle for Zendikar",
story_date: datetime(day: 23, month: 09, year: 2015),
author: "<NAME>",
doc
)
#emph[Nissa was closer to the power of Zendikar, and to the world’s soul, than ever before. She was able to channel it through the towering treelike elemental she called Ashaya, the Awoken World—her friend. And the land itself responded to her presence, augmenting her strength and acting as an extension of her being, helping her to battle the Eldrazi. But all of that was suddenly ripped away; the soul of Zendikar was taken from her and now it is no longer there when she reaches out to it. Nissa has been left nearly powerless and alone, and she believes that the Eldrazi—perhaps even the titan—must have something to do with this. She feels the burden of the bundle of seeds that she carries with her, those from trees that have been wiped out by the Eldrazi; she promised the world that she would not stop until she could plant them safely on Zendikar again. But now, while others around her prepare to go to battle to save the world, Nissa feels the emptiness all around her and worries that they are already too late, that there is no world left to save.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
It happened more at twilight than any other time. A long, dark shape would move. A branch would stretch or bend. Nissa would catch it out of the corner of her eye and she would be sure—for just that moment, just that heartbeat—that it was Ashaya, the elemental manifestation of Zendikar's soul, come back just as she knew it would.
#figure(image("006_Nissa's Quest/01.jpg", width: 100%), caption: [Ashaya, the Awoken World | Art by Raymond Swanland], supplement: none, numbering: none)
But then she would turn her head. Why did she always have to turn her head? And she would see that it was just a tree, just the wind, just the long shadows cast by the setting sun. Her breathing would return to normal, her heart would fall into rhythm again, and she would be left alone, sitting cross-legged on the hard ground, in the exact place on the bluff that she had been standing when Zendikar had been torn away from her.
She kept vigil there, returning each day to ground herself, reach into the land, and search for any hint of Zendikar. She was convinced that it was the Eldrazi titan that had taken it, or chased it away, or hurt it; she had seen once before how terribly a titan could hurt Zendikar. But she reasoned that if it were to return, it would return to the place it had last been—and she believed that it would return, she wanted to believe that it would return looking for her. When it did, she would be there. She would always be there for her friend.
But when Nissa reached out, all she ever found was emptiness, the shattered pieces of a shell. Zendikar never reached back. In place of its embrace, she was met with a frigid chill that worked its way up through her bones as night settled in.
The darkness and the cold meant it was time to head back up into her perch in the nearby massive willow. It wouldn't do Zendikar or anyone else any good if she nodded off and was consumed by an Eldrazi in the middle of the night.
She often considered going back to Sky Rock each night. There was something alluring about the security offered by Gideon's sky patrols, not to mention the protection of the formidable Planeswalker himself. But the allure didn't outweigh the drawback. If the others saw her again, she'd have to try one more time to explain—and she couldn't bear the thought of exposing her hurt only to face the skeptical looks and questions yet again.
She had tried to explain it to them, all of them. She had tried to explain it to Gideon, and then later to his friend and fellow Planeswalker Jace. She had told them that something horrible had happened to Zendikar's soul. It had been ripped away from her. She had lost her friend, and her access to the overwhelming well of power that flowed through the land.
But neither Jace nor Gideon seemed to understand, nor did anyone else—though Jace had been, at the very least, curious about her "perception of the world," as he called it. But the thing was, it wasn't her perception; Zendikar's soul was real. As were the souls of other planes; Nissa had felt them, she'd even communicated with Lorwyn's soul. But that kind of thing was difficult, if not impossible, to explain in words. The concept of a world having a soul was so foreign that it was easy for others to write her off, dismiss the truth as a single elf's "perception."
Nissa didn't blame Gideon or Jace, or any of the others. They didn't see things as she did. When they looked at Zendikar, they saw trees, rocks, brambles, beasts, rivers, and mountains. But they saw each of these things as distinct and disconnected elements. They didn't perceive the underlying bond. They were blind to the powerful leylines that connected every living thing on the world like a network of arteries, pumping power and promise from one beating heart to the next. They were deaf to the voice of the world that whispered and shouted and laughed and sometimes even cried out in pain. They could not see how truly alive Zendikar was . . . or used to be.
#figure(image("006_Nissa's Quest/02.jpg", width: 100%), caption: [Zendikar's Roil | Art by <NAME>ley], supplement: none, numbering: none)
It wasn't anymore.
When Nissa looked at the world now, she too only saw broken sticks, fallen leaves, and tangled branches thick with thorns. She could no longer see the whole, she couldn't feel the oneness. She could not hear the voice of her friend.
The dullness of the world around her screamed reality. It made her memories feel like dreams, the fanciful perceptions of an elf.
If those dreams had ever been real, they were not real anymore.
"Are you really gone?" Nissa didn't want to believe it. There was something that told her that it couldn't be true. Yet . . . she lowered her hand, fingers outstretched, ever so slowly down toward the surface of the ground. She held her breath and touched the dirt.
But that's all it was: dirt.
If Zendikar's soul was gone, if the Eldrazi titan had destroyed it, then all of this dirt, all the brambles, and branches, and beasts, would soon be gone too. A world without a soul would not be a world for long.
Her other hand at her chest, Nissa clutched the silk packet of seeds given to her by the vampire what seemed like ages ago. If this was truly the end for Zendikar, then these seeds were exactly what the vampire had said they were: the world's last hope of enduring. On another plane.
Nissa swallowed, but the hot lump in the back of her throat worked its way up behind her cheeks anyway. She closed her eyes as a single tear trailed down the side of her face.
She held the seeds tighter. She had been so sure that she would prove the vampire wrong—no, she had been so sure that #emph[together ] she and Zendikar would prove the vampire wrong. She had promised the seeds that she would plant them here on their own world's soil when it was safe, when the Eldrazi threat had been eliminated, when they could grow into tall, strong trees and weave their lives in with Zendikar's soul.
But Zendikar's soul was gone. It was gone. How many more times would she have to reach out into the void to be convinced of it?
#emph[It's gone] . She forced the words into her mind. #emph[Zendikar is gone!]
Some part of her still refused to believe it.
She knew that all the evidence—everything she had seen, felt, and heard—said it was true, but somehow she couldn't believe.
Nissa opened her eyes to the twilit world of long shadows. Tonight, none of them were Zendikar, but one night, one of them might be. If it were to come back, this is where the world's soul would come.
So she would stay.
"Run!" The shrill voice of a goblin from behind startled Nissa.
Instinctively, she jumped to her feet and drew her sword.
"Run!" the goblin cried. It was barreling toward her, moving at a surprising speed considering one of its back legs appeared to be broken—or maybe even partially amputated, Nissa couldn't tell. "Run, now!"
#figure(image("006_Nissa's Quest/03.jpg", width: 100%), caption: [Chasm Guide | Art by <NAME>oss], supplement: none, numbering: none)
Nissa sidestepped as the goblin blew by her.
And then, in the distance, she saw the stampede. There were at least three dozen Eldrazi. Small, no bigger than the stump of a tree. They moved so quickly that each of the monsters looked like a hard, bony insect being carried along on a blurred cloud of dust that was its legs.
They navigated nimbly through the forest, coming straight for her, straight for the clearing—Zendikar's clearing.
She could not allow them to touch this place. She could not allow them to corrupt a single piece of grass.
She tightened her grip on the hilt of her sword—it was the only weapon she had. It would have to be enough; she would make it enough. She stepped forward to stand between the precious piece of land and the monsters.
They were so close that she could smell them now.
Disgustingly fleshy, scurrying creatures. They were never part of the oneness that was Zendikar.
The leader of their pack set its course straight for Nissa.
All of the pain and destruction here, it was all their fault.
They came in range.
Nissa swung her blade.
The steel hit the bony plate of the first Eldrazi, and Nissa powered straight through to the sinew underneath, slicing the miniature monster in half.
A beat later she pivoted and carried her momentum with her through her sword and into the head of a second Eldrazi.
#figure(image("006_Nissa's Quest/04.jpg", width: 100%), caption: [Sword of the Animist | Art by <NAME>], supplement: none, numbering: none)
Nissa hated these creatures.
She hated them so much she could squeeze each of their necks until their heads popped off.
She hacked and chopped at the horde as it surrounded her. They seemed to have forgotten about the goblin quarry they had been pursuing. Good. Then they would have no reason to tear through the clearing after it.
Nissa spun in a circle, blade out, severing no less than four bodies from their wriggling, scrambling legs.
One managed to latch onto her own leg. It scampered up, pulling on the fabric of her skirts, digging its sharp, pointed nubs of feet into her flesh.
"Get off me!" Nissa grabbed the thing by its bony back and ripped its legs out of her thigh. She launched it straight at a nearby tree with so much force that when it hit, its bony plate shattered and its insides splattered against the bark.
She didn't have time to watch the monster drip down the trunk; there were dozens more.
#figure(image("006_Nissa's Quest/05.jpg", width: 100%), caption: [Swarm Surge | Art by <NAME>], supplement: none, numbering: none)
If Ashaya had been there, the elemental would have stomped on them with one massive foot, taking out the whole swarm with a single thrust.
If Nissa could have reached Zendikar's well of power, she would have called up great walls of land to snap shut on them, crushing the whole lot in the space of a breath.
But as it was, she was only one, and she only had her sword. She choked up on the hilt and swung again and again and again.
It seemed they would never stop coming.
A caution tugged on the corner of her mind, the same caution that had been dancing at the edge of her awareness for the past few days any time she faced an Eldrazi. If it came to it, if she couldn't destroy the Eldrazi and she couldn't escape—then she would have to go. She would have to planeswalk away before their corruption touched her. She could not allow for the seeds to be turned to white, chalky dust in her pocket. Not if they were Zendikar's last hope.
Her insides tensed and the edges of her form tingled. Her body was prepared to planeswalk. All she would have to do was release her hold on this world, this place, and she could leave.
But leaving would mean that it was over.
And Nissa wasn't ready for this to be the end. Not yet.
She thrust her blade at two of the nearest Eldrazi, skewering the pair through their chests; at the same time, she kicked a third away from her legs, but the swarm only thickened.
The prickling intensified. Nissa's instincts were telling her that this wasn't a battle she would win easily.
She somersaulted out of the way of a fourth and punched a fifth in its underside, using the ricochet to catapult herself over three more that had come too close.
The trilling had worked its way up to a resonant frequency, and it tugged at the pit of her stomach.
No. Not yet.
She could still win this. She hacked down two more.
And then another four.
But eight more closed in.
She could feel the weight of the seeds in her pocket.
#emph[Are you really gone?]
There was no answer. Of course there was no answer.
She glanced back over her shoulder at the clearing.
Then, with a zip and a metallic clanging, a hook on a chain rushed past her and plunged into one of the Eldrazi, which—now that she saw it—looked like it was about to pounce.
The chain was yanked, pulling the hook back, and Nissa followed it to a broad-chested kor. He was holding one hook in each hand. Hedron tattoos glowed on his arms and forehead, illuminating his hard-cut facial features and the long bundle of barbels that hung from his chin like a beard. "I'll take this group, you focus on that bunch on the right."
Nissa nodded, turning her attention to the handful left to her. There were only five. That was manageable, even for just one elf. This would not be the end. She pushed the impatient tingling away from the edges of her being. She would not have to leave this world, not tonight.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
When both Nissa and the kor were satisfied that there were no Eldrazi left, he turned to her, wiping the Eldrazi gore off his hooks. "You didn't happen to have seen a goblin pass through here, did you?"
"She went that way." Nissa pointed to the trees on the other side of the clearing. The beautiful, uncorrupted clearing.
"And I take it she's the one who brought the swarm with her."
Nissa sheathed her sword. "You could say that."
"I warned her. How many times do you have to tell a goblin to take it slow in order to get it through its thick skull?" The kor walked straight across the land where Zendikar had fallen and toward the trees where Nissa had pointed, but he didn't seem to see the trail the goblin had left behind; he was already wandering off course.
"I don't think goblins understand the meaning of 'slow,' " Nissa said. "And it's more that way." She crossed the clearing too, not taking a single step on the uncorrupted ground for granted. She pointed down at the packed underbrush where the goblin had run through, dragging her injured leg. "See?"
"Ah, right," the kor said, adjusting his course. "On both counts. You must be one of Gideon's rangers."
A ranger. Nissa hadn't considered herself a ranger for what felt like a very long time. An animist, a nature mage, a part of Zendikar. But not a ranger. Now that seemed to be the only thing she could claim to be. "Something like that," she said.
"Gideon's lucky to have someone like you out patrolling," the kor said as he traced the goblin's path. "So is Pili. Don't think she would have handled that swarm with quite the same . . . finesse as you did." He smiled, his glowing hedron tattoos lighting his sharp features. "I'm Munda, one of Gideon's squad leaders. Usually you wouldn't find me chasing around stray goblins, but tonight I drew the short straw."
#figure(image("006_Nissa's Quest/06.jpg", width: 100%), caption: [Munda, Ambush Leader | Art by Johannes Voss], supplement: none, numbering: none)
"Oh." Nissa said. The kor, Munda, was slightly off course again. The trail was harder to follow here. They were walking across hard, rocky ground now, which was significantly less revealing than soft dirt or leaves. "To your left."
Munda shifted course.
Nissa wasn't sure when she had agreed to help Munda track Pili, but here she was, a ranger again.
"She came in with the new recruits today," Munda said, nodding ahead, indicating the lost goblin. "Raving from the moment the healers fixed her up enough for her to regain consciousness. Something about her friend, Leek. Another goblin, I assume. From what I was able to get out of her, the two were separated at Sea Gate. She was picked up by the Dojir Nomads on their way over from the Calcite Flats. The other goblin, Leek, was most likely lost. But this Pili, she has it in her head that he's out there. I told her nothing is left at Sea Gate."
Nissa knew what it was like to feel something that no one else could understand.
"Did you see the numbers we got though?" Munda went on. "I didn't know there were that many outcasts at the Calcite Flats. Ah, but Gideon—Commander-General Jura, that is—he says they're not outcasts at all. We're all in this together. And so as soon as they stepped foot on Sky Rock, they were no longer the Dojir Nomads, they were part of our army. It's as simple as that. That man's something else." Munda scratched the barbels on his chin. "You might be surprised, but I knew him before all this."
His look indicated he was expecting some sort of reaction from Nissa. "Oh," she said. Most of her attention was focused on the goblin's tracks. They were headed in the direction of Sea Gate, just as Munda had predicted. Nissa wanted the goblin to be right, but she didn't see how Pili could be. Nothing was left at Sea Gate, she had seen it herself.
"We battled together, Gideon and me," Munda said. "Quite a number of times. Our paths would invariably cross, as neither of us shied away from taking on the biggest of the monsters."
"Oh," Nissa said again.
"That was before Sea Gate fell, of course. Now taking on one of the big ones is just considered foolish. Save yourself, because we need you for the fight that's coming, you know?"
Nissa nodded obligingly.
"Gideon's right," Munda said. "We need every single man, woman, and child this world has to offer if we hope to stand a chance. That's one of the reasons I'm tracking down this goblin. Pili's a fighter. Obvious by her spirit. We especially need the fighters. We all have to band together. It's now or never. As one, we'll reclaim Sea Gate. And from there, we'll take back Zendikar."
Nissa's breath hitched. She almost spun on the kor, she almost snapped, almost told him that Zendikar wasn't something you could "take back." Zendikar wasn't something that belonged to anyone. Not to the people, not to the Eldrazi, not even to the great Commander-General Jura.
Zendikar, the real Zendikar, was simultaneously bigger than anything they could imagine and so much more intimate than they could ever understand.
She almost told him that when they cried out—"For Zendikar!"—they didn't know what they were saying. She almost told him. And then she heard the sobs of a goblin.
Sitting at what was clearly the recently exposed mouth of a hidden, underground cave was the small form of the injured goblin.
"I told you to slow down," Munda's voice boomed. "You would have been devoured if it wasn't for—" he broke off when he saw her tears.
Nissa knelt at the goblin's side and rested her hand on Pili's heaving shoulder.
"Leek." The name came out on a sob.
Nissa looked to the hole in the ground.
"Hello?" A voice came up from below. It was weak and quiet. "Help. Please."
Pili sobbed again. "Leek." She shook her head.
Nissa looked to Munda. "Keep an eye on her. I'll be right back."
Munda nodded, though he didn't move any closer. He seemed out of his element in the presence of this small, sobbing creature.
Nissa climbed down through a tight tunnel that ended at a nearly-complete cave-in. There was the smallest sliver of an opening at the top. She reached to her belt for a flint and struck it against the wall. Holding the flame to the opening, Nissa could make out what at first looked like a hundred little glowing lights. But as her vision adjusted, Nissa saw the lights were eyes, those belonging to a large group of goblins.
"Help," one of them said weakly.
"Munda!" Nissa called up. "We're going to need some rope. And those hooks." She looked back at the goblins. "None of you is Leek, are you?"
Collectively, they bowed their heads. One of them pointed back to the far corner. Three bodies were lined up against the wall. "Oh," Nissa said. Her heart broke for Pili; the goblin had been so close.
With careful work and patience the cave-in was cleared away—Nissa could have done it in a heartbeat had she had access to her powers—and the goblins made their way out.
Munda was pleased at the size of the goblin army they had uncovered, and as he helped arrange for the injured to be carried back to Sky Rock by the others, he told them of Commander-General Jura and the plan to reclaim Sea Gate. He had the attention of most in their numbers. But Pili sat off to the side, alone.
Nissa approached slowly and knelt at the goblin's side.
For a long moment they just sat there in the dark in silence. Then the goblin inhaled deeply. "They said he was gone." She shook her head. "But I knew he went to the safe place. I knew." She pounded her fist into the dirt. "I should have been faster."
"It's not your fault," Nissa said.
The goblin gestured at her injured leg, which was now roughly bandaged and bound. "I should have run faster." She pounded the dirt again, and then once more, and then the tears came.
Nissa had never hugged a goblin before. It had been a long time since she had hugged anyone. But it seemed like the thing she was supposed to do. She understood Pili's pain. She understood what it was like to hurt on the inside. Hurt in a way, in a place, that no one could see or reach or fix. This was the kind of pain that existed in deep wells and came crashing down in overwhelming waves. Waves that worked their way up from an endless sea. Waves that would never stop crashing. Sometimes they would be rough, and sometimes they would be muted. But they would never stop beating against the shore.
Nissa squeezed Pili around the shoulders and waited for this wave to pass.
"They said he was gone." Pili said, wiping her tears. "But I knew." She hit her fist to her chest. "I knew here." She pounded her chest again. "Here!" She stood up. "I knew!" She spun around to face Nissa, her eyes narrowing as her sorrow turned to vengeance. "The monsters will pay for making him run. They will pay!" She stormed off to join the others, to listen to Munda's message.
Nissa's heart thudded in her ears, an echo of the pounding of Pili's fist on her heart.
It was just like Pili had said. Nissa touched her own chest. She knew. She knew just like the goblin. That's why she couldn't leave when her life was threatened, she couldn't planeswalk away even when she was surrounded by Eldrazi. That's why she kept vigil. That's why she refused to listen even when her mind told her that it was gone.
Zendikar was there. It was like a word on the tip of her tongue.
But where?
There was not a place where the world's soul went when it was scared or when it needed to regroup. Or when it was hurt.
No secret hideaway, or tunnel, or cave, or—
Nissa was on her feet, the edges of her being scintillating, ready to planeswalk before her mind had even caught up with what her heart knew.
There was a place. A safe place, a powerful place. A place that Zendikar could have retreated to.
Khalni Heart.
#figure(image("006_Nissa's Quest/07.jpg", width: 100%), caption: [Khalni Heart Expedition | Art by Jason Chan], supplement: none, numbering: none)
The expression of Zendikar's mana. The spot where all the leylines converged. If something had happened, if the titan had threatened the world's soul, that's where it would have run to. That's where it would be hiding.
Khalni Heart.
Zendikar was still here, just as Nissa had known all this time. It just wasn't #emph[here. ] Of course it wasn't here. Why would it come back to the forest where the horrible thing had happened? She had been looking in the wrong place all this time.
She laughed aloud and her heart lifted; she had forgotten what it felt like for her heart to be free and light enough to lift. The tingling came back, tugging on her again, pulling her from the inside. But not to another plane. This time to—
"Crazy elf."
The murmuring voice of a staring goblin brought Nissa back toward reality, back toward this forest where her feet were grounded—though not all the way. She had forgotten the goblins, and Pili and Munda, and Gideon and Jace, and even the Eldrazi. She had forgotten everything but Zendikar.
"I have to go," she said to no one and everyone at the same time. It was all she could do to run into the forest out of their line of sight.
From the trees of the Vastwood, Nissa set her sights on Bala Ged.
How fitting a destination that was—the place where she had met the world's soul for the first time. All the memories flooded back. It was like she was there again. It was like she was that young elf—that Joraga ranger—again. This night was like the night she had left her home so long ago. She had snuck out in the cover of darkness. She had made her way alone through the forest.
The difference was that back then she had been running away because she was scared of Zendikar—she had thought the land wanted to hurt her. This time she was running straight toward it. She couldn't wait to see it again; Zendikar was her closest friend.
Trembling, Nissa let go of the Vastwood; she stopped fighting the tugging, and the tingling at her edges worked its way inward. When it reached her center, Nissa planeswalked away—back home, back to Bala Ged, to find Zendikar.
#figure(image("006_Nissa's Quest/08.jpg", width: 100%), caption: [Nissa's Expedition | Art by <NAME>], supplement: none, numbering: none)
|
|
https://github.com/ludwig-austermann/typst-funarray | https://raw.githubusercontent.com/ludwig-austermann/typst-funarray/main/examples/doc.typ | typst | MIT License | #import "@preview/idwtet:0.3.0"
#set page(header: text(gray, 9pt)[`funarray` package documentation])
#show: idwtet.init.with(
code-font-size: 11pt,
eval-scope: (
funarray: (
value: {import "../funarray.typ" as funarray; funarray},
code: "#import \"@preview/funarray:0.3.0\""
)
))
= `funarray` Package
This package provides some convinient functional functions for typst to use on arrays. Let us import the package and define
```typst
#import "@preview/funarray:0.3.0"
```
== chunks
The chunks function translates the array to an array of array. It groups the elements to chunks of a given size and collects them in an bigger array.
```typst-ex-code
let a = (1, "not prime", 2, "prime", 3, "prime", 4, "not prime", 5, "prime")
funarray.chunks(a, 2)
```
== unzip
The unzip function is the inverse of the zip method, it transforms an array of pairs to a pair of vectors.
```typst-ex-code
let a = (
(1, "not prime"),
(2, "prime"),
(3, "prime"),
(4, "not prime"),
(5, "prime"),
)
funarray.unzip(a)
```
== cycle
The cycle function concatenates the array to itself until it reaches a given size.
```typst-ex-code
let a = range(5)
funarray.cycle(a, 8)
```
Note that there is also the functionality to concatenate with `+` and `*` in typst.
== windows and circular-windows
This function provides a running window
```typst-ex-code
let a = range(5)
funarray.windows(a, 3)
```
whereas the circular version wraps over.
```typst-ex-code
let a = range(5)
funarray.circular-windows(a, 3)
```
== partition and partition-map
The partition function seperates the array in two according to a predicate function. The result is an array with all elements, where the predicate returned true followed by an array with all elements, where the predicate returned false.
```typst-ex-code
let a = (
(1, "not prime"),
(2, "prime"),
(3, "prime"),
(4, "not prime"),
(5, "prime"),
)
let (primes, nonprimes) = funarray.partition(a, x => x.at(1) == "prime")
primes
```
There is also a partition-map function, which after partition also applies a second function on both collections.
```typst-ex-code
let a = (
(1, "not prime"),
(2, "prime"),
(3, "prime"),
(4, "not prime"),
(5, "prime"),
)
let (primes, nonprimes) = funarray.partition-map(
a,
x => x.at(1) == "prime",
x => x.at(0)
)
primes
```
== group-by
This functions groups according to a predicate into maximally sized chunks, where all elements have the same predicate value.
```typst-ex-code
let f = (0,0,1,1,1,0,0,1)
funarray.group-by(f, x => x == 0)
```
== flatten
Typst has a `flatten` method for arrays, however that method acts recursively. For instance
```typst-ex-code
(((1,2,3), (2,3)), ((1,2,3), (1,2))).flatten()
```
Normally, one would only have flattened one level. To do this, we can use the typst array concatenation method `+`, or by folding, the `sum` method for arrays:
```typst-ex-code
(((1,2,3), (2,3)), ((1,2,3), (1,2))).sum()
```
To handle further depth, one can use flatten again, so that in our example:
```typst-ex-code
(
((1,2,3), (2,3)), ((1,2,3), (1,2))
).sum().sum() == (
((1,2,3), (2,3)), ((1,2,3), (1,2))
).flatten()
```
== take-while and skip-while
These functions do exactly as they say.
```typst-ex
#let f = (0,0.5,0.2,0.8,2,1,0.1,0,-2,1)
#funarray.take-while(f, x => x < 1)
#funarray.skip-while(f, x => x < 1)
```
== accumulate and scan
These functions are similar to `fold`, but produce again arrays and do not reduce into one final value.
Compare
```typst-ex
#let a = (1,) * 10
#a.fold(0, (acc, x) => acc + x)
#funarray.accumulate(a, 0, (acc, x) => acc + x)
#funarray.scan(a, (0, 0), (acc, x) => {
let s = acc.sum() + x
((acc.at(1), s), s)
})
```
`accumulate` gives us also intermediate results compared to `fold`. Scan is even more flexible, by simulating mutable state (here `acc`), we can look e.g. back 2 states.
The signatures are as follows
#table(
columns: 3,
[*Function*], [*Signature*], [*Accumulators $cal(A)$*],
[`fold`], $B^n times A times cal(A) -> A$, $f : A times B -> A$,
[`accumulate`], $B^n times A times cal(A) -> A^n$, $f : A times B -> A$,
[`scan`], $B^n times A times cal(A) -> C^n$, $f : A times B -> A times C$,
)
where $B^n$ is the inputed array and $A$ our initial value/state.
== unfold and iterated
These functions can be used to construct array. `iterated` applies a function multiple times, so that
```typst-ex-code
funarray.iterated(1, x => 2*x, 10)
```
We provided a initial value, a function and the length of the resulting array. Similarly, but more powerful is `unfold`
```typst-ex-code
funarray.unfold((1, 1), x => {
let next = x.sum()
((x.at(1), next), x.at(0))
}, 10)
```
Here we created the first fibonacci numbers by passing the previous two values as state.
The signatures are as follows
#table(
columns: 3,
[*Function*], [*Signature*], [*Argument Functions $cal(F)$*],
[`iterated`], $A times cal(F) times {n} -> A^n, space.med n in NN$, $f : A -> A$,
[`unfold`], $A times cal(F) times {n} -> B^n, space.med n in NN$, $f : A -> A times B$,
)
where $A$ is the initial value/state.
= Unsafe functions
The core functions are defined in `funarray-unsafe.typ`. However, assertions (error checking) are not there and it is generally not being advised to use these directly. Still, if being cautious, one can use the imported `funarray-unsafe` module in `funarray(.typ)`. All function names are the same.
To do this from the package, do as follows:
```typst-ex
#funarray.funarray-unsafe.chunks(range(10), 3)
``` |
https://github.com/michaelvanstraten/michaelvanstraten | https://raw.githubusercontent.com/michaelvanstraten/michaelvanstraten/master/resume.typ | typst | #import "@preview/modern-cv:0.6.0": *
#show: resume.with(
author: (
firstname: "Michael", lastname: "<NAME>", email: "<EMAIL>", github: "michaelvanstraten", birth: "June 9, 2004", positions: ("Systems Architect", "Full-stack Software Engineer",),
), date: datetime.today().display(), colored-headers: false, show-footer: true,
)
= Experience
#resume-entry(
title: "Storage Infrastructure Student Worker", location: "Berlin, Germany", date: "October 2023 - Present", description: "Mozilla Corp.", title-link: "https://phabricator.services.mozilla.com/p/mvanstraten/",
)
#resume-item[
- Leading a project to implement a new tracing system in the Gecko Browser engine
- Worked extensively on mission-critical, low-level C++17 components
- Gained expertise in designing and implementing highly performant, multi-process
systems
]
#resume-entry(
title: "Independent Software Engineer", location: "Remote", date: "July 2022 - October 2023", description: "Specialized in Machine Learning and IoT/Mobile Development",
)
#resume-item[
- Advised clients on implementing fundamental machine learning algorithms
- Developed IoT applications using ESP-IDF in C
- Built mobile applications in Flutter with Bluetooth Low Energy integration
- Developed full-stack web applications
]
#resume-entry(
title: "Web Designer/Developer", location: "Falkensee, Germany", date: "October 2018 - July 2021", description: "msFaktura", title-link: "https://www.msfaktura.de/",
)
#resume-item[
- Enhanced internally developed software solutions
- Designed and developed numerous WordPress applications using PHP
]
#resume-entry(
title: "Full-stack Web Developer", location: "Remote", date: "2016 - Present", description: "The Family of Music",
)
#resume-item[
- Site Reliability Engineer (SRE) for various services, including WordPress and
custom Go applications
- Designed and integrated a large e-commerce platform with over 6,000 products
- Developed custom Go applications for email marketing strategies
]
= Projects
#resume-entry(
title: "SwiftyRedis", location: [#github-link("michaelvanstraten/swifty-redis")], date: "Summer 2022",
)
#resume-item[
- Developed a robust, versatile asynchronous Redis library for Swift, officially
listed as a Redis Client
]
#resume-entry(
title: "Actix Web JWT Authentication Library", location: [#github-link("michaelvanstraten/actix-jwt-auth-middleware")], date: "April 2022",
)
#resume-item[
- Created a popular JSON Web Token (JWT) authentication library for the Actix Web
framework
]
#resume-entry(
title: "Simple Neural Network Framework (No Dependencies)", location: [#github-link("michaelvanstraten/simple-net")], date: "Winter 2019",
)
#resume-item[
- Developed a custom neural network framework to understand the underlying
mathematics and implementation
- Supports multiple feedforward layers with a custom gradient descent algorithm
]
= Skills
#resume-skill-item(
"Languages", (
strong("Rust"), strong("Python"), strong("Swift"), "Nix", "C++", "Go", "PHP", "TypeScript", "JavaScript",
),
)
#resume-skill-item(
"Technologies", (
strong("Git"), strong("Redis"), strong("NixOS"), "Machine Learning", "Kubernetes", "WebAssembly",
),
)
= Education
#resume-entry(
title: "Humboldt-Universität zu Berlin", location: "Berlin, Germany", date: "October 2023 - Present", description: "Bachelor of Science in Mathematics",
)
#resume-entry(
title: "Gesamtschule <NAME>", location: "Falkensee, Germany", date: "September 2020 - April 2023", description: "Allgemeine Hochschulreife (High School Diploma)",
)
|
|
https://github.com/EpicEricEE/typst-droplet | https://raw.githubusercontent.com/EpicEricEE/typst-droplet/master/src/split.typ | typst | MIT License | #import "util.typ": attach-label, space, splittable
// Joins the given children into a single content.
//
// If the children list is empty, an empty content is returned instead of none.
#let join(children) = {
if children.len() == 0 {
[]
} else {
children.join()
}
}
// Gets the number of breakpoints in the given content.
//
// A breakpoints must always be at a space. For example, the sequece
// ([Hello], [ ], [my world!])
// has two inner breakpoints:
// 1. ([Hello],) - ([my world!],) - (sep: [ ])
// 2. ([Hello my],) - ([world!],) - (sep: " ")
//
// Returns: The number of breakpoints.
#let breakpoints(body) = {
if type(body) == str {
body.split(" ").len() - 1
} else if body.has("text") {
breakpoints(body.text)
} else if body.has("child") {
breakpoints(body.child)
} else if body.has("children") {
body.children.map(breakpoints).sum(default: 0)
} else if body.func() in splittable {
breakpoints(body.body)
} else if body.func() in (space, linebreak, parbreak) {
1
} else {
0
}
}
// Splits the given content at a given breakpoint index.
//
// Content is split at spaces. A sequence can be split at any of its childrens'
// breakpoints (spaces), but in general not between children.
//
// Returns: A tuple of the first and second part.
#let split(body, index) = {
// Shortcut for out-of-bounds indices.
if index > breakpoints(body) {
return (body, none, none)
}
if index < 0 {
return split(body, calc.max(0, breakpoints(body) + index + 1))
}
// Handle string content.
if type(body) == str {
let words = body.split(" ")
let first = words.slice(0, index).join(" ")
let second = words.slice(index).join(" ")
return (first, second, " ")
}
// Handle text content.
if body.has("text") {
let (text, ..fields) = body.fields()
if "label" in fields { fields.remove("label") }
let label = if body.has("label") { body.label }
let func(it) = if it != none { body.func()(..fields, it) }
let (first, second, sep) = split(text, index)
return (..attach-label((func(first), func(second)), label), sep)
}
// Handle content with "body" field.
if body.func() in splittable {
let (body: text, ..fields) = body.fields()
if "label" in fields { fields.remove("label") }
let label = if body.has("label") { body.label }
let func(it) = if it != none { body.func()(..fields, it) }
let (first, second, sep) = split(text, index)
return (..attach-label((func(first), func(second)), label), sep)
}
// Handle styled content.
if body.has("child") {
let (child, styles, ..fields) = body.fields()
if "label" in fields { fields.remove("label") }
let label = if body.has("label") { body.label }
let func(it) = if it != none { body.func()(it, styles) }
let (first, second, sep) = split(child, index)
return (..attach-label((func(first), func(second)), label), sep)
}
// Handle sequences.
if body.has("children") {
let first = ()
let second = ()
let sep = none
// Find child containing the breakpoint and split it.
let sub-index = index
for (i, child) in body.children.enumerate() {
let child-breakpoints = breakpoints(child)
// Check if current child contains splitting point.
if sub-index <= child-breakpoints {
if child.func() not in (space, linebreak, parbreak) {
// Push split child (skip trailing spaces)
let (child-first, child-second, child-sep) = split(child, sub-index)
first.push(child-first)
second.push(child-second)
sep = child-sep
} else {
sep = child
}
second += body.children.slice(i + 1)
break
}
sub-index -= child-breakpoints
first.push(child)
}
return (join(first), join(second), sep)
}
// Handle unbreakable content.
return if index == 0 { (none, body, none) } else { (body, none, none) }
}
|
https://github.com/protohaven/printed_materials | https://raw.githubusercontent.com/protohaven/printed_materials/main/common-tools/spindle_sander.typ | typst |
#import "../environment/env-protohaven-class_handouts.typ": *
= Spindle Sander
== Usage Notes
=== Safety
- Keep fingers a minimum of three inches from moving abrasive surfaces
- Do not sand on the up (right) side of the disk sander
- Position the workpiece so that it will not kick back during sanding
- Sand with the direction of the grain
- Do not use to sand work that is too small to properly support or large work that is improperly supported
- Thin stock may be pulled into the gap between the abrasive and the support table. Keep thin stock flat against the table, or perpendicular to the table.
=== Care
- Allow abrasive to sand at it’s own pace. Don’t force it
- Alert a staff member if the abrasive is overworn
- Submit a maintenance request when needed
// Make maintantence requests an inclusion?
=== Cleanup
- Sweep the floor and vacuum debris
- Recycle waste in the scrap bin
- Empty scrap bin and dust collection when full
== Parts of the Spindle Sander
=== Table
- the workpiece should be supported by the table at all times
== Resources
|
|
https://github.com/SkiFire13/eh-presentation-shellcode | https://raw.githubusercontent.com/SkiFire13/eh-presentation-shellcode/master/task1.d.typ | typst | #import "@preview/polylux:0.3.1": *
#import "unipd.typ": *
#new-section[ Task 1.d ]
#slide[
- Extend task 1.b to execute:
#align(center, `/usr/bin/env`)
- And pass it some environment variables:
#align(center, ```
aaa=1234
bbb=5678
cccc=1234
```)
]
#new-section[ Task 1.d: Solution ]
#slide[
#let left = ```asm
; Setup command
xor eax, eax
push eax
push "/env"
push "/bin"
push "/usr"
mov ebx, esp
; Construct the argument array argv[]
xor eax, eax
push eax ; argv[1] = 0
push ebx ; argv[0] points "/usr/bin/env"
mov ecx, esp
; Setup environment strings
xor eax, eax
push eax
push "1234"
push "aaa=" ; "aaa=1234"
push eax
push "5678"
push "bbb=" ; "bbb=5678"
```
#let right = ```asm
mov eax, "###4"
shr eax, 24
push eax
push "=123"
push "cccc" ; "cccc=1234"
mov edx, esp
; Construct the environment array
xor eax, eax
push eax ; env[3] = 0
push edx ; env[2] points "cccc=1234"
lea eax, [edx + 12]
push eax ; env[1] points "bbb=5678"
lea eax, [edx + 24]
push eax ; env[0] points "aaa=1234"
mov edx, esp
; Invoke execve()
xor eax, eax ; eax = 0x00000000
mov al, 0x0b ; eax = 0x0000000b
int 0x80
```
#text(size: 16pt, grid(columns: (1fr, 1.3fr), column-gutter: 1em, left, right))
]
// TODO: Show stack?
#slide[
#align(center, v(-10%) + scale(x: 90%, y: 90%, image("exe1d.png")))
]
#slide[
#place(center + horizon, v(20%) + scale(x: 85%, y: 85%, image("obj1d.png")))
]
|
|
https://github.com/exdevutem/taller-git | https://raw.githubusercontent.com/exdevutem/taller-git/main/main.typ | typst | #import "template.typ": template
#import "@preview/big-todo:0.2.0": *
#show: template
= ¿Qué es Git?
Es un software FOSS #footnote[Free and Open Source Software, o Software libre y de código abierto.] de control de versiones, creado por <NAME> #footnote[También conocido por la creación del Kernel de Linux.]. Un software de control de versiones es un tipo de software que maneja los cambios que se le ha hecho a algún grupo de archivos, lo que nos permite mantener un control de 'qué', 'cómo' y 'cuándo' fue generado un cambio, además de el 'quién' lo ha hecho. Además, permite retroceder cambios hechos, en caso de necesitarse.
= Términos importantes <terminos>
- *Directorio*, también conocido como 'carpeta' en Windows.
- *Terminal o Línea de Comandos*, como una interfaz para introducir comandos de texto.
- *CLI*, Command Line Interface, o interfaz de línea de comandos. Comunmente se utiliza para describir programas que sólo existen en una línea de comandos o terminal.
- *Editor de texto*, programa que te permite modificar algún archivo de texto. Estos incluyen programas como Notepad de Windows, VIM o Nano para la terminal, o VSCode, (actualmente) el editor de texto más popular en la programación.
- *Repositorio*, "lugar donde se guarda algo". En el contexto, es la carpeta donde se mantiene un proyecto.
- *Github*, un sitio web que mantiene repositorios de forma Online. Distinto de Git!.
= Comandos de Git importantes <comandos>
- *init*: inicia un repositorio de Git en el directorio actual.
- *clone*: comando que trae un repositorio almacenado de forma online y lo _clona_ hacia algún directorio local.
- *add*: Sigue archivos y cambios en Git.
- *commit*: Guarda tus archivos y cambios en Git.
- *push*: Sube los 'commits' creados a un repositorio remoto, como a GitHub.
- *pull*: Descarga cambios de un repositorio remoto. Es el opuesto de push.
#pagebreak()
#outline(indent: 2em)
#outline(title: [Lista de figuras], target: figure.where(kind: image))
#pagebreak()
#include "src/instalacion.typ"
#include "src/post-install.typ"
#include "src/first-steps.typ"
#pagebreak()
#include "src/branches.typ"
#pagebreak()
#include "src/issues.typ"
#pagebreak()
#include "src/pull-request.typ"
#pagebreak()
#include "src/merge-conflicts.typ"
#pagebreak()
#todo_outline
|
|
https://github.com/mhspradlin/wilson-2024 | https://raw.githubusercontent.com/mhspradlin/wilson-2024/main/understanding-ai/day-3.typ | typst | MIT License | #set page(
paper: "presentation-16-9",
numbering: "1",
number-align: right,
header: locate(loc => {
let elems = query(
selector(heading.where(level: 1)).before(loc),
loc,
)
let has-headers-on-page = query(
selector(heading.where(level: 1)),
loc,
).filter(h => h.location().page() == loc.page())
.len() != 0
if elems == () or has-headers-on-page {
none
} else {
let body = elems.last().body
h(1fr) + emph(body)
}
}
)
)
#set text(size: 30pt)
#set document(title: "Understanding Artificial Intelligence", author: "<NAME>")
= Understanding Artificial Intelligence
#align(center + horizon)[Day Three]
#pagebreak()
= Classifiers
#figure(image("figures/classifier.png", height: 86%))
== Overview
- Classifiers are used to predict what *category* a given data point belongs to
- Spam email, not spam email
- Species of animal
- Very dependent upon domain, no one-size-fits-all
#pagebreak()
== Uses
Many things can be formulated as a classification problem:
- Email spam detection
- Filtering candidates for hiring
- Loan application decisions
- Credit scoring
- Handwriting recognition
#pagebreak()
== Algorithms
There are many classification algorithms, including:
- Decision trees
- K-nearest neighbors
- Naive Bayes
- Support vector machines
- Neural networks
#pagebreak()
== Approach: K-Nearest Neighbors
- Start with a training data set where each data point is labeled with a category
- Compare a new piece of data to the $k$ nearest data points
- Take the category that is in the majority of those $k$
Interactive example:
#align(center)[#link("https://tinyurl.com/knn-demo")]
#align(center)[#link("http://vision.stanford.edu/teaching/cs231n-demos/knn/")]
#pagebreak()
== K-Nearest Neighbors
- Generally very accurate
- Insensitive to outliers
- No assumptions about your data
- Simple to implement and understand
- Computationally expensive#footnote()[Specialized storage, like vector databases, are required for good scaling and performance on large datasets]
- Needs extra tuning if classes are skewed
#pagebreak()
== Accuracy
In the previous slide, we said that the algorithm is generally very *accurate*. Accuracy for classifiers is oftem measured using a *confusion matrix*.
#pagebreak()
== Confusion Matrix
#table(columns: (1fr, 1fr, 1fr), rows: (80pt, 100pt, 100pt), align: center + horizon, inset: 5pt,
[], [Predicted Negative], [Predicted Positive],
[Actual Negative], [True Negative], [False Positive],
[Actual Positive], [False Negative], [True Positive])
#pagebreak()
== Confusion Matrix: Example
Hypothetical classifier for "cancer" (1) or "no cancer" (0):
#table(columns: (auto, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr), align: center + horizon,
[Individual Number], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12],
[Actual Classification], [1], [1], [1], [1], [1], [1], [1], [1], [0] , [0] , [0], [0]
, [Predicted Classification] , [0] , [0] , [1] , [1] , [1] , [1] , [1], [1], [1] , [0], [0], [0])
#table(columns: (1fr, 1fr, 1fr), rows: (40pt, 40pt, 40pt), align: center + horizon, inset: 5pt,
[], [Predicted Negative], [Predicted Positive],
[Actual Negative], [], [],
[Actual Positive], [], [])
== Accuracy
There are many accuracy measurements. A basic one is:
$ "Accuracy" = ("True positives" + "True negatives") / ("Total") $
It's unwise to rely on this alone. Consider the case when 95% of the data set does not have cancer - classifying *everyone* as negative for cancer would give a 95% accuracy.
#pagebreak()
== $F_1$ Score
Good for when there's class imbalance and false negatives (FN) are especially undesirable:
$ "F"_1 &= (2 * "True positives") / (2 * "True positives" + "False positives" + "False negatives") $
== $phi$ Coefficient (MCC)
$phi$ (phi) or Matthews correlation coefficient (MCC), good general alternative to plain accuracy, especially for impalanced classes.
$ phi &= "MCC" = ("TP" * "TN" - "FP" * "FN") / sqrt(("TP" + "FP")("TP" + "FN")("TN" + "FP")("TN" + "FN")) $
#pagebreak()
== Group Exercise
- Read the provided article
- Split into groups and discuss:
- How was a classifier likely used in this situation?
- How did bias in the data used to train the classification model manifest in the output?
- How could discrimination be detected and avoided?
- We'll then regroup and discuss as a class
#pagebreak()
= Bayesian Statistics
#figure(image("figures/Thomas_Bayes.gif", height: 70%), caption: "The Reverend Thomas Bayes (maybe)")
== Overview
- *Bayesian Statistics* is based on the interpretation of probability as a _degree of belief_ in an event.
- This is different than *frequentist statistics* which interprets probability as how often an event happens if the situation were to occur many times in a row.
- Useful for AI and machine learning because you can update your best guess when new data arrives.
== Bayes' Theorem
#align(horizon)[
$ P(A|B) = (P(B|A) P(A)) / P(B) $ #align(center)[where $P(B) != 0$.]]
#pagebreak()
#grid(columns: (2fr, 1fr), [
#figure(image("figures/sample-space-a-b.svg", height: 100%))
], [
$P(A) = ...$
$P(B) = ...$
$P(A|B) = ...$
$P(B|A) = ...$
$(P(B|A)P(A))/P(B) = ...$
$(P(A|B)P(B))/P(A) = ...$
40 total events
])
#pagebreak()
== Bayes' Theorem: Everyday Example
- Suppose you think there's an 80% chance the belief "my friend is mad at me" is true.
- You get some new information: Your friend texted you to hang out.
- How does your _degree of belief_ change?
#pagebreak()
$ P(A|B) = (P(B|A) P(A)) / P(B) $
$P(A) &= 80% = "Prior probability" \
P(B) &= 90% = "Marginal probability" \
P(B|A) &= "Odds friend texted you if they are mad" \
&= 40% \
P(A|B) &= (40% * 80%) / (90%) approx 35.6% => "Friend is probably not mad"$
#pagebreak()
= Classifiers
== Approach: Naive Bayes
- Utilize Bayes' Theorem to calculate the *probability* that a data point is one of multiple categories
- Choose the category with the highest probability
#pagebreak()
== Naive Bayes
#grid(columns: (1fr, 2fr),
table(columns: (auto, auto, auto, auto), inset: 10pt, align: center,
[\#], [$a_1$], [$a_2$], [$y$],
[1], [Yes], [Yes], [Yes],
[2], [Yes], [No], [Yes],
[3], [Yes], [Yes], [No],
[4], [No], [Yes], [Yes],
[5], [Yes], [No], [No],
),
text(size: 28pt)[
$
"Pr"&"edicted " y = accent(y, hat) = max_y p(y|bold(x)) \
p(y|bold(x)) &= (p(bold(x)|y) p(y)) / p(bold(x)) prop p(bold(x)|y) p(y) \
p(y) &= ("# of " y) / "Total" = (|y|) / (|X|) \
accent(y, hat) &= max_y (|y| * p(bold(x)|y)) / (|X|)
$
])
#pagebreak()
== Naive Bayes
$p(bold(x)|y)$ is not easy to estimate. We make a *naive* assumption, that all attributes are *independent*.
In probability, if two events $A$ and $B$ are independent, then: $ p(A|B) = p(B|A) = p(A) = p(B) $
$ p(A "and" B) = p(A) * p(B) $
#pagebreak()
== Naive Bayes
A data point is a vector of events combined with an "and":
$
bold(x) &= (a_1, a_2, ..., a_n) \
p(bold(x)) &= p(a_1 "and" a_2 "and" ... "and" a_n) \
&= p(a_1) * p(a_2) * ... * p(a_n)
$
#pagebreak()
== Naive Bayes
If probabilities are *conditioned* on another event, $y$, that ends up getting applied to all the event probabilities:
$
p(bold(x)|y) &= p((a_1, a_2, ..., a_n)|y) \
&= p(a_1|y) * p(a_2|y) * ... * p(a_n|y) \
&= product_(i=1)^n p(a_i|y)
$
== Naive Bayes
$
accent(y, hat) &= max_y (|y|) / (|X|) p(bold(x)|y) = max_y (|y|) / (|X|) * product_(i=1)^n p(a_i|y)
$
Estimating $p(a_i|y)$ is easy:
$
p(a_i|y) = ("# of data points with attribute " a_i "and " y ) / ("Total number of data points with" y)
$
#pagebreak()
== Example
#grid(columns: (1fr, 2fr),
table(columns: (auto, auto, auto, auto), inset: 10pt, align: center,
[\#], [$a_1$], [$a_2$], [$y$],
[1], [Yes], [Yes], [Yes],
[2], [Yes], [No], [Yes],
[3], [Yes], [Yes], [No],
[4], [No], [Yes], [Yes],
[5], [Yes], [No], [No],
),
[
A new data point has $(a_1, a_2)$ and we are predicting if $y$ = Yes or $y$ = No.
])
#pagebreak()
#grid(columns: (1fr, 2fr),
table(columns: (auto, auto, auto, auto), inset: 10pt, align: center,
[\#], [$a_1$], [$a_2$], [$y$],
[1], [Yes], [Yes], [Yes],
[2], [Yes], [No], [Yes],
[3], [Yes], [Yes], [No],
[4], [No], [Yes], [Yes],
[5], [Yes], [No], [No],
),
[
#table(columns: (auto, auto, auto), inset: 10pt,
[], [$y$ = Yes], [$y$ = No],
[$p(a_1="Yes"|y)$], [2/3], [1],
[$p(a_1="No"|y)$], [1/3], [0],
[$p(a_2="Yes"|y)$], [2/3], [1/2],
[$p(a_2="No"|y)$], [1/3], [1/2],)
])
Consider: $x_"new" = (a_1="Yes", a_2="No") = ("Yes", "No")$
#pagebreak()
#grid(columns: (1.3fr, 1fr),
table(columns: (auto, auto, auto), inset: 10pt,
[], [$y$ = Yes], [$y$ = No],
[$p(a_1="Yes"|y)$], [2/3], [1],
[$p(a_1="No"|y)$], [1/3], [0],
[$p(a_2="Yes"|y)$], [2/3], [1/2],
[$p(a_2="No"|y)$], [1/3], [1/2],), [
$x_"new" = ("Yes", "No")$
$p(&y = "Yes"|x_"new") = \
& frac(abs(y="Yes"), abs(X)) product_(i=1)^n p(x_a_i|y="Yes")$
]
)
#text(size: 23pt)[
$ product_(i=1)^n p(x_a_i|y="Yes") &=
p(a_1 = "Yes"|y="Yes") * p(a_2 = "No"|y="Yes") \
&= 2/3 * 1/3 = 2/9 \
p(y = "Yes"|x_"new") &=
(|y="Yes"|)/(|X|) product_(i=1)^n p(x_a_i|y) = 3/5*2/9 = 2/15$
]
#pagebreak()
#grid(columns: (1.3fr, 1fr),
table(columns: (auto, auto, auto), inset: 10pt,
[], [$y$ = Yes], [$y$ = No],
[$p(a_1="Yes"|y)$], [2/3], [1],
[$p(a_1="No"|y)$], [1/3], [0],
[$p(a_2="Yes"|y)$], [2/3], [1/2],
[$p(a_2="No"|y)$], [1/3], [1/2],), [
$x_"new" = ("Yes", "No")$
$p(&y = "No"|x_"new") = \
&(|y="No"|)/(|X|) product_(i=1)^n p(x_a_i|y="No")$
]
)
#text(size: 23pt)[
$ product_(i=1)^n p(x_a_i|y="No") &=
p(a_1 = "Yes"|y="No") * p(a_2 = "No"|y="No") \
&= 1 * 1/2 = 1/2 \
p(y = "No"|x_"new") &=
(|y="No"|)/(|X|) product_(i=1)^n p(x_a_i|y) = 2/5*1/2 = 1/5$
]
#pagebreak()
== Naive Bayes Example
$
p(y="Yes"|x_"new") = 2/15 \
p(y="No"|x_"new") = 1/5 \
$
We choose the max, so we predict $y$ = "No" for $x_"new"$.
|
https://github.com/Sematre/typst-kit-thesis-template | https://raw.githubusercontent.com/Sematre/typst-kit-thesis-template/main/sections/07_appendix.typ | typst | = Appendix
== First Appendix Section
#figure(
image("/assets/logo-kit.svg", width: 50%),
caption: "A figure"
) |
|
https://github.com/EpicEricEE/typst-equate | https://raw.githubusercontent.com/EpicEricEE/typst-equate/master/assets/example.typ | typst | MIT License | #import "../src/lib.typ": equate
#set text(size: 14pt)
#set par(justify: true)
#set page(
width: 11cm,
height: 4cm,
margin: 1em,
background: pad(0.5pt, box(
width: 100%,
height: 100%,
radius: 4pt,
fill: white,
stroke: white.darken(10%),
)),
)
#show: equate.with(breakable: true, sub-numbering: true)
#set math.equation(numbering: "(1.1)")
The dot product of two vectors $arrow(a)$ and $arrow(b)$ can be
calculated as shown in @dot-product.
$
angle.l a, b angle.r &= arrow(a) dot arrow(b) \
&= a_1 b_1 + a_2 b_2 + ... a_n b_n \
&= sum_(i=1)^n a_i b_i. #<sum>
$ <dot-product>
The sum notation in @sum is a useful way to express the dot
product of two vectors.
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/031%20-%20Hour%20of%20Devastation/004_The%20Hour%20of%20Promise.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Hour of Promise",
set_name: "Hour of Devastation",
story_date: datetime(day: 28, month: 06, year: 2017),
author: "<NAME>",
doc
)
#figure(image("004_The Hour of Promise/01.jpg", width: 100%), caption: [Hapatra, Vizier of Poisons | Art by <NAME>son], supplement: none, numbering: none)
#emph["And lo, the three dark divinities returned, and as they felled the gods, the Hour of Promise arrived. And so the great locust god fulfilled the great promise, and thus the Hekma was torn asunder, its protections cast aside before the return of the God-Pharaoh."]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Hapatra stood on the steps of the Temple of Strength, watching the blood of the Luxa seep upriver, transforming the water to crimson as its stain spread. Her arms were crossed tight in front of her chest, and her mouth was a hard line. The other viziers of the temple flanked her on either side, sharing her fixation with the dry riverbed and its crimson stain.
Khufu stood to her right. He was broad-shouldered and bulky, with a patch of gray sneaking across his temples. In a happier moment, Hapatra would have teased him for his age (a ghastly thirty-five), but now all she could do was shake her head.
"We should have news of the new gods' intentions by now," she said. "Where is Iput?"
"Returning swiftly, I'm certain," Khufu said, faith ringing through his voice like a chime.
Hapatra toyed with the pet snake wrapped around her little finger. Earlier, a messenger had come to say that three new gods had appeared, and that one had engaged Rhonas in combat. She wished she could stand alongside Rhonas to greet the newcomers, but the viziers had agreed in the moment that it was best to stay at their temples.
Hapatra pursed her lips. She was as anxious and desperate for news as the rest of her peers. "We should be near Rhonas for the Hour of Glory."
Khufu crossed his arms. "The Hour of Glory is the time when gods and mortals alike will prove their worthiness to enter into the glorious Afterlife."
Hapatra made a small noise of confirmation. "So the new gods will test them first? Then move on to us and the untested initiates?"
Khufu shrugged.
Hapatra shifted from foot to foot, letting her little pet slide from one hand to the other. Her heart beat with anxiety. She knew in her heart that Rhonas's victory would be swift, but waiting for news was proving to be torturous.
"The prophecies have always been unclear about #emph[where ] we were supposed to be for all of this. How will we know when to lead the untested initiates to the new gods? And what does the river turning to blood have to do with it?" Hapatra frowned.
Khufu held up his hands, palms facing upward.
"The God-Pharaoh will make all clear."
#emph[May the God-Pharaoh's mercy be more bountiful than his communications] , Hapatra thought to herself.
She let her gaze drift back to the River Luxa. The birds had stopped singing, and the city, usually rife with the sounds of happy training, was utterly silent. It made Hapatra uncomfortable. Even more concerning was the retreating water—blood—of the river. The empty riverbed was filled with undead fish. Strange, lumpy, blood-soaked animals flopped on the mud and rolled around lamely. The Curse of Wandering did not care that they needed water to move after all.
It was all too strange. Too unorthodox. These prophecies were vague, and their manifestations unsettling.
Foreign doubts ghosted through Hapatra's mind. She dared not give them names.
Without warning, her breath hitched in her throat.
A sudden, jarring pain burst in Hapatra's chest, and she doubled over in agony, clutching her heart and cursing through the sting.
She looked around desperately for the source and saw that the other viziers were clutching their chest as well. She stilled her mind and tried to work her way through the ache. Hapatra was a master of poisons and had spent much of her life forcing her body to work through searing pain. She breathed in, then out, focusing on her will to ease the panic and hurt from her body.
The physical pain passed, but a feeling of dread remained.
Parts of the city were screaming. Hapatra looked out over the rooftops and temples to find the source. The sound seemed to be coming from the Gate, but grew louder to her ear, as if something were traveling rapidly over Naktamun. In the distance, Hapatra saw Kefnet take to the air, followed by a strange dark shape she did not recognize.
From above, she heard something odd—a chittering, scratching, leggy little noise creeping through the haze of the Hekma. Hapatra looked up and saw a cloud of locusts hovering above.
The monsters were meant to have been vanquished with the Hour of Revelation. That was why the demon had arrived to fly over the city; he was the driven out of paradise, as were all beasts outside the Hekma. Why did the monsters persist?
Her snake slipped off her finger and slithered into a crack in the temple wall.
Hapatra looked back toward Kefnet and realized that the dark shape following him could only be one of the new gods.
#figure(image("004_The Hour of Promise/02.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
It was #emph[massive] . The thing seemed to be climbing the nearest tower. Its claws gripped the rock sides of an obelisk as it hauled its enormous body upward. Halfway up the thing appeared to remember it had wings, launching itself quickly to the top. The drone of its wings was a constant, violent noise, as though the air itself was protesting the constant beating inflicted upon it by the gigantic insectoid wings.
Hapatra turned to Khufu.
"We should help Kefnet!"
The other vizier shook his head, still wincing from the mysterious pain. "This is all part of the Hour of Glory. The gods will be tested as we will."
"And that is what that pain was? A test?"
Khufu nodded, and Hapatra's lips curled. She crossed to the opposite side of the veranda. Nothing about this felt right.
At that moment, she heard small footsteps coming up the stairs. Iput, the Temple of Strength's youngest and most fleet-footed vizier, ran swiftly up the stairs. Her face was a mess of tears. Hapatra kneeled and caught her in her arms.
"Iput, what did you see? What do the new gods want?"
"Rhonas is dead!" she sputtered.
Hapatra's face fell. She shook her head.
"No. He is a god. The gods cannot be killed."
Iput shuddered with grief. "The scorpion god killed him. It means to kill them all."
Rhonas was the mightiest of the gods. Beasts shied away from his power, and dark forces quailed wherever his shadow fell. Rhonas could not be killed.
But the pain in Hapatra's heart said otherwise.
Behind her, Khufu was yelling.
"It is a test! Iput is lying! Rhonas, greatest god of them all, will join the side of the God-Pharaoh—"
"Would you be silent for once!" Hapatra yelled.
This was no time for protocol. Promises had been broken, and trust had been pierced with unfamiliar venom. Hapatra could grieve later. Her only goal now was to keep the other gods safe so no other citizen would feel the pain of a god falling.
Hapatra looked up and saw dark clouds of insects clinging to the inside of the barrier. She looked to the locust god on the spire in the distance in time to witness it, arms outstretched, wielding some unholy magic directed at the sky above.
The buzz of locusts filled the air above her.
A gray mass was coalescing on the inside of the Hekma. At first it was sparse, but as the locust god's spell continued, the mass grew larger and larger, and the drone of buzzing wings grew louder and louder.
Hapatra narrowed her eyes to make out what the locusts were doing. They seemed to be clambering over each other to reach the shimmering magic of the Hekma. And as they moved, shafts of clear light broke through where the barrier used to stand. Hapatra's lips parted in horror. The locusts were eating away at the Hekma itself.
Hapatra turned to the other viziers. "The Hour of Promise is when the world will be transformed into a glorious paradise. 'No more will the Hekma be required to hedge out the desert and the marauding dead, for the waters of the Luxa will flow freely through the wastes.' Right?!"
The other viziers nodded their heads. Hapatra jabbed a finger at the locust god in the distance. She drew back her shoulders and stood at full height. "The Luxa will flow freely through the wastes because there won't #emph[be ] a Hekma!"
The viziers looked up in horror. They watched from their high vantage point as the locusts consumed more and more of the magic that kept them safe from the outside.
Even Khufu couldn't help but look. "The locust god is doing this . . . ?"
The Hekma was coated with locusts beyond count, their swarm so thick that the light of both suns flickered and dimmed. An eerie, black night fell on Naktamun. Hapatra blinked as her eyes adjusted. The mass of insects moved and shifted, dappling light on the stones of the Temple of Strength.
Hapatra decided this was about the right time to go inside.
"No more gawking! Everyone retreat!" Hapatra called. The other viziers were swallowed by their grief, and reluctantly picked themselves up off the ground with desperate sobs.
Hapatra whipped around. "Rhonas would not want you to sit and mourn! Arm yourselves for battle, viziers!"
The others sniffed and nodded, heading inside to retrieve their weapons.
A pinprick of light escaped through the dark mass of insects above.
Shafts of light broke through across the underside of the barrier, at first several, then a dozen, and suddenly a quarter of the Hekma barrier vanished.
Hapatra swore.
The city erupted into chaos.
#figure(image("004_The Hour of Promise/03.jpg", width: 100%), caption: [Art by <NAME> Ro], supplement: none, numbering: none)
She watched from the temple as Kefnet flew upward and began a spell to repair the Hekma, but his effort was in vain. Swarms of locusts mobbed the god, and Kefnet struggled to continue the enchantment under the assault of hundreds of thousands of insects. Hapatra cursed the limited view she had of the rest of the city.
As the surrounding Hekma vanished, a wave of marauding mummies poured into the city from the wastes beyond.
She turned heel and ran as quickly as she could into the Temple of Strength.
Initiates were panicking, hugging each other for comfort. Some viziers were arming themselves; another was leading the beasts of the temple out of their habitats to let loose into the city to fight off the marauding mummies. The inside of the Temple of Strength was an extensive training ground known as the Holding, a carefully curated wildlife preserve designed as a place where initiates could hone their tenacity and survival skills. Hapatra began working her way through the outer ring of the Holding toward its more perilous inner ring. She had spent her entire life devoted to this Temple, and knew every path and shortcut. The vizier's chambers were very near now.
Hapatra did her very best not to let the turmoil in her heart show on her face. All she had ever wanted was a place by Rhonas's side in the Afterlife. Where would gods go when they died?
Her own chambers were shrouded in poisonous vines. She passed through with tingling ease and ran toward her weapon cabinet.
Spear. Scimitar. Vials upon vials of poisons.
Hapatra remembered a lesson she had taught just months before.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#emph[She stood encircled by initiates, each healthy, talented, and poised for success in the Trial of Strength. As master of poisons, Hapatra delighted in teaching her craft.]
#emph[She gestured with a lift of her proud chin and asked the group of students a simple question. "How do marauding mummies move through the sandy desert?"]
#emph[Hapatra waited for a beat and then broke into a dazzling smile.]
#emph["With ] #strong[grit] !"
#emph[Every initiate groaned, and Hapatra grinned with smug satisfaction.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Hapatra smiled at the memory and pulled out a vial of poison. She knew full well how mummies moved. Once the Curse of Wandering took hold, the muscles animated through impulses that were sent through the spinal cord and nerves to the muscles.
She smeared poison on the edge of her scimitar.
"Dead nerves, dead mummy."
Hapatra punctuated her quip with a shrill whistle.
Something massive rumbled past the opening to her chamber, and Hapatra smiled wickedly. She grabbed a thick shawl to protect her skin from the locusts and called out to the thing outside.
"Tuyaaaa, sweetheart!"
She heard a hiss from behind the vines. Hapatra slung her scimitar over her back and moved the vines to the side, cooing at the huge basilisk in front of her.
Tuya was twice as tall as Hapatra and longer than she had ever cared to measure. The two shared a magical bond, and the basilisk nuzzled the hands of her master. Hapatra kissed the nose of her serpent.
"The world as we know it has ended, old girl," Hapatra whispered. The basilisk snuggled her nose into the crook of Hapatra's neck.
The master of poisons swallowed her grief.
"No time for mourning, sweetheart. We have a city to save."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Hapatra clung tight to Tuya's back as the serpent wound its way through the rings of the Holding. There were no initiates in here now, and the wilderness was strangely empty.
Hapatra extended a hand and wove a spell of calling. #emph[To me] , she projected. #emph[Follow me outside and avenge your master, for he is dead.]
The beasts and animals of the Holding lifted their heads attentively. They began to follow, first one, then many, until a mass of antelopes, hippopotamuses, rhinoceroses, and elephants were following the slithering basilisk.
Vines and leaves whipped Hapatra's face as she barreled through the jungle of the Holding. She tugged at Tuya's side to steer the basilisk up the central staircase, shutting her eyes tight as they broke through the doorway into the terror of the brilliant light of day.
The light hit her face at the same time as a storm of screams and noise. Free of their task, the locusts were swarming whatever body they could find first. Cursed dead had begun to wander in from the desert outside, and a few horrors from the wastes had started to attack any living person they could find.
Naktamun, once shining alabaster, was stained with plague and beasts.
Hapatra could feel locusts bouncing off her even through her thick shawl. She brought Tuya to a halt, and the menagerie of animals from the Temple of Strength following behind stopped in turn.
The suns above were dappled with clouds of insects. Kefnet hovered far above now, desperately trying to rebuild the Hekma. In the distance, Hapatra could make out the locust god still standing atop its spire, setting wave after wave of locusts upon a hapless Kefnet.
Hapatra quickly wove another spell of calling. #emph[Attack the pretender gods! Kill the insectoid trespassers!]
The beasts roared with bloodthirst and fury, and Tuya reared up to bare her fangs. Hapatra drew her scimitar and willed Tuya to charge.
They tore through the streets of Naktamun, ramming as many marauding mummies and locusts as possible. Hapatra leaned over the side of her serpent and sliced through the chests of several mummies with her poisoned scimitar. With every swipe of her blade, another mummy halted, hunched over, and fell to the earth, its body seizing and shaking.
#emph[If only Rhonas could see me now] , she thought with a bittersweet smile.
Tuya's fangs clamped down on the bodies of several marauding mummies, and Hapatra leapt to the ground.
"Keep the cursed dead out of the city!" she yelled. The basilisk gave her a quick loving flick of her tongue and slithered away to the edge of Naktamun.
Hapatra looked up, spotted the struggling Kefnet high above the city, and ran toward him.
The shawl prevented the locusts from biting and scraping her skin, but Hapatra quickly realized it would be no help against the mummies that surrounded her now. She charged forward into the throng all the same. She started to intone a prayer to Rhonas before catching herself and cursing. Yet still she wove her way through swaths of enemies, her blade dancing with a practiced, deadly grace as she cut herself free from the crowd of undead.
She knew that her poison would freeze the mummies on its own. Hapatra ran toward the nearest group of marauding dead and began to make as many cuts as possible. Her poison would cease movement on both the living and the dead. She could not remove the Curse of Wandering, but she could make it a hell of a lot harder for them to wander in the first place.
Hapatra cut slice after slice, leaving a trail of seizing corpses in her wake.
She lost herself at that moment. Moving her blade side to side, with locusts disrupting her vision and buzzing filling her ears, Hapatra felt old. She had lived for thirty-four years—two lifetimes' worth of experience. Rhonas had been there for her from the very start. He was so good and so true. How could her god betray her like this?
No. It wasn't the gods.
It was the one who was absent. The God-Pharaoh who was not here.
This was his fault.
Hapatra screamed in fury and sliced the head of a marauding mummy clear off.
A flash of gold caught her eye.
Hapatra looked over and watched as two children stood back to back against a group of decayed mummies.
They stabbed with stolen spears and yelled tactical advice to one another. Their movements were unskilled, channeled from a place of abject terror.
Hapatra's heart felt heavy. She charged forward and made quick work of the attacking mummies, with the two children stabbing and screaming alongside her.
Once their enemies had fallen in a poisoned heap, Hapatra turned to the children.
"Where are your caretakers?"
"They won't stop," replied the older child.
Hapatra's brow fell in confusion. She kicked in the door of the nearest house and walked inside.
Several anointed were preparing lunch in the kitchen. Mounds of food piled up on all sides and each bowl was coated with feasting locusts. The stink of insects and tainted food was thick in the air. One anointed mummy had run out of bowls to put food in and was simply dropping it, spoonful by spoonful, onto the floor. A mass of locusts busily consumed the extra food, but the mummies took no notice. It appeared the anointed were unable to stop their duties despite the chaos that permeated the city.
Hapatra recoiled and exited quickly. She knelt to the level of the children and pulled out a vial of poison.
"Give me your spears," she instructed.
The boys handed over the spears, and Hapatra uncorked her poison, applying it to their blades with her fingers.
"Find some adults and stay near them. Slice as many marauding mummies as you can with this."
A scream caught her ear. Hapatra stood, drew her scimitar, and ran toward the sound. Locusts were mobbing the body of a man while a woman stood at his side, smacking the insects away with her hands. The slap of her fingers was drowned out by the incessant drone of their wings.
Hapatra realized she was standing by a fountain in her favorite courtyard.
The fountain had pulled water directly from the river. It was stained with blood now.
Hapatra felt a tug at her heart, and Tuya rounded the quarter of the square, her massive scaled body smacking into the walls with indelicate force. Her snout was coated with blood and the viscera of dead insects.
Hapatra climbed atop her familiar and urged her forward. Kefnet was perched atop a tower nearby, his wings drooping with fatigue.
Hapatra pushed Tuya forward, and they slid through the city with ease.
More citizens were fighting back now, and a few had encouraged their anointed to do the same. Every now and then, Hapatra passed one of the beasts from the Holding; they tore and bit and scratched at the intruding mummies. Some noticed as the basilisk passed and ran to tag along.
"Vizier Hapatra!"
Hapatra halted Tuya, looking for whoever had called her name.
The heretic Samut stood below.
"If you're here to say 'I told you so,' I don't want to hear it," Hapatra yelled down.
Samut shook her head. She looked to her left, and the champion Djeru came around the corner.
"We need to find and protect Oketra," Samut said.
"We . . . we saw Rhonas fall." Djeru shook his head. "We cannot let the other gods suffer Rhonas's fate."
Hapatra sighed.
"Get on."
The two former initiates gracefully climbed atop Tuya, and Hapatra urged the basilisk forward.
Hapatra mused as the basilisk travelled. "I always understood the Hour of Promise to mean that the Hekma would fall to reveal paradise."
"It is all part of the God-Pharaoh's lies." Samut's mouth was a hard line. Djeru shook his head behind her and remained silent.
Hapatra petted the cool scales of her basilisk. "Serving Rhonas was my purpose in life. I refuse to believe he knowingly lied to us."
"He did not knowingly lie to us. The gods were manipulated by a more powerful force."
Hapatra nodded, considering this. She looked over her shoulder and met eyes with Samut.
"Can this force be killed?"
Samut shook her head slowly. "I don't want to find out."
"For someone who claims to know so much, your vision is narrow," Hapatra snapped.
Djeru piped in from behind. "Keeping our people and gods alive is paramount. Let the trespassers fight each other."
Sure enough, two of the trespassers came rushing across their path. One was Gideon, the broad-shouldered warrior Oketra had claimed as one of her own. The other was a pale woman in a violet dress.
"Don't stop for them," Djeru spat.
Hapatra looked back for a last glimpse at the strangers. There were no other cities save Naktamun, and yet these trespassers knew nothing of its culture. The day before yesterday, she had received word through the viziers that the gods were welcoming these guests. Hapatra sneered. Let the trespassers deal with the God-Pharaoh. If he is from a different world as well, then they all #emph[deserve each other.]
A gust of wind blew a new cloud of locusts over the basilisk. Hapatra huddled the other two close against her back and shielded them all with her shawl, then looked down the thoroughfare.
Kefnet and Oketra were there: Kefnet hovering in the air, Oketra solid, unmoving, almost a statue save for the flick of one ear. As a servant of Rhonas, Hapatra had never had much appreciation for Oketra, but she found herself overcome with relief to be in the god's presence, grateful for the first warmth she had felt since Rhonas's death.
The two gods were looking at something behind her. Hapatra halted her basilisk and turned to see what they were staring at, but her view was blocked by broken columns, fractured stone, and the endless clouds of buzzing locusts.
Hapatra looked back to her gods with a plea in her heart.
"Kefnet! Oketra! The Hekma is lost! We will take you to safety!" Hapatra distantly realized how ridiculous this command would have sounded only a day before.
Both gods ignored her, continuing to look off into the distance. Oketra's bow was in her hands, an arrow of white light nocked.
"Oketra, please!" Hapatra called, voice cracking as she contemplated all that she had already lost, and all that was still left to lose. "Oketra! We will protect you!" The hole in her heart from Rhonas's death was already too large. She could not bear to see it grow.
Oketra looked down at her. Her pale eyes glowed softly, and Hapatra basked in her familiar calm. The God of Solidarity looked down on Hapatra and smiled, sad and small. Around Hapatra, the sounds of people fleeing in terror abated as the god gazed into her soul.
"#strong[You are not here to protect us, child of Rhonas.] " Oketra shook her head ever so slightly. "#strong[We are here to protect you] #strong[.] "
Hapatra's heart clenched. "Oketra, no!"
But with those words of dismissal, Oketra turned once more and raised her bow. Kefnet flew higher in the air, and Hapatra was finally able to see what the two gods had been staring at.
The beast was nightmare given form.
It was more immense than any monster she had seen through the Hekma in the wilds of the desert. Tall, taller than any god, even Rhonas, which Hapatra would not have thought possible. It had the body of a man and the head of a scorpion, but one that somehow stood #emph[upright] on the being's body—and it was far larger and bulkier than any scorpion had a right to be. Dancing behind it, in a loose, rhythmic, weaving circle, was its stinger, the point glistening with ichor. Even the ever-present swarms of locusts gave the monster a wide berth, reluctant to cross its path. Hapatra could hear a loud chittering sound, though whether it came from the monster's mouth or its tail she could not tell.
Kefnet looked back at Oketra, and Hapatra was shocked to see the god's fear so clearly written on his face.
"#strong[Stow your terror, brother] #strong[!] " Oketra said with a finality that thrummed through Hapatra's heart. "#strong[Face this beast and wield your gifts in the ways of war!] "
Kefnet lifted his head. With a flex of his shoulders, he flew high and to the side of the scorpion.
Oketra lifted her arrow again.
"#strong[Turn back, god-killer, scourge of everlasting life, and you will live through this day.] "
Oketra's voice rang throughout the clearing, her notes pure silver, though she emphasized #emph[this day] in a way that made it clear she would be coming for her brother's killer eventually. She raised her bow, its white arrow now incandescent, burning hot. The scorpion swiveled its head to regard both Kefnet and Oketra, though if it spoke, Hapatra could not understand anything through the constant #emph[chitter chitter chitter ] sound it made.
As the being came closer, Hapatra felt its presence and gasped. Her heart filled with terror as she recognized the scorpion god for what it was. Its divinity—though malevolent, an inverse of the other gods—was unmistakable.
The three gods were still, sizing each other up as if captured in one of the temple friezes Hapatra knew so well.
And then chaos erupted.
Kefnet flew at the scorpion god, darting in and out as he cast spell after spell. He disguised his dives in a series of illusions, massive birds and crocodilian dragons, each one catching the scorpion god's attention just in time for Kefnet to attack when least expected, narrowly avoiding the scorpion's sting. Oketra fired a succession of arrows, but somehow the scorpion god turned its thick carapace to intercept every missile. Oketra's white energy dissipated against its shields even as it attacked Kefnet with a blur of blows from its stinger.
Kefnet soon ceased any attempts at illusory deception, for the scorpion god seemed never to take a wrong step or to mistime an attack. Many tales were told of Oketra's arrows striking down giant sandwurms and demons, and Hapatra was awed at the kind of power the scorpion god must possess to shrug off such blows, thick shell or no. She urged Tuya to keep to the shadows and soon found herself praying aloud to Oketra and Kefnet, shouting praise to aid in their battle.
Kefnet flew higher to avoid the scorpion god's attacks, but the god immediately switched to focus on Oketra instead, closing on her with terrifying speed. Oketra was forced to backpedal furiously, her footfalls shaking the ground as Kefnet was forced to swoop back in to distract and harass the assassin.
As deadly efficient as the scorpion god was, Kefnet and Oketra fought with a grace that Hapatra thought almost poetic. They moved in tandem with one another, their flurries of attack and counterattack timed precisely to expose a flank on the scorpion god's side or a weak spot in its armor. Although the scorpion god was so far undeterred, Hapatra knew she was watching two masters of combat, their cooperative technique honed over thousands of years of fighting.
The scorpion god made several strikes, all misses, and quickly changed direction. Its sting had seemed to make contact with that shift—it must have grazed one of Kefnet's wings, for the ibis-headed god began to sputter through the air, one wing refusing to move at the same speed as the other. He faltered, and the scorpion god immediately took advantage, its stinger darting, each time narrowly missing Kefnet's head or chest. Kefnet, straining under the exertion, lurched from side to side in desperation.
Oketra stood still at the edge of the thoroughfare, holding her bow aimed but still. She could not risk hitting Kefnet as he fought to stay alive, his body now interposed between her and the scorpion god. In his dance of survival, the ibis-headed god stumbled. The scorpion god rushed in and Kefnet's wings gave out.
The scorpion god's pursuit was halted by Oketra's arrow of white light exploding through his head. The constant chittering sound vanished as the scorpion god, headless, crashed into the earth, its body flattening rubble into dust and the reverberations briefly lifting Hapatra, her basilisk, and its passengers off the ground. Hapatra watched as the body of the scorpion god crumbled to dust, whatever force had animated it no longer present.
Kefnet straightened his wing and stood up, seemingly uninjured. He smiled wickedly at his sister, who shared his joy.
The three humans cheered atop the basilisk. They praised the courage of Oketra and the brilliance of Kefnet.
#emph[My gods are magnificent] , Hapatra thought in wonder. Samut and Djeru hugged each other tight, and clapped Hapatra on the back. Hapatra refused to share their tears of joy. She would have time to herself later for that.
But as she contemplated how she would mourn the passing of Rhonas, the dust and particles that once were the form of the scorpion god began to shift.
The pieces lifted from the ground and, within moments, reconstituted the very beast that had been killed only just before.
The beast rose whole and uninjured, as though the battle that had shaken the earth beneath the thoroughfare mere moments before had never happened. Kefnet turned back toward his fallen foe only to find the scorpion god facing him dead on, its vile chittering the last thing Kefnet heard before its stinger pierced the middle of his forehead. The wound was neither deep nor wide, but the beautiful and brilliant Kefnet, God of Knowledge, was dead before he hit the ground.
Hapatra screamed, and Samut and Djeru did the same, their hearts aching once again with the loss of a god. Oketra hissed with fury, firing her arrows in an act of futility.
"#strong[Mortals! Flee to the safety of the mausoleums!] " Oketra cried.
Hapatra halted for a moment. #emph[What] mausoleums?
She ignored the command and yelled to Samut and Djeru sitting behind her, "Get off now!"
The two did as they were told, and Hapatra dug her heels into Tuya to urge the basilisk forward.
The serpent spat its venom, weaving itself around the scorpion god and gnashing its venomous jaws. Hapatra gripped tightly with her thighs and pulled the basilisk in a sharp turn, urging her mount toward the enemy.
The blood of Kefnet had spilled over the stone in the courtyard, and Tuya slid as she tried to grapple with the scorpion god. Hapatra kept a firm grip on Tuya's scales and silently urged her familiar forward. Her heart ached with the pain of Kefnet's death, but she shoved the hurt as far deep as she could. This trespasser needed to die, and it would be at her hand.
Oketra leapt between the basilisk and the scorpion god.
Hapatra's chest cramped in pain. She looked up, and she cried out in horror. Directly above her, the scorpion god's stinger was lodged in Oketra's gut.
Hapatra screamed and heard an unfamiliar voice shout in grief at the same time. Gideon stood on the opposite end of the courtyard, his face the very picture of anguish.
She and the basilisk froze in fear as the scorpion god stepped over the two of them. It looked to the sky, seeking #emph[something] , and proceeded on its way through the streets of Naktamun, ignoring the mortals in its wake.
The thoroughfare was empty, and two of Hapatra's gods lay dead in front of her.
For the first time all day, she openly wept.
She wept for the death of her god. She wept for the death of her pantheon. She wept for the children forced to fight and the men devoured by locusts and the beloved serpent that shivered with fear under her hand. Her grief cascaded over the levy of her control and sent her into the arms of a champion and a heretic. Djeru and Samut held the vizier as she sobbed, and they, too, mourned their many losses.
Other citizens, survivors one and all, came out of alleys and hiding places to see the bodies of the gods.
Hapatra gasped for air through her grief and saw Gideon standing still over Oketra.
#figure(image("004_The Hour of Promise/04.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
She composed herself and nodded to Samut and Djeru, who let go of her shoulders and allowed her to cross to Gideon.
Hapatra looked down her nose at Gideon. Her cheeks were stained with teary kohl, and her lips twitched in a deadly combination of grief and fury.
"The source of this hell is a trespasser like yourself, isn't it?"
Gideon swallowed hard and nodded.
Hapatra glared and spoke with a voice that dripped with venom.
"Then he is your responsibility to kill. Be done with your task and get out of my city."
The master of poisons turned away and approached Samut and Djeru, her sandals stepping through the ichor of gods.
She looked at them both with resolution in her eyes. "We must find Bontu and Hazoret and keep them alive at all costs. They are all we have now."
|
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/newline-mode.typ | typst | Apache License 2.0 | // Test newline continuations.
---
#{
"hello"
.clusters()
if false {
}
else {
("1", "2")
}
}
---
#"hello"
.codepoints()
#if false {
}
else {
("1", "2")
}
|
https://github.com/monaqa/typscrap.nvim | https://raw.githubusercontent.com/monaqa/typscrap.nvim/master/class/layout/telomere.typ | typst | #let draw_tick_range(y_start, y_end, date) = {
let left_margin = 16pt
let baseline = 0pt
let max_days = 30
let diff_days = (datetime.today() - date) / duration(days: 1)
let tick_color = {
let base_color = rgb("#2ecc40")
if date.weekday() == 6 {
base_color = blue
} else if date.weekday() == 7 {
base_color = red
}
let diff_ratio = 80% * calc.min(1, calc.pow(diff_days / max_days, 1 / 2))
color.mix((base_color, 100% - diff_ratio), (luma(90%), diff_ratio))
}
let tick_width = {
let diff_ratio = 90% * calc.min(1, diff_days / max_days)
4pt * (100% - diff_ratio)
}
let content_date = text(
size: 8pt,
fill: tick_color,
font: "Noto Serif",
number-type: "old-style",
date.display("[year]-[month]-[day]"),
)
place(left + top, dx: -(left_margin - tick_width / 2), line(
start: (0pt, y_start + 0.5pt + baseline),
end: (0pt, y_end - 0.5pt + baseline),
stroke: tick_color + tick_width,
))
place(
dx: -(48pt + left_margin),
dy: (y_start + y_end) / 2 - 0.25em,
left + top,
content_date,
)
}
#let telomere(loc) = {
let offset = loc.position()
let ticks = query(<meta-tick>, loc).enumerate().map(((idx, tick)) => (
idx: idx,
date: tick.value.date,
page: tick.location().page(),
y: tick.location().position().y,
))
let last_tick_on_prev_page = ticks.filter((tick) => tick.page < loc.position().page).at(-1, default: none)
let ticks_to_display = ticks.filter((tick) => tick.page == loc.position().page)
if last_tick_on_prev_page != none {
ticks_to_display.insert(0, (
idx: last_tick_on_prev_page.idx,
date: last_tick_on_prev_page.date,
y: loc.position().y + 1.0cm,
))
}
for tick in ticks_to_display {
let next_tick = ticks.at(tick.idx + 1, default: none)
if next_tick == none {
// 最後の tick は終わりの場所を示すためだけにある
break
}
if tick.date != none {
if next_tick.page != loc.position().page {
draw_tick_range(tick.y, loc.position().y + 841.89pt - 4.0cm, tick.date)
continue
}
draw_tick_range(tick.y, next_tick.y, tick.date)
}
}
}
|
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Maths.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: "Maths",
authors: (
"<NAME>",
),
date: "30 Octobre, 2023",
)
#set heading(numbering: "1.1.")
#link("Calculus.pdf") #link("Category_Theory.pdf") #link("Home.pdf")
#link("Integral.pdf") #link("Maths_DM.pdf") #link("Maths_DM.pdf")
#link("Maths_Exercices.pdf") #link("Maths_Exercices.pdf")
#link("Maths_Sup.pdf")
#link("Multivariable Function.pdf")[Multivariable Function.md]
#link("Partial Derivative.pdf")[Partial Derivative.md]
#link("SimpleOrdinaryDE.pdf")
#link("Symmetry Groups and Degeneracy.pdf")[Symmetry Groups and Degeneracy.md]
#link("Tangent plane.pdf")[Tangent plane.md]
|
|
https://github.com/nicolasfara/commonwears-2024-rome | https://raw.githubusercontent.com/nicolasfara/commonwears-2024-rome/master/commonwears-2024-rome.typ | typst | #import "@preview/polylux:0.3.1": *
#import themes.metropolis: *
#set page(paper: "presentation-16-9")
#show raw: set text(size: 11pt)
#show math.equation: set text(font: "Fira Math")
#show figure.caption: set text(size: 16pt)
#set text(font: "Fira Sans", weight: "light", size: 20pt)
#set strong(delta: 100)
#set par(justify: true)
#title-slide(
title: "COMMON-WEARS Meeting @ Rome",
subtitle: "Activities Summary",
author: "<NAME>, PhD Student @ UNIBO",
date: "January 25, 2024",
)
#new-section-slide("Pulverization: Reconfig. at Runtime")
#slide[
= RQs
/ RQ1: How can a pulverised deployment be reconfigured at runtime in a decentralised way to adapt to changing conditions (load, energy, etc.)?
/ RQ2: How can such adaptation be designed to provide relevant benefits over a static allocation?
= Main contributions
+ Extend the theoretical framework of pulverisation by adding support for _runtime configuration rules_
+ Provide a practical framework (called _PulvReAKt_ #cite(<nicolas_farabegoli_2024_10535841>)) developed in Kotlin
+ Validate the proposed framework both by simulation and real deployment
]
#slide(title: "Pulverization Partitioning")[
#figure(
image("figs/pulverization.png"),
caption: "Logic device partitioned into five components and its links to neighbour devices."
)
]
#slide(title: "Pulverization DSL: System Definition")[
```kt
object HighCPU : Capability
object LowLatencyComm : Capability
object EmbeddedDevice : Capability
val configuration = pulverizedSystem {
device("control-center") {
Behavior and State deployableOn HighCPU
Communication deployableOn LowLatencyComm
Sensors deployableOn EmbeddedDevice
}
device("iot-sensor") {
Behavior deployableOn setOf(HighCPU, EmbeddedDevice)
Communication deployableOn LowLatencyComm
Sensors and Actuators deployableOn EmbeddedDevice
}
}
```
]
#slide(title: "Pulverization DSL: Runtime Setup")[
```kt
object HighLoad : ReconfigurationEvent<Double>() {
override val predicate = { it > 0.90 }
override val events = cpuLoad()
}
object LowBattery : ReconfigurationEvent<Double>() {
override val predicate = { it < 0.20 }
override val events = batteryLevel()
}
val runtime = pulverizationRuntime(configuration, "iot-sensor", setOf(...)) {
DeviceBehaviour() startsOn Server
DeviceCommunication() startsOn Server
DeviceSensors() startsOn Smartphone
DeviceActuators() startsOn Smartphone
reconfigurationRules {
onDevice {
HighLoad reconfigures { Behaviour movesTo Smartphone }
LowBattery reconfigures { Behaviour movesTo Server }
}
}
}
```
]
#slide(title: "Small-Scale Scenario: Crowd Alert in a Lab")[
We want to avoid situations where too many people are too close to each other in the same room for safety reasons.
To do so, we equiped each people with a _wearable device_ that can detect other devices via Bluetooth.
The _Received Signal Strenght Indicator_ (RSSI) is used to estimate the distance between two devices:
#align(center)[
$d = 10^frac(R#sub[ref] minus R, 10 dot n)$
]
The system is composed of: _Smartphones_, a _Monitor_, and a _Server_.
The _Behaviour_ of the devices is moved to the _Smartphones_ when the _CPU load_ is too high and to the _Server_ when the _Battery level_ is too low.
]
#slide(title: "Representation of the system in action")[
#figure(
image("figs/crow-laboratory-demo.drawio.svg")
)
]
#slide(title: "Large-Scale Scenario: Collective Computation at a Urban Event")[
To show the potential of the automatic reconfiguration of the system, we simulated a large-scale scenario.
We simulated a _City Event_ where the participants are involved in a collective activity whose computational weight is relevant (similar to Pokemon Go#footnote[https://pokemongolive.com/]).
The application requires physically moving into the city reaching _Points of Interest_ (PoI) and performs some operations there.
We suppose the application to be pulverised and its behaviour to be able to run either on a _Smartphone_ or in the _Cloud_.
]
#slide(title: "Metrics")[
For each simulated scenario, we define two changing threshold at which the system is reconfigured: $italic(v)$ and $italic(lambda)$ (stable configuration have $italic(v) > italic(lambda)$)
When $italic(v), italic(lambda) < 0$ force the behaviour to be always in the cloud,
and when $italic(v) < 0, italic(lambda)$ forcing the behaviour to be always on the smartphone.
We are interested in the following metrics:
- $P#sub[device] (op("kW"))$, the average power consumption of the device
- $P#sub[cloud] (op("kW"))$, the average power consumption of the cloud
- $op("Distance") (op("km"))$, the total distance travelled by the participants
- $op("$")#sub[cloud] (op("$"))$, the price paid to keep the required cloud instances up and running
]
#slide(title: "Energy and Cost Models")[
We assume that the power consumption of the device is linearly dependent on the CPU usage, and we thus decided to estimate the Energy Per Instruction (EPI) for the _Smartphone_ and the _Cloud_.
In this scenario we considered a Qualcomm Snapdragon 888 (5W) and an Intel Xeon Platinum P-8124 (220W).
To estimate the EPI we divided the TDP by the CPU score obtained from PassMark#footnote[https://www.cpubenchmark.net/] and then used these ratios to estimate the relative EPI of the two CPUs, obtaining an $op("EPI")#sub[ratio]$ close to $1:18$.
We take the EPI estimation for the server CPU from approximately $10 J$ per instruction#cite(<6629328>).
#figure(
image("figs/simulation-screenshot.png", height: 78%),
caption: "A snapshot of the large-scale simulation."
)
]
#slide(title: "Results")[
#figure(
image("figs/cloud_cost-device_consumption-cloud_consumption-distance-device=1000.0.png"),
caption: "Simulation results with 1000 devices"
)
]
#new-section-slide("AC for Dynamic Reconfiguration")
#slide[
= RQs
/ RQ1: How can a pulverised system be effectively deployed and managed in complex infrastructures like the Edge-to-Cloud Continuum?
/ RQ2: How can a pulverised system be dynamically reconfigured in a decentralised way using global policies?
/ RQ3: What are the benefits and limitations of using decentralised policies?
= Main contributions
+ A _middleware architecture_ for managing pulverised systems in the E-CC
+ The use of _AC_ as a solution for the _dynamic reconfiguration_ of the system
+ An evaluation of the proposed reconfiguration approach comparing the _adaptive_ solution with a _non-adaptive_ counterpart.
]
#slide(title: "Middleware architecture")[
#figure(
image("figs/new-pulv-arch.png"),
caption: "Middleware layers and the mapping between them in the architectural model."
)
#figure(
image("figs/middleware-example-ac.png"),
caption: "Representation of a simple system composed of four logical devices."
)
]
#slide(title: "AC for Dynamic Reconfiguration")[
We show how Aggregate Computing can provide a suitable programming model for implementing runtime reconfiguration rules for pulverised systems from a global stance.
We consider a system composed of _thin_ and _thick_ devices, where the former are able to offload their behaviour to the latter.
The objective is to dynamically relocate the behaviour adapting to changing CPU loads of the _thick host_.
A reconfiguration policy can be defined as a _function_ returning `Set[Component]` to be executed locally.
]
#slide(title: "SCR approach")[
Reconfiguration approach based on SCR pattern #cite(<PIANINI202144>).
```scala
def isThick: Boolean = ... // true if the device is thick
def offloadWeight: Int = ... // the offload weight
def cpuCost(): Int = if (isThick) /* cpu load */ else offloadWeight
def behavior = ... // the local behavior component
def main(): Set[Component] = {
val potential =
G(source = isThick, field = cpuCost(), acc = _ + _, metric = cpuCost)
val managed: Set[Behavior] = C(potential, _ ++ _, Set(behavior))
var load = cpuCost()
val runOnThick: Set[Behavior] =
if (isThick) managed.takeWhile { load += offloadWeight; load < 100 }
else Set()
val onLeader = G(isThick, runOnThick, identity(), cpuCost)
if (isThick) onLeader
else Set(behavior) -- onLeader ++ Set(Sensor, Actuator)
}
```
]
#slide(title: "Evaluation")[
We have exercised the proposed approach in two network topologies: _Lobster Network_ #cite(<Zhou2013>) and _Scale-free Network_ #cite(<Barabasi1999>).
For each topology we have considered different _device load_, and _device failure_.
In all the experiments we have measured the $"QoS" = frac(tau#sub("0"), tau)$ of the system where $tau$ is the _thin_ and _thick_ device that have successfully offloaded their behaviour. The set of device that have failed to offload their behaviour is $tau#sub[0] subset.eq tau$.
The baseline we compare with is a system where offloading is pre-defined: every thin host offloads its behaviour component to the nearest thick host.
]
#slide(title: "Results - Varaible Load")[
#figure(
image("figs/dynamic-load.svg"),
caption: "Comparison between the baseline and the proposed approach with variable load."
)
]
#slide(title: "Results - Graceful Degradation")[
#figure(
image("figs/constant-load.svg"),
caption: "Comparison between the baseline and the proposed approach in a degradation condition."
)
]
#bibliography("bibliography.bib")
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/grotesk-cv/0.1.0/content/references.typ | typst | Apache License 2.0 | #import "../lib.typ": *
#import "@preview/fontawesome:0.2.1": *
== #fa-icon("users") #h(5pt) #get-header-by-language("References", "Referencias")
#v(5pt)
#if is-english() [
#reference-entry(
name: [<NAME>, Resistance Leader],
company: [Cyberdyne Systems],
telephone: [+1 (555) 654-3210],
email: [<EMAIL>],
)
#reference-entry(
name: [<NAME>, CEO],
company: [Tyrell Corporation],
telephone: [+1 (555) 987-6543],
email: [<EMAIL>],
)
] else if is-spanish() [
#reference-entry(
name: [<NAME>, Líder de la Resistencia],
company: [Cyberdyne Systems],
telephone: [+1 (555) 654-3210],
email: [<EMAIL>],
)
#reference-entry(
name: [<NAME>, CEO],
company: [Tyrell Corporation],
telephone: [+1 (555) 987-6543],
email: [<EMAIL>],
)
]
|
https://github.com/ljgago/typst-chords | https://raw.githubusercontent.com/ljgago/typst-chords/main/src/single.typ | typst | MIT License | #import "./utils.typ": parse-content, has-number, size-to-scale
/// The single chord a chord without diagram used to show the chord name over a word.
///
/// - ..text-params (auto): Embeds the native *text* parameters from the standard library of *typst*. *Optional*.
///
/// - background (color): Sets the background color of the chord. *Optional*.
///
/// - body (content): Is the word or words where the chord goes. *Required*.
///
/// - name (content): Displays the chord name over the selected words in the body. *Required*.
///
/// - position (content): Positions the chord on a specific body character. *Required*.
/// - ```typ []```: chord name centered on the body.
/// - ```typ [number]```: the chord name starts on a specific body character. (First position ```typ [1]```)
///
/// -> content
#let single-chord(
..text-params,
background: rgb(0, 0, 0, 0),
body,
name,
position
) = context {
assert.eq(type(background), color)
assert.eq(type(body), content)
assert.eq(type(name), content)
assert.eq(type(position), content)
let scale = 1
if "size" in text-params.named().keys() {
let (size,) = text-params.named()
scale = size-to-scale(size, 12pt)
}
let horizontal-offset = 0pt
let vertical-offset = 1.2em
let anchor = center
let size = (:)
size.body = measure(body)
size.name = measure(text(..text-params)[#name])
let body-array = parse-content(body)
if position.has("text") {
assert(has-number(position.at("text")) == true, message: "the \"position\" must to be a \"content\" with only numbers")
let body-chars-offset = 0pt
let pos = int(position.at("text")) - 1
let min-pos = 0
let max-pos = body-array.len() - 1
pos = calc.clamp(pos, min-pos, max-pos)
for i in range(pos) {
body-chars-offset += measure([#body-array.at(i)]).width
}
// gets the char-offset to center the first character of
// the chord with the selected character of the body
let chord-char = parse-content(name).at(0)
let chord-char-width = measure(text(..text-params)[#chord-char]).width
let body-char-width = measure([#body-array.at(pos)]).width
let char-offset = (chord-char-width - body-char-width) / 2
// final horizontal offset
horizontal-offset = body-chars-offset - char-offset
anchor = left
}
size.canvas = (
width: 0pt,
height: size.body.height + size.name.height + 0.8em,
dx: horizontal-offset,
dy: -vertical-offset
)
size.canvas.width = {
if horizontal-offset > 0pt and size.name.width + horizontal-offset >= size.body.width {
size.name.width + horizontal-offset
} else if horizontal-offset <= 0pt and size.name.width >= size.body.width {
size.name.width
} else {
size.body.width
}
}
box(
width: size.canvas.width,
height: size.canvas.height, {
place(
anchor + bottom,
dx: size.canvas.dx,
dy: size.canvas.dy,
box(
fill: background,
outset: (x: 2pt * scale, y: 3pt * scale),
radius: 2pt * scale,
text(..text-params)[#name]
)
)
place(
anchor + bottom,
box(..size.body, body)
)
}
)
}
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/docs/tinymist/feature/language-content.typ | typst | Apache License 2.0 |
#import "../mod.typ": *
Language service (LSP) features:
- #link("https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide")[Semantic highlighting]
- The "semantic highlighting" is supplementary to #link("https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide")["syntax highlighting"].
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#provide-diagnostics")[Diagnostics]
- Also known as "error checking" or "error reporting".
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#highlight-all-occurrences-of-a-symbol-in-a-document")[Document highlight]
- Highlight all break points in a loop context.
- (Todo) Highlight all exit points in a function context.
- (Todo) Highlight all captures in a closure context.
- (Todo) Highlight all occurrences of a symbol in a document.
- #link("https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentLink")[Document links]
- Renders path or link references in the document, such as `image("path.png")` or `bibliography(style: "path.csl")`.
- #link("https://code.visualstudio.com/docs/getstarted/userinterface#_outline-view")[Document symbols]
- Also known as "document outline" or "table of contents" _in Typst_.
- #link("https://burkeholland.gitbook.io/vs-code-can-do-that/exercise-3-navigation-and-refactoring/folding-sections")[Folding ranges]
- You can collapse code/content blocks and headings.
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-definitions-of-a-symbol")[Goto definitions]
- Right-click on a symbol and select "Go to Definition".
- Or ctrl+click on a symbol.
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#find-all-references-to-a-symbol")[References]
- Right-click on a symbol and select "Go to References" or "Find References".
- Or ctrl+click on a symbol.
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-hovers")[Hover tips]
- Also known as "hovering tooltip".
- #link("https://www.jetbrains.com/help/idea/inlay-hints.html")[Inlay hints]
- Inlay hints are special markers that appear in the editor and provide you with additional information about your code, like the names of the parameters that a called method expects.
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-color-decorators")[Color Provider]
- View all inlay colorful label for color literals in your document.
- Change the color literal's value by a color picker or its code presentation.
- #link("https://code.visualstudio.com/blogs/2017/02/12/code-lens-roundup")[Code Lens]
- Should give contextual buttons along with code. For example, a button for exporting your document to various formats at the start of the document.
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#rename-symbols")[Rename symbols]
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#help-with-function-and-method-signatures")[Help with function and method signatures]
- #link("https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-all-symbol-definitions-in-folder")[Workspace Symbols]
- #link("https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-code-actions")[Code Action]
- Increasing/Decreasing heading levels.
- #link("https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#on-enter")[experimental/onEnter]
- #kbd("Enter") inside triple-slash comments automatically inserts `///`
- #kbd("Enter") in the middle or after a trailing space in `//` inserts `//`
- #kbd("Enter") inside `//!` doc comments automatically inserts `//!`
Extra features:
- Compiles to PDF on save (configurable to as-you-type, or other options).
- Compiles to SVG, PNG, HTML, Markdown, Text, and other formats by commands, vscode tasks, or code lenses.
- Provides code lenses for exporting to PDF/SVG/PNG/etc.
- Provides a status bar item to show the current document's compilation status and words count.
- #link("https://github.com/Myriad-Dreamin/tinymist/tree/main/tools/editor-tools")[Editor tools]:
- View a list of templates in template gallery. (`tinymist.showTemplateGallery`)
- Click a button in template gallery to initialize a new project with a template. (`tinymist.initTemplate` and `tinymist.initTemplateInPlace`)
- Trace execution in current document (`tinymist.profileCurrentFile`).
|
https://github.com/freundTech/typst-matryoshka | https://raw.githubusercontent.com/freundTech/typst-matryoshka/main/tests/features/basic/test.typ | typst | MIT License | #import "/lib.typ": compile
#set page(fill: gray)
#compile("Hello World")
|
https://github.com/markcda/unitech-typst | https://raw.githubusercontent.com/markcda/unitech-typst/master/examples/rf-telecommunication-systems/01-abstract.typ | typst | MIT License | #import "00-university-template.typ": *
#show: student_work.with(
title: "Реферат - Устройства приема и обработки сигналов в ТКС - Титов К.А.",
header: "unitech-2023-header.png",
department_name: "Кафедра информационной безопасности",
institute_name: "Институт инфокоммуникационных систем и технологий",
work_type: "реферат",
discipline_name: "Устройства приема и обработки сигналов в ТКС",
theme: "8. Приемник прямого преобразования.",
author: (name: "<NAME>", sex: "male", degree: "студент", group: "ИБО-ТС-22", nwa: "Титов К.А."),
adviser: (name: "<NAME>", sex: "male", degree: "к.в.н., доцент кафедры ИБ", nwa: "Лубенцов А.В."),
city: "Королёв",
year: "2024",
table_of_contents: true,
links: (
//(type: "doc", title: "Доктрина информационной безопасности Российской Федерации (от 5 декабря 2016 г.)"),
//(type: "book", author: "<NAME>", title: "Севейна", publisher: "Литрес.Самиздат", year: "2019"),
(type: "web", title: "Форум о технике прямого преобразования на «Сайте Кубанских Радиолюбителей»", link: "http://forum.cqham.ru/viewforum.php?f=28", access_date: "10.01.2024"),
(type: "web", title: "Радиоприёмник прямого преобразования", link: "https://ru.wikipedia.org/wiki/Радиоприёмник_прямого_преобразования", access_date: "10.01.2024"),
(type: "web", title: "Приёмник прямого преобразования частоты", link: "https://digteh.ru/WLL/PrmPrjamPreobr.php", access_date: "10.01.2024"),
),
)
= Введение
С развитием радиокоммуникаций на смену простейшим детекторным радиоприёмникам пришли радиоприёмники прямого преобразования, выделяющиеся существенными преимуществами. В отличие от традиционных детектирующих приёмников, которые используют промежуточные частоты для преобразования радиочастотных сигналов, такие приёмники осуществляют прямое преобразование радиочастотного сигнала в базовую (или низкочастотную) область без дополнительных промежуточных преобразований. В настоящее время приёмники прямого преобразования находят широкое применение в различных областях, от портативных радиостанций до высокоскоростных цифровых систем связи.
Цель данного реферата -- детально рассмотреть принципы работы, преимущества и ограничения приёмников прямого преобразования.
#set heading(numbering: "1.")
= Принципы работы приёмников прямого преобразования
Радиоприёмники прямого преобразования (или прямопреобразующие радиоприёмники) представляют собой особую конструкцию радиоприёмников, в которых входной сигнал непосредственно преобразуется на низкочастотный уровень без промежуточного преобразования.
Пусть $m(t)$ является исходным модулирующим сигналом. Тогда выражение для амплитудно-модулированного сигнала будет следующим:
$ x(t) = (C + m(t)) cos(w t) $
Если этот сигнал подать на устройство умножения двух сигналов (перемножитель), а на второй вход этого устройства подать гармонический сигнал той же частоты без сдвига фазы, то на выходе перемножителя будет сумма сигналов с удвоенной несущей частотой и постоянная составляющая:
$ y(t) = (C + m(t)) cos(w t) cos(w t) = \ = (C + m(t)) (1/2 + 1/2 cos(2 w t)) $
После фильтрации сигнала с удвоенной частоты с помощью фильтра нижних частот и устранения постоянной составляющей на выходе получается модулирующий сигнал.
#{
[Структурная схема приемника прямого преобразования, реализующая описанный выше принцип переноса спектра полезного сигнала в область низких частот, приведена на ]
ref(label("scheme"), supplement: "рисунке")
[.]
}
#set figure.caption(separator: [. ])
#figure(
image("scheme.gif", width: 80%),
caption: [Структурная схема приемника прямого преобразования]
) <scheme>
В этом приемнике полосовым фильтром выделяется группа частот, в которой присутствует входной сигнал, затем синхронным детектором осуществляется перенос спектра в область низких частот. Подавление частот соседних каналов в данной схеме может осуществить как полосовой фильтр на входе детектора, так и фильтр низкой частоты, расположенный на его выходе. Известно, что сложность фильтра низкой частоты в два раза ниже сложности полосового фильтра с той же самой избирательностью. Поэтому схема приемника прямого преобразования выгоднее как с точки зрения надежности, так и с точки зрения стоимости устройства.
Сложность фильтра низких частот зависит от его порядка. Требования к порядку фильтра приемника прямого преобразования задаются крутизной ската его амплитудно-частотной характеристики фильтра (АЧХ). В общем случае эти требования зависят от конкретного вида сигнала, применяемого в данной системе связи.
В современных вариантах приемника прямого преобразования на выходе фильтра стоит аналого-цифровой преобразователь и схема цифровой обработки сигналов. В этом случае задача подавления соседнего канала может осуществляться этой цифровой схемой, и тогда требования к фильтру, расположенному на выходе перемножителя, могут свестись к требованиям к фильтру первого порядка, и его задача будет заключаться в подавлении высокочастотных образов полосы пропускания цифрового фильтра (антиалайсинговый фильтр).
Требования к усилителю низкой частоты определяются необходимым коэффициентом усиления полезного сигнала. Часто значение необходимого коэффициента усиления достигает нескольких тысяч. Тогда на первое место выходят шумовые характеристики усилителя. В этом случае желательно ограничить полосу сигнала и на выходе УНЧ для подавления его внеполосного шума.
= Преимущества и ограничения приёмников прямого преобразования
Исторически развитие радиоприёмников прямого преобразования (ППР) связано с несколькими причинами:
1. Упрощение конструкции: ППР имеют меньше компонентов по сравнению с промежуточным преобразованием, что делает их дешевле и проще в производстве.
2. Меньшее потребление энергии: без необходимости использования дополнительных преобразовательных цепей ППР могут потреблять меньше энергии.
3. Высококачественный приём: отсутствие промежуточного преобразования может уменьшить уровень шума и искажений, что положительно сказывается на качестве приёма.
4. Особенности приёма: в некоторых диапазонах радиосвязи ППР могут быть более эффективными или удобными для использования.
Таким образом, приёмники прямого преобразования (ППР) предлагают ряд преимуществ, но у них также есть свои ограничения по сравнению с детектирующими и другими типами радиоприёмников:
1. Сложность синхронизации: поскольку ППР прямо преобразуют радиочастотный сигнал в низкочастотный без промежуточных этапов, они могут требовать сложных схем синхронизации для обеспечения стабильной работы, особенно на высоких частотах.
2. Чувствительность к помехам: без использования промежуточных этапов фильтрации сигналов ППР могут быть более чувствительными к различным видам помех, что может ухудшить качество приема в некоторых условиях.
3. Непостоянство параметров: в некоторых диапазонах частот или при различных условиях работы ППР могут демонстрировать непостоянство характеристик или требовать сложных настроек.
4. Сложности с подавлением излучения: из-за особенностей прямого преобразования сигналов ППР могут испытывать трудности с подавлением нежелательного излучения или переизлучения, особенно на близких частотах.
5. Стоимость и сложность реализации: в некоторых случаях проектирование и реализация ППР может потребовать более сложных и дорогостоящих компонентов или технологий по сравнению с детектирующими приёмниками.
6. Ограничения в диапазоне частот: для эффективной работы ППР могут иметь ограничения по диапазону рабочих частот, что делает их менее универсальными для широкого спектра приложений.
Ключевой недостаток, он же ключевое достоинство этого вида приёмников — близость зеркального канала приёма к принимаемому каналу. Практически это соседние каналы, и отфильтровать зеркальный канал приёма на низкой частоте достаточно сложно. В ряде применений зеркальный канал фильтровать не нужно вовсе, поскольку он почти гарантированно свободен. Такая ситуация наблюдается в УКВ радиовещании, когда при лицензировании частот соседний канал рядом с мощной радиостанцией стараются оставить пустым. Поэтому приёмники прямого преобразования для УКВ можно вообще не снабжать входным фильтром, а все остальное легко укладывается в одну микросхему без навесных элементов. Именно такие очень дешевые и миниатюрные приемники сейчас встраивают в электронные гаджеты типа сотовых телефонов.
В случае применения приёмника прямого преобразования на КВ, например, для любительской радиосвязи, двухполосный приём становится серьёзным недостатком, так как на узких любительских диапазонах очень много помех от соседних станций. Подавить нежелательный канал приёма можно, используя фазокомпенсационный метод. Однако при этом приёмник сразу лишается своего важнейшего преимущества — простоты устройства и регулировки.
Несмотря на эти ограничения, приёмники прямого преобразования продолжают развиваться и находить применение в различных сценариях, благодаря своим уникальным преимуществам и возможностям.
|
https://github.com/drupol/master-thesis | https://raw.githubusercontent.com/drupol/master-thesis/main/src/thesis/4-conclusion.typ | typst | Other | #import "imports/preamble.typ": *
#import "theme/template.typ": *
#import "theme/common/titlepage.typ": *
#import "theme/common/metadata.typ": *
#import "theme/disclaimer.typ": *
#import "theme/leftblank.typ": *
#import "theme/acknowledgement.typ": *
#import "theme/abstract.typ": *
#import "theme/infos.typ": *
#chapterquote(
title: "Conclusion",
ref: "chapter4",
quoteAttribution: <peng2011>,
quoteText: [
Reproducibility has the potential to serve as a minimum standard for judging
scientific claims when full independent replication of a study is not
possible
],
)
== Summary
This thesis embarked on an in-depth exploration of reproducibility in
#gls("SE"), motivated by the growing necessity for reliable and repeatable
results in research and software development. In this chapter, we summarise our
findings and discuss the implications of our research. We also suggest future
work that could be done to improve reproducibility.
In the introductory @chapter1, I provided an overview of my personal journey and
the experiences that have led me to pursue this specific area within #gls("SE").
This chapter offered readers contextual information about my background,
especially highlighting my active involvement in open-source communities and my
dedicated advocacy for the adoption of reproducibility tools and practices. I
delved into my motivations for choosing this topic, underscoring the critical
importance of reproducibility in #gls("SE"). The relevance of establishing
reliable and repeatable processes to enhance the integrity of software products
and to foster a culture of transparency and collaboration. To guide the reader
through the thesis, I recall the goals and a structured overview of the
document, chapter by chapter.
In @chapter2, the theoretical foundations of reproducibility were explored,
tracing its origins from classical scientific disciplines where it has long been
a cornerstone for validating experimental findings and theories. The chapter
began with a historical overview, highlighting how reproducibility emerged as a
fundamental principle in the natural sciences and the shifts it has undergone
with the advent of the digital era. Following this introduction, a comprehensive
set of concepts central to understanding reproducibility in #gls("SE") was
presented. Formal definitions for key terms were introduced, establishing a
rigorous and foundational basis for subsequent developments. The narrative then
extended into the realms of open source and software security, pivotal areas
where reproducibility intersects with broader concerns. Open source software,
with its ethos of transparency and collaboration, enhances reproducibility by
making the source code readily available. This transparency facilitates the
verification of software builds and improves security. With the source code
accessible and inputs correctly declared, it allows for immediate identification
of dependencies and quicker identification of vulnerabilities. The focus shifted
to the specific challenges that software engineers and researchers face in
achieving reproducible builds. This discussion delved into obstacles such as
non-deterministic build processes, variability of environments, and the lack of,
to some extent, standard practices for documenting and sharing the necessary
details to replicate software builds. By examining these challenges, the
groundwork was laid for identifying effective strategies to address them.
Lastly, it introduced third-party tools designed to compare build outputs.
In @chapter3, I systematically explored and assessed different tools and
strategies used to build software with an emphasis on their potential to
facilitate reproducible results. The chapter presented a comprehensive analysis
of four distinct strategies: Bare compilation, Docker, Guix, and Nix. Each
strategy was evaluated through multiple objective criteria. This approach allows
for a balanced assessment of each method, providing insights into how well they
help in achieving reproducible builds. For Bare compilation, the focus was on
the traditional approach of building software directly on the system without
containerization or virtual environments, highlighting its limitations and
potential issues in reproducibility. Next, Docker was evaluated as a popular
containerization technology that encapsulates the software environment, aiming
to enhance reproducibility by isolating dependencies. Following Docker, I
examined Guix and Nix, two functional package managers that offer more granular
control over environment configurations. The chapter concluded with a
comparative analysis that ranked these strategies according to their
reproducibility potential. This evaluation serves as a resource for developers
making decisions about which tools and strategies to implement in their projects
to enhance the stability, reliability and security of their developments through
reproducibility.
In the remaining sections of this conclusion chapter, we will summarise the key
findings and the broader implications of my research. Additionally, I will
expand the discussion by exploring other facets of reproducibility. Finally, I
propose future research directions aimed at enhancing reproducibility.
== Evaluation Of Tools
@chapter3 was dedicated to evaluating different tools and strategies for
building software with an emphasis on their potential to facilitate reproducible
results.
Bare compilation is the traditional approach to building software directly on
the system without containerization or virtual environments. This method offers
minimal isolation and control over the build environment, making it challenging
to achieve reproducibility. However, it is still widely used in practice due to
its simplicity and familiarity, usually with the underlying operating system
ecosystem. Debian based Linux distributions are a common choice for this method
due to their extensive package repositories and long-term support, therefore,
the usage of the package manager `apt` became a standard practice for installing
dependencies when one is missing. This imperative method for installing missing
dependencies can lead to non-reproducible builds due to the lack of version
pinning. The `apt` package manager does not provide snapshots where all the
dependencies are frozen at a given state, which makes it challenging to
reproduce the exact build environment. However, it has the advantage of being
popular and widely supported.
Using Docker for building software is a popular choice due to its increasing
popularity and the ease of creating shareable containers through Docker Hub
#cite(<dockerhub>, form: "normal"). However, sharing a container as a single
#gls("OCI") file requires a bit more work and is not as straightforward as
sharing a Docker image on their dedicated platform Docker Hub. In a way, thanks
to Docker, users have been introduced to the concept of containerization,
immutability, and to some extent, reproducibility.
While discussing Docker with people, I noticed a common misconception about
reproducibility that is worth noting, similar to @info-box-proprietary-software.
To illustrate this, let's consider a project shipping builds of their
open-source software through Docker images hosted on Docker Hub. At each
release, they publish a new version of their image. These Docker images are
immutable, and users can use and reuse them at will. However, it is simply
impossible to reproduce those images themselves from the sources. While this
illustrates the Docker leitmotif #emph["build once, use everywhere"], it does
not demonstrate true reproducibility. The essence of reproducibility lies in our
ability to recreate identical copies of these images from the sources on any
machine. If something can be reproduced multiple times but yields different
results each time, it is not truly reproducible. Similarly, if something is
produced only once and is not meant to be reproduced, it is, to some extent,
also not reproducible.
#info-box[
In #emph[declarative configuration management]
#cite(<HunterGCP>,form:"normal"), tools such as Docker, Kubernetes
#cite(<kubernetes>,form: "normal"), and Terraform
#cite(<terraform>,form: "normal") are used to specify the desired end state
of the system rather than the steps to achieve it. For example, a `Dockerfile`
describes the final environment for a container, ensuring that the system
matches predefined specifications. This method aligns with the #emph[congruent
system management] #cite(<Traugott2002>,form:"normal") approach, focusing on
consistency and predictability. Declarative configurations ensure idempotence,
meaning the same configuration can be applied multiple times without altering
the system beyond its intended state. This abstraction makes it easier to
understand and maintain, as the system determines the necessary actions to
achieve the desired state.
In contrast, #emph[imperative configuration management]
#cite(<HunterGCP>,form:"normal") involves detailing the exact steps required
to transition a system from its current state to a desired state, providing
granular control over the configuration process. Tools such as Ansible
#cite(<ansible>, form: "normal"), Chef #cite(<chef>, form: "normal"), Puppet
#cite(<puppet>, form: "normal"), and Bash scripts exemplify this approach.
This method aligns with the #emph[convergent system management]
#cite(<Traugott2002>,form:"normal") approach, focusing on achieving a goal
through a series of specific actions. While imperative configurations allow
for complex logic and conditional operations, they can be challenging to
maintain due to their non-idempotent nature, meaning the same script can
produce different results depending on the system's initial state. This
approach requires meticulous management to ensure consistency and
repeatability, offering detailed control at the expense of simplicity and
predictability.
The expressiveness of imperative tools comes at a significant cost. These
tools allow developers to make stronger assumptions about the current state of
the system. This creates a strong likelihood of like environments diverging
over time in a process known as #emph[configuration drift]. The declarative
approach to configuration management reduces the possibility of configuration
drift by favouring idempotence, explicit dependency graphs, and maintaining a
strong awareness of the current state of the environment
#cite(<HunterGCP>,form:"normal", supplement: [p.348]).
]
During the evaluation, I found Docker to be very easy to use. By using a simple
declarative syntax to define the build steps, the `Dockerfile` is one step
forward into making configurations more explicit and this has contributed a lot
to the success of the Docker ecosystem. On a less positive note, using Docker on
other platforms than Linux can be challenging and a deal breaker for some users.
On non-Linux systems, Docker relies on a virtual machine to create a Linux
environment, which can lead to performance overheads and latency issues. The
differences in filesystems between Linux and non-Linux platforms can also result
in inconsistencies and unexpected behaviour in container operations.
Additionally, networking configurations and capabilities can vary significantly,
causing more complex setups and potential connectivity issues. Resource
allocation and management can be less efficient on non-Linux platforms due to
the intermediary VM layer. On Linux based architectures, the performance are not
as good as running the software natively without containerisation, but it
remains acceptable for most use cases. Although initiatives like DevContainer
#cite(<devcontainer>, form: "normal") aim to offer a more integrated experience
with #glspl("IDE", long: false) #eg[Visual Studio Code
#cite(<vscode>, form: "normal")], working within a container introduces an
additional layer of complexity. This can be particularly challenging to manage
when dealing with aspects such as networking, storage, and security.
Guix has been an interesting tool to evaluate. While the learning curve is
steeper than Docker, the benefits are significant. I appreciated the strict and
declarative approach to package management, which aligns well with the
reproducibility goals. The idea of using an existing general-purpose language
for declaring packages and configurations is a powerful idea. The Guix community
is small but active. The absence of proprietary tools in the official repository
can pose challenges for users who require specific software, and while there are
workarounds for using proprietary software, these are not highlighted by the
Guix community, which remains dedicated to free software. However, this strong
adherence to the GNU philosophy and the principles of the @fsfwebsite ensures
that Guix maintains its commitment to software freedom and user respect. This
has an immediate consequence on long-term and archivable reproducibility by
mitigating issues associated with proprietary software, which may become
unavailable or unmaintained over time
#cite(<9403875>, form: "normal", supplement: [Criterion 8]). The performance of
Guix are great; since no containerization is involved, the software runs
natively on the system, making accessing storage and network services
straightforward. Guix extensively uses `git` #cite(<git>, form: "normal") for
fetching package configurations. The command line user interface is very
intuitive, and the information displayed to the user while running it is very
clean and clear.
Nix has been the most interesting approaches to evaluate, technically but also
politically. The learning curve is steep, but the benefits are significant.
The Nix language while being Turing-complete (@def-turing-complete) has a very
specific and limited #gls("DSL"), it is remarkably clean and powerful, making it
highly suitable for managing package builds and configurations. Additionally,
the simplicity of the Nix language enhances its efficiency and usability,
positioning it, in my own opinion, as one of the best languages for this task.
During the making of this thesis, I contributed to Nix and I really appreciated
how easy it is to contribute but also the transparency of the process when it
comes to making a change. The Nix community is very large, active and welcoming,
and the Nix package repository `nixpkgs` is one of the most active repository
on Github #cite(<octoverse2022>, form: "normal"). Nix has completely changed the
way I think about software management, how I consume software and how I ship
software. I wish I had discovered it earlier.
While Nix offers many advantages, it also has some drawbacks, primarily
concerning its installer. The Nix installer is a shell script that downloads and
installs Nix on the system. However, there are alternative installers available.
During my evaluation, I explored these different installers and ultimately chose
one developed by a United States-based company founded by <NAME>, the
creator of Nix. Given this connection, I felt confident using their installer.
Nevertheless, I found it peculiar to maintain multiple installers for the same
software, which I suspect might be a source of confusion for many users, both
new and experienced. Could this indicate a deeper governance problem?
Another drawback of Nix is the documentation. While the Nix manual is extensive
and well-written, it can be overwhelming for new users. The manual is
comprehensive but it lacks a clear and concise structure, examples and a lot of
topics are not covered. A lot of energy, initiative and effort are being made
and things are slowly moving in the right direction.
While working with Nix the first time, I got introduced to the concept of Nix
channels. Nix channels is a mechanism used to distribute and update collections
of Nix expressions. These channels provide users with a way to receive updates
for Nix packages and configurations. While Nix extensively uses `git`, the
unique concept of channels adds an extra cognitive load for users who want to
simply upgrade their machines. I preferred the simplicity Guix offers by just
using `git` to update the system. When using Flakes, the concept of Nix channels
is no longer needed.
Flakes is an experimental feature as of writing. Released in November 2021 with
Nix 2.4 #cite(<nix24release>, form: "normal"), Flakes is powerful yet
controversial. For example, some companies, including one founded by the creator
of Nix, are advocating for the adoption of Flakes, while the Nix community
awaits its stabilization. Although these differences do not affect Nix's
functionality in the short term, they can be confusing for new users and may
lead to fragmentation within the community. One might ask why such companies are
not contributing to the same codebase as the rest of the community, a situation
that has already led to some division.
#info-box(kind: "important")[
There are currently around 230 committers spread across the globe taking care
of the Nix package repository on Github
#cite(<NixpkgsCommitters>,form:"normal"). On June 1st 2023, I've been granted
the status of project committer #cite(<DrupolNixCommitter>,form:"normal").
This status allows me to merge commits, review code, and contribute to the Nix
ecosystem in a more direct way. However, I want to clarify that the
conclusions of this thesis were not influenced by my role in the Nix project.
I have worked to maintain the highest level of objectivity in this document,
with only reproducibility as the primary focus.
]
At the time of writing, the Nix community was facing a significant crisis,
leading to the creation of two new forks of Nix, @lix and @aux. This
fragmentation is a major concern for the project's future. While a new
governance structure is being established, the community remains divided over
different installers, the experimental Flake feature, the sponsorships policy
and now forks. Although the current situation is not ideal, I am confident that
the community will overcome this crisis and continue to provide an excellent
tool for the #gls("SE") community. The controversial Flake feature has attracted
many new users to the Nix ecosystem, and the community is growing rapidly. These
issues are likely a result of this rapid growth and the initial lack of clear
and transparent governance, a problem that needs to be resolved.
To conclude, it is essential to recognise that Nix is the result of extensive
research and development, used in production by numerous companies and
individuals. The Nix community is dynamic and vibrant, promising a bright future
for the project. The core value of Nix lies in its package repository,
`nixpkgs`, which hosts thousands of packages readily accessible to any Nix user.
Regardless of which Nix variant or fork one chooses, the true asset remains that
package recipe repository, likely to be shared across different forks, ensuring
consistency and reliability in package management.
#info-box(kind: "conclusion")[
I have concluded that the ideas implemented by Nix stand out as the optimal
choice. With two decades of maturity and robustness, the Nix ecosystem is, in
my view, currently the best concept for implementing reproducibility in
#gls("SE"). I am convinced that Nix, or a similar technology that embraces the
same principles #eg[@guixwebsite, @lix, @aux], has the potential to
revolutionise the way software is built, used, audited, deployed and shared.
]
#pagebreak(weak: true)
== Research Findings
During this research, I have discovered in @chapter3 that the reproducibility of
software builds is a multifaceted challenge that requires a combination of
skills, tools and strategies to address it effectively. In this section, I
present a summary of the key findings and some other facets of reproducibility
that I briefly explored, but could be expanded in future research.
=== At A Glance
Reproducibility in #gls("SE") refers to the ability to consistently recreate the
same software product, with identical functionality, using the same methods and
data across different environments and over time. This involves
ensuring that the software build process, dependencies, and computational
environments are well-documented and standardised.
#figure(
include "../../resources/typst/ch4-table-conclusion.typ",
caption: [Pros and cons of reproducibility],
kind: "table",
supplement: [Table],
) <ch4-table-conclusion>
=== Limitations
Each of the tools evaluated in @chapter3 offers unique advantages and features,
yet they also possess limitations that can impact their effectiveness in
achieving reproducibility. Below are some key points noted during the
evaluation.
==== Cross Architecture Reproducibility
Achieving software build reproducibility across different operating systems and
architectures is not feasible for certain types of build outputs, typically
binaries (@ch2-r13y-utopia). Binary build outputs depend on the #gls("CPU")
architecture #eg[`x86`, `ARM`] because converting source code into machine
code uses a set of #gls("CPU") instructions directly inherited from the
#gls("CPU") architecture. Therefore, obtaining binaries that are identical
across every architecture is unlikely to occur. This inherent dependency means
that the binaries produced on different architectures will have variations,
making exact cross hardware architecture reproducibility unattainable.
==== Unavailability Of Upstream Packages
To illustrate this limitation, I will use the example of a software package that
has been removed from the upstream repository and is no longer available for
download. In this scenario, the software package cannot be built, as the source
code is no longer accessible. Furthermore, any other packages that depend on
this now-unavailable package also become impossible to build. This limitation
highlights the importance of maintaining a robust and reliable infrastructure
for software repositories to ensure the longevity of software packages and
facilitate reproducibility. In the absence of such infrastructure,
reproducibility becomes increasingly challenging, as software packages may
become obsolete or unavailable over time.
To circumvent this limitation, researchers and developers can adopt proactive
measures to ensure the long-term reproducibility of their software builds. One
approach is to archive the source code and dependencies of the software package,
preserving them in a secure and accessible repository. This is what projects
like Software Heritage #cite(<swh>, form: "normal") is trying to achieve. By
archiving the source code and dependencies, researchers and developers can
safeguard against the loss of critical software components and maintain the
long-term reproducibility of their builds over time. Since November 2018, Guix
has incorporated support for Software Heritage, "making it the first free
software distribution backed by a stable archive"
#cite(<swguix2018>, form:"normal"). This integration allows Guix to fall back to
the Software Heritage archive if it fails to download source code from its
original location. As a result, package definitions in Guix do not need to be
modified; they still refer to the original source code URL, but the downloading
machinery will transparently access Software Heritage when necessary. This
feature significantly enhances the robustness of software builds in Guix by
ensuring that source code remains accessible even if the original URLs become
unavailable. Alternatively, implementing a caching layer to store build outputs
can significantly enhance reproducibility. This allows users to retrieve
precompiled build outputs, thereby avoiding the need to compile the source code
on their machines if the corresponding cached build exists. Nix extensively uses
that feature and facilitates the creation of such cached build layers due to its
principles (@def-functional-package-management), as it produces immutable
directories based on sources. This means that modifying existing cached builds
is not possible, mitigating potential security issues related to accidental
modifications. It's worth noting that this level of immutability and
reproducibility is not the case with all package managers.
==== Standardisation
Another limitation is the lack of standard practices for documenting and sharing
the necessary details to replicate software builds. This limitation underscores
the need for clear and comprehensive documentation to facilitate
reproducibility. An exemplary initiative addressing this challenge is the
#gls("PURL") project, which seeks to standardise the identification and location
of software packages across various ecosystems and tools. The #gls("PURL")
specification #cite(<purl>, form: "normal") provides a universal syntax to
reliably reference software packages, thereby mitigating the inconsistencies
that arise from diverse package management conventions. By establishing a common
framework, #gls("PURL") enhances the interoperability and reproducibility of
software builds across different platforms and tools, illustrating the critical
role of standardisation in reproducible research and development. In addition to
#gls("PURL"), the #gls("SWHID") is another significant development aimed at
improving standardisation. The #gls("SWHID") provides a unique, persistent
identifier for software source code, facilitating the precise identification and
retrieval of specific software versions from the @SWHArchive.
To illustrate this, the 11 June 2024, GitHub announced
#cite(<githubSBOMPURL>,form:"normal"), that generated #gls("SBOM") files will
now include a #gls("PURL"). By including the #gls("PURL"), GitHub improves the completeness of the #gls("SBOM") data, helping users in more clearly identifying
the packages in their repositories. This new Github feature exemplifies the
practical benefits of adopting a standardised specification, as it addresses a
critical need in reproducibility by providing the precise identification of
software components used in a build, thereby improving transparency and
reproducibility in software development through the inclusion of #glspl("PURL")
in GitHub's #glspl("SBOM").
== Future Work
The exploration of reproducibility in #gls("SE") is an ongoing endeavour. As
technology advances and new tools emerge, the landscape of reproducibility
continually evolves.
A foundational step towards enhancing reproducibility in #gls("SE"), and by
extension, in the broader realm of science, is to raise awareness of its
importance from the outset. This can be achieved through educational
initiatives, workshops, and seminars that highlight the benefits of
reproducibility and provide researchers with the necessary tools and resources.
Embedding reproducible practices into the research culture from the beginning
will help establish these practices as standard requirements rather than
optional enhancements.
On the technical side, the frameworks and tools evaluated in this thesis provide
a robust foundation for reproducible software builds. However, significant scope
for improvement remains. Currently, various Linux distributions continue to
develop their own package managers, resulting in redundant efforts and
inefficient use of resources. While this idea seems utopic, adopting Nix as a
#emph[universal package manager] could be a potential solution. Nix abstracts
away the underlying system, making it an ideal candidate for standardizing
software deployment across different Linux distributions. By providing a
consistent environment, Nix could streamline the deployment process, reduce
inconsistencies, enhance reproducibility across diverse systems, and improve
security. With a universal package manager, security vulnerabilities could be
addressed more efficiently, as fixes could be deployed across all systems
simultaneously. However, implementing Nix universally presents several
challenges, such as ensuring compatibility with all distributions, overcoming
resistance from communities accustomed to their current systems, and managing
the scalability and maintenance of such an initiative. To address these
challenges, a phased approach could be adopted, starting with specific use cases
or distributions where Nix has demonstrated clear benefits. Additionally,
collaborative efforts and open dialogue among stakeholders could facilitate a
smoother transition. Furthermore, adopting Nix could significantly reduce our
carbon footprint by eliminating the need to store prebuild binaries for
different distributions. Instead, binaries would be prebuilt once, then stored
and made available on a #gls("CDN") for all the Linux distributions, thus
streamlining the deployment process and contributing to environmental
sustainability.
#info-box[
The complexity of reproducibility is comparable to that of replicating a
painting. While explaining this thesis to a painter, I used the example of
creating an indistinguishable copy of another painting. The painter explained
that the likelihood of achieving such perfect replication is comparable to the
chance of a monkey writing Shakespeare's work due to the numerous variables
involved, such as the type of paint, the brush, the canvas, the lighting, the
environment, the painter's mood, and the time of day. This carefully chosen
analogy underscores the multifaceted nature of reproducibility in #gls("SE"),
where numerous variables and intricate interplay influence the final outcome.
]
The challenges in achieving reproducibility in artistic works highlight the
complexity and necessity of considering various factors. This broader context
emphasises that reproducibility is not limited to #gls("SE") but is a universal
issue that requires ongoing attention and innovation. Across different fields
such as the arts, social sciences, and natural sciences, achieving
reproducibility involves addressing a wide array of considerations.
Specifically, these considerations include ethical, economic, philosophical and
educational aspects.
=== Flaky tests
Flaky tests are tests that exhibit inconsistent outcomes without changes to the
code being tested. This means that they can fail or pass sporadically, leading
to uncertainty and mistrust in the test outcomes. These unreliable tests are not
only problematic for developers but also hinder the effectiveness of valuable
techniques in software testing research. Essentially, flaky tests pose a threat
to the validity of methodologies that rely on the assumption that a test's
outcome is solely determined by the source code it evaluates. From a recent
paper #cite(<SurveyFlakyTests>,form:"normal"), a survey of software developers
found that 59% claimed to deal with flaky tests on a monthly, weekly, or daily
basis.
Reproducibility is directly linked to the issue of flaky tests because their
inconsistency directly impacts the ability to reproduce results reliably. For
effective reproducibility in scientific software and other domains, it is
crucial that tests yield consistent and predictable results. Unstable tests
hinder the verification process, making it difficult to assert whether observed
issues are due to actual code defects or just the flakiness of the tests
themselves. This discrepancy affects validation, verification, and the
confidence in computational results.
Future work on this issue should focus on developing techniques to identify and
mitigate flaky tests, ensuring that test outcomes are consistent and reliable.
Research could explore advanced methods for detecting flakiness, such as machine
learning algorithms that analyse test behavior patterns. Additionally, creating
tools to automatically stabilize flaky tests and integrating these solutions
into continuous integration pipelines would significantly enhance the
reliability and trustworthiness of software testing processes.
=== Formal Concepts
There is potential for further describing and refining the formal definitions
related to reproducibility introduced mostly in @chapter2. While this thesis has
introduced formal definitions of key terms related to reproducibility, these
definitions can be expanded, refined and improved.
Having a set of formal definitions related to reproducibility is important
because they provide clarity and consistency in terminology, helping researchers
communicate more effectively. Standardised definitions allow for consistent
evaluation criteria, making it easier to compare results across different
studies and ensuring reliable assessments. This standardisation also supports
the development of tools and methodologies for verifying reproducibility, making
the evaluation process more rigorous.
Moreover, formal definitions play an educational role by instilling a culture of
reproducibility among new researchers and students. They guide policy-making and
governance in research institutions, promoting best practices. Ultimately, these
definitions ensure the reliability and integrity of scientific findings.
Enhancing these formal definitions will further strengthen the quality and
credibility of research.
=== Ethical Considerations
Reproducibility is fundamentally intertwined with ethical practices in research,
as it bolsters the scientific process by enforcing transparency among
researchers. The commitment to making research reproducible serves the
scientific community and fosters public trust in scientific outcomes,
demonstrating a respect for the integrity of science and its impact on society.
Ethically, researchers are obliged to report their findings and also provide
comprehensive details of their methodologies. This level of accountability
allows their research to be rigorously scrutinised, validated, or refuted by
peers, thus enhancing the quality and credibility of the scientific knowledge
produced. It is essential for maintaining public trust in scientific
research. When results are not reproducible, it undermines the reliability of
scientific discourse and can lead to scepticism towards scientific claims. This
is particularly critical when scientific research informs policy decisions in
crucial areas such as public health and environmental conservation, where
non-reproducible research could lead to misguided policies with far-reaching
consequences. As we have seen through this document, the open sharing of data
and methods is a cornerstone of reproducible research. It democratises access to
scientific knowledge, enabling a diverse range of researchers to participate in
and contribute to scientific discovery, regardless of their geographical,
political or institutional affiliations. Reproducibility acts as a bulwark
against fraud and bias. It ensures that research content, findings, discoveries
are genuine and not the result of manipulated data, thus promoting fair
distribution of resources and recognition within the scientific community.
=== Philosophical Considerations
According to @kpopper1934, a cornerstone of scientific inquiry is that a theory
must be falsifiable; that is, it can be disproven through empirical evidence.
While evidence alone cannot conclusively verify a hypothesis, it can refute one.
Reproducibility is essential in this context as it allows hypotheses to be
rigorously tested and either validated or refuted, thus contributing to the
evolution of scientific truth.
Scientific knowledge is not static but accumulates iteratively. Reproducibility
fortifies this process by ensuring that each new discovery builds upon a
foundation of previously verified results. This methodological consistency is
crucial for the progressive nature of scientific understanding.
Reproducibility also underpins the pursuit of objective knowledge. It helps
distinguish robust scientific results from those that are anomalies or artefacts
of experimental error, refining our collective understanding of natural
phenomena. The establishment of scientific consensus relies heavily on
reproducible results. This reproducibility facilitates agreement among
scientists on what constitutes established facts, thus propelling scientific
progress and fostering collaboration across various disciplines.
Moreover, reproducibility enhances the scientific enterprise by encouraging the
open sharing of data and methods. This openness not only fosters collaboration
but also transforms research into a collective endeavour rather than a series of
isolated efforts. It cultivates a scientific culture where data transparency and
methodological openness are normative, promoting an inclusive environment that
respects and builds upon the work of fellow researchers. By facilitating the
verification of results, reproducibility pays homage to the foundational work of
previous researchers and ensures that their contributions to knowledge are
respected and built upon. It reinforces the integrity of scientific practice and
propels the pursuit of further inquiry.
=== Economical Considerations
Reproducibility intersects with economic efficiency. Efficient reproducibility
can accelerate scientific progress by enabling quicker validation of results and
facilitating broader dissemination of knowledge. Economies of scale can be
applied where repetitive reproductions are feasible, thus reducing the unit cost
of research and making large-scale studies more financially sustainable.
The economic impact of reproducibility also extends to its utility in
policymaking and industrial applications. Reproducible research ensures that
policies and commercial ventures based on scientific findings are underpinned by
robust and reliable evidence, thus minimising risks and maximising efficacy.
This not only bolsters public and investor confidence but also enhances the
economic utility of scientific research.
To some extent, reproducibility is closely linked to the economy of scarcity,
where the rarity of an object or finding directly impacts its reproducibility
and associated costs. Rare phenomena or data require more specialised resources
for reproduction, which are often costly and less accessible. This scarcity
increases the economic investment required to replicate a study, from securing
rare materials to accessing specialised equipment.
Conversely, phenomena that are not rare can be reproduced with greater ease and
at a lower cost. The abundance of necessary resources and established
methodologies makes such reproduction economically viable and less
resource-intensive. This disparity highlights a fundamental economic principle
within scientific research: the cost and feasibility of reproducibility often
depend on the availability and accessibility of resources.
To illustrate this, consider the manual replication of a painting, where the
scarcity of the original artist's brushstrokes and techniques makes it
challenging to reproduce the artwork with the same precision and quality. It
would take a significant investment of time, effort, and resources to manually
replicate the painting accurately. Choosing the proper materials, mastering the
techniques, and recreating the environment and artist's vision are all essential
factors that contribute to the cost and feasibility of reproducing the painting.
In contrast, a mass-produced item, such as a digital photograph, can be
replicated with relative ease and at a lower cost.
In summary, the economic implications of reproducibility encompass a range of
considerations from the broader economic impacts on efficiency, credibility, and
practical application to the costs of rare resources.
=== Educational Considerations
Educating students in best practices is crucial for fostering a culture of
reproducibility. We can draw a compelling parallel with mathematics, where
reproducibility is inherently embedded. Just as mathematical proofs and
solutions can be independently verified by anyone following the same steps and
logic, reproducibility in #gls("SE") aims for the same level of transparency and
verifiability. This bridge underscores that reproducibility is a desirable trait
and a foundational principle that should be rigorously applied in computational
research. For example, a professor might provide students with the necessary
data, software, and materials for a specific course through fully reproducible
methods and tools. This could involve using open-source software, version
control systems, and detailed documentation to ensure that students can
reproduce the outcome in any space and any time.
Incorporating ethics education into research training programmes helps instil
the importance of reproducibility and integrity in scientific research,
emphasising the ethical responsibility researchers have towards producing
verifiable and reliable results. Organising workshops and seminars focused on
reproducibility can help disseminate best practices and foster a community
dedicated to high standards in research. These events serve as platforms for
discussion, collaboration, and the sharing of new tools and techniques.
Adopting the FAIR principles (Findable, Accessible, Interoperable, and Reusable)
#cite(<Wilkinson2016>, form: "normal") can significantly enhance reproducibility
in research. Ensuring that metadata and data are easily discoverable and
accessible helps others understand and reuse them, thereby maintaining a
transparent and verifiable scientific process. Moreover, interoperability and
reusability ensure that data and associated methodologies can be integrated
across various platforms and reused effectively, contributing to a robust
research ecosystem.
Furthermore, experienced researchers mentoring early-career scientists can pass
on valuable knowledge and emphasise the importance of reproducibility in their
work. Mentorship provides hands-on guidance and support, helping to build a
strong foundation for the next generation of scientists. By addressing these
educational and training considerations, we can cultivate a research environment
that values and prioritises reproducibility.
Reproducibility is closely linked to fact-checking, as both processes involve
verifying the accuracy and reliability of research findings. Emphasising
reproducibility can significantly enhance the quality of fact-checking by
providing clear, transparent methodologies and robust data that others can
independently verify. This rigorous approach ensures the credibility of
scientific research and fosters critical thinking skills. By engaging in
reproducible research practices, individuals develop a keen critical thinking,
which is essential for evaluating information, identifying biases, and making
informed decisions. Teaching the principles of reproducibility and fact-checking
from an early age is crucial. Incorporating these concepts into school curricula
helps students develop critical thinking skills early on, empowering them to
question assumptions, evaluate evidence, understand the scientific process and
verify by themselves. Educating students about the importance of transparency,
data integrity, and methodological rigour lays the foundation for a more
scientifically literate and critically minded society. By fostering these skills
from the beginning of their education, we can equip future generations with the
tools they need to navigate the complex and information-rich world.
#leftblank(weak: false)
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/type_check/op_type_of.typ | typst | Apache License 2.0 | #let f(x) = {
assert(type(x) == int)
};
|
https://github.com/medewitt/bio720 | https://raw.githubusercontent.com/medewitt/bio720/main/bio2-module-1.typ | typst | BSD 3-Clause "New" or "Revised" License | #import "template.typ": *
#show: ams-article.with(
title: "Virology",
authors: (
(
name: "<NAME>",
department: [Department of Biology],
organization: [Wake Forest University],
location: [Winston Salem, NC 27101],
email: "<EMAIL>",
url: "www.michaeldewittjr.com"
),
),
abstract: "Caveat Emptor",
bibliography-file: "integratedbio.bib",
)
#set heading(numbering: "1.")
#let today = datetime.today()
= Esstman
- Biology UG
- PhD at Vanderbilt at SOM in Coronaviruses
- This occured during SARS outbreak 2004
- 8th grade science teaching after PhD
- Postdoc at NIH on rotavirus (5 years)
- UVA SOM (Carilion)
- 2017 came to WFU as part of the BME major with Wake Downtown
Research
- Rotaviruses replication and evolution with a focus on viral genome replication amd assebly viral evolution
Kids 13, 14, 15 -> husban Sam
= Exam
Will be a take on examine which will tie together topics from the course.
= Central Dogma
Central Dogma of Molecular biology- transcription of DNA to RNA which are then translated into proteins.
- Genes
- Machinery
== Molecular Virology
- Basically just self-genes which take over he cells machinery
- the struce and function of viral genes at the molecular level
- the mechanism by which viral genes are expressed and regularated
== Molecular biology
Methods are used in almost any lab that does wet lab work.
== Structure
== DNA
- 4 nitrogenous bases (A, G, C, T)
- 2 ring or one ring structure (purine; A and G)
- 1 regin structure is a (pyridimine; C and T)
- Base + sugar (5 carbon) = Nucleoside
- Phosphoralated is a is a nucleotide (can be up to three)
- Can be attached at the and 5' (phosphate group attached) where the 3' OH oxygens are present
- Two strands run 5' to 3'.
- Within strand phosphodiester bond (covalent) (G to C; A to T)
- Hydrongen bond between the two strands
- Human genome is 3 Billion base pairs
- Highly condensed and also functions as a regulatory mechanism
== RNA
- 4 nitrogenous pairs (A, G, C, U)
- OH on 2' and 3' (Ribose sugar)
- RNA is not fully linear
- RNA will fold based on intramolecular base pairing (A to U; G to C)
- Proteins within the cell will bind
- Many types of RNA some of which can function as catalytic machines (e.g., ribosomes)
- RNA in the ribosomes catalyzes assembly
#figure(image("2024-01-17-10-02-54.png"))
Proteins are made up of 20 different amino acids each differning in their side chains (R groups).
Together they can generate different chemistries.
Proteins
- N (amino) terminus
- C (carboxy) terminus
- Bound using peptide bond
== Eurokayotic
Transcription occurs in the nucleus while translation occurs in the cytoplasm.
While all cells have the same DNA different genes are expressed (e.g., hemeaglobin only turned on in red blood cells).
Can be modulated at any point in protein synthesis.
Gene expression is regulated by environmental cues which activate cell signalling
Post translational modification
- kinase (Add P)
- phospotase (remove P)
= Transcription of DNA into RNA
Process by which regions of the DNA are "copied" into RNA molecules.
Transcription is the synthesis of all types of mRNA, tRNA, rRNA.
1. Initiation occurs when rna polymerase binds to DNA and opens the site allowing a transcription bubble
2. Elogation- polymase switches to elongation and promoter will initate
3. Termination - release of DNA
Bacteria are much more simple with 4 proteins to put things together.
Eurokayotic cells have 300 different polypetides come together with three different identified polymerases
All are macromolecular complexes
RNA Polymerase I (pre-rRNA)
RNA polymerase II (mRNA, snRNAs, scRNAs) also called RNAP2
RNA Polymerase II (tRNA, 5S rRNA. sn RNAs, scRNAs)
Three different classes of proteins make up RNAP2
3 "groups"
1. Rpbs composed of 12 groups
2. GTF general transcription factors (TFIIs)
- Catalytic core contains the catalytic core, but catalytic core cannot bind. Core transcription factors will direct and bind DNA directly
3. Mediator is a complex made of many peptides
Rate limiting step is generally recruiting and activating this complex.
== Overview of Transcription
General transcription factors recruited to the promoter on the DNA.
TATA is a highly conserved region in promoters
The TATA-binding protein bind here
BRE TFIIB will bind
Inr is initator
DCE or downstream core elements can replace TATA in TATAless promoters
TFIIH important for opening the bubble as a helicase
Termination - there will be a transcription stop sequence (stop codons are for translation not transcription)
AAUAAA in the pre-mRNA
|
https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/lift/brainstorm.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/packages.typ": notebookinator
#import notebookinator: *
#import themes.radial.components: *
#show: create-body-entry.with(
title: "Brainstorm: Elevation",
type: "brainstorm",
date: datetime(year: 2024, month: 1, day: 03),
author: "<NAME>",
witness: "Violet Ridge",
)
= Choices
There were several different options regarding the hang and how to lift our
robot to B tier.
#grid(
columns: (1fr, 1fr),
gutter: 20pt,
[
== Piston Lift
#pro-con(pros: [
- Does not require motors
- Easy for driver to use
- Can elevate shooting mechanism
], cons: [
- Effectiveness could be reduced if pressure is lowered during match
- Requires pneumatics
])
],
image("./piston.svg"),
[
== Balance Mechanism
A small protrusion, deployed during a match, could allow the driver to balance
the robot on the barrier. This would ideally be passive.
#pro-con(pros: [
- Does not require any actuators, pneumatics or motors.
- Can be used in multiple locations on the barrier.
], cons: [
- Hard to use for driver
- Very limited in height of hang
- Puts large amounts of strain on robot
])
],
image("./balance.svg"),
[
== PTO Lift
Power from drivetrain motors could be moved to power a lever which could lift
the robot. Moving the power would require PTO.
#pro-con(pros: [
- Could allow for a very high hang
- Uses motors which would otherwise be dead weight in a hang
], cons: [
- Very hard to design and fabricate
- Experience in PTO is very limited
- Many points of failure
])
],
image("./pto.svg"),
)
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1E800.typ | typst | Apache License 2.0 | #let data = (
("MENDE KIKAKUI SYLLABLE M001 KI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M002 KA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M003 KU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M065 KEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M095 KE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M076 KOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M048 KO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M179 KUA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M004 WI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M005 WA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M006 WU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M126 WEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M118 WE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M114 WOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M045 WO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M194 WUI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M143 WEI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M061 WVI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M049 WVA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M139 WVE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M007 MIN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M008 MAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M009 MUN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M059 MEN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M094 MON", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M154 MUAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M189 MUEN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M010 BI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M011 BA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M012 BU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M150 BEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M097 BE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M103 BOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M138 BO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M013 I", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M014 A", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M015 U", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M163 EE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M100 E", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M165 OO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M147 O", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M137 EI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M131 IN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M135 IN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M195 AN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M178 EN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M019 SI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M020 SA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M021 SU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M162 SEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M116 SE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M136 SOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M079 SO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M196 SIA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M025 LI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M026 LA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M027 LU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M084 LEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M073 LE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M054 LOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M153 LO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M110 LONG LE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M016 DI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M017 DA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M018 DU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M089 DEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M180 DOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M181 DO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M022 TI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M023 TA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M024 TU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M091 TEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M055 TE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M104 TOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M069 TO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M028 JI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M029 JA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M030 JU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M157 JEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M113 JE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M160 JOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M063 JO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M175 LONG JO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M031 YI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M032 YA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M033 YU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M109 YEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M080 YE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M141 YOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M121 YO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M034 FI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M035 FA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M036 FU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M078 FEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M075 FE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M133 FOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M088 FO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M197 FUA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M101 FAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M037 NIN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M038 NAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M039 NUN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M117 NEN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M169 NON", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M176 HI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M041 HA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M186 HU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M040 HEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M096 HE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M042 HOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M140 HO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M083 HEEI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M128 HOOU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M053 HIN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M130 HAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M087 HUN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M052 HEN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M193 HON", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M046 HUAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M090 NGGI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M043 NGGA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M082 NGGU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M115 NGGEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M146 NGGE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M156 NGGOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M120 NGGO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M159 NGGAA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M127 NGGUA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M086 LONG NGGE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M106 LONG NGGOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M183 LONG NGGO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M155 GI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M111 GA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M168 GU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M190 GEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M166 GUEI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M167 GUAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M184 NGEN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M057 NGON", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M177 NGUAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M068 PI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M099 PA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M050 PU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M081 PEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M051 PE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M102 POO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M066 PO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M145 MBI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M062 MBA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M122 MBU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M047 MBEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M188 MBEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M072 MBE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M172 MBOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M174 MBO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M187 MBUU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M161 LONG MBE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M105 LONG MBOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M142 LONG MBO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M132 KPI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M092 KPA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M074 KPU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M044 KPEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M108 KPE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M112 KPOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M158 KPO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M124 GBI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M056 GBA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M148 GBU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M093 GBEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M107 GBE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M071 GBOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M070 GBO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M171 RA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M123 NDI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M129 NDA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M125 NDU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M191 NDEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M119 NDE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M067 NDOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M064 NDO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M152 NJA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M192 NJU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M149 NJEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M134 NJOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M182 VI", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M185 VA", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M151 VU", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M173 VEE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M085 VE", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M144 VOO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M077 VO", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M164 NYIN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M058 NYAN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M170 NYUN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M098 NYEN", "Lo", 0),
("MENDE KIKAKUI SYLLABLE M060 NYON", "Lo", 0),
(),
(),
("MENDE KIKAKUI DIGIT ONE", "No", 0),
("MENDE KIKAKUI DIGIT TWO", "No", 0),
("MENDE KIKAKUI DIGIT THREE", "No", 0),
("MENDE KIKAKUI DIGIT FOUR", "No", 0),
("MENDE KIKAKUI DIGIT FIVE", "No", 0),
("MENDE KIKAKUI DIGIT SIX", "No", 0),
("MENDE KIKAKUI DIGIT SEVEN", "No", 0),
("MENDE KIKAKUI DIGIT EIGHT", "No", 0),
("MENDE KIKAKUI DIGIT NINE", "No", 0),
("MENDE KIKAKUI COMBINING NUMBER TEENS", "Mn", 220),
("MENDE KIKAKUI COMBINING NUMBER TENS", "Mn", 220),
("MENDE KIKAKUI COMBINING NUMBER HUNDREDS", "Mn", 220),
("MENDE KIKAKUI COMBINING NUMBER THOUSANDS", "Mn", 220),
("MENDE KIKAKUI COMBINING NUMBER TEN THOUSANDS", "Mn", 220),
("MENDE KIKAKUI COMBINING NUMBER HUNDRED THOUSANDS", "Mn", 220),
("MENDE KIKAKUI COMBINING NUMBER MILLIONS", "Mn", 220),
)
|
https://github.com/Pegacraft/typst-plotting | https://raw.githubusercontent.com/Pegacraft/typst-plotting/master/lib.typ | typst | MIT License | #import "/plotst/plotting.typ": plot, overlay, scatter_plot, graph_plot, histogram, pie_chart, bar_chart, radar_chart
#import "/plotst/axis.typ": axis
#import "/plotst/util/classify.typ": class, class_generator, classify, compare
|
https://github.com/royfrancis/quarto-typst-certificate | https://raw.githubusercontent.com/royfrancis/quarto-typst-certificate/main/index.typ | typst | // Some definitions presupposed by pandoc's typst output.
#let blockquote(body) = [
#set text( size: 0.92em )
#block(inset: (left: 1.5em, top: 0.2em, bottom: 0.2em))[#body]
]
#let horizontalrule = [
#line(start: (25%,0%), end: (75%,0%))
]
#let endnote(num, contents) = [
#stack(dir: ltr, spacing: 3pt, super[#num], contents)
]
#show terms: it => {
it.children
.map(child => [
#strong[#child.term]
#block(inset: (left: 1.5em, top: -0.4em))[#child.description]
])
.join()
}
// Some quarto-specific definitions.
#show raw.where(block: true): block.with(
fill: luma(230),
width: 100%,
inset: 8pt,
radius: 2pt
)
#let block_with_new_content(old_block, new_content) = {
let d = (:)
let fields = old_block.fields()
fields.remove("body")
if fields.at("below", default: none) != none {
// TODO: this is a hack because below is a "synthesized element"
// according to the experts in the typst discord...
fields.below = fields.below.amount
}
return block.with(..fields)(new_content)
}
#let empty(v) = {
if type(v) == "string" {
// two dollar signs here because we're technically inside
// a Pandoc template :grimace:
v.matches(regex("^\\s*$")).at(0, default: none) != none
} else if type(v) == "content" {
if v.at("text", default: none) != none {
return empty(v.text)
}
for child in v.at("children", default: ()) {
if not empty(child) {
return false
}
}
return true
}
}
#show figure: it => {
if type(it.kind) != "string" {
return it
}
let kind_match = it.kind.matches(regex("^quarto-callout-(.*)")).at(0, default: none)
if kind_match == none {
return it
}
let kind = kind_match.captures.at(0, default: "other")
kind = upper(kind.first()) + kind.slice(1)
// now we pull apart the callout and reassemble it with the crossref name and counter
// when we cleanup pandoc's emitted code to avoid spaces this will have to change
let old_callout = it.body.children.at(1).body.children.at(1)
let old_title_block = old_callout.body.children.at(0)
let old_title = old_title_block.body.body.children.at(2)
// TODO use custom separator if available
let new_title = if empty(old_title) {
[#kind #it.counter.display()]
} else {
[#kind #it.counter.display(): #old_title]
}
let new_title_block = block_with_new_content(
old_title_block,
block_with_new_content(
old_title_block.body,
old_title_block.body.body.children.at(0) +
old_title_block.body.body.children.at(1) +
new_title))
block_with_new_content(old_callout,
new_title_block +
old_callout.body.children.at(1))
}
#show ref: it => locate(loc => {
let target = query(it.target, loc).first()
if it.at("supplement", default: none) == none {
it
return
}
let sup = it.supplement.text.matches(regex("^45127368-afa1-446a-820f-fc64c546b2c5%(.*)")).at(0, default: none)
if sup != none {
let parent_id = sup.captures.first()
let parent_figure = query(label(parent_id), loc).first()
let parent_location = parent_figure.location()
let counters = numbering(
parent_figure.at("numbering"),
..parent_figure.at("counter").at(parent_location))
let subcounter = numbering(
target.at("numbering"),
..target.at("counter").at(target.location()))
// NOTE there's a nonbreaking space in the block below
link(target.location(), [#parent_figure.at("supplement") #counters#subcounter])
} else {
it
}
})
// 2023-10-09: #fa-icon("fa-info") is not working, so we'll eval "#fa-info()" instead
#let callout(body: [], title: "Callout", background_color: rgb("#dddddd"), icon: none, icon_color: black) = {
block(
breakable: false,
fill: background_color,
stroke: (paint: icon_color, thickness: 0.5pt, cap: "round"),
width: 100%,
radius: 2pt,
block(
inset: 1pt,
width: 100%,
below: 0pt,
block(
fill: background_color,
width: 100%,
inset: 8pt)[#text(icon_color, weight: 900)[#icon] #title]) +
block(
inset: 1pt,
width: 100%,
block(fill: white, width: 100%, inset: 8pt, body)))
}
#set text(font: "Lato", fill: rgb("#444444"))
#set par(leading: 0.7em)
#set block(spacing: 1.4em)
#let nbis-certificate(
title: none,
date: none,
headnotes-1: none,
headnotes-2: none,
gap: 72pt,
participant: none,
bg-image: none,
logo-image: none,
sign-image: none,
sign-height: 15mm,
teacher: none,
footnotes: none,
version: "Unknown",
body
) = {
// body
set text(12.5pt)
set page(
margin: (left: 2.5cm, right: 2.5cm, top: 4.5cm, bottom: 5cm),
background: if bg-image != none {
place(center + top, image(bg-image.path, height: 100%))
},
header: grid(
columns: (1fr, 1fr),
row-gutter: 0pt,
grid(
columns: 1fr,
rows: (12pt, 14pt),
row-gutter: 2.5pt,
text(weight: "medium", size: 11pt, tracking: 1.05pt, align(left + bottom, headnotes-1)),
text(weight: "medium", size: 14pt, tracking: 1.1pt, align(left + bottom, headnotes-2))
),
align(right, image(logo-image.path, height: 13mm))
),
footer: {
set text(8pt)
set par(leading: 0.5em)
set block(spacing: 1em)
set par(justify: true)
footnotes
set text(6pt)
pad(top: 1pt, version + h(1pt) + date)
}
)
// configure headings.
show heading.where(level: 1): set text(1.1em)
show heading.where(level: 1): set par(leading: 0.4em)
show heading.where(level: 1): set block(below: 0.8em)
show heading: it => {
set text(weight: 600) if it.level > 2
it
}
// underline links.
show link: underline
// page body
grid(
columns: 1fr,
row-gutter: 20pt,
// title.
pad(
top: 10pt,
bottom: gap,
text(36pt, weight: 700, tracking: 1.3pt, title)
),
// participant name
text(22pt, weight: 600, participant),
// body flow
{
set par(justify: true)
body
if sign-image != none {
image(sign-image.path, height: sign-height)
}
teacher
}
)
}
#show: nbis-certificate.with(
title: "Certificate",
headnotes-1: [www.nbis.se],
headnotes-2: [NBIS • TRAINING],
participant: [<NAME>],
bg-image: (
path: "assets/background.png"
),
logo-image: (
path: "assets/logo.png"
),
sign-image: (
path: "assets/signature.png"
),
teacher: [Course Leader | #strong[<NAME>, PhD] \
Associate Professor in Bioinformatics \
NBIS | Uppsala University
],
footnotes: [This is a certificate of participation. Participants are not evaluated. \
#strong[National Bioinformatics Infrastructure Sweden \(NBIS)] is a distributed national research infrastructure supported by the Swedish Research Council, Science for Life Laboratory, Knut and Alice Wallenberg Foundation and all major Swedish universities in providing state-of-the-art bioinformatics to the Swedish life science research community.
],
version: [v2.0.],
date: [Printed 03-Apr-2024 at 14:17.],
)
has participated in the NBIS workshop #strong[Advanced analysis of data] \
held in #strong[Uppsala] from #strong[18 Mar - 23 Mar, 2024];. \
\
The workshop consisted of 40 hours of lectures and computer exercises. This included the following topics: \
\
- Introduction to data & data analysis \
- Datatypes and data structures \
- Literate programming using data \
- Loops, conditional statements, functions and variable scope \
- Importing and exporting data \
- Visualization of data \
- Introduction to tidy data \
- Overview of package anatomy
|
|
https://github.com/yhtq/Notes | https://raw.githubusercontent.com/yhtq/Notes/main/计算方法B/code/hw1/hw1.typ | typst | #import "../../template.typ": proof, note, corollary, lemma, theorem, definition, example, remark
#import "../../template.typ": *
#show: note.with(
title: "作业1",
author: "YHTQ",
date: datetime.today().display(),
logo: none,
withOutlined : false,
withTitle : false,
withHeadingNumbering: false
)
= 1.
设 $A$ 是下三角矩阵,求其逆就是要解:
$
A X = I
$
只需对两边同时做行变换即可:
```rust
let mut X = I;
for i in 1..n {
X[i] /= A[i][i];
A[i][i] = 1;
for j in i + 1..n {
X[j] -= X[i] * A[j][i];
A[j][i] = 0;
}
}
```
计算量约为 $n^2$
= 4.
不难发现:
$
mat(1, 0, 0;2, 1, 0; 2, 1, 0)vec(2, 3, 4) = vec(2, 7, 8)
$
= 5.
假设 $A$ 有两种 $L U$ 分解:
$
A = L U = L' U'
$
注意到 $L, U$ 都可逆,因此:
$
Inv((L')) L = Inv(U) U'
$
而熟知上三角矩阵的逆,上三角矩阵乘上三角矩阵都是上三角矩阵,下三角同理,因此上式同时是上三角矩阵和下三角矩阵,只能是对角矩阵,又不难验证 $Inv((L')) L$ 是单位下三角矩阵,因此是单位矩阵,即 $L = L'$,同理 $U = U'$,因此 $L U$ 分解唯一。
= 8.
设 $A$ 的一步 Gauss 消去得到 $A'$,将有:
$
A'[i] = A[i] - (A[i][1]) / (A[1][1]) A[1]
$
因此:
$
a'_(k k) &= a_(k k) - (a_(k 1)) / (a_(1 1)) a_(1 k)\
sum_(j=1, j != k)^k abs(a'_(k j)) &= sum_(j=1, j != k)^k abs(a_(k j) - (a_(k 1)) / (a_(1 1)) a_(1 j))\
&<= sum_(j=2, j != k)^k (abs(a_(k j)) + abs((a_(k 1)) / (a_(1 1)) a_(1 j)))\
&= sum_(j=2, j != k)^k abs(a_(k j)) + (a_(k 1)) / (a_(1 1)) sum_(j=2, j != k)^k abs( a_(1 j))\
&< abs(a_(k k)) - abs(a_(k 1)) + (a_(k 1)) / (a_(1 1)) (abs(a_(1 1)) -a_(1 k) )\
& = abs(a_(k k)) - (a_(k 1)) / (a_(1 1)) a_(1 k) + (a_(k 1))/(a_(1 1)) abs(a_(1 1)) - abs(a_(k 1))\
& <= abs(a_(k k)) - (a_(k 1)) / (a_(1 1)) a_(1 k) + abs(a_(k 1))/abs(a_(1 1)) abs(a_(1 1)) - abs(a_(k 1))\
& <= abs(a_(k k)) - (a_(k 1)) / (a_(1 1)) a_(1 k)\
& = a'_(k k)\
$
证毕
= 10.
无妨设 $a_(1 1) = 1$,并设:
$
A = mat(1, a_(1 2)^T; a_(2 1), A_(2 2))
$
则有:
$
A_2 = A_(2 2) - a_(2 1) a_(1 2)^T
$
任取非零向量 $x$,则:
$
x^T A_2 x = x^T (A_(2 2)) x - (x^T a_(2 1)) (x^T a_(1 2))
$
而:
$
(t, x^T) A vec(t, x)
&= (t, x) mat(1, a_(1 2)^T; a_(2 1), A_(2 2)) vec(t, x)\
&= t^2 + (x^T a_(2 1) + a_(1 2)^T x) t + x^T A_(2 2) x
$
对于任何 $t$ 都正,换言之:
$
4 x^T A_(2 2) x > (x^T a_(2 1) + a_(1 2)^T x)^2 > 4 (x^T a_(2 1)) (x^T a_(1 2)) => x^T a_2 x > 0
$
证毕
= 14.
注意到:
$
A X = e_j
$
的解 $X$ 就是 $Inv(A)$ 的第 $j$ 列,而已知 LU 分解,上面方程是容易解出的,因此 $Inv(A)$ 的 $i j$ 元也容易得到。
= 19.
将等式 $A = L L^T$ 分块分解为:
$
mat(A_i, B^T; B, C) = mat(L_i, 0; B, I) mat(L_i^T, B^T; 0, I)
$
立得 $A_i = L_i L_i^T$,而 $L_i$ 当然是对角元均正的下三角矩阵。 |
|
https://github.com/GuTaoZi/SUSTech-thesis-typst | https://raw.githubusercontent.com/GuTaoZi/SUSTech-thesis-typst/main/template/template.typ | typst | MIT License | #import "abstract_zh.typ" : *
#import "abstract_en.typ" : *
#import "acknowledge.typ" : *
#import "appendix.typ" : *
#import "content_zh.typ" : *
#import "cover_zh.typ" : *
#import "cover_en.typ" : *
#import "decl_zh.typ" : *
#import "decl_en.typ": *
#import "references.typ" : *
#let cover(
en: false,
anonymous: false,
info: (:),
fonts: (:),
) = {
info = (
clc: "CLC",
thesis_id: "Thesis ID",
confidentiality_level: "Confidential Level",
udc: "UDC",
title: "Title",
subtitle: "Subtitle",
author: "Author",
student_id: "Student ID",
department: "Department",
major: "Major",
supervisor: "Supervisor",
submit_date: datetime.today(),
)+info
if en {
cover_en(
anonymous: anonymous,
info: info,
fonts: fonts,
)
} else {
cover_zh(
anonymous: anonymous,
info: info,
fonts: fonts,
)
}
pagebreak(weak: true)
}
#let declare(
en: false,
anonymous: false
) = {
if(en){
decl_en(anonymous: anonymous)
} else {
decl_zh(anonymous: anonymous)
}
pagebreak(weak: true)
}
#let abstract(
show_title: true,
en: false,
anonymous: false,
keywords: (:),
info: (:),
fonts: (:),
body,
) = {
info = (
clc: "CLC",
thesis_id: "Thesis ID",
confidentiality_level: "Confidential Level",
udc: "UDC",
title: "Title",
subtitle: "Subtitle",
author: "Author",
student_id: "Student ID",
department: "Department",
major: "Major",
supervisor: "Supervisor",
submit_date: datetime.today(),
)+info
if(en){
abstract_en(
show_title: show_title,
anonymous: anonymous,
keywords: keywords,
info: info,
fonts: fonts,
)[#body]
} else {
abstract_zh(
show_title: show_title,
anonymous: anonymous,
keywords: keywords,
info: info,
fonts: fonts,
)[#body]
}
pagebreak(weak: true)
}
#let content() = {
content_zh()
pagebreak()
} |
https://github.com/ToxicPie/NaOCl | https://raw.githubusercontent.com/ToxicPie/NaOCl/master/main.typ | typst | #set page(
paper: "a4",
margin: (
top: 32pt, bottom: 32pt,
left: 30pt, right: 20pt,
),
header: [
#set text(weight: "bold")
NYCU_ACtame (National Yang Ming Chiao Tung University)
#h(1fr)
Page #counter(page).display("1/1", both: true)
],
header-ascent: 20%,
footer: [
#set text(weight: "bold")
#set align(center)
2023 ICPC World Finals Luxor
],
footer-descent: 20%,
)
#show raw: set text(
font: "Jetbrains Mono",
ligatures: false,
features: (calt: 0),
size: 7.4pt,
weight: 700,
)
#show raw.line: it => {
if calc.rem(it.number, 2) == 1 {
h(-0.5em)
box(
width: 0em,
align(right, text(fill: gray)[#it.number]),
)
h(0.5em)
}
it.body
}
#import "lib.typ": recursively_render_content
#align(center)[#block(inset: 2em)[
#text(weight: "bold", size: 2em)[
NYCU_ACtame Team Reference Document
]
]]
#columns(2, gutter: 12pt)[
#set text(size: 9.8pt)
#set par(leading: 0.45em)
#outline(indent: auto, title: none)
]
#pagebreak()
#columns(2, gutter: 12pt)[
#set text(size: 9.6pt)
#set par(leading: 0.4em)
#recursively_render_content(yaml("content.yaml"))
]
|
|
https://github.com/refparo/24xx-typst | https://raw.githubusercontent.com/refparo/24xx-typst/master/24xx-zh.typ | typst | Creative Commons Attribution 4.0 International | // inline styling
#set text(
8.5pt, top-edge: 9pt, luma(10%),
font: ("Barlow", "Noto Sans CJK SC"),
weight: 350, stretch: 87.5%,
number-width: "tabular",
lang: "zh", region: "cn", script: "hans",
)
#show regex("[A-Za-z0-9\s]+"): it => {
show text.where(size: 8.5pt): text.with(9pt)
show text.where(size: 7pt): text.with(7.5pt)
show text.where(weight: 350): text.with(weight: 400)
it
}
#show regex("[。.?!,、;:“”‘’『』「」()【】[]〔〕【】—…~·《》〈〉/]+"): set text(font: "Noto Sans CJK SC")
#show "₡": set text(font: "IBM Plex Sans", stretch: 100%)
#show "➡": set text(7.5pt, font: "Noto Sans CJK SC")
#show emph: set text(rgb(37, 101, 136))
// block styling
#let leading = 3pt
#let top-edge = 9pt
#let line-height = leading + top-edge
#let block-spacing = line-height / 2 + leading
#set block(spacing: block-spacing)
#set par(leading: leading, justify: true)
#show heading.where(level: 1): set text(
30pt, top-edge: 25.5pt, baseline: -1.5pt,
weight: 500,
)
#show heading.where(level: 1): it => {
set block(below: 4 * line-height - leading - text.top-edge)
colbreak(weak: true) + it
}
#let marked(marker, gap, content) = context block(
inset: (left: -(gap + measure(marker).width)),
spacing: block-spacing,
grid(
columns: (auto, 1fr),
column-gutter: gap,
marker, content
)
)
#show heading.where(level: 2): it => {
set text(
8.5pt, top-edge: 9pt, rgb(255, 47, 23),
weight: 350,
)
marked(
text(
6pt, baseline: -0.75pt,
font: "Noto Sans CJK SC",
"▶"
),
2pt,
it.body
)
}
#let design-note(text-fill: rgb(50, 165, 194), content) = {
set text(text-fill, style: "italic")
marked(text(tracking: -1pt, "//"), 2.5pt, content)
}
#set enum(numbering: "1", body-indent: 1em)
#let columns-full(count, body) = context {
let line-height = measure("1").height + par.leading
let line-count = calc.ceil(
(measure(body).height + par.leading) /
(line-height * count)
)
block(
height: line-height * line-count - par.leading,
spacing: block-spacing,
columns(count, gutter: (100% - measure(body).width * count) / count, block(body))
)
}
#let footer(body) = {
set text(
7pt, top-edge: 6pt, rgb(133, 142, 140),
style: "italic"
)
set par(leading: 3pt)
body
}
// document styling
#set document(
title: "24XX 系统参考文档",
author: ("<NAME>", "Paro")
)
#let page-margin = (
x: (148mm - 8.5pt * 43) / 3,
y: (210mm - line-height * 46.5) / 2,
)
#set page(paper: "a5")
#set columns(gutter: page-margin.x)
// ===================
// content begins here
// ===================
#set page(margin: 0pt)
#place(image("cover.png", width: 100%))
#let heading-line-1 = {
set text(125pt, top-edge: 89pt)
h(-6pt)
text(stretch: 87.5%)[24]
text(stretch: 75%)[XX]
h(4.5pt)
}
#let heading-line-2 = {
h(-1.5pt)
text(
18pt, top-edge: 22pt,
"系统参考文档".codepoints().join(h(1fr))
)
}
// Typst currently doesn't support blending modes
// so this is a rough emulation
#context block(
width: 100%, height: 100%,
inset: page-margin,
fill: rgb(92.5%, 92.5%, 100%, 6%),
block(width: measure(heading-line-1).width)[
#set par(leading: 0pt)
#set text(fill: rgb(70%, 70%, 100%, 22.5%))
= #stack(heading-line-1, heading-line-2)
]
)
// page 1
#set page(
margin: page-margin,
columns: 2,
)
= 规则
*游戏*:玩家描述各自的角色要做什么。如果他们的行动不可能实现,需要付出代价,需要额外的步骤,或者带有风险,GM 应该告知。在确认行动之前,玩家可以调整计划,从而改变目标和赌注。只有想要_避免风险_时才需要掷骰。
*掷骰*:投一个_技能骰_——一般是 d6,有相关技能时会更高。如果被伤势或情势_阻碍_,就改为 d4。如果情势对行动有_帮助_,就多投一个 d6;如果有同伴_帮助_,那么同伴也投自己的技能骰,然后分担风险。取结果最高的骰子。
#grid(
columns: (auto, 1fr),
column-gutter: 0.5em,
row-gutter: leading,
[*1–2*], [*灾难。*你完整承受风险。GM 决定你是否成功。如果有死亡风险,你就死了。],
[*3–4*], [*挫折。*承受减轻的后果或者只能达成部分成功。如果有死亡风险,你会受伤。],
[*5+*], [*成功。*投得越高,结果越好。]
)
如果成功无法实现你的目的(“你开了枪,但它防弹!”),你至少会得到有用的信息或者建立优势。
*负重*:携带的物品量在合理范围内即可,但携带一件以上的_沉重_物品可能会阻碍你行动。
*提升*:每次任务后,每个角色可以提升一个技能(_无 ➡ d8 ➡ d10 ➡ d12_),并且获得 d6 信用点(₡)。
*防御*:被命中时,你可以描述你的一件物品_损坏_来把代价换成一个短暂的_阻碍_。_损坏_的装备在修好前都毫无用处。
*伤害*:伤害需要时间和/或医疗看护才能恢复。死亡时,尽快创建一个新角色加入游戏。参与度优先于真实性。
*GM*:不要用技能骰,而要从角色的行为、给玩家带来的风险和障碍等方面描述你的角色。带领大家设置游戏中不可越过的界限。用_快进、暂停、倒带/重做_等方式控制节奏,确保安全;并且鼓励玩家也这么做。提出你自己也不知道怎么解决的两难问题。不断转换焦点,让每个人都有表现的机会。有需要时,掷骰决定是否该有坏运气(例如用完了弹药,或者碰上了守卫)——投一个骰子决定是有(1–2)麻烦,还是(3–4)麻烦的征兆。用即兴裁决填补规则中的空白;休息时,和玩家一起回顾不够好的裁决。
= 角色
#design-note[像这种用双斜杠开头的段落是 SRD 设计注释。其它段落都是面向玩家或 GM 的文本。]
#design-note[角色的初始技能提升和物品所值的信用点数之和大约为 6,其中可以包括来自“专业”和“起源”的技能(“起源”也可以用“3 项技能提升”代替)。]
== 选择你角色的*专业*。
*露面*:擅长_读懂他人_(d8)和_欺骗_(d8)。拥有一个_种类齐全的易容衣柜_。
*蛮力*:擅长_威吓_(d8),以及_近战_(d8)或者_射击_(d8)。拥有一把_剑_,_枪械_或_义手_。
*灵能*:擅长_心灵感应_(d8,感知浅层思维)和_念动术_(d8,力量和你的手臂一样),或者选择其一提升到 d10。拥有_一瓶灵能爆发_(增幅灵能力,有成瘾性)。
*医疗*:擅长_医药_(d8)和_电子_(d8)。拥有一个_医疗包_和一套_义体手术工具_(_沉重_)。
*潜行*:擅长_攀爬_(d8)和_隐匿_(d8)。拥有一套_攀爬装备_和一副_夜视眼镜_。
*科技*:擅长_骇侵_(d8)和_电子_(d8)。拥有一套_修理工具_和一台_定制电脑_(_沉重_)。
== 选择你角色的*起源*。
*外星人*:编 2 个特征,例如_电流_、_翅膀_、_天生迷彩_、_六条肢体_。
*仿生人*:你有一个准备好升级的仿生身体。选择_合成皮肤_(看起来像人类)或者_外壳_(防御时可以无害地损坏)。提升一个技能。
*人类*:获得 3 个技能提升(从_无技能 ➡ d8 ➡ d10 ➡ d12_)。你可以选择新技能,也可以提升已有的技能。
== 选择或者编造起源给予的*技能*。
攀爬,社会关系,欺骗,电子,引擎,爆炸物,骇侵,近战,威吓,体力劳动,游说,驾驶,奔跑,射击,太空行走,隐匿,追踪
#design-note[如果角色的初始技能比这更宽泛,那么应该减少其数目,或者使其没那么有用。]
// page 2
= 装备
#design-note[如果一件物品比一台新游戏主机还便宜,那么唯一的开销就是取得它的时间。]
== 你有一部*_通讯器_*(手机)和 ₡2。大多数物品和升级每个价格 ₡1。忽略一把小刀和一顿饭之类的不到一信用点的交易。
*护甲*:_防弹背心_(可以损坏一次作为_防御_),_战斗护甲_(₡2,_沉重_,最多损坏 3 次),_动力甲_(₡3,_沉重_,最多损坏 3 次,真空级,磁力靴)。
*义体*:_义耳_(升级有_回声定位、语音压力检测器_),_义眼_(升级有_红外视觉、望远视觉、透视_),_义肢_(升级有_迅速、强力、储物仓、植入工具或武器_),_颅后接口_(升级有_感官数据备份、技能提升_),_纳米治疗机器人,毒素过滤器,变声器_。
*工具*:_火焰喷射器(沉重),低重力喷气背包,医学扫描器,迷你无人机,修理工具,侦察工具包_(攀爬工具、信号枪、帐篷;_沉重_)。
*武器*:_手榴弹_(4 枚,可以是_破片榴弹、闪光弹、烟雾弹_或 _EMP(电磁脉冲)榴弹_),_手枪,步枪(沉重),霰弹枪(沉重),电棍,麻醉枪_。
== *飞船*都带有以下功能的基础版本;每个升级花费 ₡10。紧急情况下,玩家选择一个行动来实施或者_帮助_。
*通讯器*:升级有_窃听器、干扰器、快子喷流_(恒星系内消除延迟)。
*船只*:自带_逃生舱_。升级有_战斗机、穿梭机_(可重入大气层)。
*引擎*:支持超光速跃迁和亚光速航行。升级有_增大跃迁距离、加快航行速度、提高机动性_。
*设备*:自带全体船员的_真空服_。升级有_军械库、重型装载机、挖矿装备、缆绳_。
*船体护甲*:_防御_时可以无害地损坏。升级有_可重入大气层、遮阳罩_。
*传感器*:升级有_深空探测、生命迹象扫描、行星勘测、战术舰艇扫描_。
*武器*:自带自动炮台。升级有_激光切割器、军用级炮台、鱼雷_。
= 细节
#design-note[额外的角色和设定细节通常需要针对具体设定定制(尤其是涉及到外星人和时尚)。下面的选项可以随意取用,它们应该能用到很多科幻设定里。]
== 编造或骰出*个人细节*。
*姓氏*
#columns-full(4)[
+ 艾克
+ 布莱克
+ 克鲁兹
+ 达拉斯
+ 恩格尔
+ 福克斯
+ 吉
+ 哈克
+ 艾耶
+ 约什
+ 卡斯克
+ 李
+ 莫斯
+ 纳什
+ 帕克
+ 卡迪尔
+ 辛格
+ 特兰
+ 上田
+ 郑
]
*绰号*
#columns-full(4)[
+ Ace
+ Bliss
+ Crater
+ Dart
+ Edge
+ Fuse
+ Gray
+ Huggy
+ Ice
+ Jinx
+ Killer
+ Lucky
+ Mix
+ Nine
+ Prof
+ Red
+ Sunny
+ Treble
+ V8
+ Zero
]
*举止*
#columns-full(2)[
+ 战战兢兢
+ 审时度势
+ 直率
+ 忧心忡忡
+ 沉稳
+ 随意
+ 冷漠
+ 好奇
+ 表现欲强
+ 拘谨
+ 迟钝
+ 真诚
+ 正经
+ 温和
+ 天真
+ 万事通
+ 易怒
+ 鲁莽
+ 简截了当
+ 厌烦
]
*飞船名*
#columns-full(2)[
+ 亚里安号
+ 黑杰克号
+ 卡鲁奇号
+ 金丝雀号
+ 奇想号
+ 机遇号
+ 飞鱼号
+ 福龙号
+ 公路之星号
+ 登月号
+ 摩根斯坦恩号
+ 凤凰号
+ 游集号
+ 无休号
+ 银光号
+ 星尘号
+ 逐日号
+ 雨燕号
+ 雷霆之路号
+ 旅人号
]
// back page
#set page(
margin: (
top: page-margin.y - block-spacing,
bottom: page-margin.y + line-height * 3.5
),
footer-descent: 15pt,
footer: footer[
*译注*:翻译绰号超出了译者的能力范围。“黑杰克”(Blackjack)即纸牌游戏二十一点,但“二十一点”不适合作飞船名。“卡鲁奇”(Caleuche)是智利南部原住民马普切神话中的一艘幽灵船。
版本 1.41.typ.2 • 文本、排版和 24XX logo 均 CC BY <NAME> • 美术 CC BY Beeple (<NAME>) • 中文翻译 CC BY Paro
]
)
#place(hide[= 封底])
#block(
fill: rgb(37, 101, 136),
inset: (bottom: line-height),
outset: (x: 7pt, top: 15pt)
)[
#set text(white, style: "italic")
#text(tracking: -1pt, "//") *开端*:解释设定的基本要素。如果在其它地方还没有解释清楚,那么给出一个让角色团结起来的理由,并且提示角色应该把大部分时间用在什么活动上。
]
#design-note[*封底*:如果你想模仿这个 SRD 背后的一系列微型 RPG 的风格,这个封底(或者一张信纸尺寸的白纸的一面的左半边)能放下四张 20 个条目的随机表。GM 可以用这些表格为一场即兴游戏生成灵感,比如:“[姓名] 雇了你在 [地点] 执行 [任务],但有个 [转折]!”下面有一个范例随机表。]
#design-note[*补充规则*:这个 SRD 非常简短,这是希望有经验的 RPG 玩家能大胆填补其中的空缺,而 RPG 新人则不会有太多先入为主的观点。所有模糊之处都是有意供开放解读。(例如:你能在一次掷骰中同时获得来自同伴和情势的帮助骰吗?这由你决定!)可以按需扩展或澄清规则。我自己引入新规则的原则是尽可能减少加减计算,避免太多记账工作(考虑到已经要记录信用点、阻碍、沉重物品的数量,还有哪些物品损坏),尽量选用含义显而易见或者模糊得诱人的词汇。]
== *投 d20 生成一个联系人、客户、对手或目标。*
+ 阿尔钦博托,古怪的科技商人兼工匠
+ 极光,富有的独特物品收藏家
+ 熄灯人,安静的证据清除专家
+ 漂白者,看护仿生人转变成的讥讽的刺客
+ 布朗,有一只金属手臂的阴沉的警卫队长
+ 子弹,严肃的仿生人军火贩子
+ 外卖员,有一双飞快义腿的狂妄信使
+ 渔人,正在热切地寻找队员的街头小子
+ 参,关爱世人的毒品贩子
+ 红人,极其谨慎的销赃人
+ 凯撒,穿着银色西装,爱咧嘴笑的放贷人
+ 奥西里斯,疲惫的街头外科医生
+ 粉蓝,出价慷慨的仿生人中间人
+ 雷彻,严厉的雇佣兵战术小队队长
+ 犀牛,愚钝而慷慨正直的保镖
+ 山姆,容易被害的勇敢记者
+ 变速箱,卖力的地下拆车厂主
+ 分眼,高效的情报贩子
+ 吹哨人,微笑的出租车/接头车司机
+ “X”,为不知名公司服务的冷静的中间人
== *投 d6 找一个任务。花费 ₡1 重骰。*
#grid(
columns: (auto, 1fr),
column-gutter: 0.5em,
row-gutter: leading,
[1–2], [没找到。要想有任务就得欠别人点东西。],
[3–4], [找到了一个任务,但有哪里不对。],
[5-6], [有两个任务可供选择。]
)
#v(6pt)
#design-note[*寻找任务*:许多团队不需要为了获取报酬而找工作(比如军事单位)。不过,如果你的游戏确实采用了这种安排,那么危险的任务应该有更多回报,这样才付得起那些用来医疗,修理、更换损坏的装备,重骰坏任务,以及熬过找不到任务的空窗期的 1–3 信用点的“开支”。另外,上面这张表中的“欠别人点东西”这个短语被有意模糊化了。或许值得将其澄清或引申到其它方面(比如把一个放贷人加进你的“联系人”表)。]
#design-note[*任务*:任务(或者情景等)的列表应该针对你的设定定制,并且要能引出让每个角色的技能都用得上的场景。常见的任务模板有“解决一个罕见的威胁”“调查某个难以解释的东西”和“为某人从某地取得一件物品”。它们起着“可玩设定”的作用——既要包含能暗示游戏设定的元素,又要能直接用在游戏中。]
#design-note(text-fill: rgb(50, 145, 73))[*授权协议*:这个 SRD 以 Creative Commons Attribution 4.0 协议(#underline[CC BY 4.0])发布。你可以在你自己的游戏里随意使用这里的文本和排版,前提是你遵从这些要求:]
#design-note(text-fill: rgb(50, 145, 73))[注明作者:看到这一页底下的小字了吗?那就是我用来塞下版本号和第三方内容(比如封面美术)的署名的地方。你也可以把它放在你游戏里的其它位置,但一定记得写这么一句——比如:“24XX 规则由 J<NAME> 以 CC BY 授权。”]
#design-note(text-fill: rgb(50, 145, 73))[用 24XX,别用 2400:你可以说你的游戏“与 2400 兼容”或者“可用于 2400”,但请不要直接使用来自 2400 的材料,或者把你的游戏命名成像是我的 2400 系列的一部分一样(除非你得到了我的明确允许)。]
#design-note(text-fill: rgb(50, 145, 73))[拒绝偏见:请不要在任何宣扬或者纵容白人至上主义、种族主义、厌女、歧视残疾人、恐同、恐跨,或者其它对边缘群体的偏见的产品中使用来自这个游戏的任何文本、24XX logo 或是我的名字。]
|
https://github.com/university-makino/Microcomputer-control-and-exercises | https://raw.githubusercontent.com/university-makino/Microcomputer-control-and-exercises/master/report/プレレポート5/report.typ | typst | // ライブラリの実装 //
#import "@preview/codelst:2.0.1": sourcecode
#import "@preview/i-figured:0.2.4"
//フォント設定//
#let gothic = "YuMincho"
//本文フォント//
#set text(11pt, font: gothic, lang: "ja")
//タイトル- 見出しフォント//
#set heading(numbering: "1.1")
#let heading_font(body) = {
show regex("[\p{scx: Han}\p{scx: Hira}\p{scx: Kana}]"): set text(font: gothic)
body
}
#show heading: heading_font
// ページ設定 //
#set page(
paper: "a4",
margin: (x: 25mm, y: 25mm),
columns: 1,
//fill: 背景色,
numbering: "1",
number-align: center,
header: [
#set text(8pt)
]
)
// 数式の表示の仕方を表示 //
#set math.equation(numbering: "(1)")
// 図の表示の仕方を表示 //
// #show heading: i-figured.reset-counters.with(level: 2)
// #show figure: i-figured.show-figure.with(level: 2)
//タイトルページここから//
#align(right, text()[
#text[提出日]#datetime.today().display("[year]年[month]月[day]日")
])
#v(150pt)
#align(center, text(30pt)[
#heading_font[*プレ- レポート5*]
])
// #align(center, text(14pt)[
// #heading_font[*サブタイトル*]
// ])
#v(1fr)
#align(right)[
#table(
columns:(auto, auto),
align: (right, left),
stroke: none,
[講義名],[マイコン制御および演習],
[担当教員],[伊藤 暢浩先生],
[],[],
[学籍番号],[k22120],
[所属],[情報科学部 情報科学科],
[学年],[3年],
[氏名],[牧野遥斗]
)
]
#pagebreak()
// 目次
#outline(
title: "目次",
depth: 2,
indent: auto,
)
#pagebreak()
//本文ここから//
= プレ- レポート(課題 4)
== @LEDマトリクス の電子部品 ( LEDマトリクス TOM-1588BH-B) を次のような点から調べなさい。
#figure(
image("./img/LEDマトリクス.png",width: 50%),
caption: "LEDマトリクス"
)<LEDマトリクス>
=== どのような部品か
8列8行のドットマトリックスディスプレイで、赤色の発光ダイオードを64個搭載している。
8列8行のLEDで構成されており、各LEDは各列で共通のアノードと各行で共通のカソードを持っている。
電光掲示板や電子時計などに使用される。
=== どのような仕組みか
TOM-1588BH-Bは廃盤となっており、データシートが見つからなかったため、代わりに後継機であるTOM-1588AMG-N について調査した。
@LEDマトリクス回路図 に示すように、各LEDはアノードとカソードに接続されており、アノードに正の電圧を加え、カソードに接地することでLEDを点灯させる @led_matix_oasistek_dataheet。
各LEDは行と列の交点に配置されており、行と列の交点に電圧を加えることで、特定のLEDのみを点灯させることができる。
#figure(
image("./img/LEDマトリクス回路図.png",width: 50%),
caption: "LEDマトリクス回路図"
)<LEDマトリクス回路図>
=== どのような入力を取り扱うのか
電圧を入力として取り扱う。各LEDに対してアノードに正の電圧を加え、カソードに接地することでLEDを点灯させる。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に)
一つ一つのLEDは独立して制御されるため、入力に応じて出力が変化する。各LEDに対してアノードに正の電圧を加え、カソードに接地することでLEDを点灯させる。
=== どのようなピンアサイン (各ピンの役割) か
@LEDマトリクスピンアサイン に示すように、8列8行のLEDマトリクスには、各列に対してアノードが、各行に対してカソードが接続されている。
実際のピンアサインと光る位置は綺麗に並んでいる訳ではないため、ピンアサインを確認しながら接続する必要がある。
#figure(
image("./img/LEDマトリクスピンアサイン.png",width: 90%),
caption: "LEDマトリクスピンアサイン"
)<LEDマトリクスピンアサイン>
=== 正しい動作の条件,範囲は何か
- ピーク順⽅向電流(1/10 デューティ サイクル、0.1ms パルス幅): 80mA
- ドットあたりの消費電⼒ : 75mW
- 連続順⽅向電流 : 20mA
- 推奨動作電流 : 12mA
- 逆電圧 : 5V
- 動作温度範囲 : -25°C 〜 +85°C
- 保管温度範囲 : -30°C 〜 +85°C
- 鉛フリーはんだ温度(座⾯下1/16インチ): 260°C 3秒
#pagebreak() // ページを分ける
== @OJリレー の電子部品 ( リレー OJ-SH-105LM 000) を次のような点から調べなさい。
#figure(
image("./img/OJリレー.jpeg",width: 50%),
caption: "OJリレー"
)<OJリレー>
=== どのような部品か
直流回路の高電圧・高容量緊急遮断を行うリレー。
DC回路の通電はもとより異常発生時に高電圧回路を高速遮断する @relay_omron 。
=== どのような仕組みか <H_リレーの仕組み>
リレーは電気信号を受けて機械的な動きに変えるコイル部と、電気を開閉する接点部で構成される。
コイルに電気信号を流すと、コイル部が磁化して、接点部が動く。
接点部が動くと、電気を開閉できる。
そのため、小さな電流で大きな電流を制御できる。
@リレー仕組み は、リレーの仕組みを図式化して示している @relay_omron2。
#figure(
image("./img/リレー仕組み.png",width: 50%),
caption: "リレー仕組み"
)<リレー仕組み>
=== どのような入力を取り扱うのか
コイルに電気信号を入力として取り扱う。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に)
コイルに電流を流すことで、コイル部が磁化して、接点部が動く @oj_relay_datasheet。
接点部が動くと、電気を開閉できる。
277V 10Aまでの電流を制御できる。
=== どのようなピンアサイン (各ピンの役割) か
@OJリレーピンアサイン に示すように、OJ-SH-105LM 000のピンアサインは以下の通りである @relay_datasheet 。
真っ直ぐに並んでいるピンがコイル部で、L字型に並んでいるピンが接点部である。
#figure(
image("./img/OJリレーピンアサイン.png",width: 50%),
caption: "OJリレーピンアサイン"
)<OJリレーピンアサイン>
=== 正しい動作の条件,範囲は何か
アールエスコンポーネンツ株式会社によると、OJ-SH-105LM 000の仕様は以下の通りである @relay_rs 。
- コイル電圧 : 5V dc
- 接点構成 : SPST
- 取り付けタイプ : 基板実装
- スイッチング電流 : 3A
- 極数 : 1
- ラッチ : なし
- 最大スイッチング電圧 AC : 277V
- 最大スイッチング電圧 DC : 30V dc
- 長さ : 18.2mm
- コイル抵抗 : 125Ω
- コイル電力 : 200mW
- 基準適合 : CQC03001007764, TUV R 50139166, UL E82292, VDE 40007630
- 接点材質 : 銀
- 奥行き : 10.2mm
- 寿命 : 100000回(電気的)、10000000回(機械的)
- コイルと接点間の耐電圧 : 4kVrms
- 動作温度 Max : +90°C
- 高さ : 14.7mm
- 動作温度 Min : -30°C
- シリーズ : OJ
- アプリケーションタイプ : 機器、産業用制御
#pagebreak() // ページを分ける
== @LEDマトリクス の電子部品 ( リレー G5V-2) を次のような点から調べなさい。
#figure(
image("./img/G5リレー.jpg",width: 50%),
caption: "G5リレー"
)<G5リレー>
=== どのような部品か
小型なリレーで、高密度実装に適している。
プラスチックシール・タイプでクロスバ・ツイン接点が標準。耐環境性が高くかつ高信頼性を持つ @relay_omron2 。
=== どのような仕組みか
@H_リレーの仕組み に示すように、リレーはコイル部と接点部で構成される。
小型のリレーであるため、かけれる電圧量が小さめである。
=== どのような入力を取り扱うのか
コイルに電気信号を入力として取り扱う。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に)
コイルに電流を流すことで、コイル部が磁化して、接点部が動く @g5_relay_omron 。
接点部が動くと、電気を開閉できる。
125V 2Aまでの電流を制御できる。
#pagebreak() // ページを分ける
=== どのようなピンアサイン (各ピンの役割) か
@G5リレーピンアサイン に示すように、G5リレーのピンアサインは以下の通りである @g5_relay_omron 。
1と16がコイル部で、2-15が接点部である。
コイル部に電流を流すことで、接点部が動く。
コイル部に電気を流していない時は
4-6, 11-13が接続されており、コイル部に電気を流すことで、4-8, 9-13が接続される。
#figure(
image("./img/G5リレーピンアサイン.png",width: 50%),
caption: "G5リレーピンアサイン"
)<G5リレーピンアサイン>
#pagebreak() // ページを分ける
=== 正しい動作の条件,範囲は何か
OMRON によると、G5V-2の仕様は以下の通りである @g5_relay_omron 。
@リレーの性能表 に示すように、G5V-2の性能表は以下の通りである。
#figure(
table(
columns: 2 * (1fr,) + 1 * (2fr,),
align: center,
table.cell(colspan: 2, "項目"), table.cell(colspan: 1, "基準形"),
["接触抵抗"],[],["50mΩ以下"],
["動作時間"],[],["7ms以下"],
["復帰時間"],[],["3ms以下"],
["絶縁抵抗"],[],["1,000MΩ以上(DC500Vメガ)"],
["耐電圧"],["コイルと接点間"],["AC1,000V 50/60Hz 1min"],
[],["同極接点間"],["AC750V 50/60Hz 1min"],
[],["異極接点間"],["AC1,000V 50/60Hz 1min"],
["振動"],["耐久"],["10~55Hz 片振幅0.75mm(複振幅1.5mm)"],
[],["誤動作"],["10~55Hz 片振幅0.75mm(複振幅1.5mm)"],
["衝撃"],["耐久"],["1,000m/s^2"],
[],["誤動作"],["200m/s^2"],
["耐久性"],["機械的"],["1,500万回以上(開閉ひん度36,000回/h)"],
[],["電気的"],["10万回以上(開閉ひん度1,800回/h)"],
["故障率P水準(参考値\)"],[],["DC10mV 10μA"],
["使用周囲温度"],[],["−25〜+65℃(ただし、氷結および結露しないこと)"],
["使用周囲湿度"],[],["5〜85%RH"],
["質量"],[],["約5g"],
),
caption: [リレーの性能表]
)<リレーの性能表>
#pagebreak() // ページを分ける
== @トランジスタ の電子部品 ( トランジスタ 2SC1815Y) を次のような点から調べなさい。
#figure(
image("./img/トランジスタ.jpg",width: 50%),
caption: "トランジスタ"
)<トランジスタ>
=== どのような部品か
トランジスタは、電気信号を増幅したりスイッチングしたりする機能を持っている。
ラジオの場合、空中を伝わってきた極めて微弱な信号を拡大(増幅)して、スピーカーを鳴らす。
また、あらかじめ決められた信号が来た時だけトランジスタが動作するスイッチの役割も果たす @transistor_rohm 。
2SC1815Yは、小型で尚且つそこそこ色々な用途に使えるトランジスタであるため、有名なトランジスタである。
@トランジスタとは は、トランジスタの基本機能を示している。
#figure(
image("./img/トランジスタとは.png",width: 90%),
caption: "トランジスタとは"
)<トランジスタとは>
#pagebreak() // ページを分ける
=== どのような仕組みか
トランジスタは、PN接合により構成され、ベースに電流を流すことで、コレクタ-エミッタ間に電流が流れる
ベース-エミッタ間に順方向電圧(VBE)を印加すると、エミッタの電子(-の電荷)がベースに流れ込み、一部の電子がベースの正孔(+の電荷)と結合する。これが、ベースの微小電流(IB)となる。
ベース(P型半導体)は構造的に薄く作られており、エミッタからベースに流入してきた電子の多くはコレクタに抜け出す。
コレクタ-エミッタ間電圧(VCE)によって電子(-の電荷)が誘導されてコレクタ電極方向に移動する。これがコレクタ電流ICとなる @transistor_rohm 。
@トランジスタの仕組み は、トランジスタの基本的な仕組みを示している。
#figure(
image("./img/トランジスタの仕組み.png",width: 50%),
caption: "トランジスタの仕組み"
)<トランジスタの仕組み>
=== どのような入力を取り扱うのか
ベース、エミッタ間の電流を入力として取り扱う。
#pagebreak() // ページを分ける
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に)
TOSHIBA によると、トランジスタの電流増幅率は、ベース電流が増加すると、コレクタ電流が増加する @transister_datasheet 。
@トランジスタグラフ の左の図は、Ic-Vbeの特性を示している。
エミッタ接地トランジスタの静特性で、コレクタ電流ICとベース-エミッタ間電圧Vbeの関係を表した特性である。
ベース- エミッタ間の電圧Vbeを変化させたときのコレクタ電流Icの変化を示している。
0.7V以上のVbeで急激にIcが増加する。立ち上がりの部分が急激なため、トランジスタのスイッチング特性として利用される。
@トランジスタグラフ の右の図は、Ic-Vceの特性を示している。
静特性(IC-VCE特性)はコレクタ電流Icとコレクタエミッタ間電圧VCEの関係を示している。静特性(IC-VCE特性)とは、あるコレクタエミッタ間電圧Vceにおいて流すことが可能なコレクタ電流Icの能力を示したものである。
Ibの電流を流したときに、Vceを変化させたときのIcの変化を示している。
Ibにそこそこの電流が流れていないと、Icはほとんど流れない。Ibに十分な電流が流れていると、Icはほぼ一定の値を取る。この二つの特性を見ることで、トランジスタの特性をざっくり理解することができる。
#figure(
grid(
columns: 2,
image("./img/トランジスタグラフ1.png",width: 75%),
image("./img/トランジスタグラフ2.png",width: 75%)
),
caption: "トランジスタグラフ"
)<トランジスタグラフ>
#pagebreak() // ページを分ける
=== どのようなピンアサイン (各ピンの役割) か
TOSHIBAによると、トランジスタのピンアサインは、エミッタが1番、コレクタが2番、ベースが3番である @transister_datasheet 。
@トランジスタピンアサイン は、トランジスタのピンアサインを示している。
#figure(
image("./img/トランジスタピンアサイン.png",width: 50%),
caption: "トランジスタピンアサイン"
)<トランジスタピンアサイン>
=== 正しい動作の条件,範囲は何か
TOSHIBAによると、正しい動作の条件は以下の通りとなる @transister_datasheet。
- コレクタ・ベース間電圧 : 60V
- コレクタ・エミッタ間電圧 : 50V
- エミッタ・ベース間電圧 : 5V
- コレクタ電流 : 150mA
- ベース電流 : 50 mA
- コレクタ損失 : 400 mW
- 接合温度 : 125°C
- 保管温度 : -55°C 〜 125°C
#pagebreak() // ページを分ける
== @ダイオード の電子部品 (ダイオード 1N4007) を次のような点から調べなさい。
#figure(
image("./img/ダイオード.jpg",width: 50%),
caption: "ダイオード"
)<ダイオード>
=== どのような部品か
電流を一定方向に通す半導体素子。電流が一方向にしか流れない性質を利用して、整流器や電圧安定器などに使用される。
=== どのような仕組みか
金属と半導体との接合によって生じるショットキー障壁を利用したダイオード。
pnダイオードと仕組みは似ていて、P型チャネルは電子を多く含み、N型チャネルは電子を少なく含む。このため、純電流を流すことで、P型チャネルからN型チャネルに電子が流れ、電子が流れることで電流が流れる。しかし、逆電流になると、電子が電極側に集まり、PN結合部に空白地帯が発生して、電気が流れなくなる。
この仕組みを応用して、ショットキーダイオードを作成して、整流を行なっている @diode_rohm。
@ダイオード仕組み は、ダイオードの仕組みを示している。
#figure(
image("./img/ダイオード仕組み.png",width: 70%),
caption: "ダイオード仕組み"
)<ダイオード仕組み>
=== どのような入力を取り扱うのか
ベース、エミッタ間の電流を入力として取り扱う。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に)
アノードに正の電圧を加えると、キャリアがアノードに向かって移動し、電流が流れる。逆に、アノードに負の電圧を加えると、キャリアがアノードに向かって移動できなくなり、電流が流れなくなる。
@ダイオードグラフ は、電圧が増加すると電流値が増加する。グラフの形としては指数関数的に増加している @diode_datasheet。
立ち上がり電圧は0.6Vである。
#figure(
image("./img/ダイオードグラフ.png",width: 50%),
caption: "ダイオードグラフ"
)<ダイオードグラフ>
=== どのようなピンアサイン (各ピンの役割) か
KYOCERAによると、ダイオード帯がついている側がカソードで、帯がついていない側がアノードである @diode_datasheet 。
@ダイオードピンアサイン は、トランジスタのピンアサインを示している。
#figure(
image("./img/ダイオードピンアサイン.png",width: 40%),
caption: "ダイオードピンアサイン"
)<ダイオードピンアサイン>
=== 正しい動作の条件,範囲は何か
秋月電子によると、1N4007の仕様は以下の通りである @diode_akituki。
- 構造:PN接合
- 素材:シリコン
- DC耐圧:1000V
- ピーク耐圧:1000V
- 平均順電流:1A
- ピーク順電流:30A
- 順電圧:1.1V
- 端子間容量:15pF
- 実装タイプ:スルーホール
- パッケージ:アキシャルリード
- パッケージタイプ:アキシャルリード
#pagebreak() // ページを分ける
= このLED マトリクスについて,次のことを調べなさい。
== ダイナミック点灯方式とは
ダイナミック点灯方式とは、LEDマトリクスの各LEDを点灯させる際に、一つのLEDを点灯させる時間を短くして、人間の目には一度に全てのLEDが点灯しているように見せる方式である。
この方式を用いることで、LEDマトリクスの全てのLEDを点灯させる際に、ピンを一つ一つ制御する必要がなくなり、制御が容易になる。
= @課題3フローチャート は、テキスト第5章プログラムchap5_1_1 のshowMatrix 関数のフローチャートである。下記のフローチャートの動作をまとめなさい。
#figure(
image("./img/課題3フローチャート.png",width: 90%),
caption: "課題3フローチャート"
)<課題3フローチャート>
以下は、提供されたフローチャート「showMatrix(matrix[][])」の動作と仕組みについてまとめる。
== 詳細な仕組み
*アノードループの初期化*
ano(アノード)を0から7までループさせるために変数anoを初期化する。
*カソードループの初期化*
cat(カソード)を0から7までループさせるために変数catを初期化する。
*LEDの点灯判定*
現在のano行とcat列のLEDが光るかどうかを、matrix[ano][cat]の値によって判定する。
matrix[ano][cat]が0であれば、次のステップ(5)。
0でない場合は、ステップ(6)。
*LEDを点灯*
digitalWrite(CATHODEPIN[cat], HIGH)を実行し、カソードピンをHIGHにする。
*LEDを消灯*
digitalWrite(CATHODEPIN[cat], LOW)を実行し、カソードピンをLOWにする。
*カソードループの終了判定*
catをインクリメントし、カソードループが終了しているか確認する。
まだ終了していなければステップ(3)に戻る。
*アノードの制御*
digitalWrite(ANODEPIN[ano], HIGH)を実行し、アノードピンをHIGHにする。
7msの遅延を発生させる。
digitalWrite(ANODEPIN[ano], LOW)を実行し、アノードピンをLOWにする。
*アノードループの終了判定*
anoをインクリメントし、アノードループが終了しているか確認する。
まだ終了していなければステップ(2)に戻る。
*終了*
すべてのループが終了した後、プログラムは終了する。
== 補足説明
アノードピンとカソードピンの制御: アノードピンをHIGHにしてからLOWに戻すことで、各LEDの点灯を制御する。
動的点灯方式の実現: アノードピンをHIGHおよびLOWに繰り返し設定することで、ダイナミック点灯方式を実現している。これにより、LEDマトリックス全体の制御が可能になる。
このフローチャートは、LEDマトリックスの各LEDの状態を更新するために必要な一連の手続きを示している。各ループを使ってマトリックス全体を走査し、対応するピンの状態を設定することで、任意のパターンを表示することができる。
#pagebreak() // ページを分ける
// bibファイルの指定 //
#bibliography("./bibliography.bib")
|
|
https://github.com/FrederikRichter/typwiki | https://raw.githubusercontent.com/FrederikRichter/typwiki/main/template.typ | typst | #let template(
keywords: (),
authors: (),
date: none,
title,
doc,
) = {
let title = lower(title)
let keywords = {
let res = ()
for k in keywords {
res.push(lower(k))
}
res
}
metadata((
keywords: keywords,
))
set text(lang: "de")
set page(
paper: "a4",
header: grid(
columns: (1fr, 3fr, 1fr),
align(left)[#smallcaps[#authors.join[ \ ]]],
align(center)[#text(14pt, [_ #smallcaps[#title]_])],
align(right)[#smallcaps[#keywords.join[, ]]],
),
)
set heading(numbering: "1.")
doc
}
#let frame(content) = [
#block(
breakable: false,
[
#pad(
10pt,
content,
)
],
stroke: black,
)
]
#let theorem(tag, content) = [
#block(breakable: false, [
#text(size: 14pt, style: "italic", [Theorem #tag])
#content
<theorem>
])
]
#let definition(tag, content) = [
#block(breakable: false, [
#text(size: 14pt, style: "italic", [Definition #tag])
#content
<definition>
])
]
#let remark(tag, content) = [
#block(breakable: false, [
#text(size: 14pt, style: "italic", [Remark #tag])
#content
<remark>
])
]
#let embed(file) = [
#frame([
#text(
size: 14pt,
style: "italic",
[$==>$ #file #cite(label(file))],
)
#include file
])
]
#let bibliography = [#bibliography(("./zettel-bib.yaml", "./bib.yaml"))]
|
|
https://github.com/carreter/problemst | https://raw.githubusercontent.com/carreter/problemst/main/README.md | markdown | MIT License | # problemst
Simple and easy-to-use template for problem sets/homeworks/assignments.

## Usage
Click "Start from template" in the Typst web app and search for `problemst`.
Alternatively, run the following command to create a directory initialized with all necessary files:
```
typst init @preview/problemst:0.1.0
```
## Configuration
The `pset` function takes the following named arguments:
- `class` (string): Class the assignment is for.
- `student` (string): Student completing the assignment.
- `title` (string): Title of the assignment.
- `date` (datetime): Date to be displayed on the assignment.
- `collaborators` (array of strings): Collaborators that worked on the assignment with the student. Can be `()`.
- `subproblems` (string): Numbering scheme for the subproblems. |
https://github.com/vmysak/modern-cv-typst | https://raw.githubusercontent.com/vmysak/modern-cv-typst/main/src/definitions/cv-page-frame.typ | typst | Apache License 2.0 | #import "../my-config.typ": *
#import "./cv-page-styles.typ": cvStyle
#let separator_fn(name: "", size: 7pt) = [#box(width: size) #name]
#let separator = separator_fn()
#let separator_sm = separator_fn(size: 0.5pt)
#let _contactsBuilder = parent => {
let items = ()
let contacts = userInfo.contacts.pairs()
let urls = userInfo.urls
if (parent == "footer") {
contacts = contacts.filter(c => {
userInfo.footer.contains(c.at(0))
})
}
for contact in contacts {
let key = contact.at(0)
if (key.starts-with("#")) {
continue
}
let value = contact.at(1)
let display = value
if (key in urls) {
let prefix = urls.at(key, default: "")
if (key == "homepage") {
value = ""
}
items.push([#icons.at(key)#link(prefix + value)[#separator_sm#text(display)]])
}
if (key not in urls) {
items.push([#icons.at(key)#separator_sm#text(value)])
}
}
return items
}
#let _footer = {
let contacts = _contactsBuilder("footer")
set text(size: footer-font-size)
block(inset: (top: 1pt))[
#box(width: 2fr)[
#align(left)[
#smallcaps[#userInfo.firstname#sym.space#userInfo.lastname]
<bold-desat>]
]
#box(width: 8fr)[
#align(center)[
#for c in contacts {
[#separator_sm#c#separator_sm]
}
<bold-desat>]
]
#box(width: 1fr)[
#align(right)[
#counter(page).display("1 / 1", both: true)
<bold-desat>]
]
]
}
#let _modernHeader(body) = {
let contacts = _contactsBuilder("header")
align(center)[
#box[
#set text(size: full-name-font-size)
#userInfo.firstname<accent>
#userInfo.lastname<bold>
]
]
align(center)[
#set text(size: contacts-font-size)
#userInfo.roles.join([#" "#sym.dot.c#" "])<bold-desat>
]
align(center)[
#set text(size: contacts-font-size)
#box(inset: (top: contacts-padding))[#for c in contacts {
[#separator_sm#c#separator_sm]
}
]
<desat>]
body
}
#let _photoHeader(body) = {
let aligns = left
let contacts = _contactsBuilder("header")
grid(
columns: (1fr, 3fr),
rows: (auto),
gutter: (8pt),
align: aligns,
grid.cell(rowspan: 4, image("../resources/user.jpg")),
box[
#set text(size: full-name-font-size)
#userInfo.firstname<accent>
#userInfo.lastname<bold>
],
box(inset: (top: roles-padding))[
#set text(size: contacts-font-size)
#smallcaps[
#userInfo.roles.join(text[#" "#sym.dot.c#" "])<bold-desat>
]],
grid(
columns: (1fr, 1fr),
align: aligns,
rows: (auto),
gutter: (5pt),
..contacts.enumerate().map(((i, item)) => {
return grid.cell([
#set text(size: contacts-font-size)
#item
<desat>])
})
)
)
body
}
#let cvPageFrame = (
contacts: _contactsBuilder("header"),
modernHeader: _modernHeader,
photoHeader: _photoHeader,
footer: _footer,
) |
https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/program-tracking.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/packages.typ": notebookinator
#import notebookinator: *
#import themes.radial.components: *
#show: create-body-entry.with(
title: "Program: Position Tracking",
type: "program",
date: datetime(year: 2023, month: 8, day: 20),
author: "<NAME>",
witness: "<NAME>",
)
In order to get the position tracking working we first had to install LemLib. We
followed the installation instructions #footnote(
link(
"https://lemlib.github.io/LemLib/md_docs_tutorials_1_getting_started.html",
),
) and downloaded the zip file for the 0.4.7 release. Then we ran the following
commands to apply the template:
```sh
pros c fetch [email protected]
pros c apply [email protected]
```
We then had to configure the chassis.
The first thing we had to do was configure the drivetrain.
```cpp
inline pros::Motor_Group left_motors({-11, 12, -15});
inline pros::Motor_Group right_motors({1, -2, 3});
inline lemlib::Drivetrain_t drivetrain{
&left_motors, // left drivetrain motors
&right_motors, // right drivetrain motors
10, // track width // TODO: measure this value correctly
4, // wheel diameter
342.85 // wheel rpm
};
```
Then we had to configure the sensors.
```cpp
inline pros::ADIEncoder left_enc('A', 'B', false);
inline pros::ADIEncoder back_enc('G', 'H', false);
// left tracking wheel
inline lemlib::TrackingWheel left_tracking_wheel(&left_enc, 2.75, 3);
inline lemlib::TrackingWheel back_tracking_wheel(&back_enc, 2.75, -4);
inline pros::Imu inertial_sensor(17);
inline lemlib::OdomSensors_t sensors{
&left_tracking_wheel, // vertical tracking wheel 1
nullptr, // vertical tracking wheel 2
&back_tracking_wheel, // horizontal tracking wheel 1
nullptr, // horizontal tracking wheel 2
&inertial_sensor // inertial sensor
};
```
Then we had to set the constants for the PID #footnote("See glossary") loops.
We'll cover what this means in more detail when we need to solve moving the
robot during the autonomous period.
```cpp
// forward/backward PID
inline lemlib::ChassisController_t lateralController{
8, // kP
30, // kD
1, // smallErrorRange
100, // smallErrorTimeout
3, // largeErrorRange
500, // largeErrorTimeout
5 // slew rate
};
// turning PID
inline lemlib::ChassisController_t angularController{
4, // kP
40, // kD
1, // smallErrorRange
100, // smallErrorTimeout
3, // largeErrorRange
500, // largeErrorTimeout
0 // slew rate
};
```
Once all of this was done we could combine it all together with the chassis
constructor.
```cpp
// create the chassis
inline lemlib::Chassis chassis(
drivetrain,
lateralController,
angularController,
sensors
);
```
Now that the setup is complete all we have to do is call the chassis's calibrate
method and we're good to go. ```cpp
void initialize() {
chassis.calibrate();
}
``` Now we can get the chassis's current position at any time like this:
```cpp
lemlib::Pose pose = chassis.getPose();
printf("%f\n", pose.x);
printf("%f\n", pose.y);
printf("%f\n", pose.theta);
```
|
https://github.com/jneug/typst-finite | https://raw.githubusercontent.com/jneug/typst-finite/main/README.md | markdown | MIT License | # finite (v0.3.2)
**finite** is a [Typst](https://github.com/typst/typst) package for rendering finite automata on top of [CeTZ](https://github.com/johannes-wolf/typst-canvas).
## Usage
For Typst 0.6.0 or later, import the package from the typst preview repository:
```js
#import "@preview/finite:0.3.1": automaton
```
After importing the package, simply call `#automaton()` with a dictionary holding a transition table:
```js
#import "@preview/finite:0.3.1": automaton
#automaton((
q0: (q1:0, q0:"0,1"),
q1: (q0:(0,1), q2:"0"),
q2: (),
))
```
The output should look like this:

## Further documentation
See `manual.pdf` for a full manual of the package.
## Development
The documentation is created using [Mantys](https://github.com/jneug/typst-mantys), a Typst template for creating package documentation.
To compile the manual, Mantys needs to be available as a local package. Refer to Mantys' manual for instructions on how to do so.
## Changelog
### Version 0.3.2
- Fixed an issue with final states not beeing recognized properly (#5)
### Version 0.3.1
- Added styling options for intial states:
- `stroke` sets a stroke for the marking.
- `scale` scales the marking by a factor.
- Updated manual.
### Version 0.3.0
- Bumped tools4typst to v0.3.2.
- Introducing automaton specs as a data structure.
- Changes to `automaton` command:
- Changed `label-format` argument to `state-format` and `input-format`.
- `layout` can now take a dictionary with (`state`: `coordinate`) pairs to position states.
- Added `#powerset` command, to transform a NFA into a DFA.
- Added `#add-trap` command, to complete a partial DFA.
- Added `#accepts` command, to test a word against an NFA or DFA.
- Added `transpose-table` and `get-inputs` utilities.
- Added "Start" label to the mark for initial states.
- Added option to modify the mark label for initial states.
- Added anchor option for loops, to position the loop at one of the eight default anchors.
- Changed `curve` option to be the height of the arc of the transition.
- This makes styling more consistent over longer distances.
- Added `rest` key to custom layouts.
### Version 0.2.0
- Bumped CeTZ to v0.1.1.
### Version 0.1.0
- Initial release submitted to [typst/packages](https://github.com/typst/packages).
|
https://github.com/platformer/typst-algorithms | https://raw.githubusercontent.com/platformer/typst-algorithms/main/test/assertions/assert_d_in_algo.typ | typst | MIT License | #import "../../algo.typ": d
#d
|
https://github.com/mem-courses/calculus | https://raw.githubusercontent.com/mem-courses/calculus/main/note-2/3.多元函数微分学.typ | typst | #import "../template.typ": *
#show: project.with(
course: "Calculus II",
course_fullname: "Calculus (A) II",
course_code: "821T0160",
semester: "Spring-Summer 2024",
title: "Note #3 多元函数微分学",
authors: (
(
name: "<NAME>",
email: "<EMAIL>",
id: "3230104585",
),
),
date: "April 9, 2024",
)
#let iintd = iintb($D$)
#let iints = iintb($S$)
#let iintsg = iintb($sigma$)
#let iiintv = iiintb($V$)
#let iiintog = iiintb($Omega$)
= 多元函数微分学
== $n$ 维空间
#theorem(name: [$n space.thin$维空间的距离公式])[
设 $P_1 (x_1,x_2,dots.c,x_n)$,$P_2 (y_1,y_2,dots.c,y_n)$,则
$ |P_1 P_2| = sqrt((y_1-x_1)^2 + (y_2-x_2)^2 + dots.c + (y_n-x_n)^2) $
]
#definition(name: [$n space.thin$维空间的邻域])[
设 $P_0 (p_1,p_2,dots.c,p_n) in RR^N$,$delta$ 是某一正数,点 $P_0$ 的 $delta$ 邻域,记为 $U(P_0,delta)$。
$
U(P_0,delta) = {P | abs(P P_0) < delta} = lr({(x_1,x_2,dots.c,x_n) mid(|) sqrt(sum_(i=1)^n (x_i - p_i)^2) < delta})
$
]
#definition(name: [内点、外点、边界])[
设 $E subset RR^n$,
(1) 对于 $M in E$,若 $exists delta > 0$,使得 $U(M,delta)<E$,则称 $M$ 为 $E$ 的一个#def[内点]。
(2) 对于点 $P in.not E$,若 $exists delta > 0$,使得 $U(P,delta) sect E = emptyset$,则称 $P$ 为 $E$ 的一个#def[外点]。
(3) 对于点 $Q$,若 $forall delta > 0$,$U(Q,delta)$ 内总有属于 $E$ 的点,又有不属于 $E$ 的点,则称 $Q$ 为 $E$ 的一个#def[边界点]。
(4) $E$ 的全体边界点构成的集合,称为 $E$ 的#def[边界],记作 $diff E$。
(5) $E$ 的全体内点构成的集合,称为 $E$ 的#def[内部],记作 $"int" E$。
#tip[
【画图(一般为 $n=2$ 的情况)】
- 平面直角坐标系要有箭头、方向、坐标轴名称和_必要的_刻度单位。
- $E$ 的边界要用虚线表示,$E$ 的内部要用阴影表示。
]
]
#definition(name: [开集、闭集])[
设 $E subset RR^n$,
(1) 若 $E$ 中任一点都是 $E$ 的内点,则称 $E$ 为#def[开集]。
(2) 若 $E$ 在 $RR^n$ 中的余集 $RR^n-E$ 是一个开集,则称 $E$ 为#def[闭集]。
(3) 若 $E$ 中任意两点,总可以用含于 $E$ 的一条折线连接起来,则称集合 $E$ 是#def[连通的]。
(4) 连通的开集称为#def[开区域]。
(5) 开区域连同其边界所构成的点集称为#def[闭区域]。
(6) 开区域,闭区域,或者开区域连同其一部分边界点组成的点集统称为#def[区域]。
(7) 若 $exists r > 0$,使得 $E subset U(O,r)$,则称 $E$ 是#def[有界集];否则,称 $E$ 是#def[无界集]。
]
== 多元函数的概念
#definition[
设 $D$ 是 $RR^n$ 中的一个非空子集,若存在一个对应规则 $f$,使得 $forall P in D$,有唯一的实数 $u$ 与之对应,则称 $f$ 是定义在 $D$ 上的一个函数,或说 $u$ 是点 $P$ 的函数,简称#def[点函数]。记作
$ u=f(P),space P in D $
集合 $D$ 称为函数 $f$ 的#def[定义域]。集合 ${u | u = f(P), P in D} defeq R(f)$ 称为函数 $f$ 的#def[值域]。
对于函数 $u=f(P),space P in D$,若点 $P(x_1,x_2,dots.c,x_n) in D$,则
$ u = f(x_1,x_2,dots.c,x_n),space (x_1,x_2,dots.c,x_n) in D $
称为#def[ $n$ 元函数],其中 $x_1,x_2,dots.c,x_n$ 称为#def[自变量],$u$ 称为#def[因变量]。
]
#definition(name: [二元函数的对称])[
$f(x,y)$ 关于 $x,y$ #def[对称] $<==>$ $f(x,y) = f(y,x)$。
例如:函数 $f(x,y) = display((x y)/(x^2+y^2))$ 关于 $x,y$ 是对称的。
]
== 多元函数的极限
#definition[
设函数 $u=f(P)$ 在点 $P_0$ 的某一空心邻域内有定义,$A$ 是一个常数。若
$ forall eps > 0, space exists delta > 0, space "当 " P in U^o (P_0,delta) "时,有 " abs(f(P) - A) < eps $
则称 $A$ 是函数 $u=f(P)$ 当 $P -> P_0$ 时的#def[极限],记作
$ lim_(P->P_0) f(P) = A $
]
#definition[
我们把二元函数的极限称为#def[二重极限],记为
$
lim_((x,y) -> (x_0,y_0)) f(x,y) = A
quad quad "或" quad quad
lim_(x->x_0\ y->y_0) f(x,y) = A
$
#note[
- #box(width: 100%)[
平面上 $P(x,y)->P_0 (x_0,y_0)$ 的方式有无穷多种,
$ lim_((x,y) -> (x_0,y_0)) f(x,y) = A $
要求不管 $P$ 以何种形式趋于 $P_0$,$f(x,y)$ 均趋于 $A$。
]
- 二元函数的极限运算法则与一元函数类似。变量替换,等价无穷小替换,夹逼定理等方法仍然可以适用。
]
]
#example[
#problem[
求 $display(lim_((x,y)->(0,0)) (x^2 y)/(x^2+y^2))$。
]
#solution[
由基本不等式 $display(abs(x y) <= 1/2 abs(x^2+y^2))$ 知
$
abs((x^2 y)/(x^2 + y^2)) <= 1 / 2 abs((x(x^2+y^2))/(x^2+y^2)) = 1 / 2 abs(x) -> 0 quad ((x,y) -> (0,0))
$
]
]
#tip[
【确定二重极限不存在的方法】
找两种特殊的趋近方式,若得到不同的极限,则可断言二重极限 $display(lim_((x,y) -> (x_0,y_0)) f(x,y) = A)$ 不存在。
#example[
#problem[
考察 $f(x,y)=display((x y)/(x^2+y^2))$ 当 $(x,y)->(0,0)$ 时的极限。
]
#solution[
沿 $x$ 轴考察,$display(lim_((x,y)->(0,0)\ y=0) f(x,y) = lim_(x->0) 0/(x^2) = 0)$。而 $display(lim_((x,y)->(0,0)\ y=x) f(x,y) = lim_(x->0) (x^2)/(x^2+x^2) + 1/2 != 0)$。故当 $(x,y)->(0,0)$ 时,$f(x,y)$ 无极限。
]
]
]
== 多元函数的连续性
=== 函数的全增量与偏增量
#definition(name: [函数全增量])[
设二元函数 $z=f(x,y)$ 在点 $P_0 (x_0,y_0)$ 的某一邻域内有定义。称
$
Delta = x - x_0,quad Delta y =y - y_0
$
为 $z=f(x,y)$ 在点 $P_0 (x_0,y_0)$ 处的#def[自变量增量]。称
$
Delta z = f(x_0+Delta x,y_0+Delta y)-f(x_0,y_0)
$
为 $z=f(x,y)$ 在点 $P_0 (x_0,y_0)$ 处的#def[全增量]。
]
#definition(name: [函数偏增量])[
设二元函数 $z=f(x,y)$ 在点 $P_0 (x_0,y_0)$ 的某一邻域内有定义。称
$
f(x_0+Delta x,y_0) - f(x_0,y_0) defeq Delta_x z
$
为 $z=f(x,y)$ 在点 $P_0(x_0,y_0)$ 处关于 $x$ 的#def[偏增量]。
]
=== 二元函数函数连续的定义
#definition(name: [二元函数在一点处来连续的定义])[
设二元函数 $z=f(x,y)$ 在点 $P_0(x_0,y_0)$ 的某一邻域内有定义。若
$ lim_((x,y) -> (x_0,y_0)) f(x,y) = f(x_0,y_0) quad "即" quad lim_(Delta x->0\ Delta y->0) Delta z = 0 $
则称 $z=f(x,y)$ 在点 $P_0(x_0,y_0)$ 处#def[连续]。
]
#definition(name: [二元函数在开区域连续的定义])[
设二元函数 $z=f(x,y)$ 在开区域 $D$ 内有定义,若函数 $z=f(x,y)$ 在开区域 $D$ 内每一点都连续,则称 $z=f(x,y)$ 在开区域 $D$ 内#def[连续]。
]
#definition(name: [二元函数在闭区域连续的定义])[
设二元函数 $z=f(x,y)$ 在闭区域 $D$ 上有定义,若
(1) $forall P_0 (x_0,y_0) in "int" D,space display(lim_(x->x_0\ y->y_0) f(x,y) = f(x_0,y_0))$,即 $z=f(x,y)$ 在 $"int" D$ 内每一点处都连续。
(2) $forall P_0 (x_0,y_0) in diff D,space display(lim_(space space x->x_0\ space space y->y_0\ (x,y) in D) f(x,y) = f(x_0,y_0))$。
则称 $z=f(x,y)$ 在闭区域 $D$ 上#def[连续]。
]
=== 有界闭区域上连续函数的性质
#theorem(name: [最大值和最小值定理])[
在有界闭区域 $D$ 上的多元连续函数,必定在 $D$ 上有界,且能取得它的最大值和最小值。
]
#theorem(name: [介值定理])[
在有界闭区域 $D$ 上的多元连续函数必取得介于最大值和最小值之间的任何值。
]
== 偏导数
#definition[
设函数 $z=f(x,y)$ 在点 $(x_0,y_0)$ 的某一邻域内有定义,如果极限
$
lim_(Delta x -> 0) (Delta_x z) / (Delta x) = lim_(x->0) (f(x_0 + Delta x,y_0) - f(x_0,y_0)) / (Delta x)
$
存在,则称此极限为函数 $z=f(x,y)$ 在点 $(x_0,y_0)$ 处对 $x$ 的#def[偏导数]。记作 $f'_x (x_0,y_0), atpos((diff f)/(diff x), (x_0,y_0), "")$ 或 $atpos(z'_x, (x_0,y_0), ""), atpos((diff z)/(diff x), (x_0,y_0), "")$。
]
#tip[
可以适当调换求偏导和代入顺序,来简化运算。
]
#note[
几何意义:由 $f'_x (x_0,y_0) = atpos(dif/(dif x) f(x, y_0), x=x_0, "")$ 知,$f'_x (x_0,y_0)$ 在几何上表示曲线 $display(cases(z=f(x,y),y=y_0))$ 在对应点 $ M_0 (x_0,y_0,f(x_0,y_0))$ 处的切线 $M_0 T_x$ 对 $x$ 轴的斜率(与 $x$ 轴正向夹角的正切)。
]
#caution[
求分界点处的偏导数要用定义求。
]
== 高阶偏导数
#definition[
TBD
$
(diff) / (diff x)((diff z) / (diff x)) = (diff^2 z) / (diff x^2) = f''_(x x)
quad quad quad quad quad
(diff) / (diff y)((diff z) / (diff y)) = (diff^2 z) / (diff y^2) = f''_(y y)
$
混合偏导数
$
(diff) / (diff y)((diff z) / (diff x)) = (diff^2 z) / (diff x diff y) = f''_(x y)
quad quad quad quad quad
(diff) / (diff x)((diff z) / (diff y)) = (diff^2 z) / (diff y diff x) = f''_(y x)
$
]
#theorem[
若函数 $z=f(x,y)$ 的二阶偏导数 $f''_(x y)(x,y)$ 和 $f''_(y x) (x,y)$ 都在点 $P_0 (x_0,y_0)$ 处连续,则
$
f''_(x y) (x_0,y_0) = f''_(y x) (x_0,y_0)
$
更近一步地,我们有:
若混合偏导数连续,则混合偏导数与求导顺序无关。
]
== 全微分
#definition[
若二元函数 $z=f(x,y)$ 在点 $(x,y)$ 处的#def[全增量] $Delta z=f(x+Delta x,y+Delta y)-f(x,y)$ 可以表示为
$
Delta z = A Delta x + B Delta y + o(rho) quad (rho=sqrt((Delta x)^2 + (Delta y)^2) -> 0)
$
其中 $A,B$ 与增量 $Delta x,Delta y$ 无关,只与 $x,y$ 有关,则称函数 $f(x,y)$ 在点 $(x,y)$ 处#def[可微]。其中 $A Delta x + B Delta y$ 称为函数 $f(x,y)$ 在点 $(x,y)$ 处的#def[全微分],记作 $dif z$。
]
#theorem[
若二元函数 $z=f(x,y)$ 在点 $(x,y)$ 处可微,则:
(1) $f(x,y)$ 在点 $(x,y)$ 处连续。
(2) $f(x,y)$ 在点 $(x,y)$ 处的两个偏导数 $f'_x (x,y)$ 和 $f'_y (x,y)$ 都存在,且 $A = f'_x (x,y), B = f'_y (x,y)$。
]
#theorem(name: [全微分公式])[
若二元函数 $z=f(x,y)$ 在区域 $D$ 上的每点 $(x,y)$ 处都可微,则称函数 $f$ 在区域 $D$ 上可微,且 $f$ 在 $D$ 上的全微分为
$
dif z = f'_x (x,y) dif x + f'_y (x,y) dif y
quad "或记" quad
dif z = pz / px dif x + pz / py dif y
$
]
#caution[
注意 $f'_x (x,y)$ 和 $f'_y (x,y)$ 都存在不能推出函数的全微分存在,需要另验证函数是否可微。如例题中给的例子 $f(x,y) = display(cases(display((2x y)/sqrt(x^2+y^2))\,quad& x^2+y^2!=0, 0\,&x^2+y^2=0))$。
]
#theorem(name: [可微的充分条件])[
若二元函数 $z=f(x,y)$ 的偏导数 $f'_x (x,y)$,$f'_y (x,y)$ 在点 $(x_0,y_0)$ 处连续,则 $z=f(x,y)$ 在点 $(x_0,y_0)$ 处可微。
]
#tip[
【验证多元函数可微的另一种方法】证明多元函数 $z=f(x,y)$ 满足以下性质:
(1) $f(x,y)$ 在点 $(x,y)$ 处连续。
(2) $f'_x (x_0,y_0)$ 和 $f'_y (x_0,y_0)$ 都存在。
(3) $display(lim_(Delta x->0\ Delta y->0) (Delta z - f'_x (x_0,y_0) Delta x - f'_y (x_0,y_0) Delta y)/rho = 0)$,其中 $rho = sqrt(Delta x^2 + Delta y^2)$。
反过来,可以用这些条件证明多元函数不可微。
]
== 复合函数的偏导数
#definition[
若 $z=f(u,v)$ 而 $u=phi(x,y)$,$v=psi(x,y)$,于是称 $z$ 是 $x$ 与 $y$ 的#def[复合函数]:
$
z = f(phi(x,y), psi(x,y))
$
]
#theorem(name: [偏导数公式])[
若函数 $u=phi(x,y)$,$v=psi(x,y)$ 在点 $(x,y)$ 处的偏导数都存在,$z=f(u,v)$ 在点 $(u,v)=(phi(x,y),psi(x,y))$ 处可微,则复合函数 $z=f(phi(x,y),psi(x,y))$ 在点 $(x,y)$ 处的偏导数存在且
$
pz / px = pz / pu dot pu / px + pz / pv dot pv / px
quad quad
px / py = pz / pu dot pu / py + pz / pv dot pv / py
$
]
#definition[
若 $z=f(u,v)$,$u=phi(x)$,$v=psi(x)$,则称 $z$ 是一个自变量 $x$ 的复合函数,记 $display((dif z)/(dif x))$ 为#def[全导数]。
]
#theorem(name: [全导数公式])[
若 $z=f(u,v)$,$u=phi(x)$,$v=psi(x)$,则 $z$ 关于 $x$ 的全导数为
$
(dif z) / dx = pz / pu dot du / dx + pz / pv dot dv / dx
$
]
#theorem(name: [全微分的形式不变性])[
设 $z=f(u,v)$,$u=u(x,y)$,$v=v(x,y)$ 都有连续偏导数,则复合函数 $z=f(u(x,y),v(x,y))$ 可微,且有
$
dif z = pz / pu dot du + pz / pv dot dv
$
#proof[
$
dif z
&= pz / px dot dx + pz / py dy
= (pz / pu pu / px + pz / pv pv / px) dif x + (pz / pu pu / py + pz / pv pv / py) dif y\
&= pz / pu (pu / px dx + pu / py dy) + pz / pv (pv / px dx + pv / py dy)
= pz / pu du + pz / pv dv
$
]
]
== 隐函数的偏导数
=== 一元隐函数的偏导数
#theorem(name: [一元隐函数存在定理])[
设函数 $F(x,y)$ 满足:
(1) $F(x_0,y_0) = 0$;
(2) 在点 $P(x_0,y_0)$ 的某一邻域内 $F$ 具有连续的偏导数 $F'_x, F'_y$;
(3) $F'_y (x_0,y_0) != 0$,
则在点 $P(x_0,y_0)$ 的某一邻域内存在唯一的隐函数 $y=f(x)$,满足 $F(x,y) equiv 0$,且有连续的导数 $display((dif y)/(dif x)=-(F'_x)/(F'_y))$。
#proof[
考虑 $F(x,y(x))=0$,求全导数得 $F'_x + F'_y display((dif y)/(dif x))$,移项解得 $display((dif y)/(dif x) = -(F'_x)/(F'_y))$。
]
#note[
第 (2) 和 (3) 条条件可以保证分母不为零。
]
]
=== 二元隐函数的偏导数
#theorem(name: [二元隐函数存在定理])[
设函数 $F(x,y,z)$ 满足:
(1) $F(x_0,y_0,z_0)= 0$;
(2) 在点 $P(x_0,y_0,z_0)$ 的某一邻域内 $F$ 具有连续的偏导数 $F'_x, F'_y, F'_z$;
(3) $F'_z (x_0,y_0,z_0) != 0$,
则在点 $P(x_0,y_0,z_0)$ 的某一邻域内存在唯一的隐函数与 $z=f(x,y)$,满足 $F(x,y,f(x,y))=0$,且有连续的偏导数 $display((diff z)/(diff x) = - (F'_x)/(F'_z)\;quad (diff z)/(diff y) = -(F'_y)/(F'_z))$。
]
== 场的方向导数与梯度
=== 场的概念
#definition[
设空间区域 $V$ 上的每一点 $P$,对应着某个物理量所确定的值,则称空间区域 $V$ 确定了该物理量的#def[场]。如果这个量是数量,则称为#def[数量场];如果这个量是矢量,则称为#def[矢量场]。
不随时间的变化二变化的场,称为#def[稳定场];否则,称为#def[不稳定场]。
]
#definition[
设给定一个数量场 $u=u(P),space P in V$,称具有同函数值 $C$(是一个常数)的点 $P$ 的集合所形成的曲面
$
{P in V | u(P) = C}
$
为#def[等值面]。在二维平面中的情况称为#def[等值线]。
]
=== 数量场的方向导数
#definition[
设有数量场 $u=u(P),space P in V$。$P_0 in V$,$l$ 是从 $P_0$ 出发的一条射线。在 $l$ 上任取一点 $P$,$P != P_0$,则 $u(P)$ 在线段 $P_0 P$ 上的平均变化率为
$
(u(P) - u(P_0)) / (abs(P_0 P))
$
若极限
$
lim_(P -> P_0) (u(P) - u(P_0)) / abs(P_0 P)
$
存在,则称此极限为数量场 $u(P)$ 在点 $P_0$ 处沿方向 $l$ 的#def[方向导数],记作 $lr(display((diff u)/(diff bold(l)))|)_(P_0\ )$。
记 $rho = abs(P_0 P)$。特别地,在二维平面上,设数量场为 $Z=f(x,y),space (x,y) in D,space P_0 (x_0,y_0) in D$,方向 $bold(l) = {cos phi, sin phi},space P(x_0 + Delta x, y_0 + Delta y) in l$,则 $Delta x = rho cos phi, space Delta y = rho sin phi, space rho = sqrt(Delta x ^2 + Delta y^2)$,那么
$
lr((diff z)/(diff bold(l))|)_(P_0\ ) = lim_(rho -> 0) (f(x_0+rho cos phi, y_0 rho sin phi) - f(x_0, y_0)) / rho
$
]
#theorem[
若函数 $u=u(x, y ,z)$ 在点 $P_0 (x_0, y_0, z_0)$ 处偏导数连续,则 $u$ 在点 $P_0$ 处沿任一方向 $l$ 的方向导数都存在,且
$
lr((diff u)/(diff bold(l))|)_(P_0\ ) = lr((diff u)/(diff x)|)_(P_0\ ) cos alpha + lr((diff u)/(diff y)|)_(P_0\ ) cos beta + lr((diff u)/(diff z)|)_(P_0\ ) cos gamma
$
其中,方向 $l$ 上的单位矢量为
$
bold(l)^circle.small = {cos alpha, cos beta, cos gamma}
$
]
#note[
分区域定义的函数,若在点 $P_0$ 处的偏导数不连续,则可以考虑用定义来讨论方向导数的存在性或计算。
]
=== 数量场的梯度
若函数 $u=u(x, y, z)$ 在点 $P_0 (x_0, y_0, z_0)$ 处可微,则
$
lr((diff u)/(diff bold(l))|)_(P_0\ ) = (
lr((diff u)/(diff x)|)_(P_0\ ) bold(i) + lr((diff u)/(diff y)|)_(P_0\ ) bold(j) + lr((diff u)/(diff z)|)_(P_0\ ) bold(k)
) dot (cos alpha bold(i) + cos beta bold(j) + cos gamma bold(k)) defeq bold(G) (
P_0
) dot bold(l)^circle.small = abs(bold(G) (P_0)) cos theta
$
#definition[
称
$
((diff u) / (diff x) bold(i) + (diff u) / (diff y) bold(j) + (diff u) / (diff z) bold(k))_(P_0)
$
为数量场 $u=u(x, y, z)$ 在点 $P_0$ 处的#def[梯度],记作 $atpos(grad u, P_0, "")$
]
#theorem[
数量场 $u(P)$ 在点 $P_0$ 处沿 $bold(l)$ 方向的方向导数等于梯度在 $bold(l)$ 方向上的_投影_,且方向导数沿梯度方向取得最大值,最大值等于梯度的模。即
$
atpos((diff u)/(diff bold(l)), P_0, "") = atpos(grad u, P_0, "") dot bold(l)^circle.small
;quad quad quad
max(atpos((diff u)/(diff bold(l)), P_0, "")) = abs(atpos(grad u, P_0, ""))
$
]
== 多元函数的极值
#definition[
设函数 $z=f(x,y)$ 在点 $(x_0,y_0)$ 的某邻域内有定义。若对于该邻域内任意点 $(x,y)$,都有
(1) $f(x,y) >= f(x_0,y_0)$,则称 $f(x_0,y_0)$ 为 $f(x,y)$ 的极小值,称 $(x_0,y_0)$ 为 $f(x,y)$ 的极小值点;
(2) $f(x,y) <= f(x_0,y_0)$,则称 $f(x_0,y_0)$ 为 $f(x,y)$ 的极大值,称 $(x_0,y_0)$ 为 $f(x,y)$ 的极大值点;
]
=== 极值的必要条件
#theorem[
设函数 $z=f(x,y)$ 在点 $(x_0,y_0)$ 具有偏导数,且在点 $(x_0,y_0)$ 处有极值,则它在该点的偏导数必然为零:
$
f'_x (x_0,y_0) = f'_y (x_0,y_0) = 0
$
称该点为该函数的 #def[驻点]。
]
=== 极值的充分条件
#theorem[
设函数 $z=f(x,y)$ 在点 $(x_0,y_0)$ 的某邻域内连续,有一阶及二阶连续偏导数。若 $f'_x (x_0,y_0) = 0$,$f'_y (x_0,y_0) = 0$,零 $f''_(x x) (x_0,y_0) = A,space f''_(x y) (x_0,y_0) = B,space f''_(y y) (x_0,y_0) = C$,则 $f(x,y)$ 在点 $(x_0,y_0)$ 处是否取得极值的条件如下:
(1) $B^2-A C < 0$ 时具有极值,且当 $A<0$ 时有极大值,$A>0$ 时有极小值(可以证明 $A,C$ 同号);
(2) $B^2 - A C > 0$ 时没有极值;
(3) $B^2 - A C = 0$ 时可能有极值,可能没有极值。
]
#tip[
【求多元函数的极值点】
1. 找出极值的嫌疑点:驻点,不可导点。
2. 通过极值点的充分条件验证,不能直接验证时用定义或其他方法进行判定。
]
#tip[
【求多元函数的最大值和最小值】
1. 找出最值的嫌疑点:驻点,不可导点,边界点(只需要算出在边界上的最大值和最小值即可)。
2. 计算以上诸点处的函数值并作比较,其中最大者即为最大值,最小者即为最小值。
]
=== 条件极值问题
#theorem(name: [拉格朗日乘数法])[
求函数 $z=f(x,y)$ 在约束条件 $phi(x,y)=0$ 下的条件极值,引入拉格朗日函数
$
F(x,y,lambda) = f(x,y) + lambda phi(x,y)
$
其中 $lambda$ 为参数。令:
$
cases(
F'_x = f'_x (x,y) + lambda phi'_x (x,y) = 0,
F'_y = f'_y (x,y) + lambda phi'_y (x,y) = 0,
F'_lambda phi(x,y) = 0
)
$
解出 $x,y,lambda$,其中 $x,y$ 就是可能的极值点的坐标。若这样的点唯一,由实际问题,可直接确定此即所求的点。
]
== 偏导数在几何上的应用
#definition(name: [曲线的矢量方程])[
设空间曲线的方程 $display(cases(x=x(t),y=y(t),z=z(t))),space t in [alpha,beta]$。若记 $bold(r) = x bold(i) + y bold(j) + z bold(k)$,则曲线的矢量方程为
$
bold(r) = bold(r) (t) = x(t) bold(i) + y(t) bold(j) + z(t) bold(k) = {x(t), y(t), z(t)}
$
- #[
矢值函数的*极限*:
$
lim_(t->t_0) bold(r) (t) = {lim_(t->t_0) x(t), lim_(t->t_0) y(t), lim_(t->t_0) z(t)}
$
]
- #[
矢值函数的*连续*:设 $x(t), y(t), z(t)$ 在 $t_0$ 的某邻域内有定义,若
$
lim_(t->t_0) bold(r)(t) = bold(r)(t_0)
$
则称矢值函数 $bold(r)=bold(r)(t)$ 在点 $t_0$ 处连续。实际上,$bold(r)(t)$ 在 $t_0$ 处连续当且仅当 $x(t), y(t), z(t)$ 都在 $t_0$ 处连续。
]
- #[
矢值函数的*导矢量*:
$
(dif bold(r)) / (dif t) = {x'(t), y'(t), z'(t)}
$
]
- #[
矢值函数的*矢量微分*:
$
dif bold(r) = bold(r)'(t) dif t = {x'(t) dif t, y'(t) dif t, z'(t) dif t}
$
]
]
=== 空间曲线的切线与法平面
#theorem[
设空间曲线 $Gamma$ 的方程为 $display(cases(x=x(t),y=y(t),z=z(t)))$,其中 $x'(t),y'(t),z'(t)$ 连续且不同时为零。设 $P(x_0,y_0,z_0) = P(t_0) in Gamma$。则曲线 $Gamma$ 在点 $P$ 处的#def[切线]方程为
$
(x-x_0) / (x'(t_0)) = (y-y_0) / (y'(t_0)) = (z-z_0) / (z'(t_0))
$
#def[法平面]方程为
$
x'(t_0) (x-x_0) + y'(t_0) (y-y_0) + z'(t_0) (z-z_0) = 0
$
]
#definition(name: [切矢量])[
设空间曲线 $Gamma$ 的方程为 $display(cases(x=x(t),y=y(t),z=z(t)))$,其中 $x'(t),y'(t),z'(t)$ 连续。设 $P(x_0,y_0,z_0) = P(t_0) in Gamma$。则称
$
bold(T) = {x'(t_0),y'(t_0),z'(t_0)} = atpos({dx/dt,dy/dt,dz/dt}, t=t_0, "")
$
为曲线 $Gamma$ 在点 $P$ 处的#def[切矢量]
]
#tip[
【求一般式方程表示的空间曲线的切矢量】
*法一*:对于用一般式方程表示的曲线,可以采用 $x,y,z$ 中的任意一个作参数来求切矢量,即
$
bold(T) = {dx / dt,dy / dt,dz / dt}
parallel {1, dy / dx, dz / dx}
parallel {dx / dy, 1, dz / dy}
parallel {dx / dz, dy / dz, 1}
parallel {dx, dy, dz}
$
*法二*:先求曲面 $Sigma_1: F(x,y,z)=0$ 和 $Sigma_2: G(x,y,z)$ 各自的切平面,这两切平面的交线即原空间曲线的切线。
]
=== 曲面的切平面与法线
#definition[
设曲面 $Sigma$ 的方程为 $F(x,y,z) = 0$,点 $M(x_0,y_0,z_0) in Sigma$,并设 $F(x,y,z)$ 在点 $M$ 的某邻域内具有连续的偏导数,且不同时为零。则称曲面 $Sigma$ 在点 $M$ 处光滑。
因为曲面 $Sigma$ 在点 $M$ 处光滑,所以过 $M$ 可以在曲面 $Sigma$ 上作无数多曲线,这些曲线中的每一条在点 $M$ 处都有一条切线,这些切线所组成的平面称为曲面 $Sigma$ 在点 $M$ 处的#def[切平面],其方程为
$
atpos(F'_x, M, "") (x-x_0) + atpos(F'_y, M, "") (y-y_0) + atpos(F'_z, M, "") (z-z_0) = 0
$
#h(indent)通过点 $M$ 而垂直于切平面的直线称曲面在 $M$ 点的#def[法线],其方程为
$
(x-x_0) / atpos(F'_x,M,"") = (y-y_0) / atpos(F'_y,M,"") = (z-z_0) / atpos(F'_z,M,"")
$
]
#theorem(name: [全微分的几何意义])[
曲面 $z=f(x,y)$ 在点 $M(x_0,y_0,z_0)$ 处的切平面为
$
f'_x (x_0,y_0) (x-x_0) + f'_y (x_0,y_0) (y-y_0) = z - z_0
$
即 $z=f(x,y)$ 在点 $(x_0,y_0)$ 的全微分,表示曲面 $z=f(x,y)$ 在点 $M$ 处的切平面上的点的竖坐标的增量。
] |
|
https://github.com/veilkev/jvvslead | https://raw.githubusercontent.com/veilkev/jvvslead/Typst/sys/sys.typ | typst | #import "./packages.typ": *
/***********************************************/
/* Slanted Parallelogram */
/***********************************************/
#let slantArt = pattern(
size: (20pt, 20pt),
relative: "parent",
place(
dx: 5pt,
dy: 5pt,
rotate(45deg, square(
size: 5pt,
fill: black,
)),
),
)
#let repeat_char(character, count, spacing) = {
// Loop to repeat the character and add minimal spacing
let character = text(character, size: 20pt, weight: "bold")
for i in range(0, count) {
if i > 0 { h(spacing) }
text(character)
}
}
#let parallelogram = rotate(25deg)[
#rect(
width: 0.001cm,
height: 0.50cm
)
#h(3.5pt)
]
/***********************************************/
/* Underlined Red Titles */
/***********************************************/
#let subhead(body, head: false) = {
// Conditions
set text(black) if head
set text(12pt, font: "Source Serif Pro")
underline(
stroke: 2pt + red,
offset: 4pt,
[#body]
)
}
#let empha(term, option) = {
v(-2pt) // align with text
set text(10pt)
set align(center)
set text(fill: black)
if option == 1 [
#h(5pt)
#badge-yellow(term)
#h(5pt)
] else if option == 2 [
#h(5pt)
#badge-green(term)
#h(5pt)
] else if option == 3 [
#h(5pt)
#badge-red(term)
#h(5pt)
] else if option == 4 [
#ui-action(term)
#h(5pt)
] else [
#set text(12pt)
]
}
#let page-number(number) = {
move(dx: 280pt, dy: 770pt)[
#number
]
}
/***********************************************/
/* Slanted Colorbox */
/***********************************************/
#let slantedFigure(color: black, body) = {
set text(fill: white, weight: "bold")
style(styles => {
let size = measure(body, styles)
let inset = 8pt
[#block()[
#polygon(
fill: color,
(0pt, 0pt),
(0pt, size.height + (2*inset)),
(size.width + (2*inset), size.height + (2*inset)),
(size.width + (2*inset) + 6pt, 0cm)
)
#place(center + top, dy: size.height, dx: -3pt)[#body]
]]
})
}
#let slantedColorbox(title: "title", color: none, radius: 0pt, width: auto, body) = {
let strokeColor = luma(70)
let backgroundColor = white
if color == "red" {
strokeColor = rgb(237, 32, 84)
backgroundColor = rgb(253, 228, 224)
} else if color == "green" {
strokeColor = rgb(102, 174, 62)
backgroundColor = rgb(235, 244, 222)
} else if color == "blue" {
strokeColor = rgb(29, 144, 208)
backgroundColor = rgb(232, 246, 253)
}
return box(
fill: backgroundColor,
stroke: 2pt + strokeColor,
radius: radius,
width: width,
)[
#slantedFigure(color: strokeColor)[#title]
#block(
width: 100%,
inset: (top: -2pt, x: 10pt, bottom: 10pt)
)[
#body
]
]
}
#let desc = {
set text(12pt, font: "Gotham")
set text(weight: "regular")
set text(white)
"A comprehensive guide"
}
#let title = {
set text(20pt, font: "Gotham")
set text(weight: "extrabold")
set text(white)
"Front End Lead"
}
// #box(
// width: auto,
// height: 14pt,
// {
// stack(
// dir: ltr,
// spacing: 0pt,
// [A],
// empha("Loan", 3)
// )
// }
// ) |
|
https://github.com/ludwig-austermann/typst-funarray | https://raw.githubusercontent.com/ludwig-austermann/typst-funarray/main/examples/test.typ | typst | MIT License | #import "../funarray.typ": *
#let arrs = range(7).map(i => range(i))
#range(1, 4).map(i => arrs.map(a => chunks(a, i)))
#unzip(())
#cycle(("A",), 4)
#range(1, 4).map(i => arrs.map(a => windows(a, i)))
#funarray-unsafe.windows(arrs.at(6), 2)
#range(1, 4).map(i => arrs.map(a => partition(a, n => calc.rem(n, i) == 0)))
#range(1, 4).map(i => arrs.map(a => group-by(a, n => calc.rem(n, i) == 0)))
#arrs.map(a => take-while(a, x => x < 3))
#arrs.map(a => skip-while(a, x => x < 3))
#arrs.map(a => accumulate(a, 0, (acc, x) => acc / 2 + x))
#arrs.map(a => scan(a, 1, (acc, x) => (acc / 2, acc + x)))
#range(7).map(a => unfold(1, acc => (1 + 0.1*acc, acc), a))
#range(7).map(a => iterated(0, x => 2*x + 1, a)) |
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/completion/import.typ | typst | Apache License 2.0 | // path: base.typ
#let aa() = 1;
#let aab() = 1;
#let aac() = 1;
#let aabc() = 1;
-----
// contains: base,aa,aab,aac,aabc,aa.with,aa.where
#import "base.typ": aab, aac
#aac(/* range -2..0 */); |
https://github.com/i-am-wololo/cours | https://raw.githubusercontent.com/i-am-wololo/cours/master/TP/i21/2/main.typ | typst | #import "./templates.typ": *
#show: project.with(title: "TP2 i21")
= Introduction a matplot:
Je vais skip les question, etant donne qu'elles sont extremement facile a realiser avec des listes en comprehension et la connaissance basique de matplot
= Etude de la multiplication:
pour la multiplication, le prof attend qu'on utilise la methode vu en cours pour la multiplication manuelle sous forme de tableau
#py("
def multi(n1, n2):
summ = 0
for i in range(len(n2)):
for j in range(len(n1)):
summ += (n2[j]*10**i)*(n1[i]*10**j)
return sum")
|
|
https://github.com/lxl66566/my-college-files | https://raw.githubusercontent.com/lxl66566/my-college-files/main/信息科学与工程学院/互联网原理与技术/作业/实践6/main.typ | typst | The Unlicense | #import "../../../template.typ": *
#show: project.with(
title: "实践 6",
authors: (
"absolutex",
)
)
= 实践作业6
== Wireshark 以太网实验:Wireshark 数据包捕获: 访问www.tsinghua.edu.cn
=== 选择包含 HTTP GET 消息的以太网帧。根据包含 HTTP GET 消息的以太网帧的内容回答以下问题。在回答问题时,应该在用于回答所提问题的跟踪中提交数据包的打印输出。注释打印输出以解释您的答案。
实际上,并没有找到 HTTP GET 消息中有 Ethernet II 的帧。
#figure(
image("ethernet not found.png", width: 95%),
caption: "ethernet not found"
)
==== 您的计算机的 48 位以太网地址是什么?
#figure(
image("get.png", width: 95%),
caption: "get"
)
`00:93:37:f8:27:df`
==== 以太网帧中的 48 位目标地址是什么?
在 GET 请求中,没有找到 48 位目标地址。
==== 这是 www.tsinghua.edu.cn 的以太网地址吗?什么设备将此作为其以太网地址?
不是,是上游设备(路由器)的以太网地址。
==== 为双字节帧类型字段指定十六进制值。 这对应于什么上层协议? 从以太网帧的开头开始,“GET”中的 ASCII“G”出现在以太网帧中多少字节?
#figure(
image("protocol.png", width: 95%),
caption: "frame structure"
)
对应于 IPv6 协议。`Protocol: IPv6 (0x86dd)`
#figure(
image("frame.png", width: 95%),
caption: "frame structure"
)
第 89 字节。
=== 根据包含 HTTP 响应消息第一个字节的以太网帧回答以下问题。
==== 以太网源地址的值是多少? 这是您的计算机地址,还是 www.tsinghua.edu.cn的地址。 什么设备将此作为其以太网地址?
#figure(
image("response.png", width: 95%),
caption: "response"
)
`30:7b:ac:1a:f0:02`
是 www.tsinghua.edu.cn 的地址。路由器将其作为其以太网地址。
==== 以太网帧中的目标地址是什么? 这是您计算机的以太网地址吗?
同样,找不到以太网帧中的目标地址。
==== 为双字节帧类型字段指定十六进制值。这对应于什么上层协议?
同样,对应的 IPv6 协议。
==== 从以太网帧的一开始,“OK”中的 ASCII“O”(即 HTTP 响应代码)出现在以太网帧中多少字节?
响应是 `HTTP/1.1 302 Found\r\n`,出现在第 89 字节。
== Wireshark ARP实验:清除本机ARP缓存。 确保浏览器的缓存为空。启动 Wireshark 数据包嗅探器,访问www.Tsinghua.edu.cn。停止 Wireshark 数据包捕获。回答问题:
#figure(
image("ARP.png", width: 95%),
caption: "ARP"
)
=== 包含 ARP 请求消息的以太网帧中源地址和目标地址的十六进制值是什么?
源:`fc:d7:33:01:5d:a0`
目标:`00:00:00:00:00:00`
=== 为双字节以太网帧类型字段提供十六进制值。 这对应于什么上层协议?
ARP 协议(`Protocol: ARP (0x0806)`)
=== 包含 ARP 回复消息的以太网帧中的源地址和目标地址的十六进制值是什么?
没有回复。 |
https://github.com/vEnhance/1802 | https://raw.githubusercontent.com/vEnhance/1802/main/dotpf.typ | typst | MIT License | #import "@local/evan:1.0.0":*
#show: evan.with(
title: [Appendix: dot product proof],
subtitle: [18.02 Recitation MW9],
author: "<NAME>",
date: datetime.today(),
)
Poonen proves this using the law of cosines.
Here is an outline of a proof that doesn't involve any trigonometry.
(Not all the details are filled in here.)
You are not expected to understand this for homework or exams.
We have two definitions in play and we want to show they coincide, which makes notation awkward.
So in what follows, our notation $bf(u) dot bf(v)$ will always refer to the
_geometric_ definition; that is $bf(u) dot bf(v) := |bf(u)| |bf(v)| cos theta$.
And our goal is to show that it matches the algebraic definition given in class.
We will assume that $|bf(u)| = 1$ (i.e. $bf(u)$ is a unit vector)
so that $bf(u) dot bf(v)$ is the length of the projection of $bf(v)$ onto $bf(u)$.
This is OK to assume because in the general case one just scales everything by $|bf(u)|$.
= Easy special case
As a warmup, try to show that if $bf(u) = vec(a,b)$ is any vector, then $bf(u) dot bf(e)_1 = a$.
(This is easy. The projection of $bf(u)$ onto $bf(e)_1$ is literally $a$.)
= Proof
#figure(
image("figures/r02-dotproof.png", width: 75%),
caption: [Proof that the dot product is given by the projection],
)
For concreteness, specialize to $RR^2$ and consider $bf(u) dot bf(v)$
where $bf(u) = vec(a,b)$ is a unit vector (i.e. $bf(u) = 1$),
and $bf(v) = vec(x,y)$ is any vector in $RR^2$.
Then we want to show that the projection of $bf(v)$ onto $bf(u)$ has length $x a + y b$.
The basic idea is to decompose $bf(v) = x bf(e)_1 + y bf(e)_2$.
The length of projection of $bf(v)$ onto $bf(u)$
can be decomposed then into the lengths of projections of $x bf(e)_1$ and $y bf(e)_2$.
(To see this, tilt your head so the green line is horizontal;
recall that the black quadrilateral is a rectangle, hence also a parallelogram).
In other words,
$ bf(u) dot bf(v) = bf(u) dot (x bf(e)_1 + y bf(e)_2)
= x (bf(u) dot bf(e)_1) + y (bf(u) dot bf(e)_2). $
But we already did the special cases before:
$ bf(u) dot bf(e)_1 &= a \
bf(u) dot bf(e)_2 &= b. $
Hence, we get the right-hand side is
$ bf(u) dot bf(v) = x a + y b, $
as advertised.
In summary, by using the black parallelogram, we were able to split $bf(u) dot bf(v)$
into two easy cases we already know how to do.
The same idea will work in $RR^3$ if you use $bf(v) = x bf(e)_1 + y bf(e)_2 + z bf(e)_3$
instead, and replace the parallelogram with a parallelepiped,
in which case one now has $3$ easy cases.
And so on in $n$ dimensions.
|
https://github.com/atareao/typst-templates | https://raw.githubusercontent.com/atareao/typst-templates/main/README.md | markdown | MIT License | # Templates for Typst
## Book
A simple template for my books




|
https://github.com/Chwiggy/thesis_bachelor | https://raw.githubusercontent.com/Chwiggy/thesis_bachelor/main/src/chapters/05_planning.typ | typst | #import "../preamble.typ": *
#set math.equation(numbering: "(1)")
= Planning to Access <planning>
Beyond raw travel times, I also looked at different percentiles of `r5py` travel time calculations. These percentile differences can be understood as a proxy for the amount of flexibility a traveller brings to adjust their departure time to minimise their waiting time at their first public transport stop or to minimise their overall journey time.
As such a high percentile implies transit usage without much planning and adaptation to the schedule and a low percentile implies transit usage with a high degree of planning, but flexibly adapted to the schedule @verduzco_torres_public_2024.
The mean difference between these two resulting travel times from each cell to each other cell then represents the expected travel time difference that a public transit user might experience in a specific location when travelling either with a considerable amount of premeditation, or on a whim just hoping for public transit to show up.
== Post-Processing
To measure these differences, I performed essentially the same processing as for mean travel times in @method_processing but taking the difference between the 90th and 10th percentile of r5py @r5py travel times according to @TravelTimeEq as seen in @Percentile_Difference.
$ P_c = (sum C_d\("90th"\)-C_d\("10th"\))/(N_c-1) $ <Percentile_Difference>
Here the planning indicator $P_c$ describes the average of differences for travel times from cell to cell $C_d$ at the respective percentile. These average differences between travel times were again calculated for a departure time window of an hour for each hour of the selected day to provide insights about temporal variation in this indicator. In human terms this indicator could be described as the difference in travel times in minutes depending on if the imagined traveller picked a close to optimal time (10th percentile of travel times), or got unlucky (90th percentile of travel times).
== Results
Below I will talk about the resulting travel time matrices in two sections. The first concerns the raw insights from travel time calculations. primarily centered around discussions of the travel time matrix at 17:00 local time. The second section then summarises insights gained from the differences in travel time matrices over the course of the day.
=== Planning Difference.
Consulting the map of travel time differences at 17:00 local time (compare @difference_map), there is a much less clear picture emerging, than with the raw travel times in /*reference travel time map or chapter*/. While there seem to be a few areas where travel times are relatively high with travel times up to 25 minutes they seem to be primarily unpopulated areas, like fields south of Patrick-Henry-Village, the forests south east of the historic city centre Altstadt, and slivers north of Ziegelhausen. If you then expect the low travel time difference areas to lie well within population centres, you would be mistaken however. The minimum of travel time difference with around 6 minutes lies within a forested area again: this time in the forest, right around the midpoint between Handschuhsheim and Ziegelhausen.
#figure(image("../figures/Difference_Map17.svg"), kind: "Map", supplement: "Map", caption: [Map of differences in travel time in Heidelberg for 90th and 10th percentile of travel times in minutes per cell. Difference in minutes.]) <difference_map>
In general the populated areas in @difference_map seem to display with a few exceptions a hugely homogenous travel time difference of around 10 to 15 minutes. This homogeneity is remains intact looking at neighbourhood averages including unpopulated cells (compare @boxplot_difference). Here neighbourhood averages for travel time differences all range between 10 and 15 minutes. With the exclusion of Handschuhsheim, the window gets even more narrow and average travel times all lie between 12.5 and 15 minutes. Again however as in @clean_boxplot, neighbourhoods with a lot of unpopulated area like Altstad or Handschuhsheim exhibit a much larger spread of travel time differences than central districts without much unpopulated area, like Bahnstadt. Without populated cell the picture remains largely the same, however differences between the different neighbourhoods shrink further, and the spread of travel time differences within neighbourhoods diminishes as well.
#figure(image("../figures/Boxplots_Difference.svg"), caption: [Boxplot of travel times grouped by neighbourhoods.]) <boxplot_difference>
=== Temporal
Moving on to temporal variation across the day @funky_differences, one can again notice a rough three phase structure to the data. For the travel time differences however, this structure is much noisier. The three parts roughly match the parts already observed with trave times in /*reference previous chapter*/:
+ from midnight until 03:00 local time, travel time differences seeem generally low under 10 minutes, reaching their lowest at 3:00. In these very early hours of the day, as traffic from the day before comes to a close, At 00:00 the train stations are clearly visible as places in which there still is a difference between favourable departure times and less favourable departure times. The rest of the area, seems to be largely locked into itineraries with a lot of walking. At 01:00 this only concerns the central station and the S-Bahn stop Pfaffengrund/Wieblingen.
+ Around 04:00 travel time differences increase sharply. Their spread increases to between 5 and 30 minutes during the day until 17:00 local time. Here outlying districts experience their worst travel times.
+ After a short dip in travel time differences at 17:00 the spread of travel time differences increases even more strongly until midnight. At 19:00 local time peak travel time differences hit 40 minutes, while low travel time differences drop below 5 minutes.
#figure(image("../figures/Heidelberg_Difference_MT.svg"), caption: [Differences in travel times between 90th and 10th percentile in Heidelberg from cell to cell with no population mask, over the course of a weekday.]) <funky_differences>
#figure(image("../figures/Clean_pd_summary_stats_all.svg"), caption: [Average Travel Time Difference for every populated cell in Heidelberg, with standard deviation]) <averege_differences>
Reducing the plot to the average cell with a population density above 5 people per square kilometre (compare @averege_differences), yields a much cleaner picture. Only a few populated cells exhibit a volatile change in travel time difference now. For most populated cells travel time differences decrease to near 0 during the night, to rise to general levels around 15 minutes during the rest of the day. Only at the edge times in the very early morning and the post rush-hour evening average travel time differences seem to be slightly elevated above 15 minutes.
#figure(image("../figures/clean_select_HD_DI_boroughs.svg"), caption: [Travel time differences averaged for populated cells by select districts]) <borough_differences>
Looking at a plot by borough (compare @borough_differences), this pattern generally holds. Notably, central districts like Altstadt and Weststadt experience less of a early morning and evening bump in travel time differences than less central districts like Handschuhsheim or Emmertsgrund.
<end_of_chapter>
#locate(loc => bib_state.at(query(<end_of_chapter>, loc).first().location())) |
|
https://github.com/ntjess/typst-invoice-template | https://raw.githubusercontent.com/ntjess/typst-invoice-template/main/main.typ | typst | Apache License 2.0 | #import "template.typ": invoice-from-metadata
#let meta = yaml("metadata.yaml")
#meta.doc-info.insert("logo", image("logo.svg", height: 5em))
#invoice-from-metadata(meta, pre-table-body: [], apply-default-style: true) |
https://github.com/Caellian/UNIRI_voxels_doc | https://raw.githubusercontent.com/Caellian/UNIRI_voxels_doc/trunk/template.typ | typst | #import "util.typ": locale-date-format
#let logo = image(
"./FIDIT-logo.png",
height: 15.15mm
)
#let title-page = (
study,
kind,
title,
author,
attributions,
logo,
location,
locale: "hr"
) => [
#set text(size: 16pt)
#set align(center)
#grid(
rows: (auto, 1fr, 1fr, auto),
columns: 1fr,
stack(
spacing: 20pt,
logo,
study
),
align(bottom, stack(
spacing: 20pt,
text(size: 18pt, author),
text(size: 28pt, title),
text(size: 18pt, kind)
)),
align(horizon+left, attributions),
align(center)[
#location, #locale-date-format(locale, datetime.today())
]
)]
#let footer-format = (loc) => {
let doc-start = locate(<first-page>).position()
if loc.page() < doc-start.page {
return
}
align(right, text(
weight: "regular",
size: 12pt,
counter(page).display()
))
}
// Formule se obilježavaju rednim brojem pojavljivanja u tekstu u običnoj zagradi.
#let formula(body, caption: none, ..args) = figure(
body,
kind: "formula",
supplement: none,
caption: context {
let index = counter(figure.where(kind: "formula")).get().at(0)
[(#index)#metadata((formula: index, caption: caption))]
},
..args,
)
#let config = (
study: [Sveučilišni prijediplomski studij Informatika],
kind,
title,
author,
attributions: [],
logo: logo,
location: [Rijeka],
locale: "hr",
inserts: [],
) => {
return doc => {
set page(
paper: "a4",
margin: 2.5cm,
)
set text(lang: locale)
title-page(
study,
kind,
title,
author,
attributions,
logo,
location,
locale: locale,
)
set page(
numbering: "1",
footer: locate(footer-format)
)
set text(
font: ("Times New Roman", "Liberation Serif"),
size: 12pt,
)
set par(
justify: true,
leading: 0.15em + 1em * 0.25, // line height 1.15em - 0.15em + descent
)
show par: set block(
spacing: 6pt + 1em * 0.25
)
set heading(
numbering: "1.1.",
supplement: "dijelu"
)
show heading: set text(
font: ("Arial", "Liberation Sans"),
)
show heading.where(level: 1): set text(size: 16pt)
show heading.where(level: 1): it => {
block(
above: 0pt,
below: 12pt,
it
)
}
show heading.where(level: 2): set text(size: 14pt)
show heading.where(level: 2): it => block(
above: 18pt,
below: 6pt,
it
)
show heading.where(level: 3): set text(size: 12pt)
show heading.where(level: 3): it => block(
above: 6pt,
below: 6pt,
it
)
show heading.where(level: 4): set text(size: 12pt)
show heading.where(level: 4): it => block(
above: 6pt,
below: 6pt,
it
)
set list(
marker: "-",
)
show figure.caption: set text(
font: ("Times New Roman", "Liberation Serif"),
size: 10pt,
)
show figure.where(kind: table): set figure(supplement: "Tablica")
show figure.where(kind: table): it => [
#set figure.caption(position: top)
#it
]
show figure.where(kind: image): set figure(supplement: "Slika")
show figure.where(kind: raw): set figure(supplement: "Kȏd")
show figure.where(kind: raw): it => [
#show raw: set text(
font: ("Consolas", "Courier New", "Liberation Mono"),
size: 9pt,
)
#set par(
leading: 0.5em,
)
#set block(width: 100%)
#set align(left)
#it
]
// Uključuje ascent i descent u veličinu znaka za računanje razmaka
// Ascent i descent ovise o fontu, ali obično su 50% ukupne visine glifa
show heading: set block(inset: (y: 0.25em))
show ref: it => {
let el = it.element
if el == none {
return it
}
let func = el.func()
if func == figure and el.at("kind", default: none) == "formula" {
let location = el.location()
let index = counter(figure.where(kind: "formula")).at(location).at(0)
let caption = query(metadata).find(it => {
let value = it.at("value", default: none)
if type(value) != dictionary {
return false
}
return value.at("formula", default: none) == index
})
if caption != none {
caption = caption.at("value").at("caption", default: none)
}
if caption == none {
link(location)[(#index)]
} else {
link(location)[#caption (#index)]
}
} else if func == heading {
let supplement = it.supplement
if supplement == auto {
supplement = el.supplement
}
link(el.location())[#numbering(el.numbering, ..counter(heading).at(el.location())) #supplement]
} else {
it
}
}
// Popravlja outline za formule jer njihov caption ovisi o kontekstu pa se
// krivo pokazuje u outlineu. Također, stvarni caption nije uključen.
show outline.where(target: figure.where(kind: "formula")): it => {
show outline.entry: entry => {
let location = entry.element.location()
let index = counter(figure.where(kind: "formula")).at(location).at(0)
let caption = query(metadata).find(it => {
let value = it.at("value", default: none)
if type(value) != dictionary {
return false
}
return value.at("formula", default: none) == index
})
if caption != none {
caption = caption.at("value").at("caption", default: none)
}
if caption == none {
link(location)[(#index) #box(width: 1fr, repeat[.]) #entry.page]
} else {
link(location)[(#index) #caption #box(width: 1fr, repeat[.]) #entry.page]
}
}
it
}
inserts
outline(
title: "SADRŽAJ",
indent: auto
)
pagebreak()
counter(page).update(1)
[#metadata((tag: "location-marker")) <first-page>]
doc
}
}
#let figure-list() = context {
if query(figure.where(kind: table)).len() > 0 {
pagebreak()
heading(numbering: none)[Popis tablica]
outline(
title: none,
target: figure.where(kind: table)
)
}
if query(figure.where(kind: image)).len() > 0 {
pagebreak()
heading(numbering: none)[Popis slika]
outline(
title: none,
target: figure.where(kind: image)
)
}
if query(figure.where(kind: raw)).len() > 0 {
pagebreak()
heading(numbering: none)[Popis priloga]
outline(
title: none,
target: figure.where(kind: raw)
)
}
}
|
|
https://github.com/jrihon/cv | https://raw.githubusercontent.com/jrihon/cv/main/sections/publications.typ | typst | // import template here as well, to get all the functions
#import "../brilliant-template/template.typ": *
#import "../src/biblio.typ": *
#cvSection("Publications")
+ #manual_cite(Rihon2024Ducque, "<NAME>.")
+ #manual_cite(Rihon2024puckers, "<NAME>.")
+ #manual_cite(Schofield2023HnaAptamer, "<NAME>.", is_first: true)
+ #manual_cite(mat2021eff, "<NAME>.")
+ #manual_cite(Xu2023XyNA, "<NAME>.")
+ #manual_cite(Depuydt2021PnCS1, "<NAME>.", is_first: true)
+ #manual_cite(EMBOPoster, "<NAME>.")
#v(-6pt)
#align(right, graytext(super("◆") + " joint first-author"))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.