repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/bugs/subelement-panic_04.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // List item (pre-emptive) #list.item[Hello]
https://github.com/akrantz01/resume
https://raw.githubusercontent.com/akrantz01/resume/main/template/common.typ
typst
MIT License
#let section(title) = { show heading: set text(size: 1em, weight: "bold") block(above: 1.25em)[ = #smallcaps(title) #v(-2pt) #line(length: 100%, stroke: 2pt + black) ] } #let icon(name) = box( height: 9pt, move(dx: -2pt, dy: 2pt, image("icons/" + name + ".svg")), ) #let parse-date(raw) = { if raw == none { return none } let parts = raw.split("-") if parts.len() < 2 { panic("Invalid date format") } let year = int(parts.at(0)) let month = int(parts.at(1)) let day = int(parts.at(2, default: 15)) datetime(year: year, month: month, day: day) } #let format-date(date, year: true) = { if date == none { return none } else if type(date) != datetime { date = parse-date(date) } let format = "[month repr:short]" if year { format += " [year]" } date.display(format) } #let date-range(range) = { let start = parse-date(range.start) let end = parse-date(range.at("end", default: none)) if end == none [ #format-date(start) - Present ] else if start > end { panic("Start date is after end date") } else if start.year() == end.year() { if start.month() == end.month() { format-date(start) } else [ #format-date(start, year: false) - #format-date(end) ] } else [ #format-date(start) - #format-date(end) ] }
https://github.com/7sDream/fonts-and-layout-zhCN
https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/06-features-2/substitution/multiple.typ
typst
Other
#import "/template/template.typ": web-page-template #import "/template/components.typ": note #import "/lib/glossary.typ": tr #show: web-page-template // ### Multiple substitution === #tr[multiple substitution] // Single substitution was one-to-one. Multiple substitution is one-to-many: it decomposes one glyph into multiple different glyphs. The syntax is pretty similar, but with one thing on the left of the `by` and many things on the right. 一换多#tr[substitution]可以看作将一个#tr[glyph]分解为了几个不同的#tr[glyph]。语法和上面的差不多,只是在 `by` 前面只有一个#tr[glyph],而在后面有多个。 // This can be useful if you have situations where composed glyphs with marks are replaced by a decomposition of another glyph and a combining mark. For example, sticking with the Arabic final form idea, if you haven't designed a specific glyph for alif madda in final form, you can get around it by doing this: 这种类型在处理带符号的#tr[glyph]时比较有用,你可以将它分解为独立的主体#tr[glyph]和符号#tr[glyph]。比如还是阿拉伯文中的例子,如果你没有专门为词尾形式的 alif madda 设计#tr[glyph],你可以这样处理它: ```fea feature fina { # Alif madda -> final alif + madda above sub uni0622 by uni0627.fina uni0653; } ``` // This tells the shaper to split up final alif madda into two glyphs; you have the final form of alif, and so long as your madda mark is correctly positioned, you are essentially synthesizing a new glyph out of the two others. 这段规则告诉#tr[shaper]将词尾的 alif madda 分成两个#tr[glyph]。假设你已经设计好了词尾形式的 alif,那么你只要保证 madda 符号的正确#tr[positioning],就可以通过这种方式来合成一个新#tr[glyph]了。 // In fact, when engineering Arabic fonts, it can be extremely useful to separate the dots (*nukta*) from the base glyphs (*rasm*). This allows you to reposition the dots independently of the base characters, and it can reduce the number of glyphs that you need to design and write rules for, as you only need to draw and engineer the "skeleton" form for each character. 在实际的阿拉伯字体工程中,将点号(nukta)和其他的基本#tr[glyph](被称为rasm)分开处理是非常有效的。这允许你只需要绘制每个字符的基础骨架,再单独进行点的#tr[positioning]。这可以减少实际需要设计的#tr[glyph]和编写的规则数量。 // To do this, you would add empty glyphs to the font so that the Unicode codepoints can be mapped properly, but have the outline provided by other glyphs substituted in the `ccmp` (glyph composition and decomposition feature). For example, we can provide the glyph ز (zain) by having an empty `zain-ar` glyph mapped to codepoint U+0632, but in our `ccmp` feature do this: 为了使用这个方案,你需要在字体中将某些Unicode#tr[codepoint]映射到空白的#tr[glyph]。这些#tr[glyph]本身没有#tr[outline],而是通过在`ccmp`(#tr[glyph]组合/分解)特性中将它们#tr[substitution]成其他#tr[glyph]来完成显示。例如我们想支持 zain #tr[glyph],我们可以将 `U+0632` 映射到一个空白的 `zain-ar` #tr[glyph],然后在`ccmp`特性中写上: ```fea feature ccmp { sub zain-ar by reh-ar dot-above; } ccmp; ``` // With this rule applied, we now no longer need to deal with zain as a special case - any future rule which applies to reh will deal correctly with the zain situation as well, so you have fewer "letters" to think about. 一旦这条规则应用,我们就不需要专门处理 zain #tr[character]了,任何处理 reh 的规则都可以顺便处理 zain。这样你需要考虑的字母就可以少一些了。
https://github.com/pedrofp4444/BD
https://raw.githubusercontent.com/pedrofp4444/BD/main/report/content/[1] Definição do sistema/execucao.typ
typst
#let execucao = { [ == Plano de Execução do Projeto #align(center)[ #figure( kind: image, caption: "Ilustração do diagrama de Gantt inicial.", image("../../images/Captura_GANTT_inicial.png", width: 100%) ) ] No decorrer da confirmação do projeto, a equipa da “Quatro em Linha” desenvolveu um diagrama de GANTT que permitisse, de forma pertinente e ponderada, distribuir todas as tarefas vitais para o desenvolvimento de um sistema de gestão de base de dados numa linha temporal otimizada e concreta. Com o principal objetivo de entregar uma primeira fase íntegra do projeto no prazo previsto, optou-se pela aplicação de uma *estratégia monovista* de execução, de acordo com o qual separamos o projeto em cinco fragmentos fundamentais: Definição do Sistema, Levantamento e Análise de Requisitos, Modelação Concetual, Modelação Lógica e Conclusões e Trabalho Futuro. Nesta perspetiva, ponderamos o dia três de abril como o objetivo do culminar de toda a primeira fase, o que permite à “Quatro em Linha” garantir uma margem de revisão e reavaliação dos conteúdos, se necessário, ao mesmo tempo que é demonstrado um trabalho atempado e eficaz. Iniciaram-se os trabalhos dia vinte e três de fevereiro pela *Definição do Sistema*, este que é um ponto de trabalho com vista ao estudo do cliente e aprofundamento do conhecimento na área de desenvolvimento, dentro do qual se destacam tópicos cruciais evidenciados no diagrama proposto: Contexto de aplicação, Motivação e Objetivos do Trabalho, Análise da Viabilidade do processo, Recursos e Equipa de Trabalho e o Plano de Execução do Projeto. A previsão da divisão do tempo neste período introdutório foi muito equitativa, pelo que, ao longo de uma semana, distribuímos as diferentes tarefas, com prioridade à realização de pesquisa e construção associada em grupo, salvaguardando que todos os envolvidos adquirem as habilidades e conhecimentos indispensáveis. De seguida, durante o planeamento, a “Quatro em Linha” deparou-se com a etapa mais preponderante do desenvolvimento, o *Levantamento de Requisitos*. Neste ponto, atribuímos vinte e um dias, dado a relevância do tópico, de forma a garantir bom sustento para as tarefas subsequentes e coerência do projeto. Prevemos o maior intervalo de tempo para a escolha e aplicação do Método de Levantamento e de Análise de Requisitos Adotado, onde optaremos por introduzir todos os membros da empresa de forma a diversificar as abordagens de recolha de informação, entre deslocações para reuniões presenciais, análise de validade de formulários estatísticos, escritas e aprovação de atas e outros. Dentro deste período destacaremos 7 dias para corporificar a informação obtida, este processo será dividido em três fases: Organização dos Requisitos Levantados, Análise e Validação Geral dos Requisitos e Revisão e Aprovação, respetivamente, permitindo a estruturação dos conteúdos, posterior abonação do trabalho conseguido e consequente corroboração de resultados desta etapa. Para a *Modelação Concetual*, pretendemos reservar 10 dias e uma abordagem diferente da tomada até ao momento. Dado a boa identificação e definição dos requisitos, é possível neste passo realizar uma distribuição equitativa de tarefas por todos os elementos da “Quatro em Linha”. Através da atribuição equilibrada de cargas de trabalho, ficará responsável o <NAME> pela Apresentação da Abordagem de Modelação Realizada, <NAME> pela Identificação e Caracterização das Entidades e <NAME> pela Identificação e Caracterização dos Relacionamentos. Excecionalmente, o grupo reunirá para Identificação e Caracterização dos Atributos das Entidades e dos Relacionamentos dada a influência e impacto decisivo deste tópico na atuação da equipa. De forma a concluir esta etapa, <NAME> irá elaborar a Apresentação e Explicação do Diagrama ER Produzido, de forma a simplificar e concretizar a exposição do diagrama final efetuado. Para a *Modelação Lógica*, procedeu-se à separação da equipa para otimizar os processos. Durante cinco dias, <NAME> estará encarregue da Construção e Validação do Modelo de Dados Lógico, <NAME> consubstancializará a Apresentação e Explicação do Modelo Lógico Produzido e, em simultâneo, <NAME> procederá à Normalização de Dados de forma a uniformizar e garantir a visualização intuitiva da informação existente. Posteriormente, <NAME> prosseguirá com a Validação do Modelo com Interrogações do Utilizador. Finalmente, será realizada uma reunião de equipa para a revisão da etapa e confirmação geral da edificação deste tópico. ] }
https://github.com/feiyangyy/Learning
https://raw.githubusercontent.com/feiyangyy/Learning/main/linear_algebra/线性方程组求解.typ
typst
#set text( font: "New Computer Modern", size: 6pt ) #set page( paper: "a6", margin: (x: 1.8cm, y: 1.5cm), ) #set par( justify: true, leading: 0.52em, ) = 摘要 这些系列文档主要是复习线性代数的课堂笔记,现在稍微涉及到数学算法的地方通常都和线性代数脱不了关系,以下是一些不完全的举例: #list( [OpenGL中图形的生成、位置变换、投影变换等], [数字信号分析中的各类变换的向量表示], [数字图像处理中的卷积过程,图像变换等] ) 线性代数的出发点是求解线程方程组,线性方程组是指$n$元_一次_方程组。研究线性方程组的规律可以指导我们编写程序来求解这些线性方程组 线性方程组的解,是由$n$个有序数,可以理解$n$维的向量,有这个向量就可以引入线性空间的概念,比如二元一次方程组的解是一个平面向量,三元一次方程组的解是一个三维向量等等。 对于非线性问题,可以用线性问题来近似。 = 线性方程组求解及解的判定 以下是一个3元一次方程组 $cases( 2x_1 + 3x_3 = 1, x_1 - x_2 + 2x_3 = 1, x_1 - 3x_2 + 4x_3 = 2)$ 我们写出其矩阵,第$m$行表示第$m$个方程,第$n$列表示第$n$个未知数的系数,最后一列表示方程的右边,即常数项 $mat( 2, 0, 3, 1; 1, 1, 2, 1; 1, -3, 4, 2; )$ 这样包含常数项的矩阵叫做增广矩阵,现在,按照方式来化简: 1. 第1行除以2, 第二行减去第一行 $mat( 1, 0, 1.5, 0.5; 0, 1, 0.5, 0.5; 1, -3, 4, 2; )$ 2. 第3行减去第1行 $mat( 1, 0, 1.5, 0.5; 0, 1, 0.5, 0.5; 0, -3, 2.5, 1.5; )$ 3. 第3行加上第2行的3倍 $mat( 1, 0, 1.5, 0.5; 0, 1, 0.5, 0.5; 0, 0, 4, 3; )$ 到这个地步,我们可以自下而上的求解出$x_3,x_2, x_1$, 上面的这些步骤,称为#highlight[*矩阵的初等行变换*],矩阵的初等变换还包括行交换 观察3这个矩阵,我们可以发现矩阵自下而上,自右而左的出现非0项 $mat( 1, X, X, 0.5; 0, 1, X, 0.5; 0, 0, 4, 3; ) $ 这样的矩阵称为阶梯形,记作$J$,阶梯形对于判定方程组的解十分重要。每一行的第一个非0元称为主元,可以发现,#highlight[*主元的列指标随着行指标增加严格增加*]。 并且主元所在列的下方元素全为0(化简过程中被消去) 我们的化简过程,各行通过加减第一行的线性倍数,消去第一个元素(后方的先不管),这样第一个主元生成了(第1列的主元),接下来,我们操作第2行,将第$b_2^2$下方的元素消去,如果第一步使得第2行的第2列为0,我们通过寻找一个第2列不为0的行,让其与第2行交换(等价),如果找不到这样的行(即除了$b_1^2$之外),其余的都为0,说明第2列没有主元,则我们直接操作第3列,以此类推,只要某一列有主元,则该主元左侧都为0(被前面的列的主元消去) 假设第2列有主元,我们通过各行(3开始)加上第2行的各线性倍数消除第2列的元素,同时,这个过程中,第1列都是0(这些行的第1列在生成第1列主元的过程中已经清理为0,线性叠加$b_2^1= 0$的各倍数仍然是0) 我们还可以继续化简这个矩阵,#highlight[使得每一行的主元都为1,主元所在列的其他元素都为0]: 接下来我们以$r_n$ 表示第$n$行,$c_m$ 表示第m列,以减少篇幅 1. $r_3/4; r_2 - r_3/2$ $ mat( 1, 0, 1.5, 0.5; 0, 1, 0, -1/4; 0, 0, 1, 3/4; ) $ 2. $r_1 - 3/2 r_3$ $ mat( 1,0,0, -5/8; 0,1,0, -1/4; 0,0,1, 3/4 ) $ 这样,我们就直接得到了原方程组的解$(x_1 = -5/8, x_2 = -1/4, x_3 = 3/4)$ 而这样的阶梯形,称作简化阶梯形,记作$J_1$ 我们可以看到,在化简阶梯形时,#highlight(fill: yellow)[我们可以将主元列除主元之外的其他元素全部清理为0] 这个过程中,我们自下而上,自右往左的操作消去主元所在列的元素,我们这样操作的理由是:每个主元的左侧及下方都是0,我们从最后一个主元开始,通过各线性叠加消除所在列的元素时,不会给其左侧列带入额外的元素,后者重复如此,因而最终能化成这种简化阶梯型的 同时我们注意到右侧是不保证的 == 方程组解的判定 定理: $n$元线性方程组的解有且只有以下三种情况: 1. 有唯一解 2. 有无穷多解 3. 无解 === 推论: 阶梯形的矩阵的非0行的行数不可能超过未知量数目 设主元的位置为$b_r^t$, 表示主元在第r行第t列,并且主元不能处于最后一列$(n+1)$, 故$t <= n$, 又由主元定义可知,主元的列随着行的增加而严格增加,即$t>=r$,因此 $r<=n$,即非0行数目不会超过未知量数目 === 无解 先说明无解的情况, 当一个方程($n$)的增广矩阵的简化阶梯形的最后一个主元出现在最后一列时,此时该方程组无解,这是因为$(0_1, 0_2, ..., 0_n, 1)$ 相当于方程$0x_1 + 0x_2 + ... + 0x_n = 1 => 0 = 1$, 显然不存在解 === 唯一解 再说明有唯一解的情况, 当此方程组有m个,并且$m>=n$,当该方程组矩阵的简化阶梯形可以化简到具有$n$个主元的情况是,我们参考简化阶梯形的定义 #highlight(fill: red.darken(20%))[所在行的第一个非0元以及所在列的唯一一个非零元, 并且值为1] 我们有$n$个主元要放置到$n$列,所以抛开所有0行,剩下的每一行都有且只有一个非0项即主元项,形式如下: $ mat( 1, 0, 0, ..., d_0; 0, 1, 0, ..., d_1; ..., 0, 0, 1, d_n; 0, ..., 0, 0, 0; ..., ..., ..., ..., ...; ) $ 自 第$n$行以下,全为0行,第$1 - n$行,每行有且只有一个主元,他们的值都是1,则$(d_0, d_1, ..., d_n)$ 就是原方程组的唯一解。#highlight(fill: red.darken(20%))[主元不能出现在最后一列] === 无穷多解 当方程组的简化阶梯形的主元数量$K$小于$n$时, 假设这些主元位于$c_k, c_k in [1, n]$列, 那么,没有主元的列则为$n-K$个,假设这些列式$c_l, c_l in [1, n]$, 一种可能得形式如下: $ mat( 1, 0, 0, 0, 1, 3; 0, 1, 0, 1, 0, 3; 0, 0, 1, 0, 0, 2; 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0; ) $ 这个例子中,主元位于$(1,2,3)$列, $4, 5$列没有主元,所以这些方程就得写作: $ cases( x_1 + x_5 = 3, x_2 + x_4 = 3, x_3 = 2, ) => cases( x_1 = 3 - x_5, x_2 = 3 - x_4, x_3 = 2 ) $ 对于任何一个$x_4, x_5$的取值,原方程组都有一个解,而这两者的取值是无穷多,因此解也有无穷多个。 回到出发点,简化阶梯形中,主元所在的行的$c_l$列可能不为0,因而主元位置的未知量就是和$c_l$未知量 组成一个方程,$c_l$位置的未知量无法被消或者通过主元固定,所以这样的解就有无穷多个了
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/raw_05.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Trimming. // Space between "rust" and "let" is trimmed. The keyword ```rust let```. // Trimming depends on number backticks. (``) \ (` untrimmed `) \ (``` trimmed` ```) \ (``` trimmed ```) \ (``` trimmed```) \
https://github.com/Robotechnic/alchemist
https://raw.githubusercontent.com/Robotechnic/alchemist/master/src/utils.typ
typst
MIT License
#import "@preview/cetz:0.2.2" #let convert-length(ctx, num) = { // This function come from the cetz module if type(num) == length { if repr(num).ends-with("em") { float(repr(num).slice(0, -2)) * ctx.em-size.width / ctx.length } else { float(num / ctx.length) } } else { float(num) } } /// Convert any angle to an angle between -360deg and 360deg #let angle-correction(a) = { if type(a) == angle { a = a.deg() } if type(a) != float and type(a) != int { panic("angle-correction: The angle must be a number or an angle") } while a < 0 { a = a + 360 } calc.rem(a, 360) * 1deg } /// Check if the angle is in the range [from, to[ #let angle-in-range(angle, from, to) = { if to < from { panic("angle-in-range: The 'to' angle must be greater than the 'from' angle") } angle = angle-correction(angle) angle >= from and angle < to } #let angle-in-range-strict(angle, from, to) = { if to < from { panic("angle-in-range: The 'to' angle must be greater than the 'from' angle") } angle = angle-correction(angle) angle > from and angle < to } #let angle-in-range-inclusive(angle, from, to) = { if to < from { panic("angle-in-range: The 'to' angle must be greater than the 'from' angle") } angle = angle-correction(angle) angle >= from and angle <= to } /// get the angle between two anchors #let angle-between(ctx, from, to) = { let (ctx, (from-x, from-y, _)) = cetz.coordinate.resolve(ctx, from) let (ctx, (to-x, to-y, _)) = cetz.coordinate.resolve(ctx, to) let angle = calc.atan2(to-x - from-x, to-y - from-y) angle } /// get the distance between two anchors #let distance-between(ctx, from, to) = { let (ctx, (from-x, from-y, _)) = cetz.coordinate.resolve(ctx, from) let (ctx, (to-x, to-y, _)) = cetz.coordinate.resolve(ctx, to) let distance = calc.sqrt(calc.pow(to-x - from-x, 2) + calc.pow( to-y - from-y, 2, )) distance }
https://github.com/pluttan/typst-g7.32-2017
https://raw.githubusercontent.com/pluttan/typst-g7.32-2017/main/gost7.32-2017/g7.32-2017.config.typ
typst
MIT License
#let config = ( raw:( theme:"", bg: luma(240), num: false, size: 14pt, splitter: "|", counter: counter("listing") ), toc:( title:( label: "Содержание", size: 16pt, weight: "bold", align: "center" ), align: "left" ), img:( counter: counter("image") ), table:( counter: counter("table") ), page:( textSize: 14pt, alignNum: "center", paper: "a4", margin: (left: 30mm, right: 15mm, top: 20mm, bottom: 20mm), font: "Times New Roman", parIndent: 1.25cm ), list: ( indent: 0.35em ), heading: ( numbering: "1.1", l1: ( pagebreak: true, size: 16pt, upper: true, align: center, indent: 0.35em ), l2: ( pagebreak: false, size: 16pt, upper: false, align: left, indent: 0.35em ), l3: ( pagebreak: false, size: 14pt, upper: false, align: left, indent: 0.35em ), ) )
https://github.com/lucifer1004/leetcode.typ
https://raw.githubusercontent.com/lucifer1004/leetcode.typ/main/solutions/s0015.typ
typst
#import "../helpers.typ": * #let _3sum-ref(nums) = { let nums = nums.sorted() let n = nums.len() let ans = () for i in range(n) { if i > 0 and nums.at(i) == nums.at(i - 1) { continue } let l = i + 1 let r = n - 1 while l < r { let sum = nums.at(i) + nums.at(l) + nums.at(r) if sum < 0 { l += 1 } else if sum > 0 { r -= 1 } else { ans.push((nums.at(i), nums.at(l), nums.at(r))) while l < r and nums.at(l) == nums.at(l + 1) { l += 1 } while l < r and nums.at(r) == nums.at(r - 1) { r -= 1 } l += 1 r -= 1 } } } ans }
https://github.com/benjamineeckh/kul-typst-template
https://raw.githubusercontent.com/benjamineeckh/kul-typst-template/main/src/core/component/declaration-of-originality.typ
typst
MIT License
#let insert-dec-of-orig(declaration-of-originality, lang:"en") = { if declaration-of-originality != none{ heading( level: 1, numbering: none, outlined: false, if lang == "en" { "Declaration of Originality" } else { "Declaratie van originaliteit" } ) text(style: "italic", declaration-of-originality.at(lang)) pagebreak(weak: true) } }
https://github.com/matsumo0922/typst-keio-b2-template
https://raw.githubusercontent.com/matsumo0922/typst-keio-b2-template/master/README.md
markdown
# はじめに 慶應義塾大学理工学部2年生向けの理工学基礎実験 Typst テンプレートです # 参考 - https://github.com/tora223/report_template - https://github.com/yukukotani/typst-coins-thesis
https://github.com/paugarcia32/CV
https://raw.githubusercontent.com/paugarcia32/CV/main/modules/professional.typ
typst
Apache License 2.0
#import "../brilliant-CV/template.typ": * #cvSection("Professional Experience") #cvEntry( title: [Cybersecurity Intern], society: [Marsh McLennan], logo: "../src/logos/marsh.png", date: [2024 - Actualidad], location: [Barcelona, ES], description: list( [Evaluate cybersecurity maturity using frameworks such as ISO 27001 or NIST, identifying areas for improvement and proposing solutions to achieve an adequate level of security.], [Risk analysis to assess the threats and vulnerabilities faced by critical systems and processes of companies.], [Vulnerability analysis in systems and applications, aiming to identify possible weaknesses and security gaps that could be exploited by attackers.], ), //tags: ("Tags Example here", "Dataiku", "Snowflake", "SparkSQL") ) #cvEntry( title: [Private Professor], society: [Freelance], logo: "../src/logos/professor.png", date: [2018 - 2021], location: [Barcelona, ES], description: list( [Private classes for high school and baccalaureate students of subjects mainly in the scientific and technical branch], ), //tags: ("Tags Example here", "Dataiku", "Snowflake", "SparkSQL") ) /* #cvEntry( title: [Data Analyst], society: [ABC Company], logo: "../src/logos/abc_company.png", date: [2017 - 2020], location: [New York, NY], description: list( [Analyze large datasets using SQL and Python, collaborate with cross-functional teams to identify business insights], [Create data visualizations and dashboards using Tableau, develop and maintain data pipelines using AWS], ) ) #cvEntry( title: [Data Analysis Intern], society: [PQR Corporation], logo: "../src/logos/pqr_corp.png", date: [Summer 2017], location: [Chicago, IL], description: list( [Assisted with data cleaning, processing, and analysis using Python and Excel, participated in team meetings and contributed to project planning and execution], ) ) */
https://github.com/alberto-lazari/computer-science
https://raw.githubusercontent.com/alberto-lazari/computer-science/main/advanced-topics-cs/module-3/personal.typ
typst
I think the paper provides a very useful and interesting improvement in the theory of ML systems. What I find particularly interesting is the fact that it is not an incremental step over an already established concept. The authors really tried to provide an alternative to other models, but thinking outside of the box to give an answer to modern constraints and requirements, like GDPR. I particularly enjoy the simplicity of the model: it's minimal and intuitive, which can help to better shape future extensions and improvements. I think that starting to build the model with privacy and interpretability in mind should be the standard, for legal and requirements reasons, but also because from there it's possible to build more efficient and accurate implementations, while it's more difficult to increment privacy and interpretability aspects, once a model is well established and implemented in various forms. The only disadvantage I found in the LLM model is that it seems to be _too simplistic_. As the authors allude in the conclusion, it is yet to be seen whether the model is capable of keeping the accuracy high, even with more complex data.
https://github.com/Tyrn/wei
https://raw.githubusercontent.com/Tyrn/wei/master/BUILDME.md
markdown
# Wei ## Notes - [A Fight for a Robinson Crusoe TOC](https://www.reddit.com/r/typst/comments/1brnchc/create_a_chapterbychapter_synopsis_mirrored_in/) - [A great contribution](https://github.com/aarneng/Outline-Summaryst) ## Plain text reformatting - Comment out code, if any - Add newlines before each paragraph ``` sd '^\s{2,}' '\n' f.typ ``` Leaving the matched line as is: ``` sd '^\s{2,}' '\n$0' f.typ ``` - Replace opening dashes with em-dashes ``` sd -- '^--\s+' '---~' f.typ ``` - Replace space decorated dashes with em-dashes ``` sd -- '\s+--\s+' '~---~' f.typ ```
https://github.com/han0126/MCM-test
https://raw.githubusercontent.com/han0126/MCM-test/main/2024亚太杯typst/chapter/chapter5.typ
typst
#import "../template/template.typ": * = 问题二的模型建立与求解 == 问题分析 为了深入探讨洪水概率的分布特性,本组采用了$K-m e a n s$聚类算法对洪水概率进行了分析。通过设定$K=3$,算法将数据集划分为三个具有不同风险等级的集群,并确定了相应的中心点,从而形成了三个等风险级。这一步骤为后续的风险评估提供了坚实的基础。 基于$K-m e a n s$聚类的结果,本研究进一步采用$X G B o o s t$算法对三个风险等级进行了模型构建。$X G B o o s t(e X t r e m e G r a d i e n t B o o s t i n g)$是一种高效的梯度提升决策树算法,它能够集成多个弱学习器,通过迭代优化,逐步减少模型的偏差和方差,最终形成强学习器#cite(<rf1>)。该算法在处理分类问题中展现出了强大的性能,因此非常适合用于构建洪水不同风险的预警评价模型。在构建模型的过程中,我们针对每个风险等级选取了合适的指标,确保模型能够准确地反映各个等级的风险特征。随后,通过将数据集代入模型进行训练,不断调整模型#cite(<rf2>) ,我们得到了针对不同风险等级的预警评价模型。 为了评估模型的有效性和稳定性,本研究还进行了模型的灵敏度分析。灵敏度分析是模型评估中的重要环节,它可以帮助研究者了解模型对于输入数据的微小变化的敏感程度,从而判断模型的稳健性。在本研究中,我们通过调整数据集中的参数,观察模型输出的变化情况,以评估模型的灵敏度。 其具体思路流程图如下: #img( image("../figures/3.jpg", width: 80%), caption: "预警模型构建流程图" ) == 洪水风险预警模型构建 === 洪水概率分级 首先提取附件中提供的`train.csv`中的洪水发生概率的数据集:$X={x_1,x_2,dots,x_n}$,并进行相应的数据处理,检验并排除异常数据后,将得到的数据集导入$K-m e a n s$聚类算法中,将洪水分为$A、B、C$三类,分别对应洪水发生概率:高风险、中风险、低风险三种风险等级。即将数据集$X$分成$3$个不同的簇$G={g_1,g_2,g_3}$,使得簇心位置不发生显著变化。 #table( columns: (1fr,)*4, stroke: none, align: center + horizon, table.hline(stroke: 1.5pt), table.header()[*风险等级*][*$A$级*][*$B$级*][*$C$级*], table.hline(stroke: 0.8pt), [质心点],[$0.568401$],[$0.504591$],[$0.442312$], table.hline(stroke: 1.5pt), ) === 分析各级指标特征 针对每个风险级别的洪水事件,本组首先计算了各个指标的平均值、中位数和标准差等基本统计量。这些统计量的计算为后续的风险评估提供了数据支持。 在模型构建过程中,我们首先计算了每个聚类的平均洪水概率。这一步骤使得我们能够了解不同聚类在洪水概率上的分布情况。随后,我们对聚类按照平均洪水概率进行了排序,从而确定了各个聚类在风险等级上的排列顺序。为了进一步细化风险评估,我们定义了一个风险等级列表,并设置了选择的特征数量。在本问题中,我们决定对每个风险级别选取个特征数量。这一决策是基于特征选择的复杂性和模型准确性之间的权衡考虑。最后,我们遍历了排序后的聚类索引,并对每个聚类找到了其特征值最大的前个指标特征。这一步骤确保了我们所选的特征能够有效地代表各个聚类的风险特点,从而提高了模型的预测能力。 通过以上步骤,我们选取了若干个洪水预测的指标: #table( columns: (1fr,)*4, stroke: none, align: center + horizon, table.hline(stroke: 1.5pt), table.header()[*风险等级*][*$A$级*][*$B$级*][*$C$级*], table.hline(stroke: 0.8pt), [指标一],[大坝质量],[海岸脆弱性],[海岸脆弱性], [指标二],[基础设施恶化],[大坝质量],[侵蚀], [指标三],[河流管理],[侵蚀],[排水系统], [指标四],[季风强度],[无效防灾],[城市化], table.hline(stroke: 1.5pt), ) === 建立预警模型 基于聚类分析的结果,基于$2.2.2$节所选指标特征,选取与洪水发生概率密切相关的指标。接着,我们利用$X G B o o s t$算法(梯度提升决策树算法),来计算模型中各指标的权重。该算法的优势在于它能自动学习特征的重要性,从而准确地为每个指标赋予合适的权重。在$X G B o o s t$模型训练过程中,算法会评估每个指标对模型预测贡献的大小,并据此分配权重。权重较大的指标对洪水发生概率的预测具有更大的影响力,从而在预警模型中占据更重要的位置。结合选定的指标和通过$X G B o o s t$计算出的权重,我们建立了一个用于预测不同风险等级的洪水预警模型。该模型通过整合指标的加权值来评估洪水发生的风险等级,为决策者提供了一个量化的、基于数据驱动的决策工具。 $ Y=sum_(i=1)^m w_i dot x_i $ === 灵敏度分析 为评估洪水风险预警模型的灵敏性,采用了交叉验证的方法,将数据集`train.csv`导入训练模型中。通过这种方法,我们能够确保模型在不同子集上的表现具有一致性,并且减少模型过拟合的风险。基于先前的$K-m e a n s$聚类分析识别出的三个不同风险等级,对数据集进行分层抽样,以确保每个风险等级都得到充分的代表性。 在交叉验证的过程中,数据集被分为多个子集,每个子集都有机会作为测试集来评估模型的性能,而其余的子集合并为训练集用于模型的训练。这种反复的训练和测试,使我们能够全面地评价模型的预测能力。 在完成交叉验证后,我们将统计模型的精准度。这包括计算模型在各个风险等级上的准确率、召回率以及$F_1$分数等指标。这些指标能够为我们提供模型精准度的量化度量,从而让我们可以比较模型在不同风险等级上的表现差异。 基于上述灵敏度分析,最终得出模型准确率为$96.515%$。 \ \
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/023.%20ffb.html.typ
typst
ffb.html Filters that Fight Back August 2003 We may be able to improve the accuracy of Bayesian spam filters by having them follow links to see what's waiting at the other end. <NAME> of death2spam now does this in borderline cases, and reports that it works well.Why only do it in borderline cases? And why only do it once?As I mentioned in Will Filters Kill Spam?, following all the urls in a spam would have an amusing side-effect. If popular email clients did this in order to filter spam, the spammer's servers would take a serious pounding. The more I think about this, the better an idea it seems. This isn't just amusing; it would be hard to imagine a more perfectly targeted counterattack on spammers.So I'd like to suggest an additional feature to those working on spam filters: a "punish" mode which, if turned on, would spider every url in a suspected spam n times, where n could be set by the user. [1]As many people have noted, one of the problems with the current email system is that it's too passive. It does whatever you tell it. So far all the suggestions for fixing the problem seem to involve new protocols. This one wouldn't.If widely used, auto-retrieving spam filters would make the email system rebound. The huge volume of the spam, which has so far worked in the spammer's favor, would now work against him, like a branch snapping back in his face. Auto-retrieving spam filters would drive the spammer's costs up, and his sales down: his bandwidth usage would go through the roof, and his servers would grind to a halt under the load, which would make them unavailable to the people who would have responded to the spam.Pump out a million emails an hour, get a million hits an hour on your servers. We would want to ensure that this is only done to suspected spams. As a rule, any url sent to millions of people is likely to be a spam url, so submitting every http request in every email would work fine nearly all the time. But there are a few cases where this isn't true: the urls at the bottom of mails sent from free email services like Yahoo Mail and Hotmail, for example.To protect such sites, and to prevent abuse, auto-retrieval should be combined with blacklists of spamvertised sites. Only sites on a blacklist would get crawled, and sites would be blacklisted only after being inspected by humans. The lifetime of a spam must be several hours at least, so it should be easy to update such a list in time to interfere with a spam promoting a new site. [2]High-volume auto-retrieval would only be practical for users on high-bandwidth connections, but there are enough of those to cause spammers serious trouble. Indeed, this solution neatly mirrors the problem. The problem with spam is that in order to reach a few gullible people the spammer sends mail to everyone. The non-gullible recipients are merely collateral damage. But the non-gullible majority won't stop getting spam until they can stop (or threaten to stop) the gullible from responding to it. Auto-retrieving spam filters offer them a way to do this.Would that kill spam? Not quite. The biggest spammers could probably protect their servers against auto-retrieving filters. However, the easiest and cheapest way for them to do it would be to include working unsubscribe links in their mails. And this would be a necessity for smaller fry, and for "legitimate" sites that hired spammers to promote them. So if auto-retrieving filters became widespread, they'd become auto-unsubscribing filters.In this scenario, spam would, like OS crashes, viruses, and popups, become one of those plagues that only afflict people who don't bother to use the right software. Notes[1] Auto-retrieving filters will have to follow redirects, and should in some cases (e.g. a page that just says "click here") follow more than one level of links. Make sure too that the http requests are indistinguishable from those of popular Web browsers, including the order and referrer.If the response doesn't come back within x amount of time, default to some fairly high spam probability.Instead of making n constant, it might be a good idea to make it a function of the number of spams that have been seen mentioning the site. This would add a further level of protection against abuse and accidents.[2] The original version of this article used the term "whitelist" instead of "blacklist". Though they were to work like blacklists, I preferred to call them whitelists because it might make them less vulnerable to legal attack. This just seems to have confused readers, though.There should probably be multiple blacklists. A single point of failure would be vulnerable both to attack and abuse. Thanks to <NAME>, <NAME>, <NAME>, <NAME>, and <NAME> for reading drafts of this.FFB FAQJapanese TranslationA Perl FFBLycos DDoS@Home
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/visualize/line.typ
typst
Apache License 2.0
// Test lines. --- #set page(height: 60pt) #box({ set line(stroke: 0.75pt) place(line(end: (0.4em, 0pt))) place(line(start: (0pt, 0.4em), end: (0pt, 0pt))) line(end: (0.6em, 0.6em)) }) Hello #box(line(length: 1cm))! #line(end: (70%, 50%)) --- // Test the angle argument and positioning. #set page(fill: rgb("0B1026")) #set line(stroke: white) #let star(size, ..args) = box(width: size, height: size)[ #set text(spacing: 0%) #set line(..args) #set align(left) #v(30%) #place(line(length: +30%, start: (09.0%, 02%))) #place(line(length: +30%, start: (38.7%, 02%), angle: -72deg)) #place(line(length: +30%, start: (57.5%, 02%), angle: 252deg)) #place(line(length: +30%, start: (57.3%, 02%))) #place(line(length: -30%, start: (88.0%, 02%), angle: -36deg)) #place(line(length: +30%, start: (73.3%, 48%), angle: 252deg)) #place(line(length: -30%, start: (73.5%, 48%), angle: 36deg)) #place(line(length: +30%, start: (25.4%, 48%), angle: -36deg)) #place(line(length: +30%, start: (25.6%, 48%), angle: -72deg)) #place(line(length: +32%, start: (8.50%, 02%), angle: 34deg)) ] #align(center, grid( columns: 3, column-gutter: 10pt, ..((star(20pt, stroke: 0.5pt),) * 9) )) --- // Test errors. // Error: 12-19 point array must contain exactly two entries #line(end: (50pt,)) --- // Error: 14-26 expected relative length, found angle #line(start: (3deg, 10pt), length: 5cm)
https://github.com/floriandejonckheere/utu-thesis
https://raw.githubusercontent.com/floriandejonckheere/utu-thesis/master/thesis/chapters/07-proposed-solution/07-evaluation.typ
typst
#import "/helpers.typ": * == Evaluation Several quality metrics were considered to evaluate the quality of the microservice decomposition. #cite_full(<carvalho_etal_2019>) conducted an analysis of the criteria used to evaluate the quality of microservices architectures and found that the most common metrics are cohesion and coupling, as does our literature review win @automatedmodularization. In addition to this, they conclude that in many cases the decomposition process is guided only by these two metrics. In other cases, the software architects use other metrics (e.g. network overhead, CPU usage), although cohesion and coupling remain the dominant ones. According to experts, using four quality metrics is a good balance between the number of metrics and the quality of the solution @carvalho_etal_2019. #cite_full(<candela_etal_2016>) studied a large number of metrics to evaluate the quality of microservices architectures, including network overhead, CPU, and memory. They affirmed the need for more than two metrics to ensure the quality of the decomposition. Four metrics were selected to evaluate the quality of the microservice decomposition: cohesion, coupling, size, and complexity. We chose cohesion and coupling as they are the most common metrics used to evaluate the quality of microservices architectures. Size and complexity were chosen as they are important metrics to assess the maintainability and comprehensibility of the microservices @parnas_1972. ==== Cohesion Cohesion is a measure of the degree to which internal elements of a module in a software system are related to each other @software_engineering_vocabulary_2017. Cohesion of microservice candidates is defined as the number of static calls between methods within a microservice candidate $M_c$ in a solution $S$, divided by the total number of possible static method calls in $M_c$ @carvalho_etal_2020. The metric indicates how strongly related the methods internal to a microservice candidate are. To compute the individual cohesion of a microservice candidate $M_c$, we first introduce the boolean function $italic("ref")$, which indicates the existence of at least one method call between methods $v_i$ and $v_j$ in $M_c$. $ italic("ref")(v_i, v_j) = cases(1 "if" italic("calls")(v_i, v_j) > 0, 0 "otherwise") $ <cohesion_formula> The cohesion of a microservice candidate $M_c$ is then calculated as described in @individual_cohesion_formula, where $|M_c|$ is the cardinality of all method calls in $M_c$. $ italic("coh")(M_c) = ( sum_(v_i in M_c, v_j in M_c) italic("ref")( v_i, v_j) ) / ( |M_c| ( |M_c| - 1) / 2 ) $ <individual_cohesion_formula> The total cohesion of a solution is the sum of the individual cohesion of all microservice candidates $M_c$. A higher total cohesion indicates a better decomposition. $ italic("Cohesion") = sum_(M_c in S) italic("coh")(M_c) $ <total_cohesion_formula> ==== Coupling Coupling is a measure of the degree of interdependence between modules in a software system @software_engineering_vocabulary_2017. In the context of microservices, individual coupling is defined as the sum of static calls from methods within a microservice candidate $M_c$ in a solution $S$ to another microservice candidate $M_c in S$ @carvalho_etal_2020. $ italic("coup")(M_c) = sum_(v_i in M_c, v_j in.not M_c) italic("calls")(v_i, v_j) $ <individual_coupling_formula> Where $v_i$ and $v_j$ are methods belonging and not belonging to $M_c$ respectively, and $italic("calls")(v_i, v_j)$ returns the number of method calls present in the body of method $v_i$ made to method $v_j$. The total coupling of a solution is the sum of the individual couplings of all microservice candidates $M_c$. A lower total coupling indicates a better decomposition. $ italic("Coupling") = sum_(M_c in S) italic("coup")(M_c) $ <total_coupling_formula> ==== Size // https://wiki.c2.com/?AbcMetric Size of a microservice candidate can be defined in several different ways. In @automatedmodularization, we identified several publications that use the size metric as introduced by #cite_full(<wu_etal_2005>), defined size as the number of source code files or classes in a service. Other definitions of size include the number of methods, or the number of lines of code. However, these definitions have the disadvantage that they describe the size of a microservice candidate without considering the structure of the code. #cite_full(<fitzpatrick_1997>) developed the ABC size metric, which takes into account the number of assignments, branches, and conditions in a method. Using the number of lines of code, as well as the structure, the ABC size metric describes the size of a method more accurately. Methods with a high ABC size are harder to understand, and more prone to errors and bugs. The ABC size of a method consists of a vector $angle.l A, B, C angle.r$, where: - $A$ is the number of assignments (explicit transfer of data into a variable) - $B$ is the number of branches (explicit branch out of the current scope) - $C$ is the number of conditions in the method (logical test) ABC sizes are written as an ordered triplet of numbers, in the form $angle.l A, B, C angle.r$, for example $angle.l 7, 12, 3 angle.r$. To convert the ABC size vector into a scalar value, the magnitude of the vector is calculated using the Euclidean norm. $ |"ABC"| = sqrt(A^2 + B^2 + C^2) $ <abc_formula> The interpretation of the ABC size value is language-dependent, as some language constructs differ semantically between programming languages. For example, in the Ruby programming language an ABC value of $<= 17$ is considered satisfactory, a value between $18$ and $30$ unsatisfactory, and $>$~$30$ is considered dangerous#footnote[#link("https://docs.rubocop.org/rubocop/cops_metrics.html")[https://docs.rubocop.org/rubocop/cops_metrics.html]]. In this study we do not intend to evaluate the quality of individual methods, but rather the quality of the decomposition as a whole. As such, we use the average of the ABC sizes of all methods in a microservice candidate to calculate the size of the microservice candidate. Formalized, the ABC size metric can be defined as in @abc_size_formula. The functions $italic("asgn")(v_i)$, $italic("brch")(v_i)$, and $italic("cond")(v_i)$ return the number of assignments, branches, and conditions in method $v_i$ respectively. $ italic("abc")(v_i) = sqrt(italic("asgn")(v_i)^2 + italic("brch")(v_i)^2 + italic("cond")(v_i)^2) $ <abc_size_formula> To compute the individual size of a microservice candidate $M_c$, we sum the ABC sizes of all methods in $M_c$, and divide by the number of methods in $M_c$ $ italic("size")(M_c) = (sum_(v_i in M_c) italic("abc")(v_i))/(|v_i|) $ <individual_size_formula> The total size of a solution is the sum of the individual sizes of all microservice candidates $M_c$. $ italic("Size") = sum_(M_c in S) italic("size")(M_c) $ <total_size_formula> A lower total size indicates a better decomposition, as smaller microservices are easier to understand and maintain. However, a very low size may indicate that the microservice candidates are too small, and that the decomposition is too fine-grained. ==== Complexity // https://wiki.c2.com/?CyclomaticComplexityMetric Cyclomatic complexity is a metric that quantifies the number of linearly independent control paths through the source code of a program @mccabe_1976. The measure is computed by constructing a control-flow graph of the program, and counting the number of possible paths through the graph. Each vertex in the graph represents a group of non-branching instructions, and each edge represents a possible transfer of control between the groups. If the program does not contain any branching instructions, the complexity is 1 (there is only one path). Like ABC size, cyclomatic complexity in the context of microservices can be defined as the averaged sum of the cyclomatic complexities of all methods in a microservice candidate $M_c in S$. $ italic("complexity")(M_c) = (sum_(v_i in M_c) italic("brch")(v_i))/(|v_i|) $ <individual_complexity_formula> Where $italic("brch")(v_i)$ returns the number of branches in method $v_i$. The total complexity of a solution is then the sum of the individual complexities of all microservice candidates $M_c$. $ italic("Complexity") = sum_(M_c in S) italic("complexity")(M_c) $ <total_complexity_formula> A solution with a lower total complexity is considered to be better, as it indicates microservice candidates that are easier to understand and maintain.
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/ops-invalid-19.typ
typst
Other
// Error: 3-11 cannot divide integer by length #(3 / 12pt)
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/layout/transform.typ
typst
Apache License 2.0
// Test transformations. --- // Test creating the TeX and XeTeX logos. #let size = 11pt #let tex = { [T] h(-0.14 * size) box(move(dy: 0.22 * size)[E]) h(-0.12 * size) [X] } #let xetex = { [X] h(-0.14 * size) box(scale(x: -100%, move(dy: 0.26 * size)[E])) h(-0.14 * size) [T] h(-0.14 * size) box(move(dy: 0.26 * size)[E]) h(-0.12 * size) [X] } #set text(font: "New Computer Modern", size) Neither #tex, \ nor #xetex! --- // Test combination of scaling and rotation. #set page(height: 80pt) #align(center + horizon, rotate(20deg, scale(70%, image("/files/tiger.jpg"))) ) --- // Test setting rotation origin. #rotate(10deg, origin: top + left, image("/files/tiger.jpg", width: 50%) ) --- // Test setting scaling origin. #let r = rect(width: 100pt, height: 10pt, fill: forest) #set page(height: 65pt) #box(scale(r, x: 50%, y: 200%, origin: left + top)) #box(scale(r, x: 50%, origin: center)) #box(scale(r, x: 50%, y: 200%, origin: right + bottom))
https://github.com/soul667/typst
https://raw.githubusercontent.com/soul667/typst/main/保研/cv.typ-main 一页/resume.typ
typst
#import "template.typ": * // 设置图标, 来源: https://fontawesome.com/icons/ // 如果要修改图标颜色, 请手动修改 svg 文件中的 fill="rgb(38, 38, 125)" 属性 #let faAward = icon("icons/fa-award.svg") #let faBuildingColumns = icon("icons/fa-building-columns.svg") #let faCode = icon("icons/fa-code.svg") #let faEnvelope = icon("icons/fa-envelope.svg") #let faGithub = icon("icons/fa-github.svg") #let faGraduationCap = icon("icons/fa-graduation-cap.svg") #let faLinux = icon("icons/fa-linux.svg") #let faPhone = icon("icons/fa-phone.svg") #let faWindows = icon("icons/fa-windows.svg") #let faWrench = icon("icons/fa-wrench.svg") // 主题颜色 #let themeColor = rgb(38, 38, 125) // 设置简历选项与头部 #show: resume.with( // 字体基准大小 size: 10pt, // 标题颜色 themeColor: themeColor, // 控制纸张的边距 top: 1.5cm, bottom: 2cm, left: 2cm, right: 2cm, // 如果不需要头像,则将下面的参数注释或删除 photograph: "images/profile.jpg", photographWidth: 10em, gutterWidth: 2em, )[ = 方橙 #info( color: themeColor, ( // 其实 icon 也可以直接填字符串, 如 "fa-phone.svg" icon: faPhone, content: "(+86) 155-5555-5555" ), ( icon: faBuildingColumns, content: "南京大学", ), ( icon: faGraduationCap, content: "人工智能", ), ( icon: faEnvelope, content: "<EMAIL>", link: "mailto:<EMAIL>" ), ( icon: faGithub, content: "github.com/orangex4", link: "https://github.com/orangex4", ), ) #h(2em) // 手动顶行, 2em 代表两个字的宽度 我是 OrangeX4,你也可以叫我 *一只方橙* 或 *方橙*。现在是南京大学人工智能学院 2020 级本科生,正深陷于学习数学、编程和英语的无边苦海中。你问为什么我的名字那么奇怪? 大概是我喜欢吃橘子和橙子,又谐音方程,还有和我的名字谐音的缘故吧。喜欢一切新奇的东西,兴趣十分广泛。 ] == #faGraduationCap 教育背景 #sidebar(withLine: true, sideWidth: 12%)[ 2023.05 2020.09 ][ *南京大学* · 人工智能学院 · 人工智能专业 GPA: 4.48 / 5 · Rank: 15% ] == #faWrench 专业技能 #sidebar(withLine: false, sideWidth: 12%)[ *操作系统* *掌握* *熟悉* *了解* ][ #faLinux Linux, #h(0.5em) #faWindows Windows React, JavaScript, Python Vue, TypeScript, Node.js Webpack, Java ] == #faAward 获奖情况 #item( [ *人民奖学金* ], [ *一等奖 · 二等奖* ], date[ 2021 年 11 月 – 2022 年 11 月 ] ) #item( [ *人工智能 +* ], [ *二等奖* ], date[ 2021 年 11 月 – 2022 年 11 月 ] ) == #faCode 项目经历 #item( link( "https://github.com/OrangeX4/Latex-Sympy-Calculator", [ *Latex Sympy Calculator* ] ), [ *个人项目* ], date[ 2021 年 02 月 – 2021 年 04 月 ] ) #tech[ NodeJS, Python, VS Code ] 一个用于在 VS Code 中使用 LaTeX 数学公式进行「科学计算」的插件 - 使用 ANTLR 将 LaTeX 语句编译为 Sympy 语句 - 通过 Flask 搭建本地 HTTP 服务器与 VS Code 插件进行通信 - 可以进行多种类型的科学计算,如积分求导、矩阵计算、无穷级数计算等 #item( link( "https://github.com/OrangeX4/Reversi", [ *黑白棋 Reversi* ] ), [ *课程项目* ], date[ 2021 年 02 月 – 2021 年 04 月 ] ) #tech[ React, Python, AI ] 基于 React 与 Antd 的黑白棋前端,与基于 Python 的黑白棋 AI 后端 - 使用基于评估函数的 BFS 实现了黑白棋 AI,并实现了 Alpha-Beta 剪枝 - 基于 React 搭建了一个黑白棋平台前端,支持玩家对战、人机对战和 AI 对战 - 在后端使用 Flask 及 Socket.io 库,实现了玩家之间的联机对战 == #faBuildingColumns 校园经历 #item( [ *微软学生俱乐部技术部部长* ], [], date[ 2021 年 09 月 – 2022 年 09 月 ] )
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/grotesk-cv/0.1.0/README.md
markdown
Apache License 2.0
# Grotesk CV A simple, one-page CV template with a clean and modern design. Inspired by https://github.com/mintyfrankie/brilliant-CV and Skywalker template from Typst. ## Requirements You will need to install the following fonts in your local system: - [Hanken Grotesk](https://fonts.google.com/specimen/Hanken+Grotesk) This template also uses FontAwesome icons via the [fontawesome](https://typst.app/universe/package/fontawesome) package. ## Usage The main content layout is defined in the `cv.typ` file, which is responsible for importing the different sections from `/content` into the document . Change the `metadata.typ` file to suit your needs. Different sections can be added or removed by modifying the `cv.typ` file. Sections can be edited by modifying the corresponding `.typ` file in the `/content` directory. ## Preview ![Thumbnail](thumbnail.png "Preview")
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/construct-00.typ
typst
Other
// Compare both ways. #test(rgb(0%, 30%, 70%), rgb("004db3")) // Alpha channel. #test(rgb(255, 0, 0, 50%), rgb("ff000080")) // Test color modification methods. #test(rgb(25, 35, 45).lighten(10%), rgb(48, 57, 66)) #test(rgb(40, 30, 20).darken(10%), rgb(36, 27, 18)) #test(rgb("#133337").negate(), rgb(236, 204, 200)) #test(white.lighten(100%), white)
https://github.com/tingerrr/chiral-thesis-fhe
https://raw.githubusercontent.com/tingerrr/chiral-thesis-fhe/main/src/core/component/abstract.typ
typst
#import "/src/utils.typ" as _utils #let make-abstract( title: "Abstract", body: lorem(100), _fonts: (:), ) = { _utils.assert.text("body", body) set align(horizon) set heading(numbering: none, outlined: false, offset: 0) show heading: set text(16pt, font: _fonts.sans) show heading: set block(below: 1.8em) heading(level: 1, title) par(justify: true, body) }
https://github.com/isaacholt100/isaacholt100.github.io
https://raw.githubusercontent.com/isaacholt100/isaacholt100.github.io/master/maths-notes/4-cambridge%3A-part-III/combinatorics/combinatorics.typ
typst
#import "../../template.typ": * #show: doc => template(doc, hidden: (), slides: false)
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/show-text-01.typ
typst
Other
// Another classic example. #show "TeX": [T#h(-0.145em)#box(move(dy: 0.233em)[E])#h(-0.135em)X] #show regex("(Lua)?(La)?TeX"): name => box(text(font: "New Computer Modern")[#name]) TeX, LaTeX, LuaTeX and LuaLaTeX!
https://github.com/voXrey/cours-informatique
https://raw.githubusercontent.com/voXrey/cours-informatique/main/typst/logique.typ
typst
#set text( font: "Noto Sans Imperial Aramaic", size: 11pt ) = Partie 5 - Logique == Chapitre ? - Logique Propositionnelle === I - Syntaxe Nos valeurs booléennes "vrai" et "faux" sont - $top$ top - $bot$ bot Il existe différents ordres pour la logique Ordre 0 : $not, and, or, -->, <--$ Ordre 1 : $forall, exists$... $V$ ensemble de variables On nommera selon cette convention : Propositions : p, q, r, ... Variables propositionnelles : x, y, z, ... ```ocaml type formula = Top | Bot | Var of variable | Not of formula | And of formula * formula | Or of formula * formula ... ``` Type inductif $eq.triple$ Ensemble inductif $E_0 = {$Top, Bot$} union V$ $E_(n+1) = E_n union {phi_1 join phi_2 | phi_1,phi_2 in E_n, join in {and, or, -->, <-->}}union {not phi | phi in E_n}$ #underline[Connecteurs logiques] : $not, and, or, -->, <-->$ #underline[Arité] : nombre d'arguments. $not$ unaire (arité 1). Les autres sont binaires. Une formule logique peut être représentée par un arbre. Aux feuilles on a des variables ou $top$ ou $bot$. Aux noeuds internes on a des connecteurs logiques. $-->$ On reprend le vocabulaires des arbres #underline[Exemple] : $"var"(phi)$ est définit inductivement. $"var"(top)$ = $"var"(bot)$ = $emptyset$ ... Syntaxiquement, $(x and y) and z != x and (y and z)$ === II - Sémentique #underline[Valuation] : $v : V --> {0, 1}$. Le programme interprète les formules dans ${V, F}$ #underline[Evaluation des formules] : On prolonge les valuations "par morphisme" pour toutes les formules. Soit v une valuation. On définit $accent(v, -):E --> {0, 1}$. $accent(v, -)(bot) = 0$ $accent(v, -) = 1$ $accent(v, -) = v(x)$ $accent(v, -)(not phi) = 1 - accent(v, -)(phi)$ $accent(v, -)(phi join psi) = "table de "join" appliquée à" accent(v, -)(phi) "et" accent(v, -) (psi)$ #underline[Page 7 du poly] : #underline[Notation] : $v models phi <=> v(phi) = 1$ avec une barre c'est $<=> v(phi) = 0$ $accent(v, -)(phi) = [|phi|]_v$ $v models phi$ "est un model satisfait" satisfaisable / satfisfiable tautologique = valide antilogie $phi models psi <--> forall v, v models phi --> v models psi$ Equivalence logique : $phi models psi$ et $psi models phi$ parfois notée $eq.triple$ === 4 - Liens Syntaxe Sémantique - La valeur de $accent(v, -)$ ne dépend que de $v(x)$ pour $x in$ $"var"(phi)$ #underline[Preuve par induction structurelle] : Soit v et w tels que $v(x) = w(x) forall x in $ $"var"(phi)$. - Si $phi = top$ alors $accent(v, -)(phi) = 1 = accent(w, -)(phi)$ - Si $phi = bot$ ... - Si $phi = x$ alors $x in$ $"var"(phi)$ donc par hypothèse $v(x) = w(x)$ donc $accent(v, -)(x) = accent(w, -)(x)$ - Si $phi = not psi$ alors par induction structurelle : $accent(v, -)(psi) = accent(w, -)(psi)$. Donc $accent(v, -)(phi) = 1 - accent(v, -)(psi) = 1 - accent(w, -)(psi) = accent(w, -)(phi)$ Remarque : L'hypothèse d'induction s'applique car var($psi$) $subset.eq$ $"var"(phi)$. - Si $phi = phi_1 join phi_2$ alors par induction $accent(v, -)(phi_1) = accent(w, -)(phi_1) and accent(v, -)(phi_2) = accent(w, -)(phi_2)$.En effet, var($phi_1$) $subset.eq$ $"var"(phi)$ et var($phi_2$) $subset.eq$ $"var"(phi)$. Donc v et w coïncident sur var($phi_1$) et var($phi_2$). Donc $accent(v, -)(phi) = accent(w, -)(phi)$ puisque le même calcul sur $accent(v, -)(phi_1)$ et $accent(v, -)(phi_2)$ s'opère dans le tableau de vérité. - $phi models psi$ ssi $phi --> psi$ est une tautologie $phi models psi$ ssi $forall v$ valuation $v models phi$ implique $v models psi$ ssi $accent(v, -)(psi) = 1$ lorsque $accent(v, -)(phi) = 1$ ssi $accent(v, -)(phi -> psi) = 1$ d'après le tableau de vérité. - $phi$ sat ssi $exists v : v models phi$ ssi $exists v : accent(v, -)(not phi) = 0$ ssi $not phi$ n'est pas valide === 5 - Prouver qu'une formule est une tautologie ==== 5.1 - Table de vérités $phi$ tautologie ssi $forall v$ valuation $v models phi$ $-->$ BruteForce Nombre $infinity$ de valuations mais $accent(v, -)(phi)$ ne dépend que de $v(x_1), v(x_2)... v(x_n)$ où ${x_1, ... x_n} =$ $"var"(phi)$. $phi = x and y <--> y and x$ $"var"(phi)$ $= {x, y}$ #table( align: center, columns: 4, [$v(x), v(y)$], [$x and y$], [$y and x$], [phi], [0, 0], [0], [0], [1], [0, 1], [0], [0], [1], [1, 0], [0], [0], [1], [1, 1], [1], [1], [1], ) Est une tautologie évidente Autre exemple : $phi = ((x or y) and (not y or z)) --> x or z$ On notera $psi$ l'intérieur du membre gauche de $phi$ #table( align: center, columns: 6, [$v(x), v(y), v(z)$], [$x or y$], [$not y or z$], [$psi$], [$x or z$], [$phi$], [0, 0, 0], [0], [1], [0], [0], [1], [0, 0, 1], [0], [1], [0], [1], [1], [0, 1, 0], [1], [0], [0], [0], [1], [0, 1, 1], [1], [1], [1], [1], [1], [1, 0, 1], [1], [1], [1], [1], [1], [1, 1, 0], [1], [0], [0], [1], [1], [1, 1, 1], [1], [1], [1], [1], [1] ) Il sagit donc d'une tautologie #underline[Coût de la méthode] : n variable $==> 2^n$ lignes ==== 5.2 - Substitutions Dans l'arbre, on remplace les feuilles avec x par des sous-arbres $psi$. ==== 5.4 - Réduction à SAT $phi$ autologie ssi $not phi$ non satisfiable Le problème : - Entrée : Une formule $phi$ - Question : Est-elle satisfiable ? S'appelle SAT === 7 - Systèmes de connecteurs Complets $C = {not, or, and, -->, <-->}$ On sait réécrire les formules utilisant les connecteurs $-->$ et $<-->$ en des formules logiquement équivalentes et qui n'utilisent plus ces connecteurs. Autrement dit, on aurait pu construire E en prenant les connecteurs $C'={not, or, and}$. En utilisant de Morgan, on réécrit $p and q eq.triple not (not p or not q)$. Puis $C'' = {not, or}$ et même $C''' = {accent(and, -)}$ avec #table( align: center, columns: 3, [$accent(and, -)$], [0], [1], [0], [1], [1], [1], [1], [0] ) On a $not p eq.triple p accent(and, -) p$ Donc $p and q eq.triple not (p accent(and, -) q)$ car $p accent(and, -) q eq.triple not (p and q)$ === 8 - FNC / FND On se place dans le système complet ${not, and, or}$. #underline[Littéraux] : Variables à négation de variable #underline[Clause] : Disjonction de littéraux : $x or not y or z or t or not u$ #underline[Conjonction de clause] : $(x or not y or z) and (x or y or z) and (not x or z)$ #underline[Anticlause] : $x and y and not z$ #underline[FND] : $(...) or (...) or (...)$ Une forme normale serait un cas où $phi eq.triple psi$ ssi forme-normale($phi$) = forme-normale($psi$) #underline[Prop] : Pour toute formule $phi$ il existe $psi_1$ et $psi_2$ des formules équivalentes à $phi$ telles que $psi_1$ en FNC (ou l'inverse). Connaissant un FNC de $phi$, il est "facile" de trouver une FND de $not phi$ $phi = and.big_(i=1)^n or.big_(j=1)^(p_i) l_(i,j)$ $not phi = or.big_(i=1)^n not or.big_(j=1)^p_i l_(i,j) = or.big_(i=1)^n and.big_(j=1)^p_i not l_(i,j)$. #underline[Deux cas] : - Si $l_(i,j)$ est une variable alors $not l_(i,j)$ est un littéral - Si $l_(i,j)$ est la négation d'une variable x alors $not l_(i,j) eq.triple x$. ==== 8.3 - Mise en Forme Normale ===== 1) Via table de vérité On remarque qu'une FND se déduit directement de la table de vérité : on remarque les lignes avec du 1. Une anticlose est similaire à une valuation. Une FND s'obtient comme la liste des valuations qui satisfont $phi$. #underline[Rappel] : Pas unicité de la FND. Ici $phi = (x and not y) or (y and z) or (x and z) or (y and not y)$. Le dernier terme peut être retiré. #underline[Remarque] : On appelle FND (ou FNC) canonique une FND telle que chaque anticlause (resp. clause) qui contient exactement une fois chaque variable. Alors, il y a unicité de la FND canonique à l'ordre prêt. ===== 2) Via réécriture Il s'agit de faire un parcours d'arbre avec un pattern-matching afin de remplacer certaines formes de sous-formules. Il faudra faire ce parcours tant qu'il y aura quelque chose à modifier. On arrête la boucle quand la formule n'est plus modifiée. ```c to_fnc(F): - remplacer les implications et équivalences comme dans la section 7 - Tant que possible - Trouver une sous formule de F de la forme !(F1 || F2) et la remplacer dans F par (!F1 && !F2) - Idem avec une sous formule de la forme !(F1 && F2) - Idem avec une sous formule de la forme (F1 || (F2 && F3)) par (F1 || F2) && (F1 || F3) - Idem avec (F1 && F2) || F3 ``` #underline[A retenir] : La complexité reste exponentielle dans le pire des cas, mais il y aura des cas dans lesquels "cela se passe mieux" tandis que la construction de la table de vérité était exponentielle dans tous les cas. Notamment, en pratique sur de petits exemples, ce sera plus rapide que la table de vérité. #underline[Remarque] : On va identifier un type de pire cas : $phi_n = or.big_(i=1)^n (x_i and y_i)$. Appliquer la distributivité du $or "sur le" and$ va se générer en formule équivalente à $phi_n$ en FNC, mais de taille exponentielle (voir 8.3.1). Donc notre algorithme de mise en FNC s'exécutea sur $phi_n$ en temps $Omega(2^n)$ au moins. #underline[Remarque] : Complexité de la mise en FNC/FND : On a 2 méthodes en temps exponentiel. #underline[Proposition] : Il n'existe pas d'algorithme de mise en forme normale qui soit de complexité $O(n^K)$ pour un entrant K. #underline[Preuve] : $forall psi "en FNC" : psi eq.triple phi_n, |psi| >= 2^n$ *Preuve de la terminaison* On définit q par induction structurelle sur les formules : $forall x in V q(x) = 2 \ q(phi_1 and phi_2) = q(phi_1) + q(phi_2) + 1 \ q(phi_1 or phi_2) = q(phi_1) q(phi_2) \ q(not phi) = 4^q(phi)$ On montre que q est un variant de boucle pour la boucle while de l'algorithme. On fait le calcul pour 1 des 4 règles. $q(not(F_1 and F_2)) = 4^(q(F_1) + q(F_2) + 1)\ "et"\ q(not(not F_1 or not F_2)) = 4^q(F_1) 4^q(F_2) = 4^(q(F_1)+q(F_2)) < q(F_3)$ Petit rappel : On note $x_i, y_i, z_i$ les valeurs des variables au début du $i^e$ tour de boucle. Comme q est un variant : $q(x_0, y_0, z_0) > q(x_1, y_1, z_1) > q(x_2, y_2, z_2) > ...> q(x_d, y_d, z_d).$ On veut majorer d (le nombre d'itération du while) : $d <= q(x_0, y_0, z_0) + 1$ Ici, la mise en FNC de $phi$ s'exécute en temps [au plus] $O(q(phi))$ C'est non satisfaisant car $q(phi)$ peut être de la forme $4^.^.^.^4^n | n = |phi|$. ===== 3) CNF Rapide *Hors-programme* Il existe un algorithme qui étant donné $phi$ produit $psi$ en FNC en temps polynomial tel que : $exists v : v models phi <=> exists w : w models psi$ On dit que $phi$ et $psi$ sont équisatisfiables. === 9 - Logique = Langage de Spécification ==== Problème du Pavage $n "et" m$ les dimensions de rectangles à carreler $S = {s_0, ..., s_(p-1)}$ l'ensemble des tuiles $s_i = (n_i, e_i, s_i, o_i)$ Ensemble des variables : $p_(i,j,k)$ vraie si la tuile $s_k$ se trouve en position $(i, j)$. A chaque emplacement $(i, j)$, une seule tuile $and.big_(i = 1)^n and.big_(j = 1)^m and.big_(k=0)^(p-1) (p_(i,j,k) -> and.big_(l=0\ l eq.not k) not p_(i,j,l))$ Pour chaque emplacement il y a une tuile dessus $and.big_(i=1)^n and.big_(j=1)^m (or.big_(k=0)^(p-1)p_(i,j,k))$ === 10 - Problème SAT C'est le nom que l'on donne au problème suivant : #underline[Entrée] : $phi$ #underline[Question] : $phi$ est-elle satisfiable ? #underline[Remarque] : $phi "SAT" <=> not phi "n'est pas valide"$. Le problème SAT est "équivalent" à la question "est-ce que $phi$ est une tautologie". ==== 1) BruteForce==== 1) BruteForce On a une fonction d'évil renvoie uation `eval v phi` renvoie $accent(v, -)(phi)$. On énumère les évaluations jusqu'à en trouver une qui satisfasse $phi$. Correspond à l'approche "table de vérité" ==== 2) Algorithme de Quine Algorithme permettant de savoir si $phi$ est satisfiable ```python is_sat(phi): if var(phi) = void: renvoyer True ou False # phi vraie ou fausse else: for x in var(phi): if is_sat(phi[x <- Top]) return True else: return is_sat(phi[x <- Bot]) ``` ==== 3) Raffinement dans le cas d'une CNF $-->$ Le vrai algorithme de Quine #underline[Littéral] : $x "ou" not x$ ```ocaml type litteral = | Lit of variable | Nlit of variable ``` #underline[Clause] : Disjonction de littéraux ```ocaml type clause = litteral list ``` _Remarque : La clause vide équivaut à $bot$_ #underline[FNC] : Conjonction de clauses ```ocaml type fnc = clause list ``` _Remarque : La fonction vide équivaut à $top$_ ```python # Précondition : phi en CNF is_sat(phi): if phi est la fnc vide: return Tru if phi contient une clasuse vide: return False else: for x in var(phi): # On effectue un max de simplifications lors de la substitution if is_sat(phi[x<-Top]): return True else: return is_sat(phi[x<-Bot]) ``` Mais que nous apporte la FNC ? Elle facilite les simplifications. $phi[x<-top] --> "pour chaque clause c"$ - Si $x$ est dans c, on supprime la clause - Si $not x$ est dans c, on retire $not x$ de la clause Avec $phi[x<-bot]$ analogue #underline[Optimisation] : Propagation des clauses unitaires : Si une clause c n'a qu'un seul littéral, on le met à directement à vrai. #underline[Remarque] : La CNF permet de rendre plus efficace les simplifications dans l'algorithme de BackTracking de Quine. Mais la mise en CNF est exponentielle, d'où l'intérêt de la CNF rapide. <NAME>
https://github.com/Gewi413/typst-autodoc
https://raw.githubusercontent.com/Gewi413/typst-autodoc/master/example.typ
typst
MIT License
#import "typst-autodoc.typ": main #main("typst-autodoc.typ")
https://github.com/swaits/typst-collection
https://raw.githubusercontent.com/swaits/typst-collection/main/finely-crafted-cv/0.1.0/README.md
markdown
MIT License
# Finely Crafted CV Template This Typst template provides a clean and professional format for creating a curriculum vitae (CV) or résumé. It comes with functions and styles to help you easily generate a well-structured document, complete with sections for education, experience, skills, and more. ## Features - **Modern Design:** Aesthetic and professional layout designed for readability. - **Responsive Header & Footer:** Includes contact information dynamically. ## Usage To use this template, import it with the version number and utilize the `resume` or `cv` function: ```typst #import "@preview/finely-crafted-cv:0.1.0": * #show: resume.with( name: "<NAME>", tagline: "Innovative marine biologist with 15+ years of experience in ocean conservation and research.", keywords: "marine biology, conservation, research, education, patents", email: "<EMAIL>", phone: "+1-305-555-7890", linkedin-username: "amirapatel", thumbnail: image("assets/my-qr-code.svg"), ) = Introduction #lorem(100) = Experience #company-heading("Some Company", start: "March 2018", end: "Present", icon: image("icons/earth.svg"))[ #job-heading("Some Job", location: "Some Location")[ - Here is an achievement - Here's another one. ] // companies can have multiple jobs #job-heading("First Job", location: "Some Location")[ - Here is an achievement - Here's another one. ] ] // for companies which have less detail, you can use the `comment` instead of a // body of tasks, as follows: #company-heading("Another Company", start: "July 2005", end: "August 2009", icon: image("icons/microscope.svg"))[ #job-heading("Another Job", location: "Another Location", comment: [Contributed to 7 published studies. #footnote[Visit https://amirapatel.org/publications for full list of publications.]] )[] ] = Education // school-heading is an alias for company-heading, accepts the same parameters as company-heading #school-heading("University of California, San Diego", start: "Fall 2001", end: "Spring 2005", icon: image("icons/graduation-cap.svg"))[ // degree-heading is an alias for job-heading, accepts the same parameters as job-heading #degree-heading("Ph.D. in Marine Biology")[] ] ``` ## Functions and Parameters ### `resume` or `cv` This is the main function to create a CV document. - **Parameters:** - `name`: (String) Your full name. Default is "YOUR NAME HERE". - `tagline`: (String) A brief description of your professional identity or mission. - `paper`: (String) The paper size, default is "us-letter". - `heading-font`: (Font) Font for headings, customizable. - `body-font`: (Font) Font for body text, customizable. - `body-size`: (Size) Font size for body text. - `email`: (String) Your email address. - `phone`: (String) Your phone number. - `linkedin-username`: (String) Your LinkedIn username. - `keywords`: (String) Keywords for searchability. - `thumbnail`: (Image) Thumbnail or QR code image, optional. - `body`: (Block) The main content of your CV. ### `company-heading` Used to create a heading for a company or organization. - **Parameters:** - `name`: (String) Name of the company. - `start`: (String) Start date. - `end`: (String) End date, optional. - `icon`: (Image) Icon image associated with the company, optional. - `body`: (Block) Content related to the company role or tasks. ### `job-heading` Defines a job title within a company heading. - **Parameters:** - `title`: (String) Job title. - `location`: (String) Location of the job, optional. - `start`: (String) Start date, optional. - `end`: (String) End date, optional. - `comment`: (String) Additional comments or notes, optional. - `body`: (Block) Tasks or responsibilities. ### `school-heading` Alias for `company-heading`, used for educational institutions. ### `degree-heading` Alias for `job-heading`, used for academic degrees or certifications. ## License This template is released under the MIT License.
https://github.com/cs-24-sw-3-01/typst-documents
https://raw.githubusercontent.com/cs-24-sw-3-01/typst-documents/main/report/sources/CarolineInterview.typ
typst
#import "../custom.typ": * == Interview with Caroline <InterviewCaroline> 00:00 - 00:02 Caroline: Skal jeg starte med at fortælle ham, hvem jeg er? 00:02 - 00:03 Mads: Ja, det må du meget gerne. 00:03 - 00:09 Caroline: Så I har den baggrund. Altså, mit navn er Caroline, og I optager nu? 00:15 - 00:21 Caroline: Mit navn er Caroline. Jeg har været i KMD siden december i ti år, hvilket er lidt vildt at tænke på. 00:22 - 00:27 Caroline: Men det taler virkelig for, at det er en fantastisk virksomhed at arbejde for. 00:28 - 00:34 Caroline: Faktisk stort set lige fra universitetet, så har jeg kun haft mit arbejdsliv i KMD. 00:34 - 00:40 Caroline: Det passer ikke helt, jeg har arbejdet fuldtid, mens jeg tog min kandidat som managementkonsulent i et større konsulenthus. 00:42 - 00:44 Caroline: Jeg har lavet rigtig mange ting på de ti år. 00:44 - 00:45 Caroline: Det gør man jo sjovt nok. 00:45 - 00:55 Caroline: Men jeg har hele tiden været forankret i, hvordan KMD arbejder med projekter og projektledelse i noget, der hedder PMO. 00:55 - 01:00 Caroline: Så det er omkring, hvordan vi driver vores projekter, men også håndtering af dem. 01:00 - 01:12 Caroline: Og en af de ting, man jo gør, når man arbejder med projekter, er, at man arbejder med mennesker, og når man arbejder med mennesker, så er der jo sjovt nok også noget som ferie, som man skal tage højde for. 01:12 - 01:40 Caroline: Derudover har jeg udviklet og lavet et par forskellige setups, vi har haft i forbindelse med resource management, hvor vi blandt andet også har arbejdet, ikke direkte med KMD's ferieplanlægger, men med hele konceptet omkring ferie og hvad det betyder for resource management, allokering og planlægning osv. 01:42 - 01:47 Caroline: Så det, jeg laver lige nu, er, at jeg har to sider af mit arbejde. 01:47 - 02:16 Caroline: Den ene del er, at jeg er det, der hedder Portfolio Manager, så fancy som det lyder, men jeg driver nogle forskellige porteføljer på tværs af KMD. Vi kigger på projekter og investeringer, ser hvordan det går, hvad deres status er, laver en masse ledelsesrapportering og faciliterer forskellige ledelsesgrupper på forskellige niveauer helt op til vores øverste group management, hvor vi diskuterer de respektive investeringer i deres områder. 02:17 - 02:20 Caroline: Den anden del af mit arbejde består af, at jeg har et projekt selv. 02:20 - 02:32 Caroline: Jeg har lige afsluttet et program for vores daværende CTO, den øverste tekniske direktør, hvor Dion var en af mine "track leads". 02:34 - 02:40 Caroline: Det jeg laver nu ved siden af mit andet fuldtidsarbejde, er, at jeg er PMO-lead på et af de største programmer. 02:40 - 02:57 Caroline: Hvis nok det største program, vi har lige nu i KMD, som I formentlig har hørt om, men at vi skal skifte partner fra "-----" over til "-----" System, så hele den transition, der ligger der, og også udflytning af både arbejdspladser og folk osv. 02:57 - 03:05 Caroline: Og der har man et stort program. Vi er on-and-off måske 60-70 mennesker, der arbejder på det her. 03:05 - 03:10 Caroline: Og en af de ting, vi blandt andet skal forholde os til, det er, at der hele tiden er nogen, der skal arbejde. 03:11 - 03:14 Caroline: Men folk er folk, og mennesker skal have fri. 03:14 - 03:18 Caroline: Så vi har selvfølgelig også noget omkring, hvordan vi planlægger i forhold til ferie. 03:19 - 03:27 Caroline: Nu er det efterårsferie lige nu. Det er knap så kritisk, fordi der ikke er så mange med små børn. Det har jeg selv, men der er ikke så mange med små børn, så folk kan selv lidt mere planlægge ferie. 03:27 - 03:32 Caroline: Men os med små børn skal ligesom holde fri, når skoler, børnehaver og vuggestuer har lukket. 03:33 - 03:39 Caroline: Og sommerferien, der brugte vi faktisk meget det her med, hvem der er på hvornår osv. 03:39 - 04:03 Caroline: Men vi brugte ikke KMD's ferieplanlægger af den simple årsag, at det kun kan køre på de teams, man er organisatorisk tilknyttet, og det kan man ikke bruge i projekter, fordi et projekt pr. definition er noget, der er tidsbegrænset, komplekst og arbejder på tværs af enheder. 04:03 - 04:20 Caroline: Det kan selvfølgelig også være i samme enhed, men som udgangspunkt har man forskellige rollegrupper i et projekt, og det vil være på tværs af afdelinger. Hvis vi altid kunne det hele i én afdeling, så ville det bare være almindelig business as usual, groft sagt. 04:22 - 04:24 Caroline: Og det er det, jeg laver i dag. 04:24 - 04:27 Mads: Hvilket værktøj brugte I så i stedet for KMD's ferieplanlægger? 04:29 - 04:32 Caroline: Vi brugte noget så sexet som en Excel, vi selv havde lavet. 04:37 - 04:53 Caroline: Altså ren Excel. Man kan sige, at nogle gange er det altid en trade-off, fordi man kan lave noget, der er super nice og kan alle mulige fede ting, og det er virkelig nice, men samtidig skal man også tænke på, hvad man har brug for. Altså hvad man skal bruge det til. 04:53 - 05:10 Caroline: Outputtet her drejer sig om at have noget, der var simpelt for folk at bruge, som skabte et overblik, og som også imødekom de kravspecifikationer, som vi havde. Altså, man skulle have en eller anden form for "-----" af, når du er på ferie. Hvor meget på ferie er du så? 05:10 - 05:20 Caroline: Det må vi selvfølgelig HR-mæssigt formentlig ikke sige, fordi når man er på ferie, så er man selvfølgelig på ferie, men der er jo noget med, hvor kritisk det er. Har du din telefon med, kan folk komme i kontakt med dig osv. 05:21 - 05:40 Caroline: Så det, vi gjorde, var, at vi lavede en simpel Excel med uger, dage og måneder og så de respektive "-----"-medlemmer og andre medlemmer af projektteamet. Ikke de her 50-70 mennesker, der går ind og ud, men dem som har en fast allokering til programmet. 05:42 - 06:05 Caroline: Og så har vi både et mix af danske og polske ressourcer, der arbejder på det, og der er også forskel på, hvornår der er helligdage. Så for at sikre det, lagde vi alle de danske og polske helligdage ind med noget så simpelt som farvemarkeringer, og selvfølgelig en forklaringstekst på de forskellige farvekoder. 06:07 - 06:30 Caroline: Og så skulle man angive, igen bare med ord, hvem der var stedfortræder med initialer og en anden farvekodning, om man var helt rød, altså at du ikke skulle kontaktes, medmindre det virkelig brænder på, eller gul, hvor du gerne måtte kontaktes. Meget simpelt Excel. 06:31 - 06:40 Caroline: Det kan man jo altid gøre, men det ville være rart at tage noget ned fra hylden, som også er lidt mere lækkert end Excel, så man ikke skal sidde og rode rundt i det. 06:40 - 06:54 Caroline: Nu har jeg nogle rigtig dygtige talent labber. Det er den polske udgave af et graduate-forløb, og en af dem fik jeg til at lave den her Excel. 07:01 - 07:15 Mads: Så det, I egentlig manglede i ferieplanlæggeren, var, at I kunne gå ind og sætte, hvor tilgængelig du egentlig var. For vi kan se, at du i dag kun kan sige, om du har ferie eller ej. I kunne godt bruge noget, der viser, hvor tilgængelig man er. 07:16 - 07:19 Caroline: Ja, det kunne vi godt. 07:19 - 07:24 Caroline: Så bevæger man sig bare over i noget, der hedder resource management. Og der kan man sige, det kunne være ret nice at have. 07:25 - 07:39 Caroline: Jeg tror, at HR ville komme efter en, hvis man begyndte at bygge et værktøj, hvor det var en option. Når man holder ferie, så holder man ferie, og det er vigtigt, og man kan ikke pådutte folk at arbejde. 07:39 - 08:00 Caroline: Der er også regler omkring, hvis man skal arbejde i sin ferie eller weekender. Afhængig af hvilken kontrakt man har, så skal man have et tillæg, eller det skal varsles. Så det kunne være en fed feature, men man skal være varsom med det i forbindelse med ferieplanlægning. 08:01 - 08:06 Caroline: Det ville være anderledes, hvis det var et resource management-tool, for der er det en nødvendighed. 08:06 - 08:11 Caroline: Men det er jo ret nice, hvis man har en feature, der hedder "I am available by telephone". 08:11 - 08:27 Caroline: Eller noget lignende, ligesom folk selv skriver det i deres autosvar. Så må du vurdere, om det er vigtigt nok til, at du vil forstyrre dem på deres ferie. 08:27 - 09:03 Caroline: Jeg tror, HR ville være lidt skeptiske, især med yngre medarbejdere, som måske føler sig pressede til at være tilgængelige, selvom de har fri. Det vil jeg ikke være garant for at presse på. Det, vi kunne have brugt, og som vi ikke kan med KMD’s ferieplanlægger, er, at den er afdelingsbaseret, og det giver mening, for et sted skal man jo tilhøre. 09:03 - 09:19 Caroline: Men det kunne være fedt at have en version, der gav mening for både større og mindre afdelinger, hvor data kunne trækkes fra HR/SAP eller SuccessFactors, så det kunne bruges til projekter. 09:19 - 09:30 Caroline: Det ville være fedt at have et værktøj målrettet projekter, fordi vi laver rigtig mange projekter i KMD af forskellige størrelser. 09:32 - 09:57 Caroline: Og også til arbejde på tværs af afdelinger, hvor man selv kunne vælge ud fra initialer, medarbejdernummer eller lignende og planlægge ferie for projektteams. Det kunne være nice. 09:57 - 10:05 Mads: Er det ikke netop det, man kan i dag? Vi har forstået, at man kan oprette teams og vælge medarbejdere fra alle afdelinger i KMD. 10:05 - 10:27 Caroline: Ja, men så har vi en kommunikationsudfordring, vil jeg sige. For det var jeg ikke klar over. Jeg har lige siddet og sagt, at jeg har været her i ti år. Det er jo en god pointe. For hvis man kan det, jamen det er da nice. Men jeg er ret sikker på, at det ikke er tilfældet. Så er det i hvert fald en rigtig god hemmelighed, der ligger der. 10:27 - 10:30 Mads: Det kan jo være, det er lidt lavet på en underlig måde eller noget, så det er svært at bruge? 10:30 - 10:32 Caroline: Det kan også sagtens være. 10:33 - 10:38 Caroline: Men det er i hvert fald noget, hvis jeg var jer, så ville jeg notere det. 10:41 - 10:43 Caroline: Hvad mere? Altså... 10:49 - 11:00 Caroline: Hvis man ikke allerede har tænkt på det, så er det vigtigt at tage højde for, at vi har forskellige nationaliteter med forskellige helligdage. Det er sindssygt vigtigt at have med, fordi nogle af dem falder sammen, men andre gør ikke. 11:00 - 11:21 Caroline: Og det er rigtig rart at vide, hvornår der er en planlagt helligdag. Jeg kan simpelthen ikke huske, hvordan vores system håndterer det, men det er en sindssyg vigtig feature. Og så ville det være nice med den her funktion om, hvor meget man er tilgængelig. Men jeg tror, vi vil høre fra HR, hvis vi implementerer det. 11:22 - 11:35 Mads: Kunne man ikke lave det sådan, at i stedet for at have en funktion, hvor man vælger, hvor tilgængelig man er, så kunne man indføre et notesfelt, når man registrerer ferie? Så kunne man jo skrive det der. 11:35 - 11:43 Caroline: Nå ja, så er det ens egen note. Så er det en selv, der skriver det. Det kunne man godt gøre, ja. 11:43 - 12:02 Caroline: Fordi meget af det, vi oplever, har også at gøre med, hvor kritisk det er, du arbejder på, og om du er i en kritisk periode. Det afhænger også af rang. Jo højere oppe i hierarkiet, jo mere ansvar du har, og jo mere tilgængelig skal du selvfølgelig være, også når du har fri. 12:03 - 12:32 Caroline: Fordi der kan være ting, der er kritiske og haster. Når man arbejder med IT, så skubber man ikke nye elementer ud i prime time, altså i dagtimerne, fordi det kan skabe nedetid, og det vil man jo gerne begrænse, især når mange brugere er på. Så det sker på skæve tidspunkter og i weekender, hvor vi har servicevinduer. 12:33 - 12:36 Caroline: Og jeg kan give et eksempel fra det virkelige liv. 12:36 - 13:05 Caroline: Jeg var til min lillebrors fødselsdag i København her i lørdags, og hans kone arbejder hos en af vores kunder. Jeg vil ikke sige hvilken, men hun var nødt til at gå fra fødselsdagen midt på dagen for at tage et møde med KMD, fordi de skulle lancere noget, der skulle gå live her til morgen kl. 8. Det skulle hun gøre både lørdag og søndag. 13:06 - 13:21 Caroline: Og der ville det være rart at vide, om hun sad i en flyvemaskine på vej til New York og dermed ikke kunne kontaktes, eller om hun var tilgængelig i det omfang, man nu kan være i en weekend, hvor man har fri. 13:22 - 13:23 Mads: Ja, selvfølgelig. 13:28 - 13:30 Caroline: Hvad mere? 13:31 - 13:48 Mads: Altså, er det korrekt forstået, at I bruger... Vi har forstået indtil videre, at alt fravær bliver registreret i SAP SuccessFactors som baseline, ikke også? Og så kan I skrive det ind i andre værktøjer bagefter. Det er sådan "ground truth", eller hvad man kan sige. 13:51 - 13:56 Caroline: Jo, jo, selvfølgelig er det det. Det siger jeg helt klart. 14:00 - 14:16 Caroline: Vores politik er, at vi har skiftet system inden for de sidste par måneder, men du skal registrere, når du har ferie, og der er sådan en nedtælling afhængigt af, hvor meget ferie du har optjent osv. 14:17 - 14:40 Caroline: Og det gør du i SuccessFactors, som er SAP-baseret. Derinde har du også overblik over, hvor mange barnets sygedage du har, din egen sygdom og forskellige koder for det ene og det andet, f.eks. hvis du har graviditetsgener eller noget andet, så skal det registreres specifikt. 14:40 - 14:59 Caroline: Så derinde finder man al den information. Det skal du indberette, fordi hvis du ikke bruger din ferie, bliver det registreret, og så skal du have det udbetalt. KMD har selvfølgelig nogle politikker, men det er også dansk lovgivning. 15:00 - 15:40 Caroline: Man skal jo holde sin ferie. Der er en grund til, at vi har ferie i Danmark, og derfor har vi også nogle politikker i KMD omkring, hvor meget ferie der skal bruges på hvilke tidspunkter af året. Når man er chef, får man meldinger om, hvordan ens afdeling ser ud i forhold til ferieafvikling. Du skal være opmærksom på, bare som eksempel, at Karoline har to uger for meget, fordi hun ikke har holdt sommerferie. Så det skal afvikles inden det nye ferieår. 15:42 - 15:54 Caroline: Den data er derinde. Jeg smiler lidt, fordi selvfølgelig skal dataen være derinde, og det er der, registreringen sker. 15:54 - 16:13 Caroline: Jeg ved, at der måske ikke er alle, der er lige gode til at få det gjort. Så det er der nogle dialoger om. Måske er det lidt for besværligt. Så det er en balance. Nu havde jeg jo et barn, der var syg, så skal jeg registrere barnets første sygedag. 16:14 - 16:25 Caroline: Men det er en balance, for selvom jeg havde barn syg, sad jeg og arbejdede seks timer om aftenen, for jeg havde noget arbejde, der skulle laves. Så jeg arbejdede fra kl. 20 til 02, selvom jeg havde været hjemme hele dagen med mit barn. 16:26 - 16:32 Caroline: Og det er jo selvfølgelig ikke hensigtsmæssigt, men jeg registrerede ikke barnets første sygedag. 16:32 - 16:33 Mads: Det giver god mening. 16:34 - 17:05 Caroline: Jeg har helt ret til barnets første sygedag og barnets anden sygedag. Vi er så heldige og privilegerede i KMD, så det er dejligt. Men når jeg alligevel har arbejdet, skal det ikke registreres. Selvfølgelig har man ubegrænset sygedage osv., men det hele akkumuleres, og på et tidspunkt bliver der kigget på, hvor meget fravær man har, og når jeg alligevel har arbejdet, registrerer jeg det ikke. 17:05 - 17:11 Mads: Okay, på den måde. Men det kunne jo stadig være fint at registrere, at du ikke var ledig i det første tidsrum på dagen. 17:12 - 17:14 Caroline: Det ville være en god pointe. 17:16 - 17:24 Caroline: Og i udgangspunktet har vi det jo sådan. Men det er faktisk interessant, når man snakker om arbejdstider. 17:25 - 17:46 Caroline: I udgangspunktet arbejder... Altså KMD er en super fed virksomhed, fordi det selvfølgelig afhænger fra team til team, hvad du laver. Nogle er mere fastlåste i deres arbejdstider, f.eks. hvis man passer kundetelefoner, så er der ikke mange opkald om natten, så de skal være på i dagtimerne. 17:47 - 18:00 Caroline: Og de fleste arbejder også i løbet af dagen, men vi har stor fleksibilitet. Man arbejder selvfølgelig i et givent tidsrum, så vi alle kan få fat i hinanden, men der er fleksibilitet omkring arbejdstid. 18:00 - 18:08 Caroline: Vi har noget, der hedder KMD Life, som handler om at skabe en balance i forhold til ens livsfaser. 18:09 - 18:34 Caroline: Jeg er den yngste i mit område og den eneste med små børn. Jeg har derfor en fast bagkant, fordi jeg skal hente mine børn. Der er et tidsrum, hvor man selvfølgelig kan få fat i mig via telefon, men jeg har to små børn med 1,5 år mellem dem, og de skændes og kaster legoklodser på hinanden, mens jeg laver aftensmad. 18:34 - 18:39 Caroline: Så det er ikke super produktivt. Det er bedre at kontakte mig igen fra kl. 20-22. Det, jeg gør i min kalender, er at skrive ind, hvornår jeg arbejder. 18:53 - 19:19 Caroline: Der er selvfølgelig den normale arbejdstid, og så er der møder og arbejds-chunks. Jeg skriver også, hvornår jeg er med mine børn. Hvis jeg arbejder om aftenen, skriver jeg, at jeg er tilgængelig fra kl. 20 til kl. 23, eller om morgenen fra kl. 5 til 6. 19:20 - 19:28 Caroline: Man er ikke nødvendigvis tilgængelig for møder, men det kunne være en fed feature. 19:29 - 19:31 Caroline: Det kunne være nice. 19:33 - 19:42 Caroline: Også det her med, at grænserne er lidt flydende for, hvornår man arbejder bedst. Det kunne være ret nice. 19:43 - 19:47 Mads: Okay, ja. Det sørger vi for at tage med. 19:47 - 19:59 Mads: Det, vi havde snakket om indtil videre, var at lave en platform, hvor man logger ind med sin Microsoft-konto fra KMD. 20:00 - 20:06 Caroline: Alt skal være single-sign-on. Folk gider ikke bruge et system, hvis det ikke er single-sign-on. De stejler fuldstændig. 20:08 - 20:12 Mads: Ja, det var også, hvad vi tænkte. 20:12 - 20:13 Caroline: Det er super godt tænkt. 20:13 - 20:20 Caroline: Det er også fint, at brugeren i forhold til alt det med sikkerhed bruger Microsoft 365 security. Så det er fint. 20:21 - 20:29 Caroline: Men folk er helt vilde med det. Hvis det ikke er single-sign-on, så kommer de ikke til at bruge det. Punktum. 20:29 - 20:32 Mads: Okay, det sørger vi for at sætte en stor, fed streg under. 20:32 - 20:34 Caroline: Ja, perfekt. 20:35 - 21:02 Mads: Men ja, det vi havde snakket om, var, at man kunne oprette teams derinde på tværs af afdelinger mellem alle medarbejdere i KMD. Og at man så kunne gå ind og registrere fravær for sig selv. Det skulle ikke godkendes af andre management i KMD, ligesom det skal i SuccessFactors. Så man havde en form for manuel override der. Men vi ville stadig importere alt fra SuccessFactors, så man kunne se det. Så man ikke skulle indtaste alt igen. Det var det, vi havde snakket om indtil videre. 21:04 - 21:05 Caroline: Det vil også være smart. 21:05 - 21:17 Caroline: Og så have muligheden for at køre det som... Når nu det ikke skal være et system, der skal håndtere tidsregistrering, fordi det er jo ikke det, det går ud på, så er det super godt, at der ikke skal være et godkendelsesflow. 21:23 - 21:30 Caroline: Når man arbejder på projekter, så skal ferien selvfølgelig godkendes, og man er jo midlertidigt udlånt til det projekt. 21:32 - 21:42 Caroline: Så man kunne godt argumentere for, at det kunne være fedt, at man skulle godkende en nedsat ferie i det team. 21:42 - 22:06 Caroline: Omvendt kan man sige, at det med meget lille sandsynlighed vil være den person, der sidder for bordenden i projektet, der faktisk skal godkende det i det officielle tidsregistreringssystem, fordi det sjældent er personalemanageren for projektdeltagerne. 22:09 - 22:21 Mads: Nå, lad os sige, at projektlederen for projektet oprettede et team i vores system, og det var så dem, der skulle godkende det. Ville det så give god mening i stedet for, at det var en anden person? 22:21 - 22:46 Caroline: Ja, lige præcis. Jeg tænkte bare, at man er jo udlånt til projektet, så det skal selvfølgelig afstemmes... Nu tager jeg mig selv som eksempel: Jeg er højre hånd for programdirektøren for det hele, og han er ikke min chef. Min chef arbejder også i projektet, men hun arbejder langt nede – det lyder mærkeligt – men længere nede i et af de tracks, der ligger der. 22:47 - 23:01 Caroline: Min chef skal godkende min KMD-ferie overordnet, men jeg kan jo ikke tage ferie på et tidspunkt, hvor det giver dårlig mening i forhold til projektet. 23:01 - 23:37 Caroline: Så der er jo en indirekte godkendelse fra ham, der lige nu er min chef i projektet, men han kan ikke sige nej til min ferie. Det kan kun min personalechef, men der er en tese om, at et midlertidigt team også har et indirekte godkendelsesflow, fordi vi sidder på core-team-møder og diskuterer ferieafviklingen. Så vi har selvfølgelig en dialog om det. 23:37 - 23:38 Mads: Okay. 23:41 - 23:48 Caroline: Men det skulle så bare være godkendelse kun i det her projekt og ikke i systemet, hvor masterdata ligger. 23:50 - 24:01 Caroline: Men igen, folk hader at taste ting ind flere steder, så det kunne være nice, hvis der var et dataflow frem og tilbage. Det kunne det faktisk. 24:03 - 24:11 Mads: Okay, så du mener, at hvis man kunne registrere ferie i vores system, ville det give mening at sende det tilbage til SuccessFactors? 24:22 - 24:23 Caroline: Lige præcis. Ja, det kunne det. 24:25 - 24:30 Caroline: Det kunne det godt. I hvert fald i nogle tilfælde, men det har nok nogle udfordringer. 24:31 - 24:34 Mads: Jeg forestiller mig, at der er et godkendelsesflow, det også skal igennem. 24:34 - 24:36 Caroline: Det var lige præcis det, ja. 24:40 - 24:41 Mads: Ja. Okay. Perfekt. 24:43 - 24:46 Mads: Lad os lige se, om vi har mere... 24:56 - 25:05 Caroline: Altså, så er det... øhh... tag det fra en, der har lavet og implementeret rigtig mange systemer i KMD. Ikke den tekniske del, men projektlederdelen af det. 25:06 - 25:42 Caroline: Nu har det været tre HR... nej, resource management tools, og selvfølgelig en proces omkring det. Man kan sige, at et tool er jo bare et tool. Der skal være en proces omkring det. Og så er det tre, nej, fire forskellige porteføljestyringssystemer og projektledersystemer. Det skal være så simpelt som overhovedet muligt. Altså for brugeren, for at de bruger det. Det giver jo sig selv, ikke? 25:43 - 25:53 Caroline: Men det skal være simpelt og pænt at se på, men simpelthed overtrumfer faktisk udseende, også selvom man arbejder i en IT-afdeling. 25:54 - 26:11 Caroline: Jeg har seriøst stået og trænet chefer i at bruge et værktøj, hvor jeg fik spørgsmålet: 'Hvordan kommer man ind i systemet?' De skulle skrive i URL'en for at komme til det her system. Og der skete ingenting. 26:12 - 26:15 Caroline: Der var to chefer, der var simpelthen så sure, fordi der skete ikke noget. 26:15 - 26:28 Caroline: Jeg var sådan, okay, men første gang var der noget med single-sign-on og sådan noget. Men der skete ikke noget... De trykkede ikke på 'ENTER'... Okay, og så sker der jo ingenting. 26:28 - 26:52 Caroline: Så jeg siger bare, og det er faktisk meget kompetente, kloge mennesker, så der er ikke noget der, men folk har meget at se til. Folk kan være pressede. Forandring er svært, selv når det er noget, der letter deres hverdag. 26:53 - 27:04 Caroline: Så det gælder om at være meget opmærksom på, at det skal være så simpelt som muligt og skabe et så visuelt overblik som muligt. 27:05 - 27:10 Caroline: Hvis der er for mange klik, så går folk helt kolde. Ikke? 27:12 - 27:14 Caroline: Det er i hvert fald også en ting, I skal tænke på. 27:14 - 27:33 Mads: Ja, det var også helt klart noget, vi overvejede. Vi kunne også høre, at den gamle KMD-ferieplanlægger var meget simpel. Der var ikke så mange funktioner, men det var det, der gjorde, at folk gad bruge den. Fordi det ikke var ti klik, før man kunne oprette noget. Du kunne bare klikke, og så var det der. 27:34 - 27:49 Caroline: Ja, lige præcis. Men jeg vil så sige, at for at vende tilbage til det, I lige lærte mig om vores KMD-ferieplanlægger i starten af interviewet, var, at jeg ikke var klar over, at man kunne gøre det på tværs af teams. 27:51 - 27:59 Caroline: Så nu ved jeg godt, at det er den tekniske del af jeres opgave, men jeg tror også, I får ret mange bonuspoint for at gøre det mere brugbart. 27:59 - 28:12 Caroline: I skal tænke over, at der skal være en proces... Hvad er processen og governance omkring det? Det betyder ikke, at det skal være noget tungt, men hvor finder man det? Single-sign-on, lækkert udstyr, og hvad er kommunikationen omkring det? 28:15 - 28:28 Caroline: Et er lanceringen og releases, noget andet er den løbende kommunikation. Hvor finder man information? Noget så simpelt som: 'Hvad går det her tool ud på?' 28:28 - 28:48 Caroline: Er der nogle enkle små videoer eller guides, der viser, hvordan man bruger det? Det er måske ikke nødvendigt, men... Hvis jeg, der har brugt ferieplanlæggeren relativt meget, ikke var klar over det, så kunne en lille pop-up eller en gul markering have været nyttig. 29:04 - 29:06 Caroline: Det kunne være nice, tror jeg. 29:07 - 29:17 Mads: Hundrede procent. Så ligesom du siger, nogle korte videoer eller noget lækkert, hvor man selv kunne lære værktøjet i stedet for, at vi bare forventer, at man går ind og bruger det. 29:17 - 29:25 Caroline: Lige præcis. Jeg tror i hvert fald, at I skal være opmærksomme på, at værktøjet er én ting, men processer og governance omkring det er noget andet, ikke? 29:27 - 29:29 Caroline: Det ene kan ikke leve uden det andet. 29:29 - 29:42 Caroline: Så man skal være opmærksom på, at de to ting skal tænkes sammen, uden at det behøver at være et stort og kompliceret setup, for det gider folk jo ikke. 29:42 - 30:06 Caroline: Kort videoer skal være meget korte. Vi har et af de værktøjer, jeg sidder med lige nu. Det er et meget anerkendt porteføljestyringsværktøj, brugt af mange store virksomheder, og også Microsoft-baseret med Power Apps, så det er super hurtigt og lækkert. bum. bum. bum. 30:07 - 30:20 Caroline: Vi har så lavet sådan nogle videoer. "This is how you do stuff." De er mellem 50 sekunder og halvandet minut, fordi de faktisk skal vise noget. Og det er lige før, at det er for lang tid. 30:21 - 30:35 Caroline: Så vi er nede omkring... og det er selvfølgelig til den yngre generation, men her er det jo folk, der ofte har mange år på bagen, så de har ikke noget imod at se lidt længere videoer. 30:36 - 30:42 Caroline: Når man har arbejdet som projektleder i mange år, er man ikke typen, der siger, at videoer kun må vare ti sekunder, vel? 30:42 - 30:46 Caroline: Så de skal være meget korte og præcise. 30:47 - 30:51 Caroline: Så hellere, at der er lidt flere valgmuligheder for videoer. 30:54 - 31:08 Caroline: Eller sådan nogle pop-ups. Det er folk også ret glade for, vil jeg sige. Ligesom når man holder musen henover et område, og der popper en besked op, der siger "did you know that". Altså, at du kunne gøre sådan og sådan. 31:09 - 31:14 Caroline: Det er også en måde at kommunikere information til folk. 31:14 - 31:27 Caroline: Så længe der er en feature, hvor man kan slå alle notifikationer fra, for vi har også nogle ret gnavne folk, der bliver sure, hvis der popper noget op hele tiden. Så er de glade, tænker jeg. 31:28 - 31:34 Mads: Man kunne også lave en guided-tour første gang, de kommer ind, hvor man siger... Klik her, og nu gør du det her. 31:34 - 31:36 Caroline: Nemlig! 31:38 - 31:41 Caroline: Det synes jeg var en god idé, for så kan man også have den mulighed. 31:41 - 32:02 Caroline: Måske når man åbner værktøjet, så har man kalenderoverblikket her, og ude i siden kunne man have "Do you want to learn more?" med et par enkle trin til at se "learning video" eller "What can the tool do for you?" Så det er let tilgængeligt, hvis man har lyst til det. 32:02 - 32:15 Caroline: Hvis man ikke har lyst til det og bare vil klikke rundt, fordi man allerede kender det, eller man ikke ønsker hjælp, så kan man også gøre det. 32:16 - 32:37 Caroline: Når jeg reflekterer over det, så har jeg godt nok klikket mange gange i vores ferieplanlægger bare for at finde ud af, hvordan man gør. Nå ja, det var ikke sådan. Hvorfor er det låst? Nå, det er fordi, jeg ikke har adgang til den kolonne. 32:37 - 32:43 Caroline: Og det er jo ikke svært, men det faktum, at man sidder og tænker over det, gør, at folk ikke gider bruge det. 32:43 - 32:49 Caroline: Så det skal man også være opmærksom på, hvordan layoutet er. 32:51 - 32:55 Caroline: For jeg husker, det er så irriterende, når man ikke får lov til at klikke der, hvor man vil. 33:01 - 33:06 Mads: Okay, hundrede procent. Så vi kunne godt lave det lidt mere interaktivt på en eller anden måde? 33:06 - 33:07 Caroline: Ja, det synes jeg kunne være fedt. 33:15 - 33:16 Mads: Det tager vi med i hvert fald. 33:21 - 33:29 Mads: Men du nævnte søjlerne, den måde det er lavet på nu, med søjler for hver medarbejder, synes du det var træls, at det var lavet sådan? 33:33 - 33:45 Caroline: Jeg husker det bare, som om det var irriterende. Og hvis jeg sidder med den fornemmelse, så er jeg jo ikke den eneste, der sidder med den fornemmelse. 33:46 - 34:02 Caroline: Jeg kan huske, jeg tænkte: Hvordan er det nu? Jeg skal registrere ferie. Især hvis man er en af de første, så er der ikke nogen farvekoder, og så tænker man: Jeg har ferie den 10. december. 34:02 - 34:20 Caroline: Så klikker man på den 10. december, men der sker ikke noget. Så klikker man flere gange, indtil man opdager, at man skal kigge op og se, hvor man er i søjlen. Det er grayed out, så det er ikke tydeligt. 34:21 - 34:31 Caroline: Man er ikke opmærksom på det, men hvis alle felter var tydelige, ville det se grotesk ud. Så det er et trade-off, som jeg forstår. 34:31 - 34:40 Caroline: Men jeg tror, jeg har gjort det nærmest hver eneste gang, jeg har været i systemet – tænkt: Klik her... Nå nej, klik et andet sted. 34:43 - 34:49 Caroline: Hvis der ikke er nogen smartere løsning, så er jeg nok ikke den eneste, der har haft den følelse. 34:53 - 35:20 Caroline: Jeg ved ikke, hvordan det er i dag. Er det ikke integreret med Microsoft? Hvis det er, burde systemet genkende dig på en anden måde, så du kunne åbne hele dagen fremfor det statiske format, som ligner en Excel-fil. 35:24 - 35:34 Mads: Det var også noget, vi overvejede, at når du kom ind på startsiden, så ville du kun se din egen ferie for ugen. Så kunne du klikke ind i Teams og se det i sammenhæng med andre. 35:34 - 35:37 Caroline: At se det i sammenhæng med andre kunne være ret nice. 35:37 - 35:37 Mads: Ja. 35:37 - 35:43 Mads: For det er lidt forvirrende med søjlerne, fordi du skal ind og finde din egen. 35:43 - 35:48 Caroline: Det er lige præcis det. Og så afhænger det af, hvor mange der er på et team. 35:49 - 36:17 Caroline: Der kan være mange på et team, så man bliver forvirret over, hvilken kolonne der er ens egen. Og det giver i hvert fald en motivation for at opdatere sin ferie, når man starter med at se sin egen oversigt. Og derefter kan man tjekke, om de andre har gjort det samme. 36:17 - 36:22 Caroline: Folk kan godt lide at se sig selv først. Det ville være nice. 36:22 - 36:36 Caroline: Hvis man starter med at se sig selv og derefter kan vælge at se sit normale team og eventuelt de projekter, man er koblet på, kunne det være rigtig fedt. 36:40 - 36:59 Caroline: Hvis man har oprettet de her teams, kunne det være fedt, hvis man kunne se sig selv hele tiden i forhold til de andre, ligesom i Outlook, hvor du kan klikke på og fra for at se dig selv i forhold til andre. 36:59 - 37:19 Caroline: Det kunne være ret fedt. Jeg ved ikke, hvordan styringen af det skal være, men det må I finde ud af. Du har måske forskellige allokeringer afhængig af feriekalenderen. 37:19 - 37:46 Caroline: Jeg har en duo-rolle. Jeg holder fri mellem jul og nytår. Jeg har to små børn, og jeg kommer ikke til at svare på mails i mit ene arbejde. Men i mit projektarbejde, hvor vi har noget kritisk, vil jeg lave min Excel-fil sådan, at juleaften er helt rød, men dagene mellem jul og nytår er gule, så de kan kontakte mig, hvis det er nødvendigt. 37:46 - 37:53 Caroline: Men det vil jeg ikke gøre i mit andet arbejde. Så der er noget med, hvordan data flyder. 37:54 - 38:07 Caroline: I skal være opmærksomme på, at man kan have forskellige roller, og det ville være smart, hvis man kunne se det hele på én gang. 38:32 - 38:37 Mads: Det har vi faktisk ikke tænkt over, at man kan have brug for at melde det ud for to forskellige roller. 38:38 - 39:03 Caroline: Ja, og nogle har flere roller. På et tidspunkt er der et loft for, hvor mange roller du kan have. Jeg har f.eks. en 70 procents allokering til projektet, men det er mere end 70 procent af mit fuldtidsarbejde. 39:03 - 39:13 Caroline: Og så har jeg et andet arbejde også, som er en fuldtidsstilling. Jeg arbejder ikke 200 procent, men vi arbejder meget i KMD. 39:13 - 39:23 Caroline: Man er nødt til at balancere det ud, og der er stor forskel på, hvornår jeg er tilgængelig for hvad. 39:27 - 39:33 Caroline: Nu handler det om ferieplanlægning, men jeg går straks i resource management-mode, fordi jeg har arbejdet med det før. 39:34 - 39:46 Caroline: Når man har duo-roller, er der uger, hvor jeg er meget på programmet. I andre uger er jeg mere på mit andet arbejde, som ved månedens start. 39:47 - 40:10 Caroline: Der er en masse data, der skal køres igennem, og det resulterer i rapportering til ledelsen. Så er der en masse ledelsesmøder, hvor de store kanoner sidder og diskuterer, og det skal jeg facilitere. 40:10 - 40:23 Caroline: Der var jeg jo ikke tilgængelig for programmet, fordi jeg var optaget af noget andet. Så der kunne man jo – det er resource management, men det var ikke ferie – have lavet en note: "I kan ikke få fat på mig her, for jeg laver noget andet," eller hvis man er på en konference eller lignende. 40:23 - 40:41 Caroline: Det er mere sådan noget som absence i andre sammenhænge. Rigtig mange af vores tech-folk er meget ude, både som speakere på konferencer og for at tilegne sig ny viden. Dion er jo genial. 40:41 - 40:56 Caroline: I skal være glade for at have ham som kontaktperson, for han er genial. Han skal stå og tale foran nogle japanere. Vi er jo ejet af et meget stort japansk selskab, der hedder NSC "-----". 40:57 - 41:04 Caroline: De har nogle NSC-dage, som i år skal afholdes i LEGOLAND, eller noget i den stil. 41:04 - 41:11 Caroline: Dion blev spurgt, om han ville komme og tale, og det vil han selvfølgelig gerne. Men der er han jo ikke tilgængelig. 41:11 - 41:12 Mads: Nej, det er selvfølgelig rigtigt. 41:12 - 41:22 Caroline: Han har ikke ferie, men han er ikke tilgængelig. Og han er selvfølgelig heller ikke tilgængelig bagefter, for han skal sikkert indgå i alle mulige dialoger. 41:23 - 41:32 Caroline: Der er relativt mange af den slags situationer, især for tech-folkene. De er optaget af noget andet, men har ikke ferie. I programmet ville de være "gule", som betyder, at de kan kontaktes, hvis det virkelig brænder på. 41:34 - 41:51 Caroline: Det kunne være noget at overveje. Om det kun er ferieplanlægning, eller om det også skal omfatte andre former for absence – version 2.0 eller en add-on. Det kunne man tænke over. 41:52 - 42:05 Caroline: For det er jo en anden form for absence. 42:08 - 42:30 Mads: Hundrede procent, det kunne man sagtens tage med. Indtil videre har vi kun snakket om at tage SuccessFactors-koderne med ind i systemet. Men som du siger, kunne vi også tage nogle andre koder med. Og så kunne SuccessFactors-koderne være røde, og de andre kunne være gule. Det kan du vel godt komme afsted med i forhold til HR? Hvis du er fraværende uden at være syg, er det vel okay? 42:31 - 42:39 Caroline: Ja, lige præcis. Det kunne man sagtens gøre. Det var faktisk en god pointe. 42:40 - 42:54 Caroline: HR-mæssigt er man på arbejde, så man skal kunne kontaktes. Men det er vigtigt at understrege over for folk, at de ikke er fuldt til rådighed, fordi de er "gule". 42:56 - 42:57 Caroline: Det kunne være en nice feature. 42:58 - 43:05 Mads: Ja, det tager vi med. Det kunne også være fedt, hvis vi når så langt. 43:05 - 43:09 Caroline: Ja, det kan vi da håbe. Hvornår skal I aflevere? 43:10 - 43:14 Mads: Det er i slutningen af december. Den tyvende. 43:14 - 43:15 Caroline: December, ja. 43:25 - 43:28 Caroline: Ej, der er ikke lang tid til, men det skal nok blive skide godt. 43:28 - 43:35 Caroline: Og det er også fint at få afleveret det inden jul, så I kan gå på juleferie ordentligt. 43:35 - 43:43 Caroline: I har formentlig en masse eksamener i januar, så det er godt at få det ud af vejen. Har I andre spørgsmål? 43:44 - 43:47 Marc: Du nævnte det der Excel-ark med ferie og sådan noget. 43:47 - 43:48 Caroline: Uhm. 43:48 - 43:49 Marc: Er det noget, vi kan få indsigt i? 43:50 - 43:52 Marc: Om ikke andet i hvert fald de polske og danske helligdage? 43:56 - 43:58 Caroline: Ja, altså, det må I gerne. 43:58 - 44:10 Caroline: Jeg vil gerne tage et screenshot og sende det til jer. Jeg skal bare lige have det clearet. Der står umiddelbart ikke noget fortroligt, men fordi det er en del af programmet, bliver jeg nødt til at sikre mig, at alt er fint. 44:12 - 44:16 Caroline: Men jeg skal nok tjekke det, inden jeg går på efterårsferie, og sende det til jer. 44:16 - 44:20 Caroline: Jeg kan fortælle jer, hvordan vi har fået informationerne om danske og polske helligdage – Google is your friend. 44:20 - 44:23 Mads & Marc: Hahaha. 44:25 - 44:31 Caroline: Og så lige en validering hos... altså, de danske helligdage kender jeg jo godt. 44:34 - 44:43 Caroline: Der er meget stor forskel. Juleaften er jo ikke en helligdag. Nytårsaften er heller ikke en helligdag. Nogle virksomheder kræver, at man arbejder, og man skal bruge en fridag på det. Nogle har en halv fridag. 44:43 - 44:49 Caroline: Vi i KMD har faktisk fri hele dagen på begge dage, hvilket er super privilegeret, så det er to ekstra feriedage, vi har om året. 44:49 - 44:57 Caroline: Så er der nogen, der har fri 1. maj, og nogen har fri grundlovsdag. Vi har ikke fri 1. maj i KMD, men det er ikke alle, der har fri på grundlovsdag. 44:57 - 45:07 Caroline: Skolerne har lukket, men ikke alle børnehaver har lukket. Så det er lidt forskelligt. De danske helligdage har jeg valideret, og hvis jeg ikke vidste det, ville jeg gå til vores HR. 45:07 - 45:27 Caroline: De polske helligdage... Vi har et HR-setup i Polen, så der kunne man spørge dem. Men jeg lavede en Google-søgning, fandt de relevante datoer, og så tog jeg fat i en polsk kollega for at få det valideret. Det var den metode, jeg brugte. 45:27 - 45:38 Caroline: Det ville nok have været mere officielt at spørge HR, men det gjorde jeg ikke. Jeg brugte Google. 45:38 - 45:48 Mads: Det ville i hvert fald være guld værd at få den liste. For som du siger, det er forskelligt for KMD, hvilke dage I holder fri. Det ville være guld værd. 45:48 - 45:59 Caroline: Jeg skal lige tjekke det for at være sikker på, at jeg ikke giver noget videre, som jeg ikke må. Jeg kunne ikke forestille mig det, men der kan være noget omkring persondata, fordi der står navne. 46:07 - 46:11 Caroline: Eftersom I har underskrevet en NDA, så tænker jeg, at det er fint nok. 46:14 - 46:30 Caroline: Jeg kan jo bare lade være med at tage navnene med. Så kun de felter, hvor markeringerne er, som repræsenterer datoerne. Det er et simpelt Excel-ark. 46:30 - 46:37 Caroline: Jeg skal nok vende tilbage i slutningen af ugen. Jeg holder forlænget weekend. Er der andet? 46:39 - 46:42 Mads: Jeg tror faktisk, det var det hele. 46:42 - 46:43 Caroline: Okay, fedt. 46:44 - 46:47 Mads: <NAME>, fordi vi måtte få et interview med dig. Det var virkelig guld værd. 46:47 - 46:48 Caroline: Velbekomme. 46:48 - 47:06 Caroline: Jeg vil gerne se, hvad I kommer ud med. Og hvis I har brug for nogen til at teste det, så kan jeg få nærmest hvilket som helst system til at crashe. I skal bare skrive til mig, så skal jeg nok finde fejlene. 47:07 - 47:12 Caroline: Jeg vil gerne teste noget, hvis I vil prøve det af. Så bare skriv til mig. 47:12 - 47:14 Caroline: Bare tag det ikke personligt, hvis der går lidt tid, før jeg svarer. 47:14 - 47:21 Caroline: Der er et stort inflow af arbejdsopgaver og mails. 47:22 - 47:25 Caroline: Men I er altid velkomne til at sende en reminder. 47:25 - 47:29 Caroline: Jeg bliver ikke fornærmet over det. Så bare gør det. Tak. 47:31 - 47:32 Caroline: Ha' en dejlig eftermiddag. 47:32 - 47:33 Mads & Marc: Tak i lige måde. 47:33 - 47:34 Caroline: Godt. Vi tales ved. 47:35 - 47:37 Alle: Hej hej.
https://github.com/kiwiyou/algorithm-lecture
https://raw.githubusercontent.com/kiwiyou/algorithm-lecture/main/basic/05-associated-data.typ
typst
#import "@preview/cetz:0.1.2" #import "@preview/algorithmic:0.1.0" #import "../slide.typ" #show: slide.style #show link: slide.link #show footnote.entry: slide.footnote #let algorithm(..args) = text(font: ("linux libertine", "Pretendard"), size: 17pt)[#algorithmic.algorithm(..args)] #let func(body) = text(font: ("linux libertine", "Pretendard"))[#smallcaps[#body]] #align(horizon + center)[ = 알고리즘 기초 세미나 05: 연관 자료구조 #text(size: 0.8em)[ 연세대학교 전우제#super[kiwiyou] \ 2023.01.11.r1 ] ] #slide.slide[맵][ - 두 자료가 연관되어 있음 - 한 자료로 다른 쪽 자료를 찾을 수 있음 - 찾는 열쇠가 되는 자료가 키, 찾으려는 자료는 값 ] #slide.slide[해시를 이용한 맵][ - 해시 함수: 모든 값을 고정된 길이의 값으로 변환하는 함수 - 키에 해시 함수를 적용한 값을 사용하여 값을 찾음 - 가장 간단한 구현으로, 배열을 만든 후 해시 값을 길이로 나눈 나머지 위치에 값을 저장 - 삽입, 검색, 삭제에 모두 평균 $cal(O)(1)$, 최악 $cal(O)(N)$ - 해시 충돌: 해시 값이 같은 키가 여럿 존재하는 경우 ] #slide.slide[트리를 이용한 맵][ - 해시 함수를 이용하지 않고, 균형 잡힌 이진 검색 트리#super([BBST])를 이용하여 연관을 구현 - 삽입, 검색 및 삭제에 모두 $cal(O)(log N)$ - 키에 관한 이분 탐색이 가능 ] #slide.slide[집합 자료구조][ - 키와 연관된 값 없이 자료의 존재 여부만 확인할 수 있는 자료구조 ] #slide.slide[과제][ - #slide.problem("26069", "붙임성 좋은 총총이") - #slide.problem("29721", "변형 체스 놀이 : 다바바(Dabbaba)") - #slide.problem("29714", "브실이의 구슬 아이스크림") ] #slide.slide[우선순위 큐][ - 자료마다 우선순위가 부여됨 - 삽입된 값 중 우선순위가 높은 값이 먼저 삭제됨\* - 보통 이진 힙으로 구현: 삽입, 삭제에 $cal(O)(log N)$ ] #slide.slide[우선순위 큐][ - #slide.problem("14235", "크리스마스 선물") - #slide.problem("23757", "아이들과 선물 상자") - #slide.problem("28107", "회전초밥") ]
https://github.com/mrknorman/evolving_attention_thesis
https://raw.githubusercontent.com/mrknorman/evolving_attention_thesis/main/08_infrastructure/08_infrastructure.typ
typst
= Software Development <software-dev-sec> == cuPhenom <cuphenom-sec>
https://github.com/Karolinskis/KTU-typst
https://raw.githubusercontent.com/Karolinskis/KTU-typst/main/mainPages/ImageList.typ
typst
#page(header: none)[ #align(center)[ = Paveikslų sąrašas ] #outline( title: "", target: figure.where(kind: image) ) ]
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz/0.0.2/lib/plot.typ
typst
Apache License 2.0
// CeTZ Library for drawing charts #import "axes.typ" #import "palette.typ" #import "../util.typ" #import "../draw.typ" #import "../vector.typ" // Compute list of linear paths for data points, clipped to // the bounding box of [min-x, max-x][min-y, max-y]. // // - data (array): List of (x, y) data points // - min-x (float): Min x // - max-x (float): Max x // - min-y (float): Min y // - max-y (float): Max y #let paths-for-points(data, min-x, max-x, min-y, max-y) = { let in-range(p) = { if p == none { return false } let (px, py, ..) = p return (px >= min-x and px <= max-x and py >= min-y and py <= max-y) } let lin-interpolated-pt(a, b) = { let x1 = a.at(0) let y1 = a.at(1) let x2 = b.at(0) let y2 = b.at(1) /* Special case for vertical lines */ if x2 - x1 == 0 { return (x2, calc.min(max-y, calc.max(y2, min-y))) } if y2 - y1 == 0 { return (calc.min(max-x, calc.max(x2, min-x)), y2) } let m = (y2 - y1) / (x2 - x1) let n = y2 - m * x2 let x = x2 let y = y2 y = calc.min(max-y, calc.max(y, min-y)) x = (y - n) / m x = calc.min(max-x, calc.max(x, min-x)) y = m * x + n return (x, y) } let paths = () let path = () let prev-p = none for p in data { if p == none { continue } let (px, py, ..) = p if px == none or py == none { continue } if in-range(p) { if not in-range(prev-p) and prev-p != none { path.push(lin-interpolated-pt(p, prev-p)) } path.push(p) } else { if in-range(prev-p) { path.push(lin-interpolated-pt(prev-p, p)) } else if prev-p != none { let a = lin-interpolated-pt(p, prev-p) let b = lin-interpolated-pt(prev-p, p) if in-range(a) and in-range(b) { path.push(a) path.push(b) } } if path.len() > 0 { paths.push(path) path = () } } prev-p = p } if path.len() > 0 { paths.push(path) } return paths } /// Add data to a plot environment. /// /// Must be called from the body of a `plot(..)` command. /// /// - domain (array): Domain tuple of the plot. If `data` is a function, /// domain must be specified, as `data` is sampled /// for x-values in `domain`. Values must be numbers. /// - hypograph (bool): Fill hypograph; uses the `hypograph` style key for /// drawing /// - epigraph (bool): Fill epigraph; uses the `epigraph` style key for /// drawing /// - fill (bool): Fill to y zero /// - samples (int): Number of times the `data` function gets called for /// sampling y-values. Only used if `data` is of /// type function. /// - style (style): Style to use, can be used with a palette function /// - axes (array): Name of the axes to use ("x", "y"), note that not all /// plot styles are able to display a custom axis! /// - mark (string): Mark symbol to place at each distinct value of the /// graph. Uses the `mark` style key of `style` for drawing. /// /// The following marks are supported: /// - `"*"` or `"x"` -- X /// - `"+"` -- Cross /// - `"|"` -- Bar /// - `"-"` -- Dash /// - `"o"` -- Circle /// - `"triangle"` -- Triangle /// - `"square"` -- Square /// - mark-size (float): Mark size in cavas units /// - data (array,function): Array of 2D data points (numeric) or a function /// of the form `x => y`, where `x` is a value /// insides `domain` and `y` must be numeric. /// /// *Examples* /// - `((0,0), (1,1), (2,-1))` /// - x => calc.pow(x, 2) #let add(domain: auto, hypograph: false, epigraph: false, fill: false, mark: none, mark-size: .2, samples: 100, style: (stroke: black, fill: gray), mark-style: (stroke: black, fill: none), axes: ("x", "y"), data ) = { // If data is of type function, sample it if type(data) == "function" { assert(samples >= 2) assert(type(domain) == "array" and domain.len() == 2) let (lo, hi) = domain data = range(0, samples + 1).map(x => { let x = lo + x / samples * (hi - lo) (x, (data)(x)) }) } // If data is not of type function, auto set domain if domain == auto or domain.at(0) == auto or domain.at(1) == auto { let (lo, hi) = ( calc.min(..data.map(t => t.at(0))), calc.max(..data.map(t => t.at(0))) ) if domain == auto { domain = (lo, hi) } else if domain.at(0) == auto { domain.at(0) = lo } else if domain.at(1) == auto { domain.at(1) = hi } } // Get y-domain let y-domain = ( calc.min(..data.map(t => t.at(1))), calc.max(..data.map(t => t.at(1))) ) (( type: "data", data: data, axes: axes, x-domain: domain, y-domain: y-domain, epigraph: epigraph, hypograph: hypograph, fill: fill, style: style, mark: mark, mark-size: mark-size, mark-style: mark-style, ),) } /// Add an anchor to a plot environment /// /// - name (string): Anchor name /// - position (array): Tuple of x and y values. /// Both values can have the special values "min" and /// "max", which resolve to the axis min/max value. /// Position is in axis space! /// - axes (array): Name of the axes to use ("x", "y"), note that both /// axes must exist! #let add-anchor(name, position, axes: ("x", "y")) = { (( type: "anchor", name: name, position: position, axes: axes, ),) } /// Create a plot environment /// /// Note: Data for plotting must be passed via `plot.add(..)` /// /// Note that different axis-styles can show different axes. /// The `"school-book"` and `"left"` style shows only axis "x" and "y", /// while the `"scientific"` style can show "x2" and "y2", if set /// (if unset, "x2" mirrors "x" and "y2" mirrors "y"). Other /// axes (e.G. "my-axis") work, but no ticks or labels will be shown. /// /// *Options* /// /// The following options are supported per axis /// and must be prefixed by `<axis-name>-`, e.G. /// `x-min: 0`. /// #box[ /// - label (content): Axis label /// - min (int): Axis minimum value /// - max (int): Axis maximum value /// - tick-step (float): Distance between major ticks /// - minor-tick-step (float): Distance between minor ticks /// - ticks (array): List of ticks values or value/label /// tuples. Example `(1,2,3)` or `((1, [A]), (2, [B]),)` /// - format (string): Tick label format, `"float"`, `"sci"` (scientific) /// or a custom function that receives a value and /// returns a content (`value => content`). /// - grid (bool,string): Enable grid-lines at tick values: /// - `"major"`: Enable major tick grid /// - `"minor"`: Enable minor tick grid /// - `"both"`: Enable major & minor tick grid /// - `false`: Disable grid /// - unit (content): Tick label suffix /// - decimals (int): Number of decimals digits to display for tick labels /// ] /// /// - body (body): Calls of `plot.add` commands /// - size (array): Plot canvas size tuple of width and height in canvas units /// - axis-style (string): Axis style "scientific", "left", "school-book" /// - `"scientific"`: Frame plot area and draw axes y, x, y2, and x2 around it /// - `"school-book"`: Draw axes x and y as arrows with both crossing at $(0, 0)$ /// - `"left"`: Draw axes x and y as arrows, the y axis stays on the left (at `x.min`) /// and the x axis at the bottom (at `y.min`) /// - name (string): Element name /// - options (any): The following options are supported per axis /// and must be prefixed by `<axis-name>-`, e.G. /// `x-min: 0`. /// - min (int): Axis minimum /// - max (int): Axis maximum /// - tick-step (float): Major tick step /// - minor-tick-step (float): Major tick step /// - ticks (array): List of ticks values or value/label /// tuples /// - unit (content): Tick label suffix /// - decimals (int): Number of decimals digits to display #let plot(body, size: (1, 1), axis-style: "scientific", name: none, ..options ) = draw.group(name: name, ctx => { let data = () let anchors = () for cmd in body { assert(type(cmd) == "dictionary" and "type" in cmd, message: "Expected plot sub-command in plot body") if cmd.type == "data" { data.push(cmd) } if cmd.type == "anchor" { anchors.push(cmd) } } assert(axis-style in ("scientific", "school-book", "left"), message: "Invalid plot style") // Create axes let axis-dict = (:) for d in data { for (i, name) in d.axes.enumerate() { if not name in axis-dict { axis-dict.insert(name, axes.axis( min: none, max: none)) } let axis = axis-dict.at(name) let domain = if i == 0 {d.x-domain} else {d.y-domain} axis.min = util.min(axis.min, ..domain) axis.max = util.max(axis.max, ..domain) axis-dict.at(name) = axis } } let options = options.named() let get-axis-option(axis-name, name, default) = { let v = options.at(axis-name + "-" + name, default: default) if v == auto { default } else { v } } // Set axis options for (name, axis) in axis-dict { if not "ticks" in axis { axis.ticks = () } axis.label = get-axis-option(name, "label", $#name$) axis.min = get-axis-option(name, "min", axis.min) axis.max = get-axis-option(name, "max", axis.max) axis.ticks.list = get-axis-option(name, "ticks", ()) axis.ticks.step = get-axis-option(name, "tick-step", axis.ticks.step) axis.ticks.minor-step = get-axis-option(name, "minor-tick-step", axis.ticks.minor-step) axis.ticks.decimals = get-axis-option(name, "decimals", 2) axis.ticks.unit = get-axis-option(name, "unit", []) axis.ticks.format = get-axis-option(name, "format", axis.ticks.format) axis.ticks.grid = get-axis-option(name, "grid", false) // Sanity checks assert(axis.min < axis.max, message: "Axis min. must be < max.") axis-dict.at(name) = axis } // Prepare styles for i in range(data.len()) { if type(data.at(i).style) == "function" { data.at(i).style = (data.at(i).style)(i) } if type(data.at(i).mark-style) == "function" { data.at(i).mark-style = (data.at(i).mark-style)(i) } } // Compute poly-lines for i in range(data.len()) { let (x, y) = data.at(i).axes.map(name => axis-dict.at(name)) data.at(i).path = paths-for-points(data.at(i).data, x.min, x.max, y.min, y.max) } let stroke-segments(segments) = { for s in segments { draw.line(..s, fill: none) } } let draw-marks(pts, x, y, mark, mark-size) = { // Scale marks back to canvas scaling let (sx, sy) = size sx = (x.max - x.min) / sx sy = (y.max - y.min) / sy sx *= mark-size sy *= mark-size let bl(pt) = (rel: (-sx/2, -sy/2), to: pt) let br(pt) = (rel: (sx/2, -sy/2), to: pt) let tl(pt) = (rel: (-sx/2, sy/2), to: pt) let tr(pt) = (rel: (sx/2, sy/2), to: pt) let ll(pt) = (rel: (-sx/2, 0), to: pt) let rr(pt) = (rel: (sx/2, 0), to: pt) let tt(pt) = (rel: (0, sy/2), to: pt) let bb(pt) = (rel: (0, -sy/2), to: pt) let draw-mark = ( if mark == "o" { draw.circle.with(radius: (sx/2, sy/2)) } else if mark == "square" { pt => { draw.rect(bl(pt), tr(pt)) } } else if mark == "triangle" { pt => { draw.line(bl(pt), br(pt), tt(pt), close: true) } } else if mark == "*" or mark == "x" { pt => { draw.line(bl(pt), tr(pt)); draw.line(tl(pt), br(pt)) } } else if mark == "+" { pt => { draw.line(ll(pt), rr(pt)); draw.line(tt(pt), bb(pt)) } } else if mark == "-" { pt => { draw.line(ll(pt), rr(pt)) } } else if mark == "|" { pt => { draw.line(tt(pt), bb(pt)) } } ) for pt in pts { let (px, py, ..) = pt if px >= x.min and px <= x.max and py >= y.min and py <= y.max { draw-mark(pt) } } } let fill-segments-to(segments, to) = { for s in segments { let origin = (s.first().at(0), to) let target = (s.last().at(0), to) draw.line(origin, ..s, target, stroke: none) } } // Fill epi-/hypo-graph for d in data { let (x, y) = d.axes.map(name => axis-dict.at(name)) axes.axis-viewport(size, x, y, { draw.anchor("center", (0, 0)) draw.set-style(..d.style) if d.at("hypograph", default: false) { fill-segments-to(d.path, y.min) } if d.at("epigraph", default: false) { fill-segments-to(d.path, y.max) } if d.at("fill", default: false) { fill-segments-to(d.path, calc.max(calc.min(y.max, 0), y.min)) } }) } if axis-style == "scientific" { axes.scientific( size: size, bottom: axis-dict.x, top: axis-dict.at("x2", default: auto), left: axis-dict.y, right: axis-dict.at("y2", default: auto),) } else if axis-style == "left" { axes.school-book( size: size, axis-dict.x, axis-dict.y, x-position: axis-dict.y.min, y-position: axis-dict.x.min) } else if axis-style == "school-book" { axes.school-book( size: size, axis-dict.x, axis-dict.y,) } // Stroke + Mark data for d in data { let (x, y) = d.axes.map(name => axis-dict.at(name)) axes.axis-viewport(size, x, y, { draw.set-style(..d.style) stroke-segments(d.path) }) if d.mark != none { axes.axis-viewport(size, x, y, { draw.set-style(..d.style, ..d.mark-style) draw-marks(d.data, x, y, d.mark, d.mark-size) }) } } // Place anchors for a in anchors { let (x, y) = a.axes.map(name => axis-dict.at(name)) assert(x != none, message: "Axis " + name + " does not exist") assert(y != none, message: "Axis " + name + " does not exist") axes.axis-viewport(name: "anchors", size, x, y, { let (ax, ay) = a.position if ax == "min" {ax = x.min} else if ax == "max" {ax = x.max} if ay == "min" {ay = y.min} else if ay == "max" {ay = y.max} draw.anchor("default", (0,0)) draw.anchor(a.name, (ax, ay)) }) draw.copy-anchors("anchors", filter: (a.name,)) } })
https://github.com/0x1B05/algorithm-journey
https://raw.githubusercontent.com/0x1B05/algorithm-journey/main/practice/note/content/有序表.typ
typst
#import "../template.typ": * #pagebreak() = 有序表 所有的操作都是log(n) 红黑树,AVL树,SB树,跳表(skiplist)都可以实现有序表 上面所有结构实现的时间复杂度没有区别.知识原理不同,常数时间有区别. 通常用SB树(好改.) > 跳表不是一个系列的,其他三个都属于平衡搜索二叉树系列. == 搜索二叉树 若有重复节点,例如5,5.则可以使用5*2 例如5,a;5,b.则可以使用5,{a,b} 重复节点不影响复杂度. 删除: 没有孩子,直接删 左右孩子不全,也简单,让唯一的节点替代. 都有的话,左树的最右,或者右树上最左.替代的节点的子树直接接到替代节点的父去. 缺点: 没有平衡性,没办法每时每刻都是log(n) 取决于用户的数据. 左右子树高度差不超过1.(严格平衡) 这里平衡是指左右子树高度差不太大. == AVL树(严格平衡) (搜索二叉树,左旋,右旋) 带有自平衡操作的搜索二叉树 avl在上面的基础上,增加了如何用左旋和右旋 红黑树,也是同样的基础,但是其有自己平衡性的定义,如何平衡的操作 SB树也是自己定义. === 左旋,右旋 头节点倒向哪边就是xx旋 avl树怎么查到自己不平衡的? 增删改查操作与搜索二叉树完全一致,但是加入/删除一个节点后,会往上查是否有平衡性. 删除节点两个孩子都全的时候,从哪儿查起.替换节点的父开始. === 四种平衡性被破坏的情况 LL型:左树过长 RR型:右树过长 LR型:左孩子的右孩子过长(把左孩子的右孩子调成头部) RL型:右孩子的左孩子过长(把右孩子的左孩子调成头部) 红黑树和SB树与avl树增删改查节点全一样,检查时机全一样. 有区别的是,到具体某一个节点的时候,判断的违规条件不一样. avl维持高度信息,红黑树维持自己的有关平衡二叉树的信息,SB树维持的是节点的大小,即有多少个节点的信息. == SB树 平衡性 每棵子树的大小不小于其兄弟的子树大小. 即每棵叔叔树的大小不小于其任何之子树的大小 > 这里的大小是节点的数量 LL型:左树过多 RR型:右树过多 LR型:左孩子的右孩子过多(把左孩子的右孩子调成头部) RL型:右孩子的左孩子过多(把右孩子的左孩子调成头部)
https://github.com/howardlau1999/sysu-thesis-typst
https://raw.githubusercontent.com/howardlau1999/sysu-thesis-typst/master/custom.typ
typst
MIT License
#let 行距 = 1em #let 字体 = ( 仿宋: ("Times New Roman", "Adobe Fangsong Std", "FangSong"), 宋体: ("Times New Roman", "Source Han Serif SC", "SimSun"), 黑体: ("Times New Roman", "Arial", "Adobe Heiti Std", "SimHei"), 楷体: ("Times New Roman", "Adobe Kaiti Std R", "KaiTi"), 代码: ("Inconsolata", "Source Han Sans HW SC", "Times New Roman", "SimSun"), ) #let 强调色 = cmyk(100%, 0%, 100%, 60%)
https://github.com/KaarelKurik/conditional-plasticity
https://raw.githubusercontent.com/KaarelKurik/conditional-plasticity/main/presentation.typ
typst
#import "@preview/polylux:0.3.1": * #import "@preview/ctheorems:1.1.2": * #import themes.simple: * #show: simple-theme.with( footer: [], ) #set par(justify:true) #title-slide[ = Banachi ruumi ühikkera plastilisus ning mõned seotud tulemused #v(2em) <NAME> ] #slide[ = Meetrilise ruumi plastilisus *Definitsioon:* Meetriline ruum $(M,d)$ on _(homöomorfselt) plastiline_ siis, kui iga 1‑Lipschitz (homöomorfne) bijektsioon $f : M -> M$ on isomeetria. (Panna tähele, et plastilisusest järeldub homöomorfne plastilisus.) *Küsimus:* Kas iga Banachi ruumi kinnine ühikkera on plastiline? Praegune seis: tõestatud mitmel erijuhul. Peamine võte on ekstremaalsete punktide uurimine. *Definitsioon:* Konveksse hulga punkt on _ekstremaalne_ kui hulgas asuvad sirglõigud sisaldavad seda punkti vaid otspunktina. Näiteks konveksse hulknurga ekstremaalsete punktide hulk on täpselt tema nurgad, ringi ekstremaalsed punktid ühtivad tema piirjoonega. *Definitsioon:* Banachi ruum on _rangelt konveksne_ kui tema ühikkera ekstremaalsete punktide hulk ühtib ühiksfääriga. ] #slide[ = Varasemad tulemused - ruumid, mille ühikkera on ühend lõplikumõõtmelistest polüeedrilistest ekstremaalsetest alamhulkadest (sh kõik rangelt konvekssed Banachi ruumid) @angosto:2019 @cascales:2016, - mistahes $ell_1$-summa rangelt konvekssetest Banachi ruumidest (sh $ell_1$ ise) @kadets_zavarzina:2016 @kadets_zavarzina:2018, - $ell_infinity$-summa *kahest* rangelt konvekssest Banachi ruumist @haller:2022, - $ell_1 plus.circle_2 RR$ @haller:2022, - $C(K)$, kus $K$ on kompaktne metriseeruv ruum lõpliku kuhjumispunktide hulgaga (sh $c tilde.equiv C(omega+1)$, ehk koonduvate reaaljadade ruum) @fakhoury:2024 @leo:2022. ] #slide[ = Minu tulemused 1. Kui Banachi ruumi kõik separaablid alamruumid on homöomorfselt plastilise ühikkeraga, siis ruum ise on homöomorfselt plastilise ühikkeraga. + Kui iga Banachi ruumi $X$ ühikkera on plastiline, siis kõik 1‑Lipschitz bijektsioonid kujul $f : B_Y -> B_Z$, kus $Y,Z$ on Banachi ruumid, on isomeetriad. Need tulemused saab kätte otsese konstruktsiooniga. ] #slide[ 3. Olgu $X$ rangelt konvekssete Banachi ruumide $X_i$ lõpliku pere $ell_infinity$‑summa. Iga mitteahendav funktsioon $g : B_X -> B_X$ faktoriseerub "teatud kombel" komponentsfääride kaudu. Täpsemalt, $ exists sigma in "perm"_n exists g_i : S_i -> S_sigma(i) forall x in B_X (norm(pi_i x) = 1 => g_i (pi_i x) = pi_sigma(i) G(x)). $ Üks tagajärg: sellise $X$ korral on iga ekstremaalsust säilitav $1$‑Lipschitz bijektsioon $f : B_X -> B_X$ isomeetria. Tõestus on sisuliselt graafiteoreetiline, seega leidub graafiteoreetiline analoog teoreemile. ] #slide[ #bibliography("refs.yml") ]
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/field-02.typ
typst
Other
// Test fields on function scopes. #enum.item #assert.eq #assert.ne
https://github.com/ClazyChen/Table-Tennis-Rankings
https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2004/WS-01.typ
typst
#set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (1 - 32)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [1], [ZHANG Yining], [CHN], [2608], [2], [WANG Nan], [CHN], [2549], [3], [NIU Jianfeng], [CHN], [2455], [4], [GUO Yan], [CHN], [2431], [5], [GUO Yue], [CHN], [2375], [6], [LI Ju], [CHN], [2293], [7], [TIE Yana], [HKG], [2213], [8], [SONG Ah Sim], [HKG], [2191], [9], [LIN Ling], [HKG], [2157], [10], [GAO Jun], [USA], [2147], [11], [STEFF Mihaela], [ROU], [2138], [12], [KIM Kyungah], [KOR], [2130], [13], [LAU Sui Fei], [HKG], [2125], [14], [ZHANG Rui], [HKG], [2097], [15], [LI Nan], [CHN], [2092], [16], [LEE Eunsil], [KOR], [2091], [17], [BOROS Tamara], [CRO], [2086], [18], [FAN Ying], [CHN], [2085], [19], [PENG Luyang], [CHN], [2084], [20], [CAO Zhen], [CHN], [2076], [21], [TOTH Krisztina], [HUN], [2068], [22], [JIANG Huajun], [HKG], [2057], [23], [KIM Hyon Hui], [PRK], [2047], [24], [FUKUHARA Ai], [JPN], [2043], [25], [LANG Kristin], [GER], [2039], [26], [LI Xiaoxia], [CHN], [2035], [27], [STRUSE Nicole], [GER], [2011], [28], [FUJINUMA Ai], [JPN], [2010], [29], [LI Jiawei], [SGP], [2006], [30], [<NAME>], [JPN], [1993], [31], [KIM Mi Yong], [PRK], [1983], [32], [KOSTROMINA Tatyana], [BLR], [1981], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (33 - 64)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [33], [SUK Eunmi], [KOR], [1978], [34], [#text(gray, "LI Jia")], [CHN], [1970], [35], [SCHOPP Jie], [GER], [1965], [36], [BADESCU Otilia], [ROU], [1954], [37], [SCHALL Elke], [GER], [1949], [38], [LI Chunli], [NZL], [1941], [39], [UMEMURA Aya], [JPN], [1940], [40], [STEFANOVA Nikoleta], [ITA], [1934], [41], [KIM Bokrae], [KOR], [1931], [42], [<NAME>], [JPN], [1924], [43], [PAVLOVICH Viktoria], [BLR], [1921], [44], [BAI Yang], [CHN], [1904], [45], [<NAME>], [RUS], [1902], [46], [FAZEKAS Maria], [HUN], [1893], [47], [BATORFI Csilla], [HUN], [1883], [48], [WANG Chen], [CHN], [1882], [49], [<NAME>], [LUX], [1871], [50], [<NAME>ong], [SGP], [1869], [51], [POTA Georgina], [HUN], [1868], [52], [<NAME>], [KOR], [1868], [53], [<NAME>], [CHN], [1851], [54], [STRBIKOVA Renata], [CZE], [1851], [55], [<NAME>un-Feng], [TPE], [1849], [56], [<NAME>], [ISR], [1847], [57], [PASKAUSKIENE Ruta], [LTU], [1845], [58], [ODOROVA Eva], [SVK], [1842], [59], [NEMES Olga], [ROU], [1838], [60], [ZHANG Xueling], [SGP], [1833], [61], [<NAME>], [HUN], [1830], [62], [BENTSEN Eldijana], [CRO], [1824], [63], [NEGRISOLI Laura], [ITA], [1817], [64], [CHEN TONG Fei-Ming], [TPE], [1810], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (65 - 96)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [65], [KONISHI An], [JPN], [1808], [66], [<NAME>ika], [BLR], [1805], [67], [KWAK Bangbang], [KOR], [1799], [68], [<NAME>], [ITA], [1798], [69], [<NAME>], [CRO], [1797], [70], [HUANG Yi-Hua], [TPE], [1793], [71], [<NAME>], [CZE], [1786], [72], [<NAME>], [JPN], [1785], [73], [WANG Yu], [ITA], [1783], [74], [<NAME>], [GER], [1778], [75], [<NAME>], [ROU], [1776], [76], [<NAME>], [KOR], [1772], [77], [<NAME>], [KOR], [1772], [78], [<NAME>], [PRK], [1768], [79], [<NAME>], [GER], [1766], [80], [LOGATZKAYA Tatyana], [BLR], [1766], [81], [<NAME>], [SVK], [1756], [82], [FUJITA Yuki], [JPN], [1755], [83], [VACHOVCOVA Alena], [CZE], [1755], [84], [<NAME>], [JPN], [1755], [85], [<NAME>], [AUT], [1755], [86], [STEFANSKA Kinga], [POL], [1753], [87], [<NAME>], [RUS], [1751], [88], [<NAME>], [JPN], [1744], [89], [<NAME>], [GER], [1738], [90], [<NAME>], [SLO], [1730], [91], [<NAME>], [SWE], [1725], [92], [<NAME>], [JPN], [1724], [93], [<NAME>], [SLO], [1720], [94], [<NAME>], [JPN], [1720], [95], [<NAME>], [USA], [1715], [96], [<NAME>], [FRA], [1714], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (97 - 128)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [97], [MIAO Miao], [AUS], [1712], [98], [<NAME>], [UKR], [1710], [99], [<NAME>], [CRO], [1709], [100], [<NAME>], [HUN], [1707], [101], [<NAME>], [SWE], [1706], [102], [<NAME>], [IND], [1705], [103], [MIE Anne-Claire], [FRA], [1702], [104], [<NAME>], [KOR], [1699], [105], [KIM Mookyo], [KOR], [1699], [106], [<NAME>], [RUS], [1697], [107], [<NAME>], [USA], [1696], [108], [VOLAKAKI Archontoula], [GRE], [1690], [109], [COSTES Agathe], [FRA], [1689], [110], [<NAME>], [KOR], [1683], [111], [<NAME>-Christine], [CAN], [1683], [112], [WIGOW Susanna], [SWE], [1680], [113], [<NAME>], [RUS], [1679], [114], [<NAME>], [DEN], [1677], [115], [PIETKIEWICZ Monika], [POL], [1675], [116], [CADA Petra], [CAN], [1673], [117], [<NAME>], [FRA], [1667], [118], [#text(gray, "<NAME>")], [KOR], [1657], [119], [SU Hsien-Ching], [TPE], [1652], [120], [TAN Paey Fern], [SGP], [1652], [121], [#text(gray, "HAN Kwangsun")], [KOR], [1651], [122], [#text(gray, "TAKEDA Akiko")], [JPN], [1647], [123], [BAKULA Andrea], [CRO], [1643], [124], [<NAME>], [BUL], [1642], [125], [#text(gray, "<NAME>")], [SWE], [1638], [126], [<NAME>], [SWE], [1637], [127], [<NAME>], [KOR], [1635], [128], [<NAME>], [SRB], [1631], ) )
https://github.com/MrToWy/Bachelorarbeit
https://raw.githubusercontent.com/MrToWy/Bachelorarbeit/master/Code/endpointBefore.typ
typst
#import("../Template/customFunctions.typ"): * #codly(annotations:( ( start: 1, end: 14, label: <extractComplexFields> ), ( start: 20, end: 22, label: <connectResponsible> ), ( start: 45, end: 49, label: <clearModules2> ) ), highlights:( (line:12, label: <moduleData>), (line:18, label: <moduleData2>), (line:32, fill: green, label: <clearModules>), (line:65, fill: red, label: <upsert>), (line:60, fill: blue, label: <upsertFilter>), ) ) ```ts async updateModule(moduleDto: ModuleDto) { const { id, degreeProgramId, groupId, translations, subModules, responsibleId, requirementsHardId, requirementsSoftId, requirementsSoft: requirementsSoftNew, requirementsHard: requirementsHardNew, ...moduleData } = moduleDto; const updateArgs = { where: { id }, data: { ...moduleData, responsible: responsibleId ? { connect: { id: responsibleId } } : undefined, requirementsHard: { update: { requiredSemesters: requirementsHardNew.requiredSemesters, translations: { upsert: this.upsertTranslations(this.filterValidTranslations(requirementsHardNew.translations)) }, modules: { set: [], // remove all modules, before adding the new ones connect: requirementsHardNew.modules.map(module => ({ id: module.id })) } } }, requirementsSoft: { update: { requiredSemesters: requirementsSoftNew.requiredSemesters, translations: { upsert: this.upsertTranslations(this.filterValidTranslations(requirementsSoftNew.translations)) }, modules: { set: requirementsSoftNew.modules.map(module => ({ id: module.id })) } } }, ... } const createArgs = { ... }; const upsertArgs = { where: { id }, update: updateArgs.data, create: createArgs.data } const upsertedModule = await this.prisma.module.upsert(upsertArgs); } ```
https://github.com/elteammate/typst-compiler
https://raw.githubusercontent.com/elteammate/typst-compiler/main/src/ir-def.typ
typst
#import "utils.typ": * #let flags = mk_enum( debug: true, // do not remove "terminates_function" ) #let ir_instruction = mk_enum( debug: true, "const", "load", "load_addr", "store", "store_fast", "drop", "cast", "goto", "goto_if_not", "add", "sub", "mul", "div", "join", "move_param", "load_slot", "mk_function", "call_fast", "return_", ) #let mk_ir(res, instr, ty, ..args) = (res: res, instr: instr, ty: ty, args: args.pos()) #let mk_function() = ( locals: (:), code: (), labels: (:), params: (), stack_occupancy: (), slots: (:), return_ty: none )
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/fletcher/0.4.1/README.md
markdown
Apache License 2.0
# Fletcher [![Manual](https://img.shields.io/badge/docs-manual.pdf-green)](https://github.com/Jollywatt/typst-fletcher/raw/master/docs/manual.pdf) ![Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fgithub.com%2FJollywatt%2Farrow-diagrams%2Fraw%2Fmaster%2Ftypst.toml&query=package.version&label=version) [![Repo](https://img.shields.io/badge/GitHub-repo-blue)](https://github.com/Jollywatt/typst-fletcher) _**Fletcher** (noun) a maker of arrows_ A [Typst]("https://typst.app/") package for drawing diagrams with arrows, built on top of [CeTZ]("https://github.com/johannes-wolf/cetz"). ```typ #import "@preview/fletcher:0.4.1" as fletcher: node, edge ``` <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/Jollywatt/typst-fletcher/raw/master/docs/example-gallery/first-isomorphism-theorem-dark.svg"> <img src="https://github.com/Jollywatt/typst-fletcher/raw/master/docs/example-gallery/first-isomorphism-theorem-light.svg"> </picture> ```typ #fletcher.diagram(cell-size: 15mm, $ G edge(f, ->) edge("d", pi, ->>) & im(f) \ G slash ker(f) edge("ur", tilde(f), "hook-->") $) ``` <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/Jollywatt/typst-fletcher/raw/master/docs/example-gallery/flowchart-trap-dark.svg"> <img src="https://github.com/Jollywatt/typst-fletcher/raw/master/docs/example-gallery/flowchart-trap-light.svg"> </picture> ```typ // https://xkcd.com/1195/ #import fletcher.shapes: diamond #set text(font: "Comic Neue", weight: 600) #fletcher.diagram( edge-stroke: 1pt, node((0,0), [Start], corner-radius: 2pt, extrude: (0, 3)), edge("-|>"), node((0,1), align(center)[ Hey, wait,\ this flowchart\ is a trap! ], shape: diamond), edge("d,r,u,l", "-|>", [Yes], label-pos: 0.1) ) ``` <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/Jollywatt/typst-fletcher/raw/master/docs/example-gallery/state-machine-dark.svg"> <img src="https://github.com/Jollywatt/typst-fletcher/raw/master/docs/example-gallery/state-machine-light.svg"> </picture> ```typ #fletcher.diagram( node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), spacing: 4em, edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), node((0,0), `reading`, radius: 2em), edge(`read()`, "-|>"), node((1,0), `eof`, radius: 2em), edge(`close()`, "-|>"), node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)), edge((0,0), (0,0), `read()`, "--|>", bend: 130deg), edge((0,0), (2,0), `close()`, "-|>", bend: -40deg), ) ``` ## Todo/wishlist - [x] Mathematical arrow styles - [x] Also allow `&`-delimited equations for specifying nodes - [ ] Support CeTZ arrowheads - [x] Support arbitrary node shapes drawn with CeTZ - [ ] Allow referring to node coordinates by their content? - [ ] Support loops connecting a node to itself - [x] More ergonomic syntax to avoid repeating coordinates? - [x] Poly-edges with multiple segments - [ ] Add way to adjust edge connection points while still having them snap to node edges - [ ] Zig-zags and waves ## Change log ### 0.4.1 - Support custom node shapes! Edges connect to node outlines automatically. - New `shapes` submodule, containing `diamond`, `pill`, `parallelogram`, `hexagon`, and other node shapes. - Allow edges to have multiple segments. - Add `vertices` an `corner-radius` options to `edge()`. - Relative coordinate shorthands may be comma separated to signify multiple segments, e.g., `"r,u,ll"`. - Add `dodge` option to `edge()` to adjust end points. - Support `cetz:0.2.0`. ### 0.4.0 - Add ability to specify diagrams in math-mode, using `&` to separate nodes. - Allow implicit and relative edge coordinates, e.g., `edge("d")` becomes `edge(prev-node, (0, 1))`. - Add ability to place marks anywhere along an edge. Shorthands now accept an optional middle mark, for example `|->-|` and `hook-/->>`. - Add “hanging tail” correction to marks on curved edges. Marks now rotate a bit to fit more comfortably along tightly curving arcs. - Add more arrowheads for the sake of it: `}>`, `<{`, `/`, `\`, `x`, `X`, `*` (solid dot), `@` (solid circle). - Add `axes` option to `diagram()` to control the direction of each axis in the diagram's coordinate system. - Add `width`, `height` and `radius` options to `node()` for explicit control over size. - Add `corner-radius` option to `node()`. - Add `stroke` option to `edge()` replacing `thickness` and `paint` options. - Add `edge-stroke` option to `diagram()` replacing `edge-thickness`. ### 0.3.0 - Make round-style arrow heads better approximate the default math font. - Add solid arrow heads with shorthand `<|-`, `-|>` and double-bar `||-`, `-||`. - Add an `extrude` option to `node()` which duplicates and extrudes the node's stroke, enabling double stroke effects. ### 0.2.0 - Experimental support for customising arrowheads. - Add right-angled edges with `edge(..., corner: left/right)`.
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/syntaxes/textmate/tests/unit/bugs/tinymist-issue194.typ
typst
Apache License 2.0
$ x^"#" = "argmin"_(A x=b) ||x||_(cal(l)_2) $
https://github.com/felsenhower/kbs-typst
https://raw.githubusercontent.com/felsenhower/kbs-typst/master/examples/17.typ
typst
MIT License
#set text(font: "Comic Sans MS") #show heading: set text(fuchsia) = Einführung Mein erster Text mit Typst! #lorem(20)
https://github.com/Robotechnic/iridis
https://raw.githubusercontent.com/Robotechnic/iridis/master/README.md
markdown
MIT License
# iridis Iridis is a package to colorize parenthesis in your typst document. Iridis is a latin word that means "rainbow". This package is inspired by the many rainbow parenthesis plugins available for code editors. <!--EXCLUDE--> You can import the module with: ```typ #import "@preview/iridis:0.1.0": * ``` <!--END--> ## Usage The package provides a single show-rule `iridis-show` that can be used to colorize parenthesis in your document and a palette `iridis-palette` that can be used to define the colors used. The rule takes 3 arguments: - `opening-parenthesis`: The opening parenthesis character. Default is `("(", "[", "{")`. - `closing-parenthesis`: The closing parenthesis character. Default is `(")", "]", "}")`. - `palette`: The color palette to use. Default is `iridis-palette`. If the symbols are single characters, they are interpreted as normal strings but if you use multi-character strings, then they are interpreted as regular expressions. ## Exemples <!--EXAMPLE(code)--> ````typ #show: iridis.iridis-show ```rs fn main() { let n = false; if n { println!("Hello, world!"); } else { println!("Goodbye, world!"); } } ``` ```cpp #include <iostream> int main() { bool n = false; if (n) { std::cout << "Hello, world!" << std::endl; } else { std::cout << "Goodbye, world!" << std::endl; } } ``` ```py if __name__ == "__main__": n = False if n: print("Hello, world!") else: print("Goodbye, world!") ``` ```` ![code](https://raw.githubusercontent.com/Robotechnic/iridis/master/images/code1.png) <!--EXAMPLE(math)--> ````typ #show: iridis.iridis-show $ "plus" equiv lambda m. f lambda n. lambda f. lambda x. m f (n f x) \ "succ" equiv lambda n. lambda f. lambda x. f (n f x) \ "mult" equiv lambda m. lambda n. lambda f. lambda x. m (n f) x \ "pred" equiv lambda n. lambda f. lambda x. n (lambda g. lambda h. h (g f)) (lambda u. x) (lambda u. u) \ "zero" equiv lambda f. lambda x. x \ "one" equiv lambda f. lambda x. f x \ "two" equiv lambda f. lambda x. f (f x) \ "three" equiv lambda f. lambda x. f (f (f x)) \ "four" equiv lambda f. lambda x. f (f (f (f x))) \ $ $ (((1 + 5) * 7) / (5 - 8 * 7) + 3) * 2 approx 4.352941176 $ $ mat( 1, 2, ..., (10 / 2); 2, 2, ..., 10; dots.v, dots.v, dots.down, dots.v; 10, (10 - (5 * 8)) / 2, ..., 10; ) $ ```` ![math](https://raw.githubusercontent.com/Robotechnic/iridis/master/images/math1.png) ## Changelog ### 0.1.0 - Initial release
https://github.com/cwreed/cv
https://raw.githubusercontent.com/cwreed/cv/main/src/modules/education.typ
typst
#import "../template.typ": cvEntry, colors #let nyu-resume = cvEntry( title: [Master of Science, Data Science], institution: [New York University], date: [2020 -- 2022], location: [New York, NY], description: [], ) #let yale-resume = cvEntry( title: [Bachelor of Science, Environmental Studies _with distinction_, _cum laude_], institution: [Yale University], date: [2015 -- 2019], location: [New Haven, CT], description: list( [_Thesis title_: Engaging open-source precision viticulture to manage spatial heterogeneity and improve cover-cropping practice on an organic vineyard (#link("https://evst.yale.edu/node/36310")[Abstract])], ), ) #let sfs-bhutan = cvEntry( title: [Study Abroad], institution: [School for Field Studies \// #linebreak()Ugyen Wangchuck Institute for Conservation and Environmental Research], date: [June -- July 2017], location: [Bumthang District, Bhutan], description: list( [Completed coursework on Himalayan forest ecology, rural livelihoods, and Bhutanese culture], [Conducted ethnographic field research on agricultural knowledge transfer in the village of Ura and presented findings to government stakeholders], ), )
https://github.com/Mc-Zen/tidy
https://raw.githubusercontent.com/Mc-Zen/tidy/main/docs/tidy-guide.typ
typst
MIT License
#import "template.typ": * #import "/src/tidy.typ" #include "/tests/test_tidy.typ" // ensure that tests pass #let version = toml("/typst.toml").package.version #let import-statement = "#import \"@preview/tidy:" + version + "\"" #show: project.with( title: "Tidy", subtitle: "Keep your code tidy.", authors: ( "Mc-Zen", ), abstract: [ *tidy* is a package that generates documentation directly in #link("https://typst.app/", [Typst]) for your Typst modules. It parses docstring comments similar to javadoc and co. and can be used to easily build a reference section for each module. ], date: datetime.today().display("[month repr:long] [day], [year]"), version: version, url: "https://github.com/Mc-Zen/tidy" ) #pad(x: 10%, outline(depth: 1)) #pagebreak() = Introduction You can easily feed *tidy* your in-code documented source files and get beautiful documentation of all your functions and variables printed out. // Enjoy features like type annotations, links to other documented definitions and arbitrary formatting within function and parameter descriptions. Let's get started. The main features are: - Type annotations, - Seamless cross references, - Rendering code examples (see @preview-examples), - help command generation (see @help-command), and - Docstring testing (see @docstring-testing). First, we import *tidy*. #raw(block: true, lang: "typ", import-statement) We now assume we have a Typst module called `repeater.typ`, containing a definition for a function named `repeat()`. // *Example of some documented source code:* #let example-code = read("/examples/repeater.typ") #file-code("repeater.typ", raw(block: true, lang: "typ", example-code)) A *function* is documented similar to javadoc by prepending a block of `///` comments. Each line needs to start with three slashes `///` (whitespace is allowed at the beginning of the line). _Parameters_ of the function can be documented by listing them as #show raw.where(lang: "markspace"): it => { show " ": box(inset: (x: 0.1pt), box( fill: red.lighten(70%), width: .7em, height: .8em, radius: 1pt, outset: (bottom: 3pt, top: 1pt), )) it } ```markspace /// - parameter-name (type): ... ``` Following this exact form is important (see also the spaces marked in red) since this allows to distinguish the parameter list from ordinary markup lists in the function description or in parameter descriptions. For example, another space in front of the `-` could be added to markup lists if necessary. The possible types for each parameter are given in parentheses and after a colon `:`, the parameter description follows. Indicating a type is mandatory (you may want to pick `any` in some cases). An optional _return type_ can be annotated by ending with a line that contains `->` followed by the return type(s). In front of the parameter list, a _function description_ can be put. Both function and parameter descriptions may span multiple lines and can contain any Typst code (see @user-defined-symbols on how to use images, user-defined variables and functions in the docstring). *Variables* are documented just in the same way (lacking the option to specify parameters). A definition is recognized as a variable if the identifier (variable/function name) is not followed by an opening parenthesis. The `->` syntax which also specifies the return type for functions can be used to define the type of a variable. Calling #ref-fn("parse-module()") will read out the documentation of the given string. We can then invoke #ref-fn("show-module()") on the result. ```typ #let docs = tidy.parse-module(read("docs.typ"), name: "Repeater") #tidy.show-module(docs) ``` This will produce the following output. #tidy-output-figure( tidy.show-module(tidy.parse-module(example-code, name: "Repeater"), style: tidy.styles.default) ) Cool, he? By default, an outline for all definitions is displayed at the top. This behaviour can be turned off with the parameter `show-outline` of #ref-fn("show-module()"). There is another nice little feature: in the docstring, you can cross-reference other definitions with the extra syntax `@@repeat()` or `@@awful-pi`. This will automatically create a link that when clicked in the PDF will lead you to the documentation of that definition. Of course, everything happens instantaneously, so you can see the live result while writing the docs for your package. Keep your code documented! = More options Sometimes you want to document "private" functions and variables but omit them in the public documentation. In order to hide all definitions starting with an underscore, you may set `omit-private-definitions` to `true` in the call to #ref-fn("show-module()"). Similarly, "implementation parameters" to otherwise public functions occur once in a while. These are then used internally by the library. In order to conceal such parameters which may lead to confusion with dedicated documentation readers, you can name them with a leading underscore and set `omit-private-parameters` to `true` as well. #pagebreak() = Accessing user-defined symbols <user-defined-symbols> This package uses the Typst function #raw(lang: "typc", "eval()") to process function and parameter descriptions in order to enable arbitrary Typst markup within those. Since #raw(lang: "typc", "eval()") does not allow access to the filesystem and evaluates the content in a context where no user-defined variables or functions are available, it is not possible to directly call #raw(lang: "typ", "#import"), #raw(lang: "typ", "#image") or functions that you define in your code. Nevertheless, definitions can be made accessible with *tidy* by passing them to #ref-fn("parse-module()") through the optional `scope` parameter in form of a dictionary: ```typ #let make-square(width) = rect(width: width, height: width) #tidy.parse-module( read("my-module.typ"), scope: (make-square: make-square) ) ``` This makes any symbol in specified in the `scope` dictionary available under the name of the key. A function declared in `my-module.typ` can now use this variable in the description: ```typ /// This is a function /// #make-square(20pt) #let my-function() = {} ``` It is even possible to add *entire modules* to the scope which makes rendering examples using your module really easy. Let us say the file `wiggly.typ` contains: #file-code("wiggly.typ", raw(lang: "typ", block: true, read("/examples/wiggly.typ"))) #pagebreak() Note, that we use the predefined function `example()` here to show the code as well as the rendered output of some demo usage of our function. The `example()` function is treated more in-detail in @preview-examples. We can now parse the module and pass the module `wiggly` through the `scope` parameter. Furthermore, we apply another trick: by specifying a `preamble`, we can add code to run before each example. Here we use this feature to import everything from the module `wiggly`. This way, we can directly write `draw-sine(...)` in the example (instead of `wiggly.draw-sine(...)`): ```typ #import "wiggly.typ" // don't import something specific from the module! #let docs = tidy.parse-module( read("wiggly.typ"), name: "wiggly", scope: (wiggly: wiggly), preamble: "import wiggly: *;" ) ``` In the output, the preview of the code examples is shown next to it. #{ import "/examples/wiggly.typ" let module = tidy.parse-module( read("/examples/wiggly.typ"), name: "wiggly", scope: (wiggly: wiggly), preamble: "import wiggly: draw-sine;" ) tidy-output-figure(tidy.show-module(module, show-outline: false)) } #pagebreak() = Preview examples <preview-examples> As we saw in the previous section, it is possible with *tidy* to add examples to a docstring and preview it along with its output. The function `example()` is available in every docstring and has some bells and whistles which are showcased with the following `example-demo.typ` module which contains a function for highlighting text with gradients (seems not very advisable due to the poor readability): // #file-code("example-demo.typ", raw(lang: "typ", block: true, read("/examples/example-demo.typ"))) #{ set text(size: .89em) import "/examples/example-demo.typ" let module = tidy.parse-module( read("/examples/example-demo.typ"), scope: (example-demo: example-demo) ) tidy-output-figure(tidy.show-module(module, show-outline: false, break-param-descriptions: true)) } = Customizing the style There are multiple ways to customize the output style. You can - pick a different predefined style, - apply show rules before printing the module documentation or - create an entirely new style. A different predefined style can be selected by passing a style to the `style` parameter: ```typ #tidy.show-module( tidy.parse-module(read("my-module.typ")), style: tidy.styles.minimal ) ``` You can use show rules to customize the document style before calling #ref-fn("show-module()"). Setting any text and paragraph attributes works just out of the box. Furthermore, heading styles can be set to affect the appearance of the module name (relative heading level 1), function or variable names (relative heading level 2) and the word *Parameters* (relative heading level 3), all relative to what is set with the parameter `first-heading-level` of #ref-fn("show-module()"). Finally, if that is not enough, you can design a completely new style. Examples of styles can be found in the folder `src/styles/` in the #link("https://github.com/Mc-Zen/tidy", "GitHub Repository"). == Customizing Colors (mainly for the `default` style) The colors used by a style (especially the color in which types are shown) can be set through the option `colors` of #ref-fn("show-module()"). It expects a dictionary with colors as values. Possible keys are all type names as well as `signature-func-name` which sets the color of the function name as shown in a function signature. The `default` theme defines a color scheme `colors-dark` along with the default `colors` which adjusts the plain colors for better readability on a dark background. ```typ #tidy.show-module( docs, colors: tidy.styles.default.colors-dark ) ``` With a dark background and light text, these colors produce much better contrast than the default colors: #{ set box(fill: luma(20)) set text(fill: luma(240)) let module = tidy.parse-module( ``` /// Produces space. /// - amount (length): #let space(amount) ```.text ) tidy-output-figure(tidy.show-module(module, show-outline: false, colors: tidy.styles.default.colors-dark, style: tidy.styles.default)) } #pagebreak() == Predefined styles Currently, the two predefined styles `tidy.styles.default` and `tidy-styles.minimal` are available. - `tidy.styles.default`: Loosely imitates the online documentation of Typst functions. - `tidy.styles.minimal`: A very light and space-efficient theme that is oriented around simplicity. With this theme, the example from above looks like the following: #{ import "/examples/wiggly.typ" let module = tidy.parse-module( read("/examples/wiggly.typ"), name: "wiggly", scope: (wiggly: wiggly), preamble: "import wiggly: *;" ) tidy-output-figure(tidy.show-module(module, show-outline: false, style: tidy.styles.minimal)) } #pagebreak() = Help command <help-command> #text(red)[This feature is still experimental and may change a bit in its details. Output customization will be made available with the introduction of user-defined types into Typst. The _search_ feature will then move into a nested function, i.e., `help.search()`. ] With *tidy*, you can easily add a `help` command to your package. This allows the users of your package to call #raw(lang: "typ", "#your-package.help(\"foo\")") to get the docs for the specified definition printed right in their document. This makes reading up on options and discovering features in your package effortless. After the desired information has been gathered, it's no more than deleting a line of document source code to make the docs vanish into the hidden realms of repositories once again! As a demonstration, calling #raw(lang: "typ", "#tidy.help(\"parse-module\")") produces the following (clipped) output into the document. #{ set text(size: .8em) pad(x: 5%, box( height: 170pt, clip: true, box( height: 180pt, clip: true, box(tidy.help("parse-module")) ) ) ) } /* The feature that will make using *your* package attractive. Without leaving the editor The usage and ease of access for typst packages is about to be revolutionized! */ This feature supports: - function and variable definitions, - definitions defined in nested submodules, e.g., \ #raw(lang: "typ", "#your-package.help(\"sub.bar.foo\")") - asking only for the parameter description of a function, e.g., \ #raw(lang: "typ", "#your-package.help(\"foo(param1)\")") - lazy evaluation of docstring processing (even loading `tidy` is made lazy). \ _Don't pay for what you don't use!_ - search through the entire package documentation, e.g., \ #raw(lang: "typ", "#your-package.help(search: \"module\")") == Setup If you have already documented your code, adding such a help function will require only little further effort in implementation. In your root library file, add some code of the following kind: #raw(block: true, lang: "typ", ``` #let help(..args) = { ```.text + "\n " + import-statement.slice(1) + "\n" + ``` let namespace = ( ".": read.with("/src/my-package.typ") ) tidy.generate-help(namespace: namespace, package-name: "tidy")(..args) } ```.text) First, we set up a `namespace` dictionary that reflects the way that definitions can be accessed by a user. Note that due to import statements that import _from_ a file, this may not reflect the actual file structure of your repository. Take care to provide `read.with()` objects with the filename prepended instead of directly calling `read()`. This allows *tidy* to only lazily read the source files upon a help request from the end user. As a more elaborate example, let us look at some library root file for a maths package called `heymath`. #file-code("heymath.typ", ```typ #import "vec.typ": vec-add, vec-subtract // import definitions into root #import "matrix.typ" // submodule "matrix" /// ... #let pi-squared = 9.86960440108935861883 ```) Our `namespace` dictionary could then look like this: ```typc let namespace = ( ".": (read.with("/heymath.typ"), read.with("/vec.typ")) "matrix": read.with("/matrix.typ") "matrix.solve": read.with("/solve.typ") ) ``` Since the symbols from `vec.typ` are imported directly into the library (and are accessible through `heymath.vec-add()` and `heymath.vec-subtract()`), we add this file to the root together with the main library file. Both files will be internally concatenated for docstring processing. The content of `matrix.typ`, however, can only be accessed through `heymath.matrix.` (by the user) and so we place `matrix.typ` at the key `matrix`. For nested submodules, write out the complete name "path" for the key. As an example, we have added `matrix.solve` -- a module that would be imported within `matrix.typ` -- to the code sample above. *It is advised not to change the signature of the help function manually in order to keep consistency between different packages using this features*. == Searching It is also possible to search the package documentation via the search argument of the help function: \ #raw(lang: "typ", "#tidy.help(search: \"module\")"). This feature is even more experimental. #{ set text(size: .8em) pad(x: 5%, box( height: 170pt, clip: true, box( height: 180pt, clip: true, box(tidy.help(search: "module")) ) ) ) } == Output customization (for end-users) The default style for help output should work more or less for light and dark documents but is otherwise not very customizable. This is intended to be changed when user-defined types are available in Typst because these would provide the ideal interface for such customization. Until then, I do not deem it much sense to provide a temporary solution that need. == Notes about optimization (for package developers) When set up in the form as shown above, the package `tidy` is only imported when a user calls `help` for the first time and not at all if the feature is not used _(don't pay for what you don't use)_. The files themselves are also only read when a definition from a specific submodule in the "namespace" is requested. In the case of _extremely_ long code files, it _could_ make sense to separate the documentation from the implementation by adding "documentation files" that only contain a _declaration_ plus docstring for each definition -- with the body left empty. ```typ /// - inputs (array): The inputs for the algorithm. /// - parameters (none, dictionary): Some parameters. #let my-really-long-algorithm(inputs, parameters: none) = { } ``` The advantage is that the source code is not as crowded with (sometimes very long) docstrings and that docstring parsing may get faster. On the downside, there is an increased maintenance overhead due to the need of synchronizing the actual file and the documentation file (especially when the interface of a function changes). #pagebreak() = Docstring testing <docstring-testing> Tidy supports small-scale docstring tests that are executed automatically and throw appropriate error messages when a test fails. In every docstring, the function #raw(lang: "typc", "test(..tests, scope: (:))") is available. An arbitrary number of tests can be passed in and the evaluation scope may be extended through the `scope` parameter. Any definition exposed to the docstring evaluation context through the `scope` parameter passed to #ref-fn("parse-module()") (see @user-defined-symbols) is also accessible in the tests. Let us create a module `num.typ` with the following content: ```typ /// #test( /// `num.my-square(2) == 4`, /// `num.my-square(4) == 16`, /// ) #let my-square(n) = n * n ``` Parsing and showing the module will run the docstring tests. ```typ #import "num.typ" #let module = tidy.parse-module( read("num.typ"), name: "num", scope: (num: num) ) #tidy.show-module(module) // tests are run here ``` As alternative to using `test()`, the following dedicated shorthand syntax can be used: ```typ /// >>> my-square(2) == 4 /// >>> my-square(4) == 16 #let my-square(n) = n * n ``` When using the shorthand syntax, the error message even shows the line number of the failed test in the corresponding module. A few test assertion functions are available to improve readability, simplicity and error messages. Currently, these are `eq(a, b)` for equality tests, `ne(a, b)` for inequality tests and `approx(a, b, eps: 1e-10)` for floating point comparisons. These assertion helper functions are always available within docstring tests (with both `test()` and `>>>` syntax). Docstring tests can be disabled by passing `enable-tests: false` to #ref-fn("show-module()"). #pagebreak() = Function documentation Let us now "self-document" this package: #let style = tidy.styles.default #{ set heading(numbering: none) set text(size: 9pt) let module = tidy.parse-module( ( read("/src/parse-module.typ"), read("/src/show-module.typ"), read("/src/helping.typ") ).join("\n"), name: "tidy", require-all-parameters: true ) tidy.show-module( module, style: style, show-outline: true, sort-functions: false, omit-private-parameters: true, omit-private-definitions: true ) }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/numblex/0.1.0/lib/circle_numbers.typ
typst
Apache License 2.0
/// Circled numbers /// - `n`: integer /// - returns: circled number like ① #let circle_numbers(n) = { return "①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿".at(n - 1) }
https://github.com/mrtz-j/typst-thesis-template
https://raw.githubusercontent.com/mrtz-j/typst-thesis-template/main/template/chapters/introduction.typ
typst
MIT License
#import "global.typ": * #import "../utils/symbols.typ": * This typst template is intended for use by UiT students to write their Bachelor's or Master's thesis, or any other document requiring a similar format. Although it meets the official requirements set by the UiT, this template is *unofficial*, and students should verify with their supervisor whether it can be used to typeset the thesis or not. The styling and layout for this thesis template has been largely inspired by <NAME>'s #LaTeX template. #footnote[see #link("https://github.com/egraff/uit-thesis")] In addition to demonstrating how this template will typeset your content, this document is meant to serve as a helpful reference for how to use its features. The remaining chapters will present a number of useful examples and should be useful for users regardless of their experience with typst.
https://github.com/RaphGL/ElectronicsFromBasics
https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/DC/chap4/1_scientific_notation.typ
typst
Other
=== Scientific notation In many disciplines of science and engineering, very large and very small numerical quantities must be managed. Some of these quantities are mind-boggling in their size, either extremely small or extremely large. Take for example the mass of a proton, one of the constituent particles of an atom\'s nucleus: $ "Proton mass" = 0.00000000000000000000000167 "grams" $ Or, consider the number of electrons passing by a point in a circuit every second with a steady electric current of 1 amp: $ 1 "amp" = 6,250,000,000,000,000,000 "electrons per second" $ A lot of zeros, isn\'t it? Obviously, it can get quite confusing to have to handle so many zero digits in numbers such as this, even with the help of calculators and computers. Take note of those two numbers and of the relative sparsity of non-zero digits in them. For the mass of the proton, all we have is a \"167\" preceded by 23 zeros before the decimal point. For the number of electrons per second in 1 amp, we have \"625\" followed by 16 zeros. We call the span of non-zero digits (from first to last), plus any zero digits #emph[not] merely used for placeholding, the \"significant digits\" of any number. The significant digits in a real-world measurement are typically reflective of the accuracy of that measurement. For example, if we were to say that a car weighs 3,000 pounds, we probably don\'t mean that the car in question weighs #emph[exactly] 3,000 pounds, but that we\'ve rounded its weight to a value more convenient to say and remember. That rounded figure of 3,000 has only one significant digit: the \"3\" in front -- the zeros merely serve as placeholders. However, if we were to say that the car weighed 3,005 pounds, the fact that the weight is not rounded to the nearest thousand pounds tells us that the two zeros in the middle aren\'t just placeholders, but that all four digits of the number \"3,005\" are significant to its representative accuracy. Thus, the number \"3,005\" is said to have #emph[four] significant figures. In like manner, numbers with many zero digits are not necessarily representative of a real-world quantity all the way to the decimal point. When this is known to be the case, such a number can be written in a kind of mathematical \"shorthand\" to make it easier to deal with. This \"shorthand\" is called #emph[scientific notation]. With scientific notation, a number is written by representing its significant digits as a quantity between 1 and 10 (or -1 and -10, for negative numbers), and the \"placeholder\" zeros are accounted for by a power-of-ten multiplier. For example: $ 1 "amp" &= 6,250,000,000,000,000,000 "electrons per second" \ &"... can be expressed as ..." \ 1 "amp" &= 6.25 x 10^18 "electrons per second" $ 10 to the 18th power ($10^18$) means 10 multiplied by itself 18 times, or a \"1\" followed by 18 zeros. Multiplied by 6.25, it looks like \"625\" followed by 16 zeros (take 6.25 and skip the decimal point 18 places to the right). The advantages of scientific notation are obvious: the number isn\'t as unwieldy when written on paper, and the significant digits are plain to identify. But what about very small numbers, like the mass of the proton in grams? We can still use scientific notation, except with a negative power-of-ten instead of a positive one, to shift the decimal point to the left instead of to the right: $ "Proton mass" &= 0.00000000000000000000000167 "grams" \ &"... can be expressed as ..." \ "Proton mass" &= 1.67 x 10^-24 "grams" $ 10 to the -24th power ($10^-24$) means the inverse ($1/x$) of 10 multiplied by itself 24 times, or a \"1\" preceded by a decimal point and 23 zeros. Multiplied by 1.67, it looks like \"167\" preceded by a decimal point and 23 zeros. Just as in the case with the very large number, it is a lot easier for a human being to deal with this \"shorthand\" notation. As with the prior case, the significant digits in this quantity are clearly expressed. Because the significant digits are represented \"on their own,\" away from the power-of-ten multiplier, it is easy to show a level of precision even when the number looks round. Taking our 3,000 pound car example, we could express the rounded number of 3,000 in scientific notation as such: $ "car weight" = 3 times 10^3 "pounds" $ If the car actually weighed 3,005 pounds (accurate to the nearest pound) and we wanted to be able to express that full accuracy of measurement, the scientific notation figure could be written like this: $ "car weight" = 3.005 times 10^3 "pounds" $ However, what if the car actually did weigh 3,000 pounds, exactly (to the nearest pound)? If we were to write its weight in \"normal\" form (3,000 lbs), it wouldn\'t necessarily be clear that this number was indeed accurate to the nearest pound and not just rounded to the nearest thousand pounds, or to the nearest hundred pounds, or to the nearest ten pounds. Scientific notation, on the other hand, allows us to show that all four digits are significant with no misunderstanding: $ "car weight" = 3.000 times 10^3 "pounds" $ Since there would be no point in adding extra zeros to the right of the decimal point (placeholding zeros being unnecessary with scientific notation), we know those zeros #emph[must] be significant to the precision of the figure.
https://github.com/DrakeAxelrod/cvss.typ
https://raw.githubusercontent.com/DrakeAxelrod/cvss.typ/main/bak/cvss.typ
typst
MIT License
#let _cvss = plugin("cvss.wasm") #str(_cvss.cvss(bytes("CVSS:2.0/AV:N/AC:L/Au:N/C:P/I:P/A:P"))) #str(_cvss.cvss(bytes("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"))) #str(_cvss.cvss(bytes("CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H"))) #str(_cvss.cvss(bytes("CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"))) // #let cvss = ( // vector: "CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N", // calc: (v) => float(str(_cvss.cvss(bytes(v)))), // ) // #(cvss.calc)("CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N") #let cvss40 = ( re: { let header = "CVSS\:4\.0" let av = "[\/]?(AV\:[N|A|L|P])?" let ac = "[\/]?(AC\:[L|H])" let at = "[\/]?(AT\:[N|P])?" let pr = "[\/]?(PR\:[N|L|H])?" let ui = "[\/]?(UI\:[N|R|A])?" // Vulnerable System Impact Metrics let vc = "[\/]?(VC\:[N|L|H])?" let vi = "[\/]?(VI\:[N|L|H])?" let va = "[\/]?(VA\:[N|L|H])?" // Subsequent System Impact Metrics let sc = "[\/]?(SC\:[N|L|H])?" let si = "[\/]?(SI\:[N|L|H])?" let sa = "[\/]?(SA\:[N|L|H])?" // Supplemental Metrics let s = "[\/]?(S\:[X|N|P])?" let au = "[\/]?(AU\:[X|N|Y])?" let r = "[\/]?(R\:[X|A|U|I])?" let v = "[\/]?(V\:[X|D|C])?" let re = "[\/]?(V\:[X|L|M|H])?" let u = "[\/]?(U\:[X|Clear|Green|Amber|Red])?" let metric = "[\/]([A-Z]{1,3})\:" // regex("CVSS\:4\.0[\/]?(AV\:[N|A|L|P])?[\/](AC\:[L|H])") regex(header + metric) } ) #let cvss31 = ( re: regex("CVSS:3.1/AV:(N|A|L|P)/AC:(L|H)/PR:(N|L|H)/UI:(N|R|A)/S:(U|C)/C:(N|L|H)/I:(N|L|H)/A:(N|L|H)"), ) #let cvss30 = ( re: regex("CVSS:3.0/AV:(N|A|L|P)/AC:(L|H)/PR:(N|L|H)/UI:(N|R|A)/S:(U|C)/C:(N|L|H)/I:(N|L|H)/A:(N|L|H)"), ) #let cvss20 = ( re: regex("CVSS:2.0/AV:(N|A|L|P)/AC:(L|H)/Au:(N|S|M)/C:(N|P|C)/I:(N|P|C)/A:(N|P|C)"), ) #let verify( // re, vector, ) = { // if vector.starts_with("CVSS:4.0") { // let re = cvss40.re; // re.match(vector) // } vector = upper(vector) .replace("CLEAR", "Clear") .replace("GREEN", "Green") .replace("AMBER", "Amber") .replace("RED", "Red") if vector.starts-with("CVSS:4.0") { let re = cvss40.re; vector.matches(re) } } #verify("CVSS:4.0/AV:None/AC:H/AT:P/PR:H/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N")
https://github.com/CreakZ/mirea-algorithms
https://raw.githubusercontent.com/CreakZ/mirea-algorithms/master/reports/title_page_template.typ
typst
#let title_page(work_num, theme) = { set par(justify: false) align( center, [ #image("mirea.png") #text(size: 10pt, [ МИНИСТЕРСТВО НАУКИ И ВЫСШЕГО ОБРАЗОВАНИЯ РОССИЙСКОЙ ФЕДЕРАЦИИ ]) #text([ Федеральное государственное бюджетное образовательное учреждение высшего образования ]) #text([ *"МИРЭА - Российский технологический университет"* ]) #text(size: 18pt, [ *РТУ МИРЭА* ]) #stack( spacing: 0.15em, line(length: 100%, stroke: 0.5pt), line(length: 100%, stroke: 0.5pt), ) #stack( dir: ttb, spacing: .6em, text([Институт информационных технологий (ИТ)]), text([Кафедра математического обеспечения и стандартизации информационных технологий (МОСИТ)]) ) #block( above: 3em, below: 5em, [ #stack( dir: ttb, spacing: .6em, text( size: 14pt, [ *ОТЧЕТ ПО ПРАКТИЧЕСКОЙ РАБОТЕ №#work_num* ] ), text( size: 14pt, [ *по дисциплине* ] ), text( size: 14pt, [ *«Структуры и алгоритмы обработки данных»* ] ) ) #text( size: 14pt, [ Тема «#theme» ] ) ] ) #grid([ #text( size: 12pt, [ #v(1fr) #h(30%) Выполнил студент группы ИКБО-50-23 #h(1fr) Русаков М.Ю. ]) #text( size: 12pt, [ #h(30%) Принял старший преподаватель #h(1fr) Скворцова Л.А. #v(4fr) ]) #text([ Москва #datetime.today().year() ]) ]) #pagebreak() ]) }
https://github.com/SeniorMars/tree-sitter-typst
https://raw.githubusercontent.com/SeniorMars/tree-sitter-typst/main/examples/layout/par-justify.typ
typst
MIT License
--- #set page(width: 180pt) #set block(spacing: 5pt) #set par(justify: true, first-line-indent: 14pt, leading: 5pt) This text is justified, meaning that spaces are stretched so that the text forms a "block" with flush edges at both sides. First line indents and hyphenation play nicely with justified text. --- // Test that lines with hard breaks aren't justified. #set par(justify: true) A B C \ D --- // Test forced justification with justified break. A B C #linebreak(justify: true) D E F #linebreak(justify: true) --- // Test that justificating chinese text is at least a bit sensible. #set page(width: 200pt) #set par(justify: true) 中文维基百科使用汉字书写,汉字是汉族或华人的共同文字,是中国大陆、新加坡、马来西亚、台湾、香港、澳门的唯一官方文字或官方文字之一。25.9%,而美国和荷兰则分別占13.7%及8.2%。近年來,中国大陆地区的维基百科编辑者正在迅速增加; --- // Test that there are no hick-ups with justification enabled and // basically empty paragraph. #set par(justify: true) #""
https://github.com/chamik/gympl-skripta
https://raw.githubusercontent.com/chamik/gympl-skripta/main/cj-dila/19-edison.typ
typst
Creative Commons Attribution Share Alike 4.0 International
#import "/helper.typ": dilo, poezie #dilo("Edison", "edison", "<NAME>", "", "1. p. 20. st.; poetismus", "ČSR", "1928", "lyricko-epický", "báseň") #columns(2, gutter: 1em)[ *Téma*\ podstata a význam vynálezce Thomase Alvy Edisona *Motivy*\ smysl tvorby, života, smrti a života; sebevrazi, hazardní hráči, prostitutky $times$ úspěšný vynálezce *Časoprostor*\ přelom 19.--20. st. za života Edisona; toulky Prahou *Postavy*\ _lyrický subjekt_ -- vypravěč, záporná postava, v kontrastu s Edisonem, neúspěšný prázdný život, hazardní hráč\ _Edison_ -- symbol, zástupce pokroku techniky, podnikatel, kladná postava *Kompozice*\ 5 zpěvů, bez interpunkce, ich-forma z pohledu básníka *Vypravěč*\ lyrický subjekt, nejspíš znázorňuje autora *Jazykové prostředky*\ refrén (variace končící "z života i smrti"), anafory (opakování na začátku verše; "piják", "hleď", "proč"), termíny ("s kyselinou solnou", "s cívkou rumkorfu"), nepoužívá se interpunkce (viz ukázka) #colbreak() *Obsah*\ 1. zpěv: toulky Prahou, most přes Vltavu, potká sebevraha, uvědomí si, že to je on 2. zpěv: o Edisonovi, jak roznášel noviny, zachránil život malému chlapci a odstěhoval se do New Yorku; subjekt vzpomíná na své dětství a otce 3. zpěv: popis Edisonových vynálezů, oslava pokroku a techniky, žárovka a telefon 4. zpěv: vrchol básně; o smyslu života, největší štěstí je z objevů, 5. zpěv: zpět v Praze, pohled z balkonu na rozsvícené město; probuzení ze spánku *Literárně historický kontext*\ <NAME> (1847--1931) v době vydání žil. Vystřízlivění z euforie po založení ČSR. Rozvoj techniky, změna životního stylu. ] #pagebreak() #show: poezie *Ukázka -- II.* Naše životy jsou strmé jako vrak\ jednou kvečeru se vracel rychlovlak\ mezi Kanadou a mezi Michiganem\ soutěskami které neznám jejich jménem\ po plošině kráčel malý průvodčí\ s čapkou nasazenou těsně do očí\ bylo tu však něco krásného co drtí\ odvaha a radost z života i smrti Jeho otec krejčí švec a drvoštěp\ kupec s obilím měl chatrč půdu sklep\ a věčnou nestálost jež k potulkám nás svádí\ zemřel touhou po vlasti a smutkem mládí Tatíku tys věděl co je věčný stesk\ dnes je z tebe popel hvězda nebo blesk\ tatíku tys věděl že jsou všude hrubci\ mezi krejčími i mezi dřevorubci\ ty jsi poznal co jsou potulky a hlad\ chtěl bych zemřít jak ty také zdráv a mlád\ avšak je tu cosi těžkého co drtí\ smutek stesk a úzkost z života i smrti Nevím kde a máš-li jaký náhrobek\ ze tvé krve zbyl tu malý pohrobek\ hleď už slabikuje v Kanadě tvé knihy\ hleď už těší se jak půjde na dostihy\ hleď už čítá slavné životopisy\ encyklopedii staré eposy\ hleď už vyrostl hleď čas tak rychle míjí\ hleď už nehrá si čta knížky o chemii [...] #pagebreak()
https://github.com/VZkxr/Typst
https://raw.githubusercontent.com/VZkxr/Typst/master/Seminario/Preliminares/pre.typ
typst
#set page(header: [ Preliminares #h(1fr) Demo 3]) #highlight(fill: rgb("#FF75B5"), radius: 8pt, stroke: black, extent: 3pt)[Definición 1] #h(2pt) (Espacio muestral). Consideremos un experimento aleatorio. El conjunto de posibles resultados de ese experimento se conoce como #text(fill: rgb("#B10040"))[espacio muestral.] Ejemplo: El espacio muestral del lanzamiento de 2 tetraedros está definido por #set math.mat(delim: "{") $ Omega = mat( (1,1)\,(1,2)\,(1,3)\,(1,4); (2,1)\,(2,2)\,(2,3)\,(2,4); (3,1)\,(3,2)\,(3,3)\,(3,4); (4,1)\,(4,2)\,(4,3)\,(4,4); ) $ donde $(i,j)$ representa el registro de que haya caído $i$ en el primer tetraedro y $j$ en el segundo tetraedro, con $i,j = 1,2,3,4$. #highlight(fill: rgb("#FF75B5"), radius: 8pt, stroke: black, extent: 3pt)[Definición 2] #h(2pt) (Principio de conteo). Si $Omega$ es un espacio muestral finito y $A subset.eq Omega$, entonces $ P(A) = frac(\# text("de casos favorables") (A), \# text("de casos totales") (Omega)) $ Ejemplo 1.1: Para obtener la probabilidad de obtener un 2 en un dado, primero obtenemos el espacio muestral $Omega$ y el evento de nuestros casos favorables $A$, entonces $ Omega &= {1,2,3,4,5,6} \ A &= {2} $ Así, $ P(A) = frac(\# text("de casos favorables") (A), \# text("de casos totales") (Omega)) = frac(1, 6) $ Por lo tanto, la probabilidad de obtener un 2 en un dado es de $1/6$. #highlight(fill: rgb("#FF75B5"), radius: 8pt, stroke: black, extent: 3pt)[Definición 3] #h(2pt) (Variable Aleatoria). Es una función cuyo dominio es el espacio muestral y su imágen son los $RR$, es decir, $X: Omega arrow.r.long RR$ y satisface $ {w in Omega divides X(w) lt.eq x} in cal(F) #h(.5cm) forall x in RR $ donde $cal(F)$ es una familia de eventos $(A,B,C,...)$. Ejemplo: En términos más simples, una variable aleatoria es una función que asigna un valor, usualmente numérico, al resultado de un experimento aleatorio, por decir, los posibles resultados de tirar dos tetraedros. #highlight(fill: rgb("#FF75B5"), radius: 8pt, stroke: black, extent: 3pt)[Definición 4] #h(2pt) (Función de densidad). Sea $(Omega, cal(F), P)$ un espacio de probabilidad y $X: Omega arrow.r.long RR$ una variable aleatoria discreta. A la función $ f_X (x)=P[{cal(w) in Omega divides X(cal(w))=x}]=P(X=x) $ se le llama #text(fill: rgb("#B10040"))[función de densidad] de la variable aleatoria $X$. Ejemplo: Consideremos el lanzamiento de una moneda en donde se quiere contar el número de soles. Tenemos que $Omega = {(a,a),(a,s),(s,a),(s,s)}$, si $cal(w_1)=(a,a), cal(w_2)=(a,s), cal(w_3)=(s,a), cal(w_4)=(s,s)$ entonces $ X(cal(w)) = cases( 0 #h(.2cm)\, "si" cal(w) = cal(w_1), 1 #h(.2cm)\, "si" cal(w) = cal(w_2) #h(.2cm) "o" #h(.2cm) cal(w) = cal(w_3), 2 #h(.2cm)\, "si" cal(w) = cal(w_4), ) $ Luego, $ f_X (0) &= P[{cal(w) in Omega divides X(cal(w)) = 0}] = P[{(a,a)}] = 1/4 \ f_X (1) &= P[{cal(w) in Omega divides X(cal(w)) = 1}] = P[{(a,s)},{(s,a)}] = 1/2 \ f_X (2) &= P[{cal(w) in Omega divides X(cal(w)) = 2}] = P[{(s,s)}] = 1/4 $ Por lo tanto, $ f_X (x) = cases( 1/4 #h(.2cm)\, "si" x = 0, 1/2 #h(.2cm)\, "si" x = 1, 1/4 #h(.2cm)\, "si" x = 2, 0 #h(.2cm)\, "en otro caso", ) $ #figure( image("plot_dens.png", width: 80%), caption: [ Gráfica de $f_X (x)$. ], ) #highlight(fill: rgb("#FF75B5"), radius: 8pt, stroke: black, extent: 3pt)[Definición 5] #h(2pt) (Función de distribución). La #text(fill: rgb("#B10040"))[función de distribución] o función de distribución acumulativa $F: RR arrow.r.long [0,1]$ de una variable aleatoria $X$ se define por $ F_X (x) = P[X lt.eq x], #h(.5cm) text("para toda") x in RR. $ Ejemplo: En el lanzamiento de un dado se tiene que $Omega = {1,2,3,4,5,6}$, y sabemos por el #text(weight: "bold")[ejemplo 1.1] que la probabilidad de obtener alguno de los elementos de $Omega$ es de $1/6$. Entonces $ F_X (x) = cases( 0 #h(.2cm)\, "si" x < 1, 1/6 #h(.2cm)\, "si" 1 <= x < 2, 2/6 #h(.2cm)\, "si" 2 <= x < 3, 3/6 #h(.2cm)\, "si" 3 <= x < 4, 4/6 #h(.2cm)\, "si" 4 <= x < 5, 5/6 #h(.2cm)\, "si" 5 <= x < 6, 1 #h(.2cm)\, "si" x >= 6 ) $ En la figura 2 se muestra la gráfica de la función de distribución de la variable aleatoria, donde es más sencillo notar la #text(weight: "bold")[acumulación de probabilidad] entre los diferentes valores que puede tomar tal función. #figure( image("plot_dist.png", width: 80%), caption: [ Gráfica de $F_X (x)$. ], )
https://github.com/antonWetzel/typst-languagetool
https://raw.githubusercontent.com/antonWetzel/typst-languagetool/main/example/main.typ
typst
MIT License
#import "lt.typ": lt #show: lt() #set text(lang: "de") Das ist ein Satz mit einem Tipfehler. Ich glaube, dass Wowow ein Wort ist. #set text(lang: "en") What a beautiful color. #include "other.typ"
https://github.com/kdog3682/typkit
https://raw.githubusercontent.com/kdog3682/typkit/main/0.1.0/src/ao.typ
typst
#import "validation.typ": * #import "resolve.typ": resolve-array #let masterattrs = ( line: ( "fill", "stroke", "radius", ), circle: ( "fill", "stroke", "radius", ), rect: ( "fill", "stroke", "radius", ), text: ( "fill", "stroke", "weight", ), box: ( "width", "height", "baseline", "fill", "stroke", "radius", "inset", "outset", "clip" ), table: ( "columns", "rows", "gutter", "column-gutter", "row-gutter", "fill", "align", "stroke", "inset" ), ) #let reduce(x, callback) = { let store = (:) if is-array(x) { for v in x { let value = callback(v) if is-array(value) { store.insert(..value) } } } else if is-object(x) { for (k, v) in x { let value = callback(k, v) if is-array(value) { store.insert(..value) } } } return store } #let merge-dictionary(a, b, overwrite: true) = { for (k, v) in b { if type(a) == dictionary and k in a and type(v) == dictionary and type(a.at(k)) == dictionary { a.insert(k, merge-dictionary(a.at(k), v, overwrite: overwrite)) } else if overwrite or k not in a { a.insert(k, v) } } return a } #let merge-dictionaries(..sink) = { let store = (:) let args = sink.pos().filter(is-object) for arg in args { for (k, v) in arg { store.insert(k, v) } } return store } #let build-attrs2(sink, key: none, ..base-sink) = { let kwargs = base-sink.named() let ref = masterattrs.at(key) for (k, v) in sink.named() { if k in ref { kwargs.insert(k, v) } } return kwargs } #let build-attrs(base, ..sink, key: none, aliases: false) = { let args = sink.pos() if args.len() == 0 { return build-attrs2(base, key: key, ..sink) } if base == none { base = (:) } let alias-ref = ( inset: ( large: 10pt, ), ) for (k, v) in sink.named() { if key == none or k in masterattrs.at(key) { if aliases == true and k in alias-ref { let m = alias-ref.at(k) if v in m { v = m.at(v) } } base.insert(k, v) } } return base } #let assign-existing(a, b) = { for (k, v) in b { if k in a and v != none { a.insert(k, v) } } return a } #let assign-fresh(a, b) = { for (k, v) in b { if k in a or v == none { continue } else { a.insert(k, v) } } return a } #let assign(a, b) = { for (k, v) in b { if v != none { a.insert(k, v) } } } #let create-scope(..sink) = { let modules = sink.pos() if modules.len() == 0 { return (:) } let base = dictionary(modules.at(0)) for m in modules.slice(1) { for (k, v) in dictionary(m) { base.insert(k, v) } } return base } #let remove-none(x) = { if is-array(x) { return x.filter(not-none) } if is-object(x) { return reduce(x, (x, y) => { if not-none(y) { return (x, y) } }) } } #let filter-array(a, b) = { if is-array(b) { return a.filter(x => not b.contains(x)) } todo() } #let filter-object(a, b) = { if is-array(b) { let store = (:) let keys = filter-array(a.keys(), b) return reduce(keys, (key) => (key, a.at(key))) } todo() } #let filter(a, b) = { if is-array(a) { return filter-array(a, b) } if is-object(a) { return filter-object(a, b) } panic("the input for filter must be of array or object") } #let map-filter(items, fn) = { let store = () for item in items { let v = fn(item) if not-none(v) { store.push(v) } } return store } #let map(x, fn, ..sink) = { if is-number(x) { let store = () for i in range(1, x + 1) { store.push(fn(i)) } return store } else { let pos = sink.pos() if pos.len() > 0 { return x.map((x) => fn(x, ..pos)) } else { return x.map(fn) } } } #let getter(x, ..sink) = { let args = sink.pos() if args.len() == 1 { return x.at(key, default: none) } let kwargs = sink.named() let ignore = kwargs.at("ignore", default: none) if ignore != none { return filter(x, resolve-array(ignore)) } } #let every(x, fn) = { return x.all(fn) } #let resolve-sink-attrs(sink, base) = { let kwargs = sink.named() return assign-existing(base, kwargs) } #let find-nearest = (arr, target, ignore: none) => { let ignore = resolve-array(ignore) let closest = none let min_diff = none for num in arr { if num in ignore { continue } let diff = calc.abs(target - num) if min_diff == none or diff < min_diff { min_diff = diff closest = num } } return closest } #let unique(x, y) = { return filter-array(x, y) } #let trx(transform) = { if is-string(transform) { (x) => x.at(transform) } else if is-function(transform) { transform } else { identity } } #let get-max(group, transform: none) = { let get = trx(transform) let max-value = none for item in group { let value = get(item) if max-value == none or value > max-value { max-value = value } } max-value } #let get-min(group, transform: none) = { let get = trx(transform) let min-value = none for item in group { let value = get(item) if min-value == none or value < min-value { min-value = value } } min-value } // Example usage // #let numbers = (5, 2, 8, 1, 9, 3) // #let objects = ( // (x: 1, y: 5), // (x: 3, y: 2), // (x: 2, y: 8) // ) // #panic(get-min(objects, transform: "y"))
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/packages/typst.node/npm/win32-arm64-msvc/README.md
markdown
Apache License 2.0
# `@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc` This is the **aarch64-pc-windows-msvc** binary for `@myriaddreamin/typst-ts-node-compiler`
https://github.com/EpicEricEE/typst-equate
https://raw.githubusercontent.com/EpicEricEE/typst-equate/master/tests/alignment/test.typ
typst
MIT License
#import "/src/lib.typ": equate #set page(width: 6cm, height: auto, margin: 1em) #show: equate // Test correct number position when using `set align`. #set math.equation(numbering: "(1)") #for number-align in (left, right) { set math.equation(number-align: number-align) $ a + b $ show math.equation: set align(start) $ a + b $ show math.equation: set align(end) $ a + b $ } // Test alignment points together with `set align`. #show math.equation: set align(start) $ a + b &= c &+ d = e \ f &= g & = h $
https://github.com/0x1B05/english
https://raw.githubusercontent.com/0x1B05/english/main/kaoyan/content/writing.typ
typst
#import "../template.typ": * #pagebreak() = Writing == 应用文 === 05 Two months ago you got a job as an editor for the magazine Designs & Fashions. But now you find that the work is not what you expected. You decide to quit. Write a letter to your boss, <NAME>, telling him your decision, stating your reason (s), and making an apology. - Write your letter with no less than 100 words. - Do not sign your own name at the end of the letter; use “<NAME>” instead. You do not need to write the address. ==== resignation Dear Mr. Wang, #underline[_I am writing to formally notify you of_] my resignation from my position as an editor at Designs & Fashions, #underline[_effective two weeks from today._] Two months ago, I *embarked* on this role with great enthusiasm, looking forward to contributing to our *esteemed* magazine. However, I have *come to realize* that the job responsibilities and the work environment do not *align with* my career *aspirations* and personal growth goals. *Despite my initial excitement*, the daily tasks #underline[_have proven to be quite different from what I expected, focusing more on_] administrative duties #underline[_rather than_] the creative editorial work I am passionate about. #underline[_I deeply regret any inconvenience my departure may cause to the team and the ongoing projects._] #underline[_Please know that this decision was not made lightly, and it took considerable thought and reflection._] #underline[_I am truly grateful for the opportunity to_] work with such a talented team #underline[_and for_] the professional experiences I have gained during my *tenure*. #underline[_I would like to extend my sincerest apologies for any disruption this may cause and assure you that I am committed to *facilitating* a smooth transition._] #underline[_I am more than willing to assist in_] training my successor #underline[_and will ensure_] that all my tasks are up-to-date before my *departure*. #underline[_Thank you for your understanding and support. I hope to maintain a positive relationship moving forward, and I look forward to potential future collaborations._] Yours sincerely, <NAME> ==== 辞职信 尊敬的王先生: 我写此信是为了正式通知您,我将从今天起两周后辞去《设计与时尚》杂志编辑的职务。 两个月前,我满怀热情地开始了这一角色,期待为我们备受尊崇的杂志做出贡献。然而,我逐渐意识到工作职责和工作环境并不符合我的职业抱负和个人成长目标。尽管我最初非常兴奋,但日常任务与我期待的有很大不同,更多地集中在行政职责上,而非我热爱的创意编辑工作。 我深感遗憾,我的离职可能会给团队和正在进行的项目带来不便。请知悉,这个决定经过了深思熟虑,并非轻率之举。我非常感激有机会与如此才华横溢的团队合作,并感谢我在任职期间获得的专业经验。 我想对由此可能造成的任何中断表示最诚挚的歉意,并向您保证,我致力于确保平稳过渡。我非常愿意帮助培训我的接班人,并将确保在离职前完成所有任务。 感谢您的理解和支持。我希望未来能保持积极的关系,并期待将来有机会再次合作。 此致, 李明 #pagebreak() === 06 You want to contribute to Project Hope by offering financial aid to a child in a remote area. Write a letter to the department concerned, asking them to help find a candidate. You should specify what kind of child you want to help and how you will carry out your plan. - Write your letter in no less than 100 words. Write it neatly. - Do not sign your own name at the end of the letter; use “<NAME>” instead. - Do not write the address. Dear Project Hope Team, ==== Applying for Financial Aid #underline[_I hope this letter finds you well._] #underline[_I am writing to express my interest in_] providing financial aid to a child through your esteemed organization, Project Hope. #underline[_I am particularly interested in_] supporting a child from a remote area who is facing significant educational challenges #underline[_due to_] *financial constraints*. #underline[_My intention is to_] *sponsor* a child's education for a minimum of one school year, covering expenses such as school fees, books, and necessary supplies. #underline[_I believe that_] every child deserves the opportunity to learn and grow in a supportive environment, #underline[_and I am eager to make a meaningful difference in a young individual's life._] To ensure that the aid *reaches* a suitable candidate, I kindly request your assistance in identifying a child who *meets these criteria*. #underline[_Please provide information regarding_] the process for selecting a child and how I can *initiate* my contribution. #underline[Thank you for considering my request. I look forward to your guidance and am ready to proceed] as soon as a suitable candidate is identified. Yours sincerely, <NAME> ==== 申请经济援助 尊敬的希望工程团队: 您好!我写此信是想通过贵机构为一名孩子提供经济援助。我特别希望支持一名因经济困难而在教育上面临重大挑战的偏远地区孩子。 我的计划是至少资助一名孩子一学年的教育,包括学费、书籍和必需的学习用品。我相信每个孩子都应该有机会在支持性的环境中学习和成长,我渴望在年轻人的生活中做出有意义的改变。 为确保援助到达合适的候选人,我恳请您帮助确定符合这些标准的孩子。请提供关于选择孩子的过程以及我如何开始我的捐助的信息。 感谢您考虑我的请求。我期待您的指导,并准备好一旦找到合适的候选人就立即开始行动。 此致, 李明 #pagebreak() === 07 Write a letter to your university library, making suggestions for improving its service. - You should write about 100 words. - Do not sign your own name at the end of the letter. Use “<NAME>” instead. - Do not write the address. ==== Suggestions for Enhancing Library Services Dear Library Management, #underline[_I hope this message finds you well._] #underline[_As a_] frequent user of our university library, #underline[_I would like to suggest a few enhancements that could improve_] the services provided to students. *Firstly*, #underline[_extending library hours, especially_] during exam periods, would greatly benefit students who require more time for study and research. *Additionally*, increasing the availability of study rooms could *facilitate* group discussions and collaborative learning, #underline[_which are essential for_] academic success. #underline[_Another area for_] improvement is the digital resources section. Expanding our digital library, especially with more e-books and online journals in various fields, would significantly *aid* students *engaged in* extensive research projects. *Lastly*, implementing *a more intuitive online catalog system* would *streamline the process* of locating and reserving books, making it more user-friendly. #underline[_Thank you for considering these suggestions. I am confident that these changes would greatly enhance our learning environment._] Best regards, <NAME> ==== 关于提升图书馆服务的建议 亲爱的图书馆管理部, 希望这条信息您收到时一切安好。作为我们大学图书馆的常客,我想建议几项改进措施,以提升对学生的服务质量。 首先,特别是在考试期间,延长图书馆的开放时间将极大地惠及需要更多学习和研究时间的学生。此外,增加学习室的可用性可以促进小组讨论和合作学习,这对学术成功至关重要。 另一个改进领域是数字资源部分。扩展我们的数字图书馆,尤其是增加更多各学科领域的电子书和在线期刊,将显著帮助从事广泛研究项目的学生。 最后,实施一个更直观的在线目录系统将简化查找和预订书籍的过程,使其更加用户友好。 感谢您考虑这些建议。我相信这些变化将大大提升我们的学习环境。 最诚挚的问候, 李明 #pagebreak() === 08 You have just come back from Canada and found a music CD in your luggage that you forgot to return to Bob, your landlord there. Write him a letter to 1) make an apology, and 2) suggest a solution. - You should write about 100 words. - Do not sign your own name at the end of the letter. Use “<NAME>” instead. - Do not write the address. ==== Apology and Resolution Regarding the Music CD Dear Bob, #underline[_I hope this message finds you well._] #underline[_I am writing to express my sincere apologies for_] an *oversight* that occurred during my recent departure from Canada. I have discovered a music CD in my luggage that belongs to you, which I *inadvertently* forgot to return before leaving. #underline[_I deeply regret not ensuring that_] all borrowed items were returned to you, #underline[_and I appreciate your understanding in this matter._] #underline[_To rectify this, I propose to_] mail the CD back to you *at my expense*. #underline[_If this arrangement suits you, please_] provide your *preferred* mailing address, #underline[_or *alternatively*, if you have another preferred solution, I am open to suggestions._] #underline[_Thank you for your kindness and understanding. I look forward to resolving this matter swiftly and to your satisfaction._] #underline[_Warm regards,_] <NAME> ==== 关于音乐 CD 的道歉和解决方案 亲爱的鲍勃, 希望您收到这条消息时一切安好。我写信是为了对我最近离开加拿大时发生的一个疏忽表示诚挚的歉意。我在我的行李中发现了一张属于您的音乐 CD,我在离开之前无意中忘记归还了。 我非常遗憾没有确保所有借来的物品都已归还给您,感谢您的理解。为了纠正这一点,我提议以我的费用邮寄 CD 回给您。如果这个安排适合您,请提供您的首选邮寄地址,或者,如果您有其他更好的解决方案,我也愿意听取。 感谢您的善良和理解。我期待着迅速并令您满意地解决这个问题。 温馨的问候, 李明 #pagebreak() === 09 Restrictions on the use of plastic bags have not been so successful in some regions. “White Pollution” is still going on. Write a letter to the editor (s) of your local newspaper to 1) give your opinions briefly, and 2) make two or three suggestions. - You should write about 100 words. - Do not sign your own name at the end of the letter. Use “Li Ming” instead. - Do not write the address. ==== Combatting White Pollution: A Call for Strengthened Measures Dear Editor, #underline[_I am writing to express my concerns regarding the ongoing issue of_] "White Pollution" in our region, #underline[_despite_] existing restrictions on plastic bag usage. #underline[_It appears that_] the current measures are not sufficient to *curb* the environmental damage caused by these *non-biodegradable* materials. #underline[_In my opinion,_] more *rigorous* *enforcement* of the existing laws #underline[_is crucial_]. Many *individuals* and *businesses* continue to use plastic bags because _there are minimal consequences for *non-compliance*._ #underline[_Additionally, there should be a greater emphasis on_] public education about the severe environmental impacts of plastic pollution, #underline[_which might encourage_] more people to choose eco-friendly alternatives. Furthermore, I suggest that local *authorities* implement incentive programs to support businesses that transition to sustainable packaging options. Subsidies or tax breaks could significantly *reduce the financial burden* of this switch and promote wider adoption. #underline[_Thank you for considering these suggestions as we_] strive to protect our environment. Best regards, <NAME> ==== 对抗“白色污染”:呼吁加强措施 尊敬的编辑, 我写信是为了表达我对我们地区尽管已有塑料袋使用限制仍然存在的“白色污染”问题的关注。当前的措施似乎不足以减少这些不可生物降解材料造成的环境破坏。 我认为,更严格地执行现有法律至关重要。许多个人和企业继续使用塑料袋,因为不遵守规定的后果很小。此外,应该更加强调公众教育,关于塑料污染的严重环境影响,这可能会鼓励更多人选择环保的替代品。 另外,我建议地方当局实施激励计划,支持那些过渡到可持续包装选项的企业。补贴或税收减免可以显著减少这种转变的财务负担,并促进更广泛的采纳。 感谢您考虑这些建议,我们努力保护我们的环境。 最诚挚的问候, 李明 #pagebreak() === 10 You are supposed to write for the Postgraduates' Association a notice to recruit volunteers for an international conference on globalization. The notice should include the basic qualifications for applicants and other information which you think is relevant. - You should write about 100 words. - Do not sign your own name at the end of the notice. Use “Postgraduates' Association” instead. ==== Volunteer Recruitment for International Conference on Globalization Dear Postgraduate Students, The Postgraduates' Association is currently *seeking* motivated volunteers to help *coordinate* the upcoming International Conference on Globalization, which is scheduled to take place from November 15th to 17th, 2024. #underline[_This event is a *premier* opportunity to engage with_] thought leaders and experts discussing global economic, social, and cultural transformations. We are looking for volunteers who are currently enrolled as postgraduate students with excellent communication skills in English. #underline[_Proficiency in additional languages is highly desirable._] Volunteers should be able to work effectively within a team and adapt to the fast-paced environment of an international conference. #underline[_An interest in global issues and their complexities is essential._] #underline[_As a volunteer, you will be involved in various tasks_] such as setting up the conference venue, managing registration desks, providing information to attendees, and assisting in session facilitation. #underline[_This role offers a chance to gain valuable experience, enhance your CV, and expand your professional network._] #underline[_Interested candidates should submit a brief statement of interest and their CV to_] _<EMAIL>_ #underline[_by_] October 5, 2024. #underline[_We look forward to your enthusiastic participation in making this international event a success._] Best regards, Postgraduates' Association ==== 全球化国际会议志愿者招募 亲爱的研究生们, 研究生会目前正在寻找积极的志愿者,协助组织即将举行的全球化国际会议,会议定于 2024 年 11 月 15 日至 17 日举行。这是一个与全球经济、社会和文化转变领域的思想领袖和专家交流的绝佳机会。 我们寻找的志愿者应为当前在读研究生,具备出色的英语沟通能力;掌握其他语言能力将是一个大加分项。志愿者需要能够在团队中有效合作,并能适应国际会议快节奏的环境。对全球问题及其复杂性有兴趣是必需的。 作为志愿者,您将参与会议场地的设置、管理注册台、为与会者提供信息以及协助会议过程等各种任务。这一角色将为您提供宝贵的经验,增强您的简历,并扩展您的专业网络。 有兴趣的候选人请于 2024 年 10 月 5 日前提交一份简短的兴趣声明和简历至_<EMAIL>_。我们期待您的热情参与,共同使这一国际盛事取得成功。 最诚挚的问候, 研究生会 #pagebreak() === 11 Write a letter to a friend of yours to 1) recommend one of your favorite movies and 2) give reasons for your recommendation. - You should write about 100 words. - Do not sign your own name at the end of the letter. Use “<NAME>” instead. - Do not write the address. ==== Must-Watch Movie Recommendation! Dear [Friend's Name], I hope this letter finds you well. I recently watched a movie that I must recommend to you: “The Grand Budapest Hotel” directed by <NAME>. #underline[_This film stands out not only for its unique storytelling but also for its visual and thematic brilliance._] The movie is *a vibrant tapestry of humor and drama*, #underline[_masterfully woven through a narrative that spans several generations at a famous European hotel_]. #underline[_What *captivates* most is_] Anderson's distinctive style—meticulously crafted scenes, symmetrical compositions, and a pastel color palette that transforms each frame into a work of art. Moreover, #underline[_the *ensemble* cast delivers performances that are both *enchanting* and *poignant*, perfectly complementing the *whimsical* yet thoughtful *storyline*._] It’s a *cinematic* experience that #underline[_offers both a visual feast and a profound *commentary* on the nature of time, memory, and friendship._] I think you’ll find it both entertaining and inspiring. Enjoy the movie! Best regards, <NAME> ==== 必看电影推荐! 亲爱的[朋友姓名], 希望这封信找到你时一切安好。我最近看了一部非常推荐给你的电影:“布达佩斯大饭店”,导演是韦斯·安德森。这部电影不仅因其独特的叙事方式而脱颖而出,而且在视觉和==== 主题上都表现得极为出色。 这部电影是幽默与戏剧的生动组合,通过讲述一个发生在著名欧洲酒店、跨越几代人的故事,巧妙地编织了起来。最吸引人的是安德森的独特风格——精心制作的场景、对称的构图和粉彩色调的调色板,将每个画面都变成了一件艺术作品。 此外,众多演员的表演既迷人又令人感动,完美地补充了这个古怪而深思的故事情节。这是一次电影体验,既提供了视觉盛宴,也对时间、记忆和友谊的本质提供了深刻的评论。 我认为你会觉得它既有趣又富有启发性。享受电影吧! 最好的祝愿, 李明 #pagebreak() === 12 Some international students are coming to your university. Write them an email in the name of the Students' Union to 1) extend your welcome and 2) provide some suggestions for their campus life here. - You should write about 100 words. - Do not sign your name at the end of the letter. Use “<NAME>” instead. - Do not write the address. ==== Welcome to Our University! Dear International Students, #underline[_On behalf of the Student Union, I am delighted to_] welcome you to our university community. #underline[_As you embark on this exciting chapter of your academic journey_], we are here to ensure that your experience is both *enriching* and *memorable*. To *make the most of your time* on campus, I encourage you to *engage actively in our diverse array of clubs and societies*. #underline[_Whether your interest *lies* in sports, arts, or academic pursuits_], there is something here for everyone. Participating in these groups is a fantastic way to meet new people, learn new skills, and *integrate into the university life*. Additionally, I recommend exploring the city and its *surroundings*. #underline[_Our campus is ideally located to offer both urban attractions and natural beauty_], #underline[_providing plenty of opportunities for_] relaxation and exploration. We look forward to seeing you *thrive* here. If you have any questions or need assistance, please do not hesitate to contact the Student Union office. *Warm regards*, <NAME> ==== 欢迎来到我们的大学! 亲爱的国际学生们, 我代表学生会热烈欢迎您加入我们的大学社区。在您开始这一激动人心的学术旅程的新篇章时,我们在这里确保您的体验既丰富又难忘。 为了充分利用您在校园的时间,我鼓励您积极参与我们多样化的俱乐部和社团。无论您的兴趣是体育、艺术还是学术追求,这里总有适合每个人的活动。参与这些团体是结识新朋友、学习新技能并融入大学生活的绝佳方式。 此外,我建议探索城市及其周边环境。我们的校园地理位置优越,既有城市景点也有自然美景,为您提供了众多放松和探索的机会。 我们期待看到您在这里茁壮成长。如果您有任何问题或需要帮助,请随时联系学生会办公室。 最温馨的问候, 李明 #pagebreak() === 13 Write an e-mail of about 100 words to a foreign teacher in your college, inviting him/her to be a judge for the upcoming English speech contest. - You should include the details you think necessary. - Do not sign your own name at the end of the e-mail. Use “<NAME>” instead. - Do not write the address. ==== Invitation to Serve as a Judge at the English Speech Contest Dear [Teacher's Name], I hope this message finds you well. I am writing to invite you to *serve as* a judge at our *upcoming* English Speech Contest, #underline[_scheduled for_] October 10th, 2024, at the college *auditorium*. #underline[_Your *expertise* in English literature and proficiency in communication would greatly benefit the judging panel._] The contest will begin at 9:00 AM and is expected to #underline[_last until approximately_] 3:00 PM. Contestants will be *delivering speeches on* various themes related to global issues, aiming to *showcase* their *oratory* skills and their ability to *engage* an audience. We would be honored if you could join us and *lend your insight to* help recognize and encourage the talents of our participants. #underline[_Please let us know your availability by_] September 20th, so we can *finalize the details*. #underline[_Thank you for considering this request. I look forward to the possibility of your participation._] Warm regards, <NAME> ==== 邀请您担任英语演讲比赛评委 亲爱的[教师姓名], 希望您收到此信息时一切安好。我写信是想邀请您担任我们即将举行的英语演讲比赛的评委,比赛定于 2024 年 10 月 10 日,在学院礼堂举行。您在英语文学和沟通能力方面的专长将极大地增强评审团的实力。 比赛将于上午 9 点开始,预计持续到下午 3 点左右。参赛者将就全球问题的各种==== 主题发表演讲,展示他们的演说技巧和吸引听众的能力。 如果您能加入我们,并提供您的洞察力帮助我们识别和鼓励参与者的才能,我们将感到非常荣幸。请在 9 月 20 日前告知我们您的可用性,以便我们完成详细安排。 感谢您考虑这一请求。期待您能参与其中。 最温暖的问候, 李明 #pagebreak() === 14 Write a letter of about 100 words to the president of your university, suggesting how to improve students’ physical condition. - You should include the details you think necessary. - Do not sign your own name at the end of the letter. Use “<NAME>” instead. - Do not write the address. ==== Enhancements for Student Physical Well-being Dear President [President's Name], I hope this letter finds you well. #underline[_As a_] *committed* member of our university community, #underline[_I am writing to suggest some enhancements that could significantly improve_] the *physical condition* of our students. #underline[_Firstly, increasing the availability of sports facilities and extending their hours would allow_] more students to *incorporate* physical activity *into* their daily routines. Additionally, introducing more varied fitness programs, such as yoga, *pilates*, and dance classes, could #underline[_*cater to* a wider range of interests, *promoting* regular participation._] Secondly, improving *the nutritional options* available on campus by including more healthy, affordable food choices in our *cafeterias* could greatly influence students' *overall health*. Partnering with local farms to supply fresh produce could also enhance meal quality and *appeal*. These *initiatives* could *foster a healthier student body* and positively impact academic performance. Thank you for considering these suggestions. I believe these changes would greatly benefit our university community. Warm regards, <NAME> ==== 提升学生体质的建议 尊敬的[校长姓名]校长, 希望这封信件找到您一切安好。作为我们大学社区的一员,我写信是想建议一些改进措施,这些措施能显著提升我们学生的身体状况。 首先,增加体育设施的可用性并延长开放时间,能让更多学生将体育活动纳入他们的日常生活中。此外,引入更多种类的健身项目,如瑜伽、普拉提和舞蹈课程,可以满足更广泛的兴趣,促进定期参与。 其次,通过在我们的餐厅中增加更多健康、经济实惠的食品选择,改善校园内的营养选项,这将极大影响学生的整体健康。与当地农场合作提供新鲜农产品,也可以提升餐食质量和吸引力。 这些举措能培养更健康的学生群体,并积极影响学术表现。感谢您考虑这些建议。我相信这些变化将极大地惠及我们的大学社区。 最温馨的问候, 李明 #pagebreak() === 15 ==== Book Recommendation for Our Next Club Reading Session Dear Club Members, I hope this message finds you all well. #underline[_I am thrilled to recommend_] “The Night Circus” by <NAME> for our next club *reading session*. This *enchanting* novel #underline[_is not only a feast for the imagination but also a masterpiece of magical realism that I believe will *spark* lively discussions among us._] “The Night Circus” #underline[presents a unique *blend* of *intricate plot lines* and *beautifully crafted characters*, all set within] a *mystical* *circus* that only opens at night. Morgenstern's writing is both richly descriptive and *compelling*, making it a perfect *pick* for those who #underline[appreciate layers of mystery *intertwined with* romance and historical *nuances*.] #underline[_This book promises to be a captivating read that will keep you engaged from the first page to the last._] I look forward to *exploring its depths together* and *hearing everyone’s thoughts* during our session. Best regards, <NAME> ==== 下次读书会的书籍推荐 亲爱的俱乐部成员们, 希望这条信息找到大家都很好。我非常高兴为我们下一次读书会推荐 <NAME> 的《夜间马戏团》。这本迷人的小说不仅是想象力的盛宴,而且是一部魔幻现实主义的杰作,我相信它将激发我们之间的热烈讨论。 《夜间马戏团》独特地融合了错综复杂的情节和精心塑造的角色,所有这些都设定在一个仅在夜间开放的神秘马戏团中。Morgenstern 的写作既丰富描述性又引人入胜,非常适合那些欣赏神秘、浪漫与历史细微差别交织在一起的读者。 这本书承诺将是一本引人入胜的读物,将使您从第一页到最后一页都保持兴趣。我期待着与大家一起探索它的深度,并在我们的会议中听到大家的想法。 最好的祝愿, 李明 #pagebreak() === 16 Suppose you are a librarian in your university. Write a notice of about 100 words, providing the newly-enrolled international students with relevant information about the library. - Do not sign your own name at the end of the notice. Use “<NAME>” instead. - Do not write the address. ==== Welcome to the University Library! Dear International Students, Welcome to our university! As your librarian, #underline[_I am pleased to provide you with essential information about_] our library services and resources. Our library *houses* an extensive collection of books, journals, and digital resources *across various disciplines*. We offer study spaces, group collaboration rooms, and computer access to support your *academic endeavors*. To get started, please visit our website to register for a library card, which *grants you access to* borrowing and online services. We also provide *orientation sessions* to help you *familiarize yourself with* the library layout and services. These sessions are scheduled during the first two weeks of the semester, and we #underline[_highly recommend attending_] one. #underline[_For any questions or further assistance, feel free to approach our help desk._] We look forward to supporting your academic journey! Best regards, <NAME> ==== 欢迎使用大学图书馆! 亲爱的国际学生们, 欢迎来到我们的大学!作为你们的图书馆员,我很高兴为你们提供关于我们图书馆的服务和资源的必要信息。 我们的图书馆拥有广泛的书籍、期刊和数字资源,涵盖各个学科。我们提供学习空间、团队协作室和计算机访问,以支持你的学术活动。 首先,请访问我们的网站注册图书馆卡,该卡可以让你借书和使用在线服务。我们还提供导向会,帮助你熟悉图书馆的布局和服务。这些会议安排在学期的前两周,我们强烈建议你参加。 如果有任何问题或需要进一步帮助,请随时前往我们的咨询台。我们期待支持你的学术旅程! 最好的祝愿, 李明 #pagebreak() === 17 You are to write an email to <NAME>, a newly-arrived Australian professor, recommending some tourist attractions in your city. Please give reasons for your recommendation. - Do not sign your own name at the end of the email. Use “<NAME>” instead. - Do not write the address. ==== Welcome to Our City and Some Must-Visit Attractions! Dear Prof<NAME>, Welcome to our *vibrant* city! #underline[_I am delighted to recommend a few attractions that showcase the unique charm and history of our area._] Firstly, the City Museum is a *must-visit*. It *houses* an extensive collection that *offers insights into* the local history and cultural heritage. #underline[_This is a great way to_] *immerse yourself in* the spirit of our city from day one. Secondly, I #underline[_suggest visiting_] the Central Botanical Gardens. The gardens are not only a perfect spot for relaxation and a stroll but also *host* various exotic plants and flowers #underline[_that highlight the city’s commitment to biodiversity._] Lastly, #underline[_do not miss the Old Town_]. Its *quaint* streets and historical architecture provide a *picturesque* journey back in time, #underline[_perfect for an afternoon exploration._] I hope you enjoy discovering these gems! Best regards, <NAME> ==== 欢迎来到我们的城市,以及一些必游景点的推荐! 亲爱的库克教授, 欢迎来到我们充满活力的城市!我很高兴向您推荐几个展示我们地区独特魅力和历史的景点。 首先,市立博物馆是必游之地。它收藏了丰富的展品,提供了对当地历史和文化遗产的深入了解。这是您从第一天起就沉浸在我们城市精神中的绝佳方式。 其次,我建议参观中央植物园。这些花园不仅是放松和漫步的完美地点,还展示了各种异国植物和花卉,凸显了城市对生物多样性的承诺。 最后,不要错过老城区。它那古色古香的街道和历史建筑提供了一次如画的时光之旅,非常适合下午的探索。 希望您喜欢发现这些宝藏! 最好的祝愿, 李明 #pagebreak() === 18 Write an email to all international experts on campus, inviting them to attend the graduation ceremony. In your email, you should include time, place and other relevant information about the ceremony. - You should write about 100 words neatly. - Do not use your own name at the end of the email. Use “<NAME>” instead. ==== Invitation to Attend the Graduation Ceremony Dear Esteemed International Experts, #underline[_It is with great pleasure that we extend an invitation to you to attend our upcoming_] Graduation Ceremony. This significant event is scheduled to take place on June 15th, 2024, at 10:00 AM in the University Auditorium. The ceremony will honor the achievements of our graduates and celebrate the *culmination* of their academic journey. #underline[_Your presence would greatly enrich the experience, providing_] our students #underline[_with a sense of_] the global community they are about to join. #underline[Following the ceremony,] a reception will be held in the university garden, #underline[_allowing for an opportunity to_] *mingle* and offer congratulations personally. #underline[_Please confirm your attendance by June 1st, 2024, to *facilitate* planning. We look forward to the honor of your presence._] Warm regards, <NAME> ==== 邀请参加毕业典礼 尊敬的国际专家们, 我们非常高兴地邀请您参加我们即将举行的毕业典礼。这一重要活动定于 2024 年 6 月 15 日上午 10 点在大学礼堂举行。 典礼将表彰我们毕业生的成就,并庆祝他们学术旅程的顶点。您的出席将极大丰富这次经验,为我们的学生提供即将加入的全球社区的感觉。 典礼后,将在大学花园举行招待会,为大家提供一个相互交流和亲自祝贺的机会。 请于 2024 年 6 月 1 日前确认您的出席,以便我们进行安排。我们期待您的光临。 最诚挚的问候, 李明 #pagebreak() === 19 Suppose you are working for the "Aiding Rural Primary School" project of your university. Write an email to answer the inquiry from an international student volunteer, specifying the details of the project. - You should write about 100 words. - Do not use your own name in the email; use "<NAME>" instead. ==== Details about the "Aiding Rural Primary School" Project Dear [Volunteer's Name], Thank you for your interest in the "Aiding Rural Primary School" project. This initiative is a part of our university's *commitment to improving* educational facilities and resources in *underprivileged* rural areas. #underline[_The project involves_] *refurbishing* local school buildings, providing educational materials, and organizing teaching sessions led by our volunteers. We also aim to set up a small library in each school to ensure that students have access to a wide range of learning resources. We typically organize volunteer groups to travel to the schools every semester, with each mission *lasting about* two weeks. Volunteers are expected to help with *physical renovations* and participate in educational activities. #underline[_If you are interested in joining us, please reply with your available dates and any specific skills you can offer to the project._] #underline[We truly appreciate your *willingness* to contribute and look forward to potentially *having you on our team*.] Best regards, <NAME> ==== 关于“援助农村小学”项目的详细信息 亲爱的[志愿者姓名], 感谢您对“援助农村小学”项目的兴趣。此项倡议是我们大学致力于改善贫困农村地区教育设施和资源的一部分。 项目涉及翻修当地学校建筑、提供教育材料以及组织由我们的志愿者领导的教学活动。我们还计划在每所学校设立一个小图书馆,确保学生能够接触到广泛的学习资源。 我们通常每学期组织志愿者小组前往这些学校,每次任务持续约两周。志愿者需要帮助进行物理翻新并参与教育活动。 如果您有兴趣加入我们,请回复您的可用日期和您能为项目提供的特定技能。我们非常感谢您的贡献意愿,并期待您能成为我们团队的一员。 最诚挚的问候, 李明 #pagebreak() === 20 The student union of your university has assigned you to inform the international students about an upcoming singing contest. Write a notice in about 100 words. - Write your answer. - Do not use your own name in the notice. ==== Join Our University's International Singing Contest! Dear International Students, #underline[_We are excited to announce the upcoming_] International Singing Contest, #underline[_organized by the Student Union, scheduled for October 10th, 2024._] This event aims to #underline[_*celebrate musical talents* across *our diverse student body* and *foster cultural exchange* through *the universal language of music*_]. The contest will take place in the University Auditorium *from 6:00 PM onwards*. Participants will have the opportunity to showcase their vocal skills and *represent their cultural heritage* through song. #underline[Prizes will be awarded for the best performances, with categories including Best *Solo*, Best *Duet*, and Best Traditional Song.] To participate, please register by September 30th by emailing _<EMAIL>_. #underline[_Whether you are competing or cheering, this event promises to be a wonderful evening of entertainment and cultural celebration._] We look forward to your participation and to a night of memorable performances! Warm regards, Student Union ==== 参加我们大学的国际歌唱比赛! 亲爱的国际学生们, 我们很高兴地宣布,由学生会组织的国际歌唱比赛将于 2024 年 10 月 10 日举行。此活动旨在庆祝我们多样化学生群体中的音乐才能,并通过音乐这一全球语言促进文化交流。 比赛将从晚上 6 点开始,在大学礼堂举行。参与者将有机会展示他们的歌唱技巧,并通过歌曲表达他们的文化遗产。将为最佳表演颁发奖项,包括最佳独唱、最佳二重唱和最佳传统歌曲等类别。 如欲参加,请于 9 月 30 日前通过_<EMAIL>_注册。无论是参赛还是加油,这次活动都将是一个充满娱乐和文化庆典的美妙夜晚。 我们期待您的参与和一场难忘的表演之夜! 最诚挚的问候, 学生会 #pagebreak() === 21 A foreign friend of yours has recently graduated from college and intends to find a job in China. Write him/her an email to make some suggestions. - You should write about 100 words. - Do not use your name in the email; use “<NAME>” instead. ==== Tips for Job Hunting in China Dear [Friend's Name], #underline[_Congratulations on your graduation!_] #underline[_As you *embark* on your job search in China, I have a few suggestions that might_] help you *navigate the job market* here more effectively. Firstly, *familiarize* yourself *with* Chinese business *etiquette*. Understanding *cultural nuances* can greatly *enhance* your interactions and interviews with potential employers. Secondly, learning Mandarin, if you haven't already, will significantly *boost your employability*, as many companies *prefer candidates* who can communicate in the local language. Additionally, *leverage your unique background as* an international candidate. Emphasize how your global perspective and education can contribute to a Chinese company's international goals. *Networking* is also *key-try* to attend *industry-related* events and *connect with professionals* via platforms like LinkedIn. Lastly, *tailor your resume* and *cover letter* to each job application, highlighting skills and experiences that *align with the job requirements*. #underline[_Best of luck, and I'm here to help however I can!_] Warm regards, <NAME> ==== 在中国找工作的建议 亲爱的[朋友姓名], 祝贺你毕业!在你开始在中国找工作的旅程中,我有一些建议可能会帮助你更有效地导航这里的就业市场。 首先,熟悉中国的商业礼仪。理解文化细微差别可以极大地增强你与潜在雇主的互动和面试。其次,如果你还没有学习普通话,现在开始学习将大大提高你的就业能力,因为许多公司更喜欢可以用当地语言交流的候选人。 此外,利用你作为国际候选人的独特背景。强调你的全球视野和教育如何能够为中国公司的国际目标做出贡献。建立人际网络也很关键——尝试参加行业相关活动并通过 LinkedIn 等平台与专业人士联系。 最后,针对每一个工作申请调整你的简历和求职信,突出与工作要求相符的技能和经验。 祝你好运,我在这里随时帮助你! 最温暖的问候, 李明 #pagebreak() === 22 Write an e-mail to a professor at a British university, inviting him/her to organize a team for international innovation contest to be held at your university. - You should write about 100 words. - Do not sign your own name in the email; use “<NAME>” instead. ==== Invitation to Form a Team for the International Innovation Contest Dear Professor [Professor's Last Name], I hope this message finds you well. I am writing to *cordially* invite you to participate in the *upcoming* International Innovation Contest *hosted* by our university, which is scheduled to take place on December 3rd, 2024. #underline[_This contest aims to_] bring together creative minds *from across the globe* to *collaborate* and compete on projects that *push the boundaries of technology and innovation*. #underline[_We believe that your expertise and leadership would greatly benefit your team and contribute significantly to the diversity and success of the event._] #underline[_We would be honored if you could_] organize a team from your university to join us. #underline[_Full details regarding the contest rules, registration process, and accommodations will be provided upon your confirmation._] #underline[_We look forward to the possibility of your participation and the exciting contributions your team will bring to the competition._] Warm regards, <NAME> ==== 邀请组队参加国际创新竞赛 亲爱的[教授姓氏]教授, 希望您收到此消息时一切安好。我写信是为了诚挚邀请您参加我们大学即将举行的国际创新竞赛,该竞赛计划于 2024 年 12 月 3 日举行。 此次竞赛旨在聚集全球创造性思维,共同合作和竞争,推动技术和创新的界限。我们相信,您的专业知识和领导能力将极大地益于您的团队,并显著地贡献于活动的多样性和成功。 如果您能组织您所在大学的团队加入我们,我们将感到荣幸。一旦您确认参加,我们将提供有关竞赛规则、注册流程和住宿的完整详情。 我们期待您的参与可能性以及您的团队将为比赛带来的激动人心的贡献。 最温暖的问候, 李明 #pagebreak() === 23 Write a notice to recruit a student for Prof. Smith's research project on campus sports activities. Specify the duties and requirements of the job. - You should write about 100 words. - Do not use your own name at the end of the notice; use “<NAME>” instead. ==== Notice of Recruitment for Student Research Assistant <NAME> is currently *seeking* a *diligent* and *motivated* student to join his research project focusing on campus sports activities. The successful candidate will *assist in* collecting and analyzing data related to student participation in sports, organizing *focus group discussions*, and contributing to the preparation of research reports. #underline[_Requirements for the position include_] strong analytical skills, *proficiency in* statistical software, and excellent written and *verbal* communication abilities. #underline[_*Prior experience* in research or sports management is highly desirable._] The candidate must also *demonstrate* a *keen* interest in *promoting physical fitness and well-being* among students. #underline[_This is a unique opportunity to gain valuable research experience and contribute to enhancing the campus sports program._] *Interested* students should submit their resumes and *a cover letter* to the *department office* by July 25th. #underline[For further inquiries, please contact the *department secretary*.] We look forward to your applications! Best regards, <NAME> ==== 关于校园体育活动研究项目招聘学生的通知 史密斯教授目前正在招募一名勤奋且有积极性的学生加入他的校园体育活动研究项目。成功的候选人将协助收集和分析学生参与体育活动的数据,组织焦点小组讨论,并参与研究报告的准备工作。 该职位要求包括较强的分析能力、熟练使用统计软件以及出色的书面和口头沟通能力。具有研究或体育管理经验者优先考虑。候选人还必须表现出对促进学生身体健康的浓厚兴趣。 这是一个获得宝贵研究经验并为改进校园体育项目做出贡献的独特机会。有意者请于 7 月 25 日前将简历和求职信提交至系办公室。如有进一步咨询,请联系系秘书。 我们期待您的申请! 最诚挚的问候, 李明 #pagebreak() === 24 Read the following email from an international student and write a reply. Write your answer in about 100 words. ``` Dear <NAME>, I’ve got a class assignment to make an oral report on an ancient Chinese scientist, but I’m not sure how to prepare for it. Can you give me some advice? Thank you for your help. Yours, Paul ``` Do not use your own name in your email; use “<NAME>” instead. ==== Advice for Your Report on an Ancient Chinese Scientist Dear Paul, #underline[_I’m glad to hear that you’re *delving* into_] the rich history of Chinese science! Preparing *an oral report* on an ancient Chinese scientist is an exciting opportunity to explore significant contributions that have *shaped* scientific thought globally. First, I recommend choosing a scientist whose work *resonates with* your interests, such as <NAME>, who invented the *seismoscope*, or <NAME>uo, who *made advancements in* various scientific fields. Once you’ve selected a scientist, #underline[_*gather reputable sources from* the library or *online scholarly databases* to ensure accuracy and depth in your report._] #underline[_*Structure your presentation* clearly-start with an introduction to_] the scientist’s *era* and background, discuss their major contributions and experiments, and conclude with their impact on both ancient and modern science. #underline[_Using *visuals* like *timelines* or images of their inventions can greatly enhance your report._] #underline[_If you need further assistance or specific resources, feel free to ask. Best of luck with your presentation!_] Best regards, <NAME> ==== 关于您关于中国古代科学家的报告的建议 亲爱的保罗, 很高兴听说您正在深入研究中国科学的丰富历史!准备关于中国古代科学家的口头报告是一个探索对全球科学思想产生重大贡献的绝佳机会。 首先,我建议选择一位与您的兴趣相呼应的科学家,例如发明了地动仪的张衡或在多个科学领域取得进展的沈括。选择好科学家后,从图书馆或在线学术数据库中收集可靠的资料,以确保您的报告准确且深入。 清晰地结构化您的演讲——从科学家的时代和背景介绍开始,讨论他们的主要贡献和实验,最后总结他们对古代和现代科学的影响。使用时间线或他们发明的图像等视觉资料可以极大地增强您的报告。 如果您需要进一步的帮助或特定资源,请随时询问。祝您演讲顺利! 最诚挚的问候, 李明 #pagebreak() == essay === 05 #align(center)[ #image("./images/05.png", width: 60%) ] ==== The "Soccer Match" of Elderly Care #underline[_The drawing depicts_] an elderly man sitting in the middle of a field, surrounded by his four children, each standing in front of a goalpost. The children #underline[_are labeled as_] "Eldest Son," "Second Son," "Third Son," and "Youngest Daughter." The elderly man appears to be the "soccer ball" being passed around, #underline[*_symbolizing_*] the challenges of providing care for elderly parents. #underline[_The intended meaning of this illustration is to highlight the difficulties and *dynamics* involved in_] elderly care within a family. #underline[_It reflects the tendency for_] children to *pass the responsibility* of caring for their aging parents *from one to another*, #underline[_rather than_] taking collective and consistent responsibility. #underline[_This situation can lead to_] feelings of neglect and isolation for the elderly parents, #underline[_as_] they are treated more like a burden to be managed than loved family members to be cherished. #underline[_In my opinion, this drawing effectively captures a significant social issue, particularly in societies where_] *filial piety* and family responsibility are highly valued. #underline[It underscores the importance of] approaching elderly care with a sense of duty, compassion, and cooperation among siblings. #underline[_Rather than_] *shifting the responsibility*, families should work together to provide a stable and supportive environment for their aging parents. #underline[_This illustration *serves* as a powerful reminder of the emotional and ethical aspects of_] caregiving. #underline[_It calls for a *reevaluation* of how we perceive and manage the responsibilities of_] caring for elderly family members. #underline[_By fostering a culture of_] shared responsibility and mutual support, families #underline[_can ensure_] that their elderly members feel valued and cared for, #underline[_rather than_] isolated and neglected. #underline[_In conclusion, the drawing highlights the need_] for a collective and compassionate approach to elderly care. #underline[_It encourages_] families to come together, share the responsibilities, and provide consistent and loving care for their aging parents. #underline[_This approach not only benefits_] the elderly #underline[_but also_ strengthens] *familial bonds* #underline[_and promotes_] a more *harmonious* family life. ==== 养老“足球赛” 这幅画描绘了一位坐在场地中央的老人,周围是他的四个孩子,每个孩子都站在一个球门前。孩子们分别被标注为“大儿子”、“二儿子”、“三儿子”和“小女儿”。老人看起来像是被传来传去的“足球”,象征着家庭中养老责任的挑战。 这幅插图的意图是突出家庭中涉及养老的困难和动态。它反映了子女们将照顾年迈父母的责任相互推卸的倾向,而不是集体和一致地承担责任。这种情况会导致老年父母感到被忽视和孤立,因为他们被当作一个需要管理的负担,而不是需要珍惜的亲人。 在我看来,这幅画有效地捕捉了一个重要的社会问题,特别是在那些孝道和家庭责任被高度重视的社会中。它强调了以责任感、同情心和兄弟姐妹之间合作的态度来对待养老的重要性。与其推卸责任,家庭应该共同努力,为年迈父母提供一个稳定和支持的环境。 这幅插图作为对照顾者情感和伦理方面的有力提醒。它呼吁我们重新审视如何看待和管理照顾年迈家庭成员的责任。通过培养共同责任和相互支持的文化,家庭可以确保其老年成员感受到被重视和关爱,而不是被孤立和忽视。 总之,这幅画突显了对养老采取集体和富有同情心的方法的必要性。它鼓励家庭团结起来,共享责任,为年迈父母提供一致和有爱的照顾。这种方法不仅有利于老人,也加强了家庭纽带,促进了更加和谐的家庭生活。 #pagebreak() === 06 #align(center)[ #image("./images/06.png", width: 60%) ] ==== version 1 ===== Essay #underline[_The images depict two distinct scenes of_] individuals emulating the famous British football star, <NAME>. #underline[_The first image shows_] a young man with the name "Beckham" *tattooed* *prominently* on his face. #underline[_The second image *portrays*_] a person getting a haircut styled to resemble Beckham's *iconic* hairstyle, costing 300 yuan. These pictures #underline[_vividly illustrate the lengths to which some individuals go_] to express their admiration for celebrities. #underline[_These images reflect a broader social phenomenon of_] celebrity *worship*, which has become increasingly *prevalent* in modern society. The man with the tattoo represents *the extreme end of this spectrum*, where individuals permanently mark their bodies to show their *dedication*. The second image, while less permanent, still *highlights the extent* to which people are willing to *invest time and money* to *mimic* their idols. #underline[_This phenomenon is driven by the desire for *a sense of identity and belonging*, as well as the influence of media that continuously *glorifies* celebrities and their lifestyles._] #underline[_In my view, this trend of idolizing celebrities can have both positive and negative impacts._] #underline[_On the positive side_], celebrities can serve as role models, inspiring fans to achieve their own goals and pursue their passions. #underline[_However, the negative side is more *concerning*._] *Excessive idolization* can lead to *a loss of individual identity*, where people *prioritize* emulating their idols *over* developing their own unique qualities. #underline[_Moreover, it can foster *a consumerist culture* where superficial aspects, such as appearance and lifestyle, are *valued over* *substance* and character._] #underline[_In conclusion, while_] admiration for celebrities #underline[_can be_] harmless and even motivating, #underline[_it is essential to maintain a balanced perspective._] It is crucial for individuals to cultivate their own identities and values rather than solely seeking validation through *imitation* of others. #underline[_Society should encourage a culture that celebrates_] individuality and personal achievements over *blind adulation of fame*. ===== 中文翻译 这些图片展示了两种模仿英国足球明星大卫·贝克汉姆的场景。第一张图片显示一个年轻人把“Beckham”的名字刺在脸上。第二张图片描绘了一个人花 300 元做了一个贝克汉姆的标志性发型。这些图片生动地展示了一些人为了表达对名人的钦佩所做出的努力。 这些图片反映了在现代社会中日益普遍的崇拜名人的现象。脸上纹身的那个人代表了这种现象的极端,人们永久性地在身体上留下标记以展示他们的奉献精神。第二张图片虽然不那么永久,但仍然突显了人们愿意投入时间和金钱来模仿他们偶像的程度。这种现象是由寻求身份认同和归属感的愿望以及不断美化名人及其生活方式的媒体影响所驱动的。 在我看来,这种崇拜名人的趋势既有积极的一面,也有消极的一面。积极的一面是,名人可以作为榜样,激励粉丝实现自己的目标并追求自己的激情。然而,更令人担忧的是消极的一面。过度的崇拜可能导致个体身份的丧失,人们优先考虑模仿偶像,而不是发展自己的独特品质。此外,它还可能助长一种重外表和生活方式而轻实质和品格的消费主义文化。 总之,尽管对名人的钦佩可以是无害甚至有激励作用的,但保持平衡的观点至关重要。个人应该培养自己的身份和价值观,而不是单纯通过模仿他人来寻求认同。社会应当鼓励一种庆祝个性和个人成就的文化,而不是对名人盲目的崇拜。 ==== version2 ===== The Influence of Celebrity Culture: A Reflective Analysis #underline[_The photos presented depict two scenes reflecting the influence of_] celebrity culture. #underline[_In the first image,_] a young man has the name "Beckham" tattooed prominently on his face. #underline[_In the second image,_] another young man is seen getting a haircut styled like <NAME>, a famous English football star, for 300 yuan. #underline[_These photos highlight a social phenomenon where_] individuals *go to great lengths to* emulate their idols, #underline[_often to extreme measures_]. This behavior is *indicative* of the powerful influence celebrities hold over their admirers, particularly among the youth. The act of tattooing a celebrity's name on one's face or spending a significant amount of money to replicate a famous hairstyle underscores *the depth of admiration* and the desire to identify closely with these public figures. #underline[_In my opinion, this phenomenon raises several important points for consideration._] #underline[_Firstly, it reflects the *pervasive reach* of media and popular culture in_] shaping personal identities and lifestyles. Celebrities, through their public *personas* and marketing, *create aspirational images* that many people seek to emulate. #underline[_This can have both positive and negative consequences. On the positive side,_] celebrities can inspire individuals to pursue their passions and dreams. #underline[_However, the negative aspect arises when_] the admiration *turns into an obsession*, #underline[_leading to actions that_] might be regretted later or that compromise an individual's well-being. #underline[_Furthermore, this trend *speaks to* the broader issue of societal values and the emphasis placed on external appearances and *materialism*._] The fact that individuals are willing to *undergo* physical alterations or spend considerable amounts of money to *mirror* a celebrity's look #underline[_suggests a prioritization of superficial attributes over intrinsic qualities_]. #underline[_It calls into question_] the role models that society *upholds* and the messages being conveyed to younger generations about self-worth and identity. #underline[In conclusion,] the photos of individuals emulating <NAME> through tattoos and hairstyles #underline[_serve as a potent illustration of the influence of_] celebrity culture. #underline[_While_] admiration for public figures #underline[_can be_] motivating, #underline[it is essential to maintain a balanced perspective and prioritize personal values and well-being over superficial *mimicry*.] #underline[_Society must encourage individuals to appreciate_] their unique identities and cultivate self-worth *from within* #underline[_rather than_] relying *solely* on *external validation*. ===== 名人文化的影响:反思分析 所展示的照片描绘了两种反映名人文化影响的场景。第一张照片中,一名年轻人在脸上显眼地纹上了“Beckham”的名字。第二张照片中,另一名年轻人正在以 300 元的价格理一个像英国著名足球明星大卫·贝克汉姆一样的发型。 这些照片突显了一种社会现象,即个人为模仿他们的偶像付出了巨大的努力,往往到了极端的地步。这种行为表明名人对其崇拜者,特别是年轻人,具有强大的影响力。在脸上纹上名人的名字或花费大量金钱去模仿一个著名的发型,强调了崇拜的深度和与这些公众人物紧密联系的愿望。 在我看来,这一现象提出了几个重要的考虑点。首先,它反映了媒体和流行文化在塑造个人身份和生活方式方面的广泛影响。名人通过他们的公众形象和营销,创造了许多人寻求模仿的理想形象。这可以带来积极和消极的后果。积极方面,名人可以激励个人追求他们的激情和梦想。然而,消极方面,当崇拜变成痴迷时,会导致可能在以后后悔的行为或妥协个人福祉的行为。 此外,这一趋势还涉及到更广泛的社会价值观问题,以及对外在外表和物质主义的强调。个人愿意进行身体改变或花费大量金钱来模仿名人的外表,这表明优先考虑外在属性而不是内在品质。这引发了对社会树立的榜样和传达给年轻一代关于自我价值和身份的信息的质疑。 总之,通过纹身和发型模仿大卫·贝克汉姆的照片,是名人文化影响力的有力说明。尽管对公众人物的崇拜可以带来动力,但必须保持平衡的视角,优先考虑个人价值和福祉,而不是肤浅的模仿。社会必须鼓励个人欣赏他们独特的身份,从内在培养自我价值,而不仅仅依赖外在的认可。 #pagebreak() === 07 #align(center)[ #image("./images/07.png", width: 60%) ] ==== version 1 ===== Essay #underline[_The drawing presents a scene from_] a soccer field, with a player preparing to *take a penalty shot*. #underline[_In the player's thought bubble,_] the goal appears vast, and the goalkeeper seems tiny and easily defeatable. #underline[_Conversely, in the goalkeeper's thought bubble,_] the goal appears narrow, and he himself seems larger and more *imposing*. #underline[_This clever illustration highlights the psychological aspect_] of perspective and confidence in challenging situations. #underline[_The intended meaning of this drawing is to demonstrate how_] perception *shapes* reality. The player's confidence in scoring is *bolstered* by his perception of the goal as large and the goalkeeper as insignificant. On the other hand, the goalkeeper's confidence in saving the shot is supported by his perception of himself as large and the goal as small. This divergence in perception illustrates how individuals interpret situations based on their mindset and confidence levels. To support this view, consider the example of public speaking. For a confident speaker, the audience may appear friendly and supportive, making the task seem easier and the speaker more likely to perform well. However, for someone with stage fright, the same audience may seem intimidating and judgmental, making the task appear daunting and increasing the likelihood of a poor performance. This difference in perception significantly impacts the outcomes, much like the soccer player's and goalkeeper's differing views affect their expectations of success. In conclusion, the drawing effectively underscores the importance of perspective and confidence in determining how we approach and handle challenges. By understanding that our perception can influence our reality, we can learn to manage our mindset and improve our performance in various situations. ===== 中文翻译 这幅画展示了一个足球场上的场景,一个球员准备罚点球。在球员的想象中,球门显得非常大,而守门员看起来很小,很容易被击败。相反,在守门员的想象中,球门显得狭窄,而他自己则显得庞大而令人畏惧。这幅巧妙的插图突出了在挑战性情境中,心理角度和信心的重要性。 这幅画的意图是展示感知如何塑造现实。球员对进球的信心因其对球门的宽大和守门员的无足轻重的感知而增强。另一方面,守门员对扑救的信心则来自于他对自己庞大和球门狭小的感知。这种感知上的分歧表明个体如何根据他们的心态和信心水平来解释情境。 为了支持这一观点,考虑一个公开演讲的例子。对于一个自信的演讲者来说,观众可能显得友好和支持,使任务看起来更容易,演讲者更有可能表现良好。然而,对于一个有舞台恐惧的人来说,同样的观众可能显得令人生畏和评判,使任务看起来艰巨,并增加表现不佳的可能性。这种感知上的差异显著影响了结果,就像足球运动员和守门员不同的看法影响了他们对成功的预期一样。 总之,这幅画有效地强调了视角和信心在我们处理挑战时的重要性。通过理解我们的感知可以影响我们的现实,我们可以学习管理我们的心态,并在各种情境中提高我们的表现。 ==== version2 ===== Perception and Reality: The Power of Perspective The drawing depicts two individuals on a soccer field. The player and the goalkeeper #underline[_each have different perceptions of the goal_]. The player sees the goal as very large with a tiny *goalkeeper*, #underline[_making it seem_] easier to score. *Conversely*, the goalkeeper #underline[_perceives the goal as_] much smaller with a large player, #underline[_making it seem_] more difficult to defend. #underline[_The intended meaning of this illustration is to highlight how_] perception can significantly influence one’s experience and actions. #underline[_It suggests that_] the way we view a situation can shape our confidence, approach, and ultimately, our performance. #underline[_This *discrepancy* in perception underscores the *subjective* nature of challenges and opportunities._] #underline[_In my opinion, this drawing effectively illustrates the psychological aspect of_] performance and competition. #underline[It reminds us that] our mindset and perspective *play crucial roles in* how we approach tasks and challenges. #underline[_This concept is particularly relevant in_] competitive settings #underline[_where_] mental attitude can be as important as physical ability. #underline[_An example that supports this view can be found in_] sports psychology. Athletes often use visualization techniques to enhance their performance. By imagining themselves succeeding, they can *boost their confidence* and improve their actual performance. This technique #underline[_is rooted in_] the understanding that perception shapes reality. For instance, a basketball player might visualize making *free throws* under pressure, which helps them perform better in real game situations. #underline[_This practice demonstrates_] how altering one’s perception can lead to *tangible* improvements in performance. #underline[_Another example can be drawn from_] *academic settings*. Students who perceive exams as *insurmountable* obstacles are likely to experience higher levels of anxiety and perform poorly. #underline[_On the other hand,_] those who view exams as *manageable* challenges are more likely to approach their studies with a positive attitude, leading to better preparation and higher scores. #underline[_This difference in perception can create a significant impact on_] their academic success. #underline[_In conclusion, the drawing emphasizes the powerful influence of_] perception on reality. By understanding and managing our perceptions, we can enhance our performance and effectively tackle challenges. #underline[_It encourages us to_] *adopt a positive and realistic view of* our abilities and the tasks ahead, #underline[_ultimately leading to_] greater success and fulfillment. ===== 认知与现实:视角的力量 这幅画展示了在足球场上的两个人。球员和守门员对球门有不同的看法。球员看到球门非常大,守门员很小,使得进球似乎更容易。相反,守门员认为球门非常小,球员非常大,使得守门变得更难。 这幅插图的意图是强调认知如何显著影响一个人的体验和行动。它表明我们看待情况的方式可以影响我们的信心、方法和最终表现。这种认知差异凸显了挑战和机会的主观性。 在我看来,这幅画有效地展示了表现和竞争的心理方面。它提醒我们,心态和视角在我们如何处理任务和挑战中起着至关重要的作用。这一概念在竞争环境中特别相关,在这种环境中,心理态度与身体能力同样重要。 支持这一观点的一个例子可以在运动心理学中找到。运动员经常使用可视化技术来提高表现。通过想象自己成功,他们可以增强信心并改善实际表现。这一技术基于认知塑造现实的理解。例如,篮球运动员可能会想象自己在压力下投中罚球,这有助于他们在实际比赛中表现更好。这种做法表明,改变认知可以带来实际的表现改善。 另一个例子可以来自学术环境。那些认为考试是不可逾越的障碍的学生可能会经历更高的焦虑水平并表现不佳。而那些将考试视为可管理挑战的学生则更有可能以积极的态度对待学习,从而准备得更好,成绩更高。这种认知差异对他们的学术成功产生了重大影响。 总之,这幅画强调了认知对现实的强大影响。通过理解和管理我们的认知,我们可以提高表现,有效应对挑战。它鼓励我们以积极和现实的态度看待自己的能力和前方的任务,从而带来更大的成功和满足感。 #pagebreak() === 08 #align(center)[ #image("./images/08.png", width: 60%) ] ==== Unity and Cooperation: Overcoming Challenges Together The drawing depicts two individuals, each with one leg, walking together with the aid of crutches. They are supporting each other as they move forward, #underline[_symbolizing mutual assistance and collaboration_]. #underline[_The accompanying text reads,_] "You have one leg, I have one leg; together, we travel north and south." #underline[_The intended meaning of this illustration is to highlight the power of_] cooperation and mutual support in overcoming challenges. It suggests that by working together and supporting each other, individuals can achieve greater things and navigate through difficulties more effectively. #underline[_The imagery of the two people, each missing a leg, emphasizes that despite individual limitations, collective effort can lead to success._] #underline[_In my opinion, this drawing effectively conveys a profound message about the importance of_] teamwork and *solidarity*. #underline[_It reminds us that no one is entirely *self-sufficient* and that collaboration is key to overcoming obstacles._] The idea that "together, we travel north and south" underscores *the limitless possibilities* when people *unite their strengths* and *compensate for each other's weaknesses*. #underline[_This concept is especially relevant in today's interconnected world, where complex challenges often require collective action and shared resources._] Whether in personal relationships, *professional settings*, or *larger societal contexts*, #underline[the principle of mutual support *fosters* resilience and innovation.] #underline[_The drawing also serves as a metaphor_] for *inclusivity* and the value of diverse contributions. #underline[_By recognizing and *leveraging* each other's unique abilities and perspectives, we can create more effective and harmonious communities._] #underline[_In conclusion, the illustration and its accompanying text highlight the essential role of_] cooperation in achieving common goals and overcoming individual limitations. It encourages us to *embrace* collaboration and support each other in our respective journeys, ultimately leading to *shared success and fulfillment*. ==== 团结与合作:共同克服挑战 这幅画展示了两个各自只有一条腿的人,他们借助拐杖一起行走。彼此相互支持,象征着互助与合作。附带的文字写道:“你一条腿,我一条腿;你我一起,走南闯北。” 这幅插图的意图是强调合作与互助的力量在克服挑战中的重要性。它表明通过合作和相互支持,个人可以实现更大的成就,更有效地应对困难。两个各缺一条腿的人形象强调了尽管个人有局限,但集体的努力可以带来成功。 在我看来,这幅画有效地传达了关于团队合作和团结的重要信息。它提醒我们,没有人是完全自给自足的,合作是克服障碍的关键。“你我一起,走南闯北”的理念强调了人们团结力量、互补长短时无限的可能性。 这个概念在当今互联的世界中尤为重要,因为复杂的挑战往往需要集体行动和共享资源。无论在个人关系、专业环境还是更大的社会背景中,互助的原则都能培养韧性和创新。该插图还作为包容性和多样性贡献价值的隐喻。通过认识和利用彼此独特的能力和观点,我们可以创造更有效和谐的社区。 总之,这幅插图及其附带的文字强调了合作在实现共同目标和克服个人局限中的重要作用。它鼓励我们在各自的旅程中拥抱合作,互相支持,最终实现共同的成功和满足感。 #pagebreak() === 09 #align(center)[ #image("./images/09.png", width: 60%) ] ==== The Paradox of Connectivity: Near and Far in the Digital Age The drawing depicts a web-like structure with numerous people interacting with various digital devices *within its segments*. Each individual *is engrossed in* their own screen, representing the vast network of connections facilitated by the internet. #underline[_The title of the drawing, "The Near and Far of the Internet," *encapsulates* the *dual* nature of digital connectivity._] #underline[_The intended meaning of this illustration is to highlight the paradox of_] the internet's ability #underline[_to_] simultaneously connect and distance us. #underline[_On one hand,_] the internet brings people together from across the globe, enabling instant communication and access to information. #underline[_On the other hand,_] it can create a sense of isolation as individuals become absorbed in their virtual interactions, often at the expense of real-world relationships. #underline[_In my opinion, this drawing effectively captures the complexities of our digital age._] It underscores the benefits of the internet, such as the ability to maintain long-distance relationships, access a wealth of knowledge, and participate in global communities. These advantages are especially *pertinent* in our increasingly globalized world, where digital communication tools have become *indispensable*. #underline[However, the drawing also serves as a *cautionary tale* about the potential downsides of] excessive internet use. The image of people *confined to* their screens suggests a disconnection from their immediate surroundings and physical communities. This isolation can #underline[_lead to a lack of_] meaningful personal interactions, reduced physical activity, and mental health issues such as anxiety and depression. #underline[_Therefore, the key takeaway from this illustration is_] the need for balance. While embracing the connectivity and opportunities provided by the internet, it is crucial to remain mindful of its impact on our real-world relationships and well-being. We should strive to integrate our digital and physical lives in a way that enhances rather than diminishes our overall quality of life. ==== 连接的悖论:数字时代的近与远 这幅画描绘了一个网状结构,许多人在其分段内与各种数字设备互动。每个人都沉浸在自己的屏幕中,代表了互联网促进的庞大连接网络。这幅画的标题“网络的‘近’与‘远’”概括了数字连接的双重性质。 这幅插图的意图是突出互联网同时连接和疏远我们的悖论。一方面,互联网将来自世界各地的人们聚集在一起,实现即时通信和信息访问。另一方面,它可能会造成一种孤立感,因为人们常常沉迷于虚拟互动,牺牲了现实世界中的关系。 在我看来,这幅画有效地捕捉了我们数字时代的复杂性。它强调了互联网的好处,例如维持长距离关系、获取丰富的知识和参与全球社区。这些优势在我们日益全球化的世界中尤为重要,数字通信工具已成为不可或缺的工具。 然而,这幅画也作为关于过度使用互联网潜在缺点的警示。人们被限制在屏幕上的图像暗示着与周围环境和实际社区的脱节。这种孤立可能导致缺乏有意义的个人互动、减少体力活动以及焦虑和抑郁等心理健康问题。 因此,这幅插图的主要教训是需要平衡。在拥抱互联网提供的连接和机会的同时,我们必须保持对其对现实世界关系和幸福感影响的关注。我们应努力将数字生活和现实生活结合起来,以增强而不是减少我们整体的生活质量。 #pagebreak() === 10 #align(center)[ #image("./images/10.png", width: 60%) ] ==== Cultural Hotpot: A Feast of Beauty and Nutrition The drawing depicts a "hotpot" *brimming with* various ingredients, #underline[_each representing_] different cultural elements. These elements, #underline[_labeled with terms such as_] "Structure," "*Etiquette*," "Old Customs," and "*Modernity*," among others, #underline[_symbolize the rich and diverse components that make up culture_]. #underline[_The hotpot itself, traditionally a *communal* meal where various ingredients are cooked together, serves as a *metaphor* for the blending and integration of these cultural elements._] #underline[The intended meaning of this illustration is to emphasize the] richness and *nourishing* quality of culture. #underline[_Just as_] a hotpot combines various ingredients to create a flavorful and nutritious meal, #underline[culture *amalgamates*] different traditions, customs, and values to form a *cohesive* and enriching experience. #underline[_The smoke rising from the center of the hotpot *signifies* the *dynamic* and *evolving* nature of culture, constantly blending and adapting to new influences while maintaining its *core essence*._] #underline[In my opinion, this *metaphor* is both *apt* and *insightful*.] Culture, #underline[_much like a_] hotpot, requires a balance of ingredients to *achieve its full potential*. #underline[_Each element contributes its unique flavor and value, creating_] a *tapestry* of shared experiences and mutual understanding. #underline[_This drawing also underscores the importance of_] preserving cultural diversity and heritage #underline[while *embracing* modern influences.] #underline[_It reminds us that_] culture is not static but an *ever-changing* and *living entity* that thrives on diversity and *inclusivity*. #underline[_By appreciating and integrating different *cultural elements*, we can create a more *harmonious* and enriched society._] ==== 文化火锅:美味与营养的盛宴 这幅画展示了一个装满各种食材的“火锅”,每种食材代表不同的文化元素。这些元素标有“结构”、“礼仪”、“老习俗”和“现代性”等术语,象征着构成文化的丰富多样的组成部分。火锅本身,作为一种将各种食材一起烹煮的传统共享餐,成为这些文化元素融合和整合的隐喻。 这幅插图的意图是强调文化的丰富性和营养性。正如火锅将各种食材结合在一起,创造出美味且有营养的餐点,文化将不同的传统、习俗和价值观融合在一起,形成一种连贯且充实的体验。火锅中心升起的烟雾象征着文化的动态和演变性质,不断融合和适应新的影响,同时保持其核心本质。 在我看来,这个隐喻既恰当又深刻。文化,就像火锅一样,需要平衡的成分来达到其全部潜力。每个元素都贡献其独特的风味和价值,创造出一种共同的体验和相互理解的拼图。这幅画还强调了在接受现代影响的同时,保护文化多样性和遗产的重要性。它提醒我们文化不是静止的,而是一种不断变化和活生生的实体,依靠多样性和包容性而繁荣。通过欣赏和整合不同的文化元素,我们可以创造一个更加和谐和丰富的社会。 #pagebreak() === 11 #align(center)[ #image("./images/11.png", width: 60%) ] ==== The Journey's Remnants: A Reflection on Environmental Responsibility #underline[_The drawing portrays_] a small boat, filled with tourists, floating on a river that *is littered with* various types of waste. The trash, *comprising* plastic bottles, food wrappers, and other debris, pollutes the water, #underline[_creating a stark contrast between_] the natural beauty of the river and the man-made waste *contaminating* it. #underline[_The intended meaning of this illustration is to highlight_] the environmental *degradation* caused by human activities, #underline[_particularly_] tourism. #underline[_The drawing serves as a powerful reminder of the negative impact_] that careless behavior can have on nature. The tourists, *seemingly* *oblivious* to the waste surrounding them, #underline[_represent the larger issue of how people often fail to recognize or address the environmental consequences of their actions._] #underline[In my opinion, this illustration is a *poignant* commentary on the importance of environmental responsibility.] #underline[_It underscores the need for greater awareness and *proactive* measures to_] protect our natural surroundings. #underline[_Tourism, while beneficial for_] economies and cultural exchange, #underline[_must be managed_] sustainably #underline[_to_] prevent harm to the environment. #underline[_This drawing also calls attention to the broader issue of_] waste management #underline[_and the necessity for_] individuals and communities to *adopt more eco-friendly practices*. By reducing waste, recycling, and promoting clean-up efforts, we can *mitigate* the damage caused to our ecosystems. #underline[_Ultimately, this image serves as a call to action, urging us to reflect on_] our environmental *footprint* and *make conscious efforts to* preserve the beauty and health of our planet. ==== 旅程之余:环境责任的反思 这幅画展示了一艘载满游客的小船,漂浮在被各种垃圾污染的河流上。这些垃圾包括塑料瓶、食品包装和其他废弃物,污染了水体,形成了自然美景与人为废物之间的鲜明对比。 这幅插图的意图是强调人类活动,特别是旅游业对环境的破坏。这幅画作为一个强有力的提醒,指出了不负责任的行为对自然的负面影响。游客们似乎没有意识到周围的垃圾,代表了人们常常未能认识或解决其行为对环境的后果的更大问题。 在我看来,这幅插图对环境责任的重要性做出了深刻的评论。它强调了提高环保意识和采取积极措施保护自然环境的必要性。旅游业虽然对经济和文化交流有益,但必须以可持续的方式管理,以防止对环境的破坏。这幅画还引起了对废物管理的广泛关注,呼吁个人和社区采取更加环保的做法。通过减少废物、回收利用和推广清洁活动,我们可以减轻对生态系统的破坏。最终,这幅图像呼吁我们反思自己的环境足迹,并努力保护地球的美丽和健康。 #pagebreak() === 12 #align(center)[ #image("./images/12.png", width: 60%) ] ==== Perspectives on Loss and Optimism: An Analysis #underline[_The drawing features_] two individuals reacting to a spilled bottle. #underline[_The person on the left, with a despondent expression, says,_] "It's all gone!" #underline[Meanwhile, the person on the right, displaying a more optimistic *demeanor*, remarks,] "Luckily, there's still some left." #underline[_This simple scene vividly illustrates the *contrasting* attitudes of *pessimism* and *optimism* when faced with the same situation._] #underline[_The intended meaning of this illustration is to highlight how_] individuals can *perceive* and respond to *adversity* in different ways. #underline[_The two characters represent opposing perspectives on loss and opportunity._] #underline[_While one focuses on_] what has been lost, #underline[_the other emphasizes_] what remains, #underline[_suggesting that_] attitude significantly influences how we *interpret* and handle challenges. #underline[_In my opinion, this drawing serves as a powerful reminder of the importance of_] maintaining *a positive outlook*, even in difficult circumstances. #underline[_Life is filled with unexpected setbacks and losses_], but how we choose to view these events can greatly affect our well-being and resilience. #underline[_The optimistic character in the illustration embodies_] a mindset that sees potential and hope, which can be incredibly *empowering* and motivating. #underline[_On the other hand, the *pessimistic* view, while natural and *understandable*, often leads to feelings of_] despair and helplessness. *Therefore*, *adopting a positive perspective* can help us *navigate through hardships* more effectively and find opportunities for growth and improvement. ==== 失落与乐观的观点:一个分析 这幅画展示了两个人对一个打翻的瓶子做出反应。左边的人表情沮丧地说:“全完了!”而右边的人则表现出更加乐观的态度,说:“幸好还剩点儿。”这个简单的场景生动地展示了在面对同一情况时,悲观与乐观的对比态度。 这幅插图的意图是强调个人在面对逆境时可以有不同的感知和反应。两个角色代表了对失落和机会的对立观点。一个人关注失去的东西,而另一个人则强调剩下的东西,暗示态度极大地影响我们如何解读和处理挑战。 在我看来,这幅画作为一个强有力的提醒,强调了在困难情况下保持积极心态的重要性。生活充满了意外的挫折和失落,但我们如何选择看待这些事件可以极大地影响我们的幸福感和韧性。插图中的乐观角色体现了一种看到潜力和希望的心态,这种心态可以极大地赋予人力量和动力。另一方面,悲观的观点虽然自然且可以理解,但往往会导致绝望和无助的感觉。因此,采用积极的视角可以帮助我们更有效地度过困难,并找到成长和改进的机会。 #pagebreak() === 13 #align(center)[ #image("./images/13.png", width: 60%) ] ==== Graduates at the Crossroads: Navigating Life's Choices #underline[_The drawing depicts_] a group of graduates standing at the edge of a *precipice*, facing a *myriad* of *divergent* paths. Each path is labeled with different life choices such as "Employment," "*Entrepreneurship*," "Study Abroad," and "*Civil Service*". The graduates appear *contemplative*, #underline[_each carrying a *backpack* symbolizing_] their *readiness* for the journey ahead. #underline[_The intended meaning of this illustration is to represent_] the crucial decisions that graduates must make #underline[_as they_] transition from academic life to the professional world. #underline[_It highlights_] the various paths available to them, #underline[_each with its own set of_] opportunities and challenges. This moment of choice is significant, as it will *shape* their future careers and personal lives. #underline[In my opinion, this drawing effectively captures the essence of the post-graduation *phase*.] #underline[_It underscores the importance of thoughtful_] decision-making and self-awareness. Graduates often find themselves at a *crossroads*, where they must evaluate their goals, values, and aspirations to choose a path that *aligns with* their *vision* for the future. #underline[_The illustration also emphasizes that_] there is no *singular* "correct" path; *rather*, each choice can lead to success and fulfillment if approached with dedication and a positive mindset. #underline[_This image serves as a reminder of the diverse opportunities that lie ahead for_] graduates. #underline[_It encourages them to embrace the uncertainty and potential of this transitional period, to_] seek guidance, #underline[_and to_] remain adaptable. By recognizing the significance of this moment and making informed choices, graduates can confidently embark on their journeys and contribute meaningfully to society. ==== 毕业生在十字路口:导航人生的选择 这幅画展示了一群毕业生站在悬崖边,面对多条岔路。每条路都标有不同的人生选择,如“就业”、“创业”、“出国留学”和“公务员”。毕业生们看起来在思考,每个人都背着象征他们准备好迎接前方旅程的背包。 这幅插图的意图是代表毕业生从学术生活过渡到职业世界时必须做出的关键决策。它突出了他们面前的各种道路,每条路都有其自身的机遇和挑战。这个选择的时刻非常重要,因为它将决定他们未来的职业和个人生活。 在我看来,这幅画有效地捕捉了毕业后阶段的本质。它强调了深思熟虑的决策和自我意识的重要性。毕业生常常发现自己站在十字路口,他们必须评估自己的目标、价值观和愿望,以选择与他们未来愿景相符的道路。插图还强调,没有单一的“正确”道路;相反,如果以奉献和积极的心态来对待,每种选择都能通向成功和满足。 这幅图像提醒我们,毕业生面前有各种各样的机会。它鼓励他们拥抱这一过渡时期的不确定性和潜力,寻求指导,并保持适应性。通过认识到这一时刻的重要性并做出明智的选择,毕业生可以自信地开始他们的旅程,并对社会做出有意义的贡献。 #pagebreak() === 14 #align(center)[ #image("./images/14.png", width: 60%) ] ==== The Passage of Time: A Reflection on Intergenerational Bonds #underline[The drawing is divided into two panels.] #underline[_The left panel shows a scene from thirty years ago, where_] a young mother is holding the hand of her little daughter, who is carrying a doll. #underline[_The right panel depicts the same pair in the present day, with_] the daughter now grown up and the mother elderly. The daughter is supporting her mother as they walk together, #underline[symbolizing] *the reversal of roles* over time. #underline[_The intended meaning of this illustration is to highlight the enduring bond between_] parents and children and the natural *progression* of life. #underline[It poignantly captures the cycle of] caregiving, #underline[_where those who_] once cared for us eventually come to rely on our care. #underline[_This transition is a *testament* to_] the strength of familial relationships and *the deep sense of duty* and love that *sustains* them through the years. #underline[_In my opinion, this drawing beautifully *encapsulates* the essence of *intergenerational* bonds._] #underline[_It serves as a reminder of_] the inevitable passage of time and the importance of cherishing and nurturing these relationships. As children, we often take our parents' care for granted, but as we grow older, we come to understand and appreciate the sacrifices they made for us. #underline[_This realization brings a sense of gratitude and a commitment to *reciprocate* that care when they need it most._] #underline[_The drawing also emphasizes the emotional and moral responsibility we have_] towards our aging parents, #underline[_highlighting the virtues of_] compassion, respect, and support. #underline[It encourages us to reflect on] our own *family dynamics* and to #underline[_ensure that we honor and preserve the bonds that define and enrich our lives_]. ==== 时光流逝:代际纽带的反思 这幅画分为两个部分。左边的画面展示了三十年前的场景,一个年轻的母亲牵着小女儿的手,女儿抱着一个娃娃。右边的画面展示了现在的同一对母女,女儿已经长大,母亲变老了。女儿搀扶着母亲一起走路,象征着随着时间的推移角色的逆转。 这幅插图的意图是突出父母与子女之间持久的纽带以及生命的自然进程。它深刻地捕捉到了照顾的循环,那些曾经照顾我们的人最终依赖我们的照顾。这种转变见证了家庭关系的力量以及维持这些关系的深厚责任感和爱。 在我看来,这幅画美丽地概括了代际纽带的本质。它提醒我们时间的不可避免的流逝,以及珍惜和培育这些关系的重要性。作为孩子,我们常常认为父母的照顾是理所当然的,但随着我们长大,我们开始理解并感激他们为我们所做的牺牲。这种认识带来了感恩的心情和在他们最需要时回报照顾的承诺。这幅画还强调了我们对年迈父母的情感和道德责任,突出了同情、尊重和支持的美德。它鼓励我们反思自己的家庭动态,确保我们尊重并保持那些定义和丰富我们生活的纽带。 #pagebreak() === 15 #align(center)[ #image("./images/15.png", width: 60%) ] ==== The Smartphone Era: A Modern Gathering #underline[The drawing illustrates a contemporary social] *gathering*, where four individuals are seated around a table laden with food. Instead of *engaging with* each other, each person is absorbed in their smartphone. #underline[_Despite being physically present, they are mentally distant, engrossed in the virtual world._] #underline[_The intended meaning of this illustration is to comment on the pervasive influence of_] smartphones on social interactions. #underline[_It underscores how_] modern technology, #underline[_while_] connecting us to the wider world, #underline[_can simultaneously_] disconnect us from the people immediately around us. #underline[_This paradox highlights the challenge of_] maintaining genuine human connections in an era *dominated* by digital communication. #underline[_In my opinion, this drawing serves as a poignant reminder of the need to_] balance our digital lives with real-world interactions. While smartphones and other devices offer convenience and connectivity, they should not replace face-to-face communication and *the deep bonds* that come from it. #underline[_The illustration suggests that_] we often miss out on meaningful moments and conversations #underline[_because we are too engrossed in_] our screens. #underline[_It calls for a more mindful approach to_] technology use, #underline[_encouraging us to_] put down our devices and engage more fully with those around us. #underline[_By doing so, we can foster richer relationships and a greater sense of community._] #underline[_This balance is essential for_] our emotional well-being and the overall quality of our social interactions. ==== 手机时代的聚会 这幅画展示了一个现代社交聚会,四个人围坐在摆满食物的桌子旁。尽管他们在身体上是聚在一起的,但每个人都沉浸在自己的智能手机中。虽然他们在身体上是聚在一起的,但精神上却是远离的,沉迷于虚拟世界中。 这幅插图的意图是评论智能手机对社交互动的广泛影响。它强调了现代科技在将我们连接到更广阔的世界的同时,也能使我们与周围的人断开联系。这一矛盾突显了在数字通信主导的时代保持真正的人际关系的挑战。 在我看来,这幅画作为一个深刻的提醒,强调了平衡数字生活与现实世界互动的必要性。尽管智能手机和其他设备提供了便利和连接,但它们不应取代面对面的交流和由此产生的深厚纽带。这幅插图表明,由于我们过于沉迷于屏幕,我们常常错过有意义的时刻和对话。它呼吁我们更有意识地使用科技,鼓励我们放下设备,与周围的人更充分地互动。通过这样做,我们可以培养更丰富的关系和更强的社区意识。这种平衡对我们的情感健康和整体社交互动质量至关重要。 #pagebreak() === 16 #align(center)[ #image("./images/16.png", width: 60%) ] ==== Leading by Example: The Power of Actions over Words #underline[_The drawing is split into two panels._] #underline[_In the first panel,_] a parent is seen relaxing on a chair, *engrossed in* a mobile phone while watching television. The parent commands the child, "Son, you need to study hard!" The child, sitting at a table with a pile of books, appears disheartened by the parent's words. #underline[_In the second panel,_] the scenario shifts: the parent is now seated at a table, diligently studying alongside the child. #underline[_Both are focused on their work, creating a shared atmosphere of dedication and effort._] #underline[_The intended meaning of this illustration is to emphasize the importance of_] leading by example #underline[_rather than merely_] issuing directives. It suggests that actions speak louder than words, #underline[_particularly in the context of_] parenting and mentorship. When parents or mentors demonstrate the behaviors they wish to *instill* in their children or mentees, #underline[_it fosters an environment of_] mutual respect and motivation. #underline[_This approach is far more effective than_] just imposing expectations without modeling the desired conduct. #underline[_In my opinion, this drawing effectively conveys a crucial lesson about the influence of_] role models. #underline[_It highlights that_] children are highly perceptive and are more likely to emulate the behaviors they observe rather than follow verbal instructions. #underline[_This underscores the responsibility of_] parents and mentors to embody the values and habits they wish to instill. #underline[_By participating actively in the learning or working process,_] adults can inspire and encourage younger individuals to adopt similar attitudes *towards their responsibilities*. This mutual engagement #underline[_not only strengthens the relationship but also cultivates a culture of continuous improvement and shared commitment_]. ==== 以身作则:行动胜于言语 这幅画分为两部分。在第一部分中,一个家长正悠闲地坐在椅子上,沉迷于手机和电视。他对孩子说:“儿子,你给我好好学习!”孩子坐在堆满书籍的桌子旁,看起来因家长的话而沮丧。在第二部分,情景发生了变化:家长现在坐在桌子旁,认真地和孩子一起学习。两人都专注于自己的工作,营造出一种共同努力的氛围。 这幅插图的意图是强调以身作则的重要性,而不仅仅是发号施令。它表明行动胜于言语,特别是在育儿和指导方面。当家长或导师展示他们希望孩子或被指导者养成的行为时,它会营造一种相互尊重和激励的环境。这种方法远比仅仅提出期望而不树立榜样更为有效。 在我看来,这幅画有效地传达了关于榜样影响的重要教训。它突出了孩子的高度感知力,他们更可能模仿他们观察到的行为,而不是遵循口头指示。这强调了家长和导师承担起体现他们希望灌输的价值观和习惯的责任。通过积极参与学习或工作过程,成年人可以激发和鼓励年轻人对其责任采取类似的态度。这种相互参与不仅加强了关系,还培养了持续改进和共同承诺的文化。 #pagebreak() === 17 #align(center)[ #image("./images/17.png", width: 60%) ] ==== Owning Books vs. Reading Books: A Reflection on True Learning #underline[_The drawing is divided into two panels._] #underline[_In the first panel,_] an individual *reclines* in a chair, surrounded by shelves filled with books, exclaiming, "I have so many books!" #underline[_The second panel shows_] a different individual sitting at a desk with a few books open in front of them, stating, "I strive to read 20 books this year." #underline[_This contrast between the two panels highlights the difference between_] merely possessing books and actively engaging with them through reading. #underline[_The intended meaning of this illustration is to emphasize the distinction between_] owning books and the act of reading them. #underline[It underscores that the mere] possession of books #underline[_does not equate to_] acquiring knowledge or wisdom. #underline[_True learning comes from_] reading, understanding, and reflecting on the content of books, #underline[_rather than_] just accumulating them as physical objects. #underline[_In my opinion, this drawing effectively captures a fundamental truth about_] the pursuit of knowledge. #underline[_It serves as a reminder that_] having access to resources is only the first step; #underline[_what truly matters is how we utilize_] those resources. #underline[_In today's society, where information is readily available, it is easy to *fall into the trap of* equating possession with knowledge._] However, #underline[_the real value lies in the effort we put into_] comprehending and applying the information we gather. #underline[_This illustration encourages us to focus on the_] quality of our learning experiences #underline[_rather than_] the quantity of our possessions. #underline[_By dedicating time and effort to_] reading and understanding, #underline[_we can achieve deeper insights and make meaningful contributions to_] our personal and professional lives. ==== 拥有书籍与阅读书籍:对真正学习的反思 这幅画分为两部分。在第一部分,一个人斜倚在椅子上,周围是装满书籍的书架,他感叹道:“我有这么多书!”第二部分展示了另一个人坐在桌旁,面前摊开几本书,他说:“我争取今年读完 20 本书。”这两部分之间的对比突显了拥有书籍与通过阅读积极参与书籍内容之间的区别。 这幅插图的意图是强调拥有书籍与阅读书籍之间的区别。它强调仅仅拥有书籍并不等于获得知识或智慧。真正的学习来自于阅读、理解和反思书籍的内容,而不是仅仅将书籍作为物品积累。 在我看来,这幅画有效地捕捉了关于追求知识的基本真理。它提醒我们,拥有资源只是第一步;真正重要的是我们如何利用这些资源。在当今社会,信息随手可得,很容易陷入将拥有等同于知识的陷阱。然而,真正的价值在于我们为理解和应用所收集的信息所付出的努力。这幅插图鼓励我们专注于学习体验的质量,而不是拥有的数量。通过投入时间和努力去阅读和理解,我们可以获得更深刻的见解,并对我们的个人和职业生活做出有意义的贡献。 #pagebreak() === 18 #align(center)[ #image("./images/18.png", width: 60%) ] ==== version 1 ===== Balancing Course Selection: Challenges and Pragmatism #underline[_The picture depicts_] a student sitting at a desk, #underline[_engaging with_] a course selection system on a laptop. #underline[_Surrounding the student are two thought bubbles._] #underline[_The bubble on the left reads_], "New knowledge, innovative, challenging," #underline[_while the one on the right states,_] "High grades, easy to pass, less homework." #underline[_These two sets of considerations reflect the dilemma students face when_] selecting courses. #underline[_This illustration highlights the contrast between_] intellectual curiosity and academic pragmatism. #underline[_On one side_], students are attracted to courses that offer new knowledge, innovation, and challenges, which are essential for personal growth and intellectual development. #underline[_On the other side,_] the need for high grades, easy passes, and manageable workloads reflects a *pragmatic* approach driven by the pressures of academic success and future career *prospects*. #underline[_In my opinion, this image effectively captures the complex decision-making process involved in_] course selection. #underline[_It underscores the reality that_] students must navigate between their desire for meaningful learning experiences and the practical considerations of maintaining a high GPA and managing their workload. #underline[This duality is not just a reflection of students' *aversion* to difficulty but also a response to the broader educational and societal pressures.] #underline[_While it is easy to criticize_] students for *opting* for easier courses, #underline[_it is essential to understand the underlying factors that drive these choices._] The educational system #underline[_often places a significant emphasis on_] grades and standardized testing, which can *discourage* students from taking on more challenging courses that might *negatively impact* their GPA. *Additionally*, *societal expectations* and *the competitive job market* #underline[_further reinforce the need for_] high academic performance. #underline[_To address this issue, a collective effort is required from_] educators, policymakers, and society *as a whole*. Schools should strive to create an environment that values *intellectual curiosity* and *critical thinking* as much as academic success. Providing support systems such as academic *counseling*, flexible grading policies, and opportunities for experiential learning can help students feel more confident in pursuing challenging courses. #underline[_In conclusion, the picture illustrates the balancing act that_] students face in course selection, torn between the pursuit of knowledge and the need for academic pragmatism. #underline[_Understanding and addressing the root causes of this dilemma requires a *comprehensive* approach that involves all *stakeholders* in the education system._] ===== 平衡选课:挑战与实用主义 这幅图画展示了一名学生坐在桌前,使用笔记本电脑上的选课系统。学生周围有两个思考泡泡。左边的泡泡写着“新知识、创新、有挑战性”,而右边的泡泡则写着“高分、易通过、作业少”。这两组考虑因素反映了学生在选课时面临的困境。 这幅插图突出了知识好奇心与学术实用主义之间的对比。一方面,学生被提供新知识、创新和挑战的课程所吸引,这对于个人成长和智力发展至关重要。另一方面,对高分、易通过和可管理的工作量的需求反映了一种由学术成功和未来职业前景驱动的务实态度。 在我看来,这幅图画有效地捕捉了选课过程中复杂的决策过程。它强调了学生在寻求有意义的学习经历与保持高 GPA 和管理工作量的实际考虑之间的现实。这种二元性不仅反映了学生对困难的厌恶,也反映了对更广泛的教育和社会压力的回应。 虽然容易批评学生选择更容易的课程,但理解驱动这些选择的基本因素是至关重要的。教育系统通常高度重视成绩和标准化考试,这可能会阻止学生选择那些可能会对 GPA 产生负面影响的更具挑战性的课程。此外,社会期望和竞争激烈的就业市场进一步强化了对高学术成绩的需求。 要解决这个问题,需要教育者、政策制定者和整个社会的共同努力。学校应努力创造一个重视智力好奇心和批判性思维与学术成功同等的环境。提供学术辅导、灵活的评分政策和体验式学习机会等支持系统,可以帮助学生更有信心地追求挑战性课程。 总之,这幅图画说明了学生在选课时面临的平衡,徘徊在追求知识与学术实用主义之间。理解并解决这一困境的根本原因需要一个综合的方法,涉及教育系统中的所有利益相关者。 ==== version 2 ===== The Dilemma of Course Selection: Balancing Interest and Practicality #underline[_The picture illustrates_] a student sitting in front of a laptop, engrossed in selecting courses. The screen displays a course selection system, while thought bubbles around the student reflect various considerations: "New knowledge," "Innovative," "Challenging," *versus* "High grades," "Easy to pass," and "Less homework." #underline[_This illustration highlights a significant dilemma students face during_] course selection: #underline[_the choice between_] pursuing *intellectually stimulating* and challenging courses or opting for easier courses that guarantee higher grades and less workload. This *dichotomy* #underline[_reflects a broader issue in_] educational systems, #underline[_where_] students must balance their academic interests with practical considerations, such as GPA and time management. #underline[_In my view, this drawing effectively captures the complexities of_] academic decision-making. #underline[_It underscores the tension between_] the desire for personal and intellectual growth and the *pragmatic* need to maintain a high GPA and manage a reasonable workload. #underline[_This dilemma is not merely a reflection of_] students' *aversion* to difficulty #underline[_but also indicative of_] the pressures *imposed* by *societal and educational expectations*. Students often face significant pressure to achieve high grades, which can lead them to prioritize courses that are perceived as easier and more manageable. This *pragmatic* #underline[_mindset is reinforced by_] educational systems that *place a heavy emphasis on* grades as a measure of success. *Consequently*, students might *shy away from* courses that, while challenging and intellectually rewarding, might *jeopardize* their GPA. #underline[_However, this issue cannot be solely attributed to_] students. Societal attitudes and school systems *play a crucial role in* shaping students' choices. The emphasis on grades and the competitiveness of academic and job markets *contribute to* this pragmatic approach. #underline[_To address this issue, a collective effort is needed from_] educators, policymakers, and society *at large* to create an environment where intellectual curiosity and personal growth are valued *alongside* academic performance. #underline[_In conclusion, the picture highlights the ongoing struggle_] students face in balancing their academic interests with practical considerations. While internal factors influence students' choices, societal and systemic pressures are equally significant. A *holistic* approach that encourages intellectual exploration and values diverse measures of success is essential to *resolving this dilemma*. ===== 选课困境:平衡兴趣与实用性 这幅画展示了一名学生坐在笔记本电脑前,专心致志地选择课程。屏幕上显示的是选课系统,而学生周围的思考泡泡反映了各种考虑因素:“新知识”、“创新”、“有挑战性”与“高分”、“易通过”、“作业少”之间的对比。 这幅插图突显了学生在选课时面临的重大困境:在追求智力上有吸引力且具有挑战性的课程与选择能保证高分和较少工作量的容易课程之间做出选择。这种二分法反映了教育系统中的更广泛问题,即学生必须在学术兴趣与实际考虑之间找到平衡,例如 GPA 和时间管理。 在我看来,这幅画有效地捕捉了学术决策的复杂性。它强调了个人和智力成长的愿望与保持高 GPA 和管理合理工作量的实际需要之间的紧张关系。这种困境不仅反映了学生对困难的厌恶,还反映了社会和教育期望带来的压力。 学生往往面临取得高分的巨大压力,这可能导致他们优先考虑被认为更容易和更易管理的课程。这种务实的心态受到重视成绩作为成功衡量标准的教育系统的强化。因此,学生可能会回避那些虽然具有挑战性和智力回报但可能危及 GPA 的课程。 然而,这一问题不能仅仅归咎于学生。社会态度和学校制度在塑造学生的选择方面发挥了至关重要的作用。对成绩的重视和学术及就业市场的竞争性助长了这种务实的方法。要解决这一问题,需要教育工作者、政策制定者和整个社会的共同努力,营造一个智力好奇心和个人成长与学术表现同样受到重视的环境。 总之,这幅图画突显了学生在平衡学术兴趣与实际考虑方面面临的持续斗争。尽管内部因素影响学生的选择,但社会和系统的压力同样重要。鼓励智力探索并重视多样化成功衡量标准的整体方法对于解决这一困境至关重要。 #pagebreak() === 19 #align(center)[ #image("./images/19.png", width: 60%) ] ==== version 1 ===== A Journey: The Importance of Perseverance and Rest The drawing shows two hikers on a mountainous path. One hiker is sitting on the steps, exhausted, saying, "I'm tired, I can't climb anymore." The other hiker, standing and offering a bottle of water, encourages, "Don't give up! Rest for a while and then continue climbing." #underline[_This scene captures a moment of_] struggle and support during a challenging journey. #underline[_The intended meaning of this illustration is to emphasize the significance of_] perseverance and #underline[_the role of_] encouragement and rest in overcoming difficulties. #underline[_It highlights that while_] persistence is crucial in achieving goals, #underline[_it is equally important to_] recognize when to take a break and seek support from others. #underline[_The dialogue between the two hikers symbolizes the balance between effort and rest, illustrating_] that even when one feels overwhelmed, taking a moment to *recharge* can *renew the strength to continue*. #underline[_In my opinion, this drawing effectively conveys a powerful message about_] resilience and the importance of *mutual* support. #underline[_It reminds us that_] every challenging journey, whether *literal* or *metaphorical*, *is fraught with* moments of doubt and fatigue. However, the presence of a supportive companion #underline[_can make a significant difference in_] helping us *push through our limits*. #underline[_This image also underscores the necessity of_] self-care; #underline[_knowing when to rest is not a sign of weakness but a strategy for *long-term success*_]. By pausing to recuperate, we can maintain our physical and mental well-being, ensuring we have the *stamina* to reach our goals. ===== 途中的旅程:坚持与休息的重要性 这幅画展示了两个登山者在山间小路上。一个登山者坐在台阶上,筋疲力尽地说:“累了,我不爬了。”另一个登山者站着,递给他一瓶水,鼓励道:“别呀!休息一下再接着爬。”这个场景捕捉了在艰难旅途中挣扎和支持的时刻。 这幅插图的意图是强调坚持的重要性以及鼓励和休息在克服困难中的作用。它强调了在实现目标时,尽管坚持至关重要,但同样重要的是认识到何时需要休息和寻求他人的支持。两个登山者之间的对话象征着努力与休息之间的平衡,表明即使在感到不堪重负时,花时间恢复精力也能重新激发继续前进的力量。 在我看来,这幅画有效地传达了关于韧性和相互支持的重要信息。它提醒我们,每一段艰难的旅程,无论是字面上的还是隐喻性的,都充满了怀疑和疲惫的时刻。然而,有一个支持的伙伴在身边,可以显著帮助我们突破极限。这个图像还强调了自我照顾的必要性;知道何时休息不是软弱的表现,而是长期成功的策略。通过暂停恢复,我们可以保持身心健康,确保我们有足够的耐力达到目标。 ==== version 2 ===== Perseverance and Rest: A Balanced Approach to Challenges #underline[_The drawing depicts_] two individuals taking a break on a staircase during a hike. One person, looking exhausted, says, "I'm tired, I can't go on." The other person, offering a water bottle, encourages, "Don't give up! Take a rest and then continue." #underline[_The background shows a series of hills, *suggesting* a challenging but scenic journey._] #underline[_The intended meaning of this illustration is to highlight the importance of_] perseverance #underline[while also recognizing] the need for rest. It suggests that while it is natural to feel tired and overwhelmed during difficult tasks, taking breaks and recharging can help us continue our journey more effectively. The encouragement to rest and then proceed reflects a balanced approach to tackling challenges, emphasizing resilience and self-care. #underline[_In my opinion, this drawing effectively communicates a valuable lesson about_] handling difficulties. #underline[_It underscores the significance of_] persistence in achieving goals #underline[_while also acknowledging that_] rest is *an essential component of endurance*. Often, people feel compelled to push through fatigue #underline[_without considering the benefits of_] taking a moment to recover. This can lead to burnout and *diminished* productivity. #underline[_The illustration reminds us that *pausing to rest* is not a sign of weakness but *a strategic move* to sustain our efforts *over the long haul*._] #underline[_Moreover, the supportive interaction between the two individuals highlights the importance of_] encouragement and support from others. Having someone to motivate us during tough times can make a significant difference in our ability to persevere. #underline[This drawing serves as a *metaphor* for] life's challenges, encouraging us to *adopt a balanced approach* that includes both determination and self-care. ===== 坚持与休息:应对挑战的平衡方法 这幅画展示了两个人在徒步旅行中在楼梯上休息的情景。一个人看起来很疲惫,说:“累了,我不爬了。”另一个人递上水瓶,鼓励道:“别呀!休息一下再接着爬。”背景显示了一系列的山丘,暗示着一段具有挑战但风景优美的旅程。 这幅插图的意图是强调坚持的重要性,同时也认识到休息的必要性。它表明,在面对困难任务时感到疲倦和不堪重负是很自然的,通过休息和充电可以帮助我们更有效地继续旅程。休息后再前行的鼓励反映了应对挑战的平衡方法,强调了韧性和自我照顾。 在我看来,这幅画有效地传达了一个关于应对困难的宝贵教训。它强调了在实现目标过程中坚持不懈的重要性,同时也承认休息是持久力的一个重要组成部分。人们常常感到有必要在疲劳中硬撑过去,而不考虑休息片刻带来的好处。这可能导致倦怠和生产力下降。插图提醒我们,暂停休息不是软弱的表现,而是为了长久努力的战略举措。 此外,两个人之间的支持互动突显了他人鼓励和支持的重要性。在艰难时期,有人鼓励我们可以显著提升我们坚持下去的能力。这幅画作为生活挑战的隐喻,鼓励我们采用一种包括决心和自我照顾的平衡方法。 #pagebreak() === 20 #align(center)[ #image("./images/20.png", width: 60%) ] ==== Habits: Procrastination vs. Proactivity #underline[_The drawing is divided into two panels, each depicting a different individual_] with *contrasting* work habits. #underline[_In the left panel,_] a girl is *diligently* working at her desk, surrounded by stacks of papers. #underline[_She remarks,_] "I feel at ease only when I finish my tasks early." #underline[_In the right panel,_] a boy *reclines* casually in his chair with minimal work materials in front of him, saying, "I won't start until the last minute." #underline[_The intended meaning of this illustration is to contrast two common approaches to_] task management: *proactive* versus *procrastinative*. #underline[_The girl represents those who prefer to_] complete their work ahead of time to avoid *last-minute stress*, #underline[_while the boy exemplifies those who_] delay their tasks until the deadline is *imminent*. #underline[_This juxtaposition highlights the impact of different habits_] on productivity and stress levels. #underline[_In my opinion, this drawing effectively captures the essence of two divergent approaches_] to work. #underline[_It underscores the benefits of_] proactivity, #underline[_such as_] reduced stress and a sense of accomplishment. By starting tasks early, individuals can manage their time more effectively, #underline[_allowing for unexpected challenges and *revisions*_]. #underline[_This approach often leads to higher quality work and a more balanced lifestyle._] #underline[Conversely, the illustration also highlights the *drawbacks* of] procrastination. Delaying tasks can result in heightened stress and a rushed, lower-quality output. While some individuals may believe they work better under pressure, this habit can lead to chronic stress and a negative impact on overall well-being. #underline[_Ultimately, the drawing serves as a reminder of the importance of_] cultivating effective work habits. Adopting a proactive approach can #underline[_significantly enhance_] productivity and reduce stress, #underline[_leading to a more *fulfilling* and successful academic or professional life._] ==== 习惯:拖延与积极主动 这幅画分为两部分,每部分展示了一个具有不同工作习惯的个体。在左边的画面中,一个女孩在她的书桌前勤奋地工作,周围堆满了文件。她说:“尽早完成才放心。”在右边的画面中,一个男孩悠闲地靠在椅子上,面前只有很少的工作材料,他说:“不到最后不动手。” 这幅插图的意图是对比两种常见的任务管理方法:积极主动与拖延。女孩代表那些喜欢提前完成工作以避免最后一刻压力的人,而男孩则代表那些直到截止日期临近才开始工作的人。这种对比突显了不同习惯对生产力和压力水平的影响。 在我看来,这幅画有效地捕捉了两种不同工作方法的本质。它强调了积极主动的好处,如减少压力和成就感。通过提前开始任务,个体可以更有效地管理时间,应对意外挑战和修改。这种方法通常会导致更高质量的工作和更平衡的生活方式。 相反,插图还突显了拖延的缺点。拖延任务会导致压力增加和匆忙、质量较低的产出。虽然有些人可能认为自己在压力下工作更好,但这种习惯会导致慢性压力并对整体健康产生负面影响。 最终,这幅画提醒我们培养有效工作习惯的重要性。采用积极主动的方法可以显著提高生产力和减少压力,从而带来更充实和成功的学术或职业生活。 #pagebreak() === 21 #align(center)[ #image("./images/21.png", width: 60%) ] ==== Following Your Passion: The Importance of Personal Fulfillment #underline[_The drawing depicts a conversation between a father and his child._] The child, dressed in a *clown* costume and holding a *prop*, says, "Dad, many classmates think learning to sing and act is not fun." The father responds, "Do you like it yourself? That's enough." #underline[_This exchange highlights the *contrast* between *societal expectations* and *personal satisfaction*._] #underline[_The intended meaning of this illustration is to emphasize the importance of_] pursuing personal passions and interests, #underline[_regardless of external opinions._] #underline[_It suggests that *personal fulfillment* and happiness should *take precedence over* *conforming* to the *preferences* or judgments of others._] The father's response *underscores* the value of *self-acceptance* and the courage to *follow one's unique path*. #underline[_In my opinion, this drawing effectively conveys a crucial message about the significance of_] individual passion and fulfillment. #underline[_It reminds us that_] each person has unique interests and talents, #underline[_which should be nurtured and celebrated._] #underline[_In a world where societal norms and peer pressure often *dictate* what is considered valuable or worthwhile, this illustration encourages us to prioritize our own happiness and personal growth._] #underline[_Moreover, the father's supportive attitude serves as a model for how_] parents and mentors can positively influence the development of self-confidence and individuality in children. By affirming the child's interests and encouraging them to pursue what they love, the father helps foster a sense of *self-worth* and *resilience against external criticism*. This approach not only *enhances the child's emotional well-being* but also *empowers them to achieve their fullest potential*. #underline[_In conclusion, this drawing serves as a powerful reminder to_] value and support personal passions. It encourages us to seek fulfillment *in our own terms* and to provide the same encouragement to others, #underline[_especially the younger generation_]. By doing so, we can create *a more inclusive and supportive environment* where everyone is free to pursue their dreams and *achieve their true potential*. ==== 追随你的热情:个人满足感的重要性 这幅画展示了一对父子之间的对话。孩子穿着小丑服装,拿着道具,说:“爸爸,很多同学觉得学唱戏不好玩。”父亲回答道:“你自己不是喜欢吗?那就足够了。”这一交流突出了社会期望与个人满足感之间的对比。 这幅插图的意图是强调追求个人热情和兴趣的重要性,而不管外界的看法。它表明个人的满足感和幸福感应该优先于迎合他人的偏好或判断。父亲的回答强调了自我接受和有勇气走自己独特道路的价值。 在我看来,这幅画有效地传达了关于个人热情和满足感的重要信息。它提醒我们每个人都有独特的兴趣和才能,应该被培养和庆祝。在一个社会规范和同伴压力经常决定什么被认为是有价值或有意义的世界里,这幅插图鼓励我们优先考虑自己的幸福和个人成长。 此外,父亲的支持态度是家长和导师如何积极影响孩子的自信心和个性发展的榜样。通过肯定孩子的兴趣并鼓励他们追求自己喜欢的事物,父亲帮助培养了自尊感和抵抗外界批评的韧性。这种方法不仅提高了孩子的情感健康,还使他们能够发挥最大的潜力。 总之,这幅画作为一个强有力的提醒,提醒我们要重视和支持个人热情。它鼓励我们按照自己的方式寻求满足感,并为他人,尤其是年轻一代提供同样的鼓励。通过这样做,我们可以创造一个更加包容和支持的环境,让每个人都可以自由追求自己的梦想,实现自己的真正潜力。 #pagebreak() === 22 #align(center)[ #image("./images/22.png", width: 60%) ] ==== The Value of Broadening Horizons: Attending Campus Lectures The drawing shows two students standing in front of a notice board advertising a campus lecture. The girl on the left *expresses her doubts by saying*, "It's not related to our major. Listening to it won't be of much use." The boy on the right *responds optimistically*, "Let's go and listen; it will surely be beneficial." #underline[_This scene depicts a common situation where_] students evaluate the *relevance* and potential benefits of *extracurricular* activities. #underline[_The intended meaning of this illustration is to highlight the importance of_] being open-minded and taking advantage of diverse learning opportunities, #underline[even those seemingly] unrelated to one's primary field of study. It suggests that knowledge from various disciplines can provide unexpected benefits and contribute to a *well-rounded* education. #underline[_In my opinion, this drawing effectively conveys a significant message about the value of_] intellectual curiosity and the pursuit of knowledge beyond one's immediate area of expertise. #underline[_It underscores the idea that education should not be confined to a narrow focus but should encompass a broad range of subjects and experiences._] *Engaging with* different fields can #underline[_foster *critical thinking*, creativity, and adaptability—skills that are increasingly important in a rapidly changing world._] *Furthermore*, the boy's encouragement to attend the lecture #underline[_reflects a proactive attitude toward_] personal and academic growth. By embracing opportunities to learn from diverse sources, students can *gain new perspectives and insights that* may enhance their understanding of their own *discipline* and *open up new pathways* for *future endeavors*. #underline[_In conclusion, this drawing serves as a reminder_] to value and *seek out* diverse learning experiences. It encourages students to be open to new ideas and to recognize the potential benefits of *interdisciplinary* learning. By doing so, they can enrich their education and better prepare themselves for the complexities of the modern world. ==== 拓宽视野的价值:参加校园讲座 这幅画展示了两个学生站在广告校园讲座的布告栏前。左边的女孩表达了她的疑虑,说:“不是我们专业的,听了也没有多大用。”右边的男孩乐观地回答道:“去听一下,肯定有好处。”这个场景描绘了学生们评估课外活动的相关性和潜在好处的常见情况。 这幅插图的意图是强调保持开放心态并利用各种学习机会的重要性,即使这些机会似乎与自己的主要研究领域无关。它表明来自不同学科的知识可以带来意想不到的好处,并有助于全面的教育。 在我看来,这幅画有效地传达了关于智力好奇心和在自己立即专长领域之外追求知识的重要信息。它强调了教育不应局限于狭窄的焦点,而应包括广泛的学科和经验。接触不同领域可以培养批判性思维、创造力和适应能力——这些技能在迅速变化的世界中越来越重要。 此外,男孩鼓励参加讲座反映了对个人和学术成长的积极态度。通过接受从不同来源学习的机会,学生可以获得新的视角和见解,这些可能会增强他们对自己学科的理解并为未来的努力开辟新的途径。 总之,这幅画提醒我们要重视并寻求多样的学习经历。它鼓励学生对新思想保持开放,并认识到跨学科学习的潜在好处。这样做可以丰富他们的教育,并更好地为现代世界的复杂性做好准备。 #pagebreak() === 23 #align(center)[ #image("./images/23.png", width: 60%) ] ==== Celebrating Tradition: The Dragon Boat Festival #underline[_The drawing depicts a *vibrant* scene of_] a dragon boat race, #underline[_with_] two boats competing in a river under a bridge. *Spectators* *line* the *riverbanks* and the bridge, cheering enthusiastically. In the foreground, an elderly couple watches the race, with one of them commenting, "It's great! The dragon boat race in our village is getting more and more popular." #underline[_The intended meaning of this illustration is to highlight_] the cultural significance and *communal spirit of traditional festivals*, particularly the Dragon Boat Festival. #underline[_The scene *showcases* how such events_] bring people together, *fostering* a sense of unity and pride in local traditions. #underline[_The elderly couple's comment reflects_] the growing enthusiasm and participation in these cultural activities, #underline[_indicating_] a thriving and engaged community. #underline[_In my opinion, this drawing effectively captures the essence of_] community celebrations and the preservation of *cultural heritage*. #underline[_It underscores the importance of maintaining and promoting_] traditional festivals, #underline[_which serve as a vital link between generations and a means of strengthening social bonds._] The enthusiastic participation of both the racers and the spectators exemplifies how cultural traditions #underline[_can be a source of joy, excitement, and *communal* pride._] *Moreover*, the drawing also highlights the role of elders in the community as keepers of tradition. Their presence and appreciation for the growing popularity of the dragon boat race #underline[_demonstrate the value of intergenerational connections in preserving cultural heritage_]. #underline[_By involving_] both young and old, #underline[_such events ensure that traditions are passed down and continue to thrive._] #underline[_In conclusion, this illustration serves as a reminder of the importance of_] celebrating and preserving cultural traditions. #underline[_It encourages_] communities to engage in and support these activities, fostering a sense of unity and continuity. #underline[_Through such efforts, cultural heritage can be *cherished* and *sustained* for *future generations*._] ==== 庆祝传统:龙舟节 这幅画描绘了一个热闹的龙舟竞赛场景,两艘龙舟在桥下的河里竞赛。观众们沿着河岸和桥上热情地欢呼。在前景中,一对老夫妇观看比赛,其中一人评论道:“真好啊,咱们村的龙舟赛越来越热闹了。” 这幅插图的意图是突出传统节日的文化意义和社区精神,特别是龙舟节。场景展示了这种活动如何将人们聚集在一起,培养团结和对地方传统的自豪感。老夫妇的评论反映了对这些文化活动日益增长的热情和参与度,表明一个繁荣和积极参与的社区。 在我看来,这幅画有效地捕捉了社区庆祝活动和文化遗产保护的本质。它强调了维护和推广传统节日的重要性,这些节日作为代际之间的重要纽带,加强了社会纽带。赛手和观众的热情参与表明,文化传统可以成为快乐、兴奋和社区自豪感的源泉。 此外,这幅画还突出了社区中老年人的作用,作为传统的守护者。他们的存在和对龙舟赛日益受欢迎的欣赏展示了代际联系在保护文化遗产中的价值。通过让年轻人和老年人共同参与,这类活动确保了传统得以传承和持续繁荣。 总之,这幅插图提醒我们庆祝和保护文化传统的重要性。它鼓励社区参与和支持这些活动,培养团结和连续性。通过这些努力,文化遗产可以被珍惜和传承给未来的世代。 #pagebreak() === 24 #align(center)[ #image("./images/24.png", width: 60%) ] ==== The Impact of New Parks on Community Well-being #underline[_The picture and chart provide a complementary view of_] the increasing number of parks in a certain city and #underline[_their positive impact on_] the community. #underline[_In the picture,_] several people are enjoying various activities in a newly built small park. One person *remarks*, "The new park near our home is really nice!" The background shows people jogging, #underline[_indicating the park's role in promoting_] physical fitness. #underline[_The chart beside the picture shows_] the number of parks built in the city over the past three years. In 2020, there were 406 parks. This number *increased to* 532 in 2021 *and reached* 670 in 2022. #underline[_The steady growth in the number of parks highlights_] the city's commitment to improving public spaces and community well-being. #underline[_The intended meaning of these visual elements is to emphasize the significance of_] urban planning in enhancing the quality of life for residents. The new parks not only provide a space for recreational activities but also *foster* a sense of community and encourage healthy lifestyles. The comment from the individual in the picture *reflects* a common sentiment among residents who benefit from these improved public spaces. #underline[_In my opinion, the picture and chart effectively illustrate the positive outcomes of_] increased investment in public parks. These spaces are crucial for promoting physical health, mental well-being, and social interaction. Parks offer a *respite* from the urban environment, providing a natural setting for relaxation and exercise. #underline[_The increase in the number of parks also signifies_] a *forward-thinking* approach by city planners, *prioritizing* green spaces in urban development. Furthermore, the enthusiasm shown by the park-goers underscores the importance of such initiatives. Residents who have access to well-maintained parks are likely to engage more in outdoor activities, leading to a healthier and more active community. This can also have *long-term benefits*, such as reduced healthcare costs and enhanced social cohesion. #underline[_In conclusion, the visual elements highlight the vital role of_] parks in urban life. #underline[_They serve as a reminder of the importance of_] continuous investment in public spaces #underline[_to ensure_] the well-being of the community. #underline[_By prioritizing the creation and maintenance of_] parks, cities #underline[_can foster a healthier, happier, and more connected populace._] ==== 新公园对社区福祉的影响 这张图片和图表提供了一个关于某市公园数量增加及其对社区积极影响的互补视角。图片中,几个人在新建的小公园里享受各种活动。一个人说:“家门口新建的小公园真不错!”背景显示了人们在跑步,表明公园在促进身体健康方面的作用。 图片旁边的图表显示了该市过去三年建造公园的数量。2020 年有 406 座公园,这一数字在 2021 年增加到 532 座,并在 2022 年达到 670 座。公园数量的稳步增长突显了该市在改善公共空间和社区福祉方面的承诺。 这些视觉元素的意图是强调城市规划在提高居民生活质量方面的重要性。新公园不仅提供了休闲活动的空间,还促进了社区感和健康生活方式。图片中个人的评论反映了受益于这些改善公共空间的居民的共同情绪。 在我看来,这幅图画和图表有效地说明了对公共公园增加投资的积极成果。这些空间对于促进身体健康、心理健康和社会互动至关重要。公园提供了一个城市环境中的休憩之所,为放松和锻炼提供了自然环境。公园数量的增加也表明城市规划者优先考虑绿地在城市发展中的前瞻性方法。 此外,公园使用者表现出的热情突显了此类举措的重要性。拥有良好维护公园的居民更有可能参与户外活动,从而形成一个更健康、更活跃的社区。这还可以带来长期利益,例如降低医疗费用和增强社会凝聚力。 总之,这些视觉元素突显了公园在城市生活中的重要作用。它们提醒我们持续投资公共空间以确保社区福祉的重要性。通过优先创建和维护公园,城市可以培养一个更健康、更幸福、更紧密联系的公众。
https://github.com/RubixDev/typst-tabley
https://raw.githubusercontent.com/RubixDev/typst-tabley/main/README.md
markdown
MIT License
# typst-tabley Basic experimental tables in CeTZ. ## Example See [`example.typ`](./example.typ) for the source. But don't get too excited, column and row spanning isn't really supported. ![Example](./example.png) ## What is this This package is just a small attempt to see how feasible it is to create a CeTZ based table package. I do not plan to work on this any further, but the hope is that eventually [tablex](https://github.com/PgBiel/typst-tablex) will integrate some sort of CeTZ renderer possibly reusing some of this code.
https://github.com/darkMatter781x/OverUnderNotebook
https://raw.githubusercontent.com/darkMatter781x/OverUnderNotebook/main/entries/driver/driver.typ
typst
#import "/packages.typ": notebookinator, codetastic, gentle-clues #import notebookinator: * #import themes.radial.components: * #import gentle-clues: * #import codetastic: qrcode #show: create-body-entry.with( title: "Program: Driver Control Code", type: "program", date: datetime(year: 2024, month: 1, day: 15), author: "<NAME>", ) = Driver Control The key design philosophy behind the button mapping is to keep the driver's thumbs on the joysticks whenever possible. This means that often used functionality must be accessible without moving the driver's thumbs and thus these functions are mapped to the trigger buttons. We also must reduce the likelihood of the driver accidentally pressing buttons that could be detrimental, such as the emergency stops, and thus these function require that two buttons be pressed. == Control Scheme Before we can look at the code, we must first set out the requirements for the code: - Left Joystick vertical axis #sym.arrow.r.double left side of the drive (tank drive) - Right Joystick vertical axis #sym.arrow.r.double right side of the drive (tank drive) - UP #sym.arrow.r.double move lift up slowly - DOWN #sym.arrow.r.double move lift down slowly - UP double press #sym.arrow.r.double move lift to highest position - DOWN double press #sym.arrow.r.double move lift to lowest position - R1 #sym.arrow.r.double Toggle Wings - R2 #sym.arrow.r.double Toggle Blocker - L1 #sym.arrow.r.double Intake - L2 #sym.arrow.r.double Outtake - RIGHT #sym.arrow.r.double Toggle automatic firing functionality of the catapult - LEFT #sym.arrow.r.double manually fire catapult - X & A #sym.arrow.r.double toggle catapult emergency stop - Y & B #sym.arrow.r.double toggle lift emergency stop == Terms - Boolean: A value that can only be true or false - Rising Edge: Often times you only want to do an action once per button press, such as a toggle. One way to approach this is to do this action when the button changes from false to true. This kind of boolean transition is called the rising edge. - Falling Edge: The transition from true to false. == Code now let's look at some code: - Tank drive: ```cpp // takes each side's drive power in the range [-127, 127] and a curve gain Robot::chassis->tank( // gets left joystick y axis in the range [-127, 127] Robot::control.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y), // gets left joystick y axis in the range [-127, 127] Robot::control.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y), // drive curve gain to enable greater control of the robot. 15); ``` Ok, but whats this "drive curve"? The idea is to make it easier to control the robot at slow speeds, but still be able to go at max speed. This enhances our driver's ability to accurately control the robot. In this graph the x is the vertical axis of the joystick, and the y is the output voltage (this specific curve is the work of team 5225A _The Pilons_): #figure(image("./curve.png", width: 50%)) - Lift: The lift must be capable of moving from its topmost position to its lowest position as quickly as possible, but sometimes its also beneficial to have the lift somewhere in the middle. This is useful for minimizing the chance of tipping when blocking or shooting. We do this by moving the lift to its max or min with a double press, but the driver may also just press up or down to move the intake to a middle position. How do you detect a double press? A double press boils down to a button being pressed twice with little delay between the two presses. That begs the question of what is a press? You can either listen to the falling edge or the rising edge of the button to detect a button press. We use the falling edge for the first press and rising edge for the second press. This double press algorithm looks like so: - On falling edge of button, record the current time and store it in a variable - On the rising edge of a button, find how long it has been since the last button press. If it has been less than 150 ms, then go to the min / max of the lift. Always perform the normal functionality of the button no matter whether the button is being double pressed or not #warning[ For our lift, we can let this happen, because moving the lift up when its target is at its max position, because we prevent it from going above the max angle of the lift. But, when using double presses for different subsystems this may cause problems unwanted behavior. ] // typstfmt::off ```cpp const bool up = Robot::control.get_digital(pros::E_CONTROLLER_DIGITAL_UP); const bool down = Robot::control.get_digital(pros::E_CONTROLLER_DIGITAL_DOWN); // lift granular control // change the goal position of the lift by the liftIncrement Robot::Subsystems::lift->changeTarget( liftIncrement * (up - down) // ensures that if up and down are both pressed, then nothing happens ); // lift max/min angle // on the rising edge of up, if up was pressed recently, // then set target to max angle if (up && !prevUp && pros::millis() - lastUpPress < maxTimeBetweenDoublePress) Robot::Subsystems::lift->setTarget(LiftArmStateMachine::maxAngle); // on the rising edge of down, if down was pressed recently, // then set target to max angle if (down && !prevDown && pros::millis() - lastDownPress < maxTimeBetweenDoublePress) Robot::Subsystems::lift->setTarget(LiftArmStateMachine::minAngle); // on falling edge of up & down, update the last press time if (!up && prevUp) lastUpPress = pros::millis(); if (!down && prevDown) lastDownPress = pros::millis(); // update previous values of up and down prevUp = up; prevDown = down; ``` // typstfmt::on - Toggles: Wings / Blocker / Automatic Catapult firing ```cpp // wings toggle // retrieve the value of the R2 button const bool r1 = Robot::control.get_digital(pros::E_CONTROLLER_DIGITAL_R1); // if on the rising edge of the button if (r1 && !prevR1) { // flip the state of the wings wingsState = !wingsState; // apply the state of the wings to the actual pistons if (wingsState) Robot::Actions::expandWings(); else Robot::Actions::retractWings(); } // update the previous value of R1 prevR1 = r1; // the other toggles are implemented in much the same way ``` - Intake / Outtake ```cpp // if pressing L1, then spin the intake inwards if (Robot::control.get_digital(pros::E_CONTROLLER_DIGITAL_L1)) Robot::Motors::intake.move(127); // if pressing L2, then spin the intake outwards else if (Robot::control.get_digital(pros::E_CONTROLLER_DIGITAL_L2)) Robot::Motors::intake.move(-127); // otherwise, don't sent power to the intake else Robot::Motors::intake.move(0); ``` - Catapult/Lift emergency stop toggle ```cpp // get whether both emergency stop buttons are currently being pressed const bool cataEStopCombo = Robot::control.get_digital(pros::E_CONTROLLER_DIGITAL_X) && Robot::control.get_digital(pros::E_CONTROLLER_DIGITAL_A); // if both buttons have just become pressed (rising edge), then toggle the // emergency stop of the catapult if (cataEStopCombo && !prevCataEStopCombo) { // if the catapult is currently emergency stopped, then disable the // emergency stop if (Robot::Subsystems::catapult->getState() == CatapultStateMachine::STATE::EMERGENCY_STOPPED) Robot::Subsystems::catapult->cancelEmergencyStop(); // otherwise emergency stop the catapult else Robot::Subsystems::catapult->emergencyStop(); } // update the previous value of the emergency stop buttons prevCataEStopCombo = cataEStopCombo; ```
https://github.com/LeoColomb/dotdocs
https://raw.githubusercontent.com/LeoColomb/dotdocs/main/README.md
markdown
MIT License
# .docs > 📄 Paper documents templates ## Getting Started ### Files * `assets/fonts`: Fonts (`TYPST_FONT_PATHS`) * `packages/**`: Packages (https://github.com/typst/packages) ## Usage ### Direct ```console typst compile src/main.typ dist/main.pdf ``` ### Container ```console docker run --rm \ -v "${PWD}/src:/opt/data/src" \ -v "${PWD}/dist:/opt/data/dist" \ ghcr.io/leocolomb/dotdocs:latest \ compile \ "/opt/data/src/main.typ" \ "/opt/data/dist/main.pdf" ``` ## Acknowledgments ### Software * [Typst](https://typst.app/) ### Fonts * [The Bold Font](https://www.dafont.com/the-bold-font.font) * [Source Sans Pro](https://adobe-fonts.github.io/source-sans/) * [IBM Plex Sans](https://www.ibm.com/plex/) ## License MIT © [<NAME>](https://colombaro.fr)
https://github.com/astrojhgu/nsfc_typ
https://raw.githubusercontent.com/astrojhgu/nsfc_typ/master/nsfc.typ
typst
#let nsfc_content(doc)={ let en_sans_serif = "Georgia" let en_serif = "Times New Roman" let zh_hei = ("FZHei-B01", "FZHei-B03") let zh_kai = ("AR PL UKai",) let zh_shusong = ("FZShuSong-Z01", "FZShuSong-Z01S") let title_font = (en_serif, ..zh_kai) let body-font = (en_serif, ..zh_shusong) let heading-font = (en_serif, ..zh_kai) let clean_numbering(..schemes) = { (..nums) => { let (section, ..subsections) = nums.pos() let (section_scheme, ..subschemes) = schemes.pos() if subsections.len() == 0 { numbering(section_scheme, section) } else if subschemes.len() == 0 { numbering(section_scheme, ..nums.pos()) } else { clean_numbering(..subschemes)(..subsections) } } } set heading(numbering: clean_numbering("(一)", "1.", "(a)")) show heading.where( level: 1 ): it => block(width: 100%)[ #set text(16pt, font: heading-font, weight: "regular", fill:blue) #h(2em) #counter(heading).display(it.numbering) #it.body ] show heading.where( level: 2 ): it => block(width: 100%)[ #set text(16pt, font: heading-font, weight: "regular",fill:blue) #h(2em) #counter(heading).display(it.numbering) #it.body ] set text(size: 15pt) align(center)[ #block(text(font: title_font, weight: "bold", 18pt, [*报告正文*])) #v(0.5em) ] [~~~~~~~~参照以下提纲撰写,要求内容翔实、清晰,层次分明,标题突出。#text(blue)[请勿删除或改动下述提纲标题及括号中的文字。] ] set par(first-line-indent: 2em,justify: true, linebreaks: "optimized") show figure.where(kind: image): it => block(width: 100%)[#align(center)[ #set figure(placement: auto) #it.body // #it.supplement // original #it.caption ]] show figure.where(kind: table): it => block(width:100%)[ #it.caption //#set figure.caption(position: top) #it.body ] set math.equation(numbering: "(1)") set text(font: body-font, lang: "zh", region: "cn") set terms(indent: 1em, hanging-indent: 0em) doc }
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/markup/heading.typ
typst
Apache License 2.0
== Level 2 == Level 2 with // comments
https://github.com/masaori/exact-solution-of-2d-ising-model
https://raw.githubusercontent.com/masaori/exact-solution-of-2d-ising-model/main/theorem.typ
typst
#let theorem_counter_str = (loc) => { let heading_counter = counter(heading) let theorem_counter = counter(figure.where(kind: "lib:theroem")) let heading_counter_number = heading_counter.at(loc) let theorem_counter_number = theorem_counter.at(loc) let number = heading_counter_number + theorem_counter_number return numbering("1.1", ..number) } #let block_with_counter = ( title, name, fill, inset, radius, content, ) => { let title_line = () => { let counter_str = theorem_counter_str(here()) let title_line if name == none { title_line = $bold(title)$ + " " + counter_str } else { title_line = $bold(title)$ + " " + counter_str + " ("+ name + ") " } return title_line } return figure( kind: "lib:theroem", supplement: title, )[#block( width: 100%, breakable: false, fill: fill, inset: inset, radius: radius, [ #context title_line(): ] + "\n" + content )] } #let theorem = (name, content) => block_with_counter( "Theorem", name, rgb("#ffffcb"), 8pt, 4pt, content ) #let definition = (name, content) => block_with_counter( "Definition", name, rgb("#d4d4d4"), 8pt, 4pt, content ) #let claim = (name, content) => block_with_counter( "Claim", name, rgb("#bae8ff"), 8pt, 4pt, content ) #let proof = (content) => box( width: 100%, fill: rgb("#f0f0f0"), inset: 8pt, radius: 4pt, [ $bold("Proof:")$ #content ] ) #let note = (content) => box( width: 75%, fill: rgb("#ffebd1"), inset: 8pt, radius: 4pt, [ #set text(size: 8pt) $bold("Note:")$ #content ] ) #let theorem_rules(qed-symbol: $qed$, doc) = { show figure.where(kind: "lib:theroem"): it => it.body set heading(numbering: "1.1.") show heading: it => { return [ #context counter(figure.where(kind: "lib:theroem")).update(0) #it ] } show ref: it => { if it.element == none { return it } if it.element.func() != figure { return it } if it.element.kind != "lib:theroem" { return it } let supplement = it.element.supplement if it.citation.supplement != none { supplement = it.citation.supplement } let loc = it.element.location() return link( it.target, [#supplement #theorem_counter_str(loc)] ) } doc } // // Examples. // #show: theorem_rules.with(qed-symbol: $qed$) = A <head_1> == B ここは @head_1 の あらすじ @thorem_1 === C #figure()[ This is Figure ]<fig_2> #block_with_counter( "Theorem", none, rgb("#ff0000"), 8pt, 4pt, )[ hoge hogehogehogehogehogehogehoge ]<thorem_1> #block_with_counter( "Theorem", "Name of this", rgb("#ff0000"), 8pt, 4pt, )[ hogehogehogehogehogehogehogehoge ] #block_with_counter( "Theorem", "Name of this", rgb("#ff0000"), 8pt, 4pt, )[ hoge ] == D === E #block_with_counter( "Theorem", "Name of this D", rgb("#ffaaaa"), 8pt, 4pt, )[ hoge ]<theoremD> #block_with_counter( "Theorem", "Name of this E", rgb("#aaaaaa"), 8pt, 4pt, )[ hoge ] #block_with_counter( "Theorem", "Name of this E", rgb("#aaaaaa"), 8pt, 4pt, )[ hoge ] === F #block_with_counter( "Theorem", "Name of this F", rgb("#aaaaaa"), 8pt, 4pt, )[ hoge ] #figure()[ phi = 1 ]<fig_1> #theorem("aaa")[ phi = 1 "AAAAA" $1234$ @fuga @hoge $ "AAAAA" $ ]<fuga> #claim(none)[ $ 1 * 3 - 1 = 2 $ ]<hoge2> #claim(none)[ $ 1 * 3 - 1 = 2 $ ]<hoge>
https://github.com/ohmycloud/computer-science-notes
https://raw.githubusercontent.com/ohmycloud/computer-science-notes/main/Misc/destructure_binding.typ
typst
#import "@preview/splash:0.3.0": * #let make-title(title: none, author: none, date: none, description: none) = [ #set align(center) = #title #v(1em) #text(style: "italic", description) #v(1em) / 设计者: #author / 日期: #date #v(3em) ] #make-title( title: "绑定时解构", author: "ohmycloud", date: "2024-01-25", description: "参数解构" ) #outline( title: "目录", target: heading.where(level: 1) ) #pagebreak() #show heading.where(level: 1): it => { align(center)[#text(xcolor.cyan)[ *#it*]] v(0.75em) } #show heading.where(level: 2): it => { text(red)[ *#it*] v(0.6em) } #show heading.where(level: 3): it => { text(red)[ *#it*] v(0.6em) } #show raw.where(block: true): block.with( fill: luma(240), inset: 10pt, radius: 4pt, width: 100%, ) = 定义主体 ```rs struct Book { title: String, author: String, count: u32, tags: Vec<String>, } fn main() { let book_list = vec![ Book { title: "A Christmas Carol".into(), author: "<NAME>".into(), count: 1_200_000, tags: vec!["ghost".into(), "christmas".into()], }, Book { title: "A Visit from St. Nicholas".into(), author: "<NAME>".into(), count: 50_000_000, tags: vec!["santa".into(), "christmas".into()], }, ]; } ``` = 绑定时解构 ```rs for Book { title, author, count, .. } in book_list { if count >= 1_000_000 { println!( "Congratulations, {}, you are the best sellers with {} ", author, count ); } } ```
https://github.com/howardlau1999/sysu-thesis-typst
https://raw.githubusercontent.com/howardlau1999/sysu-thesis-typst/master/functions/numbering.typ
typst
MIT License
#let partcounter = counter("part") #let chaptercounter = counter("chapter") #let appendixcounter = counter("appendix") #let footnotecounter = counter(footnote) #let rawcounter = counter(figure.where(kind: "code")) #let imagecounter = counter(figure.where(kind: image)) #let tablecounter = counter(figure.where(kind: table)) #let equationcounter = counter(math.equation) #let appendix() = { appendixcounter.update(10) chaptercounter.update(0) counter(heading).update(0) } #let chinesenumber(num, standalone: false) = if num < 11 { ("零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十").at(num) } else if num < 100 { if calc.mod(num, 10) == 0 { chinesenumber(calc.floor(num / 10)) + "十" } else if num < 20 and standalone { "十" + chinesenumber(calc.mod(num, 10)) } else { chinesenumber(calc.floor(num / 10)) + "十" + chinesenumber(calc.mod(num, 10)) } } else if num < 1000 { let left = chinesenumber(calc.floor(num / 100)) + "百" if calc.mod(num, 100) == 0 { left } else if calc.mod(num, 100) < 10 { left + "零" + chinesenumber(calc.mod(num, 100)) } else { left + chinesenumber(calc.mod(num, 100)) } } else { let left = chinesenumber(calc.floor(num / 1000)) + "千" if calc.mod(num, 1000) == 0 { left } else if calc.mod(num, 1000) < 10 { left + "零" + chinesenumber(calc.mod(num, 1000)) } else if calc.mod(num, 1000) < 100 { left + "零" + chinesenumber(calc.mod(num, 1000)) } else { left + chinesenumber(calc.mod(num, 1000)) } } #let chinesenumbering(..nums, location: none, brackets: false) = locate(loc => { let actual_loc = if location == none { loc } else { location } if appendixcounter.at(actual_loc).first() < 10 { numbering(if brackets { "(1.1)" } else { "1.1" }, ..nums) } else { if nums.pos().len() == 1 { "附录 " + numbering("A.1", ..nums) } else { numbering(if brackets { "(A.1)" } else { "A.1" }, ..nums) } } })
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/github-pages/docs/data-flow-standalone.typ
typst
Apache License 2.0
#import "graphs.typ": data-flow-graph #set page(height: auto, width: auto, margin: 0.5em) #show link: underline #figure( data-flow-graph(stroke: black, bg-color: white, light-theme: true), caption: [Figure: Browser-side module needed: $dagger$: compiler; $dagger.double$: renderer. ], numbering: none, )
https://github.com/soul667/typst
https://raw.githubusercontent.com/soul667/typst/main/PPT/MATLAB/touying/docs/i18n/zh/docusaurus-plugin-content-docs/current/utilities/fit-to.md
markdown
--- sidebar_position: 2 --- # Fit to height / width 感谢 [ntjess](https://github.com/ntjess) 的代码。 ## Fit to height 如果你需要将图片占满剩余的 slide 高度,你可以来试试 `fit-to-height` 函数: ```typst #utils.fit-to-height(1fr)[BIG] ``` 函数定义: ```typst #let fit-to-height( width: none, prescale-width: none, grow: true, shrink: true, height, body ) = { .. } ``` 参数: - `width`: 如果指定,这将确定缩放后内容的宽度。因此,如果您希望缩放的内容填充幻灯片宽度的一半,则可以使用 `width: 50%`。 - `prescale-width`: 此参数允许您使 Typst 的布局假设给定的内容在缩放之前要布局在一定宽度的容器中。例如,您可以使用 `prescale-width: 200%` 假设幻灯片的宽度为原来的两倍。 - `grow`: 是否可扩张,默认为 `true`。 - `shrink`: 是否可收缩,默认为 `true`。 - `height`: 需要指定的高度。 - `body`: 具体的内容。 ## Fit to width 如果你需要限制标题宽度刚好占满 slide 的宽度,你可以来试试 `fit-to-width` 函数: ```typst #utils.fit-to-width(1fr)[#lorem(20)] ``` 函数定义: ```typst #let fit-to-width(grow: true, shrink: true, width, body) = { .. } ``` 参数: - `grow`: 是否可扩张,默认为 `true`。 - `shrink`: 是否可收缩,默认为 `true`。 - `width`: 需要指定的宽度。 - `body`: 具体的内容。
https://github.com/darioglasl/Arbeiten-Vorlage-Typst
https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/management_summary.typ
typst
#set heading( outlined: false, numbering: none, ) == Ausgangslage == Aufgabenstellung == Vorgehen == Technologien == Analyse == Umsetzung == Ausblick
https://github.com/19pdh/suplement-sprawnosci
https://raw.githubusercontent.com/19pdh/suplement-sprawnosci/master/suplement.typ
typst
#import "style.typ": proba #set document( author: "<NAME>", title: "Suplement sprawności", ) #show heading: it => [ #set text(1.4em, weight: "bold") #block(it.body) ] #set par(justify: true) #set text( font: "Century Gothic", size: 11pt ) #set align(center + horizon) = Suplement sprawności IV <NAME> “Rotunda” #set align(center + bottom) Poznań, sierpień 2024 github.com/19pdh/suplement-sprawnosci #pagebreak() #set align(left + top) // ============= SPRAWNOSCI #include "sprawnosci.typ" #pagebreak() // ============= PRÓBY #import "proby.typ": proby #align(center)[= Próby] #v(1cm) #for p in proby [ #proba(p) #v(0.7cm) ]
https://github.com/Area-53-Robotics/53A-Notebook-Over-Under-2023-2024
https://raw.githubusercontent.com/Area-53-Robotics/53A-Notebook-Over-Under-2023-2024/master/Vex%20Robotics%2053A%20Notebook%202023%20-%202024/Entries/Build%20Entry/Intake-Sleds-Battery-Mount.typ
typst
//notebook start //Note: "\" adds a line between text #set page(header: [ VR #h(1fr) October 27, 2023 ]) = INTAKE SLEDS + BATTERY MOUNT \ == Stand-Up Notes #let cell = rect.with( inset: 8pt, fill: rgb("#E3E3E3"), width: 100%, radius: 10pt ) #grid( columns: (170pt, 170pt, 170pt), rows: (80pt, 80pt), gutter: 3pt, cell(height: 100%)[*Michael*:\ - Mount intake sleds I cut last meeting], cell(height: 100%)[*Akif*:\ - Investigate bending I saw in the catapult's arm last meeting], cell(height: 100%)[*Jacob*: - I will construct a secure battery mount], cell(height:100%)[*Veena*: \ - I will start organizing and formatting our digital notebook], cell(height:100%)[*Zoey*: \ - xxx] ) == Intake Sleds Today we mounted and tested the intake sleds. === Assembly #figure( image("/Images/Build Images/Intake Sled Distance.png", width: 92.1893022%), caption: [Intake Sleds]) #figure( image("/Images/Build Images/Intake Sled close-up.png", width: 50%), caption: [Intake Sleds; Detail]) === Testing ==== Procedure - Drove over the barrier repeatedly to establish how much the sleds improved driving over the middle barrier with the intake forward \ > We could not drive over the barrier at all before implementing the sleds. ==== Results #table( columns: (25%,75%), rows: (3.5%), fill: (_, row) => if row > 0 {rgb("#E4FFE6")}, [Trial], [Drive Over Middle Barrier?], [1], [Yes], [2], [Yes], [3], [Yes], [4], [Yes], [5], [Yes] ) #figure( image("/Images/Build Images/intake sled use.png"), caption: [Sleds Use Case from Video of Tests] ) - Sleds clearly push front of robot up - Allows wheels to later come in contact with pole and drive over === Conclusion - The sleds allow us to drive over the barrier 100% of the time #pagebreak() == Battery Mount //#figure( // grid( // columns: (13em, 13em, 13em), // gutter: .25em, // [ #image("/Images/Build Images/BatteryHolderSide.png", width: 75%) ], // [ #image("/Images/Build Images/BatteryHolderTop.png", width: 75%) ], // [ // - Simple Lever // - Battery placed in cage // - Lever pulls down on end of battery // - Battery cannot move within cage // ], // ), // caption: [Battery Mount] //) //#figure( // image("/Images/Build Images/Intake Sled close-up.png", width: 50%), // caption: [Intake Sleds; Detail]) #grid( columns: (13em, 13em, 13em), // gutter: .25em, figure(image("/Images/Build Images/BatteryHolderSide.png", width: 75%), caption: [Battery Mount \ Side]), figure(image("/Images/Build Images/BatteryHolderTop.png", width: 75%), caption: [Battery Mount \ Top] ), [ - Simple lever - Battery placed in cage - Lever pulls down on end of battery - Rubber bands pull lever into place - Battery cannot move within cage ] )
https://github.com/noahjutz/AD
https://raw.githubusercontent.com/noahjutz/AD/main/appendix/examples/main.typ
typst
= Beispiele == AC-Laufzeit beim Inkrementieren <ex-average-case> Sei $A$ der Algorithmus, der eine binäre Zahl der Länge $n$ um 1 erhöht. Es gibt $|Sigma^n| = 2^n$ binäre Zahlen der From ${0, 1}^n$. $ T^"AC"_A (n) &= 1/2^n sum_(x in {0, 1}^n) T(x) \ $ Beim inkrementieren wird jede 1 am Ende zu einer Null, und anschließend wird der Carry vorangehängt. Die Laufzeit für ein gegebenes $x$ ist also $ T_A (x) = max {k mid(|) x_k...x_2x_1x_0 = {1}^k} + 1 $ Die Hälfte der Zahlen aus ${0, 1}^n$ endet mit einer 1. Die Hälfte dieser Teilmenge endet wiederum mit zwei 1en, und so weiter. #include "binary_subsets.typ" Daher ist die Summe aller Laufzeiten eine endliche geometrische Reihe mit der Basis $1/2$. $ sum_(x in {0, 1}^n) T_A (x) &= 1 + 1/2 + 1/4 + ... + 1/(2^n) \ &= sum_(k=0)^n (1/2)^k $ Diese Reihe konvergiert gegen 2. Die Average-Case-Laufzeit $T^"AC"_A (n)$ ist somit konstant. $ T^"AC"_A (n) = 1/2^n dot 2 in O(1) $ #include "binary_complexity.typ" == Insertion Sort <ex-insertion-sort> #import "/notizen/sortieralgorithmen/insertion_sort/insertion_sort.typ": insertion_sort #insertion_sort(34, 45, 12, 34, 23, 18, 38, 17, 43, 51) == Bubble Sort <ex-bubble-sort> #import "/notizen/sortieralgorithmen/bubble_sort.typ": bubble_sort #bubble_sort(34, 45, 12, 34, 23, 18, 38, 17, 43, 7) == Selection Sort <ex-selection-sort> #import "/notizen/sortieralgorithmen/selection_sort.typ": selection_sort #selection_sort(34, 45, 12, 34, 23, 18, 38, 17, 43, 7)
https://github.com/PA055/5839B-Notebook
https://raw.githubusercontent.com/PA055/5839B-Notebook/main/Entries/Game_Discussion/post_reveal.typ
typst
#import "/packages.typ": notebookinator #import notebookinator: * #import themes.radial.components: * #show: create-body-entry.with( title: "<EDP Stage>: <your title here>", type: "identify", date: datetime(year: 1982, month: 1, day: 1), author: "<NAME>", witness: "<NAME>", ) Write your content here.
https://github.com/azzamsa/cv-template
https://raw.githubusercontent.com/azzamsa/cv-template/master/cv.typ
typst
Apache License 2.0
#import "utils.typ" // set rules #let setrules(uservars, doc) = { set text( font: uservars.bodyfont, size: uservars.fontsize, hyphenate: false, ) set list(spacing: uservars.linespacing) set par( leading: uservars.linespacing, justify: true, ) doc } // show rules #let showrules(uservars, doc) = { // Uppercase section headings show heading.where(level: 2): it => block(width: 100%)[ #v(uservars.sectionspacing) #set align(left) #set text(font: uservars.headingfont, size: 1em, weight: "bold") #if (uservars.at("headingsmallcaps", default: false)) { smallcaps(it.body) } else { upper(it.body) } #v(-0.75em) #line(length: 100%, stroke: 1pt + black) // draw a line ] // Name title/heading show heading.where(level: 1): it => block(width: 100%)[ #set text(font: uservars.headingfont, size: 1.5em, weight: "bold") #if (uservars.at("headingsmallcaps", default: false)) { smallcaps(it.body) } else { upper(it.body) } #v(2pt) ] // Links show link: set text(blue) doc } // Set page layout #let cvinit(doc) = { doc = setrules(doc) doc = showrules(doc) doc } // Job titles #let jobtitletext(info, uservars) = { if uservars.showTitle { block(width: 100%)[ *#info.personal.titles.join(" / ")* #v(-4pt) ] } else { none } } // Address #let addresstext(info, uservars) = { if uservars.showAddress { // Filter out empty address fields let address = info.personal.location.pairs().filter(it => it.at(1) != none and str( it.at(1), ) != "") // Join non-empty address fields with commas let location = address.map(it => str(it.at(1))).join(", ") block(width: 100%)[ #location #v(-4pt) ] } else { none } } #let contacttext(info, uservars) = block(width: 100%)[ #let profiles = ( box(link("mailto:" + info.personal.email)), if uservars.showNumber { box(link("tel:" + info.personal.phone)) } else { none }, if info.personal.url != none { box(link(info.personal.url)[#info.personal.url.split("//").at(1)]) }, ).filter(it => it != none) // Filter out none elements from the profile array #if info.personal.profiles.len() > 0 { for profile in info.personal.profiles { profiles.push( box(link(profile.url)[#profile.url.split("//").at(1)]), ) } } #set text( font: uservars.bodyfont, weight: "medium", size: uservars.fontsize * 1, ) #pad(x: 0em)[ #profiles.join([#sym.space.en #sym.diamond.filled #sym.space.en]) ] ] #let cvheading(info, uservars) = { align(center)[ = #info.personal.name #jobtitletext(info, uservars) #addresstext(info, uservars) #contacttext(info, uservars) ] } #let cveducation(info, title: "Education", isbreakable: true) = { if info.education != none { block[ == #title #for edu in info.education { let start = utils.strpdate(edu.startDate) let end = utils.strpdate(edu.endDate) let edu-items = "" if edu.honors != none { edu-items = edu-items + "- *Honors*: " + edu.honors.join(", ") + "\n" } if edu.courses != none { edu-items = edu-items + "- *Courses*: " + edu.courses.join(", ") + "\n" } if edu.highlights != none { for hi in edu.highlights { edu-items = edu-items + "- " + hi + "\n" } edu-items = edu-items.trim("\n") } // Create a block layout for each education entry block(width: 100%, breakable: isbreakable)[ // Line 1: Institution and Location #if edu.url != none [ *#link(edu.url)[#edu.institution]* #h(1fr) *#edu.location* \ ] else [ *#edu.institution* #h(1fr) *#edu.location* \ ] // Line 2: Degree and Date #text(style: "italic")[#edu.studyType in #edu.area] #h(1fr) #utils.daterange(start, end) \ #eval(edu-items, mode: "markup") ] } ] } } #let cvwork(info, title: "Work Experience", isbreakable: true) = { if info.work != none { block[ == #title #for w in info.work { block(width: 100%, breakable: isbreakable)[ // Line 1: Company and Location #if w.url != none [ *#link(w.url)[#w.organization]* #h(1fr) *#w.location* \ ] else [ *#w.organization* #h(1fr) *#w.location* \ ] ] // Create a block layout for each work entry let index = 0 for p in w.positions { if index != 0 { v(0.6em) } block(width: 100%, breakable: isbreakable, above: 0.6em)[ // Parse ISO date strings into datetime objects #let start = utils.strpdate(p.startDate) #let end = utils.strpdate(p.endDate) // Line 2: Position and Date Range #text(style: "italic")[#p.position] #h(1fr) #utils.daterange(start, end) \ // Project name #pad(y: 0em)[ #for pr in p.projects [ #text()[#pr.name] // Highlights or Description #for hi in pr.highlights [ - #eval(hi, mode: "markup") ] ] ] ] index = index + 1 } } ] } } #let projectEntry(entry, isbreakable: true) = { block(width: 100%, breakable: isbreakable)[ // Line 1: Entry Name with optional URL #if entry.url != none [ *#link(entry.url)[#entry.name]* \ ] else [ *#entry.name* \ ] // Summary or Description #for hi in entry.highlights [ - #eval(hi, mode: "markup") ] ] } #let cvcontributions(info, title: "Contributions", isbreakable: true) = { if info.contributions != none { block[ == #title #for contrib in info.contributions [ #projectEntry(contrib) ] ] } } #let cvprojects(info, title: "Projects", isbreakable: true) = { if info.projects != none { block[ == #title #for project in info.projects [ #projectEntry(project) ] ] } } #let cvskills( info, title: "Skills, Languages", isbreakable: true, ) = { if (info.languages != none) or (info.skills != none) { block(breakable: isbreakable)[ == #title #if (info.languages != none) [ #let langs = () #for lang in info.languages { langs.push([#lang.language (#lang.fluency)]) } - *Languages*: #langs.join(", ") ] #if (info.skills != none) [ #for group in info.skills [ - *#group.category*: #group.skills.join(", ") ] ] ] } }
https://github.com/SWATEngineering/Docs
https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/PianoDiProgetto/sections/PianificazioneSprint/DecimoSprint.typ
typst
MIT License
#import "../../functions.typ": glossary === Decimo #glossary[sprint] *Inizio*: Venerdì 16/02/2024 *Fine*: Giovedì 22/02/2024 *Obiettivi dello #glossary[sprint]*: - Proseguire la stesura del _Piano di Progetto_: - Aggiornare pianificazione e preventivo pertinenti allo #glossary[sprint] 10 e inserire il consuntivo pertinente allo #glossary[sprint] 9; - Aggiungere pianificazione e preventivo degli #glossary[sprint] 11 e 12, come parte della pianificazione a breve termine. - Continuare a progettare la struttura architetturale del prodotto, traducendo i #glossary[design pattern] individuati in una bozza di diagramma #glossary[UML] delle classi (seguendo le prassi specificate a tal riguardo nelle _Norme di Progetto v1.0_); - Iniziare la stesura delle _Specifiche Tecniche_, con particolare attenzione alle sezioni di *Introduzione* e *Tecnologie*; - Iniziare a sviluppare parte della prima versione del prodotto applicando quanto imparato dalla progettazione avviata precedentemente, dopo aver discusso con la Proponente le caratteristiche essenziali del #glossary[PoC] che è sensato implementare all'interno del prodotto vero e proprio.
https://github.com/astro-group-bristol/paper-management
https://raw.githubusercontent.com/astro-group-bristol/paper-management/main/presentation/main.typ
typst
Other
#import "@preview/polylux:0.3.1": * #import "tamburlaine.typ": * #let HANDOUT_MODE = false #enable-handout-mode(HANDOUT_MODE) #show: tamburlaine-theme.with(aspect-ratio: "4-3") #show link: item => underline(text(blue)[#item]) #let COLOR_CD = color.rgb("#56B4E9") #let COLOR_REFL = color.rgb("#D55E00") #let COLOR_CONT = color.rgb("#0072B2") #set par(spacing: 0.5em, leading: 0.5em) #set text(tracking: -0.5pt, size: 22pt) #let todo(item) = text(fill: red, [#item]) #title-slide( title_size: 30pt, title: [ #set text(tracking: -3pt) #set align(left) #move( dy: -0.3em, text( size: 90pt, move(dy: -31pt, stack( spacing: 4pt, move(dx: -43pt, dy: 17pt, [#text(fill: TEXT_COLOR)[Paper]]), [management#v(1.3em)], move(dy: 20pt, dx: 110pt, align(right, text(size: 46pt, [...or, how I learned to stop worrying and love Zotero]))) ) )) ) #v(0.5em) ], authors: ([<NAME>], ), where: "Astro Dev Group", )[ ] #slide()[ #set align(center) #align(horizon)[ #set text(weight: "black", size: 40pt, fill: PRIMARY_COLOR) How do you manage your papers? ] ] #slide(title: "Physical")[ #set align(center) #align(horizon)[ #image("./figs/Fri 27 Sep 14:35:12 BST 2024.png") ] ] #slide(title: "Virtual")[ #set text(size: 28pt) #v(0.5em) A *directory* on your machine: ``` $ du -hs papers 632GB papers ``` #v(1em) Read directly in a PDF reader. - Like the physical solution, still has a lot of manual housekeeping - Automated searching, but only on filenames\* ] #slide(title: "Zotero")[ #set text(size: 20pt) A tool for keeping track of your papers: #link("https://www.zotero.org/") #v(1em) #grid(columns: (40%, 1fr), [ Does much more: - Metadata - Citation helper - Notes and papers in one places - Expansive search\* - Browser extensions ("connectors") - Sync between machines\* - Plugins - Tags ], [ #image("./figs/zotero-example.png") ]) #v(1em) But it has one substantial problem: *it is easier to put information into Zotero than it is to get it out.* #v(1fr) #text(size: 12pt)[Fergus should do a demo now.] #v(1em) ] #slide(title: "Fergus's tips")[ #v(1em) #set text(size: 28pt) - Use *tags*, but remove the default tags - *Don't* keep your notes in Zotero (too limited for what you need to be able to do) - Have a `todo` tag and a `read` tag (assign them colours) - *Flat* collections > nested collections - Spend a bit of time every time you add an item adding metadata (tags, comments, etc.) #v(1em) #align(center)[ #text(weight: "black", fill: PRIMARY_COLOR)[Your ability to get information out is only as good as the _metadata_ you put in.] ] ] #slide(title: "A deep(ish) dive into shallow waters")[ #set text(size: 20pt) #v(1em) Looking inside the directory: #v(0.3em) ``` ~ $ ls Zotero cache/ storage/ zotero-mirror.sqlite zotero.sqlite.bak locate/ styles/ zotero.sqlite zotero.sqlite-journal logs/ translators/ zotero.sqlite.1.bak ``` #v(1em) Looking inside the database with `sqlitebrowser`: #v(0.3em) #set align(center) #image("./figs/sql-database.png", width: 50%) ] #slide()[ #v(1em) #align(center)[ #image("./figs/item-annotations.png", width: 100%) ] You can automate searching through this beyond what Zotero would let you do. - You can do it in any programming language - You can use your SQL skills (thanks Mark) to query things! ] #slide()[ #set align(center) #set align(horizon) #text(weight: "black", size: 40pt, fill: PRIMARY_COLOR)[ Fergus's top tip: write your own tools on top of Zotero. ] #v(5em) #text(size: 12pt)[Fergus should do another demo now.] ]
https://github.com/ufodauge/master_thesis
https://raw.githubusercontent.com/ufodauge/master_thesis/main/src/template/components/main-section/index.typ
typst
MIT License
#import "../common/page.typ" : Page #import "../common/heading.typ": H1, H2, H3-6 #import "../../constants/page.typ": PAGE_NUMBERING_MAIN #let MainSection( references: none, body ) = [ #set page(numbering: PAGE_NUMBERING_MAIN) #counter(page).update(1) #let NUMBERING_H1 = "第1章" #let NUMBERING_H2-6 = "1.1" #set heading(numbering: NUMBERING_H2-6) #let HeadingTemplate(numbering-format, it) = [ #let loc = it.location() #let indexes = counter(heading).at(loc) #numbering(numbering-format, ..indexes) #h(1em) #it.body ] #let isHeading(cts, level: none) = { return cts.func() == heading and ( level == none or cts.at("level") == level ) } #show heading : it => H3-6(HeadingTemplate(NUMBERING_H2-6, it)) #show heading.where(level: 1): it => H1( HeadingTemplate(NUMBERING_H1, it), ) #show heading.where(level: 2): it => H2( HeadingTemplate(NUMBERING_H2-6, it), inset: ( left : 2pt, bottom: 12pt ) ) #set math.equation( supplement: [式], numbering : (_) => { locate(loc => { let chapter = counter(heading).at(loc).first() let index = counter(math.equation).at(loc).first() return numbering("(1.1)", chapter, index) }) } ) #show figure: it => align(center, [ #let loc = it.location() #let chapter = counter(heading).at(loc).first() #let index = it.counter.at(loc).first() #if it.kind == image { block[ #it.body 図 #numbering("1.1: ", chapter, index) #it.caption.body ] } else if it.kind == table { block[ 表 #numbering("1.1: ", chapter, index) #it.caption.body #it.body ] } else { it } ]) #let pages = body.fields().children.fold((), (acc, cts) => { if isHeading(cts, level: 1) { acc.push(([ #set heading(numbering: NUMBERING_H1) #cts ],)) } else if acc.len() > 0{ if isHeading(cts, level: 2) { acc.last().push(cts) } else { // いいんだこれ acc.last().last() += cts } } return acc }).map((cts) => Page([ #counter(figure.where(kind: table)).update(0) #counter(figure.where(kind: image)).update(0) #cts.first() #v(-2pt) #cts.slice(1).fold([], (acc, v) => acc + block( inset: ( top : 6pt, bottom: 24pt, ), v )) ])) #for pg in pages [ #pg ] #Page[ #set bibliography(title: "参考文献") #show heading.where(level: 1): it => H1(it.body) #references ] ]
https://github.com/Dav1com/minerva-report-fcfm
https://raw.githubusercontent.com/Dav1com/minerva-report-fcfm/master/minerva-report-fcfm.typ
typst
MIT No Attribution
/// Esta función permite obtener ayuda sobre cualquier función /// del template. Para saber qué funciones y variables define /// el template simplemente deja que el autocompletado te guíe, /// luego puedes llamar esta función para obtener más ayuda. /// /// - nombre (str): Puede ser el nombre de una función o /// variable, entonces la función entrega /// ayuda general sobre esta. Si se entrega /// algo de la forma `"help(nombre)"` entonces /// entrega ayuda específica sobre el argumento /// `nombre`. /// -> content #let help(nombre) = { import "@preview/tidy:0.3.0" as tidy import "meta.typ": * let help = tidy.generate-help( namespace: local-namespace("minerva-report-fcfm.typ"), package-name: package-name, style: tidy-styles() ) show: help-show help(nombre) } #import "lib/states.typ" as states /// Contiene variables de estado utilizadas por el template. /// -> module #let states = states #import "lib/util.typ" as util /// Contiene múltiples utilidades, como arreglos y funciones que /// ayudan a la localización al español. /// -> module #let util = util #import "lib/rules.typ" as rules /// Contiene show y set rules que no son vitales para el template /// y que pueden ser activadas a gusto. /// -> module #let rules = rules #import "lib/front.typ" as front /// Contiene portadas varias. /// -> module #let front = front #import "lib/header.typ" as header /// Contiene encabezados varios. /// -> module #let header = header #import "lib/footer.typ" as footer /// Contiene pies de página varios. /// -> module #let footer = footer #import "lib/departamentos.typ" as departamentos /// Lista de departamentos, unidades y centros de la Facultad de Ciencias Físicas /// y Matemáticas. /// /// Un departamento es un diccionario con un nombre, y opcionalmente un logo, /// por ejemplo: /// /// ```typ /// let mi-departamento = ( /// nombre: ( /// "Universidad de Chile", /// "Facultad de Ciencias Físicas y Matemáticas", /// "Centro de Modelamiento Matemático" /// ), /// logo: read("logos/cmm.png") /// ) /// ``` /// -> module #let departamentos = departamentos /****************************************************************************** * Template * *****************************************************************************/ /// Función que aplica los estilos del template para informes. /// /// - meta (dictionary, module): Archivo `meta.typ`. /// - portada (function): Portada a usar. /// - header (function): Header a usar. /// - footer (function): Footer a usar. /// - margenes-portada (dictionary): Márgenes de la portada. /// - margenes (dictionary): Márgenes del documento. /// - showrules (bool): Si es `true` se aplicarán showrules irreversibles. /// Si se requiere más personalización recomiendo desactivar. /// - doc (content): Documento a aplicar el template. /// -> content #let informe( meta, portada: front.portada1, header: header.header1, footer: footer.footer1, margenes-portada: (top: 3.5cm), margenes: (top: 3.5cm), showrules: true, doc ) = { let portada-set-extra = (:) if margenes-portada != (:) { portada-set-extra.insert("margin", margenes-portada) } set document(title: meta.titulo, author: meta.autores, date: datetime.today()) set page(header: header(meta), footer: footer(meta), margin: margenes) set text(lang: "es", region: "cl", hyphenate: true) set heading(numbering: "1.") set par(leading: 0.5em, justify: true, linebreaks: "optimized") set math.equation(numbering: "(1)") show figure.where(kind: table): set block(width: 80%) show figure.where(kind: image): set block(width: 80%) if portada != none { set page(header: [], footer: [], ..portada-set-extra) portada(meta) } set page(numbering: "1") if showrules { show: rules.primer-heading-en-nueva-pag show: rules.operadores-es doc } else { doc } } /// Crea un resumen que no aparece en el índice (outline). /// /// - body (content): Cuerpo del resumen. /// -> content #let resumen(body) = [ #heading(level: 1, numbering: none, outlined: false)[Resumen] #body #pagebreak(weak: true) ] #let abstract = resumen
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/showybox/0.2.0/showy.typ
typst
Apache License 2.0
/* * ShowyBox - A package for Typst * <NAME> (c) 2023 * * showy.typ -- The package's main file containing the * public and (more) useful functions * * This file is under the MIT license. For more * information see LICENSE on the package's main folder. */ /* * Function: showybox() * * Description: Creates a showybox * * Parameters: * - frame: * + upper-color: Color used as background color where the title goes * + lower-color: Color used as background color where the body goes * + border-color: Color used for the showybox's border * + radius: Showybox's radius * + width: Border width of the showybox * + dash: Showybox's border style * - title-style: * + color: Text color * + weight: Text weight * + align: Text align * - body-styles: * + color: Text color * + align: Text align * - sep: * + width: Separator's width * + dash: Separator's style (as a 'line' dash style) */ #let showybox( frame: ( upper-color: black, lower-color: white, border-color: black, radius: 5pt, width: 2pt, dash: "solid" ), title-style: ( color: white, weight: "bold", align: left ), body-style: ( color: black, align: left ), sep: ( width: 1pt, dash: "solid" ), title: "", breakable: false, ..body ) = { block( fill: frame.at("border-color", default: black), radius: frame.at("radius", default: 5pt), inset: 0pt, breakable: // Auto break if there's no title if title != "" { false } else { breakable }, stroke: ( paint: frame.at("border-color", default: black), dash: frame.at("dash", default: "solid"), thickness: frame.at("width", default: 2pt) ) )[ /* * Title of the showybox. We'll check if it is * empty. If so, skip its drawing and only put * the body */ #if title != "" { block( inset:(x: 1em, y: 0.5em), width: 100%, fill: frame.at("upper-color", default: black), radius: (top: frame.at("radius", default: 5pt)))[ #align( title-style.at("align", default: left), text( title-style.at("color", default: white), weight: title-style.at("weight", default: "bold"), title ) ) ] v(-1.1em) // Avoid an inelegant space } /* * Body of the showybox */ #block( fill: frame.at("lower-color", default: white), width: 100%, inset:(x: 1em, y: 0.75em), radius: if title != "" { (bottom: frame.at("radius", default: 5pt)) } else { frame.at("radius", default: 5pt) }, align( body-style.at("align", default: left), text( body-style.at("color", default: black), body.pos().join( align(left, // Avoid alignement errors line( start:(-1em, 0pt), end: (100% + 1em, 0pt), stroke: ( paint: frame.at("border-color", default: black), dash: sep.at("dash", default: "solid"), thickness: sep.at("width", default: 1pt) ) ) ) ) ) ) ) ] }
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/visualize/shape-circle-04.typ
typst
Other
// Radius wins over width and height. // Error: 23-34 unexpected argument: width #circle(radius: 10pt, width: 50pt, height: 100pt, fill: eastern)
https://github.com/cadojo/correspondence
https://raw.githubusercontent.com/cadojo/correspondence/main/src/dear/src/statement.typ
typst
MIT License
// // Preamble // #import "../../rolo/rolo.typ": * #let statement( sender: author(), logo: none, title: "Statement of Purpose", date: datetime.today().display("[month repr:long] [day], [year]"), divider: true, theme: black, header: none, footer: none, body, ) = { set stack(spacing: 1em) set text(font: "New Computer Modern", size: 12pt) set par(justify: true) show heading: set text(theme) show par: set block(spacing: 1.5em) let titleblock = if some(title) { align(center, heading(level: 1, text(size: 26pt, title))) if divider { pad(top: 1em, line(length: 100%, stroke: 1pt + black)) } if some(sender) { set text(rgb(75,75,75)) stack(dir: ltr, spacing: 1fr, ..( fullname(sender.name), if some(sender.email) { sender.email } else { none } ).filter(some)) } } else { none } set page( header: header, header-ascent: 1em, footer: if some(footer) { footer } else { set text(rgb(75,75,75)) place(left, align(left, date)) place(right, align(right, counter(page).display("1 / 1", both: true))) }, ) move(dy: -1em, titleblock) show link: set text(theme) body }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/anatomy/0.1.0/lib.typ
typst
Apache License 2.0
#let metrics( size, typeface, _text, top-edges: ( "ascender", "cap-height", "x-height", "baseline" ), bottom-edges: ( "descender", ), typeset: ((:)) => [] ) = style(styles => { let edges = top-edges + bottom-edges let get-metric(edge, above-baseline: true) = { let frame = measure(text( size, font: typeface, top-edge: if above-baseline { edge } else { "baseline" }, bottom-edge: if above-baseline { "baseline" } else { edge } )[.], styles) return (if above-baseline { 1 } else { -1 } * frame.height) } let metrics = (:) for edge in top-edges { metrics.insert(edge, get-metric(edge)) } for edge in bottom-edges { metrics.insert( edge, get-metric(edge, above-baseline: false)) } locate(loc => { let top-edge = edges.first() let bottom-edge = edges.last() let stroke_width = 0.5pt let description-size = (1 + 2 / 3) / 10 * 1em set text( size, font: typeface, ) block( width: 100%, above: description-size, below: description-size, { set align(left) box( height: metrics.at(top-edge) - metrics.at(bottom-edge), clip: true, text( top-edge: top-edge, bottom-edge: bottom-edge, features: ( "pkna", ), _text ) ) for metric in metrics.pairs() { place(top, move( dy: metrics.at(top-edge) - metric.at(1) - stroke_width / 2, grid( columns: 2, gutter: description-size / 4, line( length: 100%, stroke: stroke_width ), text( description-size, // Place edge description at the half of x-height top-edge: metrics.at("x-height") / size / 2 * 1em, metric.at(0) ) ) )) } }) }) [ #typeset(metrics) ] })
https://github.com/pta2002/typst-timeliney
https://raw.githubusercontent.com/pta2002/typst-timeliney/main/timeliney.typ
typst
MIT License
#import "@preview/cetz:0.2.2": canvas, draw, coordinate, util #let timeline( body, spacing: 5pt, show-grid: false, grid-style: (stroke: (dash: "dashed", thickness: .5pt, paint: gray)), tasks-vline: true, line-style: (stroke: 3pt), milestone-overhang: 5pt, milestone-layout: "in-place", box-milestones: true, milestone-line-style: (), offset: 0, ) = style( styles => { layout( size => { canvas( debug: false, length: size.width, { import draw: * let headers = () let tasks = () let flat_tasks = () let milestones = () let n_cols = 0 let pt = 1 / size.width.pt() for line in body { if line.type == "header" { headers.push(line.headers) if line.total > n_cols { n_cols = line.total } } else if line.type == "task" or line.type == "taskgroup" { tasks.push(line) } else if line.type == "milestone" { milestones.push(line) } } // Task titles group( { let i = 0 for task in tasks { if task.type == "task" { content( (rel: (0, 0)), task.name, anchor: "north", name: "task" + str(i), padding: spacing, ) anchor( "task" + str(i) + "-bottom", (rel: (0, 0), to: "task" + str(i) + ".south", update: true), ) anchor( "task" + str(i) + "-top", (rel: (0, 0), to: "task" + str(i) + ".north-west", update: false), ) anchor( "task" + str(i), (rel: (0, 0), to: "task" + str(i) + ".east", update: false), ) flat_tasks.push(task) i += 1 } else if task.type == "taskgroup" { for t in task.tasks { content( (rel: (0, 0)), t.name, anchor: "north", name: "task" + str(i), padding: spacing, ) anchor( "task" + str(i) + "-bottom", (rel: (0, 0), to: "task" + str(i) + ".south", update: true), ) anchor( "task" + str(i) + "-top", (rel: (0, 0), to: "task" + str(i) + ".north-west", update: false), ) anchor( "task" + str(i), (rel: (0, 0), to: "task" + str(i) + ".east", update: false), ) flat_tasks.push(t) i += 1 } } } if milestone-layout == "aligned" { for (i, milestone) in milestones.enumerate() { content( (rel: (0, 0)), milestone.body, anchor: "north", name: "milestone" + str(i), padding: spacing, ) anchor( "milestone" + str(i) + "-bottom", (rel: (0, 0), to: "milestone" + str(i) + ".south", update: true), ) anchor( "milestone" + str(i) + "-right", (rel: (0, 0), to: "milestone" + str(i) + ".east", update: false), ) anchor( "milestone" + str(i) + "-top", (rel: (0, 0), to: "milestone" + str(i) + ".north", update: false), ) } } }, name: "titles", ) // Now that we have laid out the task titles, we can render the task group boxes group( ctx => { on-layer( 1, { let start_x = coordinate.resolve(ctx, "titles.north-west").at(1).at(0) let end_x = 1 + start_x let i = 0 for group in tasks { if group.type != "taskgroup" { i += 1 continue } let start_i = i let group_start = none let group_end = none for task in group.tasks { if group_start == none { let start_y = coordinate.resolve(ctx, "titles.task" + str(i) + "-top").at(1).at(1) group_start = (start_x, start_y) } let end_y = coordinate.resolve(ctx, "titles.task" + str(i) + "-bottom").at(1).at(1) group_end = (end_x, end_y) i += 1 } rect(group_start, group_end, stroke: 1pt) } if tasks-vline { line("titles.north-east", "titles.south-east") } if box-milestones and milestone-layout == "aligned" { let start = none let end = none for (i, milestone) in milestones.enumerate() { if start == none { let start_y = coordinate.resolve(ctx, "titles.milestone" + str(i) + "-top").at(1).at(1) start = (start_x, start_y) } let end_y = coordinate.resolve(ctx, "titles.milestone" + str(i) + "-bottom").at(1).at(1) end = (end_x, end_y) } rect(start, end, stroke: 1pt) } }, ) }, name: "boxes", ) get-ctx( ctx => { let (start_x, start_y, _) = coordinate.resolve(ctx, "titles.north-east").at(1) let end_x = 1 + coordinate.resolve(ctx, "titles.north-west").at(1).at(0) let end_y = coordinate.resolve(ctx, "titles.south").at(1).at(1) group( { for (i, header) in headers.rev().enumerate() { let passed = 0 for group in header { let group_start = none let group_end = none for (name, len) in group.titles { let start = ( a: (start_x, start_y + 16 * (i + 1) * pt), b: (end_x, start_y + 16 * (i + 1) * pt), number: passed / n_cols * 100%, ) if group_start == none { group_start = start } let end = ( a: (start_x, start_y + 16 * i * pt), b: (end_x, start_y + 16 * i * pt), number: (passed + len) / n_cols * 100%, ) group_end = end content(start, end, anchor: "north-west", align(center + horizon, name)) passed += len } let group_style = (stroke: 1pt + black) if "style" in group { group_style = group.style } rect(group_start, group_end, ..group_style) } } }, name: "top-headers", ) // Draw the lines for (i, task) in flat_tasks.enumerate() { let start = "titles.task" + str(i) let task_start_y = coordinate.resolve(ctx, "titles.task" + str(i)).at(1).at(1) let (task_top_x, task_top_y, _) = coordinate.resolve(ctx, "titles.task" + str(i) + "-top").at(1) let task_bottom_y = coordinate.resolve(ctx, "titles.task" + str(i) + "-bottom").at(1).at(1) let h = task_top_y - task_bottom_y for gantt_line in task.lines { let start = ( a: (start_x, task_start_y), b: (end_x, task_start_y), number: (gantt_line.from + offset) / n_cols * 100%, ) let end = ( a: (start_x, task_start_y), b: (end_x, task_start_y), number: (gantt_line.to + offset) / n_cols * 100%, ) let style = line-style if ("style" in gantt_line) { style = gantt_line.style } line(start, end, ..style) } } // Grid if show-grid != false { let month_width = (end_x - start_x) / n_cols on-layer( -1, { // Horizontal if show-grid == true or show-grid == "x" { for i in range(1, n_cols) { line( (start_x + month_width * i, start_y), (start_x + month_width * i, end_y), ..grid-style, ) } } if show-grid == true or show-grid == "y" { for (i, task) in flat_tasks.enumerate() { let task_bottom_y = coordinate.resolve(ctx, "titles.task" + str(i) + "-bottom").at(1).at(1) line((start_x, task_bottom_y), (end_x, task_bottom_y), ..grid-style) } if milestone-layout == "aligned" { for (i, milestone) in milestones.enumerate() { let bottom_y = coordinate.resolve(ctx, "titles.milestone" + str(i) + "-bottom").at(1).at(1) line((start_x, bottom_y), (end_x, bottom_y), ..grid-style) } } } // Border all around the timeline rect("titles.north-west", (end_x, end_y), stroke: black + 1pt) }, ) } // Milestones if milestones.len() > 0 { let draw-milestone( i, at: 0, body: "", style: milestone-line-style, overhang: milestone-overhang, spacing: spacing, anchor: "north", type: "milestone", ) = { if milestone-layout == "in-place" { let x = (end_x - start_x) * ((at + offset) / n_cols) + start_x get-ctx( ctx => { let pos = (x: x, y: end_y - (spacing + overhang).pt() * pt) let box_x = x let (w, h) = util.measure(ctx, body) if x + w / 2 > end_x { box_x = end_x - w / 2 } if i != 0 { let (prev_end_x, prev_start_y, _) = coordinate.resolve-anchor(ctx, "milestone" + str(i - 1) + ".north-east") let prev_end_y = coordinate.resolve-anchor(ctx, "milestone" + str(i - 1) + ".south").at(1) if box_x - w / 2 < prev_end_x and pos.y <= prev_start_y and pos.y + h >= prev_end_y { pos = (x: x, y: prev_end_y - spacing.pt() * pt * 2) } } line((x, start_y), (rel: (0, overhang.pt() * pt), to: pos), ..style) on-layer( 1, { content((box_x, pos.y), anchor: anchor, body, name: "milestone" + str(i)) }, ) }, ) } else if milestone-layout == "aligned" { let x = (end_x - start_x) * (at / n_cols) + start_x let end_y = coordinate.resolve(ctx, "titles.milestone" + str(i) + "-right").at(1).at(1) line((x, start_y), (x, end_y), (start_x, end_y), ..style) } } on-layer(-0.5, { if milestone-layout == "aligned" { set-ctx(ctx => { ctx.prev.pt = coordinate.resolve(ctx, "titles.south").at(1) return ctx }) } for (i, milestone) in milestones.enumerate() { draw-milestone(i, ..milestone) } }) } }, ) }, ) }, ) }, ) #let headerline(..args) = { let groups = args.pos() let headers = () let current_group = () let total = 0 let parse_entry(e) = { if type(e) == array { return e } else { return (e, 1) } } for grp in groups { if type(grp) == array { current_group.push(grp) total += grp.at(1) } else if type(grp) == dictionary { if current_group.len() > 0 { headers.push(current_group) } headers.push((titles: grp.group.map(parse_entry))) total += grp.group.map(n => parse_entry(n).at(1)).sum() } else { current_group.push((grp, 1)) total += 1 } } if current_group.len() > 0 { headers.push((titles: current_group)) } return ((type: "header", headers: headers, total: total),) } #let group(..args) = { return (group: args.pos()) } #let task(name, style: none, ..lines) = { let processed_lines = () for line in lines.pos() { if type(line) == dictionary { processed_lines.push(line) } else { let (from, to) = line if style != none { processed_lines.push((from: from, to: to, style: style)) } else { processed_lines.push((from: from, to: to)) } } } ((type: "task", name: name, lines: processed_lines),) } #let taskgroup(title: none, tasks) = { let extratask = () if title != none { let min = none let max = none for task in tasks { for l in task.lines { if min == none or l.from < min { min = l.from } if max == none or l.to > max { max = l.to } } } extratask = ((type: "task", name: title, lines: ((from: min, to: max),)),) } ((type: "taskgroup", tasks: extratask + tasks),) } #let milestone(body, at: none, ..options) = { ((type: "milestone", at: at, body: body, ..options.named()),) }
https://github.com/fywc/Resume_Template
https://raw.githubusercontent.com/fywc/Resume_Template/main/README.md
markdown
# Resume Template A resume template written in typst, designed for zh_CN. ## How to use Create a project on [typst.app](https://typst.app/), then copy and paste everything in `main.typ` and `template.typ`, and all done! Online [preview](https://typst.app/project/rL4K5AXmR67yYXwlws9nh5). (The first compilation may be a bit slow, but afterwards it will be an incremental compilation where you see the results immediately.)
https://github.com/cnaak/blindex.typ
https://raw.githubusercontent.com/cnaak/blindex.typ/main/lib.typ
typst
MIT License
//============================================================================================// // Includes // //============================================================================================// #import "./books.typ": iBoo, bSort #import "./lang.typ": lDict //============================================================================================// // Book Info Retrieving // //============================================================================================// // abrv to dict -> dict #let a2d(abrv, lang) = { let ret = () for (KEY, VALUE) in lDict { let VAL = (abbr: VALUE.at(lang).at(0), full: VALUE.at(lang).at(1)) if abrv == VAL.abbr { let SRT = (:) let BID = int(KEY) for SS in bSort.keys() { let DB = bSort.at(SS) let IDX = none for idx in range(DB.len()) { if DB.at(idx) == BID { IDX = idx break } } SRT.insert(SS, IDX) } ret.push(( "BUID": KEY, // Book's unique ID "lang": lang, // Query's used {lang} "abrv": VAL.abbr, // Query's used {abrv} "full": VAL.full, // Book's full name "STDN": iBoo.at(KEY), // Book's Standard Name (English) "SORT": SRT, // Book's index in existing sorting schemes ) ) } } return ret } //============================================================================================// // Biblical Literature Indexing // //============================================================================================// // Biblical Literature Indexing #let blindex(abrv, lang, entry) = context [ #metadata(( ABRV: abrv, LANG: lang, DATA: a2d(abrv, lang), ENTR: entry, WHRE: here().position(), ))<bl_index> ] // Index making. {BSS} is the Book Sorting Scheme, a key of the {bSort} dict, defined at // "./books.typ" and written to <metadata>.<bl_index>.<instance>.at(i).at(bUID).DATA.SORT #let mkIndex( cols: 2, gutter: 8pt, wgt: (bk: "bold", tx: "regular", pg: "extrabold"), pattern: [.], merged-book-headings-full: true, mbhf-join: (" / ",), sorting-tradition: "Oecumenic-Bible", exclude-missing: false, ) = context { let BIG = 100000 let HUGE = 1000000 let idxDict = (:) let rawList = query(<bl_index>) // An array of metadata for __e in rawList { // __e is a metadata entry let __r = __e.value // __r is the record placed by blindex(...) let booSort = __r.DATA.at(0).SORT.at(sorting-tradition) if (not exclude-missing) or (booSort != none) { let booHArr = () // Most generic book heading (as some are mergings) if (__r.DATA.len() > 1) and (merged-book-headings-full) { // Merged book display for __d in __r.DATA { booHArr.push(__d.full) } } else { // Single book display booHArr.push(__r.DATA.at(0).full) } let booHead = if mbhf-join.len() > 1 { booHArr.join(mbhf-join.at(0), last: mbhf-join.at(1)) } else { booHArr.join(mbhf-join.at(0)) } let the_Key = if booSort != none { str(booSort + HUGE) } else { str(BIG + HUGE) } let the_Val = (__r.ENTR, __r.WHRE.page) // Populates idxDict if the_Key in idxDict { idxDict.at(the_Key).at(1).push(the_Val) } else { idxDict.insert(the_Key, (booHead, (the_Val,))) } } } let sorKeys = idxDict.keys().sorted() columns(cols, gutter: gutter)[ #for SK in sorKeys { text(weight: wgt.bk, idxDict.at(SK).at(0)) linebreak() for VL in idxDict.at(SK).at(1) { box(width: 1.2em) text(weight: wgt.tx, VL.at(0)) // ENTRY box(width: 0.3em) box(width: 1fr, repeat(align(center, box(width: 0.5em, pattern)))) box(width: 1.8em, align(center, text(weight: wgt.pg, [#VL.at(1)]))) // PAGE linebreak() } } ] } //============================================================================================// // Biblical Literature Quoting // //============================================================================================// // Biblical Literature fill, for background #let blFill = rgb("00000020") // Results in a transparent light gray // "raw" Quoting of Biblical Literature #let rQuot(body, tfmt: (font: "Linux Libertine", weight: "medium", lang: "en"), fill: true, quotes: true, ) = { if fill { if quotes { smartquote(double: true) } highlight(fill: blFill, text(..tfmt, body)) if quotes { smartquote(double: true)} } else { if quotes { smartquote(double: true) } text(..tfmt, body) if quotes { smartquote(double: true)} } } // "line" Citation of Biblical Literature #let lCite(abrv, lang, pssg, version, cited) = [ --- #a2d(abrv, lang).at(0).full~#pssg (#version)~#cite(cited)] // "inline" Quoting of Biblical Literature #let iQuot(body, abrv, lang, pssg, version, cited, tfmt: (font: "Linux Libertine", weight: "medium", lang: "en"), fill: true, quotes: true, ) = { rQuot(body, tfmt: tfmt, fill: fill, quotes: quotes) lCite(abrv, lang, pssg, version, cited) blindex(abrv, lang, pssg) } // "block" Quoting of Biblical Literature #let bQuot(body, abrv, lang, pssg, version, cited, tfmt: (font: "Linux Libertine", weight: "medium", lang: "en"), fill: true, quotes: false, width: 90%, inset: 4pt, fill-below: false, ) = { align(center, stack(dir: ttb, block(width: width, fill: if fill { blFill } else { none }, inset: inset, align(left, par(leading: 0.65em, justify: true, linebreaks: "optimized", if quotes { [#smartquote(double: true)] } else { [] } + [#text(..tfmt, body)] + if quotes { [#smartquote(double: true)] } else { [] } ) ), ), block(width: width, fill: if fill-below { blFill } else { none }, inset: inset, align(right, lCite(abrv, lang, pssg, version, cited) ) ), blindex(abrv, lang, pssg) ) ) }
https://github.com/coco33920/.files
https://raw.githubusercontent.com/coco33920/.files/mistress/typst_templates/moderncv.typst/README.md
markdown
# ModernCV for Typst * [How to use](#how-to-use) * [Examples](#examples) * [How to customize colors](#how-to-customize-colors) ![Template preview](preview.png) This is a [typst](https://github.com/typst/typst) template inspired by LaTeX's [moderncv](https://github.com/moderncv/moderncv). Currently it features a very basic structure, but the main components are defined to allow for sufficient flexibility such to provide all the customizations that the original package has. ## How to use This template provides a few customizations that should be considered when writing CVs: * Headings: * `h1` for two-columns, coloured section headings * `h2` and `h3` used internally for job roles and places * `h4` usable as a generic heading by users * Functions: * `cvcol`: used to write in the rightmost column only. Builds on `cvgrid` * `cventry`: used to write a CV entry. Builds on `cvgrid` * `cvlangauge`: used to write a language entry. Builds on `cvgrid` * `datebox`: provides content with stacked year above (big) and month below (tinier) * `daterange`: two `datebox`es separated by an em dash * `xdot`: adds a trailing dot to a string only if it's not already present * `cvgrid`: basic layout function that wraps a grid. Controlled by two parameters `left_column_size` (default: 25%) and `grid_column_gutter` (default: 8pt) which control the left column size and the column gutter respectively. Most of the times you'll be using `cventry` and `cvcol`, for example: ```typst = Work Experience #cventry( start: (month: "December", year: 2101), end: (month: "", year: "Present"), role: [Junior Frobnication Engineer], place: "WeDontWork Inc.")[ Your description here ] #cvcol[ ==== Generic stuff My other stuff goes here ] ``` ## Examples See `example.typ` `example.pdf`. ## How to customize colors Currently the `project` function exposes three different color parameters: * `main_color`: Used by left-side heading bars (default: `rgb(147, 14, 14)`) * `heading_color`: Used in headings text (default: same as `main_color`) * `job_color`: Used in the main job occupation text (default: `rgb("#737373")`)
https://github.com/augustebaum/tenrose
https://raw.githubusercontent.com/augustebaum/tenrose/main/examples/filerender.typ
typst
MIT License
#import "@preview/diagraph:0.2.2": * #render(read("./filerender.dot"))
https://github.com/Wybxc/typst-nix
https://raw.githubusercontent.com/Wybxc/typst-nix/main/examples/handout.typ
typst
Apache License 2.0
#import "@local/handout:0.2.0": * #show: project.with( title: "Handout 01", authors: ( "Wybxc", ), date: "September 2023", ) = Bounded Subset Sum == (a) Consider the case where $a_1 = 1/(1+ρ) C, a_2 = a_3 = dots.c = (1+ρ)/(2+ρ) C$. In this case, we have $a_1 + a_2 > C$, so according to the greedy algorithm, we obtain $T(S) = a_1 = 1/(1+ρ) C$. However, the optimal solution is $T^*(S) >= a_2 = (1+ρ)/(2+ρ) C$, and we have $ (T^*(S))/T(S) = (1+ρ)/(2+ρ) " /" 1/(1+ρ) = (1+ρ)^2/(2+ρ) > ρ $ Therefore, for any approximation ratio $ρ$, this greedy algorithm cannot reliably achieve it. == (b) 1. If there exists $a_i>=C/2$, set the initial value of $S$ to be ${a_i}$; otherwise, set $S$ to be an empty set. 2. Run the greedy algorithm from part (1) with this initial value of $S$ to obtain the final value of $S$. It can be proven that the algorithm described in part (b) will always find an $S$ that satisfies $T(S) >= C/2$, making it an approximation algorithm with an approximation ratio of 2.
https://github.com/fsr/rust-lessons
https://raw.githubusercontent.com/fsr/rust-lessons/master/src/lesson3.3.typ
typst
#import "slides.typ": * #show: slides.with( authors: ("<NAME>", "<NAME>"), short-authors: "H&A", title: "Wer rastet, der rostet", short-title: "Rust-Kurs Lesson 3", subtitle: "Ein Rust-Kurs für Anfänger", date: "Sommersemester 2023", ) #show "theref": $arrow.double$ #show link: underline #new-section("Ownership, References and Slices") #slide(title: "Ownership")[ - memory is managed through system of ownership - a set of rules checked by the compiler - memory safety guarantees without a garbage collector - rule violation theref compile error - no runtime overhead ] #slide(title: "Ownership rules")[ From the original Rust Book: - Each value in Rust has an *owner*. - There can only be one owner at a time. - When the owner goes out of scope, the value will be _dropped_. ] #slide(title: "The String type")[ #columns(2)[ - can store data of arbitrary length - meta data stored on stack - content allocated on heap #begin(2)[ ```rust { // allocates memory to store // "hello" on the heap let s1 = String::from("hello"); // s1 is valid here } // s1 is out of scope // String will be dropped, memory deallocated ``` ] #colbreak() #begin(3)[ #figure( image("assets/l3.3_string-memory-representation.svg", width: 100%), caption: [Memory representation of s1.], ) ] ] ] #slide(title: "Move Ownership out of function")[ ```rust fn main() { let outer_string = foo(); println!("{}", outer_string); } fn foo() -> String { let inner_string = String::from("hello world"); inner_string } ``` ] #slide(title: "Is this valid code?", theme-variant: "action")[ ```rust fn strings() -> String { let original = String::from("hello"); let new_owner = original; ```#only(2)[```rust // new_owner takes the ownership from original // which means original does not own it anymore // „one owner“-Rule ```]```rust println!("{}", original); new_owner } ``` ] #slide(title: "Move Ownership into function")[ #columns(2)[ ```rust fn main() { let s = String::from("hello"); let len = get_length(s); ``` #begin(3)[```rust // s has been moved into function, // is invalid now ```] ```rust println!("|{}| == {}", s, len); } fn get_length(some_string: String) -> usize { println!("{}", some_string); some_string.len() ``` #begin(4)[```rust // some_string is dropped here ```] ```rust } ``` #colbreak() #uncover("2-")[ in this code: - where are strings moved? - where are strings dropped? ] ] ] #slide(title: "References and Borrowing")[ ```rust fn main() { let s = String::from("hello"); let len = get_length(&s); println!("|{}| == {}", s, len); } ``` #uncover(2)[```rust // here, get_length borrows the string, // it doesn't move it and doesn't own it ```] ```rust fn get_length(some_string: &String) -> usize { some_string.len() } ``` ] #slide(title: "References and Borrowing: mutably")[ ```rust fn main() { let s = String::from("hello"); append_world(&mut s); println!("|{}|", s); } ``` #uncover(2)[```rust // here, append_world gets a mutable reference // that it changes ```] ```rust fn append_world(some_string: &mut String) { some_string.push_str(", world!"); } ``` ] #slide(title: "Scope of References")[ ```rust fn main() { let s = String::from("hello"); let ref1 = &s; // why is this not allowed? append_world(&mut s); println!("|{}|", ref1); println!("|{}|", s); } ``` #uncover(2)[```rust // references exist until their last use // an immutable reference is not allowed while there‘s also a &mut ```]] #slide(title: "Dereferencing")[ #columns(2)[ - the `*` operator follows the reference to its original location ```rust let a = 13; // a has type `i32` let b = &a; // b has type `&i32` let c = *b; // c has type `i32` ``` #colbreak() #uncover(2)[ ```rust let mut value = 12; let value_ref = &mut value; *value_ref = 6; println!("{value}"); // prints 6, because we changed the // content of `value` with `value_ref` ``` ] ] ] #slide(title: "Dangling References")[ - returning a reference to a value that will be dropped is an error ```rust fn create_dangling_ref() -> &String { let s = String::from("hello"); &s // `s` will be dropped, so any reference to `s` will be invalid } ``` ] #slide(title: "Summary: Rules of References")[ - you can have _either_ \ *one mutable reference* _XOR_ \ *any number of immutable references* - references must always be valid \ theref no references to dropped memory ] #slide(title: "The Slice type")[ #grid( columns: (1fr, 1fr), align(horizon)[ - a *slice is a reference* to a contiguous sequence of elements in a collection \ theref does not take ownership #uncover("2-")[ - `&str` is a _string slice_ ```rust let s = String::from("hello world"); let hello = &s[0..5]; let world: &str = &s[6..11]; ``` ] \ #uncover("4-")[ ```rust let string_literals = "are slices too!"; ``` - they point to a place in the binary (data segment), not in the heap ] ], align(right + horizon)[ #uncover("3-")[ #image("assets/l3.3_string_slice.svg", height: 80%) ] ], )] #slide(title: "Range Syntax")[ - [a, b) $<==>$ `[inclusive..exclusive]` - [a, b] $<==>$ `[inclusive..=inclusive]` ```rust let s = String::from("range fun"); // 012345678 let range = &s[..5]; // same as [0..5] let fun = &s[6..]; // same as [6..(s.len())] let range_fun = &s[..]; // same as [0..=(s.len()-1)] ``` ] #slide(title: "String slices as parameters")[ - converting a `String` to a `&str` is easy - converting a `&str` to a `String` requires heap allocation #columns(2)[ ```rust fn compute_string(s: &String) -> &str {...} ``` - takes a reference to a `String` - can only be called with a reference to a `String` #colbreak() ```rust fn compute_str(s: &str) -> &str {...} ``` - takes a _string slice_ - can easily be called with any `String`, _string slice_, _string literal_, reference to a `String` - generally preferred ] ] #slide(title: "Slicing arrays")[ ```rust let array = [1, 2, 3, 4, 5]; let slice: &[i32] = &array[1..4]; assert_eq!(slice, &[2, 3, 4]); ``` ] #slide(title: "Exercise", theme-variant: "action")[ Write a program that reads a sentence from standard input. Print each word from that sentence in a new line. Hint: Try to separate the words by whitespace. You can use this code to read a single line from standard input. ```rust let mut sentence = String::new(); std::io::stdin().read_line(&mut sentence).expect("Failed to read sentence"); ``` ]
https://github.com/chrischriscris/Tareas-CI5651-EM2024
https://raw.githubusercontent.com/chrischriscris/Tareas-CI5651-EM2024/main/skel2/src/template.typ
typst
#let conf(font: "CMU Concrete", math_font: "Neo Euler", title, doc) = { // Document configuration set document(title: [#title], author: "<NAME>") set page(margin: 2cm, numbering: "1") // Style configuration set text(font: font, lang: "es") show raw: set text(font: "JetBrains Mono") show math.equation: set text(font: math_font) show link: doc => underline[#text(fill: blue)[#doc]] // Paragraph configuration set par(leading: 0.55em, justify: true) show par: set block(above: 1em, spacing: 0.55em) // Misc configuration show heading: it => { set align(center) set text(14pt) block(height: 1.5em)[#it] } set list(tight: false) set enum(tight: false) // Initial content grid(columns: (1fr, 1fr), block[ #set align(center) #image("logo.png", width: 50%) Universidad Simón Bolívar \ CI-5651 - Diseño de Algoritmos I \ Prof. <NAME> \ ], [ #set align(end) #rect(fill: rgb("c4e6ff"), outset: 0.5em, radius: 5pt)[ #set align(center) Resuelto por: \ <NAME> \ ] ]) // Document body [= #title] doc } // Helper for questions #let question(..args) = { let questions = args.pos() let n = questions.len() let i = 0 while i < n { let question = questions.at(i) let answer = questions.at(i + 1) enum(start: calc.floor(i / 2 + 1))[ #question \ \ #answer ] if i + 2 < n { pagebreak() } i += 2 } } // Helper for pseucode #let pseudocode(code-block) = { align(center)[ #block( fill: rgb("f0f8ff"), inset: 1em, radius: 5pt, stroke: gray, )[#code-block] ] } #let GITFRONT_REPO = "https://gitfront.io/r/chrischriscris/swaWSXShzVoW/Tareas-CI5651-EM2024/tree/"; #let GITHUB_REPO = "https://github.com/chrischriscris/Tareas-CI5651-EM2024/tree/main/";
https://github.com/arthurcadore/eng-telecom-workbook
https://raw.githubusercontent.com/arthurcadore/eng-telecom-workbook/main/semester-7/DLP2/project1/project.typ
typst
MIT License
#import "@preview/klaro-ifsc-sj:0.1.0": report #import "@preview/codelst:2.0.1": sourcecode #show heading: set block(below: 1.5em) #show par: set block(spacing: 1.5em) #set text(font: "Arial", size: 12pt) #show: doc => report( title: "Dispositivos Lógicos Progamáveis II", subtitle: "Consumo de área em bin2bcd e contagem binária", authors: ("<NAME> e <NAME>",), date: "02 de Abril de 2023", doc, ) = Introdução Neste relatório, está explicita duas implementações de soma de números representados em binário. Os números a serem somados serão inseridos no circuito como dois vetores de bits (8bits cada), desta forma, o somador poderá somar números de 0 a 99. A primeira implementação será realizada diretamente em BCD, ou seja, a soma dos vetores de bits é realizada em BCD e em seguida convertida para SSD (representação para display de 7-segmentos) enquanto que na segunda implementação, a soma é realizada em binário primeiro, e em seguida convertida para BCD e posteriormente para SSD. O objetivo deste relatório é comparar o consumo de área e o tempo de propagação entre as duas implementações, e determinar qual é a mais eficiente e adequada para cenários de aplicação. = Implementação com somador BCD A primeira implementação foi realizada diretamente com a soma em BCD e a conversão para SSD. Para isso, utilizamos um somador BCD de 4 dígitos, que soma dois números BCD de 4 dígitos e retorna o resultado em BCD. Como a soma é de números com 2 algarismos, é necessário 8 bits (4 mais 4) para a representação em BCD. Portanto, a entrada do somador é de dois vetores de 8bits. #figure( outlined: true, image("./pictures/RTL-P1.png", width: 80%), caption: [RTL - Circuito da Primeira Parte \ Figura elaborada pelo autor], supplement: "Figura" ); Como podemos ver na imagem apresentada acima, o RTL mostra a implementação do somador BCD de 4 dígitos. O somador recebe dois vetores de 4 bits cada (um para dezena e outro para a unidade), e retorna um vetor de 4 bits, para o somador da unidade, o carry out é enviado para o somador da dezena. Em seguida, são utilizados três conversores BCD para SSD, que convertem um número BCD de 4 bits para um display de 7 segmentos, para a representação do número somado. Para verificar seu funcionamento, na primeira etapa, realizamos um testebench para verificar se a implementação está correta. Abaixo está a simulação do testbench: #figure( outlined: true, image("./pictures/RTLSIM-P1.png", width: 80%), caption: [Simulação RTL - Primeira parte\ Figura elaborada pelo autor], supplement: "Figura" ); = Implementação com somador binário e conversor BCD Para realizar a segunda etapa da atividade, implementamos quatro códigos VHDL para a contagem ocorrer em binário (de maneira mais simples), e em seguida realizar sua conversão para BCD (oque é mais custoso em relação a primeira parte da atividade). Para isso, utilizamos os códigos bin2bcd, binAdder e bcd2ssd, além de um código que declara os componentes utilizados, chamado project1. #figure( outlined: true, image("./pictures/RTL-P2.png", width: 80%), caption: [RTL - Circuito da Segunda Parte\ Figura elaborada pelo autor], supplement: "Figura" ); Como podemos notar, nesta segunda implementação, os dois vetores de bits são diretamente somados e em seguida convertidos para BCD e posteriormente para SSD, para isso, os seguintes códigos (representados por componentes) foram utilizados: O código bin2bcd é responsável por converter um número binário de 8 bits para BCD, dividindo o número em centenas, dezenas e unidades. \ O código binAdder é responsável por somar dois números binários de 8 bits, e o código bcd2ssd é responsável por converter um número BCD para um display de 7 segmentos. \ Por fim, o código "project1" declara os componentes utilizados e realiza a conexão entre eles. Para verificarmos seu funcionamento, realizamos um testbench para verificar se a implementação está correta. Abaixo está a simulação do testbench: #figure( outlined: true, image("./pictures/RTLSIM-P2.png", width: 80%), caption: [Simulação RTL - Segunda parte\ Figura elaborada pelo autor], supplement: "Figura" ); Podemos notar que a implementação 2 é mais complexa que a implementação 1, pois a implementação 2 realiza a soma em binário e em seguida converte para BCD e SSD, enquanto que a implementação 1 realiza a soma diretamente em BCD e converte para SSD. = Conclusão A partir dos resultados obtidos, podemos concluir que a implementação 1 é mais rápida devido ao tempo de propagação amostrado em cada um dos casos. Também podemos concluir que a implementação Y é mais eficiente em termos de área, pois o consumo de área foi menor em relação à implementação X. #table( columns: (1fr, 1fr, 1fr), align: (left, center, center), table.header[Implementacao][Área (LE)][Tempo de propagação (ns)], [Parte 1], [48], [3.823], [Parte 2], [83], [13.699], ) = Códigos VHDL utilizados - Parte 2: Para a segunda parte, utilizei outro arquivo bin2bcd.vhd, ao invés do arquivo provido pelo professor em aula, devido a dificuldades de coloca-lo em operação. Como a implementação abaixo não necessita de registradores para operar, o calculo de área e tempo de propagação foi feito sem necessidade de alterações, garantindo confiabilidade no resultado obtido. == bin2bcd #sourcecode[```vhd library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity bin2bcd is port ( A : in std_logic_vector (7 downto 0); sd, su, sc : out std_logic_vector (3 downto 0) ); end entity; architecture ifsc_v1 of bin2bcd is signal A_uns : unsigned (7 downto 0); signal sd_uns, su_uns, sc_uns : unsigned (7 downto 0); begin A_uns <= unsigned(A); sc_uns <= A_uns/100; sd_uns <= A_uns/10; su_uns <= A_uns rem 10; sc <= std_logic_vector(resize(sc_uns, 4)); sd <= std_logic_vector(resize(sd_uns, 4)); su <= std_logic_vector(resize(su_uns, 4)); end architecture; ```] O código binAdder é reponsavel por somar dois números binários de 7 (128 represetações possiveis, e portanto atendendo a especificação) bits e retornar o resultado em binário com 8 bits. == binAdder #sourcecode[```vhd library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity binAdder is generic( Nlength: integer := 7 ); port( in_1: in std_logic_vector(Nlength - 1 downto 0); in_2: in std_logic_vector(Nlength - 1 downto 0); out_1: out std_logic_vector(Nlength downto 0) ); end binAdder; architecture v1 of binAdder is signal bin1, bin2: unsigned(Nlength downto 0); signal out_bin: unsigned(Nlength downto 0); begin bin1 <= resize(unsigned(in_1),Nlength + 1); bin2 <= resize(unsigned(in_2),Nlength + 1); out_bin <= bin1 + bin2; out_1 <= std_logic_vector(out_bin); end v1; ```] == bcd2ssd: O código bcd2ssd é responsável por converter um número BCD de 4 bits para um display de 7 segmentos. #sourcecode[```vhd library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity bcd2ssd is port ( bcd : in std_logic_vector(3 downto 0); ssd_out : out std_logic_vector(6 downto 0); ac_ccn : in std_logic ); end entity bcd2ssd; architecture bcd2ssd_v1 of bcd2ssd is signal ssd : std_logic_vector(6 downto 0); signal bcd_int : integer range 0 to 9; begin ssd_out <= ssd when ac_ccn = '1' else not ssd; bcd_int <= to_integer(unsigned(bcd)); with bcd_int select ssd <= "0111111" when 0, "0000110" when 1, "1011011" when 2, "1001111" when 3, "1100110" when 4, "1101101" when 5, "1111101" when 6, "0000111" when 7, "1111111" when 8, "1101111" when 9, -- Character "E" when others: "1111001" when others; end architecture bcd2ssd_v1; ```] == Project-1 (declaração de componentes): O código project1 declara os componentes utilizados e realiza a conexão entre eles. #sourcecode[```vhd library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity project1 is port( clk : in std_logic; reset : in std_logic; input1 : in std_logic_vector(6 downto 0); input2 : in std_logic_vector(6 downto 0); ssd_unit : out std_logic_vector(6 downto 0); ssd_decimal : out std_logic_vector(6 downto 0); ssd_centena : out std_logic_vector(6 downto 0) ); end entity; architecture ifsc of project1 is component div_clk is generic ( div : natural := 50 ); port ( clk_in : in std_logic; rst : in std_logic; clk_out : out std_logic ); end component div_clk; component bin2bcd is port ( A : in std_logic_vector (7 downto 0); sd, su, sc : out std_logic_vector (3 downto 0) ); end component bin2bcd ; component bcd2ssd is port ( bcd : in std_logic_vector(3 downto 0); ssd_out : out std_logic_vector(6 downto 0); ac_ccn : in std_logic ); end component bcd2ssd; component binAdder is generic ( Nlength : natural := 7 ); port( in_1: in std_logic_vector(Nlength - 1 downto 0); in_2: in std_logic_vector(Nlength - 1 downto 0); out_1: out std_logic_vector(Nlength downto 0) ); end component binAdder; signal adder_out : std_logic_vector(7 downto 0); signal bcd_out0, bcd_out1, bcd_out2 : std_logic_vector(3 downto 0); signal ac_ccn0, ac_ccn1, ac_ccn2 : std_logic; begin adder : component binAdder generic map( Nlength => 7 ) port map ( in_1 => input1, in_2 => input2, out_1 => adder_out ); bin2bcd_1 : component bin2bcd port map ( A => adder_out, su => bcd_out0, sd => bcd_out1, sc => bcd_out2 ); bcd2ssd_1 : component bcd2ssd port map ( bcd => bcd_out0, ssd_out => ssd_unit, ac_ccn => ac_ccn0 ); bcd2ssd_2 : component bcd2ssd port map ( bcd => bcd_out1, ssd_out => ssd_decimal, ac_ccn => ac_ccn1 ); bcd2ssd_3 : component bcd2ssd port map ( bcd => bcd_out2, ssd_out => ssd_centena, ac_ccn => ac_ccn2 ); end architecture; ```]
https://github.com/silverling/resume
https://raw.githubusercontent.com/silverling/resume/main/resume.typ
typst
#import "template.typ": * #show: resume.with( name-zh: [凌少鹏], name-en: [ShaopengLing], wechat: [this-silver-ling], email: [#link("mailto:<EMAIL>")[<EMAIL>]], phone: [18580098284], github: [#link("https://github.com/silverling")[github.com/silverling]], avatar: "imgs/id_white.jpg" ) = 教育背景 西安电子科技大学 #h(2cm) 人工智能(学士) #h(1fr) 2019.09-2023.07 \ 西安电子科技大学 #h(2cm) 计算机科学与技术专业(保研、在读硕士) #h(1fr) 2023.09-2026.07 = 获奖情况 - 获得 2021 年 ICPC 国际大学生程序设计竞赛铜牌. - 获得 2020 年 IEEExtreme 全球极限编程大赛 Global Rank 前 2% (77/4132). - 获得 2021 年中国高校计算机大赛-团体程序设计赛全国个人三等奖. - 获得“美亚杯”中国电子数据取证大赛团体赛一等奖. - 获得全国大学生数学竞赛三等奖. - 获得两年国家励志奖学金. = 项目经历 #experience( project: [数据融合生成平台], tag: [毕业设计], )[此项目主要针对目标检测任务中特殊目标的样本稀少或零样本问题,提出了一套特殊目标的样本生成方案。我负责全流程的工作,主要包括三维模型重建、三维场景融合与图像和谐化算法处理。我设计实现了一个数据融合生成平台,基于 `Three.js`、`Konva.js` 等框架,可以在网页端将三维模型与二维图像融合,并交由后端图像和谐化的深度学习算法模型处理。数据融合生成平台项目链接:#link("https://github.com/silverling/harmonizer-platform")] = 技能特长 // - *学习能力突出,能在较短的时间内快速掌握新领域的知识,适应能力强.* - 在深度学习领域有扎实的理论基础和实践经验,熟悉并能灵活运用各种深度学习算法。 熟练掌握深度学习模型的设计、训练与推理,以及开源深度学习框架 `PyTorch` 的使用. - 熟悉 `Transformer` 模型,包括其原理、结构和应用,能够有效地构建和调整 `Transformer` 模型以满足特定任务的需求。 熟悉 `Bert`、`GPT` 模型的结构与训练细节,能够将其应用于文本分类、命名实体识别等自然语言处理任务,并进行模型微调以提高性能. - 熟悉 `Stable Diffusion`、`GAN`、`VAE` 等一众生成模型的原理、结构和应用,并且掌握 `SD` 的 `WebUI` 的使用和部署. - 熟悉 `C/C++`, `Python`, `Javascript`, `Rust`, `CUDA` 编程,熟悉相关构建工具链,工程经验比较丰富. - 熟练掌握 `Linux` 环境,熟悉 `Git` 版本控制与团队协同等工具,掌握 `CI/CD` 等自动化工作流模式. - 掌握计算机图形学的基本概念,了解对渲染管线和图形学 `API`, 包括 OpenGL 和 Vulkan. // - 完成数字信号处理、计算机视觉与图像处理、计算机组成原理课程学习,基础扎实. // - 掌握前端网页设计,熟悉 `Vue` 框架以及 `Javascript` 编程等. // - 掌握后端服务设计,熟悉 `Node.js` 以及 `FastAPI` 等后端服务搭建与部署. - 英语水平较好,能流畅阅读外文文献和技术文档.
https://github.com/francescoo22/kt-uniqueness-system
https://raw.githubusercontent.com/francescoo22/kt-uniqueness-system/main/src/annotation-system/rules/relations.typ
typst
#import "../../proof-tree.typ": * #import "../../vars.typ": * // ************** Annotations Relations ************** #let A-id = prooftree( axiom($$), rule(label: "A-Id", $alpha beta rel alpha beta$), ) #let A-trans = prooftree( axiom($alpha beta rel alpha' beta'$), axiom($alpha' beta' rel alpha'' beta''$), rule(n:2, label: "A-Trans", $alpha beta rel alpha'' beta''$), ) #let A-bor-sh = prooftree( axiom($$), rule(label: "A-Bor-Sh", $shared borrowed rel top$), ) #let A-sh = prooftree( axiom($$), rule(label: "A-Sh", $shared rel shared borrowed$), ) #let A-bor-un = prooftree( axiom($$), rule(label: "A-Bor-Un", $unique borrowed rel shared borrowed$), ) #let A-un-1 = prooftree( axiom($$), rule(label: "A-Un-1", $unique rel shared$), ) #let A-un-2 = prooftree( axiom($$), rule(label: "A-Un-2", $unique rel unique borrowed$), ) // ************** Parameters Passing ************** #let Pass-Bor = prooftree( axiom($alpha beta rel alpha' borrowed$), rule(label: "Pass-Bor", $alpha beta ~> alpha' borrowed ~> alpha beta$) ) #let Pass-Un = prooftree( axiom($$), rule(label: "Pass-Un", $unique ~> unique ~> top$) ) #let Pass-Sh = prooftree( axiom($alpha rel shared$), rule(label: "Pass-Sh", $alpha ~> shared ~> shared$) )
https://github.com/AlvaroRamirez01/Analisis_de_Algoritmos_2024-1
https://raw.githubusercontent.com/AlvaroRamirez01/Analisis_de_Algoritmos_2024-1/master/Tarea_05_Busquedas/Tarea05.typ
typst
#import "conf.typ": * #import "@preview/algorithmic:0.1.0" #import algorithmic: * #import "@preview/lovelace:0.1.0": * #show: doc => conf( materia: "Análisis de Algoritmos", tarea: "Tarea 5: Búsquedas.", profesor: ( nombre: "<NAME>", sexo: "F", ), ayudantes: ( "<NAME>", "<NAME>" ), alumnos: ( ( nombre: "<NAME>", cuenta: "316276355", email: "<EMAIL>" ), ), fecha: datetime.today(), encabezado: "Problema a desarrollar", doc, ) #let colors = (black, gray, silver, white, navy, blue, aqua, teal, eastern, purple, fuchsia, maroon, red, orange, yellow, olive, green, lime) #text(11pt)[ #par(justify: true)[ #set enum(numbering: "a)") = Problema 1 Consideremos el siguiente juego, entre dos personas: El jugador $J_A$ piensa un número entero en un rango. El jugador $J_B$ intenta encontrar tal número haciendo preguntas de la forma: ¿Es el número menor que $x$? o ¿Es mayor que $y$? El objetivo es realizar el menor número de preguntas. Se supone que nadie hace trampa. + Diseñar una buena estrategia para el juego... cuando el jugador $J_A$ indica un rango especifico, digamos de $1$ a $N$. En este caso, ¿Cual resulta ser la complejidad del algoritmo? *Justificar*. + Diseñar una buena estrategia para el juego... cuando el jugador $J_A$ no indica el rango del número que pensó. ¿Cual es la complejidad del algoritmo propuesto? *Justificar*. #solucion(color: navy)[ *a) Diseñar una buena estrategia para el juego cuando el jugador $J_A$ indica un rango especifico, digamos de $1$ a $N$. En este caso, ¿Cual resulta ser la complejidad del algoritmo?.* Una buena estrategia seria la siguiente, dado a que conocemos el valor de $N$, donde $N$ es el rango de números que el jugador $J_A$ puede pensar, podemos sacar la mitad de $N$ y en el primer turno podemos preguntar si el numero que pensó es mayor o menor al la mitad de $N$ que previamente calculamos. Si el jugador $J_A$ responde que el numero que pensó no es ni mayor ni menor a la mitad de $N$, entonces podemos determinar que $N$ es el numero que pensó, ya que es el único numero que queda y no existe la posibilidad de que el jugador $J_A$ haya pensado otro numero que no este en el rango de $1$ a $N$. Si el jugador $J_A$ responde que el numero que pensó es mayor a la mitad de $N$, entonces podemos descartar la mitad de los números que están a la izquierda de la mitad de $N$ y repetimos el proceso de arriba, pero ahora con la mitad de los números que quedaron. Si el jugador $J_A$ responde que el numero que pensó es menor a la mitad de $N$, entonces podemos descartar la mitad de los números que están a la derecha de la mitad de $N$ y repetimos el proceso de arriba, pero ahora con la mitad de los números que quedaron. La complejidad del algoritmo propuesto es de $O(log n)$ en el peor de los casos, ya que en cada iteración, el rango de búsqueda se reduce a la mitad, lo que proporciona una convergencia rápida hacia el elemento buscado. *b) Diseñar una buena estrategia para el juego cuando el jugador $J_A$ no indica el rango del número que pensó. ¿Cual es la complejidad del algoritmo propuesto?* Para resolver este problema, vamos a inspirarnos en 2 algoritmos de búsqueda, la búsqueda binaria y la búsqueda exponencial. Primero vamos a usar la búsqueda exponencial para acotar en el rango en el que se encuentra el numero que pensó el jugador $J_A$ y después vamos a usar la búsqueda binaria para encontrar el numero exacto que pensó el jugador $J_A$. #set enum(numbering: "1.") 1. *Establecer un límite inferior*: Comienza con un límite inferior (por ejemplo, 1) y un límite superior (por ejemplo, 2). Inicialmente, el límite superior es menor que el número a adivinar. 2. *Duplicar el límite superior*: Incrementa el límite superior multiplicándolo por 2 en cada iteración hasta que se alcance un límite superior que sea mayor o igual al número objetivo. 3. *Realizar preguntas*: Para cada iteración, pregunta si el número objetivo está en el rango entre el límite inferior y el límite superior. Dependiendo de la respuesta, actualiza los límites para restringir la búsqueda. - Si el número objetivo es menor que el límite superior actual, aplica búsqueda binaria en el rango entre el límite inferior y el límite superior para encontrar el número. - Si el número objetivo es mayor o igual que el límite superior actual, duplica nuevamente el límite superior y continúa. Este enfoque combina la búsqueda exponencial para encontrar un rango aproximado y luego aplica la búsqueda binaria dentro de ese rango para adivinar el número exacto. La complejidad de este algoritmo está dominada por la fase de búsqueda binaria dentro del rango encontrado por la búsqueda exponencial. La búsqueda exponencial tiene una complejidad de $O(log n)$, donde n es la distancia entre el límite inferior y el límite superior en la última iteración de la búsqueda exponencial. Luego, la búsqueda binaria en este rango tiene una complejidad adicional de $O(log n)$ para adivinar el número exacto. En conjunto, la complejidad total es $O(log n) + O(log n) = O(log n)$. ] = Problema 2 Dada un arreglo de n enteros $A[0,...,n-1]$, tal que $∀i$, $0≤i≤n$, se tiene que $|A[i]-A[i+1]|≤1$; si $A[0]=x$ y $A[n-1]=y$, se tiene que $x < y$. Diseña un algoritmo de búsqueda eficiente, de orden logarítmico, que localice al indice $j$ tal que $a[j] = z$, para un valor dado de $z$, $x ≤ z ≤ y$. *Justificar.* #solucion(color: blue)[ Lo primero que se debe de realizar, es verificar la forma que están distribuidos los elementos en el arreglo A, basándonos en la condición $|A[i]-A[i+1]|≤1$; si $A[0]=x$ y $A[n-1]=y$, se tiene que $x < y$, podemos ver que el arreglo esta ordenado de forma monótona y creciente, por lo que podemos continuar con el algoritmo a diseñar. A continuación, se describe el algoritmo de búsqueda que se pensó para resolver el problema: ` Inicializar dos índices, izquierda = 0 y derecha = n - 1, y una variable medio = 0. Mientras (izquierda <= derecha): Calcular el índice medio como: medio = (izquierda + derecha) / 2. Si A[medio] es igual a z,entonces devolver medio ya que hemos encontrado el elemento buscado. Si A[medio] es menor que z, actualizar izquierda = medio + 1 para buscar en la mitad derecho del arreglo. Si A[medio] es mayor que z, actualizar derecha = medio - 1 para buscar en la mitad izquierda del arreglo. ` El algoritmo de búsqueda logarítmica propuesto tiene una complejidad de $O(log n)$ en el peor caso. Esto se debe a que en cada iteración, el rango de búsqueda se reduce a la mitad, lo que proporciona una convergencia rápida hacia el elemento buscado. ] = Problema 3 Se tiene un conjunto de $N$ rocas, todas ellas de diferente tamaño, forma y consistencia. Rocas que se ven del mismo tamaño pueden tener peso muy diferente. Un Experto desea convencer a un Jurado que una roca especial, de entre las N rocas dadas, es la de menor peso. El Experto si sabe los pesos de cada una de las rocas y el Jurado no. El Experto quiere mostrar que la roca especial es la de menor peso usando una balanza menos de $(N-1)$ veces. ¿Eso es posible? *Justifica.* #solucion(color: eastern)[ Sí, es posible demostrar que una roca especial es la de menor peso utilizando menos de $(N - 1)$ veces una balanza. Para lograrlo, se puede utilizar una estrategia conocida como "división binaria" o "división en grupos", a continuación se describe esta estrategia: 1. *Paso 1: Divide las rocas en dos grupos aproximadamente iguales.* Divide las $N$ rocas en dos grupos de aproximadamente N/2 rocas cada uno. Es fundamental que estos grupos estén lo más equilibrados posible en términos de cantidad de rocas y, por lo tanto, de peso total. 2. *Paso 2: Pesa los dos grupos.* Utiliza la balanza para comparar el peso del primer grupo de rocas con el peso del segundo grupo de rocas. - Si la balanza está equilibrada, entonces la roca especial está en el grupo que no se pesó y es la de menor peso. Pasamos al paso 3. - Si la balanza no está equilibrada, la roca especial está en el grupo más ligero. Pasamos al paso 3. 3. *Paso 3: Divide nuevamente el grupo de rocas más ligero.* Toma el grupo de rocas en el que se encuentra la roca especial y repite el proceso de dividirlo en dos grupos de aproximadamente igual tamaño. 4. *Paso 4: Pesa uno de los nuevos grupos con el grupo ya identificado como más ligero.* Utiliza la balanza para comparar el peso del grupo recién dividido con el grupo que previamente identificaste como más ligero. - Si la balanza está equilibrada, entonces la roca especial está en el grupo que no se pesó y es la de menor peso. Hemos demostrado que la roca especial es la más ligera utilizando 2 pesadas en total. - Si la balanza no está equilibrada, la roca especial está en el grupo más ligero. Hemos demostrado que la roca especial es la más ligera utilizando 2 pesadas en total. En resumen, utilizando esta estrategia de división binaria, puedes demostrar que una roca especial es la de menor peso usando como máximo 2 pesadas en total, independientemente del número de rocas $N$ en el conjunto inicial. ] = Problema 4 Consideremos el Algoritmo de Búsqueda por Interpolación. + Presentar un ejemplo de al menos 400 datos para el cual el algoritmo termine la búsqueda (exitosa o no) en pocas iteraciones. + Dar un ejemplo de, al menos, 400 datos para el cual el algoritmo termine la búsqueda (exitosa o no) en muchas iteraciones. #solucion(color: purple)[ El algoritmo de búsqueda por interpolación es utilizado para buscar un elemento en una lista ordenada aplicando una estimación basada en la distribución de los datos. La eficiencia de este algoritmo depende de la distribución de los datos y la posición del elemento buscado en la lista. *a) Ejemplo con pocas iteraciones:* Supongamos que tenemos una lista de 400 datos en la que la mayoría de los elementos están agrupados al principio y al final de la lista, y solo unos pocos están en el medio. Vamos a crear una lista siguiendo este patrón: ``` 1, 2, 3, ..., 150, 151, 152, ..., 250, 251, 252, ..., 350, 351, 352, ..., 399, 400 ``` Para buscar el número 100 en esta lista, el algoritmo de búsqueda por interpolación realizará pocas iteraciones ya que puede estimar rápidamente que el número 100 se encuentra en el rango 1-150. *b) Ejemplo con muchas iteraciones:* Supongamos que tenemos una lista de 400 datos en la que están distribuidos de manera uniforme. Vamos a crear una lista de esta forma: ``` 1, 2, 3, 4, ..., 397, 398, 399, 400 ``` Para buscar el número 100 en esta lista, el algoritmo de búsqueda por interpolación realizará muchas iteraciones ya que la estimación inicial será menos precisa debido a la distribución uniforme de los datos. En ambos casos, el resultado de la búsqueda (exitosa o no) dependerá de si el elemento que estamos buscando está presente en la lista o no. ] = Problema Opcional Supongamos que se tiene un programa que manipula textos muy grandes, como un procesador de palabras. El programa toma como entrada un texto, representado como una secuencia de caracteres y produce alguna salida. Si en algún momento el programa encuentra un error del cual no puede recuperarse y ademas no puede indicar que error es o donde esta, entonces la única acción que el programa toma es escribir ERROR y abortar el proceso. Supongamos que el error es local, esto es, se tiene una cadena en particular del texto la cual, por alguna extraña razón, al programa no le gusta. El error es independiente del contexto en el cual aparece la cadena “ofensiva”. Diseñar una estrategia logarítmica para localizar la fuente del error. #solucion(color:lime)[ Para localizar la fuente del error en un texto representado como una secuencia de caracteres de manera logarítmica, podemos aplicar un enfoque similar a la búsqueda binaria. Este enfoque implica dividir iterativamente el texto en mitades y buscar la cadena ofensiva en cada mitad, reduciendo así el espacio de búsqueda. Aquí está la estrategia detallada: #set enum(numbering: "1.") 1. *Inicializacion*: - Definimos un rango inicial para la búsqueda que abarca todo el texto. - Inicialmente, el límite inferior es 0 y el límite superior es la longitud total del texto. 2. *Búsqueda binaria para localizar la cadena ofensiva*: - En cada iteración, calculamos el punto medio del rango actual. - Buscamos la cadena ofensiva en la mitad del texto definida por el rango actual. - Si encontramos la cadena ofensiva en la mitad actual, la fuente del error está en esa mitad. Terminamos el proceso y reportamos la mitad actual como la fuente del error. - Si la cadena ofensiva está en la mitad inferior, actualizamos el límite superior al punto medio actual. - Si la cadena ofensiva está en la mitad superior, actualizamos el límite inferior al punto medio actual. 3. *Repetición de la búsqueda binaria*: - Repetimos el paso 2 hasta que el rango se reduzca a un solo carácter (es decir, límite inferior igual a límite superior). En este punto, habremos localizado la fuente del error. Esta estrategia tiene una complejidad logarítmica $O(log n)$, ya que en cada iteración estamos reduciendo a la mitad la parte del texto en la que estamos buscando la cadena ofensiva. Cada iteración se acerca rápidamente a la ubicación exacta de la cadena ofensiva, permitiendo una localización eficiente en términos de tiempo. ] ]] // #pseudocode( // no-number, // [*input:* integers $a$ and $b$], // no-number, // [*output:* greatest common divisor of $a$ and $b$], // [*while* $a != b$ *do*], ind, // [*if* $a > b$ *then*], ind, // $a <- a - b$, ded, // [*else*], ind, // $b <- b - a$, ded, // [*end*], ded, // [*end*], // [*return* $a$] // )
https://github.com/lucifer1004/leetcode.typ
https://raw.githubusercontent.com/lucifer1004/leetcode.typ/main/problems/p0016.typ
typst
#import "../helpers.typ": * #import "../solutions/s0016.typ": * = 3Sum Closest Given an integer array `nums` of length `n` and an integer `target`, find three integers in `nums` such that the sum is closest to `target`. Return the sum of the three integers. You may assume that each input would have exactly one solution. #let _3sum-closest(nums, target) = { // Solve the problem here } #testcases( _3sum-closest, _3sum-closest-ref, ( (nums: (-1, 2, 1, -4), target: 1), (nums: (0, 0, 0), target: 1), (nums: (0, 1, 1), target: 2), (nums: range(-10, 20, step: 3), target: 20), (nums: range(-10, 10), target: 30) ) )
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/layout/relative.typ
typst
--- relative-fields --- // Test relative length fields. #test((100% + 2em + 2pt).ratio, 100%) #test((100% + 2em + 2pt).length, 2em + 2pt) #test((100% + 2pt).length, 2pt) #test((100% + 2pt - 2pt).length, 0pt) #test((56% + 2pt - 56%).ratio, 0%)
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/051%20-%20March%20of%20the%20Machine/013_Episode%208%3A%20Wrenn%20and%20Eight.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Episode 8: Wrenn and Eight", set_name: "March of the Machine", story_date: datetime(day: 24, month: 04, year: 2023), author: "<NAME>", doc ) Wrenn used to think that no matter where she went, she'd always be home. Hard to argue otherwise for dryads. So often home meant a tree they'd never leave. For her, things are a little more complicated: the trees with which she's bonded cannot survive the process for long, and she herself has matters to attend to all over the Multiverse. But she remained convinced that—no matter where in the Multiverse she ended up—she'd never be far from another place to live. Until she arrived on New Phyrexia. In all her days she could never have imagined a place like this, scoured of all natural life; at once deathly quiet and filled with the artificial chittering of machines. If you asked any dryad to imagine their worst nightmare, they'd speak of a place like this. Wrenn hates it here. And she hates, most of all, that this is where she's going to die. It isn't dying that scares her. Unlike Chandra, who carries Wrenn's frail head and torso toward the Invasion Tree, Wrenn isn't afraid of the spears and barbs the Phyrexians unleash in their direction. The gouts of flame and molten ore that fire over her shoulder—some from Chandra, some from Koth—do not frighten her either. If anything, she wishes that she could join them, but she hardly has the strength to keep the fires inside of herself at bay. Using them against others would jeopardize everything they've come here to do. #emph[That ] is what truly frightens Wrenn: the possibility that she may not be able to do what everyone is relying upon her to do. The Invasion Tree does not sing to her anymore. He hasn't said a word the entire time she's been here—not even earlier, when she nearly managed to graft herself onto him. If it rejects her then they have no way of controlling him, no way of reaching Teferi, no way of stopping this onslaught. And they will need Teferi if they are to stop any of this. Of that, Wrenn is certain. From here, jostling with each step, she can see the coming onslaught: thousands of Phyrexians, with thousands more being assembled on the spot. Metal shines on each—not in the way of a knight's gallant armor, but in the way of churning forges and shining needles. And though there are more eyes staring back at her then there are leaves in a forest, she sees no life in any of them. "This place should not exist," she says. "Tell me about it," Chandra incinerates a spear before it can hit them. "We just have to hold on a little longer." Her breathing is ragged, her steps uneven; she's struggling to hold Wrenn up. Wrenn wasn't certain Chandra would ever walk again after the fall they took. Human bodies are delicate things. Nissa's vines caught them before they splattered against the ground—but sometimes the fall itself was bad, no matter how you landed. Yet Chandra stands and fights no matter how much pain she must be in. "Are you in need of mending?" Wrenn asks. "I'm fine," is the pyromancer's sharp response. A rain of needles comes toward them—Koth levitates the metal beneath their feet to a shield over their heads. Needles spark as they bounce off its surface, some find new homes in the backs of Mirrans that Koth couldn't cover. He curses, the sound like quenching a blade. "Can't keep this up forever!" "It won't be forever," Chandra says. "Once Wrenn's at the tree, everything will be fine." Except that it will take time to graft onto the tree, to speak with it, to search for her old friend. And that's supposing she's able to do any of that at all. Will this body of hers hold out long enough? There is so little left of her. Chandra is clutching her like a wayward pet. In the face of the Invasion Tree's mighty form, she is less than an acorn. If there were others, if she had her sisters with her, maybe~ A scream tears her from her thoughts. Wrenn comes back into reality and sees a sharp tendril shoot through the air over Chandra's shoulder. The scream's coming from up ahead—the other end of the tendril's gone clean through Melira's stomach. "You should have taken our offer," comes a familiar voice. Nissa. A barbed vine slices straight toward them. Chandra sucks in a breath. The fireball she sends back at Nissa flickers and fades midway through. She curses, and, in an act of desperation, rolls to avoid impact. Barbs pierce the ground like spears—standing just as tall as any of the warriors. If one of those had pierced them~ "Got your back!" Koth shouts. He flings a craggy boulder at Nissa. One of her slicing vines splits it in two, then throws both halves back at the rebels. Chandra burns one in midair, groaning with the effort. Her shaky breathing's becoming a rattle. Wrenn wishes there was more she could do to help—but staying awake and keeping herself alive will have to do. A couple dozen Mirrans are all that remains of the fighting force, and the only ones in the way of Nissa's unstoppable charge. As Chandra makes a break for the tree, Koth, Melira, and the others cover their escape. Hard enough when it was only Phyrexian soldiers with which they had to contend—near impossible in the face of a killing machine like Nissa. Vines and blades alike slice through flesh as easily as paper. "Koth!" shouts Melira. Blood spills like sap into the hand she's using to cup her wound. "Koth, we need a barricade!" He glances over toward her. Even Wrenn can read the concern on his face. "Coming up. Chandra, you're going to have to bolt." "Got it!" Koth drives a fist into the platform. Orange flares throughout his form. Metal groans up and grows, forming a barrier to stop Nissa's approach. But it's not done growing, yet, and Nissa isn't going to take this lightly. She stalks toward them, lifted high above the surface of the bridge on a tangle of cable-like roots. Copper branches pierce the bodies of those that stand before her—Phyrexian and Mirran alike. One of her steps is three of anyone else's. Though Chandra is running as fast as she can, there's no way that she'll be able to evade all of Nissa's questing strikes. If Chandra wanted, she could melt those roots in place. Send her crumpling to the ground. But Chandra hadn't looked over her shoulder since Nissa appeared. "You don't want to hurt her, do you?" Wrenn asks. Chandra says nothing. "I understand. It's difficult, with friends. But you aren't really hurting her. I'm certain she'd never want to hurt you—so isn't keeping her from doing that exactly what she'd want you to do?" Chandra clenches her jaw. "Wrenn." "Yes?" "It isn't that—" Before Chandra can finish, she's torn backward. Wrenn tumbles from her grip, landing on the cold metal bridge in time to see Chandra dangling high above, Nissa lifting her by the ankle with a long and brassy root. One of the Mirrans catches Wrenn and keeps running. "Get her to the tree. Keep her moving!" Koth shouts. He, too, has turned his attention to fighting off Nissa. This Mirran only gets a few steps further before one of Nissa's spears nails them in place. They hurl Wrenn through the air. Two of his comrades look on in horror—but a third has the presence of mind to catch Wrenn and keep her going. From hand to hand she passes, tossed through the air to keep her out of Phyrexian clutches. The Phyrexians think humans know little of unity—but Wrenn knows otherwise. #figure(image("013_Episode 8: Wrenn and Eight/01.jpg", width: 100%), caption: [Art by: <NAME>ainville], supplement: none, numbering: none) By the time she makes it to Melira's arms, Wrenn's nearly to the Invasion Tree. And Chandra's still in the air. "Still with us?" Melira rasps. "I am, but~" Wrenn says. "I can't—I can't do this on my own, I need Chandra's help—" "I'm sorry, but I don't think you're going to get it," says Melira. How is she running, wounded as she is? A pang of guilt shoots through the dryad. There's too much resting on this to stop, but~ "#emph[We told you] ," says Nissa. Her booming voice carries all the way up to the platform. "We warned you this would never work!" Vines wrap about Chandra's throat. Wrenn feels them, too, as Melira helps her up onto the observation platform. Higher and higher Chandra goes, writhing and fighting, her body swinging. How long can humans go without breathing? "How do I set you up with this tree?" Melira asks. Below them, Koth and dozens of Mirrans hold off the rest of the Phyrexian army at the barricades. Nissa might have been able to walk straight over it—but the others will have to go the hard way. Soldiers climb to the top of the barricade and hurl recovered quills back at the teeming Phyrexian army. Some are plucked right from their positions, taken screaming into the mass of metal and oil on the other side of the barricade. Still, they fight. Wrenn's tongue sticks to the roof of her mouth. "Just leave me by it, but I need help with the fire—" "I'm sorry, that's more than I can do," says Melira. She picks Wrenn up and places the gnarled roots of her waist against the tree. "But I can help you with this, at least a little." Before Wrenn can ask what she means, magic ebbs from Melira's hand, glowing a faint white. Strength seeps into Wrenn's bark as the glow fades—but not just strength. Something about this feels as crisp as rain, as vital as sun. Melira is woozy on her feet. What she's done seems to have taken a lot out of her. She sinks to her knees, then sits, her back against Realmbreaker's white plating. "Should~ should help, a bit~" Wrenn wants to ask Koth if he'll go save Chandra. She wants to join with any tree but this, wants to hold onto herself just a little longer. She wants to help Melira, though she doesn't know how she'd even start. But at times like these, it's hard to get what you want. She closes her eyes as her roots meld into the Invasion Tree. No—he has another name, one he prefers, and it'd be rude of her not to use it. Realmbreaker. Sickness floods her senses. Oil roils over her roots, swirling with evil. No song fills her, no call of the forest, only an insistence that she does not belong. She doesn't. But no matter what Realmbreaker says, she's going to stay. Deep in the sylvan recess of her heart, Wrenn begins to sing. Of Innistrad's storied oaks, of the floating pines of Zendikar, of maple, yew, and beech she sings. Louder and louder the staggered chant of Realmbreaker#emph[: you do not belong] . Something within #emph[twists] , then begins to pull. Wrenn yelps. She rakes her fingers against the plating, unwilling to yield, not now. Pressure's building up within the hollow of her chest—the fire is all too eager to fight the tree's ill intent. It's searing the inside of her throat. If she gives into it, the fire might well buy her enough time to fully meld with the tree—if it doesn't consume her first. But that won't work. There's too much hunger. The fire, Realmbreaker—there is hunger on both sides, and she dangles between the two predators. All of this is starting to hurt. Chandra would know what to do. She could speak fire. Calm it down, direct it, tell it where it needs to go, keep it from burning Wrenn as it burned Realmbreaker. But Chandra dangles above the bridge, and she, too, is about to die here, and there will be no one else to help. Wrenn clenches her jaw tight. #emph[You can burn, but only the things that aren't me] , she thinks. Chandra said thinking at it might help. A flare within her belly, the smell of burning oak. The thousand voices within Realmbreaker scream at once—but so, too, does Wrenn. How is the fire meant to tell the two apart? They are one and the same, now. Already Realmbreaker's foulest thoughts echo within her own mind: they must spread, they must claim what is already claimed, they must wake the plane to the glories of New Phyrexia. Like a fungus gone mad they continue their shouting even as the fire consumes them. Even as it consumes her. Flames lick at her eyes. Wrenn opens them. There is something behind Nissa. Something in white. Gold flashes across her vision, so bright she mistakes it at first for the fire—but it soon fades. At the center is Nissa. The light's exploding from her mouth and eyes, the metal roots armoring her have gone white-hot. The blow staggers her—she drops Chandra. What was~ ? Ah, she sees it now—the angel catches Chandra and sets her on the platform. "Wrenn!" shouts Chandra, choking and rasping. "Are you still in there?" "I-I am," Wrenn says. Realmbreaker is trying to convince her that there is no Wrenn—but she knows that's a lie. So long as the Multiverse is still in danger, there is still a Wrenn. Chandra hacks and coughs—but she lays her hand on Wrenn's shoulder all the same. Wrenn can hear her breathing, even if her vision is starting to fade. "You're doing such a good job, Wrenn." Is she? Parts of her are starting to flicker to ash. "Do you remember what we talked about back on Dominaria?" Chandra's voice echoes in Wrenn's head. Everything goes hazy around them, spinning like a leaf on the wind. People are screaming. Someone's hurt. There's a war going on only a few yards away, and~ What was it Chandra said back then? "Like~ breathing~ ?" Behind her seared-shut eyes, the colors start to swirl: gold, red, green. "That isn't helpful right now," Chandra says. She lays her hand on Wrenn's shoulder. Warmth blossoms in Wrenn's mind. Instead of lingering within Wrenn, the fires now flow from Realmbreaker to Chandra, stopping only briefly in between. "Fire's going to burn, no matter what you do, but you can shape it if you try." It's easier to think without the fire in the way. Wrenn can focus on something more than the pain. She must #emph[shape ] the fire. It's a living thing, just like her roots. Like any growing sprout, it needs guidance. The landscape in her mind changes. Colors take shape: a twisting tree sprouts from red and gold, its branches burnished copper. An unseen wind stirs its leaves. Slowly, they are falling away, fading as they spiral. An endless lake of black oil surrounds the glowing tree. Bubbles rise and burst across its surface, each one a voice, each one pleading for Wrenn to join them. But she won't. Not yet. Within the boughs of her imagined tree is a girl. As she begins to sing, fire flows from her lips, spilling out into the black void in search of someone who will hear it. For what feels an eternity the song floats through the dark until—at last, impossibly—it hears something. Wrenn hears something. Faint, fading, the barest whisper of green against the darkness—but it is there. "You can do this~" Chandra's voice echoes. The battle echoes, too. The crunch of metal on bone; Koth's shouted orders; the rumbling impact of some unseen munitions. She must focus—to tune it all out. Wrenn sends her fires out. Normally, she'd let any sapling so shy take its time. Trees needed to come into their own. A dryad's job was to look after that process, to make them the best they could be. Finding this poor little soul now—grafting herself onto him—goes against everything she knows. She hopes that he will understand. #figure(image("013_Episode 8: Wrenn and Eight/02.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) The fires quest ever forward in search of that furtive trace of green. Black encroaches on the roots of the tree—but still the girl sings, still she searches, still she hopes the distant song will return. There: a sapling no larger than her hand, struggling against the dark. How lonely this delicate creation! How long has he been here in the dark? Cursed spots line its edges; what green remains is pale as seafoam. This is not a place meant for the living. As her mind reaches for him—as his song fills her ears—she shapes the fires once more. An incandescent forest springs from the oil, the burning path leading straight to the sapling. All around them the oil begins to bubble, to churn. #emph[Join us. Bark that never breaks, leaves that never shed, a fire that never burns itself out—join us, and you will be eternal.] But Wrenn does not want to. And the sapling doesn't either, his song going shrill with fear. Chandra said the trick was to shape the fire. Very well—Wrenn will take a cue from the Mirrans outside. Just as they protect her, she will protect this sapling until she can sing him fully grown. Flaming trees grow to the size of mountains, their branches interlocking like the shields of Koth's constructs. Waves of black oil thrash against them—but the trees flare bright, and the oil rolls off their sizzling surface. All the while Wrenn's flames dance about the sapling, all the while she sings with her faltering voice. #emph[Grow] , she wills. #emph[For all of us.] And though the sapling was shy, he knows now—surrounded by his larger fellows—that he is safe. Wrenn's song is a dry log upon the bonfire: he grows tall, tall, impossibly so; his song becomes a booming chant, a warrior's chant; his branches thick as boulders. How handsome he's become. Happiness wells up within her. She feels herself smile, although she isn't certain how; her body is distant and cold. Only the fires here give her any warmth. But what will they do once those fires have burned themselves out? Wrenn doesn't know. But she does know she's got a fine new partner. #grid( columns: (1fr, 1fr), gutter: 2em, figure(image("013_Episode 8: Wrenn and Eight/03.png", height: 40%), caption: [], supplement: none, numbering: none), figure(image("013_Episode 8: Wrenn and Eight/04.png", height: 40%), caption: [], supplement: none, numbering: none), ) #emph[Hello, Eight] , she says. #emph[Let's introduce you to Teferi.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Eight knows he doesn't have long. The same fires that protect him will soon engulf them both. With her other hosts she'd learned all sorts of things about them—which waters they favored, how the sun felt against their leaves—but with Eight, there's only room for one thing. Letting him grow. Perched on his branches, Wrenn shoots through the dark like a star through a moonless sky. A hundred years of growth, two, three, happen in the span of seconds. Had she a stomach it'd be lost somewhere in the rising tides of black oil beneath them. The higher they go the worse pain she's in—but she holds on tight, all the same. The others said Eight was the kind of tree who bridged whole planes together. At first, Wrenn wasn't certain how she'd guide him on her own. She sees now that there was no need for worry. He wants to grow. All he needs is the power that she lends him. Fires churning in his belly, Eight reaches for new planes. His branches grow, splitting here and there, each its own pathway. Something in the dark #emph[gives] , and soon he's torn holes all around them. Wrenn can't count them all—it is as if she has stepped within the eye of an insect. Where there was once darkness there is now a kaleidoscope of light. Everywhere her gaze lands there is something to tantalize it: a castle assailed on all sides by gilded oaks; a gleaming, towering city of chrome on the verge of collapse; a plane where trees and rocks and rivers explode with the beautiful, brutal energy of life. She sees a temple in flames, a sun that consumes all it touches, a river that flows blood red with the oil of its sailors. And yet across all these disparate planes, there is some unity: crimson skies, Phyrexian symbols, nature contorting against itself. What people she sees are always in the thick of a fight. Skulls crumble beneath mechanical legs. Soldiers have their heads dunked into vats of black oil. Blood drips from the mouths of those who will take up arms rather than surrender their homes. Chandra said this affected every plane—but seeing it like this, all laid out before Wrenn's eyes, is a different story. #emph[They need our help] , Eight says. #emph[We have to find what they haven't] , Wrenn answers. #emph[I only know the places they've seen. The places they've made me go.] #emph[I know a hidden place. But to find it, we have to get a little lost.] Eight feels nervous below her. Wrenn runs a hand over his bark, embers trailing in the wake of her fingertips. #emph[Don't worry. We'll be together.] These eyes of hers are not eyes; this body of hers is not a body. She can shed them if she wishes, if they slow her—and so she does. Vision will not help when it comes to getting lost; it'll only get in the way. The tangles of Teferi's magic aren't visible to the naked eye. You must feel them—feel your growth stuttering, or shooting faster, your leaves going still, your flames at last held in place. The light of a thousand planes bears down on Wrenn, but she pays them no mind, guiding Eight ever upward, ever searching. As a weaver before a loom, she guides his many branches: here a rise, there a fall; here a loop, there an enclosure. To think about any of it will set the whole thing awry. There is a place somewhere here out of sight. There is a place that time cannot touch. There is a place no one would ever think to look, a place found if only she can trace the clumsy trail of a friend~ #emph[There.] Vision returns as the flames roar within her. They've found the right place: the sky is blue as a sapling's dream; the people, though armored, show no signs of fear; the rivers flow green; the trees bear the fruits of kind treatment. Beneath one such tree she sees a gathered throng of people. On gently shaped stone they sit, the clothing draped across their forms bright as jewels, their skin warmed by the sun. Among them are mages and warriors, scholars and diplomats, a queen and half a dozen farmers. In their strong voices, they give thanks to all that has come before them—to the seas, the sky, and to the grand tree who has weathered so much. Among them—standing at the queen's side—is Teferi. There is an ease to him here she's never seen before, a calm that's overtaken him. Wrenn hates to ruin her friend's happiness—but this can't wait. He'll understand. With a thought she calls to Eight, and Eight is quick to answer. A questing branch opens a tear into this tangled bramble. Quick as its creator the tear grows into something greater: a portal big enough for someone to walk through. #figure(image("013_Episode 8: Wrenn and Eight/05.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) Wrenn can't walk. She doesn't have legs in either this ephemeral flame form or the physical one, grafted onto Realmbreaker back on New Phyrexia. Eight can't walk. He's the soul of the tree, after all; if he leaves, the whole thing will fall apart. Her only hope is to call out and hope the others notice what's happened. "Teferi!" The clatter of arms taken up, the hum of spells, the whisper of sandals against the earth. They've noticed. Wonder makes its home in the observers—with dashes of caution and bravery. All faces turn toward the queen and the man at her side. She, for her part, errs on the side of caution. "Who are you, efreet?" But Teferi lays a comforting hand on the queen's shoulder. "She's a friend of mine." He walks down the steps, stopping at the bottom to look back toward the queen. "We might not have much time to finish preparations." "Bold of you to assume there's a threat we cannot face," the queen answers. Her expression goes warm. Wrenn feels a pang of guilt. The queen can't know what it is they're facing—but Wrenn must hope their help will be enough. "Wrenn, you found me," Teferi says as he approaches the portal. The kindness and charm he wore around his companions fades a little. Wrenn's not good with faces, but even she knows concern when she sees it. "I don't think we have time for reminiscing, do we?" Something in her chest goes tight. Is it so obvious? She shakes her head. "No. I'm sorry, we don't. It~ Finding you was~" "You don't have to explain," Teferi says. "Just tell me what I can do to help." For a second, she isn't there anymore—she's somewhere cold and dark and empty. When she returns, her chest feels even tighter. "We need you on New Phyrexia. Everyone's fighting back, but there are so many of them and so few of us. Any second now they're going to overtake us. We need a great hero." She can see herself reflected in Teferi's eyes—all flame, no real body. It frightens her to think that she has no body, no solidity now, but a lot of things frighten her, and she isn't yet done. "A great hero? I happen to be looking at one," he says. "It took me decades to find this place, and you've done it in no time at all." "Please," Wrenn creaks. Those words don't feel like they're suited to her. "Teferi, there isn't time." He nods in understanding. He reaches for her shoulder, only to draw it back when he remembers there are only flames to meet him. He turns toward the others— Again, she winks out of existence, again it is cold and dark and— A thousand scabbards strapped to a thousand waists, a thousand spears rattling with movement, boots on the lush earth, war chants in the air—The tightness jumps up to her throat. An entire army had amassed that time. Thousands of them. She'd just been talking with Teferi, and~ When had all these people arrived? How long does she still have? Not long enough. Not long enough at all. Wrenn presses her eyes shut. Think. If there won't be much left of her to physically join the fight, she must do whatever she can to help. And if the Phyrexians brought numbers—well, there were numbers here. Not so many as the enemy, but their bravery shone bright as their armor. Teferi's people could help. If she could bring them to the fight, that is. But that would be a mess. This place is hidden within the boughs of the tree itself. Letting Teferi slip through is easy enough—he was only a single leaf. The rest of the army would be a mess of vines springing out, tangling themselves among all the disparate planes she'd seen. And it occurs to her then, as Teferi turns toward her, just what it is she has to do. You undo a tangle by moving through it. She and Eight could do the same here—if they tried, they could push the planes toward one another until New Phyrexia gave, and then leave this one in its place. Wrenn doesn't know where it'll go. Eight doesn't seem to either—all he offers is that it's some place dark, some place that isn't a place at all. And the two of them won't have long afterward. #emph[I'm all right with that] , Wrenn says. #emph[At least we'll have each other.] Warmth from Eight. He's all right with it, too. Teferi takes a step toward them—toward the portal. "Wait," she says. "Don't come alone. Bring your friends." "Wrenn, the effort it'd take to do that—" he starts, but she can't bear to do this if someone is going to tell her to stop. "I know. But I want to do it. Please, bring as many as you can. I'll find some other way to live." Teferi does not answer—but his friends do. The warriors close ranks behind him like petals, their shields overlapping. Mages fill the spaces behind, and— Cold, dark, a place that isn't a place— Longer this time. Too long. This is going to be the last time, isn't it? Teferi's sent out the call. Thousands have answered, ready to rush into New Phyrexia while the two share space. All because she reached out to him again. No matter what else her life has been—she is proud of this. "It was so nice to meet you, Teferi. I hope whatever remains of me will remember," she says. Teferi's smile only makes it hurt worse. "Whatever remains of me will always remember my friend, Wrenn," he says. "A hero whose name precedes her." Cold on the edges of her vision, darkness licking at her limbs. At least it won't be New Phyrexia. She's happier dying here, with one limb in Zhalfir. Wrenn closes her eyes and does what she does best: she grows. #figure(image("013_Episode 8: Wrenn and Eight/06.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The portal that springs up before the gathered warriors of Zhalfir would put a mountain to shame. Wreathed in flame, yet smooth as the surface of a lake, it is a thing of beauty—yet the images reflected within are anything but. On the other side there is only metal, only blood, only the slick black oil of New Phyrexia. There are only a handful of people left behind a makeshift barricade: a man at the gates, fighting a numberless army with whatever he can find, a woman slumped near a tree and a pyromancer at her side, fighters hurling stones for want of better weapons. A golden angel beats back the Grand Praetor—but even her heavenly blade has grown weary. A war engine rolls to the walls. A single blow will see it toppled. In truth, they needn't even make the blow. The monstrosity flings the angel through the gate—and the force of this alone is enough to shatter them. The gathered armies of New Phyrexia pour through the gate and freeze, in confusion and horror. Ahead of them is a portal to a place lush and verdant, cultivated by careful hands and attentive hearts. It is a thing that horrifies them. So, too, do the warriors who cross over the portal, and the mage who stands at the vanguard. It has been many years since they were called to war—but Zhalfir stands ready.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/springer-spaniel/0.1.0/src/package/board-n-pieces.typ
typst
Apache License 2.0
#import "@preview/board-n-pieces:0.4.0": * #let board = board.with( white-square-fill: white, highlighted-white-square-fill: rgb("#aee9da"), black-square-fill: luma(50%), highlighted-black-square-fill: rgb("#326b67"), arrow-stroke: .35em + green, stroke: 0.5pt, display-numbers: true, square-size: 2em, )