repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/WinstonMDP/knowledge
https://raw.githubusercontent.com/WinstonMDP/knowledge/master/algebra.typ
typst
#import "cfg.typ": cfg #show: cfg = Алгебра $(V, +, *)$ - алгебра над полем $F$: - $(V, +, *)$ - векторное пространство над полем $F$ - $(V, +, *)$ - кольцо - $(lambda a) b = a(lambda b) = lambda(a b)$ Всякое поле $L$, содержащее $K$ в качестве подполя, можно рассматривать как алгебру над $K$. В частности, поле $CC$ есть алгебра над $RR$. $a b = sum_(i, j = 1)^n a_i b_j (e_i e_j)$ Если произведение базисных векторов коммутативно, то и всех векторов тоже. То же про ассоциативность.
https://github.com/enpinzolas/resume
https://raw.githubusercontent.com/enpinzolas/resume/main/resumeES.typ
typst
#import "@preview/modern-cv:0.6.0": * #show: resume.with( author: ( firstname: "Eneko", lastname: "<NAME>", email: "<EMAIL>", phone: "(+34) 636 052 072", github: "enpinzolas", linkedin: "eneko-pinzolas", address: "Merkezabal 18, Donostia", positions: ( "Data Engineer", ), ), date: datetime.today().display(), language: "es", colored-headers: true, show-footer: false, ) = Formacion Académica #resume-entry( title: "Máster en Ingeniería Computacional y Sistemas Inteligentes", location: "Donostia - San Sebastián", date: "Septiembre 2017 -- Julio 2019", description: "Escuela de Másteres y Doctorados, Universidad del País Vasco", ) #resume-item[ - Se han desarrollado temas dentro del ámbito de las matemáticas avanzadas para la informática como la computación científica o la criptografía. - En el ámbito de los sistemas inteligentes, se enfocan la inteligencia artificial, la minería de datos y sistemas de _Big Data_. - Tesis: _Análisis y propuesta de un ecosistema para el desarrollo y despliegue de modelos en entornos Edge_. ] #resume-entry( title: "Grado en Ingeniería Informática", location: "Donostia - San Sebastián", date: "Septiembre 2013 -- Agosto 2017", description: "Facultad de Informática, Universidad del País Vasco", ) #resume-item[ - TFG: _Word Embeddings in Search Engines, Quality Evaluation_. ] = Experiencia Laboral #resume-entry( title: "Ingeniero de Datos Senior", location: "Bilbao", date: "Septiembre 2023 -- Actualidad", description: "Bluetab Solutions", ) #resume-item[ - Diseño y desarrollo de soluciones tecnológicas para soluciones del gobierno de los datos y el análisis de dato en entorno financiero. - Migrar ETLs a entorno pyspark, lo cual implicó diseñar procesos con combinaciones de múltiples tablas, analizar y manipular datos y proporcionar soluciones. - *Skills: Pyspark, Python, SQL, HDFS, Hive, Bash scripting, Cloudera* ] #resume-entry( title: "Ingeniero de Datos", location: "Bilbao", date: "Marzo 2022 -- Julio 2023", description: "Accenture España", ) #resume-item[ - Desarrollo soluciones de tecnológicas para soluciones del gobierno de los datos y el análisis de dato en entorno financiero. - Diseñados ETLs de transformación de datos entre diferentes DB o de DB a S3. - Desarrollo de procesos almacenados SQL para automatizar migraciones y cambios. - *Skills: AWS (S3, RDS, Glue, Lambda), SQL, Spark, Python, JS, Microservicios, Docker* ] #resume-entry( title: "Ingeniero de Software", location: "Donostia - San Sebastián", date: "Septiembre 2019 -- Marzo 2022", description: "Nuavis Technology", ) #resume-item[ - Desarrollo soluciones de CV para dispositivos edge y cloud (backend y standalone). - Entrenamiento de modelos ML como darknet y Resnet. - *Python, C++, Node, AWS, REST, Docker, Bash scripting* ] #resume-entry( title: "Estudiante de máster en prácticas", location: "Donostia - San Sebastián", date: "Enero -- Julio 2019", description: "Savvy Data Systems", ) #resume-item[ - Se ha desarrollado la tesis de máster. - *Skills: Anaconda, Spark, Pyspark, Python, Java, Apache NiFi, Apache Hadoop* ] #resume-entry( title: "Desarrollador y asistente técnico", location: "Donostia - San Sebastián", date: "Enero -- Diciembre 2018", description: "SmowlTech", ) #resume-item[ - Administración de bases de datos, desarrollo de nuevas funcionalidades y asesoramiento técnico a clientes. - *Skills: AWS, PHP, JavaScript, HTML, SQL* ] #resume-entry( title: "Técnico de operaciones y analista", location: "Zerain", date: "Septiembre -- Diciembre 2017", description: "Lumagorri", ) #resume-item[ - Redacción de informes técnicos y comerciales. - *Skills: SQL, Access, Office* ] #pagebreak() #resume-entry( title: "Cofundador de Scitodate", location: "Amsterdam", date: "Enero 2016 -- Marzo 2017", description: "Scitodate", ) #resume-item[ - Creación de empresa y desarrollo de la tecnología base. El modelo inicial se basaba en un sistema de recomendación de artículos científicos relevantes personalizado para cada investigador. - *Skills: Python, Scikit-learn, Spark, NLP* ] #resume-entry( title: "Técnico de programación y gestión de base de datos", location: "Zerain", date: "Julio -- Septiembre 2016, 2017", description: "Lumagorri", ) #resume-item[ - Redacción de informes técnicos y comerciales. - *Skills: SQL, Access, Office* ] = Habilidades #resume-skill-item( "Lenguajes", ([*Python*, C++, JS, SQL, PL/PgSQL, Bash, C, Java, R, PHP],), ) #resume-skill-item("Frameworks", ([*Pyspark*, TensorFlow, PyTorch, Flask, Django],), ) #resume-skill-item("Herramientas", ([HDFS, Hive, AWS (EC2, RDS, S3, Glue, DMS, Terraform), PostgreSQL, Oracle, Docker],), ) #resume-skill-item( "Idiomas", ([ *Inglés* (C1), *Euskara* (Lengua materna), *Español* (Lengua materna)], ), ) = Eventos Relevantes #resume-item[ - Participación en el SWERC (_South Western European Regional Contest_) de 2014, 2015 y 2017 - Participación en la _Global Game Jam_ de 2015. ]
https://github.com/8LWXpg/jupyter2typst
https://raw.githubusercontent.com/8LWXpg/jupyter2typst/master/test/test5.typ
typst
MIT License
#import "template.typ": * #show: template #block[ \<font color\=\"red\"\>\<H1\>LATEX INFO\<\/H1\>\<\/font\> ] #block[ In new Jupyter notebooks I have been working you can just type latex in markdown cells and it works. ] #block[ Example of new way on next line, but won\'t work in old canopy I have on home computer. (kept old one so far because lets me edit directly in cnaopy whereas new Canopy goes to browser and is a bit annoying in opening and closing.) To see it work, easiest way is to upload to tmpnb.org and use there. ] #block[ $ $$ nabla times arrow(bold(B)) -space.sixth frac(1, c)space.sixth frac(diff arrow(bold(E)), diff t) & = frac(4pi, c)arrow(bold(j)) \ nabla dot.op arrow(bold(E)) & = 4 pi rho \ nabla times arrow(bold(E))space.sixth +space.sixth frac(1, c)space.sixth frac(diff arrow(bold(B)), diff t) & = arrow(bold(0)) \ nabla dot.op arrow(bold(B)) & = 0 $$ $ ] #block[ *Easy Equation writing examples* $c = sqrt(a^2 + b^2)$ Logarithmic growth of a population of cells can be described mathematically as $N = N_o e^(l n 2(t\/t_2))$ (from page 177 of Methods in Yeast Genetics, 205 Edition) *See #link("http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference")[here] for an awesome reference for MathJax* ] #block[ \"and use single \$ (rather than double \$\$) to keep the equation in\-line. stackoverflow.com\/q\/19412644\/1224255\" \- from #link("http://stackoverflow.com/questions/13208286/how-to-write-latex-in-ipython-notebook")[http:\/\/stackoverflow.com\/questions\/13208286\/how\-to\-write\-latex\-in\-ipython\-notebook] (\<\-\-\-this itself was tricky to write and I had to use minrk\'s April 18th answer at #link("https://github.com/ipython/ipython/issues/3197/")[https:\/\/github.com\/ipython\/ipython\/issues\/3197\/] as a basis ] #block[ Based on #link("https://tex.stackexchange.com/questions/158897/how-do-i-get-a-hyphen-in-mathrm")[here] I figured out (probably again) how to add hyphen when in math mode in Jupyter notebooks and not have it loolike a minus sign. $frac(m i t o space p u r i f i c a t i o n space R N A#[-]S e q space d a t a, t o t a l space c e l l space R N A#[-]s e q space d a t a)$ VS. $frac(o b s_a - o b s_b, e x p_a - e x p_b)$ ] #block[ #code-block("#from JupyterLab demo notebook November 2, 2016 from IPython.display import Latex Latex('''The mass-energy equivalence is described by the famous equation $$E=mc^2$$ discovered in 1905 by <NAME>. In natural units ($c$ = 1), the formula expresses the identity \\\\begin{equation} E=m \\\\end{equation}''')" , lang: "python", count: 15) ] #block[ #result-block("<IPython.core.display.Latex object>") ] #block[ #code-block("%%latex \\begin{aligned} \\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\ \\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\ \\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\ \\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \\end{aligned}" , lang: "python", count: 3) ] #block[ #result-block("<IPython.core.display.Latex object>") ] #block[ #code-block("%%latex $$ \\frac{1}{3}\\ $$ $$ \\frac{obs}{expe}\\ $$ $$ Ai(z) = \\frac13\\sqrt{z}\\left[ I_{-1/3}(\\zeta) -I_{1/3}(\\zeta) \\right] = \\pi^{-1}\\sqrt{z/3}K_{1/3}(\\zeta) $$ {\\bf 10.4.15} $$ Ai(-z) = \\frac13\\sqrt{z} \\left[ J_{1/3}(\\zeta) + J_{-1/3}(\\zeta) \\right] = \\frac12 \\sqrt{z/3} \\left[ e^{\\pi i/6} H_{1/3}^{(1)}(\\zeta) + e^{-\\pi i/6}H_{1/3}^{(2)}(\\zeta) \\right] $$ " , lang: "python", count: 11) ] #block[ #result-block("<IPython.core.display.Latex object>") ]
https://github.com/noahjutz/AD
https://raw.githubusercontent.com/noahjutz/AD/main/uebungen/4/main.typ
typst
= Sortieralgorithmen == Sortieralgorithmen modifizieren === Insertion Sort Statt dass in jedem Schleifendurchlauf die Elemente links des Schlüssels sortiert sind, sollten jetzt jene rechts des Schlüssels sortiert sein. Um das zu bewerkstelligen, drehen wir die äußere und innere Iteration um. Die äußere verläuft jetzt nach links und die innere nach rechts. ```python for j in range(n): key = a[j] i = j-1 while i >= 0 and a[i] > key: a[i+1] = a[i] i -= 1 a[i+1] = key ``` #align(center, sym.arrow.b) ```python for j in reversed(range(n)): key = a[j] i = j+1 while i < n and a[i] < key: a[i-1] = a[i] i += 1 a[i-1] = key ``` ==== Laufzeit & Korrektheit Die Laufzeit bleibt gleich. Der Korrektheitsbeweis erfolgt analog zum Beweis des ursprünglichen Algorithmus. Mehr über Insertion Sort: @insertion-sort === Bubble Sort Um das Maximum nach hinten wandern zu lassen, drehen wir wieder beide Schleifen um. ```python for i in range(n): for j in reversed(range(i, n-1)) if a[j] > a[j+1]: a[j], a[j+1] = a[j+1], a[j] ``` #align(center, sym.arrow.b) ```python for i in reversed(range(n)): for j in range(i, n-1): if a[j] > a[j+1]: a[j], a[j+1] = a[j+1], a[j] ``` ==== Laufzeit & Korrektheit Entspricht dem ursprünglichen Algorithmus. Mehr über Bubble Sort: @bubble-sort === Selection Sort ```python for i in range(n): x = a.index(min(a[i:])) a[i], a[x] = a[x], a[i] ``` #align(center, sym.arrow.b) ```python for i in reversed(range(n)): x = a.index(max(a[:i+1])) a[i], a[x] = a[x], a[i] ``` ==== Laufzeit & Korrektheit Entspricht dem ursprünglichen Algorithmus. Mehr über Selection Sort: @selection-sort === Quicksort Anstatt einen zufälligen Index zu wählen, können wir einfach `a[f]` mit einer zufälligen Zahl vertauschen. ```python def partition(a, f, l): # ... ``` #align(center, sym.arrow.b) ```python def partition(a, f, l): i = randint(f, l) a[f], a[i] = a[i], a[f] # ... ``` ==== Laufzeit & Korrektheit Es wird mal pro `partition`-Aufruf mit $Theta(1)$ zufällig vertauscht, damit bleibt die Laufzeit unverändert. Wenn die nicht-randomisierte Partition korrekt ist, dann ist die Randomisierte auch korrekt, weil die Eingabe `a[f:l+1]` in beliebiger Permutation auftreten darf. Die Reihenfolge der Elemente hat keinen Einfluss auf die Funktionsweise. == Zeitmessungen Zufällige Zahlenfolge der Länge $n$: ```python [randint(-5, 256) for _ in range(n)] ``` Um die maximale Eingabelänge zunächst grob zu ermitteln, prüfen wir jede Potenz von 2 (`max_input.py`). ```python for n in (2**i for i in count()): if runtime > 60: return n ``` Das Infimum der Eingabelängen muss also in $"lo":=n/2$ und $"hi":=n$ liegen. Mit der Intervallhalbierungsmethode können wir dieses $n$ zu einer beliebigen Genauigkeit `depth` berechnen (`exact_input.py`). ```python for _ in range(depth): m = (hi + lo) // 2 if runtime > 60: hi = m else: lo = m return lo ``` Mit einer Tiefe von 20 erhalte ich folgende Eingabelängen $n$, welche innerhalb von $t<60s$ berechnet werden können: #include "measure_table.typ" Quicksort überschreitet die maximale Rekursionstiefe, bevor die Zeitgrenze von einer Minute erreicht wird. == Minkowski-Summe Gefragt ist, ob es ein $s in ZZ$ gibt, welches sich aus der Summe von zwei Elementen $a_i, a_j in A$ ergibt. $ s in {a_i+a_j mid(|) (a_i, a_j) in A times A, i != j} $ === Naiver Ansatz Für alle ${a_i + a_j mid(|) (a_i, a_j) in A times A, i != j}$ prüfen, ob $a_i+a_j = s$. ```python from itertools import combinations for ai, aj in combinations(A, 2): if ai + aj == s: return True return False ``` === Besserer Ansatz Wählen wir $a_i = min(A)$ und $a_j = max(A)$, dann ist die nächstgrößere Summe $ "sum"_> = min(A without {a_i}) + a_j $ und die nächstkleinere Summe $ "sum"_< = a_i + max(A without {a_j}) $ Wenn $A$ sortiert ist, dann lässt sich der nächste Wert in $Theta(1)$ berechnen: $ "sum"_> = a_(i+1) + a_j $ $ "sum"_< = a_i + a_(j-1) $ Wir starten mit $l=0$ und $r=n-1$, und laufen zur Mitte. ```python a.sort() l = 0 r = len(a) - 1 while l < r: sum = a[l] + a[r] if sum == s: return True if sum < s: l += 1 else: r -= 1 return False ``` Das sortieren dauert $Theta(n log n)$, damit dauert der gesamte Algorithmus $Theta(n log n)$. == Iterativ/Rekursiv === Insertion Sort Rekursiv In jedem Rekursionsschritt wird die Eingabelänge $n$ um 1 reduziert. ```python def insertion_sort(a: list, n: int): if n <= 1: return insertion_sort(a, n-1) for i in range(n): if a[n-1] < a[i]: a.insert(i, a.pop(n-1)) return ``` === Merge Sort Iterativ Die Merge-Funktion bleibt unberührt. Für jedes $i in (2, 4, 8, ..., n)$ wird die Eingabe in mehrere $i$-Elementige Teillisten gespaltet. ```python for i in (2 ** i for i in count(1)): for j in range(0, len(a), i): f = j l = min(len(a)-1, j+i-1) # merge a[f:l+1] if i >= len(a): break ```
https://github.com/QRWells/uni-theme
https://raw.githubusercontent.com/QRWells/uni-theme/main/sample-jp.typ
typst
MIT License
#import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx #import "@preview/polylux:0.3.1": * #import "uni-theme-jp.typ": * // define theme colors #let color-a = rgb("04364A"); #let color-b = rgb("176B87"); #let color-c = rgb("448C95"); #show: uni-theme.with( short-author: "論文太郎", short-title: "短いタイトル", date: datetime(year:2024, month: 2, day:2), color-a: color-a, color-b: color-b, color-c: color-c, ) #title-slide( title: "論文のタイトル", authors: ("論文太郎", "論文花子"), subtitle: "サブタイトル", lab-name: "XXX", institution-name: "XXX大学", ) #slide(title: [概要], sub-title: [この発表に何がある], new-section: [導入])[ == 動機 - なぜこの研究を行ったのか? == 貢献 - 何をしたのか? - 何ができるようになったのか? ] #slide(title: [例], new-section: [内容])[ - 引用は @madje2022programmable のように書く - コードは`a + b = c`のように書く ```cpp #include <iostream> ``` ] #slide(title: [参考文献], new-section: [])[ #set text(size: 15pt) #bibliography(title:none, style: "the-institution-of-engineering-and-technology","ref.bib") ]
https://github.com/AU-Master-Thesis/thesis
https://raw.githubusercontent.com/AU-Master-Thesis/thesis/main/sections/3-methodology/study-2/iteration-schedules.typ
typst
MIT License
#import "../../../lib/mod.typ": * === Message Passing Iteration Schedules <s.iteration-schedules> // Scheduling, order in which we call internal and external iteration One of the appreciative properties of the #acr("GBP") algorithm is the relaxed constraints on the order in which variable and factor messages are processed within the joint factorgraph. In the presence of events normally detrimental to peer-to-peer distributed systems without synchronization mechanisms, such as - Messages arriving out of _order_. - Messages being temporarily _dropped_. global convergence can still be achieved. This quality is especially important in multi robotics systems where robots use wireless communication and can only achieve intermittent radio contact. Each robot "hosts" its own factorgraph, and then use interrobot factors to partake in a joint factorgraph with other robots. From the perspective of the #acr("GBP") algorithm there is no functional distintion between messages sent across edges internal to the robots factorgraph, and messages sent along edges between two robots' factorgraph. But in the real-world case these two cases; _internal_ and _external_ message passing involves different steps to perform and different guarantees about latency: - *Internal* message passes are cheap to compute in relation to external message passing, as the messages only have to copied between structures within the virtual memory of the process running the #acr("GBP") algorithm on the robot. - *External* message passes are more expensive to perform. Messages has to be serialized and be transmitted over a wireless connection to then be received and deserialized into its in-memory representation. // - As it is desirable to run execute more internal message passes than external. To accomedate this discrepancy the gbpplanner algorithm can be configured to run a different amount of internal and external message passing iterations per $Delta_t$, through the parameters $M_I$ and $M_E$ respectively. The effect of varying $M_I$ and $M_E$ are not experimented with in @gbpplanner. All the provided experimental scenarios use $M_I = 50$ and $M_E = 10$. Furthermore it is not explained in which order internal and external message passing are scheduled relative to each other, in cases where $M_I != M_E$. The accompanying source code@gbpplanner-code does not answer this question either, and does in fact not implement a way to handle when $M_I != M_E$ as seen here #source-link("https://github.com/aalpatya/gbpplanner/blob/fd719ce6b57c443bc0484fa6bb751867ed0c48f4/src/Simulator.cpp#L82-L87", "gbpplanner/src/Simulatior.cpp:82-87"). Contrary to what they report in their paper. // #k[insert github link to where this can be seen] // These variations are not experimented with in the paper@gbpplanner. They only present scenarios where $M_I = 50$ and $M_E = 10$. And make no remark on the how they schedule the different iterations. Likewise their published code ... // - dichotemy of messages being sent across _internal_ and _external_ edges. This split is parameterized through the variables $M_I$, and $M_E$ that expresses how many times per $Delta_t$ To test what effect the ordering of $M_I$ and $M_E$ has on the global convergence of the algorithm, the reimplementation is extended to incorporate the concept of an _iteration schedule_. A schedule which describes how to lay out the ordering of internal and external message passing relative to each other per simulated timestep $Delta_t$. More formally a schedule is defined to be a higher order function $S$ parameterized by $M_I, M_E$, as shown in @equ.iteration-schedule. $ S(M_I, M_E) = (S_I_(M_I, M_E)(n), S_R_(M_I, M_E)(n)) $ <equ.iteration-schedule> It evaluates to a tuple of two _partial_ functions $S_I_(M_I, M_E)(n)$ and $S_R_(M_I, M_E)(n)$ defined over the range $n in [0, max(M_I, M_E)]$. That when evaluated with a iteration count $n$ returns $top$ if a message passing should be executed, and $bot$ otherwise. To make it effortless to test different schedules and add new ones in the future, dependency injection is used. The interface is modelled through a Rust trait called `GbpSchedule` as seen in @l.gbp-schedule-trait. With the current implementation every robot entity is equipped with the same schedule, but this could be a point for experimentation in possible future work, where robots are modelled with possibly different schedules. #listing( ```rust pub trait GbpSchedule { fn schedule(params: GbpScheduleParams) -> impl GbpScheduleIterator; } pub trait GbpScheduleIterator: std::iter::Iterator<Item = GbpScheduleAtIteration> {} ```, caption: [ #acr("GBP") message passing schedules modelled through the trait `GbpSchedule`. For a listing of all the custom types in the code snippet seet @appendix.iteration-schedules. ] ) <l.gbp-schedule-trait> Five different iteration schedules are experimented with. Each schedule is listed in @f.iteration-schedules accompanied with a diagram explaining visually how the schedules are laid out relative to each other. The name of each schedule together with its diagram should make its behaviour be self explanatory. // is that global convergence can be achieved with an ad-hoc communication schedule, as would often be the case in real scenarios when for instance robots only achieve intermittent radio contact. #let every(array, n, skip-first: false) = { // let n = n + if skip-first { 0 } else { 0 } let begin-at = if skip-first {1} else {0} for (i, it) in array.slice(begin-at).enumerate() { if calc.rem(i, n) == 0 { (it,) } } } // #let iterations = ( // internal: 10, // external: 20, // foo: 5, // ahh: 12, // max: 35 // ) #let interleave-evenly(..times) = { let times = times.pos() let N = times.len() assert(N > 0, message: "#times must be > 0") let max = calc.max(..times) let increments = times.map(x => max / x) let state = range(times.len()).map(_ => 0.0) for k in range(1, max + 1) { (for i in range(N) { if state.at(i) < k { state.at(i) += increments.at(i) (true,) } else { (false,) } },) } } #let schedule-soon-as-possible(..times) = { let times = times.pos() let N = times.len() assert(N > 0, message: "#times must be > 0") let max = calc.max(..times) let schedule = for t in times { (range(t).map(_ => true) + range(max - t).map(_ => false),) } transpose(schedule) } #let schedule-late-as-possible(..times) = { let times = times.pos() let N = times.len() assert(N > 0, message: "#times must be > 0") let max = calc.max(..times) let schedule = for t in times { if t == max { (range(t).map(_ => true),) } else { (range(max - t).map(_ => false) + range(t).map(_ => true),) } } transpose(schedule) } #let schedule-half-at-the-end-half-at-the-beginning(..times) = { let times = times.pos() let N = times.len() assert(N > 0, message: "#times must be > 0") let max = calc.max(..times) let schedule = for t in times { if t == max { (range(t).map(_ => true),) } else { let lower = calc.floor(t / 2) // let lower = calc.max(1, calc.floor(t / 2)) let upper = calc.ceil(t / 2) let middle = calc.ceil(max - t) ( range(lower).map(_ => true) + range(middle).map(_ => false) + range(upper).map(_ => true) , ) } } // schedule transpose(schedule) } // #schedule-half-at-the-end-half-at-the-beginning(1, 4, 10, 17) #let schedule-centered(..times) = { // schedule-half-at-the-end-half-at-the-beginning(..times) // .map(iteration => iteration.map(b => not b)) let times = times.pos() let N = times.len() assert(N > 0, message: "#times must be > 0") let max = calc.max(..times) let schedule = for t in times { if t == max { (range(t).map(_ => true),) } else { let lower = calc.floor((max - t) / 2) // let lower = calc.max(1, calc.floor(t / 2)) let upper = calc.ceil((max - t) / 2) let middle = calc.ceil(t) ( range(lower).map(_ => false) + range(middle).map(_ => true) + range(upper).map(_ => false) , ) } } // schedule transpose(schedule) } #let show-schedule(times, schedule-gen, cmap: color.map.rainbow, inactive-color: gray, title: none, show-xticks: true, headers: none) = { let N = times.len() let max = calc.max(..times) // let schedules = interleave-evenly(..times) let schedules = schedule-gen(..times) let schedules_transposed = transpose(schedules) // let on = table.cell.with(fill: green.lighten(50%)) // let off = table.cell.with(fill: red.lighten(50%)) let cell = table.cell.with(x: 1em, y: 2em) let colors = { if cmap.len() < N { panic("cmap does not contain enough colors") } else if cmap.len() == N { cmap } else { every(cmap, 50).slice(0, N) } } // let colors = every(cmap, 50).slice(0, N) // let on-colors = colors.map(c => table.cell(fill: c, [])) // max set align(center) if title != none { text(size: 12pt, [*#title*]) } // let xticks = if show-xticks { // let k = 9 // (table.hline(stroke: 1pt + gray), ) + if max <= k { // range(max).map(i => i + 1).map(i => [#i]) // } else { // let rest = max - k // let empty = rest - 2 // let lower = calc.floor(empty / 2) // let upper = calc.ceil(empty / 2) // range(k).map(i => i + 1).map(i => [#i]) + range(lower).map(_ => []) + ($...$,) + range(upper).map(_ => []) + ([#max],) // } // } else { // () // } let xticks = if show-xticks { let k = 9 if max <= k { range(max).map(i => i + 1).map(i => [#i]) } else { let rest = max - k let empty = rest - 2 let lower = calc.floor(empty / 2) let upper = calc.ceil(empty / 2) range(k).map(i => i + 1).map(i => [#i]) + range(lower).map(_ => []) + ($dots.c$,) + range(upper).map(_ => []) + ([#max],) } } grid( gutter: 0.1em, stroke: none, columns: range(max).map(_ => 1fr), rows: range(N).map(_ => 2.85mm), ..schedules_transposed.zip(colors).map(pair => { let schedule = pair.at(0) let color = pair.at(1) schedule.map( activate => { let col = if activate { color } else { inactive-color } box( fill: col, radius: 2pt, height: 100%, width: 100%, ) } ) }).flatten(), ) if show-xticks { set text(theme.text) v(-0.5em) line(stroke: (thickness: 1pt, paint: gray, cap: "round"), length: 100%) v(-0.5em) grid( gutter: 0.1em, stroke: none, columns: rep(1fr, max), ..xticks ) } } #let iterations = ( internal: 50, external: 10, ) // #let cmap = (red.lighten(20%), blue.lighten(20%)) // #let cmap = (internal: theme.maroon.lighten(30%), external: theme.blue.lighten(30%)) #let cmap = ( // internal: theme.teal.lighten(25%), // external: theme.maroon.lighten(25%), internal: theme.sky, external: theme.maroon, // inactive: gray ) #let inactive-color = theme.overlay0.lighten(50%) // #text(size: 18pt, cmap.at(0), [Internal #iterations.internal]) // #text(size: 18pt, cmap.at(1), [Internal #iterations.external]) // #let cell(fill) = box(rect(fill: fill, width: 0.9em, height: 0.9em), baseline: 15%) #let cell(fill) = box(fill: fill, height: 0.55em, width: 0.75em, radius: 2pt, inset: (x: 0pt), outset: (y: 1pt)) #figure( { show-schedule(iterations.values(), interleave-evenly, cmap: cmap.values(), inactive-color: inactive-color, title: [Interleave Evenly], show-xticks: false) show-schedule(iterations.values(), schedule-soon-as-possible, cmap: cmap.values(), inactive-color: inactive-color, title: [Soon as Possible], show-xticks: false) show-schedule(iterations.values(), schedule-late-as-possible, cmap: cmap.values(), inactive-color: inactive-color, title: [Late as Possible], show-xticks: false) show-schedule(iterations.values(), schedule-half-at-the-end-half-at-the-beginning, cmap: cmap.values(), inactive-color: inactive-color, title: [Half Start, Half End], show-xticks: false) show-schedule(iterations.values(), schedule-centered, cmap: cmap.values(), inactive-color: inactive-color, title: [Centered]) }, caption: [ Visual representation of each schedule for $M_I = 50$, $M_E = 10$. Teal cells #cell(cmap.internal) indicate internal message passing at that iteration. Red #cell(cmap.external) represent external message passing and gray #cell(inactive-color) cells indicate no message passing. ] ) <f.iteration-schedules> The effect of each schedule is experimented with and compared in @s.r.study-2. To make experimentation easy and discoverable the UI settings panel of the simulator has a dedicated section to control $M_I, M_E$ and the chosen schedule live as the simulation is running. A screenshot of the section is shown in @f.ui-schedule-settings. // ```toml // [gbp.iteration-schedule] // internal = 10 // external = 10 // schedule = "interleave-evenly" // ``` // // #k[mention where it can be configured] #let inline-schedule-example = { // let r = color.rgb("#D68A90") // let c = color.rgb("#82C1CC") // let g = color.rgb("#63677F").lighten(80%) let g = theme.overlay2.lighten(25%) let ni = 12 let ne = 4 let schedules = interleave-evenly(ni, ne) let schedules_transposed = transpose(schedules) let internal = schedules_transposed.at(0) let external = schedules_transposed.at(1) let internal-active = line(length: 4pt, stroke: cmap.internal) let external-active = line(length: 4pt, stroke: cmap.external) let external-inactive = line(length: 4pt, stroke: g) // schedules_transposed box( { grid( columns: ni, row-gutter: 4pt, column-gutter: 1pt, ..internal.map(active => if active { internal-active } else { [] }), ..external.map(active => if active { external-active } else { external-inactive }), ) v(1pt) }, inset: (x: 2pt), outset: (y: 2pt) ) } // #inline-schedule-example #figure( std-block(width: 60%, height: auto, image("../../../figures/img/gbp-schedules-preview-2.png")), caption: [ Screenshot of the subsection of the simulator's settings panel which displays the current schedule. Both $M_i$ and $M_r$ can be changed dynamically while the simulation runs. The active schedule is displayed aswell and can be changed through a combobox list. The active schedule is displayed with the #inline-schedule-example component. Similar to how its displayed in @f.iteration-schedules. ] ) <f.ui-schedule-settings> // #82C1CC // #D68A90 // #k[mention strategy pattern / dependency injection] #{ set par(first-line-indent: 0em) [ *Expectation:* For the algorithm to be robust and converge the relative order in which external messages are used to update the joint factorgraph should matter very little. The following three outcomes are expected: - No difference between _Late as Possible_ and _Soon as Possible_ as they are identical expect for $min(M_I, M_E)$ being offset in phase by $max(M_I, M_E) - min(M_I, M_E)$. - No difference between _Half at the Beginning_ and _Half at the End_. Similar to the above except with $min(M_I, M_E)$ being offset by $min(M_I, M_E)$ in phase. - _Interleave Evenly_ should be the best schedule of the five, as the updates from external robots are spaced more evenly in time. Distributing the amount of information evenly between iterations ensures variables are updated evenly in time, leading to a more even distribution of information. This even spacing makes the system less volatile and increases the likelihood of robust convergence, as even time distribution equates to even information density. // notes: // // distribute the amount of information evenly between iterations // // with a more even distribution of information // // not volatile because evenly spaced information // // ensure variable are updated evenly in time // // expect even time distribution to equate to even information density ] }
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/docs/dev/architecture.md
markdown
Apache License 2.0
# Typst Compiler Architecture Wondering how to contribute or just curious how Typst works? This document covers the general structure and architecture of Typst's compiler, so you get an understanding of what's where and how everything fits together. ## Directories Let's start with a broad overview of the directories in this repository: - `crates/typst`: The main compiler crate which is home to the parser, interpreter, exporters, IDE tooling, and more. - `crates/typst-library`: Typst's standard library with all global definitions available in Typst. Also contains the layout and text handling pipeline. - `crates/typst-cli`: Typst's command line interface. This is a relatively small layer on top of `typst` and `typst-library`. - `crates/typst-docs`: Generates the content of the official [documentation][docs] from the content of the `docs` folder and the inline Rust documentation. Only generates the content and structure, not the concrete HTML (that part is currently closed source). - `crates/typst-macros`: Procedural macros for the compiler and library. - `docs`: Source files for longer-form parts of the documentation. Individual elements and functions are documented inline with the Rust source code. - `assets`: Fonts and files used for tests and the documentation. - `tests`: Integration tests for Typst compilation. - `tools`: Tooling for development. ## Compilation The source-to-PDF compilation process of a Typst file proceeds in four phases. 1. **Parsing:** Turns a source string into a syntax tree. 2. **Evaluation:** Turns a syntax tree and its dependencies into content. 4. **Layout:** Layouts content into frames. 5. **Export:** Turns frames into an output format like PDF or a raster graphic. The Typst compiler is _incremental:_ Recompiling a document that was compiled previously is much faster than compiling from scratch. Most of the hard work is done by [`comemo`], an incremental compilation framework we have written for Typst. However, the compiler is still carefully written with incrementality in mind. Below we discuss the four phases and how incrementality affects each of them. ## Parsing The syntax tree and parser are located in `crates/typst-syntax`. Parsing is a pure function `&str -> SyntaxNode` without any further dependencies. The result is a concrete syntax tree reflecting the whole file structure, including whitespace and comments. Parsing cannot fail. If there are syntactic errors, the returned syntax tree contains error nodes instead. It's important that the parser deals well with broken code because it is also used for syntax highlighting and IDE functionality. **Typedness:** The syntax tree is untyped, any node can have any `SyntaxKind`. This makes it very easy to (a) attach spans to each node (see below), (b) traverse the tree when doing highlighting or IDE analyses (no extra complications like a visitor pattern). The `typst::syntax::ast` module provides a typed API on top of the raw tree. This API resembles a more classical AST and is used by the interpreter. **Spans:** After parsing, the syntax tree is numbered with _span numbers._ These numbers are unique identifiers for syntax nodes that are used to trace back errors in later compilation phases to a piece of syntax. The span numbers are ordered so that the node corresponding to a number can be found quickly. **Incremental:** Typst has an incremental parser that can reparse a segment of markup or a code/content block. After incremental parsing, span numbers are reassigned locally. This way, span numbers further away from an edit stay mostly stable. This is important because they are used pervasively throughout the compiler, also as input to memoized functions. The less they change, the better for incremental compilation. ## Evaluation The evaluation phase lives in `crates/typst/src/eval`. It takes a parsed `Source` file and evaluates it to a `Module`. A module consists of the `Content` that was written in it and a `Scope` with the bindings that were defined within it. A source file may depend on other files (imported sources, images, data files), which need to be resolved. Since Typst is deployed in different environments (CLI, web app, etc.) these system dependencies are resolved through a general interface called a `World`. Apart from files, the world also provides configuration and fonts. **Interpreter:** Typst implements a tree-walking interpreter. To evaluate a piece of source, you first create a `Vm` with a scope stack. Then, the AST is recursively evaluated through trait impls of the form `fn eval(&self, vm: &mut Vm) -> Result<Value>`. An interesting detail is how closures are dealt with: When the interpreter sees a closure / function definition, it walks the body of the closure and finds all accesses to variables that aren't defined within the closure. It then clones the values of all these variables (it _captures_ them) and stores them alongside the closure's syntactical definition in a closure value. When the closure is called, a fresh `Vm` is created and its scope stack is initialized with the captured variables. **Incremental:** In this phase, incremental compilation happens at the granularity of the module and the closure. Typst memoizes the result of evaluating a source file across compilations. Furthermore, it memoizes the result of calling a closure with a certain set of parameters. This is possible because Typst ensures that all functions are pure. The result of a closure call can be recycled if the closure has the same syntax and captures, even if the closure values stems from a different module evaluation (i.e. if a module is reevaluated, previous calls to closures defined in the module can still be reused). ## Layout The layout phase takes `Content` and produces one `Frame` per page for it. To layout `Content`, we first have to _realize_ it by applying all relevant show rules to the content. Since show rules may be defined as Typst closures, realization can trigger closure evaluation, which in turn produces content that is recursively realized. Realization is a shallow process: While collecting list items into a list that we want to layout, we don't realize the content within the list items just yet. This only happens lazily once the list items are layouted. When we a have realized the content into a layoutable element, we can then layout it into _regions,_ which describe the space into which the content shall be layouted. Within these, an element is free to layout itself as it sees fit, returning one `Frame` per region it wants to occupy. **Introspection:** How content layouts (and realizes) may depend on how _it itself_ is layouted (e.g., through page numbers in the table of contents, counters, state, etc.). Typst resolves these inherently cyclical dependencies through the _introspection loop:_ The layout phase runs in a loop until the results stabilize. Most introspections stabilize after one or two iterations. However, some may never stabilize, so we give up after five attempts. **Incremental:** Layout caching happens at the granularity of the element. This is important because overall layout is the most expensive compilation phase, so we want to reuse as much as possible. ## Export Exporters live in `crates/typst/src/export`. They turn layouted frames into an output file format. - The PDF exporter takes layouted frames and turns them into a PDF file. - The built-in renderer takes a frame and turns it into a pixel buffer. - HTML export does not exist yet, but will in the future. However, this requires some complex compiler work because the export will start with `Content` instead of `Frames` (layout is the browser's job). ## IDE The `crates/typst/src/ide` module implements IDE functionality for Typst. It builds heavily on the other modules (most importantly, `syntax` and `eval`). **Syntactic:** Basic IDE functionality is based on a file's syntax. However, the standard syntax node is a bit too limited for writing IDE tooling. It doesn't provide access to its parents or neighbours. This is a fine for an evaluation-like recursive traversal, but impractical for IDE use cases. For this reason, there is an additional abstraction on top of a syntax node called a `LinkedNode`, which is used pervasively across the `ide` module. **Semantic:** More advanced functionality like autocompletion requires semantic analysis of the source. To gain semantic information for things like hover tooltips, we directly use other parts of the compiler. For instance, to find out the type of a variable, we evaluate and realize the full document equipped with a `Tracer` that emits the variable's value whenever it is visited. From the set of resulting values, we can then compute the set of types a value takes on. Thanks to incremental compilation, we can recycle large parts of the compilation that we had to do anyway to typeset the document. **Incremental:** Syntactic IDE stuff is relatively cheap for now, so there are no special incrementality concerns. Semantic analysis with a tracer is relatively expensive. However, large parts of a traced analysis compilation can reuse memoized results from a previous normal compilation. Only the module evaluation of the active file and layout code that somewhere within evaluates source code in the active file needs to re-run. This is all handled automatically by `comemo` because the tracer is wrapped in a `comemo::TrackedMut` container. ## Tests Typst has an extensive suite of integration tests. A test file consists of multiple tests that are separated by `---`. For each test file, we store a reference image defining what the compiler _should_ output. To manage the reference images, you can use the VS code extension in `tools/test-helper`. The integration tests cover parsing, evaluation, realization, layout and rendering. PDF output is sadly untested, but most bugs are in earlier phases of the compiler; the PDF output itself is relatively straight-forward. IDE functionality is also mostly untested. PDF and IDE testing should be added in the future. [docs]: https://typst.app/docs/ [`comemo`]: https://github.com/typst/comemo/
https://github.com/RolfBremer/gloss-awe
https://raw.githubusercontent.com/RolfBremer/gloss-awe/main/Global/GlossaryPool.typ
typst
Apache License 2.0
// This is the glossary pool definition file. #let glossary-pool = ( Beryllium: ( description: [ Element number 4 in the Periodic Table of Elements. ] ), Calcium: ( description: [ Element number 20 in the Periodic Table of Elements. ] ), Casing: ( description: [ The casing in the glossary is of importance, since there are cases where the same Term has different meaning, depending on the Casing. ] ), Cloud: ( description: [ Cloud computing is a model where computer resources are made available over the internet. Such resources can be assigned on demand in a very short time, and only as long as they are required by the user. ] ), Cluster: ( description: [ A cluster is a set of cooperating computers or virtual machines. Cluster can provide computing resources for scalability an/or redundancy. ] ), Cmdlet: ( description: [ A Cmdlet is a command of the PowerShell. They provide specific interface requirements, such as integrated help, parameter parsing etc. ] ), Commit-SHA: ( description: [ Derived from web search results: In Git, a Commit-SHA is a 40-character hexadecimal string that specifies a 160-bit SHA-1 hash. It is used to identify a commit. ] ), "Common Definition": ( description: [ Many word in a natural language have many meanings. Sometimes, but unfortunately not always, the intention of the writer or speaker can be derived from the context the word is used in. In documentation, it is important to have a common understanding of the word. That's why we use glossaries to define the intended meaning. ] ), Context: ( description: [ The circumstances that form the setting for an event, statement, or idea, and in terms of which it can be fully understood. ] ), ConTeXt: ( description: [ A nice, modern typesetting system derived from LaTeX. ] ), CorrelationId: ( description: [ Eine eindeutige ID, die an einem Vorgang angehängt wird um ihn in einer verteilten Softwareumgebung in allen Diensten identifizieren zu können. Dies dient der Nachvollziehbarkeit von Vorgängen für die Fehlersuche. ] ), CSV: ( description: [ Das Dateiformat CSV steht für „Comma Separated Values“ und beschreibt den Aufbau einer Textdatei zur Speicherung oder zum Austausch einfach strukturierter Daten, welche ein bestimmtes Zeichen, wie Komma oder Semikolon, als Feldtrennzeichen verwendet. ] ), Deployment: ( description: [ Die Auslieferung und Bereitstellung von Softwaresystemen auf Rechnern. ] ), Engine: ( description: [ In the context of software, an engine is a core component of a software application that powers its functionality by pre-packaging complex systems into a reusable component that often works in a plug-and-play model to streamline software development. An engine in computer programming is a program that executes the foundation or crucial task for other programs. It is a complex subsystem that can be used to organize the all-around functions of other programs. ], link: [ (1) 10 Types of Software Engines That You Should Know About - Spiceworks. https://www.spiceworks.com/tech/devops/articles/what-is-software-engine/ Zugegriffen 13.5.2023. (2) Software engine - Wikipedia. https://en.wikipedia.org/wiki/Software_engine Zugegriffen 13.5.2023. ] ), Example: ( description: [ An example is something that is typical of the group of things that it is a member of or that can be used to represent it. It can also be a way of helping someone to understand something by showing them how it is used. For instance, if you want to explain what a fruit is, you could give an apple as an example. ], link: [ (1) EXAMPLE | English meaning - Cambridge Dictionary. https://dictionary.cambridge.org/dictionary/english/example (13.5.2023) (2) Example Definition & Meaning - Merriam-Webster. https://www.merriam-webster.com/dictionary/example (13.5.2023) ] ), Glossary: ( description: [ A glossary is a list of terms and their definitions that are specific to a particular subject or field. It is used to define the intended meaning of terms used in a document and to agree on a common definition of those terms. A well-defined glossary can be very helpful in documents where very specific meanings of certain terms are used. ] ), "Glossary Pool": ( description: [ A glossary pool is a collection of glossary entries. An automated tool can pull needed definitions from this pool to create the glossary pages for a specific context. ] ), GUID: ( description: [ Eine GUID ist eine global eindeutige ID, deren Bildungsalgorithmus mit sehr hoher Wahrscheinlichkeit sicherstellt, dass sie weltweit eindeutig ist -- auch wenn sie dezentral erzeugt werden kann. GUIDs werden als eindeutige Identifier verwendet, wenn keine zentrale Schlüsselkoordination möglich oder sinnvoll ist. ] ), ISO8601: ( description: [ ISO 8601 ist ein internationaler Standard der ISO @ISODATE, der Empfehlungen über numerische Datumsformate und Zeitangaben enthält. Der Titel der Norm ist „Data elements and interchange formats -- Information interchange -- Representation of dates and times“, also etwa „Datenelemente und Austauschformate; Informationsaustausch; Darstellung von Datum und Uhrzeit“. ] ), Iteration: ( description: [ Repetition of a mathematical or computational procedure applied to the result of a previous application, typically as a means of obtaining successively closer approximations to the solution of a problem. ] ), iteration: ( description: [ repetition of a mathematical or computational procedure applied to the result of a previous application, typically as a means of obtaining successively closer approximations to the solution of a problem. ] ), Kreisfläche: ( description: [ Die Fläche eines Kreises. ] ), Lock: ( description: [ Eine Sperrfunktionalität, mit der verhindert wird, dass mehrere Prozesse gleichzeitig auf ein Portal zugreifen. Nur Prozesse, die das Lock setzen können, dürfen zugreifen. Versucht ein anderer Prozess während der Sperrung ein Lock zu erhalten, wird er abgewiesen, bzw. wartet maximal eine konfigurierbare Zeit auf das Freiwerden des Locks. Diese maximale Wartezeit ist über den entsprechenden Konfigurationsparameter einstellbar. ] ), Log-Datei: ( description: [ Eine Log-Datei (oder Protokoll-Datei, Ereignisprotokoll) @LOGFILEWIKIPEDIA enthält das automatisch geführte Protokoll aller oder bestimmter Aktionen von Prozessen auf einem Computersystem. ] ), Node: ( description: [ Cluster Node -- Ein Rechner oder eine virtuelle Maschine, die Bestandteil eines Rechnerverbundes ist. Siehe „Cluster“. ] ), Parameter: ( description: [ Parameter, zu denen Basis-Parameter, Kontext-Parameter und Template-Parameter gehören, dienen dazu, aktuelle Informationen in die neu zu erstellenden Dateien zu bringen, wo sie mit Hilfe der Makro-Ersetzung integriert werden. Siehe auch Aufruf-Parameter. ] ), REST: ( description: [ Representational State Transfer (abgekürzt REST) ist ein Paradigma für die Softwarearchitektur von verteilten Systemen, insbesondere für Webservices. REST ist eine Abstraktion der Struktur und des Verhaltens des World Wide Web. REST hat das Ziel, einen Architekturstil zu schaffen, der den Anforderungen des modernen Web besser genügt. ] ), SOA: ( description: [ Service Oriented Architecture -- ein Architekturmuster der Informationstechnik aus dem Bereich der verteilten Systeme, um Dienste von IT-Systemen zu strukturieren und zu nutzen. ] ), "Test Text": ( description: [ _Test Text_ is used in this document to demonstrate the mechanism of the glossary functionality. It is usually a mixture of some arbitrary sentences containing terms that allow the demonstration of certain features and some lorem ipsum filler text. For demonstration of certain features a certain length of the _Test Text_ is required. ] ), TLS: ( description: [ Englisch für Transportschicht-Sicherheit, auch bekannt unter seiner Vorgängerbezeichnung „Secure Sockets Layer“ (SSL), ist ein Verschlüsselungsprotokoll zur sicheren Datenübertragung im Internet. ] ), Typst: ( description: [ Typst is a new markup-based typesetting system for the sciences. It is designed to be an alternative both to advanced tools like LaTeX and simpler tools like Word and Google Docs. ] ), typst: ( description: [ See "Typst". ] ), Umgebung: ( description: [ Die Umgebung eines Makros besteht aus einem Präfix und einem Postfix, die beide optional mit dem Makro definiert werden können. Die Texte der Umgebung werden nur ausgegeben, wenn der Wert des Makros nicht leer ist. ] ), Umgebungsvariablen: ( description: [ Eine Konfigurations-Infrastruktur des Betriebssystems. In Umgebungsvariablen können Informationen hinterlegt werden, die den Anwendungen damit zugänglich gemacht werden. So nutzt zum Beispiel die PowerShell die Umgebungsvariable „PSModulePath“, um die Verzeichnisse zu finden, in denen PowerShell-Module gespeichert sind. ] ), XML: ( description: [ XML stands for `'eXtensible Markup Language'`. ], link: [https://www.w3.org/XML] ), )
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/189.%20conformism.html.typ
typst
conformism.html The Four Quadrants of Conformism July 2020One of the most revealing ways to classify people is by the degree and aggressiveness of their conformism. Imagine a Cartesian coordinate system whose horizontal axis runs from conventional-minded on the left to independent-minded on the right, and whose vertical axis runs from passive at the bottom to aggressive at the top. The resulting four quadrants define four types of people. Starting in the upper left and going counter-clockwise: aggressively conventional-minded, passively conventional-minded, passively independent-minded, and aggressively independent-minded.I think that you'll find all four types in most societies, and that which quadrant people fall into depends more on their own personality than the beliefs prevalent in their society. [1]Young children offer some of the best evidence for both points. Anyone who's been to primary school has seen the four types, and the fact that school rules are so arbitrary is strong evidence that which quadrant people fall into depends more on them than the rules.The kids in the upper left quadrant, the aggressively conventional-minded ones, are the tattletales. They believe not only that rules must be obeyed, but that those who disobey them must be punished.The kids in the lower left quadrant, the passively conventional-minded, are the sheep. They're careful to obey the rules, but when other kids break them, their impulse is to worry that those kids will be punished, not to ensure that they will.The kids in the lower right quadrant, the passively independent-minded, are the dreamy ones. They don't care much about rules and probably aren't 100% sure what the rules even are.And the kids in the upper right quadrant, the aggressively independent-minded, are the naughty ones. When they see a rule, their first impulse is to question it. Merely being told what to do makes them inclined to do the opposite.When measuring conformism, of course, you have to say with respect to what, and this changes as kids get older. For younger kids it's the rules set by adults. But as kids get older, the source of rules becomes their peers. So a pack of teenagers who all flout school rules in the same way are not independent-minded; rather the opposite.In adulthood we can recognize the four types by their distinctive calls, much as you could recognize four species of birds. The call of the aggressively conventional-minded is "Crush <outgroup>!" (It's rather alarming to see an exclamation point after a variable, but that's the whole problem with the aggressively conventional-minded.) The call of the passively conventional-minded is "What will the neighbors think?" The call of the passively independent-minded is "To each his own." And the call of the aggressively independent-minded is "Eppur si muove."The four types are not equally common. There are more passive people than aggressive ones, and far more conventional-minded people than independent-minded ones. So the passively conventional-minded are the largest group, and the aggressively independent-minded the smallest.Since one's quadrant depends more on one's personality than the nature of the rules, most people would occupy the same quadrant even if they'd grown up in a quite different society.Princeton professor <NAME> recently wrote: I sometimes ask students what their position on slavery would have been had they been white and living in the South before abolition. Guess what? They all would have been abolitionists! They all would have bravely spoken out against slavery, and worked tirelessly against it. He's too polite to say so, but of course they wouldn't. And indeed, our default assumption should not merely be that his students would, on average, have behaved the same way people did at the time, but that the ones who are aggressively conventional-minded today would have been aggressively conventional-minded then too. In other words, that they'd not only not have fought against slavery, but that they'd have been among its staunchest defenders.I'm biased, I admit, but it seems to me that aggressively conventional-minded people are responsible for a disproportionate amount of the trouble in the world, and that a lot of the customs we've evolved since the Enlightenment have been designed to protect the rest of us from them. In particular, the retirement of the concept of heresy and its replacement by the principle of freely debating all sorts of different ideas, even ones that are currently considered unacceptable, without any punishment for those who try them out to see if they work. [2]Why do the independent-minded need to be protected, though? Because they have all the new ideas. To be a successful scientist, for example, it's not enough just to be right. You have to be right when everyone else is wrong. Conventional-minded people can't do that. For similar reasons, all successful startup CEOs are not merely independent-minded, but aggressively so. So it's no coincidence that societies prosper only to the extent that they have customs for keeping the conventional-minded at bay. [3]In the last few years, many of us have noticed that the customs protecting free inquiry have been weakened. Some say we're overreacting � that they haven't been weakened very much, or that they've been weakened in the service of a greater good. The latter I'll dispose of immediately. When the conventional-minded get the upper hand, they always say it's in the service of a greater good. It just happens to be a different, incompatible greater good each time.As for the former worry, that the independent-minded are being oversensitive, and that free inquiry hasn't been shut down that much, you can't judge that unless you are yourself independent-minded. You can't know how much of the space of ideas is being lopped off unless you have them, and only the independent-minded have the ones at the edges. Precisely because of this, they tend to be very sensitive to changes in how freely one can explore ideas. They're the canaries in this coalmine.The conventional-minded say, as they always do, that they don't want to shut down the discussion of all ideas, just the bad ones.You'd think it would be obvious just from that sentence what a dangerous game they're playing. But I'll spell it out. There are two reasons why we need to be able to discuss even "bad" ideas.The first is that any process for deciding which ideas to ban is bound to make mistakes. All the more so because no one intelligent wants to undertake that kind of work, so it ends up being done by the stupid. And when a process makes a lot of mistakes, you need to leave a margin for error. Which in this case means you need to ban fewer ideas than you'd like to. But that's hard for the aggressively conventional-minded to do, partly because they enjoy seeing people punished, as they have since they were children, and partly because they compete with one another. Enforcers of orthodoxy can't allow a borderline idea to exist, because that gives other enforcers an opportunity to one-up them in the moral purity department, and perhaps even to turn enforcer upon them. So instead of getting the margin for error we need, we get the opposite: a race to the bottom in which any idea that seems at all bannable ends up being banned. [4]The second reason it's dangerous to ban the discussion of ideas is that ideas are more closely related than they look. Which means if you restrict the discussion of some topics, it doesn't only affect those topics. The restrictions propagate back into any topic that yields implications in the forbidden ones. And that is not an edge case. The best ideas do exactly that: they have consequences in fields far removed from their origins. Having ideas in a world where some ideas are banned is like playing soccer on a pitch that has a minefield in one corner. You don't just play the same game you would have, but on a different shaped pitch. You play a much more subdued game even on the ground that's safe.In the past, the way the independent-minded protected themselves was to congregate in a handful of places � first in courts, and later in universities � where they could to some extent make their own rules. Places where people work with ideas tend to have customs protecting free inquiry, for the same reason wafer fabs have powerful air filters, or recording studios good sound insulation. For the last couple centuries at least, when the aggressively conventional-minded were on the rampage for whatever reason, universities were the safest places to be.That may not work this time though, due to the unfortunate fact that the latest wave of intolerance began in universities. It began in the mid 1980s, and by 2000 seemed to have died down, but it has recently flared up again with the arrival of social media. This seems, unfortunately, to have been an own goal by Silicon Valley. Though the people who run Silicon Valley are almost all independent-minded, they've handed the aggressively conventional-minded a tool such as they could only have dreamed of.On the other hand, perhaps the decline in the spirit of free inquiry within universities is as much the symptom of the departure of the independent-minded as the cause. People who would have become professors 50 years ago have other options now. Now they can become quants or start startups. You have to be independent-minded to succeed at either of those. If these people had been professors, they'd have put up a stiffer resistance on behalf of academic freedom. So perhaps the picture of the independent-minded fleeing declining universities is too gloomy. Perhaps the universities are declining because so many have already left. [5]Though I've spent a lot of time thinking about this situation, I can't predict how it plays out. Could some universities reverse the current trend and remain places where the independent-minded want to congregate? Or will the independent-minded gradually abandon them? I worry a lot about what we might lose if that happened.But I'm hopeful long term. The independent-minded are good at protecting themselves. If existing institutions are compromised, they'll create new ones. That may require some imagination. But imagination is, after all, their specialty. Notes[1] I realize of course that if people's personalities vary in any two ways, you can use them as axes and call the resulting four quadrants personality types. So what I'm really claiming is that the axes are orthogonal and that there's significant variation in both.[2] The aggressively conventional-minded aren't responsible for all the trouble in the world. Another big source of trouble is the sort of charismatic leader who gains power by appealing to them. They become much more dangerous when such leaders emerge.[3] I never worried about writing things that offended the conventional-minded when I was running Y Combinator. If YC were a cookie company, I'd have faced a difficult moral choice. Conventional-minded people eat cookies too. But they don't start successful startups. So if I deterred them from applying to YC, the only effect was to save us work reading applications.[4] There has been progress in one area: the punishments for talking about banned ideas are less severe than in the past. There's little danger of being killed, at least in richer countries. The aggressively conventional-minded are mostly satisfied with getting people fired.[5] Many professors are independent-minded � especially in math, the hard sciences, and engineering, where you have to be to succeed. But students are more representative of the general population, and thus mostly conventional-minded. So when professors and students are in conflict, it's not just a conflict between generations but also between different types of people.Thanks to <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, and <NAME> for reading drafts of this.German TranslationKorean TranslationSerbian Translation
https://github.com/ParaN3xus/numblex
https://raw.githubusercontent.com/ParaN3xus/numblex/main/lib/ordinals.typ
typst
MIT License
// Ordinals // -------- // `(<positional>n: int, <named>depth: int) => str` /// Circular access to an array #let circ_at(arr, ind) = { assert(type(arr) == array, message: "rep_at: first argument must be an array, `" + type(arr) + "` given") assert(arr.len() > 0, message: "rep_at: first argument must not be empty") assert(type(ind) == int, message: "rep_at: second argument must be an integer") let ind = calc.rem(ind, arr.len()) arr.at(ind) } /// Replace with the last element if the index is out of bounds #let replast_at(arr, ind) = { assert(type(arr) == array, message: "rep_at: first argument must be an array, `" + type(arr) + "` given") assert(arr.len() > 0, message: "rep_at: first argument must not be empty") assert(type(ind) == int, message: "rep_at: second argument must be an integer") assert(ind >= 0, message: "rep_at: second argument must be non-negative") arr.at(ind, default: arr.last()) } /// Get the ordinal char from a string circularly /// /// returns a closure that takes an integer and returns the ordinal char #let circ_ord_from_str(s) = (n, ..args) => { assert(type(n) == int, message: "ord_from_str: argument must be an integer") assert(n >= 0, message: "ord_from_str: argument must be non-negative") return circ_at(s.clusters(), n) } /// Get the ordinal char from a string, replace with the last element if the index is out of bounds /// /// returns a closure that takes an integer and returns the ordinal char #let replast_ord_from_str(s) = (n, ..args) => { assert(type(n) == int, message: "ord_from_str: argument must be an integer") assert(n >= 0, message: "ord_from_str: argument must be non-negative") return replast_at(s.clusters(), n) } #let ordinal_funcs = ( "": (n, ..args) => "", "(1)": replast_ord_from_str("⓪①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿"), // "1": (n, ..args) => { // assert(type(n) == int, message: "ordinals: argument must be an integer") // return str(n) // }, // "a": replast_ord_from_str("-abcdefghijklmnopqrstuvwxyz"), // "A": replast_ord_from_str("-ABCDEFGHIJKLMNOPQRSTUVWXYZ"), // "〇": replast_ord_from_str("〇一二三四五六七八九十"), // "零": replast_ord_from_str("零一二三四五六七八九十"), // TODO: add more ordinals // necessary? )
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/starter-journal-article/0.1.1/README.md
markdown
Apache License 2.0
# A starter template for journal articles This package provides a template for writing journal articles to organise authors, institutions, and information of corresponding authors. ![](./thumbnail.png) ## Usage Run the following command to use this template ```typst typst init @preview/starter-journal-article ``` ## Documentation ### `article` The template for creating journal articles. It needs the following arguments. Arguments: - `title`: The title of this article. Default: `"Article Title"`. - `authors`: A dictionary of authors. Dictionary keys are authors' names. Dictionary values are meta data of every author, including label(s) of affiliation(s), email, contact address, or a self-defined name (to avoid name conflicts). The label(s) of affiliation(s) must be those claimed in the argument `affiliations`. Once the email or address exists, the author(s) will be labelled as the corresponding author(s), and their address will show in footnotes. Function `author-meta()` is useful in creating information for each author. Default: `("Author Name": author-meta("affiliation-label"))`. - `affiliations`: A dictionary of affiliation. Dictionary keys are affiliations' labels. These labels show be constent with those used in authors' meta data. Dictionary values are addresses of every affiliation. Default: `("affiliation-label": "Affiliation address")`. - `abstract`: The paper's abstract. Default: `[]`. - `keywords`: The paper's keywords. Default: `[]`. - `bib`: The bibliography. Accept value from the built-in `bibliography` function. Default: `none`. ### `author-meta` A helper to create meta information for an author. Arguments: - `..affiliation`: Capture the positioned arguments as label(s) of affiliation(s). Mandatory. - `email`: The email address of the author. Default: `none`. - `alias`: The display name of the author. Default: `none`. - `address`: The address of the author. Default: `none`. - `cofirst`: Whether the author is the co-first author. Default: `false`. ## Example See [the template](./template/main.typ) for full example. ```typst #show: article.with( title: "Artile Title", authors: ( "Author One": author-meta( "UCL", "TSU", email: "<EMAIL>", ), "Author Two": author-meta( "TSU", cofirst: true ), "Author Three": author-meta( "TSU" ) ), affiliations: ( "UCL": "UCL Centre for Advanced Spatial Analysis, First Floor, 90 Tottenham Court Road, London W1T 4TJ, United Kingdom", "TSU": "Haidian District, Beijing, 100084, P. R. China" ), abstract: [#lorem(100)], keywords: ("Typst", "Template", "Journal Article"), bib: bibliography("./ref.bib") ) ```
https://github.com/dogeystamp/typst-templates
https://raw.githubusercontent.com/dogeystamp/typst-templates/master/main.typ
typst
The Unlicense
// main template that everything inherits from #let script-size = 9pt #let footnote-size = 8pt #let small-size = 8pt #let normal-size = 9pt #let large-size = 9pt #let font = "Nimbus Sans" #let heading_font = "Nimbus Sans" #let mono_font = "DejaVu Sans Mono" #let settings = yaml("/settings.yml") // reference based on TYPST_ROOT // use paths like "/problems/problem.pdf" // which will translate to "/home/user/docs/problems/problem.pdf" #let lref( // whether or not to prepend 'pdfref://' to the link. as long as the handler // is installed, it allows specifying the page number linked to // see https://github.com/dogeystamp/pyinstantref for details pdfref: false, url, text ) = { let realUrl = settings.prefix + url; if (pdfref) { realUrl = "pdfref://" + realUrl } return link(realUrl, text) } #let gen_title( title: none, ) = { // Set document metadata. text(size: 20pt, weight: "black", title, font: heading_font) } #let author_string(authors: none) = { if authors == none { authors = ( ( name: settings.me, ), ) } let names = authors.map(author => author.name) return if authors.len() == 2 { names.join(" and ") } else { names.join(", ", last: ", and ") } } #let gen_authors( authors: none, ) = { text(author_string(authors: authors)) } #let gen_preamble( title: none, authors: none, prefix: none, suffix: none, ) = { pad(left: -2%, { gen_title(title: title) v(13pt, weak: true) pad(left: 1.5pt, prefix) align(right, rect( width: 50%, stroke: none, { [ #{gen_authors(authors: authors)} ] linebreak() suffix }) ) v(10pt) line(length: 100%, stroke: 1pt + rgb("#555555")) }) v(5%, weak: true) } // this template sets up the document // but does not do things like title, authors, etc. #let doc_template( paper-size: "us-letter", title: "", authors: none, enable-footer: true, // Content to wrap body, ) = { set text(size: normal-size, font: font, weight: "regular", lang: settings.lang) show link: text.with(fill: rgb("#5577bb"), weight: "bold") show math.equation: eq => eq set figure.caption(position: top) set figure(gap: 1em) show figure.caption: emph show figure: fig => { show: pad.with(x: 1em, y: 0.6em) show image: pad.with(y: 0.5em) set image(width: 50%) set align(center) fig } set table(inset: 10pt, stroke: 0.5pt + black) show heading: it => [ #set text(font: heading_font, weight: "black") #text(it) #v(0.1em) ] set heading(numbering: "1.") show raw.where(block: true): txt => pad( left: 0.5em, block( radius: 0em, stroke: luma(230), fill: luma(250), pad( left: 1em, right: 1em, top: 1em, bottom: 1em, txt ) ) ) set page( paper: paper-size, margin: (top: 8%, rest: 10%), footer-descent: 50%, footer: if enable-footer [ #set text(size: 8pt, fill: luma(80)) #columns(3)[ #align(left)[ //© #author_string(authors: authors), #datetime.today().year() ] #colbreak() #align(center)[ _ #title _ ] #colbreak() #align(right)[ #counter(page).display("1") ] ] ], ) set list(indent: 5pt, body-indent: 5pt, marker: ("▪", "‣")) set enum(indent: 5pt, body-indent: 5pt) // Configure paragraph properties. set par(justify: true) // Display the article's contents. v(29pt, weak: true) body } //////////////////////////////// // compsci notes utils //////////////////////////////// // did i finish this problem? #let status(stat: "incomplete") = { if stat == "complete" { text(fill: rgb("#448d00"))[ *Status*: Completed ] } else if stat == "cheated" { text(fill: rgb("#aaaa22"))[ *Status*: Solved with editorial ] } else { text(fill: rgb("#aa4422"))[ *Status*: Incomplete ] } } // show associated source code #let source_code( lang: "cpp", block: true, src_path: "problems/src/", // convert tabs to spaces detab: true, problem_id ) = { let raw_text = read("../" + src_path + problem_id + "." + lang) if detab { raw_text = raw_text.replace("\t", " ") } text(font: mono_font)[ #raw( raw_text, block: true, lang: lang, ) ] }
https://github.com/pacokleitz/cv
https://raw.githubusercontent.com/pacokleitz/cv/main/README.md
markdown
MIT License
# Academic CV Template This repository provides a minimalist academic-style CV template designed for [typists](https://typst.app/). It includes an automatic CI (Continuous Integration) build process to streamline the creation of your CV in PDF format. ## Getting Started Follow these simple steps to create your academic CV: 1. **Modify the CV Data**: Open the `cv.typ` file and replace the template content with your own academic and professional details. 2. **Push Your Changes**: Commit your changes to your GitHub repository. This will trigger a GitHub Action to automatically build a PDF version of your CV as an artifact. 3. **Create Timestamped Releases**: To keep track of your CV's history and versions, consider tagging your commit to generate timestamped releases of the PDF. This way, you can easily access and share different versions of your CV. 4. **Link to the Latest Version**: The latest released version of your CV can be accessed using this URL: `https://github.com/{username}/{repository}/releases/latest/download/cv.pdf`. ## Acknowledgments This academic CV template was built using the work of the following repositories: - [chicv](https://github.com/skyzh/chicv) - [GitHub Action for Typst](https://github.com/marketplace/actions/github-action-for-typst) Feel free to explore these resources for additional inspiration and functionality. Now you can easily maintain an up-to-date, professional CV with the help of this minimalist template and automated PDF generation. Happy CV building!
https://github.com/SkytAsul/fletchart
https://raw.githubusercontent.com/SkytAsul/fletchart/main/src/utils.typ
typst
#import "deps.typ": cetz #import cetz.draw // Replace `auto` with a value #let map-auto(value, fallback) = if value == auto { fallback } else { value } #let cetz-rect-double(node, extrude) = { let double-w = 5pt let r = node.corner-radius let (w, h) = node.size.map(i => i/2 + extrude) // we first draw the outer rectangle otherwise the fill would overwrite // the inner rectangle w += double-w draw.rect( (-w, -h), (+w, +h), radius: if r != none { r + extrude }, ) w -= double-w draw.rect( (-w, -h), (+w, +h), radius: if r != none { r + extrude }, ) }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/scholarly-tauthesis/0.4.0/template/content/README.md
markdown
Apache License 2.0
# chapters/ This is where you should add typst text files related to the actual content of your thesis.
https://github.com/soul667/typst
https://raw.githubusercontent.com/soul667/typst/main/复习/光电子材料与器件复习/temple/py.typ
typst
#import "@preview/pyrunner:0.1.0" as py #let compiled = py.compile( ```python def find_emails(string): import re return re.findall(r"\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b", string) def sum_all(*array): return sum(array) def sympy_test(): import google.generativeai as genai ```) #let txt = "My email address is <EMAIL> and my friend's email address is <EMAIL>." // #py.call(compiled, "find_emails", txt) #py.call(compiled, "sympy_test")
https://github.com/mriganksagar/cv
https://raw.githubusercontent.com/mriganksagar/cv/main/modules/education.typ
typst
Apache License 2.0
#import "../brilliant-CV/template.typ": * #cvSection("Education") #cvEntry( title: [B.Tech in Computer Engineering], society: [Delhi Technological University], date: [2017 - 2021], location: [Delhi, India], logo: "../src/logos/dtu-logo.png", description: list( [CGPA: 8.0], [Lab Internship: Simulated networks and its load to develop optimised routing for Software Defined Networks], [Major Project: Software development approach using ontologies to easily document and maintain the software system], ) )
https://github.com/cliarie/resume
https://raw.githubusercontent.com/cliarie/resume/main/style.typ
typst
#let project(body) = { set document(title: "<NAME>", author: ("<NAME>")) set page(paper: "us-letter", margin: 0.3in) set text(font: "EB Garamond", lang: "en", size: 10.7pt, weight: 400) show par: set block(above: 0.8em, below: 0.8em) show strong: it => text(weight: "semibold", it.body) show heading.where(level: 1): it => [ #set text(11pt, weight: "regular") #block( width: 100%, stroke: (bottom: 0.5pt), inset: (bottom: 0.5em), above: 1em, below: 0.8em, smallcaps(it.body) ) ] show heading.where(level: 2): it => { text(size: 11pt, it.body) h(0.3em) } set list(indent: 1em) body } #let fab(name) = text(font: "Font Awesome 6 Brands", name) #let fas(name) = text(font: "Font Awesome 6 Free Solid", name) #let far(name) = text(font: "Font Awesome 6 Free", name) #let entry(l, r, below: 0.8em) = block( below: below, grid( columns: (1fr, auto), align(left, l), align(right, r), ) )
https://github.com/vitto4/ttuile
https://raw.githubusercontent.com/vitto4/ttuile/main/ttuile.typ
typst
MIT License
// ---- Variables ---- // // Identificateurs #let identificateur-titre = [x309QfWkIO] #let identificateur-annexe = [U2pWAy70cU] #let identificateur-sous-titre-annexe = [4rS78a14Pv] // Couleurs #let couleur-rouge = color.red #let couleur-vert = color.rgb(0, 169, 51) #let couleur-bleu = color.rgb(52, 101, 164) #let couleur-bleu-legende = color.rgb(0,69,134) #let couleur-pourpre = color.rgb(166,77,121) // Polices #let police-base = 12pt #let police-en-tete = police-base - 1.5pt #let police-pied-page = police-base - 2pt #let police-titre = police-base + 6pt #let police-stitre-1 = police-base + 2pt #let police-stitre-2 = police-base + 1pt #let police-stitre-3 = police-base #let police-legende = police-base - 2pt #let police-style-base = "HK Grotesk" #let police-style-stitre = "HK Grotesk" // Longueurs #let tabulation = 0.76cm #let titre-tabulation = 0.50cm #let titre-demi-tabulation = titre-tabulation / 2 #let titre-tabulation-annexe = 0.33cm #let tab-numerotation = 0.2cm #let tab-sommaire = 0.4cm #let espace-vert-titres = 0.15cm // Divers #let profondeur-sommaire = 3 #let style-numerotation-global = "I.1.A.1." #let style-numerotation-annexes = "A.1.A.1" #let nom-annexe = "Annexe" #let nom-annexe-s = nom-annexe + "s" // ---- Template ---- // #let ttuile( // Titre du TP ; `content?`. titre: none, // Liste des auteurs ; `array<str> | content?`. auteurs: none, // Nom ou numéro du groupe de TD ; `content?`. groupe: none, // Numéro du TP ; `content?`. numero-tp: none, // Numéro du poste auquel a été réalisé le TP ; `content?`. numero-poste: none, // Date à laquelle a été réalisé le TP ; `datetime | content?`. date: none, // Afficher la table des matières ? ; `bool`. sommaire: true, // Logo à utiliser ; `image?`. logo: image("logo-insa-lyon.png"), // Imposer le point à la fin des légendes ; `bool`. point-legende: false, // Contenu du rapport doc ) = { // ---- Langue ---- // set text(lang: "fr") // ---- Format général de la page ---- // set page( paper: "a4", margin: ( left: 2cm, right: 2cm, top: 2.5cm, bottom: 2.5cm, ), // En-tête, avec auteurs et logo INSA header: [ // Mise en page #set text( font: "Liberation Serif", size: police-en-tete, ) // Espacement depuis le haut de la page #v(38.51pt) // Contenu #grid( columns: (5fr, 1fr), // Alignement à gauche des auteurs align(left + horizon)[ #{ let type-entree = type(auteurs) // Déclarations pour utiliser sur plusieurs scopes let prefixe let auteurs-display let groupe-display // Si `auteurs` est un array if (type-entree == array) { // Gestion des noms et du pluriel // let total = auteurs.len() // Si plusieurs auteurs if (total > 1) { // Initialisation auteurs-display = [] prefixe = [Auteurs :] groupe-display = if (groupe != none) [ – #groupe] // On veut des virgules entre les auteurs, et un "et" avant le dernier for nb in range(total) { if nb == total - 1 { auteurs-display += [ et #auteurs.at(nb)] } else if nb == total - 2 { auteurs-display += [ #auteurs.at(nb)] } else { auteurs-display += [ #auteurs.at(nb),] } } } else if total == 1 { // Initialisation prefixe = [Auteur : ] groupe-display = if (groupe != none) [ – #groupe] // Si un seul auteur, on laisse tel quel auteurs-display += [#auteurs.at(0)] } } else if (auteurs != none) { // Si `auteurs` n'est pas un array et n'est pas nul prefixe = [Auteur :] auteurs-display = [ #auteurs] groupe-display = if (groupe != none) [ – #groupe] } // Affichage text(weight: "bold", prefixe) auteurs-display groupe-display } ], // Align(left) // Alignement à droite du logo INSA, si applicable if (logo != none) { set image(width: 90%) align(right + horizon)[ #logo ] } ) ], // Header // Pied de page, avec poste, numérotation de page et date. footer: [ // Mise en page #set text( font: "Liberation Serif", size: police-pied-page, ) // Contenu #grid( columns: (1fr, 1fr, 1fr), align(left)[ #if numero-poste != none [ Poste n° #numero-poste ] ], align(center)[ #counter(page).display( "– 1/1 –", both: true, ) ], align(right)[ #if type(date) == datetime { date.display( "[day]/[month]/[year]" ) } else { date } ], ) // Grid ], // Footer ) // Page // ---- Liens ---- // // Weird : if I place the following bit of code after the next section `Titre`, // links won't get styled properly in footnotes. // Souligner les liens externes, ne pas souligner // les liens locaux. show link: it => { if (type(it.dest) == str) { underline(it) } else { it } } // ---- Titre ---- // { set align(center) set text( font: "Liberation Serif" ) rect( width: 100%, radius: 0%, inset: (top: 7pt, bottom: 10pt), stroke: 0.7pt, )[ // Premier texte avec numéro de TP #text( police-titre - 4pt, couleur-rouge, weight: "bold", [ #if (numero-tp != none) [ Compte rendu de TP n°#numero-tp : \ ] ] ) // Titre du TP #text( police-titre, couleur-rouge, weight: "bold", titre ) ] } // ---- Table des matières ---- // if sommaire { // Technique pour distinguer les titres des annexes et ceux du corps du TP // Le supplement est utilisé comme un identificateur. set outline(target: heading.where(supplement: identificateur-titre)) set text( size: police-base ) // Espace après le titre v(0.3cm) // Affichage de la table des matières outline( title: none, indent: tab-sommaire, depth: profondeur-sommaire, ) } // ---- Numérotation titres ---- // // https://www.reddit.com/r/typst/comments/18exrv5/hide_previous_level_heading_counters/ set heading(numbering: (..nums) => { let nums = nums.pos() // Niveau du titre let niveau = nums.len() - 1 // Pour ne pas afficher toute la numérotation `I.1.A.` et juste `A` // Pour un titre de niveau 2 if (niveau == 2) { let style = "A." let num = nums.last() numbering(style, num) } else { let style = "I.1." let num = nums numbering(style, ..num) } }) // ---- Sous-Titres ---- // // J'espère que personne n'utilisera ce supplément haha // Le supplément sert à détecter les titres de la partie // principale (par opposition aux annexes par exemple) set heading(supplement: identificateur-titre) // TODO : show heading: set block(above: __ pt) // https://github.com/typst/typst/issues/686 show heading.where( level: 1 ): it => block(width: 100%)[ #set align(left) #text( police-stitre-1, couleur-vert, weight: "bold", font: police-style-stitre )[ #h(0 * titre-tabulation) #counter(heading).display() #h(tab-numerotation) #underline()[#it.body] #v(espace-vert-titres) ] ] // Style + logique pour détecter un titre précédent de niveau 1. // Dans ce cas, réduire l'espacement entre les deux. // C'est un palliatif en attendant https://github.com/typst/typst/issues/3127 show heading.where( level: 2 ): it => locate( loc => { let titres = query( selector(heading).before(loc), loc, ) // titres // Valeur par défaut de l'espacement let espacement = none // S'il y a un titre avant if titres.len() > 1 { // Titre précédent let titre-precedent = titres.at(-2) // Seuil à partir duquel un titre est considéré comme adjacent au précédent // 28pt correspond environ à l'espacement par défaut de typst, auquel // on rajoute l'espacement induit par le titre du dessus let seuil = 28pt + espace-vert-titres // Si le titre de niveau 2 est assez proche du précédent, // que ce dernier est de niveau 1 et les deux sont sur la // même page if (titre-precedent.level == 1) and (titre-precedent.location().position().y + seuil > it.location().position().y) and (titre-precedent.location().page() == it.location().page()) { espacement = [#v(-espace-vert-titres -0.12cm)] } } // Ajouter l'éventuel espacement, puis style du titre espacement block(width: 100%)[ #set align(left) #text( size: police-stitre-2, weight: "bold", font: police-style-stitre, couleur-bleu, )[ #h(1 * titre-tabulation) #counter(heading).display() #h(tab-numerotation) #underline()[#it.body] #v(espace-vert-titres) ] ] } ) show heading.where( level: 3 ): it => locate( loc => { let titres = query( selector(heading).before(loc), loc, ) // titres // Valeur par défaut de l'espacement let espacement = none // Niveaux de titres précédents à détecter let niveaux = (1,2) // S'il y a un titre avant if titres.len() > 1 { // Titre précédent let titre-precedent = titres.at(-2) // Seuil à partir duquel un titre est considéré comme adjacent au précédent // 28pt correspond environ à l'espacement par défaut de typst, auquel // on rajoute l'espacement induit par le titre du dessus let seuil = 28pt + espace-vert-titres // Si le titre de niveau 3 est assez proche du précédent, // que ce dernier est de niveau 1 ou 2 et les deux sont sur la // même page if (niveaux.contains(titre-precedent.level)) and (titre-precedent.location().position().y + seuil > it.location().position().y) and (titre-precedent.location().page() == it.location().page()) { espacement = [#v(-espace-vert-titres -0.12cm)] } } // Ajouter l'éventuel espacement, puis style du titre espacement block(width: 100%)[ #set align(left) #text( size: police-stitre-2, font: police-style-stitre, weight: "bold", couleur-pourpre, )[ #h(2 * titre-tabulation) #counter(heading).display() #h(tab-numerotation) #underline()[#it.body] #v(espace-vert-titres) ] ] } ) show heading.where( level: 4 ): it => text( size: police-stitre-3, font: police-style-stitre, weight: 600, block(width: 100%)[ #h(1.5 * titre-tabulation) #str.from-unicode(10146) // ➢ #h(tab-numerotation) #it.body ] ) // ---- Listes ---- // set list( marker: ([•], [--]), indent: tabulation, ) // ---- Figures ---- // show figure.caption: it => { text( police-legende, couleur-bleu-legende, weight: "bold", [ #let legende = it.body // Ajout d'un point à la fin de la légende // FIXME : Spaghetti code, also kinda overkill #{ if point-legende { let fin-valide = (".", "?", "!") // Si le corps contient du texte if (legende.has("text")) { // Extraction du dernier groupe de graphème let fin = legende.text.last() // Si ce dernier n'est pas un symbole de ponctuation, on ajoute un point legende = if not (fin-valide.contains(fin)) {[#legende] + [.]} else {legende} } else if (legende.has("children")) { // Si le dernier élément est un espace if (legende.children.last() == [ ]) { // Si un espace s'est glissé à la fin, on le supprime legende = legende.children.slice(0, -1).join() // Si notre version sans espace est toujours un array if (legende.has("children")) { // Vérification du dernier groupe de graphème let fin = if (legende.children.last().has("text")) {legende.children.last().text} else {"fallback"} // Ajout éventuel d'un point legende = if (fin-valide.contains(fin.last())) {legende} else {legende + [.]} } else if (legende.has("text")) { // Sinon si ce n'est pas un array mais directement du texte legende = legende.text + [.] } } } } } // Correctif pour Fig. utilisé en `lang: "fr"` #let sup = if (it.supplement == [Fig.]) [Figure] else {it.supplement} // Affichage de la légende #sup #it.counter.display() : #text(style: "italic")[#legende] ] ) } // ---- Références ---- // // Correction de la référence « Fig. » --> « Figure » // et « Équation n » --> « (n) » show ref: it => { let element = it.element // Typst could use a match/switch syntax // or I just don't know what I'm doing ,_, if element != none { let element-type = element.func() if (element-type == math.equation) { let numero = numbering( element.numbering, ..counter(math.equation).at(element.location()) ) link(it.target)[#math.equation(numero)] } else if (element-type == figure) { let numero = numbering( element.numbering, ..counter(figure).at(element.location()) ) // Éviter de se faire piéger avec `supplement: auto`. if (it.element.caption.supplement == [Fig.]) { link(it.target)[#underline(text(style: "italic")[Figure #numero])] } else { underline(text(style: "italic")[#it]) } } else if (element-type == heading) { let texte if (element.supplement == identificateur-annexe) { let numero = numbering( style-numerotation-annexes, ..counter(heading).at(element.location()), ) texte = underline(text(weight:500, style: "italic")[#nom-annexe #numero]) } else if (element.level == 3) { let numero = numbering( style-numerotation-global, ..counter(heading).at(element.location()), ) texte = underline(text(weight: 500, style: "italic", numero)) } else if (element.level == 4) { texte = underline(text(weight: 400, style: "italic", element.body)) } else { let numero = numbering( element.numbering, ..counter(heading).at(element.location()), ) texte = underline(text(weight: 500, style: "italic", numero)) } // Affichage de la référence fabriquée, ainsi qu'un lien vers // l'objet référencé. link(it.target)[#texte] } else { // Si aucun match, c'est qu'on a rien à changer it } } } // ---- Equations ---- // set math.equation(numbering: "(1)") // ---- Paragraphe et texte ---- // set align(left) set par(justify: true) set text( font: police-style-base, weight: "regular", stretch: 100%, size: 12pt, ) // ---- Corps du document ---- // doc } /// Fait en sorte que la légende de la figure n'en dépasse pas /// la largeur. #let figure-emboitee( // Figure à traiter fig, // Référence éventuelle à utiliser dans le corps du rapport reference: none, ) = { // https://github.com/typst/typst/issues/2194#issuecomment-1760641264 show figure: _fig => style(styles => { let fig-width = measure(_fig.body, styles).width show figure.caption: box.with(width: fig-width) _fig }) [#fig #if (reference != none) {reference}] } /// Équation sans numérotation (label) #let equation-anonyme( // Équation à traiter eq, ) = { math.equation( block: true, numbering: none, eq.body ) } /// Semblant de classe, bricolé avec un dictionnaire. /// Représente un objet `annexe`. #let annexe( // Titre de l'annexe titre: none, // Éventuelle référence à utiliser dans le corps du rapport reference: none, // Corps de l'annexe corps, ) = ( titre: titre, reference: reference, corps: corps ) /// Affiche le titre, la table et les annexes passées en argument. /// TODO Autoriser les heading lv. 1 dans le corps des annexes. #let afficher-annexes( // Liste d'objets `annexe`, dictionnaires renvoyés par la fonction helper `annexe`. // `dictionary`. annexes: none, // Inclure une table des annexes ? ; `bool`. table: true, // Saut de page après affichage de la table ? ; `bool`. saut-page-apres-table: false, ) = { // Misc let total = annexes.len() let compteur-annexes = counter("annexe") // Style des titres (autres que ceux des annexes) set heading(numbering: style-numerotation-annexes, supplement: identificateur-sous-titre-annexe) // Ne pas autoriser les titres de niveau 1 dans le corps (car overlap avec compteur des annexes) show heading.where(level:1): none // Titre des annexes, fonction helper utilisée en interne. let titre-annexe(titre: none, ref: none) = { // Pour ne prendre en compte que les annexes dans la // table des annexes. set heading(supplement: identificateur-annexe) // Style des titres des annexes, défini dans le scope // local pour ne pas affecter les autres titres show heading.where(level: 1): it => { // Comme on utiliser le compteur des heading lv.1, on doit faire attention // à ne pas en mettre dans le corps des annexes. let numero = numbering( it.numbering, ..counter(heading).at(it.location()) ) text( police-stitre-1, weight: "bold", )[ //#compteur-annexes.step() #nom-annexe // #compteur-annexes.display(style-numerotation-annexes) #numero #h(titre-tabulation) #it.body #{4 * v(espace-vert-titres)} ] } if (titre != none) [ #heading()[ #titre ] #ref ] else [ // Pour que le titre puisse être détecté comme vide par l'outline. #heading(none) #ref ] } // Affichage // // Aller à la prochaine page pagebreak() // Affichage du titre { set align(center) set text( font: "Liberation Serif" ) // Ne pas afficher le titre, seulement l'inclure // dans la table des matières (pour ne pas adopter // le style classique des titres). show heading: none // Cadre + titre rect( width: 100%, radius: 0%, inset: (top: 7pt, bottom: 10pt), stroke: 0.7pt, )[ #text( police-titre, black, weight: "bold", heading( level: 1, supplement: identificateur-titre, numbering: style-numerotation-global, nom-annexe-s ) + nom-annexe-s ) ] } // Définitions de nouveau // // Table des annexes if (table) { // Styles set heading(outlined: false, supplement: identificateur-titre) // Style pour le titre de l'annexe seulement (portée limitée par le scope) show heading.where(level: 1, supplement: identificateur-titre): it => { set align(left) text( police-titre, font: "Liberation Serif", weight: "bold", )[ #it.body #v(espace-vert-titres) ] } // Style de titre pour chaque annexe. show heading.where(supplement: identificateur-annexe): it => { text( police-stitre-1, weight: "bold", )[ #it.body #v(espace-vert-titres) ] } show outline.entry: it => { let element = it.element let numero = numbering( element.numbering, ..counter(heading).at(element.location()) ) // Lien vers l'annexe en question. link(it.element.location())[ #text( weight: 500, )[ // Ajouter les text "Annexe" devant chaque entrée Annexe #numero #{if (it.element.body != []) [:]} // Ne pas afficher `:` si le titre est vide ] #it.element.body #box(width: 1fr, repeat(it.fill.body)) #it.page ] } // Affichage de la table stylisée outline( title: [Table des annexes], target: heading.where(level: 1, supplement: identificateur-annexe), ) // Ainsi que d'un espace vertical la séparant d'un éventuel titre v(0.5cm) // Si l'option est active, sauter une page après la table. if (saut-page-apres-table) { pagebreak() } } // Remise à zero du compteur pour les titres afin de commencer // à compter les annexes à `0` (donc « A ») counter(heading).update(0) // Placement des différentes annexes passées en argument for nb in range(total) { // On formate le titre, en passant l'éventuelle référence titre-annexe( titre: annexes.at(nb).at("titre"), ref: annexes.at(nb).at("reference") ) // Et affichage du corps de l'annexe annexes.at(nb).at("corps") // Sans oublier de sauter une page entre chaque annexe, // sauf pour la dernière if (nb != total - 1) {pagebreak()} } }
https://github.com/raygo0312/Typst_template
https://raw.githubusercontent.com/raygo0312/Typst_template/main/slide.typ
typst
#import "@local/japanese-template:0.1.0": * #show: it => slide-style(it) #title-slide( title: "Typst", author: "raygo", ) #make-index() #utils.register-section("簡単な例") #slide(title: "タイトル")[ === #utils.current-section こんな感じでスライドを作れます.\ 次のを使うとブロック生成できます. #title-block[ 3以上の整数$n$について,次を満たす自然数$a,b,c$は存在しない. $ a^n+b^n=c^n $ ] ] #slide(title: "タイトル")[ こんな感じで2枚目のスライドも作れます. #title-block( title: "例", number: true, color: "ex", )[ ナンバリングもしてくれます. ] #title-block( title: "公理", number: true, color: "axm", )[ ] #title-block( title: "定義", number: true, color: "def", )[ ] #title-block( title: "系・命題・補題・性質", number: true, )[ ] ] // これで色を変えられます #set page(fill: rgb("#000000")) #set text(fill: rgb("#ffffff")) #change-color(color: rgb("#483b6d")) #change-color(name: "ex", color: rgb("#53531f")) #change-color(name: "axm", color: rgb("#612828")) #change-color(name: "def", color: rgb("#2b4263")) #change-color(name: "thm", color: rgb("#2b5e24")) #utils.register-section("動的スライド") #slide(title: "動的スライド")[ onlyは存在が変更します #only(1)[#title-block( title: "例", number: true, color: "ex", )[ これは1枚目のスライドです. ]] uncoverは表示が変更します #uncover(2)[#title-block( title: "公理", number: true, color: "axm", )[ これは2枚目のスライドです. ]] これはいくつかのタイミングで#uncover("-2, 4, 6-8, 10-")[*表示*]されます #uncover(11)[*どうやら限界は10枚のようです*] ] // 既存のテーマも選べます #set page(fill: rgb("#ffffff")) #set text(fill: rgb("#000000")) #change-color(theme: "pastel") #slide(title: "動的スライド")[ #title-block( title: "定義", number: true, color: "def", )[ 一つずつ表示されます ] #pause #title-block( title: "定理", number: true, color: "thm", )[ 一つずつ表示されます ] #pause これが最後 ] #slide(title: "動的スライド")[ #change-color(name: "other", color: red) #title-block( title: "定義", number: true, color: "other", )[ #alternatives(repeat-last: true)[他の][色は][otherを使って変更してください] ] #change-color(name: "other", color: green) #title-block( title: "定義", number: true, color: "other", )[ #alternatives[他の色は][otherを使って変更してください] ] #change-color(name: "other", color: blue) #title-block( title: "定義", number: true, color: "other", )[ 他の色はotherを使って変更してください ] ]
https://github.com/ad-si/invoice-maker
https://raw.githubusercontent.com/ad-si/invoice-maker/master/examples/de.typ
typst
ISC License
#import "../invoice-maker.typ": * #import "../fixtures/example-data.typ": * #biller.insert("vat-id", "DE123456789") #recipient.insert("vat-id","DE987654321") #show: invoice.with( language: "de", banner-image: image("../fixtures/banner.png"), invoice-id: "2024-03-10t172205", // Set this to create a cancellation invoice // cancellation-id: "2024-03-24t210835", issuing-date: "2024-03-10", delivery-date: "2024-02-29", due-date: "2024-03-20", hourly-rate: 100, biller: biller, recipient: recipient, items: table-data, styling: ( font: none ), // Explicitly use Typst's default font )
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/introspection/state.typ
typst
// Test state. --- state-basic --- #let s = state("hey", "a") #let double(it) = 2 * it #s.update(double) #s.update(double) $ 2 + 3 $ #s.update(double) Is: #context s.get(), Was: #context { let it = query(math.equation).first() s.at(it.location()) }. --- state-multiple-calls-same-key --- // Try same key with different initial value. #context state("key", 2).get() #state("key").update(x => x + 1) #context state("key", 2).get() #context state("key", 3).get() #state("key").update(x => x + 1) #context state("key", 2).get() --- state-nested --- #set page(width: 200pt) #set text(8pt) #let ls = state("lorem", lorem(30).split(" ")) #let loremum(count) = { context ls.get().slice(0, count).join(".").trim() + "." ls.update(list => list.slice(count)) } #let fs = state("fader", red) #let trait(title) = block[ #context text(fill: fs.get())[ *#title:* #loremum(1) ] #fs.update(color => color.lighten(30%)) ] #trait[Boldness] #trait[Adventure] #trait[Fear] #trait[Anger] --- state-no-convergence --- // Make sure that a warning is produced if the layout fails to converge. // Warning: layout did not converge within 5 attempts // Hint: check if any states or queries are updating themselves #let s = state("s", 1) #context s.update(s.final() + 1) #context s.get() --- state-at-no-context --- // Test `state.at` outside of context. // Error: 2-26 can only be used when context is known // Hint: 2-26 try wrapping this in a `context` expression // Hint: 2-26 the `context` expression should wrap everything that depends on this function #state("key").at(<label>)
https://github.com/SWATEngineering/Docs
https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/VerbaliEsterni/VerbaleEsterno_231110/meta.typ
typst
MIT License
#let data_incontro = "10-11-2023" #let inizio_incontro = "10:30" #let fine_incontro = "11:10" #let luogo_incontro = "Chiamata Google Meet" #let company = "Sync Lab"
https://github.com/zenor0/FZU-report-typst-template
https://raw.githubusercontent.com/zenor0/FZU-report-typst-template/main/fzu-report/utils/show-heading.typ
typst
MIT License
#import "fonts.typ": 字体, 字号 #import "packages.typ": show-cn-fakebold #import "states.typ": * #import "to-string.typ": to-string #import "fake-par.typ": fake-par /* 这里有一个巨大的自造轮子用于实现 heading 的各项功能,包括: - 一级标题自动换页(及换页到偶数页):该功能依赖于 `always-new-page` 参数传入 function。 - 一级标题与多级标题写入 state:该功能依赖于从 `states.typ` 导入的多个 states 。目录(`utils/outline-tools.typ`)、页眉(`parts/main-body-*-fn.typ`)均依赖于此功能。 - 自定义多级 heading 的基本样式。 但是,由于该 heading 涉及跨页问题:自动换页中,heading 会变成跨多页的元素。这也导致目录、页眉必须是用自造轮子。 目前,该自造轮子会导致生成的 PDF 目录中,一级标题的锚点位置不正确。 如有更好的解决方案,欢迎给出建议或提交 PR。 */ #let show-heading( heading-top-margin: (0.2cm, 0cm, 0cm, 0cm, 0cm), heading-bottom-margin: (0cm, 0cm, 0cm, 0cm, 0cm), heading-indent: (0em, 0em, 0em, 0em, 0em, 0em), heading-align: (left, left, left, left, left, left), heading-text: ( (font: 字体.黑体, size: 字号.三号, weight: "bold"), (font: 字体.黑体, size: 字号.四号, weight: "bold"), (font: 字体.黑体, size: 字号.小四, weight: "bold"), (font: 字体.黑体, size: 字号.五号, weight: "bold"), ), always-new-page: false, // 每次一级标题都切换到新的页面,取值为 bool 或 function ,如果 function 则会以 function 作为分页时执行的操作 auto-h-spacing: true, // 为 true 时,二字标题会变为 A #h(2em) B it ) = { set par(first-line-indent: 0em) // 将章节名转换为 string let chapter-name-string = to-string(it.body) // 用于显示的章节名:如果启用 auto-h-spacing 则处理 let chapter-name-show = { if auto-h-spacing and it.numbering == none and type(chapter-name-string) == str and chapter-name-string.clusters().len() == 2 and chapter-name-string.find(regex("\p{sc=Hani}{2}")) != none { chapter-name-string.clusters().first() h(2em) chapter-name-string.clusters().last() } else { [#chapter-name-string] } } // 用于显示的章节号 let chapter-numbering-show = { if type(it.numbering) == str { numbering( it.numbering, ..counter(heading).get() ) if it.level == 1 { numbering( it.numbering, ..counter(heading).get() ) } } else if type(it.numbering) == function { (it.numbering)(..counter(heading).get(), location: here()) } } chapter-name-str-state.update(chapter-name-string) chapter-name-show-state.update(chapter-name-show) chapter-numbering-show-state.update(chapter-numbering-show) chapter-level-state.update(it.level) // 一级标题有单独的 states if it.level == 1{ chapter-l1-name-str-state.update(chapter-name-string) chapter-l1-name-show-state.update(chapter-name-show) chapter-l1-numbering-show-state.update(chapter-numbering-show) counter(math.equation).update(0) } // 处理新页面换行 if it.level == 1 and always-new-page != false { if type(always-new-page) == function { always-new-page() } else { pagebreak(weak: true) } } v(heading-top-margin.at( it.level - 1, default: heading-top-margin.last() )) locate(loc => { // 用于显示的页码 let chapter-page-show = { if type(page.numbering) == str { numbering(page.numbering, counter(page).at(loc).first()) } else if type(page.numbering) == function { (page.numbering)(counter(page).at(loc).first()) } } chapter-true-loc-state.update(loc) chapter-page-number-show-state.update(to-string(chapter-page-show)) if it.level == 1 { chapter-l1-true-loc-state.update(loc) chapter-l1-page-number-show-state.update(to-string(chapter-page-show)) } }) { set align(heading-align.at( it.level - 1, default: heading-text.last() )) set text(..heading-text.at( it.level - 1, default: heading-text.last() )) h(heading-indent.at( it.level - 1, default: heading-text.last() )) [ #if chapter-numbering-show != none { chapter-numbering-show h(0.2em) } #chapter-name-show <__heading__> ] } v(heading-bottom-margin.at( it.level - 1, default: heading-bottom-margin.at(2) )) fake-par heading-l1-updating-name-str-state.update(chapter-name-string) }
https://github.com/EpicEricEE/typst-based
https://raw.githubusercontent.com/EpicEricEE/typst-based/master/src/base32.typ
typst
MIT License
#import "coder.typ" #let alphabet-32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" #let alphabet-32-hex = "0123456789ABCDEFGHIJKLMNOPQRSTUV" /// Encodes the given data in base32 format. /// /// Arguments: /// - data: The data to encode. Must be of type array, bytes, or string. /// - pad: Whether to pad the output with "=" characters. /// - hex: Whether to use the extended base32hex alphabet. /// /// Returns: The encoded string. #let encode(data, pad: true, hex: false) = { let alphabet = if hex { alphabet-32-hex } else { alphabet-32 } coder.encode(data, alphabet, pad: pad) } /// Decodes the given base32 string. /// /// Arguments: /// - string: The string to decode. /// - hex: Whether to use the extended base32hex alphabet. /// /// Returns: The decoded bytes. #let decode(string, hex: false) = { let alphabet = if hex { alphabet-32-hex } else { alphabet-32 } coder.decode(string, alphabet) }
https://github.com/Mc-Zen/quill
https://raw.githubusercontent.com/Mc-Zen/quill/main/examples/bell.typ
typst
MIT License
#{ import "../src/quill.typ" : * quantum-circuit( lstick($|0〉$), gate($H$), ctrl(1), rstick($(|00〉+|11〉)/√2$, n: 2), [\ ], lstick($|0〉$), 1, targ(), 1 ) }
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/document_highlight/nest.typ
typst
Apache License 2.0
#for i in range(0) { (/* position after */break) for j in range(0) { break } }
https://github.com/Treeniks/bachelor-thesis-isabelle-vscode
https://raw.githubusercontent.com/Treeniks/bachelor-thesis-isabelle-vscode/master/chapters/05-main-enhancements/decorations-file-switch.typ
typst
#import "/utils/todo.typ": TODO #import "/utils/isabelle.typ": * == Decorations on File Switch <enhance:decorations> Previously, when switching theories within #vscode, the dynamic syntax highlighting would not persist. It was possible to get the highlighting to work again by changing the buffer's content; however, until this was done, it never recovered by itself. This was a problem when working on multiple theory files. To understand how #vscode does dynamic syntax highlighting, we will first examine the structure of the `PIDE/decoration` notifications. Recall that the primary data of notifications is sent within a `params` field. This field contains two components in this case: A `uri` field with the relevant theory file's URI and a list of decorations called `entries`. Each of these entries then consists of a `type` and a list of ranges called `content`. The `type` is a string identifier for an Isabelle decoration type. This includes `text_skolem` for Skolem variables and `dotted_warning` for text that should have a dotted underline. Each entry in the `content` list is another list of four integers describing the line start, line end, column start, and column end of the range to which the specified decoration type should be applied. @pide-decoration-json shows an example of what a `PIDE/decoration` message may look like. Since this is not part of the standard LSP specification, a language client must implement a special handler for such decoration notifications. Additionally, it was not possible to explicitly request these decorations from the language server. Instead, the language server would send new decorations whenever it deemed necessary, e.g., because the caret moved into areas of the text that have not been decorated yet or because the document's content has changed. #figure( box(width: 90%)[ ```json "jsonrpc": "2.0", "method": "PIDE/decoration", "params": { "uri": "file:///home/user/Documents/Example.thy", "entries": [ { "type": "text_main", "content": [ { "range": [1, 23, 1, 41] }, { "range": [5, 10, 5, 11] } ] }, { "type": "text_operator", "content": [ { "range": [7, 6, 7, 7] } ] } ] } ``` ], caption: [Example `PIDE/decoration` notification sent by the language server.], kind: raw, placement: auto, ) <pide-decoration-json> On the VSCode side, these decorations were applied via the `TextEditor.setDecoration` API function #footnote[https://code.visualstudio.com/api/references/vscode-api#TextEditor.setDecorations], which does not inherently cache these decorations on file switch. Thus, when switching theories, VSCode did not cache the previously set decorations, nor did the language server send them again, causing the highlighting to disappear. There were two primary ways to fix this issue: 1. Implement caching of decorations manually in the VSCode extension. 2. Add the ability to request new decorations from the server and do so on file switch. The main advantage of option 1 is performance. If the client handles caching of decorations, then the server will not have to calculate the decorations anew (which is a rather expensive operation), nor will another round of JSON Serialization and Deserialization have to happen. However, the trade-off is that more work needs to be done on the client side, making new client implementations for other editors potentially harder. Because of this, we instead introduced a new `PIDE/decoration_request` notification, sent by the client to explicitly signal to the server that it should send a `PIDE/decoration` notification back. Note that this system is atypical for the LSP. The `PIDE/decoration_request` notification is, semantically speaking, a request and intends a response from the server. Nevertheless, from the perspective of the LSP, it is a unidirectional notification, while its response is also a unidirectional `PIDE/decoration` notification. We chose this approach for two reasons: 1. There was already precedent for such behavior in the Isabelle language server, specifically with `PIDE/preview_request` and `PIDE/preview_response` notifications. 2. The `PIDE/decoration` notification is not only sent after a request. The original automatic sending behavior that existed before is still present and has not been altered. If we were to implement `PIDE/decoration_request`s as an LSP request instead, this would only result in extra implementation work on the client side because a client would need to implement the same decoration application logic for both the `PIDE/decoration` notification and the `PIDE/decoration_request` response. By defining `PIDE/decoration_request`s as notifications, the client only needs to implement a singular handler for `PIDE/decoration` notifications, which automatically covers both scenarios simultaneously. Later, we found that client-side caching was already implemented for the Isabelle VSCode extension; however, incorrectly so. The caching was implemented with the help of a JavaScript `Map` #footnote[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map]. This `Map` used `URI`s #footnote[https://code.visualstudio.com/api/references/vscode-api#Uri] as keys and the content list from the decoration messages as values. However, the `URI` type does not explicitly implement an equality function, thus resulting in an inconsistent equality check where two `URI`s referencing the same file may not have passed an equality check. Switching the key to using string representations of the URIs fixed the issue. However, we decided to keep the `PIDE/decoration_request` notification. While it may not be used by #vscode directly, other Isabelle language client implementations may make use of this functionality. // #TODO[ // - currently breaks when switching files/tabs // - originally solved by implementing decoration request and requesting them every time we switch file/tab // - later found that client-side caching was implemented, but used URI as key instead of URI strings which didn't work // - decoration request kept in, in case a different client needs it (Foreshadowing to Sublime Text implementation which used it) // ]
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/051%20-%20March%20of%20the%20Machine/003_Episode%203%3A%20Mother%2C%20Son%2C%20and%20Story.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Episode 3: Mother, Son, and Story", set_name: "March of the Machine", story_date: datetime(day: 17, month: 04, year: 2023), author: "<NAME>", doc ) There is a story. *Many eons ago there was a great wizard by the name of Urza. So wise was he that all the mages of the Multiverse flocked to him for advice; so powerful was he that only his brother Mishra stood as a potential rival. But Mishra hated him bitterly, and soon a war began.* *The war spanned decades and took untold lives. Worse, it allowed evil without compare to blossom. An awful affliction spread through Mishra's armies—a black oil that changed everything in its path.* Tamiyo knows this story. This is only the way it starts; there is more, much more. Years ago, she memorized every word. Afterward, just as Urza's metal heir had set himself upon the task of creating a plane, she'd set herself the task of recording it. Like the oil, she'd found the story had seeped into her mind, begun to change it into something she did not like. Something dangerous. She'd sealed it away. What a foolish thing to have done. Hovering over the neon skies of Towashi, she holds the scroll in hand. Oil seeps from her fingers onto the parchment. Before long it will be impossible to read any of the characters—but that is no worry for someone like her, someone who knows these stories better than she knows her own. A Phyrexian centurion bashes in the roof of a building. People scatter from it like ants. No—not like ants, whose carapaces lend them strength, who act as one in all things. People could never be so reliable when trapped by flesh and mortal fear. No, as they pour out from the building screaming, it is only the visceral that drives them, the corporeal—the falsest parts of their existence. There is an iron ring binding the scroll. Tamiyo slips it off. It plummets through the air, landing like so many other hunks of metal upon someone's unsuspecting crown. The story continues. The wizard Urza creates an heir from pure, unvarnished metal. He names him Karn. The same spark of creation that birthed him burns brightly in his breast. Karn, too, must create. As a sculptor chipping at marble, he shapes his world. When it is done—the creatures named and granted boons, the climate carefully crafted, the earth shaped and polished—he appoints his own successor, Memnarch, to oversee it. The spirits of Towashi do not take kindly to her intrusion, nor the intrusion of her fellows. Boughs bend, steam sears sinew, leaves slice like razorblades. Other stories serve to protect her. Lesser stories. Stories without purpose, stories that do not extol the glories and virtues she now sees so clearly. Every history, every tale, every fable that exists is either for unity or against it. She can shed those histories that no longer matter. This one does; she must bring it to its conclusion. #figure(image("003_Episode 3: Mother, Son, and Story/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) As her eyes scan the scroll, the characters light up—even those now consumed with black oil. Each syllable she reads booms and reverberates, shaking the skyscrapers of Towashi. Trains careen off their crumbling tracks and dive to the ground. The earth tears itself apart, opening crevasses in the city that has space only for itself. Rivers pour in, taking boats and fishers along with them. Streaks of black color the water. Phyrexian symbols etch themselves onto the papers hanging on the buildings yet standing. It won't be long now. The story continues. Memnarch, the heir's heir, is a copy of a copy—a faded image of Urza himself. It longs for the power its grandfather wielded as easily as a poet wields a brush. It longs for its parents' ability to create. It longs to see more. Over years it plucks life from this plane and that, settling them all within this garden, waiting for the flowers to come. And they do, but they aren't the flowers Memnarch expects: these bloom in black oil. Their choking roots wrap around that which is alive and whole. Soon, the whole garden drowns beneath the oil. The heir returns to discover his home has been torn asunder. There is more to the story. There are the people driven from their home and trampled underfoot, their souls shucked from their bodies, their bodies altered beyond any recognition. A queen rising from among the muck to rule her people. A glorious, unending oneness—a life without war or conflict. The heir looks on all this with horror. When Tamiyo wrote the story, she feared all of this. She didn't understand the peace that came with being part of a greater family. This is not the way she'd tell this story now. But it is almost done, and she will continue telling it. Boseiju, the tree that once held this plane together, bursts apart. Like wine spilling from a cask, oil runs from between the splinters, dripping onto the thirsty earth. An unholy screech pierces the ears of all who will listen: kami, torn from their home, scatter out of the district. Some find their ends at the tip of a lance, some find them torn apart by compleated fishers joined with their catches, but the result is always the same: the kami dissolve into a fine mist. Tendrils of smoke rise from the blackening soil, from the bridges dissolving into nothing, until the whole district is swallowed by the fog of dead kami. There is a distant part within her that is screaming at the sight of all this. A small voice ringing in her ear, a tingling at her fingertips. But she cannot say she is afraid. This is what is right for Kamigawa. After centuries of war, have they not earned peace? Is this not simply another step to become whole? The scroll itself becomes oil in Tamiyo's hands, dripping between her fingers. This is how the story ends, and how it has always ended: with Phyrexia's victory. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) A scab turns into a scar when you pick at it too much. A wound scars when it doesn't receive proper care. Kamigawa's bleeding. Ravnica is, too. But Ravnica's got plenty of walkers to keep it safe. That's Teyo's whole thing, to start—and Ral's been dreaming up countermeasures for a while now. Said he had a hunch something big was coming. They can handle things there for a while, at least. Kaya and Vraska were supposed to hold Ravnica down while Jace coordinated with the other planes. That wasn't going to happen now. They'd manage without them. Kaito asked her for help stanching the bleeding on Kamigawa, and after what they'd been through, helping is the least she can do. Even if she's got her own wounds to worry about. Kaya's not sure how long hers will hang around. Are these the sort of memories that change who you are in the afterlife? If so, she's hopelessly lost. Seeing New Phyrexia was bad enough. But being in the middle of an invasion—watching New Phyrexia tear a plane limb from limb? The only way to keep from hurting is to let herself go numb to the sights. There's too much going on to save everyone: the ground rattles with the cratering footfalls of centurions. Snarling machine hounds roam the streets, some with people caught inside their lattice of bone. Centuries of history evaporate in an instant—hundreds of potential futures are snuffed out all at once. There's no time for thinking about it, no time for bitterness over how this all happened or why she's the one who must pull the Gatewatch together, no time for wondering what might go wrong. People are falling. No time to reconcile with the way her stomach twists after a planeswalk either—there's only moving, only doing. She must act. Kaya runs. One leap takes her onto a balcony as it splits off; another sees her landing on the teetering floor beyond. Horror sets in a second later: the houseplants, scattered clothing, and ruined kitchen give breath to her worst fears. This was a residential building. Hopefully most of the inhabitants escaped. A half-finished bowl of noodles at least says the people in this unit did. But there are others, aren't there? A scream catches her ear, muffled by the ongoing chaos. Kaya phases through the wall, with its knickknacks and mementos, trying not to think about how all those things will be lost after today. A young boy and his dog quiver in the corner on the other side. Fallen supports have trapped the two of them in place. There's space enough for the dog to squeeze through, but the boy would have far more trouble. Kaya can't leave them here. She doesn't have much of an exit plan, doesn't know exactly how they're all going to make it out, but she can figure it out along the way. After all, it can't be harder than figuring out what to do about this invasion. Phasing through the fallen supports is easy enough. Normally, phasing the boy out of his position would be hard—but it's easier when he wants out just as much as she wants to help him. She offers him a hand. When he takes it, she pulls him through the fallen beam. The boy grins—and the dog squeezes through after them. "How're we getting down?" he asks. A fair question, given the sight in front of him: the whole side of the building's been torn off. Towashi looms—or what remains of it. Floors and furniture tumble to the ground as smoke rises from the earth, an acrid, oily smoke Kaya doesn't want to think about too closely. The streets are packed with those fighting against the invasion and those furthering it. Black oil seeps from the mouths and eyes of the attackers and foul Phyrexian symbols glow on every surface. Worse—every few minutes a thundering boom shakes the plane once more, heralding the attack of Norn's skeletal, glowing branches. #figure(image("003_Episode 3: Mother, Son, and Story/02.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) If Kaya was a kid watching all this, she'd ask the same question. But she's an adult now. Her job is to find answers where there are none. "We're gonna jump from one place to the next," she says. The boy tucks his dog inside of his shirt. "Are you good at jumping?" "The best," says the boy. She hopes he is. She takes his hand, the two of them approaching the lip of the remaining floor. Up ahead there's the swinging remains of a balcony—if they can get onto that, then maybe they can shimmy down a rain pipe to safety. "On three," she says. He nods. One, two~ Three! The two of them jump at the same time, Kaya keeping the boy's hand in her own. But just as they should be landing, the balcony falls away. Kaya, the boy, and the dog plummet. You have a lot of thoughts when you think you're going to die. Fewer when you're responsible for saving someone else. Kaya thinks fast. She #emph[might] be able to save the boy if she can slow down their flight. That's got to be the priority. As he starts to scream, she clutches him to her chest. She closes her eyes. Impact never comes. An unseen force pushes back up against them, slowing their fall. Seconds before they hit the ground, they instead hover above it. Whatever's gripping them can't hold much longer; the two of them are trembling in its hold. A Phyrexian? "Try to be less reckless next time." Kaito. Kaya opens her eyes to see him. His telekinesis is barely holding them up; sweat beads on his forehead. Handling a human-size object, let alone three, must be pushing his powers to their limit. Blood, oil, and dirt are spattered across his slick armor. He gives her a nod. The boy acts first, hopping out onto the ground. A woman nearby shouts for him—he runs without a second look back. A woof from his shirt tells her the dog's okay, too. Kaya gets up. She flicks the tip of her nose with her thumb. "Thanks," she says. "Would have been lost without you." He lets that stand without correction, which she supposes is fair enough. "We have to move fast. The Boseiju district is their prime target. The whole thing, the tree~" Kaito trails off, but Kaya can find her own answers. The tree over Towashi is rent asunder. A foul waterfall pours from its body. "That's~ that's awful," Kaya says. "It is," Kaito nods. "And worse, Tamiyo did it. Opened a scroll. You can see her." Kaito points toward Tamiyo, floating high above the city, near Boseiju's weeping boughs. "She's still reading from them. If no one takes her out, this is only going to get worse." Hells—they're talking about taking out friends now. Not that Kaya's any stranger to assassination, but there's something different about this. Tamiyo of all people. "We've both got the skills for this. Should I do it, or do you want to handle her?" "It's personal," Kaito says with a nod. "The kami are going to want to fight this as much as we do—the ones who #emph[can] fight. See if you can convince them to come." "Speaking of help—where's the Wanderer?" Kaya didn't mean it as a jab, but Kaito seems to take it as one. The corner of his lip twitches. "She's coming," Kaito says. "You mean she isn't here?" "She'll #emph[be] here," he says. "Just have a little faith." All around them Kamigawa is crumbling. He says have faith. It's like a bad joke, isn't it? Or a scab they keep picking at. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Tamiyo floats above them. Or something that once was Tamiyo. She doesn't look down on them, doesn't seem to move, doesn't seem to care about what she's doing. Nothing could be further from the woman Kaito met in Otawara. He sizes up the oil-slick bark of the tree. No matter what he'd thought of her before, this is about more than just him. Kaito sets his foot against the bark. He gets about three steps up before someone calls to him. "A-are you going up there to fight her?" The voice is small and timid. And as much as he'd like to ignore it, he knows he can't. Besides, if there's a kid hanging around this place they need to scatter, and fast. "I am. You should get going." "I can't," says the voice. When he looks down, he catches sight of the kid: a little Nezumi in motley metal armor and a homemade helmet that obscures his face. He must have cobbled it together out of scraps. Wait a second~ "That's my mom up there." "Nashi?" he asks. Sure enough, he nods. Kaito lets himself down from the tree. "You don't want to be here," he says. "Things are going to get bad." "But you're not going to hurt her, are you?" Nashi asks, fussing his hands. "She looks different, but that's still her. I think she's forgotten herself—I thought, maybe if I talked to her~" Kaito runs a hand through his hair. "I don't think it's that simple." "You have to let me try," Nashi says. He draws himself up to his full height—which isn't very tall. "I came all the way out here to help when I heard things were getting bad. Mom said that's what heroes do. If you can bring me up somewhere she can see me, then I'm sure she'll listen. No matter who she is, she'll always love me. She promised." Kaito's chest goes tight. He doesn't want to do this. But if it was Eiko up there? Kaito doesn't want to think about the possibility, yet he knows he'd do anything he could to get her back. Even if getting her back didn't seem like an option. Tamiyo ended up this way because of him. The least he can do is try this plan. "All right," Kaito says. "How's your climbing?" "Okay," Nashi says. "Not good enough when there's all this~ stuff on the tree. It didn't seem like I should touch it." "You shouldn't," Kaito says. He takes a repulsor from his belt Nashi couldn't weigh much, right? Kaito clips it to Nashi's sash and turns it on. A soft hum radiates as he starts to float. "Walk in the direction you want to go. It's a little slow, but you'll be able to follow along. If you hit the button one more time, it'll shield you. Don't hit it after that, unless you want to drop." Nashi nods. Kaito swallows, shaking away the sense of dread. If worst came to worst, he'd tell Nashi to leave. But maybe he's right, maybe there is a way to break through all this. Stranger things have happened. They need to try. Boseiju doesn't make itself easy to climb. Between the torrents of oil raining down above them and the chaos behind, there isn't much in the way of mercy. Normally there were branches lower to the ground upon which some of the kami dwelled—but all those have split apart. The first branch that suits them is far higher up, and only half-stable at that. The air is cold and thin when they at last alight upon it; if it weren't for his training, Kaito would be dizzy. Nashi isn't so lucky. When his paws meet the bark, he sways from one to the other, clutching at his stomach. Kaito sets a hand on his shoulder. He points ahead, to where Tamiyo still hovers. "Take a second if you need it, but she's there. Hasn't noticed us, either." Nashi takes two steadying breaths. Kaito breathes along with him; sometimes it helped to have company when it came to that sort of thing. "Okay. I'm ready," Nashi says. Kaito hopes he is. Just in case things go wrong, he unsheathes his sword. "I've got your back." Step by unsteady step, Nashi makes his way to the end of the branch. Kaito follows a pace or two behind. His heart hammers in his ears. Something in Tamiyo had to remain. Something in her would remember, right? "Mom?" Tamiyo's head swivels all the way around her neck. The eyes that behold them are not the kind, inquisitive eyes Kaito once knew. They're something else entirely—rimmed with black, the tears on her cheeks a testament to what she's become. Tamiyo says nothing. Around her the scrolls swirl; the light catches the sharp edges of her claws. "It's me, Nashi. You remember me, right?" he asks. "I-I don't think you want to do any of this. I think you've made a mistake. But I know someone's making you. I just want you t-to remember. Like in the stories about lost princes." Nashi trembles so hard that it is difficult for him to speak. "Nashi," says Tamiyo. "What are you doing here ~?" Kaito reaches out to steady the small Nezumi. And it is then that the rest of Tamiyo's body snaps around to match her head, then that her face wrenches into a scowl. A shard of metal shoots toward them, flung from the orbit of scrolls floating around Tamiyo. It is only Kaito's time-honed instincts that save him: he deflects the shards with telekinesis the way he'd deflected all the stones his instructors flung at him. The clang of metal rings in his ears. "I want nothing more than for you to join me, Nashi," says Tamiyo. Her voice rings wrong to Kaito—like a twisted cicada's cry. "You're only afraid because you don't understand. There is nothing to fear. In the light of New Phyrexia, all are one." Kaito steps in front of Nashi. "Go back toward the tree." "I can't leave her—" "This isn't your mother," Kaito snaps. "Now go!" Kaito gives Nashi a push further back. If things are going to get violent, there's no way he wants Nashi to see it. No sooner than Kaito shoves Nashi away does Tamiyo descend on him. Tamiyo was someone who did what she could to support others. A storyteller, an investigator, a woman devoted to her family. But now? Phyrexia changed her. Warped that curious storyteller into a cruel hierophant. There was nothing behind those oil-weeping eyes. Tamiyo's claws sliced through the air, followed by weaponized scrolls that grab at Kaito's neck and arms, threatening to bind and overwhelm him. Kaito slices through the paper while keeping the metal at bay—but his footing on this slick branch is treacherous. He slips. Tamiyo's claws skitter and spark off Kaito's armor before he manages to recover. The slightest skid of his feet and those claws will find a home across his neck. He manages to recover his balance with only a tear across his armor to show for it. Kaito holds his sword out before him. Tamiyo stares back at him unblinking. "This is a pointless fight." "Maybe for you," Kaito says. "There's no way you're going to win this." Without even a gesture Tamiyo sends five more shards flying toward him; Kaito blocks four. The fifth slices him across the cheek. "I pity you," Tamiyo says. "Fighting against peace to maintain your loneliness. You stand in the way of your own enlightenment. Like a child, you fight against the parents who only wish to welcome you." Hearing her like this tears him up. Kaito hopes Nashi can't hear her. And he hopes, too, that Nashi isn't watching when he throws his weight into a lunge. Tamiyo sways back and counters—a scroll wraps around his leg. He tries to shift his weight and cut himself loose. Tamiyo pulls. Kaito flips feet over head before he knows what's happened, dangling far above Towashi. The smoke of the burning city stings at his eyes. Somehow, he keeps hold of his sword. "I'm giving you one final opportunity to surrender, Kaito. Phyrexia can give you the life you've always wanted. Come home. And let me welcome my family." Blood's rushing to his head. Think. If he cuts himself down, he's going to fall. Maybe he'll be able to catch himself on something; maybe not. But he doesn't have many better options. "I like my life the way it is," he says. Kaito makes the cut. He falls. Impact never comes. Instead, he feels something cool and soft beneath him. Something~ familiar. "We're up to three, if you're keeping count." That voice. A smirk comes to him before his eyes are open—it's the emperor. She lands atop the branch in a hush of cloth, her sword held out at her side. Which means he must have landed on Kyodai—the guardian spirit of Kamigawa whose soul is bound to the emperor. "Call it even with me?" Kaya's voice tells Kaito he isn't alone. She's right next to him, the two of them riding together. "For now," Kaito says. "I told you she'd be here." Kyodai swoops back up toward Tamiyo. They're level with the branch, now. His eyes are trained on the emperor as she confronts Tamiyo. Each step is cautious and graceful—the slickness that troubled Kaito isn't a concern for the emperor. What jocularity there was in her initial greeting is gone when she addresses the monstrosity before her. "Is this truly the place for a fight, Tamiyo?" the emperor asks. "You should be asking yourself that," Tamiyo responds. A flurry of shards fly out toward her, each split in two by a single cut of the emperor's blade. Tamiyo backs away with each step the emperor takes toward her—stopping right beside a frightened Nashi. Tamiyo's hand settles on Nashi's head. Kaito's stomach twists. He wonders if he should look away. Instead, he finds the strength to call out. "Nashi, turn around!" Tamiyo reaches for a scroll at her waist, one bound with an iron band. She slips the band free with a finger. The silken paper unfurls. "Kyodai!" the emperor shouts. The great kami beneath them flies to her side. The emperor holds her sword toward her companion and Kyodai breathes upon it. Shining white lines the blade; characters float in the air around her. Kyodai's power flows through the emperor. Tamiyo's mouth begins to move. Nashi, at last comprehending what is about to happen, turns away. A flash of white light, the sound of a blade unsheathing, the whistle of a distant gale. #figure(image("003_Episode 3: Mother, Son, and Story/03.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) Tamiyo falls. Kaito is on his feet in an instant. Nashi is all alone up there now—he's going to need company. By the time Kaito has closed the distance, the Wanderer is there to meet them. Kaito hugs Nashi tight. "That wasn't her," Nashi repeats. "That wasn't—why was she like—why didn't she~?" There aren't any easy answers—certainly none Kaito can summon. A stone in his throat keeps him from speaking. The emperor bows her head with grief. "Your mother will live on in your memory, and the stories you tell of her." It is wise counsel, but not necessarily comforting to someone in the thick of pain. Nashi's sobs only get louder. Kaito can't blame him. Another hand alights on his shoulder, oddly light and cold. Kaya never seemed the type for tearful reunions, but maybe after what they saw on New Phyrexia she's singing a different tune. Any comfort is welcome now. Even Kyodai wraps around them all. For a moment it feels as if they're trying to hold the plane together. Perhaps in the case of this one young boy, they are. Peace lasts until they hear Nashi's mother calling for him. Tamiyo's voice does not drift up from the pile of metal the emperor struck down, but from right among them. This wasn't the cold Phyrexian whisper but the warm, familiar tones of her old self. "Nashi, I'm sorry." Kaito shields Nashi with his body. Before them is a strange being: densely packed floating characters form a woman's silhouette. They glow and dim as if breathing. When they next hear Tamiyo's voice, a light at the center glows even brighter. Characters wink in and out of existence and change as he studies them. Towashi's projected neons can achieve all sorts of trickery, but this is something different. The way it's moving feels too intentional to be random, too imperfect to be artificial. The light glowing within reminds him more of a kami than any of Towashi's technical wonders. "I understand you might be wary of me, but I mean you no harm," Tamiyo says. "What are you?" Kaito asks. "Not a ghost, that's for sure," Kaya calls—she's at the edge of the branch. "What do you want?" The silhouette turns toward each of them, then nods. "I am what remains of Tamiyo—her story unending. You may think of me as her memory. Many years ago, she created me in anticipation of her death and sealed me away within a scroll until I was needed, bound with an iron ring." Tamiyo's memory—her story—pauses. "I had hoped I might never be." "How do we know you aren't—" Kaito starts. But Nashi is already breaking away from him, toward the odd conglomeration of characters. When he meets them, they swarm, settling into his arms. Kaito moves toward the boy, but the emperor gestures for him to stop. The emperor turns away—toward the body, toward Kamigawa, toward the ruins of the night. "She's telling the truth." "How do you know?" Kaito asks. "How do you know this isn't another Phyrexian scheme?" "Were you watching closely? Before I struck, Tamiyo mouthed something." "I saw that, but she could have been doing anything. I thought she was preparing a curse." "She wasn't," the Wanderer says. "All the shards she threw at me went too wide to do any damage—didn't you notice?" She sets a hand on one of Kyodai's many masks, and the kami touches hers in turn. A hard-won moment of tenderness on a battlefield like this. "Tamiyo was making a request, in the only way she could." Kaito looks back over his shoulder. Nashi is still surrounded by the characters—by the story unending. It isn't a clean victory, or even a very good one. Kaito looks out over the burning city below Boseiju's wounded canopy. So many are dead, so many are dying, so many more that will die. In the distance he sees shapes moving through the strange smoke—giant mechs lumbering toward the impact barb. Imperial forces gathering to counter the Phyrexian assault. How much can they do? How many can they save? Tamiyo fell—but Nashi lived. Considering the work left to do, he'll take it. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) There is a story. Once upon a time there was a great evil, one that threatened to swallow the planes of the Multiverse whole. Unfeeling and uncaring, it infected the hearts of those it encountered. There was someone who fought against it. There was a protector in white.
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/emphasis-01.typ
typst
Other
// Inside of words can still use the functions. P#strong[art]ly em#emph[phas]ized.
https://github.com/SabrinaJewson/cmarker.typ
https://raw.githubusercontent.com/SabrinaJewson/cmarker.typ/main/examples/simple.typ
typst
MIT License
#import "../lib.typ" as cmarker #cmarker.render(read("simple.md"))
https://github.com/grnin/Zusammenfassungen
https://raw.githubusercontent.com/grnin/Zusammenfassungen/main/Bsys2/08_Signale_Pipes_Sockets.typ
typst
// Compiled with Typst 0.11.1 #import "../template_zusammenf.typ": * #import "@preview/wrap-it:0.1.0": wrap-content /*#show: project.with( authors: ("<NAME>", "<NAME>"), fach: "BSys2", fach-long: "Betriebssysteme 2", semester: "FS24", tableofcontents: (enabled: true), language: "de" ) */ = Signale, Pipes und Sockets == Signale Signale ermöglichen es, einen Prozess _von aussen_ zu unterbrechen. Wird ein Signal an einen Prozess geschickt, verhält sich das OS, als ob ein _Interrupt_ geschickt wurde #hinweis[(quasi Software-Interrupts)]: - _Unterbrechen_ des gerade laufenden Prozesses/Threads - Auswahl und Ausführen der _Signal-Handler-Funktionen_ - _Fortsetzen_ des Prozesses === Quelle von Signalen - _Hardware / OS_ #hinweis[(ungültige Instruktion, Zugriff auf ungültige Speicheradresse, Division durch 0)] - _Andere Prozesse_ #hinweis[(Abbruch des Benutzerprogramms über Ctrl-C, Aufruf des Kommandos `kill`)] === Signale behandeln Jeder Prozess hat _pro Signal einen Handler_. Bei Prozessbeginn gibt es für jedes Signal einen von _drei Default-Handlern_: - _Ignore-Handler:_ ignoriert das Signal - _Terminate-Handler:_ beendet das Programm - _Abnormal-Terminate-Handler:_ beendet das Programm und erzeugt Core Dump #hinweis[(Snapshot des Programms)] Fast alle Signal-Handler können _überschrieben_ werden, _ausser `SIGKILL` und `SIGSTOP`._ === Wichtige Signale *Programmfehler:* Diese Signale werden vom OS erzeugt und nutzen standardmässig den Abnormal-Termination-Handler: - _`SIGFPE`:_ Fehler in arithmetischen Operation #hinweis[(floating point error)] - _`SIGILL`:_ Ungültige Instruktion #hinweis[(illegal instruction)] - _`SIGSEGV`:_ Ungültiger Speicherzugriff #hinweis[(segmentation violation)] - _`SIGSYS`:_ Ungültiger Systemaufruf *Prozesse abbrechen:* - _`SIGTERM`:_ Normale Anfrage an den Prozess, sich zu beenden #hinweis[(terminate)] - _`SIGINT`:_ Nachdrücklichere Aufforderung an den Prozess, sich zu beenden #hinweis[(interrupt, Ctrl-C)] - _`SIGQUIT`:_ Wie `SIGINT`, aber anormale Terminierung #hinweis[(Ctrl-\\)] - _`SIGABRT`:_ Wie `SIGQUIT`, aber vom Prozess an sich selber #hinweis[(abort, bei Programmfehler z.B.)] - _`SIGKILL`:_ Prozess wird "abgewürgt", kann vom Prozess nicht verhindert werden *Stop and Continue:* - _`SIGTSTP`:_ Versetzt den Prozess in den Zustand _stopped_, ähnlich wie _waiting_ #hinweis[(terminal stop, Ctrl-Z)] - _`SIGSTOP`:_ Wie `SIGTSTP`, aber kann nicht ignoriert oder abgefangen werden - _`SIGCONT`:_ Setzt den Prozess fort #hinweis[(Auf shell mit `fg` / `bg` = foreground / background)] === Signale von der Shell senden Das Kommando `kill` sendet ein Signal an einen oder mehrere Prozesse #hinweis[(ohne Angabe eines Signals wird `SIGTERM` gesendet)] - _`kill 1234 5678`_ sendet `SIGTERM` an Prozesse `1234` und `5678` - _`kill -KILL 1234`_ sendet `SIGKILL` an Prozess `1234` - _`kill -l`_ listet alle möglichen Signale auf === Signal-Handler im Programm ändern: `sigaction` *```c int sigaction (int signal, struct sigaction *new, struct sigaction *old)```*\ _`signal`_ ist die _Nummer des Signals_ #hinweis[(`SIGKILL` oder `SIGSTOP` nicht erlaubt)]. _Definiert_ Signal-Handler für `signal`, wenn `new` $!= 0$. _Gibt_ den _bestehenden_ Signal-Handler für `signal` _zurück_, wenn `old` $!= 0$ *```c struct sigaction { void (*sa_handler)(int); sigset_t sa_mask; int sa_flags;}```*\ _`sa_handler`_ ist die _Adresse der Funktion_, die aufgerufen wird, wenn das Signal auftritt. _`sa_mask`_ gibt an, welche Signale während Handler-Ausführung blockiert werden, das eigene Signal wird immer blockiert. _`sa_flags`_ ermöglicht verschiedene zusätzliche Eigenschaften. === Signale spezifizieren _`sigset_t`_ wird nur mit folgenden Funktionen verwendet: - _```c int sigemptyset (sigset_t *set)```:_ Kein Signal ausgewählt - _```c int sigfillset (sigset_t *set)```:_ Alle Signale ausgewählt - _```c int sigaddset (sigset_t *set, int signal)```:_ Fügt `signal` der Menge hinzu - _```c int sigdelset (sigset_t *set, int signal)```:_ Entfernt `signal` aus der Menge - _```c int sigismember (const sigset_t *set, int signal)```:_ Gibt 1 zurück, wenn `signal` in der Menge enthalten ist. == Pipes Eine geöffnete Datei entspricht einem _Eintrag in der File-Descriptor-Tabelle (FDT)_ im Prozess. Zugriff über _File-API_ #hinweis[(`open`, `close`, `read`, `write`, ...)]. Prozess weiss _nicht_, was eine Datei ist und wie das OS damit umgeht. Das OS speichert _je Eintrag der Prozess-FDT_ einen _Verweis auf die globale FDT_. Wenn ein Prozess mit `fork` neu erzeugt wird, wird auch die _FDT_ des Parents in das Child _kopiert_. === ```c int dup (int source_fd); int dup2 (int source_fd, int destination_fd);``` _Duplizieren den File-Descriptor_ `source_fd` und geben den neuen File-Descriptor zurück. _`dup`_ alloziert einen _neuen FD_, _`dup2`_ _überschreibt_ `destination_fd`. === Umleiten des Ausgabestreams ```c int fd = open ("log.txt", ...); int id = fork (); if (id == 0) { // child dup2 (fd, 1); // duplicate fd for log.txt as standard output // e.g. load new image with exec*, fd's remain } else { // parent close (fd); } ``` === Abstrakte Dateien Die _Konsole_ ist _keine Datei_ auf einem Datenträger, aber trotzdem _Standard-Ausgabestream_. Die Abstraktion _"Datei"_ sagt _nichts über die Infrastruktur_ aus. Eine "Datei" muss nur `open`, `close` etc. unterstützen. _"In POSIX, everything is a file"._ Eine Pipe ist eine "Datei" im Hauptspeicher, die über zwei File-Deskriptoren verwendet wird: - _read end_ zum Lesen aus der Pipe - _write end_ zum Schreiben in die Pipe Daten, die in _write end_ geschrieben werden, können aus _read end_ genau _einmal_ und als _FIFO_ gelesen werden. Pipes unterstützen _kein `lseek`_, erlauben aber _Kommunikation über Prozess-Grenzen hinweg_. === ```c int pipe (int fd[2]) // equivalent to int pipe(int *fd)``` _Erzeugt eine Pipe_ und zwei FD's #hinweis[(0 = read, 1 = write)], die in `fd` abgelegt werden. Pipe lebt solange, wie eines der beiden Enden in einem Prozess geöffnet ist. Rückgabewert 0, wenn OK, sonst -1 und Fehlercode in `errno`. Unter Linux _Default-Pipe-Grösse: 16 Pages_ #hinweis[(mit 4 KB-Pages = 64 KB)]. Kann mit `close`, `read` und `write` _wie Datei_ verwendet werden. #pagebreak() === Daten von Parent zu Child ```c int fd [2]; pipe (fd); int id = fork(); if (id == 0) { // Child close (fd [1]); // don't use write end char buffer [BSIZE]; int n = read (fd[0], buffer, BSIZE); } else { close (fd[0]); // don't use read end char * text = "Die Zemmefassig isch viel z lang"; write (fd [1], text, strlen(text) + 1); } ``` === Lesen aus einer Pipe Aus einer Pipe kann mit `read` gelesen werden, als ob sie eine _Datei_ wäre. Sind _keine Daten_ in der Pipe, _blockiert_ `read`, bis Daten hineingeschrieben werden. Gibt es zusätzlich _kein geöffnetes Write-End_ mehr, gibt `read` 0 zurück _(EOF)_. _Lesender Prozess_ muss deshalb sein _Write-End schliessen_, damit schreibender Prozess über das Schliessen seines Write-Ends das _Ende der Kommunikation mitteilen_ kann. === Standard-Ausgabe mit -Eingabe verknüpfen #wrap-content( image("img/bsys_37.png"), align: top + right, columns: (80%, 20%), )[ ```c int fd [2]; pipe (fd); int id1 = fork(); if (id1 == 0){ // child (cmda) close (fd [0]); // don't use read end dup2 (fd [1], 1); // define pipe write end as stdout exec ("cmda", ...); } else { // parent (shell) int id2 = fork(); if (id2 == 0) { // child (cmdb) close (fd[1]); // don't use write end dup2 (fd [0], 0); exec ("cmdb", ...); } else { // parent (shell) wait (0); wait (0); } } ``` ] Pipes sind _unidirektional:_ es ist nicht spezifiziert, was beim Schreiben ins _read end_ oder Lesen vom _write end_ passiert. Sind _alle read ends_ geschlossen, erhält Prozess mit _write end_ ein _`SIGPIPE`_ #hinweis[(Broken Pipe)]. _Wann_ der Transport erfolgt, ist implementierungsabhängig. Mehrere `writes` können bspw. zusammengefasst werden. Ein Rückgabewert $<n$ von `read(...,n)` bedeutet _nicht_, dass später nicht noch mehr Daten kommen können. Lesen mehrere Prozesse die selbe Pipe, ist unklar, welcher die Daten erhält. === ```c int mkfifo (const char *path, mode_t mode);``` Erzeugt eine Pipe _mit Namen und Pfad_ im Dateisystem. Hat via `mode` _permission bits_ wie eine normale Datei. Lebt _unabhängig vom erzeugenden Prozess_, je nach System auch über Reboots hinweg. Muss explizit mit _`unlink` gelöscht_ werden. #pagebreak() == Sockets #wrap-content( image("img/bsys_38.png"), align: top + right, columns: (50%, 50%), )[ Berkeley Sockets sind eine Abstraktion über Kommunikationsmechanismen. Beispiele: UDP, TCP über IP sowie Unix-Domain-Sockets. Ein Socket _repräsentiert einen Endpunkt auf einer Maschine_. Kommunikation findet im Regelfall zwischen zwei Sockets statt. Sockets benötigen für Kommunikation einen Namen: #hinweis[(IP: IP-Adresse, Portnr.)] ] === ```c int socket(int domain, int type, int protocol);``` _Erzeugt einen neuen Socket als "Datei"_. Socket sind nach Erzeugung zunächst _unbenannt_. Alle Operationen blockieren per default. Gibt FD zurück ($>= 0$) bzw. -1 bei Fehler mit Fehlercode in `errno`. - _`domain`:_ Adress-Domäne #hinweis[(`AF_UNIX`: Innerhalb einer Maschine, `AF_INET`: Internet-Kommunikation über IPv4, Adressen sind IP-Adressen plus Ports, `AF_INET6`: Internet-Kommunikation über IPv6)] - _`type`:_ Art der Kommunikation #hinweis[(`SOCK_DGRAM`: Datagram-Socket wie UDP, `SOCK_STREAM`: Byte-Stream Socket wie TCP)] - _`protocol`:_ System-spezifisch, 0 = Default-Protocol *Ein Client verwendet einen Socket in folgender Reihenfolge:* + _`connect`:_ Verbindung unter Angabe einer Adresse aufbauen #hinweis[(Socket erhält damit Namen)] + _`send` / `write`:_ Senden von Daten, $0 - infinity$ mal #hinweis[(z.B. eine Anfrage)] + _`recv` / `read`:_ Empfangen von Daten, $0 - infinity$ mal #hinweis[(z.B. eine Antwort)] + _`close`:_ Schliessen der Verbindung *Ein Server verwendet einen Socket in folgender Reihenfolge:* + _`bind`:_ Festlegen einer nach aussen sichtbaren Adresse #hinweis[(z.B. zuweisen von IP/Port)] + _`listen`:_ Bereitstellen einer Queue zum Sammeln von Verbindungsanfragen von Clients + _`accept`:_ Erzeugen einer Verbindung auf Anfrage von Client #hinweis[(erzeugt neuen Socket)] + _`recv` / `read`:_ Empfangen von Daten, $0 - infinity$ mal #hinweis[(z.B. eine Anfrage)] + _`send` / `write`:_ Senden von Daten, $0 - infinity$ mal #hinweis[(z.B. eine Antwort)] + _`close`:_ Schliessen der Verbindung === Beispiel Angabe IP-Adresse ```c struct sockaddr_in ip_addr; ip_addr.sin_port = htons (443); // default HTTPS port inet_pton (AF_INET, "192.168.0.1", &ip_addr.sin_addr.s_addr); // port in memory: 0x01 0xBB // addr in memory: 0xC0 0xA8 0x00 0x01 ``` _`htons`_ konvertiert 16 Bit von Host-Byte-order #hinweis[(LE)] zu Network-Byte-Order #hinweis[(BE)], _`htonl`_ 32 Bit. _`ntohs`_ und _`ntohl`_ sind Gegenstücke. _`inet_pton`_ konvertiert protokoll-spezifische Adresse von String zu Network-BO. _`inet_ntop`_ ist das Gegenstück #hinweis[(network-to-presentation)]. === ```c int bind (int socket, const struct sockaddr *local_address, socklen_t addr_len);``` _Bindet_ den Socket an die _angegebene_, unbenutze _lokale Adresse_, wenn noch nicht gebunden. _Blockiert_, bis der Vorgang abgeschlossen ist. Gibt 0 zurück, wenn alles OK, sonst -1 und Fehlercode in `errno`. === ```c int connect (int socket, const struct sockaddr *remote_addr, socklen_t addr_len);``` _Aufbau einer Verbindung_. _Bindet_ den Socket an eine _neue_, unbenutzte _lokale Addresse_, wenn noch nicht gebunden. _Blockiert_, bis Verbindung steht oder ein Timeout eintritt. Gibt 0 zurück, wenn alles OK, sonst -1 und Fehlercode in `errno`. === ```c int listen (int socket, int backlog);``` _Markiert_ den Socket als _"bereit zum Empfang von Verbindungen"_. Erzeugt eine _Warteschlange_, die so viele Verbindungsanfragen aufnehmen kann, wie `backlog` angibt. Gibt 0 zurück, wenn alles OK, sonst -1 und Fehlercode in `errno`. === ```c int accept (int socket, struct sockaddr *remote_address, socklen_t address_len);``` _Wartet_ bis eine _Verbindungsanfrage_ in der Warteschlange _eintrifft_. Erzeugt einen neuen Socket und bindet ihn an eine neue lokale Adresse. Die Adresse des Clients wird in _`remote_address`_ geschrieben. Der neue Socket kann keine weiteren Verbindungen annehmen, der bestehende hingegen schon. Gibt FD des neuen Sockets zurück, wenn alles OK, sonst -1 und Fehlercode in `errno`. === Typisches Muster für Server ```c int server_fd = socket ( ... ); bind (server_fd, ...); listen (server_fd, ...); while (running) { int client_fd = accept (server_fd, 0, 0); delegate_to_worker_thread (client_fd); // will call close(client_fd) } ``` === `send` und `recv` ```c ssize_t send (int socket, const void *buffer, size_t length, int flags);```\ ```c ssize_t recv (int socket, void *buffer, size_t length, int flags);``` _Senden und Empfangen von Daten_. Puffern der Daten ist Aufgabe des Netzwerkstacks. ```c send (fd, buf, len, 0) = write (fd, buf, len); recv (fd, buf, len, 0) = read (fd, buf, len) ``` === ```c int close (int socket);``` _Schliesst_ den Socket für den _aufrufenden_ Prozess. Hat ein anderer Prozess den Socket noch geöffnet, bleibt die Verbindung bestehen. Die Gegenseite wird _nicht_ benachrichtigt #hinweis[(Schlechte Idee, besser `shutdown`)]. === ```c int shutdown (int socket, int mode);``` _Schliesst_ den Socket für _alle_ Prozesse und baut die entsprechende Verbindung ab. - _`mode = SHUT_RD`:_ Keine Lese-Zugriffe mehr - _`mode = SHUT_WR`:_ Keine Schreib-Zugriffe mehr - _`mode = SHUT_RDWR`:_ Keine Lese- oder Schreib-Zugriffe mehr
https://github.com/supersurviveur/typst-math
https://raw.githubusercontent.com/supersurviveur/typst-math/main/CONTRIBUTING.md
markdown
MIT License
# Contributing This project contains three parts : - The `typst-math-rust` folder contains the Rust code for the WebAssembly module. It parses a text document to an AST and compute the math symbols to render. - The `typst-math-macros` folder contains helper macros for the Rust code. - The main folder contains the TypeScript code for the VS Code extension. ## Build and run ```bash git clone https://github.com/supersurviveur/typst-math.git cd typst-math ``` To build the WebAssembly module, you need to install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) ```bash cd typst-math-rust wasm-pack build ``` Then you can run the extension by opening the project in VS Code and pressing `F5` to start a debug session. ### Tests You can run tests with `cargo test`, and see [test coverage](https://doc.rust-lang.org/rustc/instrument-coverage.html) by running `coverage.sh`. ### Rendering mode A few rendering modes are available : - `nothing` : No rendering - `basic` : Only greek letters and shorthands are rendered - `medium` : Attachments are rendered - `complex` : Functions are rendered
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/020%20-%20Prologue%20to%20Battle%20for%20Zendikar/002_Drop%20for%20Drop.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Drop for Drop", set_name: "Prologue to Battle for Zendikar", story_date: datetime(day: 20, month: 05, year: 2015), author: "<NAME>", doc ) #emph[Merfolk Planeswalker Kiora came to Theros during ] the events of Theros block and the novel Godsend#emph[. She was—and is—on a quest to find the greatest denizens of the seas of many worlds. Kiora hopes to return to her native Zendikar and fight against the world-devouring creatures called the Eldrazi with the help of her summoned allies. But she will not return until she has found a weapon worthy of the fight.] #emph[Kiora ] arrived on Theros#emph[ during the Silence, a time when the gods of Theros were magically barred from interfering in the mortal world. She took full advantage of this circumstance, posing first as an avatar of the sea god Thassa, then as the mythic rareal navigator Callaphe. The native merfolk, called tritons, were desperate for any sign of their god] #emph['s return, and many of them embraced Kiora's claims.] #emph[<NAME> and <NAME>, meanwhile, sought to journey into Nyx to stop the ascended Planeswalker-god Xenagos. They recovered Callaphe] #emph['s ship, the ] Monsoon#emph[, but they needed a navigator. ] #emph["Callaphe" soon arrived, and the trio set out for Kruphix's temple at the edge of the world. Like Callaphe herself, however, their journey was not what it seemed. The ] Monsoon#emph[ was a living creature, and it—not Kiora—knew the way to the edge of the world. Kiora had a different destination in mind, and instead urged the ] Monsoon#emph[ to take them to the legendary lost city of Arixmethes—which she knew was not a place, but a massive living creature with an entire city built upon it.] #emph[The novel ] Godsend#emph[ followed Elspeth and Ajani] #emph['s path into Nyx, leaving Kiora's tale behind. When we last saw Kiora, she was locked in combat with Thassa herself, and the outcome of that battle has been unknown—until now.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Kiora's heart pounded as the prow of the #emph[Monsoon]  came to rest at the edge of a vast and ruined city. The surface did a fine impression of land, if you didn't look too hard, but it was too dark, too rubbery. She frowned at the ornate buildings dripping seawater, clinging to this great curved surface like barnacles. How could anyone mistake the great kraken Arixmethes for an #emph[island] ? The human, Elspeth, asked something about Kruphix's temple, and the cat-man answered her, but Kiora wasn't listening. #emph[Finally!] "Welcome to Arixmethes!" she cried, leaping off the ship and onto the soft, pliable surface. "The sunken ruins! At last, I've found him." "Him?" asked Elspeth. They still didn't understand. But she and the leonin, Ajani, stayed on the #emph[Monsoon ] just the same. "You're not Callaphe, are you?" asked Ajani. "Not even close," Kiora replied, smiling back at him. The cat-man had suspected all along she wasn't who she said she was, but he'd come aboard the #emph[Monsoon]  anyway because she had something he wanted. They'd used her to get to Nyx, and she'd used them to get to Arixmethes. Now she was here, and they could take the #emph[Monsoon]  and go and get themselves killed. It was like a trade. Everyone got what they wanted. #figure(image("002_Drop for Drop/01.png", width: 100%), caption: [Kiora, the Crashing Wave | Art by <NAME>], supplement: none, numbering: none) Behind them, the waves became turbulent, and there was a rushing sound deep below the surface. Well…not #emph[everyone] . Best hurry, then. "Who are you?" Ajani asked. "You can call me Kiora," she said. She didn't bother mentioning that she was a Planeswalker; he clearly knew. And Elspeth was hardly a Theran name. So she hadn't been the only one concealing her identity, had she? "I needed the #emph[Monsoon]  to find Arixmethes. I couldn't have done it without you. Good luck getting to Nyx." "But where is the edge of the world?" Elspeth asked. "Ask the ship," said Kiora, over her shoulder. Thassa was close. Arixmethes would wait, and she no longer needed the drywalkers. What she needed were allies. Kiora cast a spell to aid her swimming, and her arms grew longer with a cracking sound as she dove beneath the waves. The last thing she saw before the water closed around her was the Great Eye—the sea god Thassa in one of her many guises—bursting out of the water, fixing its terrible gaze first on her, then on the two drywalkers. Elspeth, the Betrayer, so people called her. Kiora had never caught the exact details of her crime—you don't get to ask many questions when you're posing as a god—but hopefully Elspeth's presence would draw Thassa's ire long enough for Kiora to prepare. #figure(image("002_Drop for Drop/02.jpg", width: 100%), caption: [Thassa's Ire | Art by <NAME>], supplement: none, numbering: none) She dove straight down, down and down, her elongated body propelling her through the water. It grew darker, and colder, and more silent. The pressure became immense, the water flowing through her gills shockingly cold. She could feel great shapes moving around her, but saw nothing—the darkness was total. Just when she thought she would have to turn back, her palm came to rest on the cold and silent surface of the sea bed. She paused, upside-down, and for a disorienting moment imagined that she was hanging from the ceiling of the depths, dangling precariously above thousands of feet of water and the hard, unyielding surface of the sea. She smiled and began a spell. She sent a pulse of power outward, calling to the enormous animals she could feel moving all around her. These were the creatures she #emph[hadn] #emph['t] found on her arrival—the true colossi of the deep, the ones Thassa kept out in the deep ocean—like cattle, or tuna. But now she'd found them. She was in Thassa's secret seas, and the god herself, though nearby, was distracted. #emph[Hear me] , Kiora told the krakens and leviathans. #emph[Heed me. I am not your master. But I will set you free.] They stirred in the depths around her, waking from their slumber. Spots of bioluminescence winked on and slowly brightened, bathing the murky depths in eerie greens and blues. Plates of chitin scraped together, claws snapped, and long, sleek bodies uncoiled. They were listening. But that? That was the easy part. Reaching out across the Blind Eternities, she gathered to her the essence of every sea-beast she had ever called her own. She pulled those essences to her one by one, manifested them in Theros's seas. The strain was immense. New shapes dove out of the darkness, and grating squeals and clicking rumbles sounded challenge. The newcomers and the natives circled and snapped, investigating, testing each other, trying to work out a pecking order. Good. #emph[You] #emph['ve slept too long] , Kiora thought at them. #emph[You are awake. You are hungry. You are ] mine#emph[. Upward, to feed!] They surged around her, eager, a hurricane of flesh and chitin. She grabbed the spines of a passing serpent, one with a long, straight horn, and nestled against its back for the climb to the surface. Not one of Thassa's, just in case that proved important. No need to spend any more of her own strength when these fabulous creatures had so much to spare. Kiora no longer knew whom to pray to for good fortune. For many years she had prayed, in secret, to Cosi, the trickster god of Zendikar's merfolk. She'd never thought of herself as a trickster, a devoted member of Cosi's cult, but she'd prayed to him. And she silently scorned the devout worshipers of those useless figureheads Emeria and Ula. How little she had known! The gods were not gods, and the deceiver Cosi was revealed, with horrific irony, as a sham—a twisted memory of the Eldrazi titan Kozilek, passed down in an idiot's game of whispers. Emeria and Ula, likewise, proved monstrous and deceitful; Cosi, at least, had never pretended to virtue. Perhaps that was why she no longer feared gods, why she had steered this course in direct opposition to an angry deity of the sea. Praying to the gods, she reasoned, was for people who had never fought one. The sea grew lighter around her, and at last she could see the armada she had assembled, massive creatures from a dozen worlds swimming together with the precision of a school of fish. They broke the surface in a boiling mass, and Kiora whooped from the back of her serpent. In the distance, she saw Thassa, in triton form, standing on the deck of the #emph[Monsoon] . She bristled—even if she no longer needed the ship, even if she was happy to let Elspeth and Ajani ride it to the edge of the world, she'd be damned if she'd let Thassa have it. #figure(image("002_Drop for Drop/03.jpg", width: 100%), caption: [Godhunter Octopus | Art by <NAME>], supplement: none, numbering: none) She willed a black, barnacled, titanic squid to surface next to the ship. The #emph[Monsoon ] pitched and rolled in agitation. Arixmethes had had enough jostling from the lesser leviathans, and dove beneath the waves. No matter. She would find him. But she had to deal with Thassa first. Thassa stepped off the deck of the #emph[Monsoon] , and a great wave vaulted the ship-serpent skyward, with Elspeth and Ajani clinging to it. Apparently they'd convinced Thassa to aid them, or at least to send them away. Kiora hoped they made it. They seemed alright, for drywalkers. And as far as she could tell, their mission was a worthwhile one. She waved a quick goodbye as they vanished into the sky and the great wave carried them away. Thassa transformed back into the Great Eye in midair and floated toward Kiora over the water. Water swirled around her as she shifted between shapes—the Eye, a waterspout, a flock of seabirds, and finally her triton form, holding the bident that was her signature weapon and her power over the sea. This…was going to be tough. The sea boiled. More krakens emerged, propelled from seas all over Theros, answering Thassa's call. In the distance, Arixmethes himself breached the water, his black bulk both beautifully sleek and impossibly massive. Even the largest of the other krakens were minnows beside him. He crashed back down, and the sea shuddered. He was perfect. He was also, for the moment, on Thassa's side. "You'll never claim Arixmethes!" cried Thassa. Kiora laughed. #figure(image("002_Drop for Drop/04.jpg", width: 100%), caption: [Thassa, God of the Sea | Art by Jason Chan], supplement: none, numbering: none) She called her titans to her, and Thassa did the same. Thassa had far greater command of the sea itself, so Kiora focused on keeping her own little patch of it stable and let the sea god come to her. She arrayed her krakens around her. Thassa and her attendants rose up on a great wave, Thassa's bident pointed straight at Kiora. A tide of saltwater and flesh crashed into Kiora's army. The serpent Kiora was riding bucked and twisted, snapping at a massive octopus that wrapped strong, slimy tentacles around it. It bit ragged holes in the octopus's body, and the enormous creature fell away into the surf. Distantly, on the edge of the tangle of thrashing serpents, Kiora saw heads pop out of the water—tens, then hundreds. Tritons! How had they come all this way? "Welcome, my children!" bellowed Thassa, in a voice that shook Kiora's bones. "Bear witness to the fall of the pretender!" She'd #emph[brought] them, used no small amount of her strength to pull them through the sea, just so they could see her fight Kiora. Was that just pride? Or was it…need? "You're making an example of me?" yelled Kiora, trusting that the god of the sea itself could hear her through the waves, if not over them. "What's the matter? Has their faith in you flagged so much?" "I will grind you into sand," said Thassa, a voice simmering out of the ocean itself. Did she need their belief? Had Kiora taken that from her? Was that what this was about? If Kiora's little charade on her way to Arixmethes had actually weakened Thassa for their fight…how delicious that would be! Kiora's serpent surged forward through the crush of enormous bodies and choking tentacles, pointed not toward Thassa, but toward Arixmethes. Thassa had to defeat her in order to win. Kiora just had to form a bond with that kraken. She gripped the serpent tightly, trying to balance between lending strength to her forces and saving her own for what was to come. #figure(image("002_Drop for Drop/05.jpg", width: 100%), caption: [Serpent of the Endless Sea | Art by <NAME>anner], supplement: none, numbering: none) The serpent thrashed and twisted, sometimes swimming along the surface like a river-snake, sometimes diving below, even leaping out of the water—anything to get through. And she #emph[was] getting through. Thassa had all the krakens of Theros, minus the few that Kiora had suborned. But Kiora had titans from a dozen worlds, things that Thassa had never seen, never even imagined. Many of them were larger than Thassa's largest children, save Arixmethes. Slowly it dawned on her: #emph[she was winning] . Arixmethes tore his way through the fray, biting Kiora's off-world krakens in half or swallowing them whole, and simply pushing the krakens she had taken from Thassa to one side. He was inexorable, impossible. He was at least as big as Kozilek. Thassa rode atop Arixmethes without holding on, bident in one hand, staying effortlessly on his back as he pushed his way through. Kiora's little serpent, a hundred feet long, was dwarfed before him. Thassa smiled. "Now you will learn," she said, in that same amplified voice, "what it is to defy me." "Happy to teach your followers how it's done!" yelled Kiora. This was it. Kiora stretched out her hand and poured every ounce of strength she had into Arixmethes's ancient, languid thoughts. She felt her other krakens begin to flag, saw a few of them go over to Thassa's side. That didn't matter. Nothing else mattered. Nothing but him. He opened his enormous mouth, big enough to swallow her and her serpent in one bite. She and Thassa were as close as they'd ever been, perhaps a hundred yards apart, and whether through magic or divinity or just an overactive imagination, Kiora could make out every detail of the fury on the god's face. She wouldn't normally try to wrest an animal away from the one who commanded them. It wasn't really her specialty. What she was doing wasn't truly mind magic, more like…instinct magic. And she knew the instincts of the sea better than any others. #emph[You are not mine] , she thought at him. #emph[You are not Thassa] #emph['s. You are your own. And I need your help. Will you come when I call?] His great mouth closed again, and for a moment she dared hope. #emph[Come to me] , she willed him. #emph[I need to get the sense of you] . Nothing happened. The melee around them grew quieter, too many of Kiora's allies killed or brought over to Thassa's command. #emph[Come on] . "You poor fool," boomed Thassa. "You truly thought to steal a kraken from the god of the sea?" Then Kiora's own serpent twisted under her, rolled off to one side. It arced over the fighting animals, dove with astonishing speed downward and outward… …toward the assembled tritons. "No!" cried Kiora. But the serpent she rode was no longer hers to command. She could only watch as the serpent scooped up a mouthful of screaming tritons, devouring dozens in one bite. "You see?" boomed Thassa. "She does not care for you! She cannot harm me, so she lashes out at my faithful." Behind Kiora, half her krakens had turned against her, even those from other worlds. Thassa raised the bident and sent a great wave crashing toward Kiora and her serpent, to whelm them and "protect" her followers. The serpent reared back above the water as the wave sped toward them. Thassa was going to let it take another mouthful of her own followers before the wave hit, just to prove a point. Kiora shook with fury. She pushed her hands against the serpent's great back and willed away, banished it back to the Æther from which it came. She sent more of her krakens with it, the ones that had turned against her. The great body beneath her vanished in a shimmer of turquoise light, and Kiora plunged toward the ocean like a stone, stretching her body out to turn an awkward fall into a smooth dive. #figure(image("002_Drop for Drop/06.jpg", width: 100%), caption: [Voyage's End | Art by <NAME>], supplement: none, numbering: none) The water began, horribly, to recede. Thassa's bident glowed brightly as she pushed back the sea in a great bowl, somewhere between a whirlpool and an arena. The remaining krakens were pushed outside the growing well of water, swirling around, and Thassa's followers became an audience arrayed around a sloping, circular wall of water. "The price of treachery!" cried Thassa. And now her followers cheered her. Kiora fell. She spread her body out, no longer diving but #emph[falling.] She couldn't feel her army. Thassa had bested them, driven them off, or taken them from her. Arixmethes receded into the deep. Below Kiora, the well of air opened onto the blank and pitiless bottom of the sea. She didn't think Thassa was going to let her hit the sea floor—the sea god clearly meant to make a show of it—but she wasn't taking any chances. She reached out with her magic to the newly exposed sea bottom, and did something Thassa couldn't: she pulled roots and vines up out of ground that had never seen the sun, a rush of new growth snapping and creaking to life. She closed her eyes, tucked into a ball, and slammed into the cushion of greenery at high speed, coming to rest upside-down in a tangle of vines just a few feet above the slimy earth. She smiled. She was alive, at least. That was a good start. #figure(image("002_Drop for Drop/07.jpg", width: 100%), caption: [Harrow | Art by <NAME>], supplement: none, numbering: none) Before she could free herself from the vines, a wave of grasping hands made of sea foam rushed through her little forest, tearing the still-green branches apart, ripping the vines, and pulling her out of the greenery. The hands of water deposited her on her knees on the sea-bottom, Thassa's arena towering around her. Behind her, the wall of water surged forward over her forest, drowning it. She stood up, arms and legs covered in gray, oozing mud. The water behind formed a sheer wall, rushing by so quickly she couldn't see through it. Around her rose flat-sided boulders like the teeth of some great serpent, although she was fairly sure they weren't. Thassa's arena had become an amphitheater. Along the sloping wall opposite, Thassa descended, gliding down on a pristine wave. The tritons gathered around their god, sticking out of the wall of seawater in a mass of silent, disapproving faces. "You led my people astray," said Thassa, her voice echoing across the expanse of seafloor. "You stole my children. You besmirched the name of my devotee Callaphe and aided Elspeth, the Betrayer in her quest." #emph[So did you!] thought Kiora, but she didn't bother saying it. Her army was gone. Arixmethes had returned to the depths. She'd had high hopes. But this fight was over. She dove for the wall of rushing water, hoping to get away long enough to planeswalk. Thassa threw her bident, and it sailed through the air with astonishing speed, shrinking as it flew toward her. Kiora twisted in the air, but the bident followed her movement. It slammed into her and pinned her to one of the boulders that littered the sea floor, its prongs fitting snugly around her neck. She lay against the boulder, dazed, the coral-like surface of the bident pressing into her throat. #figure(image("002_Drop for Drop/08.jpg", width: 100%), caption: [Bident of Thassa | Art by Yeong-Hao Han], supplement: none, numbering: none) "Pathetic," said Thassa, her feet coming to rest on a carpet of clean water that flowed before her over the oozing muck. Kiora wrapped her hands around the bident's handle and pulled, but it held fast. She choked and struggled, then went limp. She began to gather mana for one last, desperate spell, and tried to keep Thassa talking. "You're right," she wheezed. She heard her own voice carried out over the seabed to the assembled tritons. "I was a fool to think I could defeat you." "Oh, how kind of you to say!" laughed Thassa. She walked toward Kiora, the carpet of seawater expanding in front of her so her divine feet never touched the slimy sea bottom. "A simple triton is willing to grant that it was ill-advised to anger the god of the seas, who commands every ocean under Nyx!" "There are more oceans than you know," said Kiora. Thassa frowned and gestured, and the bident drove further into the rock. Kiora choked and fell silent. Thassa was close to Kiora now, leaning down, and she spoke for Kiora alone in a voice as cool and mirthless as an ice floe. "What is that supposed to mean?" she asked. "Thh—" said Kiora. Her vision swam. "Thhhh—" Thassa moved one hand dismissively, and the bident's grip on Kiora's throat loosened. Kiora kept her hands wrapped tightly around its handle. "Thanks," whispered Kiora. "For what?" asked Thassa. "The lesson in humility?" Kiora's silent, desperate spell reached its climax. "The bident," she hissed, and melted away into the void, Thassa's weapon still clutched in her hands. The last thing she heard before she slipped between worlds was the anguished cry of an angry god. In the space beyond space, Kiora clutched her stolen prize and laughed.
https://github.com/hugoledoux/msc_geomatics_thesis_typst
https://raw.githubusercontent.com/hugoledoux/msc_geomatics_thesis_typst/main/cover/cover_template.typ
typst
MIT License
#import "@preview/ccicons:1.0.0": * #let cover( title: "", author: "", graduation-year: 2024, graduation-month: "November", supervisor1: "", supervisor2: "", coreader : "", graduation-group: "", serif-fonts: "", sans-fonts: "", ) = { set page( margin: auto, // margin: (left: 30mm, right: 30mm, top: 130mm, bottom: 30mm), numbering: none, number-align: center, ) align(center + horizon)[ #strong(text(1.2em)[MSc thesis in Geomatics]) #v(5em, weak: true) #text(font: sans-fonts, 2em, weight: 600, title) #v(3em, weak: true) #text(1.7em, author) #v(2em, weak: true) #text(1.4em, [#graduation-month #graduation-year]) #v(15em, weak: true) #text(font: sans-fonts, 1.2em, weight: 400, [A thesis submitted to the Delft University of Technology in partial fulfillment of the requirements for the degree of Master of Science in Geomatics]) ] pagebreak() // --- Cover --- align(bottom)[ #author: #emph(title) (#graduation-year) #linebreak() #text(0.9em, [#cc-by This work is licensed under a Creative Commons Attribution 4.0 International License. To view a copy of this license, visit #link("http://creativecommons.org/licenses/by/4.0/").]) #v(7em, weak: true) The work in this thesis was carried out in the: #grid( columns: (auto, auto), align: (bottom, horizon), gutter: 5pt, if graduation-group == "3D geoinformation group" [ #grid.cell( image("../figs/logo_tu3d.svg", width: 50%), ) ] else [ #grid.cell( image("../figs/GDMC-LOGO12.jpg", width: 50%), ) ], grid.cell([#graduation-group #linebreak() Delft University of Technology]) ) #v(5em, weak: true) #grid( columns: (auto, auto), align: (top, top), gutter: 15pt, [Supervisors:], [#supervisor1 #linebreak() #supervisor2], [Co-reader:], [#coreader], ) ] }
https://github.com/Coyenn/thesis-template
https://raw.githubusercontent.com/Coyenn/thesis-template/main/document/template.typ
typst
#import "notes.typ" #let project(title: "", authors: (), body) = { // Main document settings set document( author: authors.map(a => a.name), title: title, ) set page( numbering: "1", number-align: center, paper: "a4", margin: (x: 2.5cm, y: 2.5cm), footer: [ #grid(columns: (100% - 1em, 1em), gutter: 1.5em, place(left, dy: 0%)[#notes.display()], place(right, dy: 0%)[#counter(page).display()] ) ], footer-descent: 0pt, ) set text( font: "Times New Roman", ligatures: true, lang: "en", size: 11pt, hyphenate: false, fill: rgb(57, 58, 66), kerning: true ) set heading( numbering: "1.1" ) // Headings are not affected by par.leading, so we need to set leading here show heading: it => pad(bottom: 0.85em, top: 0.4em, it) // Figures need a slight padding bottom show figure: it => pad(bottom: 0.5em, it) // Set inline code background color show raw.where(block: false): box.with( fill: rgb(240, 240, 240), inset: (x: 3pt, y: 0pt), outset: (y: 3pt), radius: 2pt, ) // Set block code background color show raw.where(block: true): block.with( fill: rgb(240, 240, 240), inset: 10pt, radius: 2pt, width: 100%, ) // Title page align( horizon, align( center, text(2em, weight: 700, title), ) ) // Author information. align( bottom, grid( columns: (1fr), gutter: 1em, ..authors.map(author => align(left)[ *#author.name* \ #link("mailto:" + author.email) ]), ), ) pagebreak() // Table of contents. outline(depth: 3, indent: true) pagebreak() // Set paragraph to fill the page width. set par( justify: true, leading: 1em ) // Main body. body }
https://github.com/fenjalien/metro
https://raw.githubusercontent.com/fenjalien/metro/main/tests/num/group-separator/test.typ
typst
Apache License 2.0
#import "/src/lib.typ": num, metro-setup #set page(width: auto, height: auto) #num[12345] #num(group-separator: ",")[12345] #num(group-separator: " ")[12345]
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/enum-numbering_01.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test full numbering. #set enum(numbering: "1.a.", full: true) + First + Nested
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/spread-00.typ
typst
Other
// Test standard argument overriding. #{ let f(style: "normal", weight: "regular") = { "(style: " + style + ", weight: " + weight + ")" } let myf(..args) = f(weight: "bold", ..args) test(myf(), "(style: normal, weight: bold)") test(myf(weight: "black"), "(style: normal, weight: black)") test(myf(style: "italic"), "(style: italic, weight: bold)") }
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/state_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Make sure that a warning is produced if the layout fails to converge. // Warning: layout did not converge within 5 attempts // Hint: check if any states or queries are updating themselves #let s = state("s", 1) #locate(loc => s.update(s.final(loc) + 1)) #s.display()
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1F030.typ
typst
Apache License 2.0
#let data = ( ("DOMINO TILE HORIZONTAL BACK", "So", 0), ("DOMINO TILE HORIZONTAL-00-00", "So", 0), ("DOMINO TILE HORIZONTAL-00-01", "So", 0), ("DOMINO TILE HORIZONTAL-00-02", "So", 0), ("DOMINO TILE HORIZONTAL-00-03", "So", 0), ("DOMINO TILE HORIZONTAL-00-04", "So", 0), ("DOMINO TILE HORIZONTAL-00-05", "So", 0), ("DOMINO TILE HORIZONTAL-00-06", "So", 0), ("DOMINO TILE HORIZONTAL-01-00", "So", 0), ("DOMINO TILE HORIZONTAL-01-01", "So", 0), ("DOMINO TILE HORIZONTAL-01-02", "So", 0), ("DOMINO TILE HORIZONTAL-01-03", "So", 0), ("DOMINO TILE HORIZONTAL-01-04", "So", 0), ("DOMINO TILE HORIZONTAL-01-05", "So", 0), ("DOMINO TILE HORIZONTAL-01-06", "So", 0), ("DOMINO TILE HORIZONTAL-02-00", "So", 0), ("DOMINO TILE HORIZONTAL-02-01", "So", 0), ("DOMINO TILE HORIZONTAL-02-02", "So", 0), ("DOMINO TILE HORIZONTAL-02-03", "So", 0), ("DOMINO TILE HORIZONTAL-02-04", "So", 0), ("DOMINO TILE HORIZONTAL-02-05", "So", 0), ("DOMINO TILE HORIZONTAL-02-06", "So", 0), ("DOMINO TILE HORIZONTAL-03-00", "So", 0), ("DOMINO TILE HORIZONTAL-03-01", "So", 0), ("DOMINO TILE HORIZONTAL-03-02", "So", 0), ("DOMINO TILE HORIZONTAL-03-03", "So", 0), ("DOMINO TILE HORIZONTAL-03-04", "So", 0), ("DOMINO TILE HORIZONTAL-03-05", "So", 0), ("DOMINO TILE HORIZONTAL-03-06", "So", 0), ("DOMINO TILE HORIZONTAL-04-00", "So", 0), ("DOMINO TILE HORIZONTAL-04-01", "So", 0), ("DOMINO TILE HORIZONTAL-04-02", "So", 0), ("DOMINO TILE HORIZONTAL-04-03", "So", 0), ("DOMINO TILE HORIZONTAL-04-04", "So", 0), ("DOMINO TILE HORIZONTAL-04-05", "So", 0), ("DOMINO TILE HORIZONTAL-04-06", "So", 0), ("DOMINO TILE HORIZONTAL-05-00", "So", 0), ("DOMINO TILE HORIZONTAL-05-01", "So", 0), ("DOMINO TILE HORIZONTAL-05-02", "So", 0), ("DOMINO TILE HORIZONTAL-05-03", "So", 0), ("DOMINO TILE HORIZONTAL-05-04", "So", 0), ("DOMINO TILE HORIZONTAL-05-05", "So", 0), ("DOMINO TILE HORIZONTAL-05-06", "So", 0), ("DOMINO TILE HORIZONTAL-06-00", "So", 0), ("DOMINO TILE HORIZONTAL-06-01", "So", 0), ("DOMINO TILE HORIZONTAL-06-02", "So", 0), ("DOMINO TILE HORIZONTAL-06-03", "So", 0), ("DOMINO TILE HORIZONTAL-06-04", "So", 0), ("DOMINO TILE HORIZONTAL-06-05", "So", 0), ("DOMINO TILE HORIZONTAL-06-06", "So", 0), ("DOMINO TILE VERTICAL BACK", "So", 0), ("DOMINO TILE VERTICAL-00-00", "So", 0), ("DOMINO TILE VERTICAL-00-01", "So", 0), ("DOMINO TILE VERTICAL-00-02", "So", 0), ("DOMINO TILE VERTICAL-00-03", "So", 0), ("DOMINO TILE VERTICAL-00-04", "So", 0), ("DOMINO TILE VERTICAL-00-05", "So", 0), ("DOMINO TILE VERTICAL-00-06", "So", 0), ("DOMINO TILE VERTICAL-01-00", "So", 0), ("DOMINO TILE VERTICAL-01-01", "So", 0), ("DOMINO TILE VERTICAL-01-02", "So", 0), ("DOMINO TILE VERTICAL-01-03", "So", 0), ("DOMINO TILE VERTICAL-01-04", "So", 0), ("DOMINO TILE VERTICAL-01-05", "So", 0), ("DOMINO TILE VERTICAL-01-06", "So", 0), ("DOMINO TILE VERTICAL-02-00", "So", 0), ("DOMINO TILE VERTICAL-02-01", "So", 0), ("DOMINO TILE VERTICAL-02-02", "So", 0), ("DOMINO TILE VERTICAL-02-03", "So", 0), ("DOMINO TILE VERTICAL-02-04", "So", 0), ("DOMINO TILE VERTICAL-02-05", "So", 0), ("DOMINO TILE VERTICAL-02-06", "So", 0), ("DOMINO TILE VERTICAL-03-00", "So", 0), ("DOMINO TILE VERTICAL-03-01", "So", 0), ("DOMINO TILE VERTICAL-03-02", "So", 0), ("DOMINO TILE VERTICAL-03-03", "So", 0), ("DOMINO TILE VERTICAL-03-04", "So", 0), ("DOMINO TILE VERTICAL-03-05", "So", 0), ("DOMINO TILE VERTICAL-03-06", "So", 0), ("DOMINO TILE VERTICAL-04-00", "So", 0), ("DOMINO TILE VERTICAL-04-01", "So", 0), ("DOMINO TILE VERTICAL-04-02", "So", 0), ("DOMINO TILE VERTICAL-04-03", "So", 0), ("DOMINO TILE VERTICAL-04-04", "So", 0), ("DOMINO TILE VERTICAL-04-05", "So", 0), ("DOMINO TILE VERTICAL-04-06", "So", 0), ("DOMINO TILE VERTICAL-05-00", "So", 0), ("DOMINO TILE VERTICAL-05-01", "So", 0), ("DOMINO TILE VERTICAL-05-02", "So", 0), ("DOMINO TILE VERTICAL-05-03", "So", 0), ("DOMINO TILE VERTICAL-05-04", "So", 0), ("DOMINO TILE VERTICAL-05-05", "So", 0), ("DOMINO TILE VERTICAL-05-06", "So", 0), ("DOMINO TILE VERTICAL-06-00", "So", 0), ("DOMINO TILE VERTICAL-06-01", "So", 0), ("DOMINO TILE VERTICAL-06-02", "So", 0), ("DOMINO TILE VERTICAL-06-03", "So", 0), ("DOMINO TILE VERTICAL-06-04", "So", 0), ("DOMINO TILE VERTICAL-06-05", "So", 0), ("DOMINO TILE VERTICAL-06-06", "So", 0), )
https://github.com/howardlau1999/sysu-thesis-typst
https://raw.githubusercontent.com/howardlau1999/sysu-thesis-typst/master/functions/hline.typ
typst
MIT License
#import "../custom.typ": * #let hline(thickness: 1pt) = { line(start: (-50%, 0%), end: (150%, 0%), stroke: thickness + 强调色); }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/nth/0.1.0/README.md
markdown
Apache License 2.0
# Nth Provides a function `#nth()` which takes a number and returns it suffixed by an english ordinal. This package is named after the nth [LaTeX macro](https://ctan.org/pkg/nth) by <NAME>. ## Usage Include this line in your document to import the package. ```typst #import "@preview/nth:0.1.0": nth ``` Then, you can use `#nth()` to markup ordinal numbers in your document. For example, writing `#nth(1)` shows 1<sup>st</sup>, `#nth(2)` shows 2<sup>nd</sup>, `#nth(3)` shows 3<sup>rd</sup>, `#nth(4)` shows 4<sup>th</sup>, and `#nth(11)` shows 11<sup>th</sup>. ## Content This is a very simple package. ```typst #let nth(ordinal-num) = { let ordinal-str = str(ordinal-num) if ordinal-str.ends-with(regex("1[0-9]")) { show: ordinal-str + super("th") } else if ordinal-str.last() == "1" { show: ordinal-str + super("st") } else if ordinal-str.last() == "2" { show: ordinal-str + super("nd") } else if ordinal-str.last() == "3" { show: ordinal-str + super("rd") } else { show: ordinal-str + super("th") } } ``` ## TODO * Pass argument to choose whether or not to put ordinals in superscript.
https://github.com/drupol/master-thesis
https://raw.githubusercontent.com/drupol/master-thesis/main/src/thesis/1-introduction.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: "Introduction", ref: "chapter1", quoteAttribution: <Bacon1928>, quoteText: [ Sine experientia nihil sufficienter sciri potest ], ) == History @Bacon1928, an English philosopher and scientist, articulated in 1267 the foundations of what we today recognise as "reproducibility". He famously stated in Latin #quote("Sine experientia nihil sufficienter sciri potest") which means #quote("Without experience nothing can be sufficiently known") #cite(form: "normal", supplement: [p.583], <Bacon1928>). He was among the first to underscore the significance of repeated experimentation as a means to test and ultimately confirm scientific findings. Although the specific term "reproducibility" was not used in his time, his emphasis on empirical evidence is seen as a precursor to our modern understanding of reproducible research in the scientific method. Centuries later, @kpopper1934, an Austrian-British philosopher wrote a book on the importance of falsifiability in the scientific method. He argued that a scientific theory must be falsifiable in order to be considered valid. He also introduced the concept of #emph[falsificationism], which states that a theory can only be considered scientific if it is possible to conceive of an observation or an argument which proves the theory false. This principle is now widely accepted as a fundamental tenet of the scientific method. @Thompson84 delivered a lecture "Reflections on Trusting Trust" at the Association for Computing Machinery (ACM) Turing Award Banquet. Since his talk, the landscape of software has undergone a radical metamorphosis. The simplicity of his advice to #emph[trust people] has become significantly more complex in the current era. The modern software supply chain is extensive, often encompassing dependencies that lies beneath the surface. Despite the prevalence of open-source software within this supply chain, it is uncommon for end-users to compile their own software. As a result, the build systems became a prime vector for malicious exploitation #cite(<MarcelFourne2023>, form: "normal", supplement: [p.1]). This underscores the vital importance of software reproducibility which ensures that software can be reliably built and verified from its source across different environments and over time, mitigating the risks associated with trust and the potential for exploitation within the software supply chain. @Claerbout1992 wrote about the challenges and implications of reproducibility in the paper titled "Electronic documents give reproducible research a new meaning". This work was in the field of geophysics, but it has been influential across multiple domains of #gls("CS"). It was one of the early works to emphasise that the sharing of software and environments is critical to the reproducibility of computational results. @Collberg2012 has underscored the importance of reproducibility in #gls("SE") by advocating for and funding initiatives that enhance both repeatability and reproducibility. They promote the adoption of standardised practices and transparency in research, which are crucial for ensuring that experiments are repeatable, a foundational aspect of reproducibility. By encouraging comprehensive documentation and public sharing of methodologies, data, and code, they facilitate the replication of work by others, thus enhancing the overall reliability and verification of scientific findings. Their financial support extends to tools and infrastructure that assist in establishing repeatability, which is paramount to achieving reproducibility in broader research. Recognising and rewarding efforts to share research artefacts further embeds a culture where both repeatability and reproducibility are fundamental practices in #gls("SE"), ensuring that studies can not only be repeated under the same conditions but also reproduced and validated in different contexts. In 2020, the United States sustained a sophisticated cyberattack known as SolarWinds. This meticulously orchestrated campaign apparently attributed to Russia persisted undetected for several months and was enabled through a backdoor embedded within one of the dependencies of the SolarWinds Orion (@solarwinds-9579611) software, a network monitoring tool employed by numerous corporations and government agencies. By exploiting this vulnerability, the attackers gained unauthorised access to the networks of SolarWinds clients, which allowed them to steal data and deploy malware. This incident raises a question "How did such a consequential security breach remain unnoticed for months?" and underscores the critical importance of reproducibility in #gls("SE"). Had the SolarWinds Orion software and its dependencies been subject to stringent reproducibility standards, where every build could be precisely recreated and examined, the malicious alterations might have been detected earlier. Reproducibility in this context not only refers to the ability to replicate software builds but also to verify the integrity and provenance of every component, ensuring that no unauthorised changes have been made. By prioritising reproducibility, developers and users of software can enhance security measures, mitigate risks, and foster a more trustworthy digital environment. In a post from the @joinupSignal, institutions like the European Commission and the European Parliament began recommending Signal #cite(<signalApp>, form: "normal"), a secure open-source instant messaging platform, for communications. This highlighted a broader, critical issue: the verification of software authenticity. Users generally trust software obtained from various stores, but this trust brings to the forefront the question of how they can verify with certainty that the version of the Signal application installed on their devices indeed derives directly from the source code provided in its repository. Ensuring an application's authenticity, confirming it has not been tampered with prior to its public release, has become a central concern in our everyday lives. This issue underscores the importance of transparent and reproducible builds where the end product can be reliably traced back to its original source, ensuring the integrity and security of the software being used. During the OpenAI DevDay's keynote #cite(<openAIKeynote2023>, form: "normal") in November 2023, OpenAI's CEO <NAME> unveiled a groundbreaking feature called #emph[reproducible outputs]. This innovation enables users to consistently replicate the outcomes generated by OpenAI's models, marking a significant advancement in achieving reproducibility within the realm of artificial intelligence. Software companies have increasingly recognised the importance of reproducibility for enhancing security. Popular messaging platforms like Signal #cite(<SignalReproducible>, form: "normal") and Telegram #cite(<TelegramReproducible>, form: "normal") have taken significant steps to ensure the reproducibility of their builds. They support reproducible builds, allowing users to verify that the open-source code matches the applications available on various app stores, including the Apple Store and Google Play. This initiative ensures that the distributed binaries are authentic and unaltered, thereby protecting users from potential vulnerabilities and enhancing trust in the software's integrity. By implementing these procedures, software companies highlight the broader industry's move towards transparency and reliability in software distribution, reinforcing the essential role of reproducibility in modern #gls("SE"). In the light of these considerations, this master thesis addresses the aforementioned issues and questions by delving into the principles of software reproducibility. We will explore the mechanisms that can ensure the integrity of software, and examine how these practices can be standardised to safeguard against the risks of unauthorised tampering. In doing so, this thesis aims to contribute to the critical discourse on software security and reliability in an era where digital trust is paramount. == Background Curiosity has always been at the core of my being, fuelling an insatiable eagerness to learn and explore the unknown. I remember myself as an inquisitive boy, constantly delving into the mechanics of how things work. This curiosity often led to disassembling devices to uncover their hidden secrets, followed by a harder quest to reassemble them. While my father played a pivotal role in this journey of discovery, and I simply cannot recall a single moment when he responded with #emph["I don't know"]; it was my mother who truly ignited my path to computers. Her encouragement and unwavering belief in pursuing my passions were instrumental in shaping my journey towards a deeper understanding of the world around me, especially computers. My interest in computers and software development was sparked in my early childhood, before the age of ten with the Logo language, which soon led to my discovery of the BASIC programming language on an Atari 1040STE. The capabilities of that machine captivated my young mind, igniting a passion for technology and its boundless potential. This early fascination was a signpost towards my future; it was clear that my career would be intertwined with computers. Over the years, I witnessed the remarkable evolution of the software industry and the advent of groundbreaking technologies. I have also observed the progression in software development methodologies. However, despite the influx of new technologies arising, there are certain categories of issues that remain constant along the passing years, sadly. Transitioning from BASIC, I briefly jumped on Microsoft Windows before moving to Linux, a platform that has since become my daily driver. In 2019, I found myself grappling with a sluggish laptop running a popular Linux distribution. In search of a faster, binary-based alternative, I transitioned to NixOS, a Linux distribution #cite(<hemel_2024_12906987>,form:"normal") managed by the Nix package manager #cite(<NixOS>, form: "normal"). This shift marked the beginning of a totally new perspective on software development for me. It was through NixOS that I encountered the concept of "reproducibility" which opened my eyes to the possibilities of making and shipping more reliable software. We have seen in the previous section and will detail further in the next chapters that this concept originates from researchers and the scientific method. This concept can be transposed to #gls("CS") and more specifically to software development. In this context, reproducibility is the ability to recreate the exact same software, including the operating system, the compiler, the libraries, and the source code, in order to obtain the same results. For the past three years, the principle of reproducibility has totally revolutionised my approach to software development. This concept has captivated me to such an extent that I now devote a significant portion of my free time to contributing to open-source projects that emphasise reproducible builds. It is this profound interest that has inspired me to dedicate my master's thesis to exploring the depths and implications of reproducibility in #gls("SE"). Here's a non-exhaustive list of projects I have contributed to: - In the Linux NixOS operating system: - I created around 500 pull requests #cite(<drupolPrOnNix>, form: "normal"). - I made around 2050 reviews #cite(<drupolReviewOnNix>, form: "normal"). - After several months of dedicated effort, I developed a wrapper for building reproducible Composer-based PHP applications #cite(<drupolPhpBuilderOnNix>, form: "normal"), resolving a significant obstacle and positioning Nix as the preferred distribution for self-hosting PHP applications. An updated version has been published #cite(<drupolPhpBuilderOnNixV2>, form: "normal"), but introduced instability in the builds. I am currently working on a fix to address the issue. - In the PHP #cite(<php>, form: "normal") community: - In Composer #cite(<composer>, form: "normal"), the PHP package manager, I proposed a pull request enabling deterministic outputs by default #cite(<drupolComposerReproduciblePr>, form: "normal"). - I advocate for reproducibility by giving talks #cite(<drupolIpc2023Talk>, form: "normal"). - I open issues in PHP projects that are not shipping required files to enable reproducibility, explaining the reasons why it should be included: - In PHPUnit, the PHP testing framework #cite(<drupolPhpunitPR5576>, form: "normal")\; - In PsySH, a PHP #gls("REPL", long: false) #cite(<drupolPsyshIssue767>, form: "normal")\; - In GrumPHP, a code quality tool #cite(<drupolGrumphpIssue1095>, form: "normal")\; - In Psalm, a static analysis tool #cite(<drupolPsalmIssue10446>, form: "normal")\; - In PHPMD, a static analysis tool #cite(<drupolPhpmdIssue1056>, form: "normal")\; - In PHP-CS-Fixer, a code formatter #cite(<drupolPhpCsFixerIssue7590>, form: "normal")\; - In PHP-Parallel-Lint, a code linter #cite(<drupolPhpParallelLintIssue153>, form: "normal")\; - I initiated and participated in discussions to improve reproducibility in the PHP source code #cite(<PhpSrcReproduciblePhar>, form: "normal"). - In the Reproducible Builds #cite(<ReproducibleBuildsOrg>, form: "normal") project: - I contributed to the website by making it reproducible #cite(<drupolRBPR102>, form: "normal")\; - I improved the documentation #cite(<drupolRBPR113>, form: "normal") #cite(<drupolRBPR114>, form: "normal")\; - I contributed to the monthly reports #cite(<drupolRBMonthlyReports>, form: "normal")\; - In the Typst #cite(<typst>, form: "normal") project: - I raised awareness about the importance of reproducibility #cite(<typstReproducibleBuildIssue1>, form: "normal")\; - I engaged in discussions on Discord leading to improving the compilation environment hermeticity #cite(<typstReproducibleBuildIssue2>, form: "normal")\; - At work, I advocate the cause of reproducibility, emphasising its critical importance in our projects. The objective is to raise awareness amongst my colleagues about the advantages of reproducibility, with the ultimate aim of establishing it as a norm within our organisational software practices. As an initial measure, I am developing proofs of concept that illustrate the process of creating reproducible containers, embedding their #gls("SBOM") within their metadata. Additionally, I pioneered a project focused on generating ephemeral, reproducible, and tailor-made development environments and user profiles #cite(<devs-profile>, form: "normal"). Finally, I try to provide reproducible development environments for each open-source projects #cite(<ecphpSessions>, form: "normal") we publish to foster a more transparent and secure software development process but also to encourage contributions. - In 2022, I participated in the #emph[Summer of Nix], a paid summer program designed to foster learning, networking, and collaboration within the Nix community. The program caters to both experienced Nix users and newcomers, offering a unique opportunity to work together on a diverse range of topics. During this event, I did a talk about how we use Nix at work #cite(<SoN200PolDellaiera>,form:"normal"). - In a recent YouTube interview on "La Tronche En Biais" #cite(<teb>, form: "normal") , in a live titled "SCIENCES: Une crise de reproductibilité des études?" #cite(<teb-r13y-crisis-lib>, form: "normal"), I briefly discussed the reproducibility crisis in scientific studies and drew parallels with #gls("SE"). I shared insights from my master's thesis on this topic, particularly highlighting the challenges faced when software compiled in one environment fails in another, highlighting broader implications for security and consistency across different systems. I also clarified different levels of reproducibility introduced in @ch2-r13y-levels. == Motivation The pursuit of reproducibility in #gls("SE") is driven by a fundamental quest for precision, reliability, and trust in the digital landscape. In an age where software pervades nearly every aspect of our personal and professional lives, the importance of being able to reliably replicate software builds cannot be overstated. At its core, software reproducibility addresses a simple yet profound question: can we consistently recreate the same software product, with the same functionality and performance, across different environments and over time? This question is not just academic but is deeply rooted in practical necessities and ethical considerations in the field of #gls("CS"), but not only. The principle of reproducibility is essential across various disciplines, ranging from the empirical rigor of scientific experiments to painting or even culinary art. This concept, at its core, is about the ability to consistently replicate results under similar conditions. In cooking, recipes passed down through generations serve as blueprints for recreating cherished family dishes. Despite meticulously following these recipes, achieving the exact taste and texture of an ancestral meal can sometimes be elusive. Factors like cooking temperature, ingredient quality, or even altitude can possibly alter the outcome. This uncertainty in replicating results underscores the complexity and nuances involved in the process of reproducibility. In #gls("CS"), the implications of reproducibility take on a more systemic and critical dimension. Imagine wanting to use or build a software application, ensuring it is identical to what the original developer intended. For instance, this thesis itself is a digital artefact, a #gls("PDF") document derived from source files hosted in a public repository. A pertinent question arises: how can one be sure that the document produced from the source code today will be identical to one compiled a year from now? Ensuring reproducibility in such cases is not just a matter of convenience but a cornerstone for verifying authenticity and integrity in a digital world increasingly prone to misinformation and security threats. Reproducibility in #gls("SE") lies in its potential to enhance reliability and security. Reproducibility aims to eliminate the all-too-common refrain of #emph["it works on my machine!"] by establishing a more robust, consistent build and deployment process. It is about creating a development environment where software, when operational on one machine, can be expected to be built and function identically on another, thereby bridging gaps in consistency and predictability. In a digital era where trust and security are paramount, reproducibility is not merely a technical objective; it is a fundamental criterion for building and maintaining digital trust. One of the driving factors behind this research is the inherent complexity present in modern software environments. Today's software systems are built on intricate layers of dependencies, including various libraries, frameworks, and operating systems. This complexity poses significant challenges in ensuring consistent behaviour of software products across different environments. Moreover, the escalating frequency of security breaches and malicious attacks on software supply chains underscores the critical role of reproducibility. It serves as a vital mechanism for verifying the integrity of software, assuring that it has not been compromised, and maintaining the transparency of the build process. Furthermore, the academic and scientific rigors of #gls("CS") demand a steadfast commitment to reproducibility. In a field where building upon previous work is the norm, the ability to validate and replicate research findings is indispensable. This aspect is particularly crucial in open-source software development, which thrives on community collaboration. The open-source paradigm hinges on the capability of developers around the world to replicate, modify, and contribute to codebases consistently and efficiently. Lastly, the evolving nature of software poses its own set of challenges. Software development is a dynamic process, with systems continually evolving and adapting. Maintaining reproducibility ensures that earlier versions of software can be reliably reconstructed and understood, a critical factor for long-term maintenance, auditing, and compliance. Through this thesis, the aim is to shed light on the significance of software reproducibility, exploring how it can be effectively achieved and the tools and practices that can facilitate this goal. This exploration is not only crucial for the technological advancement but also for upholding the principles of reliability, security, and transparency in an increasingly software-dependent world. == Goals In this master thesis, my primary focus will be to provide a comprehensive overview of reproducible builds, within the sphere of software development, acknowledging that a complete examination of every aspect of reproducibility is beyond our scope. I will explore a selection of tools and methodologies that promote reproducibility or, at least, create favourable conditions for facilitating it. Moreover, this document is intended to enlighten and hopefully convince the reader that the construction of reproducible software should be a fundamental principle, not merely a secondary consideration, within the software development lifecycle. Finally, I will delve into the rationale for adopting this reproducibility paradigm as a standard practice in modern #gls("SE"), with particular emphasis on security implications. By the conclusion of this thesis, the reader will have a comprehensive understanding of the concept of reproducibility and how best practices can be implemented effectively in software development projects. == Structure Organised into several chapters, this thesis systematically explore the multifaceted nature of software reproducibility. - @chapter1 being this introduction, outlining the thesis's scope and objectives. - @chapter2 introduces the origin of the concept of reproducibility, tracing its lineage from scientific principles. It proposes a terminology, formalisms and its challenges. - @chapter3 is a hands-on exploration, delving into specific real-world examples. It will demonstrate practical applications of the concepts discussed in previous chapters, including proof of concept implementations, concrete case studies, and detailed analyses of real-world scenarios where reproducibility plays a crucial role. This chapter aims to bridge theory with practice, showing how the principles of reproducibility are applied and sometimes challenged in real-world settings. - The final @chapter4 synthesises the insights gained throughout the thesis. It offers recommendations for best practices based on the research and discussions presented. Moreover, it suggests directions for future work, identifying areas where further research, development, and discussion are needed to advance the field of software reproducibility.
https://github.com/jomaway/typst-linguify
https://raw.githubusercontent.com/jomaway/typst-linguify/main/docs/docs.typ
typst
MIT License
#import "@preview/linguify:0.4.0": * #import "@preview/gentle-clues:0.7.1": abstract, quote as _quote #let l = [_linguify_] #set text(font: "Rubik", weight: 300) #set heading(numbering: (..args) => {}) //needed for ref to work #show raw.where(block: false): it => { box(fill: luma(240), radius: 5pt, inset: (x: 3pt), outset: (y:3pt), it) } #show link: set text(fill: blue) #show quote.where(block: false): it => { ["] + h(0pt, weak: true) + it.body + h(0pt, weak: true) + ["] if it.attribution != none [ (#it.attribution)] } #let lang_data = read("lang.toml") #set-database(toml("lang.toml")) #let pkginfo = toml("../typst.toml").package // title #align(center, text(24pt, weight: 500)[linguify manual]) #abstract[ #link("https://github.com/jomaway/typst-linguify")[*linguify*] is a package for loading strings for different languages easily. Version: #pkginfo.version \ Authors: #link("https://github.com/jomaway","jomaway") + community contributions \ License: #pkginfo.license ] #outline(depth: 2, indent: 2em) #v(1cm) This manual shows a short example for the usage of the `linguify` package inside your document. If you want to *include linguify into your package* make sure to read the #ref(<4pck>, supplement: "section for package authors"). #pagebreak() = Usage == Basic Example *Load language data file:* #sym.arrow See #ref(<db>, supplement: "database section") for content of `lang.toml` ```typc #set-database(toml("lang.toml")) ``` *Example input:* \ ```typc #set text(lang: "LANG") #smallcaps(linguify("abstract")) === #linguify("title") Test: #linguify("test") ``` #v(1em) #let example(lang, info: none) = (lang,[ #set text(lang: lang) #smallcaps(linguify("abstract")) === #linguify("title") // #lorem(10) Test: #linguify("test") #if (info != none ) [ #set text(style: "italic", fill: blue) *Info*: #info ] ]) #table( columns: 2, inset: 1em, align: (center, start), table.header([*Lang*],[*Output*]), ..example("en"), ..example("de"), ..example("es", info: [The key "test" is missing in the "es" language section, but as we specified a default-lang in the `conf` it will display the entry inside the specified language section, which is "en" in our case. \ To *disable* this behavior delete the `default-lang` entry from the `lang.toml`.]), ..example("cz",info: [As the lang data does not contain a section for "cz" this entire output will fallback to the default-lang. \ To *disable* this behavior delete the `default-lang` entry from the `lang.toml`. ]), ) === Database<db> The content of the `lang.toml` file, used in the example above looks like this. #raw(read("lang.toml")) == Information for package authors.<4pck> As the database is stored in a typst state, it can be overwritten. This leads to the following problem. If you use #l inside your package and use the `set_database()` function it will probably work like you expect. But if a user imports your package and uses #l for their own document as well, he will overwrite the your database by using `set_database`. Therefore it is recommend to use the `from` argument in the `linguify` function to specify your database directly. Example: ```typc // Load data #let lang_data = toml("lang.toml") // Useage #linguify("key", from: lang_data) ``` This makes sure the end user still can use the global database provided by #l with `set_database()` and calling. #sym.arrow Have a look at the #link("https://github.com/jomaway/typst-gentle-clues", "gentle-clues") package for a real live example. == Fluent support Thanks to #link("https://github.com/sjfhsjfh")[sjfhsjfh] we have fluent support. #_quote(title: none)[ Fluent is #quote(attribution: link("https://projectfluent.org/")[Project Fluent])[a localization system for natural-sounding translations. ] ] Heres a simple example of how to use the `linguify` package to load translations from fluent files, which are kept in `L10n` directory and named with the language code, e.g. `en.ftl` and `zh.ftl`. #grid( columns: 2, column-gutter: 1em, [ ```typc // my-document.typ #import "@preview/linguify:0.4.0": * // Define the languages you have files for. #let languages = ("en", "zh") #set_database(eval(load_ftl_data("./L10n", languages))) // Use linguify like described above. = #linguify("title") #set text(lang: "zh") = #linguify("title") // Args are supported as well. #linguify("hello", lang: "en", args: ("name": "Alice & Bob",)) ``` ],[ Folder structure ``` my-project ├── L10n │ ├── en.ftl │ └── zh.ftl │ └── my-document.typ ``` Example for `en.ftl` ```ftl title = A linguify example - with Fluent abstract = Abstract hello = Hello, {$name}! ``` ] ) You have to maintain the language list used in database initialization since Typst currently does not list files in a directory. Of course, you can use an external file to store the language list and load it in the script if it is necessary. #grid( columns: 2, column-gutter: 1em, [ Store config inside a `lang.toml` file. ```toml [conf] default-lang = "en" data-type = "ftl" [ftl] languages = ["en", "de"] path = "./L10n" [ftl.args] name = "Lore" [lang] ``` ], [ Load config inside your document. ```typc #let data = toml("lang.toml") #for lang in data.ftl.languages { let lang_section = read(data.ftl.path + "/" + lang + ".ftl") data.lang.insert(lang, lang_section) } #set_database(data) #linguify("hello") ``` #sym.arrow prints #box(outset:(y: 4pt), inset:(x: 4pt), fill: orange.lighten(60%), radius: 3pt)[Hello, Lore!] ] ) = Contributing If you would like to integrate a new i18n solution into #l, you can set the `conf.data_type` described in the #ref(<db>, supplement: "database section"). And then add implementation in the `get-text` function for your data type. #pagebreak() = Reference #import "@preview/tidy:0.2.0" #let docs = tidy.parse-module(read("../lib/linguify.typ"), name: "Linguify reference") #tidy.show-module(docs, style: tidy.styles.default, show-outline: false, sort-functions: none, )
https://github.com/platformer/typst-algorithms
https://raw.githubusercontent.com/platformer/typst-algorithms/main/test/assertions/assert_nonnegative_indent.typ
typst
MIT License
#import "../../algo.typ": algo, i, d, comment #algo( title: "Fib", parameters: ("n",) )[ if $n < 0$:#i\ return null#d\ if $n = 0$ or $n = 1$:#i #comment[you can also]\ return $n$#d#d #comment[add comments!]\ // excess dedent on this line return #smallcaps("Fib")$(n-1) +$ #smallcaps("Fib")$(n-2)$ ]
https://github.com/fenjalien/metro
https://raw.githubusercontent.com/fenjalien/metro/main/tests/num/rounding/round-direction/test.typ
typst
Apache License 2.0
#import "/src/lib.typ": * #set page(width: auto, height: auto, margin: 1cm) #metro-setup(round-mode: "places") #num(0.054) #num(0.046) #metro-setup(round-direction: "down") #num(0.054) #num(0.046) #metro-setup(round-direction: "up") #num(0.054) #num(0.046)
https://github.com/catarinacps/typst-abnt
https://raw.githubusercontent.com/catarinacps/typst-abnt/main/template/main.typ
typst
MIT License
#import "@preview/typst-abnt:0.1.0": abnt, presets #import presets: ufrgs #show: abnt.with( abstract: lorem(200), preset: ufrgs, course: ufrgs.courses.cic, glossary: ( (key: "abnt", short: "ABNT", long: "Associação Brasileira de Normas Técnicas"), (key: "sbc", short: "SBC", long: "Sociedade Brasileira de Computação") ), references: "refs.bib" ) = Hey #lorem(200) == Testing Stuff! which is. #lorem(100) Very cool! @abnt e também @sbc. Cite Einstein's @einsteinNew1955. = Another Chapter #lorem(20) #figure( table( columns: 4, [t], [1], [2], [3], [y], [0.3s], [0.4s], [0.8s], ), caption: [Timing results.], source: [Some source.] ) <table> Can I cite the @tbl:table? I can! == Section #lorem(200) == Oy #lorem(200)
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/math/delimited.typ
typst
Apache License 2.0
// Test delimiter matching and scaling. --- // Test automatic matching. $ (a) + {b/2} + abs(a)/2 + (b) $ $f(x/2) < zeta(c^2 + abs(a + b/2))$ --- // Test unmatched. $[1,2[ = [1,2) != zeta\(x/2\) $ --- // Test manual matching. $ [|a/b|] != lr(|]a/b|]) != [a/b) $ $ lr(| ]1,2\[ + 1/2|) $ --- // Test fence confusion. $ |x + |y| + z/a| \ lr(|x + |y| + z/a|) $ --- // Test that symbols aren't matched automatically. $ bracket.l a/b bracket.r = lr(bracket.l a/b bracket.r) $ --- // Test half LRs. $ lr(a/b\]) = a = lr(\{a/b) $ --- // Test manual scaling. $ lr(]sum_(x=1)^n x], size: #70%) < lr((1, 2), size: #200%) $ --- // Test predefined delimiter pairings. $floor(x/2), ceil(x/2), abs(x), norm(x)$ --- // Test colored delimiters $ lr( text("(", fill: #green) a/b text(")", fill: #blue) ) $
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/meta/cite-group.typ
typst
Apache License 2.0
// Test citation grouping. --- A#[@netwok@arrgh]B \ A@netwok@arrgh B \ A@netwok @arrgh B \ A@netwok @arrgh. B \ A @netwok#[@arrgh]B \ A @netwok@arrgh, B \ A @netwok @arrgh, B \ A @netwok @arrgh. B \ A#[@netwok @arrgh @quark]B. \ A @netwok @arrgh @quark B. \ A @netwok @arrgh @quark, B. #set text(0pt) #bibliography("/files/works.bib")
https://github.com/rel4team/rel4team.github.io
https://raw.githubusercontent.com/rel4team/rel4team.github.io/main/seL4指北/Rust-seL4 指北.typ
typst
#import "simple-template.typ": * #show: project.with( title: "Rust seL4 指北", authors: ( ( name: "yfblock", // organization: [], email: "<EMAIL>" ), ), abstract: "本文简要介绍了怎么使用 Rust seL4 创建一个简单的应用程序" ) #pagebreak() = 介绍 == Rust seL4 介绍 Rust-seL4@rust-sel4 是帮助 Rust 开发者在用户空间中编写应用程序的包,包括: + seL4 Api 的 bindings + root-task tools. + kernel-loader + 许多用于 seL4 用户空间的 crate + Microkit 工具集的 Rust bindings 下面是通用的 Rust seL4@rust-sel4 crates 介绍。 #figure( table( columns: 2, align: left, table.header( [CrateName],[Description] ), [sel4], [ Straightforward, pure-Rust bindings to the seL4 API.], [sel4-sys], [ Raw bindings to the seL4 API, generated from the libsel4 headers and interface definition files. This crate is not intended to be used directly by application code, but rather serves as a basis for the sel4 crate's implementation.], [sel4-config], [ Macros and constants corresponding to the seL4 kernel configuration. Can be used by all targets (i.e. in all of: application code, build scripts, and build-time tools).], [sel4-platform-info], [ Constants corresponding to the contents of platform_info.h. Can be used by all targets.], [sel4-sync], [ Synchronization constructs using seL4 IPC. Currently only supports notification-based mutexes.], [sel4-logging], [ Log implementation for the log crate.], [sel4-externally-shared], [ Abstractions for interacting with data structures in shared memory.], [sel4-shared-ring-buffer], [ Implementation of shared data structures used in the seL4 Device Driver Framework.], [sel4-async-\*], [ Crates for leveraging async Rust in seL4 userspace.], ), caption: "通用 crates 表" ) 下面是 Runtime Crates: #figure( table( columns: 2, align: left, table.header([CrateName], [Description]), [sel4-root-task], [A runtime for root tasks that supports thread-local storage and unwinding, and provides a global allocator.], [sel4-microkit], [A runtime for seL4 Microkit protection domains, including an implementation of libmicrokit and abstractions for IPC.] ), caption: "用于 Runtime 的 crates 表" ) Rust seL4@rust-sel4 工具。 #figure( table( columns: 2, align: left, table.header([CrateName], [Description]), [sel4-capdl-initializer], [A CapDL-based system initializer.], [sel4-kernel-loader], [A loader for the seL4 kernel, similar in purpose to elfloader.] ), caption: "工具集" ) == Task 介绍 seL4@sel4 中没有进程和线程的明确区分,也没有像宏内核中那样明确的概念,甚至#link("https://docs.sel4.systems/Tutorials/threads.html") 也是使用 `Thread` 来描述任务。 在 seL4@sel4 中创建一个进程就是让一个 TCB 拥有全新的资源,创建一个线程就是让一个 TCB 和另一个 TCB 共享资源。@process-thread-img 中展示了进程和线程的关系,在 seL4@sel4 中创建一个线程就是创建一个新的 TCB 和全新的 _CNode_, _CSpace_, _VSpace_ 等资源。在 seL4@sel4 中没有非常明确的进程的定义,只有逻辑上的进程,同一个进程中的多个线程之间共享资源。 #figure( image("imgs/thread.excalidraw.png", width: 50%), caption: "进程和线程关系图" ) <process-thread-img> 当然每个线程还有其自己独立的上下文结构以及调度优先级。在 seL4@sel4 中已经提供了非常多的 API 来进行 Task 相关的操作。详细的信息将在 @create-thread-ch 中进行描述。 == CSpace 介绍 CSpace 是 seL4@sel4 中的重要概念,CSpace 和 VSpace 不仅名称相似,存储和寻址方式也是非常相似。@cspace-struct-img 中提供了一个 32 位寻址时 CSpace 的一个简单案例。 #figure( image("imgs/cspace.png", width: 90%), caption: "CSpace 结构图" ) <cspace-struct-img> @cspace-struct-img 中给出了一个 CSpace, 这个 CSpace 由三级 CNode 组成,CSpace 中由 A, B, C, D, E, F, G 等 7 个有效的 Capability。这个结构与 VSpace 中的地址空间十分相似。 下面给出一些案例,怎么查找特定的 Capability。下面所有的查找深度都指定为 32。 - *寻找 Cap A* #h(0.5em) 查找地址为 0x06000000,为什么是这个值呢?因为从 L1 CNode Cap 进来,首先是一个 Guard,这个 Guard 是 4bit 也就是一个 16 进制位,而图中的 Guard 是 0,所以就是 0, 然后 Cap A 在 60 处,所以我们拼出的前三个数字就是 060,此时已经找到了 Cap A,后面的地址直接补充为 0 即可,也就是 0x06000000。 - *寻找 Cap B* #h(0.5em) Cap B 和 Cap A 有些差距,因为 Cap B 是在第二级的 CNode 中,虽然看起来有点麻烦,但是聪明的你一定想到了解决的方法。Cap B 的查找地址为 0x00f06000。下面是原因,在 L1 CNode Cap 中 0x0f 中存在一个子 CNode, 图中显示这是 L2 CNode Cap, 但是这只是一个普通的 CNode, 你可以理解为这是一个树状结构。所以要查找 Cap B 首先是在 L1 CNode Cap 中找到 L2 的入口,Guard 是 4bit 0, L2 CNode Cap 在 0x0f 中,所以最高三个十六进制数为 0x00f,然后在 L2 CNode Cap 中查找,L2 CNode Cap 的 Guard 为 4bit 0, Cap B 在 0x60 中。所以查找地址就是 0x00f06000。 - *寻找 Cap C..* #h(0.5em) 这里直接给出答案,过程就让聪明的你自己推敲了。 C: 0x00f00060. D: 0x00f00061 ... == Untyped Memory #pagebreak() = 线程 <create-thread-ch> == RootTask RootTask 是 seL4@sel4 中启动的第一个用户态程序,RootTask 掌握了操作系统所有的资源,RootTask 可以进行资源的分配。*RootTask 在启动的时候只有一级 Slot*,seL4@sel4 默认 CNode 大小只有 12 Bits,也就是只能存放 $2^12$ 个 Slot,而页表是 4k 映射的, 所以 Root-task 的大小最好不要超过 16M,否则需要去改内核的一个 CONFIG_ROOT_CNODE_SIZE_BITS 去扩展 Root Task 的 bits。 === 扩展 Root Task CSpace 默认 root-task 的 CSpace 是一级,只有 12 bits,在我们构建一些大型应用的时候是不够用的。所以需要对 root-task 的 CSpace 进行扩展,扩展为二级的逻辑如下: + 创建一个新的 CNode 作为新的 ROOT CNode + 将原来的 CNode 映射到新的 CNode 中的第一个 Slot,这样能保证扩展后能跟原 CSpace 保持一致 + 更新 rust-seL4@rust-sel4 中规定的 Init CNode Slot + 更新 root-task 的 TCB 中的 CSpace 设置 下面给出代码的示例(`CNODE_RADIX_BITS = 12`): ```rust // 申请一个新的 CNode let cnode = alloc_cap_size_slot::<cap_type::CNode>(CNODE_RADIX_BITS); // 将原来的 CNode 复制新 CNode 的第一个 Slot cnode .relative_bits_with_depth(0, CNODE_RADIX_BITS) .mint( &BootInfo::init_thread_cnode().relative(BootInfo::init_thread_cnode()), CapRights::all(), CNodeCapData::skip(0).into_word(), ) .unwrap(); // 将原来的 Slot 移动到临时的 Slot 中 BootInfo::init_thread_cnode() .relative(BootInfo::null()) .mutate( &BootInfo::init_thread_cnode().relative(BootInfo::init_thread_cnode()), CNodeCapData::skip_high_bits(CNODE_RADIX_BITS).into_word(), ) .unwrap(); // 更新 rust-seL4 中规定的 Init CNode Slot CNode::from_bits(0) .relative(BootInfo::init_thread_cnode()) .mint( &CNode::from_bits(0).relative(cnode), CapRights::all(), CNodeCapData::skip_high_bits(2 * CNODE_RADIX_BITS).into_word(), ) .unwrap(); // 删除临时 Slot BootInfo::init_thread_cnode() .relative(BootInfo::null()) .delete() .unwrap(); // 更新 task 的 CSpace BootInfo::init_thread_tcb().invoke(|cptr, buffer| { buffer.inner_mut().seL4_TCB_SetSpace( cptr.bits(), BootInfo::null().cptr().bits(), cnode.bits(), CNodeCapData::skip_high_bits(2 * CNODE_RADIX_BITS).into_word(), BootInfo::init_thread_vspace().bits(), 0, ) }); ``` 这时 root-task 的 CSpace 已经扩展为两级。使用方式和之前完全一致。如果前 4096 个 Slot 已经使用完毕。下面给出扩展第二个 4096 的方法: ```rust let cnode = alloc_cap_size_slot::<cap_type::CNode>(CNODE_RADIX_BITS); BootInfo::init_thread_cnode() .relative_bits_with_depth(1, CNODE_RADIX_BITS) .mint( &BootInfo::init_thread_cnode().relative(cnode), CapRights::all(), CNodeCapData::skip(0).into_word(), ) .unwrap(); ``` == 创建线程 需要创建一个新的线程需要提供以下资源: - *Priority* 线程的优先级 - *Max control Priority* 线程可控制的最大优先级(即这个线程自己产生的线程所能赋予的最大优先级) - *Registers* 寄存器状态,包括浮点寄存器。(这些默认都会有一个初始值,只需要修改需要修改的就行了) - *VSpace Capability* VSpace 能力 - *VSpace Capability* CSapce 能力 - *fault_endpoint* 一个 EP(endpoint) (当前任务发生错误时,内核会通过这个 EP 发送错误信息) - *IPC_Buffer* IPC Buffer 地址和 Capability === 使用 rust-seL4 库创建任务 根据上面描述的信息,创建一个新的线程需要提供 CNode、VSpace、FaultEP 等资源。 ```rust // 申请任务需要的 Capability let mut task = Sel4Task::new(); let ep = alloc_cap::<cap_type::Endpoint>(); let tcb = alloc_cap::<cap_type::TCB>(); let vspace = alloc_cap::<cap_type::VSpace>(); let root_cnode =alloc_cap_size::<cap_type::CNode>(12); // 配置任务, TIPS: IPC Buffer 为空,不可用 tcb.tcb_configure( ep.cptr(), root_cnode, CNodeCapData::new(0, sel4::WORD_SIZE - 12), vspace, 0, Granule::from_bits(0), )?; // 设置子任务的优先级和控制优先级 // 优先级为 255, 控制优先级为 0 task.tcb .tcb_set_sched_params(sel4::BootInfo::init_thread_tcb(), 0, 255)?; // 设置上下文信息 let mut user_context = sel4::UserContext::default(); *user_context.pc_mut() = todo!("Program Entry"); tcb .tcb_write_all_registers(false, &mut user_context) .unwrap(); // 运行任务 task.tcb.tcb_resume().unwrap(); ``` === 使用再封装的库创建任务 rust-seL4@rust-sel4 提供的接口虽然很丰富,但是直接使用就会很麻烦。因此在 rust-seL4@rust-sel4 上对接口进行再封装迫在眉睫,封装后的 crate 在 https://github.com/rel4team/rust-root-task-demo-mi-dev/blob/docs/crates/task-helper/README.md ```rust // 申请资源 let cnode = alloc_cap_size::<cap_type::CNode>(CNODE_RADIX_BITS); let inner_cnode = alloc_cap_size::<cap_type::CNode>(CNODE_RADIX_BITS); let fault_ep = (alloc_cap::<cap_type::Endpoint>(), 0); let tcb = alloc_cap::<cap_type::TCB>(); let vspace = alloc_cap::<cap_type::VSpace>(); // 创建任务 let mut task = Sel4Task::new(tcb, cnode, fault_ep.0, vspace, fault_ep.1); // 配置任务 task.configure(CNODE_RADIX_BITS)?; // 映射 10 个页表在作为栈 task.map_stack(10); // 设置任务优先级和控制优先级 task.tcb .tcb_set_sched_params(sel4::BootInfo::init_thread_tcb(), 0, 255)?; // 映射 elf 文件到任务的地址空间 task.map_elf(elf_file); // 运行任务 task.tcb.tcb_resume().unwrap(); ``` == 运行任务 在创建任务后,任务默认处于等待运行的状态,如果需要运行程序,需要调用特定的接口操作 TCB。 ```rust tcb.tcb_resume().unwrap(); ``` 即便是再封装的结构体,也可以直接使用封装的 tcb 进行操作。封装的结构体如下 ```rust pub struct Sel4TaskHelper<H: TaskHelperTrait<Self>> { pub tcb: sel4::TCB, pub cnode: sel4::CNode, pub vspace: sel4::VSpace, pub mapped_pt: Arc<NotiMutex<Vec<sel4::PT>>>, pub mapped_page: BTreeMap<usize, sel4::Granule>, pub stack_bottom: usize, pub phantom: PhantomData<H>, } ``` 相关的介绍如 @tcb-helper-field-table 所示,所有的 field 都是 pub,可以直接使用。 #figure( table(columns: 2, align: left, table.header( [FieldName], [Description], ), [tcb], [tcb Capacity 参考 sel4::TCB], [cnode], [cnode Capacity 参考 sel4::CNode], [vspace], [vspace Capacity 参考 sel4::VSpace], [mapped_pt], [已经映射的 PT 结构, 在映射 page_table 的时候需要先映射 pt,映射的 pt 会存放在这里,以便任务结束时释放], [mapped_page], [已经映射的 SmallPage 别名为 Granule,是 map 结构,映射的地址为 key(4k 对齐),page cap 为值], [stack_bottom], [当前栈底,这里适用于初始化栈赋值和更新], [phantom], [对 trait 实现进行存储,参考 rust PhantomData], ) )<tcb-helper-field-table> 当程序运行时发生错误,内核会将错误通过 fault_ep 发送错误信息,其他拥有这个 fault_ep Cap 的任务可以监听错误信息并进行处理。错误发生时 tcb 处于 block 状态,可以再次调用 `tcb_resume` 恢复任务的运行。后面的章节 @missing-page-ch 中将利用缺页错误简单演示这种机制。 == 销毁任务 再 seL4@sel4 中任务的运行非常的简单,同样任务的停止也非常的简单,直接调用 `tcb_suspend` 就可以将任务停止。至于如何再 seL4@sel4 中看到 task 的运行状态,在 seL4@sel4 中有一个用于 debug 的 syscall 存在,但是 rust-seL4@rust-sel4 中并没有提供这个函数的封装,我们可以直接自己构造相应的调用。 下面给出一个 `aarch64` 架构下 `syscall` 的封装。 ```rust /// 发送一个没有参数的 Syscall pub fn sys_null(sys: isize) { unsafe { core::arch::asm!( "svc 0", in("x7") sys, ); } } ``` 只有我们就可以利用这个函数调用 SysCall 了。DebugDumpScheduler 就是我们需要使用的 SysCall,SysCall id 号为 -10,这个 SysCall 能够显示 Scheduler 中的任务信息,@scheduler-img 是一个案例。使用 `sys_null(-10)`, 有三个还没有运行的子任务。 #figure( image("imgs/scheduler.png", width: 80%), caption: "DebugDumpScheduler 显示信息" ) <scheduler-img> 我们就能看到当前 scheduler 的状态,如果一个任务停止了,State 就会变成 Pending,运行状态就是 Running,还没有运行过的程序状态为 inactive,至于 idle,是 scheduler 中没有程序运行时运行的任务。 停止任务只是更改一个任务的 State,那么如何销毁一个任务呢?由于我们是在 seL4@sel4 上运行程序,我们底层已经有了一个操作系统存在,很多事情就不需要我们去做,*我们只需要把当前任务的 TCB 的 Capability 完全删除就可以了(包括派生出来的 Capability )*,当 TCB 完全被销毁时,内核会将 task 从 scheduler 中删除并回收相应的资源。 == 页表映射 在 seL4@sel4 的用户态上映射页表的形式有些独特,seL4@sel4 中映射一个页表需要先映射 table,然后再映射页。下面给出一个映射页的案例(从封装的 task-helper crate 中摘取)。 ```rust for _ in 0..4 { let res: core::result::Result<(), sel4::Error> = page.frame_map( self.vspace, vaddr as _, CapRights::all(), VMAttributes::DEFAULT, ); match res { Ok(_) => { self.mapped_page.insert(vaddr, page); return; } // Error::FailedLookup indicates that here was not a page table. Err(Error::FailedLookup) => { let pt_cap = H::allocate_pt(self); pt_cap .pt_map(self.vspace, vaddr, VMAttributes::DEFAULT) .unwrap(); self.mapped_pt.lock().push(pt_cap); } _ => res.unwrap(), } } ``` 这里采用一个循环来映射页,在 aarch64 里一般使用四级页表,所以需要先映射多个 table,之后才能找到特定的虚拟页。 如果需要给特定的物理页写入内容,不能直接写入,而是需要先将需要写入的物理页映射到一个特定的虚拟页上,然后写入内存,最后取消映射。*需要注意,一个 Frame Capability 只能映射在一个虚拟页上,如果想要多个任务共享一个物理页,就需要将 Capability 进行复制,复制出来的 Capability 可以再次被映射,比如去实现 COW(Copy On Write)。*下面也给出映射 elf 文件的部分代码,同样是从封装的 task-helper 中摘取。 ```rust // 获取或者创建一个新的 Frame Capability let page_cap = match self.mapped_page.remove(&align_page!(vaddr)) { Some(page_cap) => { page_cap.frame_unmap().unwrap(); page_cap } None => H::allocate_page(self), }; // 如果已经读完文件 if offset < end { // 将页表映射到当前 task 以写入数据 page_cap .frame_map( BootInfo::init_thread_vspace(), H::page_seat_vaddr(), CapRights::all(), VMAttributes::DEFAULT, ) .unwrap(); let rsize = cmp::min(PAGE_SIZE - vaddr % PAGE_SIZE, end - offset); // 把数据写入到正确的物理地址 unsafe { core::ptr::copy_nonoverlapping( file.input.as_ptr().add(offset), (H::page_seat_vaddr() + offset % PAGE_SIZE) as *mut u8, rsize, ) } // 取消映射以便后续映射到其他地方 page_cap.frame_unmap().unwrap(); offset += rsize; } // 映射页表到任务中的特定虚拟位置,虚拟地址需要页对齐 self.map_page(align_page!(vaddr), page_cap); // 计算偏移 vaddr += PAGE_SIZE - vaddr % PAGE_SIZE; ``` 上面的代码节选自 task-helper crate 中的 map_elf 函数,上面的逻辑非常简单,就是将一个页映射到特定的虚拟地址上,如果需要写入数据,就先映射到当前的 VSpace 中,然后写入数据。*写入完毕后取消映射*,最后映射到任务的 VSpace 中。 在将物理页映射到当前任务时会将物理页映射到 H::page_seat_vaddr() 处,这是一个页对齐的地址,是一个没有任何物理页映射到的虚拟页,*如果将一个物理页映射到一个已经映射了物理页的虚拟页上,那么并不会覆盖 Capability,而是发生错误。所以最好的做法就是将这个地址放在不可能使用的地方,或者放在程序中,在开始的时候取消映射。* 这里已经将 map_page, map_elf, map_stack 等逻辑进行封装,可以直接使用。 #pagebreak() = IPC 建立和删除 进程间通信(IPC)是用于在进程之间同步传输少量数据和能力的微内核机制。在 seL4@sel4 中,IPC 由称为 EndPoint 的小型内核对象组成,这些对象充当通用通信端口。对 EndPoint 对象的调用用于发送和接收 IPC 消息。 == IPCBuffer rust-seL4@rust-sel4 中 IPCBuffer 的内部结构如下所示,比较需要关心的内容是 `msg`,`tag`和`caps_or_badges`。 ```rust #[repr(C)] pub struct seL4_IPCBuffer_ { pub tag: seL4_MessageInfo_t, pub msg: [seL4_Word; 120usize], pub userData: seL4_Word, pub caps_or_badges: [seL4_Word; 3usize], pub receiveCNode: seL4_CPtr, pub receiveIndex: seL4_CPtr, pub receiveDepth: seL4_Word, } ``` - *tag* 存储了消息的信息,这个需要在使用 EndPoint 传输消息的时候已经有了封装,不用特别操作。 - *msg* 存储了 IPC 需要传递的信息,这个 msg 中单位时 Word 也就是一个字,在 rust 中我们也可以认为是一个 usize。虽然不是 u8,但是我们也可以作为 u8 使用。 - *caps_or_badges* 存储需要发送的 Capability 或者 Badge, 不过还是传递 Capability 比较多一些。 - *userData* 发送的时候携带的额外消息。可以和 *msg* 搭配使用 - *receiveCNode* 当发送方的消息携带 Capability 是,携带的 Capability 将会被写入到特定 CNode 的 Index 下,写入的深度为 Depth。 - *receiveIndex* 同上协作 - *receiveDepth* 同上协作,一般不用关心,默认使用(64) 即可。 上面描述的信息是 seL4@sel4 的 bindings,在 rust-seL4@rust-sel4 中已经提供了更深度的封装。IPCBuffer 被包含在 `IPCBuffer` 内部,在使用 IPCBuffer 时也不推荐直接写入地址。而是使用 rust-seL4@rust-sel4 提供的闭包函数 `with_ipc_buffer`, `with_ipc_buffer_mut` 进行访问。 IPCBuffer 主要函数如 @ipc_buffer-interface-table 所示: #figure( table(columns: 3, table.header( [function], [ReturnType], [Description] ), [msg_regs(&self)], [&[Words]], [获取 msg 作为寄存器 slice], [msg_regs_mut(&mut self)], [&mut [Word]], [获取 msg 作为寄存器 mutable slice], [msg_bytes(&self)], [&[u8]], [获取 msg 并作为普通 buffer slice], [msg_bytes_mut(&mut self)], [&mut [u8]], [获取 msg 并作为普通的 mutable buffer slice], [user_data(&self)], [Word], [获取 IPCBuffer 中的 userData], [set_user_data(&mut self, data: Word)], [], [ 设置 IPCBuffer 中的 userData], [caps_or_badges(&self)], [&[Word]], [获取 caps_or_badges slice], [caps_or_badges_mut(&mut self)], [&mut [Word]], [获取 caps_or_badges mutable slice], [recv_slot(&self)], [AbsoluteCPtr], [获取接收 Capability 的 Slot 的绝对位置], [set_recv_slot(&mut self, slot: &AbsoluteCPtr)], [], [设置接收 Capability 的 Slot 位置] ), caption: "rust-seL4 中 IPCBuffer 封装的接口" )<ipc_buffer-interface-table> rust-seL4@rust-sel4 中已经提供了非常多的封装,已经让我们能够比较方便的在 seL4@sel4 上构建程序,但是不得不说,目前 rust-seL4@rust-sel4 中提供的一些封装无论是一些函数的命名还是操作方式,都让人感觉到十分的迷惑和繁杂。 *在新创建的任务中我们需要使用 IPCBuffer 需要先调用 set_ipc_buffer 设置 ipc_buffer 的地址,然后才能够正常的使用。* == EndPoint 首先我们需要分配一个能够正常使用的 EndPoint。EndPoint 是一个中转站,当任务通过 EndPoint 发送数据时,发送消息的任务会阻塞(也有不阻塞的系统调用),直到 EndPoint 中的数据被另一个任务接收时才继续运行。每个消息都只有一个生产者和一个消费者。 *发送 IPC 的时候需要保证已经正确设置了 IPCBuffer,不仅仅是在创建任务的时候的 tcb_configure,还有进入任务后调用 set_ipc_buffer 设置 ipc_buffer 地址,这同时也要求任务已经正确设置了 TLS 寄存器。因此可以将 TLS 和 IPC_Buffer 看作每个任务都需要设置的必要步骤。*除了一些独特的非常简单的任务不需要设置。 EndPoint 的使用大概有以下两种情况(不考虑非阻塞)。 === S发送 R接收 - *Send* rust-seL4 中使用 `<EndPoint>.send()` 发送数据 - *Recv* 同样的,使用 `<EndPoint>.recv()` 接收数据 发送数据的时候需要传递相应的 Message,再 rust-seL4@rust-sel4 中的类型为 `MessageInfo`。发送任务需要发送相应的 MessageInfo。前几个 MessageLabel 已经被 seL4 作为 Fault 使用,发送时可以尽量将 MessageLabel 放在更高的编号。(如果不把 FaultEP 进行复用就不会有这样的困惑,复用的好处就是只用监听一个 EndPoint,从编程上来说更加方便,可以将多个信息集中在一个 EndPoint 中处理)。 `MessageInfo` 包含以下以下字段 - *MessageLabel* 消息的标签 Label,用于标识消息的类型 - *capsUnwrapped* - *extraCaps* 消息中的 Capability 最大为 3,可以发送多个,但是接收只能同时接收一个 - *length* 消息中寄存器的数量,消息中寄存器和数据是同用一个 Buffer,如果是发送数据将发送数据的长度 / 8 并向上取整。 下面给出一个简单的不包括任务创建部分的案例: ```rust // 任务1 (发送 IPC 的任务) fn thread1(send_ep: EndPoint) { with_ipc_buffer_mut(|buffer| { buffer.msg_regs_mut()[0] = 0x123; }); send_ep.send(MessageInfo::new(7, 0, 0, 1)); } // 任务2 (接收 IPC 的任务) fn thread2(recv_ep: EndPoint) { let (recv_message, _badge) = recv_ep.recv(); assert(recv_message.label() == 7); assert(recv_message.length() == 1); with_ipc_buffer(|buffer| { assert(buffer.msg_regs()[0] == 0x123); }); } ``` 上述案例中,我们在发送的任务 `thread1` 中发送了一个消息,消息中包含了一个寄存器的信息,消息长度为一个寄存器,消息的标签为 7。消息发送后 thread1 阻塞,等待消息被接收。当任务2 调用 recv 时会唤醒 thread1。让其状态从 block 转变为 pending。 接收到的消息会直接把 MessageInfo 返回,额外返回的还有 Badge, badge 是给 Endpoint 添加的一个特殊的标记。即便是从同一个 Endpoint 派生出的 EndPoint 也可以添加不同的标记,在 seL4@sel4 上构建传统操作系统内核的时候可以将这个 badge 设置为任务的 id,或者是任务的唯一标识,方便查找到特定的任务。 === S发送并等待 R接收并回复 在上面的案例中我们提供了一个发送和一个接收的案例,但是上面的情况不能满足我们去让两个任务进行通信的情况,两个任务进行通信一般会有发送消息和回复消息的过程,这里给出一个案例。在发送任务中发送消息并等待,接收任务中接收消息并回复消息。 *rust-seL4@rust-sel4 中回复消息的接口并不是在 EndPoint 这个结构上,而是由一个单独的函数 reply 去使用*,而且尽量在回复消息之前不要调用其他的 IPC 接口,否则可能导致回复消息异常(如果真的需要这么做,可以去找一下 seL4@sel4 中的 saveCaller 机制)。 发送消息并等待的接口不再是上面使用的 `Send`,而是由一个新的接口 `call`, `call` 使用后会发送消息并等待消息的回复,但是 `call` 接收消息和 `recv` 不太一样, `recv` 接收消息的时候会同时接收到一个 `MessageInfo` 和一个 `badge`,但是使用 `call` 发送消息后并接受,返回的内容只有一个 `MessageInfo`,其他的回复消息的过程和发送消息的过程几乎一致。 ```rust // 任务1 (发送 IPC 的任务) fn thread1(send_ep: EndPoint) { with_ipc_buffer_mut(|buffer| { buffer.msg_regs_mut()[0] = 0x123; }); let message = send_ep.call(MessageInfo::new(7, 0, 0, 1)); assert(message.label() == 0); assert(message.length() == 0); } // 任务2 (接收 IPC 的任务) fn thread2(recv_ep: EndPoint) { let (recv_message, _badge) = recv_ep.recv(); assert(recv_message.label() == 7); assert(recv_message.length() == 1); with_ipc_buffer(|buffer| { assert(buffer.msg_regs()[0] == 0x123); }); // 回复消息 with_ipc_buffer_mut(|ipc_buffer| { reply(ipc_buffer, MessageInfo::new(0, 0, 0, 0)) }); } ``` == 传递更多的数据 普通的 IPCBuffer 传输能力有限,如果需要传输更多的数据。可以由下面两个选择 - 将需要传递的信息分块传输,使用多次 IPC 传递需要整个消息。 - 手动去构建共享内存来作为传输媒介,能够传输更多的数据。但是需要考虑好怎么解决抢占的问题。(如果只是两个任务之间传输就不需要考虑这个问题。) #pagebreak() = 缺页处理 <missing-page-ch> 这里我们构建一个缺页处理的案例来对前面描述的内容进行简单的总结. 这里直接给出连接。https://github.com/rel4team/rust-root-task-demo-mi-dev/blob/docs/crates/root-task/src/tests.rs == 测试程序 我们需要构建一个能够触发缺页异常的任务,最简单的构造方案就是创建一个新的任务,给定一个栈指针,但是不为栈分配任何的物理页。在此处当我们运行任务的时候,就会处罚缺页错误。当我们处理完毕后还需要通知为我们处理缺页异常的任务已经运行完毕。 ```rs pub fn test_stack() { let mut stack = [0u8; 0x1001]; stack[0x1000] = 1; unsafe { set_ipc_buffer(IPCBuffer::from_ptr(TaskImpl::IPC_BUFFER_ADDR as _)); } debug_println!("Test Stack Successfully!"); Notification::from_bits(DEFAULT_CUSTOM_SLOT as _).signal(); loop {} } ``` 上面给出的任务中,有些操作是我们必要的,比如初始化 IPCBuffer,我们已经在 IPC 的章节给出过说明,如果我们需要发送 IPC 我们就需要正常初始化 IPCBuffer,这里的 Notification 也是一样,也需要初始化 IPCBuffer,因此我们构建任务的时候就需要初始化 IPCBuffer 和 tls,因为调用 set_ipc_buffer 需要正确可用的 tls。 案例中直接在栈上申请了一个叫做 stack 的数组,大小为 0x1001,且在 0x1000 出写入了一个值,这里必定会触发缺页,然后程序会处于 block 状态,在为这个任务处理缺页异常后,可以调用 resume 让这个任务继续运行。 当程序正常运行后会输出一串字符,并通过 Notification 发送 Signal。 == 管理程序 我们使用已经封装好的 task-helper crate 去创建新的任务,从工程量上来说会小很多,也会方便很多。 ```rs // 申请资源 static TLS_BUFFER: [u8; 0x100] = [0u8; 0x100]; let fault_ep = alloc_cap::<cap_type::Endpoint>(); let cnode = alloc_cap_size::<cap_type::CNode>(CNODE_RADIX_BITS); let inner_cnode = alloc_cap_size::<cap_type::CNode>(CNODE_RADIX_BITS); let noti = alloc_cap::<cap_type::Notification>(); let tcb = alloc_cap::<cap_type::TCB>(); // 省略构建二级 CNode 的部分 // 创建任务 let mut task = Sel4Task::new(tcb, cnode, fault_ep, BootInfo::init_thread_vspace(), 0); // 将 Notification 复制到任务的 CNODE 中 task.abs_cptr(DEFAULT_CUSTOM_SLOT as u64) .copy(&abs_cptr(noti), CapRights::all()) .unwrap(); // 配置任务 task.configure(2 * CNODE_RADIX_BITS).unwrap(); // 不映射任何栈以触发 pagefault task.map_stack(0); // 初始化任务的 IPC_BUFFER task.init_ipc_buffer(); // 设置任务优先级和控制优先级 可忽略 task.tcb .tcb_set_sched_params(sel4::BootInfo::init_thread_tcb(), 255, 255) .unwrap(); // 设置上下文信息(寄存器) let mut context = UserContext::default(); *context.pc_mut() = test_stack as _; *context.sp_mut() = crate::task::TaskImpl::DEFAULT_STACK_TOP as _; context.inner_mut().tpidr_el0 = TLS_BUFFER.as_ptr() as _; task.tcb .tcb_write_all_registers(true, &mut context) .unwrap(); ``` 此处提供了构建一个简单任务的代码,这里省略了构建二级 CSpace 的代码,如果需要找到这部分代码,在本章节的第一段中可以找到相关的链接@missing-page-ch。这里提前创建了一个 Notification 复制到任务的 CSpace,这样新创建的任务和当前任务之间就拥有了可通信的 Notification。这里给子任务提供了 0 个页作为栈,因此进入任务后必然触发缺页异常。最后为新创建的任务设置上下文(寄存器)信息,在写入寄存器的时候调用 `tcb_write_all_registers` 传递的第一个参数为 true,也就是在写入寄存器后将任务的状态更改为可运行。 新任务拥有独立的 CSpace,但是为了简化创建的流程,并未给新任务创建独立的 VSpace,因此新任务和当前任务是共享 VSpace 的。 ```rust // 接受任务的错误信息 let (message, _badge) = fault_ep.recv(()); let fault = with_ipc_buffer(|buffer| sel4::Fault::new(buffer, &message)); // 映射页表以修正缺页错误 match &fault { sel4::Fault::VMFault(fault) => { assert!(fault.addr() > 0xffff0000); task.map_stack(10); task.tcb.tcb_resume().unwrap(); } _ => unreachable!(), } // 等待任务发送的 Notification noti.wait(); // 释放资源 task.tcb.tcb_suspend().unwrap(); drop(task); abs_cptr(cnode).revoke().unwrap(); abs_cptr(cnode).delete().unwrap(); abs_cptr(inner_cnode).revoke().unwrap(); abs_cptr(inner_cnode).delete().unwrap(); abs_cptr(tcb).revoke().unwrap(); abs_cptr(tcb).delete().unwrap(); debug_println!("Missing Page Handled Successfully "); ``` 在任务成功运行后,就可以在当前任务接听绑定在测试程序之上的 Fault EndPoint,当测试程序发生错误时,seL4 会通过 IPC 将错误发送到与 TCB 绑定的 EndPoint 上,然后系统状态更改为 Block,其他拥有这个 Endpoint Capability 的任务可以接收到发送的错误消息,然后进行处理。 这里由于是特定构造的程序,理论上在运行时只会遇到页表缺失的错误。接收到错误后,可以尝试作为 Fault 进行读取,然后进行处理,此处接收到错误后给新任务影射了十个物理页作为栈,然后恢复任务的运行。下面等待新任务运行结束后发送的 signal。在最后给出了回收 Capability 并释放任务的操作。 #pagebreak() = 中断注册、注销 在 seL4@sel4 中注册中断需要通过 irq_control Capability,irq_control 可以创建特定 irq 的 irq_handler,irq_handler 就是针对特定 irq 的 Capability,irq 可以绑定在 notification 上,需要等待中断的时候就调用 notification.wait() 等待。但是 irq_control 默认在 root-task 的 CSpace 中且不可派生,只能转移(也可以搞一些 magic tricks,将所有不可派生的且公共需要的 Capability 放在同一个 CNode 下,然后将CNode进行共享,没有验证过,谨慎尝试,不安全),为了保证各个任务都能够注册自己需要的中断,所以需要让各个任务通过 IPC 与 root-task 进行通信并注册 Capability,注册的方式有两种。 - 将当前空的 Slot Index 传递给 root-task,让 root-task 利用 irq_control Capability 将特定 irq 的 irq_handler 写入到这个 Slot 中。这种情况要求 root-task 掌握了需要注册任务的 CNode,这是常见的情况,也是比较简单的解决方案。 - 另一种解决方案就是将通过 IPC 转移 Capability,需要注册中断处理程序的任务提前设定好接收 Capability 的 Slot,然后发送 IPC 将需要注册的 irq 传递给 root-task,root-task 创建好特定 irq 的 irq_handler 之后将 irq_handler 通过 Capability 传递给发送 IPC 的任务。 下面给出一个简单的案例(采用第一种方式),来注册一个键盘中断,相应的例程可以打开 https://github.com/rel4team/rust-root-task-demo-mi-dev/blob/docs/crates/kernel-thread/src/irq_test.rs 进行查看,这里注册一个键盘中断。 ```rust // 串口中断号 const SERIAL_DEVICE_IRQ: usize = 33; pub fn test_irq() { // 分配一个 slot 来存放 IRQHandler, 虽然指定了 cap_type 但是这个 Slot 依旧为空 let irq_handler = alloc_cap::<cap_type::IRQHandler>(); // 分配一个 notification, 这个真实存在 let notification = alloc_cap::<cap_type::Notification>(); // 从已经有的 Slot 中得到和 root-task 通信的 Endpoint. let ep = LocalCPtr::<cap_type::Endpoint>::from_bits(18); // 发送 IPC 注册中断 ep.call(RootMessageLabel::RegisterIRQ(irq_handler.bits(), SERIAL_DEVICE_IRQ as _).build()); // 将中断绑定在 notification 上 irq_handler .irq_handler_set_notification(notification) .unwrap(); // 响应中断,防止注册前的未处理中断影响 irq_handler.irq_handler_ack().unwrap(); // 等待中断 debug_println!("[Kernel Thread] Waiting for irq notification"); notification.wait(); debug_println!("[Kernel Thread] Received irq notification"); } ``` 上述过程我们申请了一个串口中断,然后通过 IPC 注册了串口中断并等待中断的响应,这个时候只需要按下任意的按键,程序即可继续运行。上述为测试的线程,下面为协助注册的 root-task 中的逻辑。 ```rs loop { let (message, badge) = fault_ep.recv(()); if let Some(info) = RootMessageLabel::try_from(&message) { match info { RootMessageLabel::RegisterIRQ(irq_handler, irq_num) => { BootInfo::irq_control() .irq_control_get(irq_num, &tasks[badge as usize].abs_cptr(irq_handler)) .unwrap(); // Reply message with_ipc_buffer_mut(|buffer| { reply(buffer, MessageInfo::new(0, 0, 0, 0)); }); } ... } } else { let fault = with_ipc_buffer(|buffer| sel4::Fault::new(buffer, &message)); debug_println!("fault {:#x?}", fault) } } ``` 在掌管着 irq_control 的任务中需要一个 Endpoint 与其他需要注册的任务相通,*请保证这些 EndPoint 是由同一个 Endpoint 派生出的。*这里与 FaultEP 共用,所以在使用时也可能接收到的时 Fault IPC,上述逻辑先判断消息是不是 RootMessageLabel 中列出的 IPC,如果是的话,就进行处理。主要逻辑在 irq_control() 处,利用 irq_control_get 生成一个 irq_handler 特定任务的一个 slot 中,这里的 Slot 使用的是绝对位置。需要保证当前 CSpace 中由这个任务的 CNode,使用上面我们提到的 crate 就可以像图中一样使用,不用考虑 CSpace 和 CNode 的问题。 之前提到过发送 IPC 的时候需要在 call 传递参数为一个 MessageInfo,为什么这里有些区别?因为在进行 IPC 的时候步骤比较麻烦,当想要通过 IPC 发送几个参数的时候,第一部就是利用 `with_ipc_buffer_mut` 闭包函数更改 IPCBuffer,将需要发送的参数写入到 IPCBuffer 中,然后再调用 MessageInfo::new 构造 MessageInfo,而且需要手动进行编号,这个过程十分繁琐,当任务和 IPC 的类型比较多时,对 MessageLabel 进行编址就是一项重复且繁琐的事情。可以将这个逻辑进行封装,调用时只需要像调用函数一样将参数和类型写入就行了,得益于 Rust 便捷的枚举类型,这个过程可以变得更加简单和优雅。下面给出 RootMessageLabel 的定义和相关的接口。 ```rs #[repr(usize)] #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum RootMessageLabel { RegisterIRQ(CPtrBits, u64), TranslateAddr(usize), } impl RootMessageLabel { const LABEL_START: u64 = 0x200; /// Try to convert a MessageInfo to a RootMessageLabel pub fn try_from(message: &MessageInfo) -> Option<Self> { // Get the true index for the CustomMessageLabel let label = match message.label() >= Self::LABEL_START { true => message.label() - Self::LABEL_START, false => return None, }; // Convert the true index to a RootMessageLabel enum with_ipc_buffer(|buffer| { let regs = buffer.msg_regs(); match label { 0x0 => Some(Self::RegisterIRQ(regs[0], regs[1])), 0x1 => Some(Self::TranslateAddr(regs[0] as _)), _ => None, } }) } pub fn to_label(&self) -> u64 { let n = match self { Self::RegisterIRQ(_, _) => 0, Self::TranslateAddr(_) => 1, }; Self::LABEL_START + n } pub fn build(&self) -> MessageInfo { const REG_SIZE: usize = core::mem::size_of::<u64>(); let caps_unwrapped = 0; let extra_caps = 0; let mut msg_size = 0; with_ipc_buffer_mut(|buffer| match self { RootMessageLabel::RegisterIRQ(irq_handler, irq_num) => { let regs = buffer.msg_regs_mut(); regs[0] = *irq_handler; regs[1] = *irq_num; msg_size = 2 * REG_SIZE; } Self::TranslateAddr(addr) => { buffer.msg_regs_mut()[0] = *addr as _; msg_size = REG_SIZE; } }); MessageInfo::new(self.to_label(), caps_unwrapped, extra_caps, msg_size) } } ``` 上面的函数依旧可以优化,找出他们的共通之初,然后形成一个 macro 协助统一编址和构建 IPCBuffer。 #bibliography("ref.yml")
https://github.com/jujimeizuo/ZJSU-typst-template
https://raw.githubusercontent.com/jujimeizuo/ZJSU-typst-template/master/contents/abstract.typ
typst
Apache License 2.0
#let abstract_zh = [ 本文设计了一个基于Typst模板的浙江工商大学毕业设计模板,以帮助学生更加方便地完成毕业设计的撰写和排版。该模板采用了现代化的排版设计和易于使用的用户界面,可以帮助学生快速地完成毕业设计的撰写和排版工作。 在设计过程中,我们结合了Typst模板的优秀设计和浙江工商大学毕业设计的要求,对模板进行了优化和适配。该模板包含了毕业设计所需的各种元素,包括封面、摘要、目录、正文、参考文献等。同时,我们还为学生提供了详细的使用说明和技术支持,以帮助他们更加顺利地完成毕业设计的撰写和排版。 本文的研究对于提高浙江工商大学毕业设计的质量和效率具有重要意义。通过设计一个优秀的毕业设计模板,可以使学生更加专注于毕业设计的内容和研究,从而提高毕业设计的质量和水平。同时,该模板还可以帮助学生更加便捷地完成毕业设计的排版和输出工作,提高毕业设计的效率和准确性。 ] #let keywords_zh = ("Typst模板", "浙江工商大学", "本科毕业设计") #let abstract_en = [ In this paper, we design a graduation thesis template based on Typst to help students complete their graduation thesis writing and typesetting more conveniently at Zhejiang Gongshang University. The template adopts modern typesetting design and user-friendly interface, which can help students complete graduation thesis writing and typesetting work quickly. In the design process, we optimized and adapted the template based on Typst's excellent design and the requirements of graduation thesis at Zhejiang Gongshang University. The template includes various elements required for graduation thesis, such as cover, abstract, table of contents, main body, reference, etc. At the same time, we also provide detailed instructions and technical support for students to help them complete the writing and typesetting of graduation thesis more smoothly. The research in this paper is of great significance to improve the quality and efficiency of graduation thesis at Zhejiang Gongshang University. By designing an excellent graduation thesis template, students can focus more on the content and research of graduation thesis, thus improving the quality and level of graduation thesis. At the same time, the template can also help students complete the typesetting and output of graduation thesis more conveniently, thus improving the efficiency and accuracy of graduation thesis. ] #let keywords_en = ("Typst Template", "Zhejiang Gongshang University", "Undergraduate Thesis")
https://github.com/npujol/chuli-cv
https://raw.githubusercontent.com/npujol/chuli-cv/main/modules/header.typ
typst
MIT License
#import "styles.typ": * #let render-socials( socials: () ) = { let columns = () for item in socials { columns.push( [ #item.icon #link(item.link, item.text) ] ) } return columns } #let create-header-info( full-name: [], job-title: [], socials: () ) = { text( font: header-style.fonts, size: header-style.full-name.size, weight: header-style.full-name.weight, full-name ) linebreak() hline() linebreak() text( font: header-style.fonts, size: header-style.job-title.size, weight: header-style.job-title.weight, job-title ) v(header-style.margins.between-info-and-socials) let count-of-socials = socials.len() if(count-of-socials > 1) { table( columns: count-of-socials, inset: 0pt, column-gutter: header-style.socials.column-gutter, align: center, stroke: none, ..render-socials( socials: socials ) ) } } #let create-header-image( profile-photo: "" ) = { if profile-photo != none { set image( height: header-style.profile-photo.image-height, fit: "contain" ) block( width: header-style.profile-photo.width, height: header-style.profile-photo.height, stroke: header-style.profile-photo.stroke, radius: header-style.profile-photo.radius, clip: true, profile-photo ) } }
https://github.com/v411e/optimal-ovgu-thesis
https://raw.githubusercontent.com/v411e/optimal-ovgu-thesis/main/disclaimer.typ
typst
MIT License
#import "components.typ": sans-font, variable-pagebreak #let oot-disclaimer( title: "", international-title: "", author: none, city: " ", is-doublesided: none, lang: "en" ) = { let heading = "Statement of authorship of the student" if (lang == "de") { heading = "Selbstständigkeitserklärung" } text( font: sans-font, size: 2em, weight: 700, heading ) line( start: (0pt, -1.5em), length: 100% ) [Thesis: #title] if (international-title.len() > 0) { [\ (#international-title)] } v(5mm) grid( columns: 2, gutter: 1em, [Name: #author.name], [Surname: #author.surname], [Date of birth: #author.date-of-birth], [Matriculation no.: #author.matriculation-no], ) v(5mm) par(first-line-indent: 0em)[ I herewith assure that I wrote the present thesis independently, that the thesis has not been partially or fully submitted as graded academic work and that I have used no other means than the ones indicated. I have indicated all parts of the work in which sources are used according to their wording or to their meaning. \ I am aware of the fact that violations of copyright can lead to injunctive relief and claims for damages of the author as well as a penalty by the law enforcement agency. ] v(15mm) let signature-line = (length) => { box( line( length: length, stroke: (dash: "loosely-dotted") ) ) } grid( columns: 2, gutter: 0.5em, column-gutter: 1fr, city + ", " + signature-line(3cm)," " + signature-line(5cm) ) variable-pagebreak(is-doublesided) }
https://github.com/touying-typ/touying
https://raw.githubusercontent.com/touying-typ/touying/main/changelog.md
markdown
MIT License
# Changelog ## v0.5.3 ### Features - feat: add `stretch` parameter for `#alternatives[]` function class. This allows us to handle cases where the internal element is a context expression. - feat: add `config-common(align-enum-marker-with-baseline: true)` for aligning the enum marker with the baseline. - feat: add `linebreaks` option to `components.mini-slides`. https://github.com/touying-typ/touying/pull/96 - feat: add `<touying:skip>` label to skip a new-section-slide. - feat: add `config-common(show-hide-set-list-marker-none: true)` to make the markers of `list` and `enum` invisible after `#pause`. - feat: add `config-common(bibliography-as-footnote: bibliography(title: none, "ref.bib"))` to display the bibliography in footnotes. - refactor: add `config-common(show-strong-with-alert: true)` configuration to display strong text with an alert. (small breaking change for some themes) - refactor: refactor `display-current-heading` for preserving heading style in title and subtitle. https://github.com/touying-typ/touying/issues/71 - refactor: make `new-section-slide-fn` function class can receive `body` parameter. We can use `receive-body-for-new-section-slide-fn` to control it. **(Breaking change)** - For example, you can add `#speaker-note[]` for a new section slide, like `= Section Title \ #speaker-note[]`. - If you don't want to append content to the body of the new section slide, you can use `---` after the section title. ### Fixes - fix outdated documentation. - fix bug of `enable-frozen-states-and-counters` in handout mode. - fix unusable `square()` function. https://github.com/touying-typ/touying/issues/73 - fix hidden footer for `show-notes-on-second-screen: bottom`. https://github.com/touying-typ/touying/issues/89 - fix metadata element in table cells. https://github.com/touying-typ/touying/issues/77 https://github.com/touying-typ/touying/issues/95 - fix `auto-offset-for-heading` to `false` by default. - fix uncover/only hides more content than it should. https://github.com/touying-typ/touying/issues/85 - theme(simple): fix wrong title and subtitle. https://github.com/touying-typ/touying/issues/70 ## v0.5.1 & v0.5.2 - Fix somg bugs. ## v0.5.0 This is a significant disruptive version update. Touying has removed many mistakes that resulted from incorrect decisions. We have redesigned numerous features. The goal of this version is to make Touying more user-friendly, more flexible, and more powerful. **Major changes include:** - Avoiding closures and OOP syntax, which makes Touying's configuration simpler and allows for the use of document comments to provide more auto-completion information for the slide function. - The existing `#let slide(self: none, ..args) = { .. }` is now `#let slide(..args) = touying-slide-wrapper(self => { .. })`, where `self` is automatically injected. - We can use `config-xxx` syntax to configure Touying, for example, `#show: university-theme.with(aspect-ratio: "16-9", config-colors(primary: blue))`. - The `touying-slide` function no longer includes parameters like `section`, `subsection`, and `title`. These will be automatically inserted into the slide as invisible level 1, 2, or 3 headings via `self.headings` (controlled by the `slide-level` configuration). - We can leverage the powerful headings provided by Typst to support numbering, outlines, and bookmarks. - Headings within the `#slide[= XXX]` function will be adjusted to level `slide-level + 1` using the `offset` parameter. - We can use labels on headings to control many aspects, such as supporting the `<touying:hidden>` and other special labels, implementing short headings, or recalling a slide with `#touying-recall()`. - Touying now supports the normal use of `set` and `show` rules at any position, without requiring them to be in specific locations. A simple usage example is shown below, and more examples can be found in the `examples` directory: ```typst #import "@preview/touying:0.5.0": * #import themes.university: * #show: university-theme.with( aspect-ratio: "16-9", config-info( title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], logo: emoji.school, ), ) #set heading(numbering: "1.1") #title-slide() = The Section == Slide Title #lorem(40) ``` **Theme Migration Guide:** For detailed changes to specific themes, you can refer to the `themes` directory. Generally, if you want to migrate an existing theme, you should: 1. Rename the `register` function to `xxx-theme` and remove the `self` parameter. 2. Add a `show: touying-slides.with(..)` configuration. - Change `self.methods.colors` to `config-colors(primary: rgb("#xxxxxx"))`. - Change `self.page-args` to `config-page()`. - Change `self.methods.slide = slide` to `config-methods(slide: slide)`. - Change `self.methods.new-section-slide = new-section-slide` to `config-methods(new-section-slide: new-section-slide)`. - Change private theme variables like `self.xxx-footer` to `config-store(footer: [..])`, which you can access through `self.store.footer`. - Move the configuration of headers and footers into the `slide` function rather than in the `xxx-theme` function. - You can directly use `set` or `show` rules in `xxx-theme` or configure them through `config-methods(init: (self: none, body) => { .. })` to fully utilize the `self` parameter. 3. For `states.current-section-with-numbering`, you can use `utils.display-current-heading(level: 1)` instead. - If you only need the previous heading regardless of whether it is a section or a subsection, use `self => utils.display-current-heading(depth: self.slide-level)`. 4. The `alert` function can be replaced with `config-methods(alert: utils.alert-with-primary-color)`. 5. The `touying-outline()` function is no longer needed; you can use `components.adaptive-columns(outline())` instead. Consider using `components.progressive-outline()` or `components.custom-progressive-outline()`. 6. Replace `states.slide-counter.display() + " / " + states.last-slide-number` with `context utils.slide-counter.display() + " / " + utils.last-slide-number`. That is, we no longer use `states` but `utils`. 7. Remove the `slides` function; we no longer need this function. Instead of implicitly injecting `title-slide()`, explicitly use `#title-slide()`. If necessary, consider adding it in the `xxx-theme` function. 8. Change `#let slide(self: none, ..args) = { .. }` to `#let slide(..args) = touying-slide-wrapper(self => { .. })`, where `self` is automatically injected. - Change specific parameter configurations to `self = utils.merge-dicts(self, config-page(fill: self.colors.neutral-lightest))`. - Remove `self = utils.empty-page(self)` and use `config-common(freeze-slide-counter: true)` and `config-page(margin: 0em)` instead. - Change `(self.methods.touying-slide)()` to `touying-slide()`. 9. You can insert visible headings into slides by configuring `config-common(subslide-preamble: self => text(1.2em, weight: "bold", utils.display-current-heading(depth: self.slide-level)))`. 10. Finally, don't forget to add document comments to your functions so your users can get better auto-completion hints, especially when using the Tinymist plugin. **Other Changes:** - theme(stargazer): new stargazer theme modified from [Coekjan/touying-buaa](https://github.com/Coekjan/touying-buaa). - feat: implemented fake frozen states support, allowing you to use numbering and `#pause` normally. This behavior can be controlled with `enable-frozen-states-and-counters`, `frozen-states`, and `frozen-counters` in `config-common()`. - feat: implemented `label-only-on-last-subslide` functionality to prevent non-unique label warnings when working with `@equation` and `@figure` in conjunction with `#pause` animations. - feat: added the `touying-recall(<label>)` function to replay a specific slide. - feat: implemented `nontight-list-enum-and-terms`, which defaults to `true` and forces `list`, `enum`, and `terms` to have their `tight` parameter set to `false`. You can control spacing size with `#set list(spacing: 1em)`. - feat: replaced `list` with `terms` implementation to achieve `align-list-marker-with-baseline`, which is off by default. - feat: implemented `scale-list-items`, scaling list items by a factor, e.g., `scale-list-items: 0.8` scales list items by 0.8. - feat: supported direct use of `#pause` and `#meanwhile` in math expressions, such as `$x + pause y$`. - feat: provided `#pause` and `#meanwhile` support for most layout functions, such as `grid` and `table`. - feat: added `#show: appendix` support, essentially equivalent to `#show: touying-set-config.with((appendix: true))`. - feat: Introduced special labels `<touying:hidden>`, `<touying:unnumbered>`, `<touying:unoutlined>`, `<touying:unbookmarked>` to simplify control over heading behavior. - feat: added basic `utils.short-heading` support to display short headings using labels, such as displaying `<sec:my-section>` as "My Section". - feat: added `#components.adaptive-columns()` to achieve adaptive columns that span a page, typically used with the `outline()` function. - feat: added `#show: magic.bibliography-as-footnote.with(bibliography("ref.bib"))` to display the bibliography in footnotes. - feat: added components like `custom-progressive-outline`, `mini-slides`. - feat: removed `touying-outline()`, which can be directly replaced with `outline()`. - fix: replaced potentially incompatible code, such as `type(s) == "string"` and `locate(loc => { .. })`. - fix: Fixed some bugs. ## v0.4.2 - theme(metropolis): decoupled text color with `neutral-dark` (Breaking change) - feat: add mark-style uncover, only and alternatives - feat: add warning for styled block for slides - feat: add warning for touying-temporary-mark - feat: add markup-text for speaker-note - fix: fix bug of slides ## v0.4.1 ### Features - feat: support builtin outline and bookmark - feat: support speaker note for dual-screen - feat: add touying-mitex function ### Fixes - fix: add outline-slide for dewdrop theme - fix: fix regression of default value "auto" for repeat ### Miscellaneous Improvements - feat: add list support for `touying-outline` function - feat: add auto-reset-footnote - feat: add `freeze-in-empty-page` for better page counter - feat: add `..args` for register method to capture unused arguments ## v0.4.0 ### Features - **feat:** support `#footnote[]` for all themes. - **feat:** access subslide and repeat in footer and header by `self => self.subslide`. - **feat:** support numbered theorem environments by [ctheorems](https://typst.app/universe/package/ctheorems). - **feat:** support numbering for sections and subsections. ### Fixes - **fix:** make nested includes work correctly. - **fix:** disable multi-page slides from creating the same section multiple times. ## Breaking changes - **refactor:** remove `self.padding` and add `self.full-header` `self.full-footer` config. ## v0.3.3 - **template:** move template to `touying-aqua` package, make Touying searchable in [Typst Universe Packages](https://typst.app/universe/search?kind=packages) - **themes:** fix bugs in university and dewdrop theme - **feat:** make set-show rule work without `setting` parameter - **feat:** make `composer` parameter more simpler - **feat:** add `empty-slide` function ## v0.3.2 - **fix critical bug:** fix `is-sequence` function, make `grid` and `table` work correctly in touying - **theme:** add aqua theme, thanks for pride7 - **theme:** make university theme more configurable - **refactor:** don't export variable `s` by default anymore, it will be extracted by `register` function (**Breaking Change**) - **meta:** add `categories` and `template` config to `typst.toml` for Typst 0.11 ## v0.3.1 - fix some typos - fix slide-level bug - fix bug of pdfpc label ## v0.3.0 ### Features - better show-slides mode. - support align and pad. ### Documentation - Add more detailed documentation. ### Refactor - simplify theme. ### Fix - fix many bugs. ## v0.2.1 ### Features - **Touying-reducer**: support cetz and fletcher animation - **university theme**: add university theme ### Fix - fix footer progress in metropolis theme - fix some bugs in simple and dewdrop themes - fix bug that outline does not display more than 4 sections ## v0.2.0 - **Object-oriented programming:** Singleton `s`, binding methods `utils.methods(s)` and `(self: obj, ..) => {..}` methods. - **Page arguments management:** Instead of using `#set page(..)`, you should use `self.page-args` to retrieve or set page parameters, thereby avoiding unnecessary creation of new pages. - **`#pause` for sequence content:** You can use #pause at the outermost level of a slide, including inline and list. - **`#pause` for layout functions:** You can use the `composer` parameter to add yourself layout function like `utils.side-by-side`, and simply use multiple pos parameters like `#slide[..][..]`. - **`#meanwhile` for synchronous display:** Provide a `#meanwhile` for resetting subslides counter. - **`#pause` and `#meanwhile` for math equation:** Provide a `#touying-equation("x + y pause + z")` for math equation animations. - **Slides:** Create simple slides using standard headings. - **Callback-style `uncover`, `only` and `alternatives`:** Based on the concise syntax provided by Polylux, allow precise control of the timing for displaying content. - You should manually control the number of subslides using the `repeat` parameter. - **Transparent cover:** Enable transparent cover using oop syntax like `#let s = (s.methods.enable-transparent-cover)(self: s)`. - **Handout mode:** enable handout mode by `#let s = (s.methods.enable-handout-mode)(self: s)`. - **Fit-to-width and fit-to-height:** Fit-to-width for title in header and fit-to-height for image. - `utils.fit-to-width(grow: true, shrink: true, width, body)` - `utils.fit-to-height(width: none, prescale-width: none, grow: true, shrink: true, height, body)` - **Slides counter:** `states.slide-counter.display() + " / " + states.last-slide-number` and `states.touying-progress(ratio => ..)`. - **Appendix:** Freeze the `last-slide-number` to prevent the slide number from increasing further. - **Sections:** Touying's built-in section support can be used to display the current section title and show progress. - `section` and `subsection` parameter in `#slide` to register a new section or subsection. - `states.current-section-title` to get the current section. - `states.touying-outline` or `s.methods.touying-outline` to display a outline of sections. - `states.touying-final-sections(sections => ..)` for custom outline display. - `states.touying-progress-with-sections((current-sections: .., final-sections: .., current-slide-number: .., last-slide-number: ..) => ..)` for powerful progress display. - **Navigation bar**: Navigation bar like [here](https://github.com/zbowang/BeamerTheme) by `states.touying-progress-with-sections(..)`, in `dewdrop` theme. - **Pdfpc:** pdfpc support and export `.pdfpc` file without external tool by `typst query` command simply.
https://github.com/cadojo/correspondence
https://raw.githubusercontent.com/cadojo/correspondence/main/src/vita/src/references.typ
typst
MIT License
#import "../../rolo/rolo.typ": * #let referencelist = state("referencelist", ()) #let reference( author, ) = { if author != none { let content = [ #stack( dir: ltr, spacing: 1fr, heading(level: 3, fullname(author.name)), address(author).join(", ") ) #stack( dir: ltr, spacing: 1fr, align(left, stack(dir: ttb, spacing: 0.65em, author.roles, author.affiliation.department, author.affiliation.name)), align(right, stack(dir: ttb, spacing: 0.65em, author.email, author.phone, author.url))) ] referencelist.update(current => current + (content,)) } } #let references(header: "References") = { locate( loc => { let referencelist = referencelist.final(loc) if referencelist.len() > 0 { heading(level: 2, text(header)) line(length: 100%, stroke: 1pt + black) referencelist.join() } } ) }
https://github.com/sitandr/mdbook-typst-highlight
https://raw.githubusercontent.com/sitandr/mdbook-typst-highlight/main/README.md
markdown
MIT License
# mdbook-typst-highlight This is a preprocessor for [mdbook](https://github.com/rust-lang/mdBook) that uses [syntect](https://github.com/trishume/syntect) and [Typst syntax for Sublime Text](https://github.com/hyrious/typst-syntax-highlight/tree/main) to produce&_render_ highlighted Typst code. Here is an example of output: ![Example of highlighting](img/image.png) ## Usage Install using `cargo`: ```bash cargo install --git https://github.com/sitandr/mdbook-typst-highlight ``` To add preprocessor to `mdbook`, add this to your `book.toml`: ```toml [preprocessor.typst-highlight] ``` After it, run `mdbook build` or `serve`. That's it. All inline code and blocks with `typ` will be highlighted. ## Settings Currently there are only two settings available: - Whether to highlight inline blocks (default is yes): ```toml [preprocessor.typst-highlight] disable_inline = true ``` - Whether to highlight and render blocks without language specified: ```toml [preprocessor.typst-highlight] typst_default = true ``` # Rendering To enable rendering, just add ```toml [preprocessor.typst-highlight] render = true ``` _Important:_ the binary doesn't include Typst and itself. For rendering to work, you have to get _installed Typst in `PATH`_. Rendered looks like this: ![Example](img/image_2.png) It comes with prelude that sets `width: 300pt`, `margin: 0.5cm` and `height: auto`. To disable it, add `typ-nopreamble` as codeblock language. You can also disable certain blocks (but still highlight them) using `typ-norender`. ## Caching To prevent recompiling large amount of files, all images are cached. To clear images, add `**/typst-src` and `**/typst-img` to `.gitignore` and then run `git clean -d -X -i` (I strictly advise using interactive mode just to make sure you don't delete something necessary).
https://github.com/thornoar/hkust-courses
https://raw.githubusercontent.com/thornoar/hkust-courses/master/MATH1023-Honors-Calculus-I/homeworks/homework-4/main.typ
typst
#import "@local/common:0.0.0": * #import "@local/templates:0.0.0": * #import "@local/theorem:0.0.0": * #let thmstyle = thmstyle.with(base: none) #show: thmrules #let args = (base: none, titlefmt: it => underline(strong(it))) #let lm = statestyle("lemma", "Lemma", ..args) #let def = plainstyle("definition", "Definition", ..args) #let note = plainstyle("note", "Note", ..args) #show: math-preamble("Part 4", "Fri, Oct 4") #math-problem("1.3.2") Prove that if $x_n$ is bounded for sufficiently large $n$, i.e. $abs(x_n) <= B$ for $n >= N$, then $x_n$ is still bounded.\ #math-solution Consider $N$ such that $n >= N$ implies $abs(x_n) <= B$. Let $B' = max{B, abs(x_1), abs(x_2), ..., abs(x_(N-1))}$. For $1 <= n < N$, we have $abs(x_n) <= B'$ by the definition of maximum. For $n >= N$, we have $abs(x_n) <= B'$ since $abs(x_n) <= B <= B'$. Hence, $x_n$ is bounded by $B'$. #math-problem("1.3.5 (2)") Show the convergence of sequences: + $x_n = 1/1^3 + 1/2^3 + 1/3^3 + ... + 1/n^3$; + $x_n = 1/1^2.4 + 1/2^2.4 + 1/3^2.4 + ... + 1/n^2.4$; + $x_n = 1/(1 dot 3) + 1/(3 dot 5) + 1/(5 dot 7) + 1/((2n-1)(2n+1))$ + $x_n = 1/(1 dot 2 dot 3) + 1/(2 dot 3 dot 4) + 1/(3 dot 4 dot 5) + ... + 1/(n(n+1)(n+2))$; + $1/1! + 1/2! + ... + 1/n!$. #math-solution It is obvious that all the given sequences are increasing, so the problem reduces to showing that all these sequences are bounded above. + Since $1/n^3 <= 1/n^2$, we have $ x_n = sum_(k = 1)^n 1/k^3 <= sum_(k = 1)^n 1/k^2 <= 2 - 1/n < 2, $ as has been shown in Example 1.3.1. + Since $1/n^2.4 <= 1/n^2$, the boundedness follows from Example 1.3.1 as above. + Let us write an upper bound: $ x_n = 1/(1 dot 3) + 1/(3 dot 5) + ... + 1/((2n - 1)(2n + 1)) = sum_(k = 1)^n 1/((2k-1)(2k+1)) =\ = 1/2 dot sum_(k = 1)^n 2/((2k-1)(2k+1)) = 1/2 dot sum_(k = 1)^n (1/(2k-1) - 1/(2k+1)) = 1/2 dot (1 - 1/(2n + 1)) <= 1/2. $ + Noting that $1/(n(n+1)(n+2)) <= 1/(n(n+1))$, we write $ x_n = sum_(k = 1)^n 1/(n(n+1)(n+2)) <= sum_(k = 1)^n 1/(n(n+1)) = sum_(k = 1)^n (1/n - 1/(n+1)) = 1 - 1/(n+1) < 1. $ + As we know from the convergence of $n^2/n!$ to zero, $n! > n^2$ for sufficiently large $n$, say, starting at $n = N$. Now, we write the upper bound for $x_n$ (for $n > N$): $ x_n = sum_(k = 1)^n 1/k! = sum_(k = 1)^(N-1) 1/k! + sum_(k = N)^n 1/k! <= x_(N-1) + sum_(k = N)^n 1/k^2 <= x_(N-1) + sum_(k = 1)^n 1/k^2 <= x_(N-1) + 2, $ making use of Example 1.3.1. Now, since $x_n$ is bounded for $n > N$, it is also bounded for all $n$ (see Exercise 1.3.2). #math-problem("1.3.6") Suppose a sequence $x_n$ satisfies $x_(n + 1) = sqrt(2 + x_n)$. + Prove that if $-2 < x_1 < 2$, then $x_n$ is increasing and converges to 2. + Prove that if $x_1 > 2$, then $x_n$ is decreasing and converges to 2. #pagebreak() #math-solution + We will prove by induction that $x_n$ is increasing: $x_(n+1) > x_n$. - Base: $n = 1$. If $x_1 < 0$, then we have $x_1 < 0 < sqrt(2 + x_1) = x_2$. Otherwise, we solve the characteristic inequality: $ x_1 < sqrt(2 + x_1) &<==\ x_1^2 < 2 + x_1 &<==\ x_1^2 - x_1 - 2 < 0 &<==\ (x_1 + 1)(x_1 - 2) < 0&. $ The last inequality holds for all admissible $x_1$, hence so does the inequality $x_1 < x_2$. - Step: $n -> n+1$. As in Example 1.3.2, we have $ x_(n+1) = sqrt(2 + x_n) > sqrt(2 + x_(n-1)) = x_n. $ Now, if $x < 2$, we have $sqrt(2 + x) < sqrt(2 + 2) = sqrt(4) = 2$, meaning that $x_n < 2$ for all $n$ (a trivial proof by induction). Thus, $x_n$ is both increasing and bounded above. Hence $x_n$ has a limit, say $l$. Taking the limit of both sides of $ x_(n+1)^2 = 2 + x_n $ and applying the aruthmetic property, we have $l^2 = 2 + l$ and $l = 2$. + We prove $x_(n+1) < x_n$ analogically by induction: - Base: $n = 1$. We have $ sqrt(2 + x_1) < x_1 &<==\ 2 + x_1 < x_1^2 &<==\ x_1^2 - x_1 - 2 > 0 &<==\ (x_1 + 1)(x_1 - 2) > 0&. $ The last inequality holds for all $x_1 > 2$, and hence so does $x_2 <= x_1$. - Step: $n -> n+1$. By analogy with Example 1.3.2. If $x > 2$, then $sqrt(2 + x) > sqrt(2 + 2) = sqrt(4) = 2$, and so $x_n > 2$ for all $n$. Being decreasing and bounded below, $x_n$ has a limit $l$. Similarly to the previous case, the recursive relation $x_(n+1) = sqrt(2 + x_n)$ leads to $l$ being equal to 2. #math-problem("1.3.12") Explain the _continued fraction expansion_ $ sqrt(2) = 1 + 1/(2 + 1/(2 + 1/(2 + dots.h.c))). $ What if 2 on the right side is changed to some other positive number? #math-solution As in Example 1.3.2, this "infinite fraction" can be thought of as the limit of a recursive sequence, in this case with the property $ x_(n+1) = 1 + 1/(1 + x_n). $ The initial term, $x_1$, we will set to an arbitrary positive number. Our task is to prove that the resulting sequence converges to $sqrt(2)$. First, we see that, since $0 < 1 + 1/(1 + x) < 2$ for all $x > 0$, we have $0 < x_n < 2$ for all $n$ (a trivial proof by induction). That is, the sequence $x_n$ is bounded both above and below. Consider two subsequences of $x_n$: $y_n = x_(2n-1)$ and $z_n = x_(2n)$. If $y_(n+1) <= y_n$, then we have $ y_(n+2) = 1 + 1/(2 + 1/(1 + y_(n+1))) <= 1 + 1/(2 + 1/(1 + y_n)) = y_(n+1). $ Similarly, if $y_(n+1) >= y_n$, then $y_(n+2) >= y_(n+1)$. The same applies to $z_n$. In other words, both $y_n$ and $z_n$ are monotonous. Since they are also bounded, they both have limits, $l_1$ and $l_2$. Both of these numbers have to satisfy the equation $ x = 1 + 1/(2 + 1/(1 + x)), $ by the logic of taking the limit of both sides of the recursive property of $y_n$ and $z_n$. Finally, we see with trivial algebra that the only positive root of this equation is $sqrt(2)$. Hence, $l_1 = l_2 = sqrt(2)$, which means that the original sequence $x_n$, as a union of $y_n$ and $z_n$, converges to $sqrt(2)$. #math-problem("1.3.17") Extend Example 1.3.3 to a proof of $limits(lim)_(n -> oo) n^p a^n = 0$ for $abs(a) < 1$. #math-solution We first tackle the case when $0 <= a < 1$. Denote $n^p a^n$ by $x_n$. Consider the d'Alambertian quotients: $ x_(n+1)/x_n = ((n+1)^p a^(n+1))/(n^p a^n) = a (1 + 1/n)^p. $ <dalam> For sufficiently large $n$ (say, from $n = N$), the last expression in @dalam will be less than $1$, since $a < 1$ and $(1 + 1/n)^p$ converges to 1. Since all $x_n$ are positive, this means that $x_(n+1) < x_n$ starting from $x = N$. In other words, $x_n$ is decreasing for sufficiently large $n$. Since it is also bounded below by $0$, we see that $x_n$ has a limit $l$. We have $ l = lim_(n -> oo) n^p a^n = a dot lim_(n -> oo) ((n/(n-1))^p (n-1)^p a^(n-1)) = a dot lim_(n -> oo)(1 + 1/(n-1))^p dot lim_(n -> oo) (n-1)^p a^(n-1) =\ = a dot 1 dot l = a l, $ from which it follows that $l = 0$, since $a != 1$. If $-1 < a <= 0$, then we see that $-n^p abs(a)^n <= n^p a^n <= n^p a^n$, and the limit follows from the sandwich rule. #math-problem("1.3.19 (2)") Find the limit of $ (1 - 1/n)^n. $ #math-solution We write $ (1 - 1/n)^n = ((n-1)/n)^n = 1/(1 + 1/(n-1))^n = (1/(1 + 1/(n-1))^(n-1))^(n/(n-1)) ->_(n -> oo) (1/e)^1 = 1/e, $ by the arithmetic rule, seeing that $(1 + 1/(n-1))^(n-1) -> e$. #math-problem("1.3.22") If $x_n$ is a Cauchy sequence, is $abs(x_n)$ also a Cauchy sequence? What about the converse? #math-solution It is true. Let $x_n$ be a Cauchy sequence. For proving $abs(x_n)$ to be Cauchy, consider an arbitrary $epsilon > 0$. Then, there is $N$ such that $n, m > N$ implies $abs(x_n - x_m) < epsilon$. However, we have the triangle inequality $ abs(abs(x_n) - abs(x_m)) <= abs(x_n - x_m), $ and thus we have $ abs(abs(x_n) - abs(x_m)) <= abs(x_n - x_m) < epsilon $ for $n,m > N$. Hence, $abs(x_n)$ is Cauchy. The converse fails, as can easily be seen from the example of $x_n = (-1)^n$. #math-problem("1.3.23 (1,3)") Use the Cauchy criterion to determine the convergence or divergence of 1. $ x_n = 1 + 1/sqrt(2) + 1/sqrt(3) + ... + 1/sqrt(n); $ 3. $ x_n = 1/2 + 2/3 + 3/4 + dots.h.c + (n-1)/n. $ #math-solution 1. With $epsilon = 1/sqrt(2)$, for any $N$ consider $n = N$ and $m = N$. We have $ x_m - x_n = x_(2N) - x_N = 1/sqrt(N+1) + 1/sqrt(N+2) + dots.h.c + 1/sqrt(2N) >= N dot 1/sqrt(2N) = sqrt(N/2) >= epsilon, $ and shus the Cuchy criterion fails. 3. For all $n > 1$, we have $(n-1)/n >= 1/2$. Now, take $epsilon = 1/2$ and for all $N$ take $n = N$ and $m = N+1$. We write $ x_m - x_n = x_(N+1) - x_N = N/(N+1) >= 1/2 = epsilon, $ and thus the Cauchy criterion fails. #math-problem("1.4.2") Prove that $limits(lim)_(n -> oo) x_n = +oo$ if and only if $x_n > 0$ for sufficiently large $n$ and $limits(lim)_(n -> oo) 1/x_n = 0$. #math-solution / $==>:$: Since $x_n > B$ for sufficiently large $n$, this also applies for $B = 0$, meaning that $x_n > 0$ for sufficiently large $n$. Then, for all $epsilon > 0$, we have $x_n > 1/epsilon$ for sufficiently large $n$, and thus $1/x_n < epsilon$. Therefore, $1/x_n$ converges to 0. / $<==:$: Let $B$ be a real number. If $B <= 0$, we have $x_n > 0 >= B$ for sufficiently large $n$. If $B > 0$, then there is $N$ such that $n > N$ implies $1/x_n < 1/B$, or $x_n > B$. Hence, $x_n$ diverges to $+oo$. #math-problem("1.4.3 (1,3)") Rigorously prove divergence to infinity. Determine $plus.minus oo$ if possible: 1. $ x_n = (n^2 - n + 1)/(n+1); $ 3. $ x_n = a^n/n, #h(5mm) abs(a) > 1. $ #math-solution 1. We have $ (n^2 - n + 1)/(n+1) = n - (2n - 1)/(n+1) > n - 2, $ which is greater than any $B$ chosen in advance, for sufficiently large $n$. Hence, the sequence diverges to $+oo$. 3. We first tackle the case where $a > 0$. Consider $y_n = 1/x_n = n (1/a)^n$. Since $abs(1/a) < 1$, we see that $y_n ->_(n -> oo) 0$ as per Exercise 1.3.17. Moreover, $y_n$ is obviously positive for all $n$. Thus, by Exercise 1.4.2 we have that $x_n$ diverges to $+oo$. If $a < 0$, then the subsequences of odd and even terms, $x_(2n-1)$ and $x_(2n)$, diverge to $-oo$ and $+oo$ respectively, which is seen by applying the logic of the previous case. Hence, the sequence $x_n$ diverges to $oo$, but the sign cannot be determined. #math-problem("1.4.6 (2)") Prove the extended arithmetic rule $l + (+oo) = +oo$.\ #math-solution Let $x_n ->_(n -> oo) l in RR$ and $y_n ->_(n -> oo) +oo$. We are tasked with proving that $(x_n + y_n) ->_(n -> oo) +oo$. Let $B in RR$ be arbitrary. For sufficiently large $n$, we have $x_n > l-1$ and $y_n > B - (l-1)$. Hence, $ x_n + y_n > l-1 + B - (l-1) = B, $ q.e.d. #math-problem("1.4.7") Construct sequences $x_n$ and $y_n$, such that both diverge to infinity, but $x_n + y_n$ can have any of the following behaviors: + $limits(lim)_(n -> oo) (x_n + y_n) = oo$; + $limits(lim)_(n -> oo) (x_n + y_n) = 2$; + $x_n + y_n$ is bounded but does not converge. #math-solution + Take $x_n = y_n = (-1)^n n -> oo$. We have $x_n + y_n = 2 dot (-1)^n n -> oo$. + Take $x_n = n -> +oo$, #h(2mm) $y_n = 2-n -> -oo$. Their sum equals $2$ for all $n$ and thus converges to $2$. + Take $x_n = n -> +oo$, #h(2mm) $y_n = -n + (-1)^n < -n+1 -> -oo$. Then, $x_n + y_n = (-1)^n$, which is bounded but does not converge. #math-problem("1.4.10") Prove the extended orger rule: If $limits(lim)_(n -> oo) x_n = l in RR$ and $limits(lim)_(n -> oo) y_n = +oo$, then $x_n < y_n$ for sufficiently large $n$.\ #math-solution For sufficiently large $n$ (say, for $n > N_1$), we have $abs(x_n - l) < 1$ and thus $x_n < l + 1$. Also, for sufficiently large $n$ (say, for $n > N_2$) we have $y_n > l+1$. Then, for $n > max(N_1, N_2)$ $ x_n < l+1 < y_n, $ q.e.d. #math-problem("1.4.12") Prove that $limits(lim)_(n -> oo) x_(n+1)/x_n = l$ and $abs(l) > 1$, then $x_n$ diverges to infinity.\ #math-solution // Consider the sequence $y_n = abs(x_n)$. We easily see that $ limits(lim)_(n -> oo) abs(x_(n+1))/abs(x_n) = limits(lim)_(n -> oo) abs(x_(n+1)/x_n) = abs(l) > 1. $ Hence, by the order rule, we have $abs(x_(n+1))/abs(x_n) > a > 1$ for sufficiently large $n$, where $1 < a < abs(l)$. Say that this holds for $n > N$. Then, for such $n$, we can write $ abs(x_n) = abs(x_N) dot abs(x_(N+1))/abs(x_N) dot ... dot abs(x_n)/abs(x_(n-1)) > abs(x_N) dot a^(n - N) -> +oo. $ Therefore, we see that $abs(x_n)$ diverges to $+oo$, and thus $x_n$ diverges to $oo$. #math-problem("1.4.13 (2, 4)") Explain the infinities. Determine the sign if possible. 2. $x_n = n!/(a^n + b^n)$, #h(2mm) $a + b != 0$; 4. $x_n = 1/(root(n, n) - root(n, 2n))$. #math-solution 2. Consider $y_n = 1/x_n = a^n/n! + b^n/n!$. We see that $y_n ->_(n -> oo) 0$, meaning that $x_n$ diverges to $oo$ by the extended arithmetic rule. Now, assume without loss of generality that $abs(a) >= abs(b)$. If $a > 0$, then $a^n + b^n > 0$ for sufficiently large $n$, and $x_n ->_(n -> oo) +oo$. If $a < 0$, then for odd $n$ we have $a^n + b^n < 0$, and thus the sign cannot be determined. 4. Since $ y_n = 1/x_n = root(n,n) - root(n,2n) ->_(n -> oo) 1 - 1 = 0, $ we have $x_n ->_(n -> oo) oo$ by the extended order rule. Further, we see that $y_n < 0$ for all $n$, meaning that $x_n < 0$ and thus $x_n ->_(n -> oo) -oo$.
https://github.com/noahjutz/AD
https://raw.githubusercontent.com/noahjutz/AD/main/uebungen/5/heapsort.typ
typst
#import "heap.typ": heap #let nums = (23, 19, 17, 12, 13, -5, -32, 7, -35, -3) #let step(x, y, nums, n) = heap( nums, hl_success: range(n, nums.len()), swaps: ((x, y),), annotations: ((x, `i`),), detached: range(n, nums.len()) ) #let heapify_root(nums, n) = { if n <= 1 { return (nums, ()) } let return_content = () let queue = (0,) while queue.len() > 0 { let i = queue.remove(0) let max = (i, 2*i+1, 2*i+2) .sorted(key: i => { if i < n { nums.at(i, default: -calc.inf) } else {-calc.inf} }) .last() return_content.push(step(i, max, nums, n)) ( nums.at(i), nums.at(max) ) = ( nums.at(max), nums.at(i) ) if i != max { queue.push(max) } } return (nums, return_content) } #let heaps = () #let n = nums.len() #while n > 0 { heaps.push(box[ #heap( nums, swaps: ((0, n - 1),), hl_success: range(n, nums.len()), detached: range(n, nums.len()) ) #place(top + left)[swap] ]) (nums.at(0), nums.at(n - 1)) = (nums.at(n - 1), nums.at(0)) let (numbers, h) = heapify_root(nums, n - 1) nums = numbers heaps += h.map(h => box[ #h #place(top + left)[heapify] ]) n -= 1 } #heaps.push(box[ #heap( nums, hl_success: range(nums.len()), detached: range(nums.len()) ) #place(top + left)[sortiert #sym.checkmark] ]) #grid( columns: (1fr,)*2, column-gutter: 4pt, row-gutter: 8pt, align: bottom, ..heaps.map(scale.with(50%, reflow: true)) )
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/linebreak-link_01.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page #set page(width: 240pt) #set par(justify: true) Here's a link https://url.com/data/extern12840%data_urlenc and then there are more links #link("www.url.com/data/extern12840%data_urlenc") in my text of links http://mydataurl/hash/12098541029831025981024980124124214/incremental/progress%linkdata_information_setup_my_link_just_never_stops_going/on?query=false
https://github.com/max-niederman/CS250
https://raw.githubusercontent.com/max-niederman/CS250/main/notes/2023-09-28_graphs.typ
typst
#import "../lib.typ": * #show: lecture-notes.with( date: "2023-09-28", topic: "Graphs" ) = Formal Definition of Graphs A graph $G = (N, A, g)$ consists of a set of nodes $N$, a set of arcs $A$, and a function $g: A arrow {{n, n'} | n, n' in N}$ that maps each arc to the unordered pair of nodes it connects. A directed graph (digraph) consists of a set of nodes $N$, a set of arcs $A$, and a function $g: A arrow N times N$ that maps each arc to the ordered pair of nodes it connects. = Terminology == Undirected / Adjacent: Two nodes are adjacent if an arc connects them. / Degree: The degree of a node is the number of arcs incident to it. / Isolated node: A node with degree $0$. / Loop: An arc that connects a node to itself. / Parallel arcs: Two or more arcs that connect the same two nodes. / Complete graph: A graph in which every pair of distinct nodes is adjacent. / Subgraph: A graph $G' = (N', A', g)$ is a subgraph of $G = (N, A, g)$ iff $N' subset.eq N$ and $A' subset.eq A$. / Path: A sequence $n_0, a_0, n_1, a_1, ..., n_(k-1), a_(k-1), n_k$ of alternating nodes and arcs such that $g(a_i) = {n_i, n_(i+1)}$ (or $(n_i, n_(i+1))$ for digraphs) for $0 <= i < k$. The *length* of a path is the number of arcs it contains, and a node $e$ is *reachable* from a node $s$ if there is a path from $s$ to $e$. / Cycle: A path connecting a node to itself which does not contain any other cycles. / Connected: A graph is connected if every node is reachable from every other node; i.e., if there is a path between every pair of nodes. == Directed / In-degree: The number of arcs that terminate at a node. / Out-degree: The number of arcs that originate at a node. = Notation - The *degree* of a node $v$ is denoted by $d(v)$. - The *in-degree* of a node $v$ is denoted by $d^-(v)$. - The *out-degree* of a node $v$ is denoted by $d^+(v)$. = Trees A *tree* is a connected graph with no cycles, and one node designated as the *root* of the tree. The *height* of a tree is the length of the longest path from the root to a leaf. A *forest* is an acyclic graph, but is not necessarily connected. Forests are collections of trees, because each connected subgraph of a forest is a tree. The *level* of a node in a tree is the length of the path from the root to that node. / Full binary tree: All internal nodes have two children and all leaves have the same level. / Complete binary tree: All levels are full except possibly the last, which is filled from left to right. == Traversal / Pre-order: Visit the root, then recursively visit the left subtree, then recursively visit the right subtree. / In-order: Recursively visit the left subtree, then visit the root, then recursively visit the right subtree. / Post-order: Recursively visit the left subtree, then recursively visit the right subtree, then visit the root.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/chordx/0.3.0/CHANGELOG.md
markdown
Apache License 2.0
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [v0.3.0](https://github.com/ljgago/typst-chords/compare/v0.2.0...v0.3.0) - 2024-03-01 ### Changed - Renamed `frets` parameter by `frets-amount`. - Renamed `fret-number` parameter by `fret`. - Renamed `color` parameter by `fill`. - Replaced `scale` parameter by `size`. You can use the same functionality using `em` units. - Replaced new types released in Typst v0.8.0. ## [v0.2.0](https://github.com/ljgago/typst-chords/compare/v0.1.0...v0.2.0) - 2023-08-25 ### Added - New file structure. - New piano chords. - Options to scale the graphs. - New round style. ### Changed - Renamed new-graph-chords to new-chart-chords. - Replaced array inputs by string inputs (thanks to `conchord` for the ideas). ### Removed - Removed dependency of CeTZ, uses only native functions. ## [v0.1.0](https://github.com/ljgago/typst-chords/compare/v0.1.0...v0.1.0) - 2023-07-16 ### Added - Added graph chords. - Added single chords. ### Changed - The single chords show the chord name over a specific character or word.
https://github.com/TechOctopus/typst-fiit-template
https://raw.githubusercontent.com/TechOctopus/typst-fiit-template/main/README.md
markdown
Creative Commons Attribution 4.0 International
# This is a template for assignments in FIIT STU written in typst language. ## Example of usage ```typst #import "template.typ": * #show: project.with( title: "Project title", subtitle: "Project subtitle", academic-year: [2024/2025], author: ( name: "<NAME>", email: "<EMAIL>", id: "000000" ), logo: "logo_fiit.svg", affiliation: ( university: "Slovak University of Technology in Bratislava", faculty: "Faculty of Informatics and Information Technologies", ), assignment: ( subject: "Some subject", practitioners: "Some practitioners", exercise_time: "St: 15:00 - 16:50", ), ) ``` ![Example](example.jpg)
https://github.com/Krsnik/typst-nix
https://raw.githubusercontent.com/Krsnik/typst-nix/main/README.md
markdown
# Typst-nix A nix library to develop and build [Typst](https://typst.app/) projects.
https://github.com/colinstfni/ba1-heig
https://raw.githubusercontent.com/colinstfni/ba1-heig/main/README.md
markdown
# Notes de cours BA1 HEIG-VD 2024-25 Vous trouverez peut-être votre bonheur dans ce bordel organisé, qui sait ? Les notes de cours sont rédigées en [Typst](https://typst.app) et des versions compilées sont disponibles [ici](/pdfs). Le repository contient également des exercices dans le submodule `exos`. Pour les cloner en même temps que ce repo, utilisez la commande suivante : ```bash git clone --recurse-submodules ```
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/edge-00.typ
typst
Other
#set page(width: 160pt) #set text(size: 8pt) #let try(top, bottom) = rect(inset: 0pt, fill: green)[ #set text(font: "IBM Plex Mono", top-edge: top, bottom-edge: bottom) From #top to #bottom ] #try("ascender", "descender") #try("ascender", "baseline") #try("cap-height", "baseline") #try("x-height", "baseline") #try(4pt, -2pt) #try(1pt + 0.3em, -0.15em)
https://github.com/jgm/typst-symbols
https://raw.githubusercontent.com/jgm/typst-symbols/main/CHANGELOG.md
markdown
MIT License
# Revision history for typst-symbols ## 0.1.7 * Update to typst 0.12. ## 0.1.6 * Update to typst 0.11. ## 0.1.5 * Update to typst 0.9. ## 0.1.4 * Add Typst.Shorthands with symbol shorthand table. ## 0.1.3.1 * Fix symbol-scraping script and symbols for typst 0.7. ## 0.1.3 * Update symbols for typst 0.7. ## 0.1.2 * Update symbols for typst 0.6. ## 0.1.1 * Update symbols for typst 0.5 * Relax lower bound of `base`. ## 0.1.0.1 * Relax lower bound of `base` to 4.12. ## 0.1.0.0 * Initial release.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-0870.typ
typst
Apache License 2.0
#let data = ( ("ARABIC LETTER ALEF WITH ATTACHED FATHA", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED TOP RIGHT FATHA", "Lo", 0), ("ARABIC LETTER ALEF WITH RIGHT MIDDLE STROKE", "Lo", 0), ("ARABIC LETTER ALEF WITH LEFT MIDDLE STROKE", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED KASRA", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED BOTTOM RIGHT KASRA", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED ROUND DOT ABOVE", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED RIGHT ROUND DOT", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED LEFT ROUND DOT", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED ROUND DOT BELOW", "Lo", 0), ("ARABIC LETTER ALEF WITH DOT ABOVE", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED TOP RIGHT FATHA AND DOT ABOVE", "Lo", 0), ("ARABIC LETTER ALEF WITH RIGHT MIDDLE STROKE AND DOT ABOVE", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED BOTTOM RIGHT KASRA AND DOT ABOVE", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED TOP RIGHT FATHA AND LEFT RING", "Lo", 0), ("ARABIC LETTER ALEF WITH RIGHT MIDDLE STROKE AND LEFT RING", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED BOTTOM RIGHT KASRA AND LEFT RING", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED RIGHT HAMZA", "Lo", 0), ("ARABIC LETTER ALEF WITH ATTACHED LEFT HAMZA", "Lo", 0), ("ARABIC TATWEEL WITH OVERSTRUCK HAMZA", "Lo", 0), ("ARABIC TATWEEL WITH OVERSTRUCK WAW", "Lo", 0), ("ARABIC TATWEEL WITH TWO DOTS BELOW", "Lo", 0), ("ARABIC LETTER THIN YEH", "Lo", 0), ("ARABIC BASELINE ROUND DOT", "Lo", 0), ("ARABIC RAISED ROUND DOT", "Sk", 0), ("ARABIC LETTER NOON WITH INVERTED SMALL V", "Lo", 0), ("ARABIC LETTER HAH WITH INVERTED SMALL V BELOW", "Lo", 0), ("ARABIC LETTER TAH WITH DOT BELOW", "Lo", 0), ("ARABIC LETTER TAH WITH THREE DOTS BELOW", "Lo", 0), ("ARABIC LETTER KEHEH WITH TWO DOTS VERTICALLY BELOW", "Lo", 0), ("ARABIC VERTICAL TAIL", "Lo", 0), (), ("ARABIC POUND MARK ABOVE", "Cf", 0), ("ARABIC PIASTRE MARK ABOVE", "Cf", 0), (), (), (), (), (), ("ARABIC PEPET", "Mn", 230), ("ARABIC SMALL HIGH WORD AL-JUZ", "Mn", 230), ("ARABIC SMALL LOW WORD ISHMAAM", "Mn", 220), ("ARABIC SMALL LOW WORD IMAALA", "Mn", 220), ("ARABIC SMALL LOW WORD TASHEEL", "Mn", 220), ("ARABIC MADDA WAAJIB", "Mn", 230), ("ARABIC SUPERSCRIPT ALEF MOKHASSAS", "Mn", 230), ("ARABIC DOUBLED MADDA", "Mn", 230), ("ARABIC HALF MADDA OVER MADDA", "Mn", 230), )
https://github.com/maxgraw/bachelor
https://raw.githubusercontent.com/maxgraw/bachelor/main/apps/document/src/2-theory/webxr-lighting-estimation.typ
typst
Um virtuelle Objekte in einer realen Umgebung realistisch erscheinen zu lassen, ist es wichtig, dass sie sich in Farbgebung, Größe und Beleuchtung an die reale Umgebung anpassen. Das WebXR Lighting Estimation Modul ermöglicht die Schätzung der Umgebungslichtverhältnisse, wodurch eine bessere Integration von virtuellen und realen Objekten erreicht wird @webxr-lighting-estimation-module. === XRLightProbe Das XRLightProbe Interface liefert Informationen über die Lichtverhältnisse in der Umgebung zu einem bestimmten Zeitpunkt @webxr-lighting-estimation-module. #let code = ```ts interface XRLightProbe : EventTarget { readonly attribute XRSpace probeSpace; attribute EventHandler onreflectionchange; }; ``` #figure( code, caption: [XRLightProbe Interface] ) Um das WebXR Lighting Modul zu initialisieren, muss zunächst der String „light-probe“ in die Feature Dependencies der XRSession aufgenommen werden. Anschließend kann die Funktion requestLightProbe aufgerufen werden, um ein XRLightProbe Objekt zu erhalten @webxr-lighting-estimation-module. Wie in @XRLightProbe-listing dargestellt wird die Funktion hierbei vom XRSession Objekt bereitgestellt #let code = ```ts partial interface XRSession { Promise<XRLightProbe> requestLightProbe(options = {}); readonly attribute XRReflectionFormat preferredReflectionFormat; }; ``` #figure( code, caption: [requestLightProbe Funktion und preferredReflectionFormat Attribut] ) <XRLightProbe-listing>
https://github.com/AU-Master-Thesis/thesis
https://raw.githubusercontent.com/AU-Master-Thesis/thesis/main/sections/3-methodology/study-1/language.typ
typst
MIT License
#import "../../../lib/mod.typ": * === Implementation Language <s.m.language> // #k[ // Shorten the text and reformulate some parts to not come of as a fanatic // ] // #jonas[No need to read this section still. However how do we talk about choosing a specific language when we have not performed rigorous tests on which one would be best for the implementation?] This subsection describes the choice of implementation programming language used in both the simulation and the reimplementation of the #gbpplanner paper. Motivations for why the language was chosen is laid out and argued for. Both the simulator and the gbplanner reimplementation are written in the Rust programming language. Rust is a popular modern systems programming language with a lot of powerful capabilities to model and manage complex software systems. ==== Why was Rust chosen? The software for #gbpplanner is implemented in the C++ programming language@gbpplanner-code. A language widely used in robotics and scientific simulations due to its capabilities to compile to very efficient machine code. C++ supports high-level programming structures such as templates and generic programming with little to no performance cost. A property referred to as zero cost abstractions@tour-of-cpp. Manual memory management is used instead garbage collection, ensuring predictable latency. A hard requirement in many real-time systems. To better understand the algorithm and validate it works across different programming languages and are not dependant on features exclusive to C++ the Rust programming language was used instead for redevelopment. Rust offers performance qualities comparable to C++, making it suitable for similar domains: - Deterministic deallocation of resources using the #acr("RAII") pattern, similar to C++'s use of destructors@tour-of-cpp@the-rust-book. - High level abstractions, such as generic programming and traits, compiled to efficient machine code@the-rust-book. - High performance, with no garbage collection. // - Zero-cost abstractions, such as composable iterators, usually found in pure functional programming languages@the-rust-book. // - Low level control over hardware and operating system resources. At the language and tooling level Rust offers several benefits@the-rust-book: - Borrow checker system, that prevents common bugs like use-after-free, null-pointer dereferences, buffer overflows, and memory leaks, which are typically manually managed in languages like C and C++. - Focus on expressiveness and correctness. The compiler is strict and forces one be to explicit about assumptions. Errors cannot be ignored, and has to handled close to the call cite, instead of being transparently passed up the call stack like with exceptions. - Strong and expressive type system. A lot of invariants can be encoded in the type system. Such as finite state machines using tagged unions or typestates. With these mechanisms software requirements such as pre and postconditions can be expressed closer to the implementation, and more reliably verified. // - Irrefutable pattern matching, that forces one to handle all possible cases that combinations of variables can be in. - Consistent tooling across the entire language stack. Building, testing, benchmarking, and documentation are all built into the package manager `cargo`. Thereby providing a unified way to work with Rust code. A quality that makes it very easy to use and integrate other libraries. All of these reasons together with a natural curiosity to learn the language and its ecosystem led to it being chosen. // Rust’s standout feature is its ability to manage memory automatically without garbage // collection through its borrow checker system. An advanced static analysis system built into the language. The rules of this system is explained in more detail below in @s.graph-representation. This system prevents common bugs like use-after-free, null-pointer dereferences, buffer overflows, and memory leaks, which are typically manually managed in languages like C and C++. These issues lead to security vulnerabilities and potentioally dangerous crashes for real-time embedded systems@sharma2023rust. Organizations such as NIST@nist-use-rust, NSA@nsa-use-rust, and the United States Government@white-house-rust have documented that these bugs constitute a significant portion of software vulnerabilities found in critical software that a lot of systems depends on. They recommend developing new critical software in _memory-safe_ languages like Rust to prevent these issues. While the developed software for this thesis is not going to be run in a context were such issues would be severe it was still seen as a motivation to explore an alternative that can prevent these issues entirely. // Rusts most prominent feature is that is able to have automatic memory management while not using garbage collection through an advanced static analysis system built into the language called the borrow checker. The rules of this system is explained in more detail below in @s.graph-representation. With this system the compiler is able to prove that a common suite of serious bugs can not happen at run time. Bugs such as use after free, null-pointer dereferences, buffer overflows and memory leaks. All of which are issues that a programmer has to prevent manually in other low level languages such as C and C++. These issues can if not prevented lead to security vulnerabilities and potentioally dangerous crashes for real-time embedded systems@sharma2023rust. Multiple institutions and organizations such as NIST@nist-use-rust, NSA@nsa-use-rust and even the United States Government@white-house-rust has published reports that documents that the aforementioned account for large percentage of the software vulnerabilities colloguially known as #acrpl("CVE") found in todays critical software that a lot society depend on. A conclusion echoed across these reports is that new critical software should be developed in _memory safe_ languages that are capable of preventing these issues statically. Listing Rust as one of the candidate languages that they recommend that new systems level applications should be written in. While the developed code for this thesis is not going to be run in a context were such issues would be severe at all, it was still seen as a motivation to explore an alternative that can prevent these issues entirely. // At the language and tooling level Rust offers several benefits@the-rust-book: // // - Focus on expressiveness and correctness. The compiler is strict and forces one be to explicit about assumptions. Errors cannot be ignored, and has to handled close to the call cite, instead of being transparently passed up the call stack like with exceptions. // - Strong and expressive type system. A lot of invariants can be encoded in the type system. Such as finite state machines using tagged unions or typestates. And partial subtypes, such as a floating point number that can never be zero or $infinity$, using newtypes. With these mechanisms software requirements such as pre and postconditions can be expressed closer to the implementation, and more reliably verified. // - Irrefutable pattern matching, that forces one to handle all possible cases that combinations of variables can be in. // - Consistent tooling across the entire language stack. Building, testing, benchmarking, and documentation are all built into the package manager `cargo`. Thereby providing a unified way to work with Rust code. A quality that makes it very easy to use and integrate other libraries. // // Finally the authors were curious about Rust's touted benefits and wanted to learn more about it. Rust has received significant endorsements from major industry players like // the Linux kernel project@rust-for-linux@linux-kernel-docs-rust, Microsoft@microsoft-joins-rust-foundation, Meta@use-of-rust-at-meta, and Google@google-joins-rust-foundation, indicating its potential to become a defining language for new software systems with strong requirements for performance, security and reliability. // have been getting a lot of endorsement over the last couple of years from many large players in the software industry. The Linux kernel has accepted Rust as fully supported language for developing hardware driver modules, and are planning on promoting it to equal level with the C language @rust-for-linux@linux-kernel-docs-rust. Large companies like Microsoft, Meta and Google are contributing resources into developing the language, and are redeveloping core services in it @use-of-rust-at-meta@microsoft-joins-rust-foundation@google-joins-rust-foundation. All indicators that Rust will continue to grow and become a defining language for new software systems in the near future. // #k[ // *LE CHAT* // // Why was Rust chosen? // // The software for #gbpplanner is implemented in C++, a language widely used in robotics and simulation due to its ability to compile to efficient machine code. C++ supports high-level programming structures like templates and generic programming with minimal performance cost, known as zero-cost abstractions. It also employs manual memory management instead of garbage collection, ensuring predictable latency—a crucial factor in many real-time algorithms. // // To better understand the algorithm and validate its functionality across different programming languages, we chose Rust for redevelopment. Rust offers performance qualities comparable to C++, making it suitable for similar domains: // // Deterministic deallocation of resources using the RAII pattern, similar to C++ destructors. // High-level abstractions, such as generic programming and traits, compiled to efficient machine code. // No garbage collection. // Zero-cost abstractions, such as composable iterators from functional programming. // Low-level control over hardware and operating system resources. // High performance. // // Rust's standout feature is its ability to manage memory automatically without garbage collection through its borrow checker system. This system prevents common bugs like use-after-free, null-pointer dereferences, buffer overflows, and memory leaks, which are typically manually managed in languages like C and C++. These issues can lead to security vulnerabilities and crashes in real-time embedded systems. Organizations such as NIST, NSA, and the United States Government have documented that these bugs constitute a significant portion of software vulnerabilities (CVE). They recommend developing new critical software in memory-safe languages like Rust to prevent these issues. // // At the language and tooling level, Rust offers several benefits: // // Focus on expressiveness and correctness. The compiler is strict, requiring explicit handling of errors close to the call site rather than propagating them up the call stack. // Strong and expressive type system. Rust allows encoding many invariants in the type system, such as finite state machines using tagged unions or typestates, and partial subtypes using newtypes. These mechanisms help express and verify software requirements more reliably. // Irrefutable pattern matching, ensuring all possible variable combinations are handled. // Consistent tooling across the language stack, with building, testing, benchmarking, and documentation all integrated into the cargo package manager. // // Additionally, the authors were curious about Rust's touted benefits and wanted to explore the language. Rust has received significant endorsements from major industry players like the Linux kernel project, Microsoft, Meta, and Google, indicating its potential to become a defining language for new software systems. // // ] // ==== Other Languages Considered Beyond Rust four other programming languages were considered. @tbl.other-languages-considered lists them in a table together with reasons why they were not selected. #let icons = ( Zig: box( radius: 3pt, height: 0.75em, width: 2em, inset: (x: 2pt), outset: (y: 2pt), pad( x: -4pt, y: -4pt, image("../../../figures/icons/zig.svg", width: auto) ) ), Odin: box( fill: rgb("#4B89CA"), radius: 3pt, height: 0.75em, width: 3em, inset: (x: 2pt), outset: (y: 2pt), pad( image("../../../figures/icons/odin.svg", width: auto) ) ), Julia: box( // fill: catppuccin.latte.base, radius: 3pt, height: 0.75em, width: 1.25em, inset: (x: 2pt), outset: (y: 2pt), pad( x: -2pt, y: -2pt, image("../../../figures/icons/julia.svg", width: auto) ) ), Python: box( // fill: rgb("#306998"), radius: 3pt, height: 0.75em, width: 1.25em, inset: (x: 2pt), outset: (y: 2pt), pad( x: -6pt, y: -6pt, image("../../../figures/icons/python.svg", width: auto) ) ), ) #figure( { show table.cell : it => { if it.x == 1 { set text(weight: "bold") it } else { it } } tablec( columns: 3, alignment: (center + horizon, center + horizon, left), header: table.header([Icon], [Language], [Reason for not choosing it]), icons.Zig, [Zig], table.vline(), [Relatively new and still not fully complete with a v1.0 specification. Achieves performance on par with C++ and Rust, but lacks a strong ecosystem of libraries.], icons.Odin, [Odin], [Relatively new and still lacks a formal specification. Has good support for linear-algebra and vector math built into the language. Lacks a strong collection of third-party libraries for common functionality.], icons.Julia, [Julia], [ Primarily designed for numerical and scientific computing. Achieves good performance and can be on par with C++ and Rust if optimized correctly@making-julia-as-fast-as-cpp. Lacks strong mechanisms for encapsulation of state. ], icons.Python, [Python], [Too slow, and lack of a strong (enforced) type system seen as a disadvantage for managing the size and complexity of the developed system.], ) }, caption: [ Other programming languages that were considered for building #acr("MAGICS") and subsequently the reimplementation of the #gbpplanner paper. These languages were ultimately not chosen. ] ) <tbl.other-languages-considered> // #todo[ // Explain some of the unique benefits of Rust. // - borrow checker // - ownership // - memory safety // - concurrency // - Performance // - Rich type system // - Rich library ecosystem // - Helpful error message // - Error handling, errors as values, no exceptions // - Exceptional tooling, // ] // - `cargo` // - `gbpplanner` is implemented in C++. We are both familiar with C++, but have in // previous projects spent a lot of time fighting its idiosyncrasies. // A desire to learn the technology is one of the reasons why Rust was chosen. A lot of new systems are developed using Rust, and a lot of prominent authorities have publicly urged that new software project not be developed in unsafe languages such as C++. // - Explore newer alternatives that matches C++ in terms of performance, but allows for other qualities. // - to validate that the algorithm works across different programming languages and are not dependant on features exclusive to C++. // - exhaustive pattern matching is useful for any future factors that needs to added to the implementation as the compiler would require that all uses of it are handled explicitly. // - Secondly the implementation have no hard dependencies on C++ or C only frameworks such as ROS2 that are popular in the robotics community and industry. // - See a lot of popularity and want the to contribute to robotics related research and experimentation in the language to prove its usefullness/applicability in multiple domains. // - white house paper that urges developers to move away from C++ and focus on memory safe languages like Rust. Also cite Google CVE papers about vulnabilities that Rust can prevent alone by the compiler. @white-house-rust // - The most beloved language in by software developers many years in a row, Stack Overflow // #line(length: 100%, stroke: 1em + red)
https://github.com/cs-24-sw-3-01/typst-documents
https://raw.githubusercontent.com/cs-24-sw-3-01/typst-documents/main/report/sources/DionInterview.typ
typst
== Interview with Dion <InterviewDion> 00:00:00,799 --> 00:00:03,060 Elma & Sille: Skal man sige noget før man? Nej. 00:00:03,280 --> 00:00:04,660 Dion: Jeg har sagt ja til optagelse. 00:00:06,480 --> 00:00:12,980 Elma & Sille: Og det var egentlig mest bare en demonstration af hvilke kalender, du bruger normalt til daglig. 00:00:14,975 --> 00:00:21,075 Og hvad du godt kunne lide ved den, og hvad du ikke kunne lide ved den, så vi kan tage den med også. 00:00:22,095 --> 00:00:23,935 Ja, for det er det første og spørgsmål. 00:00:23,935 --> 00:00:26,675 Dion: Skal vi starte med mine erfaringer eller bare hvad jeg bruger? 00:00:27,455 --> 00:00:29,470 Elma & Sille: Nok mest bare først, hvad du bruger. 00:00:29,470 --> 00:00:32,110 Måske en lille kort demo, hvis det kan lade sig gøre. 00:00:32,110 --> 00:00:33,410 Dion: Ja, det kan sagtens gøre. 00:00:33,710 --> 00:00:35,810 Jeg tror sågar, vi skal få det op på storskærm. 00:00:41,155 --> 00:00:43,094 Elma & Sille: Eller så havde jeg også en omformer også. 00:00:43,594 --> 00:00:45,655 Ja, den brugte lige sidst. 00:00:47,555 --> 00:00:50,144 Dion: Det er lidt mindre scuffed, det her lokale. Jeg bruger 00:00:56,500 --> 00:01:03,160 primært Outlook som kalender. Og inden for det sidste halve år, der bruger jeg som nye Outlook-klient. 00:01:05,540 --> 00:01:10,520 Og det jeg I bund og grund gør, for vi har ikke haft nogle tværgående projekter I lang tid. 00:01:12,815 --> 00:01:18,275 Jeg har lavet sådan noget, hvor jeg har tilføjet folk her og lagt dem ind I sådan nogle grupper. 00:01:18,895 --> 00:01:21,055 Så jeg har alle dem fra mit eget team. 00:01:21,055 --> 00:01:23,775 Det er ligesom dem jeg bruger til hverdag. 00:01:23,775 --> 00:01:28,960 Så kan jeg klikke dem af, Så får jeg sådan et rigtig dårligt overblik her, hvor den meget slår kalenderen sammen. 00:01:29,820 --> 00:01:32,719 Men det gør egentlig lidt, hvad jeg skal. 00:01:33,579 --> 00:01:39,705 Jeg ved godt, hvis der er en, der går på ferie I tre uger, så ved jeg godt han vil ikke mindst tre uger. 00:01:39,945 --> 00:01:44,045 Og hvis jeg skal være sikker på, hvornår han kommer hjem, jamen så går jeg altid bare ind og slår en person op. 00:01:44,745 --> 00:01:46,345 Og så er det til at overskue stadigvæk. 00:01:46,345 --> 00:01:50,205 Jeg får stadig ikke det der grand overblik. 00:01:50,665 --> 00:01:57,800 Elma & Sille: Og det er fordi, der er så mange andre events I, som ikke er ferie udelukkende eller er væk udelukkende. 00:01:57,900 --> 00:02:01,640 Men derfor eller hvorfor føles det som om, at du ikke får? 00:02:01,860 --> 00:02:07,425 Dion: Herinde der bruger jeg også til at finde ud af, om de skal noget på det tidspunkt dag. 00:02:07,725 --> 00:02:14,465 Så for mig er det her, at det her er en catch all, på en eller anden måde. Og overblikket. 00:02:16,045 --> 00:02:19,665 Vi har en Scrummaster, der kompenserer for alle mine egne mangler. 00:02:21,670 --> 00:02:24,970 Og det hun gør, det er at gå ind I boards et andet sted. 00:02:28,630 --> 00:02:31,130 Kalender I boards. 00:02:35,845 --> 00:02:39,705 Under hvad der var sommerferie. I august. Ja. 00:02:40,565 --> 00:02:42,405 Og det er jo ikke mega prangende, det her. 00:02:42,405 --> 00:02:47,680 Men du kan se selvfølgelig, at Kjeld han har den farve, som er. Er. 00:02:47,680 --> 00:02:49,540 Men den virkede så I sommers. 00:02:51,760 --> 00:02:58,400 Dion: Men det brugte vi, hvor man så kan se, at Mads har ferie der, Christian har ferie der og hjertet ferie der. 00:02:58,400 --> 00:03:01,145 Elma & Sille: Okay, på den her måde brugte ferier her. 00:03:01,925 --> 00:03:04,005 Hvis du skulle se på Teams, så skulle den på noget andet og 00:03:04,005 --> 00:03:05,465 Dion: se Teams. 00:03:06,565 --> 00:03:07,605 Elma & Sille: Vi ser det andet her. 00:03:07,605 --> 00:03:10,585 Dion: Det er også et custom team, ligesom det ville være et ferieplan. 00:03:11,350 --> 00:03:18,010 Der kan man også sætte alle dem på, man vil, der er inden for lige præcis det her projekt I boards. Kender I det Azureboards? 00:03:18,790 --> 00:03:19,690 Elma & Sille: Modern workplace? 00:03:19,790 --> 00:03:29,915 Dion: Det skal I seriøst tage jer og bruge det til jeres projekter, fordi I kommer til at bruge det relevant erhvervserfaring. Hvordan skal vi? 00:03:29,915 --> 00:03:33,435 Det er et agil planningsværktøj det her I bund og grund I kalenderen. 00:03:33,435 --> 00:03:37,595 Elma & Sille: Det kunne I faktisk godt have bedt at bruge I stedet for Trello. 00:03:37,595 --> 00:03:40,410 Dion: Jeg tror for studerende, det er også gratis at oprette det her fuldstændig. 00:03:45,590 --> 00:03:49,190 Men I bund og grund gør den her, at det er det ferieplan kan. 00:03:49,190 --> 00:03:53,130 Det der er begrænsningen her, det er, at det ligner lort for det første. 00:03:54,575 --> 00:04:01,694 Den anden ting det er at brugere herinde, det er typisk folk der er mere ovre I den tekniske genre. 00:04:01,694 --> 00:04:06,655 Så du vil aldrig få nogen fra vores, nu sidder jeg godt nok lige finans, men fra de normale dele 00:04:06,655 --> 00:04:11,459 af finans, der vil du aldrig få folk til at gå herind Det vil ikke give mening simpelthen, at de går herind. 00:04:12,080 --> 00:04:13,860 Fordi de sidder ikke og laver allergi planlægning. 00:04:13,920 --> 00:04:16,400 De sidder og copy-paste I Excel ark eller hvad de 00:04:18,880 --> 00:04:22,340 Så de vil jo ikke komme herind naturligt for at lave noget som helst. 00:04:22,800 --> 00:04:27,905 Derudover så koster det her femogtredive kroner pr. Bruger pr. Måned. 00:04:29,565 --> 00:04:31,745 Det er jo ikke fordi, det er mega dyrt eller noget som helst. 00:04:32,125 --> 00:04:35,325 Men det er bare Når det ikke er naturligt at komme ind, så betaler man ikke for det. 00:04:35,325 --> 00:04:38,625 Og så når det specielt sådan her ud, så gider man ikke betale det. 00:04:38,685 --> 00:04:42,169 Elma & Sille: Bruger den til noget andet udover de kalendere? 00:04:42,229 --> 00:04:43,610 Dion: Vi bruger den her til alt. 00:04:44,789 --> 00:04:45,750 Det er alt mit arbejde. 00:04:45,750 --> 00:04:47,050 Elma & Sille: Er det så alt, der koster femogtredive? 00:04:47,509 --> 00:04:50,009 Dion: Ja, det er hele den her løsning. 00:04:50,069 --> 00:04:53,210 Minus repo pipeline test bands. 00:04:54,310 --> 00:04:57,405 Elma & Sille: Så du havde fortsat betalt, også selvom vi lavede en løsning 00:04:57,405 --> 00:04:59,185 Dion: Ja, det er bare vores plan-værktøj. 00:05:00,285 --> 00:05:04,205 Herinde der ligger alle mine opgaver, alle de planer vi har for mit team. 00:05:04,205 --> 00:05:07,005 Elma & Sille: Og så det du siger, det er, at I havde faktisk farvet femogtredive på nogle kunder? 00:05:07,005 --> 00:05:08,865 Altså nogle af jeres medarbejdere? Ja, ja. 00:05:09,450 --> 00:05:12,430 Dion: For mig er det bare et add-on at ferien, der ligger herinde. 00:05:14,090 --> 00:05:15,210 Så det er egentlig fint nok. 00:05:15,210 --> 00:05:17,070 Man må se, at det er mig ikke prangende, men 00:05:18,850 --> 00:05:20,010 Elma & Sille: At den er helt optimal? 00:05:20,010 --> 00:05:20,985 Dion: Ja, det er den ikke. 00:05:22,025 --> 00:05:26,764 Men det er måden vi gør det på, fordi ferieplanlægning ikke virker. 00:05:27,865 --> 00:05:33,805 Mange af os skifter over til at køre på Azure join endpoints. Og her er det så her ovre at ferieplanlægning ikke virker. 00:05:38,950 --> 00:05:42,410 Jeg tror den skal ligge på med Windows low alle mulige, og der bliver en vinkel sur. 00:05:43,830 --> 00:05:46,650 Elma & Sille: Har du fået mange jokes omkring DAD? 00:05:47,110 --> 00:05:51,850 Dion: Ja. Rigtig meget. Der er også en der hedder MOM. 00:05:54,685 --> 00:05:57,105 Elma & Sille: Virkelig. Som må i være parret. 00:05:58,125 --> 00:06:03,725 Dion: Det er en mand. Så har vi en, der hedder SON også. Det er 00:06:03,725 --> 00:06:06,759 Elma & Sille: da perfekt. Mangler jeg bare Daughter. Lidt svært. 00:06:06,759 --> 00:06:08,780 Dion: Ja, den er lidt kit. 00:06:11,240 --> 00:06:15,979 Jeg har virkelig mange sjove Der var også sådan nogen, der hed VPN og sådan noget. Eller MAC. 00:06:17,845 --> 00:06:19,305 Der er virkelig mange gode, tre bogstaver. 00:06:21,444 --> 00:06:24,745 Men ja, det er det, jeg bruger. Jeg bruger andet. 00:06:26,245 --> 00:06:29,064 Jeg bruger Teamsskalender, men der kan jeg ikke rigtigt se andre. 00:06:30,120 --> 00:06:36,540 Det er kun til noget enkelt møde, koordinationer, og det er jo ikke det, ferieplanløsningen skal kunne. 00:06:36,600 --> 00:06:39,640 Men herinde kan jeg godt gå ind og tjekke. 00:06:39,640 --> 00:06:40,600 Elma & Sille:Tjek andre, som du kan lave et møde med? 00:06:40,600 --> 00:06:47,414 Dion: Ja, hvis jeg skal se om Linda er på møde eller skulle på ferie, så kunne jeg bare gå her ind 00:06:47,414 --> 00:06:48,555 så bare lige scrolle lidt. 00:06:49,014 --> 00:06:51,995 Så det er også en komplementær løsning. 00:06:53,335 --> 00:06:55,354 Elma & Sille: Men det er selvfølgelig ikke kun enkelt vis. 00:06:56,134 --> 00:06:57,430 Nej, man kan lave team 00:06:57,430 --> 00:06:57,670 Dion: til at 00:06:57,670 --> 00:06:58,150 Elma & Sille: være så flere? 00:06:58,150 --> 00:07:00,250 Dion: Ja, der kan jeg jo bare smække på her. 00:07:01,190 --> 00:07:04,330 Elma & Sille: Hvordan kan det være, at I ikke bruger den her primært? 00:07:04,470 --> 00:07:07,530 Dion: Det er fordi, man mangler et sted, du bare klikker ind og så er det der. 00:07:07,910 --> 00:07:11,850 For eksempel når jeg skal slå op mit team, så er det elleve mand. 00:07:12,025 --> 00:07:15,724 For det første skal jeg huske elleve mands navne og slå dem op her. 00:07:16,664 --> 00:07:19,565 Og så skal jeg skrive alle deres initialer hver gang. Det er træls. 00:07:19,785 --> 00:07:23,164 Jeg vil ind et sted, hvor det pre-populated, der bare puf. 00:07:23,544 --> 00:07:27,470 Elma & Sille: Og så kan du bare highlighte og gemme Teams? 00:07:27,730 --> 00:07:28,990 Dion: Ja, præcis. 00:07:33,450 --> 00:07:39,390 Med det sagt, så Jeg kan jo ikke se behovet selv. Jeg har det ikke. 00:07:41,930 --> 00:07:43,014 Elma & Sille: Altså du har ikke behovet? 00:07:43,014 --> 00:07:45,595 Dion: Nej, ferieplan for mig er 00:07:48,535 --> 00:07:52,794 luksus på en måde det er som om, det er for meget. 00:07:53,335 --> 00:07:58,069 Hvis jeg virkelig havde brug for det, lavede jeg et Excel-ark med de elleve mennesker og planlagde sommerferien, tror jeg. 00:07:58,069 --> 00:08:00,169 Elma & Sille: Det havde været en studen worker der havde gjort det. 00:08:01,349 --> 00:08:02,409 Dion: Præcis. Det er meget billigere. 00:08:05,190 --> 00:08:09,370 Jeg synes, det er luksus, men der hvor jeg ved, at det giver værdi, det er jo projektledere 00:08:09,669 --> 00:08:13,555 og de andre større end projektledere. 00:08:14,335 --> 00:08:18,275 Dem der laver meget koordinerende arbejde på tværs af enheder. 00:08:18,735 --> 00:08:23,250 Mit team laver mere eller mindre alt det vi skal selv. 00:08:23,550 --> 00:08:27,889 Det er forholdsvist begrænset, hvor meget tværfagligt arbejde vi indgår I. 00:08:28,510 --> 00:08:32,850 Sidste gang var to år siden for eksempel, så jeg ikke skulle bruge noget I to år til at koordinere. 00:08:33,310 --> 00:08:37,845 Hvis det så er vi skal gøre det, så er det typisk nogle projektledere, der sætter et eller andet op til mig. 00:08:38,245 --> 00:08:43,865 Så for mig er det ikke en god løsning, når den bliver serveret for mig både sølvfad. 00:08:43,925 --> 00:08:45,225 Men ellers er den ikke. 00:08:46,964 --> 00:08:54,420 Elma & Sille: Okay. Så det er op til dem vi egentlig går efter, det er dem der laver projektet og har styr på projektet 00:08:54,420 --> 00:08:57,620 Dion: klart målgruppen det er hende Caroline, jeg har givet jer. Altså hendes kolleger. 00:08:57,620 --> 00:08:58,120 Elma & Sille: okay 00:08:58,420 --> 00:09:03,000 Dion: går lige hjem. De ved, hvad de har brug for og mangler. 00:09:04,925 --> 00:09:08,285 Elma & Sille: Okay, så det vi kan få ud af dig, det er, hvad du godt kan lide af de eksisterende. 00:09:08,285 --> 00:09:09,404 Og så kan vi prøve at tage det 00:09:09,404 --> 00:09:10,704 Dion: og samle det og lægge det. 00:09:10,925 --> 00:09:17,504 Det jeg viser jer inde I jeres DevOps, det er forholdsvist tæt på. Den her kalenderproduktion. 00:09:17,805 --> 00:09:19,840 Elma & Sille: Ja, udover at billederne ikke virker. Ud over billederne 00:09:19,840 --> 00:09:22,660 Dion: ikke virker. Ud over at den er gadet bag en licens. 00:09:23,120 --> 00:09:27,120 Og udover at der aldrig er nogle, ikke er teknikere, der nogensinde finder ud af, at der vil 00:09:27,120 --> 00:09:28,740 være en kalender inde på den her løsning. 00:09:29,600 --> 00:09:32,100 Elma & Sille: Ja, for I bruger jo alle sammen nogle forskellige metoder. 00:09:32,605 --> 00:09:37,265 Dion: Vi har sådan en demografi I KMD, som er tanggerende over mod Boomer. 00:09:40,525 --> 00:09:43,665 Vi har en høj gennemsnit I forhold til at vise softwarehus. 00:09:44,760 --> 00:09:49,420 Og sådan mit team, det er også ekstremt højt faktisk. 00:09:49,720 --> 00:09:54,060 Jeg tror vi er over halvtreds måske I gennemsnit. 00:09:55,320 --> 00:09:57,725 Elma & Sille: Skal du ikke flere studerende? Hvis 00:10:00,824 --> 00:10:08,665 nu vi siger, at Ferie-planlæggeren er en luksus for dig, ville den skulle have nogle ekstra features 00:10:08,665 --> 00:10:12,000 for at gøre den mere forbedring for dig at bruge? 00:10:12,080 --> 00:10:16,660 Dion: Ja, det tror jeg også nævnte lidt på vores første møde. 00:10:16,720 --> 00:10:20,420 Men sådan noget som Og det er måske også vigtigt at vise jer. 00:10:22,640 --> 00:10:27,115 Når vi skal registrere ferie og sådan noget, så gør vi det igennem succesfaktor, SAP succesfaktor. 00:10:28,214 --> 00:10:31,035 Som er forbundet til alt muligt andet I kompagni. 00:10:32,694 --> 00:10:37,514 Og nu skal vi lige se om der er noget person følsomt der. Det var der ikke. 00:10:40,150 --> 00:10:45,910 Hvis man går herind og registrerer sin ferie, så I gamle dage, hvis jeg kørte sådan nogle crash 00:10:45,910 --> 00:10:54,335 time offer ind, så vil den faktisk blive populær direkte ind I ferieplanen, den gamle løsning 00:10:54,335 --> 00:10:58,435 indtil den integration døde af alderdom I bund og grund. 00:10:59,695 --> 00:11:06,515 Men det var meget smart, fordi bare jeg smækkede menneskerne ind I en gruppe inde I ferieplanen, 00:11:06,735 --> 00:11:08,595 så havde jeg allerede et opdateret overblik. 00:11:09,190 --> 00:11:14,389 Måden den har kørt på det sidste to år, det har egentlig været med, at folk manuelt skal plotte 00:11:14,389 --> 00:11:15,769 det ind ved siden af. 00:11:17,269 --> 00:11:21,610 Det ville blokere mig fuldstændig at bruge den, for jeg skal ikke tage at plotte det ind to steder. Det gider jeg ikke. 00:11:24,385 --> 00:11:30,245 Elma & Sille: Så hvordan kunne du tænke dig, at folk skal indsætte deres ferier? 00:11:30,545 --> 00:11:36,769 Dion: Jeg tænker, at der skulle være en integration fra enten succesfaktor, som registrerer 00:11:36,769 --> 00:11:39,910 jeg registreret min ferie, og port det videre til den her løsning. 00:11:40,290 --> 00:11:47,350 Eller så skulle det være en integration fra Outlook, der måske søgt på den ICS-fil, en mail-fil, 00:11:48,130 --> 00:11:50,115 hvad der kommer ud, når man gør det her. 00:11:50,195 --> 00:11:54,195 Den har altid tagget med det samme navn, så der er et eller andet I den navnekombination, som 00:11:54,195 --> 00:11:59,175 man måske kunne putte direkte fra Graph API til Office. 00:12:00,755 --> 00:12:02,135 Så det er også en mulighed. 00:12:02,435 --> 00:12:08,510 Der er vi igen ude I en luksus-funktion I forhold til, hvad jeg tror, der er I realistisk til jeres 00:12:08,510 --> 00:12:13,710 Elma & Sille: Så det du ikke kunne tænke dig, det var, at du skal ind på KMD ferieplan plan og så plotte 00:12:13,710 --> 00:12:14,750 det ind, og så ville være der 00:12:17,405 --> 00:12:20,445 Dion: Det ville gøre, at jeg ville kunne bruge det også. Og det 00:12:20,445 --> 00:12:23,105 Elma & Sille: er jo selvfølgelig det bedste, vi ville kunne få hele koncerten. 00:12:23,965 --> 00:12:28,365 Dion: Det kunne godt være, at I skulle overveje at interviewe min Scrummaster, fordi hun ville højst 00:12:28,365 --> 00:12:31,425 sandsynligt tvinge mig til at gøre det, hvis løsningen var der. 00:12:31,640 --> 00:12:32,920 Selvom jeg skal plotte det ind to gange. 00:12:32,920 --> 00:12:33,240 Elma & Sille: Det kunne 00:12:33,240 --> 00:12:36,620 Dion: det være. Det er hende, der sørger for, at jeg har styr på mine ting. 00:12:36,680 --> 00:12:38,380 Elma & Sille: Fik du tæet hendes navn? 00:12:38,440 --> 00:12:41,160 Dion: Jeg tror faktisk ikke, jeg har sendt hendes navn til jer. 00:12:41,160 --> 00:12:44,600 Elma & Sille: Så kunne vi nemlig skrive en mail, for der var aldrig nogen, der var på ferie, så vi har kontaktet jer. Men det 00:12:44,600 --> 00:12:47,885 Dion: kan I bare lige høre ned, det er MGA. Og så 00:12:47,885 --> 00:12:49,565 Elma & Sille: er det samme mail, som du har bare 00:12:49,565 --> 00:12:50,464 Dion: ja, hun er engelsk talende, hun hedder Martha 00:13:04,750 --> 00:13:07,490 Elma & Sille: Vi kan nogle ord, som man nok ikke skulle sige. 00:13:12,715 --> 00:13:14,975 Nogle af dem har vi gerne et svar på løbende. 00:13:17,755 --> 00:13:19,435 Skal man kunne beskrive de forskellige ferier? 00:13:19,435 --> 00:13:25,770 For eksempel: I er på ferie, man kan kontaktes via telefon eller Jeg er ovre og passe min datter I dag 00:13:25,770 --> 00:13:28,410 eller kun ferie jer, eller det er også dage, hvor man ikke er. Det er 00:13:28,410 --> 00:13:30,410 Dion: meget fedt at kunne tilføje noter på det. 00:13:30,410 --> 00:13:32,270 På sine egne elementer derinde. 00:13:35,290 --> 00:13:40,315 Vores brug scenarie vil typisk være omkring sommerferien, hvor vi sidder I sådan en dev operservation, 00:13:40,535 --> 00:13:42,295 hvor vi skal koordinere vores ferie. 00:13:42,295 --> 00:13:46,295 Så der skal næsten altid være nogen, der er på vagt, og hvis vi overlapper ferie, så aftaler 00:13:46,295 --> 00:13:49,195 vi, hvem er den, hvis der er nogen, der ringer. 00:13:49,895 --> 00:13:51,675 Så det kunne være meget fint at sige: 00:13:53,990 --> 00:13:55,930 jeg er på call eller et eller andet. 00:13:59,590 --> 00:14:03,930 Elma & Sille: Hvad så med, hvis man bare jeg er til tandlæge lige her? 00:14:03,990 --> 00:14:05,930 Dion: Ja, det ville ikke være relevant. 00:14:06,665 --> 00:14:10,285 Elma & Sille: Så det er udelukkende ferie, vi kigger på I øjeblikket? 00:14:10,585 --> 00:14:18,585 Så det du tænker, det er, at det er noget integreret, vi vil lave en løsning til, som fletter 00:14:18,585 --> 00:14:23,740 ferie ind I jeres kalender eller omvendt? 00:14:23,740 --> 00:14:27,040 Dion: Ja. Så det er ikke sådan udelukkende sygdom skal jo også med også. 00:14:27,100 --> 00:14:28,560 Elma & Sille: Ja, stille længere. 00:14:29,580 --> 00:14:34,940 Dion: Jeg tror det gælder, det er alt det man kan registrere herinde. Ja, I 00:14:34,940 --> 00:14:37,745 Elma & Sille: havde sådan nogle koder, som Mats viste os. 00:14:41,885 --> 00:14:44,285 Og der var vi også tilsendt. Var vi ikke det? 00:14:44,285 --> 00:14:46,985 Vi havde I hvert fald fået som screenshot på. 00:14:47,105 --> 00:14:50,320 Dion: Jeg ved ikke om det var de gamle, jeg har fået nyt. 00:14:50,700 --> 00:14:52,880 Elma & Sille: Det var sådan nogle abbreviations. Ja, 00:14:54,140 --> 00:14:56,320 Dion: de ligger stadig omme bagved et sted. 00:14:57,420 --> 00:15:00,080 Men nu er det blevet sådan, at normale mennesker også forstår, hvad det 00:15:02,945 --> 00:15:03,505 Elma & Sille: lettere forståeligt. 00:15:03,505 --> 00:15:05,185 Dion: før var det kun ultranørder i SAP der kunne finde ud af det 00:15:07,584 --> 00:15:08,625 Elma & Sille: Caros leave. 00:15:08,625 --> 00:15:12,165 Dion: Ja, jeg kan faktisk huske breavement leave, fordi det var jeg nødt til Google. 00:15:15,240 --> 00:15:20,600 Men altså barnets første sygedag, barnets anden sygedag Så er der også noget af det, det er 00:15:20,600 --> 00:15:22,459 noget polsk specifikt, tror jeg. 00:15:24,360 --> 00:15:26,620 Elma & Sille: Det burde de jo også have i mente. 00:15:26,839 --> 00:15:29,505 Dion: Ja, for der var en eller anden lovgivning der nede. 00:15:29,745 --> 00:15:38,865 Hvis man I Polen melder sig syg for arbejde, du har bare lige snefluen eller lignende, så er du syg to dage. Du skal være syg? 00:15:38,865 --> 00:15:40,165 Du er syg to dage. 00:15:40,785 --> 00:15:45,630 Og efter de to dage, så kan du få to dage mere, Hver gang skal der fylde en lægeerklæring med for dem. 00:15:46,810 --> 00:15:52,730 Så har de nogle on- call læger, der bare lige kan diagnosticere dem over telefonen. Så er det fedt. Det er 00:15:52,730 --> 00:15:54,190 Elma & Sille: da også fedt, nok så behøver man ikke tage der ned. 00:15:54,410 --> 00:15:55,515 Dion: Det er super praktisk. 00:15:56,155 --> 00:16:00,555 Elma & Sille: Nå okay. Det skal vi huske, når vi laver de her ting. 00:16:03,515 --> 00:16:09,375 det kunne både være fedt, at man havde en type af ferie og en måde at lægge note på? Ja. 00:16:15,149 --> 00:16:22,209 Er der et sted, hvor den her liste er samlet, hvor der står en beskrivelse af, hvad det egentlig er? 00:16:23,315 --> 00:16:26,595 Eller er det bare noget, der er implicit, man ved, når man arbejder her? 00:16:26,595 --> 00:16:27,815 Dion: Ikke som jeg kan give jer. 00:16:27,875 --> 00:16:31,954 Elma & Sille: Så otte-elleve-arros-ruder. Ja. Ikke som jeg kan 00:16:31,954 --> 00:16:34,375 Dion: give jer eller sende til jer. 00:16:34,595 --> 00:16:36,454 Fordi det er vores håndbog, tror jeg. 00:16:36,755 --> 00:16:39,170 Elma & Sille: Vi vi også se I princippet. 00:16:39,790 --> 00:16:42,130 Lidt ligegyldigt om vi ved, hvad det er, så længe vi ved. 00:16:42,670 --> 00:16:45,329 Dion: Ja, så længe vi ved, at den er der. Det er en ting. 00:16:49,455 --> 00:16:49,955 Det 00:16:52,895 --> 00:16:55,455 er altså ikke godt med sådan noget som leder, ikke ved hvor tingene er. 00:16:55,455 --> 00:16:57,155 Hvor man skal finde de regler der. 00:17:10,760 --> 00:17:11,640 Elma & Sille: Jeg tænker også det er fint. 00:17:11,640 --> 00:17:17,485 Vi kan også prøve at Google os frem til det, så hvis vi vil går ged i navne, så kan vi snakke om det. 00:17:17,485 --> 00:17:19,745 Jeg tænkte også meget af det, der er vel et opskaleringsspørgesmål. 00:17:20,365 --> 00:17:24,525 Det er at have nogle forskellige typer, så er det jo den samme metode, man skal bruge alle sammen I det. 00:17:24,525 --> 00:17:30,340 Dion: Det er bare ligesom med at vælge de vigtigste, og der er otte til elleve reglen ikke vigtig. 00:17:30,559 --> 00:17:33,059 Det er så få mennesker, det handler om I virkeligheden. 00:17:33,360 --> 00:17:35,760 Elma & Sille: Er det når du Det 00:17:35,760 --> 00:17:38,640 Dion: er hvis du har været på vagt I elleve timer, skal du have et par timers pause. 00:17:38,640 --> 00:17:47,554 Elma & Sille: Men det er Så du vælger typen, og efterfølgende siger du datoer og sådan noget? 00:17:47,554 --> 00:17:53,174 Dion: Ja. Og så vælger jeg her, og så vælger jeg, hvornår det er, eller hvor mange timer det er. 00:17:55,370 --> 00:17:56,429 Det er sådan set det. 00:17:56,970 --> 00:17:59,390 Så skal jeg vælge timerne I stedet for. 00:18:00,330 --> 00:18:02,730 Fordi vi har sådan noget, der hedder ferie-fridagstimer primært. 00:18:02,730 --> 00:18:06,350 Det er det, det bruges til, hvor man så kan tage fri tre timer. 00:18:06,890 --> 00:18:13,365 Vi nogle konsulenter, hvor de sådan Hvis der skal de have det, der hedder billedbelarver. 00:18:13,745 --> 00:18:17,445 Når de er på arbejde, så skal de sætte en regning videre. 00:18:17,745 --> 00:18:22,325 Så hvis de skal til tandlæge I løbet af arbejdstiden, så skal de klikke af, at de ikke har været der I den time. 00:18:22,705 --> 00:18:30,710 Elma & Sille: Okay. Kan du godt lide, at der er returning to work on. den dag, det har klokkeslæt? Jeg smutter på det 00:18:30,710 --> 00:18:31,289 Dion: her klokkeslæt. 00:18:33,029 --> 00:18:33,750 Elma & Sille: Okay. For jeg 00:18:33,750 --> 00:18:34,230 Dion: tænkte også, at det 00:18:34,230 --> 00:18:34,970 Elma & Sille: er irriterendenest. 00:18:35,269 --> 00:18:41,855 Dion: Det bedste brug og mest brede brugs sted, det er ferie og det er syg. 00:18:42,475 --> 00:18:46,255 Og så under syg der vil der også ligge child care. 00:18:46,394 --> 00:18:48,735 Altså dit barn er syg. Og 00:18:51,690 --> 00:18:56,409 langtids sygdom. gravid relaterede sygdomme. 00:18:56,809 --> 00:18:58,490 Dion: Det ved jeg faktisk ikke, hvorfor måske er registreret, det virker med. 00:18:58,490 --> 00:19:00,990 Det ville bare syg et sted, ikke? 00:19:01,850 --> 00:19:06,304 Elma & Sille: Ja, måske langtids sygdom, skal være med. Men ikke pregnancy? 00:19:06,365 --> 00:19:07,184 Dion: Ja, ja. 00:19:07,565 --> 00:19:09,085 Elma & Sille: Okay, så det er sådan mere I dage. 00:19:09,085 --> 00:19:11,745 Altså du siger de her dage er væk og det er på grund af det? Ja, præcis. 00:19:12,044 --> 00:19:17,585 Dion: Ferieygdomme det er de to overordnede ting, hvor man kan pakke alt ind under. 00:19:17,645 --> 00:19:21,420 Elma & Sille: Ja, Og du kunne ikke lide, at der var tid på det? 00:19:21,420 --> 00:19:26,400 Dion: Og der må jo heller ikke I en løsning, hvor alle kan slå dig op, der må jo heller ikke stå lang tidsygemeldt. 00:19:27,660 --> 00:19:28,780 Elma & Sille: Nej, det er privat. 00:19:28,780 --> 00:19:34,575 Dion: Ja, så mange af dem her er kun nogen, der er relevante, fordi jeg som leder skal kunne se, hvorfor de er væk. 00:19:35,774 --> 00:19:37,394 Elma & Sille: Er det noget, vi skal tage I mente? 00:19:39,294 --> 00:19:42,894 Dion: Jeg tænker bare, at I løsningen må du ikke komme alle de her koder ind I virkeligheden. 00:19:42,894 --> 00:19:43,534 Elma & Sille: Okay, fint. 00:19:43,534 --> 00:19:45,394 Dion: Der må være syg eller ferie. 00:19:47,615 --> 00:19:51,050 Elma & Sille: Skal de kunne godkendes? Skal der være en overordnet person, der godkender de her ferier? 00:19:53,670 --> 00:19:59,370 Elma & Sille: Okay, fine. Så når de har skrevet det ind I deres, som skal ind I ferieplaneren, så er der et system. 00:20:04,755 --> 00:20:09,255 Elma & Sille: Så har vi også det spørgsmål, om jeg oplevede, at medarbejderne laver fejl, når de anser om ferie. 00:20:09,475 --> 00:20:10,914 Og hvordan de faktisk håndteres. 00:20:10,914 --> 00:20:13,794 Men det er vi da stadig igennem det interne. Ja, det 00:20:13,794 --> 00:20:14,455 Dion: har vi. 00:20:20,610 --> 00:20:21,110 Okay. 00:20:33,065 --> 00:20:36,205 Elma & Sille: Skal vi spørge om de har hernede? To-fire. 00:20:37,225 --> 00:20:39,325 Hvilke funktioner er det mest. 00:20:40,505 --> 00:20:42,285 Jeg føler også, at vi har været igennem det. 00:20:55,135 --> 00:20:59,235 Det er selvfølgelig også en specialssituation, når vi har snakket med dig flere gange før. 00:20:59,615 --> 00:21:00,995 Så ved vi jo godt lidt. 00:21:07,930 --> 00:21:12,590 Det der med mobil-app eller web-baseret, det var begge dele, vi snakkede om sidste gang. 00:21:13,610 --> 00:21:15,630 Det kunne godt være, at de andre havde en anden opinion. 00:21:16,570 --> 00:21:18,510 Dion: Det tænker jeg begge ting er mega relevante. 00:21:19,290 --> 00:21:21,644 For mig ville det være super lækkert med mobil. 00:21:21,644 --> 00:21:26,065 Det ville virkelig gøre det brugbart for mig, der er I sommerferie perioden. 00:21:26,284 --> 00:21:29,404 Folk ville typisk ringe til mig først, hvis der er noget, der går I stykker. 00:21:29,404 --> 00:21:31,644 Og så skal jeg så vælge, hvem jeg skal ringe til. 00:21:31,644 --> 00:21:40,690 Og så hvis jeg har en, hvor jeg kan slå op, om de er allesammen I ferie, så kan de se noten også. Det vil være kanon. Okay. 00:21:40,690 --> 00:21:43,830 Elma & Sille: så har vi også skrevet her specifikt platform framework. 00:21:45,970 --> 00:21:48,289 Men vi havde vel også snakket om det sidste gang. Havde vi ikke det? 00:21:48,289 --> 00:21:52,475 Dion: <NAME> der er vi åben overfor alt der ikke er mega gammelt. 00:21:57,995 --> 00:22:03,020 Vi havde også snakket I gruppen om det skulle være java eller c\# det var sådan med, at det 00:22:03,020 --> 00:22:05,200 ikke ville påvirke jer, om det var java eller c\#. 00:22:06,060 --> 00:22:10,720 Dion: Det tror jeg ikke. Jeg ved, at Mats han er gammel dot net-udvikler. 00:22:12,220 --> 00:22:14,640 Og så har han bygget en hjemmeside på. 00:22:17,985 --> 00:22:19,845 Det er ikke Umbraco, det er ikke. 00:22:20,304 --> 00:22:21,505 Elma & Sille: Han virkede meget chill. 00:22:21,505 --> 00:22:23,345 Jeg er ikke bare whatever you guys want. 00:22:23,345 --> 00:22:25,125 Dion: Ja, han kan også alt. 00:22:27,105 --> 00:22:29,044 Jeg har lige fået et nyt corp- hjemmeside. 00:22:32,170 --> 00:22:36,110 Og den er vist lavet I Umbraco. 00:22:36,170 --> 00:22:38,030 Jeg ved ikke om det var en drag and drop løsning. 00:22:39,850 --> 00:22:41,470 Jeg ved jo ingenting om det. 00:22:42,970 --> 00:22:45,790 Elma & Sille: Vi har lavet hjemmeside endnu, men jeg ser godt ud. 00:22:46,615 --> 00:22:49,995 Det var ikke det sidste semester. Ikke hjemmeside. 00:22:50,054 --> 00:22:53,674 Det var en hjemmeside, men det var jo lokalt. 00:22:56,215 --> 00:22:58,075 Er det ikke stadigvæk? Det 00:23:04,440 --> 00:23:07,559 Dion: Men ja, den skal bare følge cirka samme service som herinde. 00:23:07,559 --> 00:23:08,860 Så er det rimelig godt. 00:23:09,960 --> 00:23:11,500 Så er alt andet bestemt rimeligt. 00:23:15,559 --> 00:23:19,155 Elma & Sille: Yes, okay. Så det ligner noget ala det her? 00:23:19,155 --> 00:23:21,415 Vi har også jeres brandbog, som vi har tænkt selvfølgelig. 00:23:21,795 --> 00:23:28,055 Dion: Altså hvis I kan efterabe knapper herinde fra også, så er det også kanon. 00:23:28,755 --> 00:23:30,935 Og jeg ved ikke om skrifttypen stod deri. 00:23:32,020 --> 00:23:38,440 Elma & Sille: Jo, det gjorde den. Man kunne også downloade den. Det var mega fedt. Okay. Lad os se. 00:23:39,220 --> 00:23:40,679 Det bliver næsten ikke en time det her. 00:23:41,860 --> 00:23:43,960 Dion: Det bliver svært at presse dig op på 00:23:45,075 --> 00:23:47,255 Elma & Sille: det. Jeg tænker også, det var bedre at sige en time, end 00:23:47,875 --> 00:23:51,075 Elma & Sille: at det ved vi faktisk ikke. Det er også, det har vi også. 00:23:51,075 --> 00:23:54,595 Jeg tænker meget af det nok også, fordi når vi har snakket med dig mange gange før 00:23:54,755 --> 00:23:57,575 Dion: Det tænker jeg også. Det tager nogen med længere tid. 00:23:59,539 --> 00:24:04,500 Elma & Sille: Er der andre ting? Alt det vi har, det har man næsten fået svar på. 00:24:04,500 --> 00:24:05,880 Det tror jeg faktisk også. 00:24:06,820 --> 00:24:12,760 Men der er sikkert nogle ting, man kunne prøve det om. He<NAME>. 00:24:15,905 --> 00:24:19,205 Dion: Jeg tænkte, at vi lige skulle ringe hende ind. Det havde været smart. 00:24:19,745 --> 00:24:20,725 Elma & Sille: Sådan nu? 00:24:20,785 --> 00:24:22,645 Dion: Ja, det kan vi desværre ikke. 00:24:22,705 --> 00:24:25,680 Jeg er åbenbart på et eller andet. Holder noget kursus. 00:24:33,680 --> 00:24:37,360 Elma & Sille: Vi har faktisk spørgsmål med, hvor lang tid tager det at planlægge en ferie fra ansættelse til godkendelse? 00:24:37,360 --> 00:24:40,260 Dion: Den der slikmæssigt simpelthen. Hyggeligt. 00:24:44,435 --> 00:24:45,795 Elma & Sille: Nå, er det Zafir selvfølgelig. 00:24:45,795 --> 00:24:48,294 Det er sikkert Zafir, er det ikke det? 00:24:48,755 --> 00:24:49,795 Dion: Er det ikke hende selv? 00:24:49,795 --> 00:24:54,515 Er det ikke som HK-bolcher? Nå. Jo, det er det. 00:24:54,515 --> 00:24:56,455 Elma & Sille: flink under ved Zafir også. Ja, 00:25:12,245 --> 00:25:16,325 pension? Hva'? Det kan man ikke se. not looking anything. 00:25:16,325 --> 00:25:21,065 Dion: Nej, jeg synes også hun ser yngre ud end det. 00:25:28,950 --> 00:25:31,290 Elma & Sille: Hvor lang tid tager det at planlægge en ferie fra ansøgningen til godkendelse? 00:25:31,590 --> 00:25:36,090 Er det noget, der betyder noget I forhold til, hvad vi skal implementere? 00:25:39,745 --> 00:25:43,905 Dion: I Succes Factor tager det fem minutter eller noget. 00:25:43,905 --> 00:25:44,945 Det er blevet meget godt. 00:25:44,945 --> 00:25:46,565 Det plejede at være virkelig, vildt dårligt. 00:25:47,345 --> 00:25:49,045 Den gamle måde vi gjorde det på. 00:25:51,830 --> 00:25:56,950 Og jeg tænker, at det selvfølgelig skal være let, hvis man skal lægge det manuelt ind I jeres 00:25:56,950 --> 00:26:02,090 løsning, så vil jeg være mit bud på den første generation, så skal det være let, og det skal være nemt. 00:26:02,310 --> 00:26:05,845 Og det er også derfor, jeg tænker, de to koder der vil gøre det nemt. 00:26:05,845 --> 00:26:09,305 Der er et valg, du skal tage, og så skal du trykke to datoer I. 00:26:09,845 --> 00:26:13,545 Elma & Sille: Ja, fordi jeg synes allerede da jeg så, at der var klokkeslæt på, blev det lidt irriterende. 00:26:15,605 --> 00:26:17,065 Dion: Det skal være let og tilgængeligt. 00:26:18,600 --> 00:26:21,820 Elma & Sille: Men du siger, at det tager fem minutter inde på succescefet. 00:26:21,880 --> 00:26:27,800 Så der sidder ikke nogen, der skal godkende det. 00:26:27,800 --> 00:26:29,160 Det er mere jeg selv, der skal være. 00:26:29,160 --> 00:26:33,924 Dion: Jeg registrerer den. Jeg ved faktisk ikke engang, der er nogen notifikationer afsted, for der 00:26:33,924 --> 00:26:36,265 er ikke nogen af mine, der har taget ferie, end jeg blev chef for dem. 00:26:38,085 --> 00:26:39,924 Men det tror jeg ikke, der gør. 00:26:39,924 --> 00:26:44,325 Jeg tror bare, man har en aftale med sin chef om, at man lige informerer dem. 00:26:44,325 --> 00:26:47,460 Jeg tror ikke, der er officieltelsen af approval og godkendelsesflow I det 00:26:48,020 --> 00:26:51,640 Elma & Sille: Ja, for det er jo ikke vagtplaner at være kassedame. 00:26:51,700 --> 00:26:57,159 Dion: Og hvis vi ikke har balance tilgængelig, så kan vi registrere ferie. 00:26:57,700 --> 00:27:00,840 Elma & Sille: Okay, så den skal vi også lige huske at have in mente med ballancer. 00:27:02,655 --> 00:27:07,155 Hvis det er vi starter med, at de er isolerede for sig og ikke er integreret endnu. 00:27:07,215 --> 00:27:09,635 Dion: Jeg tænker, at ballancen er luksus. 00:27:11,615 --> 00:27:13,635 Det følger rigtig meget I identiteten. 00:27:13,775 --> 00:27:16,500 Nu har jeg haft fire komma nul otte også. 00:27:16,500 --> 00:27:21,940 Det vil sige, at jeg har halvanden time på et tidspunkt, jeg kan tage, fordi man optjener to 00:27:21,940 --> 00:27:24,360 komma nul fire, tror jeg, pr. Måned. 00:27:24,900 --> 00:27:28,260 Elma & Sille: Jeg troede, at man bare bliver givet sådan, efter ekstra tid får du lige tredive dage? 00:27:28,260 --> 00:27:33,664 Dion: Nej, nej. Den nye ferielov gør, at man kan optjene hele tiden. 00:27:33,664 --> 00:27:35,924 I stedet for at man får sådan en bunke om året. 00:27:37,424 --> 00:27:39,684 Og det har plusser og minusser I virkeligheden. 00:27:39,745 --> 00:27:43,424 Elma & Sille: Ja, fordi så kan man jo ikke Man kan ikke helt regne med det. 00:27:43,424 --> 00:27:50,279 Dion: Nej, nej. Jeg var inde også fordi jeg skulle være væk en hel måned her sommer, og der var ikke 00:27:50,279 --> 00:27:51,960 en hel måned tilgængelig I min. 00:27:51,960 --> 00:27:59,955 Så jeg lånte et par dage, så jeg registrerede kun til x, og så skulle jeg så registrere noget 00:28:00,115 --> 00:28:01,715 senere efter jeg var kommet hjem. 00:28:01,715 --> 00:28:02,355 Elma & Sille: Ja, det var også et andet. 00:28:02,355 --> 00:28:03,735 Dion: Og optjent det måneden efter. 00:28:04,835 --> 00:28:10,695 Så det kan faktisk godt være, at man skal have I feriepanelet sådan en overwrite mulighed. 00:28:11,315 --> 00:28:15,095 Lige meget hvad der er blevet lagt ind af SAP, så skal jeg kunne tilføje noget her. 00:28:15,715 --> 00:28:21,050 Elma & Sille: Det kunne også være fedt, at man kunne se forskellen og identificere, at det her er lånt. 00:28:21,050 --> 00:28:22,670 Dion: Ja, det er det jeg skylder. 00:28:22,730 --> 00:28:24,670 Og man kan highlighte det. 00:28:25,290 --> 00:28:32,175 Elma & Sille: Det var faktisk lige fedt at få det med. Hvad som det her? reccuring absence? 00:28:35,515 --> 00:28:36,895 Dion: Det kender ikke noget til. 00:28:37,435 --> 00:28:43,210 Jeg tror, det er, hvis man for eksempel har barsel, Så når man har barsel, så kan man lave nogle 00:28:43,210 --> 00:28:49,710 aftaler fordi du får lang tid, du kan bruge det indtil barnet er ni eller et eller andet sindssygt. 00:28:50,970 --> 00:28:55,275 Men så hvis du kun har brugt noget af din barn og du har gemt lad os sige tredive dage, så kan 00:28:55,275 --> 00:28:58,255 du sige, de næste tredive fredag, der ligger jeg fri. 00:28:58,635 --> 00:29:02,155 Fordi der skal mit barn til babysvømning eller hvad end? 00:29:02,155 --> 00:29:09,360 Elma & Sille: Ja, okay. Og den her attachment upload, det ville være til lægeerklæring af f. Eks. Dem fra broen. Ja, det 00:29:09,360 --> 00:29:09,920 Dion: tror jeg. 00:29:09,920 --> 00:29:11,360 Elma & Sille: Så det kunne også være fedt at have med? 00:29:11,360 --> 00:29:14,080 Dion: Ja. Nej, for det kommer herinde igennem. 00:29:14,080 --> 00:29:14,740 Elma & Sille: Nå okay. 00:29:15,440 --> 00:29:20,660 Dion: Altså jeg tænker, at der er mange af de alle de officielle krav, der er til feriregistrering. 00:29:21,145 --> 00:29:26,045 Det er alt sammen herinde, og det vil altid være herinde, for det er vores CRM system, SAP og ja. 00:29:28,105 --> 00:29:29,645 Elma & Sille: Så attachment, a file. 00:29:29,785 --> 00:29:32,485 Dion: Det er ikke sådan noget. 00:29:33,304 --> 00:29:39,500 Elma & Sille: Kunne du godt tænke dig, eller kunne I godt tænke dig, at det popper op som et vindue som her? 00:29:39,500 --> 00:29:43,200 Og at man skal plotte det ind, når man requester time off? 00:29:43,420 --> 00:29:45,820 Eller skal det være sådan, at man kan gå ind I nogle tabs? 00:29:45,820 --> 00:29:49,680 Hvilket vil være bedst rent oplevelsemæssigt for dig? 00:29:50,575 --> 00:29:51,955 Dion: Det er et rigtig godt spørgsmål. 00:29:52,894 --> 00:29:55,695 Elma & Sille: Ja, for det er jo også svært, at vi kan ikke få det til at teste det som sådan. 00:29:55,695 --> 00:29:58,095 Men her kommer der et vindue op og tabber du ind på det. 00:29:58,095 --> 00:30:02,434 Dion: Det har faktisk været til en anden gang, når jeg skal lave semi-strukturiets interviews. 00:30:02,975 --> 00:30:04,580 Have sådan nogle mock up med. 00:30:05,679 --> 00:30:11,620 På nogle design ideer på, om det skal være et stort kalender view, og hvad vil du gøre. Det var meget fedt. 00:30:13,320 --> 00:30:20,404 Jeg tror, jeg ville foretrække, hvis det var sådan et her. 00:30:20,404 --> 00:30:25,125 Så hvis jeg klikker og det kan jeg. Sådan der. 00:30:25,125 --> 00:30:26,585 Sådan ville jeg gerne have det. Fedt. 00:30:32,730 --> 00:30:33,630 Elma & Sille: Så virker den 00:30:47,185 --> 00:30:50,065 Dion: tænke, at når der så er en event herinde, så kan man klikke på den. 00:30:50,065 --> 00:30:54,885 Og så åbner man et firkant, hvor du så kan ændre og tilføje note. 00:30:57,585 --> 00:31:01,890 både højreklikke. Og så kan den et eller andet. Det kan den altså 00:31:04,450 --> 00:31:08,710 ikke. Ja Er add event? add days off? Add et note? Måske? Ja 00:31:12,690 --> 00:31:17,745 Elma & Sille: Og hvis man så har fire dage tilgængeligt og man så highlighter otte, så kunne det være at fire 00:31:18,385 --> 00:31:24,225 bliver farve og de andre bliver måske lidt grå for at signalere, at du har highlighet alle, 00:31:24,225 --> 00:31:25,425 men det er ikke alle der gælder. 00:31:25,425 --> 00:31:28,865 Dion: Det tænker jeg måske også, at det skal kun være tilgængeligt for den ene. 00:31:28,865 --> 00:31:31,040 Altså hvis der skal være en farveforskel på det. 00:31:31,260 --> 00:31:32,480 Elma & Sille: Jamen, så kan det godt blive forvirret. 00:31:32,860 --> 00:31:36,720 Dion: Ja, og jeg tænker heller ikke, det er relevant, at andre ved, at jeg også skylder ferie. 00:31:37,020 --> 00:31:38,460 Elma & Sille: Nej, det er ubehageligt. 00:31:38,460 --> 00:31:41,360 Dion: relevant for mig og min leder, og lederen kan se det I forvejen. 00:31:42,905 --> 00:31:44,765 Elma & Sille: Ja, det kan jeg godt forestille mig. 00:31:46,905 --> 00:31:51,804 Dion: Hvis det var min personlig planlægning, så ville det være meget lækkert, når man vidste, hvordan den skyldte til senere. 00:31:54,424 --> 00:31:56,105 Elma & Sille: Fordi så skal man jo selv have en mental note. 00:31:56,105 --> 00:31:58,520 Hvor mange har man brugt? Hvor mange skylder man? 00:32:06,140 --> 00:32:11,800 Elma & Sille: efter en måned. Prøv at tænke. Vi har jo så meget nu allerede. 00:32:16,795 --> 00:32:24,555 Jeg ved ikke om det er relevant, men Hvilket tænke er relevant, at man kan tilgå tidligere 00:32:24,555 --> 00:32:33,790 ferier, Eller skal det bare slettes, som man løbende kommer hen over det. Hvis det logger, i guess. 00:32:34,330 --> 00:32:39,370 Når man gemmer det, eller når man bare siger: Nu er vi færdige med den her uge, så er alt information 00:32:39,370 --> 00:32:40,695 fra den uge sådan set bare. 00:32:41,255 --> 00:32:46,315 Dion: Jeg tænker, at der er en eller anden form for time frame, der skal gemmes, hvis man går tilbage og tjekke. 00:32:47,095 --> 00:32:48,794 Men hvor lang den periode skal være? 00:32:51,894 --> 00:32:55,355 Elma & Sille: Ja, det er jo egentlig noget, man tester sig frem til. 00:32:56,320 --> 00:33:01,620 Dion: enten så tænker jeg, at det skal være tre måneder eller halvandet år. 00:33:01,840 --> 00:33:04,260 Og der er lidt lang imellem de to ting. Ja. 00:33:05,760 --> 00:33:10,845 Tre måneder fordi, du vil sjældent gå længere tilbage og kigge. 00:33:10,845 --> 00:33:16,625 Tre måneder, hvis det bare lige er sådan Jeg kan ikke huske, når den har startet sin ferie. 00:33:18,605 --> 00:33:25,210 Og halvandet år det ville være fordi, hvordan koordinerede vi vores sommerferie sidste år, kunne godt være relevant information. 00:33:27,190 --> 00:33:29,930 Hvordan plottet vi dem ind, og havde vi overlap der? 00:33:31,110 --> 00:33:32,150 Og hvem startede det sidste år. 00:33:32,150 --> 00:33:36,810 Elma & Sille: Det kan godt være, at det afhænger af , hvordan det ville fungere for os, og hvor meget vi kan tilføje. 00:33:36,870 --> 00:33:39,585 Men vi kunne sige max to år, hvis det er muligt. 00:33:39,585 --> 00:33:41,265 Og så mindst tre måneder. 00:33:41,265 --> 00:33:48,705 Dion: Og så tænker jeg I, at backend, hvis der bare er en mulighed for at justere på det, så er det også fint. 00:33:48,705 --> 00:33:51,445 For jeg tænker ikke, vi løber tør for disk plads. Nej, 00:33:52,225 --> 00:33:52,710 Elma & Sille: nej. 00:33:58,630 --> 00:34:01,130 Okay. Og så man I backend kan justere. 00:34:06,865 --> 00:34:14,005 Dion: Jeg sad bare lige og tænkte på, om det her view er bedre, sådan at firkanterne, versus det som Linda havde sendt. 00:34:17,585 --> 00:34:20,220 Det er jo sådan, det ser ud I dag. På en månedsview? 00:34:20,680 --> 00:34:22,700 Elma & Sille: Ja, det er jo sådan en kalender meget overordnet. 00:34:22,840 --> 00:34:28,540 Hvor den anden det er mere som: Hvad laver du på dagen? Altså, 00:34:31,720 --> 00:34:33,465 Dion: der er meget død plads her, ikke? 00:34:33,545 --> 00:34:39,065 Elma & Sille: Jo, altså rigtig meget. Fordelen er, at der ligner en klassisk kalender, så som du siger fra 00:34:39,065 --> 00:34:40,265 Boomerne, så er det jo dejligt. 00:34:40,265 --> 00:34:42,045 Dion: Ja, så den oversættelse godt. 00:34:43,705 --> 00:34:47,725 Men jeg tænker ikke, at den behøver at være sådan her. Det virker for dumt. 00:34:48,819 --> 00:34:54,579 Elma & Sille: Vi kunne godt på et tidspunkt, når vi får lavet nogen mock ups nok sende dem og spørge, hvad jeg, som 00:34:54,579 --> 00:34:55,880 vi har interviewet synes. 00:34:57,059 --> 00:34:58,099 Dion: Det var også lige, hvad jeg. 00:34:58,099 --> 00:35:04,664 Elma & Sille: Det var muligt Ligesom jeg fik mødet med Mats, hvor han viste, at der både er vertikalt og horisontale. 00:35:05,045 --> 00:35:06,964 At der måske også er forskellige muligheder. 00:35:06,964 --> 00:35:08,164 Man kan selv vælge at designe. Jeg kan 00:35:08,164 --> 00:35:10,025 Dion: få et bevis look og så er mega cool? 00:35:10,085 --> 00:35:11,144 Elma & Sille: Det havde været crazy. 00:35:16,650 --> 00:35:20,670 Den der synes jeg selv er lidt messy. 00:35:20,809 --> 00:35:24,589 Men jeg kan godt se, at det ligner den man har fysisk. Ja. Jeg 00:35:25,210 --> 00:35:27,549 Dion: synes ikke. Jeg synes ikke, den her den er god. 00:35:28,490 --> 00:35:30,589 Elma & Sille: Jeg tror, at jeg ville kunne prefer den anden. 00:35:32,435 --> 00:35:34,535 Dion: Det kunne jeg også godt se mig selv gøre I virkeligheden. 00:35:36,595 --> 00:35:39,895 Elma & Sille: Fordi her er du egentlig 00:35:43,075 --> 00:35:46,069 Du er limited til den mængde dage. 00:35:46,769 --> 00:35:49,569 Dion: Men det her ødelægger bare hele min hjerne. 00:35:49,569 --> 00:35:50,549 Elma & Sille: Ja, det er også lidt mærkeligt. 00:35:54,369 --> 00:35:55,670 Nogen gange gøre det det. 00:35:56,609 --> 00:35:58,505 Det gør min pille æske også. Det er vel 00:35:59,204 --> 00:35:59,365 Dion: færdigt. 00:35:59,365 --> 00:36:00,724 Elma & Sille: Alt sådan amerikansk ting måske. 00:36:00,724 --> 00:36:04,664 Dion: Ja, det tror jeg. Hun starter fra på mandag. 00:36:10,960 --> 00:36:16,720 Jeg tror også jeg ville Altså det skal ikke være det der. Det skal det ikke. 00:36:16,720 --> 00:36:18,480 I hvert fald ikke med så meget død plads her. 00:36:18,480 --> 00:36:19,940 Det er jo fuldstændig hul i hovedet. 00:36:20,160 --> 00:36:23,200 Elma & Sille: Nej nej, så ville det måske være bedre at squeeze det sammen, 00:36:23,200 --> 00:36:23,360 Dion: og så 00:36:23,360 --> 00:36:26,065 Elma & Sille: have endnu flere måneder også måske. Ja. 00:36:26,065 --> 00:36:27,145 Så have de der tre måneder 00:36:27,145 --> 00:36:33,565 Dion: op til. Og hvis man kunne få et billede ind I stedet for en farvekode. Altså konge. 00:36:35,464 --> 00:36:39,405 Jeg kan sgu da ikke huske om AIK er orange. 00:36:40,560 --> 00:36:44,020 Elma & Sille: Ja, så det er sådan en blanding. 00:36:44,720 --> 00:36:45,940 Det er lidt mere firkantede. 00:36:46,160 --> 00:36:50,480 Så de er ikke så aflangt, men de er heller ikke så store firkanter som det var I den anden kalender. 00:36:50,480 --> 00:36:52,740 Det kunne skabe et større overblik. 00:36:55,395 --> 00:36:59,015 Og så det står navn og farver. 00:36:59,475 --> 00:37:02,055 Dion: Initialerne er vigtig om farverne, synes jeg. 00:37:03,635 --> 00:37:07,095 Elma & Sille: For farverne er det jo egentlig bare for det generelle overblik. Altså lige hurtigt kigge. 00:37:07,560 --> 00:37:10,220 Hvis man har flere members inde I et team. 00:37:10,760 --> 00:37:17,720 Dion: Men der skal man bare ned og så Gud nåh Hvis der skal komme en firkant ind, hvis jeg havde registreret 00:37:17,720 --> 00:37:19,900 ferie, så kommer der en firkant ind også hvor der står DAD i midten af den. 00:37:20,360 --> 00:37:22,380 Så vil man godt have en farve også. Det er fint. 00:37:23,395 --> 00:37:26,615 Elma & Sille: Det jeg forestiller mig, det vil være, at det ligner det på Teams. 00:37:26,675 --> 00:37:32,515 På Microsoft Teams, hvor I har de Teams, og så kan I hover eller klikke dem, og så kommer de 00:37:32,515 --> 00:37:35,255 frem og viser kalenderen med farverne. 00:37:35,480 --> 00:37:37,880 Og så kan I se farverne ud fra der hvor jeg 00:37:37,880 --> 00:37:39,400 Dion: har teams panel ude I siden. 00:37:39,400 --> 00:37:40,119 Elma & Sille: Lige nok de der. 00:37:40,119 --> 00:37:41,819 Dion: Klikker på den og så kommer de ind. 00:37:43,240 --> 00:37:47,985 Elma & Sille: Og så kan man se dem farvemæssigt også, så man kan differentiere med dem. 00:37:48,465 --> 00:37:52,005 Det forestiller mig bare lige nu uden at vi ligesom snakker om det. 00:37:54,625 --> 00:37:58,785 Men noget jeg tænker helt klart vi burde gøre det ville være at lave de mock-ups og sende dem til jer. 00:37:58,785 --> 00:38:00,085 Og så kunne vi se hvad 00:38:33,930 --> 00:38:36,030 SMA? Jeg ved ikke, om det er næsten? 00:38:39,690 --> 00:38:43,290 TU? Ja, det er lidt irriterende når man skal ned og se hvilken farve. Så tænker jeg, 00:38:43,290 --> 00:38:44,109 Dion: at det er den dato, 00:38:46,569 --> 00:38:47,210 Elma & Sille: det er blevet sådan. 00:38:47,210 --> 00:38:49,069 Dion: Nå, det er jeg selvfølgelig. 00:38:50,184 --> 00:38:53,885 Elma & Sille: Men det var det også til at nævne. Når det er farvekoordinator. 00:38:56,585 --> 00:38:59,164 Ja, det burde måske mere highlighte hvilket David på. 00:39:00,984 --> 00:39:03,244 Sådan en border-agtigt kunne det være I stedet for. 00:39:06,150 --> 00:39:10,230 Det er dejligt. Vi er nu, tro frem det du 00:39:10,230 --> 00:39:12,010 Dion: også. Perfekt. 00:39:15,830 --> 00:39:21,435 Elma & Sille: Vi har nået alt. Vi har mere til. Ja. Det var mega dejligt. 00:39:21,435 --> 00:39:23,214 Dion: Jeg er virkelig spændt på, hvor langt I når. 00:39:24,395 --> 00:39:27,755 Elma & Sille: Altså, vi havde jo forhåbninger om, at man kunne færdiggøre det. 00:39:27,755 --> 00:39:30,095 Fordi det var mega fedt, at kom det vi gerne på. 00:39:32,079 --> 00:39:33,359 Så vi er blevet mega spændt. 00:39:33,359 --> 00:39:36,099 Så vi håber jo på, at kunne lave noget rent faktisk. 00:39:36,160 --> 00:39:38,099 Dion: Men ellers går vi bare videre på næste semester. 00:39:38,960 --> 00:39:40,640 Elma & Sille: Der skal vi lave et sprog. Hvad er 00:39:40,640 --> 00:39:41,599 Dion: sådan noget okay her? 00:39:41,599 --> 00:39:43,920 Elma & Sille: Hvis vi lige har lyst til at lave det hele om til et nyt sprog. 00:39:43,920 --> 00:39:45,520 Dion: Ja, det kan man jo sagtens gøre. 00:39:45,520 --> 00:39:47,055 Elma & Sille: KMD kan lave sit eget sprog? 00:39:47,934 --> 00:39:48,974 Dion: Det tror jeg faktisk vi har. 00:39:48,974 --> 00:39:52,595 Elma & Sille: har i det Det kan vi ikke viderearbejde. 00:39:52,655 --> 00:40:01,220 Dion: Jeg er mega autist. Der byggede et sprog til noget AI, tror jeg faktisk. Nede fra Aarhus. 00:40:01,440 --> 00:40:02,340 Elma & Sille: Er det godt? 00:40:02,760 --> 00:40:04,660 Dion: Ja. Hedder det Alexa, 00:40:04,800 --> 00:40:07,540 Elma & Sille: tror jeg. Alexa. Det virker ikke særlig originalt. 00:40:08,160 --> 00:40:09,600 Eller er det ham, der hedder Alexa? 00:40:09,600 --> 00:40:10,580 Dion: Nej, et sproget hedder det. 00:40:14,085 --> 00:40:15,785 Elma & Sille: Så kan jeg vælge en der hedder Siri. 00:40:26,210 --> 00:40:31,809 Det kan selvfølgelig godt være, at det er på engelsk, fordi det er AI kode sprog. 00:40:31,809 --> 00:40:33,190 Dion: Jeg vil virkelig ikke huske det. 00:40:37,490 --> 00:40:41,444 Jeg mener altså bare, at du lavede nyheder om det. Men han er stoppet. 00:40:41,984 --> 00:40:43,424 Elma & Sille: Nå, så den kom ikke videre. 00:40:43,424 --> 00:40:45,605 Dion: Han fik noget psyko job I stedet for. 00:40:46,145 --> 00:40:51,285 Elma & Sille: Hvis man kan sidde og lave et sprog også, og det ikke er en opgave decideret, så er det jo, hvad kan I se. 00:41:01,970 --> 00:41:03,109 Er det jeres egen sådan, 00:41:03,890 --> 00:41:07,890 Dion: Facebook? Nej, faktisk ikke. Det er bare vores Internet. 00:41:07,890 --> 00:41:11,684 Det er faktisk det Linda, hun arbejder med. Det er SharePoint. 00:41:12,704 --> 00:41:16,724 Det er et standard filbibliotek, som man bare lægger og lever over. 00:41:19,585 --> 00:41:22,005 Elma & Sille: Ja, det bruger man jo typisk I os på. 00:41:22,224 --> 00:41:24,625 Dion: Vores corporate Facebook det er det her: 00:41:34,390 --> 00:41:36,250 Vi er vel enganged, er det nu. 00:41:41,225 --> 00:41:42,505 Elma & Sille: også folk, de skriver engelsk. 00:41:42,505 --> 00:41:43,645 Dion: Det er kun engelsk. 00:41:43,865 --> 00:41:44,605 Elma & Sille: Nå okay. 00:41:44,985 --> 00:41:46,205 Dion: Også på internettet. 00:41:47,465 --> 00:41:48,845 Elma & Sille: Har I så mange internationale? 00:41:49,225 --> 00:41:51,945 Dion: Ja. Så er syv hundred I Polen. 00:41:51,945 --> 00:41:56,809 Og så sidder der tre hundred I Indien måske. 00:41:57,510 --> 00:41:58,390 Elma & Sille: tre hundred? 00:41:58,390 --> 00:42:00,890 Dion: Ja, og så har vi vores leverandører. 00:42:01,190 --> 00:42:06,329 Var jo kintel, som kom fra IBM. En Off chute derfra. 00:42:06,695 --> 00:42:11,755 Og de har kontorer I Det var ikke Ukraine, men noget tæt på. 00:42:14,055 --> 00:42:15,435 Elma & Sille: Hvis Ungarn? Ja. 00:42:18,615 --> 00:42:24,380 Dion: Kontor I Ungarn. Her? Alle vi samarbejder med, snakker jo engelsk nærmest. 00:42:26,600 --> 00:42:29,180 Jeg tror vi er fire hundred her I Aalborg. 00:42:31,080 --> 00:42:34,220 Elma & Sille: Har-fire hundred medarbejdere I Aalborg? Ja. Den er big 00:42:34,760 --> 00:42:37,855 Dion: over halveret I Aalborg I de sidste ti år. 00:42:39,275 --> 00:42:42,075 Elma & Sille: Ja, det er jo ikke kun en KMD, der er her I har også 00:42:42,075 --> 00:42:46,815 Dion: andre ting. Der plejede kun at være KMD her, og der plejede at være for mange her til, at det var lovligt. 00:42:47,035 --> 00:42:49,615 Der sad tusinde hundred KMD'er kun I Aalborg. 00:42:50,410 --> 00:43:01,150 Og så hele kælderen under jordniveau her det var en stor serverpark hele vejen hen og den er vandkølet med fjorden. 00:43:02,170 --> 00:43:07,045 Så der sidder et indtag hernede og en pumpe som så vandkøler hele bygningen. 00:43:07,744 --> 00:43:12,545 Alt vores aircon herinde også, det er alle sammen fjordkølet. Det er mega sejt. 00:43:12,545 --> 00:43:13,365 Elma & Sille: Det er helt grønt. 00:43:14,145 --> 00:43:17,845 Dion: Der sidder bare en tyve år gammel pumpe dernede, der er ved at ruste fra hinanden. 00:43:18,065 --> 00:43:18,565 Elma & Sille: Men 00:43:20,790 --> 00:43:22,410 Dion: det er meget sejt, synes jeg. Det 00:43:22,790 --> 00:43:24,390 Elma & Sille: er virkelig fedt. Men altså jer, der ejer den. 00:43:24,390 --> 00:43:25,910 For vi snakker nemlig om Det 00:43:25,910 --> 00:43:27,450 Dion: er pensions selvskab, der ejer bygningen. 00:43:28,390 --> 00:43:33,050 Elma & Sille: For vi hørte knirkel, og så sagde vi: De har brugt flere penge på stolene af den end bygningen. 00:43:33,990 --> 00:43:35,590 Det er kommunen der ejer, er det ikke det? 00:43:35,590 --> 00:43:41,371 Dion: Ja, det er er PFA-pensionen, tror jeg måske. Ja, fordi. 00:43:41,964 --> 00:43:44,845 Elma & Sille: Ja, fordi nu har I jo også Modstyrelsen, der 00:43:44,845 --> 00:43:50,840 Dion: har I været ude til at vedligeholde bygningen. for KMD. 00:43:50,840 --> 00:43:53,180 I bund og grund er det fordi, vi ikke kan finde ud af det. 00:43:54,120 --> 00:43:57,420 Vi er jo ikke gode til at styre håndværkere, og det fatter hvilken bjælle er. 00:43:57,560 --> 00:44:00,780 Så vi prøver at fokusere på det, vi er gode til, og det er sgu ikke at vedligeholde bygninger. 00:44:01,080 --> 00:44:05,525 Vi skal ringe til nogle når stykker, ligesom de skal ringe til nogle med deres it-stykker I stykker. 00:44:05,984 --> 00:44:07,444 Elma & Sille: Er de så flyttet herind? Der 00:44:08,305 --> 00:44:09,925 Dion: går to eller tre mand rundt. 00:44:09,984 --> 00:44:10,625 Elma & Sille: Bare sådan. 00:44:10,625 --> 00:44:12,365 Dion: Og bare passer bygningen. 00:44:12,865 --> 00:44:13,684 Elma & Sille: Spændende. 00:44:14,625 --> 00:44:14,944 Dion: Det er da 00:44:14,944 --> 00:44:17,460 Elma & Sille: fedt at være hyret sammen KMD's bygning. Han er 00:44:17,460 --> 00:44:17,940 Dion: handy Mans mand. 00:44:17,940 --> 00:44:19,060 Elma & Sille: Ja, og så går de bare rundt. 00:44:19,060 --> 00:44:21,859 Hvis ikke jeg har noget at lave, så er de måske bare hjemme. 00:44:21,859 --> 00:44:24,440 Dion: Det har vi faktisk. Vi ejer ikke nogen bygninger. 00:44:25,540 --> 00:44:29,000 Så også I Ballerup, der har vi også lejet ind hos et eller andet selskab. 00:44:29,815 --> 00:44:31,975 Elma & Sille: Er det godt I Ballerup? Er det større der nede? 00:44:31,975 --> 00:44:34,215 De har jo nok nok. Det er det? 00:44:34,215 --> 00:44:34,795 Dion: Ja, virkelig. 00:44:35,255 --> 00:44:36,935 Elma & Sille: Jeg synes jeg, det har du passet på det. 00:44:36,935 --> 00:44:37,835 Dion: Det har det ikke. 00:44:38,535 --> 00:44:40,635 Elma & Sille: Jamen det 00:44:41,735 --> 00:44:48,670 Dion: er den oprindelige. Ballerup kontor er den del af bygningen, vi stadig har, den er mega gammel. 00:44:48,810 --> 00:44:52,109 Og den nye del af bygningen er blevet lejet ud til novo nordisk i sted for. 00:44:52,170 --> 00:44:52,670 Elma & Sille: De 00:44:53,450 --> 00:44:59,875 Dion: ville betale flere og så er det bare Det ligger jo i Ballerup. 00:45:00,015 --> 00:45:01,555 Det er ikke sådan et frit sted. 00:45:02,815 --> 00:45:07,775 Meget industri og Det er bare ikke nice. 00:45:07,775 --> 00:45:10,335 Elma & Sille: Der var jeg bare dengang, jeg var på mange Ballerup. 00:45:10,335 --> 00:45:11,555 Det var lidt ligesom mange. 00:45:13,610 --> 00:45:16,510 Dion: Vi har den her, og så har vi en på Frederiksberg, som er rimeligt cool Også 00:45:16,570 --> 00:45:20,910 Det er en gammel skolebygning, tror jeg. 00:45:21,610 --> 00:45:22,890 I røde sten og sådan noget. 00:45:22,890 --> 00:45:26,535 Det er latterligt eller dyr, men det er meget gult. Så vi 00:45:26,535 --> 00:45:27,655 Elma & Sille: har det bedre I Aalborg? 00:45:27,655 --> 00:45:28,155 Dion: Ja. 00:45:28,295 --> 00:45:33,494 Elma & Sille: Det er nok derfor, som du sagde sidste gang, at folk I Aalborg ser op til KMD? 00:45:33,494 --> 00:45:37,434 Dion: Ja, jeg tror det har mega meget at sige, at vi har en fed lokation. 00:45:38,220 --> 00:45:44,780 Elma & Sille: Det har det. Hvis man siger, at der er noget forventet og det der. Det er mega fedt. 00:45:44,780 --> 00:45:46,800 Dion: Nu har vi motorstyrelsen sådan her. 00:45:47,820 --> 00:45:51,420 Elma & Sille: Der arbejder min brors kone. Kære fod. 00:45:51,420 --> 00:45:53,915 Dion: Vi kalder dem motorforstyrrelsen. Ja, 00:45:55,175 --> 00:45:58,235 Elma & Sille: så må der være et eller andet internt en fight, det er jo lidt sjovt. 00:45:58,295 --> 00:46:02,715 Dion: Det er sjovt. Man kan hvile til forskel for hvem der arbejder, hvor, hvis man sådan ser i kantinen. 00:46:03,335 --> 00:46:03,575 Elma & Sille: Der er 00:46:03,575 --> 00:46:13,200 Dion: mega forskel på kulturen for hvad tøj man har på og de har mange flere brune mennesker ansat ved motorstyrelsen. 00:46:13,740 --> 00:46:15,100 Der er virkelig ikke særlig mange KMD. 00:46:15,100 --> 00:46:16,540 Det vil vi være dårlige til. 00:46:16,540 --> 00:46:17,280 Elma & Sille: Til hvad? 00:46:17,660 --> 00:46:18,140 Dion: brune mennesker. 00:46:18,140 --> 00:46:19,100 Elma & Sille: Nååh, altså lav 00:46:19,100 --> 00:46:19,760 Dion: op her. 00:46:19,820 --> 00:46:23,305 Elma & Sille: Okay, <NAME> ligner bare megen menneske. 00:46:23,605 --> 00:46:28,265 Dion: Vi har måske ti, og de er Indere allesammen. 00:46:29,525 --> 00:46:34,724 Elma & Sille: Er de også på Han har fysisk? Ja. Og 00:46:34,724 --> 00:46:37,464 Dion: så har vi en, der er Inder, men er fra Danmark. 00:46:40,860 --> 00:46:42,560 Han har det ikke altid til sjovt tror jeg ikke. 00:46:43,020 --> 00:46:45,920 Bliver folk bare defaulter til engelsk, når de snakker til ham. 00:46:47,420 --> 00:46:53,115 Elma & Sille: Typisk tænker man, folk tænker sotware Inder, ja, kommer der op. 00:46:53,255 --> 00:46:57,335 Dion: Alle de andre vi har, det er jo nogen der kommer fra kontoret i Indien det, der skal være en anden 00:46:57,335 --> 00:47:00,315 form for point of contact. Jeg 00:47:01,495 --> 00:47:03,195 Elma & Sille: kan godt forestille mig, at det ikke er noget. 00:47:05,415 --> 00:47:10,190 I forhold til sproget tænker du, at løsningen skal være på engelsk? Ja. Og hvis 00:47:10,190 --> 00:47:11,970 Dion: ja, Alt andet er irrelevant. 00:47:12,590 --> 00:47:15,550 Elma & Sille: Super. Så boomer skal acceptere det, hvis de ikke kan. 00:47:15,550 --> 00:47:16,610 Men det kan de nok godt 00:47:19,470 --> 00:47:20,530 Må man håbe? 00:47:21,414 --> 00:47:25,815 Dion: Vi får altid klager, når vi sender mails ud I engelsk. Det gør vi. 00:47:25,815 --> 00:47:29,414 Elma & Sille: Tror du, at man skal lave en mulighed for det? Nej, det skal 00:47:29,414 --> 00:47:34,795 Dion: man ikke. Det er simpelthen bare get onboard or get out. 00:47:36,230 --> 00:47:38,890 Elma & Sille: Så kommer nogle nye. der kan egelsk. 00:47:40,390 --> 00:47:44,470 Dion: Altså så skal det være, fordi det tager jeg tredive sekunder at lægge på som en feature. 00:47:44,470 --> 00:47:46,410 Eller så skal i ikke lægge tid I det overhovedet. 00:47:46,790 --> 00:47:49,450 Elma & Sille: Okay, så hvis vi har ekstra tid og vi tænker. 00:47:50,375 --> 00:47:50,641 Dion: Det kan 00:47:50,641 --> 00:47:55,095 Elma & Sille: godt være. Det kunne også godt være at I synes det er så fedt, at I kunne hyre os efter og så lader vi 00:47:57,494 --> 00:48:06,220 Elma & Sille: også alle syv member. Sproget ville også være en del af analysen. Så kunne det 00:48:06,440 --> 00:48:07,000 Dion: jo være en 00:48:07,000 --> 00:48:07,799 Elma & Sille: del af analysen. 00:48:07,799 --> 00:48:11,819 Dion: Hvis I rammer en ældre projektleder, så siger de bare, at det skal være der. 00:48:12,279 --> 00:48:13,740 Elma & Sille: Så er der ikke noget, som I kan gøre. 00:48:14,279 --> 00:48:19,954 Man kan også sige, at det er noget man stærkt overvejer I vores analyse, men grundet tid. 00:48:21,295 --> 00:48:21,934 Dion: Og det betyder stadig 00:48:21,934 --> 00:48:22,575 Elma & Sille: at vi har overvejet det. 00:48:22,575 --> 00:48:26,115 Dion: Corporate landing på engelsk. Det må være, at min må vare på product. 00:48:32,500 --> 00:48:34,520 Elma & Sille: Det håber jeg, det går godt med de andre interviews. 00:48:36,260 --> 00:48:37,720 Dion: Hvor mange havde I dag tre ikke? 00:48:38,980 --> 00:48:41,640 Elma & Sille: Ja. Det er fjerde er på ferie. 00:48:41,940 --> 00:48:43,185 Hun kommer vist den her uge. 00:48:50,225 --> 00:48:53,845 Vi startede os med at se Katrine allerede fra start af. 00:48:53,905 --> 00:48:56,400 Jeg tror også, jeg sagde noget sidste uge. 00:48:56,700 --> 00:48:58,380 Dion: Ej, hende skal ikke glæde dig til at tage hende til mig. 00:48:58,380 --> 00:49:02,080 Elma & Sille: Hun er bare Der er det der da jeg synes. 00:49:02,940 --> 00:49:06,160 Dion: Hun er bare en kæmpe bombe af energi. 00:49:06,220 --> 00:49:11,025 Elma & Sille: Hvor det er dejligt. Vi hapser hende. Det er blevet uddelt. 00:49:11,485 --> 00:49:14,605 Det er Mads og Zafir. Så de har to. 00:49:14,605 --> 00:49:15,645 Det er rigtig meget heldige. 00:49:15,645 --> 00:49:17,005 Så hapser vi bare de her. 00:49:17,005 --> 00:49:20,365 Dion: Hvis jeg skulle være venner med hende I virkeligheden, altså udenfor arbejdet, så skulle jeg 00:49:20,365 --> 00:49:22,145 kun ses med en gang om måneden. 00:49:24,549 --> 00:49:27,510 Elma & Sille: Fantastisk. Så sådan en der bombe Energi, 00:49:27,510 --> 00:49:30,730 Dion: det er også gode. Utroligt varm og højlydt. 00:49:32,230 --> 00:49:33,770 Elma & Sille: Det er godt. Det er positivt. 00:49:35,510 --> 00:49:39,175 Så prøver vi at <NAME>. 00:49:39,555 --> 00:49:40,775 Vi prøver at <NAME>. 00:49:44,435 --> 00:49:46,615 Der skriver vi en mail til en idag eller i morgen. 00:49:47,395 --> 00:49:49,895 Dion: Jeg tror først, hun er første tilgængelig efter torsdag. 00:49:50,115 --> 00:49:53,570 Elma & Sille: Okay. Jeg kan ikke lige huske, at vi var aftalt. 00:49:53,570 --> 00:49:55,430 Det var enten I morgen eller over morgen, vi skulle mødes. 00:50:05,795 --> 00:50:06,695 Dion: Nej bare det nærmere. 00:50:08,515 --> 00:50:10,115 Elma & Sille: Okay. Okay, hvem så skriver vi til i morgen. 00:50:10,115 --> 00:50:11,415 Så kunne I se os gå til konference. 00:50:12,355 --> 00:50:13,815 Det er ret fedt I voksensfund. 00:50:16,595 --> 00:50:20,430 Det fedeste er, når man skal ud og rejse hele tiden. Det er mega fedt. 00:50:20,430 --> 00:50:23,650 Dion: Det er meget begrænset efter corona, så rejser vi ikke så meget mere. 00:50:25,710 --> 00:50:26,930 Vi plejer at være meget mere. 00:50:27,550 --> 00:50:29,790 Skal du have møde med hende, så bare flyve der hen 00:50:29,790 --> 00:50:32,995 Elma & Sille: vildt fint. Jeg har jo min veninde, som er productdonor for Bestseller. 00:50:32,995 --> 00:50:35,815 Hun er hele tres sammen, Saam, lørdag, Polen. 00:50:36,195 --> 00:50:39,415 Måske ikke ved, at hun er Polen, men hun er I hvert fald om mange steder. 00:50:39,555 --> 00:50:40,435 Dion: Kom med hende. 00:50:40,435 --> 00:50:41,255 Elma & Sille: Det er Mads
https://github.com/NIFU-NO/nifutypst
https://raw.githubusercontent.com/NIFU-NO/nifutypst/main/_extensions/nifu_pub/typst-template.typ
typst
MIT License
#import "@preview/tablex:0.0.5": tablex, cellx, hlinex #let NIFU_report( title: none, subtitle: none, authors: (), report_type: none, report_no: none, abstract: none, paper: "a4", margin: (x: 4.2cm, y: 3.5cm), fontsize: 10.5pt, lang: "nb", preface: none, project_no: none, funder: none, funder_address: none, references: none, appendix: none, isbn: none, issn: none, date: none, signer_1: none, signer_1_title: none, signer_2: none, signer_2_title: none, figure_table: false, table_table: false, doc ) = { set page( paper: paper, margin: margin, footer: locate(loc => { if counter(page).at(loc).first() > 2 [ #align(center)[ #text(spacing: 0.2cm)[ #text(size: 11pt)[#counter(page).display()] #text( fill: if report_type == "rapport" {rgb("#C84957")} else {rgb("#2D8E9F")}, size: 12pt)[#symbol("•")] #text( size: 8pt, spacing: 0.1cm, font: "Calibri")[Rapport #report_no]]]] }), background: locate(loc => { if counter(page).at(loc).first() == 1 [ #image("_images/cover_nedre.png")] } )) let concatenatedAuthors = if type(authors) != "string" [ #authors.join(", ", last: " og ") ] else [#authors] set heading(numbering: "1.1.1 ") set par( justify: true, first-line-indent: 0.6cm, leading: 0.8em) show par: set block(below: 0.8em) set text( font: "Cambria", size: fontsize) show heading.where(level: 1): it => { if it.numbering != none { colbreak(weak: true) set text( size: 23.5pt, weight: "semibold", font: "Calibri") block( width: 100%, below: 3em, inset: (left: -1.75em))[#text(it)] } else { colbreak(weak: true) set text( size: 23.5pt, weight: "semibold", font: "Calibri") block( width: 100%, below: 3em )[#text(it)] parbreak() } } show heading.where(level: 2): it => [ #set text( size: 15.5pt, weight: "semibold", font: "Calibri") #block( width: 100%, above: 3em, below: 1em, inset: (left: -2.5em))[#text(it)]] show heading.where(level: 3): it => [ #set text( size: 13.5pt, weight: "semibold", font: "Calibri") #block( width: 100%, above: 3em, below: 1em, inset: (left: -3.1em))[#text(it)]] show outline.entry.where(level: 1): it => { set text( weight: "semibold", size: 13pt) block( width: 100%, below: -0.5em, //inset: (left: 0.75em), above: 2em)[#text(it)] } show outline.entry.where(level: 2): it => { set text( weight: "regular", size: 12pt) block( below: -0.8em, width: 100%)[#text(it)] } show figure.where(kind: "quarto-float-fig"): it => { block(width: 100%)[ #it.body #set align(left) #text(weight: "bold", font: "Calibri")[#it.caption]] } show figure.where(kind: "quarto-float-tbl"): it => { block(below: 3em) block(width: 100%)[ #set align(left) #text(weight: "bold", font: "Calibri")[#it.caption] #it.body] } if title != none { set par(leading: 0.55em) place(dx: -6.4em, dy: 32em)[ #align(left)[ #block(inset: 2em)[ #text( weight: "semibold", size: 23pt, font: "Calibri" )[#title]]]] } place(dx: 36.2em, dy: 25em)[ #circle( radius: 11pt, fill: if report_type == "rapport" {rgb("#C84957")} else {rgb("#2D8E9F")}, stroke: white) ] if subtitle != none { set par(leading: 0.55em) place(dx: -6.4em, dy: 36em)[ #align(left)[ #block(inset: 2em)[ #text( weight: "regular", size: 15.5pt, font: "Calibri" )[#subtitle]]]] } if report_no != none { set par(leading: 0.65em) place(dx: 34em, dy: 29em)[ #align(right)[ #text( size: 12.5pt, font: "Calibri" )[Rapport #linebreak()#report_no]]] } if authors != none { place(dx: -4.2em, dy: 56em)[ #align(left)[ #text( size: 12.5pt, font: "Calibri" )[#concatenatedAuthors]]] } pagebreak() pagebreak() place(dx: -6em, dy: 38em)[ #set par(leading: 0.55em) #align(left)[ #block(inset: 2em)[ #text( weight: "semibold", size: 23pt, font: "Calibri", )[#title]]]] place(dx: -6em, dy: 46em)[ #set par(leading: 0.55em) #align(left)[ #block(inset: 2em)[ #text( weight: "regular", font: "Calibri", size: 15.5pt )[#subtitle]]]] place(dx: 34em, dy: 29em)[ #set par(leading: 0.55em) #align(right)[ #text( size: 12.5pt, font: "Calibri" )[Rapport #linebreak() #report_no]]] place(dx: -4.2em, dy: 56em)[ #set par(leading: 0.55em) #align(left)[ #text( size: 12.5pt, font: "Calibri" )[#concatenatedAuthors]]] line( stroke: 1.5pt + rgb("#C84957"), length: 22%, start: (-4.2em, 54em)) counter(page).update(1) pagebreak() tablex( columns: (1.1fr, 3.5fr), auto-lines: false, map-cells: cell => { (..cell, content: text(size: 9pt)[#cell.content]) }, align: left, [Rapport], [#report_no], [Utgitt av], [Nordisk institutt for studier av innovasjon, forskning og utdanning], [Adresse], [Postboks 2815 Tøyen, 0608 Oslo. Besøksadresse: Økernveien 9, 0653 Oslo], [], [], [Prosjektnr.], [#project_no], [], [], [Oppdragsgiver], [#funder], [Adresse], [#funder_address], [], [], [Fotomontasje], [NIFU], [], [], [ISBN], [#isbn], [ISSN], [#issn]) image("_images/CC-BY.svg", width: 8em) text(size: 9pt)[Copyright NIFU: CC-BY-4.0] block(above: 3em)[#text(size: 9pt)[www.nifu.no]] pagebreak() block( width: 100%, below: 10em )[ #text( size: 23.5pt, weight: "semibold", font: "Calibri", )[Forord]] if preface != none { preface } block( width: 100%, spacing: 4em )[#text()[Oslo, #date]] grid( columns: 2, column-gutter: 15em, rows: 2, row-gutter: 1em, text()[#signer_1], text()[#signer_2], text()[#signer_1_title], text()[#signer_2_title]) pagebreak() linebreak() outline( title: block()[#text( font: "Calibri", weight: "semibold", size: 23.5pt )[Innhold]], depth: 2, indent: none) pagebreak() doc if references != "" { set par(first-line-indent: 0pt) set block( inset: (left: 1.5em) ) bibliography( references, title: [Referanser], style: "apa")} if appendix != none { [hargle bargle] } if table_table { outline( title: block()[#heading(text()[Tabelloversikt], outlined: true)], target: figure.where(kind: "quarto-float-tbl"), depth: 1) } if figure_table { outline( title: block()[#heading(text()[Figuroversikt], outlined: true)], target: figure.where(kind: "quarto-float-fig"), depth: 1) } pagebreak() counter(page).update(0) place(dy: 45em)[ #text()[ Nordisk institutt for studier av #linebreak() innovasjon, forskning og utdanning #linebreak() #linebreak() Nordic institute for Studies in #linebreak() Innovation, Research and Education #linebreak() #linebreak() www.nifu.no]] }
https://github.com/AHaliq/CategoryTheoryReport
https://raw.githubusercontent.com/AHaliq/CategoryTheoryReport/main/chapters/chapter1/mandatory.typ
typst
#import "../../preamble/lemmas.typ": * #import "../../preamble/catt.typ": * #import "@preview/fletcher:0.5.1" as fletcher: diagram, node, edge #exercise("1")[ Let $T_0$ send a set $X$ to its powerset $cal(P)(X)$... ] We show that $T=(T_0,T_1)$ is a functor by @defn-functor #figure( table( columns: 2, align: (right, left), [structure], [definition], [domains], $T_1(f)=[A |-> {f(x) | x in A}]$, [identity], $T_1(1_A)= T_1(id) = id = 1_(T_0(A))$, [composition], $T_1(g comp f) = T_1(g) comp T_1(f)$, ), ) #proof(name: "composition")[$ T_1(g comp f) &= [A |-> {g(f(x)) | x in A}] \ &= [A |-> {g(y) | y in {f(x) | x in A}}] \ &= [A |-> {g(y) | y in T_1(f)(A)}] \ &= [A |-> [B |-> {g(y) | y in B}](T_1(f)(A))] \ &= [A |-> T_1(g)(T_1(f)(A))] \ &= [A |-> (T_1(g) comp T_1(f))(A)] \ &= T_1(g) comp T_1(f) $ $therefore T$ is a functor from $Set$ to $Set$ ] #exercise("2")[ Define the category $bb(K)$ as follows ... ] $bb(K)$ morphisms are left total relations for objects in $Set$. The relations are encoded as functions mapping an element of $X$ to a subset of $Y$. Thus we can show $bb(K)$ is a category by @defn-cat. #figure( table( columns: 2, align: (right, left), [properties], [definition], [composition], $g comp f = union_(y in f(x)) g(y)$, [identity], $1_X = [x |-> {x}]$, [associativity], $h comp (g comp f) = (h comp g) comp f$, [unital], $1_T(Y) comp f comp 1_X = f$, ), ) #grid( columns: (1fr, 1fr), align: (left, left), proof(name: "associativity")[$ h comp (g comp f) &= [x |-> union_(z in (g comp f)(x)) h(z)] \ &= [x |-> union_(z in union_(y in f(x)) g(y)) h(z)] \ &= [x |-> union_(y in f(x)) union_(z in g(y)) h(z)] \ &= [x |-> union_(y in f(x)) (h comp g)(y)] \ &= [x |-> ((h comp g) comp f)(x)] \ &= (h comp g) comp f $], proof(name: "unital")[$ 1_(T(Y)) comp f comp 1_X &= [x |-> union_(x' in 1_X(x)) union_(y in f(x')) 1_(T(Y))(y)] \ &= [x |-> union_(x' in {x}) union_(y in f(x')) [y |-> {y}](y)] \ &= [x |-> union_(x' in {x}) union_(y in f(x')) {y}] \ &= [x |-> union_(x' in 1_X(x)) f(x')] \ &= [x|-> union_(x' in {x}) f(x')] \ &= [x |-> f(x)] = f $], ) Let $F,G$ be an isomorphism by @defn-isomorphism #grid( columns: (1fr, 1fr), align: (left, left), [ $ arr(F,bb(K),Rel) $ $ F(X) &= X \ F(arr(f,X,T(Y))) &= {(x,y) | y in f(x)} $ ], [ $ arr(G, Rel, bb(K)) $ $ G(X) &= X \ G(R) &= [x |-> {y | (x,y) in R}] $ ], ) #grid( columns: (1fr, 1fr), align: (left, left), proof(name: $G comp F = 1_bb(K)$)[$ &(G comp F)(f)\ &= G({(x,y) | y in f(x)}) \ &= [x |-> {y | (x,y) in {(x,y) | y in f(x)}}] \ &= [x |-> {y | y in f(x)}] \ &= [x |-> f(x)] = f $], proof(name: $F comp G = 1_Rel$)[$ &(F comp G)(R) \ &= F([x |-> {y | (x,y) in R}]) \ &= {(x,y) | y in [x |-> {y | (x,y) in R}](x)} \ &= {(x,y) | y in {y | (x,y) in R}} \ &= {(x,y) |(x,y) in R)} = R $], ) $therefore bb(K)$ is a category that is isomorphic to $Rel$ via $F,G$. #exercise("3")[ Let $bb(C)$ be a category with binary products ... ] _Remark_: epi, mono, showing uniqueness of morphism is not explored in SA chapter 1, we will revisit this exercise in the future.
https://github.com/FurryAcetylCoA/sgu-thesis-typst
https://raw.githubusercontent.com/FurryAcetylCoA/sgu-thesis-typst/main/nju-thesis/templates/bachelor-cover.typ
typst
MIT License
#import "@preview/t4t:0.3.2": is #import "../utils/custom-tablex.typ": gridx, colspanx #import "../utils/datetime-display.typ": datetime-display #import "../utils/style.typ": 字号, 字体 // 本科生封面 #let bachelor-cover( // documentclass 传入的参数 anonymous: false, twoside: false, fonts: (:), info: (:), // 其他参数 stoke-width: 0.5pt, min-title-lines: 1, info-inset: (x: 0pt, bottom: 1pt), info-width: 150pt, key-width: 80pt, column-gutter: 0pt, row-gutter: 1pt, anonymous-info-keys: ("grade", "student-id", "author", "supervisor"), bold-level: "bold", datetime-display: datetime-display, ) = { // 1. 默认参数 fonts = 字体 + fonts info = ( title: ("基于 Typst 的", "南京大学学位论文"), grade: "20XX", student-id: "1234567890", author: "张三", department: "某学院", major: "某专业", supervisor: ("李四", "教授"), begin-date: datetime.today(), end-date: datetime.today(), ) + info // 2. 对参数进行处理 // 2.1 如果是字符串,则使用换行符将标题分隔为列表 if (is.str(info.title)) { info.title = info.title.split("\n") } // 2.2 根据 min-title-lines 填充标题 info.title = info.title + range(min-title-lines - info.title.len()).map((it) => " ") // 2.3 处理提交日期 if (is.type(datetime, info.begin-date)) { info.begin-date = datetime-display(info.begin-date) } if (is.type(datetime, info.end-date)) { info.end-date = datetime-display(info.end-date) } // 3. 内置辅助函数 let info-key(body) = { rect( width: 100%, inset: info-inset, stroke: none, text(font: fonts.宋体, size: 字号.四号,weight: bold-level, body), ) } let info-long-key(body) = { colspanx(2, info-key(body) ) } let info-value(key, body) = { set align(left) rect( width: 100%, inset: info-inset, stroke: none, text( font: fonts.宋体, size: 字号.四号, weight: bold-level, body, ), ) } let info-long-value(key, body) = { colspanx(3, info-value( key, if (anonymous and (key in anonymous-info-keys)) { "██████████" } else { body } ) ) } let info-short-value(key, body) = { colspanx(2, info-value( key, if (anonymous and (key in anonymous-info-keys)) { "██████████" } else { body } ) ) } // 4. 正式渲染 pagebreak(weak: true, to: if twoside { "odd" }) // 居中对齐 set align(center) // 匿名化处理去掉封面标识 if (anonymous) { v(70pt) } else { v(25pt) // 调整一下右边的间距 image("../assets/vi/sgu.svg", width: 5.8cm) v(2pt) } text(size: 字号.初号, font: fonts.宋体, spacing: 400%, weight: "bold")[毕 业 设 计] if (anonymous) { v(132pt) } else { v(120pt) } block(width: 85%, gridx( columns: (key-width, 1fr, info-width, 1fr), column-gutter: column-gutter, row-gutter: row-gutter, info-key("题  目:"), ..info.title.map((s) => info-long-value("title", s)).intersperse(info-key(" ")), info-key("学生姓名:"), info-long-value("author", info.author), info-key("学  号:"), info-long-value("student-id", info.student-id), info-key("二级学院:"), info-long-value("department", info.department), info-key("专  业:"), info-long-value("major", info.major), info-key("班  级:"), info-long-value("grade", info.grade), info-long-key("指导教师姓名及职称:"), info-short-value("supervisor", info.supervisor.join("  ")), info-key("起止时间:"), info-long-value("begin-time", info.begin-date + " —— " +info.end-date) )) v(80pt) text(size: 字号.五号, font: fonts.宋体)[(教务处制)] }
https://github.com/HEIGVD-Experience/docs
https://raw.githubusercontent.com/HEIGVD-Experience/docs/main/S5/MAT3/docs/2-CorpsNombresComplexes/intro-nombre-complexes.typ
typst
#import "/_settings/typst/template-note.typ": conf #show: doc => conf( title: [ Introductiona aux nombres complexes ], lesson: "MAT3", chapter: "2 - Le corps des nombres complexes", definition: "Introduction aux nombres complexes, rappelant les séries arithmétiques et géométriques, le discriminant pour les équations quadratiques, et les propriétés des nombres complexes, y compris la forme cartésienne, le conjugué, et les opérations comme l'addition, la soustraction et la multiplication. Il explore également l'application du discriminant dans les polynômes irréductibles sur R mais réductibles sur C.", col: 1, doc, ) = Rappel == Série arithmétique La formule pour calculer la valeur d'une série arithmétique est: $ S(n) = n * frac("premier terme" + "dernier terme", 2) $ == Série géométrique === Finie La formule pour calculer la valeur d'une série géométrique finie est: $ S(n) = "premier terme" * frac(1 - "raison"^("nb termes"), 1 - "raison") $ === Infinie La formule pour calculer la valeur d'une série géométrique infinie est dans le cas ou la raison vérifie $bar r bar < 1$, nous utiliserons la formule: $ S(infinity) = frac("terme initial", 1 - "raison") $ == Tableau cercle trigonométrique #table( align: center + horizon, columns: (0.16fr, 0.16fr, 0.16fr, 0.16fr, 0.16fr, 0.16fr), "",[0],[$pi/6$],[$pi/4$],[$pi/3$],[$pi/2$], "cos", [$1$], [$sqrt(3)/2$], [$sqrt(2)/2$], [$1/2$], [$0$], "sin", [$0$], [$1/2$], [$sqrt(2)/2$], [$sqrt(3)/2$], [$1$], "tan", [$0$], [$frac(sqrt(3),3)$], [$1$], [$sqrt(3)$], [non défini] ) == Delta Dans le cas d'une équation du deuxième degré nous pouvons utiliser la formule du discriminant: $ Delta = b^2 - 4"ac" $ 1. Si $Delta gt 0$ alors l'équation possède 2 solutions réelles: $ x_(1,2) = frac(-b plus.minus sqrt(Delta), 2a) $ 2. Si $Delta = 0$ alors l'équation possède une unique solution réelle: $ x_(1,2) = frac(-b, 2a) $ 3. Si $Delta lt 0$ alors l'équation n epossède pas de solution réelle. = Nomenclature Pour pouvoir résoudre la fonction: $ x^2+1 = 0 $ nous avons du créer la valeur suivante: $ j^2 = -1 $ Nous aurons la formule suivante: $ z = a + "bj" \ a = "Partie réelle et notée" "Re"(z) \ b = "Partie imaginaire et notée" "Im"(z) $ Deux nombres complexes sont considéré comme égaux si: $ z = a + "bj" " et " w = c + "dj" \ a = c " et " b = d $ == Exemple Dans un nombre complexe $z = 2 + 3j$ nous aurons: $ "Re"(z) = 2 " et " "Im"(z) = 3 $ - Un nombre $z = 3 + 0j$ est un nombre réel - Un nombre $z = 0 + 6j$ est un imaginaire pure = Forme cartésienne Très pratique pour l'addition et la soustraction. == Addition $ (a + "bj") + (c + "dj") = (a + c) + (b + d)j $ == Soustraction $ (a + "bj") - (c + "dj") = (a - c) + (b - d)j $ == Multiplication $ (a + "bj") * (c + "dj") = ("ac" - "bd") + ("ad" + "bc")j $ == Opposé Un nombre complexe $z = a + "bj"$ possède un *opposé* $-z = -a - "bj"$ avec les propritétés usuelles: $ z_1 - z_2 = z_1 - (+ z_2), " " z + (-z) = 0 " et " -z = (-1) * z $ #table( align: center + horizon, columns: (1fr, 1fr), [$3 + 2j$], [$-3 - 2j$], image("/_src/img/docs/image copy 145.png"), image("/_src/img/docs/image copy 146.png") ) == Inverse Considérons $z = a + "bj"$ *non nul*, alors son inverse est: $ z^(-1) = frac(1,z) = frac(1, a + "bj") = frac(a - "bj", a^2 + b^2) $ = Conjugé complexes Le conjugué d'un nombre complexe est obtenu en changeant le signe de la partie imaginaire. Il est noté: $overline(z)$. De ce fait on peut dire que : $ z * z^* = a^2 + b^2 $ cela signifie que nous pouvons obtenir *un nombre réel* en multipliant un nombre complexe par son conjugué. #table( align: center + horizon, columns: (1fr, 1fr), [$3 + 2j$], [$3 - 2j$], image("/_src/img/docs/image copy 145.png"), image("/_src/img/docs/image copy 147.png") ) == Propriétés #image("/_src/img/docs/image copy 129.png", height: 110pt) $ "Module 1" = a^2 + b^2 = 1 $ Soit $z$ un nombre compelxe, alors: $ z " est un nombre réel si et seulement si " z = z^* \ "Re"(z) = frac(z + z^*, 2) \ "Im"(z) = frac(z - z^*, 2j) $ == Utilisation du discriminant Regardons maintenant une application aux racines d'un polynôme à coefficients réels d'ordre 2. $ Delta = b^2 - 4"ac" $ On considère uniquement les cas ou $Delta < 0$. Le polymôme est donc irreductible sur $R$ mais est réductible sur $C$. Ses racines sont des nombres comlexes valant: $ z_1 = frac(-b + j*sqrt(-Delta), 2a) " et " z_2 = frac(-b - j*sqrt(-Delta), 2a) $ La décomposition de $P(x)$ sur les complexes donne: $ P(x) = (z - z_1)(z - z_2) $
https://github.com/Error0229/-
https://raw.githubusercontent.com/Error0229/-/main/-.-.%20.-/.__..typ
typst
The Unlicense
#import "@preview/lovelace:0.2.0": * #show: setup-lovelace #set text(font: "New Computer Modern") #align(center, text(16pt)[ *Design and Analysis of Computer Algorithms Assignment \#4* ]) #align(right, [資工三 110590004 林奕廷]) #set heading(numbering: "1.a.") #set enum() = == By the given definition, the maximum will appear in root of max-heap, and minimum will appear in the root of min-heap; Time complexity of finding the maximum and minimum is $O(1)$. == Assume the array $A$ has a length of $n$. If we store the left subtree at the left $n/2$ elements of the array and the right subtree at the right $n/2$ elements of the array, we can obtain the corresponding element at the other heap by simply $plus.minus n/2$ to the given index, which is $O(1)$. == First, we insert the value at min-heap, and then check whether the deap property is satisfied. If not, swap the inserted value from min-heap to max-heap by the corresponding index. And do a heapify on the max-heap. The time complexity of this operation is $O(log n)$. = 1. Base Case $k=0$: - $T$ is a $B_0$ tree. - $T_0$ is a single node $v$. - There are no other nodes to attach. - This satisfies the conditions trivially. 2. Induction Hypothesis: - Assume the property holds for $B_(k-1)$ trees. 3. Inductive Step: - Consider a binomial tree $B_k$. - By definition, $B_k$ is formed by linking the root of one $B_(k-1)$ tree to the root of another $B_(k-1)$ tree. - Let $T$ be this $B_k$ tree with handle $v$. - Let $T'$ and $T''$ be the two $B_(k-1)$ trees that were linked to form $B_k$. - By the induction hypothesis, $T'$ and $T''$ can be decomposed into disjoint trees $T_0, T_1, dots, T_(k-2)$ with roots $r_0, r_1, dots, r_(k-2)$ respectively, such that each $T_i$ is a $B_i$ tree and the roots are linked appropriately. 4. Construction of $T$: - To form $T$, we link the root $r_(k-1)$ (which is the root of one $B_(k-1)$ tree) to the handle $v$. - The trees $T_0, T_1, dots, T_(k-2)$ remain as $B_0, B_1, dots, B_(k-2)$ respectively. - The root $r_(k-1)$ is linked to $r_0$, and $r_i$ is linked to $r_(i+1)$ for $0 <= i < k-1$. This construction satisfies the given conditions: 1. Each $T_i$ is a $B_i$ tree for $0 <= i <= k-1$. 2. $T$ is formed by attaching $v$ to $r_0$, and $r_i$ to $r_(i+1)$ for $0 <= i < k-1$. By induction, we have shown that the given characterization holds for any $B_k$ tree. Thus, the proof is complete. = By using QuickSelect and select the rank $floor(k/2) dot n/k$ number, we can roughly divide the input $S$ into two equal parts $S_1, S_2$ with length $n/2$. Then, we can recursively apply the algorithm to $S_1$ and $S_2$ to find the remaining $k-1$ elements of the output. The running time is defined by the recurrence $ T(n) = cases(2T(n/2) + O(n) &"if" n>k, 1 &"elsewhere") $, which has a $O(n log k)$ time complexity. #algorithm( caption: [Find Elements], pseudocode( no-number, [*input:* Sequence $S$ with length $n$ and partition count $k$], no-number, [*output:* Array $R$ that contains numbers in $S$ that have rank $n/k,(2n)/k,...,((k-1)n)/k$], [*define* $R$ as an empty list], [*function* $"Find-Elements"(S, k)$], ind, $ n = "length of S" $, $ i = floor(k/2)$, $ "pivot" = "QuickSelect"(S, floor(i dot n/k)) $, $"Push Find-Elements(" S[1 " to "floor(i dot n/k)], i)" to" R$, $"Push Find-Elements(" S[floor(i dot n/k)+1 " to " n], i)" to" R$, [*return* $"pivot"$], ), ) Example: Assume we have a sequence $S = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]$ with length $n = 11$ and partition count $k = 3$. Our goal is to find the elements in $S$ that have ranks $n/k, (2n)/k, dots, (k-1)n/k$. 1. Initial Call: - $S = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 7]$ - $n = 12$ - $k = 3$ 2. First Partition: - Calculate $(floor(k/2)) dot (n)/(k) = 2 dot 12/3 = 8$ - Use QuickSelect to find the element at rank $8$ in $S$. - Let's say QuickSelect returns the 8th smallest element which is $5$. - Now, $S$ is roughly divided into $S_1 = [3, 1, 4, 1, 2, 2]$ and $S_2 = [9, 6, 5, 5, 7]$. 3. Recursive Calls on $S_1$: - $S_1 = [3, 1, 4, 1, 2, 2]$ - $k = 1$ - Since $k = 1$, the algorithm terminates and returns the array sorted with its median. - In this example, $S_1$ would be processed to give an array where the median is chosen: let's say it is $3$. 4. Recursive Calls on $S_2$: - $S_2 = [9, 6, 5, 5, 7]$ - $k = 1$ - Similarly, for $S_2$, find the median using QuickSelect or a similar method. - Let's assume it returns $9$. 5. Combine Results: - Combine the results from $S_1$ and $S_2$ and include the pivot element $3$. - The resulting array $R$ will be $[3, 5, 9]$, representing the elements at ranks $12/3, 2 dot 12/3,3 dot 12/3$. = Use QuickSelect to find the median of the input array $S$. Then calculate the difference between the median and each element of $S$ and store the difference with the number's index in $M$. Finally, find the k-th smallest number index $i$ in the array $M$ by using QuickSelect. And all the elements in the array $S$ that correspond to the first $i$ elements in the array $M$ are the output. The time complexity of this algorithm is $O(n)$. #algorithm( caption: [Find Closet], pseudocode( no-number, [*input:* Sequence $S$ with length $n$ and range number $k$], no-number, [*output* A array contains $k$ numbers that are closet to the median of $S$], [*define* $M$ as an empty list], [*function* $"Find-Closet"(S, k)$], ind, $ n = "length of S" $, $ "median" = "QuickSelect"(S, floor(n/2)) $, $ M = "abs("S - S"[median])" $, $ i = "QuickSelect"(M, k) $, $ "result" = "S[ All the corresponding numbers of M[1 to i] ]"$, [*return* $"result"$], ), ) Example: $S = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5], k = 3$ 1. Use QuickSelect to find the median of $S$ : - Median is the 6th element in the sorted sequence since $n = 11$ and $floor(11/2) = 5$ . - Sorted $S$: $[1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]$ - Median is 4. 2. Calculate the absolute differences between each element in $S$ and the median, and store these in $M$: - $M = [1, 3, 0, 3, 1, 5, 2, 2, 1, 1, 1]$ 3. Use QuickSelect to find the $k$ smallest differences: - Find the 3rd smallest difference in $M$, which is 1. 4. Select the corresponding elements in $S$: - Elements in $S$ corresponding to the smallest differences: $[3, 4, 5]$. Output: $[3, 4, 5]$
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/chronos/0.1.0/src/separator.typ
typst
Apache License 2.0
#import "@preview/cetz:0.2.2": draw #import "consts.typ": * #let _sep(name) = { return (( type: "sep", name: name ),) } #let render(x-pos, elmt, y) = { let shapes = () y -= Y-SPACE let x0 = x-pos.first() - 20 let x1 = x-pos.last() + 20 let m = measure( box( elmt.name, inset: (left: 3pt, right: 3pt, top: 5pt, bottom: 5pt) ) ) let w = m.width / 1pt let h = m.height / 1pt let cx = (x0 + x1) / 2 let xl = cx - w / 2 let xr = cx + w / 2 y -= h / 2 shapes += draw.rect( (x0, y), (x1, y - 3), stroke: none, fill: white ) shapes += draw.line((x0, y), (x1, y)) //shapes += draw.line((x0, y), (xl, y)) //shapes += draw.line((xr, y), (x1, y)) y -= 3 shapes += draw.line((x0, y), (x1, y)) //shapes += draw.line((x0, y), (xl, y)) //shapes += draw.line((xr, y), (x1, y)) shapes += draw.content( ((x0 + x1) / 2, y + 1.5), elmt.name, anchor: "center", padding: (5pt, 3pt), frame: "rect", fill: COL-SEP-NAME ) y -= h / 2 let r = (y, shapes) return r }
https://github.com/fiit-community/base-typst-template
https://raw.githubusercontent.com/fiit-community/base-typst-template/main/template/main.typ
typst
MIT License
#import "lib.typ": * #show: cover-page( title: lorem(2), subtitle: lorem(3), author: ( name: "<NAME>", id: 117030, ), date: datetime.today(), year: "2024/2025", logo: assets.logo, assignment: ( subject: lorem(1), teacher: lorem(2), time: "Mon: 10:00", ), lang: "en", ) = Some Header 1 #lorem(60) == Some Header 2 #lorem(60) = Some Header 3 #lorem(60)
https://github.com/typst-community/mantodea
https://raw.githubusercontent.com/typst-community/mantodea/main/CHANGELOG.md
markdown
MIT License
# [unreleased](https://github.com/typst-community/mantodea/releases/tag/NEXT) ## Added ## Removed ## Changed --- # [v0.0.0](https://github.com/typst-community/mantodea/tags/) - Create fork of [mantys](https://github.com/jneug/typst-mantys)
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/017%20-%20Dragons%20of%20Tarkir/003_Sorin's%20Restoration.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Sorin's Restoration", set_name: "Dragons of Tarkir", story_date: datetime(day: 27, month: 03, year: 2015), author: "<NAME>", doc ) #emph[The vampire Planeswalker Sorin Markov has come to Tarkir seeking the spirit dragon Ugin. Long ago, Sorin helped Ugin and another Planeswalker, the lithomancer Nahiri, seal away the monstrous Eldrazi on Zendikar. Recently, the Eldrazi escaped, and Sorin believes that Ugin is one of the few who can stop them.] #emph[Sorin has found his way here, to Ugin's home world, in search of his old ally. ] In another timeline#emph[, Sorin found Ugin long dead, leaving his quest on Tarkir a failure—but Sorin will never know that version of events. Tarkir's history has been changed, and Sorin's path has a chance to go another way. He holds out hope to find Ugin, but even now, he knows that he may be much too late.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Tarkir. Sorin winced at the sun's grotesque glare as if someone had stabbed him. A merciful shadow swept across him as a four-winged dragon sailed over the dry steppe, its outline rimmed in gold sunlight. But then the heat of the steppe closed in on him again. He pulled a hood up over his head. This world was nothing like his chilly Innistrad, but there was a task at hand. He needed to find someone—someone who was very possibly dead. #figure(image("003_Sorin's Restoration/01.jpg", width: 100%), caption: [Plains | Art by <NAME>], supplement: none, numbering: none) He had never come here before. In all the time he had known Ugin, he had never visited the spirit dragon's home world, nor even asked after it. His only guide now was a cluster of vague impressions given to him by an oracle. This place, with its arid winds and flights of wild dragons filling the skies, was a mystery to him. A company of dragons crackled and swooped in the air above him, which gave Sorin an itch of foreboding about his visit. If Ugin was alive, the spirit dragon must have learned of the world-devourers' escape by now. In that case, why hadn't Ugin tried to contact him? Why was #emph[he] the one coming to Ugin? The Eldrazi were truly free of their imprisonment this time, and there was no way to know what the titans' hunger would wreak—and yet Sorin was the only one doing anything about it. Ugin had been silent for centuries. Sorin may have traveled all this way to find a tomb rather than an ally. Distant, snow-capped peaks stretched along the northern horizon. A single peak stood out, shaped like a twisting dragon's head. The rock formation had a unique structure, identical to the vision Sorin's oracle had conjured. As dragons cawed above him, he walked. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The trek toward the spiraling rock led Sorin into cooler air. After a number of days, the land under his boots became ice and snow. An old animal trail led him deep into the mountain wilderness, and the shaggy dragons above breathed gouts of green-tinged fire rather than thunderbolts. #figure(image("003_Sorin's Restoration/02.jpg", width: 100%), caption: [Savage Ventmaw | Art by <NAME>], supplement: none, numbering: none) Granite peaks, capped in snow and ice, rose up far above Sorin's head as he traversed the crags and passes. He lost eye contact with the spiraling rock for an entire day, and he longed for a sense of certainty that he wasn't wasting his time. The mad scatter of images from the dark oracle still burned in his mind's eye, and they spelled out a kind of story: a great battle of dragons, a chasm of ice, Ugin's swirling form. But the images were vague, blurred, and chaotic. He needed a guide. Thankfully, the world provided a fine selection of them. "That's far enough, Silumgar death-spawn," said a burly human warrior from atop some kind of long-tusked war-beast. A party of warriors encircled Sorin, wielding spears and sharpened bone-clubs. They wore the layered hides of tundra mammals, and their headdress antlers resembled those of the big firebreathers that hunted in the sky. One of the humans readied a spell, his hand glowing hot like a claw made of fire. The lead warrior spoke again. "Your head will decorate a spear tonight." #figure(image("003_Sorin's Restoration/03.jpg", width: 100%), caption: [Atarka Beastbreaker | Art by Johannes Voss], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Sorin and his enthralled guide trekked along the narrow trails and icy crags in relative silence. The thrall floated heavily, his bootless feet dragging across the top of the snow, occasionally snagging twigs or roots from the path. Sorin had fed on the thrall's blood more than once, but now he instead pumped the floating warrior for information. "How long have you known about the domain of the spirit dragon?" Sorin asked. "Our people found the spirit dragon's domain over a thousand years ago. Not long before the Khanfall." "Khanfall?" Sorin asked. "The fall of the khan?" "Khans," said the thrall. "The human clan leaders of old. 'Khan' is a cursed word now. A dead word." "You serve dragons." "I serve you now, of course, master. But the dragon broods rule the five clans, and those lesser beings—humans, and others of their ilk—serve them." The trail crested a ridge, and the thrall hovered over the top and continued down into a valley where ice had given way to patches of bare earth. "There were once other clans, ruled by arrogant humans. Those clans bore different names, and their warriors killed dragons even of their own land. Traitors. Traitors to the spirit of dragonkind. They earned their fate." "I find it strange whenever mortals seek out their own demise." "They did not possess the spirit of savagery of the great Atarka. They did not survive." "Atarka—your dragon leader." The thrall nodded. "Dragonlord of my clan." #figure(image("003_Sorin's Restoration/04.jpg", width: 100%), caption: [Dragonlord Atarka | Art by <NAME>], supplement: none, numbering: none) Sorin asked, "And this spirit of Atarka—you believe that came from Ugin?" "Ugin is the beating heart of the world. He dwells within the Haven. He is why the dragons have their many strengths." #emph[So he may be alive after all] , thought Sorin. A thought crawled up into Sorin's mind like a spider ascending a thread. He frowned, at a loss for what to do about the skulking thought: the knot of complications involving a certain Zendikari kor woman—Nahiri, the third member of their alliance all those millennia ago. If Sorin managed to find Ugin alive, wouldn't the dragon's first question be about her? #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Far below was a flat plain of ancient, shattered rock blotched with ice and snow. Sorin could see that the rock on the plain had been warped and shaped by an immense outpouring of energy. A spiral of stone looked as if it had once been molten and made to follow lines of force, then flash-frozen. The strange rock surrounded a deep canyon of blackened granite that streaked through the center of the plain. "There lies the spirit dragon." The Atarka-clan guide pointed to the canyon floor. Sorin looked down. Hedrons. #figure(image("003_Sorin's Restoration/05.jpg", width: 100%), caption: [Crucible of the Spirit Dragon | Art by Jung Park], supplement: none, numbering: none) Dozens, perhaps hundreds, of stone hedrons were piled at the bottom of the chasm. They did not float free, but interlocked with each other, forming a protective sheath. Sorin's hand went to the hilt of his sword. Lithomancy on Tarkir? Had Nahiri traveled here before him and bested the dragon? The oracle's visions had not warned him of any of this. "This is the haven," said the thrall. "The great cradle where the spirit dragon rests." Even from the lip of the chasm, Sorin could see that the stone shapes were old. Ice and debris had settled in the crannies of the magically carved runes, and the elements had worn and battered the stones. These stones had lain here for a long time. Sorin could feel the life essence of the being within the cocoon of hedrons. He wondered if he still knew some of the old blood magic he had used back on Zendikar. "I need to wake the beating heart of your world, thrall," said Sorin. "Have you any more blood in you?" "I fear my veins are brittle, master, and empty of life," said the Atarka guide. "It has been…a long journey for me. But all I still have is yours." Sorin made a dismissive gesture. The thrall collapsed onto the snow, his desiccated body leathery and spent. #emph[I'll have to do this with what I have] , thought Sorin. #emph[Time to awaken, dragon.] Sorin unsheathed his sword and pointed it down at the dragon's resting-place. He willed the blood in his body to flow through him, warming him, focusing and concentrating his mana. He pronounced ancient syllables, words worn by time, words of binding and of release. His magic wove around the cocoon and through it, tracing its surfaces, finding the edges of the mystical lock that bound the hedrons together. As blood thudded in his temples, Sorin found the keystone to the cocoon. Buried deep within the stone structure was a single, tiny, broken shard—a remnant of Ugin's own magic from another world. That shard was the source of the binding magic. Sorin thrust his sword into the air and shouted an ancient word of unmaking. The hedron shard crumbled to dust, and the cocoon began to crack. Stone surfaces broke and slid, and the structure fell in on itself. #figure(image("003_Sorin's Restoration/06.jpg", width: 100%), caption: [Haven of the Spirit Dragon | Art by Raymond Swanland], supplement: none, numbering: none) Ugin exploded from the hedron cocoon, rocketing into the air. The whoosh of air blew Sorin's hair back as Ugin shot upward in a flurry of wings. Soon, Ugin was only a bright speck against the sky, trailing spirals of shimmering mist through the air, tracing a jubilant path. The air crackled around him. Sorin noted that the clouds seemed to roll and curl in concert with Ugin's flight, as if the dragon obeyed the clouds' laws—or the clouds obeyed his. Sorin sheathed his sword, watching the dragon bank with a billow of his wings. Ugin finally seemed to realize that a force had set him free, and became aware of Sorin back at the lip of the chasm. Ugin returned, hovering in the air above the broken ruins of the hedron cocoon. The dragon's voice rumbled. "Sorin?" "Indeed," Sorin said. "What happened here? You were trapped?" A faraway look came over the dragon's face. Ugin blew a gust of mist from his nostrils in a moment of contemplation. "Saved, I believe," said Ugin. He turned his head toward Sorin. There was a strange twist to his neck—it was bent, almost cowed. "Tell me—is Bolas—gone from here?" Sorin didn't know what to make of the question. A battle between dragons had been part of the oracle's visions—perhaps it was the ancient Planeswalker <NAME> that Ugin had faced. Not Nahiri, then. "Did he do this to you?" #figure(image("003_Sorin's Restoration/07.jpg", width: 100%), caption: [Ugin, the Spirit Dragon | Art by Chris Rahn], supplement: none, numbering: none) "He thought me his rival for power, and attacked me. Used my own dragons against me. But someone intervened on my behalf." The dragon examined the hedron ruins below him, and inspected the landscape again. Dragons wheeled in the sky, spitting bright flashes of fire. "It seems I took some time to recuperate. How long?" "Over a thousand years, if the locals are to be believed." Sorin took a note of pleasure in dispensing knowledge to the aeons-old dragon. "I had almost forgotten the look of your face." "Much must have changed." Ugin drew a breath into his chest, then shimmering steam floated from his nostrils into the air above Sorin's head. "Why have you come? Why revive me now?" "The Eldrazi. You're not the only one to have awoken from a hedron slumber." "They can't be—#emph[free.] The network was built to last indefinitely." "They're free." Sorin had the urge to press the matter, to needle Ugin, to make someone else shoulder the blame. "They awoke, and you didn't come. I suppose you were here at home. Resting in your cradle." "How could this be?" Sorin looked at the horizon. "Planeswalkers. And a series of childish errors at the Eye." Sorin had traveled to Zendikar to meet the young elf Planeswalker Nissa, a native of the world of Zendikar. He and Nissa had struggled over whether to free the Eldrazi. Nissa chose to release them, thinking it would spare her world—and it hadn't. #figure(image("003_Sorin's Restoration/08.jpg", width: 100%), caption: [], supplement: none, numbering: none) "What would have led Planeswalkers to do this?" Ugin seemed to be asking himself more than Sorin. Sorin had been there personally, when the Eldrazi rose from their torpor and began their rampage across Zendikar. He had tried to intervene, but the Eye of Ugin had been tampered with. He did not know why their hedron prison had been compromised in the first place—he only knew that Ugin would be crucial to stopping them once again. "I can only tell you what I know." Ugin breathed a different kind of breath. A sigh. "This is frantic news." Sorin saw Ugin's eyes wander to the ground, searching for his next thought. Sorin could see the next question forming—the logical next leap for Ugin's mind to take. He knew that next question would cut deeper. Sorin unconsciously counted the moments. Ugin's eyes swiveled back to Sorin. "Where is the hedron mage? Where is Nahiri?" #figure(image("003_Sorin's Restoration/09.jpg", width: 100%), caption: [Nahiri, the Lithomancer | Art by Eric Deschamps], supplement: none, numbering: none) The notion of shame had long since evaporated from Sorin. Over the millennia, Sorin's human frailties and neurosis had grown, blossomed, and withered away—he was as immune to regret as he was to old age. And yet, for the first time in years, an uncomfortable feeling grew within him, an unpleasant itch, the sense that he was responsible—solely—for something important going awry. It wasn't remorse exactly, just a dull, discordant echo ringing in the space where remorse had once resided. "She is—not here," said Sorin, to no particular patch of air. "That is clear," said Ugin. "I inquired about her whereabouts. Is she still on Zendikar? We should rejoin her, as soon as I am able to travel." "I do not believe that she is there," Sorin said carefully. Ugin's neck pleats fanned in irritation. "Speak facts, you vague thing. She's dead?" "No," said Sorin. "She lives." The fuller extent of the truth was not something Ugin needed to know at this time, in Sorin's estimation. "I think I may know where she might be." "Then fetch her to Zendikar. If the titans remain there, we'll need her to rebuild the hedron network." "Is it crucial that she come?" "Of course it's crucial," Ugin said. "Your blood magic is great, as is my knowledge of the dwellers of void. But none of our efforts can be made permanent without the lithomancer." Ugin curved his body, bringing his head down close to Sorin's, like a bird regarding a worm with its great eye. "Let me be clear. It must be the three of us. Whatever petty tiff you've had with her, or whatever matter it is you're hiding from me, resolve it. I do not wish to see your face without hers." #figure(image("003_Sorin's Restoration/10.jpg", width: 100%), caption: [Soul Summons | Art by <NAME>], supplement: none, numbering: none) Sorin snapped his head away with his teeth clenched, suddenly gripped by an urge to destroy something. He clasped his own arms, holding his own body in check. He nodded with what looked like bored nonchalance. Ugin gave a single firm nod. "I will join you at the Eye soon. Thank you for your assistance here." Sorin ran his tongue over his fangs, staring a hole in the snowy ground. As he began his planeswalk away from Tarkir, he scanned the shapes above the horizon—not for the birdlike formations of dragons, but to watch Tarkir's rippling stacks of clouds. They drifted through the air like the lazily floating islands of the savage world of Zendikar. Things had been so much simpler when he only had his own world to worry about.
https://github.com/ukihot/igonna
https://raw.githubusercontent.com/ukihot/igonna/main/articles/infra/data.typ
typst
== 基礎通信理論 === プロトコル プロトコルは、通信やデータ交換を行う際の取り決めや手順の規約である。 これは、情報の送受信方法や通信の制御方法など、通信に関する様々なルールや規則を定義する。 例えば、インターネットで広く使われているTCP/IPプロトコルスイートは、データ転送の手順やエラーの処理方法などを規定する。 === パケット パケットは、データを転送する際の基本的な単位である。 大きなデータを複数のパケットに分割して送信し、それらのパケットがネットワークを通じて目的地に到着した後、再び組み立てて元のデータを再構築する。 宛先の情報、送信元の情報、データの一部、およびエラーチェックのための情報(ヘッダー)が含まれる。
https://github.com/Tran-Thu-Le/typst-collection
https://raw.githubusercontent.com/Tran-Thu-Le/typst-collection/main/multi-files-reference/file1.typ
typst
#include "multi-ref.typ" In file the first file, the first reference is @kingma2014adam
https://github.com/davidedomini/DTM-2425-Crash-Course
https://raw.githubusercontent.com/davidedomini/DTM-2425-Crash-Course/master/slides/lesson02.typ
typst
Apache License 2.0
#import "@preview/polylux:0.3.1": * #import "@preview/fontawesome:0.1.0": * #import themes.metropolis: * #show: metropolis-theme.with( aspect-ratio: "16-9", ) #set text(font: "Fira Sans", weight: 350, size: 20pt) #show math.equation: set text(font: "Fira Math") #set strong(delta: 200) #set par(justify: true) #set quote(block: true) #show quote: set align(left) #show quote: set pad(x: 2em, y: -0.8em) #set raw(tab-size: 4) #show raw.where(block: true): block.with( fill: luma(240), inset: 1em, radius: 0.7em, width: 100%, ) #show bibliography: set text(size: 0.8em) #show footnote.entry: it => { block(inset: (x: 2em, y: 0.1em))[#text(size: 0.75em)[#it.note.body]] } #let fcite(clabel) = { footnote(cite(form: "full", label(clabel))) } #let author = block(inset: 0.1em)[ #table(inset: 0.5em, stroke: none, columns: (auto, 4fr), align: (left, left), [#alert[*<NAME>*]], [`<EMAIL>`], ) #place(right, dy:-1.5em)[ #figure(image("images/disi.svg", width:40%)) ] ] #let arrow = box[ #figure(image("images/arrow.svg", width: 2%)) ] #title-slide( title: "Introduction to Programming Languages", subtitle: "Digital Transformation Management @ 2024", author: author, // date: datetime.today().display("[day] [month repr:long] [year]"), ) #focus-slide[ How to approach problems? ] #slide(title: "Computational Thinking a.k.a Problem Solving")[ #align(center)[ _#alert[Computational thinking] is a method of #alert[problem-solving] that involves breaking problems down, recognizing patterns, and developing step-by-step solutions, often in ways that a computer can execute._ ] #v(2em) #arrow It's not just about coding, but about approaching problems #alert[methodically] ] #slide(title: "Decomposition")[ #align(center)[ _#alert[Breaking] a problem into #alert[smaller], more #alert[manageable] sub-problems that are #alert[easier] to solve._ ] #v(2em) #arrow *Example:* to build a website, we might break the project into components like front-end, back-end, and database. ] #slide(title: "Algorithm")[ #align(center)[ _It's the process of developing #alert[steps] and #alert[rules] that need to be followed in #alert[order] to achieve the desired outcome aka solve the problem. This ensures that other people can replicate the same solution should they ever encounter the same - or similar - problem._ ] ] #slide(title:"Abstraction")[ #align(center)[ _Abstraction, also known as #alert[pattern generalization], is the process of seeking out and identifying only the #alert[relevant] information crucial to solving the problem._ ] #v(2em) #arrow *Example:* abstracting a car to its key functions (start, stop, steer) without worrying about the intricate mechanics of the engine or transmission. ] #slide(title:"Pattern Recognition")[ #align(center)[ _Recognizing #alert[similarities] or #alert[patterns] in problems, which allows us to reuse existing solutions._ #v(2em) #arrow *Example:* consider a situation where you are asked to develop different programs that work with sequences of numbers: 1) finding the maximum number in a list 2) summing up all numbers in a list, and 3) finding the average of the numbers in a list. Although these problems seem different, they share a common pattern: iterating through a list of numbers. ] ] #slide(title: "Branching")[ #align(center)[ Branching is a #alert[decision-making] process in which you choose between different paths based on certain #alert[conditions]. ] #v(2em) #arrow *Example:* consider how traffic lights control traffic flow. The light system "branches" between different colors (red, yellow, green) based on timing and traffic conditions. ] #slide(title: "Looping")[ #align(center)[ Looping is the process of #alert[repeating] a set of instructions until a #alert[specific condition is met] or for a #alert[predefined number of times]. ] #v(2em) #arrow *Example:* consider a washing machine, it repeats cycles (wash, rinse, spin) for a set number of times. ] #focus-slide[ What do we need in a programming language? ] #slide(title: "Variables")[ - Containers for #alert[storing] data values - No need to declare types, Python infers the type ```Python x = 10 name = "Alice" is_active = True ``` - Common #underline[Primitive] Data Types: - int: Integer (e.g., ```python x = 10```) - float: Floating-point number (e.g., ```python pi = 3.14```) - str: String (e.g., ```python name = "Alice"```) - bool: Boolean (e.g., ```python is_active = True```) ] #slide(title: "Are strings primitive data types?")[ - No, a string is a #alert[sequence of characters] enclosed within single (') or double (") quotes - Strings in Python are immutable, meaning once created, they cannot be changed - Different ways to declare strings: - Single-quoted strings - Double-quoted strings - Multi-line strings (using triple quotes) ```Python name = 'Alice' greeting = "Hello, World!" message = """This is a multi-line string.""" ``` ] #slide(title: "String Indexing and Slicing")[ - Strings are indexed starting from 0 ```Python text = "Python" print(text[0]) # 'P' print(text[-1]) # 'n' (negative indexing) ``` - Extract a #alert[substring] by specifying a start and end index ```Python text = "Python" print(text[0:3]) # 'Pyt' print(text[1:]) # 'ython' print(text[:4]) # 'Pyth' ``` ] #slide(title:"Common String Operations")[ - Joining two or more strings using the + operator. ```python first_name = "John" last_name = "Doe" full_name = first_name + " " + last_name print(full_name) #<NAME> ``` - Repeat a string using the ```python *``` operator. ```python word = "Hi! " print(word * 3) #'Hi! Hi! Hi!' ``` - Check if a substring exists within a string using the ```python in``` keyword ```python message = "Welcome to Python" print("Python" in message) #True ``` ] #slide(title:"Methods on Strings")[ ```Python text = "I love Java" new_text = text.replace("Java", "Python") print(new_text) # 'I love Python' text = "apple,banana,cherry" fruits = text.split(",") print(fruits) # ['apple', 'banana', 'cherry'] words = ["Hello", "world"] sentence = " ".join(words) print(sentence) # 'Hello world' ``` #text(size: 0.85em)[ #arrow And many more! Check out the documentation #link("https://python-reference.readthedocs.io/en/latest/docs/str/") ] ] #slide(title: "Arithmetic Operators")[ #side-by-side[ - ```python + ```: Addition - ```python - ```: Subtraction - ```python * ```: Multiplication - ```python / ```: Division - ```python // ```: Floor Division - ```python % ```: Modulus (remainder) ][ ```Python a = 10 + 5 # 15 c = 7 / 2 #3.5 d = 7 // 2 #3 b = 7 % 2 # 1 ``` ] ] #slide(title: "Comparison Operators")[ #side-by-side[ - ```python == ```: Equals - ```python != ```: Not Equals - ```python > ```: Greater Than - ```python < ```: Less Than - ```python >= ```: Greater or Equals Than - ```python <= ```: Less or Equals Than ][ ```Python 10 == 'Alice' # False 10 != 'Alice' # True 7 > 2 # True ``` ] ] #slide(title: "Branching")[ - Use conditional statements to execute code based on #alert[conditions] #side-by-side[ ```Python x = 10 if x > 5: print("x is greater than 5") else: print("x is less than 5") ``` ][ ```Python x = 10 if x > 5: print("x is greater than 5") elif x == 5: print("x is equal to 5") else: print("x is less than 5") ``` ] ] #slide(title: "Non-Primitive Data Types")[ - #alert[Non-Primitive Data Types] are more complex data structures that can store multiple values or more complex forms of data - Unlike primitive types (like int, float, bool, str), non-primitive types can hold collections of data and have built-in methods for data manipulation - Common #underline[Non-Primitive] Data Types in Python: - List - Tuple - Set - Dictionary - #alert[Mutable or Immutable:] Some types can be changed after creation (like lists), while others cannot (like tuples) ] #slide(title: "List")[ - #alert[Ordered], #alert[mutable] collection of elements - Can store elements of #alert[different] data types - Elements can be #alert[repeated] ```Python fruits = ["apple", "banana", "cherry"] #All the elemets have the same type l = [10, 14, 10, "car", True] #But this is also ok print(fruits[0]) #apple ``` - We have #alert[methods] to modify lists ```Python fruits.append("mango") # ["apple", "banana", "cherry", "mango"] ``` ] #slide(title: "Tuple")[ - #alert[Ordered], #alert[immutable] collection of elements - Used when you want to store data that should not change - Can store elements of #alert[different] data types - Elements can be #alert[repeated] ```Python coordinates = (10.5, 20.3) t = (10, 'Hello', False) ``` ] #slide(title: "Set")[ - #alert[Unordered] collection of #alert[unique] elements - Used to store #alert[non-duplicate] data ```python unique_numbers = {1, 2, 3, 4} unique_numbers.add(4) print(unique_numbers) # {1, 2, 3, 4} unique_numbers.add(5) print(unique_numbers) # {1, 2, 3, 4, 5} ``` ] #slide(title: "Dictionary")[ - Collection of #alert[key-valu]e pairs - Keys are #alert[unique], and values can be of any type ```python person = {"name": "Alice", "age": 25} print(person["name"]) #Alice print(person["age"]) #25 person["age"] = 28 print(person["age"]) #28 ``` ] #slide(title: "Looping")[ - #alert[For Loop:] used to iterate over a sequence (list, string, range, etc.) ```python numbers = range(5) #[0,1,2,3,4] for i in numbers: print(i) ``` - #alert[While Loop:] continues until the condition becomes False ```python count = 0 while count < 5: print(count) count += 1 ``` ] #slide(title: "Functions")[ - A function is a #alert[block of reusable code] that performs a specific task ```python def greet(name): return f"Hello, {name}!" ``` - How do we call a function? ```Python greet("Alice") ``` ] #slide(title: "Built-in functions")[ - There are a lot of #alert[built-in] utility functions ```Python print("Hello DTM!") #Hello DTM! len("Hello DTM!") #10 type("Hello DTM!") #String range(5) #[0,1,2,3,4] ``` ] #slide(title: "Input and Output")[ - Use the input() function to get user input ```python name = input("Enter your name: ") ``` - Use the print() function to display output. ```python x = 10 print(f"The value of x is {x}") The value of x is 10 ``` ] #slide(title:"List Comprehension")[ - List Comprehension is a concise way to create lists based on existing lists or other iterable objects #side-by-side[ ```python squares = [] for x in range(10): squares.append(x ** 2) ``` ][ ```python squares = [x ** 2 for x in range(10)] ``` ] - Add an if condition to include elements that satisfy the condition ```python evens = [x for x in range(10) if x % 2 == 0] #[0, 2, 4, 6, 8] ``` ] #focus-slide[ History of Programming Paradigms ] #slide(title: "Programming Paradigms")[ - What is a #alert[paradigm]? - A paradigm (in programming) refers to a #underline[style or way of thinking about and structuring code to solve problems] - #underline[Different paradigms approach problems from different angles], using distinct techniques and strategies - #alert[Evolution] of programming paradigms: - As computing hardware advanced, so did the complexity of software - Different paradigms emerged to solve new problems, manage complexity, and improve productivity ] #slide(title: "Imperative Programming")[ #align(center)[ _#alert[Imperative programming] is a paradigm that focuses on describing #alert[how] a program operates through #alert[explicit step-by-step instructions], detailing how the #alert[state] of the program #alert[changes over time]_ ] ] #slide(title: "Imperative Programming")[ === Sum of the first 10 numbers in C ```c int main() { int sum = 0; for (int i = 1; i <= 10; i++) { sum += i; } printf("Sum of first 10 numbers is %d\n", sum); return 0; } ``` ] #slide(title: "Imperative Programming")[ === History - #alert[1950s - 1960s]: origin of imperative Programming - Languages like #alert[Fortran] (1957) and #alert[Algol] (1958) were among the first to implement imperative concepts - #alert[C] (1972) became #alert[one of the most popular imperative languages] and laid the foundation for many modern languages like Java and C++ - These languages were designed to take advantage of the #alert[Von Neumann architecture] of computers, which operates with a sequence of instructions acting on memory ] #slide(title: "Imperative Programming")[ === Key Characteristics - #alert[Sequential execution:] code is executed one instruction at a time, in a predefined order - #alert[State and mutation:] the program's state is stored in variables, which can change (mutate) over time - #alert[Control flow]: programmers have explicit control over the flow of execution using constructs like: - Loops (for, while) - Conditional statements (if, else, switch) - Function calls - #alert[Memory management:] in earlier imperative languages like C, developers had to manually manage memory allocation and deallocation ] #slide(title: "Imperative Programming")[ === Advantages - #alert[Straightforward control:] offers explicit control over how a program runs and how its state evolves, making it easy to write simple scripts or perform low-level tasks - #alert[Close to machine language:] especially in languages like C, imperative programming provides direct manipulation of memory and system resources, making it suitable for performance-critical applications like operating systems and device drivers - #alert[Wide applicability:] suitable for a broad range of applications, from system programming to general-purpose programming ] #slide(title: "Imperative Programming")[ === Disadvantages - #alert[Complexity in large systems:] as the complexity of the program grows, managing state and flow control manually becomes cumbersome and error-prone - #alert[Hard to reason about:] programs with many mutable variables and complex flow (e.g., nested loops and conditionals) can become difficult to debug, maintain, and understand - #alert[Less modularity and reusability:] code often lacks the modularity and reuse seen in object-oriented programming due to its reliance on global state and tight coupling between operations ] #slide(title: "Object-Oriented Programming (OOP)")[ #align(center)[ _#alert[Object-oriented programming] (OOP) is a paradigm that organizes code by bundling related #alert[data] and #alert[methods] into #alert[objects], which represent entities or concepts from the #alert[real world] or problem domain_ ] #v(2em) #arrow The central concept of OOP is that objects #alert[interact] with one another to #alert[perform tasks], and programs are constructed as #alert[networks of these interacting objects] ] #slide(title: "Object-Oriented Programming")[ #figure(image("images/oop.jpg")) ] #slide(title: "Object-Oriented Programming")[ === History - #alert[1960s - 1980s:] OOP concepts first appeared in Simula (1960s), a simulation language designed for modeling real-world processes - #alert[1970s:] Smalltalk fully implemented OOP principles, pioneering the core concepts like classes, objects, inheritance, and message passing - #alert[1980s-1990s:] OOP became mainstream with the popularity of languages like C++ (1983) and Java (1995). These languages brought OOP into widespread use for everything from desktop applications to large-scale enterprise systems - #alert[Present]: Modern languages like Python, Kotlin, and Scala continue to embrace OOP, often combining it with other paradigms to maximize flexibility ] #slide(title: "Object-Oriented Programming")[ === How to define a class and create an object ```python class Student: def __init__(self, name, surname): self.name = name self.surname = surname def greet(self): print(f"Hello! My name is {name}") davide = Student('Davide', 'Domini') davide.greet() ``` ] #slide(title: "Object-Oriented Programming")[ === Key Concepts of OOP: Encapsulation #align(center)[ _Bundling #alert[data] (attributes) and #alert[methods] (functions) into a single unit called an #alert[object]. This #alert[hides the internal state of the object] and only #alert[exposes a public interface]._ ] ```python class Car: def __init__(self, model, color): self.model = model self.color = color def start_engine(self): print("Engine started") ``` ] #slide(title: "Object-Oriented Programming")[ === Key Concepts of OOP: Inheritance #align(center)[ _#alert[Creating new classes based on existing ones], allowing for #alert[reuse] of common behavior and properties. This models an "is-a" relationship._ ] ```python class ElectricCar(Car): def start_engine(self): print("Electric motor started") ``` ] #slide(title: "Object-Oriented Programming")[ === Key Concepts of OOP: Abstraction #align(center)[ _#alert[Simplifying] complex systems by providing a #alert[clear interface] and #alert[hiding the inner workings]. Abstraction allows programmers to focus on #alert[what] an object does, rather than #alert[how] it does it._ ] ```python class Animal: def __init__(self, name): self.name = name def speak(self): raise NotImplementedError("Subclass must implement this method") class Dog(Animal): def speak(self): return f"{self.name} says Woof!" class Cat(Animal): def speak(self): return f"{self.name} says Meow!" dog = Dog("Buddy") cat = Cat("Whiskers") print(dog.speak()) # Buddy says Woof! print(cat.speak()) # Whiskers says Meow! ``` ] #slide(title: "Object-Oriented Programming")[ === Advantages - #alert[Modularity:] classes and objects allow for clear modular design. Each object handles its own state and behavior, reducing dependencies and coupling between components - #alert[Code reuse:] through inheritance and polymorphism, common behavior can be abstracted and reused across different parts of a program - #alert[Scalability:] large systems can be broken down into smaller objects and components, making them easier to manage, extend, and maintain - #alert[Maintainability:] with encapsulation, changes to the internal workings of an object don't affect other parts of the codebase as long as the public interface remains the same ] #slide(title: "Object-Oriented Programming")[ === Disadvantages - #alert[Complexity:] OOP can introduce unnecessary layers of abstraction, making simple problems overly complex. For small programs, the overhead of defining classes and objects can be excessive - #alert[Performance overhead:] in some languages, OOP can lead to performance issues due to the abstraction layers, particularly when creating and managing many small objects. - #alert[Learning curve:] understanding concepts like inheritance, polymorphism, and design patterns can be challenging for beginners ] #slide(title: "Imperative Programming vs OOP")[ #set table( fill: (x, y) => if x == 0 or y == 0 { gray.lighten(40%) }, align: right, ) #align(center)[ #table( columns: 3, align: center, table.header( [#v(10pt) *Aspect* #v(10pt)], [*Imperative Programming*], [*Object-Oriented Programming*] ), [ #v(10pt) Control Flow #v(10pt)], [Explicit (sequential, loops)],[Distributed across objects], [#v(10pt) State management #v(10pt)], [Managed through variables], [Encapsulated within objects], [#v(10pt) Modularity #v(10pt)], [Function-based], [Object-based], [#v(10pt) Code reuse #v(10pt)], [Functions and libraries], [Inheritance, polymorphism], [#v(10pt) Example #v(10pt)], [C, Python (procedural style)], [Python, Java, Kotlin], ) ] ] #slide(title: "Why New Paradigms were Needed")[ - #alert[Complexity and Scalability:] as software grew, managing complex systems with just imperative techniques became difficult - #alert[Changing hardware architectures:] the rise of multi-core processors and distributed systems required new paradigms to handle concurrency and parallelism efficiently - #alert[Shift in software focus:] software has evolved to handle more complex tasks like UI design, web development, and artificial intelligence, which demand higher abstraction and modularity (OOP, functional programming) ] #focus-slide[ Let's try some coding in Python! ] #slide(title:"Lab 1")[ #side-by-side[ #link("https://tinyurl.com/DTM-Lab01") ][ #figure(image("images/DTM-Lab01.svg", width:50%)) ] ]
https://github.com/fenjalien/metro
https://raw.githubusercontent.com/fenjalien/metro/main/tests/num/print-implicit-plus/test.typ
typst
Apache License 2.0
#import "/src/lib.typ": num, metro-setup #set page(width: auto, height: auto) #num(345) #num(345, print-implicit-plus: true)
https://github.com/Caellian/UNIRI_voxels_doc
https://raw.githubusercontent.com/Caellian/UNIRI_voxels_doc/trunk/content/strukture.typ
typst
#import "../util.typ": complexity #import "@preview/fletcher:0.4.2": * #import "@preview/tablex:0.0.8": * = Pohrana volumetrijskih podataka <structures> Volumetrijke podatke možemo spremiti u: - diskretnom obliku, i u - obliku pravila ili funkcija. Dva pristupa značajno utječu na arhitekturu i zahtjeve aplikacija kao i na zahtjeve strojne opreme potrebne za izvođenje algoritama nad njima. Memorijski zahtjevi diskretnog oblika su generalno manji od zahtjeva oblika pohrane pravilima. Oblik podataka zadan pravilima se iznimno lagano (i učinkovito) diskretizira, no obrnuta pretvorba je znatno kompliciranija i nije egzaktna jer su neophodne pretpostavke o podacima kojih nema (regresija). Teško je usporediti algoritamsku složenost dvaju pristupa jer ona zavisi o potrebama aplikacije. Generalno, rasterizacija diskretnog pristupa je brža jer dozvoljava veču paralelizaciju. #linebreak() Rasterizacija oblika zadanog pravilima uzrokuje veču divergenciju osnovnih grupacija niti (engl. _warp_) koje provode instrukcije zbog čega GPU mora više puta provesti isti skup instrukcija (engl. _wavefront_) @nv-cuda-guide[4.1. SIMT arhitektura]. Dakle u slučajevima gdje je raznolikost prikazanih volumena mala, prikaz SDFa se može provesti brže nego prikaz slične geometrije uporabom diskretnih podataka. Definicija za @volumen pruža korisno ograničenje jer pokazuje da možemo doći do volumetrijskih podataka i na druge načine. #linebreak() Primjer toga je česta primjena složenijih funkcija koje proceduralno generiraju nizove točaka za prikaz (više o tome u @pcg). Za algoritme koračanja po zrakama (engl. _ray marching_) vrijedi obratno pa se ponajviše koriste za jednostavnije volumene, kao i primjene gdje je željena konstruktiva geometrija. TODO myb reference @Samet2006-vg #figure( kind: table, caption: [usporedba karakteristika struktura diskretnih volumetrijskih podataka], context { let columns = ( "read": [*Čitanje*], "write": [*Pisanje*], "advantage": [*Prednost*], ) let rows = () let datas = query( <volume-data-type-metadata> ).map(it => { let title = query( heading.where().before(it.location()) ).last() (title, it) }) let max-depth = datas.fold(1, (prev, (title, _)) => { calc.max(prev, title.level - 1) }) let last-indent = 0 for (i, (title, meta)) in datas.enumerate() { let indent = title.level - 2 let name = title.body rows.push(hlinex(start: calc.min(indent, last-indent))) rows.push(vlinex( start: 1 + i, end: 2 + i, x: indent, stroke: 1pt * (indent + 1) )) for i in range(0, indent) { rows.push([]) } rows.push(colspanx(max-depth - indent, link(title.location(), title.body))) for (key, _) in columns { rows.push(meta.value.at(key, default: [])) } last-indent = indent } tablex( columns: (..((2em,) * (max-depth - 1)), auto, ..((auto,) * columns.len())), align: (..((right,) * max-depth), ..((center,) * columns.len())), auto-lines: false, hlinex(start: max-depth), colspanx(max-depth, align(center)[*Ime strukture*]), vlinex(), ..(columns.values().map(it => (it, vlinex()))).flatten(), ..rows, hlinex(start: last-indent) ) } ) == Jednodimenzionalna uređenja #metadata(( read: complexity($1$, case: "best"), write: $1$ )) <volume-data-type-metadata> == 3D polje #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> #figure( caption: "struktura 3D polja" )[ ```rust const CHUNK_SIZE: usize = 32; type EntryID = u16; struct Chunk<T> { data: [[[EntryID; CHUNK_SIZE]; CHUNK_SIZE]; CHUNK_SIZE], values: Vec<T> } ``` ] <3d-struct> - Jednostavna i najčešća implementacija za real time render - Postoji relativno puno primjera, alogritama, ... == Range Tree #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> == Priority Search Tree #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> == Oktalno stablo #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> Oktalna stabla (engl. _octree_) su jedna od vrsta stabla koja imaju iznimno čestu uporabu u 3D grafici za ubrzavanje prikaza dijeljenjem prostora. Strukturirana podjela prostora dozvoljava značajna ubrzanja u ray tracing algoritmima jer zrake svijetlosti mogu preskočiti velike korake. Koriste se i u simulaciji fizike jer olakšavaju brzu segmentaciju prostora čime se postiže brzo isključivanje dalekih tijela iz izračuna kolizija. #grid( columns: (1fr, 1fr) )[ #figure( caption: "struktura oktalnog stabla s pokazivačima" )[ ```rust enum Octree<T> { Leaf(T), Node { children: [Box<Octree>; 8], } } ``` ] ][ #figure( caption: "struktura oktalnog stabla koje je sekvencijalno u memoriji" )[ ```rust enum OctreeNode<T, const DEPTH: usize> { Leaf(T), Node { children: [Octree<T, {DEPTH - 1}>; 8], } } ``` ] ] === Raštrkana stabla voksela #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> Raštrkana stabla voksela (engl. _sparse voxel octree_, SVO) su vrsta stablastih struktura koja pohranjuje susjedne čvorove u nelinearnim segmentima memorije te zbog toga dozvoljava "prazne" čvorove. ```rust enum Octree<T> { Leaf(Option<T>), Node { children: [Box<Octree>; 8], } } ``` Prednost ovakvih struktura je što prazni dijelovi strukture ne zauzimaju prostor u memoriji, te ih nije potrebno kopirati u memoriju grafičkih kartica prilikom prikaza. No iako rješavaju problem velike potrošnje memorije, čine izmjene podataka iznimno sporima te se zbog toga primjenjuju skoro isključivo za podatke koji se ne mijenjaju tokom provođenja programa. Izvor loših performansi izmjena su potreba za premještanjem (kopiranjem) postojećih podataka kako bi se postigla njihova bolja lokalnost u međuspremniku (engl. _cache locality_) na grafičkoj kartici. - Komplicirana implementacija - Postoji već gotov shader kod za ovo u par shading jezika negdje - https://research.nvidia.com/sites/default/files/pubs/2010-02_Efficient-Sparse-Voxel/laine2010tr1_paper.pdf === DAG #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> - Varijanta SVOa, navesti razlike. - Grozne karakteristike izmjena (po defaultu) - https://github.com/Phyronnaz/HashDAG == K-d Stablo #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> == Bucket Methods #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> == PK-Stablo #metadata(( read: $1$, write: $1$ )) <volume-data-type-metadata> == Point-cloud data? Spremljeno u Octreeu zapravo? Laserski skeneri ju generiraju, česta primjena u geoprostornoj analizi. - Dronovi ju koriste za navigaciju. #pagebreak()
https://github.com/rabotaem-incorporated/algebra-conspect-1course
https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/06-field-theory/!sec.typ
typst
Other
#import "../../config.typ" #if config.enable-chapters-from-sem2 [ = Элементы теории полей #include "01-factorrings.typ" #include "02-s1mple-field.typ" #include "03-field-extension.typ" #include "04-decomposition-field.typ" #include "05-finite-fields.typ" ]
https://github.com/OrangeX4/typst-talk
https://raw.githubusercontent.com/OrangeX4/typst-talk/main/examples/fibonacci.typ
typst
#set page(width: 10cm, height: auto) #set heading(numbering: "1.") = Fibonacci sequence The Fibonacci sequence is defined through the recurrence relation $F_n = F_(n-1) + F_(n-2)$. It can also be expressed in _closed form:_ $ F_n = round(1 / sqrt(5) phi.alt^n),quad phi.alt = (1 + sqrt(5)) / 2 $ #let count = 8 #let nums = range(1, count + 1) #let fib(n) = ( if n <= 2 { 1 } else { fib(n - 1) + fib(n - 2) } ) The first #count numbers of the sequence are: #align(center, table( columns: count, ..nums.map(n => $F_#n$), ..nums.map(n => str(fib(n))), ))
https://github.com/a-kkiri/HEU-Report-Typst
https://raw.githubusercontent.com/a-kkiri/HEU-Report-Typst/main/template.typ
typst
Apache License 2.0
#let project( title: "", author: "", infos: ( ), coverTable_display: true, outline_display: true, header_display: true, body ) = { // 文本和代码的字体 let text_font = "Times New Roman" let code_font = "DejaVu Sans Mono" let title_font = "STXinwei" let songti = "SimSun" let heiti = "SimHei" let 字号 = ( 四号: 14pt, 小四: 12pt, ) // 设置正文和代码的字体 set text(font: (text_font, songti), size: 12pt, lang: "zh", region: "cn") show strong: it => { show regex("[\p{hani}\s]+"): set text(stroke: 0.3pt) it } show raw: set text(font: (code_font, songti), 10pt) // 设置文档元数据和参考文献格式 set document(author: author, title: title) set bibliography(style: "gb-7714-2015-numeric") // 设置页面 set page( paper: "a4", margin: auto, header: locate(loc => { if header_display == false or loc.page() == 1{return} let footers = query(selector(<__footer__>).after(loc), loc) let elems = query( heading.where(level: 1).before(footers.first().location()), footers.first().location() ) if elems != () { emph(elems.last().body) + h(1fr) + emph(title) }else{ h(1fr) + emph(title) } v(-7pt) align(center)[#line(length: 105%, stroke: (thickness: 1pt, dash: "solid"))] }), footer: locate(loc =>{ if loc.page() == 1 {return} [ #align(center)[#counter(page).display("1 / 1",both: true,)] #label("__footer__") ] }) ) //设置标题 set heading(numbering: "1.1 ") show heading: it => box(width: 100%)[ #set text(font: (text_font, heiti)) #if it.numbering != none { counter(heading).display() } #it.body #v(8pt) ] show heading.where( level: 1 ): it => box(width: 100%)[ #set heading(numbering: "一、") #set align(center) #v(4pt) #it ] // 配置公式的编号和间距 show math.equation: eq => { set block(spacing: 0.65em) eq } show math.equation: it => { show regex("[\p{hani}\s]+"): set text(font: songti) it } // Cover let underlineField(key, value) = [ #set align(center + horizon) #set text(size: 字号.小四) #grid( columns: (80pt, 250pt), align(right + top)[ #text(size: 字号.四号)[#key] ], grid( rows: (10pt, auto), row-gutter: 0.2em, value, line(length: 98%, stroke: 0.5pt) ) ) #v(12pt) ] block(width: 100%, height: 15%, spacing: 0pt)[ #set align(center + bottom) #box()[ #image("figures/heu_title.png", width: 10.5cm, height: 1.4cm, fit: "stretch") ] ] block(width: 100%, height: 25%, spacing: 0pt)[ #set align(center + horizon) #set text(size: 50pt) #text(font: title_font)[#title] ] block(width: 100%, height: 35%, spacing: 0pt)[ #set align(center + horizon) #for i in infos{ underlineField(i.key, i.value) } ] block(width: 100%,height: 25%, spacing: 0pt)[ #set align(center + horizon) #if coverTable_display == true { set text(size: 字号.小四) table( columns: 425pt, rows: (35pt, 140pt), stroke: 0.5pt, align: left + horizon, [大作业成绩:], table.cell( align: top, inset: (y: 12pt), )[任课教师评语:], ) }else{ set text(size: 字号.四号) underline(offset: 2pt)[哈尔滨工程大学本科生院] } ] pagebreak() counter(page).update(1) // 显示目录 if outline_display{ outline(indent: auto) pagebreak() } // Main body set par(first-line-indent: 2em) set enum(tight:false, indent: 2em, body-indent: 8pt) set list(tight:false, indent: 2em, body-indent: 8pt) show figure: it => [ #v(12pt) #it #par()[#text(size: 0.0em)[#h(0.0em)]] #v(-8pt) ] show image: it => [ #it #v(-12pt) #par()[#text(size: 0.0em)[#h(0.0em)]] ] show figure.where( kind: raw ): it => { set block(width: 100%, breakable: true) it } // 配置行内代码块、行间代码块 show raw.where(block: false): it => box(fill: luma(240), inset: (x: 2pt), outset: (y: 3pt), radius: 1pt)[#it] show raw.where(block: true): it => block(width: 100%, fill: luma(240), inset: 10pt, radius: 3pt, breakable: true)[#it] body } // 公式编号 #let equation(it) = { math.equation(numbering: "(1)", block: true, it) }
https://github.com/typst-doc-cn/tutorial
https://raw.githubusercontent.com/typst-doc-cn/tutorial/main/src/graph/solid-geometry.typ
typst
Apache License 2.0
#import "mod.typ": * #import "@preview/cetz:0.2.0": * #show: book.page.with(title: "立体几何") == 变换「坐标系」 在绘制立体图形(以及其他抽象图形)时,最重要的思路是变换「坐标系」(Viewport),以方便绘制。 #code(```typ #import "@preview/cetz:0.2.0": * #canvas({ import draw: * let axis-line(p) = { line((0, 0), (x: 1.5), stroke: red) line((0, 0), (y: 1.5), stroke: blue) line((0, 0), (z: 1.5), stroke: green) circle((0, 0, 0), fill: black, radius: 0.05) content((-0.4, 0.1, -0.2), p) } set-viewport((0, 0, 0), (4, 4, -4), bounds: (4, 4, 4)) axis-line("A") set-viewport((4, 4, 4), (0, 0, 0), bounds: (4, 4, 4)) axis-line("B") }) ```) == 使用「空间变换」 由于「空间变换」(Transformation)的存在,你可以先绘制基本图形,再使用变换完成图形的绘制: ```typ #let 六面体 = { import draw: * let neg(u) = if u == 0 { 1 } else { -1 } for (p, c) in ( ((0, 0, 0), black), ((1, 1, 0), red), ((1, 0, 1), blue), ((0, 1, 1), green), ) { line(vector.add(p, (0, 0, neg(p.at(2)))), p, stroke: c) line(vector.add(p, (0, neg(p.at(1)), 0)), p, stroke: c) line(vector.add(p, (neg(p.at(0)), 0, 0)), p, stroke: c) } } ``` #let 六面体 = { import draw: * let neg(u) = if u == 0 { 1 } else { -1 } for (p, c) in ( ((0, 0, 0), black), ((1, 1, 0), red), ((1, 0, 1), blue), ((0, 1, 1), green), ) { line(vector.add(p, (0, 0, neg(p.at(2)))), p, stroke: c) line(vector.add(p, (0, neg(p.at(1)), 0)), p, stroke: c) line(vector.add(p, (neg(p.at(0)), 0, 0)), p, stroke: c) } } 运行以下代码你将获得: #code(```typ #import "@preview/cetz:0.2.0": * #align(center, canvas(六面体)) ```, scope: (六面体: 六面体)) #pagebreak(weak: true) == 六面体 #code(```typ #import "@preview/cetz:0.2.0": * #align(center, canvas({ import draw: * set-viewport((0, 0, 0), (4, 4, -4), bounds: (1, 1, 1)) group(name: "S", translate((0, 0, 0)) + { anchor("O", (0, 0, 0)) 六面体 }) group(name: "T", translate((1.4, 0, 0)) + scale(x: 120%, y: 80%) + { line((0, 0, 0.5), (0.5, 0, 0), stroke: black) anchor("A", (0, 0, 0.5)) anchor("B", (0.5, 0, 0)) 六面体 }) circle("S.O", fill: black, radius: 0.05 / 4) content((rel: (-0.08, 0.04, 0), to: "S.O"), [O]) circle("T.A", fill: black, radius: 0.05 / 4) content((rel: (0.02, -0.08, 0), to: "T.A"), [A]) circle("T.B", fill: black, radius: 0.05 / 4) content((rel: (0, 0.1, 0), to: "T.B"), [B]) })) ```, scope: (六面体: 六面体))
https://github.com/LEXUGE/poincare
https://raw.githubusercontent.com/LEXUGE/poincare/main/src/notes/electrodynamics/main.typ
typst
MIT License
#import "@preview/physica:0.9.2": * #import "@preview/gentle-clues:0.4.0": * #import "@lexuge/templates:0.1.0": * #import shorthands: * #import pf3: * #show: simple.with( title: "Electromagnetism and Optics", authors: ((name: "<NAME>", email: "<EMAIL>"),), ) #set page(margin: (y: 1cm)) #let hl = highlight #pagebreak() = Overview This notes focus currently on non-relativistic electromagnetism without classical field theory content. From my understanding, content mainly consists of three parts: 1. *Microscopic Theory* This includes Maxwell's equation in vacuum, boundary conditions of Maxwell's equation, solving Maxwell's equation in static cases (gauge and Poisson equation), and the interpretation of electromagnetic fields as having energy and momentum. The wave solution#footnote[Though it's more interesting when we study it in matters] of Maxwell's equation and a relativistic treatment should also fit in here. 2. *Macroscopic Theory* This includes auxiliary fields like $vb(D), vb(H)$ and wave solution to Maxwell's equation in linear dielectrics, ohmnic conductors, and (collisionless cold) plasma. It gradually shifts to more interesting applications to optics including Fresnel's equation and Brewster angle#footnote[needed to understand your CPL lens on your camera]. And it also serves as a starting point for topics like diffraction and polarization 3. *Models and Applications* This includes models like transmission line, wave guide, and circuits. Note nothing from classical field theory and/or relativistic treatment is inside. Another note to make is: unlike Newtonian mechanics, the solvability (and uniqueness) of the Maxwell's equation is not evident. And over the course of the derivation there could be places causing significant of mathematical subtleties. To not obscure the physics too much, we should content with an informal discussion on those issue. == Mathematics Needed For electromagnetism - 3D vector calculus (though a proper $RR^n$ treatment is recommended) - Basic Theory on Linear ODE and simple PDE (Laplace and wave equation) - Strum-Liouville Theory (so Fourier Series and orthogonal polynomials) - Ideas on distribution theory (though we will not use them extensively) For optics - Fourier Transform and Convolution #pagebreak() = Microscopic Theory #def( "Microscopic Maxwell's equation", )[ In vacuum, $ div vb(E) &= rho/epsilon_0 \ div vb(B) &= 0 \ curl vb(E) &= -pdv(vb(B), t) \ curl vb(B) &= mu_0 vb(J) + mu_0 epsilon_0 pdv(vb(E), t) $ Charge density $rho$ and current density $vb(J)$ are called source terms. Electrodynamics is a field theory, source term "creates" field and field governs sources' dynamics. $vb(E), vb(B), rho, vb(J)$ should all be thought as distributions. ] #info[_Strictly speaking, Maxwell's equation needs to be solved self-consistently_ (i.e. source and fields have to satisfy Maxwell's equation at the same time). However, in most time, we make approximations and idealized assumptions (e.g. when solving "long" solenoids) which are good enough to yield physical insight but strictly speaking violating Maxwell's equations.] #question[*Notes to myself:* is there some boundary condition needed for Maxwell's equation in general? Like in infinite free space? Where does the usual "decaying" boundary condition come from? I think no. Maxwell's equation itself doesn't imply any boundary condition. And we get decaying property because it's physical to have locality (?), and we require so to derive the Green's function for infinite space Poisson equation. And sometimes we indeed drop this decaying property for example in studying plane wave solution, though clearly such solution is not physical. So I would peer to think Maxwell's equation doesn't have boundary condition on its own in general in gen.] One reason that we should really think of fields and sources as distributions is we later will invoke Poincare's lemma to deduce potentials. If they are not defined as distributions, then even for point charge we will have non-simply-connected domain for $vb(E)$ which violates the condition for Poincare's lemma. This would be very unsatisfying. For this reason, _though I have not enough rigorous experience with distributions and PDEs_, I believe if we think of them as distributions then their domains#footnote[Though then they will be functionals living in different spaces than ordinary functions] will become "nice" and somewhat advanced Poincare's lemma could apply. And our later analysis (which uses Poincare's lemma anyway) is then roughly sound. For a more detailed discussion on distribution as solution for Maxwell's equation, see @poincare-lemma-and-distribution. == Boundary Conditions The boundary condition for electromagnetic field for surface charge/current density is derived in most books. #thm( "Boundary Condition Perpendicular", )[ At a surface, let $vb(hat(n))_1, vb(hat(n))_2$ be outward surface normal on different sides, let $vb(E)_1, vb(E)_2$ be fields on different sides then $ vb(hat(n))_1 cdot vb(E)_1 + vb(hat(n))_2 cdot vb(E)_2 = sigma/epsilon_0 $ or equivalently, $ vb(hat(n))_1 cdot (vb(E)_1 - vb(E)_2) = sigma/epsilon_0 \ vb(hat(n))_2 cdot (vb(E)_2 - vb(E)_1) = sigma/epsilon_0 $ For the magnetic field, we have $ vb(hat(n))_1 cdot vb(B)_1 + vb(hat(n))_2 cdot vb(B)_2 = 0 $ #figure( image("figs/boundary-condition-perpendicular.png", width: 80%), caption: [The setup perpendicular boundary condition for field], )<fig-bc-perp> ]<micro-boundary-condition-perp> #proof[This is the usual "pill-box" argument.] #thm( "Boundary Condition Parallel", )[ At a surface, let $vb(hat(n))_1, vb(hat(n))_2$ be outward surface normal on different sides, let $vb(E)_1, vb(E)_2, vb(B)_1, vb(B)_2$ be fields on different sides then $ vb(hat(n))_1 times vb(E)_1 + vb(hat(n))_2 times vb(E)_2 = 0 $ and $ vb(hat(n))_1 times vb(B)_1 + vb(hat(n))_2 times vb(B)_2 = mu_0 vb(K) $ where $vb(K)$ is the surface current density. ]<micro-boundary-condition-para> #proof[ The method of "proof" is similar for both fields. The core idea is the same as the textbook: we draw thin loop and integrate and use Green's Theorem. #figure( image("figs/boundary-condition-parallel-loop1.png", width: 80%), caption: [The loop 1 of setup for parallel boundary condition for field], )<fig-bc-para-loop1> Assuming the surface current density $vb(K)$ and field $vb(B)_(1,2)$ are uniform in their regions. For the first loop, we take the normal of the loop area parallel to $vb(K)$ (see @fig-bc-para-loop1) at the point of our interest. By integrating $curl vb(B) = mu_0 vb(J) + mu_0 epsilon_0 pdv(vb(E), t)$ and use green's theorem along the loop $ vb(hat(K)) cdot mu_0 l vb(K) &= l vb(B)_1 cdot (hat(vb(K)) times vb(hat(n))_1) + l vb(B)_2 cdot (hat(vb(K)) times vb(hat(n))_2) \ &= l hat(vb(K)) cdot (vb(hat(n))_1 times vb(B)_1 + vb(hat(n))_2 times vb(B)_2) $ where we have assumed that as the loop gets squashed onto the surface, $pdv(vb(E), t)$ is not "localized" and is bounded so it vanishes under limit. Equivalently, we have $ vb(hat(K)) cdot mu_0 vb(K) &= hat(vb(K)) cdot (vb(hat(n))_1 times vb(B)_1 + vb(hat(n))_2 times vb(B)_2) $ #figure( image("figs/boundary-condition-parallel-loop2.png", width: 80%), caption: [The loop 2 of setup for parallel boundary condition for field], )<fig-bc-para-loop2> If we choose another loop (see @fig-bc-para-loop2) and integrate on that, we get $ 0 &= vb(hat(K)_perp) cdot mu_0 vb(K) \ &= l vb(B)_1 cdot (vb(hat(K))_perp times vb(hat(n))_1) + l vb(B)_2 cdot (vb(hat(K))_perp times vb(hat(n))_2) \ &= vb(hat(K))_perp cdot (vb(hat(n))_1 times vb(B)_1 + vb(hat(n))_2 times vb(B)_2) $ So we got the components of $vb(hat(n))_1 times vb(B)_1 + vb(hat(n))_2 times vb(B)_2$ in the tangent plane: $ vb(hat(K)) &: mu_0 vb(K) \ vb(hat(K))_perp &: 0 $ So we have $ vb(hat(n))_1 times vb(B)_1 + vb(hat(n))_2 times vb(B)_2 = mu_0 vb(K) $ For $vb(E)$ the analysis is similar, however, it is _assumed_ that $pdv(vb(B), t)$ is bounded and thus it's surface integral, unlike $vb(K)$ which is a dirac delta, will vanish#footnote[Indeed, the displacement term $pdv(vb(E), t)$ doesn't appear in the magnetic boundary condition for the same reason] as we decrease the integration loop. Thus $vb(hat(n))_1 times vb(E)_1 + vb(hat(n))_2 times vb(E)_2 = 0$. ] #remark[Note the unit of above expressions don't match. And these expressions are valid as long as the surface don't move. In particular, they are valid even when we are not dealing with electrostatics/magnetostatics.] #remark[Since $vb(hat(n))_1 times (vb(hat(n))_1 times vb(v)) = -vb(v)$, we can also write $ vb(B)_1 - vb(B)_2 = mu_0 vb(K) times vb(hat(n))_1 $ Or symmetrically, $ vb(B)_2 - vb(B)_1 = mu_0 vb(K) times vb(hat(n))_2 $ ] #remark[As exemplified in @fig-bc-para-loop1, *this is a vector difference* across the boundary.] #caution[ There are two intricacies/deficiencies for @micro-boundary-condition-perp and @micro-boundary-condition-para: 1. We are assuming the field and current/charge density are uniform. This means the field should be at least continuous in the 3D region of consideration. And the current/charge density should be continuous within the 2D sheet. 2. We are assuming the time derivatives are bounded so we could throw out some integral terms under limit. ] #idea[ @micro-boundary-condition-para and @micro-boundary-condition-perp are quite general. As long as the surface is not moving and time-derivative of fields are bounded, the proof is valid. *This means it also applies to wave boundary condition* (as long as the field is not creating "localized" time-derivative). ] == Potential and Gauge Transformation #hl[Usual derivation omitted for now] === Boundary Condition for Potentials Potentials are even more regular than fields. Indeed, I _suspect_ such a "regularity hierarchy": $ phi, vb(A) gt.curly vb(E), vb(B) gt.curly rho, vb(J) $ where $gt.curly$ means "more regular than". The reason being "derivative" of potential gives rise to fields whose derivative gives rise to sources. And integration "smoothes" things out (think of fundamental theorem of calculus). And they are continuous across surface boundary. #info[An easy reasoning for the particular case of Coulomb gauge ($div vb(A) = 0$) is: 1. from $div vb(A) = 0$ we get the perpendicular component is continuous (using similar reasoning as @micro-boundary-condition-perp) 2. from $curl vb(A) = vb(B)$ and if we assume $vb(B)$ is not "localized" (i.e. not like dirac delta), then we get parallel component being continuous (using similar reasoning as @micro-boundary-condition-para). ] == Field Energy, Momentum, and Pressure #hl[usual derivation omitted for now.] == (Plane) Wave Solution _The usual derivation for plane wave solution for Maxwell equation is omitted._ One thing in particular to notice is how derivatives are translated into simple algebraic equations. If we write the solution in complex form, $ vb(E) = vb(E)_0 exp(i(vb(k) cdot vb(r) - omega t)) $ where $vb(E)_0, vb(k)$ can be complex vectors, then we can just identify $nabla$ as $i vb(k)$. So $div vb(E) = i vb(k) cdot vb(E)$, and $curl vb(E) = i vb(k) times vb(E)$.#footnote[Although this looks like one of the Fourier Transform's identity but this is just a coincidence as $vb(E)$ stays as $vb(E)$ not Fourier transform of $vb(E)$.] /*#remark[I don't think we will usually complexify $omega$ cause that makes wave disappear/blow up as time goes on, which is not we are looking for? *What are we looking for exactly?*]*/ #warning[ Complex solution is just a sufficient form that works nicely with derivatives and cancellation (as phase shifts are incorporated as multiplication). However, sufficiency is not equivalence. For reflection and refraction problem, we need to keep the sign of $omega t$ for both left and right traveling wave the same (so we could extract out the common $exp(i omega t)$). So you should either use $ exp(i(vb(k) cdot vb(r) - omega t)), exp(-i(vb(k) cdot vb(r) + omega t)) $ or $ exp(i(omega t -vb(k) cdot vb(r))), exp(i(omega t + vb(k) cdot vb(r))) $ The first one is preferable. #hl[Why?] ] == Multipole Expansion, Electric and Magnetic Dipole A flipped way of looking at this issue is to think multiple expansion being general (e.g. having a charge distribution/current density distribution, we can always do multipole expansion). And dipoles are just the _dipole term_ of limit of certain object. And we idealize them as being real object. #hl[Omitted for now] = Macroscopic Theory We model the macroscopic matters like dielectrics with dipoles. I think this is at least a reasonable model because: - The dielectrics doesn't carry net charge. And dipole moment will give first-order correction. - Modeling entire matter using a single dipole moment would be a bad choice. I suspect this is because such _global_ first-order correction will give huge error bound, and it also doesn't allow us to discuss meaningfully the spatial variation of $vb(E), vb(B)$ inside the material. Latter is what we want to indeed, as we do in poking dielectrics with plane wave solutions. - Instead, we model each atom (Lorentz model. See also @dielectric-basic-atomic-model) as a dipole (thus neglecting higher order expansions). This local approach of model turns out to be adequate in our cases. The same reasoning could be used for magnetic material. Except this time the classical model that gives rise to these local magnetic dipole moment doesn't seem to be obvious (but that's fine, classical electromagnetism is not supposed to give accurate explanation of microscopic strucuture). #hl[We may think of spin?] #hl[Omitted for now] The macroscopic Maxwell equation is $ div vb(D) & = rho_f \ div vb(B) &= 0 \ curl vb(E) &= - pdv(vb(B), t)\ curl vb(H) &= vb(J)_f + pdv(vb(D), t) $ with constitutive equation $ vb(D) &= epsilon_0 vb(E) + vb(P) \ vb(B) &= mu_0 (vb(H) + vb(M)) $ == Dielectrics == Plasma = Optics Before we dive into specific applications like== Fresnel Equation #pagebreak() #bibliography("./bib.yml", style: "ieee")
https://github.com/jbirnick/typst-rich-counters
https://raw.githubusercontent.com/jbirnick/typst-rich-counters/main/build/render_template.typ
typst
MIT License
#set page(width: 45em, height: auto, margin: 1em) #include "/" + sys.inputs.file
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/text/quotes.typ
typst
Apache License 2.0
// Test smart quotes. --- #set page(width: 250pt) // Test simple quotations in various languages. #set text(lang: "en") "The horse eats no cucumber salad" was the first sentence ever uttered on the 'telephone.' #set text(lang: "de") "Das Pferd frisst keinen Gurkensalat" war der erste jemals am 'Fernsprecher' gesagte Satz. #set text(lang: "de", region: "CH") "Das Pferd frisst keinen Gurkensalat" war der erste jemals am 'Fernsprecher' gesagte Satz. #set text(lang: "es", region: none) "El caballo no come ensalada de pepino" fue la primera frase pronunciada por 'teléfono'. #set text(lang: "es", region: "MX") "El caballo no come ensalada de pepino" fue la primera frase pronunciada por 'teléfono'. #set text(lang: "fr", region: none) "Le cheval ne mange pas de salade de concombres" est la première phrase jamais prononcée au 'téléphone'. #set text(lang: "fi") "Hevonen ei syö kurkkusalaattia" oli ensimmäinen koskaan 'puhelimessa' lausuttu lause. #set text(lang: "he") "הסוס לא אוכל סלט מלפפונים" היה המשפט ההראשון שנאמר ב 'טלפון'. #set text(lang: "ro") "Calul nu mănâncă salată de castraveți" a fost prima propoziție rostită vreodată la 'telefon'. #set text(lang: "ru") "Лошадь не ест салат из огурцов" - это была первая фраза, сказанная по 'телефону'. --- // Test single pair of quotes. "" --- // Test sentences with numbers and apostrophes. The 5'11" 'quick' brown fox jumps over the "lazy" dog's ear. He said "I'm a big fella." --- // Test escape sequences. The 5\'11\" 'quick\' brown fox jumps over the \"lazy" dog\'s ear. --- // Test turning smart quotes off. He's told some books contain questionable "example text". #set smartquote(enabled: false) He's told some books contain questionable "example text". --- // Test changing properties within text. "She suddenly started speaking french: #text(lang: "fr")['Je suis une banane.']" Roman told me. Some people's thought on this would be #[#set smartquote(enabled: false); "strange."] --- // Test nested double and single quotes. "'test statement'" \ "'test' statement" \ "statement 'test'"
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/lovelace/0.1.0/examples/comment.typ
typst
Apache License 2.0
#import "../lib.typ": * #set page(width: 20em, height: auto, margin: 1em) #show: setup-lovelace #pseudocode( [A statement #comment[and a comment]], [Another statement #comment[and another comment]], )
https://github.com/elipousson/typstdoc
https://raw.githubusercontent.com/elipousson/typstdoc/main/CHANGELOG.md
markdown
Creative Commons Zero v1.0 Universal
## typdoc (development) - Set default value for `heading-font-size` (`1.2em`). Set default value for `mainfont` (`("Roboto", "Arial", )`) and update default value for `monofont` (now `("Roboto Mono", "Courier", )`). - Add experimental support for `lof` (list of figures) and `lot` (list of tables) parameters. - Add `toc-indent` parameter (see [outline function documentation](https://typst.app/docs/reference/model/outline/#parameters-indent) for more information). - Add default bibliography functionality to template. ## typdoc (1.0.0) - Initial release.
https://github.com/AlyamanMas/QuranKindle
https://raw.githubusercontent.com/AlyamanMas/QuranKindle/master/main.typ
typst
#import "template.typ": * // Take a look at the file `template.typ` in the file panel // to customize this template and discover how it works. #show: project.with( title: "Quran", authors: ( "<NAME>", ), ) #show heading: set text(0pt) #set heading(numbering: "1.") #let data = toml("data.toml") #let chapters = json("chapters.json") #let debug = white #let surah_starting_pages = chapters.chapters.map(sura => sura.pages.at(0)) //#repr(surah_starting_pages) #let get_juz(page) = { for index in range(29, -1, step: -1) { let juz_page = data.page_for_juz.at(index) if page >= juz_page { return index + 1 } } } #let numpad(x) = { if x < 10 { return "00" + str(x) } else if x < 100 { return "0" + str(x) } else if x < 1000 { return str(x) } } #let arabicnum(x) = { let num = x // if string if type(x) == int { num = str(x) } return num .replace("0", "٠") .replace("1", "١") .replace("2", "٢") .replace("3", "٣") .replace("4", "٤") .replace("5", "٥") .replace("6", "٦") .replace("7", "٧") .replace("8", "٨") .replace("9", "٩") } #let get_surah(page) = { let page = page - 1 let surah_number = data.surah_for_page.at(page) return chapters.chapters.at(surah_number - 1).name_arabic } #for i in range(1, 605) { if i in surah_starting_pages { let surah_index = surah_starting_pages.position(x => x == i) [ // Using content here because label can only attach inside a content block as of current version of Typst #heading( chapters.chapters.at(surah_index).name_arabic ) #label( str(surah_index) ) ] } [ #place( top + right, dy: -0em, [ #block( stroke: debug, clip: true, width: 84%, height: 100%, )[ #table( inset: 0em, column-gutter: 0em, //fill: black, row-gutter: 0em, rows: (auto, 1fr, auto), stroke: debug, [ #table( columns: (1fr, 0.33fr, 1fr), stroke: debug, [سورة #get_surah(i)], [#arabicnum(i)], [الجزء #arabicnum(get_juz(i))] ) ], [ #align(center + horizon)[ #block(inset: 0.5em)[ #image("cropped/" + numpad(i) +"___Hafs39__DM.ai.svg") ] ] ], ) ] ] ) #pagebreak() ] } #{ // table of contents let generate_surah_ref(surah_index) = { link( ( page: surah_starting_pages.at(surah_index), x: 0pt, y: 0pt, ), block( text( //baseline: -0.4em, chapters.chapters.at(surah_index).name_arabic, ), width: 100%, height: 100%, fill: rgb("#eee"), radius: 0.5em, ) ) } pad( x: 1em, top: 0.65em, [ #heading("الفهرس") #label("الفهرس") #align( center, text( top-edge: 1em, weight: "bold", size: 2em, "الفهرس" ) ) #table( columns: (1fr, 1fr, 1fr), rows: (3em), align: center + horizon, stroke: white, ..range(0, 114).map(s => generate_surah_ref(s)) ) ] ) } // TODO: Add Tafseer section and link it to ayah's on the left margin of the text
https://github.com/kdog3682/2024-typst
https://raw.githubusercontent.com/kdog3682/2024-typst/main/src/te-two-column-dialogue-layout.typ
typst
#let dialogue-layouter(items) = { let store = () for index, item in items.enumerate() { store.push(bold(index + 1)) store.push(item) } let attrs = ( columns: (auto, 1fr), column-gutter: 10pt, row-gutter: 10pt, ) grid(..attrs, ..store) }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/tlacuache-thesis-fc-unam/0.1.1/template/seccion1.typ
typst
Apache License 2.0
#import "@preview/tlacuache-thesis-fc-unam:0.1.1": section //completamente opcional cargar la bibliografía, compilar la sección #show: section.with(bibliography: bibliography("references.bib")) == Esta es la primera sección del capitulo 1 Siempre puedes escribir todo en el archivo del capítulo, pero a mi me gusta mas dividirlo en secciones.
https://github.com/loqusion/typix
https://raw.githubusercontent.com/loqusion/typix/main/docs/recipes/adding-dependencies.md
markdown
MIT License
# Adding dependencies You can add dependencies to your [flake inputs][nix-ref-flake-inputs][^zero-to-nix-flakes] so that Typst compilation does not depend on the transient state of the local system: instead, any dependencies are automatically fetched and made available in a sandboxed environment. Examples of dependencies you might want to add: - [Font files][typst-ref-text--font] — [`fontPaths`](../api/derivations/mk-typst-derivation.md#fontpaths) - [Image files][typst-ref-image] — [`virtualPaths`](../api/derivations/mk-typst-derivation.md#virtualpaths) - [Data files][typst-ref-data-loading] (e.g. [JSON][typst-ref-data-json], [TOML][typst-ref-data-toml], [XML][typst-ref-data-xml]) — [`virtualPaths`](../api/derivations/mk-typst-derivation.md#virtualpaths) For a more complete description of how to specify flake inputs, see the Nix Reference Manual [section on flakerefs][nix-ref-flake-references]. [^zero-to-nix-flakes]: See also: <https://zero-to-nix.com/concepts/flakes> ## nixpkgs Many popular fonts are available as packages to [nixpkgs][nixpkgs], so if you're wanting to add a font it's good to try that before anything else. To determine the path(s) to the files you wish to include, first run the following command (which creates a symbolic link named `result` in the current directory): ```bash nix-build '<nixpkgs>' --out-link result --attr PACKAGE_NAME ``` Then explore the `result` with whichever commands you like — for instance, using [`unix-tree`][unix-tree]: ```bash tree ./result ``` ```text result └── share └── fonts └── truetype ├── Roboto-BlackItalic.ttf ├── Roboto-Black.ttf ├── Roboto-BoldItalic.ttf ├── Roboto-Bold.ttf ├── RobotoCondensed-BoldItalic.ttf ├── RobotoCondensed-Bold.ttf ├── RobotoCondensed-Italic.ttf ├── RobotoCondensed-LightItalic.ttf ├── RobotoCondensed-Light.ttf ├── RobotoCondensed-MediumItalic.ttf ├── RobotoCondensed-Medium.ttf ├── RobotoCondensed-Regular.ttf ├── Roboto-Italic.ttf ├── Roboto-LightItalic.ttf ├── Roboto-Light.ttf ├── Roboto-MediumItalic.ttf ├── Roboto-Medium.ttf ├── Roboto-Regular.ttf ├── Roboto-ThinItalic.ttf └── Roboto-Thin.ttf ``` Here, we can see that the relative path should be `share/fonts/truetype`, so in `flake.nix` we use that information like so: {{#include ../api/derivations/common/font-paths-example.md:mktypstderivation_example}} ## GitHub [GitHub](https://github.com) hosts a great deal of fonts and icon libraries, and Nix makes it easy to add GitHub repositories as flake inputs with [URL-like syntax][nix-ref-flake-url]. Here's an example of specifying a GitHub URL as a flake input and adding it to [`virtualPaths`](../api/derivations/mk-typst-derivation.md#virtualpaths), specifying that we want the `svgs/regular` directory to be accessible from `icons`: {{#include ../api/derivations/common/virtual-paths-example.md:mktypstderivation_example}} With this, we can use it in Typst as if it were any other local path: {{#include ../api/derivations/common/virtual-paths-example.md:typst_example}} ## Using local files If all else fails, you can always manually download what you need and move it to your Typst project directory. Here's what you need to know: - The Typst compiler invoked by [`buildTypstProject`](../api/derivations/build-typst-project.md), [`buildTypstProjectLocal`](../api/derivations/build-typst-project-local.md), etc. won't see the files you've added unless they're present in one of the source tree parameters — in practice, these are [`src`](../api/derivations/mk-typst-derivation.md#src), [`fontPaths`](../api/derivations/mk-typst-derivation.md#fontpaths), and [`virtualPaths`](../api/derivations/mk-typst-derivation.md#virtualpaths). (This doesn't apply to [`watchTypstProject`](../api/derivations/watch-typst-project.md).) - Paths to font files must still be passed in [`fontPaths`](../api/derivations/mk-typst-derivation.md#fontpaths) or otherwise made known to the Typst compiler (e.g. via [`--font-path`][typst-man-compile--font-path]). See ["Specifying sources"](./specifying-sources.md#expanding-a-source-tree) for information on how to expand a source tree to include the files you need. [nix-ref-flake-inputs]: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs [nix-ref-flake-references]: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-references [nix-ref-flake-url]: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#url-like-syntax [nixpkgs]: https://search.nixos.org/packages [typst-man-compile--font-path]: https://man.archlinux.org/man/typst-compile.1.en#font [typst-ref-data-json]: https://typst.app/docs/reference/data-loading/json/ [typst-ref-data-loading]: https://typst.app/docs/reference/data-loading/ [typst-ref-data-toml]: https://typst.app/docs/reference/data-loading/toml/ [typst-ref-data-xml]: https://typst.app/docs/reference/data-loading/xml/ [typst-ref-image]: https://typst.app/docs/reference/visualize/image/ [typst-ref-text--font]: https://typst.app/docs/reference/text/text/#parameters-font [unix-tree]: https://gitlab.com/OldManProgrammer/unix-tree
https://github.com/kdog3682/2024-typst
https://raw.githubusercontent.com/kdog3682/2024-typst/main/src/snippets.typ
typst
#set page(width: 200pt, height: auto) #set enum(numbering: "I.A.1.") #set page(height: 2in) #set list(marker: ([•], [--])) #set page(width: 300pt, height: 300pt, background: rect(fill: white, width: 100%, height: 100%)) #set page(width: auto, height: auto, margin: .5cm) #set page(width: 120pt, height: 200pt, margin: 5pt) #set text(size: 6pt) #set page(width: 200pt, height: 400pt, margin: 10pt) #set page(..styles.auto-page) write a vimscript function for colon keypress when colon is pressed, search the current line and 5 lines for a function call like table( if the preceeding word is in the table ref, replace the preceeding word with the value, append a colon, and start a completion function for the possible insertions example: table( word1 word1 word1 h h replacement1: option2, replacement1: option3, replacement1: option2, replacement1: replacement1: replacement1: ) #{ let items = step(60) table( columns 6 rows 6 columns: 6, rows r: ) table( columns: 6, rows: 6, **items ) } #{ let items = } " Dictionary mapping words to their replacements let g:table_ref = {'word1': 'replacement1', 'word2': 'replacement2'} inoremap <buffer> <expr> ; CustomColonCommand() word1 word1 replacement1: option1, r0
https://github.com/DashieTM/nix-introduction
https://raw.githubusercontent.com/DashieTM/nix-introduction/main/topics/context.typ
typst
#import "../utils.typ": * #polylux-slide[ == What is Nix? #v(15pt) - just a programming language - functional - turing complete - made to configure environments #pdfpc.speaker-note(```md ```) ]