repo
stringlengths 27
90
| file
stringlengths 57
176
| language
stringclasses 2
values | license
stringclasses 13
values | content
stringlengths 25
180k
|
---|---|---|---|---|
https://github.com/Error-418-SWE/Documenti | https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/2%20-%20RTB/Documentazione%20esterna/Verbali/23-11-15/23-11-15.typ | typst | #import "/template.typ": *
#show: project.with(
date: "15/11/23",
subTitle: "Avvio dell'Analisi dei Requisiti",
docType: "verbale",
authors: (
"<NAME>",
),
externalParticipants : (
(name: "<NAME>", role: "Referente aziendale"),
),
timeStart: "10:00",
timeEnd: "11:00",
location: "Zoom",
);
= Ordine del giorno
- Approfondimento specifiche del capitolato;
- Presentazione, supportata da una board Miro, delle domande raccolte dal gruppo sostanziate con proposte e mock up. Le domande si articolano in:
- identificazione della tipologia di utente a cui il prodotto Ú destinato;
- prime proposte di user interface e user experience;
- differenza di funzionalità tra applicativo desktop e mobile;
- funzionalità desiderate;
- API RESTful.
- Conferme riguardo lo stack tecnologico individuato;
- Scelta del canale di comunicazione preferenziale tra Proponente e Fornitore;
- Organizzazione di un prossimo meeting e programmazione regolare degli incontri.
\
== Approfondimento specifiche del capitolato
Lo scopo del meeting Ú iniziare l'Analisi dei Requisiti, focalizzando l'attenzione sulla comprensione delle funzionalità richieste, la loro implementazione e il dominio tecnologico che il gruppo utilizzerà .
Le domande raccolte dal gruppo sono state catalogate nei seguenti ambiti:
- use case;
- funzionalità ;
- user interface e user experience;
- stack tecnologico.
\
== Presentazione delle domande raccolte dal gruppo in merito ai requisiti
=== Utente
L'utente tipico Ú stato individuato nella figura di un amministratore e/o impiegato lato back-office, dotato dunque di massimi privilegi durante l'uso dell'applicativo.\
Le principali azioni che tale utente svolgerà sono:
- interrogazione del magazzino;
- richiesta di spostamento di un prodotto;
- zoom e spostamento all'interno dell'ambiente 3D.
=== User interface & user experience
Durante l'incontro si Ú presentata un'idea generale di possibile user interface. Sono state individuate alcune caratteristiche desiderabili, quali:
- esporre con chiarezza le operazioni disponibili all'utente (distinzione evidente tra elementi selezionabili e non);
- evitare eccessive animazioni o effetti _lampeggianti_;
- evidenziare in modo chiaro gli elementi ricercati (ad esempio riducendo l'opacità degli altri elementi), al fine di non disorientare l'utente;
- spostare la telecamera sull'oggetto ricercato (se singolo);
- essenziale che la ricerca non modifichi la struttura visualizzata del magazzino.
=== Differenze tra applicativo desktop e mobile
Durante la riunione Ú emerso che vi saranno delle differenze tra la versione desktop e la versione mobile. L'accesso completo alla funzionalità (esempio richiesta di spostamento di prodotti) sarà fornito per la versione desktop, mentre la versione mobile presenterà delle funzioni limitate (ad esempio solo visualizzazione e ricerca). In ogni caso, il gap funzionale tra dispositivi rimane ancora da definire nel dettaglio. L'applicativo sarà responsive.
=== Funzionalità desiderate
Da una prima analisi sono emerse le principali funzionalità desiderate, quali:
- creazione dell'ambiente 3D del magazzino, articolata in:
- definizione dei parametri dimensionali del magazzino ;
- creazione e posizionamento nello spazio degli scaffali;
- definizione dei bin, ovvero le locazioni capaci di accogliere i prodotti;
- caricamento dei dati da un database per la popolazione del magazzino;
- interrogazione del magazzino mediante ricerche per ID, nome, o caratteristiche dei prodotti;
- evidenziazione dei prodotti ricercati mediante effetti visivi (ad esempio cambio del colore) e/o spostamento della telecamera;
- invio di notifiche mediante la chiamata a API RESTful per lo spostamento di prodotti nel magazzino.
Durante l'analisi del processo di configurazione si Ú chiarito che il primo passaggio di configurazione riguarda la definizione della geometria del magazzino. Per un magazzino a pianta rettangolare, la geometria può essere definita con tre parametri (lunghezza, larghezza, altezza); per scenari più complessi, il software deve essere in grado di definire la geometria del magazzino dai \<path\> contenuti in un file SVG caricato dall'utente. Successivamente, vengono caricati i dati presenti nel DB.
Il database non impone vincoli strutturali, ma Ú pensato per interfacciarsi con la struttura determinata in fase di creazione.
=== API RESTful
Per l'invio delle notifiche di richiesta di spostamento, l'applicativo si interfaccerà con delle API RESTful. à emerso che l'implementazione di tali API non Ú di interesse del capitolato, e per tale motivazione possiamo procedere ad una simulazione del comportamento delle stesse con assunzioni riguardo i parametri e le risposte. Ad esempio per lo spostamento di un elemento da un bin ad un altro:
- invio all'API delle coordinate di partenza (es: scaffale) e delle coordiante d'arrivo (un altro scaffale) e il prodotto interessato;
- l'API risponde:
- stato 200 (contatto con l'API avvenuto con successo): spostamento richiesto con successo;
- stato 200 (contatto con l'API avvenuto con successo): spostamento non possibile;
- risposte alle interrogazioni ottenuta in formato JSON;
- la logica di controllo della facoltà di spostare un prodotto Ú gestita interamente dall'endpoint REST.
\
== Conferme riguardo lo stack tecnologico individuato
Lo stack tecnologico individuato dal gruppo si articola in:
- DB SQL per la gestione del database relazionale;
- Three.js per l'implementazione della parte grafica (JavaScript o TypeScript);
- Node.js per la comunicazione tra applicativo e database;
- Docker per la containerizzazione del prodotto.
Lo stack tecnologico discusso rappresenta un punto di partenza, ma Ú soggetto a modifiche. Ad ogni modo, al momento, le tecnologie individuate e proposte hanno trovato l'approvazione del Proponente.
In merito all'utilizzo di JavaScript o TypeScript ed eventuali framework per il lato front end (ad esempio React, Angular), il Proponente ha lasciato la massima libertà al Gruppo. L'azienda Proponente utilizza internamente TypeScript e Angular.
\
== Stabilimento delle metodologie di contatto
Il Proponente ha confermato l'intenzione di proseguire i contatti mediante l'uso di posta elettronica.
\
== Organizzazione di un prossimo meeting e programmazione regolare degli incontri
L'incontro si Ú concluso con la programmazione del prossimo meeting in data 23 novembre 2023, dalle ore 14:00 alle ore 15:00.\
In questa prima fase di Analisi dei Requisiti, Proponente e Fornitore si sono trovati d'accordo circa la necessità di svolgere incontri con cadenza almeno settimanale.
\
= Azioni da intraprendere
A seguito del meeting sono state individuate le seguenti operazioni da svolgere:
- raccolta e catalogazione di aspettative e bisogni;
- produzione della documentazione quale use cases, Analisi dei Requisiti da presentare al prossimo meeting;
- esplorazione del dominio tecnologico.
|
|
https://github.com/fredguth/abnt-typst | https://raw.githubusercontent.com/fredguth/abnt-typst/main/main.typ | typst | #import("./templates/abnt_template.typ"):template
#show: template
#include("./cap1.typ")
#include("./cap2.typ")
#include("./cap3.typ")
#include("./cap4.typ")
#include("./cap5.typ")
|
|
https://github.com/jamesrswift/frackable | https://raw.githubusercontent.com/jamesrswift/frackable/main/docs/manual.typ | typst | The Unlicense | #import "@preview/tidy:0.3.0"
#import "@preview/mantys:0.1.4": *
#import "/src/lib.typ": frackable, generator
#let package = toml("/typst.toml").package
#let docs = tidy.parse-module(read("/src/impl.typ"), scope: (frackable: frackable, generator: generator),)
#titlepage(
package.name,
[Frackable], // title
[<NAME>], //subtitle
none, //description,
package.authors,
(package.repository,),
package.version,
datetime.today(),
none, // abstract,
package.license,
toc: false,
)
#tidy.show-module(docs, style: tidy.styles.default) |
https://github.com/astro-group-bristol/paper-management | https://raw.githubusercontent.com/astro-group-bristol/paper-management/main/presentation/tamburlaine.typ | typst | Other | #import "@preview/polylux:0.3.1": *
#let date = datetime(year: 2024, month: 9, day: 27)
// colour configurations
#let SECONDARY_COLOR = rgb("#f6f0e0").lighten(60%)
#let PRIMARY_COLOR = rgb("#be2b31")
#let TEXT_COLOR = black.lighten(13%)
#let tamburlaine-theme(aspect-ratio: "4-3", body) = {
set page(
paper: "presentation-" + aspect-ratio,
fill: SECONDARY_COLOR,
margin: 0.7em
)
set text(fill: TEXT_COLOR, size: 25pt, font: "NimbusSanL")
body
}
#let title-slide(
title: none,
title_size: 80pt,
authors: (),
where: none,
content
) = {
set page(
fill: SECONDARY_COLOR,
margin: (top: 0em, left: 0em, right: 0em, bottom: 0em),
)
set text(fill: TEXT_COLOR, weight: "bold")
let pretty-title = move(dx: 0.5em, rect(outset: (top: 6pt, right: 6pt, left: 34pt, bottom: 34pt), stroke: PRIMARY_COLOR + 4pt,
rect(outset: (top: 4pt, right: 4pt, left: 22pt, bottom: 22pt), stroke: PRIMARY_COLOR + 4pt,
rect(outset: (top: 2pt, right: 2pt, left: 12pt, bottom: 12pt), stroke: PRIMARY_COLOR + 4pt,
rect(outset: (top: 0pt, right: 0pt, left: 4pt, bottom: 4pt), stroke: PRIMARY_COLOR + 4pt,
block(width: 85%, fill: PRIMARY_COLOR, inset: (top: 0em, bottom: 0.0em, left: 1em, right: 2em),
par(leading: 10pt)[
#text(weight: "black", size:title_size, fill: SECONDARY_COLOR)[#title]
]))))))
let author = authors.join(h(1em))
logic.polylux-slide[
#v(1.5em)
#align(center)[
#pretty-title
]
#v(1.5em)
#rect(inset: (top: 0em, left: 1em, right: 1em), width:100%, stroke:none, fill: SECONDARY_COLOR)[
#grid(
columns: (50%, 1fr),
row-gutter: 3pt,
author,
align(right, where),
align(left, text(size: 20pt, weight: "regular")[]),
align(right, text(size: 20pt, weight: "regular",
[#date.display("[day] [month repr:long] [year]") / Bristol]
)),
)
#v(-1.5em)
#content
#v(-0.5em)
]
]
}
#let subtitle-slide(
title_size: 80pt,
title,
) = {
set page(
fill: SECONDARY_COLOR,
margin: (top: 0em, left: 0em, right: 0em, bottom: 0em),
)
set text(fill: TEXT_COLOR, weight: "bold")
let pretty-title = move(dx: 0.5em, rect(outset: (top: 6pt, right: 6pt, left: 34pt, bottom: 34pt), stroke: PRIMARY_COLOR + 4pt,
rect(outset: (top: 4pt, right: 4pt, left: 22pt, bottom: 22pt), stroke: PRIMARY_COLOR + 4pt,
rect(outset: (top: 2pt, right: 2pt, left: 12pt, bottom: 12pt), stroke: PRIMARY_COLOR + 4pt,
rect(outset: (top: 0pt, right: 0pt, left: 4pt, bottom: 4pt), stroke: PRIMARY_COLOR + 4pt,
block(width: 85%, fill: PRIMARY_COLOR, inset: (top: 0em, bottom: 0.5em, left: 1em, right: 2em),
par(leading: 10pt)[
#text(weight: "black", size:title_size, fill: SECONDARY_COLOR)[#title]
]))))))
logic.polylux-slide[
#set align(horizon)
#v(-3em)
#align(center)[
#pretty-title
]
]
}
#let slide(foreground: TEXT_COLOR, background: SECONDARY_COLOR, title: none, body) = {
set page(
fill: background,
margin: (bottom: 1.5em)
)
let footer = locate( loc => {
block(
stroke: ( top: 1mm + PRIMARY_COLOR ), width: 100%, inset: ( y: .5em ),
text(fill: foreground, .5em, {
"CC BY-SA 4.0 <NAME>"
h(2em)
"/"
h(2em)
"Astro Dev Group"
h(2em)
"/"
h(2em)
date.display("[day] [month repr:long] [year]")
h(1fr)
logic.logical-slide.display()
})
)
})
set page(
footer: footer,
footer-descent: 0em,
header-ascent: 1.5em,
)
let content = {
block(outset: 0.8em, width: 100%, fill: PRIMARY_COLOR, spacing: 0.8em, par(leading: 10pt, text(fill: SECONDARY_COLOR, size: 50pt, weight: "black", title)))
v(0.3em)
body
}
logic.polylux-slide(content)
}
#let _setgrp(img, grp, display:true) = {
let key = "id=\"" + grp + "\""
let pos1 = img.split(key)
if display {
pos1.at(1) = pos1.at(1).replace("display:none", "display:inline", count:1)
} else {
pos1.at(1) = pos1.at(1).replace("display:inline", "display:none", count:1)
}
pos1.join(key)
}
#let setgrp(img, ..grps, display: true) = {
grps.pos().fold(img, (acc, grp) => {
_setgrp(acc, grp, display: display)
})
}
#let animsvg(img, display_callback, ..frames, handout: false) = {
let _frame_wrapper(_img, hide: (), display: ()) = {
setgrp((setgrp(_img, ..hide, display: false)), ..display, display: true)
}
if handout == true {
let final_image = frames.pos().fold(img, (im, args) => _frame_wrapper(im, ..args))
display_callback(1, final_image)
} else {
let output = ()
let current_image = img
for args in frames.pos().enumerate() {
let (i, frame) = args
current_image = _frame_wrapper(
current_image, ..frame
)
let this = display_callback(i + 1, current_image)
output.push(this)
}
output.join()
}
}
#let cbox(content, ..args) = rect(radius: 3pt, outset: 5pt, ..args, content)
|
https://github.com/bigskysoftware/hypermedia-systems-book | https://raw.githubusercontent.com/bigskysoftware/hypermedia-systems-book/main/lib/definitions.typ | typst | Other | #let leading = 0.6em
#let body-font = "Linux Libertine"
#let secondary-font = "Linux Biolinum"
#let display-font = "Jaro"
#let mono-font = "Berkeley Mono"
#import "./indexing.typ": *
#let part-heading(it) = [
#page([], header: none, footer: none)
#pagebreak(to: "odd")
#align(horizon)[
#set par(leading: 5pt, justify: false)
#set text(size: 32pt, font: display-font)
#text(fill: luma(140))[
#it.at("supplement", default: none)
#counter(heading).display("I")
]
#linebreak()
#it.body
#metadata("")<heading-here>
]
]
#let chapter-heading(it) = [
#page([], header: none, footer: none)
#pagebreak(to: "odd")
#v(3in)
#set par(justify: false)
#set text(size: 22pt, font: display-font)
#block({
if it.at("numbering") != none {
text(fill: luma(140), {
it.supplement
[ ]
str(counter(heading).get().at(1))
})
linebreak()
}
it.body
[#metadata("")<heading-here>]
})
]
#let asciiart(..args, source) = figure({
set text(size: .8em)
set par(leading: .5em)
block(breakable: false, align(start, raw(source, block: true)))
}, kind: image, ..args)
#let blockquote = quote.with(block: true)
#let sidebar(title, body) = [#block(
spacing: 1em, block(
width: 100%,
inset: 1em,
stroke: (top: 1pt, bottom: 1pt),
fill: luma(237),
breakable: true,
)[
#set text(.8em, font: secondary-font)
#if title != [] {
block(
breakable: false,
strong(title)
)
}
#block(spacing: 1em, body)
],
)<sidebar>]
#let important(title, body) = [#block(
spacing: 1em, block(
width: 100%,
inset: 1em,
stroke: (
top: (thickness: 1pt, paint: blue), bottom: (thickness: 1pt, paint: blue),
),
fill: rgb("#def"),
breakable: true,
)[
#set text(.8em, font: secondary-font)
#block(
breakable: false,
strong(title) + v(4em)
)
#v(-4em)
#block(spacing: 1em, body)
],
)<important>]
#let html-note(label: [HTML Notes], title, body) = [#block(
spacing: 1em,
block(
width: 100%,
inset: 1em,
stroke: (top: 1pt, bottom: 1pt),
fill: rgb("#f5f5ff"),
breakable: true,
)[
#set text(.8em, font: secondary-font)
#show heading: set text(1em)
=== #label: #title
#body
],
)<html-note>]
#let skew(angle, vscale: 1, body) = {
let (a, b, c, d) = (1, vscale * calc.tan(angle), 0, vscale)
let E = (a + d) / 2
let F = (a - d) / 2
let G = (b + c) / 2
let H = (c - b) / 2
let Q = calc.sqrt(E * E + H * H)
let R = calc.sqrt(F * F + G * G)
let sx = Q + R
let sy = Q - R
let a1 = calc.atan2(F, G)
let a2 = calc.atan2(E, H)
let theta = (a2 - a1) / 2
let phi = (a2 + a1) / 2
set rotate(origin: bottom + center)
set scale(origin: bottom + center)
rotate(phi, scale(x: sx * 100%, y: sy * 100%, rotate(theta, body)))
}
|
https://github.com/mgoulao/IST-MSc-Thesis-Typst-Template | https://raw.githubusercontent.com/mgoulao/IST-MSc-Thesis-Typst-Template/main/template.typ | typst |
#let heading_style(it) = {
// Set chapter
locate(loc => {
let heading_number = counter(heading).at(loc).at(0)
if it.level == 1{
if heading_number != 0 {
pagebreak()
align(right,
grid(rows: (140pt,auto),
text(140pt, fill: rgb("#999999"), counter(heading).display()),
text(28pt, it.body)
)
)
pagebreak()
} else {
pad(
bottom: 50pt,
text(30pt, it))
}
// Increase figures counter
// counter(figure).step(level: 1)
}
else if it.level <= 3 {
pad(
top: 10pt,
bottom: 10pt,
text(14pt, it)
)
}
else if it.level > 3 {
// Set run-in subheadings, starting at level 4.
parbreak()
text(11pt, style: "italic", weight: "regular", it.body + ".")
} else {
it
}
})
}
#let project(
school_logo: none,
cover_image: none,
title: "",
subtitle: "",
author: "",
degree: "",
supervisors: (),
committee: (),
date: "",
abstract: [],
abstract_pt: none,
custom_sections: (),
body,
) = {
// Set the document's basic properties.
set document(author: author, title: title)
set page(
margin: (left: 20mm, right: 20mm, top: 20mm, bottom: 20mm),
)
set text(font: "Source Sans Pro", lang: "en")
set heading(numbering: "1.1")
//set figure(numbering: "1.1")
//show figure.where(kind: table): it => {
// counter(figure.where(kind: table)).step(level: 1)
// it
//}
show heading: heading_style
// Table of content and lists style
show outline: it => {
show heading: set text(fill: rgb("#000"))
set text(fill: rgb("#666666"), weight: 500)
it
}
// Set a heading style for bibliography
show bibliography: it => {
show heading: it_heading => {
pagebreak()
pad(
bottom: 50pt,
text(30pt, it_heading.body)
)
}
it
}
// Cover page
// Title page.
// The page can contain a logo if you pass one with `logo: "logo.png"`.
if school_logo == none {
school_logo = "images/ist-logo.png"
}
image(school_logo, height: 20mm, width: auto)
v(8mm)
// Image
if cover_image != none and cover_image.trim().len() > 0 {
pad(bottom: 10mm,
image(cover_image)
)
} else {
v(58mm)
}
align(center, {
block(
width: 80%,
{
// Title
text(16pt, weight: "bold", [This is the Title of the Thesis and it is a very Big Title covering More than One Line])
// Subtitle
if subtitle.trim().len() > 0 {
pad(
top: 0.8em,
text(14pt, subtitle)
)
}
// Author information.
pad(
top: 3.2em,
text(16pt, weight: "bold", author)
)
// Thesis information.
pad(
top: 3.2em, {
text(12pt, [Thesis to obtain the Master of Science Degree in])
linebreak()
v(1.8em)
text(16pt, weight: "bold", degree)
})
// Supervisor information
if supervisors.len() > 0 {
pad(
top: 1.8em,
text(12pt, {
if supervisors.len() > 1 {
[Supervisors: ]
} else {
[Supervisor: ]
}
supervisors.join([ \ ])
})
)
}
// Committee information.
if committee.len() > 0 {
pad(top: 1.2em, text(14pt, weight: "bold", [Examination Committee]))
pad(
top: 1.2em,
grid(
rows: (auto,) * calc.min(3, committee.len()),
gutter: 0.5em,
..committee.map(member => text(12pt, member.role + [: ] + member.name)),
),
)
}
})
})
// Date
align(center + bottom,
pad(
top: 4em,
text(14pt, weight: "bold", date)
)
)
pagebreak()
// End of cover page
counter(page).update(0)
set page(
margin: (left: 25mm, right: 25mm, top: 30mm, bottom: 30mm),
footer: [
#set align(center)
#set text(12pt, weight: "bold")
#counter(page).display(
"i",
)
],
number-align: center,
)
// Custom sections (Ackowledgments, Declarations, etc.)
// Abstract page.
v(1fr)
heading(outlined: false, numbering: none, text(0.85em)[Abstract])
align(left)[
#set par(justify: true)
#abstract
]
v(1.618fr)
pagebreak()
if abstract_pt != none {
v(1fr)
heading(outlined: false, numbering: none, text(0.85em)[Resumo])
align(left)[
#set par(justify: true)
#abstract_pt
]
v(1.618fr)
pagebreak()
}
// Table of contents.
outline(depth: 4, indent: true)
pagebreak()
// Figure listing
outline(
title: [List of Figures],
target: figure.where(kind: image),
)
pagebreak()
// Table listing
outline(
title: [List of Tables],
target: figure.where(kind: table),
)
// Reset page counter and make a empty page with no number
set page(
footer: []
)
pagebreak()
counter(page).update(0)
// Main content
set page(
margin: (left: 25mm, right: 25mm, top: 30mm, bottom: 30mm),
footer: [
#set align(center)
#set text(12pt, weight: "bold")
#counter(page).display(
"1",
)
],
number-align: center,
)
// Main body.
set par(justify: true)
body
}
#let appendices(body) = {
counter(heading).update(0)
counter("appendices").update(1)
set heading(
numbering: (..nums) => {
let vals = nums.pos()
let value = "ABCDEFGHIJ".at(vals.at(0) - 1)
if vals.len() == 1 {
return value
}
else {
return value + "." + nums.pos().slice(1).map(str).join(".")
}
}
);
[#pagebreak() #body]
}
|
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Maths_Sup.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Maths Sup",
authors: (
"<NAME>",
),
date: "30 Octobre, 2023",
)
#set heading(numbering: "1.1.")
== Ressources
<ressources>
- #link("Maths_Sup_Course.pdf")[MathsSup]
- #link("coursMP2I-analyse.pdf")[Cours MPSI/MP2I Analyse]
- #link("http://alain.troesch.free.fr/")[Cours de mathématique MPSI]
- #link("http://christophebertault.fr/cours-et-exercices/")[Christophe Bertault]
- #link("https://groupe-reussite.fr/ressources/cours-en-ligne-maths-sup-maths/")[Groupe Réussite]
#link("Maths.pdf")[Maths]
|
|
https://github.com/arthurcadore/eng-telecom-workbook | https://raw.githubusercontent.com/arthurcadore/eng-telecom-workbook/main/semester-7/COM_1/homework4/homework.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: "Modulação e Demodulação em Frequência (FM)",
subtitle: "Sistemas de Comunicação I",
authors: ("<NAME>",),
date: "09 de Abril de 2024",
doc,
)
= Introdução
O objetivo deste relatório é apresentar o desenvolvimento de um sistema de modulação e demodulação em frequência (FM) para sinais de áudio. O sistema foi desenvolvido através de linguagem MATLAB (Octa ve), e tem como objetivo principal a compreensão do processo de modulação e demodulação em frequência, bem como a análise dos sinais modulados e demodulados.
\
Neste relatório será apresentado a fundamentação teórica do processo de modulação e demodulação em frequência, bem como a análise dos sinais modulados e demodulados, os scripts MATLAB utilizados e os resultados obtidos.
\
Desta forma, poderemos compreender o processo de modulação e demodulação FM, bem como a análise dos sinais modulados e demodulados, e a importância deste processo para a transmissão de sinais de áudio em sistemas de comunicação.
= Fundamentação teórica
== Principais Conceitos
Os principais conceitos teóricos abordados neste relatório são:
- Modulação FM: A modulação em frequência (FM) é um processo de modulação em que a frequência da portadora é variada de acordo com a amplitude do sinal modulante. A variação da frequência da portadora é proporcional à amplitude do sinal modulante, resultando em um sinal modulado em frequência. A modulação em frequência é amplamente utilizada em sistemas de comunicação para transmissão de sinais de áudio, devido à sua alta qualidade de áudio e baixa interferência.
- Demodulação FM: A demodulação em frequência é o processo de recuperar o sinal modulante original a partir do sinal modulado em frequência. A demodulação FM é realizada através da diferenciação do sinal modulado, que resulta em um sinal que contém a informação de frequência do sinal modulante original. O sinal demodulado é então filtrado para remover as frequências indesejadas e obter o sinal de áudio original.
- Sinal Portador: O sinal portador é um sinal (tipicamente de alta frequência) que é modulado pela informação do sinal modulante. O sinal portador é a base para a transmissão do sinal modulado em frequência e é recuperado na demodulação para obter o sinal de áudio original.
- Sinal Modulante: O sinal modulante é o sinal de áudio que é modulado em frequência para transmissão em sistemas de comunicação. O sinal modulante é a informação que é transmitida através da variação da frequência da portadora.
== Resumo dos Itens abordados (Material de Referência)
Além dos conceitos base apresentados acima, o material de referência também aborda os seguintes tópicos, que são importantes para o entendimento do processo de modulação e demodulação em frequência (itens 9.1, 9.2, 9.3 e 9.4).
=== The history of the FM Standard
Objetivo: Apresentar a modulação em frequência (FM) e sua importância para a transmissão de sinais de áudio em sistemas de comunicação.
\
Nesta sessão do livro, o autor apresenta a história da modulação em frequência (FM) e sua importância para a transmissão de sinais de áudio em sistemas de comunicação. O nacimento da modulação em frequência ocorreu em 1933 com o americano <NAME>, que desenvolveu e demonstrou a rádio FM como uma solução para o "problema do ruÃdo estático".
\
Em 1912, <NAME> descobriu que, se as ondas eletromagnéticas emitidas pelos receptores de rádio (de válvula de vidro) fossem alimentadas de volta através do hardware (circuito de RF), a intensidade do sinal aumentava, e assim, ondas de rádio eram geradas.
\
De acordo com o livro, ele chamou esse processo de feedback positivo de regeneração, e é considerado uma das descobertas mais importantes na história do rádio, pois significava que receptores de rádio também poderiam ser usados como transmissores.
=== The mathematics of FM & the Modulation Index
Objetivo: Apresentar a matemática da modulação em frequência (FM) e o Ãndices de modulação FM.
Nesta sessão, o autor explica sobre a construção de um modulador FM analógico através de um VCO (Voltage Controller Oscillator). O VCO gera um sinal senoidal cuja fase (e, portanto, efetivamente a frequência) muda em resposta a variações de amplitude de um sinal de controle de entrada.
\
Quando o sinal modulante é inserido no VCO, ele é multiplicado por uma constante (k_f) que representa a relação de variação de tensão proporcional a variação de frequência.
\
Assim, conforme o sinal modulante varia (supondo uma senoide por exemplo), o sinal modulado tem sua frequência variada na mesma proporção que a variação de tensão ao longo do tempo.
\
A fase do senoide é determinada pelo valor instantâneo de tensão do sinal modulante, e a frequência do sinal modulado é determinada pela taxa de variação da fase do sinal modulante.
=== FM Signal Bandwidth
Objetivo: Apresentar a largura de banda do sinal FM e as diferenças entre NFM (Narrowband FM) e WFM (Wideband FM).
Nesta sessão, o autor apresenta a largura de banda do sinal FM e as diferenças entre NFM (Narrowband FM) e WFM (Wideband FM). A largura de banda do sinal FM é determinada pela taxa de variação da frequência do sinal modulante.
\
A modulação em frequência é considerada um processo de Banda Estreita ou Banda Larga, e o valor do Ãndice de modulação determina isso. Se o Ãndice de modulação de um sinal FM for << 1, é considerado FM de Banda Estreita (NFM), enquanto se for >> 1, é FM de Banda Larga (WFM).
==== NFM (Narrowband FM):
A modulação em frequência de banda estreita (NFM) é caracterizada por um Ãndice de modulação << 1, resultando em um desvio de frequência máximo limitado, geralmente em torno de 5kHz. Neste cenário, as aproximações podem ser feitas para simplificar os cálculos, já que a contribuição da frequência instantânea é negligenciável. A equação de modulação FM pode ser expandida usando identidades trigonométricas apropriadas. A NFM é comumente usada em aplicações como comunicações de rádio bidirecionais e sistemas de rádio de curto alcance, onde a largura de banda é limitada e a fidelidade do sinal é essencial.
==== WFM (Wideband FM):
A modulação em frequência de banda larga (WFM) é o padrão usado por estações de rádio comerciais, caracterizado por um Ãndice de modulação >> 1. Neste caso, o desvio de frequência máximo permitido é maior, frequentemente em torno de 75kHz. A WFM oferece uma qualidade de áudio superior à NFM, mas requer uma largura de banda maior. Durante o processo de modulação, são criadas um número infinito de bandas laterais ao redor da frequência da portadora, o que exige uma limitação da largura de banda para evitar interferências entre canais. As estações de rádio FM geralmente são separadas por 0,2MHz nos receptores analógicos devido a essa limitação de largura de banda.
=== FM Demodulation Using Differentiation
Objetivo: Apresentar a demodulação em frequência utilizando a diferenciação do sinal modulado.
\
Nesta seção, o autor descreve o processo de demodulação do sinal FM modulado através de diferenciação do sinal recebido. Para o sinal transmitido (e recebido perfeitamente), um novo sinal diferenciado denotado como (onde o traço denota a derivada) é gerado pelo receptor.
\
Neste método, o sinal terá a aparência de um sinal AM-DSB-TC no domÃnio do tempo, pois possui uma envoltória de informação (embora, ao contrário de uma envoltória AM padrão, a frequência do componente da portadora ainda muda). De acordo com o autor, as flutuações nesta envoltória são diretamente proporcionais à frequência instantânea do sinal modulado, que deve ser diretamente proporcional à amplitude do sinal de informação original.
\
Se considerarmos que o termo senoidal de alta frequência pode ser removido por um detector de envoltória (utilizado nos scripts matlab descritos neste documento, veja o código abaixo), fica claro que a amplitude da envoltória é diretamente proporcional à amplitude do sinal de informação. Embora tenha um deslocamento DC (e ganho de resultante da constante de modulação FM), o sinal de áudio original pode ser recuperado com precisão.s
#sourcecode[```matlab
% Calculating the FM demodulation for the modulated signal
demodulated_signal = diff(modulated_signal) * fs / k0;
demodulated_signal = [demodulated_signal, 0]; % Sinal demodulado
% calculating the FFT of the random signal;
demodulated_f = fft(demodulated_signal)/length(demodulated_signal);
demodulated_f = fftshift(demodulated_f);
% Calculating the signal wrap.
demodulated_wrap = abs(hilbert(demodulated_signal));
```]
= Análise dos resultados
== Sinal de áudio Aleatório:
Inicialmente, foi feita a importação de um sinal de áudio para ser utilizado como modulante da portadora em frequência, para transmissão em FM.
A figura abaixo mostra o plot do sinal no domÃnio do tempo, bem como seu respectivo plot do sinal no domÃnio da frequência.
#figure(
figure(
image("./pictures/timeDomain.png"),
numbering: none,
caption: [Sinal de entrada no domÃnio do tempo]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Uma vez com o sinal de entrada definido, a modulação em frequência foi realizada através da integração do argumento de fase da portadora a partir do sinal da modulante, conforme o script abaixo:
#sourcecode[```matlab
% Creating the FM modulated signal:
phase_argument = 2*pi*k_f*cumsum(modulating_signal)*(Ts);
modulated_signal = A_carrier * cos(2*pi*f_carrier*t + phase_argument);
```]
Onde na figura acima os parâmetros são:
- `modulating_signal` é o sinal de áudio importado.
- `k_f` é a sensibilidade do modulador para variação de frequência.
- `Ts` é o perÃodo de amostragem do sinal.
- `A_carrier` é a amplitude da portadora
- `f_carrier` é a frequência da portadora.
- `t` é o vetor de tempo do sinal modulado (utilizado para realizar a modulação em FM).
- `phase_argument` é o argumento de fase da portadora do sinal, gerado a partir da integração do sinal modulante.
- `modulated_signal` é o sinal modulado em FM.
Uma vez com o sinal modulado em FM, podemos compreender o formato do sinal modulado no domÃnio do tempo e da frequência, conforme a figura abaixo:
#figure(
figure(
image("./pictures/FrequencyDomain.png"),
numbering: none,
caption: [Sinal modulado em FM no domÃnio do tempo e da frequência]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Uma vez com o sinal modulado, e multiplexado, podemos transmiti-lo pelo meio fÃsico sem que haja interferência entre cada portadora (idealmente). O sinal no meio fÃsico é ilustrado abaixo em azul.
\
#figure(
figure(
image("./pictures/Modulated.png"),
numbering: none,
caption: [Sinal modulado e "transmitido" no meio fÃsico]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Na recepção do sinal, precisamos realizar sua demodulação para ter novamente o sinal de áudio original. Para isso, utilizamos um demodulador FM, que é basicamente um circuito que realiza a derivação do sinal modulado, conforme o script abaixo:
#sourcecode[```matlab
% Calculating the FM demodulation for the modulated signal
demodulated_signal = diff(modulated_signal) * fs / k0;
demodulated_signal = [demodulated_signal, 0]; % Sinal demodulado
% calculating the FFT of the random signal;
demodulated_f = fft(demodulated_signal)/length(demodulated_signal);
demodulated_f = fftshift(demodulated_f);
% Calculating the signal wrap.
demodulated_wrap = abs(hilbert(demodulated_signal));
```]
Com o sinal demodulado, utilizamos um filtro passa-baixas para eliminar as frequências indesejadas, e obter o sinal de áudio original.
Para isso, foi utilizado um filtro FIR de ordem relativamente alta (neste caso 100), com frequência de corte de 20kHz. A frequência neste script foi fixada em 20kHz, pois trata-se de um sinal de áudio, e portanto, não há informação relevante acima desta frequência para ser capturada.
Para verificar se de fato o filtro está atuando corretamente, abaixo está um plot da resposta em frequência do filtro FIR:
#figure(
figure(
image("./pictures/filter.png"),
numbering: none,
caption: [Resposta em frequência do filtro FIR]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Com o sinal demodulado e filtrado, podemos realizar seu plot no dominio do tempo e também realizar a FFT do sinal para observar as componentes de frequência do sinal demodulado.
#figure(
figure(
image("./pictures/Demodulated.png"),
numbering: none,
caption: [Sinal demodulado no domÃnio do tempo]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Como podemos observar, o sinal demodulado é muito semelhante ao sinal de áudio original, com pequenas distorções devido ao processo de modulação e demodulação em frequência.
O sinal também foi plotado no dominio do tempo e da frequência, para verificar se o sinal demodulado está correto.
#figure(
figure(
image("./pictures/DemodulatedF.png"),
numbering: none,
caption: [Sinal demodulado no domÃnio da frequência]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
== Sinal Senoidal Modulante
Devido as variações no processo de modulação e demodulação apresentadas anteriormente, foi feita a análise de um sinal puramente senoidal como modulante em FM, para verificar se o processo de modulação e demodulação em frequência está correto.
Inicialmente, foi feita a definição dos parâmetros do sinal modulante e em seguida o plot do mesmo no dominio do tempo e também da frequência:
#figure(
figure(
image("./pictures/timeDomain-Sin.png"),
numbering: none,
caption: [Sinal senoidal modulante no domÃnio do tempo e da frequência]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Em seguida, com o sinal modulante definido, foi feita a modulação em frequência do sinal senoidal, note que para esse processo de modulação, o sinal modulante é uma senoide pura, e portanto, o sinal modulado em FM possui uma variação suave e periódica de frequência ao longo do tempo.
\
Sendo assim possivel analisar o sinal modulado no dominio do tempo e da frequência, conforme a figura abaixo:
#figure(
figure(
image("./pictures/FrequencyDomain-Sin.png"),
numbering: none,
caption: [Sinal modulado em FM no domÃnio do tempo e da frequência]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Com o sinal modulado em FM definido, podemos transmiti-lo pelo meio fÃsico, e realizar a demodulação do sinal para obter o sinal senoidal original.
Na recepção, foi feita a demodulação do sinal modulado, e em seguida a filtragem do sinal demodulado para obter o sinal senoidal original, a figura abaixo mostra o sinal demodulado no dominio do tempo:
#figure(
figure(
image("./pictures/Demodulated-Sin.png"),
numbering: none,
caption: [Sinal demodulado no domÃnio do tempo]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
Novamente, para verificar se o sinal demodulado está correto, foi feita a análise do sinal demodulado no dominio da frequência, conforme a figura abaixo:
#figure(
figure(
image("./pictures/DemodulatedF-Sin.png"),
numbering: none,
caption: [Sinal demodulado no domÃnio da frequência]
),
caption: figure.caption([Elaborada pelo Autor], position: top)
)
= Scripts e Códigos Utilizados:
== Definições Iniciais
O script abaixo define as variáveis iniciais do sistema, como a amplitude dos sinais, a frequência do sinal modulante, a frequência da portadora, a sensibilidade do modulador para variação de frequência, e o perÃodo de amostragem do sinal.
#sourcecode[```matlab
close all; clear all; clc;
pkg load signal;
% Altera o tamanho da fonte nos plots para 15
set(0, 'DefaultAxesFontSize', 20);
% Defining the signals amplitude.
A_modulating = 1;
A_carrier = 1;
% Defining the signals frequency
f_modulating_max = 20000;
f_carrier = 80000;
% modulator sensibility for frequency variation (Hz/volts)
k_f = 2000000;
k0 = 2*pi*k_f;
% Delta variable, correponding to max frequency variation.
d_f = k_f*A_modulating;
% Beta variable, correspondig to percentage of frequency variation about the frequency of the modulating.
b = d_f/f_modulating_max;
% Defining the period and frequency of sampling:
fs = 50*f_carrier;
Ts = 1/fs;
T = 1/f_modulating_max;
% Defining the sinal period.
t_inicial = 0;
t_final = 2;
% "t" vector, correspondig to the time period of analysis, on time domain.
t = [t_inicial:Ts:t_final];
```]
== Sinal modulante e Modulado FM
O script abaixo importa um sinal de áudio para ser utilizado como modulante da portadora em frequência, e em seguida realiza a modulação em frequência do sinal modulante.
#sourcecode[```matlab
% Import the audioSignal to use as modulating FM signal:
[modulating_signal, Hs] = audioread('randomSignal.wav');
modulating_signal = transpose(modulating_signal);
% Calculate the number of zeros to be added
num_zeros = length(t) - length(modulating_signal);
% Add the zeros to the end of the modulating_signal vector
modulating_signal = [modulating_signal, zeros(1, num_zeros)];
% Transpose the modulated signal if necessary
modulated_signal = transpose(modulating_signal);
% Creating the FM modulated signal:
phase_argument = 2*pi*k_f*cumsum(modulating_signal)*(Ts);
modulated_signal = A_carrier * cos(2*pi*f_carrier*t + phase_argument);
% Plot signals on time domain:
figure(1)
subplot(311)
plot(t, (modulating_signal),'b', 'LineWidth', 2)
xlim([0.00054 0.00067])
xlabel('Time (s)')
ylabel('Amplitude')
title('Random Sound Signal (Time Domain)')
subplot(312)
plot(t, abs(modulating_signal),'r', 'LineWidth', 2)
xlim([0.00054 0.00067])
xlabel('Time (s)')
ylabel('Amplitude')
title('Random Sound Signal - Absolute (Time Domain)')
subplot(313)
plot(t, modulated_signal,'k', 'LineWidth', 2)
xlim([0.00054 0.00067])
xlabel('Time (s)')
ylabel('Amplitude')
title('Modulated FM Signal (Time Domain)')
```]
== FFT dos sinais modulantes
O script abaixo calcula a FFT dos sinais modulantes e modulados, e em seguida realiza o plot dos sinais no domÃnio da frequência.
#sourcecode[```matlab
% calculating the step of the frequency vector "f" (frequency domain);
f_step = 1/t_final;
% creating the frequency vector "f" (frequency domain);
f = [-fs/2:f_step:fs/2];
% calculating the FFT of the random signal;
modulating_f = fft(modulating_signal)/length(modulating_signal);
modulating_f = fftshift(modulating_f);
% calculating the FFT of the modulated signal;
modulated_f = fft(modulated_signal)/length(modulated_signal);
modulated_f = fftshift(modulated_f);
% Plotting the modulated signal on frequency domain;
figure(2)
subplot(211)
plot(f, abs(modulating_f), 'k', 'LineWidth', 2)
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Modulating Signal (Frequency Domain)')
xlim([-f_carrier*1.2 f_carrier*1.2])
ylim([0 A_carrier/1000])
subplot(212)
plot(f, abs(modulated_f), 'k', 'LineWidth', 2)
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Modulated Signal (Frequency Domain)')
xlim([-f_carrier*1.2 f_carrier*1.2])
ylim([0 A_carrier/1000])
```]
== Demodulação do sinal e Filtro
O script abaixo realiza a demodulação do sinal modulado, e em seguida realiza a filtragem do sinal demodulado para obter o sinal de áudio original.
#sourcecode[```matlab
% Calculating the FM demodulation for the modulated signal
demodulated_signal = diff(modulated_signal) * fs / k0;
demodulated_signal = [demodulated_signal, 0]; % Sinal demodulado
% Ordem do filtro FIR
filtro_ordem = 100;
% Frequência de corte do filtro FIR
% Como trata-se de um sinal de áudio, a frequência de corte pode ser fixada em 20kHz
frequencia_corte = 20000;
% Coeficientes do filtro FIR para cada sinal demodulado
coeficientes_filtro = fir1(filtro_ordem, frequencia_corte/(fs/2));
% Resposta em frequência do filtro FIR para cada sinal demodulado
[H_fir, f_fir] = freqz(coeficientes_filtro, 1, length(t), fs);
% Plot da resposta em frequência do filtro:
figure(6)
plot(f_fir, abs(H_fir), 'r', 'LineWidth', 3)
xlim([0 frequencia_corte*1.1])
title('Resposta em Frequência do Filtro FIR')
xlabel('Frequência (Hz)')
ylabel('Magnitude')
```]
== Filtragem e plotagem dos sinais resultantes
O script abaixo realiza a filtragem do sinal demodulado, e em seguida realiza o plot dos sinais modulados e demodulados no domÃnio do tempo e da frequência.
#sourcecode[```matlab
% Filtragem dos sinais demodulados
demodulated_filtered = filter(coeficientes_filtro, 1, demodulated_signal);
% calculating the FFT of the random signal;
demodulated_filtered_f = fft(demodulated_filtered)/length(demodulated_filtered);
demodulated_filtered_f = fftshift(demodulated_filtered_f);
% Calculating the signal wrap.
demodulated_wrap = abs(hilbert(demodulated_filtered));
% Plotting the modulated and demodulated signals on time domain:
figure(3)
subplot(311)
plot(t, modulated_signal, 'k', 'LineWidth', 2)
xlim([0.00054 0.00067])
xlabel('Tempo (s)')
ylabel('Amplitude')
title('Sinal Modulado FM (DomÃnio do Tempo)')
subplot(312)
plot(t, demodulated_signal, 'b', 'LineWidth', 2)
xlim([0.00054 0.00067])
xlabel('Tempo (s)')
ylabel('Amplitude')
title('Sinal Demodulado FM (DomÃnio do Tempo)')
subplot(313)
plot(t, demodulated_filtered, 'r--', 'LineWidth', 2)
xlim([0.00054 0.00067])
xlabel('Tempo (s)')
ylabel('Amplitude')
title('Sinal Demodulado FM Filtrado (DomÃnio do Tempo)')
figure(4)
subplot(211)
plot(f, demodulated_filtered_f, 'k', 'LineWidth', 2)
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Demodulated Signal (Frequency Domain)')
xlim([-f_carrier*1.2 f_carrier*1.2])
ylim([0 A_carrier/1000])
subplot(212)
plot(f, abs(demodulated_filtered_f), 'k', 'LineWidth', 2)
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Absolute Demodulated Signal (Frequency Domain)')
xlim([-f_carrier*1.2 f_carrier*1.2])
ylim([0 A_carrier/1000])
```]
= Conclusão
A partir dos conceitos vistos e dos resultados obtidos, podemos concluir que o processo de modulação e demodulação em frequência é uma tecnica eficiente para a transmissão de sinais de áudio em sistemas de comunicação, pois permite a transmissão de sinais de áudio com qualidade e fidelidade com baixa interência devido a informação estar sendo carregada na variação de frequência e não na amplitude do sinal.
Desta forma, podemos compreender seu uso em sistemas de telecomunicação utilizado atualmente pelas rádios analógicas regionais para transmissão de sinais de áudio em broadcast para toda a região, visto que esse tipo de transmissão possui um baixo Ãndice de ruÃdo e distorção.
= Referências
Para o desenvolvimento deste relatório, foi utilizado o seguinte material de referência:
- #link("https://www.researchgate.net/publication/287760034_Software_Defined_Radio_using_MATLAB_Simulink_and_the_RTL-SDR")[Software Defined Radio Using MATLAB & Simulink and the RTL-SDR, de <NAME>] |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/vonsim/0.1.0/README.md | markdown | Apache License 2.0 | This package adds the ability to syntax highlighting VonSim source code in Typst.
## How to use
To add global support for VonSim, just add these lines and use a raw block with `vonsim` as its language.
````typst
#import "@preview/vonsim:0.1.0": init-vonsim
// Adds global support for VonSim
#show: init-vonsim
// Highlight VonSim code
```vonsim
; Welcome to VonSim!
; This is an example program that calculates the first
; n numbers of the Fibonacci sequence, and stores them
; starting at memory position 1000h.
n equ 10 ; Calculate the first 10 numbers
org 1000h
start db 1
org 2000h
mov bx, offset start + 1
mov al, 0
mov ah, start
loop: cmp bx, offset start + n
jns finish
mov cl, ah
add cl, al
mov al, ah
mov ah, cl
mov [bx], cl
inc bx
jmp loop
finish: hlt
end
```
````
Alternatively, use `init-vonsim-full` to also use the VonSim theme.
|
https://github.com/hongjr03/shiroa-page | https://raw.githubusercontent.com/hongjr03/shiroa-page/main/DSA/chapters/6æ åäºåæ .typ | typst |
#import "../template.typ": *
#import "@preview/pinit:0.1.4": *
#import "@preview/fletcher:0.5.0" as fletcher: diagram, node, edge
#import "/book.typ": book-page
#show: book-page.with(title: "æ åäºåæ | DSA")
= æ åäºåæ
<æ åäºåæ >
== æ çå®ä¹ååºæ¬æ¯è¯
<æ çå®ä¹ååºæ¬æ¯è¯>
#definition[
*æ *ïŒæ æ¯ $n(n >= 0)$ 䞪ç»ç¹çæééåãåœ $n = 0$ æ¶ïŒç§°äžºç©ºæ ïŒåœ $n > 0$ æ¶ïŒæ å
·æä»¥äžæ§èŽšïŒ
- æäžä»
æäžäžªç¹å®çç§°äžºæ ¹çç»ç¹
- åœ $n > 1$ æ¶ïŒå
¶äœç»ç¹å¯å䞺 $m(m > 0)$ 䞪äºäžçžäº€çæééå $T_1, T_2, dots, T_m$ïŒå
¶äžæ¯äžäžªéåæ¬èº«åæ¯äžæ£µæ ïŒç§°äžºæ ¹çåæ ã
]<æ çå®ä¹>
对æ¯çº¿æ§ç»æåæ åœ¢ç»æïŒ
#table(
columns: (1fr, 1fr),
rows: 2em,
align: center + horizon,
table.header([*线æ§ç»æ*], [*æ åœ¢ç»æ*]),
[第äžäžªæ°æ®å
çŽ ïŒæ å驱], [æ ¹ç»ç¹ïŒæ å驱],
[æåäžäžªæ°æ®å
çŽ ïŒæ åç»§], [å€äžªå¶åç»ç¹ïŒæ åç»§],
[å
¶ä»æ°æ®å
çŽ ïŒäžäžªå驱ãäžäžªåç»§], [å
¶ä»ç»ç¹ïŒäžäžªå亲ãå€äžªå©å],
)
=== åºæ¬æ¯è¯
- *ç»ç¹*ïŒæ°æ®å
çŽ +è¥å¹²æååæ ç忝
- *ç»ç¹ç床*ïŒç»ç¹ç*åæ *䞪æ°ïŒè¿éåçŠ»æ£æ°åŠäžç床ææäžåïŒ
- *æ ç床*ïŒæ äžç»ç¹çæå€§åºŠ
- *å¶åç»ç¹*ïŒåºŠäžº 0 çç»ç¹
- *忝ç»ç¹*ïŒåºŠäžäžº 0 çç»ç¹
- ïŒä»æ ¹ç»ç¹å°æäžªç»ç¹çïŒ*è·¯åŸ*ïŒç±ä»æ ¹å°è¯¥ç»ç¹æç»åæ¯åç»ç¹ææ
- *屿¬¡*ïŒæ ¹ç»ç¹ç屿¬¡äžº 1ïŒå
¶äœç»ç¹ç屿¬¡çäºå
¶å亲ç»ç¹ç屿¬¡å 1
- *æ çæ·±åºŠ*ïŒæ äžç»ç¹çæå€§å±æ¬¡
- *森æ*ïŒ$m(m > 0)$ 棵äºäžçžäº€çæ çéå #note_block[
ä»»äœéç©ºæ æ¯äžäžªäºå
ç» $"Tree" = ("root", F)$ïŒå
¶äž $"root"$ æ¯æ çæ ¹ç»ç¹ïŒ$F$ æ¯åæ æ£®æã
]
- *æåæ *ïŒ
+ æç¡®å®çæ ¹ç»ç¹
+ æ æ ¹ååæ æ ¹ä¹éŽäžºæåå
³ç³»
- *æåºæ *ïŒæ äžç»ç¹çååæ çææ¯æåºçïŒå³åæ ä¹éŽææ¬¡åºå
³ç³»
- *æ åºæ *ïŒåæ ä¹éŽæ 次åºå
³ç³»
== äºåæ
#definition[
*äºåæ *ïŒäºåæ æäžºç©ºæ ïŒææ¯ç±äžäžªæ ¹ç»ç¹å äžäž€æ£µåå«ç§°äžºå·Šåæ åå³åæ çãäºäžäº€çäºåæ ç»æã
]
#note_block[
床䞺 2 çæ äžäžå®æ¯äºåæ ã
]
#block(breakable: false)[
#import fletcher.shapes: house, hexagon, ellipse
#let blob(pos, label, tint: white, ..args) = node(
pos,
align(center, label),
width: auto,
fill: tint.lighten(60%),
stroke: 1pt + tint.darken(20%),
corner-radius: 5pt,
shape: circle,
..args,
)
#set figure(supplement: none)
äºåæ çäºç§åœ¢æïŒ
#grid(
columns: (0.8fr, 0.8fr, 1fr, 1fr, 1fr),
)[
#figure($diameter$, caption: "空æ ")
][
#figure(diagram(blob((0, 0), "N")), caption: "åªå«æ ¹ç»ç¹")
][
#figure(diagram(blob((0, 0), "N"), edge(), blob((-0.5, 0.5), "L")), caption: "å³åæ 䞺空æ ")
][
#figure(diagram(blob((0, 0), "N"), edge(), blob((0.5, 0.5), "R")), caption: "å·Šåæ äžºç©ºæ ")
][
#figure(
diagram(blob((0, 0), "N"), edge(), blob((-0.5, 0.5), "L"), edge((0, 0), (0.5, 0.5)), blob((0.5, 0.5), "R")),
caption: "å·Šå³åæ åäžäžºç©º",
)
]
]
=== äºåæ çæ§èŽš
+ åšäºåæ ç第 $i$ å±äžè³å€æ $2^(i-1)$ 䞪ç»ç¹ïŒ$i >= 1$ïŒã
+ 深床䞺 $k$ çäºåæ è³å€æ $2^k - 1$ 䞪ç»ç¹ïŒ$k >= 1$ïŒã
+ 对任äœäžæ£µé空äºåæ ïŒè¥å¶åç»ç¹æ°äžº $n_0$ïŒåºŠäžº 2 çç»ç¹æ°äžº $n_2$ïŒå $n_0 = n_2 + 1$ã
+ å
·æ $n$ 䞪ç»ç¹çå®å
šäºåæ çæ·±åºŠäžº $floor(log_2n) + 1$ã#definition[
*满äºåæ *ïŒæ¯å±ç»ç¹éœèŸŸå°æå€§åŒçäºåæ ã
] #definition[
*å®å
šäºåæ *ïŒæ äžæå«ç $n$ 䞪ç»ç¹å满äºåæ äžçŒå·äžº $1$ è³ $n$ çç»ç¹äžäžå¯¹åºã
] #note_block[
å®å
šäºåæ äžäžå®æ¯æ»¡äºåæ ïŒäœæ¯æ»¡äºåæ äžå®æ¯å®å
šäºåæ ã
å€æäžæ£µæ æ¯åŠæ¯å®å
šäºåæ ïŒ
- 仿 ¹ç»ç¹åŒå§ïŒæå±åºçŒå·
- è¥æäžªç»ç¹æå³å©åèæ å·Šå©åïŒåäžæ¯å®å
šäºåæ
- è¥æäžªç»ç¹äžæ¯å·Šå³å©åéœæïŒåå
¶åçç»ç¹éœæ¯å¶åç»ç¹
]
+ äžæ£µæ $n$ 䞪ç»ç¹çå®å
šäºåæ ïŒæå±åºçŒå·ïŒå¯¹ä»»äžç»ç¹ $i$ æïŒ
- è¥ $i = 1$ïŒå $i$ æ¯æ ¹ïŒæ å亲ïŒåŠåå
¶åäº²æ¯ $floor(i/2)$ã
- è¥ $2i > n$ïŒå $i$ æ å·Šå©åïŒåŠåå·Šå©åæ¯ $2i$ã
- è¥ $2i + 1 > n$ïŒå $i$ æ å³å©åïŒåŠåå³å©åæ¯ $2i + 1$ã
== äºåæ çååšç»æ
=== 顺åºååšç»æ
ç®åæ¥è¯Žå°±æ¯çšæ°ç»ååšäºåæ çç»ç¹ïŒæç
§å®å
šäºåæ çç»æååšã
æ ¹èç¹ååšåšæ°ç»äžæ 䞺 0 çäœçœ®ïŒç¶åæ¯äžªç»ç¹çå·Šå©åååšåš $2i + 1$ çäœçœ®ïŒå³å©åååšåš $2i + 2$ çäœçœ®ïŒ$i$ 衚瀺该ç»ç¹åšæ°ç»äžçäžæ ãåæ ·çïŒåŠæç¥éäžäžªç»ç¹çäžæ ïŒå¯ä»¥éè¿ $floor((i-1)/2)$ æŸå°å
¶å亲ç»ç¹ã
=== éŸåŒååšç»æ
==== äºåéŸè¡š
ç»ç¹ç»æïŒ
#table(columns: ((5em, 4em, 5em)), rows: 2em, align: center + horizon, [lchild], [data], [rchild])
#figure(image("../assets/2024-06-25-16-13-50.png", width: 80%), caption: "äºåéŸè¡š")
==== äžåéŸè¡š
æ¯äºåéŸè¡šå€äºäžäžªæåå亲ç»ç¹çæéã
#table(columns: ((5em, 5em, 4em, 5em)), rows: 2em, align: center + horizon, [parent], [lchild], [data], [rchild])
#figure(image("../assets/2024-06-25-16-15-02.png", width: 80%), caption: "äžåéŸè¡š")
== äºåæ çéå
=== å
åºéå
å
è®¿é®æ ¹ç»ç¹ïŒç¶åäŸæ¬¡å
åºéåå·Šåæ åå³åæ ã
#note_block[
è¥äºåæ 䞺空æ ïŒå空æäœïŒåŠåïŒ
+ è®¿é®æ ¹ç»ç¹ïŒ
+ å
åºéåå·Šåæ ïŒïŒéåœïŒ
+ å
åºéåå³åæ ãïŒéåœïŒ
]
ééåœå®ç°ïŒ
```c
void PreOrder(Bitree T) {
Stack S;
InitStack(S);
Bitree p = T;
while (p || !StackEmpty(S)) {
if (p) {
visit(p->data);
Push(S, p);
p = p->Lchild;
} else {
Pop(S, p);
p = p->Rchild;
}
}
}
```
=== äžåºéå
å
äžåºéåå·Šåæ ïŒç¶åè®¿é®æ ¹ç»ç¹ïŒæåäžåºéåå³åæ ã
#note_block[
è¥äºåæ 䞺空æ ïŒå空æäœïŒåŠåïŒ
+ äžåºéåå·Šåæ ïŒïŒéåœïŒ
+ è®¿é®æ ¹ç»ç¹ïŒ
+ äžåºéåå³åæ ãïŒéåœïŒ
]
ééåœå®ç°ïŒ
```c
void InOrder(Bitree T) {
Stack S;
InitStack(S);
Bitree p = T;
while (p || !StackEmpty(S)) {
if (p) {
Push(S, p);
p = p->Lchild;
} else {
Pop(S, p);
visit(p->data);
p = p->Rchild;
}
}
}
```
=== ååºéå
å
ååºéåå·Šåæ ïŒç¶åååºéåå³åæ ïŒæåè®¿é®æ ¹ç»ç¹ã
#note_block[
è¥äºåæ 䞺空æ ïŒå空æäœïŒåŠåïŒ
+ ååºéåå·Šåæ ïŒïŒéåœïŒ
+ ååºéåå³åæ ïŒïŒéåœïŒ
+ è®¿é®æ ¹ç»ç¹ïŒ
]
ééåœå®ç°ïŒ
```c
void PostOrder(Bitree T) {
Stack S;
InitStack(S);
Bitree p = T;
Bitree r = NULL;
while (p || !StackEmpty(S)) {
if (p) {
Push(S, p);
p = p->Lchild;
} else {
GetTop(S, p);
if (p->Rchild && p->Rchild != r) {
p = p->Rchild;
} else {
Pop(S, p);
visit(p->data);
r = p;
p = NULL;
}
}
}
}
```
== 线玢äºåæ
ç»ç¹ç»æïŒ
#table(columns: (
(5em, 4em, 5em, 4em, 5em)
), rows: 2em, align: center + horizon, [lchild], [ltag], [data], [rtag], [rchild])
ltag å rtag çšæ¥æ è®°æ¯åŠäžºçº¿çŽ¢ïŒå³æåå驱ååç»§çæéãåŠæäžº 0ïŒå衚瀺æåå©åç»ç¹ïŒåŠæäžº 1ïŒå衚瀺æåå驱æåç»§ã
#image("../assets/Threaded_tree.svg", width: 37%)
== æ 忣®æ
=== å©åå
åŒè¡šç€ºæ³
#definition[
*å©åå
åŒè¡šç€ºæ³*ïŒä»¥äºåéŸè¡šäœäžºæ çååšç»æïŒç§°äžºå©åå
åŒè¡šç€ºæ³ã
]
ç»ç¹ç»æïŒ
#table(columns: ((5em, 5em, 5em)), rows: 2em, align: center + horizon, [firstchild], [data], [nextsibling])
#image("../assets/2024-06-25-16-37-45.png")
=== æ çéå
==== å
æ ¹éå
è¥æ äžç©ºïŒåå
è®¿é®æ ¹ç»ç¹ïŒç¶åäŸæ¬¡å
æ ¹éå忣µåæ ã
==== åæ ¹éå
è¥æ äžç©ºïŒåäŸæ¬¡åæ ¹éå忣µåæ ïŒç¶åè®¿é®æ ¹ç»ç¹ã
==== æå±æ¬¡éå
è¥æ äžç©ºïŒå仿 ç第äžå±ïŒæ ¹ç»ç¹ïŒåŒå§ïŒä»äžèäžãä»å·Šè³å³äŸæ¬¡è®¿é®åç»ç¹ã
==== åºçš
*æ±æ æ·±*ïŒ
```C
int TreeDepth(CSTree T) {
if (!T) return 0;
else {
h1 = TreeDepth(T->firstchild);
h2 = TreeDepth(T->nextsibling);
return (max(h1 + 1, h2));
}
}// TreeDepth
```
*èŸåºæææ ¹å°å¶åç»ç¹çè·¯åŸ*ïŒ
```C
void AllPath(Bitree T, Stack &S) {
/// èŸåºäºåæ äžä»æ ¹å°ææå¶åç»ç¹çè·¯åŸ
if (T) {
Push(S, T->data);
if (!T->Lchild && !T->Rchild) PrintStack(S);
else {
AllPath(T->Lchild, S);
AllPath(T->Rchild, S);
}
Pop(S);
}// if(T)
} // AllPath
```
*èŸåºæ£®æäžæææ ¹å°å¶åç»ç¹çè·¯åŸ*ïŒ
```C
void OutPath(Bitree T, Stack &S) {
// èŸåºæ£®æäžææä»æ ¹å°å¶çè·¯åŸ
while (!T) {
Push(S, T->data);
if (!T->firstchild) Printstack(s);
else
OutPath(T->firstchild, s);
Pop(S);
T = T->nextsibling;
}// while
} // OutPath
```
=== 森æçéå
æ çéååäºåæ çéåååšå¯¹åºå
³ç³»ïŒ
#table(
columns: (1fr, 1fr, 1fr),
rows: 2em,
align: center + horizon,
table.header([*æ *], [*森æ*], [*äºåæ *]),
[å
æ ¹éå], [å
åºéå], [å
åºéå],
[åæ ¹éå], [äžåºéå], [äžåºéå],
)
==== å
åºé忣®æ
è¥æ£®æäžç©ºïŒå坿äžè¿°è§åéåä¹ïŒ
+ è®¿é®æ£®æäžç¬¬äžæ£µæ çæ ¹ç»ç¹ïŒ
+ å
åºé忣®æäžç¬¬äžæ£µæ çåæ æ£®æïŒ
+ å
åºé忣®æäžïŒé€ç¬¬äžæ£µæ ä¹å€ïŒå
¶äœæ ææç森æã
å³äŸæ¬¡ä»å·Šè³å³å¯¹æ£®æäžçæ¯äžæ£µæ è¿è¡å
æ ¹éåã
==== äžåºé忣®æ
è¥æ£®æäžç©ºïŒå坿äžè¿°è§åéåä¹ïŒ
+ äžåºé忣®æäžç¬¬äžæ£µæ çåæ æ£®æïŒ
+ è®¿é®æ£®æäžç¬¬äžæ£µæ çæ ¹ç»ç¹ïŒ
+ äžåºé忣®æäžïŒé€ç¬¬äžæ£µæ ä¹å€ïŒå
¶äœæ ææç森æã
å³äŸæ¬¡ä»å·Šè³å³å¯¹æ£®æäžçæ¯äžæ£µæ è¿è¡*åæ ¹éå*ã
== åå€«æŒæ
#definition[
*垊æè·¯åŸé¿åºŠ*ïŒ*WPL*ïŒïŒè®Ÿ $T$ æ¯äžæ£µæ $n$ 䞪å¶åç»ç¹çäºåæ ïŒæ¯äžªå¶åç»ç¹ $w_i$ çæåŒäžº $w_i$ïŒä»æ ¹ç»ç¹å°æ¯äžªå¶åç»ç¹ $w_i$ çè·¯åŸé¿åºŠäžº $l_i$ïŒå $T$ ç垊æè·¯åŸé¿åºŠäžº $
"WPL"(T) = sum_(i=1)^(n) w_i times l_i
$
]
#definition[
*åå€«æŒæ *ïŒåžŠæè·¯åŸé¿åºŠæççäºåæ 称䞺åå€«æŒæ ãåç§°*æäŒäºåæ *ã
]
#note_block[æ ¹èç¹è·¯åŸé¿åºŠäžº 0ïŒå·Šåæ è·¯åŸé¿åºŠå 1ïŒå³åæ è·¯åŸé¿åºŠå 1ã]
*æå»º*åå€«æŒæ çç®æ³ïŒ
1. ä» $n$ 䞪æåŒ $w_1, w_2, dots, w_n$ çå¶åç»ç¹åºåïŒæé $n$ æ£µåªæäžäžªç»ç¹çäºåæ ã
2. åš $n$ 棵æ äžéåäž€æ£µæ ¹ç»ç¹çæåŒæå°çæ äœäžºå·Šå³åæ æé äžæ£µæ°çäºåæ ïŒäžæ°çäºåæ çæ ¹ç»ç¹çæåŒäžºå
¶å·Šå³åæ æ ¹ç»ç¹çæåŒä¹åã#note_block[
äœ¿çšæå°å å¯ä»¥å¿«éæŸå°æå°ç䞀䞪æ ã
]
3. ä» $n$ 棵æ äžå é€éåç䞀棵æ ïŒå¹¶å°æ°æé çäºåæ å å
¥å°æ£®æäžã
4. éå€ 2 å 3ïŒçŽå°æ£®æäžåªæäžæ£µæ 䞺æ¢ã
èå倫æŒçŒç å°±æ¯æ ¹æ®åå€«æŒæ çè·¯åŸæ¥çŒç ïŒè·¯åŸå·ŠèŸ¹äžº 0ïŒå³èŸ¹äžº 1ã
|
|
https://github.com/DawnEver/ieee-conference-typst-template | https://raw.githubusercontent.com/DawnEver/ieee-conference-typst-template/main/README.md | markdown | MIT License | # IEEE Conference [Typst](https://typst.app) Template
I am preparing for IEEE cofference these days. Frustrated with Latex, I choose Typst to rewrite my paper.
In fact, typst app provides built-in IEEE paper template and [ieee-typst-template](https://github.com/bsp0109/ieee-typst-template) gives a modified edition for author's requiements, but they are not enough.
Based on Word and Latex templates and format guidelines, I diy my Typst template.
## What is Typst
Typst is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use.
- [Typst Github](https://github.com/typst/typst)
- [Typst Homepage](https://typst.app)
## Features
- IEEE copyright on the first page.
- Top captions for tables.
- ...
## Preview
See the [main.pdf](main.pdf).

## Usage:
You can try it online ([Click Me](https://typst.app/project/rgsg7a58qn3fKa7jPhbl2U)) or run locally.I strongly recommand writing with VSCode.

## Contribute
Welcome to PRs.
|
https://github.com/SamK/typst-fonts-showcase | https://raw.githubusercontent.com/SamK/typst-fonts-showcase/master/template.typ | typst | // vim: tabstop=2 softtabstop=2 shiftwidth=2
#let template(title, pangram) = {
set page(numbering: "1/1")
set text(fallback: false)
let list-fonts() = {
let fonts = ()
let lines = read("fonts.txt").split("\n")
for this-line in lines {
let clean-line = this-line.trim()
if clean-line != "" {
fonts.push(clean-line)
}
}
fonts
}
let font-box(font_name) = {
heading(numbering: "1. ")[
#text(font: font_name, font_name)
#text(size: .8em, weight: "regular", [(#font_name)])
]
set text(font: font_name)
pangram
}
align(center, text(17pt, title))
let all-fonts = list-fonts()
[This document shows all the #all-fonts.len() fonts Typst found on your system.]
outline()
for this-font in all-fonts {
font-box(this-font)
}
}
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/km/0.1.0/lib.typ | typst | Apache License 2.0 | #let binary-digits(x, digit: 0) = {
let digits = range(digit).map(_ => 0)
while (x != 0) {
digits.insert(digit, calc.rem-euclid(x, 2))
x = calc.div-euclid(x, 2)
}
return digits.rev().slice(0, digit).rev()
}
#let gray-code(x) = x.bit-xor(x.bit-rshift(1))
#let karnaugh(labels, minterms, implicants: (),
show-zero: false, mode: "code") = {
let (X, Y) = range(2).map(i =>
if (type(labels.at(i)) == str) {
// Label extracted from character(s)
labels.at(i).clusters().map(x => eval(x, mode: "math"))
} else { labels.at(i) }
)
// Dimensions: 2^len
let row = calc.pow(2, X.len())
let column = calc.pow(2, Y.len())
let cell = (
width: 2.4em,
height: 2.4em,
)
let gray-codes(till, digit) = range(till).map(i => gray-code(i)).map(code =>
block(width: cell.width, height: cell.height, inset: cell.height / 9,
for digit in binary-digits(code, digit: digit) {
math.equation[#digit]
}
)
)
return table(
rows: row + 1,
columns: column + 1,
inset: 0em,
stroke: (x, y) =>
if (x == 0 or y == 0) { none } else { 1pt },
align: (x, y) => {
if (x == 0 and y != 0) { horizon + right }
else if (x != 0 and y == 0) { center + bottom }
else { horizon + center }
},
// Top-left label block
block(width: cell.width, height: cell.height, {
line(end: (100%, 100%))
let label = (
x: box(for x in Y { x }),
y: box(for y in X { y }),
)
context place(horizon + center,
dx: measure(label.x).width / 2, dy: -0.5em, label.x)
context place(horizon + center,
dx: -measure(label.y).width / 2, dy: 0.5em, label.y)
}),
// Horizontal gray code labels
..if mode == "code" { gray-codes(column, Y.len()) },
table.cell(x: 1, y: 1,
rowspan: row, colspan: column,
block(clip: true, {
table(
rows: row,
columns: column,
inset: 0em,
align: horizon + center,
stroke: 2pt / 3,
..range(row).map(i =>
range(column).map(j =>
block(width: cell.width, height: cell.height, {
let term = minterms.at(i).at(j)
if type(term) == int {
if term == 0 {
if show-zero { $0$ }
} else if term == 1 { $1$ }
else { math.ast.small }
} else { term }
})
)
).flatten()
)
while (implicants.len() > 0) {
let implicant = implicants.pop()
let (x, y, width, ..) = implicant
let height = if implicant.len() == 3 { width } else { implicant.at(3) }
place(
top + left,
dx: y * cell.width,
dy: x * cell.height,
rect(
fill: rgb("#0003"),
stroke: 2pt / 3,
width: cell.width * width,
height: cell.height * height,
outset: -cell.height / 9)
)
// No need to expand out-of-range rectanges from the expanded rectange
if (implicant.len() == 5 and not implicant.at(4)) { continue }
// Draw extra out-of-range rectange(s)
if x + height > row {
implicants.push((row - x - height, y, width, height, false))
if y + width > column {
implicants.push((row - x - height, column - y - width, width, height, false))
}
}
if y + width > column {
implicants.push((x, column - y - width, width, height, false))
}
}
})
),
..if mode == "code" { gray-codes(row, X.len()) },
)
}
|
https://github.com/jamesrswift/ionio-illustrate | https://raw.githubusercontent.com/jamesrswift/ionio-illustrate/main/dist/0.1.0/src/lib.typ | typst | MIT License | #import "@preview/cetz:0.1.2"
/// Returns an object representing mass spectrum content.
#let mass-spectrum(
data,
args: (:)
) = {
let prototype = (
// --------------------------------------------
// Public member data
// --------------------------------------------
data: data,
keys: (
mz: 0,
intensity: 1
),
size: (auto, 1),
range: (40, 400),
style: (:),
labels: (
x: [Mass-Charge Ratio],
y: [Relative Intensity (%)]
),
linestyle: (this, idx)=>{},
// --------------------------------------------
// "Private" member data
// --------------------------------------------
axes: (
x: none,
y: none
),
plot-extras: (this)=>{},
// --------------------------------------------
// Methods
// --------------------------------------------
display: (this) => {
cetz.canvas({
import cetz.draw: *
let (x,y) = (this.setup-axes)(this)
cetz.draw.group(ctz=>{
(this.setup-plot)(this, x, y)
cetz.axes.axis-viewport(this.size, x, y,{
(this.plot-extras)(this)
if this.data.len() > 0 {
for (i, row) in data.enumerate() {
let x = float(row.at(this.keys.mz))
let y = float(row.at(this.keys.intensity))
(this.display-single-peak)(this, x, x, y)
}
}
})
})
})
},
display-single-peak: (this, idx, mz, intensity) => {
if (mz > this.range.at(0) and mz < this.range.at(1) ){
cetz.draw.line(
(mz, 0),
(rel: (0,intensity)),
..(this.linestyle)(this, idx)
)
}
},
setup-plot: (this, x, y) => {
cetz.axes.scientific(
size: this.size,
left: y,
right: none,
bottom: x,
top: none,
frame: true,
label: (offset: 0.3),
tick: (length:-0.1)
)
},
setup-axes: (this) => {
this.axes.x = cetz.axes.axis(
min: this.range.at(0),
max: this.range.at(1),
label: this.labels.x,
)
this.axes.y = cetz.axes.axis(
min: 0,
max: 110,
label: this.labels.y,
ticks: (step: 20, minor-step: none)
)
return this.axes
},
get-intensity-at-mz: (this, mz) => {
return float(
(this.data).filter(
it=>float(it.at(this.keys.mz, default:0))==mz
).at(0).at(this.keys.intensity)
)
},
callout-above: (this, mz, content: none, y-offset: 1.3em) => {
if ( content == none ) { content = mz}
return cetz.draw.content(
anchor: "bottom",
(mz, (this.get-intensity-at-mz)(this, mz)), box(inset: 0.3em, [#content])
)
},
calipers: ( this,
start, end, // mass-charge ratios
height: none,
content: none,
stroke: gray + 0.7pt // Style
) => {
if (content == none){ content = [-#calc.abs(start - end)] }
// Determine height
let start_height = (this.get-intensity-at-mz)(this, start)
let end_height = (this.get-intensity-at-mz)(this, end)
if ( height == none ) { height = calc.max(start_height, end_height) + 5 }
let draw-arrow(x, y) = cetz.draw.line(
(x - 0.5, y + 2),(x + 0.5, y + 2),
stroke: stroke
)
// Draw
return {
// Start : horizontal arrow
draw-arrow(start, start_height)
draw-arrow(end, end_height)
cetz.draw.merge-path({
cetz.draw.line( (start, start_height + 2), (start, height) )
cetz.draw.line((start, height), (end, height))
cetz.draw.line((end, height),(end, end_height + 2))
}, stroke: stroke)
// Content
cetz.draw.content(
( (start + end) / 2, height),
anchor: "bottom",
box(inset: 0.3em, content)
)
}
},
title: (this, content, anchor: "top-left", ..args) => {
return cetz.draw.content(
anchor: anchor,
(this.range.at(0), 110),
box(inset: 0.5em, content),
..args
)
}
)
// Overrides
for (key, value) in args.pairs() {
prototype.insert(key, value)
}
// Asserts
assert(type(prototype.keys.mz) in (int, str))
assert(type(prototype.keys.intensity) in (int, str))
return prototype
}
#let MolecularIon(charge:none) = [M#super()[#charge+]] |
https://github.com/GYPpro/Java-coures-report | https://raw.githubusercontent.com/GYPpro/Java-coures-report/main/.VSCodeCounter/2023-12-15_05-15-05/details.md | markdown | # Details
Date : 2023-12-15 05:15:05
Directory d:\\Desktop\\Document\\Coding\\JAVA\\Rep\\Java-coures-report
Total : 52 files, 7709 codes, 180 comments, 1740 blanks, all 9629 lines
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [README.md](/README.md) | Markdown | 1 | 0 | 2 | 3 |
| [README.typ](/README.typ) | Typst | 179 | 2 | 39 | 220 |
| [Report/0.typ](/Report/0.typ) | Typst | 48 | 4 | 9 | 61 |
| [Report/1.typ](/Report/1.typ) | Typst | 84 | 2 | 23 | 109 |
| [Report/10.typ](/Report/10.typ) | Typst | 550 | 4 | 155 | 709 |
| [Report/11.typ](/Report/11.typ) | Typst | 1,068 | 17 | 150 | 1,235 |
| [Report/2.typ](/Report/2.typ) | Typst | 116 | 2 | 23 | 141 |
| [Report/3.typ](/Report/3.typ) | Typst | 306 | 2 | 49 | 357 |
| [Report/4.typ](/Report/4.typ) | Typst | 172 | 5 | 38 | 215 |
| [Report/5.typ](/Report/5.typ) | Typst | 133 | 2 | 39 | 174 |
| [Report/6.typ](/Report/6.typ) | Typst | 736 | 2 | 123 | 861 |
| [Report/7.typ](/Report/7.typ) | Typst | 210 | 13 | 45 | 268 |
| [Report/8.typ](/Report/8.typ) | Typst | 209 | 5 | 49 | 263 |
| [Report/9.typ](/Report/9.typ) | Typst | 384 | 3 | 82 | 469 |
| [Report/Javaè¯èš å®éªæ¥åæš¡æ¿ 2023-10-8-20231214155905.typ](/Report/Java%E8%AF%AD%E8%A8%80%20%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A%E6%A8%A1%E6%9D%BF%202023-10-8-20231214155905.typ) | Typst | 497 | 1 | 263 | 761 |
| [Report/æå°èŽ¹çšæå€§æµé®é¢-20231215032417.typ](/Report/%E6%9C%80%E5%B0%8F%E8%B4%B9%E7%94%A8%E6%9C%80%E5%A4%A7%E6%B5%81%E9%97%AE%E9%A2%98-20231215032417.typ) | Typst | 323 | 1 | 205 | 529 |
| [rubbish/myIO.java](/rubbish/myIO.java) | Java | 76 | 0 | 17 | 93 |
| [sis10/Test.java](/sis10/Test.java) | Java | 18 | 0 | 5 | 23 |
| [sis10/myLinearEntire.java](/sis10/myLinearEntire.java) | Java | 41 | 0 | 18 | 59 |
| [sis10/myLinearLib.java](/sis10/myLinearLib.java) | Java | 197 | 34 | 13 | 244 |
| [sis10/myLinearSpace.java](/sis10/myLinearSpace.java) | Java | 111 | 4 | 18 | 133 |
| [sis10/myMatrix.java](/sis10/myMatrix.java) | Java | 267 | 4 | 24 | 295 |
| [sis10/myPolynomial.java](/sis10/myPolynomial.java) | Java | 131 | 4 | 21 | 156 |
| [sis10/myRealNum.java](/sis10/myRealNum.java) | Java | 58 | 3 | 15 | 76 |
| [sis1/basicIO.java](/sis1/basicIO.java) | Java | 26 | 0 | 3 | 29 |
| [sis2/Test.java](/sis2/Test.java) | Java | 54 | 0 | 2 | 56 |
| [sis2/UIDmanager.java](/sis2/UIDmanager.java) | Java | 138 | 0 | 19 | 157 |
| [sis3/Test.java](/sis3/Test.java) | Java | 26 | 5 | 5 | 36 |
| [sis3/TrieTree.java](/sis3/TrieTree.java) | Java | 37 | 0 | 6 | 43 |
| [sis4/regularExp.java](/sis4/regularExp.java) | Java | 34 | 0 | 4 | 38 |
| [sis5/SchoolLib.java](/sis5/SchoolLib.java) | Java | 186 | 31 | 15 | 232 |
| [sis5/Student.java](/sis5/Student.java) | Java | 114 | 0 | 24 | 138 |
| [sis5/Test.java](/sis5/Test.java) | Java | 18 | 0 | 3 | 21 |
| [sis5/course.java](/sis5/course.java) | Java | 76 | 0 | 17 | 93 |
| [sis5/score.java](/sis5/score.java) | Java | 107 | 0 | 22 | 129 |
| [sis6/segTree.h](/sis6/segTree.h) | C++ | 102 | 12 | 10 | 124 |
| [sis7/Test.java](/sis7/Test.java) | Java | 24 | 5 | 5 | 34 |
| [sis7/segTree.java](/sis7/segTree.java) | Java | 100 | 3 | 14 | 117 |
| [sis8/maxFlow.java](/sis8/maxFlow.java) | Java | 96 | 0 | 13 | 109 |
| [sis8/minCost.java](/sis8/minCost.java) | Java | 139 | 0 | 19 | 158 |
| [sis8/solution.java](/sis8/solution.java) | Java | 26 | 1 | 3 | 30 |
| [sis9/Bed.java](/sis9/Bed.java) | Java | 13 | 0 | 4 | 17 |
| [sis9/City.java](/sis9/City.java) | Java | 21 | 0 | 7 | 28 |
| [sis9/Constants.java](/sis9/Constants.java) | Java | 10 | 0 | 4 | 14 |
| [sis9/Hospital.java](/sis9/Hospital.java) | Java | 49 | 0 | 19 | 68 |
| [sis9/Main.java](/sis9/Main.java) | Java | 32 | 0 | 6 | 38 |
| [sis9/MoveTarget.java](/sis9/MoveTarget.java) | Java | 28 | 0 | 9 | 37 |
| [sis9/MyPanel.java](/sis9/MyPanel.java) | Java | 78 | 2 | 15 | 95 |
| [sis9/Person.java](/sis9/Person.java) | Java | 145 | 0 | 36 | 181 |
| [sis9/PersonPool.java](/sis9/PersonPool.java) | Java | 38 | 0 | 9 | 47 |
| [sis9/Point.java](/sis9/Point.java) | Java | 21 | 0 | 7 | 28 |
| [test.java](/test.java) | Java | 56 | 7 | 15 | 78 |
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) |
|
https://github.com/protohaven/printed_materials | https://raw.githubusercontent.com/protohaven/printed_materials/main/meta-environments/env-protohaven_policy.typ | typst |
// Core colors and fonts for the design identity
#let accent_color = rgb("#6EC7E2")
#let warning_color = rgb("#900000")
#let light_grey = rgb(65%,65%,65%)
#let mid_grey = rgb(50%,50%,50%)
#let dark_grey = rgb(38%,38%,38%)
#let sans_font = ("Noto Sans")
#let serif_font = ("Noto Serif")
#let mono_font = ("Fira Mono")
/*
* Renders `content` with the module's text styling. This is useful for content
* that is outside of the `template` container but which should be visually consistent.
*/
#let apply-text-styles(content) = {
set text(
font: sans_font
)
set par(
leading: 0.8em,
)
show heading.where(level: 1): it => [
// #pagebreak(weak: true)
#set text(size: 20pt, font: sans_font, number-type: "lining", weight: "bold",)
#block(it.body)
]
show heading.where(level: 2): it => text(
size: 17pt,
font: sans_font,
number-type: "lining",
weight: "semibold",
{
v(0.6em)
it.body
}
)
show heading.where(level: 3): it => text(
size: 14pt,
font: sans_font,
number-type: "lining",
weight: "semibold",
it.body
)
show heading.where(level: 4): it => text(
size: 12pt,
font: sans_font,
number-type: "lining",
weight: "semibold",
it.body
)
show link: l => text(
font: mono_font,
size:10pt,
box(width:6.7in)[#l.body]
)
show figure: it => align(center)[
#set text(size: 9pt, font: sans_font)
#it.body
/*#it.supplement*/ #it.caption
]
content
}
#let policy_document(
title: "Policy Document",
authors: ("Someone","<NAME>"),
date: datetime.today(),
draft: false,
wrapper: apply-text-styles,
doc,
) = {
set page(
background: if draft {rotate(-44deg,
{text(160pt, fill: rgb("EEEEEE"), [*DRAFT*])
linebreak()
text(60pt, fill: rgb("EEEEEE"), date.display())}
)})
set document(title: title,
author: authors,
keywords: ("protohaven", "policy"),
date: date,
)
show outline.entry.where(
level: 1
): it => {
v(12pt, weak: true)
strong(it)
}
// Title page
set text(
font: sans_font,
)
align(center, image("../images/Protohaven-Logo-Horizontal-Color-959069212.png"))
v(1in)
stack(dir: ttb,
// text(weight: "bold", size: 18pt, mid_grey, smallcaps("Policy Document")),
// v(1.2em),
text(weight: "bold", size: 36pt, [#title]),
v(3em),
text(weight: "bold", size: 14pt, [Adoption Date: #date.display("[month repr:long] [day padding:none], [year]")]),
v(15em),
outline(depth: 2)
)
v(1fr)
rect(width: 100%, inset: 2em, align(center, "License Information"))
pagebreak()
// The rest of the content
set page(
margin: (top: 1in, left: 1in, bottom: 1in, right: 1in),
numbering: "1",
footer: [
#set text(9pt, style: "italic")
#h(1fr)
Protohaven Policy Document â #title â
#counter(page).display(
"1 of 1",
both: true,
)
],
)
counter(page).update(1)
wrapper(doc)
} |
|
https://github.com/Shedward/dnd-charbook | https://raw.githubusercontent.com/Shedward/dnd-charbook/main/dnd/game/game.typ | typst | #import "spells.typ": *
#import "character.typ": *
#import "abilities.typ": *
#import "proficiencies.typ": *
#import "biography.typ": *
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/raw-03.typ | typst | Other | // Lots of backticks inside.
````
```backticks```
````
|
https://github.com/Coekjan/parallel-programming-learning | https://raw.githubusercontent.com/Coekjan/parallel-programming-learning/master/ex-3/report.typ | typst | #import "../template.typ": *
#import "@preview/cetz:0.2.2" as cetz
#import "@preview/codelst:2.0.1" as codelst
#show: project.with(
title: "å¹¶è¡çšåºè®Ÿè®¡ç¬¬ 3 次äœäžïŒMPI çŒçšïŒ",
authors: (
(name: "å¶ç¯ä»", email: "<EMAIL>", affiliation: "ACT, SCSE"),
),
)
#let data = toml("data.toml")
#let lineref = codelst.lineref.with(supplement: "代ç è¡")
#let sourcecode = codelst.sourcecode.with(
label-regex: regex("//!\s*(line:[\w-]+)$"),
highlight-labels: true,
highlight-color: lime.lighten(50%),
)
#let batch-of(s) = {
let nodes = s.split("x").at(0)
let proc-per-node = s.split("x").at(1)
(int(nodes), int(proc-per-node))
}
#let data-time(raw-data) = raw-data.pairs().map(data => {
let (batch, time) = data
let (nodes, proc-per-node) = batch-of(batch)
((nodes, proc-per-node), time.sum() / time.len())
})
#let data-speedup(raw-data) = data-time(raw-data).map(data => {
let pivot = data-time(raw-data).at(0).at(1)
let (batch, time) = data
(batch, pivot / time)
})
#let data-table(raw-data) = table(
columns: (auto, 1fr, 1fr, 0.7fr, 0.7fr, 0.7fr),
align: horizon + center,
table.header(table.cell(rowspan: 2)[*è¿çšæ°é*], table.cell(colspan: 2)[*ååžæ
åµ*], table.cell(rowspan: 2, colspan: 3)[*è¿è¡æ¶éŽïŒåäœïŒç§ïŒ*], [*ç»ç¹æ°*], [*è¿çšæ°/ç»ç¹æ°*]),
..raw-data.pairs().enumerate().map(pair => {
let (index, pair) = pair
let (batch, data) = pair
let nodes = batch.split("x").at(0)
let proc-per-node = batch.split("x").at(1)
let num-proc = int(nodes) * int(proc-per-node)
if index == raw-data.keys().enumerate().find(pair => {
let (i, batch) = pair
let (nodes, proc-per-node) = batch-of(batch)
nodes * proc-per-node == num-proc
}).at(0) {
(
table.cell(rowspan: raw-data.keys().filter(batch => {
let (nodes, proc-per-node) = batch-of(batch)
nodes * proc-per-node == num-proc
}).len(), str(num-proc)),
nodes,
proc-per-node,
data.map(str)
)
} else {
(nodes, proc-per-node, data.map(str))
}
}).flatten()
)
#let data-chart(raw-data, width, height, time-max, speedup-max) = cetz.canvas({
let color(index) = {
let data = data-time(raw-data).at(index)
let (batch, _) = data
let (nodes, proc-per-node) = batch
let procs = calc.log(nodes * proc-per-node, base: 2)
(
fill: (red, orange, yellow, blue, green, purple, lime).at(int(procs)),
)
}
cetz.chart.columnchart(
size: (width, height),
data-time(raw-data).map(pair => {
let (batch, time) = pair
let (nodes, proc-per-node) = batch
(rotate(-30deg)[
#set text(size: 0.8em)
#nodes#sym.times#proc-per-node
], time)
}),
y-max: time-max,
x-label: [_ç»ç¹æ°é #sym.times æ¯ç»ç¹çè¿çšæ°é_],
y-label: [_å¹³åè¿è¡æ¶éŽïŒåäœïŒç§ïŒ_],
bar-style: color,
)
cetz.plot.plot(
size: (width, height),
axis-style: "scientific-auto",
plot-style: (fill: black),
x-tick-step: none,
x-min: 0,
x-max: data-time(raw-data).len() + 1,
y2-min: 1,
y2-max: speedup-max,
x-label: none,
y2-label: [_å 鿝_],
y2-unit: sym.times,
cetz.plot.add(
axes: ("x", "y2"),
data-speedup(raw-data).enumerate().map(pair => {
let (i, pair) = pair
let (_, speedup) = pair
(i + 1, speedup)
}),
),
)
})
= å®éªïŒç©éµä¹æ³
== å®éªå
å®¹äžæ¹æ³
äœ¿çš MPI çŒçšå®ç°ç©éµä¹æ³çå¹¶è¡å éïŒå¹¶åšäžåè¿çšæ°éãäžåç»ç¹æ°éäžè¿è¡å®éªïŒè®°åœè¿è¡æ¶éŽå¹¶è¿è¡åæã
- ç©éµå€§å°ïŒ8192 #sym.times 8192
- ç©éµååç®æ³ïŒç»å®ç©éµ $A$ äž $B$ïŒè®¡ç®å
¶ä¹ç§¯ $A B = C$ïŒéè¿å° $A$ æè¡ååæ¥è®¡ç®ïŒåŠ @equation:block-matrix æç€ºã
$
A B = mat(A_1; A_2; dots.v; A_n) B = mat(A_1 B; A_2 B; dots.v; A_n B) = C
$ <equation:block-matrix>
- è¿çšæ°éïŒ1 \~ 64
- ç»ç¹æ°éïŒ1 \~ 64
çšåºæé è¿çšäžæåŠäžèŠç¹ïŒ
+ è®¡ç® $A B$ æ¶ïŒå° $A$ æè¡ååèäžæ¯å° $B$ æåååïŒäœ¿åŸ MPI ååæ°æ®ïŒå°åè¿ç»ïŒæ¶æŽå æ¹äŸ¿ã
+ åŠ @code:script-code æç€ºïŒå©çšèæ¬ ```bash matmul.slurm.run``` æå®ç»ç¹æ°éäžæ¯äžªç»ç¹çè¿çšæ°éïŒåšæçæ Slurm äœäžèæ¬ïŒè¿è¡æ¶æå®åœ¢åŠ `SLURM_BATCH=AxB` çç¯å¢åéïŒå¯æå® MPI çšåºè¿è¡äº `A` 䞪ç»ç¹ãæ¯äžªç»ç¹ `B` 䞪è¿çšäžãäŸåŠ ```sh SLURM_BATCH=4x4 ./matmul.slurm.run ``` æå® MPI çšåºè¿è¡äº 4 䞪ç»ç¹ãæ¯äžªç»ç¹ 4 䞪è¿çšïŒå
± 16 䞪è¿çšäžã
+ äžºè®°åœæåºæ¶éŽïŒäœ¿çš POSIX ç ```c gettimeofday()``` åœæ°ïŒ
+ 䞺ç®èŠå°è®°åœç©éµä¹æ³ç»æïŒå粟床浮ç¹éµåïŒïŒäœ¿çš OpenSSL ç SHA1 ç®æ³è®¡ç®å
¶æçº¹ã
代ç åŠ @code:matmul-code æç€ºïŒå
¶äžïŒ
- #lineref(<line:mpi-init>)ã#lineref(<line:mpi-rank>)ã#lineref(<line:mpi-size>) äœ¿çš MPI è¿è¡äºåå§åãè·åè¿çšçŒå·ãè·åè¿çšæ°éçæäœïŒ
- #lineref(<line:mpi-bcast>) å° $B$ ç©éµå¹¿æå°ææè¿çšïŒ
- #lineref(<line:mpi-scatter-1>)ã#lineref(<line:mpi-scatter-2>)ã#lineref(<line:mpi-scatter-3>) å° $A$ ç©éµååååå°ææè¿çšïŒ
- #lineref(<line:mpi-gather-1>)ã#lineref(<line:mpi-gather-2>)ã#lineref(<line:mpi-gather-3>) å° $C$ ç©éµæ¶éå°è¿çš 0ïŒ
- #lineref(<line:mpi-finalize>) ç»æ MPIã
#figure(
sourcecode(
raw(read("matmul/matmul.c"), lang: "c"),
),
caption: "å¹¶è¡ç©éµä¹æ³ MPI å®ç°ä»£ç ",
) <code:matmul-code>
== å®éªè¿çš
åšåŠ @chapter:platform-info æè¿°çå®éªå¹³å°äžè¿è¡å®éªïŒåå«äœ¿çš 1 \~ 64 䞪è¿çšïŒååžåš 1 \~ 64 䞪ç»ç¹äžïŒè¿è¡ç©éµä¹æ³ïŒè®°åœè¿è¡æ¶éŽïŒæµå® 3 次åå¹³ååŒïŒåå§æ°æ®åŠ @table:matmul-raw-data æç€ºã
== å®éªç»æäžåæ
#let matmul-speedup-max = data-speedup(data.matmul).sorted(key: speedup => speedup.at(1)).last()
ç©éµä¹æ³å®éªæµå®çè¿è¡æ¶éŽåŠ @figure:matmul-chart äžçæ¡æ±æç€ºïŒçžåé¢è²è¡šç€ºçžåçæ»è¿çšæ°ïŒïŒå¹¶è¡å éæ¯åŠ @figure:matmul-chart äžçæçº¿æç€ºïŒå
¶äžæå€§å 鿝åšç»ç¹æ°äžº #matmul-speedup-max.at(0).at(0)ãæ¯ç»ç¹çè¿çšæ°äžº #matmul-speedup-max.at(0).at(1) æ¶ïŒæ»è¿çšæ°äžº #{matmul-speedup-max.at(0).at(0) * matmul-speedup-max.at(0).at(1)}ïŒèŸŸå°ïŒæå€§å éæ¯äžº #matmul-speedup-max.at(1)ã
#figure(
data-chart(data.matmul, 12, 8, 600, 60),
caption: "ç©éµä¹æ³è¿è¡æ¶éŽ",
) <figure:matmul-chart>
å¯è§éçè¿çšæ°éå¢å ïŒè¿è¡æ¶éŽéæžåå°ãå
·äœæ¥è¯ŽïŒ
+ éçæ»è¿çšæ°éïŒè¿è¡æ¶éŽéæžåå°ïŒå 鿝åç°äºçº¿æ§è§åŸãå 鿝æªåç°å®å
šçº¿æ§ïŒå¯èœæ¯å äžºå¹¶è¡æ¬èº«ååšéä¿¡åŒéã
+ æ»è¿çšæ°çžåæ¶ïŒè¿çšåšé矀äžçååžæ
åµïŒç»ç¹æ°éïŒå¯¹è¿è¡æ¶éŽæäžå®åœ±åïŒäŸåŠïŒ
- åœæ»è¿çšæ°äžº 16 æ¶ïŒå° 16 䞪è¿çšåæ£åš 16 䞪ç»ç¹äžçè¿è¡æ¶éŽèŸé¿ïŒåœæ»è¿çšæ°äžº 64 æ¶ïŒå° 64 䞪è¿çšåæ£åš 32 䞪ç»ç¹ïŒæ¯ç»ç¹ 2 䞪è¿çšïŒäžçè¿è¡æ¶éŽèŸé¿ãè¿å¯èœæ¯å 䞺è¿çšåšäžåç»ç¹éŽéä¿¡æ¶ïŒçœç»å»¶è¿èŸå€§ã
- åœæ»è¿çšæ°äžº 64 æ¶ïŒå° 64 䞪è¿çšåæ£åš 64 䞪ç»ç¹äžçè¿è¡æ¶éŽèŸçãè¿å¯èœæ¯å 䞺éçŸ€äžæç§ææç»æäœ¿åŸæåé
ç 64 䞪ç»ç¹äºèéä¿¡æçèŸé«ã
ç©éµä¹æ³å®éªäžçåå§æ°æ®åŠ @table:matmul-raw-data æç€ºã
#figure(
data-table(data.matmul),
caption: "ç©éµä¹æ³å®éªåå§æ°æ®",
) <table:matmul-raw-data>
= éæ³š
== çŒè¯äžè¿è¡
代ç äŸèµ MPIãOpenSSL åºïŒè¥æªå®è£
è¿äºåºïŒéæåšå®è£
ãåšåå€å¥œäŸèµåïŒå¯äœ¿çšä»¥äžåœä»€è¿è¡çŒè¯äžè¿è¡ïŒ
- çŒè¯ïŒ```sh make```ïŒ
- è¿è¡ïŒ```sh make run ```ïŒ
- å¯éè¿ç¯å¢åé ```SLURM_BATCH``` æå®ç»ç¹æ°éäžæ¯äžªç»ç¹çè¿çšæ°éïŒäŸåŠ ```sh SLURM_BATCH=4x4 make run``` æå® MPI çšåºè¿è¡äº 4 䞪ç»ç¹ãæ¯äžªç»ç¹ 4 䞪è¿çšïŒå
± 16 䞪è¿çšäžã
- è¿è¡ç»æåè¥æç€ºéè¯¯ïŒæ£æµå°æçº¹é误ïŒïŒå诎æè¿è¡ç»æäžæ£ç¡®ïŒè¯¥æ£æµæºå¶ç倧èŽé»èŸç± @code:makefile-fingerprint äžç Makefile 代ç ç»åºïŒ
#figure(
sourcecode(
```make
# The fingerprint of the result
FINGERPRINT := 00 11 22 33 44 55 66 77 88 99 99 88 77 66 55 44 33 22 11 00
# Run the program `app` and check the fingerprint
.PHONY: run
run:
exec 3>&1; stdbuf -o0 ./app | tee >(cat - >&3) | grep -q $(FINGERPRINT)
```
),
caption: "Makefile äžçæçº¹æ£æµä»£ç "
) <code:makefile-fingerprint>
- æž
çïŒ```sh make clean```ã
- å°çŒè¯äº§ç©ãSlurm èæ¬äº§ççèŸåºæä»¶å
šéšæž
é€ã
å
¶äž ```sh make run``` å®é
è°çšäº ```sh matmul.slurm.run``` èæ¬ïŒåŠ @code:script-code æç€ºã
#figure(
sourcecode(
raw(read("matmul/matmul.slurm.run"), lang: "bash"),
),
caption: "ç©éµä¹æ³è¿è¡èæ¬",
) <code:script-code>
== å®éªå¹³å°ä¿¡æ¯ <chapter:platform-info>
æ¬å®éªæå€å¹³å°äžºåèªæ ¡çº§è®¡ç®å¹³å°ïŒç³»ç»é
眮 260 䞪 CPU 计ç®èç¹ïŒæ¯äžªèç¹é
眮 2 é¢ Intel Golden 6240 ç³»åå€çåšïŒå
± 36 ç©çæ žïŒã384 GB å
åãææèç¹éè¿ 100Gb/s EDR Infiniband äºèç»æè®¡ç®åååšçœç»ãç³»ç»äœ¿çš Slurm äœäžºäœäžè°åºŠç³»ç»ã
|
|
https://github.com/ivaquero/typst-fasvg | https://raw.githubusercontent.com/ivaquero/typst-fasvg/main/README.md | markdown | MIT License | # Typst-FASVG


Offline [FontAwesome](https://fontawesome.com/) Binding for [Typst](https://typst.app/docs/).
## Usage
1. Download the fasvg latest desktop version from [FontAwesome Official Site](https://github.com/FortAwesome/Font-Awesome/releases), unzip it into your workspace folder, and rename it as `fasvg`.
2. Download the `fasvg.typ` file, and place it into your workspace folder as well.
3. Import it into your Typst file, and use it with `fa()` function like the following example
```typst
#import "fasvg": *
#fa("brand-amazon-pay")
```
You can also customize the icon like this
```typst
#import "fasvg": *
#fa(
"brand-amazon-pay",
baseline: 0.25em,
height: 1.0em,
width: 1.5em)
```
Checkup [manual](https://github.com/ivaquero/typst-fasvg/blob/main/manual.pdf) for more details.

## Changelog
### v0.1.0 (2023-08-28)
- update fasvg to v6.5.1
### v0.0.4 (2023-08-28)
- change naming pattern
### v0.0.3 (2023-08-16)
- update fasvg to v6.4.2
- change naming pattern
### v0.0.2 (2023-07-28)
- update structures
- enable customization
### v0.0.1 (2023-07-27)
- initial release
- add fasvg v6.4.0
|
https://github.com/Enter-tainer/typstyle | https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/typstfmt/82-non-converge-list.typ | typst | Apache License 2.0 | #let f(t) = t
We have next things:
- thing 1;
- thing 2;
- thing 3.
#f[Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri.]
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/block-01.typ | typst | Other | // Nothing evaluates to none.
#test({}, none)
// Let evaluates to none.
#test({ let v = 0 }, none)
// Evaluates to single expression.
#test({ "hello" }, "hello")
// Evaluates to string.
#test({ let x = "m"; x + "y" }, "my")
// Evaluated to int.
#test({
let x = 1
let y = 2
x + y
}, 3)
// String is joined with trailing none, evaluates to string.
#test({
type("")
none
}, "string")
|
https://github.com/pku-typst/meppp | https://raw.githubusercontent.com/pku-typst/meppp/main/lib.typ | typst | MIT License | #import ("table.typ"): meppp-tl-table
#import ("template.typ"): meppp-lab-report
#let pku-logo(..args) = image("pkulogo.png", ..args)
#let subfigure(
body,
caption: none,
numbering: "(a)",
inside: true,
dx: 10pt,
dy: 10pt,
boxargs: (fill: white, inset: 5pt),
alignment: top + left,
) = {
let lsa = counter("last-subfigure-at")
let sc = counter("subfigure-counter")
context if lsa.get() != counter(figure).get() {
sc.update((1,))
lsa.update(counter(figure).get())
} else {
sc.step()
}
let number = context sc.display(numbering)
body
if (inside) {
place(alignment, box([#number #caption], ..boxargs), dx: dx, dy: dy)
} else {
linebreak()
align(center, [#number #caption])
}
} |
https://github.com/dssgabriel/master-thesis | https://raw.githubusercontent.com/dssgabriel/master-thesis/main/src/chapters/5-bibliography.typ | typst | Apache License 2.0 | #show bibliography: set heading(numbering: "1.")
#bibliography("../references.bib", style: "ieee")
|
https://github.com/MatheSchool/typst-g-exam | https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/src/g-exam.typ | typst | MIT License | #import "@preview/oxifmt:0.2.0": strfmt
#import "./global.typ" : *
#import "./auxiliary.typ": *
#import "./g-question.typ": *
#import "./g-option.typ": *
#import "./g-solution.typ": *
#import "./g-clarification.typ": *
#import "./g-sugar.typ": *
/// Template for creating an exam.
///
/// - author: Infomation of author of exam.
/// - name (string, content): Name of author of exam.
/// - email (string): E-mail of author of exam.
/// - watermark (string): Watermark with information about the author of the document.
/// - school: Information of school.
/// - name (string, content): Name of the school or institution generating the exam.
/// - logo (none, content, bytes): Logo of the school or institution generating the exam.
/// - exam-info: Information of exam.
/// - academic-period (none, content, str): Academic period.
/// - academic-level (none, content, str): Academic level.
/// - academic-subject (none, content, str): Academic subname.
/// - number (none, content, str): Number of exam.
/// - content (none, content, str): Content of exam.
/// - model (none, content, str): Model of exam.
/// - date (none, auto, datetime): Date of generate document.
/// - keywords (string): Keywords of document.
/// - language (en, es, de, fr, pt, it, nl): Language of document. English, Spanish, German, French, Portuguese and Italian are defined.
/// - clarifications (string, content, array): Clarifications of exam. It will appear in a box on the first page.
/// - question-text-parameters: Parameter of text in question and subquestion. For example, it allows us to change the text size of the questions.
/// - show-student-data (none, true, false, "first-page", "all-pages", "odd-pages"): Show a box for the student to enter their details. It can appear on the first page, all pages or on all odd-numbered pages.
/// - show-grade-table: (bool): Show the grade table.
/// - decimal-separator: (".", ","): Indicate the decimal separation character.
/// - question-points-position: (none, left, right): Position of question points.
/// - show-solution: (true, false, "space", "spacex2", "spacex3"): Show the solutions.
/// - show-draft: (true, false): It shows a draft label in the background.
#let g-exam(
author: (
name: "",
email: none,
watermark: none
),
school: (
name: none,
logo: none,
),
exam-info: (
academic-period: none,
academic-level: none,
academic-subject: none,
number: none,
content: none,
model: none
),
language: "en",
localization: (
grade-table-queston: none,
grade-table-total: none,
grade-table-points: none,
grade-table-grade: none,
point: none,
points: none,
page: none,
page-counter-display: none,
family-name: none,
given-name: none,
group: none,
date: none,
draft-label: none,
),
date: auto,
keywords: none,
clarifications: none,
question-text-parameters: none,
show-student-data: "first-page",
// show-student-data: (
// given-name: true,
// family-name: true,
// group: true,
// date: true
// ),
show-grade-table: true,
decimal-separator: ".",
question-points-position: left,
show-solution: true,
show-draft: false,
body,
) = {
if type(show-student-data) != "dictionary" and type(show-student-data) != "array" {
assert(show-student-data in (none, true, false, "first-page", "all-pages", "odd-pages"),
message: "Invalid show studen data")
}
assert(question-points-position in (none, left, right),
message: "Invalid question point position")
assert(decimal-separator in (".", ","),
message: "Invalid decimal separator")
assert(show-solution in (true, false),
message: "Invalid show solution value")
assert(show-draft in (true, false),
message: "Invalid show draft value")
assert(date == none or date == auto or type(date) == "datetime",
message: "Date must be nono, auto or datetime."
)
set document(
title: __document-name(exam-info: exam-info).trim(" "),
author: author.name,
date: date
)
let margin-right = 2.5cm
if (question-points-position == right) {
margin-right = 3cm
}
set page(
margin: (top: 5cm, right:margin-right),
numbering: "1 / 1",
number-align: right,
header-ascent: 20%,
header: {
context{
let __page-number = counter(page).at(here()).first()
__show-header(
page-number: __page-number,
school: school,
exam-info: exam-info,
show-student-data: show-student-data)
}
},
background: {
__show-draft(draft-show: show-draft, draft-label:[draft])
},
footer: {
context {
line(length: 100%, stroke: 1pt + gray)
align(right)[
#counter(page).display(__g-localization.final().page-counter-display, both: true,
)
]
// grid(
// columns: (1fr, 1fr, 1fr),
// if type(school) == "dictionary" {
// align(left, school.at("name", default : none))
// },
// align(center)[#exam-info.academic-period],
// align(right)[
// Página
// #counter(page).display({
// "1 de 1"},
// both: true,
// )
// ]
// )
__show-watermark(author: author, school: school, exam-info: exam-info, question-points-position:question-points-position)
}
}
)
__read-localization(language: language, localization: localization)
__g-question-points-position-state.update(u => question-points-position)
__g-question-text-parameters-state.update(question-text-parameters)
set text(lang:language)
if show-grade-table == true {
context {
__g-grade-table-header(
decimal-separator: decimal-separator,
)
}
v(10pt)
}
__g-show-solution.update(show-solution)
__g-decimal-separator.update(decimal-separator)
set par(justify: true)
if clarifications != none {
__g-show_clarifications(clarifications: clarifications)
}
show: __sugar
body
[#hide[]<end-g-question-localization>]
[#hide[]<end-g-exam>]
}
|
https://github.com/DaAlbrecht/thesis-TEKO | https://raw.githubusercontent.com/DaAlbrecht/thesis-TEKO/main/content/Task_analysis.typ | typst | #import "@preview/tablex:0.0.5": tablex, cellx
#let appendix = figure.with(kind: "appendix", numbering: "A", supplement: [Appendix])
Here, we'll cover the initial context resulting from the assignment available @a_assignment
== Task description
Multiple customers of Integon rely upon RabbitMQ as their designated messaging
broker. Different systems write messages into a queue, the messages then need to be
processed by other systems. If for some reason a specific message should be
processed again, the owner of the processing system cannot retry
processing the message because the messages are not persistent, once consumed the message is gone. Said owner has to contact the owner of the sending
system and ask for a retransmission of the message. This is a time-consuming and
costly process. The goal of this thesis is to develop a microservice that allows
queueing messages again, without needing to contact the owner of the sending system.
The queuing should be possible via an API call.
=== Out of scope<Out_of_scope>
The goal is to also embed the microservice into already existing observability
systems to enable requeuing of messages via UI. This is beyond the scope of this
thesis and will be implemented in a follow-up project.
== Initial situation
The microservice needs to be developed from scratch. There is no existing
architecture or codebase to build upon.
|
|
https://github.com/Besthope-Official/backend | https://raw.githubusercontent.com/Besthope-Official/backend/master/24autumn/git-tutorial.typ | typst | #import "@preview/cuti:0.2.1": show-cn-fakebold
#import "@preview/cetz:0.2.2"
#show: show-cn-fakebold
#let title = [çæ¬æ§å¶ç³»ç» Git]
#let header = [å端éšåŒåææ¡£]
#set text(font: ("Source Han Serif SC"))
#set page(
header: [#set text(12pt); #align(right + horizon, header)],
background: image("images/backend_logo_opacity_0.25.png", fit: "cover", width: 30%),
numbering: "1",
number-align: right,
)
#show link: underline
// CONTENTS
#align(center, text(20pt)[
*#title*
])
== çæ¬æ§å¶ç³»ç»
*çæ¬æ§å¶ç³»ç»* (Version Control Systems, VCSs) æ¯äžç±»çšäºè¿œèžªæºä»£ç ïŒæå
¶ä»æä»¶ãæä»¶å€¹ïŒæ¹åšçå·¥å
·ã顟åæä¹ïŒè¿äºå·¥å
·å¯ä»¥åž®å©æä»¬ç®¡ç代ç çä¿®æ¹åå²ïŒäžä»
åŠæ€ïŒå®è¿å¯ä»¥æ¹äŸ¿å¢éåäœçŒç ã
äŸåŠïŒåšå®é
项ç®åŒåäžçäžäºåºæ¯ïŒ
- éèŠæ¥çåœåçæ¬åäžäžçæ¬ä¹éŽç*å·®åŒ*
- æŽç»èçïŒè¿äžªæä»¶çè¿äžè¡æ¯ä»ä¹æ¶å被çŒèŸçïŒæ¯è°äœåºçä¿®æ¹ïŒä¿®æ¹åå æ¯ä»ä¹ïŒ
- åœåçæ¬äžçº¿åºç°äž¥é bugïŒéèŠ*åé*å°äžäžçæ¬
- è¿éèŠç¥éïŒåšåªäžäžªçæ¬å¿«ç
§å¯ŒèŽäºåå
æµè¯å€±èŽ¥ïŒ
çæ¬æ§å¶æ¯é¡¹ç®ç®¡ççäžå€§å
³é®ãå®è·µäžïŒæä»¬äŒäœ¿çšæåžžçšççæ¬æ§å¶å·¥å
· *Git* æ¥ç®¡ç代ç ïŒå®æ¯äžäžª*ååžåŒçæ¬æ§å¶ç³»ç»*ïŒå®¢æ·ç«¯å¹¶äžåªæåææ°çæ¬çæä»¶å¿«ç
§ïŒèæ¯æä»£ç ä»åºå®æŽå°*å
é*äžæ¥ïŒå
æ¬å®æŽçåå²è®°åœã
#figure(image("images/dvcs.png", width: 50%), caption: "ååžåŒVCSçäžäžªäŒå¿æ¯ïŒå°±ç®äžå¿æå¡åšåçæ
éïŒäºåéœå¯ä»¥çšä»»äœäžäžªéååºæ¥çæ¬å°ä»åºæ¢å€æ°æ®åºåå²ã")
äœ å¯ä»¥æå®åäžåçè¿ç«¯ä»åºäº€äºïŒåšåäžäžªé¡¹ç®äžïŒåå«åäžåç人çžäºåäœãGit ç*忝*åèœé垞区倧ïŒå®æ¯æé线æ§çåŒåæµçšïŒå¹¶äžèœå€ææå°ç®¡çå Linux å
æ žè¿æ ·åºå€§ç项ç®ã
#figure(image("images/git-branch.svg", width: 50%))
æ»èèšä¹ïŒåè¥äœ å°æ¥çå·¥äœåè®¡ç®æºæ²ŸèŸ¹ïŒGit ç»å¯¹æ¯äœ 犻äžåŒçåŒåå·¥å
·ã
== Git çå®ç°
Git çå端å®ç°çžåœäŒé
ïŒèœç¶åšçè§£äžç¡®å®ååšäžå®çå€æåºŠãæä»¬äŒç®å讲解å®çåçïŒä»¥äŸ¿å€§å®¶èœå€çæ£äºè§£ Git ççžå
³æŠå¿µãåŠæäœ å¯¹è¿éšåäžæå
Žè¶£ïŒå¯ä»¥èœ¬è³äžäžå°èã
=== ææ ·è®°åœçæ¬å·®åŒ: è®°åœå¿«ç
§
#let graph(data, direction: "right", grow, node-color: gray, show-mark: true) = {
cetz.canvas(length: 1cm, {
import cetz.draw: *
set-style(content: (padding: .2),
fill: node-color.lighten(70%),
stroke: node-color.lighten(70%)
)
cetz.tree.tree(
data,
direction: direction,
spread: 2.5,
grow: grow,
draw-node: (node, ..) => {
circle((), radius: .55, stroke: none)
content((), node.content)
},
draw-edge: (from, to, ..) => {
let (a, b) = (from + ".center", to + ".center")
if show-mark {
line((a, .6, b), (b, .6, a), mark: (end: ">"))
} else {
line((a, .6, b), (b, .6, a))
}
},
name: "tree"
)
})
}
#let versions = ([ver 1], ([ver 2], ([ver 3], [ver 4])))
#let A-delta = ([A],([$Delta_1$],([$Delta_2$],([$Delta_3$],))))
#let B-delta = ([B], ([$Delta_1$],))
#let A-git = ([A], ([$A_1$], ([$A_2$], [$A_3$])))
#let B-git = ([B], ([B], ([B], [$B_1$])))
#figure(
grid(align: center, column-gutter: auto,
[#graph(versions, 2.5, node-color: red, show-mark: false) #graph(A-delta, 2.5) #graph(B-delta, 7.5)]
),
caption: [åºäº*å·®åŒ* (delta-based) ççæ¬æ§å¶])
Git äžååšæ¯äžªæä»¶äžåå§çæ¬çå·®åŒïŒåè®Ÿäœ çæ¹åšæ¯æ·»å äºäžè¡ææ¬ïŒå®å¹¶äžäŒè®°åœè¿è¡æ°å¢çææ¬ââå®åªååšæä»¶ç*å¿«ç
§*ïŒæ¯åœäœ æäº€æŽæ°æä¿å项ç®ç¶ææ¶ïŒå®åºæ¬äžå°±äŒå¯¹åœæ¶ç*å
šéšæä»¶*å建äžäžªå¿«ç
§ïŒå¯æ¬ïŒå¹¶ä¿åè¿äžªå¿«ç
§ç*玢åŒ*ã
#figure(
grid(align: center, column-gutter: auto,
[#graph(versions, 2.5, node-color: red) #graph(A-git, 2.5) #graph(B-git, 2.5)]
),
caption: "ååšéæ¶éŽæ¹åçå¿«ç
§")
#let snapshot = (
([ver 1],
[A], [B], ([ver 2],
([$A_1$]), [ver 3])
)
)
#let demo = cetz.canvas(length: 1cm, {
import cetz.draw: *
let node-color = gray
set-style(content: (padding: .2),
fill: node-color.lighten(70%),
stroke: node-color.lighten(70%)
)
cetz.tree.tree(
snapshot,
direction: "down",
spread: 2.5,
grow: 2.0,
draw-node: (node, ..) => {
circle((), radius: .55, stroke: none)
content((), node.content)
},
draw-edge: (from, to, ..) => {
let (a, b) = (from + ".center", to + ".center")
line((a, .6, b), (b, .6, a), mark: (end: ">"))
},
name: "tree"
)
let (a, b) = ("tree.0-2", "tree.0-1")
line(stroke: (paint: node-color.lighten(70%), dash: "dashed"), (a, .6, b), (b, .6, a), mark: (end: ">"))
})
ç»æ¯äžªçæ¬åå¿«ç
§æŸç¶åŸè空éŽïŒå¯¹æ€ïŒGit çäŒåæ¯ïŒåŠææä»¶æ²¡æä¿®æ¹ïŒå°±äžåéæ°ååšè¯¥æä»¶ïŒèæ¯åªä¿çäžäžª*æéïŒéŸæ¥ïŒ*ïŒæåä¹åååšçæä»¶ã
#figure(demo, caption: "ç±å¿«ç
§ææçåå²è®°åœïŒèœç¶çæ¬ 2 æå BïŒåŸäžåºç°äºç¯ç圢ç¶ïŒäœB没æå
¶å®åºèŸ¹ïŒäžäŒåºç°åŸªç¯ïŒä¹å æ€äžææç¯")
仿°æ®ç»æçè§åºŠæ¥çè¿ç§è®Ÿè®¡ïŒåå²è®°åœå°±æäºäžäžªç±å¿«ç
§ç»æçæåæ ç¯åŸãäžæ¬¡å¿«ç
§å°±æ¯äžæ£µ*æ *ïŒå
å«äºå
šéšçæä»¶ïŒæ¯äžæ¬¡å¿«ç
§æŽæ°ç*æäº€*(commit)å
å«äºäžé¢çæ ïŒéåžŠäºæäº€ä¿¡æ¯ãäœè
ãæ¶éŽæ³çå
æ°æ®ã
=== ææ ·ååšæä»¶: äžåéœæ¯å¯¹è±¡
æäœç³»ç»äžºæä»¬æœè±¡åº*æä»¶*çæŠå¿µïŒæä»¬éè¿æä»¶è·¯åŸæ¥å®äœæä»¶å
æ°æ®æåšçç£çäœçœ®ïŒåæ ¹æ®æä»¶çå
ä¿¡æ¯å®äœæä»¶åšç¡¬çäžçå
·äœäœçœ®ïŒæç»è®¿é®å°æä»¶çå
容ã
è Git æçç¬å±äºå®çæä»¶*å
容寻å*ç³»ç»ãå®å¹¶äžåºäºæä»¶è·¯åŸå¯»åïŒè·¯åŸäžåäœäžºè·åæä»¶å
容çé®ïŒèæä»¶*å
容æ¬èº«å°±æ¯è¿äžªé®*ã
Git å°é¡¹ç®ææåæ§æä»¶å
容ãæä»¶çç¶æéè¿SHA1ç®æ³è¿è¡*ååžå*ãå猩åäœäžº Blob 对象ååšåš `.git\objects` å
ãGit æ°æ®åºäžä¿åçä¿¡æ¯éœæ¯ä»¥æä»¶å
容çååžåŒæ¥çŽ¢åŒïŒææçæ°æ®åšååšåéœè®¡ç®æ ¡éªåïŒç¶åä»¥æ ¡éªåæ¥åŒçšã
æä»¬çšäžäžªå°äŸåæ¥äœç°ååžåçè¿çšïŒ
```py
>>> import hashlib
>>> data = 'hello git'
>>> content = f'blob {len(data)}\x00{data}'
'blob 9\x00hello git'
>>> hashlib.sha1(content.encode()).hexdigest()
'f09e9c379f5fe8f4ce718641c356df87906d87a6'
$ echo -n "hello git" | git hash-object --stdin
f09e9c379f5fe8f4ce718641c356df87906d87a6
```
对æä»¶åãç®åœçä¿¡æ¯çä¿çäŸèµäºå
åæå°ç*æ *ãååŠäœ çææ°æäº€äžæŽæ¹äºäžäžªæä»¶çæä»¶åïŒèæ²¡ææ¹åå®çå
容ïŒGit äžäŒæ·»å æ°ç Blob 对象ïŒèåªäŒæŽæ¹æ å¯¹è±¡äžæåè¿äžª Blob 对象çåç§°ã
æ ãæäº€ïŒä»¥åæ è®°ïŒè¿äºå
æ°æ®ä¹æ¯ Git 对象ïŒåæ ·äŒç»è¿ååžååæä»¶äžèµ·åå
¥ `objects` ç®åœäžãæ£å 䞺å®ä»¬å
±åç»§æ¿â对象âçç»äžæ¥å£ïŒå
³èè¿äºæŠå¿µåªéèŠæäŸååžçŽ¢åŒã
#figure(image("images/data-model-3.png", width: 85%), caption: [Git 对象暡å瀺äŸïŒç¬¬äžæ¬¡æäº€çå¿«ç
§æ·»å äº `bak/test.txt`ïŒå
容åæä»¶åå忬¡æäº€äžæ ·ãGit äžäŒæ·»å æ°ç Blob 对象ïŒåªé什å
¶åŒçšç¬¬äžæ¬¡æäº€çæ 对象å³å¯ã])
ç®æŽèå髿ç讟计ã
=== ææ ·è®Ÿçœ®åæ¯: åŒçš
ç°åšïŒææçå¿«ç
§éœå¯ä»¥éè¿å®ä»¬ç SHA-1 ååžåŒæ¥åŒçšïŒäžè¿æä»¬å¹¶äžéèŠè®°äœè¿äžäž²äž² 40 äœçåå
è¿å¶å笊ãGit æ¯æçååžïŒä¹æ¯æå¯¹ååžåŒå*å«å*(alias)ïŒ*æ è®°*(tag)å¿«ç
§å·ïŒ
```bash
$ git tag -a v0.1.0 4892c7dc -m 'version 0.1.0 released'
```
ä¹åæä»¬å°±å¯ä»¥çš `v0.1.0` æŽäŸ¿äºäººç±»è®°å¿ççŒå·æ¥åŒçšè¿äžªå¿«ç
§å·äºã
Git å
éšç»Žæ€*åŒçš*(reference)äœ¿åŸæäžé¡¹å«åå¯ä»¥æåææ°çæäº€ïŒåœåæåšäœçœ®äŒçšäžäžªç¹æ®ç `HEAD` çŽ¢åŒæ è®°ã
#figure(image("images/head-to-master.png", width: 65%), caption: [äŸåŠïŒ`master` åŒçšéåžžäŒæåäž»åæ¯çææ°äžæ¬¡æäº€ïŒæ€æ¶ `HEAD` åŒçšæå `master`ã])
å建*忝*å
¶å®å°±æ¯æ°å»ºäžäžªåŒçšïŒåæ¯åæ¢åªéèŠæ¹å `HEAD` æä»¶å
忝çæåïŒè忝åå¹¶ïŒmergeïŒåæ¯å建äžäžªæ°çæäº€å¯¹è±¡ïŒå
¶ç¶èç¹æåäž€äžªåæ¯çææ°æäº€ïŒç¶ååå¹¶äºè
çæä»¶ã
#figure(image("images/basic-merging-2.png"), caption: "忝åŒåçäžäžªåºæ¯ã䞺äºè§£å³åºç°ç bugïŒäœ åšäž»åæ¯ä¹äžæ°å»ºäºäžæ¡ iss53 忝ïŒåšä¿®æ£äºé®é¢#53åïŒäœ åšäž»åæ¯å°å
¶åå¹¶ã")
=== æ»ç»
TL;DR: Git 以*å¿«ç
§*ç圢åŒè®°åœçæ¬å·®åŒïŒå°èŠååšäºä»åºçæ°æ®æœè±¡äžº*对象*ïŒå
·äœæ¥è¯ŽïŒBlob ä¿åäºæä»¶å
容ïŒ*æ *ä¿åäºç®åœç»æåæä»¶åïŒ*æäº€*ä¿åäºäžæ¬¡å¿«ç
§çæäº€ä¿¡æ¯ãäœè
ãæ¶éŽæ³çå
æ°æ®ãå¯¹è±¡æ ¹æ®å
¶å
容ç*ååžåŒ*è¿è¡çŽ¢åŒãå
³èãåæ¶ïŒGit å
éšç»Žæ€*åŒçš*ïŒå
讞çšäžäžªæŽçšæ·å奜çå«åæ¥æåææ°çæäº€è®°åœïŒäœ¿åŸæä»¬å¯ä»¥è¿è¡åŒºå€§ç*忝*æäœãåšè¿ç§ç®æŽç讟计ä¹äžïŒGit çæäœå°±æ¯å¯¹äžäºâ对象âåâåŒçšâç*åŸæäœ*ã
== äœ¿çš Git
=== å®è£
äžé
眮
åœå Git çææ°çš³å®çæ¬äžº 2.47.0ãçš `git --version` æ¥çäœ çç³»ç»äžæ¯åŠå®è£
äº Gitã
- 对äºWindows çšæ·ïŒ#link("https://gitforwindows.org/")[äžèœœå°å]ãåŠææ æ³äžèœœïŒå°è¯ç§åŠäžçœæ#link("https://mirrors.tuna.tsinghua.edu.cn/github-release/git-for-windows/git/")[æž
åéå]ã#link("https://registry.npmmirror.com/binary.html?path=git-for-windows/")[é¿ééå]ïŒ
- å¯¹äº MacOS çšæ·ïŒGit éåžžæ¯ç³»ç»èªåžŠçå·¥å
·ïŒåŠææ²¡æå¯ä»¥å°è¯äžé¢è¿äžªåŸåœ¢åç Git #link("http://sourceforge.net/projects/git-osx-installer/")[å®è£
å·¥å
·]ïŒæè
å°è¯ `homebrew` å®è£
ïŒåŠä¹ äžè£
äžäžªå
管çå·¥å
·ïŒã
- å¯¹äº Linux çšæ·ïŒæ ¹æ®äœ ç³»ç»çåè¡çå®è£
å
管çåšå®è£
Gitã
- äŸåŠ Ubuntu/DebianïŒ`sudo apt-get install git`
æä»¬å¯¹ Windows å®è£
å
é¢å€åäžäºè¯ŽæïŒéåžžæ¥è¯Žæç
§é»è®€è®Ÿçœ®å®è£
Git å³å¯ïŒäœéèŠçšåŸ®æ³šæäžäºäžªæ§åç讟眮ïŒåŠæ¢è¡ç¬ŠãçŒèŸåšïŒãæä»¬å»ºè®®äœ åèè¿ç¯#link("https://blog.csdn.net/mukes/article/details/115693833")[æç« ]æ¥èŸ
å©äœ å³çã
å®è£
äº Git ä¹åïŒåš shell é䜿çšåŠäžåœä»€é
çœ®äœ ççšæ·ååé®ç®±ãåèè¿ç¯#link("https://git-scm.com/book/zh/v2/%e8%b5%b7%e6%ad%a5-%e5%88%9d%e6%ac%a1%e8%bf%90%e8%a1%8c-Git-%e5%89%8d%e7%9a%84%e9%85%8d%e7%bd%ae")[æç« ]:
```bash
git config --global user.name <name>
git config --global user.email <email-address>
```
=== Git æ¥å£
åšåŠä¹ Git æ¥å£ä¹åïŒæä»¬å
æ¥äºè§£äžäž Git æä»¶çç¶æïŒ
- *æªè·èžª*(Untracked)ïŒGit å°æªè·èžªçæä»¶ïŒå³è¿æ²¡æçº³å
¥çæ¬ç®¡ççæä»¶ã
- *已修æ¹*(Modified)ïŒä¿®æ¹äºæä»¶ïŒäœè¿æ²¡ä¿åå°æ°æ®åºäžã
- *å·²æå*(Staged/Added)ïŒå¯¹äžäžªå·²ä¿®æ¹æä»¶çåœåçæ¬åäºæ è®°ïŒäœ¿ä¹å
å«åšäžæ¬¡æäº€çå¿«ç
§äžã
- *å·²æäº€*(Committed)ïŒæ°æ®å·²ç»å®å
šå°ä¿ååšæ¬å°æ°æ®åºäžã
è¿äŒè®©æä»¬ç Git é¡¹ç®æ¥æäžäžªé¶æ®µïŒå·¥äœåºãæååºä»¥å Git ç®åœã
#figure(image("images/areas.png", width: 75%), caption: [åšäžæ¬¡æäº€äžïŒéäžæäº€çæä»¶äŒä»å·¥äœåºè®°åœå°æååºãæåç»ååžå¯¹è±¡ååæŸå° `.git` ç®åœäž])
åå»ºäžæ¬¡ `commit` çæµçšåŠäžïŒ
- åšå·¥äœåºäžä¿®æ¹æä»¶ã
- å°äœ æ³èŠäžæ¬¡æäº€çæŽæ¹éæ©æ§å°æåïŒè¿æ ·åªäŒå°æŽæ¹çéšåæ·»å å°æååºã(`git add`)
- æäº€æŽæ°ïŒæŸå°æååºçæä»¶ïŒå°å¿«ç
§æ°žä¹
æ§ååšå° Git ç®åœã(`git commit`)
䞺ä»ä¹èŠåŒå
¥æååºè¿äžªç䌌å€äœçæ¥éª€ïŒæ³è±¡äžäžïŒåœäœ åŒåäºäž€äžªç¬ç«çç¹æ§ïŒåžæå建䞀䞪ç¬ç«çæäº€ïŒè¿æ¶åå°±å¯ä»¥æéæ©å°è¿è¡æäº€ã
åŠå€äžäºåžžçšçåœä»€è¡æäœïŒ
- `git clone <repository>`: å
éè¿çšä»åºå°æ¬å°ãæäºèåžä¹åæ¬¢çš Git è¿çšä»åºæ¥ååžä»£ç äœäžã
- `git status`: æ¥çåœåä»åºçç¶æã
- `git push`: å°æ¬å°ä»åºçæŽæ°æšéå°è¿çšä»åºïŒåææ¯äœ å·²ç»å
³è奜äºè¿çšä»åºïŒãåœäœ ç IDE å åºç°çœç»åå æ æ³æšéæ¶å¯ä»¥å°è¯åšåœä»€è¡äžæšéã
- `git commit --amend`: çŒèŸåå²æäº€ç commit ä¿¡æ¯ã
- `git stash`: ææ¶ç§»é€å·¥äœç®åœäžçä¿®æ¹å
容ãè¿åšåæ¢åæ¯çæ¶ååŸæçšã
æä»¬æšè倧家é
读å¥ç¹å
åçŒåç#link("https://singularity-backend.gitbook.io/backend-online-doc/week1/vcs-git/interfaces")[åšçº¿ææ¡£]æ¥åŠä¹ æŽå€çæ¥å£ç¥è¯ã
=== IDE é䜿çšåŸåœ¢çé¢
åŠä¹ Git æäœçæå¥œæ¯éè¿åœä»€è¡ïŒè¿ä¹æ¯åŠä¹ åœä»€è¡ç奜æºäŒã
äœæä»¬åæ¶æšèäœ å»äºè§£ IDE ééæç Git 䜿çšïŒåšæ¥åžžå·¥äœäžïŒCLI å¹¶äžåžžçšãïŒé€äºæäºç¹å® GUI äžç®¡çšçåºæ¯ïŒ
#figure(image("images/ide.png", width: 65%), caption: [VSCode éçæºä»£ç 管ççé¢ïŒåšæäŸ Git çåŸåœ¢åç颿äœä»¥å€ïŒä¹æäŸäºå¯¹åæ¯çè¯å¥œå¯è§å])
#pagebreak()
== Git çå·¥äœæµ
ç±äº Git ç䜿çšéåžžçµæŽ»ïŒåšå®è·µåœäžè¡çäºåŸå€ç§äžåçå·¥äœæµçšïŒäžåç项ç®ãäžåçå¢éäŒæäžåçåäœæ¹åŒãäžé¢å°ä»ç»äžç§åšåç§å€§å°é¡¹ç®äžç»è¿æ»ç»åºæ¥çå·¥äœæµã
å¥ç¹çåŒåå¢éåèç乿¯è¿äžå¥æµçšã
=== è¿çš Git ä»åº
æä»¬æå°ïŒGit æ¯äžäžªååžåŒçæ¬æ§å¶ç³»ç»ïŒè¿æå³çæ¯äžªåŒåè
éœæäžä»œå®æŽçä»åºïŒç§°äžº*æ¬å°ä»åº*ãå®ç°åæ¥çæ¹åŒæ¯æ¥æäžäžªå¯é çäžå¿*è¿çšä»åº*ïŒäžäžª Git æå¡åšã
äžäºåžžçšç Git æå¡åšæïŒ
- GitHubïŒäžäžªåºäºGitçä»£ç æç®¡æå¡å¹³å°ïŒåæ¶ä¹æ¯éèŠçåŒæºç€Ÿåºã
- GitLabïŒç±»äŒŒGithubïŒäœäž»èŠé¢åäŒäžãç»ç»çå
éšäœ¿çšãä¹å¯ä»¥çšå®æ¹æäŸçéåéšçœ²ã
- GiteeïŒå
·æäžåœç¹è²çä»£ç æç®¡å¹³å°
å¥ç¹ç䞀䞪åŒåéšéšç®åäœ¿çš Github äœäžº #link("https://github.com/SingularityLab-SWUFE")[Git è¿çšä»åº]ã
=== ååžåŒåŒå
==== æºä»åº
åšé¡¹ç®çåŒå§ïŒé¡¹ç®çåèµ·è
æå»ºèµ·äžäžªé¡¹ç®çæåå§çä»åºïŒç§°äžº*æºä»åº*ãå®çç®çæ¯ïŒ
- æ±æ»åäžè¯¥é¡¹ç®çå䞪åŒåè
ç代ç
- åæŸè¶äºçš³å®åå¯ååžç代ç
==== åŒåè
ä»åº
æºä»åºå»ºç«ä»¥åïŒæ¯äžªåŒåè
éèŠåçäºæ
å°±æ¯ææºä»åºçâå€å¶âïŒåšå
¶åºç¡ä¹äž `fork`(åå)åŒåïŒäœäžºèªå·±æ¥åžžåŒåçä»åºã
æ¯äžªåŒåè
æ `fork` çä»åºæ¯å®å
šç¬ç«çïŒäºäžå¹²æ°ãèåšåŒåå·¥äœå®æä»¥åïŒåŒåè
å¯ä»¥åæºä»åºåé `Pull Request`(æšé请æ±)ïŒè¯·æ±ç®¡çåæèªå·±ç代ç åå¹¶å°æºä»åºäžã
#figure(image("images/pr.png", width: 75%), caption: [äžäžªåŒæºé¡¹ç® #link("https://github.com/Qexo/Qexo")[Qexo] ç PRïŒè®°åŸåš PR éæè¿°æž
æ¥èªå·±ç莡ç®])
==== éæä»£ç
åœç¶ïŒå€æ¡ PR å¯èœååšä»£ç å²çªïŒé¡¹ç®ç®¡çè
éŠå
éèŠå¯¹ä»£ç è¿è¡*代ç 审é
* (code review) è§£å³å²çªä»¥å€ïŒæä»¬è¿éèŠæ£éªéæå代ç çæ£ç¡®æ§ã*èªåšåæå»ºå·¥å
·*äŒæ ¹æ®æµçšèªåšçŒè¯æå»ºå®è£
åºçšïŒå¹¶æ§è¡*åå
æµè¯æ¡æ¶*çèªåšåæµè¯æ¥æ ¡éªæäº€çä¿®æ¹ã
äžäžªæçç项ç®éåžžå
å«å®å€ç*æç»éæåæç»äº€ä»* (CI/CD)ãå®éè¿èªåšåæµçšåå·¥å
·èªåšåž®å©é¡¹ç®ç®¡çè
æå»ºåºçšãæµè¯åºçšãéšçœ²åºçšã
äŸåŠïŒGithub Action éè¿ YAML æä»¶çé
眮å®ä¹å·¥äœæµçšä»¥æå»ºæ§è¡ CI/CD æµæ°Žçº¿ïŒå¹¶å¯ä»¥è§Šåäžåäºä»¶æ¶ïŒåŠ `push`ã`Pull Request`ïŒèªåšæ§è¡è¿äºå·¥äœæµçšã
åœäœ ç PR éè¿äº CI/CD çæµè¯ïŒä»¥åçžå
³ç code reviewïŒé¡¹ç®ç®¡çè
å°±å¯ä»¥éçšåŠ squash-merge çæ¹åŒå°äœ ç代ç åå¹¶å°äž»åæ¯ã
=== åæ¯ç®¡ç
ç§°åæ¯ç®¡çæ¯ Git ççµéä¹äžäžºè¿ãäžé¢æä»¬æå°äº Git ååžåŒåŒåçåºæ¬æµçšïŒäžºäºæŽå¥œå°å©çš CI/CD å·¥äœæµïŒé¡¹ç®å¢ééåžžå¯¹åæ¯çåœååæéç管çæçäžå®çè§å®ïŒäžé¢å°±ä»ç»äžç§æ¯èŸæ®ééçšçåæ¯æš¡åïŒåšè¿ç§æš¡åäžïŒåæ¯æäž€ç±»ïŒäºç§ïŒ
==== æ°žä¹
æ§åæ¯
- `main`: äž»åæ¯ïŒå®çšäºåæŸç»è¿æµè¯ïŒå·²ç»å®å
šçš³å®ç代ç ïŒåšé¡¹ç®åŒå以åçä»»äœæ¶å»åœäžïŒäž»åæ¯åæŸç代ç åºè¯¥æ¯å¯äœäžºäº§åäŸçšæ·äœ¿çšç代ç ã
- `develop`: åŒå忝ïŒå®çšäºåŒåè
åæŸåºæ¬çš³å®ä»£ç ã
#figure(image("images/main-dev.png", width: 50%), caption: [ææåŒåè
åŒå奜çåèœäŒåšæºä»åºç `develop` 忝äžè¿è¡æ±æ»ïŒç»æµè¯çš³å®åæååå¹¶å° `main` 忝ãè¿å°±æ¯äžäžªäº§åäžæå®ååååžè¿çšã])
*æç€º*ïŒåæ¯ä¿æ€åŸéèŠïŒäžèŠäžºäºåŸäžæ¶çäºäžå»ºç«åŒå忝æéæåå¹¶è³äž»åæ¯ïŒ
==== äžŽæ¶æ§åæ¯
äžŽæ¶æ§åæ¯ç±»äŒŒäºåŒå忝çäžäžªçŒå²åºãåšåŒå宿¯ãåå¹¶åïŒè¿äºäžŽæ¶æ§åæ¯äŒåŸå°å é€ãéåžžæ¥è¯ŽïŒå䞪åŒåè
äŒåš `develop` 忝äžç»§ç»åååºç¹æ§åæ¯ `feature-*`ïŒäŸåŠ `feature-OAuth` 衚瀺å®ç° OAuth ç»åœåèœçç¹æ§åæ¯ã
åŠå€äž€äžªäžŽæ¶åæ¯åšæŽå€§è§æš¡çå¢éåŒåäžäŒè¿çšå°ïŒ
- `release`: é¢ååžåæ¯ïŒåœäº§åå³å°ååžçæ¶åïŒèŠè¿è¡æåçè°æŽåæµè¯ïŒå°±å¯ä»¥åŒåºé¢ååžåæ¯
- `hotfix`: ä¿®å€ bug 忝ïŒåšäº§åäžçº¿ä¹åååžçè¡¥äžè¿è¡çާæ¥ç bug ä¿®å€å·¥äœïŒéåžžæ¥è¯Žç»è¿æµè¯åäŒåå¹¶å `main` 忝ã
#figure(image("images/[email protected]", width: 85%), caption: [æ¯èŸæ åç倧å项ç®ç Git åæ¯æš¡åãåšè¿ç§è§èäžïŒåå²è®°åœçèµ·æ¥åŸå€æäœæ¯çžåœæž
æ¥ã])
=== æäº€æ¶æ¯è§è
坹忝è§èåïŒæä»¬è¿äŒå¯¹æäº€æ¶æ¯è¿è¡è§èïŒäž»èŠçåå æ¯ïŒ
- å©çšå·¥å
·æ¥èªåšåçæ CHANGELOGïŒäŸåŠ `cz-conventional-changelog` å·¥å
·
- ç»äžæäº€æ¶æ¯æ ŒåŒïŒäžå¿
çº ç»å°åºè¯¥æä¹åæäº€æ¶æ¯
- æ¹äŸ¿é¡¹ç®æŽå¥œè®Ÿè®¡ CI/CD æµçš
#figure(image("images/changelog.png", width: 65%), caption: [äžäžªå¥œçåŒæºèœ¯ä»¶éœäŒåšæ¯äžªçæ¬å·å¯¹æäº€æè
PR è®°åœæ¹åšæ¥è®°ïŒäŸåŠ VSCode])
æä»¬çåèæ¯ #link("https://www.conventionalcommits.org/zh-hans/v1.0.0/")[纊å®åŒæäº€è§è]ãå
·äœæ¥è¯ŽïŒåŠæéçš eslint æ ŒåŒçæ ŒåŒè§èïŒ
- æ¯äžªæäº€éœ*å¿
é¡»*䜿çšç±»ååæ®µåçŒïŒåŠ `fix`, åæ¶å äžä»¥åå¿
èŠçåå·ïŒè±æåè§ïŒåç©ºæ Œ.
- åœäžäžªæäº€äžºåºçšæç±»åºå®ç°äºæ°åèœæ¶ïŒäœ¿çš `feat` ç±»åïŒäžºåºçšä¿®å€äº bug æ¶ïŒäœ¿çš `fix` ç±»åã
- ç±»ååæ®µ*å¯ä»¥*æå®èåŽïŒäŸåŠ `fix(api)` æææ¯å¯¹æ¥å£ä»£ç çä¿®å€ãåœç¶äœ ä¹å¯ä»¥äžåžŠ.
- æ¯äžªæäº€*å¿
é¡»*èŠæå¯¹æäº€çæè¿°ïŒå¯¹ä»£ç åæŽçç®çæ»ç»ãå¯ä»¥äœ¿çšäžæã
- åšç±»ååæ·»å æå¹å·ïŒè¡šæè¿æ¯äžäžª*ç Žåæ§åæŽ*(Breaking Change)ãå³ïŒå¯¹ç°æåèœææ¥å£è¿è¡çä¿®æ¹ãåŠæäœ æ¹äºæ¥å£çæäžäžªå段ïŒå¯ŒèŽæ æ³å
Œå®¹æ§çæ¬ïŒé£ä¹å°±éèŠå äžæå¹å·ã
æŽå€è§åè§äžæ¹ç»åºçææ¡£ã以äžå æ¡äœäžºæä»¬çåŒåè§èå°±å€çšäºã
==== 瀺äŸ
- `feat!: send an email to the customer when a product is shipped`
- `docs: correct spelling of CHANGELOG`
- `feat(lang): add polish language`
- `feat:` ç»åœçžå
³æ¥å£
æšè倧家å»é
读æ£åŒäžäºçåŒæºé¡¹ç®æ¥äºè§£æäº€è§èãäŸåŠïŒæç项ç®äŒèŠæ±åš PR éæåºçžå
³ç issue çŒå·ïŒççã
==== çžå
³å·¥å
·
äœ å¯ä»¥åšç»ç«¯éäœ¿çš #link("https://cz-git.qbb.sh/zh/")[commitizen]ïŒ#link("https://commitlint.js.org/")[commitlint] è¿äºå·¥å
·ç廿æ²åçŒç麻çŠã
#pagebreak()
== åèèµæ
è¿ç¯ææ¡£äž»èŠåèçæ¯ #link("https://git-scm.com/book/zh/v2")[Pro Git]ã讞å€é
åŸä»¥åå
å®¹éœæ¥èªè¿æ¬ä¹ŠïŒåŒºçæšèèªå·±äº²èªè¯»äžéåäºç« ïŒ
#link("https://singularity-backend.gitbook.io/backend-online-doc/week1/vcs-git")[å¥ç¹å·¥äœå®€ææè®ç»è¥åç«¯ææ¡£]ïŒè¿æ¯å¥ç¹åš 23 幎æååŒå±çææè®ç»è¥ïŒè¿ç¯ææ¡£ä¹æ¯åšçº¿ææ¡£çäžæ¬¡é眮翻æ°ââäž»èŠæ¯å¯¹åçéšåè¿è¡äºéåïŒå 䞺åçç¡®å®æäºäžé£ä¹å®¹æçè§£ïŒãåŠæäœ å¯¹å
¶å®éšåæå
Žè¶£ïŒæ¬¢è¿é
è¯»ææ¡£ïŒ
#link("https://missing-semester-cn.github.io/2020/version-control/")[MIT CSæè²çŒºå€±çäžè¯Ÿ: çæ¬æ§å¶(Git)]: æŽäžª Missing-semester 诟çšéœæšè倧家åŠä¹ , é垞奜çäžéšè¯Ÿ, åŠä¹ å°åŸå€å¥œçšçå·¥å
·, é€äºæå®œè§éæŽèœåž®å©äœ åšæªæ¥çèäžç涯äžèçæ¶éŽ.
#link("https://learngitbranching.js.org/")[Learn Git Branching] éè¿åºäºæµè§åšçæžžææ¥åŠä¹ Git.
#link("https://nvie.com/posts/a-successful-git-branching-model/")[A successful Git branching model]ïŒæå
³åæ¯å·¥äœæµçæç« ïŒæç« çåŸ 13 æ¥èªäºæ€ã
|
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/signature/import.typ | typst | Apache License 2.0 | // path: base.typ
#let f(u, v) = u + v;
-----
#import "base.typ": *
#(/* ident after */ f);
|
https://github.com/ohmycloud/computer-science-notes | https://raw.githubusercontent.com/ohmycloud/computer-science-notes/main/Misc/machine_learning_item.typ | typst | = æ¯è¯
亀åéªè¯æå : cross-validation folds
èªå·±å®ç°äº€åéªè¯:
```python
from sklearn.model_selection import StratifiedKFold
from sklearn.base import clone
skfolds = StratifiedKFold(n_splits=3) # add shuffle=True if the dataset is
# not already shuffled
for train_index, test_index in skfolds.split(X_train, y_train_5):
clone_clf = clone(sgd_clf)
X_train_folds = X_train[train_index]
y_train_folds = y_train_5[train_index]
X_test_fold = X_train[test_index]
y_test_fold = y_train_5[test_index]
clone_clf.fit(X_train_folds, y_train_folds)
y_pred = clone_clf.predict(X_test_fold)
n_correct = sum(y_pred == y_test_fold)
print(n_correct / len(y_pred))
```
StratifiedFold ç±»æ§è¡å屿œæ ·ãæ¯æ¬¡è¿ä»£éœå建äžäžªåç±»åšçå
é, åšè®ç»æå äžè®ç»å
é, åšæµè¯æå äžå颿µã
ç¶åå®è®¡ç®æ£ç¡®é¢æµçæ°éå¹¶èŸåºæ£ç¡®é¢æµçæ¯çã
äºå
åç±»åš: binary classifier
åªèœåºå䞀䞪类å«, èŠä¹æ¯æäžªç±»å«ïŒèŠä¹äžæ¯ã
éæºæ¢¯åºŠäžé: stochastic gradient descent(SGD æ stochastic GD)
è®ç»é: training set
æµè¯é: test set
åŸææ°æ®é: skewed datasets
æ¯åŠ, æäºç±»åçåŸçæ¯å
¶å®ç±»åçåŸçåºç°åŸé¢çæŽé«ã
æ··æ·ç©éµ: confusion matrix(CM)
çšäºè¯äŒ°åç±»åšæ§èœçäžç§æŽå¥œçæ¹åŒã
æ··æ·ç©éµçäžè¬ææ³æ¯å¯¹äºææ A/B 对å¿ïŒè®¡ç® A ç±»å®äŸè¢«å类䞺 B ç±»çæ¬¡æ°ã
äŸåŠïŒèŠç¥éåç±»åšæ··æ·åŸå 8 å åŸå 0 çæ¬¡æ°ïŒäœ å¯ä»¥æ¥çæ··æ·ç©éµç第8è¡ç¬¬0åã
èŠè®¡ç®æ··æ·ç©éµïŒäœ éŠå
èŠæäžç»é¢æµåŒïŒè¿ç»é¢æµåŒäŒåå®é
ç®æ è¿è¡æ¯èŸã
äœ å¯ä»¥å¯¹æµè¯éè¿è¡é¢æµïŒäœæ¯ç°åšæå¥œäžèŠç¢°æµè¯é(åšè®ç»éäžè®ç»å®åç±»åšä¹å, åäœ¿çšæµè¯éæ£æµè®ç»çææ)ã
çžåïŒäœ å¯ä»¥äœ¿çš *cross_val_predict()* åœæ°ïŒ
```python
from sklearn.model_selection import cross_val_predict
y_train_pred = cross_val_predict(sgd_clf, X_train, y_train_5, cv=3)
```
ç°åšå¯ä»¥äœ¿çšconfusion_matrix()åœæ°è·åŸæ··æ·ç©éµäºãåªéå°ç®æ ç±»(y_train_5)å颿µç±»äŒ éç»å®
(y_train_pred):
å°±å *cross_val_score()* åœæ°äžæ ·ïŒ*cross_val_predict()* æ§è¡ _k_-fold 亀åéªè¯ïŒäœå®äžæ¯è¿åè¯äŒ°åæ°ïŒèæ¯è¿å对æ¯äžªæµè¯æå (test fold)æåç颿µã
è¿æå³ç对äºè®ç»é(training set)äžçæ¯äžªå®äŸ, äœ åŸå°äžäžªâå¹²åçâ颿µ(è¿éçâå¹²åâæ¯æâæ ·æ¬å€âïŒæš¡å对è®ç»æéŽä»æªè§è¿çæ°æ®è¿è¡é¢æµ)ã
ç°åšå¯ä»¥äœ¿çš *confusion_matrix()* åœæ°è·åŸæ··æ·ç©éµäºãåªéèŠæç®æ ç±»(y_train_5) å颿µç±»(y_train_pred)äŒ éç»å®ïŒ
```python
from sklearn.metrics import confusion_matrix
cm = confusion_matrix(y_train_5, y_train_pred)
# array([[53892, 687],
# [ 1891, 3530]])
```
æ··æ·ç©éµäžçæ¯äžè¡ä»£è¡šäžäžªå®é
çç±»ïŒèæ¯äžå代衚äžäžªé¢æµçç±»ã该ç©éµç第äžè¡èèé5çåŸå(éŽæ§ç±»)ïŒå
¶äž53892䞪åŸå被æ£ç¡®å类䞺é5(称䞺çéŽæ§)ïŒèå
¶äœ687䞪åŸå被é误å类䞺5(å鳿§ïŒä¹ç§°äžºIç±»é误)ã第äºè¡èè5sçåŸå(æ£ç±»):
1891äŸè¢«é误å°åœç±»äžºé5(åéŽæ§ïŒä¹ç§°äžºIIåé误)ïŒèå
¶äœ3530äŸè¢«æ£ç¡®åœç±»äžº5(ç鳿§)ã
äžäžªå®çŸçåç±»åšåªäŒæçæ£åçèŽïŒæä»¥å®çæ··æ·ç©éµåªäŒåšäž»å¯¹è§çº¿äž(ä»å·Šäžå°å³äž)æéé¶åŒïŒ
```python
y_train_perfect_predictions = y_train_5 # pretend we reached perfection
confusion_matrix(y_train_5, y_train_perfect_predictions)
```
åç±»åšç粟确床:(the accuracy of the positive predictions)
$"precision" = "TP" /("TP" + "FP")$
TP 䞺ç鳿§æ°ïŒFP 䞺å鳿§æ°ã
èŠæ³è·åŸå®çŸç粟床ïŒäžäžªç®åçæ¹æ³å°±æ¯å建äžäžªåç±»åšïŒé€äºå¯¹å®ææä¿¡å¿çå®äŸè¿è¡äžæ¬¡æ£å颿µå€ïŒå®æ»æ¯è¿è¡èŽå颿µãåŠæè¿äžäžªé¢æµæ¯æ£ç¡®çïŒé£ä¹åç±»åšçç²ŸåºŠå°±æ¯ 100%ïŒç²ŸåºŠ = 1/1 = 100%ïŒãæŸç¶ïŒè¿æ ·çåç±»åšçšå€äžå€§ïŒå 䞺å®äŒå¿œç¥é€äºäžäžªæ£åå®äŸä¹å€çææå®äŸãå æ€ïŒç²ŸåºŠéåžžäžåŠäžäžªå䞺å¬åç(recall)çææ äžèµ·äœ¿çšïŒå¬åçä¹ç§°äžºçµæåºŠæç鳿§çïŒTPRïŒïŒè¿æ¯åç±»åšæ£ç¡®æ£æµå°ç鳿§å®äŸçæ¯çïŒ
$ "recall" = "TP" / ("TP" + "FN")$
åœç¶ïŒFN æ¯åéŽæ§çæ°éã
粟床åå¬åç
```python
from sklearn.metrics import precision_score, recall_score
precision_score(y_train_5, y_train_pred)
recall_score(y_train_5, y_train_pred)
```
$F_1$ score
$ F_1 = 2 / (1/"precision" + 1/"recall" )
= 2 Ã ("precision" Ã "recall") / ("precision" + "recall")
= "TP" / ("TP" + ("FN" + "FP") / 2 )
$
èŠè®¡ç® $F_1$ çåŒïŒåªéèŠè°çš *f1_score()* åœæ°ïŒ
```python
from sklearn.metrics import f1_score
f1_score(y_train_5, y_train_pred)
```
|
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/167.%20aord.html.typ | typst | aord.html
Default Alive or Default Dead?
October 2015When I talk to a startup that's been operating for more than 8 or
9 months, the first thing I want to know is almost always the same.
Assuming their expenses remain constant and their revenue growth
is what it has been over the last several months, do they make it to
profitability on the money they have left? Or to put it more
dramatically, by default do they live or die?The startling thing is how often the founders themselves don't know.
Half the founders I talk to don't know whether they're default alive
or default dead.If you're among that number, <NAME> has made a handy
calculator you can use to find out.The reason I want to know first whether a startup is default alive
or default dead is that the rest of the conversation depends on the
answer. If the company is default alive, we can talk about ambitious
new things they could do. If it's default dead, we probably need
to talk about how to save it. We know the current trajectory ends
badly. How can they get off that trajectory?Why do so few founders know whether they're default alive or default
dead? Mainly, I think, because they're not used to asking that.
It's not a question that makes sense to ask early on, any more than
it makes sense to ask a 3 year old how he plans to support
himself. But as the company grows older, the question switches from
meaningless to critical. That kind of switch often takes people
by surprise.I propose the following solution: instead of starting to ask too
late whether you're default alive or default dead, start asking too
early. It's hard to say precisely when the question switches
polarity. But it's probably not that dangerous to start worrying
too early that you're default dead, whereas it's very dangerous to
start worrying too late.The reason is a phenomenon I wrote about earlier: the
fatal pinch.
The fatal pinch is default dead + slow growth + not enough
time to fix it. And the way founders end up in it is by not realizing
that's where they're headed.There is another reason founders don't ask themselves whether they're
default alive or default dead: they assume it will be easy to raise
more money. But that assumption is often false, and worse still, the
more you depend on it, the falser it becomes.Maybe it will help to separate facts from hopes. Instead of thinking
of the future with vague optimism, explicitly separate the components.
Say "We're default dead, but we're counting on investors to save
us." Maybe as you say that, it will set off the same alarms in your
head that it does in mine. And if you set off the alarms sufficiently
early, you may be able to avoid the fatal pinch.It would be safe to be default dead if you could count on investors
saving you. As a rule their interest is a function of
growth. If you have steep revenue growth, say over 5x a year, you
can start to count on investors being interested even if you're not
profitable.
[1]
But investors are so fickle that you can never
do more than start to count on them. Sometimes something about your
business will spook investors even if your growth is great. So no
matter how good your growth is, you can never safely treat fundraising
as more than a plan A. You should always have a plan B as well: you
should know (as in write down) precisely what you'll need to do to
survive if you can't raise more money, and precisely when you'll
have to switch to plan B if plan A isn't working.In any case, growing fast versus operating cheaply is far from the
sharp dichotomy many founders assume it to be. In practice there
is surprisingly little connection between how much a startup spends
and how fast it grows. When a startup grows fast, it's usually
because the product hits a nerve, in the sense of hitting some big
need straight on. When a startup spends a lot, it's usually because
the product is expensive to develop or sell, or simply because
they're wasteful.If you're paying attention, you'll be asking at this point not just
how to avoid the fatal pinch, but how to avoid being default dead.
That one is easy: don't hire too fast. Hiring too fast is by far
the biggest killer of startups that raise money.
[2]Founders tell themselves they need to hire in order to grow. But
most err on the side of overestimating this need rather than
underestimating it. Why? Partly because there's so much work to
do. Naive founders think that if they can just hire enough
people, it will all get done. Partly because successful startups have
lots of employees, so it seems like that's what one does in order
to be successful. In fact the large staffs of successful startups
are probably more the effect of growth than the cause. And
partly because when founders have slow growth they don't want to
face what is usually the real reason: the product is not appealing
enough.Plus founders who've just raised money are often encouraged to
overhire by the VCs who funded them. Kill-or-cure strategies are
optimal for VCs because they're protected by the portfolio effect.
VCs want to blow you up, in one sense of the phrase or the other.
But as a founder your incentives are different. You want above all
to survive.
[3]Here's a common way startups die. They make something moderately
appealing and have decent initial growth. They raise their first
round fairly easily, because the founders seem smart and the idea
sounds plausible. But because the product is only moderately
appealing, growth is ok but not great. The founders convince
themselves that hiring a bunch of people is the way to boost growth.
Their investors agree. But (because the product is only moderately
appealing) the growth never comes. Now they're rapidly running out
of runway. They hope further investment will save them. But because
they have high expenses and slow growth, they're now unappealing
to investors. They're unable to raise more, and the company dies.What the company should have done is address the fundamental problem:
that the product is only moderately appealing. Hiring people is
rarely the way to fix that. More often than not it makes it harder.
At this early stage, the product needs to evolve more than to be
"built out," and that's usually easier with fewer people.
[4]Asking whether you're default alive or default dead may save you
from this. Maybe the alarm bells it sets off will counteract the
forces that push you to overhire. Instead you'll be compelled to
seek growth in other ways. For example, by doing
things that don't scale, or by redesigning the product in the
way only founders can.
And for many if not most startups, these paths to growth will be
the ones that actually work.Airbnb waited 4 months after raising money at the end of YÂ Combinator
before they hired their first employee. In the meantime the founders
were terribly overworked. But they were overworked evolving Airbnb
into the astonishingly successful organism it is now.Notes[1]
Steep usage growth will also interest investors. Revenue
will ultimately be a constant multiple of usage, so x% usage growth
predicts x% revenue growth. But in practice investors discount
merely predicted revenue, so if you're measuring usage you need a
higher growth rate to impress investors.[2]
Startups that don't raise money are saved from hiring too
fast because they can't afford to. But that doesn't mean you should
avoid raising money in order to avoid this problem, any more than
that total abstinence is the only way to avoid becoming an alcoholic.[3]
I would not be surprised if VCs' tendency to push founders
to overhire is not even in their own interest. They don't know how
many of the companies that get killed by overspending might have
done well if they'd survived. My guess is a significant number.[4]
After reading a draft, <NAME> wrote:"I think you should make the hiring point more strongly. I think
it's roughly correct to say that YC's most successful companies
have never been the fastest to hire, and one of the marks of a great
founder is being able to resist this urge."<NAME>uchheit adds:"A related problem that I see a lot is premature scalingâfounders
take a small business that isn't really working (bad unit economics,
typically) and then scale it up because they want impressive growth
numbers. This is similar to over-hiring in that it makes the business
much harder to fix once it's big, plus they are bleeding cash really
fast."
Thanks to <NAME>, <NAME>, <NAME>, <NAME>,
and <NAME> for reading drafts of this.
|
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/README.md | markdown | # Liturgical Books
Respository for my implementation of liturgical books for Orthodox and Byzantine Catholic church
I decided to open this repo as public, for anyone to use.
CSL texts are here temporarily, they are compiled from texts from OSBM monks, that they published long time ago on their former web page. They are here just as test data and will be replaced later by original transcription. Do not use without their permision.
GR texts are compiled from [https://glt.goarch.org/](GOA).
CU texts are compiled from [https://www.ponomar.net/](Ponomar).
SK texts are mostly from various sources, especially from [https://casoslov.sk/](Casoslov.sk). They also serve as test texts and will be replaced by original translation. Do not use without their permision.
Other texts are here just as test data, and will be removed or replaced in later versions.
## Prerequisites
This repository uses [https://typst.app/docs](Typst) to generate PDFs from source code.
## Command
To generate pdf use command
```
typst _general/NAME.typ
```
To update sources use command
````
git submodule update --remote
````
## Plans and TODO
- Find a way how to use second and third glory/now and how to render it properly
- Finalize general minea - add matins and liturgy/typica
- Add also lower feasts into minea
- Add lenten and flowely triodion
- Add different sources - Lviv, etc.
## Changelog
### v. 0.5
- CU, CSL and GR text are moved to separate repository, to allow it's independent reuse
- Vespers for general minea are added
- Started to add minea for great feasts
### v. 0.4
- Finished conversion of CLS oktoich to JSON
- Work in progres of JSON oktoich
### v. 0.3
- Finished CU and CSL oktoich
- Started CU common minea
- Started GR version
### v. 0.2
- Added voice 1 and 2 in Church Slavonic and Slovak transcription of Church Slavonic
- TODO: there are some differences in Lviv and Moscow oktoich, that need to be somehow resolved
### v. 0.1
- Initial commit to transfer from typst.app to separate place, as it reached maximal ammount of files. |
|
https://github.com/Gekkio/gb-ctr | https://raw.githubusercontent.com/Gekkio/gb-ctr/main/appendix/external-bus.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "../common.typ": *
#import "../timing.typ"
== Game Boy external bus
=== Bus timings
#let bus-diagram = (addr: array, rd: array, wr: array, a15: array, cs: array, data: array, sampling-edge: false) => {
import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z
text(13pt,
diagram(
grid: true,
(label: "CLK 4 MiHz", wave: (
l(1),
..range(9).map(_ => c(1)).flatten()
)),
(label: "PHI 1 MiHz", wave: (l(1), c(4), c(4), c(1),)),
(label: "A0-A14", wave: addr),
(label: "RD", wave: rd),
(label: "WR", wave: wr),
(label: "A15", wave: a15),
(label: "CS", wave: cs),
(label: "Data", wave: data),
fg: () => {
import cetz.draw
draw.set-style(stroke: (paint: rgb("#00000080"), thickness: 0.01em))
draw.line((1.0, -0.5), (1.0, 15.5))
draw.line((9.0, -0.5), (9.0, 15.5))
if sampling-edge {
draw.line((7, -0.5), (7, 15.5), stroke: (paint: rgb("#80800080"), thickness: 0.8pt))
}
}
)
)
}
#figure(
{
import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z
bus-diagram(
addr: (u(10),),
rd: (e(1), l(9),),
wr: (h(10),),
a15: (e(1), h(8), e(1),),
cs: (e(1), h(8), e(1),),
data: (x(1), z(9),),
)
},
caption: "External bus idle machine cycle"
)
#v(1cm)
#figure(
{
import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z
[
#columns(2, [
#block(
breakable: false,
[
#bus-diagram(
addr: (u(2), d(7, "addr"), u(1),),
rd: (e(1), l(9),),
wr: (h(10),),
a15: (e(1), h(2), l(6), e(1),),
cs: (e(1), h(8), e(1),),
data: (x(1), z(2), d(6, "data"), z(1)),
sampling-edge: true
)
#align(right, [
a) #hex-range("0000", "7FFF") #footnote[
Does not apply to #hex-range("0000", "00FF") accesses while the boot ROM is enabled. Boot ROM accesses do not affect the external bus, so it is in the idle state.
] <bootrom>
])
]
)
#colbreak()
#block(
breakable: false,
[
#bus-diagram(
addr: (u(2), d(7, "addr"), u(1),),
rd: (e(1), l(9),),
wr: (h(10),),
a15: (e(1), h(8), e(1),),
cs: (e(1), h(2), l(6), e(1),),
data: (x(1), z(2), d(6, "data"), z(1)),
sampling-edge: true,
)
#align(right, [
b) #hex-range("A000", "FDFF")
])
]
)
])
#block(
breakable: false,
[
#bus-diagram(
addr: (u(2), d(7, "addr"), u(1),),
rd: (e(1), l(9),),
wr: (h(10),),
a15: (e(1), h(8), e(1),),
cs: (e(1), h(8), e(1),),
data: (x(1), z(9),),
)
#align(right, [
c) #hex-range("FE00", "FFFF")
])
#v(1cm)
]
)
]
},
caption: "External bus CPU read machine cycles"
)
#figure(
{
import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z
[
#columns(2, [
#block(
breakable: false,
[
#bus-diagram(
addr: (u(2), d(7, "addr"), u(1),),
rd: (e(1), l(1), h(7), l(1),),
wr: (h(5), l(3), h(2),),
a15: (e(1), h(2), l(6), e(1),),
cs: (e(1), h(8), e(1),),
data: (x(1), z(4), d(4, "data"), z(1)),
)
#align(right, [
a) #hex-range("0000", "7FFF") #footnote(<bootrom>)
])
]
)
#colbreak()
#block(
breakable: false,
[
#bus-diagram(
addr: (u(2), d(7, "addr"), u(1),),
rd: (e(1), l(1), h(7), l(1),),
wr: (h(5), l(3), h(2),),
a15: (e(1), h(8), e(1),),
cs: (e(1), h(2), l(6), e(1),),
data: (x(1), z(4), d(4, "data"), z(1)),
)
#align(right, [
b) #hex-range("A000", "FDFF")
])
]
)
])
#block(
breakable: false,
[
#bus-diagram(
addr: (u(2), d(7, "addr"), u(1),),
rd: (e(1), l(9),),
wr: (h(10),),
a15: (e(1), h(8), e(1),),
cs: (e(1), h(8), e(1),),
data: (x(1), z(9),),
)
#align(right, [
c) #hex-range("FE00", "FFFF")
])
#v(1cm)
]
)
]
},
caption: "External bus CPU write machine cycles"
)
#figure(
{
import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z
[
#columns(2, [
#block(
breakable: false,
[
#bus-diagram(
addr: (u(1), d(8, "addr"), u(1),),
rd: (e(1), l(9),),
wr: (h(10),),
a15: (e(1), l(8), e(1),),
cs: (e(1), h(8), e(1),),
data: (x(1), d(8, "data"), z(1)),
)
#align(right, [
a) #hex-range("0000", "7FFF") #footnote(<bootrom>)
])
]
)
#colbreak()
#block(
breakable: false,
[
#bus-diagram(
addr: (u(1), d(8, "addr"), u(1),),
rd: (e(1), l(9),),
wr: (h(10),),
a15: (e(1), h(8), e(1),),
cs: (e(1), l(8), e(1),),
data: (x(1), d(8, "data"), z(1)),
)
#align(right, [
b) #hex-range("A000", "FFFF")
])
]
)
])
#v(1cm)
]
},
caption: "External bus timings for OAM DMA read machine cycles"
)
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/underover_02.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test brackets.
$ underbracket([1, 2/3], "relevant stuff")
arrow.l.r.double.long
overbracket([4/5,6], "irrelevant stuff") $
|
https://github.com/jgm/typst-symbols | https://raw.githubusercontent.com/jgm/typst-symbols/main/README.md | markdown | MIT License | # typst-symbols
This package provides definitions of the symbols used in typst
(<https://typst.app>). (Currently version 0.12.0 is targeted.)
It exports lists of triples, which can be converted into maps or
other more appropriate forms, depending on the use case. Each
triple contains the symbol name (Text), a Boolean that is True
if the symbol is an accent, and the resolved symbol (Text).
The symbols can be updated by scraping the typst website:
`make update` will do the work.
|
https://github.com/emanuel-kopp/uzh-mnf-phd | https://raw.githubusercontent.com/emanuel-kopp/uzh-mnf-phd/main/src/lib.typ | typst | #let main_doc(
title: "",
author: "",
heimatort: "",
examinators: (""),
date: "",
land: "",
PI_is_head: true,
body,
) = {
// Set the document's basic properties.
set document(author: author, title: title)
set text(font: "New Computer Modern", lang: "de", size: 11pt)
set align(center)
set page(margin: (left: 2cm, right: 2cm, bottom: 2cm, top: 2cm))
text(size: 14pt, weight: "bold")[#title]
v(3pt)
line(length: 171mm, stroke: 0.3pt)
v(24pt)
text(weight: "bold")[Dissertation]
linebreak()
v(2fr)
text(weight: "bold")[zur]
v(2fr)
text(weight: "bold")[Erlangung der naturwissenschaftlichen DoktorwÃŒrde]
v(2fr)
text(weight: "bold")[(Dr. sc. nat.)]
v(2fr)
text(weight: "bold")[vorgelegt der]
v(2fr)
text(weight: "bold")[Mathematisch-naturwissenschaftlichen FakultÀt]
v(2fr)
text(weight: "bold")[der]
v(2fr)
text(weight: "bold")[UniversitÀt ZÌrich]
v(2fr)
text(weight: "bold")[von]
v(2fr)
text(weight: 1)[#author]
v(11pt)
if land == "Schweiz" [#text(weight: "bold")[von]] else { text(weight: "bold")[aus] }
v(2fr)
if land == "Schweiz" { text(weight: 1)[#heimatort] } else { text(weight: 1)[#land] }
v(4fr)
text(weight: "bold")[Promotionskommission]
v(3pt)
grid(
align: left,
columns: 3,
[],
let (a, b, .., c) = examinators,
for ex in examinators {
if PI_is_head == true [
#if ex == a { text(weight: 1)[#ex (Vorsitz und Leitung der Dissertation)] } else { text(weight: 1)[#ex] }
]
if PI_is_head == false [
#if ex == a { text(weight: 1)[#ex (Vorsitz)] } else if ex == b { text(weight: 1)[#ex (Leitung der Dissertation)] } else { text(weight: 1)[#ex] }
]
v(0.1em)
},
[],
)
v(6fr)
text(weight: "bold")[ZÃŒrich, #date]
v(2fr)
pagebreak()
// Defining headings
show heading.where(level: 1): it => {
pagebreak()
set text(weight: "bold", size: 16pt)
it.body
v(1em)
}
// Main body
set text(font: "New Computer Modern", lang: "en", size: 11pt)
set par(justify: true)
set align(left)
set page(numbering: "1", number-align: center)
set par(leading: 1.5em)
body
}
#let chapter(
title: none,
authors: (),
affiliations: (),
header: none,
abstract: [],
chapter,
) = {
set align(left)
// Write title
text(size: 14pt, weight: "bold", title)
v(1em)
let count = authors.len()
let ncols = calc.min(count, 3)
for aut in authors {
if aut.name == authors.last().name { text()[#aut.name#super[#aut.affiliation]] } else { text()[#aut.name#super[#aut.affiliation], ] }
}
v(1em)
for aff in affiliations {
text()[#aff.num: #aff.name]
linebreak()
}
v(2em)
set align(center)
par(justify: true)[
*Abstract* \
#abstract
]
show heading.where(level: 2): it => {
v(1em)
it.body
v(1em)
}
show heading.where(level: 3): it => {
v(1em)
it.body
v(1em)
}
set align(left)
v(2em)
// Write header
set page(header: align(right)[
#text(size: 10pt, style: "italic")[#header]
])
chapter
} |
|
https://github.com/Jollywatt/typst-fletcher | https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/docs/readme-examples/state-machine.typ | typst | MIT License | #set text(10pt)
#diagram(
node-stroke: .1em/*<*/ + fg/*>*/,
edge-stroke: fg, // hide
crossing-fill: bg , // hide
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),
) |
https://github.com/alberto-lazari/cns-report | https://raw.githubusercontent.com/alberto-lazari/cns-report/main/previous-architecture.typ | typst | = Overview of previous work <previous_work>
Thestarting point of our project is _QRFuzz_ by @QRFuzz, which is made of the following components:
- *PC Monitor*: A phisical monitor in which the generated QRs are displayed.
- *Smartphone*: A phisical smartphone in which the app under test is run.
- *Appium server*: An Appium Server is an open-source automation server that facilitates the automated testing of mobile applications across different platforms, including iOS, Android, and Windows.
It acts as a bridge between test code and the mobile device or emulator, allowing to interact with the application under test programmatically.
- *QR Code Fuzzer*: The main element of the system that is responsible for coordinating and initiating actions for both the QR Code Generator and the Appium Server, along with managing the entire testing process. The fuzzing operation itself involves a series of steps repeated for each QR code under examination. These steps include navigating to the designated scanning page within the application, scanning the QR code, verifying if the app's normal behavior has been disrupted, and logging the results of the iteration as potential indications of a vulnerability.
- *QR Code Generator*: The QR Code Generator is another crucial component of QRFuzz. Its primary function is to dynamically produce QR codes using a predefined dictionary and display them on the screen. This generator is capable of creating both standard, general-purpose QR codes and custom codes based on an application-specific template.
#v(2em)
== Workflow
The workflow of the system (@old_workflow) can be summarized by the following steps:
1. The QR code displayed on the monitor is scanned by the smartphone.
2. The smartphone sends a scan responce to the QR Code Fuzzer through the Appium server
3. The QR Code Fuzzer notifies a QR change request to the QR Code Generator by updating a shared JSON file.
4. The QR Code Generator generates a new QR and displays it on the monitor.
5. The QR Code Generator notifies the update to the QR Code Fuzzer by changing the JSON file.
6. The QR Code Fuzzer sends a scan request to the smartphone via Appium server.
#figure(
image("images/qr-fuzz-old-architecture.png"),
caption: [Old architecture]
) <old_workflow> |
|
https://github.com/isaacholt100/isaacholt | https://raw.githubusercontent.com/isaacholt100/isaacholt/main/public/maths-notes/4-cambridge%3A-part-III/additive-combinatorics/additive-combinatorics.typ | typst | MIT License | #import "../../template.typ": *
#show: doc => template(doc, hidden: (), slides: false)
= Combinatorial methods
#definition[
Let $G$ be an abelian group and $A, B subset.eq G$. The *sumset* of $A$ and $B$ is $
A + B := {a + b: a in A, b in B}.
$ The *difference set* of $A$ and $B$ is $
A - B := {a - b: a in A, b in B}.
$
]<def:sumset-and-difference-set>
#proposition[
$max{|A|, |B|} <= |A + B| <= |A| dot |B|$.
]<prop:general-bound-on-sumset-size>
#proof[
Trivial.
]
#example[
Let $A = [n] = {1, ..., n}$. Then $A + A = {2, ..., 2n}$ so $|A + A| = 2|A| - 1$.
]
#lemma[
Let $A subset.eq ZZ$ be finite. Then $|A + A| >= 2|A| - 1$ with equality iff $A$ is an arithmetic progression.
]<lem:lower-bound-on-integer-sumset>
#proofhints[
Consider two sequences in $A + A$ which are strictly increasing and of the same length.
]
#proof[
- Let $A = {a_1, ..., a_n}$ with $a_i < a_(i + 1)$. Then $a_1 + a_1 < a_1 + a_2 < dots.c < a_1 + a_n < a_2 + a_n < dots.c < a_n + a_n$.
- Note this is not the only choice of increasing sequence that works, in particular, so does $a_1 + a_1 < a_1 + a_2 < a_2 + a_2 < a_2 + a_3 < a_2 + a_4 < dots.c < a_2 + a_n < a_3 + a_n < dots.c < a_n + a_n$.
- So when equality holds, all these sequences must be the same. In particular, $a_2 + a_i = a_1 + a_(i + 1)$ for all $i$.
]
#lemma[
If $A, B subset.eq ZZ$, then $|A + B| >= |A| + |B| - 1$ with equality iff $A$ and $B$ are arithmetic progressions with the same common difference.
]
#proofhints[
Similar to above, consider $4$ sequences in $A + B$ which are strictly increasing and of the same length.
]
#example[
Let $A, B subset.eq ZZ\/p$ for $p$ prime. If $|A| + |B| >= p + 1$, then $A + B = ZZ\/p$.
]
#proofhints[
Consider $A sect (g - B)$ for $g in ZZ\/p$.
]
#proof[
- $g in A + B$ iff $A sect (g - B) != emptyset$ where ($g - B = {g} - B$).
- Let $g in ZZ\/p$, then use inclusion-exclusion on $|A sect (g - B)|$ to conclude result.
]
#theorem(name: "Cauchy-Davenport")[
Let $p$ be prime, $A, B subset.eq ZZ\/p$ be non-empty. Then $
|A + B| >= min{p, |A| + |B| - 1}.
$
]<thm:cauchy-davenport>
#proofhints[
- Assume $|A| + |B| < p + 1$, and WLOG that $1 <= |A| <= |B|$ and $0 in A$ (by translation).
- Induct on $|A|$.
- Let $a in A$, find $B'$ such that $0 in B'$, $a in.not B'$ and $|B'| = |B|$ (use fact that $p$ is prime).
- Apply induction with $A sect B'$ and $A union B'$, while reasoning that $(A sect B') + (A union B') subset.eq A + B'$.
]
#proof[
- Assume $|A| + |B| < p + 1$, and WLOG that $1 <= |A| <= |B|$ and $0 in A$ (by translation).
- Use induction on $|A|$. $|A| = 1$ is trivial.
- Let $|A| >= 2$ and let $0 != a in A$. Then since $p$ is prime, ${a, 2a, ..., p a} = ZZ\/p$.
- There exists $m >= 0$ such that $m a in B$ but $(m + 1)a in.not B$ (why?). Let $B' = B - m a$, so $0 in B'$, $a in.not B'$ and $|B'| = |B|$.
- $1 <= |A sect B'| < |A|$ (why?) so the inductive hypothesis applies to $A sect B'$ and $A union B'$.
- Since $(A sect B') + (A union B') subset.eq A + B'$ (why?), we have $|A + B| = |A + B'| >= |(A sect B') + (A union B')| >= |A sect B'| + |A union B'| - 1 = |A| + |B| - 1$.
]
#example[
Cauchy-Davenport does not hold general abelian groups (e.g. $ZZ\/n$ for $n$ composite): for example, let $A = B = {0, 2, 4} subset.eq ZZ\/6$, then $A + B = {0, 2, 4}$ so $|A + B| = 3 < min{6, |A| + |B| - 1}$.
]
#example[
Fix a small prime $p$ and let $V subset.eq FF_p^n$ be a subspace. Then $V + V = V$, so $|V + V| = |V|$. In fact, if $A subset.eq FF_p^n$ satisfies $|A + A| = |A|$, then $A$ is an affine subspace (a coset of a subspace).
]
#proof[
If $0 in A$, then $A subset.eq A + A$, so $A = A + A$. General result follows by considering translation of $A$.
]
#example[
Let $A subset.eq FF_p^n$ satisfy $|A + A| <= 3/2 |A|$. Then there exists a subspace $V subset.eq FF_p^n$ such that $|V| <= 3/2 |A|$ and $A$ is contained in a coset of $V$.
]
#proof[
Exercise (sheet 1).
]
#definition[
Let $A, B subset.eq G$ be finite subsets of an abelian group $G$. The *Ruzsa distance* between $A$ and $B$ is $
d(A, B) := log (|A - B|)/(sqrt(|A| dot |B|)).
$
]
#lemma(name: "Ruzsa Triangle Inequality")[
Let $A, B, C subset.eq G$ be finite. Then $
d(A, C) <= d(A, B) + d(B, C).
$
]<lem:ruzsa-triangle-inequality>
#proofhints[
Consider a certain map from $B times (A - C)$ to $(A - B) times (B - C)$.
]
#proof[
- Note that $|B| |A - C| <= |A - B| |B - C|$. Indeed, writing each $d in A - C$ as $d = a_d - c_d$ with $a_d in A$, $c_d in C$, the map $phi: B times (A - C) -> (A - B) times (B - C)$, $phi(b, d) = (a_d - b, b - c_d)$ is injective (why?).
- Triangle inequality now follows from definition of Ruzsa distance.
]
#definition[
The *doubling constant* of finite $A subset.eq G$ is $sigma(A) := |A + A|\/|A|$.
]<def:doubling-constant>
#definition[
The *difference constant* of finite $A subset.eq G$ is $delta(A) := |A - A|\/|A|$.
]<def:difference-constant>
#remark[
The Ruzsa triangle inequality shows that $
log delta(A) = d(A, A) <= d(A, -A) + d(-A, A) = 2 log sigma(A).
$ So $delta(A) <= sigma(A)^2$, i.e. $|A - A| <= |A + A|^2\/|A|$.
]
#notation[
Let $A subset.eq G$, $ell, m in NN_0$. Then $
ell A + m A := underbrace(A + dots.c + A, ell "times") underbrace(- A - dots.c - A, m "times")
$ This is referred to as the *iterated sum and difference set*.
]
#theorem(name: "Plunnecke's Inequality")[
Let $A, B subset.eq G$ be finite and $|A + B| <= K|A|$ for some $K >= 1$. Then $forall ell, m in NN_0$, $
|ell B - m B| <= K^(ell + m) abs(A).
$
]<thm:plunneckes-inequality>
#proofhints[
- Let $A' subset.eq A$ minimise $abs(A' + B)\/abs(A')$ with value $K'$.
- Show that for every finite $C subset.eq G$, $abs(A' + B + C) <= K' abs(A + C)$ by induction on $abs(C)$ (note two sets need to be written as disjoint unions here).
- Show that $forall m in NN_0, abs(A' + m B) <= (K')^m abs(A')$ by induction.
- Use Ruzsa triangle inequality to conclude result.
]
#proof[
- Choose $emptyset != A' subset.eq A$ which minimises $|A' + B|\/|A'|$. Let the minimum value by $K'$.
- Then $|A' + B| = K' abs(A')$, $K' <= K$ and $forall A'' subset.eq A$, $|A'' + B| >= K' abs(A'')$.
- Claim: for every finite $C subset.eq G$, $|A' + B + C| <= K' abs(A' + C)$:
- Use induction on $abs(C)$. $abs(C) = 1$ is true by definition of $K'$.
- Let claim be true for $C$, consider $C' = C union {x}$ for $x in.not C$.
- $A' + B + C' = (A' + B + C) union ((A' + B + x) - (D + B + x))$, where $D = {a in A': a + B + x subset.eq A' + B + C}$.
- By definition of $K'$, $abs(D + B) >= K' abs(D)$. Hence, $
|A' + B + C| & <= |A' + B + C| + abs(A' + B + x) - abs(D + B + x) \
& <= K' abs(A' + C) + K' abs(A') - K' abs(D) \
& = K' (abs(A' + C) + abs(A') - |D|).
$
- Applying this argument a second time, write $A' + C' = (A' + C) union ((A' + x) - (E + x))$, where $E = {a in A': a + x in A' + C} subset.eq D$.
- Finally, $
abs(A' + C') & = abs(A' + C) + abs(A' + x) - abs(E + x) \
& >= |A' + C| + |A'| - |D|.
$
- We first show that $forall m in NN_0$, $abs(A' + m B) <= (K')^m abs(A')$ by induction:
- $m = 0$ is trivial, $m = 1$ is true by assumption.
- Suppose $m - 1 >= 1$ is true. By the claim with $C = (m - 1) B$, we have $ abs(A' + m B) = |A' + B + (m - 1)B| <= K' abs(A' + (m - 1)B) <= (K')^m abs(A'). $
- As in the proof of Ruzsa's triangle inequality, $forall ell, m in NN_0$, $ |A'| |ell B - m B| <= |A' + ell B| |A' + m B| <= (K')^ell abs(A') (K')^m abs(A') = (K')^(ell + m) abs(A')^2. $
]
#theorem(name: "Freiman-Ruzsa")[
Let $A subset.eq FF_p^n$ and $abs(A + A) <= K abs(A)$. Then $A$ is contained in a subspace $H subset.eq FF_p^n$ with $abs(H) <= K^2 p^(K^4) abs(A)$.
]<thm:freiman-ruzsa>
#proofhints[
- Let $X subset.eq 2A - A$ be of maximal size such that all $x + A$, $x in X$, are disjoint.
- Use Plunnecke's inequality to obtain an upper bound on $abs(X) abs(A)$.
- Show that $forall ell >= 2$, $ell A - A subset.eq (ell - 1)X + A - A$ by induction.
- Let $H$ be subgroup generated by $A$. By writing $H$ as an infinite union, show that $H subset.eq Y + A - A$, where $Y$ is subgroup generated by $X$.
- Find an upper bound for $abs(Y)$, conclude using Plunnecke inequality.
]
#proof[
- Choose maximal $X subset.eq 2A - A$ such that the translates $x + A$ with $x in X$ are disjoint.
- Such an $X$ cannot be too large: $forall x in X$, $x + A subset.eq 3A - A$, so by Plunnecke's inequality, since $abs(3A - A) <= K^4 abs(A)$, $
abs(X) abs(A) = abs(union.big_(x in X) (x + A)) <= abs(3A - A) <= K^4 abs(A).
$ Hence $abs(X) <= K^4$.
- We next show that $2A - A subset.eq X + A - A$. Indeed, if, $y in 2A - A$ and $y in.not X$, then by maximality of $X$, then $(y + A) sect (x + A) != emptyset$ for some $x in X$. If $y in X$, then $y in X + A - A$.
- It follows from above, by induction, that $forall ell >= 2$, $ell A - A subset.eq (ell - 1)X + A - A$: $ell A - A = A + (ell - 1)A - A subset.eq (ell - 2)X + 2A - A subset.eq (ell - 2)X + X + A - A = (ell - 1)X + A - A$.
- Now, let $H subset.eq FF_p^n$ be the subgroup generated by $A$: $
H = union.big_(ell >= 1) (ell A - A) subset.eq Y + A - A
$ where $Y subset.eq FF_p^n$ is the subgroup generated by $X$.
- Every element of $Y$ can be written as a sum of $abs(X)$ elements of $X$ with coefficients in ${0, ..., p - 1}$. Hence, $abs(Y) <= p^abs(X) <= p^(K^4)$.
- Hence $abs(H) <= abs(Y) abs(A - A) <= p^(K^4) K^2 abs(A)$ by Plunnecke/Ruzsa triangle inequality.
]
#example[
Let $A = V union R$, where $V subset.eq FF_p^n$ is a subspace with $dim(V) = d = n\/K$ satisfying $K << d << n - K$, and $R$ consists of $K - 1$ linearly independent vectors not in $V$. Then $abs(A) = abs(V union R) = abs(V) + abs(R) = p^(n\/K) + K - 1 approx p^(n\/K) = abs(V)$.
Now $abs(A + A) = abs((V union R) + (V union R)) = abs(V union (V + R) union 2R) approx K abs(V) approx K abs(A)$ (since $V union (V + R)$ gives $K$ cosets of $V$). But any subspace $H subset.eq FF_p^n$ containing $A$ must have size at least $p^(n\/K + (K - 1)) approx abs(V) p^K$. Hence, the exponential dependence on $K$ in Freiman-Ruzsa is necessary.
]
#theorem(name: "Polynomial Freiman-Ruzsa Theorem")[
Let $A subset.eq FF_p^n$ be such that $abs(A + A) <= K abs(A)$. Then there exists a subspace $H subset.eq FF_p^n$ of size at most $C_1 (K) abs(A)$ such that for some $x in FF_p^n$, $
abs(A sect (x + H)) >= abs(A)/(C_2 (K)),
$ where $C_1 (K)$ and $C_2 (K)$ are polynomial in $K$.
]
#proof[
Very difficult (took Green, Gowers and Tao to prove it).
]
#definition[
Given $A, B subset.eq G$ for an abelian group $G$, the *additive energy* between $A$ and $B$ is $
E(A, B) := abs({(a, a', b, b') in A times A times B times B: a + b = a' + b'}).
$ *Additive quadruples* $(a, a', b, b')$ are those such that $a + b = a' + b'$. Write $E(A)$ for $E(A, A)$.
]
#example[
Let $V subset.eq FF_p^n$ be a subspace. Then $E(V) = abs(V)^3$. On the other hand, if $A subset.eq ZZ\/p$ is chosen at random from $ZZ\/p$ (where each $a in ZZ\/p$ is included with probability $alpha > 0$), with high probability, $E(A) = alpha^4 p^3 = alpha abs(A)^3$.
]
#definition[
For $A, B subset.eq G$, the *representation function* is $r_(A + B) (x) := abs({(a, b) in A times B: a + b = x}) = abs(A sect (x - B))$.
]
#lemma[
Let $emptyset != A, B subset.eq G$ for an abelian group $G$. Then $
E(A, B) >= (abs(A)^2 abs(B)^2)/abs(A + B).
$
]
#proof[
- Observe that $
E(A, B) & = abs({(a, a', b, b') in A^2 times B^2: a + b = a' + b'}) \
& = abs(union.big_(x in G) {(a, a', b, b') in A^2 times B^2: a + b = x "and" a' + b' = x}) \
& = union.big_(x in G) abs({(a, a', b, b') in A^2 times B^2: a + b = x "and" a' + b' = x}) \
& = sum_(x in G) r_(A + B) (x)^2
$
]
= Fourier-analytic techniques
= Probabilistic tools
= Further topics
|
https://github.com/Shuenhoy/modern-zju-thesis | https://raw.githubusercontent.com/Shuenhoy/modern-zju-thesis/master/documentclass/graduate-general.typ | typst | MIT License | #import "../pages/graduate-cover.typ": graduate-cover
#import "../pages/graduate-title-zh.typ": graduate-title-zh
#import "../pages/graduate-title-en.typ": graduate-title-en
#import "../pages/graduate-decl.typ": graduate-decl
#import "../pages/template-individual.typ": template-individual
#import "../pages/outline.typ": main-outline, figure-outline, table-outline
#import "../utils/fonts.typ": *
#import "../utils/header.typ": header, footer
#import "../utils/fakebold.typ": show-cn-fakebold
#import "../utils/indent-first-par.typ": indent-first-par
#import "../utils/supplement.typ": show-set-supplement
#import "../utils/twoside.typ": show-twoside-pagebreak, twoside-numbering-footer, twoside-pagebreak
#import "../utils/near-chapter.typ": near-chapter
#import "../utils/bilingual-bibliography.typ": show-bilingual-bibliography
#import "../utils/structure.typ": frontmatter, mainmatter
#import "../utils/appendix.typ": appendix
#import "../dependency/i-figured.typ"
#let show-outline-indent(s) = {
show outline.entry: it => {
if it.level == 1 {
text(weight: "bold", it)
} else {
h(1em * (it.level - 1)) + it
}
}
s
}
#let graduate-general-default-info = (
title: ("æ¯äžè®ºæ/讟计é¢ç®", ""),
title-en: ("Graduation Project/Design Title", ""),
grade: "20XX",
student-id: "1234567890",
clc: "O643.12",
unitcode: "10335",
reviewer: ("éå", "éå", "éå", "éå", "éå"),
committe: ("äž»åž", "å§å", "å§å", "å§å", "å§å", "å§å"),
reviewer-en: ("Anonymous", "Anonymous", "Anonymous", "Anonymous", "Anonymous"),
committe-en: ("Chair", "Committeeman", "Committeeman", "Committeeman", "Committeeman", "Committeeman"),
secret-level: "æ ",
author: "åŒ äž",
department: "æåŠé¢",
major: "æäžäž",
degree: "ç¡å£«",
field: "ææ¹å",
supervisor: "æå",
submit-date: datetime.today(),
defense-date: ("äºäžä¹äžå¹Žå
æ", "September 2193"),
)
#let graduate-general-set-style(
doc,
degree: "ç¡å£«",
twoside: false,
) = {
// Page geometry
set page(
paper: "a4",
margin: (
x: 2.5cm,
bottom: 2.54cm + 12pt + 30pt,
top: 2.54cm + 12pt + 4mm,
),
)
show: show-twoside-pagebreak.with(twoside: twoside)
// Header and footer
set page(
header-ascent: 4mm,
footer-descent: 35pt,
header: header(
left: [æµæ±å€§åŠ#(degree)åŠäœè®ºæ],
right: near-chapter,
),
footer: twoside-numbering-footer,
)
// Paragraph and text
set par(leading: 1.3em, first-line-indent: 2em, justify: true)
show: indent-first-par
set text(font: åäœ.仿å®, size: åå·.å°å, lang: "zh")
show: show-cn-fakebold
set underline(offset: 0.2em)
// Headings
show heading: i-figured.reset-counters
set heading(numbering: "1.1")
show heading.where(level: 1): set text(size: åå·.å°äž)
show heading.where(level: 1): x => {
twoside-pagebreak
v(12pt)
x
v(6pt)
}
show heading.where(level: 2): set text(size: åå·.åå·)
show heading.where(level: 3): set text(size: åå·.å°å)
show heading.where(level: 4): set text(size: åå·.å°å)
show heading: set block(above: 1.5em, below: 1.5em)
// Reference
show: show-set-supplement
show figure: i-figured.show-figure
show math.equation.where(block: true): i-figured.show-equation
show figure.where(kind: table): set figure.caption(position: top)
show: show-bilingual-bibliography
doc
}
#let graduate-general(info: (:), twoside: false) = {
let info = graduate-general-default-info + info
(
pages: (
cover: graduate-cover(info: info),
title-zh: graduate-title-zh(info: info),
title-en: graduate-title-en(info: info),
decl: graduate-decl(),
outline: show-outline-indent(main-outline(outlined: true, titlelevel: 1)),
figure-outline: figure-outline(outlined: true, titlelevel: 1),
table-outline: table-outline(outlined: true, titlelevel: 1),
individual: template-individual.with(outlined: true, titlelevel: 1, bodytext-settings: (size: åå·.å°å)),
),
style: doc => {
set document(title: info.title.join())
graduate-general-set-style(doc, degree: info.degree, twoside: twoside)
},
)
}
|
https://github.com/typst-community/mantodea | https://raw.githubusercontent.com/typst-community/mantodea/main/src/_valid.typ | typst | MIT License | #import "_pkg.typ"
#let _content = content
#let _color = color
#let _gradient = gradient
#let _label = label
#let _version = version
#import _pkg.z: *
#let paint = base-type.with(name: "color/gradient", types: (_color, _gradient,))
#let auto_ = base-type.with(name: "auto", types: (type(auto),))
#let label = base-type.with(name: "label", types: (_label,))
#let version = base-type.with(name: "version", types: (_version,))
|
https://github.com/0xPARC/0xparc-intro-book | https://raw.githubusercontent.com/0xPARC/0xparc-intro-book/main/src/fhe-takeaways.typ | typst | #import "preamble.typ":*
#takeaway[FHE takeaways][
1. A _fully homomorphic encryption_ protocol allows Bob to compute some function $f(x)$ for Alice in a way that Bob doesn't get to know $x$ or $f(x)$.
2. The hard problem backing known FHE protocols is the _learning with errors (LWE)_ problem, which comes down to deciding if a system of "approximate equations" over $FF_q$ is consistent.
3. The main idea of this approach to FHEs is to use "approximate eigenvalues" as the encrypted computation and an "approximate eigenvector" as the secret key.
Intuitively, adding and multiplying two matrices with different approximate eigenvalues for the same eigenvector approximately adds and multiplies the eigenvalues, respectively.
4. To carefully do this, we actually need to control the error blowup with the _flatten_ operation. This creates a _levelled FHE_ protocol.
]
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-justify_05.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test that runts are avoided when it's not too costly to do so.
#set page(width: 124pt)
#set par(justify: true)
#for i in range(0, 20) {
"a b c "
}
#"d"
|
https://github.com/sebmestrallet/typst-simple-siam | https://raw.githubusercontent.com/sebmestrallet/typst-simple-siam/main/README.md | markdown | MIT No Attribution | # The `simple-siam` Typst package
A Typst template for SIAM paper submissions
<p align="center">
<img src="thumbnails/p1.png" alt="page 1 of an example paper based on this template" width="49%">
<img src="thumbnails/p2.png" alt="page 2 of an example paper based on this template" width="49%">
<img src="thumbnails/p3.png" alt="page 3 of an example paper based on this template" width="49%">
<img src="thumbnails/p4.png" alt="page 4 of an example paper based on this template" width="49%">
</p>
<details>
<summary>About the name</summary>
- `typst-simple-siam` is the name of the GitHub repo, `simple-siam` is the name of the Typst template
- The Typst template name does not contain `typst`, because it is redundant[^typst_template_naming]
- The Typst template name is not just `siam`, because it is not an official template, thus the name must start with a non-descriptive part[^typst_template_naming]
[^typst_template_naming]: https://github.com/typst/packages?tab=readme-ov-file#submission-guidelines
</details>
## Template adaptation checklist
- [x] Fill out `README.md`
- Change the `my-package` package name, including code snippets
- Check section contents and/or delete sections that don't apply
- [x] Check and/or replace `LICENSE` by something that suits your needs
- [x] Fill out `typst.toml`
- See also the [typst/packages README](https://github.com/typst/packages/?tab=readme-ov-file#package-format)
- [ ] Adapt Repository URLs in `CHANGELOG.md`
- Consider only committing that file with your first release, or removing the "Initial Release" part in the beginning
- [ ] Adapt or deactivate the release workflow in `.github/workflows/release.yml`
- to deactivate it, delete that file or remove/comment out lines 2-4 (`on:` and following)
- to use the workflow
- [ ] check the values under `env:`, particularly `REGISTRY_REPO`
- [ ] if you don't have one, [create a fine-grained personal access token](https://github.com/settings/tokens?type=beta) with [only Contents permission](https://stackoverflow.com/a/75116350/371191) for the `REGISTRY_REPO`
- [ ] on this repo, create a secret `REGISTRY_TOKEN` (at `https://github.com/[user]/[repo]/settings/secrets/actions`) that contains the so created token
if configured correctly, whenever you create a tag `v...`, your package will be pushed onto a branch on the `REGISTRY_REPO`, from which you can then create a pull request against [typst/packages](https://github.com/typst/packages/)
- [x] remove/replace the example test case
- [x] (add your actual code, docs and tests)
- [ ] remove this section from the README
## Getting Started
> [!IMPORTANT]
> This template is not published yet, you cannot access it from `@preview/`, but you can download [`src/lib.typ`](src/lib.typ) and use it in your project.
From the CLI:
```bash
typst init @preview/simple-siam
```
From the Typst web app:
```typ
#import "@preview/simple-siam:0.1.0": conf
#show: doc => conf(
title: [A Typst template for SIAM paper submissions],
authors: [<NAME>],
abstract: [See #link("https://github.com/sebmestrallet/typst-simple-siam")],
doc,
)
= First section
#lorem(50)
```
## Theorems & algorithms
Based on third-party Typst packages, this template allows to insert formatted theorem/proof/definition/lemma environments, as well as algorithms:
```typ
#import "lib.typ": conf, theorem, definition, lemma, thmrules, proof, pseudocode-list, algorithm
#show: thmrules
#show: doc => conf(
title: [A Typst template for SIAM paper submissions],
authors: [<NAME>],
abstract: [See #link("https://github.com/sebmestrallet/typst-simple-siam")],
doc,
)
= A theorem
#theorem[
Here the theorem formulation
]
= An algorithm
#algorithm(
pseudocode-list(
numbered-title: #smallcaps[(My Algorithm)],
stroke: none,
booktabs: false,
indentation: 2em
)[
- *Require:* Some input $a$
- *Require:* Some input $b$
+ Here the algorithm definition
]
)
```
## Files
- [`src/lib.typ`](src/lib.typ): provide the `conf(title,authors,abstract,doc)` function to format a paper
- [`src/main.typ`](src/main.typ): use `conf()` to reproduce the outputs of `ltexpprt_anonymous-submission.tex` & `ltexpprt_accepted-submission.tex` from the official template
- [`src/bib.yml`](src/bib.yml): transcoding of `ltexpprt_references.bib` from the official template to the [Hayagriva](https://github.com/typst/hayagriva/blob/main/docs/file-format.md) format
- [`src/siam.csl`](src/siam.csl): [Citation Style Language](https://citationstyles.org/) for the bibliography, based on the [IEEE](https://github.com/citation-style-language/styles/blob/master/ieee.csl) one (modified `<macro name="author">` to have small caps)
## Dependencies
- [`ctheorems`](https://typst.app/universe/package/ctheorems) ([sahasatvik/typst-theorems](https://github.com/sahasatvik/typst-theorems)) for numbered theorem environments, by [<NAME>](https://github.com/sahasatvik), [<NAME>](https://github.com/rmolinari), [<NAME>](https://github.com/MJHutchinson) and [DVDTSB](https://github.com/DVDTSB) [[MIT](https://github.com/sahasatvik/typst-theorems/blob/main/LICENSE)]
- [`lovelace`](https://typst.app/universe/package/lovelace) ([andreasKroepelin/lovelace](https://github.com/andreasKroepelin/lovelace)) for pseudocode, by [<NAME>](https://github.com/andreasKroepelin) and contributors [[MIT](https://github.com/andreasKroepelin/lovelace/blob/main/LICENSE)]
They are imported with `#import "@preview/{name}:{version}` in [`src/lib.typ`](src/lib.typ).
## Ressources
TeX sources of the official template:
- The [SIAM two-column template](https://internationalmeshingroundtable.com/assets/files/imr33/templates.zip) referenced for the [SIAM International Meshing Roundtable Workshop 2025](https://internationalmeshingroundtable.com/imr33/call-for-papers/#formatting-requirements)
- The [SIAM Macros](https://epubs.siam.org/journal-authors#macros) on the SIAM website
- The [2019 SIAM style manual](https://epubs.siam.org/pb-assets/files/SIAM_STYLE_GUIDE_2019.pdf) on the SIAM website
How to create and publish a Typst template package:
- The motivation and recommended interface for templates in the [official tutorial](https://typst.app/docs/tutorial/making-a-template/)
- The in-depth format requirements in the [typst/packages](https://github.com/typst/packages) README
- Do as the [templates directly maintained by the Typst team](https://github.com/typst/templates)
- Use the [typst-package-template](https://github.com/typst-community/typst-package-template) GitHub template from [@typst-community](https://github.com/typst-community)
## Differences with the official TeX template
See [open issues with the `compliance` label](https://github.com/sebmestrallet/typst-simple-siam/issues?q=sort%3Aupdated-desc+is%3Aopen+label%3Acompliance)
## License
[MIT-0](LICENSE) |
https://github.com/LeptusHe/LeptusHe.github.io | https://raw.githubusercontent.com/LeptusHe/LeptusHe.github.io/main/source/_posts/fourier-transform/fourier-transform-01-fourier-series.typ | typst | #import "../typst-inc/blog-inc.typc": *
#show: blog_setting.with(
title: "å
éå¶åæ¢01 - å
éå¶çº§æ°",
author: ("<NAME>"),
paper: "jis-b0",
preview: false
)
#metadata("å
éå¶åæ¢") <tags>
#metadata("æ°åŠ") <categories>
#metadata("2024-08-05") <date>
#show: shorthands.with(
($<|$, math.angle.l),
($|>$, math.angle.r)
)
#set math.equation(numbering: "(1)")
= å
éå¶æ£äº€åœæ°é
å
éå¶åœæ°é$cal(Phi)$æ¯æ£äº€åœæ°éïŒå
¶äžä»»æäž€äžªåœæ°çå
积éœäžº0ã$cal(Phi)$çå®ä¹åŠ@eq-fourier-function æç€ºã
$
cal(Phi) = {1, sin(w t), cos(w t), sin (2 w t), cos(2 w t), dots.c, sin(n w t), cos (n w t)}
$ <eq-fourier-function>
å
éå¶åºåœæ°ä¹éŽå
积çå®ä¹åŠ@eq-inner-fourier-basis-func æç€ºã
$
<|f, g|> = integral_(-T/2)^(T/2) f(x) dot.c g(x) dif x
$ <eq-inner-fourier-basis-func>
#proof[
#im[åœæ£æŽæ°$n$äž$m$满足]ïŒ$n, m > 0$æ¶ïŒ
$
<|sin(n w t), sin(m w t)|> &= Integral(-T/2, T/2, sin(n w t) dot.c sin(m w t), dif: t) \
&= cIntegral(1/2 (cos(n - m) w t - cos((n + m) w t))) \
$
åæ
åµè®šè®ºïŒåœ$m != n$æ¶ïŒæ ¹æ® @def-integral-of-cos-func å¯åŸïŒ
$
<|sin(n w t), sin(m w t)|> &= 1 /2 dot.c (Integral(-T/2, T/2, cos(n - m) w t, dif: t) - Integral(-T/2, T/2, cos(n+m) w t, dif:t) ) \
&= 1 / 2 dot.c (0 + 0) \
&= 0
$
åœ$m = n$æ¶ïŒå¯åŸïŒ
$
<|sin(n w t), sin(m w t)|> &= 1 /2 dot.c (Integral(-T/2, T/2, cos(n - m) w t, dif: t) - Integral(-T/2, T/2, cos(n+m) w t, dif:t) ) \
&= 1/ 2 dot.c (cIntegral(1) - cIntegral( cos(2 n w t) )) \
&= 1 / 2 dot.c T \
&= T / 2
$
åçå¯åŸïŒ
$
<|cos(n w t), cos(m w t)|> =
cases(
0\, quad "if " n != m,
T/2\, quad "if " n = m
)
$
$
<|sin(n w t), cos(m w t)|> &= Integral(-T/2, T/2, 1/2 dot.c (sin(n + m) w t + sin(n - m) w t ), dif: t) \
$
åœ$n != m$æ¶ïŒç± @def-integral-of-sin-func å¯åŸïŒ
$
<|sin(n w t), cos(m w t)|> = 0
$
åœ$n = m$æ¶ïŒå¯åŸïŒ
$
<|sin(n w t), cos(m w t)|> &= Integral(-T/2, T/2, 1/2 dot.c (sin(n + m) w t + sin(n - m) w t ), dif: t) \
&= cIntegral(1 / 2 sin(2 n w t)) \
&= 0
$
]
= å
éå¶çº§æ°
ä»»æäžäžª#im[åšæäžº$T$çåœæ°]éœå¯ä»¥å±åŒäžºäžåé¢çççæ£åŒŠäžäœåŒŠåœæ°ç线æ§ç»åïŒå³ïŒ
$
f(x) = sum_(n=0)^infinity (a_n sin n omega x + b_n cos n omega x)
$ <eq-fourier-series>
对äº@eq-fourier-seriesïŒæä»¬éèŠæ±è§£ç³»æ°$a_n$äž$b_n$ãæ ¹æ®#im[å
éå¶æ£äº€åœæ°ç³»çæ§èŽš]å¯ç¥ïŒ
åœ$n > 0$æ¶ïŒæ±è§£ç³»æ°$a_n$æ¶ïŒå¯ä»¥å©çšå
¬åŒïŒ
$
<| f(x), sin(n omega x)|> &= Integral(-T/2, T/2, f(x) dot.c sin n omega x) \
&= cIntegral(sin n omega x dot.c (sum_(n = 0)^infinity (a_n sin n omega x + b_n cos n omega x)) ) \
&= sum_(n=0)^infinity (a_n dot.c cIntegral(sin n omega x dot.c sin n omega x) + b_n cIntegral(sin n omega x dot.c cos n omega x) ) \
&= a_n cIntegral(sin n omega x dot.c sin n omega x) \
&= a_n dot.c T / 2
$
å æ€ïŒå¯ä»¥åŸå°
$
a_n = 2 / T dot.c <| f(x), sin n omega x |> = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c sin n omega x dif x
$
åçïŒå¯¹äºç³»æ°$b_n$ïŒå¯ä»¥åŸå°ïŒ
$
b_n = 2 / T dot.c <| f(x), cos n omega x |> = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c cos n omega x dif x
$
对äº$n = 0$çç¹æ®æ
åµïŒç±äºç±äºåœ$n = 0$æ¶ïŒ
$
cases(
sin n w t = 0,
cos n w t = 1
)
$
å æ€@eq-fourier-series äžç项$a_0 dot.c sin (0 dot.c omega x)$没ææä¹ïŒç³»æ°$a_0$å¯ä»¥äžºä»»æåŒã
对äºé¡¹$b_0 dot.c cos(0 dot.c omega x)$èèšïŒå
¶åŒäžº$1$ïŒåç³»æ°$b_0$å¯ä»¥æ±è§£ã对äºç³»æ°$b_0$ïŒå¯ä»¥æ±åŸïŒ
$
<| f(x), 1 |> &= Integral(-T/2, T/2, f(x) dot.c 1) \
&= cIntegral((sum_(i=0)^infinity (a_n sin n omega x + b_n cos n omega x)) dot.c 1) \
&= sum_(i=0)^(infinity) (a_n dot.c cIntegral(sin n omega x) + b_n dot.c cIntegral(cos n omega x)) quad (1"äž" sin n omega x, cos n omega x text("çåœæ°æ£äº€æ§)") \
&= b_0 dot.c cIntegral(cos (0 dot.c omega x)) \
&= b_0 dot.c T
$
å æ€å¯åŸïŒ
$
b_0 = 1/T dot.c <| f(x), 1 |> = 1 / T dot.c integral_(-T/2)^(T/2) f(x) dif x
$
#im[䞺äºåç»æ¹äŸ¿è®šè®ºïŒä»¥åç»äžåœ¢åŒç³»æ°ç衚述圢åŒ]ã@eq-fourier-series äžåœ$n = 0$æ¶çç¹æ®åžžæ°é¡¹$a_0 sin 0 + b_0 cos 0 = b_0$å¯ä»¥äœ¿çšå䞪垞æ°é¡¹æ¥è¡šç€ºïŒå³ä»€ïŒ
$
c_0 / 2 = a_0 sin 0 + b_0 cos 0 = b_0
$
å æ€ïŒ@eq-fourier-series å¯ä»¥è¡šè¿°äžºïŒ
$
f(x) = c_0 / 2 + sum_(i=1)^infinity (a_n dot.c sin n omega x + b_n dot.c cos n omega x)
$ <eq-fourier-series-general>
å
¶äžçç³»æ°å¯ä»¥äœ¿çš#im[ç»äžç圢åŒ]æ¥è¡šç€ºäžºïŒ
$
cases(
c_0 = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dif x,
a_n = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c sin n omega x dif x,
b_n = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c cos n omega x dif x,
)
$ <factors-of-fourier-series>
= 倿°å
éå¶çº§æ°
== 倿°å
éå¶çº§æ°æšå¯Œ
å
éå¶çº§æ°äžçæ¯é¡¹$a_n sin n omega x + b_n cos n omega x$éœåæ¶å«æäž€äžªåºåœæ°$sin n omega x$äž$cos n omega x$ã#im[䞺äºè¡šèŸŸçç®åæ§ïŒæä»¬éèŠå¯»æŸäžç§æ¹åŒæ¥å°æ¯é¡¹äžç䞀䞪åºåœæ°è¡šç€ºäžºå䞪åºåœæ°ã] å©ç𿬧æå
¬åŒïŒæä»¬å¯ä»¥äœ¿çšå€æ°æ¥åæ¶è¡šç€º$sin n omega x$äž$cos n omega x$åœæ°ã
欧æå
¬åŒçæ°åŠè¡šè¿°äžºïŒ
$
e^(i x) = cos x + i sin x
$
å圢å¯ä»¥åŸå°ïŒ
$
e^(-i x) = cos x - i sin x
$
å æ€ïŒ$sin x$äž$cos x$å¯ä»¥è¡šç€ºäžºïŒ
$
cases(
sin x = (e^(i x) - e^(-i x)) / (2 i),
cos x = (e^(i x) + e^(- i x)) / 2
)
$
å æ€ïŒ@eq-fourier-series-general å¯ä»¥è¡šè¿°äžºïŒ
$
f(x) &= c_0 / 2 + sum_(n=1)^infinity (a_n dot.c (e^(i n w x) - e^(-i n w x)) / (2 i) + b_n dot.c (e^(i n w x) + e^(-i n w x)) / 2) \
&= c_0 / 2 + sum_(n=1)^infinity (a_n dot.c (- i^2) / (2 i) (e^(i n w x) - e^(-i n w x)) + b_n / 2 dot.c (e^(i n w x) + e^(-i n w x))) \
&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n) / (2) (e^(i n w x) - e^(-i n w x)) + b_n / 2 dot.c (e^(i n w x) + e^(-i n w x))) \
&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n + b_n) / (2) dot.c e^(i n w x) + (i a_n + b_n) / 2 dot.c e^(-i n w x)) \
&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n + b_n) / (2) dot.c e^(i n w x)) + sum_(n=1)^infinity ((i a_n + b_n) / 2 dot.c e^(-i n w x)) \
&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n + b_n) / (2) dot.c e^(i n w x)) + sum_(n=-infinity)^(-1) ((i a_(-n) + b_(-n)) / 2 dot.c e^(i n w x)) \
$ <eq-complex-form-fourier-series-tmp>
åœ$n = 0$æ¶ïŒå$e^(i n omega x)$䞺ïŒ
$
e^(i 0 w x) = cos 0 + i sin 0 = 1
$
å æ€@eq-complex-form-fourier-series-tmp å¯ä»¥äœ¿çšå€æ°è¡šç€ºäžº
$
f(x) = sum_(n = -infinity)^infinity d_n e^(i n omega x)
$
å
¶äž$d_n$䞺ïŒ
$
d_n = cases(
(-i a_n + b_n) / 2 &\, quad n > 0,
1/2 c_0 &\, quad n = 0,
(i a_(-n) + b_(-n)) / 2 &\, quad n < 0
)
$
å°@factors-of-fourier-series 代å
¥ïŒå¯ä»¥åŸå°ïŒ
$
1/2 c_0 &= 1 / 2 dot.c 2 / T Integral(-T/2, T/2, f(x)) \
&= 1 / T cIntegral(f(x) dot.c e^(-i n 0 x))
$
$
(-i a_n + b_n) / 2 &= 1 / 2 dot.c 2 / T dot.c Integral(-T/2, T/2, f(x) (-i sin n w x + cos n w x)) \
&= 1 / T dot.c cIntegral(f(x) dot.c e^(-i n omega x))
$
$
(i a_(-n) + b_(-n)) / 2 &= 1 / 2 dot.c 2 / T Integral(-T/2, T/2, f(x) (i sin (-n omega x) + cos(-n omega x))) \
&= 1 / T dot.c cIntegral(f(x) dot.c e^(-i n omega x))
$
å æ€ïŒåæ°$d_n$å¯ä»¥ç»äžè¡šè¿°äžºïŒ
$
d_n = 1 / T Integral(-T/2, T/2, f(x) e^(-i n omega x))
$
#definition("å
éå¶çº§æ°ç倿°åœ¢åŒ")[
$
f(x) &= sum_(n=-infinity)^(infinity) d_n e^(i n omega x) \
&= sum_(n=-infinity)^(infinity) (1 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c e^(-i n omega x) dif x) dot.c e^(i n omega x)
$
]
== 倿°å
éå¶çº§æ°çæ£äº€åœæ°ç³»
对äºåšæäžº$T$çåœæ°$f(x)$ïŒä»å€æ°åè§åºŠæ¥è®²ïŒåšæåœæ°$f(x)$å¯ä»¥è¡šç€ºäžºå®åå€åŒåœæ°ç³»$cal(R)$ç线æ§ç»åïŒå
¶äžåœæ°ç³»$cal(R)$䞺ïŒ
$
cal(R) = { e^(i n omega x) | n in Z}
$
å æ€ïŒåœæ°$f(x)$å¯ä»¥è¡šç€ºäžºïŒ
$
f(x) = sum_(-infinity)^(infinity) d_n dot.c e^(i n omega x)
$
对äºåœæ°ç³»$cal(R)$èèšïŒå
¶å®ä¹çå
积䞺Hermitå
积ïŒåŠïŒ
$
<| f(x), g(x) |> = 1 / T integral_(-T/2)^(T/2) f(x) dot.c overline(g(x)) dif x
$
äºå®äžïŒå¯ä»¥è¯æåœæ°ç³»$cal(R)$æ¯#im[è§èæ£äº€ç]ïŒå³ïŒ
$
<| e^(i n omega x), e^(i m omega x) |> &= 1 / (T) Integral(-T/2, T/2, e^(i n omega x) dot.c overline(e^(i m omega x))) \
&= 1 / (T) cIntegral(e^(i n omega x) dot.c e^(-i m omega x)) \
&= 1 / (T) cIntegral(e ^(i (n - m) omega x))
$
åœ$n = m$æ¶ïŒæïŒ
$
<| e^(i n omega x), e^(i m omega x) |> &= 1 / (T) Integral(-T/2, T/2, 1) \
&= 1
$
åœ$n != m$æ¶ïŒæïŒ
$
<| e^(i n omega x), e^(i m omega x) |> &= 1 / T Integral(-T/2, T/2, e^(i (n - m) omega x)) \
&= 1 / T cIntegral(cos(n - m) omega x + i sin(n - m) omega x) \
&= 1 / T (cIntegral(cos(n - m) omega x) + i cIntegral(sin(n - m) omega x) ) \
&= 0
$
å æ€ïŒç³»æ°$d_n$å¯ä»¥éè¿hermitå
积æ¥è¿è¡æ±è§£ïŒ
$
d_n &= <| f(x), e^(i n omega x) |> \
&= 1 / T Integral(-T/2, T/2, f(x) dot.c e^(-i n omega x))
$
= éåœ
== äžè§åœæ°ç§¯ååå·®å
¬åŒ
$
e^(i x) = cos x + i sin x
$ <eq-euler-equation>
å æ€ïŒå¯ä»¥åŸå°
$
cases(
sin x = (e^(i x) - e^(- i x)) / (2 i ),
cos x = (e^(i x) + e^(- i x)) / 2
)
$ <eq-sin-cos-form-of-eulur>
$
cases(
sin alpha dot.c sin beta = 1/2 (cos (alpha - beta) - cos (alpha + beta)),
cos alpha dot.c cos beta = 1/2 (cos (alpha - beta) + cos(alpha + beta)),
sin alpha dot.c cos beta = 1/2 (sin(alpha + beta) + sin(alpha - beta))
)
$
#linebreak()
以$sin alpha dot.c sin beta$䞺äŸïŒäœ¿çš@eq-euler-equation è¿è¡è¯æã
#proof[
#let eulur_expr = (a, b, o) => $e^(#a) #o e^(#b)$
å°@eq-sin-cos-form-of-eulur 垊å
¥ $sin alpha dot.c sin beta$äžïŒåŸå°ïŒ
$
sin alpha dot.c sin beta &= (#eulur_expr($i alpha$, $- i alpha$, $-$)) / (2 i) dot.c (#eulur_expr($i beta$, $-i beta$, $-$)) / (2 i) \
&=((e^(i (alpha + beta)) - e^(i (alpha - beta)) ) - (e^(-i (alpha - beta)) - e^(-i (alpha + beta)))) / (-4) \
&= ((e^(i (alpha + beta)) + e^(-i (alpha + beta)) ) - (e^(i (alpha - beta)) + e^(-i (alpha - beta)))) / (-4) \
&= -1/4 (2 dot.c cos(alpha + beta) - 2 dot.c cos(alpha - beta)) \
&= 1/2 (cos(alpha - beta) - cos(alpha + beta))
$
è¯æå®æã
]
== äžè§åœæ°çå
积
#definition("äžè§åœæ°ç积å")[
äžè§åœæ°$sin w t $äž$cos w t$åšåšæ$[-T/2, T/2]$å
ç积å䞺0ïŒå³ïŒ
$
integral_(-T/2)^(T/2) sin w t dif t = 0 \
integral_(-T/2)^(T/2) cos w t dif t = 0 \
$
å
¶äž$w = (2 pi) / T$ïŒ$T$䞺äžè§åœæ°$sin(w t)$äž$cos (w t)$çæå°åšæã
]
#proof[
$
Integral(-T/2, T/2, sin w t, dif: t) &= lr(-1 / w cos w t |)_(-T/2)^(T/2) \
&= -1/w ( cos ((2 pi) / T dot.c T / 2) - cos((2 pi) / T dot.c -T / 2 )) \
&= -1 / w (cos pi - cos(-pi)) \
&= 0
$ <def-integral-of-sin-func>
$
Integral(-T/2, T/2, cos w t, dif: t) &= lr(1 / w sin w t |)_(-T/2)^(T/2) \
&= 1/w ( sin ((2 pi) / T dot.c T / 2) - sin((2 pi) / T dot.c -T / 2 )) \
&= 1 / w (sin pi - sin(-pi)) \
&= 0
$ <def-integral-of-cos-func>
]
#lemma("äžè§åœ¢åšæåœæ°ç积å")[
åŠæäžè§åœæ°$sin w t$æ$cos w t$çæå°åšæäžº$T$ïŒå
¶é¢ç$w = (2 pi) / T$ïŒååœæ°$sin n w t$æè
$cos n w t$çåšåšæ$[-T/2, T/2]$äžç积å䞺0ïŒå³ïŒ
$
integral_(-T/2)^(T/2) sin n w t dif t = integral_(-T/2)^(T/2) cos n w t dif t = 0
$
]
#proof[
以$sin n w t$䞺äŸè¿è¡è¯æïŒ$cos n w t$çæ
åµç±»äŒŒã
什$w' = n w$ïŒååœæ°$sin n w t = sin w' t$ïŒå$T' = T / n$ïŒåæ ¹æ® @def-integral-of-sin-func 以å$sin$åœæ°çåšææ§ïŒå¯åŸïŒ
$
integral_(-T/2)^(T/2) sin n w t dif t &= integral_(-n T'/2)^(n T'/2) sin w' t dif t'\
&= sum_(k = 0)^n integral_(k T' - T'/2)^(k T' + T'/2) sin w' t dif t'\
&= sum_(k = 0)^n dot.c 0 \
&= 0
$
] |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-cv/0.1.0/README.md | markdown | Apache License 2.0 | # Modern CV
[](https://github.com/DeveloperPaul123/modern-cv/stargazers)
[](https://discord.gg/CX2ybByRnt)

A port of the [Awesome-CV](https://github.com/posquit0/Awesome-CV) Latex resume template in [typst](https://github.com/typst/typst).
## Requirements
You will need the `Roboto` and `Source Sans Pro` fonts installed on your system or available somewhere. If you are using the `typst` web app, no further action is necessary. You can download them from the following links:
- [Roboto](https://fonts.google.com/specimen/Roboto)
- [Source Sans Pro](https://github.com/adobe-fonts/source-sans-pro)
This template also uses FontAwesome icons via the `[fontawesome](https://typst.app/universe/package/fontawesome)` package.
See `typst fonts --help` for more information on configuring fonts for `typst` that are not installed on your system.
### Usage
Below is a basic example for a simple resume:
```typst
#import "@preview/modern-cv:0.1.0": *
#show: resume.with(
author: (
firstname: "John",
lastname: "Smith",
email: "<EMAIL>",
phone: "(+1) 111-111-1111",
github: "DeveloperPaul123",
linkedin: "Example",
address: "111 Example St. Example City, EX 11111",
positions: (
"Software Engineer",
"Software Architect"
)
),
date: datetime.today().display()
)
= Education
#resume_entry(
title: "Example University",
location: "B.S. in Computer Science",
date: "August 2014 - May 2019",
description: "Example"
)
#resume_item[
- #lorem(20)
- #lorem(15)
- #lorem(25)
]
```
### Output
| | |
| --- | --- |
|  |  | |
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/visualize/path.typ | typst | // Test paths.
--- path ---
#set page(height: 300pt, width: 200pt)
#table(
columns: (1fr, 1fr),
rows: (1fr, 1fr, 1fr),
align: center + horizon,
path(
fill: red,
closed: true,
((0%, 0%), (4%, -4%)),
((50%, 50%), (4%, -4%)),
((0%, 50%), (4%, 4%)),
((50%, 0%), (4%, 4%)),
),
path(
fill: purple,
stroke: 1pt,
(0pt, 0pt),
(30pt, 30pt),
(0pt, 30pt),
(30pt, 0pt),
),
path(
fill: blue,
stroke: 1pt,
closed: true,
((30%, 0%), (35%, 30%), (-20%, 0%)),
((30%, 60%), (-20%, 0%), (0%, 0%)),
((50%, 30%), (60%, -30%), (60%, 0%)),
),
path(
stroke: 5pt,
closed: true,
(0pt, 30pt),
(30pt, 30pt),
(15pt, 0pt),
),
path(
fill: red,
fill-rule: "non-zero",
closed: true,
(25pt, 0pt),
(10pt, 50pt),
(50pt, 20pt),
(0pt, 20pt),
(40pt, 50pt),
),
path(
fill: red,
fill-rule: "even-odd",
closed: true,
(25pt, 0pt),
(10pt, 50pt),
(50pt, 20pt),
(0pt, 20pt),
(40pt, 50pt),
),
)
--- path-bad-vertex ---
// Error: 7-9 path vertex must have 1, 2, or 3 points
#path(())
--- path-bad-point-count ---
// Error: 7-47 path vertex must have 1, 2, or 3 points
#path(((0%, 0%), (0%, 0%), (0%, 0%), (0%, 0%)))
--- path-bad-point-array ---
// Error: 7-31 point array must contain exactly two entries
#path(((0%, 0%), (0%, 0%, 0%)))
--- issue-path-in-sized-container ---
// Paths used to implement `LayoutMultiple` rather than `LayoutSingle` without
// fulfilling the necessary contract of respecting region expansion.
#block(
fill: aqua,
width: 20pt,
height: 15pt,
path(
(0pt, 0pt),
(10pt, 10pt),
),
)
|
|
https://github.com/rdboyes/resume | https://raw.githubusercontent.com/rdboyes/resume/main/cv.typ | typst | // Imports
#import "@preview/brilliant-cv:2.0.2": cv
#import "@preview/fontawesome:0.4.0"
#let metadata = toml("./metadata.toml")
#let importModules(modules, lang: metadata.language) = {
for module in modules {
include {
"modules_" + lang + "/" + module + ".typ"
}
}
}
#show: cv.with(
metadata
)
#importModules((
"professional",
"education",
"publications",
"skills",
))
|
|
https://github.com/alex-touza/fractal-explorer | https://raw.githubusercontent.com/alex-touza/fractal-explorer/main/paper/test.typ | typst | // unnumbered title page if needed
// ...
Title
#pagebreak()
// front-matter
#set page(numbering: "I")
#counter(page).update(1)
// ...
Acknowledgments
#pagebreak()
#outline()
// page counter anchor
#metadata(()) <front-matter>
#pagebreak()
// main document body
#set page(numbering: "1")
#counter(page).update(1)
/* HERE. Still using Roman numbers instead of Arabic. */
= Something
#lorem(4000)
// back-matter
#set page(numbering: "I")
// must take page breaks into account, may need to be offset by +1 or -1
#context counter(page).update(counter(page).at(<front-matter>).first() + 1)
= Glossary
#lorem(50) |
|
https://github.com/tilman151/pypst | https://raw.githubusercontent.com/tilman151/pypst/main/docs/examples/document/template.typ | typst | MIT License | #import "@preview/charged-ieee:0.1.0": ieee
#show: ieee.with(
title: [Using Templates with Pypst],
abstract: [#lorem(100)],
authors: (
(
name: "Alice",
department: [Co-Author],
organization: [Best University],
email: "<EMAIL>"
),
(
name: "Bob",
department: [Co-Author],
organization: [Best University],
email: "<EMAIL>"
),
),
index-terms: ("Scientific writing", "Typesetting", "Document creation", "Syntax")
)
// include generated file
#include("my-document.typ") |
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/02-concepts/dimension/devanagari.typ | typst | Other | #import "/lib/draw.typ": *
#import "/lib/glossary.typ": tr
#import "/template/lang.typ": devanagari
#let start = (0, 0)
#let end = (1000, 260)
#let (basex, basey) = (120, 70)
#let width = 740
#let example = devanagari[à€à€Ÿà€à€ªà¥à€à¥ #h(-0.25em)à€°à€Ÿà€«à¥]
#let graph = with-unit((ux, uy) => {
// mesh(start, end, (100, 100), stroke: 1 * ux + gray)
let lines = (
([åé³ç¬Šå·çº¿], "rb", end.at(0), basex, basey + 153),
([#tr[headline]], "lb", 0, basex + width, basey + 100),
([#tr[baseline]], "lb", 0, basex + width, basey),
([åé³ç¬Šå·çº¿], "rb", end.at(0), basex, basey - 50),
)
for (body, anchor, xs, xe, y) in lines {
segment((xs, y), (xe, y), stroke: 2 * ux + gray.darken(30%))
txt(body, (xs, y), anchor: anchor, size: 25 * ux, dy: 4)
}
txt(example, (basex, basey), anchor: "lb", size: 170 * ux)
})
#canvas(end, start: start, width: 90%, graph)
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-A840.typ | typst | Apache License 2.0 | #let data = (
("PHAGS-PA LETTER KA", "Lo", 0),
("PHAGS-PA LETTER KHA", "Lo", 0),
("PHAGS-PA LETTER GA", "Lo", 0),
("PHAGS-PA LETTER NGA", "Lo", 0),
("PHAGS-PA LETTER CA", "Lo", 0),
("PHAGS-PA LETTER CHA", "Lo", 0),
("PHAGS-PA LETTER JA", "Lo", 0),
("PHAGS-PA LETTER NYA", "Lo", 0),
("PHAGS-PA LETTER TA", "Lo", 0),
("PHAGS-PA LETTER THA", "Lo", 0),
("PHAGS-PA LETTER DA", "Lo", 0),
("PHAGS-PA LETTER NA", "Lo", 0),
("PHAGS-PA LETTER PA", "Lo", 0),
("PHAGS-PA LETTER PHA", "Lo", 0),
("PHAGS-PA LETTER BA", "Lo", 0),
("PHAGS-PA LETTER MA", "Lo", 0),
("PHAGS-PA LETTER TSA", "Lo", 0),
("PHAGS-PA LETTER TSHA", "Lo", 0),
("PHAGS-PA LETTER DZA", "Lo", 0),
("PHAGS-PA LETTER WA", "Lo", 0),
("PHAGS-PA LETTER ZHA", "Lo", 0),
("PHAGS-PA LETTER ZA", "Lo", 0),
("PHAGS-PA LETTER SMALL A", "Lo", 0),
("PHAGS-PA LETTER YA", "Lo", 0),
("PHAGS-PA LETTER RA", "Lo", 0),
("PHAGS-PA LETTER LA", "Lo", 0),
("PHAGS-PA LETTER SHA", "Lo", 0),
("PHAGS-PA LETTER SA", "Lo", 0),
("PHAGS-PA LETTER HA", "Lo", 0),
("PHAGS-PA LETTER A", "Lo", 0),
("PHAGS-PA LETTER I", "Lo", 0),
("PHAGS-PA LETTER U", "Lo", 0),
("PHAGS-PA LETTER E", "Lo", 0),
("PHAGS-PA LETTER O", "Lo", 0),
("PHAGS-PA LETTER QA", "Lo", 0),
("PHAGS-PA LETTER XA", "Lo", 0),
("PHAGS-PA LETTER FA", "Lo", 0),
("PHAGS-PA LETTER GGA", "Lo", 0),
("PHAGS-PA LETTER EE", "Lo", 0),
("PHAGS-PA SUBJOINED LETTER WA", "Lo", 0),
("PHAGS-PA SUBJOINED LETTER YA", "Lo", 0),
("PHAGS-PA LETTER TTA", "Lo", 0),
("PHAGS-PA LETTER TTHA", "Lo", 0),
("PHAGS-PA LETTER DDA", "Lo", 0),
("PHAGS-PA LETTER NNA", "Lo", 0),
("PHAGS-PA LETTER ALTERNATE YA", "Lo", 0),
("PHAGS-PA LETTER VOICELESS SHA", "Lo", 0),
("PHAGS-PA LETTER VOICED HA", "Lo", 0),
("PHAGS-PA LETTER ASPIRATED FA", "Lo", 0),
("PHAGS-PA SUBJOINED LETTER RA", "Lo", 0),
("PHAGS-PA SUPERFIXED LETTER RA", "Lo", 0),
("PHAGS-PA LETTER CANDRABINDU", "Lo", 0),
("PHAGS-PA SINGLE HEAD MARK", "Po", 0),
("PHAGS-PA DOUBLE HEAD MARK", "Po", 0),
("PHAGS-PA MARK SHAD", "Po", 0),
("PHAGS-PA MARK DOUBLE SHAD", "Po", 0),
)
|
https://github.com/suiranruofeng/notebook | https://raw.githubusercontent.com/suiranruofeng/notebook/main/GW/åŒåäžåŒåæ³¢.typ | typst | #align(center, text(17pt)[*General Relativity: Gravitational wave and Cosmology Notebook*])
#align(center)[XuweiZhang \ #link("<EMAIL>")]
#set heading(numbering: "1.")
= çæåç
== çæåçç衚述
åšèªç±äžèœçåéæºéæ æ³æ£éªçš³å®ååçéæå€åŒååºïŒå 䞺åäžçåŒåååäžçæ¯æ§åçžäºæµæ¶äºã对äºäžè¬çè¿åšïŒæä»¬å¯¹äº$N$䞪莚ç¹çç³»ç»ïŒåšå€å$bold(F)(bold(x)_N-bold(x)_M)$åå€åŒååº$bold(g)$çäœçšäž
$ m_N (d^2bold(x)_N)/(d t^2)=m_N bold(g)+sum_M bold(F)(bold(x)_N-bold(x)_M) $
å宿们äœäžäžªæ¶ç©ºåæ 忢
$ x'=x-1/2g t^2,space t'=t $
è¿æ ·$bold(g)$å°±è¢«æ¯æ§åææµæ¶ïŒè¿åšæ¹çšå䞺
$ m_N (d^2 bold(x')_N)/(d t'^2)=sum_M bold(F)(bold(x')_N-bold(x')_M) $
è¿å°±æ¯èªç±äžèœåæ ç³»ã
== åæ åæ¢äžèç»
== 床è§åŒ é
|
|
https://github.com/francescoo22/LCD-exercises | https://raw.githubusercontent.com/francescoo22/LCD-exercises/main/src/M.typ | typst | #import "common.typ": *
#import "rules.typ": *
= Exercise M
Discuss an extension of CCS with an operator of sequential composition between processes $P; Q$. Provide an operational semantics and analyze the possibility of having an encoding in CCS of the defined operator.
*Solution*
== $CCS_seq$
$ P, Q ::= K | alpha . P | sum_(i in I) alpha . P_i | (P | Q) | P[f] | P without L | P;Q $
== Operational Semantics
#v(2em)
*Classical rules*
#grid(
columns: (auto, auto, auto),
column-gutter: 1fr,
row-gutter: 2em,
c1, c2, c3, c4, c5, c6, c7, c8
)
#v(2em)
*$CCS_seq$ rules*
#grid(
columns: (auto, auto, auto),
column-gutter: 1fr,
row-gutter: 2em,
r1, r2, r3, r4, r5, r6, r7, r8
)
#include "encoding.typ"
#include "lemmas.typ"
== Equivalence
$ forall P in CCS_seq . P approx e(P) wnu $
let $ cr = {(P, Q wnu) | P, Q in CCS_seq , Q approx e(P)} $
we need to prove that $cr$ is a weak bisimulation i.e.
- $forall P in CCS_seq . fi P atrans P' then e(P) wnu awtrans P'' wnu and P' cr (P'' wnu)$
- $forall P in CCS_seq . fi e(P) wnu atrans P'' wnu then P awtrans P' and P' cr (P'' wnu)$
The proof is done by induction on the height of the derivation tree, so we can rewrite it as follows:
- $forall P in CCS_seq . forall h in NN . fi P atrans P' "with tree of height" h then e(P) wnu awtrans P'' wnu and P' cr (P'' wnu)$
- $forall P in CCS_seq . forall h in NN . fi e(P) wnu atrans P'' wnu "with tree of height" h then P awtrans P' and P' cr (P'' wnu)$
=== First point
*base case h=1*
The only way a process can make a transition with derivation tree of height 1 is $ c1 $ and in this case also $ p1 $ and $P cr (e(P) wnu)$ because $e(P) approx e(P)$
*inductive case Const*
if $ c8 $
$=>^"by induction" e(P) wnu atrans P'' wnu "and" P' cr (P'' wnu)$
$=> e(P) atrans P''$ so #v(1em) $ p2 $ and $P' cr (P'' wnu)$
*inductive case Hide*
if $ c6 $
$=>^"by induction" e(P) wnu awtrans P'' wnu "and" P' cr (P'' wnu)\
=>^"relation" P'' approx e(P')\
=>^"only rule" e(P) awtrans P''$
$ p3 $
I have to prove that $P' wL cr P'' wL wnu$ i.e. $P'' wL approx e(P' wL)$
$ P'' wL approx^(P'' approx e(P')) e(P') wL = e(P' wL) $
*inductive case Red*
if $ c7 $
$=>^"by induction" e(P) wnu awtrans P'' wnu "and" P' cr (P'' wnu)\
=>^"only rule" e(P) awtrans P''$
and so $ p4 $
and $P''[f] approx^(P'' approx e(P')) e(P') [f] = e(P' [f]) => P'[f] cr P''[f] wnu$
*Inductive case Sum*
Sum case is trivial because if $ p5 $ also $ p6 $
and $P_j cr (e(P_j) wnu)$.
*Inductive case Par-1/Par-2/Par-3*
If $ c3 $
$=>^"by induction" e(P) wnu atrans P'' wnu "and" P' cr (P'' wnu)$
$=> e(P) atrans P''$
and so $ p7 $
#v(1em)
we need to show that $(P'|Q) cr (P''[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup wnu$
which is equivalent to show that $(P''[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup approx e(P'|Q)$
$ P' cr P'' wnu =>^(cr "definition") P'' approx e(P') \ =>^"bisim properties" (P''[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup approx (e(P')[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup = e(P'|Q) $
Par-2 and Par-3 are similar
*Inductive case Seq-L*
If $ r7 $
$=>^"by induction" e(P) wnu atrans P'' wnu "and" P' cr (P'' wnu)$
$=> e(P) atrans P''$
and so $ p8 $
#v(1em)
we need to show that $(P';Q) cr (P''[nu'/nu] | overline(v') . e(Q)) wnup wnu$
which is equivalent to show that $(P''[nu'/nu] | overline(v') . e(Q)) wnup approx e(P';Q)$
$ P' cr P'' wnu =>^(cr "definition") P'' approx e(P') \ =>^"bisim properties" (P''[nu'/nu] | overline(v') . e(Q)) wnup approx (e(P')[nu'/nu] | overline(v') . e(Q)) wnup = e(P';Q) $
*Inductive case Seq-R*
If $ r8 $
$P ended =>^"lemma 0" e(P) ->^(tau*) P_"temp" ntrans P' and P' ended$
$Q atrans Q'=>^"by induction" e(Q) wnu atrans Q'' wnu "and" Q' cr (Q'' wnu) => e(Q) atrans Q''$
and so $ p9 $
#v(2em)
$ p10 $
#v(2em)
$ p11 $
#v(2em)
Now I have to prove that $Q' cr (P' [nu'/nu] | Q'') wnup wnu$
Which is equivalent to prove that $(P' [nu'/nu] | Q'') wnup approx e(Q')$
$ P' ended =>^"End-Red" P'[nu'/nu] ended =>^"lemma 3" P'[nu'/nu] approx 0 \ => (P' [nu'/nu] | Q'') wnup approx (0 | Q'') wnup approx^(Q'' approx e(Q')) (0 | e(Q')) wnup approx^"lemma 4" 0 | e(Q') approx e(Q') $ |
|
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/3_PB/PianoDiProgetto/sections/ConsuntivoSprint/UndicesimoSprint.typ | typst | MIT License | #import "../../const.typ": Re_cost, Am_cost, An_cost, Ve_cost, Pr_cost, Pt_cost
#import "../../functions.typ": rendicontazioneOreAPosteriori, rendicontazioneCostiAPosteriori, glossary
==== Undicesimo consuntivo
*Inizio*: Venerdì 01/03/2024
*Fine*: Giovedì 07/03/2024
#rendicontazioneOreAPosteriori(sprintNumber: "11")
#rendicontazioneCostiAPosteriori(sprintNumber: "11")
===== Analisi a posteriori
La retrospettiva ha evidenziato come il totale delle ore preventivato per questo #glossary("sprint") si possa dire rispettato. La differenza tra preventivo e consuntivo Ú infatti pari a tre ore, che sul totale preventivato di 60 ore lavorative costituiscono un distacco pari al 5%, più che accettabile.
Si vuole evidenziare come nel corso di questo #glossary("sprint"), per la prima volta, ciascun componente del team abbia totalizzato una media di quasi 10 ore produttive. Questo Ú coerente con la disponibilità espressa dal team dopo la prima revisione #glossary[RTB] e con la necessità di ogni membro di raggiungere la seconda revisione #glossary[PB] avendo impiegato almeno 80 ore produttive, il minimo per poter concludere il progetto.
L'unica differenza significativa tra preventivo e consuntivo si può ritrovare nelle ore del ruolo di Amministratore: si era infatti erroneamente sottostimata la dimensione, in termini di ore produttive, delle task assegnate agli Amministratori.
à stato inoltre rilevato che le ore assegnate all'attività di revisione, sebbene complessivamente non dissimili da quelle consuntivate, sono state distribuite su un numero esiguo di membri. Per questo motivo, nei prossimi #glossary[sprint] sarà bene distribuire il carico di lavoro su un numero maggiore di persone, evitando di concentrarlo solamente su alcuni individui. Infatti, designando ripetutamente gli stessi membri del team come Verificatori, si rischia di limitare la diversità di prospettive applicate al processo di verifica, portando ad una mancanza di identificazione di potenziali problemi o miglioramenti e, a lungo andare, ad un abbassamento della qualità del lavoro svolto.
===== Aggiornamento della pianificazione e gestione dei rischi
Nel corso dello #glossary("sprint") in oggetto si Ú manifestato il rischio tecnologico RT1 o conoscenza tecnologica limitata: tale rischio si Ú concretizzato nell'utilizzo dello strumento Pydantic. Tuttavia, considerando il ruolo non centrale di tale libreria nell'#glossary[architettura] del progetto, il team ha optato per la sua rimozione.
In questo caso le misure preventive individuate non sono state efficaci nell'eludere il rischio: il team, sottovalutando la complessità dello strumento, non aveva immaginato che potesse creare dei rallentamenti nello sviluppo e, di conseguenza, non ha applicato le misure preventive individuate.
Come enunciato nell'analisi sopra, si Ú anche manifestato il rischio di comunicazione RC6 o ripetizioni nelle assegnazioni del ruolo di Verificatore: in particolare, sarebbe bene evitare scenari in cui gli stessi componenti del team vengono incaricati di verificare la #glossary[documentazione] ripetutamente, mentre altri il codice, senza che questi si scambino mai tali responsabilità ; in futuro, dunque, il team ha intenzione di adottare una rotazione più efficace del ruolo, come delineato nelle misure preventive del rischio.
Il team ha inoltre rilevato l'esigenza di intensificare il dialogo con la Proponente: nonostante le misure preventive per il rischio di comunicazione RC3 (frequenza limitata nella comunicazione con la Proponente), siano chiare riguardo alla necessità di mantenere una frequenza di incontri, e di conseguente ricezione di feedback, perlomeno settimanale, non vi Ú stato alcun tipo di comunicazione con l'azienda da all'incirca due settimane. Di conseguenza, si Ú rimarcata la volontà di organizzare un incontro al più presto e, possibilmente, di reintrodurre la frequenza settimanale che ha caratterizzato il periodo antecedente l'#glossary[RTB].
Infine, nonostante non si sia propriamente manifestato il rischio di pianificazione RP3 o "Variazioni nei tempi e costi del progetto", la decisione del team di non effettuare la terza revisione #glossary[CA] (rintracciabile nel verbale interno del 04/03) ha comunque avuto un impatto sulla pianificazione: infatti, se nel preventivo a finire redatto in occasione dell' #glossary[RTB] erano state dedicate alcune risorse allo svolgimento della #glossary[CA], ora queste sono utilizzabili in preparazione alla #glossary[PB]. Perciò non solo viene aggiornata la pianificazione all'interno del _Piano di Progetto_ aumentando le ore produttive a disposizione per determinati ruoli (Responsabile, Amministratore, Programmatore e Verificatore), ma il team ha anche intenzione di aumentare ulteriormente il ritmo di lavoro per sfruttare efficacemente le risorse aggiuntive a disposizione.
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/visualize/shape-ellipse-00.typ | typst | Other | // Default ellipse.
#ellipse()
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/stonewall/0.1.0/example/example.typ | typst | Apache License 2.0 | #import "../stonewall.typ": flags
#set page(width: 200pt, height: auto, margin: 0pt)
#set text(fill: black, size: 12pt)
#set text(top-edge: "bounds", bottom-edge: "bounds")
#stack(
spacing: 3pt,
..flags.map(((name, preset)) => block(
width: 100%,
height: 20pt,
fill: gradient.linear(..preset),
align(center + horizon, smallcaps(name)),
))
) |
https://github.com/MattiaOldani/Informatica-Teorica | https://raw.githubusercontent.com/MattiaOldani/Informatica-Teorica/master/capitoli/calcolabilità /04_cardinalità .typ | typst | #import "../alias.typ": *
#import "@preview/lemmify:0.1.5": *
#let (
theorem, lemma, corollary,
remark, proposition, example,
proof, rules: thm-rules
) = default-theorems("thm-group", lang: "it")
#show: thm-rules
#show thm-selector("thm-group", subgroup: "theorem"): it => block(
it,
stroke: red + 1pt,
inset: 1em,
breakable: true
)
#show thm-selector("thm-group", subgroup: "proof"): it => block(
it,
stroke: green + 1pt,
inset: 1em,
breakable: true
)
= CardinalitÃ
== Isomorfismi
Due insiemi $A$ e $B$ sono *isomorfi* (_equinumerosi_) se esiste una biiezione tra essi. Formalmente scriviamo: $ A tilde B. $
Detto $cal(U)$ l'insieme di tutti gli insiemi, la relazione $tilde$ Ú sottoinsieme di $cal(U)^2$.
Dimostriamo che $tilde$ Ú una relazione di equivalenza:
- *riflessività *: $A tilde A$, usiamo come biiezione la funzione identità $i_A$;
- *simmetria*: $A tilde B arrow.long.double B tilde A$, usiamo come biiezione la funzione inversa;
- *transitività *: $A tilde B and B tilde C arrow.long.double A tilde C$, usiamo come biiezione la composizione della funzione usata per $A tilde B$ con la funzione usata per $B tilde C$.
Dato che $tilde$ Ú una relazione di equivalenza, ci permette di partizionare l'insieme $cal(U)$. La partizione che ne risulta Ú formata da classi di equivalenza che contengono insiemi isomorfi, ossia con la stessa cardinalità .
Possiamo, quindi, definire la *cardinalità * come l'insieme quoziente di $cal(U)$ rispetto alla relazione $tilde$.
Questo approccio permette di confrontare tra loro la cardinalità di insiemi infiniti, dato che basta trovare una funzione biettiva tra i due insiemi per poter affermare che siano isomorfi.
== Cardinalità finita
La prima classe di cardinalità che vediamo Ú quella delle *cardinalità finite*.
Definiamo la seguente famiglia di insiemi: $ J_n = cases(emptyset & text(" se ") n = 0, {1,...,n} & text(" se ") n > 0) quad . $
Diremo che un insieme $A$ ha cardinalità finita se e solo se $A tilde J_n$ per qualche $n in NN$. In tal caso possiamo scrivere $|A| = n$.
La classe di equivalenza $[J_n]_tilde$ identifica tutti gli insiemi di $cal(U)$ contenenti $n$ elementi.
== Cardinalità infinita
L'altra classe di cardinalità Ú quella delle *cardinalità infinite*, ovvero gli insiemi non in relazione con $J_n$. Questi insiemi sono divisibili in:
- insiemi *numerabili*;
- insiemi *non numerabili*.
Analizziamo le due tipologie separatamente.
=== Insiemi numerabili
Un insieme $A$ Ú numerabile se e solo se $A tilde NN$, ovvero $A in [NN]_tilde$.
Gli insiemi numerabili vengono detti anche "*listabili*", in quanto Ú possibile elencare _tutti_ gli elementi dell'insieme $A$ tramite una regola, la funzione $f$ biettiva tra $NN$ e $A$. Grazie alla funzione $f$, Ú possibile elencare gli elementi di $A$ formando l'insieme: $ A = {f(0), space f(1), space dots}. $ Questo insieme Ú esaustivo, dato che elenca ogni elemento dell'insieme $A$ senza perderne nessuno.
Tra gli insiemi numerabili più famosi troviamo:
- numeri pari $PP$ e numeri dispari $DD$;
- numeri interi $ZZ$, generati con la biiezione $f(n) = (-1)^n (frac(n + (n mod 2), 2))$;
- numeri razionali $QQ$.
Gli insiemi numerabili hanno cardinalità $aleph_0$ (si legge _"aleph zero"_).
=== Insiemi non numerabili
Gli *insiemi non numerabili* sono insiemi a cardinalità infinita ma che non sono listabili come gli insiemi numerabili: sono "più fitti" di $NN$. Questo significa che ogni lista generata mancherebbe di qualche elemento e, quindi, non sarebbe esaustiva di tutti gli elementi dell'insieme.
Il più famoso insieme non numerabile Ú l'insieme dei numeri reali $RR$.
#theorem(numbering: none)[
L'insieme $RR$ non Ú numerabile ($RR tilde.not NN$).
]
#proof[
\ Suddividiamo la dimostrazione in tre punti:
+ dimostriamo che $RR tilde (0,1)$;
+ dimostriamo che $NN tilde.not (0,1)$;
+ dimostriamo che $RR tilde.not NN$.
[1] Partiamo con il dimostrare che $RR tilde (0,1)$: serve trovare una biiezione tra $RR$ e $(0,1)$. Usiamo una rappresentazione grafica, costruita in questo modo:
- disegnare la circonferenza di raggio $1/2$ centrata in $1/2$;
- disegnare la perpendicolare al punto da mappare che interseca la circonferenza;
- disegnare la semiretta passante per il centro $C$ e l'intersezione precedente.
L'intersezione tra l'asse reale e la retta finale Ú il punto mappato.
#v(-36pt)
#figure(
image("assets/biiezione.svg", width: 70%)
)
#v(12pt)
In realtà , questo approccio ci permette di dire che $RR$ Ú isomorfo a qualsiasi segmento di lunghezza maggiore di 0.\
La stessa biiezione vale anche sull'intervallo chiuso $[0,1]$, utilizzando la "compattificazione" $overset(RR, .) = RR union {plus.minus infinity}$ e mappando $0$ su $-infinity$ e $1$ su $+infinity$.
[2] Continuiamo dimostrando che $NN tilde.not (0,1)$: serve dimostrare che l'intervallo $(0,1)$ non Ú listabile, quindi che ogni lista che scrivo manca di almeno un elemento e per farlo proveremo a "costruire" proprio questo elemento.\ Per assurdo, sia $NN tilde (0,1)$. Allora, possiamo listare gli elementi di $(0,1)$ esaustivamente come: $ 0.& space a_(00) space a_(01) space a_(02) space dots \ 0.& space a_(10) space a_(11) space a_(12) space dots \ 0.& space a_(20) space a_(21) space a_(22) space dots \ 0.& space dots quad , $ dove con $a_(i j)$ indichiamo la cifra di posto $j$ dell'$i$-esimo elemento della lista.
Costruiamo il numero $c = 0.c_0 c_1 c_2 dots$ tale che $ c_i = cases(2 quad & "se" a_(i i) eq.not 2, 3 & "se" a_(i i) = 2) quad . $
In altre parole, questo numero viene costruito "guardando" le cifre sulla diagonale principale.
Questo numero appartiene a $(0,1)$, ma non appare nella lista scritta sopra: ogni cifra $c_i$ del numero costruito differisce per almeno una posizione (quella sulla diagonale principale) da qualunque numero nella lista. Questo Ú assurdo, visto che avevamo assunto $(0,1)$ numerabile $arrow.long.double NN tilde.not (0,1)$.
[3] Terminiamo dimostrando che $RR tilde.not NN$ per transitività .
Più in generale, non si riesce a listare nessun segmento di lunghezza maggiore di 0.
]
Questo tipo di dimostrazione (in particolare il punto [2]) Ú detta *dimostrazione per diagonalizzazione*.
L'insieme $RR$ viene detto *insieme continuo* e tutti gli insiemi isomorfi a $RR$ si dicono a loro volta continui. I più famosi insiemi continui sono:
- $RR$: insieme dei numeri reali;
- $CC$: insieme dei numeri complessi;
- $TT subset II$: insieme dei numeri trascendenti.
Vediamo due insiemi continui che saranno importanti successivamente.
=== Insieme delle parti
Il primo insieme che vediamo Ú l'*insieme delle parti* di $NN$, detto anche _power set_, ed Ú così definito: $ P(NN) = 2^NN = {S bar.v S "Ú sottoinsieme di" NN}. $
#theorem(numbering: none)[
$P(NN) tilde.not NN$.
]
#proof[
\ Dimostriamo questo teorema tramite diagonalizzazione.
Il *vettore caratteristico* di un sottoinsieme Ú un vettore che nella posizione $p_i$ ha $1$ se $i in A$, altrimenti ha $0$.
Rappresentiamo il sottoinsieme $A subset.eq NN$ sfruttando il suo vettore caratteristico: $ NN&: 0 space 1 space 2 space 3 space 4 space 5 space 6 space dots \ A&: 0 space 1 space 1 space 0 space 1 space 1 space 0 space dots quad . $
Per assurdo, sia $P(NN)$ numerabile. Vista questa proprietà , possiamo listare tutti i vettori caratteristici che appartengono a $P(NN)$ come: $ b_0 &= b_(00) space b_(01) space b_(02) space dots \ b_1 &= b_(10) space b_(11) space b_(12) space dots \ b_2 &= b_(20) space b_(21) space b_(22) space dots quad . $
Vogliamo costruire un vettore che appartenga a $P(NN)$, ma non Ú presente nella lista precedente. Definiamo il seguente: $ c = overline(b_(00)) space overline(b_(11)) space overline(b_(22)) dots $ che contiene nella posizione $c_i$ il complemento di $b_(i i)$.
Questo vettore appartiene a $P(NN)$ (perché rappresenta sicuramente un suo sottoinsieme), ma non Ú presente nella lista precedente perché Ú diverso da ogni elemento in almeno una cifra, quella sulla diagonale principale.
Questo Ú assurdo perché abbiamo assunto che $P(NN)$ fosse numerabile, quindi $P(NN) tilde.not NN$.
]
Visto questo teorema possiamo concludere che: $ P(NN) tilde [0,1] tilde overset(RR, .). $
=== Insieme delle funzioni
Il secondo insieme che vediamo Ú l'*insieme delle funzioni* da $NN$ in $NN$ così definito: $ NN_bot^NN = {f: NN arrow.long NN}. $
#theorem(numbering: none)[
$NN_bot^NN tilde.not NN$.
]
#proof[
\ Anche in questo caso useremo la diagonalizzazione.
Per assurdo, assumiamo $NN_bot^NN$ numerabile. Possiamo, quindi, listare $NN_bot^NN$ come ${f_0, f_1, f_2, dots}$.
#align(center)[
#table(
columns: (10%, 15%, 15%, 15%, 15%, 15%, 15%),
inset: 10pt,
align: horizon,
[], [$0$], [$1$], [$2$], [$3$], [$dots$], [$NN$],
[$f_0$], [$f_0 (0)$], [$f_0 (1)$], [$f_0 (2)$], [$f_0 (3)$], [$dots$], [$dots$],
[$f_1$], [$f_1 (0)$], [$f_1 (1)$], [$f_1 (2)$], [$f_1 (3)$], [$dots$], [$dots$],
[$f_2$], [$f_2 (0)$], [$f_2 (1)$], [$f_2 (2)$], [$f_2 (3)$], [$dots$], [$dots$],
[$dots$], [$dots$], [$dots$], [$dots$], [$dots$], [$dots$], [$dots$],
)
]
Costruiamo una funzione $phi: NN arrow.long NN_bot$ per dimostrare l'assurdo. Una prima versione potrebbe essere la funzione $phi(n) = f_n (n) + 1$, per _disallineare_ la diagonale, ma questo non va bene: se $f_n (n) = bot$ non sappiamo dare un valore a $phi(n) = bot + 1$.
Definiamo quindi la funzione $ phi(n) = cases(1 & "se" f_n (n) = bot, f_n (n) + 1 quad & "se" f_n (n) arrow.b) quad . $
Questa funzione Ú una funzione che appartiene a $NN_bot^NN$, ma non Ú presente nella lista precedente. Infatti, $forall k in NN$ otteniamo $ phi(k) = cases(1 eq.not f_k (k) = bot & "se" f_k (k) = bot, f_k (k) + 1 eq.not f_k (k) quad & "se" f_k (k) arrow.b) quad . $
Questo Ú assurdo, perché abbiamo assunto $P(NN)$ numerabile, quindi $P(NN) tilde.not NN$.
]
|
|
https://github.com/metamuffin/typst | https://raw.githubusercontent.com/metamuffin/typst/main/tests/typ/math/frac.typ | typst | Apache License 2.0 | // Test fractions.
---
// Test that denominator baseline matches in the common case.
$ x = 1/2 = a/(a h) = a/a = a/(1/2) $
---
// Test parenthesis removal.
$ (|x| + |y|)/2 < [1+2]/3 $
---
// Test large fraction.
$ x = (-b plus.minus sqrt(b^2 - 4a c))/(2a) $
---
// Test binomial.
$ binom(circle, square) $
---
// Error: 8-13 missing argument: lower
$ binom(x^2) $
---
// Test associativity.
$ 1/2/3 = (1/2)/3 = 1/(2/3) $
---
// Test precedence.
$ a_1/b_2, 1/f(x), zeta(x)/2, "foo"[|x|]/2 \
1.2/3.7, 2.3^3.4 \
ð³ïžâð[x]/2, f [x]/2, phi [x]/2, ð³ïžâð [x]/2 \
+[x]/2, 1(x)/2, 2[x]/2 \
(a)b/2, b(a)[b]/2 $
|
https://github.com/tingerrr/hydra | https://raw.githubusercontent.com/tingerrr/hydra/main/examples/pages.typ | typst | MIT License | #import "/src/lib.typ": hydra
#set page(paper: "a7", margin: (y: 4em), numbering: "1", header: context {
if calc.odd(here().page()) {
align(right, emph(hydra(1)))
} else {
align(left, emph(hydra(2)))
}
line(length: 100%)
})
#set heading(numbering: "1.1")
#show heading.where(level: 1): it => pagebreak(weak: true) + it
= Introduction
#lorem(50)
= Content
== First Section
#lorem(50)
== Second Section
#lorem(100)
|
https://github.com/darioglasl/Arbeiten-Vorlage-Typst | https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/06_Ergebnisse/03_empfehlung.typ | typst | == Empfehlungen zur ErgÀnzung von ... <recommendation-next-features>
|
|
https://github.com/takotori/PhAI-Spick | https://raw.githubusercontent.com/takotori/PhAI-Spick/main/sections/kraft.typ | typst | #import "../utils.typ": *
= Kraft
#grid(
columns: (50%, auto),
gutter: 5pt,
[*Kraft:*], [$arrow(F)_"res"=m arrow(a)$],
[*Gewichtskraft:*], [$F_G=m g $],
[*Federkraft:*], [$F_F=D y space.quad D &= "Federkonst." \ y &= abs(l - l_0)$],
[*Hook\`sches Gesetz:*], [$Delta F=D dot Delta y$],
[*Schiefe Ebene:* #image("../figures/kraftSchiefeEbene.png")], [$F_G=m g$ \
#v(5pt)
*Normalkraft:* \
$F_N=m g dot cos(alpha) $ \
#v(5pt)
*Hangabtriebskraft*: \
$F_H=m g dot sin(alpha)$ \
#v(5pt)
*Haftreibungskraft:* \
$F_"HR"=Ό dot F_N$ #v(5pt)],
[*Zentripetalkraft / \ Zentrifugalkraft:*], [$F_Z=(m v^2)/r = m dot omega^2 dot r$],
)
#v(4pt)
#grid(
columns: (45%, auto),
gutter: 2pt,
image("../figures/Kreiskraefte.png"),
text(size: 6pt, [Die *Zentripetalkraft* und *Zentrifugalkraft* wirken bei einer beschleunigten Kreisbewegung und haben die gleiche Formel. Es handelt sich um entgegengesetzte KrÀfte, die abhÀngig von dem Bezugssystem sind. Wird eine Kreisbewegung von auÃen betrachtet, wirkt nur die Zentripetalkraft. Befindet sich der Beobachter im rotierenden System nimmt er beide KrÀfte wahr.]),
)
== Kraft Statik
In der Statik bewegen sich die Objekte nicht. Dort gilt also: \
$ sum F=0, v(t) = 0 m slash s, a(t) = 0 m slash s^2 $
#align(
center,
image("../figures/kraftStatik1.png"),
)
$ "X) " F_s dot cos(colblue(18^circle.small)) &-Ό dot F_N &-F_G dot sin(colgreen(35^circle.small))=0 $ \
$ "Y) " F_s dot sin(colblue(18^circle.small)) &+F_N &-F_G dot cos(colgreen(35^circle.small))=0 $
#image("../figures/kraftStatik2.png")
Ein Gewicht der Masse $m = 10"kg"$ wird entsprechend der obigen Skizze durch Seile an einer Wand befestigt. Welche KrÀfte wirken im linken und rechten Seil?
*1. Methode:*
$ F_L/sqrt(3^2+4^2 ) vec(-3,4)+F_R/sqrt(8^2+6^2 ) vec(8,6)+m g vec(0,-1)=0 $
*2. Methode*
$ F_L vec(-cos(alpha),sin(alpha))+F_R vec(cos(beta),sin(beta))+m g vec(0,-1)=0 $
#grid(
columns: (auto, auto),
gutter: 5pt,
align: (center +bottom, center+bottom),
image("../figures/kraftStatik3.png"),
image("../figures/kraftStatik4.png")
)
Eine $20 "kN"$ schwere Luftseilbahnkabine hÀngt reibungsfrei an einem Tragseil und wird durch ein Zugseil festgehalten.
Wie gross sind die ZugkrÀfte im Zug- und im Tragseil?
($alpha = 20^circle.small$ und $beta = 20^circle.small$)
#v(5pt)
$
F_"S1" = F_"S2" = F_T
$
$
F_T vec(cos(180^circle.small - 20^circle.small),sin(180^circle.small - 20^circle.small)) +F_T vec(cos(20^circle.small),sin(20^circle.small)) \ + F_Z vec(cos(20^circle.small),sin(20^circle.small)) + vec(0,-20 "kN")=0 \
==> F_T = 9.97 dot 10^4 N, F_Z = 8.48 dot 10^3 N
$ |
|
https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/decide-scoring/entry.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/packages.typ": notebookinator
#import notebookinator: *
#import themes.radial.components: *
#create-body-entry(
title: "Decide: Scoring Triballs",
type: "decide",
date: datetime(year: 2023, month: 9, day: 2),
author: "<NAME>",
witness: "Violet Ridge",
)[
We rated each option on:
- Efficiency on a scale of 1 to 10
- Stability on a scale of 1 to 10
- Feasibility on a scale of 1 to 10.
#decision-matrix(
properties: ((name: "Efficiency"), (name: "Stability"), (name: "Feasibility")),
("Extentable Hook", 7, 4, 9),
("Fold Out Flaps", 10, 9, 10),
("Shot Out Net", 5, 3, 4),
)
#admonition(
type: "decision",
)[
We chose the fold out flaps. This option is both the most effective in cost of
actuators and also the simplest design, leading to it being overall the best
choice.
]
#heading[First Prototype]
#grid(
columns: (1fr, 1fr),
gutter: 20pt,
[
Our first prototype was mainly comprised of L-channel. It featured a piston to
push the L-channel forwards, mounted on the bottom of the drivetrain.
#admonition(
type: "warning",
)[
While this design was stable and powerful, it exposed the fitting of the piston
outwards, making it very easy to hit.
]
We decided to discard this design after discovering that there was no other way
to mount the piston in this position without exposing it.
],
image("./first-prototype.jpg"),
)
]
#create-body-entry(
title: "Decide: Scoring Triballs",
type: "decide",
date: datetime(year: 2023, month: 9, day: 2), // TODO: correct to date of final cad creation
author: "<NAME>",
witness: "Violet Ridge",
)[
#heading([Final Design])
Our final design used a top mounted piston and a piece of C-channel as the wing
base. This strikes the right balance between structural integrity and lightness,
and also doesn't expose the piston to other robots.
#grid(
columns: (1fr, 1fr),
gutter: 20pt,
figure(image("./iso.png"), caption: "Isometric view"),
figure(image("./top.png"), caption: "Top view"),
figure(image("./side.png"), caption: "Side view"),
figure(image("./front.png"), caption: "Front view"),
)
// TODO: add part diagrams and CAD
#image("./1.png")
#image("./2.png")
]
|
https://github.com/fenjalien/metro | https://raw.githubusercontent.com/fenjalien/metro/main/tests/angle/angle-separator/test.typ | typst | Apache License 2.0 | #import "/src/lib.typ": *
#set page(width: auto, height: auto, margin: 1cm)
#ang(6, 7, 6.5)
#ang(6, 7, 6.5, angle-separator: " ") |
https://github.com/PauKaifler/typst-template-dhbw | https://raw.githubusercontent.com/PauKaifler/typst-template-dhbw/main/README.md | markdown | Apache License 2.0 | # Typst DHBW Template
This template is my interpretation of the guidelines required by the DHBW Stuttgart and Ravensburg.
I wrote it for my 2023 bachelor thesis, and it is compatible with Typst 0.11.1.
While I am no longer a student at the DHBW, I do accept pull requests and I intend to resolve any issues that might arise in the future.
## Setup
This template requires you to separately download the DHBW Logo.
You can download it from <https://upload.wikimedia.org/wikipedia/de/1/1d/DHBW-Logo.svg> and save it in the same directory the `template.typ` is stored in as `dhbw-logo.svg`.
You may run the following command in said directory to do that:
```sh
curl https://upload.wikimedia.org/wikipedia/de/1/1d/DHBW-Logo.svg -o dhbw-logo.svg
```
## Example
You can check out how this template can be used in the [example.typ](./example.typ) found within this repository.
The following is the first page of that document:

## License
This repository is dual-licensed under the [MIT](https://choosealicense.com/licenses/mit/) and [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) license.
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/codetastic/0.1.0/util.typ | typst | Apache License 2.0 |
#import "@preview/cetz:0.1.1"
#import cetz.draw: rect
#let to-arr(code) = {
if type(code) == "integer" {
code = str(code)
}
if type(code) == "string" {
code = code.clusters().map(int)
}
if type(code) != "array" {
panic("Code needs to be provided as integer, string or array. Got " + type(code))
}
return code
}
#let to-int-arr(code) = {
return to-arr(code).map(int)
}
#let weighted-sum(nums, weights) = {
let w-func
if type(weights) == "array" {
w-func = (i) => {
return weights.at(calc.rem(i, weights.len()))
}
} else if type(weights) == "function" {
w-func = weights
}
return nums.enumerate().fold(0, (s,v) => {
let (i, n) = (..v)
s + n * w-func(i)
})
}
#let check-code(
code, digits, generator, tester
) = {
if code.len() == digits - 1 {
code.push(generator(code))
} else if code.len() == digits {
if not tester(code) {
panic("Checksum failed for code " + repr(code) + ". Should be " + str(generator(code.slice(0,-1))))
}
} else {
panic("Code has to be " + (digits - 1) + " digits (excluding checksum). Got " + code.len())
}
return code
}
#let draw-bars(bits, width:0.264mm, height:18.28mm, bg: white, fg: black) = {
// Draw background rect to set fixed size
rect((0,0), (bits.len() * width, height), fill:bg, stroke:none, name:"code-bg")
// Cluster bits to draw thick bars
// as one rect
bits = bits.fold((), (c, v) => {
if v {
if c == () or c.last() == 0 {
c.push(1)
} else {
c.at(-1) += 1
}
} else {
c.push(0)
}
c
})
// Draw bars
let i = 0
for bit in bits {
if bit > 0 {
rect(
(i*width,0),
(rel:(bit*width,height)),
fill:fg, stroke:none
)
i += bit
} else {
i += 1
}
}
}
#let draw-rect(at, width, height, fill: white, ..style) = {
rect(
at,
(rel:(width,height)),
fill: fill, stroke:none,
..style
)
}
/// Draw a bitfield of binary data as a 2d code matrix.
///
/// Bits will be drawn from the top left to the bottom right.
/// `bits.at(0).at(0)` is located at coordinate `(0,0)` and
/// `bits.at(-1).at(-1)` is located at the last coordinate
/// on the bottom right.
#let draw-matrix(
bitfield,
quiet-zone: 4,
size: 3mm,
bg: white,
fg: black
) = {
let (w, h) = (bitfield.first().len(), bitfield.len())
let (x, y) = (quiet-zone, quiet-zone)
// Draw background rect to set fixed size
rect((0,0), ((w+2*quiet-zone) * size, (h+2*quiet-zone) * -size), fill:bg, stroke:none, name:"code-bg")
// Draw modules
for i in range(h) {
for j in range(w) {
if bitfield.at(i).at(j) {
rect(
((x + j) * size, (y + i) * -size),
(rel:(size, -size)),
fill:fg, stroke:none
)
}
}
}
}
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/post_type_check/with_builtin.typ | typst | Apache License 2.0 | #let g = rgb.with(/* position */); |
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/list-attach_03.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test non-attached tight list.
#set block(spacing: 15pt)
Hello
- A
World
- B
- C
More.
|
https://github.com/andreasKroepelin/lovelace | https://raw.githubusercontent.com/andreasKroepelin/lovelace/main/examples/label-low-level.typ | typst | MIT License | #import "../lib.typ": *
#set page(width: auto, height: auto, margin: 1em)
#set text(font: "TeX Gyre Pagella")
#show math.equation: set text(font: "TeX Gyre Pagella Math")
#pseudocode(
with-line-label(<start>)[do something],
with-line-label(<important>)[do something important],
[go back to @start],
)
The relevance of the step in @important cannot be overstated.
|
https://github.com/yaoyuanArtemis/resume | https://raw.githubusercontent.com/yaoyuanArtemis/resume/main/data.typ | typst | Do What The F*ck You Want To Public License | #import "template.typ": *
#let name = "<NAME>"
#let namezh = "åå³°"
#let email = [
#icon("email.svg") <EMAIL>
]
#let phone = [
#icon("phone.svg")
(+86) 18520170194
]
#let home = [
#icon("home.svg")
#link("https://yaoyuanartemis.github.io/")[ yaoyuanartemis.github.io ]
]
#let github = [
#icon("github.svg")
#link("https://github.com/yaoyuanArtemis")[ yaoyuanArtemis ]
]
#let linkin = [
#icon("linkedin.svg")
#link("https://www.linkedin.com/in/%E5%B3%B0-%E5%88%98-2a7a8b2b8/")[ <NAME> ]
]
#let author = (
name: name,
email: email,
phone: phone,
home: home,
github: github,
linkin: linkin,
)
#let authorzh = (
name: namezh,
email: email,
phone: phone,
home: home,
github: github,
linkin: linkin,
)
#let selftitle = [ Self Introduction ]
#let selftitlezh = [ èªææ»ç» ]
#let self = [
I am passionate about pursuing technological advancements and have an unrelenting pursuit of knowledge, particularly in the field of computer science. Additionally, I enjoy meeting interesting people and experiencing diverse aspects of society. Whether it's the culture and phenomena in China or around the world, I am full of curiosity and eager to explore.
]
#let selfzh = [
æçè¡·äºè¿œæ±ææ¯è¿æ¥ïŒå¯¹ç¥è¯æçäžæç远æ±ïŒå°€å
¶æ¯åšè®¡ç®æºé¢åãåæ¶ïŒæä¹ä¹äºåšç€ŸäŒäžç»è¯æè¶£ç人åäºïŒæ·±å
¥äºè§£ç€ŸäŒçå䞪æ¹é¢ãæ 论æ¯äžåœè¿æ¯äžçåå°çæååç°è±¡ïŒæéœå
满奜å¥å¹¶æžŽææ¢çŽ¢ã
]
#let edutitle = [ Education ]
#let edutitlezh = [ æè²ç»å ]
#let edu = [
#datedsubsection(
align(left)[
*Anhui University ïŒ211ïŒ the gifted class of computer science* \
- GPA:3.30/4
- Languages: Chinese Grade A,English IELTS 6.5
- Programming Capabilities:CCF-CSP 180
- Relevant Courses:Principles of Computer Organization,Data Structures,Operating Systems,Computer Networks,Database Principles,Object-Oriented Programming,Digital Image Processing,Big Data Technology,Machine Learning,Pattern Recognition,Optimization Methods,Mathematical Modeling (Advanced Class),Artificial Intelligence,Principles of Compilers,Writing International Academic Papers (Graduate Course)
- Honors and Awards:Second-Class Scholarship for Academic Excellence,Anhui Province Big Data Competition
],
align(right)[
Hefei, China \
2017.9 - 2021.6
]
)
]
#let eduzh = [
#datedsubsection(
align(left)[
*å®åŸœå€§åŠ ïŒ211ïŒ è®¡ç®æºç§åŠäžææ¯è±æç* \
- GPA:3.30/4
- è¯èš:äžæäºçº§ç²çãè±æIELTS6.5
- è®¡ç®æºçŒçšïŒCCF-CSP 180
- çžå
³è¯ŸçšïŒè®¡ç®æºç»æåçïŒæ°æ®ç»æïŒæäœç³»ç»ïŒè®¡ç®æºçœç»ïŒæ°æ®åºåçïŒé¢å对象çšåºè®Ÿè®¡ïŒæ°ååŸåå€çïŒå€§æ°æ®ææ¯ïŒæºåšåŠä¹ ïŒæš¡åŒè¯å«ïŒæäŒåæ¹æ³ïŒæ°åŠå»ºæš¡(æé«ç)ïŒäººå·¥æºèœïŒçŒè¯åçïŒåœé
åŠæ¯è®ºææ°å(ç ç©¶ç诟çš)
- è£èªå¥é¡¹ïŒåŠä¹ äŒç§äºçå¥åŠéãå®åŸœçå€§æ°æ®ç«èµ
],
align(right)[
åè¥.äžåœ \
2017.9 - 2021.6
]
)
]
#let techtitle = [ Technical Skills ]
#let techtitlezh = [ é¡¹ç®æèœ ]
#let tech = [
- *Programming*:
- Proficient in Python and C++, which were the primary languages used for university coursework.
- Learned and used Java, MATLAB, HTML, LaTeX, and Typst.
- Familiar with HTML5, CSS, JavaScript, and TypeScript, and frequently used in practical work.
- Experienced with Node.js, Midway.js, and familiar with Egg.js and Nest.js for full-stack development.
- Used Spring Boot, MyBatis, and Restful technologies for API development in a company context.
- *Key words*: Node.js TypeScript Nest.js HTML5 CSS
- *Tools*:
- Proficient in using the Scrapy framework and have developed a gaming combat system using the Django framework.
- Experienced with databases such as MySQL and SQL Server.
- Studied "Machine Learning" and "Pattern Recognition," and am familiar with related algorithms.
- Configured clusters for Apache and MySQL.
- Utilized distributed web crawlers and scraping technologies such as BeautifulSoup, Scrapy, and regular expressions (Re).
]
#let techzh = [
- *çŒçšè¯èš*:
- è¯èš Python C++èŸäžºçæ,倧åŠå€§è¯Ÿçšäœäžäœ¿çšçäž»åè¯èš,Java Matlab Html Latex TypståŠä¹ 并䜿çš
- çæHTML5ãCSSã JavaScriptãTypeScript,å¹¶åšå®é
å·¥äœäžç»åžžäœ¿çš
- 䜿çšè¿NodeJs MidWayJS,äŒäœ¿çšEggJs NestJSçå
šæ ææ¯æ
- 䜿çšSpringBootãMyabtisãRestfulçJavaææ¯æ ,åšå
¬åžçšäœæ¥å£åŒåææ¯
- *å·¥å
·*:
- äŒäœ¿çšScrapyæ¡æ¶,䜿çšè¿Djangoæ¡æ¶åŒåæžžæå¯¹æç³»ç»
- äŒäœ¿çš MySqlãSqlSeverçæ°æ®åº
- åŠä¹ ãæºåšåŠä¹ ãããæš¡åŒè¯å«ãïŒå¯¹æºåšåŠä¹ çžå
³ç®æ³èŸäžºçæ
- é
眮è¿ApacheãMySqlçé矀æå»º
- 䜿çšååžåŒç¬è«,BeautifulSoupãScrapyãReåç¬åææ¯
]
#let projecttitle = [ Project Experience ]
#let projecttitlezh = [ 项ç®ç»å ]
#let projectexperience = [
#datedsubsection(
align(left)[
*China Merchants Bank. CMB Technology (Shenzhen) Co., Ltd.* \
Developer
],
align(right)[
2021.7 - 2023.9
]
)
- After joining the company through campus recruitment, I participated in the development of the cloud operations platform, specifically the OracleDM platform (a platform for operating Oracle databases). I primarily served as a frontend developer, using React 17, TypeScript, and Ant Design for web development and API data acquisition.
- #lorem(8)
#datedsubsection(
align(left)[
*Alibaba. Zhejiang Fliggy Network Technology Co., Ltd.* \
Frontend Developer and Operations (Ops)
],
align(right)[
2021.7 - 2023.9
]
)
- Development of the Backend System "Jellyfish" for Risk Control
- Included API calls for data and permission interfaces, and integration of event tracking.
- Independently developed a policy document parsing tool.
- Automated the parsing of airline policies from Excel, achieving a coverage of 10 airlines by February with an automation rate of 75%.
- Supported policy document types include Word 2007, Word 2003, Excel 2007, and Excel 2003.
- By building automatic parsing capabilities for airline policy documents, improved operational efficiency, reducing the time required to process complex policy documents from one day to within two hours.
- Developed basic pages for the backend ticketing operations system.
]
#let projectexperiencezh = [
#datedsubsection(
align(left)[
*æåé¶è¡.æé¶çœç»ç§æ(æ·±å³)æéå
¬åž* \
åŒåè
],
align(right)[
2021.7 - 2023.9
]
)
- æ ¡æå
¥èååäžå
¬åžçäºè¿ç»Žå¹³å°åŒåïŒå
·äœæ¯å¹³å°äžçOracleDMå¹³å°åŒåïŒè¡å
对Oracleæ°æ®åºåæäœçå¹³å°ïŒäž»èŠæ¯æ
ä»»å端åŒåå·¥çšåžïŒäœ¿çšReact17ãTypeScriptãAntDesignåçœé¡µåŒå以忥å£å¯¹æ¥
- 䜿çšSpringBootææ¯åæ¥å£åŒå
#datedsubsection(
align(left)[
*é¿éå·Žå·Ž.æµæ±é£çªçœç»ææ¯æéå
¬åž* \
å端åŒåå·¥çšåžä»¥åè¿ç»Ž
],
align(right)[
2023.9 - 2024.5
]
)
- åŒå飿§äžåå°ç³»ç»âæ°Žæ¯JellyfishâåŒå
- å
æ¬æ°æ®æ¥å£è°çšãæéæ¥å£è°çšãåç¹æ¥å
¥
- ç¬ç«åŒåæ¿çæä»¶è§£æå·¥å
·
- é对èªåžæ¿çè§£æexcelæäº§ïŒçŽ¯è®¡è³2æïŒèªåžèŠçç已蟟10䞪ïŒèªåšåç蟟å°75%
- æ¿çæä»¶ç±»åæ¯æword2007ãword2003ãexcel2007ãexcel2003
- éè¿å»ºè®Ÿèªåžæ¿çæä»¶èªåšè§£æèœåïŒæé«è¿è¥ææŸåå€å·¥äœæçïŒäœ¿åŸå€ææ¿çæä»¶ç±äžå€©çŒ©çè³2å°æ¶å
æ¿çè§£æå·¥å
·ãæºç¥šè¿è¥äžåå°ãæ°Žæ¯é£æ§éœæ¯å端䞻富项ç®
- åŒååºæ¬çæºç¥šè¿è¥äžåå°é¡µé¢
]
#let activitytitle = [ Research Experience ]
#let activitytitlezh = [ ç§ç ç»å ]
#let activityzh = [
#datedsubsection(
align(left)[
*屿§çœç»ç€Ÿå¢æ£æµ* \
æ¬ç§æéŽåè¡šåŠæ¯è®ºæ A Reduced Mixed Representation Based Multi-Objective Evolutionary Algorithm for Large-Scale Overlapping Community Detection DOI: 10.1109/CEC45853.2021.9504894 å±äºå®åŸœå€§åŠæè²éšè®¡ç®æºèœäžä¿¡æ¯å€çéç¹å®éªå®€ææ
],
align(right)[
2019-2021
]
)
// #datedsubsection(
// align(left)[
// *#lorem(8) *\
// #lorem(4)
// ],
// align(right)[
// 202x - _present_
// ]
// )
// #lorem(16)
// #datedsubsection(
// align(left)[
// *#lorem(8)* \
// #lorem(4)
// ],
// align(right)[
// 202x
// ]
// )
// - #lorem(8)
// - #lorem(8)
]
#let activity = [
#datedsubsection(
align(left)[
*Attribute-Based Network Community Detection* \
Published Academic Papers During Undergraduate Studies: A Reduced Mixed Representation Based Multi-Objective Evolutionary Algorithm for Large-Scale Overlapping Community Detection DOI: 10.1109/CEC45853.2021.9504894.
Achievement of the Key Laboratory of Computational Intelligence and Information Processing, Ministry of Education, Anhui University
],
align(right)[
2019-2021
]
)
]
#let hobbiestitle = [ Hobbies and Interests ]
#let hobbiestitlezh = [ å
Žè¶£ç±å¥œ ]
#let hobbieszh = [
- *æå*: 忬¢äºè§£åŠä¹ å°çãäžçå²åäžåœå²ãå®è§ç»æµ
- *è¿åš*: 忬¢èž¢è¶³çïŒäž»éçé©¬ïŒæ·å€é»çŒïŒæžžæ³³ïŒæ»éªä¹æäžå®æè¿è¡
]
#let hobbies = [
- *Culture*: Enjoys Learning About Geography, World History, Chinese History, and Macroeconomics
- *Sports*: Enjoys playing soccer (main team: Real Madrid); also regularly engages in outdoor activities such as swimming and skiing.
]
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/flow-orphan_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
#set page(height: 100pt)
#lorem(12)
= Introduction
This is the start and it goes on.
|
https://github.com/TheWebDev27/Calc-II-Honors-Project | https://raw.githubusercontent.com/TheWebDev27/Calc-II-Honors-Project/main/part2.typ | typst | #set text(
font: "New Computer Modern",
size: 10pt
)
#set par(
leading: .75em
)
#set align(center)
= The Nonstandard Approach
#set align(left)
One drawback with the real analysis approach involving the epsilon-delta definition of the limit is its cumbersome notation. Proofs can quickly become cluttered with absolute values and inequalities that at times can be challenging to keep track of and connect to one another. By formalizing the idea of the infinitesimal to where basic algebraic techniques can be applied to it, a new system of analysis can be developed to study the same material that real analysis does while taking advantage of simpler and more concise notation.
\
#text(14pt)[
Introduction
]
This introduction follows section 1.4 of
#set align(center)
<NAME>. (1976). _Foundations of Infinitesimal Calculus_, <NAME> & Schmidt.
#set align(left)
Let us first consider two points on the parabola $f(x) = x^2$. One will be a fixed point at $(x_0, y_0)$, while the other will lie some distance away at $(x_0 + Delta x, y_0 + Delta y)$ where $Delta x$ and $Delta y$ represent the horizontal and vertical distances between the two points.
#set text(9pt)
#figure(
image("images/parabola slope.png", width: 60%),
caption: [$(x_0, y_0)$ and $(x_0 + Delta x, y_0 + Delta y)$ on $f(x)=x^2$]
)
#set text(10pt)
The average slope between any two points $(x_1, y_1)$ and $(x_2, y_2)$ is the ratio of the change in $y$ to the change in $x$:
#set align(center)
$display((Delta y) / (Delta x)=(y_2-y_1)/(x_2-x_1)).$
#set align(left)
Therefore, the average slope between the two points on the parabola above is \
#set align(center)
#h(125pt) $display(((y_0 + Delta y) - y_0)/((x_0 + Delta x) - x_0)).$ #h(110pt) (1)
#set align(left)
The function is $f(x)=x^2$, so any $y$ value is determined by plugging in its corresponding input $x$ into it. The points then become $(x_0, x_0^2)$ and $(x_0 + Delta x, (x_0 + Delta x)^2)$. Substituting in these new $y$ coordinates into $(1)$ gives
#set align(center)
$display((Delta y)/(Delta x)) &= display(((x_0 + Delta x)^2 - x_0^2)/((x_0 + Delta x) - x_0))
\
&= display(([x_0^2+2x_0 Delta x + (Delta x)^2] - x^2_0)/((x_0+Delta x) - x_0))
\
&= display((2x_0 Delta x + (Delta x)^2)/(Delta x))
\
#h(105pt) &= 2x _0 + Delta x. #h(145pt) (2)
$
#set align(left)
(2) gives us the slope in terms of a fixed point's $x$-coordinate and its horizontal distance $Delta x$ from some variable point. If we want to find the slope of a line that lies *tangent* to the curve -- meaning that it intersects the curve at exactly one point -- at $(x_0, x_0^2)$, then we can treat $Delta x$ as a very small number so that the tangent line's slope is very close to (2). We #emph[cannot] set $Delta x$ equal to zero, because (2) follows from a quotient where $Delta x$ is present in the denominator of a quotient. Anyhow, treating it as a miniscule value leads to the intuitive result that the slope of some line tangent to the point $(x_0, x_0^2)$ on the parabola is essentially
#set align(center)
$2x_0.$
#set align(left)
This loose usage of an infinitesimal -- treating a value as infinitely small to where it can be ignored -- has in fact produced decently accurate results throughout the development of calculus over the past several centuries, being used by those such as Newton, Leibniz, Euler, and others in varying forms. However, it is by no means rigorous and does not establish results with absolute certainty. Why? This is because we are left with a problem: How do we know exactly when numbers are small enough to be treated as negligible in a calculation?
This now brings us to our first formal definition:
#set text(font: "Source Serif")
#set align(center)
#grid(
columns: 80%,
rows: auto,
[
#set align(left)
An *infinitesimal* is a number $epsilon$ where
#set align(center)
$-a<epsilon<a$
#set align(left)
for any positive real number $a$.
]
)
#set text(font: "New Computer Modern")
#set align(left)
Amongst the real numbers, 0 would be the only value that qualifies as infinitesimal. What we now do is expand the real number system by introducing *hyperreal numbers*. These include the real numbers along with nonzero infinitesimals, which can be thought of as numbers that lie infinitely close to 0. The set of all real numbers is represented by $RR$, while the set of all hyperreal numbers is represented by $RR^*$. Various symbols including $Delta x, Delta y, epsilon, #text[and] delta$ are used to symbolize infinitesimals. For instance, $x + Delta x$ is interpretted as some quantity that lies #emph[infinitely] close to $x$, and $display(1/epsilon)$ represents an *infinite positive number*. Hyperreal numbers that are not infinitely positive or negative are *finite numbers*.
#set text(9pt)
#figure(
image("images/hyperreal line.png", width: 70%),
caption: [Hyperreal number line visualized]
)
#set text(10pt)
We can conceptualize the scale of hyperreal numbers by imagining ourselves "zooming in" infinitely close onto on a real number such as 0 or 100 on the hyperreal number line (Figure 5). This helps to clarify the nature of hyperreal numbers as merely an extension of the real numbers, so much so to where its properties and the arithmetic involved with them match exactly with that of the reals. This approach to analysis is known as *nonstandard analysis*.
Going back to the calculation of the instantaneous slope of $f(x)=x^2$, we now treat the value of $Delta x$ as a nonzero infinitesimal under this new lense of analysis. This means that the expression
#set align(center)
$2x_0 + Delta x$
#set align(left)
lies infinitely close to $2x_0$, so the slope of any line tangent to $(x_0, x_0^2)$ is concluded to be $2x_0$. \ \
Let's use infinitesimals to try computing the instantaneous slope of the function
#set align(center)
$f(x)=sqrt(x)$.
#set text(9pt)
#figure(
image("images/square root function.png", width: 70%),
caption: [$f(x)=sqrt(x)$]
)
#set text(10pt)
#set align(left)
The average slope between a fixed point and a variable point on the square root function is \ \
#set align(center)
$display((Delta y)/(Delta x) &= (f(x_0+Delta x)-f(x_0))/(Delta x) \
&= (sqrt(x_0 + Delta x) - sqrt(x_0))/(Delta x)
)$
#set align(left)
In order to calculate the instaneous slope, we need a way to cancel out $Delta x$ from the denominator. This can be readily accomplished by multiplying the quotient by the conjugate of the numerator in the form of 1 to induce a difference of squares:
#set align(center)
$display(
(sqrt(x_0 + Delta x) - sqrt(x_0))/(Delta x) dot ((sqrt(x_0+Delta x) + sqrt(x_0))/(sqrt(x_0 + Delta x) + sqrt(x_0))) = ((sqrt(x_0 + Delta x))^2 - (sqrt(x_0))^2)/(Delta x(sqrt(x_0 + Delta x) + sqrt(x_0))) \
)$
$display(
&= ((x_0 + Delta x) - x_0)/(Delta x(sqrt(x_0 + Delta x) + sqrt(x_0))) \
&= (Delta x)/(Delta x(sqrt(x_0 + Delta x) + sqrt(x_0))) \
&= 1/(sqrt(x_0 + Delta x) + sqrt(x_0))
)$
#set align(left)
Since the $Delta x$ in the denominator is infinitesimal, this means that the quantity $sqrt(x_0 + Delta x)$ is infinitely close to $sqrt(x_0)$, so
#set align(center)
$display(
1/(sqrt(x_0 + Delta x) + sqrt(x_0))&=1/(sqrt(x_0) + sqrt(x_0))\
&= 1/(2sqrt(x_0)).
)$
#set align(left)
Those who have experience with calculating the derivatives of functions using the limit definition of the derivative will be quick to notice that these calculations play out mostly the same way with the exception of the absence of the limit.
At this stage, the skeptical reader may question how exactly this system has solved the concern regarding rigor. In particular, how do the ideas presented so far formalize the concept of deeming a quantity in a given calculation as neglible? What has happened so far is that we have #emph[defined] what it means for a number to be considered negligibly small, so if a given quantity does not meet the criteria specified, then we know that it cannot be ignored. Beyond that, however, we have done nothing more than explore some basic ideas of nonstandard analysis, and rigorous justifications require a working knowledge of abstract algebra. The details are obviously left out, as they lie far beyond my expertise. While the curious reader may feel left unfulfilled by this, keep in mind that the formalization of many concepts require complicated machinery, so it is commonplace for students of mathematics to take a result at face value initially and uncover its logical justification far later. As a direct analogue to the current situation, consider the analysis behind limits covered in the first half of this paper. It is likely that most undergraduates who have studied limits will never encounter this rigorous treatment of them in their lifetime -- let alone give it any consideration. Ambitious students, however, will inevitably run across it in a real analysis course, and the formalities are unveiled then. We now lie in the very same boat with infinitesimals!
#pagebreak()
#text(14pt)[
Basic Applications of Infinitesimals
]
This section follows
#set align(center)
<NAME>. (2012). _A Brief Introduction to Infinitesimal Calculus_, can be found at \ https://homepage.math.uiowa.edu/~stroyan/InfsmlCalculus/Lecture1/Lect1.pdf.
#set align(left)
It is due time for us to see how infinitesimal logic can be used to provide basic intuitive argumentation for a couple of ideas seen in calculus.
#set text(font: "Source Serif")
#set align(center)
#grid(
columns: 80%,
rows: auto,
[
#set align(left)
*Theorem 4 - The Extreme Value Theorem* \
Consider a function $f(x)$ that is continuous on a closed interval $[a, b]$. There then exist two numbers $x_(min)$ and $x_(max)$ at which $f(x)$ achieves its minimum and maximum values respectively where
#set align(center)
$f(x_(min)) <= f(x) <= f(x_(max))$
#set align(left)
for all other $x$'s.
]
)
#set text(font: "New Computer Modern")
#set align(left)
#set text(9pt)
#figure(
image("images/extreme value theorem.png", width: 50%),
caption: [Extreme value theorem visualized]
)
#set text(10pt)
The extreme value theorem asserts that if a function smoothly travels over an interval of inputs, then it must take on a minimum and a maximum value at some inputs $x_(min)$ and $x_(max)$.
*Continuity* entails that the outputs of a function are close to one another if the inputs are close. In other words, a small change in the input should only ever produce a proportionately small change in the output. Mathematically speaking, a function $f(x)$ is continuous on a closed interval $[a,b]$ only when
#set align(center)
$a <= x_1 approx x_2 <= b arrow.r.double.long f(x_1) approx f(x_2)$
#set align(left)
where the $approx$ symbol means that two quantities are _approximately_ equal (very close to one another).
With this property fleshed out, we can now go about providing an intuitive argument for the extreme value theorem. We start by dividing up the interval $[a,b]$ into small increments like so:
#set align(center)
$display(a < a + (b-a)/H < a + (2(b-a))/H < dots.h.c < a + (k(b-a))/H < dots.h.c < b) $,
#set align(left)
where $b-a$ is the length of the interval, $H$ is the number of parts the interval is partitioned into, and $k$ is a positive integer between 1 and $H$. Amongst the partition points, $f(x)$ achieves some maximum
#v(-2pt) value at one (or possibly more than one) of the partition points $x_M=display(a + (k(b-a))/H)$, so
#set align(center)
#v(5pt) $f(x_M) >= f(x_1)$ for any $x_1=display(a + (j(b-a))/H), j
!= k$.
#set align(left)
#v(2pt)We know that any input $x$ in the interval $[a, b]$ lies within a distance of $display((b-a)/(2H))$ from one of the
#v(-2pt) partition points. To see why, consider the closed interval [2,12] divided into 5 equal subintervals ($H = 5$) so that the partition points are
#set align(center)
$display(2\, #h(10pt) 2 + (12-2)/5\, #h(10pt) 2 + (2(12-2))/5\, #h(10pt) 2 + (3(12-2))/5\, #h(10pt) 2 + (4(12-2))/5\, #h(10pt) 2 + (5(12-2))/5) \
= #h(5pt) 2, #h(5pt) 4, #h(5pt) 6, #h(5pt) 8, #h(5pt) 10, #h(5pt) 12.$
#set align(left)
Since the size of the interval is 10, and it is being partitioned into 5 subintervals, the distance between each partition point is
#set align(center)
$display((b-a)/H = (12 - 2)/5 = 2).$
#set align(left)
and
#set align(center)
$display((b-a)/(2H) = 1).$
#set text(9pt)
#figure(
image("images/number line.png", width: 70%),
caption: [Partition points visualized]
)
#set align(left)
#set text(10pt)
If we think of the quantity $display((b-a)/(2H))$ as half of the distance between consecutive partition points and
#v(-2pt) imagine a one-dimensional radius of $display((b-a)/(2H))$ around each partition, then we can see that these radii
#v(0pt)cover all of the values between the partition points. Therefore, any value of $x$ within the interval must
#v(0pt) lie within a distance of $display((b-a)/(2H))$ from one of the partition points. \
If we now let $H$ grow exceedingly large to the point where $display((b-a)/(2H))$ becomes infinitesimal, then the set of
#v(-2pt) partition points will eventually "fill up" the rest of the interval $[a,b]$ so that any value of $x$ within the interval lies infinitely close to one of the partition points. In others words,
#set align(center)
$x approx x_1$ for any $x$ in $[a,b]$,
#set align(left)
which means
#set align(center)
$f(x_M) >= f(x_1) approx f(x)$,
#set align(left)
and this gives us the approximate maximum of $f(x)$. A similar argument can then be made for the approximation of the function's minimum, and this concludes the intuitive argument for the extreme value theorem, although this is by no means a formal proof.\ \ |
|
https://github.com/Geson-anko/vconf24_template_typst | https://raw.githubusercontent.com/Geson-anko/vconf24_template_typst/main/sample.typ | typst | // sample.typ
#import "vconf2024.typ": conf
#show: doc => conf(
title: "ããŒãã£ã«åŠäŒ2024èŠæšãã³ãã¬ãŒãïŒã¿ã€ãã«ãèšå
¥ïŒ",
authors: (
(name: [hinoride#super[1]], contact: "Twitter: @hiddenotna"),
(name: [ã¯ãã€ã#super[2]], contact: "E-mail: <EMAIL>"),
(name: [Lcamu#super[2]], contact: "Twitter: @ogtonvr180426"),
),
affiliations: ([#super[1]ãã©ã€ãããžãŒå匷äŒ], [#super[2]ã©ãŒã¡ã³å奜äŒ]),
abstract: [
ããã«æ¬ç ç©¶ã®å
容ããŸãšããæŠèŠãèšå
¥ããããšïŒèŠæšå·çã«ãããäžæãªç¹ãããå Žåã«ã¯ããŒãã£ã«åŠäŒå®è¡å§å¡äŒã«ãé£çµ¡ãã ããïŒ
],
bibliography-file: "bibliography.yaml",
doc,
)
= ç·èš
æ¬ãã³ãã¬ãŒãã¯TypstãçšããŠããŒãã£ã«åŠäŒã®èŠæšåçš¿ãäœæããããã®ãã¡ã€ã«ã§ããïŒ
= åçš¿ã®æžåŒ
== å
šäœã®ãã©ãŒããã
A4å€çšçŽã®PDFã§æåºããïŒWordïŒLaTeXãããã¯Typstãã¡ã€ã«ã§ã®äœæãååãšãïŒã¬ã€ã¢ãŠãã¯2ã«ã©ã ïŒãã©ã³ããµã€ãºã¯ã¿ã€ãã«18ptã»æ¬æ10ptãšããïŒæå€§ããŒãžæ°ã¯4ããŒãžãšãïŒåæãã©ã³ãã¯ææäœïŒè±æãã©ã³ãã¯Times New RomanïŒCenturyãªã©ã®æšæºçãªãã®ã䜿çšããããšïŒ
- 衚é¡ïŒä»åã®ç ç©¶å
容ã端çã«åããããã«ããïŒ
- èè
åã»é£çµ¡å
ã»æå±ïŒèè
åã«ã¯ãã³ãã«ããŒã ã䜿çšããããšãå¯èœã§ããïŒæäœ1åã«ã€ããŠå¿
ããåŠäŒåŸã«ã確å®ã«é£çµ¡ããšããé£çµ¡å
ãèšèŒããããšïŒãŸãæå±ã¯ä»»æã«èšèŒãè€æ°ã®å Žåã¯1, 2ã»ã»ã»ãšèšãïŒ
- æŠèŠïŒä»åã®ç ç©¶å
容ã1/2é 以å
ã§èšè¿°ããïŒ
== å
容ã«ã€ããŠ
çºè¡šèŠæšã¯æ¬¡ã®äºé
ãåºæ¬ãšããŠïŒç°¡æœã«èšèŒããããšãæãŸããïŒ
- ç·èšïŒä»åã®ç ç©¶ã®ãããã€ãšç ç©¶ç®çã瀺ãïŒ
- ç ç©¶æ¹æ³ïŒä»ã®äººãåããããªç ç©¶ãã§ãããããªæžãæ¹ãå¿ãããïŒ
- çµæïŒäºå®ã®ã¿ããŸãšããïŒèªåã®æèŠã¯å«ããªãïŒ
- èå¯ïŒçµæã§ç€ºããäºå®ãããšã«ããã®è§£éãããã§ã®å æé¢ä¿ãªã©ã«ã€ããŠè°è«ããïŒ
- çµèšïŒç ç©¶ã®ãŸãšããèšèŒããïŒ
- åèæç®ïŒæ¬æäžã«åŒçšé ã«èšèŒããïŒ
== è¡šèšæ¹æ³
æ¬æïŒå€§èŠåºãïŒå°èŠåºããªã©ãæçã«ããããšïŒæ¬æäžã§ã¯ãã€ãã®è¡šãã®ãããªè¡šçŸãé¿ãïŒ@fig:sample_figure ã衚1ã®ããã«æžãïŒãŸãïŒå³è¡šã®ãã£ãã·ã§ã³ã¯ããåäœã§èªãã éã«å³è¡šã®æå³ãçè§£ã§ããããã«ç°¡æœã«èšè¿°ããïŒ
== åèæç®
æ¬æäžã«å¥ã®èè
ã®æç®ãåŒçšããå Žåã¯ïŒåŒçšç®æã®æåŸéšã«@rafferty1994 ïŒ @vconf2023ïŒ @okatani2015 ïŒ @kataoka2016 ïŒ @hinoride2023 ã®ãããªç¬Šå·ãã€ããããšïŒæ¬èŠæšæåŸéšã«ãåèæç®ãã®é
ç®ãçšæãïŒåæç®ã®æ
å ±ãèšèŒããããšïŒèšèŒã®éã«ã¯ä»ã®äººãåæç®ã«ã¢ã¯ã»ã¹ã§ãããããªè¡šçŸæ¹æ³ãšããããšïŒWebãµã€ããåŒçšããå ŽåïŒããŒãžã¿ã€ãã«ïŒURLïŒåç
§æ¥ãèšèŒããããšïŒ
== åäœã»èšå·ç¥å·
äžèšã®ç¹ã«æ³šæãïŒå€èªã»çè§£ããããåçš¿ãšãªãããåªããïŒ
- äžã€ãæåïŒäžã€ãæåïŒå°ããééããããããç¹ã«æ³šæãïŒãã®äœçœ®ãæç¢ºã«ç€ºãïŒ
- åŠåïŒçç©çš®ã®åŠåã¯ã€ã¿ãªãã¯äœãšããïŒ
- ç¥èªïŒç¥èªãçšããå Žåã«ã¯ïŒååºæã«æ£åŒåç§°ã衚èšïŒã¹ãã«ã¢ãŠãïŒããïŒ2åç®ããã¯ç¥èªã§è¡šèšããïŒ
- éåäœïŒåœéåäœç³»ïŒSIïŒãçšããïŒ
- æ°åŒïŒç¬ç«ããåŒã®æåïŒå€æ°ïŒã¯æå®ã®ãªãéãã€ã¿ãªãã¯äœã«çµãïŒåŒã®äžé£çªå·ãïŒ ïŒã§å²ã¿ïŒé ã®å³ç«¯ã«æžãïŒæäžã®åŒã¯äžè¡ã«åããïŒ
- èæ³šïŒæ¬æäžã«\*, a, bãªã©ãå³è©ã«ã€ãïŒãã®ããŒãžã®äžã«æšªç·ãåŒãïŒæšªç·ã®äžã«èšè¿°ããïŒ
== å³è¡šã®äœæ
å³ããã³è¡šã®èª¬æã¯ïŒæ¬æãèŠãªããŠã倧èŠãææ¡ã§ããçšåºŠã®æå°éã®ãã®ã§ããããšãæãŸããïŒãããã¯@fig:sample_figure ã®ããã«ãã¹ãŠæ¬æäžããåç
§ããïŒ
å³ã®äžã«é¡åã»èª¬ææãèšè¿°ããïŒé¡åã¯ãã®çµããã«ããªãªããå
¥ããïŒåçãå³ãšããŠæ±ãïŒé¡åŸ®é¡åçãªã©ã®çž®å°ïŒæ¡å€§ãæ£ç¢ºã«ç€ºãã¹ãå³ã§ã¯ïŒå¿
ãå³äžã«æšæºå°ºåºŠã瀺ãç·ãèšå
¥ããïŒÃ1000çã§ã¯ç€ºããªãïŒïŒ
衚ã¯èŠæšã§èšåããæ
å ±ã®ã¿ãèšèŒãïŒé¡åã¯äžã«ïŒèª¬ææã¯äžã«èšè¿°ããïŒé¡åã¯ãã®çµããã«ããªãªããå
¥ããïŒè¡šäžã®åã®é ã«ã¯é©åãªé¡ãã€ãïŒé©åãªç¥åãçšããŠçãããïŒåäœãæç€ºããïŒåè¡ã»ååã«çªå·ãã€ããããšã¯æ¬æåŒçšã«å¿
èŠãªå Žåãé€ãé¿ããïŒ
#figure(
image("vconf2024.png", width: 95%),
caption: [䞻匵ãè£ä»ããããŒã¿ã説æã®ããã®å³ãé
眮ããŠãããïŒ],
) <fig:sample_figure>
#heading(level: 1, numbering: none)[è¬èŸ]
ããŒãã£ã«åŠäŒ Typstçãã³ãã¬ãŒãã®äœæã«ãããïŒã¯ãã€ã\@re_hako_moonæ§ã®LaTeXãã³ãã¬ãŒããåèã«ãããŠããã ããŸããïŒå¿ããæ·±ãæè¬ç³ãäžããŸãïŒ |
|
https://github.com/amanuensisfrances/LaTeX-math-expressions-in-Typst | https://raw.githubusercontent.com/amanuensisfrances/LaTeX-math-expressions-in-Typst/main/LaTeX-math-expressions-in-Typst.typ | typst | MIT License | // LaTeX MATH EXPRESSIONS IN TYPST
// (based on https://mirrors.ctan.org/info/symbols/math/maths-symbols.pdf and https://mirrors.ctan.org/fonts/newcomputermodern/doc/newcm-unimath-symbols.pdf)
// Math Alphabets
#let mathrm(input) = {$serif(#input)$}
#let mathsf(input) = {$sans(#input)$}
#let mathtt(input) = {$mono(#input)$}
#let mathup(input) = {$upright(#input)$}
#let mathit(input) = {$italic(#input)$}
#let mathbf(input) = {$bold(#input)$}
#let mathbb(input) = {$bb(#input)$}
#let mathcal(input) = {$cal(#input)$}
#let mathscr(input) = {$cal(#input)$} // see https://tex.stackexchange.com/q/361688 and https://zhuanlan.zhihu.com/p/569922028
#let mathfrak(input) = {$frak(#input)$}
#let mathnormal(input) = {$serif(italic(#input))$}
// Greek Letters
#let varepsilon = {$epsilon.alt$} // the default \epsilon in LaTeX
#let vartheta = {$theta.alt$}
#let varkappa = {$kappa.alt$}
#let varpi = {$pi.alt$}
#let varrho = {$rho.alt$}
#let varphi = {$phi.alt$} // the default \phi in LaTeX
// Binary Operation Symbols
#let pm = {$plus.minus$}
#let mp = {$minus.plus$}
#let Ast = {$ast.op$}
#let star = {$star.op$}
#let circ = {$compose$}
#let bullet = {$â¢$}
#let cdot = {$dot.op$}
#let cap = {$sect$}
#let cup = {$union$}
#let uplus = {$union.plus$}
#let sqcap = {$sect.sq$}
#let sqcup = {$union.sq$}
#let vee = {$and$}
#let land = {$and$}
#let wedge = {$or$}
#let lor = {$or$}
#let setminus = {$without$}
#let wr = {$wreath$}
#let smalldiamond = {$diamond.stroked.small$}
#let bigtriangleup = {$triangle.stroked.t$}
#let bigtriangledown = {$triangle.stroked.b$}
#let triangleleft = {$triangle.stroked.l$}
#let triangleright = {$triangle.stroked.r$}
#let smalltriangleleft = {$triangle.stroked.small.l$}
#let smalltriangleright = {$triangle.stroked.small.r$}
#let oplus = {$plus.circle$}
#let ominus = {$minus.circle$}
#let otimes = {$times.circle$}
#let oslash = {$â$}
#let odot = {$dot.circle$}
#let bigcirc = {$circle.big$}
#let ddagger = {$dagger.double$}
#let amalg = {$âš¿$}
// Relation Symbols
#let leq = {$lt.eq$}
#let preceq = {$⪯$}
#let ll = {$lt.double$}
#let subseteq = {$subset.eq$}
#let sqsubseteq = {$subset.eq.sq$}
#let vdash = {$â¢$}
#let geq = {$gt.eq$}
#let succeq = {$⪰$}
#let gg = {$gt.double$}
#let supseteq = {$supset.eq$}
#let sqsupseteq = {$supset.eq.sq$}
#let ni = {$in.rev$}
#let dashv = {$â£$}
#let equiv = {$ident$}
#let sim = {$tilde.op$}
#let simeq = {$tilde.eq$}
#let asymp = {$â$}
#let cong = {$tilde.eqq$}
#let neq = {$eq.not$}
#let doteq = {$â$}
#let propto = {$prop$}
#let mid = {$\u{2223}$}
#let bowtie = {$â$}
#let smile = {$â£$}
#let frown = {$â¢$}
// Punctuation Symbols
#let cdotp = {$dot.c$}
// Arrow symbols
#let leftarrow = {$arrow.l$}
#let Leftarrow = {$arrow.l.double$}
#let rightarrow = {$arrow.r$}
#let to = {$arrow.r$}
#let Rightarrow = {$arrow.r.double$}
#let leftrightarrow = {$arrow.l.r$}
#let Leftrightarrow = {$arrow.l.r.double$}
#let mapsto = {$arrow.r.bar$}
#let hookleftarrow = {$arrow.l.hook$}
#let leftharpoonup = {$harpoon.lt$}
#let leftharpoondown = {$harpoon.lb$}
#let rightleftharpoons = {$harpoons.rtlb$}
#let longleftarrow = {$arrow.l.long$}
#let Longleftarrow = {$arrow.l.double.long$}
#let longrightarrow = {$arrow.r.long$}
#let Longrightarrow = {$arrow.r.double.long$}
#let implies = {$thin thin arrow.r.double.long thin thin$}
#let longleftrightarrow = {$arrow.l.r.long$}
#let Longleftrightarrow = {$arrow.l.r.double.long$}
#let iff = {$thin thin arrow.l.r.double.long thin thin$}
#let longmapsto = {$arrow.r.long.bar$}
#let hookrightarrow = {$arrow.r.hook$}
#let rightharpoonup = {$harpoon.rt$}
#let rightharpoondown = {$harpoon.rb$}
#let rightcurvedarrow = {$″$}
#let leadsto = {$″$}
#let uparrow = {$arrow.t$}
#let Uparrow = {$arrow.t.double$}
#let downarrow = {$arrow.b$}
#let Downarrow = {$arrow.b.double$}
#let updownarrow = {$arrow.t.b$}
#let Updownarrow = {$arrow.t.b.double$}
#let nearrow = {$arrow.tr$}
#let searrow = {$arrow.br$}
#let swarrow = {$arrow.bl$}
#let nwarrow = {$arrow.tl$}
#let longrightsquigarrow = {$arrow.r.long.squiggly$}
// Miscellaneous Symbols
#let ldots = {$dots.h$}
#let aleph = {$×$}
#let hbar = {$planck.reduce$}
#let imath = {$ð€$}
#let jmath = {$ð¥$}
#let wp = {$â$}
#let mho = {$ohm.inv$}
#let cdots = {$dots.h.c$}
#let emptyset = {$nothing$}
#let surd = {$â$}
#let top = {$â€$}
#let bot = {$â¥$}
#let neg = {$not$}
#let flat = {$â$}
#let natural = {$â®$}
#let sharp = {$â¯$}
#let partial = {$â$}
#let ddots = {$dots.down$}
#let infty = {$infinity$}
#let Box = {$square.stroked$}
#let Diamond = {$diamond.stroked$}
#let Triangle = {$triangle.stroked.t$}
#let clubsuit = {$suit.club$}
#let diamondsuit = {$â¢$}
#let heartsuit = {$â¡$}
#let spadesuit = {$suit.spade$}
#let varclubsuit = {$â§$}
#let vardiamondsuit = {$suit.diamond$}
#let varheartsuit = {$suit.heart$}
#let varspadesuit = {$â€$}
// Variable-sized Symbols
#let prod = {$product$}
#let coprod = {$product.co$}
#let int = {$integral$}
#let oint = {$integral.cont$}
#let Join = {$âš$}
#let bigcap = {$sect.big$}
#let bigcup = {$union.big$}
#let bigsqcup = {$union.sq.big$}
#let bigvee = {$or.big$}
#let bigwedge = {$and.big$}
#let bigodot = {$dot.circle.big$}
#let bigotimes = {$times.circle.big$}
#let bigoplus = {$plus.circle.big$}
#let biguplus = {$union.plus.big$}
// Log-like Symbols
#let operatorname(input) = {$op(#input)$}
// arccos is predefined
#let arccot = {$operatorname("arccot")$}
#let arccsc = {$operatorname("arccsc")$}
#let arcosh = {$operatorname("arcosh")$}
#let arcoth = {$operatorname("arcoth")$}
#let arcsch = {$operatorname("arcsch")$}
#let arcsec = {$operatorname("arcsec")$}
// arcsin is predefined
// arctan is predefined
// arg is predefined
#let arsech = {$operatorname("arsech")$}
#let arsinh = {$operatorname("arsinh")$}
#let artanh = {$operatorname("artanh")$}
// cos is predefined
// cosh is predefined
// cot is predefined
// coth is predefined
// ctg is predfined
// csc is predefined
#let csch = {$operatorname("csch")$}
// deg is predefined
// det is predefined
// dim is predefined
// exp is predefined
// gcd is predefined
// hom is predefined
// #let Im = {$operatorname("Im")$} // uncomment this to redefine the imaginary part command from the default "â" to "Im"
// inf is predefined
// ker is predefined
#let lcm = {$operatorname("lcm")$}
// lg is predefined
// lim is predefined
// liminf is predefined
// limsup is predefined
// ln is predefined
// log is predefined
// max is predefined
// min is predefined
// mod is predefined
// Pr is predefined
// #let Re = {$operatorname("Re")$} // uncomment this to redefine the real part command from the default "â" to "Re"
// sec is predefined
#let sech = {$operatorname("sech")$}
// sin is predefined
// sinh is predefined
// sup is predefined
// tan is predefined
// tanh is predefined
// tg is predefined
// Delimiters
#let lfloor = {$â$}
#let rfloor = {$â$}
#let langle = {$âš$}
#let rangle = {$â©$}
#let vert = {$|$}
#let Vert = {$â$}
#let lceil = {$â$}
#let rceil = {$â$}
// Math Mode Accents
#let check(input) = {$accent(#input, caron)$}
#let Vec(input) = {$accent(#input, arrow)$}
#let ddot(input) = {$accent(#input, dot.double)$}
// Some other constructions
#let widetilde(input) = {$accent(#input, tilde)$}
#let overleftarrow(input) = {$accent(#input, arrow.l)$}
#let widehat(input) = {$accent(#input, hat)$}
#let overrightarrow(input) = {$accent(#input, arrow.r)$}
// Typst's root(n, x) = LaTeX's \sqrt[n]{x}
// Typst's \frac(a, b) = LaTeX's \frac{a}{b}
// AMS Delimiters
#let ulcorner = {$â$}
#let urcorner = {$â$}
#let llcorner = {$â$}
#let lrcorner = {$â$}
// AMS Arrows
#let dashrightarrow = {$arrow.r.dashed$}
#let rightdasharrow = {$arrow.r.dashed$}
#let Lleftarrow = {$arrow.l.quad$}
#let leftrightharpoons = {$harpoons.ltrb$}
#let upuparrows = {$arrows.tt$}
#let leftrightsquigarrow = {$â$}
#let rightleftarrows = {$arrows.rl$}
#let downdownarrows = {$arrows.bb$}
#let dashleftarrow = {$arrow.l.dashed$}
#let leftdasharrow = {$arrow.l.dashed$}
#let twoheadleftarrow = {$arrow.l.twohead$}
#let curvearrowleft = {$arrow.ccw.half$}
#let upharpoonleft = {$harpoon.tl$}
#let rightrightarrows = {$arrows.rr$}
#let twoheadrightarrow = {$arrow.r.twohead$}
#let curvearrowright = {$arrow.cw.half$}
#let upharpoonright = {$harpoon.tr$}
#let leftleftarrows = {$arrows.ll$}
#let leftarrowtail = {$arrow.l.tail$}
#let circlearrowleft = {$arrow.ccw$}
#let downharpoonleft = {$harpoon.bl$}
#let rightarrowtail = {$arrow.r.tail$}
#let circlearrowright = {$arrow.cw$}
#let downharpoonright = {$harpoon.br$}
#let leftrightarrows = {$arrows.lr$}
#let looparrowleft = {$arrow.l.loop$}
#let Lsh = {$â°$}
#let rightrightarrows = {$arrows.rr$}
#let looparrowright = {$arrow.r.loop$}
#let Rsh = {$â±$}
#let rightsquigarrow = {$arrow.r.squiggly$}
// AMS Negated Arrows
#let nleftarrow = {$arrow.l.not$}
#let nleftrightarrow = {$arrow.l.r.not$}
#let nrightarrow = {$arrow.r.not$}
#let nLeftrightarrow = {$arrow.l.r.double.not$}
#let nLeftarrow = {$arrow.l.double.not$}
#let nRightarrow = {$arrow.r.double.not$}
// AMS Greek
#let digamma = {$Ï$}
#let updigamma = {$Ï$}
#let Digamma = {$Ï$}
#let upDigamma = {$Ï$}
#let varkappa = {$ϰ$}
#let upvarkappa = {$kappa.alt$}
// AMS Hebrew
#let beth = {$×$}
#let daleth = {$×$}
#let gimel = {$×$}
// AMS Miscellaneous
#let Square = {$square.stroked$}
#let measureadangle = {$angle.arc$}
#let Game = {$â
$}
#let blacktriangle = {$triangle.filled.small.t$}
#let bigstar = {$â
$}
#let diagup = {$â$}
#let hslash = {$planck.reduce$}
#let lozenge = {$lozenge.stroked$}
#let nexists = {$exists.not$}
#let Bbbk = {$ð$}
#let blacktriangledown = {$triangle.filled.small.b$}
#let sphericalangle = {$angle.spheric$}
#let diagdown = {$â§µ$}
#let vartriangle = {$triangle.stroked.small.t$}
#let circledS = {$â$}
#let backprime = {$âµ$}
#let blacksquare = {$square.filled$}
#let triangledown = {$triangle.stroked.small.b$}
#let Finv = {$â²$}
#let varnothing = {$â$}
#let diameter = {$â$}
#let blacklozenge = {$â§«$}
#let eth = {$ð$}
#let matheth = {$ð$}
// AMS Binary Operators
#let dotplus = {$plus.dot$}
#let barwedge = {$âŒ$}
#let boxtimes = {$times.square$}
#let ltimes = {$â$}
#let curlywedge = {$and.curly$}
#let circledcirc = {$circle.nested$}
#let smallsetminus = {$â$}
#let veebar = {$â»$}
#let boxdot = {$dot.square$}
#let rtimes = {$â$}
#let curlyvee = {$or.curly$}
#let centerdot = {$dot.c$}
#let Cap = {$sect.double$}
#let doublebarwedge = {$â©$}
#let boxplus = {$plus.square$}
#let leftthreetimes = {$times.l$}
#let circleddash = {$dash.circle$}
#let intercal = {$âº$}
#let Cup = {$union.double$}
#let boxminus = {$minus.square$}
#let divideontimes = {$times.div$}
#let rightthreetimes = {$times.r$}
#let circledast = {$ast.circle$}
// AMS Binary Relations
#let leqq = {$lt.eqq$}
#let lessapprox = {$âª
$}
#let lessgtr = {$lt.gt$}
#let risingdotseq = {$â$}
#let subseteqq = {$â«
$}
#let curlyeqprec = {$eq.prec$}
#let trianglelefteq = {$âŽ$}
#let unlhd = {$âŽ$}
#let smallfrown = {$â$}
#let geqslant = {$⩟$}
#let gtrdot = {$gt.dot$}
#let gtreqqless = {$âª$}
#let thicksim = {$sim$}
#let sqsupset = {$supset.sq$}
#let succaprox = {$succ.approx$}
#let shortmid = {$thin thin thin thin â thin$}
#let varpropto = {$propto$}
#let blacktriangleright = {$triangle.filled.r$}
#let leqslant = {$⩜$}
#let approxeq = {$approx.eq$}
#let lesseqgtr = {$lt.eq.gt$}
#let fallingdotseq = {$â$}
#let Subset = {$subset.double$}
#let precsim = {$prec.tilde$}
#let vDash = {$âš$}
#let bumpeq = {$â$}
#let eqslantgtr = {$âª$}
#let ggg = {$gt.triple$}
#let eqcirc = {$â$}
#let thickapprox = {$approx$}
#let succcurlyeq = {$succ.eq$}
#let vartriangleright = {$â³$}
#let rhd = {$â³$}
#let shortparallel = {$thin thin thin â thin â$}
#let blacktriangleleft = {$triangle.filled.l$}
#let eqslantless = {$âª$}
#let lessdot = {$lt.dot$}
#let lesseqqgtr = {$âª$}
#let backsim = {$tilde.rev$}
#let sqsubset = {$subset.sq$}
#let precapprox = {$prec.approx$}
#let Vvdash = {$âª$}
#let Bumpeq = {$â$}
#let gtrsim = {$gt.tilde$}
#let gtrless = {$gt.lt$}
#let circeq = {$â$}
#let supseteqq = {$â«$}
#let curlysucceq = {$eq.succ$}
#let trianglerighteq = {$âµ$}
#let unrhd = {$âµ$}
#let between = {$â¬$}
#let lesssim = {$lt.tilde$}
#let lll = {$lt.triple$}
#let doteqdot = {$â$}
#let Doteq = {$â$}
#let backsimeq = {$tilde.eq.rev$}
#let preccurlyeq = {$prec.eq$}
#let vartriangleleft = {$â²$}
#let lhd = {$â²$}
#let smallsmile = {$â$}
#let geqq = {$gt.eqq$}
#let gtrapprox = {$âª$}
#let gtreqless = {$gt.eq.lt$}
#let triangleq = {$eq.delta$}
#let Supset = {$supset.double$}
#let succsim = {$succ.tilde$}
#let Vdash = {$â©$}
#let pitchfork = {$â$}
#let backepsilon = {$϶$}
#let upbackepsilon = {$϶$}
// AMS Negated Binary Relations
#let nless = {$lt.not$}
#let nleq = {$lt.eq.not$}
#let lnapprox = {$âª$}
#let precnapprox = {$prec.napprox$}
#let nvdash = {$â¬$}
#let nsubseteq = {$subset.eq.not$}
#let nsubseteqq = {$#h(5pt) slash #h(-7pt)â«
$}
#let varsubsetneqq = {$â«$}
#let ngeqq = {$#h(5pt) slash #h(-7pt) gt.eqq$}
#let gnsim = {$gt.ntilde$}
#let nsucceq = {$succ.eq.not$}
#let nshortparallel = {$thin thin thin #h(0.75pt) Ì·#h(-0.75pt) â thin â$}
#let ntriangleright = {$â«$}
#let nvartriangleright = {$â«$}
#let supsetneq = {$supset.neq$}
#let nleq = {$lt.eq.not$}
#let lneqq = {$lt.neqq$}
#let nprec = {$prec.not$}
#let nsim = {$tilde.not$}
#let nvDash = {$â$}
#let subsetneq = {$subset.neq$}
#let ngtr = {$gt.not$}
#let gneq = {$âª$}
#let gnapprox = {$âª$}
#let succnsim = {$succ.ntilde$}
#let nparallel = {$parallel.not$}
#let ntrianglerighteq = {$â$}
#let varsupsetneq = {$supset.eq_(#h(-4pt) Ì·)$}
#let nleqslant = {$#h(5pt) slash #h(-7pt) ⩜$}
#let lvertneqq = {$lt.eqq_(#h(-8.2pt)ïœ)$}
#let npreceq = {$#h(4.75pt) slash #h(-7.25pt) ⪯$}
#let notshortmid = {$thin thin thin thin #h(-0.25pt) Ì· #h(0.25pt) â thin$}
#let ntriangleleft = {$âª$}
#let nvartriangleleft = {$âª$}
#let varsubsetneq = {$subset.eq_(#h(-4pt) Ì·)$}
#let ngeq = {$gt.eq.not$}
#let gneqq = {$gt.neqq$}
#let nsucc = {$succ.not$}
#let succnapprox = {$succ.napprox$}
#let nvDash = {$â$}
#let nsupseteq = {$supset.eq.not$}
#let supsetneqq = {$â«$}
#let nleqq = {$#h(5pt) slash #h(-7pt) lt.eqq$}
#let lnsim = {$lt.ntilde$}
#let precnsim = {$prec.ntilde$}
#let nmid = {$divides.not$}
#let ntrianglelefteq = {$â¬$}
#let subsetneqq = {$â«$}
#let ngeqslant = {$#h(5pt) slash #h(-7pt)⩟$}
#let gvertneqq = {$gt.eqq_(#h(-8.2pt)ïœ)$}
#let ncong = {$tilde.eqq.not$}
#let nVDash = {$â¯$}
#let nsupseteqq = {$#h(5pt) slash #h(-7pt)â«$}
#let varsupsetneqq = {$â«$}
// Selected stmaryrd Delimiters (that are available in the NewComputerModern Math font)
#let Lbag = {$â
$}
#let Rbag = {$â$}
#let lbag = {$â
$}
#let rbag = {$â$}
#let llceil = {$â #h(-3.5pt) â #h(-1.125pt)$}
#let lCeil = {$â #h(-3.5pt) â #h(-1.125pt)$}
#let rrceil = {$#h(-1.125pt) â #h(-3.5pt) â$}
#let rCeil = {$#h(-1.125pt) â #h(-3.5pt) â$}
#let llfloor = {$â #h(-3.5pt) â #h(-1.125pt)$}
#let lFloor = {$â #h(-3.5pt) â #h(-1.125pt)$}
#let rrfloor = {$#h(-1.125pt) â #h(-3.5pt) â$}
#let rFloor = {$#h(-1.125pt) â #h(-3.5pt) â$}
#let llbracket = {$âŠ$}
#let lBrack = {$âŠ$}
#let rrbracket = {$â§$}
#let rBrack = {$â§$}
// Selected stmaryrd Arrows (that are available in the NewComputerModern Math font)
#let Longmapsfrom = {$arrow.l.double.long.bar$}
#let nnearrow = {$arrow.tr$}
#let nearrow = {$arrow.tr$}
#let longmapsfrom = {$arrow.l.long.bar$}
#let lightning = {$â¯$}
#let downzigarrow = {$â¯$}
#let Longmapsto = {$arrow.r.double.long.bar$}
#let nnwarrow = {$arrow.tl$}
#let nwarrow = {$arrow.tl$}
#let mapsfrom = {$arrow.l.bar$}
#let llparenthesis = {$âŠ$}
#let rrparenthesis = {$âŠ$}
#let Mapsfrom = {$arrow.l.double.bar$}
#let ssearrow = {$arrow.br$}
#let searrow = {$arrow.br$}
#let leftarrowtriangle = {$âœ$}
#let Mapsto = {$arrow.r.double.bar$}
#let swarrow = {$arrow.bl$}
#let swarrow = {$arrow.bl$}
#let rightarrowtriangle = {$âŸ$}
#let leftrightarrowtriangle = {$â¿$}
// Selected stmaryrd Binary Operators (that are available in the NewComputerModern Math font)
#let boxast = {$ast.sq$}
#let boxcircle = {$â§$}
#let varogreaterthan = {$gt.circle$}
#let ogreaterthan = {$gt.circle$}
#let ogtr = {$gt.circle$}
#let varcurlyvee = {$or.curly$}
#let varobslash = {$backslash.circle$}
#let obslash = {$backslash.circle$}
#let varolessthan = {$lt.circle$}
#let olessthan = {$lt.circle$}
#let oless = {$lt.circle$}
#let varotimes = {$times.circle$}
#let boxbar = {$â«$}
#let obar = {$⊶$}
#let varobar = {$âœ$}
#let varcurlyvee = {$and.curly$}
#let varocircle = {$circle.nested$}
#let ocircle = {$circle.nested$}
#let varominus = {$minus.circle$}
#let boxbox = {$â§$}
#let emptybox = {$square.stroked$}
#let talloblong = {$⫟$}
#let varoast = {$ast.circle$}
#let oast = {$ast.circle$}
#let varodot = {$dot.circle$}
#let varoplus = {$dot.circle$}
#let Yup = {$â
$}
#let boxbslash = {$â§
$}
#let boxslash = {$â§$}
#let boxdiag = {$â§$}
#let interleave = {$⫎$}
#let varbigcirc = {$circle.big$}
#let varoslash = {$â$}
// Selected stmaryrd Large Binary Operators (that are available in the NewComputerModern Math font)
#let biginterleave = {$⫌$}
#let bigsqcap = {$sect.sq.big$} |
https://github.com/yonatanmgr/university-notes | https://raw.githubusercontent.com/yonatanmgr/university-notes/main/0366-%5BMath%5D/03661101-%5BCalculus%201A%5D/src/lectures/03661101_lecture_15.typ | typst | #import "/template.typ": *
#import "/utils/graph.typ": *
#show: project.with(
title: "××××Ž× 1×׳ - ש××¢×ך 15",
authors: ("<NAME>",),
date: "20 ××€×ך××ך, 2024",
)
#set enum(numbering: "(1.×)")
=== (×ש׀×) ××©×€× ××¡× ××××ץ׳
× ×ª×× ×ת ש××ש ×€×× ×§×Š××ת $f,g,h: I bs {x_0} -> RR$. × × ×× ×× ×תק××× $f(x)<=g(x)<=h(x), forall x in I bs {x_0}$, ××× $limto(x_0) f(x) = limto(x_0) h(x) = L$. ×××, $limto(x_0) g(x) = L$.
==== ××××× (××€× ×××ךת ×§×ש×)
× ××§× $epsilon >0$ שך×ך×ת×. ×× $exists delta_1 > 0: 0< abs(x-x_0)<delta_1 => abs(f(x)-L)<epsilon => L-epsilon<f(x)$, \ ××× $exists delta_2 >0:0<abs(x-x_0) < delta_2 => abs(h(x) -L) < epsilon => h(x) < L+epsilon$.
× ××ך $delta = min{delta_1, delta_2}$. \ ×× $0<abs(x-x_0)<delta$ ××ךך $L-epsilon < f(x) <= g(x) <= h(x) < L+epsilon$. ××××ך $abs(g(x)-L) < epsilon$. #QED
==== ×××××
׊׎×: $liminff((2^x+3^x)^(1/x))= 3$.
× ×š×× ×× $f(x) = 3 = (3^x)^(1/x) <= (2^x+3^x)^(1/x) <= (3^x+3^x)^(1/x) = (2 dot 3^x)^(1/x) = 2^(1/x)dot 3 = h(x)$. ××€× ××× ××¡× ××××ץ׳, ×× × ×××× ×× $h(x)->3$, ס×××× ×.
×× ××, × ×××× ×× $liminff(2^(1/x))=1$:
$ forall epsilon > 0 exists N >0 : forall x > N => abs(2^(1/x)-1) < epsilon ==> forall epsilon > 0 exists N in NN : abs(2^(1/N) - 1) <epsilon ==> 2^(1/N) < 1 + epsilon $
××× $forall x > N$ ×תק××× $1-epsilon < 1 < 2^(1/x) < 2^(1/N) < 1+epsilon$. #QED
=== (×××) $limto(0) (sin x)/x = 1$.
==== ×××××
×ס׀××§ ×××××× $limto(0^+) (sin x)/x = 1$ ×× ×× $limto(0^-) (sin x)/x eq^(x=-t) limits(lim)_(t->0^+) (sin (-t))/(-t) = limits(lim)_(t->0^+) (sin t)/t =1$. ××ך ××××× × ×× $forall 0 <= x < pi/2$, $sin x <= x$. × ×××× ×עת ×× $x<=tan x, forall 0 <= x < pi/2$.
// #grid(columns: 2)[
#align(center)[
#image("/attachments/Screenshot 2024-02-20 at 12.41.47.png", width: 25%)
]
// ]
××× ×©×× ××ש××ש $triangle.t O A C$ $<=$ ש×× ××××š× $O A B$. $cancel(1/2) r x <= cancel(1/2) r abs(C A) = tan x, 0<x<pi/2$. ××××ך, ×§×××× ×$x <= tan x, forall 0 <= x < pi/2$. ××× $sin x <= x <= tan x, 0<=x<pi/2$ $arrl$ $1<= x/(sin x) <= 1/(cos x), 0< x< pi/2$.
× ×§×× ××ס××£ $cos x <= (sin x)/x <= 1, 0<x<pi/2$. × ×š×× ×× $cos x -->^(x->0^+) 1$, ×××× ×××× ××¡× ××××ץ׳ $(sin x)/x->1$. #QED
#pagebreak()
= ך׊××€×ת ×©× ×€×× ×§×Š××
== ך׊××€×ת ×× ×§××× ×××§××¢
- ת×× $f: I->RR$ ××שך $I=(a,b)$ ×§××¢ ׀ת××. × ××ך ×× $f$ *ך׊××€× ×× ×§××× $x_0 in I$* ×× ×תק××× $limto(x_0) f(x)= f(x_0)$.
- × ××ך ×× ××€×× ×§×Š×× *ך׊××€× ××× ××§××¢ ×׀ת×× $I$* ×× $f$ ך׊××€× ××× × ×§××× $x_0 in I$.
=== (×××××) ××× ×€×× ×§×Š×ת ××ך×××× ×š×Š××€×?
×¢××ך ×€×× ×§×Š×ת ××ך××××, ×שך ×××××š× $D(x) = cases(1 "if" x in QQ, 0 "if" x in.not QQ)$ ××××× × ×× $exists.not limto(x_0) D(x)$ ×ש×× × ×§××× $x_0 in RR$. ×××, $D(x)$ ×× ×š×Š××€× ×ש×× × ×§××× $x_0 in RR$. ××Š× ×©× ×, ×××× × ×× ×ת ××€×× ×§×Š×× $f(x) = x D(x)$ ש×× ×× ××× ×××× ××× $0!=x in RR$. ×× $limto(0) f(x) = 0 =f(0)$ ××× $f(x)$ ך׊××€× ×× ×§××× ××ש×ת ××××× $x_0 = 0$.
== ך׊××€×ת ××××× ××ש××× ×× ×§×××ת ××-ך׊××€×ת
=== (×××ך×) ך׊××€×ת ××××× ××ש×××
- ת×× $f: [a,b) -> RR$. × ××ך ש-$f$ *ך׊××€× ××××× ×× ×§××× $a$* ×× ×תק××× $limto(a^+) f(x) = f(a)$.
- ת×× $f: (c,a] -> RR$. × ××ך ש-$f$ *ך׊××€× ×ש××× ×× ×§××× $a$* ×× ×תק××× $limto(a^-) f(x) = f(a)$.
=== (×××ך×) ׊×׊×× ×€×× ×§×Š××
× ×ª×× × ×€×× ×§×Š×× $f: A->RR$ ×-$B subset A$. × ×¡×× $bv(f, B)$ ×ת ××€×× ×§×Š×× $f$ ×××××ךת ךק ×¢× $B$.
=== (××¢× ×) ת×× $f: (c,b) -> RR$ ×ת×× $a in (c,b)$. ××× $f$ ך׊××€× ×-$a$ ×××Ž× $bv(f, (c,a])$ ך׊××€× ×ש××× ×-$a$ ×-$bv(f, [a,b))$ ך׊××€× ××××× ×-$a$.
=== (×××ך×) × ×§××ת ××-ך׊××€×ת
- × ×ª×× × ×€×× ×§×Š×× $f$ ×××××ךת ××§××¢ ×׀ת×× $I$ ס××× × ×§××× $x_0$, ×€×š× ×××× ×× ×§××× $x_0$ ע׊××. ×××, ×× ×§××× $x_0$ × ×§×š×ת *× ×§××ת ××-ך׊××€×ת ס×××§×* ×× $exists limto(x_0) f(x) != f(x_0)$.
- *× ×§××ת ××-ך׊××€×ת ×ס×× ×š×ש××*: ×× ×§××××× ×ש×× ×× ××××××ת ×××-׊××××× $limto(x_0^+) f(x)$ ×-$limto(x_0^+) f(x)$.
- *× ×§××ת ××-ך׊××€×ת ×ס×× ×©× ×*: ×× ××€××ת ××× ×××××××ת ×××-׊××××× $limto(x_0^+) f(x)$ ×-$limto(x_0^+) f(x)$ ×× ×§×××.
==== ×××××: $y= f(x) = sin 1/x, x_0 = 0$
#graph(w: 15, h: 2, start:0.2, end:-0.2, functions: (x=>calc.sin(1/x),), h-asymptotes: (1, -1))
$ sin (1/x) = 0 ==> 1/x = pi k ==> x_k^((1)) = 1/(pi k), k=pm 1, pm 2, p, 3, dots ==> sin 1/x = 1 ==> \
1/x = pi/2 + 2pi k, k=0, pm 1, pm 2, dots ==> x_k^((2)) = 1/(pi/2 + 2pi k)
$
××× ×§××× $limto(0) sin 1/x$? ××, ×× $x_k^((1)) -->^(k->oo) 0 $ ×-$x_k^((2)) -->^(k->oo) 0$. $f(x_k^((1))) = 0 --> 0$ ×× $f(x_k^((2))) = 1 --> 1$ ×-$0!=1$.
×××, ××€× ×××ךת ×××× ×, $exists.not limto(0) sin 1/x$ ××× $x_0 = 0$ × ×§××ת ××-ך׊××€×ת ××ס×× ××©× ×.
==== ××××× × ×ס׀ת: ××× ×§××× $limto(0) f(x)$ ×¢××ך $f(x)=x sin 1/x$?
××, ×× $x->0$ ×-$sin 1/x$ ×ס××× (××שך $x->0$) ××× $x sin 1/x -> 0$.
#align(center)[
#graph(w: 8, h: 8, start:0.1125, end:-0.1125, functions: (x=>x*calc.sin(1/x),), additionals: ( x=>x, x=>-x))
]
|
|
https://github.com/herbhuang/utdallas-thesis-template-typst | https://raw.githubusercontent.com/herbhuang/utdallas-thesis-template-typst/main/content/background.typ | typst | MIT License | #import "/utils/todo.typ": TODO
= Background
#TODO[
Describe each proven technology / concept shortly that is important to understand your thesis. Point out why it is interesting for your thesis. Make sure to incorporate references to important literature here.
]
== e.g. User Feedback
#TODO[
This section would summarize the concept User Feedback using definitions, historical overviews and pointing out the most important aspects of User Feedback.
]
== e.g. Representational State Transfer
#TODO[
This section would summarize the architectural style Representational State Transfer (REST) using definitions, historical overviews and pointing out the most important aspects of the architecture.
]
== e.g. Scrum
#TODO[
This section would summarize the agile method Scrum using definitions, historical overviews and pointing out the most important aspects of Scrum.
] |
https://github.com/Enter-tainer/zint-wasi | https://raw.githubusercontent.com/Enter-tainer/zint-wasi/master/typst-package/README.md | markdown | MIT License | # tiaoma
[tiaoma(æ¡ç )](https://github.com/enter-tainer/zint-wasi) is a barcode generator for typst. It compiles [zint](https://github.com/zint/zint) to wasm and use it to generate barcode. It support nearly all common barcode types. For a complete list of supported barcode types, see [zint's documentation](https://zint.org.uk/):
- Australia Post
- Standard Customer
- Reply Paid
- Routing
- Redirection
- Aztec Code
- Aztec Runes
- Channel Code
- Codabar
- Codablock F
- Code 11
- Code 128 with automatic subset switching
- Code 16k
- Code 2 of 5 variants:
- Matrix 2 of 5
- Industrial 2 of 5
- IATA 2 of 5
- Datalogic 2 of 5
- Interleaved 2 of 5
- ITF-14
- Deutsche Post Leitcode
- Deutsche Post Identcode
- Code 32 (Italian pharmacode)
- Code 3 of 9 (Code 39)
- Code 3 of 9 Extended (Code 39 Extended)
- Code 49
- Code 93
- Code One
- Data Matrix ECC200
- DotCode
- Dutch Post KIX Code
- EAN variants:
- EAN-13
- EAN-8
- Grid Matrix
- GS1 DataBar variants:
- GS1 DataBar
- GS1 DataBar Stacked
- GS1 DataBar Stacked Omnidirectional
- GS1 DataBar Expanded
- GS1 DataBar Expanded Stacked
- GS1 DataBar Limited
- Han Xin
- Japan Post
- Korea Post
- LOGMARS
- MaxiCode
- MSI (Modified Plessey)
- PDF417 variants:
- PDF417 Truncated
- PDF417
- Micro PDF417
- Pharmacode
- Pharmacode Two-Track
- Pharmazentralnummer
- POSTNET / PLANET
- QR Code
- rMQR
- Royal Mail 4-State (RM4SCC)
- Royal Mail 4-State Mailmark
- Telepen
- UPC variants:
- UPC-A
- UPC-E
- UPNQR
- USPS OneCode (Intelligent Mail)
## Example
```typ
#import "@preview/tiaoma:0.2.1"
#set page(width: auto, height: auto)
= tiáo mÇ
#tiaoma.ean("1234567890128")
```

## Manual
Please refer to [manual](./manual.pdf) for more details.
## Alternatives
There are other barcode/qrcode packages for typst such as:
- https://github.com/jneug/typst-codetastic
- https://github.com/Midbin/cades
Packages differ in provided customization options for generated barcodes. This package is limited by zint functionality, which focuses more on coverage than customization (e.g. inserting graphics into QR codes). Patching upstream zint code is (currently) outside of the scope of this package - if it doesn't provide functionality you need, check the rest of the typst ecosystem to see if it's available elsewhere or request it [upstream](https://github.com/zint/zint) and [notify us](https://github.com/Enter-tainer/zint-wasi/issues) when it's been merged.
### Pros
1. Support for far greater number of barcode types (all provided by zint library)
2. Should be faster as is uses a WASM plugin which bundles zint code which is written in C; others are written in pure typst or javascript.
### Cons
1. While most if not all of zint functionality is covered, it's hard to guarantee there's no overlooked functionality.
2. This package uses typst plugin system and has a WASM backend written in Rust which makes is less welcoming for new contributors.
|
https://github.com/crd2333/crd2333.github.io | https://raw.githubusercontent.com/crd2333/crd2333.github.io/main/src/docs/AI/Reinforce%20Learning/çç¥åŠä¹ .typ | typst | ---
order: 3
---
#import "/src/components/TypstTemplate/lib.typ": *
#show: project.with(
title: "AI ç¬è®°ä¹åŒºååŠä¹ ",
lang: "zh",
)
#let ba = $bold(a)$
#let bw = $bold(w)$
= çç¥åŠä¹
== çç¥æ¢¯åºŠ
- åé¢è®²çæ¯åºäºä»·åŒïŒ$V$æ$Q$ïŒççç¥ïŒèçç¥æ¢¯åºŠæ¯å®å
šäžåçäžç§æ¹æ³
- å顟
- #fig("/public/assets/AI/AI_RL/img-2024-07-05-09-36-52.png")
- #fig("/public/assets/AI/AI_RL/img-2024-07-05-09-38-37.png")
- #fig("/public/assets/AI/AI_RL/img-2024-07-05-09-41-23.png")
- äŒç¹ïŒå
·ææŽå¥œçæ¶ææ§èŽšïŒåšé«ç»ŽåºŠæè¿ç»çåšäœç©ºéŽäžæŽææïŒèœå€åŠä¹ åºéæºçç¥
- 猺ç¹ïŒéåžžäŒæ¶æå°å±éšæäŒèéå
šå±æäŒïŒè¯äŒ°äžäžªçç¥éåžžäžå€é«æå¹¶å
·æèŸå€§çæ¹å·®
- åå°ç°åšïŒäžºä»ä¹èŠåŒå
¥åºäºçç¥ç区ååŠä¹ æ¹æ³ïŒ
- åºäºä»·åŒç区ååŠä¹ æ¹æ³ïŒ
+ åŠä¹ ä»·åŒåœæ°
+ å©çšä»·åŒåœæ°å¯Œåºçç¥
+ æŽé«çæ ·æ¬è®ç»æç
+ éåžžä»
éçšäºå
·æçŠ»æ£åšäœçç¯å¢
- åºäºçç¥ç区ååŠä¹ æ¹æ³ïŒ
+ äžéèŠä»·åŒåœæ°
+ çŽæ¥åŠä¹ çç¥
+ åšé«ç»Žæè¿ç»åšäœç©ºéŽåºæ¯äžæŽå 髿
+ éçšä»»äœåšäœç±»åçåºæ¯
+ å®¹ææ¶æå°æ¬¡äŒè§£
- åºäºæŒå-è¯è®ºå®¶çæ¹æ³å°äºè
äŒå¿ç»å
- åºäºçç¥ç区ååŠä¹ æ¹æ³æ¹æ³çŽæ¥æçŽ¢æäŒçç¥$pi^*$
- éåžžåæ³æ¯åæ°åçç¥ $pi_theta$ïŒå¹¶å©çšæ æ¢¯åºŠæåºäºæ¢¯åºŠçäŒåæ¹æ³å¯¹åæ°è¿è¡æŽæ°
- æ æ¢¯åºŠäŒåïŒå¯ååŒäŒåæ¹æ³ïŒåŠæé差忹æ³ã亀åçµæ¹æ³ãéäŒ ç®æ³çïŒå¯ä»¥ææèŠçäœç»Žåæ°ç©ºéŽïŒäœåºäºæ¢¯åºŠçè®ç»ä»ç¶æ¯éŠéïŒå 䞺å
¶å
·ææŽé«çéæ ·æçïŒè¿é没æè¯Šç»å±åŒïŒ
- 对æ¯ä¹åçè¡šæ Œåçç¥
+ éåæäžªåšäœçæŠççè®¡ç®æ¹åŒäžåïŒç¶æ $s$ äžéååšäœ $a$ çæŠçïŒäžäžªæ¯çŽæ¥æ¥è¡šïŒäžäžªæ¯è®¡ç® $pi_theta (a|s)$
+ çç¥çæŽæ°æ¹åŒäžåïŒäžäžªæ¯çŽæ¥ä¿®æ¹è¡šæ Œå¯¹åºæ¡ç®ïŒäžäžªæ¯æŽæ°åæ° $theta$
+ æäŒçç¥çå®ä¹äžå
- åºæ¬ææ³ïŒ
- å©çšç®æ åœæ°å®ä¹çç¥äŒå£æ§ïŒ$J(theta) = J(pi_theta)$ïŒç®æ åœæ°åŠäœè®Ÿè®¡?ïŒ
- å¯¹ç®æ åœæ°è¿è¡äŒåïŒäŒåæ¹ååŠäœè®¡ç®ïŒïŒä»¥å¯»æŸæäŒçç¥
- äŒåæ¹å
- ç®æ åœæ°äžå¯åŸ®åæ¶ïŒäœ¿çšæ æ¢¯åºŠç®æ³è¿è¡æäŒåæ°æçŽ¢
- ç®æ åœæ°å¯åŸ®åæ¶ïŒå©çšåºäºæ¢¯åºŠçäŒåæ¹æ³å¯»æŸæäŒçç¥ $theta_(t+1) <- theta_t + alpha nabla_theta J(theta_t)$
- ç®æ åœæ°
#fig("/public/assets/AI/AI_RL/img-2024-07-05-09-59-33.png")
- ç¶æååž$d(s)$
- çç¥æ å
³çç¶æååž
- åšè¿ç±»æ
åµäžïŒç®æ åœæ°å
³äºåæ°ç梯床éåžžæŽå¥œç®
- äžäžªç®åçåæ³æ¯å $d(s)$ 䞺ååååžïŒå³æ¯äžªç¶æéœæçžåçæé $1\/|S|$
- åŠäžç§åæ³æ¯ææééäžåé
ç»äžéšåç¶æéåãäŸåŠïŒåšäžäºä»»å¡äžïŒäžäžªåååªä»ç¶æ $s_0$ åŒå§ïŒé£ä¹å¯ä»¥è®Ÿçœ®äžºïŒ$d(s_0)=1,d(s!=s_0)=0$
- çç¥çžå
³çç¶æååž
- åšè¿ç§æ
åµäžïŒéåžžéçšçš³æç¶æååž
- $d(s)$ æ¯çš³æç¶æååžïŒè¥å¯¹äžäžªç¶æèœ¬ç§» $s->a->s'$ïŒæ»¡è¶³ïŒ#mitex(`d(s^{\prime})=\sum_{s\in\mathcal{S}}\sum_{a\in\mathcal{A}}p(s^{\prime}|s,a)\cdot\pi_{\theta}(a|s)\cdot d(s)`)
- åŠæéçšæå€§åå¹³åèœšè¿¹åæ¥ç®æ åœæ°$ max_theta J(theta)=max_theta EE_(tau wave p_theta (tau)) [sum_t r(s_t,a_t)] $
- $tau$ 䞺çç¥ $pi_theta$ éæ ·èæ¥ç蜚迹 ${s_1,a_1,r_1,dots,s_T}$
- è®° $G(tau)=sum_t r(s_t,a_t)$ïŒå¹³åèœšè¿¹åæ¥ç®æ ççç¥æ¢¯åºŠäžºïŒ
$ nabla_theta J(theta)=nabla_theta int p_theta (tau)G(tau) dif tau &= EE_(tau wave p_theta (tau)) [nabla_theta log p_theta (tau)G(tau)]\ &=EE_(tau wave p_theta (tau)) [sum_(t=1)^T nabla_theta log pi_theta (a_t|s_t)G(tau)] $
- å
¶äžåºç° $log$ æ¯å 䞺ä¹äžäžªé€äžäžª $p_theta (tau)$ïŒäºæ¯ $(nabla_theta p_theta (tau)) / (p_theta (tau))$ åæ $nabla_theta log p_theta (tau)$
- #fig("/public/assets/AI/AI_RL/img-2024-07-05-10-18-35.png")
- åŠå€äž€ç§ç®æ åœæ°åçç¥æ¢¯åºŠ
#fig("/public/assets/AI/AI_RL/img-2024-07-05-10-19-19.png")
- 䜿çšäžåççç¥æ¢¯åºŠïŒä»¥åäžåçè¿äŒŒæ¹æ³ïŒæä»¬å¯ä»¥åŸå°åç§åæ ·çåºäºçç¥æ¢¯åºŠç区ååŠä¹ ç®æ³ïŒåŠ REINFORCEãDDPGãPPOç
=== REINFORCE ç®æ³
- 对äºéæºçç¥$pi_theta (a,s) = P(a|s, theta)$
- çŽè§äžæä»¬åºè¯¥ïŒéäœåžŠæ¥äœä»·åŒ/å¥å±çåšäœåºç°çæŠçïŒæé«åžŠæ¥é«ä»·åŒ/å¥å±çåšäœåºç°çæŠç
- äžäžç« äžæä»¬æšå¯Œåºäºçç¥æ¢¯åºŠïŒæå€§åå¹³åèœšè¿¹åæ¥ç®æ åœæ°ïŒïŒåšå®è·µäžïŒæä»¬å¯ä»¥çšèç¹å¡æŽæ¹æ³è¿è¡äŒ°è®¡ #mitex(`\nabla_{\theta}J(\theta)=\ \frac{1}{N}\sum_{n=1}^{N}\sum_{t=1}^{T^{n}}R(\tau^{n})\nabla_{\theta}l o g\,\pi_{\theta}(a_{t}^{n}|s_{t}^{n})`)æ®æ€ïŒæä»¬å¯ä»¥åŸå° REINFORCE ç®æ³
#algo(caption: "REINFORCE ç®æ³")[
```typ
å©çšçç¥$pi_theta (a|s)$éæ ·$N$æ¡èœšè¿¹${tau_i}$
è®¡ç®æ¢¯åºŠ $nabla_theta J(theta)=1/N sum_(n=1)^N (sum_(t=1)^(T^n) R(tau^n) nabla_theta log pi_theta (a_t^n|s_t^n))$
æŽæ°åæ° $theta <- theta + alpha nabla_theta J(theta)$
```
]
#fig("/public/assets/AI/AI_RL/img-2024-07-05-15-16-33.png", width: 80%)
- æè区ååŠä¹ äžåç±»é®é¢å¯¹æ¯
+ éœæ¯èŸå
¥ç¶æïŒèŸåºèŠéåçè¡äžº
+ åç±»é®é¢ïŒçç£åŠä¹ ïŒïŒå讟æåžŠæ çŸçè®ç»æ°æ®ïŒéåå©çšæå€§äŒŒç¶æ³è¿è¡äŒå
+ 区ååŠä¹ ïŒæ²¡ææ çŸïŒåªèœéè¿è¯éçæ¹åŒäžç¯å¢äº€äºè·åå¥å±ïŒä»¥æ¿ä»£çç£ä¿¡æ¯è¿è¡è®ç»
- äžäžªé®é¢ââ*è®ç»å¯èœååšåå·®*
#fig("/public/assets/AI/AI_RL/img-2024-07-05-10-41-17.png")
- è§£å³åæ³ïŒæ·»å *baseline*ïŒå°å¥å±åœæ°åå»äžäžªåºçº¿ $b$ïŒäœ¿åŸ $R(tau)-b$ ææ£æèŽ
- åŠæ $R(tau)>b$ 就让éå对åºåšäœçæŠçæåïŒåŠæ $R(tau)<b$ 就让éå对åºåšäœçæŠçéäœ
- äžè¿°èç¹å¡æŽéæ ·æ¹æ³å䞺 #mitex(`\nabla_{\theta}J(\theta)=\ \frac{1}{N}\sum_{n=1}^{N}\sum_{t=1}^{T^{n}}(R(\tau^{n})-b)\nabla_{\theta}l o g\,\pi_{\theta}(a_{t}^{n}|s_{t}^{n})`)
- æ°åŠè¯æåå»äžäžªåºçº¿å¹¶äžäŒåœ±å忢¯åºŠçææåŒ
- åŠäœå®ç°çç¥æ¢¯åºŠïŒ
- éŸä»¥è®¡ç®ïŒåšå®é
åºçšæ¶ïŒéœäŒéçš PytorchãTensorflow äžçèªåšæ±å¯Œå·¥å
·èŸ
婿±è§£
- å°çç¥æ¢¯åºŠçç®æ åœæ°è§äžºæå€§äŒŒç¶æ³çç®æ åœæ°äžäžªå©çšçŽ¯ç§¯å¥å±è¿è¡å æççæ¬ïŒïŒïŒ
- çç¥æ¢¯åºŠç®æ³åšæ ·æ¬å©çšç以åçš³å®æ§äžååšçŒºé·
- ç±äºçç¥æ¢¯åºŠç®æ³äžºåçç¥ç®æ³ïŒå æ€æ ·æ¬å©çšçèŸäœ
- èŸå€§ççç¥æŽæ°æäžéå®çæŽæ°æ¥é¿äŒå¯ŒèŽè®ç»çäžçš³å®ïŒåšçç£åŠä¹ äžïŒè®ç»æ°æ®å
·æç¬ç«åååžçæ§èŽšïŒèåšåŒºååŠä¹ äžïŒäžéå®çæŽæ°æ¥é¿ $->$ åçç¥ $->$ äœèŽšéçæ°æ®ïŒäºæ¯å¯èœéŸä»¥ä»ç³ç³ççç¥äžæ¢å€ïŒè¿èå¯ŒèŽæ§èœåŽ©æºïŒ
- 犻çç¥æ¢¯åºŠïŒæ ¹æ®éèŠæ§éæ ·å©çšåŒçç¥æ ·æ¬
- å¬äžæ
- èªç¶çç¥æ¢¯åºŠ
- å¬äžæ
=== Actor-Critic ç®æ³
- 䞺ä»ä¹èŠåŒå
¥ Actor-CriticïŒäž»èŠæ¯å 䞺 REINFORCE æçäžé«
- REINFORCE ç®æ³äžççèœšè¿¹åæ¥ææéçšçŽæ¥çžå $R(tau^n)=sum_(t'=t)^T r(s_t'^i,a_t'^i)$
- è¿æ ·åæ¹å·®èŸå€§ïŒäžææ¶æãæä»¬å¯ä»¥çšåšäœä»·åŒäŒ°è®¡ $hat(Q)^pi$ æ¥è¿äŒŒèœšè¿¹åæ¥ææ$EE_(pi_theta) sum_(t'=t)^T r(s_t'^i,a_t'^i)$ïŒè¿å°±æ¯è¯è®ºå®¶(critic)
- 对åºå°ïŒçç¥ $pi_theta$ 称䞺æ§è¡è
(actor)
#algo(caption: "Actor-Critic ç®æ³")[
```typ
䜿çšåœåçç¥ $pi_theta$ åšç¯å¢äžè¿è¡éæ ·
çç¥æåïŒ$theta <- theta + alpha nabla_theta J(theta) approx 1/N sum_(i=1)^N (sum_(t=1)^T nabla_theta log pi_theta (a_t^i|s_t^i) hat(Q)^pi (s_t^i,a_t^i))$
æååœåçç¥çåšäœåŒåœæ°ïŒ$hat(Q)^pi (s_t'^i,a_t'^i) approx sum_(t'=t)^T r(s_t'^i,a_t'^i)$
```
]
#fig("/public/assets/AI/AI_RL/img-2024-07-05-15-17-48.png")
- Advantage Actor-Critc(A2C)ç®æ³
- ææ³ïŒéè¿åå»äžäžªåºçº¿åŒæ¥æ ååè¯è®ºå®¶çæå
- éäœèŸå·®åšäœæŠçïŒæé«èŸäŒåšäœæŠç
- è¿äžæ¥éäœæ¹å·®
- äŒå¿åœæ°ïŒ$A^pi (s,a)=Q^pi (s,a)-V^pi (s_t)$ïŒæ¹åcriticïŒäºæ¯åæ¬ AC ç®æ³ççç¥æ¢¯åºŠ #mitex(`\nabla_{\theta}J(\theta)\approx\frac{1}{N}\sum_{i=1}^{N}\left(\sum_{t=1}^{T}V_{\theta}\,l o g\,\pi_{\theta}(a_{t}^{i}|s_{t}^{i})\bar{Q}^{\pi}(s_{i}^{i},\alpha_{t}^{i})\right)`) å䞺 #mitex(`\nabla_{\theta}J(\theta)\approx\frac{1}{N}\sum_{i=1}^{N}\left(\sum_{t=1}^{T}\nabla_{\theta}\,l o g\,\pi_{\theta}(a_{t}^{i}|s_{t}^{i})\bar{A}^{\pi}(s_{i}^{i},\alpha_{t}^{i})\right)`)
- $Q$ å $V$éèŠçšäž€äžªç¥ç»çœç»æååïŒ
- äžéèŠ $hat(Q)^pi (s_t^i,a_t^i)= R(s_t^i,a_t^i) + gamma hat(V)^pi (s_(t+1)^i)$ïŒåªéçšäžäžªç¥ç»çœç»æå$hat(V)^pi$
- ç¶æåŒäŒ°è®¡$hat(V)^pi$èœåŠäžçç¥ $pi_theta$ å
±çšçœç»ïŒ
#fig("/public/assets/AI/AI_RL/img-2024-07-05-11-15-17.png")
- åŠæéçšçžåççœç»å»è®ç»ïŒè¿èŸ¹ç loss function 没æè®²ïŒactor ç lossïŒcritic ç lossïŒactor çæ£åå项 entropyïŒïŒå¯ä»¥åèä»£ç æè
ç #link("https://www.cnblogs.com/wangxiaocvpr/p/8110120.html")[è¿ç¯æç« ]
- æ¹éæŽæ°ïŒæ²¡å¬æïŒ
- é®é¢ïŒå©çšåäžªæ ·æ¬è¿è¡æŽæ°ïŒæŽæ°æ¹å·®èŸå€§ïŒè®ç»çš³å®æ§å·®
- è§£å³æ¹æ¡ïŒè·åŸäžäžªæ¹æ¬¡çæ°æ®ååè¿è¡æŽæ°ïŒåäžºåæ¥ååŒæ¥äž€ç§æ¹æ³
#fig("/public/assets/AI/AI_RL/img-2024-07-05-11-22-12.png")
- æ¹éæŽæ°åæ¹è¿
#fig("/public/assets/AI/AI_RL/img-2024-07-05-11-22-32.png")
- Asynchronous Advantage Actor-Critc(A3C)ç®æ³
- äžA2Cäžæ ·äœ¿çšäŒå¿åœæ°
- åŒæ¥çActor-Criticæ¹æ³èœå€å
åå©çšå€æ žCPUèµæºéæ ·ç¯å¢çç»éªæ°æ®ïŒå©çšGPUèµæºåŒæ¥å°æŽæ°çœç»ïŒè¿æææåäºåŒºååŠä¹ ç®æ³çè®ç»æç
== TRPO & PPO
- TRPOïŒTrust Region Policy OptimizationïŒæ¯äžç§åºäºçç¥æ¢¯åºŠç区ååŠä¹ ç®æ³ïŒå
¶ç®æ æ¯æå€§åçç¥çææåæ¥
- 眮信å(Trust Region)çæŠå¿µå°±æ¯åš $N(theta_"now")$ çé»åå
ïŒ$L(theta|theta_"now")$ è¶³å€éŒè¿äŒåç®æ $J(theta)$
- åé¢ä»ç»ççç¥æ¢¯åºŠæ¹æ³ïŒå
æ¬ REINFORCE å Actor-CriticïŒçšèç¹å¡æŽè¿äŒŒæ¢¯åºŠ $nabla_theta J(theta)$ïŒåŸå°éæºæ¢¯åºŠïŒç¶ååéæºæ¢¯åºŠäžåæŽæ° $theta$ïŒäœ¿åŸç®æ åœæ° $J(theta)$ å¢å€§ïŒèè¿éæ¯çšäžåçæ¹æ³
- ç®æ åœæ°ç价圢åŒåæ#mitex(`J(\theta)~=~\mathbb{E}_{S}\left[\mathbb{E}_{A\cdots\pi(\cdot|S;\theta_{\mathrm{now}})}\left[\frac{\pi(A\mid S;\,\theta)}{\pi(A\mid S;\,\theta_{\mathrm{now}})}~\cdot\,{\cal Q}_{\pi}(S,A)\right]\right]`)
- å
¶äž $Q_pi (S, A)$ äŸæ§æ æ³æ±è§£ïŒå æ€äœ¿çšè¿ä»£äžçäžäžæ¥ç $pi=pi(a_t | s_t\; theta_"old")$
- TRPO 第äºéšçœ®ä¿¡åçéæ©
- 讀䞺讟å®ç $Delta$
- çš KL æ£åºŠè¡¡é䞀䞪æŠç莚éåœæ°çè·çŠ»
- TRPO ç®æ³çæ£å®ç°èµ·æ¥å¹¶äžå®¹æïŒäž»èŠéŸç¹åšäºç¬¬äºæ¥ââæå€§åã
#hline()
- PPO åºäº TRPO çææ³ïŒäœæ¯å
¶ç®æ³å®ç°æŽå ç®å
- PPO-æ©çœ
- çŽæ¥å°çœ®ä¿¡å纊æ KL æ£åºŠäœäžºæå€±åœæ°çäžéšåïŒè¿æ ·å°±äžéèŠæ±è§£æå€§åé®é¢
- PPO-æªæ
- PPO çåŠäžç§åœ¢åŒ PPO-æªæïŒPPO-ClipïŒæŽå çŽæ¥ïŒå®åšç®æ åœæ°äžè¿è¡éå¶ïŒä»¥ä¿è¯æ°çåæ°åæ§çåæ°çå·®è·äžäŒå€ªå€§
== è¿ç»æ§å¶
- èèè¿æ ·äžäžªé®é¢ïŒæä»¬éèŠæ§å¶äžåªæºæ¢°æèïŒå®ææäºä»»å¡ïŒè·åå¥å±ãæºæ¢°æèæäž€äžªå
³èïŒåå«å¯ä»¥åš $[0, 360] äž [0, 180]$ çèåŽå
蜬åšãè¿äžªé®é¢çèªç±åºŠæ¯ $d = 2$ïŒåšäœæ¯äºç»ŽåéïŒåšäœç©ºéŽæ¯è¿ç»éå $cal(A) = [0, 360] times [0, 180]$ã
- æ€åæä»¬åŠè¿ç区ååŠä¹ æ¹æ³å
šéšéœæ¯é对犻æ£åšäœç©ºéŽïŒäžèœçŽæ¥è§£å³äžè¿°ç»æ§å¶é®é¢ãåŠæçšçœæ Œåæ¹æ³ïŒå°è¿ç»åšäœç©ºéŽçŠ»æ£åïŒäŒå¯ŒèŽåšäœç©ºéŽè¿å€§ïŒè®ç»æçäœäžãç¹å«æ¯èªç±åºŠèŸé«çé®é¢ïŒè¿ç§æ¹æ³å ä¹äžå¯è¡ã
== DPG
- ç¡®å®çç¥æ¢¯åºŠ(deterministic policy gradient)æ¯äžç§ actor-critic æ¹æ³
- ç¡®å®çç¥çœç»
- åšä¹åç« èéïŒçç¥çœç» $pi(a|s\; theta)$ æ¯äžäžªæŠç莚éåœæ°ïŒå®èŸåºçæ¯æŠçåŒãæ¬èçç¡®å®çç¥çœç» $mu(s\; theta)$ çèŸåºæ¯ $d$ 绎çåé $ba$ïŒäœäžºåšäœã䞀ç§çç¥çœç»äžäžªæ¯éæºçïŒäžäžªæ¯ç¡®å®æ§ç
- äžªäººè®€äžºäžæ¯åŸæ¬èŽšïŒïŒïŒïŒæè§å°±æ¯æåšå€ç argmax æŸå°ç¥ç»çœç»éé¢å»äº
- ç¡®å®ä»·åŒçœç»
- ä»·åŒçœç» $Q(s, ba\; bw)$ 乿¯äžäžªç¥ç»çœç»ïŒå®çèŸå
¥æ¯ç¶æ $s$ ååšäœ $ba$ïŒèŸåº $hat(q) = q(s, ba; bw)$ æ¯äžªå®æ°
- æ»èèšä¹ïŒäžªäººè®€äžºè¿éçžåœäº actor-critic çåç§ïŒå¹¶äžçæ£æäž€äžªçœç»åäºåŒæ¥ïŒäž€äžªçœç»åå«è®ç»ïŒèäžæ¯å
±äº«åå å±
- è®ç»è¿çš
- åè®ç»çæ¶åïŒå¯ä»¥åæ¶å¯¹ä»·åŒçœç»åçç¥çœç»åè®ç»ãæ¯æ¬¡ä»ç»éªåæŸæ°ç»äžæœåäžäžªåå
ç»ïŒè®°äœ $(s_j, a_j, r_j, s_(j+1))$ãæä»·åŒçœç»åçç¥çœç»åœååæ°åå«è®°äœ $w_"now"$ å $theta_"now"$
- |
|
https://github.com/YouXam/bupt-network-resources-guide | https://raw.githubusercontent.com/YouXam/bupt-network-resources-guide/main/README.md | markdown | MIT License | # bupt-network-resources-guide
åé®çœç»èµæºæåïŒå
å«äºåé®åŠçå¯èœéèŠçåç§çœç»èµæºçä»ç»åäœ¿çšæ¹æ³ã
ç®åœé¢è§ïŒ

## äžèœœ
äœ å¯ä»¥ä» [è¿é](https://github.com/YouXam/bupt-network-resources-guide/releases/latest/download/bupt-network-resources-guide.pdf) äžèœœææ°çæ¬ç PDF æä»¶ã
## çŒè¯
```bash
typst compile --font-path fonts main.typ bupt-network-resources-guide.pdf
``` |
https://github.com/Quaternijkon/notebook | https://raw.githubusercontent.com/Quaternijkon/notebook/main/content/æ°æ®ç»æäžç®æ³/.chapter-æ°æ®ç»æ/æ /äºåæ æå€§æ·±åºŠ.typ | typst | #import "../../../../lib.typ":*
=== #Title(
title: [äºåæ æå€§æ·±åºŠ],
reflink: "https://leetcode.cn/problems/maximum-depth-of-binary-tree/description/",
level: 1,
)<äºåæ æå€§æ·±åºŠ>
#note(
title: [
äºåæ æå€§æ·±åºŠ
],
description: [
ç»å®äžäžªäºåæ root ïŒè¿åå
¶æå€§æ·±åºŠã
äºåæ ç æå€§æ·±åºŠ æ¯æä»æ ¹èç¹å°æè¿å¶åèç¹çæé¿è·¯åŸäžçèç¹æ°ã
],
examples: ([
èŸå
¥ïŒroot = [3,9,20,null,null,15,7]
èŸåºïŒ3
],[
èŸå
¥ïŒroot = [1,null,2]
èŸåºïŒ2
]
),
tips: [
- æ äžèç¹çæ°éåš $[0, 10^4]$ åºéŽå
ã
- $-100 <= "Node.val" <= 100$
],
solutions: (
(
name:[ååºéåïŒDFSïŒ: éåœ],
text:[
æ çååºéå / 深床äŒå
æçŽ¢åŸåŸå©çš éåœ æ æ å®ç°ã
æŸç¶ïŒæ çæ·±åºŠ çäº å·Šåæ çæ·±åºŠ äž å³åæ çæ·±åºŠäžç æå€§åŒ +1ã
1. ç»æ¢æ¡ä»¶ïŒ åœ `rootâ` 䞺空ïŒè¯Žæå·²è¶è¿å¶èç¹ïŒå æ€è¿å 深床 0 ã
2. éæšå·¥äœïŒ æ¬èŽšäžæ¯å¯¹æ åååºéåã
- 计ç®èç¹ `rootâ` ç å·Šåæ çæ·±åºŠ ïŒå³è°çš `maxDepth(root.left)`ã
- 计ç®èç¹ `rootâ` ç å³åæ çæ·±åºŠ ïŒå³è°çš `maxDepth(root.right)`ã
3. è¿ååŒïŒ è¿å æ€æ çæ·±åºŠ ïŒå³ `max(maxDepth(root.left), maxDepth(root.right)) + 1`ã
],
code:[
```cpp
class Solution {
public:
int maxDepth(TreeNode* root) {
if (root == nullptr) return 0;
return max(maxDepth(root->left), maxDepth(root->right)) + 1;
}
};
```
]
),(
name:[å±åºéåïŒBFSïŒ],
text:[
æ çå±åºéå / 广床äŒå
æçŽ¢åŸåŸå©çš éå å®ç°ã
æ¯éåäžå±ïŒå计æ°åš +1 ïŒçŽå°éå宿ïŒåå¯åŸå°æ çæ·±åºŠã
+ ç¹äŸå€çïŒ åœ `rootâ` 䞺空ïŒçŽæ¥è¿å 深床 0 ã
+ åå§åïŒ éå `queue` ïŒå å
¥æ ¹èç¹ `root` ïŒïŒè®¡æ°åš `res` = 0ã
+ 埪ç¯éåïŒ åœ `queue` 䞺空æ¶è·³åºã
- åå§åäžäžªç©ºå衚 `tmp` ïŒçšäºäžŽæ¶ååšäžäžå±èç¹ã
- éåéåïŒ éå `queue` äžçåèç¹ `node` ïŒå¹¶å°å
¶å·Šåèç¹åå³åèç¹å å
¥ `tmpã`
- æŽæ°éåïŒ æ§è¡ `queue` = `tmp` ïŒå°äžäžå±èç¹èµåŒç» `queueã`
- ç»è®¡å±æ°ïŒ æ§è¡ `res += 1` ïŒä»£è¡šå±æ°å 1ã
+ è¿ååŒïŒ è¿å `res` å³å¯ã
],
code:[
```cpp
class Solution {
public:
int maxDepth(TreeNode* root) {
if (root == nullptr) return 0;
vector<TreeNode*> que;
que.push_back(root);
int res = 0;
while (!que.empty()) {
vector<TreeNode*> tmp;
for(TreeNode* node : que) {
if (node->left != nullptr) tmp.push_back(node->left);
if (node->right != nullptr) tmp.push_back(node->right);
}
que = tmp;
res++;
}
return res;
}
};
```
]
)
),
gain:none,
)
|
|
https://github.com/malramsay64/resume | https://raw.githubusercontent.com/malramsay64/resume/main/template.typ | typst | #import "utils.typ"
#import "@preview/fontawesome:0.4.0" as fa
/* Styles */
#let accentColor = luma(80)
#let headerInfoStyle(str) = {text(
size: 10pt,
fill: accentColor,
str
)}
#let headerQuoteStyle(str) = {text(
size: 10pt,
weight: "medium",
// style: "italic",
fill: accentColor,
str
)}
#let sectionTitleStyle(str, color:black) = {text(
size: 16pt,
weight: "bold",
fill: color,
str
)}
#let entryA1Style(str) = {text(
size: 10pt,
weight: "bold",
str
)}
#let entryA2Style(str) = {text(
weight: "medium",
// fill: accentColor,
style: "oblique",
str
)}
#let entryB1Style(str) = {text(
// size: 10pt,
fill: accentColor,
weight: "medium",
str
)}
#let entryB2Style(str) = {text(
size: 9pt,
weight: "medium",
fill: luma(80),
style: "oblique",
str
)}
// set rules
#let setrules(uservars, doc) = {
set text(
font: uservars.bodyfont,
weight: "regular",
size: uservars.fontsize,
)
set align(left)
set page(
paper: "a4",
margin: (
left: 1.8cm,
right: 1.8cm,
top: 1.5cm,
bottom: 1.8cm,
),
)
set list(
spacing: uservars.linespacing
)
set par(
leading: uservars.linespacing,
justify: true,
)
doc
}
// show rules
#let showrules(uservars, doc) = {
show heading.where(level: 1): set text(font: uservars.headingfont, size: 32pt)
show heading.where(level: 2): title => pad(bottom: 0.2em, grid(
columns: 2,
gutter: 1%,
sectionTitleStyle()[#title],
line(
start: (0pt, 0.95em),
length: 100%,
stroke: (paint: accentColor, thickness: 0.05em),
),
))
doc
}
// set page layout
#let cvinit(doc) = {
doc = setrules(doc)
doc = showrules(doc)
doc
}
// address
// TODO
#let addresstext(info, uservars) = {
if uservars.showAddress {
block(width: 100%)[
#info.personal.location.at("city", default: ""),
#info.personal.location.at("region", default: ""),
#info.personal.location.country #info.personal.location.at("postalCode", default: "")
#v(-4pt)
]
} else {none}
}
#let contacttext(info, uservars) = block(width: 100%)[
#let contact_display(icon, url, display: none) = {
let l = if display == none {
link(url)
} else {
link(url)[#display]
}
box([#icon #sym.zws #l])
}
#let profiles = (
contact_display(fa.fa-envelope(solid: true), "mailto:" + info.personal.email),
)
#if uservars.showNumber {
profiles.push(contact_display(fa.fa-phone(), "tel:" + info.personal.phone))
}
#if "url" in info.personal {
profiles.push(contact_display(fa.fa-home(), info.personal.url, display: info.personal.url.trim("https://", at: start)))
}
#if info.personal.profiles.len() > 0 {
for profile in info.personal.profiles {
let icon = if lower(profile.network) == "linkedin" {
fa.fa-linkedin()
} else if lower(profile.network) == "github" {
fa.fa-github()
// TODO: Extend the number of networks with icons
} else {
// fa.fa-circle()
}
profiles.push(contact_display(icon, profile.url, display: profile.username))
}
}
#headerInfoStyle(profiles.join([ #sym.bar.v ]))
#headerQuoteStyle(eval(info.personal.summary, mode: "markup"))
]
#let styleLabel(str) = {
text(
size: 20pt,
str
)
}
#let cvheading(info, uservars) = {
align(center)[
= #info.personal.name
#if "label" in info.personal {
styleLabel(info.personal.label)
}
#addresstext(info, uservars)
#contacttext(info, uservars)
]
}
#let entryHeading(posA1: none, url: none, posA2: none, posB1: none, dateStart: none, dateEnd: none) = {
let date = if dateStart == none {
utils.strpdate(dateEnd)
} else if dateEnd == none {
utils.strpdate(dateStart)
} else {
let start = utils.strpdate(dateStart)
let end = utils.strpdate(dateEnd)
[#start #sym.dash.en #end]
}
// parse ISO date strings into datetime objects
[
// line 1: company and location
#if url != none [
#entryA1Style(link(url, posA1)) #h(1fr) #entryA2Style(posA2)\
] else [
#entryA1Style(posA1) #h(1fr) #entryA2Style(posA2)\
]
#entryB1Style(posB1) #h(1fr) #entryB2Style(date) \
]
}
#let cvwork(info, isbreakable: true) = {
let work = utils
.filter_visible(info, "work")
.map(utils.validate_work_instance)
.sorted(key: i => i.positions.at(0).endDate)
.rev()
if work.len() > 0 [
== Work Experience
#for w in work {
// create a block layout for each work entry
for (index, p) in w.positions.enumerate() {
block(width: 100%, breakable: isbreakable)[
#if index == 0 {
entryHeading(posA1: w.organization, url: w.url, posA2: w.location, posB1: p.position, dateStart: p.startDate, dateEnd: p.endDate)
} else {
entryHeading(posB1: p.position, dateStart: p.startDate, dateEnd: p.endDate)
}
// highlights or description
#if p.summary != none [
#eval(p.summary, mode: "markup")
]
#for hi in p.highlights [
- #eval(hi, mode: "markup")
]
]
}
}
]
}
#let cveducation(info, isbreakable: true) = {
let education = utils
.filter_visible(info, "education")
.sorted(key: i => i.endDate)
.rev()
if education.len() > 0 [
== Education
#for edu in education {
let edu-items = ""
if edu.at("honors", default: none) != none {edu-items = edu-items + "- *Honors*: " + edu.honors.join(", ") + "\n"}
if edu.at("courses", default: none) != none {edu-items = edu-items + "- *Courses*: " + edu.courses.join(", ") + "\n"}
if edu.at("highlights", default: none) != 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)[
#entryHeading(
posA1: edu.institution,
url: edu.url,
posA2: edu.location,
posB1: [#edu.studyType in #edu.area],
dateStart: edu.startDate,
dateEnd: edu.endDate
)
#eval(edu.summary, mode: "markup")
#eval(edu-items, mode: "markup")
]
}
]
}
#let cvaffiliations(info, isbreakable: true) = {
if "affiliations" in info and info.affiliations != none [
== Leadership & Activities
#for org in info.affiliations {
// create a block layout for each affiliation entry
block(width: 100%, breakable: isbreakable)[
#entryHeading(
posA1: org.organization,
url: org.url,
posA2: org.location,
posB1: org.position,
dateStart: org.startDate,
dateEnd: org.endDate
)
// highlights or description
#if org.highlights != none {
for hi in org.highlights [
- #eval(hi, mode: "markup")
]
}
]
}
]
}
#let cvprojects(info, isbreakable: true) = {
let projects = utils
.filter_visible(info, "projects")
.sorted(key: i => i.endDate)
.rev()
if projects.len() > 0 [
== Projects
#for project in projects {
// create a block layout for each project entry
block(width: 100%, breakable: isbreakable)[
#entryHeading(
posA1: project.name,
url: project.at("url", default: none),
posB1: project.affiliation,
dateStart: project.startDate,
dateEnd: project.endDate
)
// summary or description
#eval(project.summary, mode: "markup")
#for hi in project.highlights [
- #eval(hi, mode: "markup")
]
// Project tools and technologies
#if "skills" in project and project.skills.len() > 0 [
// Ensure the skills look attached to the project
#v(-0.5em)
*Skills*: #project.skills.join(", ")
]
]
}
]
}
#let cvawards(info, isbreakable: true) = {
let awards = utils
.filter_visible(info, "awards")
.sorted(key: i => i.date)
.rev()
if awards.len() > 0 [
== Honors & Awards
#for award in awards {
// create a block layout for each award entry
block(width: 100%, breakable: isbreakable)[
#entryHeading(
posA1: award.title,
url: award.at("url", default: none),
posA2: award.location,
posB1: [Issued by #text(style: "italic")[#award.issuer]],
dateStart: award.date,
)
// summary or description
#eval(award.summary, mode: "markup")
#if award.at("highlights", default: none) != none {
for hi in award.highlights [
- #eval(hi, mode: "markup")
]
}
]
}
]
}
#let cvcertificates(info, isbreakable: true) = {
if "certificates" in info and info.certificates != none [
== Licenses & Certifications
#for cert in info.certificates {
// parse ISO date strings into datetime objects
let date = utils.strpdate(cert.date)
// create a block layout for each certificate entry
block(width: 100%, breakable: isbreakable)[
// line 1: certificate name
#if cert.at("url", default: none) != none [
*#link(cert.url)[#cert.name]* \
] else [
*#cert.name* \
]
// line 2: issuer and date
Issued by #text(style: "italic")[#cert.issuer] #h(1fr) #date \
]
}
]
}
#let cvpresentations(info, isbreakable: true) = {
let presentations = utils
.filter_visible(info, "presentations")
.sorted(key: i => i.date)
.rev()
if presentations.len() > 0 [
== Presentations
#for pres in presentations {
// create a block layout for each publication entry
block(width: 100%, breakable: isbreakable)[
#entryHeading(
posA1: pres.conference,
url: pres.at("url", default: none),
posA2: pres.location,
posB1: pres.title,
dateEnd: pres.date
)
#eval(pres.summary, mode: "markup")
]
}
]
}
#let cvpublications(info, isbreakable: true) = {
let publications = utils
.filter_visible(info, "publications")
.sorted(key: i => i.releaseDate)
.rev()
if publications.len() > 0 [
== Publications
#for pub in info.publications {
// parse ISO date strings into datetime objects
let date = utils.strpdate(pub.releaseDate)
// create a block layout for each publication entry
block(width: 100%, breakable: isbreakable)[
// line 1: publication title
#if pub.at("url", default: none) != none [
*#link(pub.url)[#pub.name]* \
] else [
*#pub.name* \
]
// line 2: publisher and date
Published in #text(style: "italic")[#pub.publisher] #h(1fr) #date \
]
}
]
}
#let cvskills(info, isbreakable: true) = {
let title = ()
if "languages" in info {
title.push("Languages")
}
if "skills" in info {
title.push("Skills")
}
if "interests" in info {
title.push("Interests")
}
if title.len() > 0 {block(breakable: isbreakable)[
== #title.join(", ")
#if ("languages" in info and info.languages != none) [
#let langs = ()
#for lang in info.languages {
langs.push([#lang.language (#lang.fluency)])
}
- *Languages*: #langs.join(", ")
]
#if ("skills" in info and info.skills != none) {
grid(
columns: 2,
gutter: 10pt,
..info.skills.map(s => {
(align(right)[*#s.category*], align(left)[#s.skills.join(", ")])
}).flatten()
)
}
#if ("interests" in info and info.interests != none) [
- *Interests*: #info.interests.join(", ")
]
]}
}
#let cvreferences(info, isbreakable: true) = {
if "references" in info and info.references != none {block[
== References
#for ref in info.references {
block(width: 100%, breakable: isbreakable)[
#if ref.at("url", default: none) != none [
- *#link(ref.url)[#ref.name]*: "#ref.reference"
] else [
- *#ref.name*: "#ref.reference"
]
]
}
]} else {}
}
#let endnote() = {
}
|
|
https://github.com/TJ-CSCCG/tongji-slides-typst | https://raw.githubusercontent.com/TJ-CSCCG/tongji-slides-typst/main/README.md | markdown | MIT License | # tongji-slides-typst
:page_facing_up: 念倧åŠå¹»ç¯çæš¡æ¿ | Typst
äžæ | [English](README-EN.md)
> [!CAUTION]
> ç±äº Typst 项ç®ä»å€äºå¯éåå±é¶æ®µïŒäžå¯¹æäºåèœçæ¯æäžå®åïŒå¹¶äžæ€æš¡æ¿äžºè¿æž¡æš¡æ¿ä¹åäŒäœ¿çšæ°çpackageéåïŒå æ€æ¬æš¡æ¿å¯èœååšäžäºé®é¢ãåŠææšåšäœ¿çšè¿çšäžéå°äºé®é¢ïŒæ¬¢è¿æäº€ issue æ PRïŒæä»¬äŒå°œåè§£å³ã
>
## æ ·äŸå±ç€º
以äžäŸæ¬¡å±ç€º âtitle-slideâãâ䜿çšå®äŸâãâmatrix-slideâãâèªå®ä¹materix-slideâãâ空çœslideâ äž âfocus-slideâã
<p align="center">
<img src="https://raw.githubusercontent.com/xbunax/blogImg/main/202405181220130.png" width="30%">
<img src="https://raw.githubusercontent.com/xbunax/blogImg/main/202405181220107.png" width="30%">
<img src="https://raw.githubusercontent.com/xbunax/blogImg/main/202405181220153.png" width="30%">
<img src="https://raw.githubusercontent.com/xbunax/blogImg/main/202405181220139.png" width="30%">
<img src="https://raw.githubusercontent.com/xbunax/blogImg/main/202405181220119.png" width="30%">
<img src="https://raw.githubusercontent.com/xbunax/blogImg/main/202405181220080.png" width="30%">
</p>
## äœ¿çšæ¹æ³
### æ¬å°çŒè¯
#### 1. å®è£
Typst
åç
§ [Typst](https://github.com/typst/typst?tab=readme-ov-file#installation) 宿¹ææ¡£å®è£
Typstã
#### 2. clone æ¬é¡¹ç®
```bash
git clone https://github.com/TJ-CSCCG/tongji-slides-typst.git
cd tongji-slides-typst
```
æç
§éæ±ä¿®æ¹çžå
³æä»¶ïŒç¶åæ§è¡ä»¥äžåœä»€ä»¥çŒè¯ã
```bash
typst compile main.typ
typst2pngpdf main.typ ##çŒè¯æåŸçpdfçèæ¬ïŒéèŠå®è£
imagemaskïŒä»¥é²pdf viewerå€ªèæ æ³æ¥çslidesïŒ
```
### åšçº¿çŒè¯
åš [Typst App](https://typst.app) äžäœ¿çšæ¬æš¡æ¿è¿è¡åšçº¿çŒè¯ã
## åŠäœäžºè¯¥é¡¹ç®èŽ¡ç®ä»£ç ïŒ
è¿è¯·æ¥ç [How to pull request](CONTRIBUTING.md/#how-to-pull-request)ã
## åŒæºåè®®
该项ç®äœ¿çš [MIT License](LICENSE) åŒæºåè®®ã
### QQ 矀
* TJ-CSCCG 亀æµçŸ€ïŒ`1013806782`
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/hover/user.typ | typst | Apache License 2.0 |
/// Test
#let f() = 1;
#(/* ident after */ f());
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/fletcher/0.2.0/test/test.typ | typst | Apache License 2.0 | #import "@preview/cetz:0.1.2"
#import "/src/exports.typ": *
#set page(width: 10cm, height: auto)
#show heading.where(level: 1): it => pagebreak(weak: true) + it
= Arrow heads
Compare to symbols $#sym.arrow$, $#sym.arrow.twohead$, $#sym.arrow.hook$, $#sym.arrow.bar$
#fletcher.diagram(
// debug: 1,
spacing: (10mm, 5mm),
{
for i in (0, 1, 2) {
let x = 2*i
let bend = 40deg*i
(
(marks: ("harpoon", "harpoon'")),
(marks: ("head", "head")),
(marks: ("tail", "tail")),
(marks: ("twotail", "twohead")),
(marks: ("twohead", "twotail")),
(marks: ("hook", "head")),
(marks: ("hook", "hook'")),
(marks: ("bar", "bar")),
(marks: (none, none), extrude: (2.5,0,-2.5)),
(marks: ("head", "head"), extrude: (1.5,-1.5)),
(marks: ("tail", "tail"), extrude: (1.5,-1.5)),
(marks: ("bar", "head"), extrude: (2,0,-2)),
(marks: ("twotail", "twohead"), extrude: (1.5,-1.5)),
(marks: ("circle", "bigcircle")),
(marks: ("circle", "bigcircle"), extrude: (1.5, -1.5)),
).enumerate().map(((i, args)) => {
edge((x, -i), (x + 1, -i), ..args, bend: bend)
}).join()
}
})
= Double and triple lines
#for (i, a) in ("->", "=>", "==>").enumerate() [
Formula #fletcher.diagram(
// node-inset: 5pt,
label-sep: 1pt + i*1pt,
node((0, -i), $A$),
edge((0, -i), (1, -i), text(0.6em, $f$), a),
node((1, -i), $B$),
). \
]
= Arrow head shorthands
#import "/src/main.typ": parse-arrow-shorthand
$
#for i in (
"->",
"<-",
"<->",
"<=>",
"<==>",
"|->",
"|=>",
">->",
"->>",
"hook->",
"hook'--hook",
"|=|",
">>-<<",
"harpoon-harpoon'",
"harpoon'-<<",
"<--hook'",
"|..|",
"hooks--hooks",
"o-O",
"o==O",
) {
$ #block(inset: 2pt, fill: white.darken(5%), raw(i))
&= #fletcher.diagram(edge((0,0), (1,0), ..parse-arrow-shorthand(i))) \ $
}
$
= Connectors
#fletcher.diagram(
debug: 0,
cell-size: (10mm, 10mm),
node((0,1), $X$),
node((1,1), $Y$),
node((0,0), $Z$),
edge((0,1), (1,1), marks: (none, "head")),
edge((0,0), (1,1), $f$, marks: ("hook", "head"), dash: "dashed"),
edge((0,1), (0,0), marks: (none, "twohead")),
edge((0,1), (0,1), marks: (none, "head"), bend: -120deg),
)
= Arc connectors
#fletcher.diagram(
cell-size: 3cm,
{
node((0,0), "from")
node((1,0), "to")
for Ξ in (0deg, 20deg, -50deg) {
edge((0,0), (1,0), $#Ξ$, bend: Ξ, marks: (none, "head"))
}
})
#fletcher.diagram(
debug: 3,
node((0,0), $X$),
node((1,0), $Y$),
edge((0,0), (1,0), bend: 45deg, marks: ("head", "head")),
)
#for (i, to) in ((0,1), (1,0), (calc.sqrt(1/2),-calc.sqrt(1/2))).enumerate() {
fletcher.diagram(debug: 0, {
node((0,0), $A$)
node(to, $B$)
let N = 6
range(N + 1).map(x => (x/N - 0.5)*2*120deg).map(Ξ => edge((0,0), to, bend: Ξ, marks: ("tail", "head"))).join()
})
}
= Defocus
#let around = (
(-1,+1), ( 0,+1), (+1,+1),
(-1, 0), (+1, 0),
(-1,-1), ( 0,-1), (+1,-1),
)
#grid(
columns: 2,
..(-10, -1, -.25, 0, +.25, +1, +10).map(defocus => {
((7em, 3em), (3em, 7em)).map(((w, h)) => {
align(center + horizon, fletcher.diagram(
node-defocus: defocus,
node-inset: 0pt,
{
node((0,0), rect(width: w, height: h, inset: 0pt, align(center + horizon)[#defocus]))
for p in around {
edge(p, (0,0))
}
}))
})
}).join()
)
= Label placement
Default placement above the line.
#fletcher.diagram(
// cell-size: (2.2cm, 2cm),
spacing: 2cm,
debug: 3,
{
for p in around {
edge(p, (0,0), $f$)
}
})
#fletcher.diagram(spacing: 1.5cm, {
for (i, a) in (left, center, right).enumerate() {
for (j, Ξ) in (-30deg, 0deg, 50deg).enumerate() {
edge((2*i, j), (2*i + 1, j), label: a, "->", label-side: a, bend: Ξ)
}
}
})
= Crossing connectors
#fletcher.diagram({
edge((0,1), (1,0))
edge((0,0), (1,1), crossing: true)
edge((2,1), (3,0), "|-|", bend: -20deg)
edge((2,0), (3,1), "<=>", crossing: true, bend: 20deg)
})
= `edge()` argument shorthands
#fletcher.diagram(
edge((0,0), (1,1), "->", "double", bend: 45deg),
edge((1,0), (0,1), "->>", "crossing"),
edge((1,1), (2,1), $f$, "|->"),
edge((0,0), (1,0), "-", "dashed"),
)
= Diagram-level options
#fletcher.diagram(
node-stroke: black,
node-fill: green.lighten(80%),
label-sep: 0pt,
node((0,0), $A$),
node((1,1), $sin compose cos compose tan$, fill: none),
node((2,0), $C$),
node((3,0), $D$, shape: "rect"),
edge((0,0), (1,1), $sigma$, "->", bend: -45deg),
edge((2,0), (1,1), $f$, "<-"),
)
= CeTZ integration
#import "/src/utils.typ": vector-polar
#fletcher.diagram(
node((0,0), $A$, stroke: 1pt),
node((2,1), [Bézier], stroke: 1pt),
render: (grid, nodes, edges, options) => {
cetz.canvas({
fletcher.draw-diagram(grid, nodes, edges, options)
let n1 = fletcher.find-node-at(nodes, (0,0))
let p1 = fletcher.get-node-anchor(n1, 0deg)
let n2 = fletcher.find-node-at(nodes, (2,1))
let p2 = fletcher.get-node-anchor(n2, -90deg)
let c1 = cetz.vector.add(p1, vector-polar(20pt, 0deg))
let c2 = cetz.vector.add(p2, vector-polar(70pt, -90deg))
fletcher.draw-arrow-cap(p1, 180deg, (thickness: 1pt, paint: black), "head")
cetz.draw.bezier(p1, p2, c1, c2)
})
}
)
= Node bounds
#fletcher.diagram(
debug: 2,
node-outset: 5pt,
node-inset: 5pt,
node((0,0), `hello`, stroke: 1pt),
node((1,0), `there`, stroke: 1pt),
edge((0,0), (1,0), "<=>"),
)
= Corner edges
#let around = (
(-1,+1), (+1,+1),
(-1,-1), (+1,-1),
)
#for dir in (left, right) {
pad(1mm, fletcher.diagram(
// debug: 2,
spacing: 1cm,
node((0,0), [#dir]),
{
for c in around {
node(c, $#c$)
edge((0,0), c, $f$, "O=>", corner: dir, label-pos: 0.4)
}
}
))
}
|
https://github.com/wjakethompson/wjt-quarto-ext | https://raw.githubusercontent.com/wjakethompson/wjt-quarto-ext/main/ku-letter/_extensions/ku-letter/typst-show.typ | typst | Creative Commons Zero v1.0 Universal | #show: doc => letter(
$if(subject)$
subject: [$subject$],
$endif$
$if(recipient)$
recipient: [$recipient$],
$endif$
$if(sender)$
sender: [$sender$],
$endif$
$if(header-logo)$
header-logo: "$header-logo$",
$endif$
$if(footer-logo)$
footer-logo: "$footer-logo$",
$endif$
$if(date)$
date: [$date$],
$endif$
doc,
)
|
https://github.com/goshakowska/Typstdiff | https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_complex/para/para_mix_result.typ | typst | In this #strike[report,];#underline[changed,] we will
#strike[explore];#underline[changed] the various factors that influence
#emph[fluid dynamics] in#strike[ ];#strike[glaciers];#strike[
];#strike[ha];#strike[ ];#strike[they];#strike[ ];#strike[contribute] to
the formation and behaviour of these natural structures.
#strike[All];#strike[ ];#strike[manuscripts];#strike[
];#strike[are];#strike[ ];#strike[to];#strike[ ];#strike[be];#strike[
];#strike[submitted];#strike[ ];#strike[electronically];#strike[
];#strike[to];#strike[ ];#strike[the];#strike[
];#strike[ScholarOne];#strike[ ];#strike[Abstracts];#strike[
];#strike[site];#strike[ ];#strike[created];#strike[
];#strike[for];#strike[ ];#strike[each];#strike[
];#strike[conference.];#strike[ ];#strike[The];#strike[
];#strike[manuscript];#strike[ ];#strike[upload];#strike[
];#strike[will];#strike[ ];#strike[be];#strike[
];#strike[enabled];#strike[ ];#strike[several];#strike[
];#strike[weeks];#strike[ ];#strike[after];#strike[
];#strike[acceptance];#strike[ ];#strike[notices];#strike[
];#strike[have];#strike[ ];#strike[been];#strike[
];#strike[sent.];#strike[ ];#strike[Presenting];#strike[
];#strike[authors];#strike[ ];#strike[of];#strike[
];#strike[accepted];#strike[ ];#strike[papers];#strike[
];#strike[will];#strike[ ];#strike[receive];#strike[
];#strike[an];#strike[ ];#strike[email];#strike[ ];#strike[with];#strike[
];#strike[instructions];#strike[ ];#strike[when];#strike[
];#strike[manuscript];#strike[ ];#strike[submission];#strike[
];#strike[opens.];#strike[ ];#strike[It];#strike[ ];#strike[is];#strike[
];#strike[important];#strike[ ];#strike[that];#strike[
];#strike[presenting];#strike[ ];#strike[authors];#strike[
];#strike[keep];#strike[ ];#strike[their];#strike[
];#strike[email];#strike[ ];#strike[addresses];#strike[
];#strike[up-to-date];#strike[ ];#strike[so];#strike[
];#strike[they];#strike[ ];#strike[do];#strike[ ];#strike[not];#strike[
];#strike[miss];#underline[Something] #strike[this];#underline[new.]
#strike[notice.];#underline[Monkey.]
#underline[All];#underline[ ];#underline[changed];#underline[
];#underline[are];#underline[ ];#underline[to];#underline[
];#underline[be];#underline[ ];#underline[changed];#underline[
];#strike[It];#underline[electronically] #strike[is];#underline[to]
the#underline[ ];#underline[site];#underline[
];#underline[created];#underline[ ];#underline[for];#underline[
];#underline[each];#underline[ ];#underline[conference.];#underline[
];#underline[The];#underline[ ];#underline[manuscript];#underline[
];#underline[upload];#underline[ ];#underline[will]
#strike[responsibility];#underline[be] #strike[of];#underline[enabled]
#strike[the];#underline[several] #strike[author];#underline[weeks]
#strike[to];#underline[after] #strike[obtain];#underline[acceptance]
#strike[any];#underline[notices] #strike[required];#underline[have]
#strike[government];#underline[been] #strike[or];#underline[sent.]
#strike[company];#underline[Presenting]
#strike[reviews];#underline[authors] #strike[for];#underline[of]
#strike[their];#underline[accepted] papers#underline[
];#underline[will];#underline[ ];#underline[receive];#underline[
];#underline[an];#underline[ ];#underline[email];#underline[
];#underline[with];#underline[ ];#underline[instructions];#underline[
];#underline[when];#underline[ ];#underline[manuscript];#underline[
];#underline[submission] #strike[in];#underline[opens.]
#strike[advance];#underline[It] #strike[of];#underline[is]
#strike[publication.];#underline[important]
#strike[Start];#underline[that] #strike[early];#underline[presenting]
#strike[to];#underline[authors] #strike[determine];#underline[keep]
#strike[if];#underline[their] #strike[the];#underline[email]
#strike[reviews];#underline[addresses]
#strike[are];#underline[up-to-date] #strike[required;];#underline[so]
#strike[this];#underline[they] #strike[process];#underline[do]
#strike[can];#underline[not] #strike[take];#underline[miss]
#strike[several];#underline[this] #strike[weeks.];#underline[notice.]
|
|
https://github.com/The-Notebookinator/notebookinator | https://raw.githubusercontent.com/The-Notebookinator/notebookinator/main/utils/components.typ | typst | The Unlicense | #import "/globals.typ"
/// A constructor for a table of contents component.
///
/// *Example Usage:*
/// ```typ
/// #let toc = utils.make-toc((frontmatter, body, appendix) => {
/// for entry in body [
/// #entry.title
/// #box(width: 1fr, line(length: 100%, stroke: (dash: "dotted")))
/// #entry.page-number
/// ]
/// })
/// ```
/// - callback (function): A function which returns the content of the toc. The function must take `frontmatter`, `body`, and `appendix` arguments.
/// -> function
#let make-toc(callback) = {
let helper(type) = {
let (state, markers) = if type == "frontmatter" {
(
globals.frontmatter-entries,
query(
selector(<notebook-frontmatter>),
),
)
} else if type == "body" {
(
globals.entries,
query(
selector(<notebook-body>),
),
)
} else if type == "appendix" {
(
globals.appendix-entries,
query(
selector(<notebook-appendix>),
),
)
} else {
panic("No valid entry type selected.")
}
let result = ()
for (index, entry) in state.final().enumerate() {
let page-number = counter(page).at(
markers.at(index).location(),
).at(0)
let ctx = entry.ctx
ctx.page-number = page-number
result.push(ctx)
}
return result
}
return () => context {
let frontmatter-entries = helper("frontmatter")
let body-entries = helper("body")
let appendix-entries = helper("appendix")
callback(
frontmatter-entries,
body-entries,
appendix-entries,
)
}
}
/// Constructor for a glossary component
///
/// *Example Usage:*
/// ```typ
/// #let glossary = utils.make-glossary(glossary => {
/// stack(
/// spacing: 0.5em,
/// ..for entry in glossary {
/// (
/// [
/// = #entry.word
///
/// #entry.definition
/// ],
/// )
/// },
/// )
/// })
/// ```
/// - callback (function): A function that returns the content of the glossary. The function must take a `glossary` argument.
/// -> function
#let make-glossary(callback) = {
return () => context {
let sorted-glossary = globals.glossary-entries.final().sorted(key: (
(word: word, definition: definition),
) => word)
callback(sorted-glossary)
}
}
/// Constructor for a pro / con component
///
/// *Example Usage:*
/// ```typ
/// #let pro-con = utils.make-pro-con((pros, cons) => {
/// table(
/// columns: (
/// 1fr,
/// 1fr,
/// ),
/// table.cell(fill: green)[*Pros*],
/// table.cell(fill: red)[*Cons*],
/// pros,
/// cons,
/// )
/// })
/// ```
///
/// - callback (function): A function that returns the content of the pro / con table. The function must take `pros` and `cons` arguments.
/// -> function
#let make-pro-con(callback) = {
return (pros: [], cons: []) => {
callback(pros, cons)
}
}
/// Constructor for a decision matrix
///
/// *Example Usage:*
/// ```typ
/// #let decision-matrix = utils.make-decision-matrix((properties, data) => {
/// // ...
/// })
/// ```
/// - callback (function): A function that returns the content of the matrix. The function must `properties` and `data` arguments.
/// -> function
#let make-decision-matrix(callback) = {
return (properties: (), ..choices) => {
// ensure the properties are passed in correctly
//
// this variable tracks whether the user
// is using the alternate mode of passing in arguments,
// where each property is a str instead of a dictionary
let alternate-format = false
for property in properties {
if type(property) == str {
alternate-format = true
} else {
assert(
not alternate-format,
message: "Property should be of type 'str'",
)
if property.at("weight", default: none) == none {
property.insert("weight", 1)
}
assert.eq(type(property.name), str)
assert(type(property.weight) == float or type(property.weight) == int)
}
}
// ensure the choices are passed in correctly
for choice in choices.pos() {
for (index, rating) in choice.enumerate() {
if index == 0 {
assert.eq(type(rating), str)
continue
}
assert(
type(rating) == int or type(rating) == float,
message: "Values for decision matrices must be of type 'float' or 'int'",
)
}
assert.eq(
choice.len() - 1,
properties.len(),
message: "The number of supplied values did not match the number of properties.",
)
}
// the calculation should only need to parse data in one format,
// so if the user passed in the alternate, format we'll just convert it to the standard one
properties = if alternate-format {
properties.map(property => (name: property, weight: 1))
} else {
properties
}
// now we can actually calculate the data
let data = (:)
for (index, choice) in choices.pos().enumerate() {
let name = choice.at(0)
let values = choice.slice(1)
let unweighted-total = values.sum()
let weighted-values = values.enumerate().map((
(index, value),
) => value * properties.at(index).at(
"weight",
default: 1,
))
let weighted-total = weighted-values.sum()
let property-data = (:)
for (index, property) in properties.enumerate() {
property-data.insert(
property.name,
(
unweighted: values.at(index),
weighted: weighted-values.at(index),
highest: false,
),
)
}
property-data.insert(
"total",
(
unweighted: unweighted-total,
weighted: weighted-total,
highest: false,
),
)
data.insert(
name,
property-data,
)
}
// now that we've filled in all of the data, we can calculate which choice won
// we're going to treat total like another property for the sake of calculating if it won
properties.push((name: "total"))
for property in properties {
let highest = ( // Records the index of the choice which had the highest total
index: 0,
value: 0,
)
for (index, choice) in data {
let property-value = choice.at(property.name).weighted
if property-value > highest.value {
highest.index = index
highest.value = property-value
}
}
data.at(highest.index).at(property.name).highest = true
}
properties.pop()
return callback(properties, data)
}
}
/// A constructor for an admonition component.
///
/// *Example Usage:*
/// ```typ
/// #let admonition = utils.make-admonition((type, body) => {
/// //..
/// }
/// ```
/// - callback (function): A function that returns the content for the admonition. The function must take `type` and `body` arguments.
/// Valid types include:
/// - `"note"`,
/// - `"example"`,
/// - `"warning"`,
/// - `"quote"`,
/// - `"equation"`,
///
/// - `"identify"`,
/// - `"brainstorm"`,
/// - `"decide"`,
/// - `"decision"`, // DEPRECATED
/// - `"build"`,
/// - `"program"`,
/// - `"test"`,
/// - `"management"`,
/// - `"notebook"`,
///
/// -> function
#let make-admonition(callback) = {
let valid-types = (
"note",
"example",
"warning",
"quote",
"equation",
"identify",
"brainstorm",
"decide",
"decision",
"build",
"program",
"test",
"management",
"notebook",
)
let valid-types-printable = valid-types.fold(
"",
(
base,
value,
) => {
base + " '" + value + "'"
},
)
return (type: none, body) => {
if not valid-types.contains(type) {
panic("Entry type '" + str(type) + "' is not valid. Valid types include:" + valid-types-printable)
}
callback(
type,
body,
)
}
}
/// A constructor for a pie chart component
///
/// *Example Usage:*
///
/// ```typ
/// #let pie-chart = utils.make-pie-chart(data => {
/// // ...
/// })
/// ```
/// - callback (function): A function that returns the content for the pie chart. The function must take a `data` argument.
/// -> function
#let make-pie-chart(callback) = {
return (..data) => {
callback(data)
}
}
/// A constructor for a plot component
///
/// *Example Usage:*
/// ```typ
/// #let plot = utils.make-plot((title, x-label, y-label, length, data) => {
/// // ...
/// })
/// ```
///
/// - callback (function): A function that returns the content for the plot.
/// The function must take `title`, `x-label`, `y-label`, `length`, and `data` arguments.
/// -> function
#let make-plot(callback) = {
return (title: "", x-label: "", y-label: "", length: auto, ..data) => {
callback(title, x-label, y-label, length, data)
}
}
// TODO: add method for these extra components:
// - gantt chart
// - tournament
// - team
|
https://github.com/alexanderkoller/typst-blinky | https://raw.githubusercontent.com/alexanderkoller/typst-blinky/main/blinky.typ | typst | MIT License |
#let p = plugin("blinky.wasm")
#let bib_re = regex("!!BIBENTRY!([^!]+)!!")
#let link-bib-urls(bibsrc, content) = {
let serialized = p.get_bib_map(bytes(bibsrc))
let bib_map = cbor.decode(serialized)
show bib_re: it => {
let (key,) = it.text.match(bib_re).captures
let entry = bib_map.at(key, default: "")
if entry == "" {
it
} else {
let title = entry.fields.title
let url = entry.fields.at("url", default: "")
let doi = entry.fields.at("doi", default: "")
if doi != "" {
let url = "https://doi.org/" + doi
link(url)[#title]
} else if url != "" {
link(url)[#title]
} else {
[#title]
}
}
}
content
} |
https://github.com/augustebaum/petri | https://raw.githubusercontent.com/augustebaum/petri/main/tests/fletcher/connect-places-with-transitions/test.typ | typst | MIT License | #import "/src/lib.typ": *
#set page(width: auto, height: auto, margin: 1cm)
#import "@preview/fletcher:0.4.2" as fletcher: edge
/// % Place 1
/// \node[place,
/// fill=teal!25,
/// draw=teal!75,
/// tokens=2,
/// label=$P_1$] (place1) at (0,0) {};
///
/// % Place 2
/// \node[place,
/// fill=teal!25,
/// draw=teal!75,
/// tokens=1,
/// label=$P_2$] (place2) at (4,0) {};
///
/// % Transition
/// \node[transition,
/// minimum height=12mm,
/// minimum width=1.5mm,
/// fill=black,
/// label=$T$] (trans) at (2,0) {};
///
/// % Connect P-T
/// \draw[-latex,thick] (place1) -- (trans);
///
/// % Connect T-P
/// \draw[-latex,thick] (trans) -- (place2);
#fletcher.diagram(
node-stroke: 0.5pt,
p((0,0), $P_1$, fill: teal.lighten(25%), stroke: teal.darken(15%), tokens: 2),
edge("-|>"),
t((2,0), $T$, fill: black),
edge("-|>"),
p((4,0), $P_2$, fill: teal.lighten(25%), stroke: teal.darken(15%), tokens: 1),
)
|
https://github.com/hugoledoux/msc_geomatics_thesis_typst | https://raw.githubusercontent.com/hugoledoux/msc_geomatics_thesis_typst/main/README.md | markdown | MIT License |
1. put your details in `settings.toml`
2. `typst compile main.typ`
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/SK/casoslov/casy/cas3.typ | typst | #import "/style.typ": *
#import "/SK/texts.typ": *
#import "../styleCasoslov.typ": *
= Tretà Äas
#show: rest => columns(2, rest)
#nacaloBezKnaza
#zalm(16)
#zalm(24)
#zalm(50)
#si
#lettrine("Aleluja, aleluja, aleluja, sláva tebe, Boşe.") #note[(3x)]
#lettrine("Pane, zmiluj sa.") #note[(3x)]
== Tropáre
#note[Berieme tropár, prÃpadne tropáre podÄŸa predpisu]
#primText[I teraz: (BohorodiÄnÃk)]
#lettrine("BohorodiÄka, ty si pravÜ viniÄ, * z ktorého nám vyrástol plod ÅŸivota. * K tebe sa modlÃme: * Modli sa k nemu, VládkyÅa, so svÀtÜmi apoÅ¡tolmi, * aby sa zmiloval nad naÅ¡imi duÅ¡ami.")
#zoznam((
"Nech je velebenÜ Pán deÅ Äo deÅ; * nesie nás Boh, naÅ¡a spása. * Náš Boh je Boh spásy.",
))
#trojsvatePoOtcenas
== Kondák
#note[Berieme kondák podğa predpisu]
#lettrine("Pane, zmiluj sa.") #primText([40x])
#vKazdomCase
#ektenia(3)
#lettrine("ÄestnejÅ¡ia si ako cherubÃni * a neporovnateÄŸne slávnejÅ¡ia ako serafÃni, * bez poruÅ¡enia si porodila Boha Slovo, * opravdivá BohorodiÄka, velebÃme Å¥a.")
Pane Jeşišu Kriste, Boşe náš, pre modlitby našich svÀtÜch otcov zmiluj sa nad nami.
#prepustenieMaleBezKnaza |
|
https://github.com/02hyc/Group-Meeting-Typst | https://raw.githubusercontent.com/02hyc/Group-Meeting-Typst/master/sections/weekly-report.typ | typst | #import "../globals.typ": *
= Weekly Meeting
== July 19, 2024
=== Towards Self-Assembling Artificial Neural Networks through Neural Developmental Programs #footnote[Najarro E, Sudhakaran S, Risi S. Towards self-assembling artificial neural networks through neural developmental programs[C]]
#figure(
image("../images/2024.7.19_1.png", width: 80%),
caption: [Neural Development Program approach for growing neural network]
)
- Use the Neural Development Program(NDP) to control *the growth of new networks*
- Two training methods: *Evolutionary-based* and *Gradient-based*
- Execute experiments on *MNIST, XOR, CartPole, LunarLander*
== July 19, 2024
=== Towards Self-Assembling Artificial Neural Networks through Neural Developmental Programs
#figure(
image("../images/2024.7.19_2.png"),
caption: [Developmental growth of solving the CartPole balancing task],
)
- No indication of *robustness* or other performance advantages
- No additional information about the *topological properties* of the network
== July 19, 2024
=== HYPERNETWORKS #footnote[<NAME>, <NAME>, <NAME> V. Hypernetworks[J]. arXiv preprint arXiv:1609.09106, 2016.]
- An approach of using a *hypernetwork* to generate the weights for another network, which is similar to the nature: the relationship between a *genotype* and a *phenotype*
- Generate weights for practical architectures by taking layer embedding vectors as inputs
- Hypernetworks are trained *end-to-end* with gradient descent together with the main network
=== Reflection
- The focus is not on generating networks, but on *the ability to self-explore* in a multi-task environment
- Generative networks are a means of implementation. Are there any existing methods that can achieve self-exploration capabilities to a certain extent, such as *LLM-based agents*
== July 26, 2024
- Agents environments setup
- New reasoning framework (modify the prompts)
- Digital tasks (fine tune on the digital tasks)
- Embodied tasks (usually with a vision module)
- Learn of reinforcement learning
== July 26, 2024
=== AgentGym #footnote[<NAME>, <NAME>, <NAME>, et al. AgentGym: Evolving Large Language Model-based Agents across Diverse Environments[J]. arXiv preprint arXiv:2406.04151, 2024.]
#figure(
image("../images/2024.7.26_3.png"),
caption: [Overview of the AgentGym framework],
)
== July 26, 2024
=== OSWORLD #footnote[<NAME>, <NAME>, <NAME>, et al. Osworld: Benchmarking multimodal agents for open-ended tasks in real computer environments[J]. arXiv preprint arXiv:2404.07972, 2024.]
#figure(
image("../images/2024.7.26_2.png", width: 90%),
caption:[OSWORLD: a real computer environment for multimodal agents],
)
== July 26, 2024
=== FunSearch #footnote[<NAME>, <NAME>, <NAME>, et al. Mathematical discoveries from program search with large language models[J]. Nature, 2024, 625(7995): 468-475.]
#figure(
image("../images/2024.7.26_1.png"),
caption: [Overview of FunSearch],
)
== Aug, 2, 2024
=== Target
- Diffusion Models as Tools for Gene Expression ââ Genotype
- Use partial modules in a large model to adapt to different tasks ââ Phenotype
#figure(
image("../images/2024.8.02_1.png", width: 70%),
caption: [Overview of PGDiff Framework for Versatile Face Restoration #footnote[<NAME>, <NAME>, <NAME>, et al. PGDiff: Guiding diffusion models for versatile face restoration via partial guidance[J]. Advances in Neural Information Processing Systems, 2024, 36.]],
)
== Aug, 2, 2024
=== Keywords
- Conditional Diffusion Models
- Pruning
- Model Selector
- Multi-task learning
- Neural Architecture Search
- The representations of the architectures in the search space
- Introduce diffusion models as a search algorithm
== Aug, 23, 2024
=== DiffusionNAG#footnote[<NAME>, <NAME>, <NAME>, et al. DiffusionNAG: Predictor-guided Neural Architecture Generation with Diffusion Models[J]. arXiv preprint arXiv:2305.16943, 2023.]
#figure(
image("../images/2024.8.23_1.png", width: 80%),
caption: [Overview of DiffusionNAG]
)
- Treat the neural architecture as DAG and generate the neural architecture graph through a graph diffusion model
- Controlling the generation process using property predictors, whose gradient is used to guide the architectures towards a space with desired properties
== Aug 23, 2024
=== Transformer Layers as Painters#footnote[<NAME>, <NAME>, <NAME>, et al. Transformer Layers as Painters[J]. arXiv preprint arXiv:2407.09298, 2024.]
- Explore the role of the layers of the Transformer architecture models
- Experiments on BERT and Llama2
- Do the layers share the representation space
- Are all layers necessary
- Are all middle layers doing the same thing
- Does layer order matter
- Can layers run in parallel
#figure(
image("../images/2024.8.23_2.png", width: 80%),
caption: [Different execution strategies]
)
== Aug 23, 2024
=== LLM to extract structured data
- Encapsulate the part of LLM
- Implemente text conversion from PDF to Markdown#footnote[https://github.com/VikParuchuri/marker]
#focus-slide[
Question?
]
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/circuiteria/0.1.0/gallery/test5.typ | typst | Apache License 2.0 | #import "@preview/cetz:0.2.2": draw
#import "../src/lib.typ": *
#set page(width: auto, height: auto, margin: .5cm)
#circuit({
element.multiplexer(
x: 0, y: 0, w: .5, h: 1.5, id: "PCMux",
entries: 2,
fill: util.colors.blue,
h-ratio: 80%
)
element.block(
x: (rel: 2, to: "PCMux.east"),
y: (from: "PCMux-port-out", to: "in"),
w: 1, h: 1.5, id: "PCBuf",
ports: (
north: ((id: "clk", clock: true),),
west: ((id: "in"),),
east: ((id: "out"),)
),
fill: util.colors.green
)
element.block(
x: (rel: 2, to: "PCBuf.east"),
y: (from: "PCBuf-port-out", to: "A"),
w: 3, h: 4, id: "IMem",
ports: (
west: (
(id: "A", name: "A"),
),
east: (
(id: "RD", name: "RD"),
)
),
ports-margins: (
west: (0%, 50%),
east: (0%, 50%)
),
fill: util.colors.green,
name: "Instruction\nMemory"
)
element.block(
x: (rel: 3, to: "IMem.east"),
y: (from: "IMem-port-RD", to: "A1"),
w: 4.5, h: 4, id: "RegFile",
ports: (
north: (
(id: "clk", clock: true, small: true),
(id: "WE3", name: "WE3"),
(id: "dummy1")
),
west: (
(id: "dummy2"),
(id: "A1", name: "A1"),
(id: "dummy3"),
(id: "A2", name: "A2"),
(id: "A3", name: "A3"),
(id: "dummy4"),
(id: "WD3", name: "WD3"),
),
east: (
(id: "RD1", name: "RD1"),
(id: "RD2", name: "RD2"),
)
),
ports-margins: (
north: (-20%, -20%),
east: (0%, 10%)
),
fill: util.colors.green,
name: "Register\nFile"
)
element.alu(
x: (rel: -.7, to: "IMem.center"),
y: -7,
w: 1.4, h: 2.8, id: "PCAdd",
name: text("+", size: 1.5em),
name-anchor: "name",
fill: util.colors.pink
)
element.extender(
x: (rel: 0, to: "RegFile.west"),
y: (from: "PCAdd-port-out", to: "in"),
w: 4, h: 1.5, id: "Ext",
h-ratio: 50%,
name: "Extend",
name-anchor: "south",
align-out: false,
fill: util.colors.green
)
element.multiplexer(
x: (rel: 3, to: "RegFile.east"),
y: (from: "RegFile-port-RD2", to: "in0"),
w: .5, h: 1.5, id: "SrcBMux",
fill: util.colors.blue,
h-ratio: 80%
)
element.alu(
x: (rel: 2, to: "SrcBMux.east"),
y: (from: "SrcBMux-port-out", to: "in2"),
w: 1.4, h: 2.8, id: "ALU",
name: rotate("ALU", -90deg),
name-anchor: "name",
fill: util.colors.pink
)
element.alu(
x: (rel: 2, to: "SrcBMux.east"),
y: (from: "Ext-port-out", to: "in2"),
w: 1.4, h: 2.8, id: "JumpAdd",
name: text("+", size: 1.5em),
name-anchor: "name",
fill: util.colors.pink
)
element.block(
x: (rel: 4, to: "ALU.east"),
y: (from: "ALU-port-out", to: "A"),
w: 3, h: 4, id: "DMem",
name: "Data\nMemory",
ports: (
north: (
(id: "clk", clock: true, small: true),
(id: "dummy1"),
(id: "WE", name: "WE")
),
west: (
(id: "A", name: "A"),
(id: "WD", name: "WD")
),
east: (
(id: "RD", name: "RD"),
(id: "dummy2")
)
),
ports-margins: (
north: (-10%, -10%),
west: (-20%, -30%),
east: (-10%, -20%)
),
fill: util.colors.green
)
element.multiplexer(
x: (rel: 3, to: "DMem.east"),
y: (from: "DMem-port-RD", to: "in1"),
w: .5, h: 1.5, id: "ResMux",
entries: 2,
fill: util.colors.blue,
h-ratio: 80%
)
element.block(
x: (rel: 0, to: "RegFile.west"),
y: 3.5, w: 2.5, h: 5, id: "Ctrl",
name: "Control\nUnit",
name-anchor: "north",
ports: (
west: (
(id: "op", name: "op"),
(id: "funct3", name: "funct3"),
(id: "funct7", name: [funct7#sub("[5]")]),
(id: "zero", name: "Zero"),
),
east: (
(id: "PCSrc"),
(id: "ResSrc"),
(id: "MemWrite"),
(id: "ALUCtrl"),
(id: "ALUSrc"),
(id: "ImmSrc"),
(id: "RegWrite"),
)
),
ports-margins: (
west: (40%, 0%)
),
fill: util.colors.orange
)
// Wires
wire.wire(
"wPCNext", ("PCMux-port-out", "PCBuf-port-in"),
name: "PCNext"
)
wire.stub("PCBuf-port-clk", "north", name: "clk", length: 0.25)
wire.wire(
"wPC1", ("PCBuf-port-out", "IMem-port-A"),
name: "PC"
)
wire.wire(
"wPC2", ("PCBuf-port-out", "JumpAdd-port-in1"),
style: "zigzag",
zigzag-ratio: 1
)
wire.wire(
"wPC3", ("PCBuf-port-out", "PCAdd-port-in1"),
style: "zigzag",
zigzag-ratio: 1
)
wire.intersection("wPC2.zig")
wire.intersection("wPC2.zag")
wire.stub("PCAdd-port-in2", "west", name: "4", length: 1.5)
wire.wire(
"wPC+4", ("PCAdd-port-out", "PCMux-port-in0"),
style: "dodge",
dodge-sides: ("east", "west"),
dodge-y: -7.5,
dodge-margins: (1.2, .5),
name: "PC+4",
name-pos: "start"
)
let mid = ("IMem-port-RD", 50%, "RegFile-port-A1")
wire.wire(
"wInstr", ("IMem-port-RD", mid),
bus: true,
name: "Instr",
name-pos: "start"
)
draw.hide({
draw.line(name: "bus-top",
mid,
(horizontal: (), vertical: "Ctrl-port-op")
)
draw.line(name: "bus-bot",
mid,
(horizontal: (), vertical: "Ext-port-in")
)
})
wire.wire(
"wInstrBus", ("bus-top.end", "bus-bot.end"),
bus: true
)
wire.wire(
"wOp", ("Ctrl-port-op", (horizontal: mid, vertical: ())),
bus: true,
reverse: true,
slice: (6, 0)
)
wire.wire(
"wF3", ("Ctrl-port-funct3", (horizontal: mid, vertical: ())),
bus: true,
reverse: true,
slice: (14, 12)
)
wire.wire(
"wF7", ("Ctrl-port-funct7", (horizontal: mid, vertical: ())),
bus: true,
reverse: true,
slice: (30,)
)
wire.wire(
"wA1", ("RegFile-port-A1", (horizontal: mid, vertical: ())),
bus: true,
reverse: true,
slice: (19, 15)
)
wire.wire(
"wA2", ("RegFile-port-A2", (horizontal: mid, vertical: ())),
bus: true,
reverse: true,
slice: (24, 20)
)
wire.wire(
"wA3", ("RegFile-port-A3", (horizontal: mid, vertical: ())),
bus: true,
reverse: true,
slice: (11, 7)
)
wire.wire(
"wExt", ("Ext-port-in", (horizontal: mid, vertical: ())),
bus: true,
reverse: true,
slice: (31, 7)
)
wire.intersection("wF3.end")
wire.intersection("wF7.end")
wire.intersection("wA1.end")
wire.intersection("wA2.end")
wire.intersection("wA3.end")
wire.stub("RegFile-port-clk", "north", name: "clk", length: 0.25)
wire.wire("wRD2", ("RegFile-port-RD2", "SrcBMux-port-in0"))
wire.wire(
"wWD", ("RegFile-port-RD2", "DMem-port-WD"),
style: "zigzag",
zigzag-ratio: 1.5,
name: "WriteData",
name-pos: "end"
)
wire.intersection("wWD.zig")
wire.wire(
"wImmALU", ("Ext-port-out", "SrcBMux-port-in1"),
style: "zigzag",
zigzag-ratio: 2.5,
name: "ImmExt",
name-pos: "start"
)
wire.wire(
"wImmJump", ("Ext-port-out", "JumpAdd-port-in2")
)
wire.intersection("wImmALU.zig")
wire.wire(
"wJumpPC", ("JumpAdd-port-out", "PCMux-port-in1"),
style: "dodge",
dodge-sides: ("east", "west"),
dodge-y: -8,
dodge-margins: (1, 1),
name: "PCTarget",
name-pos: "start"
)
wire.wire(
"wSrcA", ("RegFile-port-RD1", "ALU-port-in1"),
name: "SrcA",
name-pos: "end"
)
wire.wire(
"wSrcB", ("SrcBMux-port-out", "ALU-port-in2"),
name: "SrcB",
name-pos: "end"
)
wire.wire(
"wZero", (
("ALU.north-east", 50%, "ALU-port-out"),
"Ctrl-port-zero"
),
style: "dodge",
dodge-sides: ("east", "west"),
dodge-y: 3,
dodge-margins: (1.5, 1),
name: "Zero",
name-pos: "start"
)
wire.wire(
"wALURes1", ("ALU-port-out", "DMem-port-A"),
name: "ALUResult",
name-pos: "start"
)
wire.wire(
"wALURes2", ("ALU-port-out", "ResMux-port-in0"),
style: "dodge",
dodge-sides: ("east", "west"),
dodge-y: 2,
dodge-margins: (3, 2)
)
wire.intersection("wALURes2.start2")
wire.stub("DMem-port-clk", "north", name: "clk", length: 0.25)
wire.wire(
"wRD", ("DMem-port-RD", "ResMux-port-in1"),
name: "ReadData",
name-pos: "start"
)
wire.wire(
"wRes", ("ResMux-port-out", "RegFile-port-WD3"),
style: "dodge",
dodge-sides: ("east", "west"),
dodge-y: -7.5,
dodge-margins: (1, 2)
)
draw.content(
"wRes.dodge-start",
"Result",
anchor: "south-east",
padding: 5pt
)
// Other wires
draw.group({
draw.stroke(util.colors.blue)
draw.line(name: "wPCSrc",
"Ctrl-port-PCSrc",
(horizontal: "RegFile.east", vertical: ()),
(horizontal: (), vertical: (rel: (0, 0.5), to: "Ctrl.north")),
(horizontal: "PCMux.north", vertical: ()),
"PCMux.north"
)
draw.line(name: "wResSrc",
"Ctrl-port-ResSrc",
(horizontal: "ResMux.north", vertical: ()),
"ResMux.north"
)
draw.line(name: "wMemWrite",
"Ctrl-port-MemWrite",
(horizontal: "DMem-port-WE", vertical: ()),
"DMem-port-WE"
)
draw.line(name: "wALUCtrl",
"Ctrl-port-ALUCtrl",
(horizontal: "ALU.north", vertical: ()),
"ALU.north"
)
draw.line(name: "wALUSrc",
"Ctrl-port-ALUSrc",
(horizontal: "SrcBMux.north", vertical: ()),
"SrcBMux.north"
)
draw.line(name: "wImmSrc",
"Ctrl-port-ImmSrc",
(rel: (1, 0), to: (horizontal: "RegFile.east", vertical: ())),
(horizontal: (), vertical: (rel: (0, -.5), to: "RegFile.south")),
(horizontal: "Ext.north", vertical: ()),
"Ext.north"
)
draw.line(name: "wRegWrite",
"Ctrl-port-RegWrite",
(rel: (.5, 0), to: (horizontal: "RegFile.east", vertical: ())),
(horizontal: (), vertical: ("Ctrl.south", 50%, "RegFile.north")),
(horizontal: "RegFile-port-WE3", vertical: ()),
"RegFile-port-WE3"
)
let names = (
"PCSrc": "PCSrc",
"ResSrc": "ResultSrc",
"MemWrite": "MemWrite",
"ALUCtrl": [ALUControl#sub("[2:0]")],
"ALUSrc": "ALUSrc",
"ImmSrc": [ImmSrc#sub("[1:0]")],
"RegWrite": "RegWrite"
)
for (port, name) in names {
draw.content("Ctrl-port-"+port, name, anchor: "south-west", padding: 3pt)
}
})
}) |
https://github.com/maxluoXIII/resume | https://raw.githubusercontent.com/maxluoXIII/resume/master/resume.typ | typst | #show heading: set text(font: "Linux Biolinum")
#show link: underline
// Uncomment the following lines to adjust the size of text
// The recommend resume text size is from `10pt` to `12pt`
// #set text(
// size: 12pt,
// )
// Feel free to change the margin below to best fit your own CV
#set page(
margin: (x: 1.0cm, y: 1.3cm),
)
// For more customizable options, please refer to official reference: https://typst.app/docs/reference/
#set par(justify: true)
#let chiline() = {v(-3pt); line(length: 100%); v(-5pt)}
= <NAME>
#link("mailto:<EMAIL>")
| #link("https://github.com/maxluoXIII")[github.com/maxluoXIII]
| #link("https://maxluoxiii.github.io")[maxluoxiii.github.io]
== Work Experience
#chiline()
*#link("https://ibm.com")[IBM]* #h(1fr) Aug. 2021 -- Present \
Backend Developer #h(1fr) Rochester, MN \
- Developed robust device drivers for the
#link("https://www.ibm.com/products/ibm-i")[IBM i] operating system using C++,
for both physical (NVIDIA, Intel, etc.) and virtual (link aggregation, vNIC, etc.)
NICs
- Migrated device driver testing scripts to an open-source Python framework,
expanded test coverage, and improved logging/debugging capabilities to develop
a cohesive testing tool for device driver developers
- Collaborated with internal and external teams to provide support for clients
by providing analyses and fixes
*#link("https://8i.com/")[8i]* #h(1fr) May 2020 -- Aug. 2020 \
Software Engineering Intern #h(1fr) Chicago, IL \
- Developed features for an internal MPEG-DASH player to support the
company's proprietary 3D mesh, video, and audio codec including seek, caching,
and adaptive bitrate selection using the C++ Qt Framework
*#link("https://www.eagleseven.com/")[Eagle Seven]* #h(1fr) May 2019 -- Aug. 2019 \
Software Development Intern #h(1fr) Chicago, IL \
- Wrote software to calculate network performance metrics of high-frequency
trade engines
- Built a real-time dashboard using InfluxDB and Grafana to improve the automation,
comparison, and real-time tracking capabilities of the performance testing framework
== Education
#chiline()
#link("https://illinois.edu/")[*University of Illinois at Urbana-Champaign*] #h(1fr) Aug. 2017 -- May 2021 \
Bachelor of Science, Computer Science + Master of Computer Science #h(1fr) Urbana-Champaign, IL \
- Operating System Design; Distributed Systems; Communication Networks; Applied Parallel Programming
- Computer Security I/II; Advanced Computer Security; Applied Cryptography; Operating System Security
- Machine Learning; ML for Sys, Networks, & Security; Algorithms
- Interactive Computer Graphics; UI Design; Top Down Video Game Design; Game Dev Process
- Teaching Assistant for CS 225 (Data Structures) and CS 126 (Software Design Studio)
- Lead discussions and code reviews to foster educational dialogue on data
structures and best coding practices
- Provided continuous updates to the course website to provide students with up-to-date information
- Answered questions and debugged student solutions in office hours
== Projects
#chiline()
*#link("https://github.com/maxluoXIII/server-manager")[server-manager]* #h(1fr) Mar. 2023 -- Aug. 2023 \
Creator #h(1fr) #link("https://github.com/maxluoXIII/server-manager")[GitHub] \
- Developed a Discord bot in Rust utilizing their HTTPS/REST API to allow members
of a Discord server to manage multiple Minecraft servers on a host computer
*#link("https://github.com/Mottokrosh/Sheet")[Sheet]* #h(1fr) Sep. 2021 -- Jan. 2022 \
Contributor #h(1fr) #link("https://github.com/Mottokrosh/Sheet")[GitHub] \
- Identified the cause for authentication and database issues that caused an
outage of an open-source Node application.
- Communicated with the maintainer and developed a fix that was merged into
the project.
- Reviewed pull requests made by other developers and helped them merge their
own fixes to the project.
== Skills
#chiline()
- *Proficient* in C/C++, Python
- *Intermediate* knowledge of Rust, Java, HTML/CSS, Javascript (Angular), InfluxDB,
Grafana, Unity, Unreal Engine, WebGL, Android app development, Discord app
development, Qt Framework, Flutter, Chinese, Japanese
- *Basic* skills with OCaml, x86 Assembly, Verilog
|
|
https://github.com/HEIGVD-Experience/docs | https://raw.githubusercontent.com/HEIGVD-Experience/docs/main/S4/WEB/docs/TE/TE1.typ | typst | #import "/_settings/typst/template-te.typ": *
#show: resume.with(
"Résumé WEB - TE1",
"<NAME>",
cols: 3
)
= HTML
== HTML structure
- `<!DOCTYPE html>`: The document type declaration for HTML5
- `<html>`: The root element of an HTML page
- `<head>`: Contains meta-information about the document
- `<title>`: The title of the document
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css"> <!-- CSS link -->
<title>Welcome page</title>
</head>
<body>
<h1>Hello students of the Web Technologies course !</h1>
</body>
</html>
```
- width=device-width : the width of the page matches the screen width
- initial-scale=1.0 : the initial zoom level
=== Open Graph Protocol
The Open Graph protocol enables any web pages to show some additional information when shared on social media or messaging apps.
```html
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="https://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="https://ia.media-imdb.com/images/rock.jpg" />
```
== Lists
=== Unordered lists
Unordered lists are used to list items in no particular order. They are defined with the `<ul>` element.
```html
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
```
=== Ordered lists
Ordered lists are used to list items in a specific order. They are defined with the `<ol>` element.
```html
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
```
== Hyperlink
Hyperlinks are used to link from one page to another. They are defined with the `<a>` element.
```html
<a href="https://www.google.com" title="Google" target="_blank">Google</a>
<a href="mailto:<EMAIL>?subject=hello&body=world!">Hello World!</a>
```
== Media elements
=== Images
```html
<img src="image.jpg" alt="Image description">
```
=== Audio & Video
```html
<audio src="audio.mp3"></audio>
<video src="video.mp4"></video>
```
=== Canvas
The canvas element allows for dynamic, scriptable rendering of 2D and 3D shapes.
```html
<canvas id="myCanvas" width="200" height="100"></canvas>
```
== Tables
Tables are used to display data in a tabular format. They are defined with the `<table>` element.
```html
<table>
<!-- row -->
<tr>
<!-- header column -->
<th>Student ID</th>
<th>Grade</th>
</tr>
<tr>
<!-- regular column -->
<td>4</td>
<td>5</td>
</tr>
<tr>
<!-- merged columns -->
<td colspan="2">6</td>
</tr>
</table>
```
== Forms
Forms are used to collect user input. They are defined with the `<form>` element.
```html
<form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
```
== Semantic elements
```html
<header>Header</header>
<nav>Navigation</nav>
<main>Main content</main>
<section>Section</section>
<article>Article</article>
<aside>Aside</aside>
<footer>Footer</footer>
```
= CSS
== CSS Selectors
CSS selectors are used to select the elements to which the ruleset will apply. There are several types of selectors:
=== Type
Type selectors select elements based on their tag name.
```css
p {
color: red;
}
```
*This rule will apply to all `<p>` elements. in the html page.*
=== Id
Id selectors select elements based on their `id` attribute.
```css
#myId {
color: red;
}
```
*This rule will apply to the element with the `id="myId"` attribute.*
=== Class
Class selectors select elements based on their `class` attribute.
```css
.myClass {
color: red;
}
```
*This rule will apply to all elements with the `class="myClass"` attribute.*
=== Universal
The universal selector `*` selects all elements.
```css
* {
color: red;
}
```
*This rule will apply to all elements in the html page.*
=== Grouping
Grouping selectors select multiple elements.
```css
h1, h2, h3 {
color: red;
}
```
=== Descendant
Descendant selectors select elements that are descendants of another element.
```css
div p {
color: red;
}
```
*This rule will apply to all `<p>` elements that are descendants of a `<div>` element.*
=== Child
Child selectors select elements that are direct children of another element.
```css
div > p {
color: red;
}
```
*This rule will apply to all `<p>` elements that are direct children of a `<div>` element.*
=== Flexbox
Flexbox is a layout model that allows elements to align and distribute space within a container.
```html
<div class="container">
<div class="item">Item A</div>
<div class="item">Item B</div>
<div class="item">Item C</div>
</div>
```
```css
.container {
display: flex;
flex-direction: row;
}
.item {
order: 1;
flex-grow: 1
}
```
- Container (parent) properties : flex-direction, flex-wrap, flex-flow, justify-content, align-items, align-content
- Item (child) properties : order, flex-grow, flex-shrink, flex-basis, flex, align-self
=== Grid
Grid is a layout model that allows elements to align and distribute space in two dimensions.
```html
<div class="container">
<div class="item">Item A</div>
<div class="item">Item
B</div>
<div class="item">Item C</div>
</div>
```
```css
.container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
.item {
grid-column: 1 / 3;
}
```
- Container (parent) properties : grid-template-column, grid-template-rows, grid-template-areas, grid-template, ...
- Item (child) properties : grid-column-start, grid-column-end, grid-column, grid-row, grid-area, ...
#image("/_src/img/docs/image copy 38.png")
== Media Queries
Media queries are used to apply different styles based on the deviceâs characteristics.
```css
h1 { font-size: 50px; } /* General rule */
@media (min-width: 576px) { /* Tablet dimensions */
h1 { font-size: 60px; }
}
@media (min-width: 768px) { /* Desktop dimensions */
h1 { font-size: 70px; }
}
```
== CSS variables
```css
:root { /* Global variables */
--main-color: #06c;
--main-bg-color: #fff;
}
.my-element {
color: var(--main-color, #06c);
background-color: var(--main-bg-color, #fff);
}
```
The var() function can take fallback values in case one of the variables is not defined.
= JavaScript
*Interpreted*
The interpreter reads the source code and executes it directly.
*Just-in-time (JIT) compiled*
The interpreter compiles the hot parts of the source code into machine-code and executes it directly.
*First-class functions*
Functions are treated like any other value. They can be stored in variables, passed as arguments to other functions, created within functions, and returned from functions.
==== Adding JavaScript directly to HTML
```html
<script type='text/javascript'>
console.log('Hello, World!');
document.writeln('Hello, World!')
</script>
```
==== Adding JavaScript to an external file
```html
<script src='script.js'></script>
```
- The defer attribute is used to defer the execution of the script until the page has been loaded.
- The async attribute is used to load the script asynchronously.
== Primitive types
- *Undefined*: Unique primitive value undefined
- *Number*: Real or integer number (e.g. 3.14, 42)
- *Boolean*: true or false
- *String*: Character sequence, whose literals begin and end with single or double - quotes (e.g. "HEIG-VD", 'hello')
- *BigInt*: Arbitrary-precision integers, whose literals end with an n (e.g. - 9007199254740992n)
- *Symbol*: Globally unique values usable as identifiers or keys in objects (e.g. Symbol(), Symbol("description"))
- *Null*: Unique value null
== Arrays
- Array: Ordered collection of values
The syntax for creating an array is:
```javascript
let fruits = ['Apple', 'Banana', 'Cherry'];
```
Elements can be accessed using bracket notation:
```javascript
console.log(fruits[0]); // Apple
console.log(fruits.length); // Banana
```
=== Methods on arrays
```javascript
fruits.push("mango", "papaya"); // Appends new items
fruits.pop(); // Removes and returns the last item
fruits.reverse(); // Reverses the items' order
fruits.splice(2, 1, 'Orange'); // Replaces 1 elemnt at position 2 with 'Orange'
fruits.splice(1, 0, 'Peach'); // Inserts 'Peach' at index 1
```
== Typeof operator
The typeof operator returns the type of a variable or expression.
```javascript
console.log(typeof 42); // number
console.log(typeof 'hello'); // string
console.log(typeof null); // object
console.log(typeof [1, 2, 3]); // object
```
== Arithmetic operators
```javascript
1 + 1; // addition
1 - 1; // subtraction
1 / 1; // division
1 * 1; // multiplication
1 % 1; // modulo
1 ** 1; // exponentiation
```
== String operators
```javascript
"con" + "cat" + "e" + "nate";
`PI = ${Math.PI}`; // template literals (instead of: "PI = " + Math.PI)
```
In practice we should opt for template literals over string concatenation.
=== Automatic type conversion
Automatic type conversion is performed when comparing values of different types. It is at the root of many issues when using comparison operators.
```javascript
"1" == 1 // true (!!!)
false == 0 // true
8 * null // 0
```
=== Strict equality
Strict equality compares two values for equality without type conversion.
```javascript
"1" === 1 // false
"1" !== 1 // true
```
== Variables
=== var
The var statement declares a *non-block-scoped* variable, optionally initializing it to a value. Its scope is its current execution context, i.e. either the enclosing function or, if outside any function, global. It can be re-declared.
```javascript
var x = 1;
if (true) { var x = 2; } // same variable
console.log(x); // 2
```
=== let
The let statement declares a *block-scoped* local variable, optionally initializing it to a value. It can be re-assigned but not re-declared.
```javascript
let x = 1;
{ let x = 2; } // different variable (in a new scope)
console.log(x); // 1
let x = 1000; // Error: redeclaration of let x
```
=== const
The const statement declares a *block-scoped* read-only named constant. It can be re-assigned but not re-declared.
```javascript
const x = 1;
x = 2; // TypeError: Assignment to constant variable.
```
== While and do-while loops
```javascript
let num = 0;
while (num < 10) {
console.log(num);
num += 1;
}
let echo = "";
do {
echo = prompt("Echo");
console.log(echo);
} while (echo != "stop");
```
== For loop
```javascript
for (let num = 0; num < 10; num++) {
console.log(num);
}
```
The for...in statement iterates over the enumerable properties of an object.
```javascript
let obj = {a: 1, b: 2, c: 3};
for (let prop in obj) {
console.log(prop, obj[prop]);
}
```
The for...of statement creates a loop iterating over iterable objects.
```javascript
let nums = [0, 1, 2, 3, 4, 5, 6, 7, 8 , 9];
for (let num of nums) {
console.log(num);
}
```
== Declaration notation
```javascript
function square(x) {
return x * x;
}
// or
var square = function(x) {
return x * x;
}
```
== Arrow functions
```javascript
var square = x => x * x
// or
var square = (x) => {
return x * x;
}
```
== Recursion
```javascript
function factorial(n) {
return n == 1 ? n : n * factorial(n-1);
}
console.log(factorial(5)) // 5 * 4 * 3 * 2 * 1 = 120
```
.. as long as it does not overflow the call stack.
#colbreak()
== Higher-order functions
```javascript
function greaterThan(n) {
return m => m > n;
}
let greaterThan10 = greaterThan(10);
console.log(greaterThan10(11)); // true
```
= Regular expressions
Regular expressions are patterns used to match character combinations in strings. They are created using the RegExp constructor or a literal notation.
```javascript
const re1 = /ab+c/;
const re2 = new RegExp(/ab+c/);
```
- `Character Classes (., \s, \d, âŠ)` that distinguish types of chararters (resp. any, whitespace or digit)
- `Character sets ([A-Z], [a-z], [0-9], [abc], âŠ)` that match any of the enclosed - characters (resp. uppercase letters, lowercase letters, digits, and any of a, b or c)
- `Either operator (x|y)` that match either the left or right handside values
- `Quantifiers (\*, +, ?, {n}, {n,m})` that indicate the number of times an expression matches
- `Boundaries (^, \$)` that indicate the beginnings and endings of lines and words
- `Groups ((), (?<name>), (?:))` that extracts and remember (or not) information from the input
- `Assertions (x(?=y))` that helps at defining conditional expressions
```javascript
const emailRegex = /^[a-zA-Z]([a-zA-Z0-9._-]+)@(?:[a-zA-Z0-9]+\.)+(?:com|org|net)$/;
```
== Flags
```javascript
const re1 = /ab+c/; // no flag
const re2 = /ab+c/g; // global search
const re3 = /ab+c/i; // case-insensitive search
const re4 = /ab+c/m; // multi-line search
const re5 = /ab+c/gi // global case-insensitive search
```
== Context
```javascript
function doTwice(f) {
f.call(this); // bind this to the current context
f.call(this); // bind this to the current context
}
let human = {
age: 32,
getOlder() {
this.age++;
}
}
doTwice.call(human, human.getOlder); // bind this to human
console.log(human.age); // Output will be 34
```
== Array methods
- `concat()` concatenates two or more arrays and returns a new array.
- `join()` joins all elements of an array into a string.
- `pop()` removes the last element from an array and returns that element.
- `push()` adds one or more elements to the end of an array and returns the new length of the array.
- `reverse()` reverses the order of the elements of an array.
- `shift()` removes the first element from an array and returns that element.
- `slice()` selects a part of an array, and returns it as a new array.
- `sort()` sorts the elements of an array.
- `includes()` determines whether an array contains a specified element.
- `flat()` flattens an array up to the specified depth. |
|
https://github.com/Servostar/dhbw-abb-typst-template | https://raw.githubusercontent.com/Servostar/dhbw-abb-typst-template/main/src/pages/declaration-of-authorship.typ | typst | MIT License | // .--------------------------------------------------------------------------.
// | Declaration of Authorship |
// '--------------------------------------------------------------------------'
// Author: <NAME>
// Edited: 28.06.2024
// License: MIT
#let new_declaration_of_authorship(config) = (
context {
pagebreak(weak: true)
let thesis = config.thesis
let author = config.author
if text.lang == "de" [
#heading("SelbstÀndigkeitserklÀrung")
] else if text.lang == "en" [
#heading("Declaration of Authorship")
]
v(1em)
if text.lang == "de" [
Ich versichere hiermit, dass ich meine PrÃŒfung mit dem Thema
] else if text.lang == "en" [
I hereby confirm that I have written this thesis with the subject
]
v(1em)
set align(center)
text(weight: "bold", thesis.title)
if thesis.subtitle != none {
linebreak()
thesis.subtitle
}
set align(left)
v(1em)
set par(justify: true)
if text.lang == "de" [
selbstÀndig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. Ich versichere zudem, dass die eingereichte elektronische Fassung mit der gedruckten Fassung Ìbereinstimmt.
] else if text.lang == "en" [
independently and have not used any sources or aids other than those specified. I also confirm that the electronic version submitted is identical to the printed version.
]
set align(horizon)
grid(
// set width of columns
// we need two, so make both half the page width
columns: (50%, 50%),
row-gutter: 0.75em,
align(left, {line(length: 6cm)}),
align(left, {line(length: 6cm)}),
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }),
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
}
)
|
https://github.com/noriHanda/undergrad_paper | https://raw.githubusercontent.com/noriHanda/undergrad_paper/main/main.typ | typst | #import "template.typ": *
#show: project.with(
title: "çé»çŸ©æäººå·¥æèŠã®ããã®é§åéšãšãã«ã®ãŒæž¬å®ã«åºã¥ãåèŠã»ã³ã·ã³ã°",
englishTitle: "Kinesthetic sense based on evaluation of actuator energy for artificial sense in myoelectric prosthetic hands",
author: "åç° å¯æ",
supervisor: "è西 èª ä¹ ææ",
affiliation: "å·¥åŠéšæ
å ±ãšã¬ã¯ãããã¯ã¹åŠç§é»æ°é»åå·¥åŠã³ãŒã¹",
lab: "éåç¥èœããã€ã¹ç 究宀",
grade: "åŠéš4幎",
year: "什å5",
)
#outline(indent: 2em, fill: box(width: 1fr, repeat[â¯]))
// start page number
#set page(numbering: "1", number-align: center, margin: (top: 35.01mm, left: 30mm, right: 30mm, bottom: 30mm))
#counter(page).update(1)
= åºè«
== èæ¯
äœããã®äºæ
ãç
æ°ã«ããåŸå€©çã«äžè¢ãç¡ãããŠããŸã£ã人ããããŠå
倩çã«äžè¢ããªãäººã¯æ¬äººã®ææãšã¯ç¡é¢ä¿ã«ãåãã瀟äŒåå ã®éžæè¢ãéãããŠããŸããç€ŸäŒæ§é èªäœããã®ãããªäººã
ãåç»ãããã圢ã«å€é©ããæ¹æ³ãèãããããããã®ããã«ã¯äžè¢ãå¿
èŠãšããªãã³ãã¥ãã±ãŒã·ã§ã³ãæ¥åå·è¡ã®æ¹æ³ãèããå¿
èŠãåºãŠããããããããã«ããæè¡ç課é¡ã«çŽé¢ããã\
ãã®ãããäžè¢ãè£ã圢ã§ã®ç€ŸäŒåå ãå
æãã¹ãããŒãã«ãæå°ã«æãããããã§äœ¿çšè
èªèº«ã®èº«äœã®äžéšã®ããã«æããããšã®ã§ããæäœæã®çŸ©æãå¿
èŠã«ãªã£ãŠããã®ã¯æããã§ããããããã矩æã«ã¯å¯©çŸæ§ã®ã¿ãç®çãšããç©ãååšããããæäœå¯èœãªäžã䟵襲æ§ããªãããçè±ã容æãªçé»çŸ©æãæ¬åéã®ããããã®æœ®æµãçºããšèããããã\
人éãèªåã®æãåäœãããéãéæåäœïŒæèçåäœïŒãšäžéæåäœïŒç¡æèçåäœïŒã«åé¡ã§ãããéæåäœãšã¯ã人éãæå³ããéãã®åããããåäœã§ããäžæ¹ãäžéææäœã¯äººéãåäœã«å¯ŸããŠæèçã«ãªãããšã確ãã«è¡ã£ãŠããåäœãå¶åŸ¡ã®ããšã§ãããç±ããã®ãçã¿ãæãããšåæããããæããããåã«æãåŒã£èŸŒããããéããã®ãæã€ãšãã«ç¡æèã«åãå ããŠãã®ãèœã¡ãªãããã«å¶åŸ¡ããããšãã£ãããšãããã«åœããã
çé»çŸ©æã®ç®æãå
ã¯äœ¿çšè
ãããããèªåã®æã§ãã£ããã®ããã«æäœãè¡ããç¶æ
ã§ããããã®ããããã®å®æåºŠã¯åé¡ã«ãªãããçé»çŸ©æã«ãããéææäœæ§èœèªäœã¯ç ç©¶åéãšããŠãã§ã«å€§ããªãã®ãšããŠååšãã @Prosthetic-Hands-Trends ãäžæ¹ã§äžéæã®åäœã«é¢ããŠã¯ãã®èª²é¡æã®å
±æã®é£ãããã課é¡ãšããŠæãããã«ããåéã«ãªã£ãŠããããããããã®äžéæåäœç¡ãããŠäººã®æã®ãããªæäœæã¯åŸãããªãã
#figure(image("assets/overview_table.png"), numbering: "1", caption: text("çé»çŸ©æç ç©¶ã®æ¹éãšçŸåšå°"), kind: table)
== ç®ç
äžéæåäœãæé»çã«çŸ©æã«å®è£
ããã®ã§ã¯èªåã®æã®ããã«ã¯ãªããªããçäœã®æã®ããã«ãè§Šãæž©åºŠã®åœ¢ç¶ãè§Šãå¿å°ãªã©ã¯ãã¡ããã®ããšãæã«ããã£ãŠããééçãªè² æ
ããå©çšè
ã«ãã£ãŒãããã¯ããå¿
èŠããããè§ŠèŠã«åœããéšåãç®èæèŠãééçè² æ
ãæããåèŠã®éšåãæ·±éšæèŠãšåŒã°ããŠããããç®èæèŠã®åéã«ã€ããŠã¯çŸ©æã®ã¿ãªããxRãªã©ã®åéã§ããããã£ã¯ã¹ãšåŒã°ããããã«ãä»åéã«æž¡ãç ç©¶ãé²ããããŠãããäžæ¹ã§æ·±éšæèŠã«ã€ããŠã¯ç®èæèŠãšåæ§ã«éèŠã§ããã«ãé¢ãããæ¯èŒçç ç©¶ãé²ããããŠããªããããã¯Google Scholarã«ãŠ "haptics" ã¯225,000ä»¶ã "cutaneous sensation" ã¯516,000ä»¶ãããããã®ã«å¯Ÿããæ·±éšæèŠã«ããã "bathyesthesia" ã¯86ä»¶ãããããããªãããšãããæããã§ããããªã "deep sense" ã "deep sensing" ãªã©ã¯ãã£ãŒãã©ãŒãã³ã°ã®ã¢ã«ãŽãªãºã ãªã©å€å²ã«ãããåéã§ã®äœ¿çšããããŠããçšèªã§ããããé€å€ããããããã®ç ç©¶ååãèžãŸããæã
ã¯éèŠã«ãé¢ãããããŸãæãã€ããããŠããªãåéã§ããåèŠã®ãã£ãŒãããã¯ã«ä»ååãçµãããšãšããã
== æ¬è«æã®æ§æ
æ¬è«æã¯å
š6ç« ããæ§æãããŠããã\
第1ç« ã§ã¯æ¬è«æã®ç®çåã³å
è¡ç ç©¶ãèžãŸããç«ã¡äœçœ®ãè«ããã\
第2ç« ã§ã¯åèŠã»ã³ã·ã³ã°æè¡ã玹ä»ããã\
第3ç« ã§ã¯çé»çŸ©æã®é§åéšãšãã«ã®ãŒæž¬å®ãããããšã§åŠäœã«åèŠã»ã³ã·ã³ã°ãè¡ããã説æããã\
第4ç« ã§ã¯æ¬ç ç©¶çµæãçšããŠæšè«ã¢ãã«ãäœæããã®ã«ã«çšãããªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°ã®èª¬æãè¡ãã\
第5ç« ã§ã¯é§åéšãšãã«ã®ãŒãšããä¿¡å·ããªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°ãçšããŠè§£æããææ³ã«ã€ããŠç޹ä»ããã\
æåŸã«ç¬¬6ç« ãæ¬è«æã®ãŸãšããšããã
#pagebreak(weak: true)
= åèŠã»ã³ã·ã³ã°
åèŠã枬å®ããããã®æ©æ§ã¯å€ãããç ç©¶ãããŠãããç£æ¥çšãããããã¿ãããã£ã¹ãã¬ã€ãªã©å¹
åºãçšéã§å©çšãããŠããã以äžã«äž»ãªåèŠã»ã³ã·ã³ã°ãããæè¡ã玹ä»ããã @Sensors
== æ¢åã®åèŠã»ã³ã·ã³ã°æè¡
=== æªã¿ã²ãŒãžã»ã³ãµ
æªã¿ã²ãŒãžã»ã³ãµã¯ã»ã³ãµãŒéšã«ãããåŒåŒµåã»å§çž®åã«ããã黿°æµæãå€åããé屿µæææã®æ§è³ªãå©çšããŠãåããã«ã¯ã«æç®ãããå°åã§ç²ŸåºŠãé«ããå¿çæ§ãé«ãããšããå€ãã®å Žé¢ã§äœ¿ãããã
=== å§é»ã»ã³ãµ
æ°Žæ¶ãPZT (ãžã«ã³ã³é
žãã¿ã³é
žé) ãªã©ã®å§é»å¹æãæããææãã»ã³ãµãŒéšã«äœ¿çšããŠãåãæž¬å®ãããå°åã§å¿çæ§ãé«ããã³ã¹ããæ¯èŒçåªãããã粟床ã¯ãã²ãã¿ã²ãŒãžåŒãéé»å®¹éåŒã«ã¯åã°ãªãã
=== éé»å®¹éã»ã³ãµ
ã»ã³ãµãŒéšãé屿æã®é»æ¥µãåããåããã«é
眮ãããã³ã³ãã³ãµåãšããåã«ããå°äœéã«ã²ãã¿ãçããŠè·é¢ãå€ããããšã«ããéé»å®¹éã®å€åãæ€ç¥ãããæ§æãæ¯èŒçç°¡åã§äœã³ã¹ãã§çç£ã§ããäžã黿¥µããã£ã«ã ç¶ã«ãããšãå°ååã»èååãå¯èœã§ããã粟床ãå¿çæ§ãåªããŠããã
=== å
åŠã»ã³ãµ
èšæž¬å¯Ÿè±¡ç©ã«äžå®ééã§æš¡æ§ãããŒãã³ã°ããŠãããåãå ãã£ãæã«çããæš¡æ§ã®å€åããã«ã¡ã©ãã¬ãŒã¶ãŒãªã©ã®å
åŠã»ã³ãµã§æ€åºããŠãåã®å€§ãããèšç®ããŠæ±ãããéæ¥è§Šã§æž¬å®ã§ããããšãæå€§ã®ã¡ãªããã§ã¯ããã粟床ãå¿çæ§ãå°ååãã³ã¹ãã¯ãä»ã®æ¹åŒã«è»é
ãäžãããã䜿ãããå Žé¢ã¯éãããã
=== ãµãŒãã®éèµ·é»åãšãµãŒãå
èµã»ã³ãµãçšããææ³
å
è¿°ã®ãããªã»ã³ãµãçšããªãææ³ãå€ãããç ç©¶ãããŠããã
ç¹ã«ä»åã®ããã«ãµãŒãã¢ãŒã¿ãå
èµããå Žåãéåžžã«å€ãçé»çŸ©æã®ãããªãã®ã®å Žåãããšããšããšå
èµãããŠãããµãŒãããåŸãããä¿¡å·ãçšããæ¹æ³ãšããŠéèµ·é»åã芳枬ããæ¹æ³ããããããã¯ã¢ãŒã¿ã«å€åãäžããŠå転ãããéã«ã¢ãŒã¿ãçºé»æ©ãšããŠæ¯ãèãçŸè±¡ãçšããææ³ã§ããããããããã ãã§ã¯å転æ¹åãããããªãããããµãŒãã¢ãŒã¿ã®å転è§å¶åŸ¡çšã«æèŒãããŠãããšã³ã³ãŒããã¿ã³ãžã§ãã¬ãŒã¿ãçšããããšã§å€åã®æ¹åãå²ãåºããšãããã®ã§ããã\
以äžã«ãã®æ°çç説æãè¡ãã
==== ã»ã³ãµã¬ã¹ã»ã³ã·ã³ã°ã®æ°çç説æ
å
šå€ä¹±ããå€å以å€ã®èŠçŽ ãã¢ãã«åãåãé€ãããšã§å€åã®ã¿ãæœåºå¯èœãšããŠèãããšä»¥äžã®åŒã§è¡šçŸãããã\
#math.equation(block:true,numbering: "(1)" ,$ F_"ext"=F_"dis"-(F_"int"+F_"g"+F_"c"+D s X^"res"+Delta M s ^2X^"res"-Delta"K"_t"I"^"ref"_a) $)
ãã ãããã§$F_"dis"$ã¯å
šå€ä¹±ã$F_"int"$ã¯ã³ãªãªãªåã»é å¿åãªã©ã®å
éšå¹²æžåã$F_g$ã¯å§¿å¢ã®åœ±é¿ã§éåå é床ã«ããçºçããåã$F_c$ã¯ã¯ãŒãã³æ©æŠåã$D s X^"res"$ã¯ç²æ§æ©æŠåã$M$ã¯ã¢ãŒã¿çšŒåéšã®æ
£æ§ã§ãã$M s^2 X^"res"$ã¯åšæ³¢æ°é åã«ãããã¢ãŒã¿ã®åååŠã衚ãïŒããªãã¡$s, X^"res"$ã¯ããããã©ãã©ã¹æŒç®åãšåšæ³¢æ°é åã§ã®è§åºŠã衚ã倿°ïŒã$K_t$ã¯ã¢ãŒã¿ã«äœ¿çšãããŠããç£ç³ã®åŒ·ããã³ã€ã«ã®å·»ç·éã«ãã£ãŠå€åããã¢ãŒã¿åºæã®æšå宿°ã$I_a^"ref"$ã¯åšæ³¢æ°é åã«ããã黿µã衚ã倿°ã§ããã\
åŒ(1)ã«ãããCæ©æŠå$F_c$ãç²æ§æ©æŠå$D s X^"res"$ã¯äºçš®ã®çé床詊éšãæ
£æ§å€å$Delta M$ã¯å é床詊éšã«ãã£ãŠåå®ããããšãã§ããã@Sensorless-Sensing
== æ¢åæè¡ã®èª²é¡
åèŠãååŸããæ¹æ³ã«ã¯åçš®ã»ã³ãµãçšããæ¹æ³ãšãå
èµãããŠãããµãŒãã¢ãŒã¿ããåŸãããä¿¡å·ãçšããæ¹æ³ãšãäžè¬çã§ããããšãããã£ããããããã©ã¡ãã®æ¹æ³ãçé»çŸ©æã«åèŠãäžããããã®ã¢ãããŒããšããŠã¯çžå¿ãããªãã
=== åèŠã»ã³ãµã®åé¡ç¹
åç¯ã§ç޹ä»ããåèŠã»ã³ãµãçé»çŸ©æã«çšãããšãªããšäºã€ã®æžå¿µç¹ãæµ®ããã§ãããæèŒã»ã³ãµã®åãä»ãäœçœ®ãšã³ã¹ãã®å¢å ã ãåç¯ã§ç޹ä»ããåèŠã»ã³ãµã¯ã©ããå§åãçŽæ¥ãããéšåã«èšçœ®ããå¿
èŠããããç©ã«è§Šããéã«æããæè§Šãèªè察象ã§ããã°ããã§ãæ§ããªãããä»å察象ãšããã®ã¯çšŒåéšã«ãããåèŠã§ããããåèŠã»ã³ãµã皌åéšã«åãä»ããå¿
èŠãåºãŠãããé§åéšã«ããçšåºŠãµã€ãºã®ããåèŠã»ã³ãµãåãä»ãããšãªããšåãä»ãäœçœ®ãåãä»ãæ¹ã«ããªãã®å·¥å€«ãå¿
èŠãšãªã£ãŠããããšã¯æ³åã«é£ããªãã\
ãŸããã³ã¹ãã®é¢ã§ãåãµãŒãé¢ç¯éšåã«åèŠã»ã³ãµãå¿
èŠãšãªã£ãŠããããšãã广ã«ãªã£ãŠãããçé»çŸ©æã¯äžè¢ããªãæ¹ãçæŽ»ã«æ¯éã®ãªããããããšããã人暩ã®é¢ãããæäœéå¿
èŠãªãã®ãšãªã£ãŠãããã®ã§ãããããäœã³ã¹ãã«æããããšãéèŠã§ããããã®ããã«ã¯åé¢ç¯ããšã«é«äŸ¡ãªã»ã³ãµãæèŒããããšã¯æãŸãããªãã
=== ãµãŒãã®éèµ·é»åãçšããå Žåã®åé¡ç¹
æ¢åæè¡ã®äžã§å®äŸ¡ãªã¢ãããŒããšããŠãµãŒãã®éèµ·é»åãšãšã³ã³ãŒãçã®å転æ¹åãæ€åºããã»ã³ãµãšãçµã¿åãããã»ã³ãµã¬ã¹ã®ææ³ããããåç¯ã§ã玹ä»ããéãããã®ææ³ãçšããããšã§ãéèµ·é»åãæ€åºããå路以å€ã®è¿œå éšåãå¿
èŠãšããå®è£
ã§ããããŸãã远å éšåãå¿
èŠãªãããåãä»ãäœçœ®ã«åµæå·¥å€«ã®å¿
èŠæ§ããªãã\
ãããæ±ºå®çãªåŒ±ç¹ãååšãããã¢ãŒã¿ã®ç¹æ§äžãéèµ·é»åãåŸãã«ã¯ã·ã£ããã®å転ãå¿
èŠãªç¹ã§ãããå®éã®åèŠã枬å®ããéãã¢ãŒã¿ãå転ãããã«ã¯åŒ±ãããåãä»äžãããå Žåãå€ãååšããããããããã®ãããªå Žåã§ããã®ã»ã³ãµã¬ã¹ã®ææ³ã§ã¯ããã£ãŠããåèŠã¯0ãšããŠå€æãããŠããŸããããã§ã¯å®éã®çäœã®ããã«ãå€åã«èããŠããç¶æ
ã§ãçèã®è² è·ãæãåãããšã§å€åã®å€§ããã倧å¡èªç¥ããããšã¯å¶ããªãã
== ãµãŒãã®æ¶è²»é»åãçšããæ¹æ³
åç¯ã§ã¯åèŠã»ã³ãµã®æèŒãããµãŒãã®éèµ·é»åãçšãããå Žåã®æ¬ ç¹ã玹ä»ãããçé»çŸ©æã®åèŠã枬å®ããããã«ã¯ãããã®æ¹æ³ã§ã¯å®çšæ§ã«æ¬ ããéšåãããããšãããã£ãããããã®æ¹æ³ãã簡䟿ãã€éæ¢æã®èšæž¬ãå¯èœãªææ³ãæãŸããããã§ããããããã§æã
ã¯ä»ã®ç ç©¶ããŒãã§ã®ãã©ãã«ã«çç®ããã
#heading("éè² è·ã«ãããµãŒãã®æ
é", numbering: none, level: 3, outlined: false)
åãç 究宀å
ã®å¥ã®ç ç©¶ã°ã«ãŒãã§ãµãŒãã®æ
éãäœåºŠãçºçããããã®ã°ã«ãŒãã§ã¯ããããã䜿çšããŠããã®ã ããããããã®è¶³ãçºããµãŒãã«éè² è·ãããã黿µå¶åŸ¡çšã®ãã©ã³ãžã¹ã¿ãçŒãåããŠããŸãããšãåå ã ã£ãããµãŒãã¯äžããããPWMä¿¡å·ã«å¯Ÿå¿ããå転è§åºŠïŒç®æšè§åºŠïŒãšçŸåšã®å転è§åºŠãšã«ãããããå Žåã«ç®æšè§åºŠãšãªãããã«å転ããæ§è³ªããããç®æšè§åºŠãŸã§å転ããéã«å€åã«ããå転ã«ãã¬ãŒãããããéã¯ããã«è² ãããšäŸçµŠé»æµãå¢ããããšã§åãããšãããããããã®éã«å
éšã®é»ååè·¯ã®èš±å®¹é»æµãè¶
ããŠããŸãç Žæããããšããã£ããæã
ã¯ãã®çŸè±¡ã«çç®ãããŠããµãŒãã«ãããå€åãæ¶è²»é»åãçšããŠæ€åºããææ³ãèæ¡ããã
#pagebreak(weak: true)
= çé»çŸ©æã®é§åéšãšãã«ã®ãŒæž¬å®ã«ã€ããŠ
çé»çŸ©æã®çšŒåéšãçºããµãŒãã®æ¶è²»é»åãæž¬å®ããããšã§ã矩æã«ãããåèŠã枬å®ã§ãããšããã³ã³ã»ããã®å®èšŒãè¡ã£ããä»åã¯ç°¡åã®ããã«çé»çŸ©æãçšããã®ã§ã¯ãªããå®éšçšã®ããããã¢ãŒã ãçšããã
=== å®éšåšå
·
以äžã«ä»åã®å®éšã§äœ¿çšããå®éšåšå
·ã衚èšãã
- ããããã¢ãŒã ïŒè¿è€ç§åŠæ ªåŒäŒç€Ÿ KXR-A5
- ãã€ã³ã³ïŒArduino Uno
- ã·ã£ã³ãæµæïŒ1Ω
- å·®åå¢å¹
åè·¯
- ãªãã¢ã³ãïŒTexas Instrument TLC-2274
- æµæ1: 1kΩ
- æµæ2: 2kΩ
- åé
ïŒ 50g, 100g
== å®é𿹿³
#figure(image("assets/å®éšåšå
·æ§æå³.png"), kind: image, caption: text("å®éšåšå
·æ§æå³"))
#pagebreak()
äžå³ã®ããã«çé»çŸ©æãæš¡ããããããã¢ãŒã ã®ãµãŒãã®3ã€ã䜿ããããããã®æ¶è²»é»åã黿µãèšæž¬ããããšã§æž¬å®ãããåãµãŒãã®æ¶è²»é»åã¯ããµãŒãã®é»æºã©ã€ã³ã«çŽåã«ã·ã£ã³ãæµæãæ¥ç¶ãããã®æµæã®å§ç«¯ãšçµç«¯ã®é»å§ãå·®åå¢å¹
åè·¯ãçšããããšã§ãã€ã³ã³ã«ã¢ããã°æ
å ±ãšããŠåãå
¥ããããããã«ããã\
èšæž¬ã«çšãããã€ã³ã³ã¯ãåãµãŒãã®åäœãæä»€ãããã€ã³ã³ãšåäžã®ãã®ãçšããããšã§ãµãŒãã®åäœéå§ãšã»ãšãã©åæã«èšæž¬ãéå§ãããããã«èšèšãããããã§ãµãŒãã®åäœéå§ãšèšæž¬éå§ãšãå®å
šã«åæã§ãªãã®ã¯ãä»å䜿çšãããã€ã³ã³ã§ã¯åæã«äžã€ã®ã¹ã¬ããããå®è¡ã§ããªãããå³å¯ã«ã¯æ°ã¯ããã¯åã ãåäœéå§ãšèšæž¬éå§ãšããããŠããŸãããã§ããã\
=== æé
æ¬ç ç©¶ã®å®éšã§ã¯äºã€ã®åäœãã¿ãŒã³ã®ããŒã¿ãããããã¢ãŒã ã«ä»å ããè² è·ãå€ããªããååŸããããšã§åäœãã¿ãŒã³ãšéãã®é¢ä¿æ§ã調ã¹ãããããã以äžã«ãã®æé ã瀺ãã
+ è² è·ããããªãç¶æ
ã§åäœïŒãå®è¡ãããã®éã®ã·ã£ã³ãæµæã«ãããé»å§ã358Hzã§1ç§éèšæž¬ãããããã8åç¹°ãè¿ããã
+ 1ãšåæ§ã®ããšããããããã¢ãŒã ã®å
端éšåã«50gã®åé
ãåãããç¶æ
ã§å®è¡ããã
+ 1ãšåæ§ã®ããšããããããã¢ãŒã ã®å
端éšåã«100gã®åé
ãåãããç¶æ
ã§å®è¡ããã
+ åäœ2ã§1ã3ãšåæ§ã®ããšãå®è¡ããã
== å®éšçµæ
ãã®å®éšãè¡ã£ãçµæãæ¬¡ã®å³ã«ç€ºããããªæ¶è²»é»åã®æç³»åå€åãèŠãããã
#pagebreak(weak: true)
#figure(image("assets/servo_data/motion1_1_servo2_0g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo2_50g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo2_100g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo3_0g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo3_50g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo3_100g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo5_0g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo5_50g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion1_1_servo5_100g.png", height: 12em), caption: text("åäœ1ïŒäžæïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo2_0g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo2_50g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo2_100g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo3_0g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo3_50g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo3_100g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo5_0g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo5_50g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion1_2_servo5_100g.png", height: 12em), caption: text("åäœ1ïŒäžéïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo2_0g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo2_50g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo2_100g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo3_0g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo3_50g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo3_100g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo5_0g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo5_50g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion2_1_servo5_100g.png", height: 12em), caption: text("åäœ2ïŒäžæïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo2_0g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo2_50g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo2_100g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã1ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo3_0g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo3_50g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo3_100g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã2ã®æ¶è²»é»åïŒè² è·100gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo5_0g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·0gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo5_50g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·50gïŒ"))
#figure(image("assets/servo_data/motion2_2_servo5_100g.png", height: 12em), caption: text("åäœ2ïŒäžéïŒã®éã®ãµãŒã3ã®æ¶è²»é»åïŒè² è·100gïŒ"))
= ãªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°
å®éšã§åŸãããäžå®ã®èŠåæ§ã®èªããããçµæãã¢ãã«åããããšã§ãå
¥åä¿¡å·ããåºåã®äºæž¬ãã§ããããã«ãªãããã®ããã®ææ³ã¯å€ãããå€ãèããããŠããããèšç®æ©ã®é«æ§èœåã«äŒŽãè¿å¹Žã§ã¯æ©æ¢°åŠç¿ãçšããææ³ãåºãç ç©¶ãããããã«ãªã£ããæ©æ¢°åŠç¿ãšå€§ããæ¬ã£ãŠããã®ãã¬ãŒã ã¯ãŒã¯ã«ã¯ããã€ãã®çš®é¡ããããããããã«åŸæãšããåéãååšãããäŸãã°Convolutional Neural Networkãçšããæ©æ¢°åŠç¿ã¯ç»åè§£æã«é©ããŠãããæç³»åããŒã¿ãæ±ãå Žé¢ã§æ¡çšãããããšã¯å°ãªããåæ§ã«Transformerã¯èªç¶èšèªåŠçã®åéã§ä»ãäž»æµãšãªã£ãŠããããç»ååŠçã«ã¯é©ããªãã\
== æŠèŠ
åç« ã§ã®çµæã§ã瀺ãããšãããæ¬ç ç©¶ã®åŠç¿å¯Ÿè±¡ã¯æç³»åå€åããä¿¡å·ãšãªã£ãŠããããããšæç³»åå€åããä¿¡å·ã®åŠç¿ã«é©ããææ³ãå¿
èŠãšãªã£ãŠããããã§ããããããã«ãããã®ãRecursive Neural Network (RNN)ãçšããæ©æ¢°åŠç¿ã§ããããããåŸæ¥åã®RNNã¯æšè«ãã§ãŒãºãšå®è¡ãã§ãŒãºãšãã«å€ãã®èšç®éãå¿
èŠãšããããã«åŠç¿ã®ããã«å€ãã®ããŒã¿æ°ãå¿
èŠãšããããšãç¥ãããŠãããåŠç¿ã¯ãšããããçé»çŸ©æãæäœããããã®èšç®æ©ã®åŠçèœåã§æšè«ããªã¢ã«ã¿ã€ã ã§è¡ãããããšãçæ³çã§ãããããåŸæ¥åã®RNNã®ãããªå€ãã®èšç®ãªãœãŒã¹ãå¿
èŠãšãããããªã¢ãã«ãæ¡çšããããšã¯å°é£ãšãªã£ãŠããŸãã@Reservoir-Computing \
ããã§ç»å Žããã®ããªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°ïŒRCïŒã§ãããRCã¯RNNã®äžçš®ã§ã¯ãããããã¥ãŒã©ã«ãããå±€ã®éã¿ã¥ãã¯è¡ããã«åºåå±€ïŒãªãŒãã¢ãŠãïŒã®éã¿ã¥ãã®ã¿ãåŠç¿ãããããšã§ã¢ãã«ã®æé©åãè¡ãããã®ææ³ãçšããããšã§ãå€ãã®ããŒã¿æ°ããªããšãååãªç²ŸåºŠãåŸãããåŠç¿ãã§ããããšãå
è¡ã®ç ç©¶ã§æããã«ãªã£ãŠãããæã
ã¯ä»åRCãçšããŠãµãŒãã®æ¶è²»é»åã®æ³¢åœ¢ãåŠç¿ãããç³»ã«ããã£ãŠããè² è·ãäºæž¬ããã¢ãã«ãäœæããã\
RCãçšããŠåŸãããçµæã¯
== è©äŸ¡æ¹æ³
ã¢ãã«ã®è©äŸ¡ã«ã¯Root Mean Squared Error (RMSE)ãšããææšãçšããã
=== RMSEïŒå¹³æ¹å¹³åäºä¹èª€å·®ïŒ
ã¢ãã«åºåãšç®æšåºåãå
±ã«é£ç¶å€ã§äžããããæç³»åäºæž¬ã¿ã¹ã¯ããæç³»åçæã¿ã¹ã¯ã®èª€å·®ãè©äŸ¡ããææšãšããŠRMSEãåºãçšããããã\
$ "RMSE" = sqrt(frac(1,T) sum_(n=1)^T norm(upright(bold(d))(n)-accent(upright(bold(y)), hat)(n) )^2_2) $
ãšå®çŸ©ããããããã¯ã¢ãã«åºåãšç®æšåºåã®éã®äºä¹èª€å·®ã®æéå¹³åã®å¹³æ¹æ ¹ã衚ããŠãããç®æšåºåããŒã¿ã®ç¹åŸŽãèæ
®ããŠããªãã®ã§ãç°ãªãããŒã¿ã«å¯ŸããRMSEã®å€ãæ¯èŒã«æå³ããªãç¹ã¯æ³šæãããã¹ãã§ããããŸããRMSEã¯ããŒã¿ãäºæž¬å€ã«å¹³åãã倧ããå€ããç°åžžå€ãå€ãå€ãå«ãŸããŠãããšããã®åœ±é¿ã倧ããåããããã @Reservoir-Computing
#pagebreak(weak: true)
= æ¶è²»é»åããè² è·ãåŠç¿
3ç« ã§ååŸããããŒã¿ã䜿ã£ãŠRCãçšããŠåŠç¿ãããããšã§ã3ã€ã®ãµãŒãã®æ¶è²»é»åããç³»ã«ãããè² è·ãå²ãåºãã¢ãã«ãäœæããã
ãŸããæ¶è²»é»åã®ã¿ãäžãããšããã§è² è·ãäºæž¬ããã¢ãã«ãäœæãããšããã§æ±çšæ§ã«æ¬ ãããšããäºæž¬ã®ããšã3ã€ã®ãµãŒãã®æ¶è²»é»åã®æç³»åããŒã¿ã®ã»ãã«ç¹åŸŽéãšããŠããããã®ãµãŒãã®åäœéå§ãšåäœçµäºè§åºŠããããŠèšå®ããå転é床ãäžããããšãšããããããã®æ
å ±ã¯ååŸã«åå¥ã®ã»ã³ãµãªã©ã®æ©æ§ãå¿
èŠãšãããµãŒãå¶åŸ¡çšãããªãã¡RCæšè«ã«ãçšãããã€ã³ã³äžã§ååŸå¯èœãªããŒã¿ã®äžããéžãã§ããç¹ã匷調ããã
== ããŒã¿ã®ååŠç
RCãçšããåŠç¿ãããããã«ã¯ãŸãããŒã¿ãåŠç¿ã«äœ¿çšãããã圢ã«ããå¿
èŠããããä»åã¯ãµãŒã3ã€ã®æ¶è²»é»åã®æç³»åå€åãšããç¹åŸŽéã«å ããŠããµãŒãããããã®åæè§åºŠãçµäºè§åºŠããããŠèšå®éåºŠãæšªäžŠã³ã«ããããšããŒã¿ãããããããããããŸããæåŸã«ã©ãã«ãšããŠæ©èœããè² è·ééãèšèŒããããšã§ãããã°ã©ã äžã§æåž«ã©ãã«ãšããŠæ±ãããã圢ã«ãããããã°ã©ã äžã§ã¯ããã48åã®ãã¡ã€ã«ã«åããå
šããŒã¿æ°ã48åãšãããã®ãã¡38åãèšç·ŽããŒã¿ãšããŠã10åãè©äŸ¡çšããŒã¿ãšããŠããŠäœ¿çšããŠããã
#pagebreak(weak: true)
#figure(image("assets/ååŠçããŒã¿.png"), caption: text("ãªã¶ããŒåŠç¿ã«ããããéã«çšããããŒã¿æ§é "), kind: table)
#pagebreak(weak: true)
== ãªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°ã®åçš®èšå®
å®ã¯RCã«ãããŸããŸãªæ¹æ³ãææ¡ãããŠãããEcho State Network (ESN), Liquid State Machine (LSM), FORCEãªã©ãäžè¬çã§ããããä»åã¯æãã·ã³ãã«ã§å®è£
ã®ç°¡åãªESNãæ¡çšããããšãšãããESNã¯Echo State Propertyãæºãããªã¶ããŒå±€ã«å
¥åãäžãããªãŒãã¢ãŠãã®éã¿ã¥ããç·åœ¢ååž°ãçšããŠåŠç¿ãããç¹ããéåžžã«ã·ã³ãã«ã§ããããRCã䜿çšããäžã§åºã䜿ãããŠããã@FORCE
=== ãªã¶ããŒå±€
ãªã¶ããŒå±€ã«ã¯ Leaky Integrator ã«ãã£ãŠæ§æããããã¥ãŒã©ã«ããããçšããããªãŒã¯çã¯1ããªã«ã¬ã³ãçµåéã¿è¡åã®ã¹ãã¯ãã«ååŸã¯0.95ãæŽ»æ§å颿°ã«ã¯ãã€ãããªãã¯ã¿ã³ãžã§ã³ããçšãããããŒãæ°ã¯ç¹åŸŽéã®æ°ãããååã«å€§ãã100ã«èšå®ããã @Intrinsic-Plasticity
// ==== é©åãªããŒãæ°ã®èª¿æ»
// ãªã¶ããŒå±€ã®ããŒãæ°ã¯åŠç¿ã®ç²ŸåºŠãšãã®é床ããããŠæšè«ãã§ãŒãºã§ã®éåºŠãæ±ºå®ããããéåžžã«éèŠãªãã©ã¡ãŒã¿ã§ãããæ¬ç ç©¶ã¯ãµãŒãã®æ¶è²»é»åããç³»ã«ããã£ãŠããè² è·ãæšè«ã§ããããšããã³ã³ã»ããã®å®èšŒãæ¬é¡ã§ã¯ããããçé»çŸ©æã§äœ¿çšããã«ããã£ãŠååã«å°ãªãããŒãæ°ã§æšè«ã§ããªããã°å®è¡ã¹ããŒããããã«ããã¯ãšãªã£ãŠããŸããããã§æ¬¡ã®ãããªå®éšãè¡ãããšã§ä»åã®ããŒã¿ã«é©åãªããŒãæ°ã調æ»ããã
// ===== å®é𿹿³
// ãªã¶ããŒå±€ã®ããŒãæ°ã5ãã100ã«å€åãããæã®RMSEã®å€ãæ¯èŒããããã ãã48åã®ããŒã¿ã8察2ã®å²åã§åŠç¿çšãšè©äŸ¡çšã®ããŒã¿ã«ã©ã³ãã ã«åããŠããåŠç¿ãšè©äŸ¡ãè¡ãããã«ããŠãããããå®è¡ããšã«çµæãå€ãã£ãŠããããã®å€åãéã¿ãŠæ¯èŒããããã«ããããã®ããŒãæ°ã§1000åã®åŠç¿ãšè©äŸ¡ãè¡ãããã®RMSEã®å¹³åããšã£ãããã®RMSEã®å¹³åãšãªã¶ããŒå±€ã®ããŒãæ°ãšã®é¢ä¿ã次ã®å³ã®éãã§ããã
// ===== å®éšçµæ
// #figure(image("assets/node_vs_rmse.png"), caption: text("RMSEã®å¹³åã®ããŒãæ°ãšã®äŸåé¢ä¿"))
// #pagebreak(weak: true)
// 48åã®ããŒã¿ã8察2ã®å²åã§åããŠããããåŠç¿çšã®ããŒã¿ã¯38åã§ããããã®å³ããèŠãŠåããéããããŒãæ°ã38åã«è¿ã¥ãã«ã€ããŠRMSEãæ¥æ¿ã«å¢å ããŠãããããããé¢ããã«ã€ããŠæžã£ãŠããããšãããã£ãããã®çŸè±¡ã¯double descentãšåŒã°ããŠããã @double-descent
// ===== èå¯
// ãã®å®éšãããèšå®ãã¹ãããŒãæ°ã¯åŠç¿çšããŒã¿ã®ããŒã¿é·ããã倧ããããããšãRCåŠç¿ã«ã¯é©ããŠããããšãããã£ãã
=== ãªãŒãã¢ãŠãå±€
次ã«ãªãŒãã¢ãŠãå±€ã®éã¿ã¥ãã®åŠç¿æ¹æ³ã«ã€ããŠèª¬æãããä»åã¯ESNãçšããããç·åœ¢ååž°ã§ã®éã¿ã¥ãåŠç¿ãè¡ã£ãã®ã ããå€ãå€ã®åœ±é¿ãå¿
èŠä»¥äžã«å€§ããããããšãé¿ããããã«Ridgeååž°ãçšãããæ£ååãã©ã¡ãŒã¿ã¯ $1.0 times 10^(-3)$ã«èšå®ããã @Ridge
== åŠç¿çµæ
以äžããã®åŠç¿ãè¡ã£ãçµæã§ããã
#figure(align(left, (image("assets/training_set_predictions_rmse_36.05610294846806.png", width: 180%))), caption: text("æšè«ã¢ãã«ã§åŠç¿ããŒã¿ã»ããã®äºæž¬ããããçµæ"))
#pagebreak(weak: true)
#figure(align(left, (image("assets/test_set_predictions_rmse_30.560928118691546.png", width: 180%))), caption: text("æšè«ã¢ãã«ã§è©äŸ¡ããŒã¿ã»ããã®äºæž¬ããããçµæ"))
#pagebreak(weak: true)
== èå¯
åŠç¿çšããŒã¿ãçšããŠã®è©äŸ¡äžŠã³ã«è©äŸ¡çšããŒã¿ãçšããŠã®æšè«ã®RMSEã¯ã©ã¡ãã30ãè¶
ãããã®ãšãªã£ãããŸããäž¡è
ã«ãããŠäºæž¬å€ãšå®éã®å€ã®å·®ã倧ããããšãèŠãŠåãããããã¯åŠç¿ææ³èªäœãäžååãªãã®ã§ããããšãåå ãšèãããããäžçªã®ç¹çãã¹ãç¹ãšããŠã¯ééãªãã®åŠç¿ããŒã¿ãšéé50gããããŠ100gã®ããŒã¿ãšã§ã¯ããŒã¿ã®æ°ã¯åãã§ããã«ãããããããæšè«ã®çµæ0gä»è¿ãã»ãšãã©äºæž¬ã§ããŠããªãç¹ã§ãããããã¯åŠç¿ææ³ã«èª€ãããã£ãããšã瀺ããŠãããšèããããã
#pagebreak(weak: true)
= ãŸãšã
çé»çŸ©æã®æäœæ§åäžã«å¿
èŠãšãªã£ãŠããåèŠã®æ€ç¥ãè¡ãæ¹æ³ãšããŠã矩æå
ã«æèŒãããããšã®å€ããµãŒãã®æ¶è²»é»åãçšããææ³ã®åŠ¥åœæ§ã«ã€ããŠæ€èšãããçé»çŸ©æã«ããããµãŒããšããã®ã¯çäœã«ãããçèã®ããã«ãäœçœ®ãç§»åãããèœåãæã¡ãªããå€åãå ããããéã«ãã®å€§ããã«å¯Ÿå¿ããåå¿ã瀺ãããã®é¡äŒŒæ§ã¯æ¥é ã®æèŠãšããŠã¯èª°ãããæ°ã¥ãäœå°ãããã®ã§ã¯ãããæ¬ç ç©¶ãéããŠãã®é¡äŒŒæ§ã瀺ãããšãã§ããã確èªã®ããã®å®éšãéããããææãªé¡äŒŒæ§ã瀺ãã«ã¯è³ããªãã£ãã\
ãããçŸæç¹ã§ææ³èªäœãééã£ãŠãããšçµè«ã¥ããããšã¯ã§ããªããããŒã¿ã®äžãæ¹ããªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°ã®å®è£
ãèšå®ã®æšæ²ãéããããšã§ãæ¬æ¥è¡ãããã£ãå®éšã®çµæãåŸãããå¯èœæ§ã¯å€§ãã«æ®ã£ãŠãããšèããããã
#set heading(numbering: none)
= è¬èŸ
æ¬ç ç©¶ãé²ããã«ããããå€å€§ãªãæå°ããå©èšãé ããèè¥¿èª ä¹ææãã¯ãããšããå·¥åŠéšæ
å ±ãšã¬ã¯ãããã¯ã¹åŠç§éåç¥èœããã€ã¹ç ç©¶å®€ã®æ§æå¡ã®çæ§ã«æ·±è¬ã®æã衚ããŸããåžžã«æ¥œãããããšå èœã®æ¹åãžåããç§ã«åŠ¥åãèš±ããç éœã®æ¥ã
ãä¿ããŠäžãã£ãè西ææã¯ãã¡ããããèªèº«ãä¿®å£«è«æç ç©¶ãåŠäŒçºè¡šãå°±è·æŽ»åçã§ãå¿ããã«ãé¢ãããé²ãã§ç ç©¶å
容ãçºè¡šè³æã®æ ¡é²ãç確ãªå©èšããã ãã£ã修士2幎åç°èæ°ã修士1幎æŸç°äžåžæ°ã«æ·±è¬ã®æã衚ããŸãããŸããæ¥é ãããæå°ããæèŠãé ãããéåéç©ãšã¬ã¯ãããã¯ã¹ç ç©¶ã»ã³ã¿ãŒé·ã§ããããæ¬ä¹
é äžææãå
é²ããé»åææç 究宀ã®ç³å·å²å€ªéææãåçäºéåææãéåç¥èœããã€ã¹ç 究宀ã®äœè€åšååææãæ©èœéä¿¡ã»ã³ã·ã³ã°ç ç©¶å®€ã®æ± 蟺å°ä¹ææã赀柀æ£éåææãéç©é»åããã€ã¹ç 究宀ã®åšå²¡å
åºåææã«æ·±ãæè¬èŽããŸãã
#heading(numbering: none, text("Appendix"))
以äžã«RCã§åŠç¿ãè¡ã£ãéã«çšããã³ãŒãã瀺ãã
```python
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import japanize_matplotlib
from sklearn.model_selection import train_test_split
import model
BASE_PATH: str = "data/"
file_011_name: str = "0g_1_1.csv"
file_012_name: str = "0g_1_2.csv"
file_013_name: str = "0g_1_3.csv"
file_014_name: str = "0g_1_4.csv"
file_015_name: str = "0g_1_5.csv"
file_016_name: str = "0g_1_6.csv"
file_017_name: str = "0g_1_7.csv"
file_018_name: str = "0g_1_8.csv"
file_021_name: str = "0g_2_1.csv"
file_022_name: str = "0g_2_2.csv"
file_023_name: str = "0g_2_3.csv"
file_024_name: str = "0g_2_4.csv"
file_025_name: str = "0g_2_5.csv"
file_026_name: str = "0g_2_6.csv"
file_027_name: str = "0g_2_7.csv"
file_028_name: str = "0g_2_8.csv"
file_5011_name: str = "50g_1_1.csv"
file_5012_name: str = "50g_1_2.csv"
file_5013_name: str = "50g_1_3.csv"
file_5014_name: str = "50g_1_4.csv"
file_5015_name: str = "50g_1_5.csv"
file_5016_name: str = "50g_1_6.csv"
file_5017_name: str = "50g_1_7.csv"
file_5018_name: str = "50g_1_8.csv"
file_5021_name: str = "50g_2_1.csv"
file_5022_name: str = "50g_2_2.csv"
file_5023_name: str = "50g_2_3.csv"
file_5024_name: str = "50g_2_4.csv"
file_5025_name: str = "50g_2_5.csv"
file_5026_name: str = "50g_2_6.csv"
file_5027_name: str = "50g_2_7.csv"
file_5028_name: str = "50g_2_8.csv"
file_10011_name: str = "100g_1_1.csv"
file_10012_name: str = "100g_1_2.csv"
file_10013_name: str = "100g_1_3.csv"
file_10014_name: str = "100g_1_4.csv"
file_10015_name: str = "100g_1_5.csv"
file_10016_name: str = "100g_1_6.csv"
file_10017_name: str = "100g_1_7.csv"
file_10018_name: str = "100g_1_8.csv"
file_10021_name: str = "100g_2_1.csv"
file_10022_name: str = "100g_2_2.csv"
file_10023_name: str = "100g_2_3.csv"
file_10024_name: str = "100g_2_4.csv"
file_10025_name: str = "100g_2_5.csv"
file_10026_name: str = "100g_2_6.csv"
file_10027_name: str = "100g_2_7.csv"
file_10028_name: str = "100g_2_8.csv"
def convert_data_frames_to_numpys(
data_frames: list[pd.DataFrame],
) -> np.ndarray[np.float64]:
# ããããã空ã®ãªã¹ããäœæããŠãã
new_data = np.empty(
(len(data_frames), data_frames[0].columns.size, data_frames[0].shape[0]),
dtype=np.float64,
)
for i in range(len(data_frames)):
for j in range(data_frames[i].columns.size):
new_data[i][j] = data_frames[i][j].values
return new_data
def get_merged_matrix(
list_of_files: list[str],
) -> tuple[np.ndarray[np.float64], np.ndarray[np.float64]]:
data_frames = [
pd.read_csv(BASE_PATH + file, header=None, skiprows=1) for file in list_of_files
]
training_frames, testing_frames = train_test_split(data_frames, test_size=0.2)
train_data_set = convert_data_frames_to_numpys(training_frames)
test_data_set = convert_data_frames_to_numpys(testing_frames)
return train_data_set, test_data_set
train_data, test_data = get_merged_matrix(
[
file_011_name,
file_012_name,
file_013_name,
file_014_name,
file_015_name,
file_016_name,
file_017_name,
file_018_name,
file_021_name,
file_022_name,
file_023_name,
file_024_name,
file_025_name,
file_026_name,
file_027_name,
file_028_name,
file_5011_name,
file_5012_name,
file_5013_name,
file_5014_name,
file_5015_name,
file_5016_name,
file_5017_name,
file_5018_name,
file_5021_name,
file_5022_name,
file_5023_name,
file_5024_name,
file_5025_name,
file_5026_name,
file_5027_name,
file_5028_name,
file_10011_name,
file_10012_name,
file_10013_name,
file_10014_name,
file_10015_name,
file_10016_name,
file_10017_name,
file_10018_name,
file_10021_name,
file_10022_name,
file_10023_name,
file_10024_name,
file_10025_name,
file_10026_name,
file_10027_name,
file_10028_name,
]
)
# Extract the load data from the training set. the last arrays of every set are the repeated load data. pick the first one of the last arrays and make it the load data
train_load: np.ndarray[np.float64] = np.array(
[train_data[i][-1][0] for i in range(len(train_data))], dtype=np.float64
)
test_load: np.ndarray[np.float64] = np.array(
[test_data[i][-1][0] for i in range(len(test_data))], dtype=np.float64
)
# erase the last arrays of every set to make the training data does not include load data at the end
# and transpose the data to make it compatible with the ESN model
train_data = train_data[:, :-1, :].transpose(0, 2, 1)
test_data = test_data[:, :-1, :].transpose(0, 2, 1)
# Reshape the load data to make it compatible with the RMSE calculation that is for example, (38,) to (38,358)
train_load_reshaped = np.tile(train_load, (train_data.shape[1], 1)).T.reshape(-1, 1)
test_load_reshaped = np.tile(test_load, (test_data.shape[1], 1)).T.reshape(-1, 1)
# Initialize the ESN model
input_size = train_data.shape[1] # Number of data points in each sample
reservoir_size = 100 # Size of the reservoir
output_size = 1 # Predicting a single value (Load)
esn = model.ESN(N_u=input_size, N_y=output_size, N_x=reservoir_size)
# Train the ESN model
esn.train(
train_data,
train_load,
model.Tikhonov(N_x=reservoir_size, N_y=output_size, beta=1e-3),
)
# Predict using the trained model (for demonstration, use the training data itself)
train_predictions: np.ndarray[float] = esn.predict(train_data)
# Evaluate the model by computing the mean squared error on the training data
train_rmse: float = np.sqrt(((train_predictions - train_load_reshaped) ** 2).mean())
# Predict using the trained model
test_predictions: np.ndarray[float] = esn.predict(test_data)
# Evaluate the model by computing the mean squared error on the training data
test_rmse: float = np.sqrt(((test_predictions - test_load_reshaped) ** 2).mean())
print("Training RMSE: ", train_rmse)
flattened_predictions = test_predictions.flatten()
plt.figure(figsize=(12, 6))
plt.subplot(1, 2, 1)
plt.scatter(
x=range(len(train_load_reshaped)), y=train_load_reshaped, label="å®éã®è³ªé", alpha=0.6
)
plt.scatter(
x=range(len(train_predictions)), y=train_predictions, label="æšè«å€", alpha=0.6
)
plt.title("åŠç¿ããŒã¿ã»ããã§ã®æšè«")
plt.xlabel("詊è¡")
plt.ylabel("è² è·è³ªéã»æšè«å€ (g)")
plt.legend()
plt.tight_layout()
plt.savefig(f'saved_graphs/training_set_predictions_rmse_{train_rmse}.png')
plt.show()
print("Test RMSE: ", test_rmse)
plt.figure(figsize=(12, 6))
plt.subplot(1, 2, 1)
plt.scatter(
x=range(len(test_load_reshaped)), y=test_load_reshaped, label="å®éã®è³ªé", alpha=0.6
)
plt.scatter(
x=range(len(test_predictions)), y=test_predictions, label="æšè«å€", alpha=0.6
)
plt.title("ãã¹ãããŒã¿ã»ããã§ã®æšè«")
plt.xlabel("詊è¡")
plt.ylabel("è² è·è³ªéã»æšè«å€ (g)")
plt.legend()
plt.tight_layout()
plt.savefig(f'saved_graphs/test_set_predictions_rmse_{test_rmse}.png')
plt.show()
```
#pagebreak()
以äžã«ãªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°ã®ã¢ãã«ã瀺ãããã ããããã¯ç°äžïŒäžæ ¹ïŒå»£ç¬ïŒèïŒããªã¶ããŒã³ã³ãã¥ãŒãã£ã³ã°ãïŒæ£®ååºçïŒå
ã«èšèŒãããŠããã³ãŒããäžéšæ¹å€ãããã®ã§ãããæ¬ãœãŒã¹ã³ãŒãã®èäœæš©ã¯ç°äžåå¹³å
çã«åž°å±ããããšãæèšããŠããã
```python
import numpy as np
import networkx as nx
# æçåå
def identity(x):
return x
# ãªã¶ããŒ
class Reservoir:
# ãªã«ã¬ã³ãçµåéã¿è¡åWã®åæå
def __init__(self, N_x, density, rho, activation_func, leaking_rate, seed=0):
"""
param N_x: ãªã¶ããŒã®ããŒãæ°
param density: ãããã¯ãŒã¯ã®çµåå¯åºŠ
param rho: ãªã«ã¬ã³ãçµåéã¿è¡åã®ã¹ãã¯ãã«ååŸ
param activation_func: ããŒãã®æŽ»æ§å颿°
param leaking_rate: leaky integratorã¢ãã«ã®ãªãŒã¯ç
param seed: ä¹±æ°ã®çš®
"""
self.seed = seed
self.W = self.make_connection(N_x, density, rho)
self.x = np.zeros(N_x) # ãªã¶ããŒç¶æ
ãã¯ãã«ã®åæå
self.activation_func = activation_func
self.alpha = leaking_rate
# ãªã«ã¬ã³ãçµåéã¿è¡åã®çæ
def make_connection(self, N_x, density, rho):
# Erdos-Renyiã©ã³ãã ã°ã©ã
m = int(N_x * (N_x - 1) * density / 2) # ç·çµåæ°
G = nx.gnm_random_graph(N_x, m, self.seed)
# è¡åãžã®å€æ(çµåæ§é ã®ã¿ïŒ
connection = nx.DiGraph(G)
W = np.array(connection)
# éãŒãèŠçŽ ãäžæ§ååžã«åŸãä¹±æ°ãšããŠçæ
rec_scale = 1.0
np.random.seed(seed=self.seed)
W = W * np.random.uniform(-rec_scale, rec_scale, (N_x, N_x))
# ã¹ãã¯ãã«ååŸã®èšç®
eigv_list = np.linalg.eig(W)[0]
sp_radius = np.max(np.abs(eigv_list))
# æå®ã®ã¹ãã¯ãã«ååŸrhoã«åãããŠã¹ã±ãŒãªã³ã°
W *= rho / sp_radius
return W
# ãªã¶ããŒç¶æ
ãã¯ãã«ã®æŽæ°
def __call__(self, x_in: np.ndarray):
"""
param x_in: æŽæ°åã®ç¶æ
ãã¯ãã«
return: æŽæ°åŸã®ç¶æ
ãã¯ãã«
"""
# self.x = self.x.reshape(-1, 1)
self.x = (1.0 - self.alpha) * self.x + self.alpha * self.activation_func(
np.dot(self.W, self.x)
+ x_in # self.x 㯠reservoir ã®ããŒãæ° (N_x) ã®æ¬¡å
ãæã€ãã¯ãã«ãªã®ã§ãnp.dot(self.W, self.x) ã¯å¿
ã (N_x,) ã®ãã¯ãã«ã«ãªãã
)
return self.x
# ãªã¶ããŒç¶æ
ãã¯ãã«ã®åæå
def reset_reservoir_state(self):
self.x *= 0.0
# åºåå±€
class Output:
# åºåçµåéã¿è¡åã®åæå
def __init__(self, N_x, N_y, seed=0):
"""
param N_x: ãªã¶ããŒã®ããŒãæ°
param N_y: åºå次å
param seed: ä¹±æ°ã®çš®
"""
# æ£èŠååžã«åŸãä¹±æ°
np.random.seed(seed=seed)
self.Wout = np.random.normal(size=(N_y, N_x))
# åºåçµåéã¿è¡åã«ããéã¿ã¥ã
def __call__(self, x):
"""
param x: N_x次å
ã®ãã¯ãã«
return: N_y次å
ã®ãã¯ãã«
"""
return np.dot(self.Wout, x)
# åŠç¿æžã¿ã®åºåçµåéã¿è¡åãèšå®
def setweight(self, Wout_opt):
self.Wout = Wout_opt
# åºåãã£ãŒãããã¯
class Feedback:
# ãã£ãŒãããã¯çµåéã¿è¡åã®åæå
def __init__(self, N_y, N_x, fb_scale, seed=0):
"""
param N_y: åºå次å
param N_x: ãªã¶ããŒã®ããŒãæ°
param fb_scale: ãã£ãŒãããã¯ã¹ã±ãŒãªã³ã°
param seed: ä¹±æ°ã®çš®
"""
# äžæ§ååžã«åŸãä¹±æ°
np.random.seed(seed=seed)
self.Wfb = np.random.uniform(-fb_scale, fb_scale, (N_x, N_y))
# ãã£ãŒãããã¯çµåéã¿è¡åã«ããéã¿ã¥ã
def __call__(self, y):
"""
param y: N_y次å
ã®ãã¯ãã«
return: N_x次å
ã®ãã¯ãã«
"""
return np.dot(self.Wfb, y)
# ãªããžååž°ïŒbeta=0ã®ãšãã¯ç·åœ¢ååž°ïŒ
class Tikhonov:
def __init__(self, N_x, N_y, beta):
"""
param N_x: ãªã¶ããŒã®ããŒãæ°
param N_y: åºå次å
param beta: æ£ååãã©ã¡ãŒã¿
"""
self.beta = beta
self.X_XT = np.zeros((N_x, N_x))
self.D_XT = np.zeros((N_y, N_x))
self.N_x = N_x
# åŠç¿çšã®è¡åã®æŽæ°
def __call__(self, d, x):
d = np.reshape(d, (-1, 1))
x = np.reshape(x, (-1, 1))
self.X_XT = self.X_XT + np.dot(x, x.T)
self.D_XT = self.D_XT + np.dot(d, x.T)
# Woutã®æé©è§£ïŒè¿äŒŒè§£ïŒã®å°åº
def get_Wout_opt(self):
X_pseudo_inv = np.linalg.inv(self.X_XT + self.beta * np.identity(self.N_x))
Wout_opt = np.dot(self.D_XT, X_pseudo_inv)
return Wout_opt
# 鿬¡æå°äºä¹ïŒRLSïŒæ³
class RLS:
def __init__(self, N_x, N_y, delta, lam, update):
"""
param N_x: ãªã¶ããŒã®ããŒãæ°
param N_y: åºå次å
param delta: è¡åPã®åææ¡ä»¶ã®ä¿æ°ïŒP=delta*I, 0<delta<<1ïŒ
param lam: å¿åŽä¿æ° (0<lam<1, 1ã«è¿ãå€)
param update: åæå»ã§ã®æŽæ°ç¹°ãè¿ãåæ°
"""
self.delta = delta
self.lam = lam
self.update = update
self.P = (1.0 / self.delta) * np.eye(N_x, N_x)
self.Wout = np.zeros([N_y, N_x])
# Woutã®æŽæ°
def __call__(self, d, x):
x = np.reshape(x, (-1, 1))
for i in np.arange(self.update):
v = d - np.dot(self.Wout, x)
gain = 1 / self.lam * np.dot(self.P, x)
gain = gain / (1 + 1 / self.lam * np.dot(np.dot(x.T, self.P), x))
self.P = 1 / self.lam * (self.P - np.dot(np.dot(gain, x.T), self.P))
self.Wout += np.dot(v, gain.T)
return self.Wout
# ãšã³ãŒã¹ããŒããããã¯ãŒã¯
class ESN:
# åå±€ã®åæå
def __init__(
self,
N_u,
N_y,
N_x,
density=0.05,
input_scale=1.0,
rho=0.95,
activation_func=np.tanh,
fb_scale=None,
fb_seed=0,
noise_level=None,
leaking_rate=1.0,
output_func=identity,
inv_output_func=identity,
classification=False,
average_window=None,
):
"""
param N_u: å
¥å次å
param N_y: åºå次å
param N_x: ãªã¶ããŒã®ããŒãæ°
param density: ãªã¶ããŒã®ãããã¯ãŒã¯çµåå¯åºŠ
param input_scale: å
¥åã¹ã±ãŒãªã³ã°
param rho: ãªã«ã¬ã³ãçµåéã¿è¡åã®ã¹ãã¯ãã«ååŸ
param activation_func: ãªã¶ããŒããŒãã®æŽ»æ§å颿°
param fb_scale: ãã£ãŒãããã¯ã¹ã±ãŒãªã³ã°ïŒdefault: NoneïŒ
param fb_seed: ãã£ãŒãããã¯çµåéã¿è¡åçæã«äœ¿ãä¹±æ°ã®çš®
param leaking_rate: leaky integratorã¢ãã«ã®ãªãŒã¯ç
param output_func: åºåå±€ã®éç·åœ¢é¢æ°ïŒdefault: æçååïŒ
param inv_output_func: output_funcã®é颿°
param classification: åé¡åé¡ã®å Žåã¯TrueïŒdefault: FalseïŒ
param average_window: åé¡åé¡ã§åºåå¹³åããçªå¹
ïŒdefault: NoneïŒ
"""
# self.Input = Input(N_u, N_x, input_scale)
self.Reservoir = Reservoir(N_x, density, rho, activation_func, leaking_rate)
self.Output = Output(N_x, N_y)
self.N_u = N_u
self.N_y = N_y
self.N_x = N_x
self.y_prev = np.zeros(N_y)
self.output_func = output_func
self.inv_output_func = inv_output_func
self.classification = classification
# åºåå±€ããã®ãªã¶ããŒãžã®ãã£ãŒãããã¯ã®æç¡
if fb_scale is None:
self.Feedback = None
else:
self.Feedback = Feedback(N_y, N_x, fb_scale, fb_seed)
# ãªã¶ããŒã®ç¶æ
æŽæ°ããããã€ãºã®æç¡
if noise_level is None:
self.noise = None
else:
np.random.seed(seed=0)
self.noise = np.random.uniform(-noise_level, noise_level, (self.N_x, 1))
# åé¡åé¡ãåŠã
if classification:
if average_window is None:
raise ValueError("Window for time average is not given!")
else:
self.window = np.zeros((average_window, N_x))
# ãããåŠç¿
def train(self, U, D, optimizer, trans_len=None):
"""
U: æåž«ããŒã¿ã®å
¥å, ããŒã¿é·ÃN_u
D: æåž«ããŒã¿ã®åºå, ããŒã¿é·ÃN_y
optimizer: åŠç¿åš
trans_len: éæž¡æã®é·ã
return: åŠç¿åã®ã¢ãã«åºå, ããŒã¿é·ÃN_y
"""
train_len = len(U)
if trans_len is None:
trans_len = 0
Y = []
# æéçºå±
for n in range(train_len):
for m in range(len(U[1])): # ããŒã¿æ°ã ãã«ãŒãããã
# x_in = self.Input(U[n])
# TODO: x_in ã®å€§ãã > ãªã¶ããŒã®ããŒãæ°(N_x) ã®å Žåã®åŠçã远å ãã
x_in = np.zeros(self.N_x)
x_temp = U[n][m]
x_in[: len(U[n][m])] = x_temp
# ãã£ãŒãããã¯çµå
if self.Feedback is not None:
x_back = self.Feedback(self.y_prev)
x_in = x_in + x_back
# ãã€ãº
if self.noise is not None:
x_in += self.noise
# ãªã¶ããŒç¶æ
ãã¯ãã«
x = self.Reservoir(x_in)
# åé¡åé¡ã®å Žåã¯çªå¹
åã®å¹³åãååŸ
if self.classification:
self.window = np.append(self.window, x.reshape(1, -1), axis=0)
self.window = np.delete(self.window, 0, 0)
x = np.average(self.window, axis=0)
# ç®æšå€
d = D[n]
d = self.inv_output_func(d)
# åŠç¿åš
if n > trans_len: # éæž¡æãéããã
optimizer(d, x)
# åŠç¿åã®ã¢ãã«åºå
y = self.Output(x)
Y.append(self.output_func(y))
self.y_prev = d
# åŠç¿æžã¿ã®åºåçµåéã¿è¡åãèšå®
self.Output.setweight(optimizer.get_Wout_opt())
# ã¢ãã«åºåïŒåŠç¿åïŒ
return np.array(Y)
# ãããåŠç¿åŸã®äºæž¬
def predict(self, U):
test_len = len(U)
Y_pred = []
# æéçºå±
for n in range(test_len):
for m in range(len(U[1])): # ããŒã¿æ°ã ãã«ãŒãããã
# x_in = self.Input(U[n])
# TODO: x_in ã®å€§ãã > ãªã¶ããŒã®ããŒãæ°(N_x) ã®å Žåã®åŠçã远å ãã
x_in = np.zeros(self.N_x)
x_temp = U[n][m]
x_in[: len(U[n][m])] = x_temp
# ãã£ãŒãããã¯çµå
if self.Feedback is not None:
x_back = self.Feedback(self.y_prev)
x_in += x_back
# ãªã¶ããŒç¶æ
ãã¯ãã«
x = self.Reservoir(x_in)
# åé¡åé¡ã®å Žåã¯çªå¹
åã®å¹³åãååŸ
if self.classification:
self.window = np.append(self.window, x.reshape(1, -1), axis=0)
self.window = np.delete(self.window, 0, 0)
x = np.average(self.window, axis=0)
# åŠç¿åŸã®ã¢ãã«åºå
y_pred = self.Output(x)
Y_pred.append(self.output_func(y_pred))
self.y_prev = y_pred
# ã¢ãã«åºåïŒåŠç¿åŸïŒ
return np.array(Y_pred)
```
#[
#set text(lang: "en")
#bibliography("bibliography/bib.yaml", title: text(bibliographyTitleJa), style: "institute-of-electrical-and-electronics-engineers")
]
|
|
https://github.com/HPDell/typst-slides-uob | https://raw.githubusercontent.com/HPDell/typst-slides-uob/main/README.md | markdown | # Slides with Theme University of Bristol in Typst
This is a template for creating slides with the theme of the University of Bristol in Typst.
## Functions
```typ
#let slides(
title: "",
authors: (),
date: datetime.today(),
short-title: "",
body
)
```
This function changes page, text and layout settings to prepare for slides.
```typ
#let slide(body, subtitle: [])
```
This function creates a slide and can append a subtitle after its title.
Its title is specified in the nearest former level-3 headings, i.e., headings of marker `===`.
```typ
#let empty(content)
```
This function creates an empty slide.
```typ
#let leaflet(content, title: [])
```
This function creates a block area with a header and body, which looks like the `\block{}` command in Beamer.
As the name `block` has been taken by Typst itself, it is named to `leaflet` instead.
## Syntax Maps
Headings are translated into specific parts:
- The level-1 and level-2 headings are mapped to the section page and the subsection page.
- The level-3 headings are stored as slide titles and hidden. They only show up once the `#slide` is called to create a new slide.
## Example
[](./example.pdf)
|
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/model/heading.typ | typst | // Test headings.
--- heading-basic ---
// Different number of equals signs.
= Level 1
== Level 2
=== Level 3
// After three, it stops shrinking.
=========== Level 11
--- heading-syntax-at-start ---
// Heading vs. no heading.
// Parsed as headings if at start of the context.
/**/ = Level 1
#[== Level 2]
#box[=== Level 3]
// Not at the start of the context.
No = heading
// Escaped.
\= No heading
--- heading-block ---
// Blocks can continue the heading.
= #[This
is
multiline.
]
= This
is not.
--- heading-show-where ---
// Test styling.
#show heading.where(level: 5): it => block(
text(font: "Roboto", fill: eastern, it.body + [!])
)
= Heading
===== Heading ð
#heading(level: 5)[Heading]
--- heading-offset ---
// Test setting the starting offset.
#set heading(numbering: "1.1")
#show heading.where(level: 2): set text(blue)
= Level 1
#heading(depth: 1)[We're twins]
#heading(level: 1)[We're twins]
== Real level 2
#set heading(offset: 1)
= Fake level 2
== Fake level 3
--- heading-offset-and-level ---
// Passing level directly still overrides all other set values
#set heading(numbering: "1.1", offset: 1)
#heading(level: 1)[Still level 1]
--- heading-syntax-edge-cases ---
// Edge cases.
#set heading(numbering: "1.")
=
Not in heading
=Nope
--- heading-numbering-hint ---
= Heading <intro>
// Error: 1:19-1:25 cannot reference heading without numbering
// Hint: 1:19-1:25 you can enable heading numbering with `#set heading(numbering: "1.")`
Cannot be used as @intro
|
|
https://github.com/sses7757/sustech-graduated-thesis | https://raw.githubusercontent.com/sses7757/sustech-graduated-thesis/main/test-eq.typ | typst | Apache License 2.0 | #import "sustech-graduated-thesis/utils/multi-line-equate.typ": equate, equate-ref
#set text(lang: "en")
#set heading(numbering: "1.1")
#show heading: it => {
counter(math.equation).update(0)
it
}
#show math.equation: equate.with(debug: true)
#show ref: equate-ref
#set math.equation(numbering: "(1.1.a)")
= Heading
#context counter(math.equation).get()
Simple
$
O(n/t) = 1
$ <->
#context counter(math.equation).get()
Simple 2
$
O(n/t) = 1
$ <simple2>
#context counter(math.equation).get()
@eqt:simple2
Test
$
F_n &= P(n) \
&= floor(1 / sqrt(5) phi.alt^n). #<test2>
$ <test>
#context counter(math.equation).get()
@eqt:test, @eqt:test-test2
Test no label
$
F_n &= P(n) \
&= floor(1 / sqrt(5) phi.alt^n).
$ <->
#context counter(math.equation).get()
$
F_n &= P(n) \
&= floor(1 / sqrt(5) phi.alt^n). #<specific>
$ <->
#context counter(math.equation).get()
@eqt:specific
$
F_n &= P(n) #<new1> \
&= floor(1 / sqrt(5) phi.alt^n). #<new2>
$ <->
#context counter(math.equation).get()
@eqt:new1, @eqt:new2
#pagebreak()
= Heading
#context counter(math.equation).get()
Simple
$
O(n/t) = 1
$ <->
#context counter(math.equation).get()
Simple 2
$
O(n/t) = 1
$ <2-simple2>
#context counter(math.equation).get()
@eqt:2-simple2
Test
$
F_n &= P(n) \
&= floor(1 / sqrt(5) phi.alt^n). #<test2>
$ <2-test>
#context counter(math.equation).get()
@eqt:2-test, @eqt:2-test-test2
Test no label
$
F_n &= P(n) \
&= floor(1 / sqrt(5) phi.alt^n).
$ <->
#context counter(math.equation).get()
$
F_n &= P(n) #<2-specific> \
&= floor(1 / sqrt(5) phi.alt^n).
$ <->
#context counter(math.equation).get()
@eqt:2-specific
$
F_n &= P(n) #<2-new1> \
&= floor(1 / sqrt(5) phi.alt^n). #<2-new2>
$ <->
#context counter(math.equation).get()
@eqt:2-new1, @eqt:2-new2
|
https://github.com/gongke6642/tuling | https://raw.githubusercontent.com/gongke6642/tuling/main/åºç¡/array/array.typ | typst | #set par(
justify: true,
leading: 0.52em,
)
= array
=
#image("1.png", width: 100%)
#image("2.png")
#image("3.png")
#image("4.png")
#image("5.png")
#image("6.png")
#image("7.png")
#image("8.png")
#image("9.png")
#image("10.png")
#image("11.png")
#image("12.png")
#image("13.png") |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.