repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/arran4/resume | https://raw.githubusercontent.com/arran4/resume/main/README.md | markdown | # <NAME> Resume
This is my attempt at a public resume / cv. An unabridged version, abridged versions might be discoverable in snapshots. If you have any suggestions, issues, and the like please raise an issue or a PR. Why else would I do this in git.
You can download the latest compiled version (in PDF form) from:
https://github.com/arran4/resume/releases
Or build it yoursellf, you will need to install `typst` on your platform. Details on how to do that can be found here:
https://typst.app/
Feel free to fork and use for your own resume, however this is based off [Modern CV](https://typst.app/universe/package/modern-cv/) so you are best to start there, however feel free to copy the github actions code for compiling on tagging:
https://github.com/arran4/resume/blob/main/.github/workflows/typst.yaml
For suggestions / updates etc, please create a fork and then from there create a PR.
|
|
https://github.com/WooSeongChoi/perl-5-study | https://raw.githubusercontent.com/WooSeongChoi/perl-5-study/main/chapters/chapter01/introduction.typ | typst | #set image(width: 70%)
= Introduction
== ìŽëì Perlì ì¬ì©íëê°?
=== ìŽëì ì¢ìê°?
- ìë¶ ëŽ ë¹ ë¥Žê² ì€íëë ê²ì ë§ë€ ë
- í
ì€ížë¥Œ ë€ë£šë ê²ìŽ ê±°ì ëë¶ë¶ìž 겜ì°
=== ìŽëì ë³ë¡ìžê°?
- ê³ ì±ë¥ìŽ íìí ê³³
- ë¶í¬ëª
í ë°ìŽë늬 ìì±
== windows perl ì€ì¹
#figure(
image("./resource/install/01_search_google.png"),
caption: [
구êžìì perl ê²ì
]
)
구êžìì perlì ê²ìíŽì Strawberry Perlì ì ííë€.
#figure(
image("./resource/install/02_search_older_version.png"),
caption: [
ë€ë¥ž ëŠŽëŠ¬ìŠ ì°Ÿêž°
]
)
ì¶êµ¬íë ê²ì ëë¶ë¶ì Linux distroìì ì¬ì©í ì ìë perl 묞ë²ìŽêž° ë묞ì ìµì ë²ì ì perlì íŒíë€.
#figure(
image("./resource/install/03_download.png"),
caption: [
Perl 5.16 ë²ì ë€ìŽë¡ë
]
)
CentOS 7 êž°ì€ perl 5.16 ë²ì ìŽ êž°ë³ž ì€ì¹ëìŽ ììŒë¯ë¡ íŽë¹ ë²ì ì ì€ì¹íë€.
== IntelliJ Perl ì€ì
=== Perl íë¬ê·žìž ì€ì¹
#figure(
image("./resource/intellij/plugin/01_preference.png"),
caption: [
ì€ì ì°œìŒë¡ ìŽë
]
)
#figure(
image("./resource/intellij/plugin/02_install.png"),
caption: [
perl íë¬ê·žìž ì€ì¹
]
)
=== Perl íë¡ì íž ì€ì
#figure(
image("./resource/intellij/project/01_create_project.png"),
caption: [
ì perl íë¡ì íž ìì±
]
)
#figure(
image("./resource/intellij/project/02_new_perl_project.png"),
caption: [
perl íë¡ì íž ì í
]
)
#figure(
image("./resource/intellij/project/03_select_perl_interpreter.png"),
caption: [
ë¡ì»¬ì ì€ì¹ë perl 5 ìží°íëŠ¬í° ì¬ì© ì€ì
]
)
#figure(
image("./resource/intellij/project/04_define_perl_interpreter_path.png"),
caption: [
perl 5 interpreter ê²œë¡ ì€ì
]
)
#figure(
image("./resource/intellij/project/05_define_project_name.png"),
caption: [
íë¡ì íž ìŽëŠ ì ì
]
)
=== Perl ìœë ìì± & ì€í
#figure(
image("./resource/intellij/execute/01_create_perl_script.png"),
caption: [
ìë¡ìŽ perl ì€í¬ëŠœíž ìì±
]
)
#figure(
image("./resource/intellij/execute/02_define_script_name.png"),
caption: [
ì€í¬ëŠœížë¡ ì í & ì€í¬ëŠœíž ìŽëŠ ì ì
]
)
#figure(
image("./resource/intellij/execute/03_execute_script.png"),
caption: [
ì€í¬ëŠœíž ì€í
]
)
ìëìŒë¡ ì€í ì€ì ìŽ ìì±ëëë¡ ìŒëš ì€ííë€.
#figure(
image("./resource/intellij/execute/04_select_run_config.png"),
caption: [
ì€í ì€ì ì ì©
]
)
íìí ì€í ì€ì ì ì ì©íë€.
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-2980.typ | typst | Apache License 2.0 | #let data = (
("TRIPLE VERTICAL BAR DELIMITER", "Sm", 0),
("Z NOTATION SPOT", "Sm", 0),
("Z NOTATION TYPE COLON", "Sm", 0),
("LEFT WHITE CURLY BRACKET", "Ps", 0),
("RIGHT WHITE CURLY BRACKET", "Pe", 0),
("LEFT WHITE PARENTHESIS", "Ps", 0),
("RIGHT WHITE PARENTHESIS", "Pe", 0),
("Z NOTATION LEFT IMAGE BRACKET", "Ps", 0),
("Z NOTATION RIGHT IMAGE BRACKET", "Pe", 0),
("Z NOTATION LEFT BINDING BRACKET", "Ps", 0),
("Z NOTATION RIGHT BINDING BRACKET", "Pe", 0),
("LEFT SQUARE BRACKET WITH UNDERBAR", "Ps", 0),
("RIGHT SQUARE BRACKET WITH UNDERBAR", "Pe", 0),
("LEFT SQUARE BRACKET WITH TICK IN TOP CORNER", "Ps", 0),
("RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER", "Pe", 0),
("LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER", "Ps", 0),
("RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER", "Pe", 0),
("LEFT ANGLE BRACKET WITH DOT", "Ps", 0),
("RIGHT ANGLE BRACKET WITH DOT", "Pe", 0),
("LEFT ARC LESS-THAN BRACKET", "Ps", 0),
("RIGHT ARC GREATER-THAN BRACKET", "Pe", 0),
("DOUBLE LEFT ARC GREATER-THAN BRACKET", "Ps", 0),
("DOUBLE RIGHT ARC LESS-THAN BRACKET", "Pe", 0),
("LEFT BLACK TORTOISE SHELL BRACKET", "Ps", 0),
("RIGHT BLACK TORTOISE SHELL BRACKET", "Pe", 0),
("DOTTED FENCE", "Sm", 0),
("VERTICAL ZIGZAG LINE", "Sm", 0),
("MEASURED ANGLE OPENING LEFT", "Sm", 0),
("RIGHT ANGLE VARIANT WITH SQUARE", "Sm", 0),
("MEASURED RIGHT ANGLE WITH DOT", "Sm", 0),
("ANGLE WITH S INSIDE", "Sm", 0),
("ACUTE ANGLE", "Sm", 0),
("SPHERICAL ANGLE OPENING LEFT", "Sm", 0),
("SPHERICAL ANGLE OPENING UP", "Sm", 0),
("TURNED ANGLE", "Sm", 0),
("REVERSED ANGLE", "Sm", 0),
("ANGLE WITH UNDERBAR", "Sm", 0),
("REVERSED ANGLE WITH UNDERBAR", "Sm", 0),
("OBLIQUE ANGLE OPENING UP", "Sm", 0),
("OBLIQUE ANGLE OPENING DOWN", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND LEFT", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND LEFT", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND UP", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND DOWN", "Sm", 0),
("MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND DOWN", "Sm", 0),
("REVERSED EMPTY SET", "Sm", 0),
("EMPTY SET WITH OVERBAR", "Sm", 0),
("EMPTY SET WITH SMALL CIRCLE ABOVE", "Sm", 0),
("EMPTY SET WITH RIGHT ARROW ABOVE", "Sm", 0),
("EMPTY SET WITH LEFT ARROW ABOVE", "Sm", 0),
("CIRCLE WITH HORIZONTAL BAR", "Sm", 0),
("CIRCLED VERTICAL BAR", "Sm", 0),
("CIRCLED PARALLEL", "Sm", 0),
("CIRCLED REVERSE SOLIDUS", "Sm", 0),
("CIRCLED PERPENDICULAR", "Sm", 0),
("CIRCLE DIVIDED BY HORIZONTAL BAR AND TOP HALF DIVIDED BY VERTICAL BAR", "Sm", 0),
("CIRCLE WITH SUPERIMPOSED X", "Sm", 0),
("CIRCLED ANTICLOCKWISE-ROTATED DIVISION SIGN", "Sm", 0),
("UP ARROW THROUGH CIRCLE", "Sm", 0),
("CIRCLED WHITE BULLET", "Sm", 0),
("CIRCLED BULLET", "Sm", 0),
("CIRCLED LESS-THAN", "Sm", 0),
("CIRCLED GREATER-THAN", "Sm", 0),
("CIRCLE WITH SMALL CIRCLE TO THE RIGHT", "Sm", 0),
("CIRCLE WITH TWO HORIZONTAL STROKES TO THE RIGHT", "Sm", 0),
("SQUARED RISING DIAGONAL SLASH", "Sm", 0),
("SQUARED FALLING DIAGONAL SLASH", "Sm", 0),
("SQUARED ASTERISK", "Sm", 0),
("SQUARED SMALL CIRCLE", "Sm", 0),
("SQUARED SQUARE", "Sm", 0),
("TWO JOINED SQUARES", "Sm", 0),
("TRIANGLE WITH DOT ABOVE", "Sm", 0),
("TRIANGLE WITH UNDERBAR", "Sm", 0),
("S IN TRIANGLE", "Sm", 0),
("TRIANGLE WITH SERIFS AT BOTTOM", "Sm", 0),
("RIGHT TRIANGLE ABOVE LEFT TRIANGLE", "Sm", 0),
("LEFT TRIANGLE BESIDE VERTICAL BAR", "Sm", 0),
("VERTICAL BAR BESIDE RIGHT TRIANGLE", "Sm", 0),
("BOWTIE WITH LEFT HALF BLACK", "Sm", 0),
("BOWTIE WITH RIGHT HALF BLACK", "Sm", 0),
("BLACK BOWTIE", "Sm", 0),
("TIMES WITH LEFT HALF BLACK", "Sm", 0),
("TIMES WITH RIGHT HALF BLACK", "Sm", 0),
("WHITE HOURGLASS", "Sm", 0),
("BLACK HOURGLASS", "Sm", 0),
("LEFT WIGGLY FENCE", "Ps", 0),
("RIGHT WIGGLY FENCE", "Pe", 0),
("LEFT DOUBLE WIGGLY FENCE", "Ps", 0),
("RIGHT DOUBLE WIGGLY FENCE", "Pe", 0),
("INCOMPLETE INFINITY", "Sm", 0),
("TIE OVER INFINITY", "Sm", 0),
("INFINITY NEGATED WITH VERTICAL BAR", "Sm", 0),
("DOUBLE-ENDED MULTIMAP", "Sm", 0),
("SQUARE WITH CONTOURED OUTLINE", "Sm", 0),
("INCREASES AS", "Sm", 0),
("SHUFFLE PRODUCT", "Sm", 0),
("EQUALS SIGN AND SLANTED PARALLEL", "Sm", 0),
("EQUALS SIGN AND SLANTED PARALLEL WITH TILDE ABOVE", "Sm", 0),
("IDENTICAL TO AND SLANTED PARALLEL", "Sm", 0),
("GLEICH STARK", "Sm", 0),
("THERMODYNAMIC", "Sm", 0),
("DOWN-POINTING TRIANGLE WITH LEFT HALF BLACK", "Sm", 0),
("DOWN-POINTING TRIANGLE WITH RIGHT HALF BLACK", "Sm", 0),
("BLACK DIAMOND WITH DOWN ARROW", "Sm", 0),
("BLACK LOZENGE", "Sm", 0),
("WHITE CIRCLE WITH DOWN ARROW", "Sm", 0),
("BLACK CIRCLE WITH DOWN ARROW", "Sm", 0),
("ERROR-BARRED WHITE SQUARE", "Sm", 0),
("ERROR-BARRED BLACK SQUARE", "Sm", 0),
("ERROR-BARRED WHITE DIAMOND", "Sm", 0),
("ERROR-BARRED BLACK DIAMOND", "Sm", 0),
("ERROR-BARRED WHITE CIRCLE", "Sm", 0),
("ERROR-BARRED BLACK CIRCLE", "Sm", 0),
("RULE-DELAYED", "Sm", 0),
("REVERSE SOLIDUS OPERATOR", "Sm", 0),
("SOLIDUS WITH OVERBAR", "Sm", 0),
("REVERSE SOLIDUS WITH HORIZONTAL STROKE", "Sm", 0),
("BIG SOLIDUS", "Sm", 0),
("BIG REVERSE SOLIDUS", "Sm", 0),
("DOUBLE PLUS", "Sm", 0),
("TRIPLE PLUS", "Sm", 0),
("LEFT-POINTING CURVED ANGLE BRACKET", "Ps", 0),
("RIGHT-POINTING CURVED ANGLE BRACKET", "Pe", 0),
("TINY", "Sm", 0),
("MINY", "Sm", 0),
)
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/closure-11.typ | typst | Other | // Too many arguments.
#{
let f(x) = x + 1
// Error: 8-13 unexpected argument
f(1, "two", () => x)
}
|
https://github.com/hrbrmstr/2023-10-20-wpe-quarto-typst | https://raw.githubusercontent.com/hrbrmstr/2023-10-20-wpe-quarto-typst/main/blank-test/blank-r.typ | typst | // needed for callout support
#import "@preview/fontawesome:0.1.0": *
// Some definitions presupposed by pandoc's typst output.
#let blockquote(body) = [
#set text( size: 0.92em )
#block(inset: (left: 1.5em, top: 0.2em, bottom: 0.2em))[#body]
]
#let horizontalrule = [
#line(start: (25%,0%), end: (75%,0%))
]
#let endnote(num, contents) = [
#stack(dir: ltr, spacing: 3pt, super[#num], contents)
]
#show terms: it => {
it.children
.map(child => [
#strong[#child.term]
#block(inset: (left: 1.5em, top: -0.4em))[#child.description]
])
.join()
}
// Some quarto-specific definitions.
#show raw: it => {
if it.block {
block(fill: luma(230), width: 100%, inset: 8pt, radius: 2pt, it)
} else {
it
}
}
#show ref: it => locate(loc => {
let target = query(it.target, loc).first()
if it.at("supplement", default: none) == none {
it
return
}
let sup = it.supplement.text.matches(regex("^45127368-afa1-446a-820f-fc64c546b2c5%(.*)")).at(0, default: none)
if sup != none {
let parent_id = sup.captures.first()
let parent_figure = query(label(parent_id), loc).first()
let parent_location = parent_figure.location()
let counters = numbering(
parent_figure.at("numbering"),
..parent_figure.at("counter").at(parent_location))
let subcounter = numbering(
target.at("numbering"),
..target.at("counter").at(target.location()))
// NOTE there's a nonbreaking space in the block below
link(target.location(), [#parent_figure.at("supplement") #counters#subcounter])
} else {
it
}
})
// 2023-10-09: #fa-icon("fa-info") is not working, so we'll eval "#fa-info()" instead
#let callout(body: [], title: "Callout", background_color: rgb("#dddddd"), icon: none, icon_color: black) = {
block(breakable: false, fill: background_color, stroke: (paint: icon_color, thickness: 0.5pt, cap: "round"), width: 100%, radius: 2pt)[
#block(inset: 1pt, width: 100%, below: 0pt)[#block(fill: background_color, width: 100%, inset: 8pt)[#text(icon_color, weight: 900)[#icon] #title]]
#block(inset: 1pt, width: 100%)[#block(fill: white, width: 100%, inset: 8pt)[#body]]]
}
#let article(
margin: (x: 1.25in, y: 1.25in),
paper: "us-letter",
lang: "en",
region: "US",
doc
) = {
set page(
paper: paper,
margin: margin,
)
set text(
lang: lang,
region: region,
)
doc
}
#show: doc => article(
margin: (x: 1in,y: 1in,),
doc
)
#set page(
fill: rgb("#142933")
)
#set text(
fill: white,
font: ("Tilt Prism"),
size: 32pt
)
#set align(center)
This is the base for your document content.
#set align(left)
#set text(
font: "Inconsolata",
size: 12pt,
)
Exercitation ullamco proident id pariatur eu magna nisi. Minim consequat minim qui pariatur commodo officia ad ea. Irure ut reprehenderit dolor eiusmod est occaecat labore fugiat. Veniam irure anim eu culpa fugiat exercitation. Non voluptate deserunt ullamco exercitation quis minim deserunt do eu dolore laboris. Aliquip fugiat aliqua proident commodo. Consequat ut aliqua fugiat ullamco deserunt adipisicing consequat.
Tempor proident in cupidatat cupidatat laborum et ut et. Aliquip aute non aliquip anim sint proident ea nostrud ex voluptate. Ut sit nulla id aute et enim. Laboris amet tempor dolore aute est sint consequat. Voluptate sint cillum cillum laboris ad sint adipisicing pariatur non enim elit proident velit. Cillum cupidatat eiusmod nisi qui adipisicing aliqua esse in. In tempor ea sint pariatur ipsum ea duis.
#set align(center)
#v(24pt)
#block[
#block[
#box([#image("blank-r_files/figure-typst/plt1-1.svg", width: 5in, height: 3in)])
]
]
#set align(left)
#v(24pt)
Mollit ad adipisicing non irure sit dolore irure commodo veniam proident laborum ullamco. Et officia anim sunt reprehenderit esse qui aliqua veniam amet consectetur excepteur elit culpa reprehenderit. Deserunt voluptate et laborum sint dolore cupidatat nostrud anim ut duis ea. Sunt culpa aute do minim fugiat cillum.
#pagebreak()
#set align(center)
#set table(
stroke: 0.25pt + white
)
#block[
#block[
#align(center)[#table(
columns: 11,
align: (col, row) => (auto,auto,auto,auto,auto,auto,auto,auto,auto,auto,auto,).at(col),
inset: 6pt,
[mpg], [cyl], [disp], [hp], [drat], [wt], [qsec], [vs], [am], [gear], [carb],
[21.0],
[6],
[160.0],
[110],
[3.90],
[2.620],
[16.46],
[0],
[1],
[4],
[4],
[21.0],
[6],
[160.0],
[110],
[3.90],
[2.875],
[17.02],
[0],
[1],
[4],
[4],
[22.8],
[4],
[108.0],
[93],
[3.85],
[2.320],
[18.61],
[1],
[1],
[4],
[1],
[21.4],
[6],
[258.0],
[110],
[3.08],
[3.215],
[19.44],
[1],
[0],
[3],
[1],
[18.7],
[8],
[360.0],
[175],
[3.15],
[3.440],
[17.02],
[0],
[0],
[3],
[2],
[18.1],
[6],
[225.0],
[105],
[2.76],
[3.460],
[20.22],
[1],
[0],
[3],
[1],
[14.3],
[8],
[360.0],
[245],
[3.21],
[3.570],
[15.84],
[0],
[0],
[3],
[4],
[24.4],
[4],
[146.7],
[62],
[3.69],
[3.190],
[20.00],
[1],
[0],
[4],
[2],
[22.8],
[4],
[140.8],
[95],
[3.92],
[3.150],
[22.90],
[1],
[0],
[4],
[2],
[19.2],
[6],
[167.6],
[123],
[3.92],
[3.440],
[18.30],
[1],
[0],
[4],
[4],
[17.8],
[6],
[167.6],
[123],
[3.92],
[3.440],
[18.90],
[1],
[0],
[4],
[4],
[16.4],
[8],
[275.8],
[180],
[3.07],
[4.070],
[17.40],
[0],
[0],
[3],
[3],
[17.3],
[8],
[275.8],
[180],
[3.07],
[3.730],
[17.60],
[0],
[0],
[3],
[3],
[15.2],
[8],
[275.8],
[180],
[3.07],
[3.780],
[18.00],
[0],
[0],
[3],
[3],
[10.4],
[8],
[472.0],
[205],
[2.93],
[5.250],
[17.98],
[0],
[0],
[3],
[4],
[10.4],
[8],
[460.0],
[215],
[3.00],
[5.424],
[17.82],
[0],
[0],
[3],
[4],
[14.7],
[8],
[440.0],
[230],
[3.23],
[5.345],
[17.42],
[0],
[0],
[3],
[4],
[32.4],
[4],
[78.7],
[66],
[4.08],
[2.200],
[19.47],
[1],
[1],
[4],
[1],
[30.4],
[4],
[75.7],
[52],
[4.93],
[1.615],
[18.52],
[1],
[1],
[4],
[2],
[33.9],
[4],
[71.1],
[65],
[4.22],
[1.835],
[19.90],
[1],
[1],
[4],
[1],
)
]
]
]
#set align(left)
#v(24pt)
Do culpa cillum nulla reprehenderit amet ipsum. Pariatur cillum amet in sint commodo sint ex ullamco deserunt est dolore sint do. Id laborum ipsum aliqua exercitation mollit in quis labore nisi minim amet ad. Ex est laborum id et reprehenderit adipisicing ullamco duis adipisicing ad deserunt cillum.
Aliqua ex nulla eu mollit eiusmod qui. Reprehenderit laboris eu irure ex qui aliquip voluptate adipisicing nisi nulla tempor non exercitation. Esse ut deserunt labore enim. Magna eiusmod duis culpa id laborum cillum. Sunt sit anim ad aute incididunt nisi amet ipsum minim. Magna sint ullamco proident qui dolore ullamco elit mollit aute ut cillum. Mollit aliquip labore excepteur occaecat.
|
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/zalmy/Z_PaneJaVolam.typ | typst | #import "/style.typ": *
#set par(first-line-indent: 1em)
#subheader[Psalóm 140]
#note[(... PokraÄovanie)]
PoloÅŸÃ Hóspodi chranénije ustóm mojÃm, \* i dvér ohraÅŸdénija o ustnách mojÃch.
Ne uklonà sérdca mojehó v slovesá lukávstvija, \* nepÅ¡Äeváti vinÃœ o hrisÃch.
So ÄelovÃki ÄÃlajuÅ¡Äimi bezzakónije, \* i ne soÄtúsja s izbránnymi Ãch.
Nakáşet mjá právednik mÃlostiju, i obliÄÃt mjá, \* jeléj ÅŸe hrÃÅ¡naho da ne namástit hlavÃœ mojejá.
Jáko jéšÄe i molÃtva mojá v blahovolénijich Ãch, \* poşérty bÜša pri kámeni sudijà Ãch.
UslÜšatsja hlahóly mojá jáko vozmohóša: \* jáko tólÅ¡Äa zemlà prosÃdesja na zemlÃ, rastoÄÃÅ¡asja kósti Ãch pri áÄi.
Jáko k tebà Hóspodi, Hóspodi óÄi mojÃ, \* na ťá upovách, ne otimà duÅ¡u mojú.
Sochranà mjá ot sÃti, júşe sostáviÅ¡a mÃ, \* i ot soblázn ÄÃlajuÅ¡Äich bezzakónije.
Pádut vo mréşu svojú hrÃÅ¡nicy, \* jedÃn jésm áz dóndeÅŸe prejdú.
#subheader[Psalóm 141]
Hlásom mojÃm k Hóspodu vozzvách, \* hlasóm mojÃm ko Hóspodu pomolÃchsja.
ProlÃju préd nÃm molénije mojé, \* peÄáğ mojú préd nÃm vozviÅ¡Äú.
Vnehdá isÄezáti ot mené dúchu mojemú, \* i tÃœ poznal jesà stezà mojá.
Na putà sém po nemúşe choÅŸdách, \* skrÜša sÃÅ¥ mÅÃ.
Smotrjách odesnúju i vozhğadách, \* i ne bà znájaj mené.
PohÃbe bÃhstvo ot mené, \* i ÅÃsÅ¥ vzyskajáj duÅ¡Ã mojejá.
Vozzvách k tebà Hóspodi rÃch: \* tÃœ jesà upovánije mojé, ÄásÅ¥ mojá jesà na zemlà şÃvych.
VoÅmà moléniju mojemú, \* jáko smirÃchsja ziló.
Izbávi mjá ot hoÅášÄich mjá, \* jáko ukripÃÅ¡asja páÄe mené. |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/bytefield/0.0.1/README.md | markdown | Apache License 2.0 | # typst-bytefield
A simple way to create network protocol headers in typst.
Using [tablex](https://github.com/PgBiel/typst-tablex) under the hood.
## Example

```typst
bytefield(
bits(4)[Version], bits(4)[TTL], bytes(1)[TOS], bytes(2)[Total Length],
bytes(2)[Identification], bits(3)[Flags], bits(13)[Fragment Offset],
bytes(1)[TTL], bytes(1)[Protocol], bytes(2)[Header Checksum],
bytes(4)[Source Address],
bytes(4)[Destination Address],
bytes(3)[Options], bytes(1)[Padding]
)
```
## Usage
To use this library through the Typst package manager (for Typst v0.6.0+), import bytefield with `#import="@preview/bytefield:0.0.1": *` at the top of your file.
The package contains some of the most common network protocol headers: `ipv4`, `ipv6`, `icmp`, `icmpv6`, `dns`, `tcp`, `udp`.
## Features
At the moment very limited features. Feel free to extend if you like.
- Select the number of bits in one row. The default value is 32. `bytefield(bits: 32)`
- Specify the shown bit numbers in the header through the `header` argument. Example: `bytefield(header: (0,8,16,31))`
- Select the height of the rows. Default is **2.5em**. Example: `bytefield(rowheight: 20pt)`
- Adding fields with a predefined length of bits or bytes.
- Fields with a length greater than a row will automatically wrap.
- If a field-length is the multiple of a row-length it will automatically render with a higher rowheight. Example see *Ipv6*.
- Fill up the remaining space of a row with the `padding` field.
- Coloring fields through the `fill` argument. For example: `bits(32, fill: red.lighten(30%))[Test]`
## Changelog
### v0.0.1
Initial Release
Added `bytefield`, as main function to create an new bytefield diagram.
Added `bit`, `bits`, `byte`, `bytes`, `padding`, as high level API for adding fields to a bytefield.
Added `flagtext` as a utility function to create rotate text for short flag descriptions.
Added `ipv4`, `ipv6`, `icmp`, `icmpv6`, `dns`, `tcp`, `udp` as predefined diagrams.
|
https://github.com/StanleyDINNE/php-devops-tp | https://raw.githubusercontent.com/StanleyDINNE/php-devops-tp/main/documents/Rapport/Typst/Template_default.typ | typst |
#import "Util.typ": to_string, add_title, insert_code-snippet
#let __constants_toml = toml("__private_tools/constants.toml")
#let __local_placeholder_constants = (
title: "Title",
authors: "",
context: none,
date: datetime.today().display(),
header_logo: none,
)
#let set_config_header_footer(
title: __local_placeholder_constants.title,
authors: __local_placeholder_constants.authors,
context: __local_placeholder_constants.context,
date: __local_placeholder_constants.date,
header_logo:__local_placeholder_constants.header_logo,
document_
) = {
let h_f_content(
side, content,
color: rgb(__constants_toml.color.header_footer_grey)
) = align(side,
text(
weight: "thin",
size: __constants_toml.size.foot_head * 1pt,
fill: color
)[#content]
)
set page(
header: grid(
columns: (15%, 70%, 15%),
h_f_content(left + horizon, date),
h_f_content(center + horizon, header_logo),
h_f_content(right, [by #authors]),
),
footer: grid(
columns: (20%, 60%, 20%),
h_f_content(left + horizon, par(justify: false)[#text(hyphenate: false)[#context]]),
h_f_content(center + horizon, par(justify: false)[#text(hyphenate: false)[#title]]),
h_f_content(right + horizon, counter(page).display("1/1", both: true), color: black),
)
)
document_
}
#let set_config_document_style(document_) = {
// set heading(numbering: "1.1 " + str.from-unicode(__constants_toml.char.em-dash))
set heading(numbering: (..nums) => {
nums.pos().map(str).join(".")
})
set par(
first-line-indent: 2em,
justify: true
)
set text(lang: "fr")
show link: underline
// Thx to https://github.com/typst/typst/discussions/2812#discussioncomment-7721649
show heading: h => {
let number_dash = if h.numbering != none {
[#counter(heading).display() #str.from-unicode(__constants_toml.char.em-dash) ]
} else {
[]
}
pad(left: 1em * (h.level - 1), [#number_dash#h.body]) + text(0pt, white)[.]
}
document_
}
#let set_config(
title: __local_placeholder_constants.title,
title_prefix: "Homework #?: ",
authors:__local_placeholder_constants.authors,
context:__local_placeholder_constants.context,
date: __local_placeholder_constants.date,
image_banner: none,
header_logo: none,
document_,
) = {
set document(title: to_string[#title], author: authors)
document_ = [
#image_banner
#add_title[#title_prefix#title]
#document_
]
document_ = set_config_document_style[#document_]
document_ = set_config_header_footer(
title: title,
authors: authors,
context: context,
date: date,
header_logo: header_logo,
)[#document_]
document_
}
|
|
https://github.com/morrisLuke/typst_quarto_barebones_report_template | https://raw.githubusercontent.com/morrisLuke/typst_quarto_barebones_report_template/main/typst-show.typ | typst | #show: psc-report.with(
$if(title)$
title: "$title$",
$endif$
) |
|
https://github.com/gomazarashi/typst_slydst | https://raw.githubusercontent.com/gomazarashi/typst_slydst/main/example.typ | typst | #set text(lang: "ja") // èšèªãæ¥æ¬èªã«èšå®
#set text(font: ("Yu Gothic")) // ãã©ã³ããèšå®
#set heading(numbering: none)
#import "@preview/slydst:0.1.1": *
#import "@preview/codelst:2.0.1":*
#import "@preview/showybox:2.0.1":*
#show: slides.with(
title: "Typstã§ã¹ã©ã€ããäœæãã ", // å¿
é
authors: ("ããŸ"),
date: [#datetime.today().display()],
subtitle: "slydstã§æ軜ã«éçã¹ã©ã€ããäœãã",
layout: "medium",
ratio: 4 / 3,
title-color: none,
)
== showyboxã䜿ã£ãŠã¿ã
#v(10%)
#showybox(title: "Green's Theorem", frame: (
border-color: olive,
title-color: olive.lighten(10%),
body-color: olive.lighten(95%),
footer-color: olive.lighten(80%),
), footer: "蚌æã¯çç¥ããã")[
éæ²ç·$C$ã§å²ãŸããé å$D$ã«ãããŠã$C^1$çŽé¢æ°$P(x,y)$ãš$Q(x,y)$ã«å¯ŸããŠã以äžãæãç«ã€ã
$ integral.cont_C (P dif x + Q dif y ) = integral.double_D ((diff Q)/(diff x)-(diff P)/(diff y)) dif x dif y $
] |
|
https://github.com/valentinvogt/npde-summary | https://raw.githubusercontent.com/valentinvogt/npde-summary/main/src/colors.typ | typst | #let darkmode = "false"
#let page-color = white
#let text-color = black
#let brown-box = rgb(255, 236, 217)
#let tip-stroke = rgb(170, 170, 200)
#let unimportant-color = rgb("f6f6f6")
#let link-color = blue.darken(30%)
#if darkmode == "true" {
page-color = rgb(39, 43, 50)
text-color = white
brown-box = rgb(80, 80, 80)
tip-stroke = rgb(70, 70, 100)
unimportant-color = gray
link-color = blue.lighten(40%)
} |
|
https://github.com/Robotechnic/diagraph | https://raw.githubusercontent.com/Robotechnic/diagraph/main/examples/test.typ | typst | MIT License | #import "@preview/diagraph:0.3.0": *
#let labels = (
"a" :$1$,
"b" :$2$,
"c" :$3$,
"d" :$4$,
"e" :$5$,
"f" :$9$,
"g" :$10$,
"h" :$11$,
"i" :$12$,
"j" :$13$,
"k" :$14$,
"l" :$15$,
"m" :$19$,
"n": $20$,
"p" : $50$
)
#let graph = (nodes) => {
let result = "digraph {"
for (i,n) in nodes.keys().enumerate() {
for m in nodes.keys().slice(i) {
result += n.at(0) + " -> " + m.at(0) + ";"
}
}
render(result + "}", labels: nodes, width: 100%)
}
#for i in range(2, labels.len()) {
for j in range(0, labels.len() - i) {
graph(labels.keys().slice(j, j + i).fold(("z":"2"), (acc, e) => {
acc.insert(e, labels.at(e));
acc
}))
}
}
|
https://github.com/rayfiyo/myTypst | https://raw.githubusercontent.com/rayfiyo/myTypst/main/mystyle_report/main.typ | typst | BSD 3-Clause "New" or "Revised" License | #import "./template.typ": *
#import "@preview/codelst:2.0.0": sourcecode, sourcefile, lineref, code-frame
#show: cover.with(
number: "7", title: "Typstã§æžãä¿®è«ã®ãã³ãã¬", id: "12-34567", author: "å³åŸ å·ŠåŸ", university: "æ±äº¬å€§åŠå€§åŠé¢", school: "å·¥åŠç³»ç 究ç§", department: "èªç©ºå®å®å·¥åŠå°æ»", mentor: "é ç«¿", room: "ãããå®éšå®€", //
// Experiment environment
exp_year: "ïŒ", exp_month: "ïŒ", exp_day: "ïŒ", exp_day_of_week: "æ", //
weather: "æŽã", temperature: "23", humidity: "70", atmospheric_pressure: "1024", //
group: "ïŒïŒ", member1: "hoge1", member2: "hoge2", member3: "hoge3", member4: "hoge4", member5: "hoge5", member6: "hoge6", //
purpose: [
å®éšã®ç®çãšã¯ãªãã ãããïŒæ°è¡çšåºŠã§åœãããããããšãå€ãïŒ
], //
abstract_ja: [
è¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ïŒãã®åã®æåŸ"ïŒ"ã§ã¡ããã©200æåã«ãªããŸãïŒ
è¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£.ãã®åã®æåŸ"ïŒ"ã§ã¡ããã©400æåã«ãªããŸãïŒ
], bibliography-file: "references.bib",
)
// #show: master_thesis.with(
// title: "Typstã§æžãä¿®è«ã®ãã³ãã¬", author: "å³åŸ å·ŠåŸ", university: "æ±äº¬å€§åŠå€§åŠé¢", school: "å·¥åŠç³»ç 究ç§", department: "èªç©ºå®å®å·¥åŠå°æ»", id: "12-345678", mentor: "é ç«¿", mentor-post: "åææ", class: "修士", member: "hogeç·", abstract_ja: [
// è¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ïŒãã®åã®æåŸ"ïŒ"ã§ã¡ããã©200æåã«ãªããŸãïŒ
// è¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£ãŠã»ããŸãããïŒè¿å¹Žã®å®å®ã£.ãã®åã®æåŸ"ïŒ"ã§ã¡ããã©400æåã«ãªããŸãïŒ
// ], bibliography-file: "references.bib",
// )
/*
= å®éšç®ç
= å®éšåç
= å®éšæ¹æ³ãšæé
= 䜿çšåšå
·
= å®éšçµæ
= èå¯
// = åèæç® // èªåçæ
= ããŒãã·ãŒã
== ã³ãŒããããã¯
#sourcecode(numbers-start: 1)[```c
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
```]
// #sourcefile(read("ã±ã"), file:"ãã¡ã€ã«å")
== åŒçš
@ss8843592
== æ°åŒ
$ A = mat(1, 2;3, 4) $ <eq1>
@eq1 ã衚瀺
== ç»å
#img(
image("appendix/images/ladder.svg", width: 20%), caption: [ãªãªãžãã«ã®The Go gopherïŒGopherããïŒã¯ãRenée
Frenchã«ãã£ãŠãã¶ã€ã³ãããŸããã],
) <img1>\
@img1 ã衚瀺
== è¡š
#tbl(table(
columns: (7em, auto), // columns: 2, ãªã©ãå¯
align: (left, left), //
[å称], [å€], //
[A], [2], //
[B], [6], //
), caption: [ããŒãã«]) <tbl1>
@tbl1 ã衚瀺
== URLåã蟌ã¿
#link("https://typst.app/docs")[å
¬åŒããã¥ã¡ã³ã]
== å®ç
#let theorem = thmbox("theorem", "å®ç", base_level: 1)
#theorem("ã²ã€ã©-")[
Typst ã¯ãããã®ã§ãã.
] <theorem>
== è£é¡
#let lemma = thmbox("theorem", "è£é¡", base_level: 1)
#lemma[
Texã¯ããããªãã§ãã.
] <lemma>
== å®çŸ©
#let definition = thmbox("definition", "å®çŸ©", base_level: 1, stroke: black + 1pt)
#definition[
Typst is a new markup-based typesetting system for the sciences.
] <definition>
*/
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz/0.3.0/src/lib.typ | typst | Apache License 2.0 | #import "version.typ": version
#import "canvas.typ": canvas
#import "draw.typ"
// Expose utilities
#import "vector.typ"
#import "matrix.typ"
#import "styles.typ"
#import "coordinate.typ"
#import "intersection.typ"
#import "drawable.typ"
#import "process.typ"
#import "util.typ"
#import "path-util.typ"
#import "mark.typ"
#import "mark-shapes.typ"
// Libraries
#import "lib/palette.typ"
#import "lib/angle.typ"
#import "lib/tree.typ"
#import "lib/decorations.typ"
// Stubs
#import "lib/plot-stub.typ" as plot
|
https://github.com/totikom/slides | https://raw.githubusercontent.com/totikom/slides/main/2024-05-01-turing-blockchain/colors.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #let background-color = rgb("#111122")
#let text-color = rgb("#dddddd")
#let dim-text-color = text-color.darken(30%)
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/docs/thinking-ide.md | markdown | Apache License 2.0 | I have implemented nearly all LSP features. The implementations are incomplete but bring some insights. The requirement of analysis may unveil some shortcomings to building incremental analysis (computation) for typst-ide with existing crates, e.g. comemo.
First, to get LSP features, we have two approaches to extract information from Typst's source code:
- dynamic analysis, that triggers `analyze_{expr,import,...}`, which is heavily used by current typst-ide.
- static analysis, which iterates `SyntaxNode/`LinkedNode/Content/Frame`, which is also used by the current typst-ide but no cache is taken.
I list some typical ways to get LSP features. "Go to function definition" can be implemented partially with dynamic analysis, but "Go to variable definition" looks impossible, so we need to have static analysis eventually. "Go to references" initially acquires both dynamic and static analysis. "Inlay hint" can be easily implemented with dynamic analysis, but it has really poor performance since a single inlay hint request triggers many compilations.
The dynamic analysis part in Typst is attractive in comparison with other programming languages from my view. We can usually get nice and wonderful analysis results (autocompletion) by tracking some span to get corresponding values dynamically, but it is not perfect.
- Lossy information: For a non-function value, we cannot track its definition (assignment) site currently.
- Performance overhead: A single compilation is proven to be fast, but to get the best analysis result we may trigger multiple times of compilation and get exhausted memory and long time (observed in implemented inlay hint and goto references feature).
My solution is to introduce more static analysis and cache them heavily. But I find it problematic to build one with comemo. There are limitations observed for implementing performant static analysis.
- Bad performance is caused by hashing, especially on recursive structures. comemo compares input and constraints by hash, which is inefficient enough. I encounter the following cases frequently:
```rs
#[comemo::memorize]
fn analyze(input: SomeRecursiveStructure) -> Output {}
```
It is elegant, but causes poor performance frequently, as the CPUs are tired of calculating hashes on the recursive structures repeatedly. Specifically, the leaf will be hashed by `O(d)` times, where `d` is the number of wrapped `LazyHash` from the root node to the leaf node. Even though we have `LazyHash`, the overhead is not acceptable when the calculation is cheaper than hashing the input.
- Lack of revision management (comemo is global), hence causing poor memory efficiency. Now we have a keep-running compilation task along with multiple incoming IDE tasks at some random times, how do we run the global `comemo::evict` for best performance? When we trigger `comemo::evict` frequently for each IDE task, the compilation caches all go away.
- Cannot do task cancellation when analyses are nested by `comemo::memorized`:
- When some expensive analysis task is running in the background, how do we cancel if it is nested in deep `comemo::memorized`? The cancellation will cause "side effects".
- This problem also occurs with a long-time compilation for canceling.
I compared salsa (used by rust analyzer) and comemo, and found salsa solves some problems, but I'm not yet sure whether we should use salsa for caching analyses and It is also not actively maintained.
---
I think we have reached some consensus and can land a basic go-to definition feature. For the comemo part, we can just keep discussing and seek opportunities for optimization if possible.
> I think by extending Scope (storing a span) and the Tracer a bit, we could maybe solve that. Though intra-file go-to-definition is also fairly simple on the syntax tree I think, and more efficient. So, we could also go with a hybrid approach: Intra-file syntax-based and inter-file using dynamic analysis on the module and checks the span in the Scope.
This is what I'm doing. The approach may not fit in some other LSP features, but is totally fine with a go to definition feature. We can forget other features first.
> Maybe we can let the Tracer trace more things in a single compilation, so that you can run various analyses at once?
We can do it, but I'm worrying whether it will affect performance on regular compilation. Furthermore, there are some cases will extremely extend time to dynamic analysis. I can give a simple example:
```js
for i in range(5000000) {}
```
When you try to get a `typst::foundations::Func` instance for the `range` function by `analyze_expr`, it will cost 11s on my computer! IMO we should prefer static analysis whenever possible, even if the dynamic analysis is quite wonderful, as we may not like to get user reports that they randomly click some identifier for definition and the browser stucks or crashes... The performance and static analysis are usually more reliable and predictable.
> If you have intermediate LazyHash structures, every leaf should be hashed just once
For example, let's think of an extreme case: `pub enum Either { A(Box<Either>), B }`, and the analysis:
```rs
#[comemo::memorize]
fn analyze(input: Either) -> Output {}
```
We have several simple options:
+ doesn't use lazy hash inside `pub enum Either { A(Box<Either>), B }`, then the `analyze` function will have poor performance when the `Either` is big.
+ intrude a lazy hash inside `pub enum Either { A(Box<LazyHash<Either>>), B }`, then the `analyze` function will trigger for `d` times if the depth of `B` is `d`.
+ add an extra variant, and make a "HashA" when it is big enough `pub enum Either { A(Box<Either>), B, HashA(Box<LazyHash<Either>>) }`. it is possible but not operatable for me.
Overall, I feel salsa's intern-based solution is more efficient for comparing and computing many small inputs than comemo's hash-based solution.
> That's a problem indeed. If you have any proposals how we could extend comemo to make eviction smarter, I'd be interested to hear them. Maybe we can steal some stuff from salsa here, e.g. the durability concept.
> Yeah, I think that's a more fundamental problem. Maybe we could build some cancellation feature into comemo. How big is this problem in practice? Do you frequently notice a lack of cancellation or would it just be cleaner to be able to do it?
> I looked at salsa before building comemo. Maybe I just didn't "get it", but it felt a lot more complicated and it also forces you to write the compiler in a very specific way. Do you think there are some things to its approach that are fundamentally impossible in the comemo approach, rather than just not implemented?
I believe you have investigated salsa and there should be wonderful stuff to steal, for example, the durability concept, which also looks matter for optimizing the performance when the incoming events are mostly user editions. I mentioned these Cons of comemo, because I want to let you know which problems I've encountered when I try to cache static analysis with comemo. We can revisit them when they're becoming a big problem during building our LSP/IDE features.
|
https://github.com/loreanvictor/master-thesis | https://raw.githubusercontent.com/loreanvictor/master-thesis/main/thesis_typ/acknowledgement.typ | typst | MIT License | #let acknowledgement() = {
set page(
margin: (left: 30mm, right: 30mm, top: 40mm, bottom: 40mm),
numbering: none,
number-align: center,
)
let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"
set text(
font: body-font,
size: 12pt,
lang: "en"
)
set par(leading: 1em)
// --- Acknowledgements ---
align(left, text(font: sans-font, 2em, weight: 700,"Acknowledgements"))
text[
I would like to sincerely thank my supervisor Prof. Dr. <NAME> for providing me with this opportunity and guiding me along the way. I would also like to thank members of the Artemis team for their direct and indirect help and support throughout this thesis, and for enabling such a vibrant environment where a constant influx of passionate students can contribute to real-world projects through their work and research. I would like to specifically mention members of the Apollon team <NAME> and <NAME> for their continuous support and feedback.
I would also like to express my sincere gratitude to my family and friends for their ever-present support and encouragement throughout my studies, specifically my fiancee Dr. <NAME> for accompanying me on this journey and making it a lot more enjoyable and memorable.
]
v(15mm)
} |
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/037%20-%20Ravnica%20Allegiance/007_The%20Gathering%20Storm%3A%20Chapter%2013.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Gathering Storm: Chapter 13",
set_name: "Ravnica Allegiance",
story_date: datetime(day: 04, month: 09, year: 2019),
author: "<NAME>",
doc
)
Vraska looked down at her map, inked lines on parchment covered in pencil cross-hatching. Just lines on paper, for now. But what they represented . . .
#emph[You are distressed, friend-Vraska] , Xeddick projected into her mind.
Vraska leaned back in her throne of petrified bodies, now heavily cushioned and much more comfortable. She let her head rest on the thick pillow that covered the screaming face of a shadow elf, and looked up into the vaulted ceiling. Light-globes hung at intervals, glowing softly with bioluminescence, suspended in vast mats of cobweb. Vraska closed her eyes and pressed her fingers to her forehead. Her skull ached, and the tendrils on her head hung limp and lifeless.
#emph[You must rest] , Xeddick said, moving forward from the shadows beside the throne. Aside from a few Erstwhile guards, he was the only one in the throne room. Sheâd banished everyone else the night before. #emph[You push yourself too hard.]
"Itâs all I can do," Vraska muttered, and shook her head. She sat up and looked across at the albino kraul. He was small for his race, his fluttering wings weak and useless, but his mind was extraordinary. #emph[And he cares about me.] That, these days, was a rare commodity. "Sorry. Youâre right. I just . . ."
She gestured at the map.
#emph[You plan for the attack of the surface dwellers] , Xeddick said. #emph[You are certain they are coming?]
"Theyâre coming," Vraska said grimly. "<NAME> wonât give up. Itâs not in his nature." Her lip twisted. "One of his more charming qualities."
#emph[Then they will come] , Xeddick said. #emph[And you will defeat them.]
She could feel his total confidence, and it made her wince. "Thereâll be a cost, and your people will bear the brunt of it."
#emph[There is always a cost, friend-Vraska. And my people owe you more than we can possibly repay. We will take the burden, and gladly.]
"Mazirek may not agree."
#emph[Mazirek has grown apart from the rest of the kraul] , Xeddick said. He sounded uncertainâit wasnât in his nature to criticize. #emph[He has become . . . proud. He has forgotten the purpose of all kraul is to serve the hive. It is the hive that endures, when the individual fails.]
#emph[Exactly] , Vraska thought. She flung the words into the depths of her own mind, where she had a nasty feeling that sheâd find Jace looking back at her. #emph[I did what I had to do for the Golgari. These are my people, my responsibility. I have to protect them better than Jarad, so no one has to suffer what I did.] Prison, torture, and nearly death, for no better reason than that sheâd been born a gorgon.
#emph[And besides.] Vraska forced a smile, showing pointed teeth. #emph[I enjoyed it.] Watching the great sphinx Isperiaâthe judge whoâd destroyed her life with a casual signature on a formâharden into lifeless stone. #emph[I should have done that a long time ago.]
Xeddick shifted uneasily. #emph[Friend-Vraska] , he said, #emph[the guards have captured an intruder.]
"Another assassin?" Vraska looked down at the throne. "I donât need him for the throne. Have them toss himâ"
#emph[Pardon, but it does not appear to be an assassin. She claims to be an emissary from the Rakdos.]
"From #emph[Rakdos] ?" Vraska frowned. "Bring her in."
A few moments later, a pair of Erstwhile came in, escorting a bedraggled figure in a patchwork leather bodysuit, soaked to the skin. Water had washed the paste from her hair, leaving it lying flat and dripping.
"Hekara," Vraska said, with a sigh.
"Vrasky!" Hekara said, bouncing and spattering water everywhere.
"What happened to you?" Vraska said.
"Fell in the moat," Hekara said promptly.
"The moat is full of crocodiles," Vraska said.
"Found that out," Hekara said, still grinning. "Bitey!"
Vraska shook her head, tendrils curling in amusement. "Does Ral know youâre here?"
"No," Hekara said. "I just wanted to talk." She bit her lip, then looked at the guards and Xeddick.
"Leave us," Vraska said. "You as well, Xeddick. Iâll speak with you later."
The kraul bent his front legs in his speciesâ version of a bow and withdrew, the shuffling Erstwhile following after. Hekara, still dripping, skipped up toward the throne.
"I like what youâve done with the place," she said. "Very #emph[you] , you know?" She bent to examine one of the twisted statues that made up the throne. "Nice chair, too. Must be tough to chisel out all the fiddly bits."
"That was . . . not a problem," Vraska said, grinning in spite of herself. "What are you doing here, Hekara? Have you come to speak on behalf of Rakdos?"
"Nope. His Flaminghood is right pissed at you for the whole . . . thing. Doesnât like being betrayed, he says, which is weird because heâs always betraying everybody else, right? Demons!" She laughed, though it sounded a little forced. "Iâm not here on anyoneâs behalf. Just mine."
"All right," Vraska said. "What is it you want to say?"
"Iâve thought about what happened," Hekara said. "Anâ I think you should come back."
"Come back," Vraska said, deadpan.
"Yeah." Hekara bounced on the balls of her feet. "âCause weâre mates. You and me and Ral. We shouldnât be fighting each other."
"Ral is probably . . . âright pissedâ at me as well."
"Eh. Heâll get over it." Hekara waved a hand. "Heâs got a new thing which Iâm not supposed to talk about, which is okay because it doesnât make much sense to me, and he gets on these long tangents when he hasnât gotten enough sleep and starts drawing on the walls, and now I think Iâm lost and I forgot what I was saying. But #emph[anyway] you should come back because weâre mates and Iâve got no hard feelings and heâll stop being mad eventually."
"Thatâs quite an offer," Vraska said, leaning back in her throne again.
"I thought so," Hekara said. "So youâll come?"
"Unfortunately, I donât think itâs that simple."
Hekaraâs brow creased. "Why not?"
"I have . . . responsibilities."
"Burn âem!" Hekara said promptly.
"Burnâ" Vraska shook her head.
"Burning solves most things, I find," Hekara said.
"Itâs not . . ." Vraska took a deep breath. "The Golgari need me. I have a duty to protect them."
"My old teacher used to say, youâve got three duties. Listen to your boss, look after your mates, and look after yourself." Hekara cocked her head. "You #emph[are] the boss, so thatâs number one taken care of. You can bring your bug-friend with you if you want. Iâll keep him in my room. Nobody will find out."
"I canât, Hekara," Vraska said, gently.
"But you canât stay here." Hekaraâs lip quivered. "Or else youâll end up fighting Ral. And youâre #emph[mates] . I tried to tell him the same thing, but he wouldnât listen. Heâs got that dragon for a boss, though, and you donât, so I thought . . ."
#emph[I have another dragon entirely.] Vraska kept the thought to herself. #emph[Even if I didnât have Bolas, Iâd still have the Golgari people to answer to.]
"Iâm sorry," Vraska said.
"Youâre #emph[stupid] ," Hekara said, stomping her foot. "And so is Ral. You donât #emph[understand] ."
She spun on her heel and stalked out, leaving a trail of damp footprints. A few moments later, Xeddick reappeared.
#emph[Your visitor has fallen in the moat again] , he said.
"Fish her out," Vraska said. "And make sure she gets back to the surface safely."
It was the least she could. #emph[The only thing I can do.]
#emph[And the defenses?] the kraul said, gesturing at the map with a forelimb.
"Tell Mazirek and his people to start laying them out," Vraska said. "As quickly as he can. We donât have much time."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kaya followed <NAME> to Teysaâs office, walking down the elegantly furnished hallways of the most privileged parts of Orzhova. Up here, it definitely looked more like a bank than a church, with frowning portraits of past Orzhov notables on every wall, gilt furnishings, and lots of marble. Tomik paused in front of a set of double doors carved with an elaborate frieze, and Kaya came to an awkward halt beside him.
#emph[If Iâm the guildmaster] , she thought, #emph[why do I feel like Iâm the one getting called on the carpet?]
Tomik rapped lightly on the wood. Teysaâs voice came from inside. "Yes?"
"Iâve brought the guildmaster, <NAME>, as you asked."
"Of course. Come in." There was a coldness in Teysaâs words that Kaya didnât like the sound of.
They entered. Teysaâs office was almost entirely marble, with a fire roaring in a massive hearth that made it nearly stifling. Tall, narrow windows occupied the wall behind the great hardwood desk, lashed by rain. Lightning flashed from cloud to cloud outside, and Kaya heard a low roll of thunder.
Teysa, sitting between two stacks of large, leather-bound books, looked up from the ledger sheâd been writing in and gave a humorless smile.
"Guildmaster," she said.
"Um . . . Teysa." Kaya wasnât sure of her official title. "Howâs it going?"
"I have been going over the numbers," Teysa said, gesturing at the books.
"I can see." Kaya glanced at Tomik, whoâd taken an unobtrusive place in the corner. "I thought you had people for that?"
"The leader of the Orzhovâthe #emph[guildmaster] âshould have a personal appreciation of the state of our accounts. We are, after all, a bank. The balance of our assets against outstanding obligations is a matter of grave concern."
"Right." Kaya shrugged. "Look, we both know thatâs not something #emph[Iâm] going to be able to do, so if thatâs what this is aboutâ"
Teysa looked up, expression cold with suppressed anger. "I #emph[am] aware of that. In fact, you agreed to stay well away from Orzhov policy as guildmaster, and leave those matters to me. But now . . ." She tapped her finger on the ledger. "The numbers donât add up."
Kaya feigned confusion. "I donât understand."
"Let me make it simple, then. Youâve been forgiving debts, without consulting me or any other Orzhov official."
"I . . ." #emph[Hell with it.] Kaya shook her head. "All right, so what if I have? It hasnât been that manyâ"
"Sixty-seven people, to date. To a total value of two hundred forty-six thousand three hundred twelve zinos net present value, assuming . . . well, any number of things."
"Iâm sure the Orzhov can afford it," Kaya said. "I can #emph[feel] our contracts, remember. These are only a tiny fraction of them."
"Whether we can #emph[afford] it is not the point," Teysa said, her voice rising. "You promised me you would keep out of Orzhov business."
"It doesnât matter if I #emph[want] to stay out of it, or what we agreed to," Kaya said. "You told all these people that Iâm the guildmaster. Can you blame them when they treat me like it?"
"Iâm not blaming #emph[them] . Just tell them no!"
Kaya felt her anger rising. "Why? So you can keep extracting debts from their great-grandchildren?"
Teysaâs pale face colored. "Every contract the Orzhov enter into is in accordance with Ravnican law, and voluntary on both sides. We are only enforcing our rights."
"Sure. Some poor bastard wants to pay a doctor to help his wife, and that gives you the #emph[right] to work his family like slaves for the next three generations."
"He was told the terms. He could always choose not to signâ"
"And let his loved ones die." Kaya shook her head. "Donât you understand that what youâre doing to these people is wrong?"
"We arenât doing anything!" Teysa said. "Whatever happens to them, they bring on themselves. We only . . . facilitate."
They stared at one another for a long moment. Teysa had her hands flat on the ledger, breathing hard. Kaya grit her teeth.
"Regardless of your . . . scruples," Teysa said, in careful tones, "as a practical matter we cannot simply forgive our debtors. The Orzhov has obligations of our own, and we must have income to meet them. If we were to default, the consequences for Ravnica would be incalculable."
"Just because youâve tied yourself in a knot doesnât mean you have to keep pulling it tighter," Kaya said. "It doesnât mean you canât try to work yourself loose, a little at a time."
"Kaya . . ." Teysa put her hand to her forehead. "If we did what you wanted, then it would mean the destruction of the guild."
"If the guild depends on enslaving children for the debts of their fathers, then maybe it deserves to be destroyed."
"I hope those words wonât leave this room," Teysa said, with a sharp glance at Tomik. "Or I wonât be responsible for the consequences."
"Very subtle," Kaya said.
"I am trying to #emph[help] you. All you have to do is . . ." Teysa waved a hand vaguely. "Nothing. Sit on the throne and mouth a few empty platitudes. Wave at official functions. When our lawmages figure out how to extract you from our obligations, you will be free to go, with my blessing. Until thenâ"
"Until then, I just let everyone think Iâm okay with being the head of this organization?" Kaya heard her own voice rising. She hadnât realized, until that moment, how strongly she felt. "However it happened, I have the power to change things for the better here. Donât tell me not to use it."
"Apparently, I canât tell you anything," Teysa said. "Except that you should watch your back."
"Fortunately for all of us," Kaya snapped, "Iâm good at that."
She got to her feet and stalked away. Tomik hurried over, to open the double doors, but Kaya simply strode through them in a burst of purple light.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
For Ral, the apartment in Dogsrun was supposed to have been a refuge. Unfortunately, at the moment, it felt like that refuge was under siege by the rest of Ravnica. He let himself in, a few drops of rain spattering around him, and slammed the door against the driving wind.
Thunderstorms usually made him feel a kind of euphoria. All that power, coursing freely through the air, brilliant streams of energy writing themselves across his skin in trails of fire. He could reach out and touch it, taste it, smell the ozone heat. Now, though . . .
#emph[Itâs not enough.] Lightning bolts could crack stone and melt steel. But they couldnât make the wheels of bureaucracy grind faster, or triangulate resonators more accurately, or align mizzium coils. #emph[They canât make a bunch of bloody idiots do what theyâre told.]
They were making progress. The resonators were going up, all across the Tenth District, humming, spinning contraptions of mizzium, crystal, and steel. Each had to be painstakingly sited, then adjusted so that its main coils rotated with just the correct frequency and direction with respect to its fellows. Done properly, they would form a network, amplifying and altering the magical field of the Guildpact just enough that Niv-Mizzet could get what he wanted.
One mistake, though, and all their efforts would be worse than useless. The resonators would fail, or worse. The potential power of a destructive resonance was devastating. Ral had neglected to mention that to the other guilds, when heâd been explaining the plan.
#emph[But if we fail, none of it matters.] He could almost feel Bolasâs hot breath on the back of his neck. The dragon was #emph[coming] , closer and closer, and if the resonators werenât ready in time then the only thing that would stand between him and Ravnica would be the Beacon, Niv-Mizzetâs desperate backup plan. #emph[Shouting into the void, and hoping somebody answers.] Ral shuddered. #emph[If we have to rely on ] that#emph[, then weâre probably doomed.]
The lock clicked, and Ral realized he was still leaning against the door. He stepped out of the way before it opened again to reveal Tomik, huddled under a wet raincoat and clutching a paper sack. He raised an eyebrow at Ral and adjusted his glasses.
"Um. I brought curry?" he said. "The kind you like. Can I come in?"
Ral realized he was still standing in the doorway, and hurriedly stepped aside. "Sorry."
"Itâs all right," Tomik said, coming inside. "Itâs not like itâs absolutely pouring. Not all of us have our own personal magical umbrella, you know?"
"Even I get wet on days like this," Ral groused. "Too much wind."
"You have my utmost sympathy." Tomik tossed the bag of curry on their little table. He took off his rain-spotted glasses, went to wipe them on his shirt, and stopped when he found it already soaked. "Have you got aâ"
Ral came up behind him and put a hand on his shoulder, turning him round. Before Tomik could finish the sentence, he kissed him, with all the pent-up frustration and worry of the past few days. Tomik stumbled back a step, against the wall, and Ral pressed hard against him.
"âtowel?" Tomik finished weakly, when Ral finally pulled away for a moment. He took a deep breath. "The curry . . ."
"Later," Ral growled.
"Later," Tomik agreed, laying his glasses carefully on the table.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Later arrived, as it tends to do, with depressing haste.
"I know what #emph[Iâm] worried about," Ral said. They were in the bedroom, and he was pacing in front of the broad window. Lightning flashed on the horizon, connecting some tower to the sky for a moment, and Ral raised his hands and let an answer crackling walk across his knuckles. He ran one hand through his sweat-damped hair and let a crackle of electricity restore its frizz. "Whatâs eating #emph[you] ?"
"Who says anythingâs eating me?" Tomik muttered. He was still lying in bed, his lanky frame covered only by a thin bedsheet. Ral watched his reflection in the window with an appreciative eye when he rolled over and sighed.
"Youâre sulking," Ral said.
"Iâm not sulking, Iâm thinking," Tomik said. "You might try it sometime."
"Fine," Ral said. "So what are you thinking?"
"Guild business," Tomik said, and sighed.
Ral looked over his shoulder. Tomikâs brow was creased, and for a moment Ral wanted to push him further. But theyâd always kept their respective positions out of their relationship, and while Ralâs circumstances had changedâ#emph[if I succeed, no one in Izzet would dare challenge me, and if I fail, it wonât matter] âTomikâs had only gotten more confused, with his master Teysa now serving under the Planeswalker Kaya.
"You know you have my help, if you need it," Ral said, after a moment of silence.
"Thank you." Tomik sat up and fumbled for his glasses. "Itâs . . . complicated."
"Iâm sure." Ral cocked his head. "Curry?"
"Curry," Tomik agreed.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
 #linebreak "The Gruul have stepped up their attacks across the Tenth District," Aurelia said. Her glowing eyes were hard to read, but Ral thought there was a hint of concern on even the angelâs beatific face. "Our garrisons along the rubblebelts are assailed almost daily. There are more of them then we imagined, and theyâre better organized. It is regrettable you did not capture this Domri; his leadership appears highly capable."
"Apologies," Ral said. "We were a little bit busy. How is <NAME>, by the way?"
"Injured, but she will recover." Aurelia inclined her head at the map on the war room table. "Unfortunately, I fear our contribution to your effort against the Golgari will be less than I initially anticipated."
"Understandable," said <NAME>. "The Senate will provide what it can, as I promised, but our numbers are limited."
"Iâve spoken with the Firemind about employing some of our more . . . effective assets for the attack," Ral said. "But with the need to build and protect the resonators, weâre spread thin as well."
"I was under the impression that Rakdos would be contributing to the effort," Aurelia said.
"So was I," Ral muttered under his breath. He hadnât seen Hekara for days, and while it was nice not to have her constantly underfoot, he was starting to worry. #emph[At least the resonator in Rakdos territory is still on schedule, even if we keep having to drag the workers out of the clubs.] "Iâll see what I can do, but time is short. Kaya, do you think your people can make up the numbers?"
"They can," Kaya said firmly. "We can, I mean. Name the time and place, and weâll be there."
"The time is tomorrow," Ral said. He shuffled the maps until he found one that showed the Undercity, more a collection of fragmentary sketches than a solid depiction of that notoriously chaotic domain. But the chamber he wanted was marked clearly enough, a vast circular cavern with an underground waterway running through the heart of it. "And the place is here. Grekâospen, the Golgari call it."
"This large space," Aurelia said, leaning closer to the map. Her folded wings nearly brushed the ceiling. "It is open ground?"
"I donât think so," Ral said. "As best our scouts can tell, itâs some kind of hive belonging to the giant insects allied with the Golgari."
"The kraul," <NAME> said. "A fascinating species. Eusocial behavior is exceedingly rare among full sentients."
"It will not be good ground for battle," Aurelia said. "Cluttered and confused. Ideal for the Golgari."
"Unfortunately," Ral said, "we donât have a choice. The node we need is there. And Vraska probably knows weâre coming." Far too many people had worked on the plan for there to be a real chance of concealing it from Golgari spies, even with Lazav doing his best to weed out Vraskaâs agents. "We should plan on a difficult fight."
"I understand," Aurelia said. "I will lead our forces personally." At Ralâs look of surprise, the angel raised one delicate eyebrow. "I committed the Legion to your cause, and I take my promises seriously. This is the best way to assure success."
"While I regret I will not be able to join the expedition," <NAME> said, "our best soldiers will be with you."
"And Iâll be there, of course," Kaya said, leaning forward. "Frankly, I could use the action."
"Right, then," Ral said. "Tomorrow."
#emph[And if Vraska shows herself, Iâll get the chance to nail her traitorous head to the wall.]
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/visualize/path_01.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
//
// // Error: 7-9 path vertex must have 1, 2, or 3 points
// #path(()) |
https://github.com/ryuryu-ymj/mannot | https://raw.githubusercontent.com/ryuryu-ymj/mannot/main/src/lib.typ | typst | MIT License | #import "mark.typ": mark, core-mark
#import "annot.typ": annot, core-annot
|
https://github.com/choglost/LessElegantNote | https://raw.githubusercontent.com/choglost/LessElegantNote/main/pages/elegant-cover.typ | typst | MIT License | #import "../utils/style.typ": åå·, åäœ
#let elegant-cover(
// documentclass äŒ å
¥çåæ°
twoside: false,
info: (:),
// datetime-display: datetime-display,
) = {
// 1. é»è®€åæ°
info = (
title: ("LessElegantNote\näžäžªTypstç¬è®°æš¡ç"),
author: "åŒ äž",
date: datetime.today(),
cover-image: "",
) + info
// 2. 对åæ°è¿è¡å€ç
// å€çæ亀æ¥æ
if type(info.date) == datetime {
info.date = info.date.display("[year]/[month]/[day]") //[year]幎[month]æ[day]æ¥
}
// // åŠææ¯å笊䞲ïŒå䜿çšæ¢è¡ç¬Šå°æ é¢åé䞺åè¡š
if type(info.title) == str {
info.title = info.title.split("\n")
}
// 3. æ£åŒæž²æ
// pagebreak(weak: true, to: if twoside { "odd" })
set page(margin: 0pt)
if info.cover-image != "" {
image(info.cover-image, width: 100%, height: 55%)
v(20pt)
} else {
}
set align(horizon)
for s in range(info.title.len()) {
text(font: åäœ.å®äœ, size: åå·.äžå·)[#h(40pt)*#info.title.at(s)*]
v(20pt)
}
text(font: åäœ.楷äœ, size: åå·.å°å)[#h(50pt)äœè
ïŒ#info.author]
v(0pt)
text(font: åäœ.楷äœ, size: åå·.å°å)[#h(50pt)æ¥æïŒ#info.date]
v(50pt)
} |
https://github.com/rlpundit/typst | https://raw.githubusercontent.com/rlpundit/typst/main/Typst/fr-Rapport/chaps/chpt1.typ | typst | MIT License | /* ------------------------------- NE PAS MODIFIER ------------------------------ */
#import "../common/metadata.typ": title, chap1
#set page(header: smallcaps(title) + h(1fr) + emph(chap1) + line(length: 100%))
#text(white)[= #chap1 <chp:chap1>]#v(-1cm)
/* ------------------------------------------------------------------------------ */
== Introduction
#lorem(32)
== Section 1
#lorem(16)
=== Sous-section 1.1
#lorem(64)
=== Sous-section 1.2
#lorem(64)
== Section 2
#lorem(16)
=== Sous-section 2.1
#lorem(64)
=== Sous-section 2.2
#lorem(64)
#figure(
image("images/typst.svg", width: 40%),
caption: "Typst logo",
) <fig:typst-logo>
@fig:typst-logo affiche le logo de `Typst`.
#figure(
table(
columns: (auto, auto, auto),
[a], [b], [c], [$a$], [$b$], [$c$],
),
caption: "Une table",
) <tab:une-table>
@tab:une-table montre un tableau.
== Conclusion
#lorem(32)
|
https://github.com/rabotaem-incorporated/algebra-conspect-1course | https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/05-group-theory/08-group-on-set.typ | typst | Other | #import "../../utils/core.typ": *
== ÐейÑÑвОе гÑÑÐ¿Ð¿Ñ ÐœÐ° ЌМПжеÑÑве
#ticket[ÐейÑÑвОе гÑÑÐ¿Ð¿Ñ ÐœÐ° ЌМПжеÑÑве. ÐпÑеЎелеМОе О пÑОЌеÑÑ]
#def[
ÐЎеÑÑ Ðž Ўалее $G$ --- гÑÑппа, $X$ --- ЌМПжеÑÑвП.
ÐейÑÑвОе $G$ Ма $X$ --- гПЌПЌПÑÑОзЌ, $G --> S(X)$.
($S(X)$ --- ЌМПжеÑÑвП бОекÑОй Оз $X$ Ма ÑебÑ.)
]
#def[
ÐейÑÑвОе $G$ Ма $X$ --- ПÑПбÑажеМОе
$
G times X &--> X\
(g, x) &maps g x
$
Ñ ÐŽÐ²ÑÐŒÑ ÑвПйÑÑваЌО:
+ $g_1 (g_2 x) = (g_1 g_2) x space.quad forall g_1, g_2 in G, x in X$
+ $e x$ = $x space forall x in X$
]
#proof(name: [СПпПÑÑавлеМОе ПпÑеЎелеМОй])[
ÐППбÑе гПвПÑÑ, вМеÑМе ÑÑО Ўва ПпÑÐµÐŽÐµÐ»ÐµÐœÐžÑ Ð¿ÐŸÑÑО МОкак Ме ÑвÑзаМÑ. ÐÑ ÐŸÐ¿ÑеЎелОлО Ўва вППбÑе ÑазМÑÑ
ПбÑекÑа. ÐПÑÑÐŸÐŒÑ ÐŒÑ ÐŽÐŸÐºÐ°Ð·ÑваеЌ, ÑÑП ÐŒÐµÐ¶ÐŽÑ ÑÑОЌО ПбÑекÑаЌО ÑÑÑеÑÑвÑÐµÑ Ð¿ÐŸÐœÑÑМПе ÑППÑвеÑÑвОе.
"$1 ==> 2$":
$phi: G --> S(X)$ --- гПЌПЌПÑÑОзЌ, ÑПгЎа ÑаÑÑЌПÑÑОЌ
$
G times X &--> X\
(g, x) &maps phi(g)(x)
$
ÐÑПвеÑОЌ ÑвПйÑÑва:
+ $phi(g_1)(phi(g_2)(x)) = phi(g_1 g_2)(x)$
+ $underbrace(phi(e), id_X)(x) = x$
"$2 ==> 1$": РаÑÑЌПÑÑОЌ $psi: G times X --> X$ О ПÑПбÑажеМОе $phi$:
$
G &limits(-->)^phi S(X)\
g &maps (x maps g x) #[--- ÑÑП бОекÑÐžÑ (еÑÑÑ ÐŸÐ±ÑаÑÐœÑй к $x$)]
$
ÐÑПвеÑОЌ, ÑÑП ÑÑП гПЌПЌПÑÑОзЌ:
$
phi(g_1 g_2) x = (g_1 g_2) x = g_1 (g_2 x) = phi(g_1) (phi(g_2) x).
$
]
#example(plural: true)[
+ $G = A_n, space X = {1, ..., n}$, $phi: A_n overbrace(arrow.r.hook, #place(move(dy: -1em, [#box(scale(sym.arrow.b.curve, x: -100%)) ОМÑекÑОвМПе ПÑПбÑажеМОе]))) S_n, (phi = i_(A_n))$
+ $G = D_n, space X #[--- плПÑкПÑÑÑ, $X supset P$ --- пÑавОлÑÐœÑй пÑÑОÑгПлÑМОк], space D_n < S(X), space phi = i_(D_n)$
+ $G = RR, space X = CC$
$
G times X &--> X\
(a, z) &maps (cos(2 pi a) + i sin (2 pi a))z
$
+ $G$ --- гÑÑппа, $X = G$
$
G times X &--> G\
(g, h) &maps g h
$
+ $G$ --- гÑÑппа, $X = G$
$
(g_1 h) = g h g_(-1) \
(g_1 g_2)h(g_1 g_2)^(-1) = g_1 (g_2 h g_2 ^(-1)) g_1^(-1)
$
+ $G = S_n, space X = RR^n$
$
sigma vec(alpha_1, dots.v, alpha_n) = vec(alpha_(sigma(1)), dots.v, alpha_(sigma(n)))
$
+ $G = S_n, space X = V$ --- лОМейМПе пÑПÑÑÑаМÑÑвП Ñ Ð±Ð°Ð·ÐžÑПЌ $e_1, ..., e_n$ $
sigma(alpha_1 e_1 + ... + alpha_n e_n) = alpha_1 e_(sigma(1)) + ... + alpha_n e_(sigma(n))
$.
]
#ticket[ÐÑбОÑÑ Ðž ÑÑабОлОзаÑПÑÑ]
#def[
ÐÑÑÑÑ $G$ ЎейÑÑвÑÐµÑ ÐœÐ° $X$, $x in X$. _ÐÑбОÑа_ $x$ --- ÑÑП ЌМПжеÑÑвП
$
G x = {g x bar g in G}
$
]
#def[
ÐÑÑÑÑ $x in X$. _СÑабОлОзаÑПÑ_ $x$:
$
St_x = {g in G bar g x = x} < G
$
]
#pr[
ÐÑÑÑÑ $abs(G) < infinity$, $G$ ЎейÑÑвÑÐµÑ ÐœÐ° $X$. ТПгЎа
$
forall x in X: abs(G) = abs(St_x) dot abs(G x)
$
]
#proof[
РаÑÑЌПÑÑОЌ (зЎеÑÑ ÐžÐŽÐµÑ ÑеÑÑ ÐŸ ЌМПжеÑÑве левÑÑ
ÑЌежМÑÑ
клаÑÑПв, $St_x$ Ме ПбÑзаМ бÑÑÑ ÐœÐŸÑЌалÑМПй пПЎгÑÑппПй!)
$
G fg St_x &limits(-->)^phi G x \
g &maps g x
$
ÐПкажеЌ кПÑÑекÑМПÑÑÑ $phi$:
$
g_2 = g_1 h "гЎе" h in St_x, space g_2 x = g_1 h x = g_1 x.
$
$G x = Im phi$ --- пП ПпÑеЎелеМОÑ. ÐÑПвеÑОЌ, ÑÑП $phi$ --- ОМÑекÑОвМа:
$
g_2 x = g_1 x &==> g_1^(-1) (g_2 x ) = g_1^(-1) (g_1 x) = x \
&==> g_1^(-1) g_2 in St_x ==> g_2 in g_1 St_x.
$
]
#ticket[ЊеМÑÑ ÐºÐŸÐœÐµÑМПй $p$-гÑÑппÑ]
#def[
$G$ --- гÑÑппа. ТПгЎа _ÑеМÑÑ Ð³ÑÑппÑ_ --- ÑÑП
$
Z(G) = {h in G bar forall g in G: h g = g h}.
$
]
#pr[
ÐÑÑÑÑ $abs(G) = p^n$, $p$ --- пÑПÑÑПе, $n in NN$. ТПгЎа
$Z(G) != {e}$
]
#proof[
ÐÑÑÑÑ $G$ ЎейÑÑвÑÐµÑ ÐœÐ° Ñебе ÑПпÑÑжеМОеЌ ($(g, x) maps g x g^(-1)$). РаÑÑЌПÑÑОЌ $h in G$. ТПгЎа
$
G = union.big_(i in I) C_i, "гЎе" C_i #[--- ПÑбОÑÑ], \
abs(G) space dots.v space abs(C_i) ==> abs(C_i) = p^m "ЎлÑ" 0 <= m <= n.
$
ÐбПзМаÑОЌ за $k_i$ ÑОÑлП ПÑÐ±ÐžÑ ÑазЌеÑа $p^i$. ТПгЎа
$
p^n = abs(G) = k_0 mul 1 + k_1 mul p + dots + k_n mul p^n ==> p bar k_0 \
k_0 >= 1, "Ñак как ПÑбОÑа" e "ÑПÑÑÐŸÐžÑ ÑПлÑкП Оз " e", МП" p >= 2
$
ÐПзвÑаÑаеЌÑÑ Ðº ÑÑебÑеЌПЌÑ:
$
abs(G h) = 1 &<==> abs({g h g^(-1) bar g in G}) = 1 \
&<==> forall g in G: g h g^(-1) = h \
&<==> h in Z(G)
$
ТакОЌ ПбÑазПЌ $abs(Z(G)) >= p$.
]
|
https://github.com/SillyFreak/tu-wien-software-engineering-notes | https://raw.githubusercontent.com/SillyFreak/tu-wien-software-engineering-notes/main/optimizing-compilers/notes.typ | typst | #import "../template/template.typ": notes
#import "oc/oc.typ": instr, succ, pred, Spec, Func, fw, bw, Const, Id, Vars, Consts, Terms, Ops, Eval, path, Paths, CM, BCM, ALCM, LCM, SpCM, Insert, Repl, Comp, Transp, Safe, Correct, Available, VeryBusy, Earliest, Delayed, Latest, Isolated
#import "oc/lattices.typ": *
#import "oc/flow-graphs.typ": *
#show: notes.with(
title: "Optimizing Compiler Notes",
authors: (
"<NAME>, 01126573",
),
)
#[
#set heading(numbering: none)
= License
This work ©2023 by <NAME> is licensed under CC BY-SA 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/
= Revision history
- no "published" version yet.
= About this document
This document is based on Uwe Egly's Optimizing Compilers lecture at Vienna University of Technology; particularly from taking it in the 2022/23 winter term and refreshing my knowledge on it mid-2023. Corrections and additions are welcome as pull requests at
https://github.com/SillyFreak/tu-wien-software-engineering-notes
This document leaves out several details and was written primarily for me, but I hope it is useful for other people as well. Among the things one reading it should keep in mind:
- This is not a replacement to Prof. Egly's slides or the lecture in any way. Much of the information may require context and/or preliminaries found in the slides or in the lecture.
- I liberally skip proofs. They make up a large part of the professor's slides, and I don't think it would be very useful to repeat them here.
- In general, I skip formal definitions where they were basic enough for me; for example, I gloss over structure and semantics of programs, which are important for most program analyses. Your mileage may vary.
- I skip chapters 1 (Motivation) and 2 (Classical Gen/Kill Data Flow Analyses) in favor of starting with the DFA framework, which subsumes that material anyway.
- The document is in general still incomplete.
- I am fallible and make errors or overlook some points' importance.
If you have questions, feel free to reach out on Github. I may at least occasionally be motivated enough to answer questions, extend the document with explanations based on your question, or help you with adding it yourself.
#pagebreak()
]
= The DFA framework
In the general data flow analysis framework, a DFA problem on an edge-labelled flow graph $G$ is formulated through a lattice with corresponding local semantics and some additional meta-information. The lattice is formed in some _carrier set_, $Carrier$:
$
Spec_G
&= (Lattice(Carrier), Func(), c_s , d) \
"where"
Lattice(Carrier) &= (Carrier, rel, meet, join, bot, top) \
Func() &: E -> Carrier -> Carrier \
c_s &in Carrier \
d &in {fw, bw}
$
$Func()$ is the DFA functional that returns for each edge a function defining the semantics of that edge. For example, if $instr_e = skip$, then $Func(e: e) = Id_Carrier = lambda c. c$. For other instructions, the semantics will vary by DFA specification. Whether the DFA functional is (for each edge) only monotonic or also distributive determines whether the MaxFP solution will only approximate or even coincide with the MOP solution.
$d$ is the direction of the problem, and $c_s$ is the initial information at the start/end node, depending on the direction.
= Gen/Kill analysis specification
#[
#let pointwise = $italic("pw")$
Gen/kill or bitvector analyses store a single bit of information for each node of the control flow graph, i.e. $Carrier := BB$. The term _bitvector_ analysis reflects that $n$ such analyses (e.g. the availability of $n$ expressions) can be carried out efficiently at the same time by combining boolean values into a bitvector, resulting in $Carrier := BB^n$. When doing so, the relevant connectives (e.g. $lt.eq$, $and$) are adapted to point-wise application (e.g. $lt.eq_pointwise$, $and_pointwise$). These two formulations are ultimately equivalent.
]
Depending on the quantification of the problem, the boolean lattice or its inverse is used:
$
Lattice(BB) :=
& (BB, and, or, lt.eq, "false", "true")
&quad& #[for universally quantified problems] \
Lattice(BB_or) :=
& (BB, or, and, gt.eq, "true", "false")
&& #[for existentially quantified problems]
$
#align(center)[
#grid(
columns: 2,
gutter: 4em,
figure(
caption: [Hasse diagram of $Lattice(BB)$],
numbering: none,
hasse-boolean
),
figure(
caption: [Hasse diagram of $Lattice(BB_or)$],
numbering: none,
hasse-boolean-inv
),
)
]
The DFA functional and direction depend on the specific analysis. In the DFA functionals, we will refer to some basic boolean functions:
$
Const_"true"
&= lambda b. "true" \
Const_"false"
&= lambda b. "false" \
Id_BB
&= lambda b. b
$
== Reaching definitions
A defintion of some variable $v$ is an assignment to that variable at a specific edge $accent(e, hat)$. The reach of a definition flows forward in the flow graph, until another definition shadows it.
$
Spec_G
& = (Lattice(BB_or), Func(), b_s, fw) \
"where" Func(e: e) &= cases(
Const_"true"
&quad& #[if $e = accent(e, hat)$, i.e. this is the site of the definition],
Const_"false"
&& #[if $instr_e$ redefines $v$],
Id_BB
&& #[otherwise],
)
$
== Available Expressions
An expression becomes available when it is computed and stops being available when a variable appearing in it is redefined. This is again a forward analysis. An expression needs to be available on all paths to be available at a node.
$
Spec_G
& = (Lattice(BB), Func(), b_s, fw) \
"where" Func(e: e) &= cases(
Const_"false"
&quad& #[if $instr_e$ redefines a variable appearing in the expression],
Const_"true"
&& #[if $instr_e$ computes the expression],
Id_BB
&& #[otherwise],
)
$
== Live variables
A variable $v$ is live at a node if it is later used on some paths before being redefined. The information flows backwards from the use sites, until a definition site is encountered.
$
Spec_G
& = (Lattice(BB_or), Func(), b_e, bw) \
"where" Func(e: e) &= cases(
Const_"true"
&quad& #[if $instr_e$ reads/uses $v$],
Const_"false"
&& #[if $instr_e$ redefines $v$],
Id_BB
&& #[otherwise],
)
$
== Very busy expressions
An expression is very busy at a node if, no matter what path is taken from the node, the expression is always used before any of the variables occurring in it is redefined. The information flows backwards from the use sites, until a definition site of one of the variables in the expression is encountered.
$
Spec_G
& = (Lattice(BB), Func(), b_e, bw) \
"where" Func(e: e) &= cases(
Const_"true"
&quad& #[if $instr_e$ computes/uses the expression],
Const_"false"
&& #[if $instr_e$ redefines a variable appearing in the expression],
Id_BB
&& #[otherwise],
)
$
#pagebreak(weak: true)
= Constant propagation
We now want to know whether a variable (or term) has, at some node, a known constant value. Both the variable and term version are undecidable, so we need conservative approximations.
Let's consider a few examples of pseudocode. In each example, we are interested in whether the printed variable is constant:
#align(center)[
#grid(
columns: 5,
gutter: 1.5em,
block(width: 2.5cm)[
```py
a = 0
b = a
print(b)
```
],
block(width: 2.5cm)[
```py
a = 0
b = a + 1
print(b)
```
],
block(width: 2.5cm)[
```py
if p: a = 0
else: a = 0
print(a)
```
],
block(width: 2.5cm)[
```py
if p: a = 0
else: return
print(a)
```
],
block(width: 2.5cm)[
```py
b = a * 0
print(b)
```
],
)
]
In the first example, `a` is constant and `b` is assigned this variable's value. Naturally, we want an analysis that recognizes that `b` has the constant value zero. In the second example, we are dealing with an arithmetic expression that contains only constant operands. Again, it is desirable to recognize `b` always has value one.
The third and fourth example demonstrates how joining control flow needs to be considered: as variable `a` is known to be _the same_ constant in both branches of example 3, its value after the conditional is that same value. As one branch _diverges_ in example 4, the other branch(es) determine the value after the conditional.
The last example shows how certain operations can result in constant results with non-constant operands: `a` is not known, yet `b` is known to be zero.
== Data domain & extended domain
To reason about values that variables/terms can take, we first need a data domain $DD$ (for which we require a distinguised element $bot in DD$). While in $Lattice(BB)$ and $Lattice(BB_or)$, the two values $"true"$ and $"false"$ are related through $rel$, for constant propagation, they have no meaning except for being distinct. We therefore work on a _flat lattice_ $FL_DD = (DD', subset.eq.sq, sect.sq, union.sq, bot, top)$, with the extended domain $DD' = DD union {top}$ containing another distinguished element:
#align(center)[
#grid(
columns: 2,
gutter: 4em,
figure(
caption: [Hasse diagram of $FL_BB$],
numbering: none,
hasse-flat-boolean
),
figure(
caption: [Hasse diagram of $FL_ZZ$],
numbering: none,
hasse-flat-integers(2)
),
)
]
We can now talk about _states_, which assign a value to each variable (this is why we require $bot in DD$: even variables not defined at some program points need to be covered). A state is thus a function $sigma: Vars -> DD$. We also define DFA states that allow all values of the extended domain: $sigma: Vars -> DD'$ and the sets of all (extended) states:
$
Sigma
&= { sigma | sigma in Vars -> DD } \
Sigma'
&= { sigma | sigma in Vars -> DD' }
$
This latter set is significant because we can construct a lattice on it by _pointwise ordering_ according to the ordering of $FL_(DD')$:
$
sigma rel_(Sigma') sigma'
&quad& #[iff $forall v in Vars: sigma(v) rel_(FL_(DD')) sigma'(v)$]
$
Or in words: two DFA states are related according to the lattice's ordering iff all variable assignments in these states are related. This results in pointwise meet and join operations as well, and two distinguished top and bottom states:
$
sigma meet_(Sigma') sigma'
&= lambda v. sigma(v) meet_(FL(DD)) sigma'(v) \
sigma join_(Sigma') sigma'
&= lambda v. sigma(v) join_(FL(DD)) sigma'(v) \
sigma_bot
&= lambda v. bot \
sigma_top
&= lambda v. top
$
$
Lattice(Sigma') = (Sigma', subset.eq.sq, sect.sq, union.sq, sigma_bot, sigma_top)
$
Consider some control flow examples again in light of this flat lattice:
#align(center)[
#grid(
columns: 3,
gutter: 2em,
block(width: 3cm)[
```py
if p: a = true
else: a = false
print(a)
```
],
block(width: 3cm)[
```py
if p: a = true
else: a = true
print(a)
```
],
block(width: 3cm)[
```py
if p: a = true
else: return
print(a)
```
],
)
]
Before exiting the conditional, we have two states $sigma_1$ and $sigma_2$, and right after a state $sigma_3 = sigma_1 meet sigma_2$. According to the lattice, we get
$
"Example 1:"
&quad& sigma_1(a) &= "true",
&thick&& sigma_2(a) &= "false"
&thick&& => sigma_3(a) &= bot \
"Example 2:"
&quad& sigma_1(a) &= "true",
&&& sigma_2(a) &= "true"
&&& => sigma_3(a) &= "true" \
"Example 3:"
&quad& sigma_1(a) &= "true",
&&& sigma_2(a) &= top
&&& => sigma_3(a) &= "true"
$
We can see that $bot$ means the value is unknown (not constant) and $top$ means the value does not exist (due to the divergence of the branch).
Since the $top$ value only represents impossibilities, we define another set $Sigma'_"Init"$ excluding those states that contain $top$ variable assignments:
$
Sigma'_"Init" = {sigma in Sigma' | forall v in Vars. sigma(v) != top}
$
== Variables, terms and operators
It is no longer sufficient (as it was for bitvector analyses) to just look at _what_ variables appear in expressions; to know whether an expression is constant, and if so what contstant it evaluates to, we need to consider _how_ an expression combines variables. We therefore consider the disjoint sets $Vars$ of variables, $Consts$ of constants, $Ops$ of operators, and $Terms$ of terms. The set of terms contains the syntaxtically possible combinations of the other three. On top of these, the semantics can be defined.
== (Extended) interpretation, evaluation function, state transformer
The (extended) interpretation $I_0$ ($I_0'$) describe the semantics of constants and operators; they can be thought of as "overloaded" for these two kinds of parameters:
$
I_0 &: cases(
Consts -> DD,
Ops -> (DD^k -> DD) &quad #[for a $k$-ary operator]
) \
I_0' &: cases(
Consts -> DD',
Ops -> (DD'^k -> DD') &quad #[for a $k$-ary operator]
)
$
These functions satisfy that
- if some of the operands of an operator are $bot$, the operation's result is $bot$; and
- (for the extended interpretation) otherwise, if some of the operands of an operator are $top$, the operation's result is $top$.
Based on that, the (extended) evaluation function $Eval$ ($Eval'$) is defined:
$
Eval &: Terms -> (Sigma -> DD) \
Eval' &: Terms -> (Sigma' -> DD')
$
Intuitively, these functions recursively apply themselves to parts of the expression, grounding themselves in $I_0$ ($I_0'$) for constants and operators, and in the current state for variables.
The exact form of these functions depends on the kind of constant propagation. For example, the term `a * 0` is not a simple constant, but it is a linear constant.
Likewise, the (extended) state transformer $Theta$ ($Theta'$) transforms an (extended) state into another based on the local semantics of an instruction:
$
Theta &: Sigma -> Sigma \
Theta' &: Sigma' -> Sigma'
$
With this, we can finally formulate a DFA specification for constant propagation:
$
Spec_G
& = (Lattice(Sigma'), Func(), sigma_s, fw) \
"where"
Func(e: e) &= Theta'_instr_e \
sigma_s &in Sigma'_"Init"
$
The difference between constant propagation specifications lies in how the extended evaluation function $Eval'$ deals with different kinds of terms:
== Simple constants
The simple constant analysis evaluates terms containing only constants and constant variables to non-$bot$ values:
$
Eval'(t)(sigma) &= cases(
sigma(v)
&quad #[if $t equiv v in Vars$],
I_0'(c)
&quad #[if $t equiv c in Consts$],
I_0'("op")(Eval'(t_1)(sigma), ..., Eval'(t_k)(sigma))
&quad #[if $t equiv ("op", t_1, ..., t_k)$]
)
$
== Copy constants
The copy constant analysis only deals with terms that are either constants themselves, or are just a variable reference. Other terms are assumed to be not constant. In other words, _copying_ one variable value into another variable is the only kind of constant _propagation_ that is performed:
$
Eval'(t)(sigma) &= cases(
sigma(v)
&quad #[if $t equiv v in Vars$],
I_0'(c)
&quad #[if $t equiv c in Consts$],
bot
&quad #[otherwise]
)
$
== Linear constants
The linear constants analysis limits itself to linear arithmetic terms: it considers terms of the form $c*v plus.circle d$ (with $c, d in Consts$, $v in Vars$, $plus.circle in {+, -}$) specifically (as well as other semantically equivalent forms such as $d eq.est 0*v + d$, $c*v eq.est c*v + 0$, etc.):
$
Eval'(t)(sigma) &= cases(
sigma(v)
&quad #[if $t equiv v in Vars$],
Eval_"SC" (t)(sigma)
&quad #[if $t equiv c*v plus.circle d$],
bot
&quad #[otherwise]
)
$
where $Eval_"SC"$ is the extended evaluation function for simple constants.
== Q constants (Kam & Ullman)
The Q constants analysis does not use a different evaluation function; instead, the MaxFP algorithm is modified slightly. Consider these code examples and a simple constant analysis on them:
#align(center)[
#grid(
columns: 2,
gutter: 2em,
block(width: 3cm)[
```py
if p:
a = 2
b = 3
else:
a = 2
b = 3
c = a + b
print(c)
```
],
block(width: 3cm)[
```py
if p:
a = 2
b = 3
else:
a = 3
b = 2
c = a + b
print(c)
```
],
)
]
In the first example, both $a$ and $b$ are constants after the conditional, but in the first example they are not; $a + b$, however, is a constant not detected by the simple constant analysis. Recall:
- Before exiting the conditional, we have $sigma_1$ with $a=2, b=3$ and $sigma_2$ with $a=3, b=2$.
- We compute $sigma_3 = sigma_1 meet sigma_2$ and find that in this state, $a=bot, b=bot$.
- We evaluate $Eval'(a+b)(sigma_3) = bot$.
The Q constants approach is now to perform the meet operation later:
- Before exiting the conditional, we have $sigma_1$ with $a=2, b=3$ and $sigma_2$ with $a=3, b=2$.
- We evaluate $Eval'(a+b)(sigma_1) = 5, Eval'(a+b)(sigma_2) = 5$.
- We compute the result $5 meet 5 = 5$ and thus detected the result as a constant.
Taking the meet "lazily" after the evaluation results in more evaluations overall, but improves precision. This approach can be generalized to taking the meet more than one step later.
== Finite constants
In contrast to the CP analyses so far, the finite constants analysis is based on _terms_: the problem illustrated for Q constants was that while previous analyses kept track of variable values (e.g. of $a$ and $b$), the value of terms such as $a+b$ was not remembered. If we stored $a+b=5$ as part of the information at the end of both branches, the MaxFP algorithm would naturally preserve and forward that information.
There are infinitely many possible terms, but fortunately, only a finite set of them needs to be considered (why?), leading to the name _finite constants_.
== Conditional constants
In previous examples, the predicate variable $p$ was left as an unknown; if however a condition is itself constant, this means we don't need to join control flows and can avoid the lossy meet operation at the end altogether.
To do so, we need to extend our domain to include boolean values: $DD_BB = DD union BB$, and extend our definitions to allow for comparisons and logical operators, so that boolean terms can be formed. On top of this, we use the flat lattice $FL_DD_BB$ and state lattice $Lattice(Sigma')$
== Value graph approach
TODO
#pagebreak(weak: true)
= Partial redundancy elimination (PRE)
PRE is an optimization that avoids recomputing the same value multiple times. The tool for this is moving computations to one or more earlier points in the flow graph (particularly outside a loop the original computation appeared in). Whenever these stored results are used, none of the variables used in the computation must have changed in the meantime ("correctness"). The three goals which can be traded are
- performance: minimize the number of computations done at runtime
- register pressure: minimize the amount of time a result needs to be held in a register
- code size: minimize the number of instructions in the flow graph
Classically, there is an additional requirement for the code motion: no program path that originally did not compute the value may be made to compute the value after code motion. This is called "safety", because the extra computation could result in a failure even though the branch originally containing the failing code wasn't taken.
Trading these in different ways leads to a taxonomy of multiple code motion strategies, for example:
- *Busy code motion* (BCM) moves calculations to the earliest opportunity. It is computationally optimal.
- *Lazy code motion* (LCM) moves calculations to the latest opportunity. It is computationally and lifetime optimal.
- *Sparse code motion* (SpCM) moves calculations to the latest position where the resulting program is code size optimal. Computational and lifetime optimality is not achieved, but no program of the same size is better.
== Code motions and admissibility
A code motion transformation ($CM$) of some candidate expression $t in Terms$ on a _node-labelled_ flow graph is defined by
- $Insert_CM (n)$: whether a computation of the form $h := t$, where $h$ is a new variable name, is inserted at the entry of node $n$;
- $Repl_CM (n)$: whether occurrences of $t$ are replaced by references to $h$ at $n$.
Obviously, not all CMs lead to correct code, thus we define admissibility: we want CMs that satisfy the following properties:
- Safety: a computation is only inserted on paths where the original program also computed the term. That means an insertion only happens at a node $n$ where the term is either available (= "up-safe": it has been computed without redefinition in the original program on all paths leading to $n$), or very busy (= "down-safe": it will be used without redefinition on all paths coming from $n$).
- Correctness: whenever $h$ is used, there is a definition of $h$ before that and $h$'s operands have not been redefined since then.
$
forall n in N. &&Insert_CM (n) &=> Safe(n) \
forall n in N. &&Repl_CM (n) &=> Correct_CM (n)
$
$
"where" quad
Safe(n) = &Available(n) or VeryBusy(n) \
Correct_CM (n) =
&forall path(#$n_1, ..., n_k$) in Paths[s, n]. exists i. \
&quad Insert_CM (n_i) and Transp^forall (path(#$n_i, ..., n_(k-1)$))
$
Where $Transp(n)$ means that $t$'s operands are not redefined at $n$ and $Transp^forall (p)$ extends that to apply to all nodes on path $p$.
=== Safety example
What follows is a node-labelled flow graph where the up- and down safety of the expression $a+b$ is highlighted in blue and green, respectively. The highlighted nodes are thus the ones where computations of the form $h := a+b$ may be inserted.
#align(center)[
#set text(size: 8pt)
#let node = stmt-node.with(width: 5.5em)
#let dummy-node = node.with(stroke: none)
#let av-node = node.with(fill: green)
#let vb-node = node.with(fill: blue)
#let vb-av-node(..opts) = {
move(dx: 4pt, dy: 4pt,
vb-node(inset: 0pt,
move(dx: -4pt, dy: -4pt,
av-node(..opts)
)))
}
#let nodes = (
// put something in column 1 so that spacing is correct
"dummy": ((0, 1), dummy-node()),
"1": ((0, 4), node()),
"2": ((1, 3), node($assign(a, c)$)),
"3": ((2, 3), av-node($assign(x, a+b)$)),
"4": ((2, 5), node()),
"5": ((3, 4), node()),
"6": ((4, 3), av-node()),
"7": ((4, 5), node()),
"8": ((5, 2), av-node()),
"9": ((5, 4), av-node()),
"10": ((6, 0), av-node($assign(y, a+b)$)),
"11": ((6, 2), av-node()),
"12": ((6, 4), av-node()),
"13": ((6, 6), av-node()),
"14": ((7, 2), av-node($assign(x, a+b)$)),
"15": ((7, 4), av-node($assign(x, a+b)$)),
"16": ((8, 3), vb-av-node($z := a+b$)),
"17": ((8, 5), av-node($x := a+b$)),
"18": ((9, 5), node()),
)
#let edge = edge.with(nodes: nodes)
#let edges = edges.with(nodes: nodes)
#node-labelled-graph(
node-padding: (-12pt, 20pt),
nodes: nodes,
..edges("1", "2", "3", "5", "6", "8", "11", "14", "16", "18"),
..edges("1", "4", "5", "7"),
..edges("6", "9", "12", "15", "16"),
..edges("17", "18"),
edge("11", "10", curve: 40deg),
edge("10", "11", curve: 40deg),
edge("12", "13", curve: -40deg),
edge("13", "12", curve: -40deg),
edge("12", "17", curve: 26deg),
edge("7", "18", curve: 60deg),
)
]
== Busy code motion (BCM)
BCM uses the earliestness principle to decide where to put computations, then eliminates redundant computations (i.e. those that can be replaced by referencing the new variable, e.g. $h$). Earliestness is defined as follows:
$
Earliest(n) = Safe(n) and cases(
"true"
&#[if $n$ is the start node],
limits(or.big)_(m in pred(n)) not Transp(m) or not Safe(m)
quad
&#[otherwise],
)
$
The BCM transformation is thus defined by
$
Insert_BCM (n) = Earliest(n) \
Repl_BCM (n) = Comp(n)
$
BCM is computationally optimal, but maximizes register pressure. Code size can grow.
== Lazy code motion (LCM)
LCM is both computationally and lifetime optimal. It moves computations to the latest possible point that still results in the minimum number of computations.
We first need the notion of delayability: a computation (of $t$) can be delayed to node $n$ when all paths to $n$ inlcude the earliest node for the computation, and these paths do not include a computation between the earliest node (inclusive) and $n$ (exclusive).
$
Delayed(n) =
&forall p in Paths[s, n]. exists i <= lambda_p. \
&quad Earliest(p_i) and not Comp^exists (p lr([i, lambda_p\[))
$
Similarly to $Earliest$, we now define $Latest$:
$
Latest(n) = Delayed(n) and (Comp(n) or or.big_(m in succ(n)) not Delayed(m))
$
This leads is to a precursor of LCM: the ALCM transformation is computationally and _almost_ lifetime optimal.
$
Insert_ALCM (n) = Latest(n) \
Repl_ALCM (n) = Comp(n)
$
As a simple example for how this is not lifetime optimal yet, take the simple example $assign(x, a+b)$. While there is no improvement to achieve, ALCM would still hoist the computation to directly before the original assignment: $assign(h, a+b); assign(x, h)$. Note that the "uselessness" of the hoisting depends on the CM transformation being applied.
We thus need to further consider a notion of _isolatedness_ regarding a specific CM transformation: a node $n$ is isolated if all paths from there to the end node that contain a replacement of $t$ at some later node $p_i$ satisfy that a computation was inserted at some node between $n$ (exclusive) and $p_i$ (inclusive).
We are specifically interested in isolatedness relative to the BCM transformation:
$
Isolated_CM (n) =
&forall p in Paths[n, e]. forall 1 < i <= lambda_p. \
&quad Repl_CM (p_i) => Insert_CM^exists (p lr(]1, i])) \
Isolated_BCM (n) =
&forall p in Paths[n, e]. forall 1 < i <= lambda_p. \
&quad Comp(p_i) => Earliest^exists (p lr(]1, i]))
$
A node $n$ is isolated (w.r.t. BCM) if either no path from there computes $t$ (at a later node than $n$), or if $t$ is computed on some paths, all computations on those paths are preceded by an earliest node that comes after $n$ and before or at the computation.
This allows us to specify the LCM transformation:
$
Insert_LCM (n) = Latest(n) and not Isolated_BCM (n) \
Repl_LCM (n) = Comp(n) and not (Latest(n) and Isolated_BCM (n))
$
// TODO are nodes 9, 12, 13 of the example graph isolated?
|
|
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/PianoDiProgetto/sections/PianificazioneSprint/TerzoSprint.typ | typst | MIT License | #import "../../functions.typ": glossary
=== Terzo #glossary[sprint]
*Inizio*: Venerdì 08/12/2023
*Fine*: Giovedì 14/12/2023
*Obiettivi dello #glossary[sprint]*:
- Apportare modifiche al sito vetrina per semplificare il processo di consultazione dei documenti;
- Proseguire la stesura delle _Norme di Progetto_, ponendo particolare attenzione su: spiegazione dei diagrammi #glossary[UML] dei casi d'uso utilizzati nell'_Analisi dei Requisiti_ e la descrizione dettagliata del significato e delle formule pertinenti alle metriche per la qualità ;
- Proseguire la stesura del _Piano di Progetto_, con l'aggiornamento di pianificazione e preventivo pertinenti allo #glossary[sprint] 3 e l'inserimento del consuntivo pertinente allo #glossary[sprint] 2;
- Proseguire la stesura dell'_Analisi dei Requisiti_:
- Rimozione dei casi d'uso superflui in quanto pertinenti a sensori che si Ú deciso di eliminare;
- Inserimento dei diagrammi #glossary[UML] realizzati precedentemente;
- Classificazione dei requisiti funzionali in obbligatori, desiderabili e opzionali.
- Proseguire la stesura del _Piano di Qualifica_ con una bozza delle metriche da adottare per valutare la qualità dei processi primari e i processi di supporto e relativi valori di accettazione e ideali;
- Apportare migliorie al #glossary[PoC]:
- Migliorare la dimostrazione dell'andamento sinusoidale della temperatura aumentando la velocità di generazione dei dati per poter modellare una giornata in pochi minuti;
- Utilizzare la funzione aggregata "MovingAverage" per ottimizzare le query;
- Implementare ed utilizzare una funzionalità di filtraggio all'interno di #glossary[Grafana] per mezzo di #glossary[Grafana] variables.
|
https://github.com/tingerrr/hydra | https://raw.githubusercontent.com/tingerrr/hydra/main/CONTRIBUTING.md | markdown | MIT License | # Contribution
## Bug fixes
If you want to fix an issue please leave a comment there so others know you are working on it. If
you want to fix a bug which doesn't have an issue yet, please create an issue first. Exceptions are
typos or minor improvements, just making the PR will be enough in those cases.
## Features
When adding features, make sure you add regression tests for this feature. See the testing section
below on testing. Make sure to document the feature, see the manual section on manual and examples
below.
## Testing
To ensure that your changes don't break exisiting code test it using the package's regression tests.
This is done automatically on pull requests, so you don't need not install [typst-test], but it's
nontheless recommended for faster iteration. In general, running `typst-test run` will be enough to
ensure your changes are correct.
## Manual and examples
The manual and example images are created from a quite frankly convoluted nushell script. If you
have, or don't mind installing, [nushell], [just] and [imagemagick], then you can simply run `just
gen` to generate a new manual and examples.
The examples inside the docs currently don't make it easy to simplify this without generating them
manually the whole time. Typst is missing a feature or plugin that allows embedding whole other
Typst documents at the moment.
That being said, it's fine to leave this step out on a PR and have me generate it once the rest of
the PR is done.
[typst-test]: https://github.com/tingerrr/typst-test
[just]: https://just.systems/
[nushell]: https://www.nushell.sh/
[imagemagick]: https://imagemagick.org/
|
https://github.com/ryuryu-ymj/mannot | https://raw.githubusercontent.com/ryuryu-ymj/mannot/main/examples/usage3.typ | typst | MIT License | #import "/src/lib.typ": *
#set page(width: auto, height: auto, margin: (x: 2cm, y: 1cm), fill: white)
#set text(24pt)
#show: mannot-init
$
mark(x, tag: #<x>) // Need # before tags.
#annot(<x>)[Annotation]
$
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-2A00.typ | typst | Apache License 2.0 | #let data = (
("N-ARY CIRCLED DOT OPERATOR", "Sm", 0),
("N-ARY CIRCLED PLUS OPERATOR", "Sm", 0),
("N-ARY CIRCLED TIMES OPERATOR", "Sm", 0),
("N-ARY UNION OPERATOR WITH DOT", "Sm", 0),
("N-ARY UNION OPERATOR WITH PLUS", "Sm", 0),
("N-ARY SQUARE INTERSECTION OPERATOR", "Sm", 0),
("N-ARY SQUARE UNION OPERATOR", "Sm", 0),
("TWO LOGICAL AND OPERATOR", "Sm", 0),
("TWO LOGICAL OR OPERATOR", "Sm", 0),
("N-ARY TIMES OPERATOR", "Sm", 0),
("MODULO TWO SUM", "Sm", 0),
("SUMMATION WITH INTEGRAL", "Sm", 0),
("QUADRUPLE INTEGRAL OPERATOR", "Sm", 0),
("FINITE PART INTEGRAL", "Sm", 0),
("INTEGRAL WITH DOUBLE STROKE", "Sm", 0),
("INTEGRAL AVERAGE WITH SLASH", "Sm", 0),
("CIRCULATION FUNCTION", "Sm", 0),
("ANTICLOCKWISE INTEGRATION", "Sm", 0),
("LINE INTEGRATION WITH RECTANGULAR PATH AROUND POLE", "Sm", 0),
("LINE INTEGRATION WITH SEMICIRCULAR PATH AROUND POLE", "Sm", 0),
("LINE INTEGRATION NOT INCLUDING THE POLE", "Sm", 0),
("INTEGRAL AROUND A POINT OPERATOR", "Sm", 0),
("QUATERNION INTEGRAL OPERATOR", "Sm", 0),
("INTEGRAL WITH LEFTWARDS ARROW WITH HOOK", "Sm", 0),
("INTEGRAL WITH TIMES SIGN", "Sm", 0),
("INTEGRAL WITH INTERSECTION", "Sm", 0),
("INTEGRAL WITH UNION", "Sm", 0),
("INTEGRAL WITH OVERBAR", "Sm", 0),
("INTEGRAL WITH UNDERBAR", "Sm", 0),
("JOIN", "Sm", 0),
("LARGE LEFT TRIANGLE OPERATOR", "Sm", 0),
("Z NOTATION SCHEMA COMPOSITION", "Sm", 0),
("Z NOTATION SCHEMA PIPING", "Sm", 0),
("Z NOTATION SCHEMA PROJECTION", "Sm", 0),
("PLUS SIGN WITH SMALL CIRCLE ABOVE", "Sm", 0),
("PLUS SIGN WITH CIRCUMFLEX ACCENT ABOVE", "Sm", 0),
("PLUS SIGN WITH TILDE ABOVE", "Sm", 0),
("PLUS SIGN WITH DOT BELOW", "Sm", 0),
("PLUS SIGN WITH TILDE BELOW", "Sm", 0),
("PLUS SIGN WITH SUBSCRIPT TWO", "Sm", 0),
("PLUS SIGN WITH BLACK TRIANGLE", "Sm", 0),
("MINUS SIGN WITH COMMA ABOVE", "Sm", 0),
("MINUS SIGN WITH DOT BELOW", "Sm", 0),
("MINUS SIGN WITH FALLING DOTS", "Sm", 0),
("MINUS SIGN WITH RISING DOTS", "Sm", 0),
("PLUS SIGN IN LEFT HALF CIRCLE", "Sm", 0),
("PLUS SIGN IN RIGHT HALF CIRCLE", "Sm", 0),
("VECTOR OR CROSS PRODUCT", "Sm", 0),
("MULTIPLICATION SIGN WITH DOT ABOVE", "Sm", 0),
("MULTIPLICATION SIGN WITH UNDERBAR", "Sm", 0),
("SEMIDIRECT PRODUCT WITH BOTTOM CLOSED", "Sm", 0),
("SMASH PRODUCT", "Sm", 0),
("MULTIPLICATION SIGN IN LEFT HALF CIRCLE", "Sm", 0),
("MULTIPLICATION SIGN IN RIGHT HALF CIRCLE", "Sm", 0),
("CIRCLED MULTIPLICATION SIGN WITH CIRCUMFLEX ACCENT", "Sm", 0),
("MULTIPLICATION SIGN IN DOUBLE CIRCLE", "Sm", 0),
("CIRCLED DIVISION SIGN", "Sm", 0),
("PLUS SIGN IN TRIANGLE", "Sm", 0),
("MINUS SIGN IN TRIANGLE", "Sm", 0),
("MULTIPLICATION SIGN IN TRIANGLE", "Sm", 0),
("INTERIOR PRODUCT", "Sm", 0),
("RIGHTHAND INTERIOR PRODUCT", "Sm", 0),
("Z NOTATION RELATIONAL COMPOSITION", "Sm", 0),
("AMALGAMATION OR COPRODUCT", "Sm", 0),
("INTERSECTION WITH DOT", "Sm", 0),
("UNION WITH MINUS SIGN", "Sm", 0),
("UNION WITH OVERBAR", "Sm", 0),
("INTERSECTION WITH OVERBAR", "Sm", 0),
("INTERSECTION WITH LOGICAL AND", "Sm", 0),
("UNION WITH LOGICAL OR", "Sm", 0),
("UNION ABOVE INTERSECTION", "Sm", 0),
("INTERSECTION ABOVE UNION", "Sm", 0),
("UNION ABOVE BAR ABOVE INTERSECTION", "Sm", 0),
("INTERSECTION ABOVE BAR ABOVE UNION", "Sm", 0),
("UNION BESIDE AND JOINED WITH UNION", "Sm", 0),
("INTERSECTION BESIDE AND JOINED WITH INTERSECTION", "Sm", 0),
("CLOSED UNION WITH SERIFS", "Sm", 0),
("CLOSED INTERSECTION WITH SERIFS", "Sm", 0),
("DOUBLE SQUARE INTERSECTION", "Sm", 0),
("DOUBLE SQUARE UNION", "Sm", 0),
("CLOSED UNION WITH SERIFS AND SMASH PRODUCT", "Sm", 0),
("LOGICAL AND WITH DOT ABOVE", "Sm", 0),
("LOGICAL OR WITH DOT ABOVE", "Sm", 0),
("DOUBLE LOGICAL AND", "Sm", 0),
("DOUBLE LOGICAL OR", "Sm", 0),
("TWO INTERSECTING LOGICAL AND", "Sm", 0),
("TWO INTERSECTING LOGICAL OR", "Sm", 0),
("SLOPING LARGE OR", "Sm", 0),
("SLOPING LARGE AND", "Sm", 0),
("LOGICAL OR OVERLAPPING LOGICAL AND", "Sm", 0),
("LOGICAL AND WITH MIDDLE STEM", "Sm", 0),
("LOGICAL OR WITH MIDDLE STEM", "Sm", 0),
("LOGICAL AND WITH HORIZONTAL DASH", "Sm", 0),
("LOGICAL OR WITH HORIZONTAL DASH", "Sm", 0),
("LOGICAL AND WITH DOUBLE OVERBAR", "Sm", 0),
("LOGICAL AND WITH UNDERBAR", "Sm", 0),
("LOGICAL AND WITH DOUBLE UNDERBAR", "Sm", 0),
("SMALL VEE WITH UNDERBAR", "Sm", 0),
("LOGICAL OR WITH DOUBLE OVERBAR", "Sm", 0),
("LOGICAL OR WITH DOUBLE UNDERBAR", "Sm", 0),
("Z NOTATION DOMAIN ANTIRESTRICTION", "Sm", 0),
("Z NOTATION RANGE ANTIRESTRICTION", "Sm", 0),
("EQUALS SIGN WITH DOT BELOW", "Sm", 0),
("IDENTICAL WITH DOT ABOVE", "Sm", 0),
("TRIPLE HORIZONTAL BAR WITH DOUBLE VERTICAL STROKE", "Sm", 0),
("TRIPLE HORIZONTAL BAR WITH TRIPLE VERTICAL STROKE", "Sm", 0),
("TILDE OPERATOR WITH DOT ABOVE", "Sm", 0),
("TILDE OPERATOR WITH RISING DOTS", "Sm", 0),
("SIMILAR MINUS SIMILAR", "Sm", 0),
("CONGRUENT WITH DOT ABOVE", "Sm", 0),
("EQUALS WITH ASTERISK", "Sm", 0),
("ALMOST EQUAL TO WITH CIRCUMFLEX ACCENT", "Sm", 0),
("APPROXIMATELY EQUAL OR EQUAL TO", "Sm", 0),
("EQUALS SIGN ABOVE PLUS SIGN", "Sm", 0),
("PLUS SIGN ABOVE EQUALS SIGN", "Sm", 0),
("EQUALS SIGN ABOVE TILDE OPERATOR", "Sm", 0),
("DOUBLE COLON EQUAL", "Sm", 0),
("TWO CONSECUTIVE EQUALS SIGNS", "Sm", 0),
("THREE CONSECUTIVE EQUALS SIGNS", "Sm", 0),
("EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW", "Sm", 0),
("EQUIVALENT WITH FOUR DOTS ABOVE", "Sm", 0),
("LESS-THAN WITH CIRCLE INSIDE", "Sm", 0),
("GREATER-THAN WITH CIRCLE INSIDE", "Sm", 0),
("LESS-THAN WITH QUESTION MARK ABOVE", "Sm", 0),
("GREATER-THAN WITH QUESTION MARK ABOVE", "Sm", 0),
("LESS-THAN OR SLANTED EQUAL TO", "Sm", 0),
("GREATER-THAN OR SLANTED EQUAL TO", "Sm", 0),
("LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE", "Sm", 0),
("GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE", "Sm", 0),
("LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE", "Sm", 0),
("GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE", "Sm", 0),
("LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT", "Sm", 0),
("GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT", "Sm", 0),
("LESS-THAN OR APPROXIMATE", "Sm", 0),
("GREATER-THAN OR APPROXIMATE", "Sm", 0),
("LESS-THAN AND SINGLE-LINE NOT EQUAL TO", "Sm", 0),
("GREATER-THAN AND SINGLE-LINE NOT EQUAL TO", "Sm", 0),
("LESS-THAN AND NOT APPROXIMATE", "Sm", 0),
("GREATER-THAN AND NOT APPROXIMATE", "Sm", 0),
("LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN", "Sm", 0),
("GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN", "Sm", 0),
("LESS-THAN ABOVE SIMILAR OR EQUAL", "Sm", 0),
("GREATER-THAN ABOVE SIMILAR OR EQUAL", "Sm", 0),
("LESS-THAN ABOVE SIMILAR ABOVE GREATER-THAN", "Sm", 0),
("GREATER-THAN ABOVE SIMILAR ABOVE LESS-THAN", "Sm", 0),
("LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL", "Sm", 0),
("GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL", "Sm", 0),
("LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL", "Sm", 0),
("GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL", "Sm", 0),
("SLANTED EQUAL TO OR LESS-THAN", "Sm", 0),
("SLANTED EQUAL TO OR GREATER-THAN", "Sm", 0),
("SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE", "Sm", 0),
("SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE", "Sm", 0),
("DOUBLE-LINE EQUAL TO OR LESS-THAN", "Sm", 0),
("DOUBLE-LINE EQUAL TO OR GREATER-THAN", "Sm", 0),
("DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN", "Sm", 0),
("DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN", "Sm", 0),
("SIMILAR OR LESS-THAN", "Sm", 0),
("SIMILAR OR GREATER-THAN", "Sm", 0),
("SIMILAR ABOVE LESS-THAN ABOVE EQUALS SIGN", "Sm", 0),
("SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN", "Sm", 0),
("DOUBLE NESTED LESS-THAN", "Sm", 0),
("DOUBLE NESTED GREATER-THAN", "Sm", 0),
("DOUBLE NESTED LESS-THAN WITH UNDERBAR", "Sm", 0),
("GREATER-THAN OVERLAPPING LESS-THAN", "Sm", 0),
("GREATER-THAN BESIDE LESS-THAN", "Sm", 0),
("LESS-THAN CLOSED BY CURVE", "Sm", 0),
("GREATER-THAN CLOSED BY CURVE", "Sm", 0),
("LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL", "Sm", 0),
("GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL", "Sm", 0),
("SMALLER THAN", "Sm", 0),
("LARGER THAN", "Sm", 0),
("SMALLER THAN OR EQUAL TO", "Sm", 0),
("LARGER THAN OR EQUAL TO", "Sm", 0),
("EQUALS SIGN WITH BUMPY ABOVE", "Sm", 0),
("PRECEDES ABOVE SINGLE-LINE EQUALS SIGN", "Sm", 0),
("SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN", "Sm", 0),
("PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO", "Sm", 0),
("SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO", "Sm", 0),
("PRECEDES ABOVE EQUALS SIGN", "Sm", 0),
("SUCCEEDS ABOVE EQUALS SIGN", "Sm", 0),
("PRECEDES ABOVE NOT EQUAL TO", "Sm", 0),
("SUCCEEDS ABOVE NOT EQUAL TO", "Sm", 0),
("PRECEDES ABOVE ALMOST EQUAL TO", "Sm", 0),
("SUCCEEDS ABOVE ALMOST EQUAL TO", "Sm", 0),
("PRECEDES ABOVE NOT ALMOST EQUAL TO", "Sm", 0),
("SUCCEEDS ABOVE NOT ALMOST EQUAL TO", "Sm", 0),
("DOUBLE PRECEDES", "Sm", 0),
("DOUBLE SUCCEEDS", "Sm", 0),
("SUBSET WITH DOT", "Sm", 0),
("SUPERSET WITH DOT", "Sm", 0),
("SUBSET WITH PLUS SIGN BELOW", "Sm", 0),
("SUPERSET WITH PLUS SIGN BELOW", "Sm", 0),
("SUBSET WITH MULTIPLICATION SIGN BELOW", "Sm", 0),
("SUPERSET WITH MULTIPLICATION SIGN BELOW", "Sm", 0),
("SUBSET OF OR EQUAL TO WITH DOT ABOVE", "Sm", 0),
("SUPERSET OF OR EQUAL TO WITH DOT ABOVE", "Sm", 0),
("SUBSET OF ABOVE EQUALS SIGN", "Sm", 0),
("SUPERSET OF ABOVE EQUALS SIGN", "Sm", 0),
("SUBSET OF ABOVE TILDE OPERATOR", "Sm", 0),
("SUPERSET OF ABOVE TILDE OPERATOR", "Sm", 0),
("SUBSET OF ABOVE ALMOST EQUAL TO", "Sm", 0),
("SUPERSET OF ABOVE ALMOST EQUAL TO", "Sm", 0),
("SUBSET OF ABOVE NOT EQUAL TO", "Sm", 0),
("SUPERSET OF ABOVE NOT EQUAL TO", "Sm", 0),
("SQUARE LEFT OPEN BOX OPERATOR", "Sm", 0),
("SQUARE RIGHT OPEN BOX OPERATOR", "Sm", 0),
("CLOSED SUBSET", "Sm", 0),
("CLOSED SUPERSET", "Sm", 0),
("CLOSED SUBSET OR EQUAL TO", "Sm", 0),
("CLOSED SUPERSET OR EQUAL TO", "Sm", 0),
("SUBSET ABOVE SUPERSET", "Sm", 0),
("SUPERSET ABOVE SUBSET", "Sm", 0),
("SUBSET ABOVE SUBSET", "Sm", 0),
("SUPERSET ABOVE SUPERSET", "Sm", 0),
("SUPERSET BESIDE SUBSET", "Sm", 0),
("SUPERSET BESIDE AND JOINED BY DASH WITH SUBSET", "Sm", 0),
("ELEMENT OF OPENING DOWNWARDS", "Sm", 0),
("PITCHFORK WITH TEE TOP", "Sm", 0),
("TRANSVERSAL INTERSECTION", "Sm", 0),
("FORKING", "Sm", 0),
("NONFORKING", "Sm", 0),
("SHORT LEFT TACK", "Sm", 0),
("SHORT DOWN TACK", "Sm", 0),
("SHORT UP TACK", "Sm", 0),
("PERPENDICULAR WITH S", "Sm", 0),
("VERTICAL BAR TRIPLE RIGHT TURNSTILE", "Sm", 0),
("DOUBLE VERTICAL BAR LEFT TURNSTILE", "Sm", 0),
("VERTICAL BAR DOUBLE LEFT TURNSTILE", "Sm", 0),
("DOUBLE VERTICAL BAR DOUBLE LEFT TURNSTILE", "Sm", 0),
("LONG DASH FROM LEFT MEMBER OF DOUBLE VERTICAL", "Sm", 0),
("SHORT DOWN TACK WITH OVERBAR", "Sm", 0),
("SHORT UP TACK WITH UNDERBAR", "Sm", 0),
("SHORT UP TACK ABOVE SHORT DOWN TACK", "Sm", 0),
("DOUBLE DOWN TACK", "Sm", 0),
("DOUBLE UP TACK", "Sm", 0),
("DOUBLE STROKE NOT SIGN", "Sm", 0),
("REVERSED DOUBLE STROKE NOT SIGN", "Sm", 0),
("DOES NOT DIVIDE WITH REVERSED NEGATION SLASH", "Sm", 0),
("VERTICAL LINE WITH CIRCLE ABOVE", "Sm", 0),
("VERTICAL LINE WITH CIRCLE BELOW", "Sm", 0),
("DOWN TACK WITH CIRCLE BELOW", "Sm", 0),
("PARALLEL WITH HORIZONTAL STROKE", "Sm", 0),
("PARALLEL WITH TILDE OPERATOR", "Sm", 0),
("TRIPLE VERTICAL BAR BINARY RELATION", "Sm", 0),
("TRIPLE VERTICAL BAR WITH HORIZONTAL STROKE", "Sm", 0),
("TRIPLE COLON OPERATOR", "Sm", 0),
("TRIPLE NESTED LESS-THAN", "Sm", 0),
("TRIPLE NESTED GREATER-THAN", "Sm", 0),
("DOUBLE-LINE SLANTED LESS-THAN OR EQUAL TO", "Sm", 0),
("DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO", "Sm", 0),
("TRIPLE SOLIDUS BINARY RELATION", "Sm", 0),
("LARGE TRIPLE VERTICAL BAR OPERATOR", "Sm", 0),
("DOUBLE SOLIDUS OPERATOR", "Sm", 0),
("WHITE VERTICAL BAR", "Sm", 0),
("N-ARY WHITE VERTICAL BAR", "Sm", 0),
)
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/par-bidi-07.typ | typst | Other | // Test whether L1 whitespace resetting destroys stuff.
اÙغاÙØš #h(70pt) Ù#" "Ø©
|
https://github.com/lf-/typst-algorithmic | https://raw.githubusercontent.com/lf-/typst-algorithmic/main/README.md | markdown | <!--
SPDX-FileCopyrightText: 2023 <NAME>
SPDX-License-Identifier: MIT
-->
# typst-algorithmic
This is a package inspired by the LaTeX [`algorithmicx`][algorithmicx] package
for Typst. It's useful for writing pseudocode and typesetting it all nicely.
[algorithmicx]: https://ctan.org/pkg/algorithmicx

Example:
```typst
#import "@preview/algorithmic:0.1.0"
#import algorithmic: algorithm
#algorithm({
import algorithmic: *
Function("Binary-Search", args: ("A", "n", "v"), {
Cmt[Initialize the search range]
Assign[$l$][$1$]
Assign[$r$][$n$]
State[]
While(cond: $l <= r$, {
Assign([mid], FnI[floor][$(l + r)/2$])
If(cond: $A ["mid"] < v$, {
Assign[$l$][$m + 1$]
})
ElsIf(cond: [$A ["mid"] > v$], {
Assign[$r$][$m - 1$]
})
Else({
Return[$m$]
})
})
Return[*null*]
})
})
```
This DSL is implemented using the same trick as [CeTZ] uses: a code block of
arrays gets those arrays joined together.
[CeTZ]: https://github.com/johannes-wolf/typst-canvas
Currently this library is not really customizable. Please vendor it and hack it
up as needed then file an issue for the customization option you're missing.
## Reference
#### stmt
Statement-level contexts in `algorithmic` generally accept the type `body` in
the following:
```
body = (ast|content)[] | ast | content
ast = (change_indent: int, body: body)
```
#### inline
Inline functions will generate plain content.
#### `algorithmic(..bits)`
Takes one or more lists of `ast` and creates an algorithmic block with line
numbers.
### Control flow
#### `Function`/`Procedure` (stmt)
Defined as `f(name: string|content, args: content[]?, ..body)`. Body can be one or more `body`
values.
#### `If`/`ElseIf`/`Else`/`For`/`While` (stmt)
Defined as `f(cond: string|content, ..body)`. Body can be one or more `body`
values.
Generates an indented block with the body, and the specified `cond` between the
two keywords as condition.
### Statements
#### `Assign` (stmt)
Defined as `Assign(var: content, val: content)`.
Generates `#var <- #val`.
#### `CallI` (inline), `Call` (stmt)
Defined as `f(name, args: content|content[])`.
Calls a function with the function name styled in smallcaps and the args joined by
commas.
#### `Cmt` (stmt)
Defined as `Cmt(body: content)`.
Makes a line comment.
#### `FnI` (inline), `Fn` (stmt)
Defined as `f(name, args: content|content[])`.
Calls a function with the function name styled in bold and the args joined by
commas.
#### `Ic` (inline)
Defined as `Ic(body: content) -> content`.
Makes an inline comment.
#### `Return` (stmt)
Defined as `Return(arg: content)`.
Generates `return #arg`.
#### `State` (stmt)
Defined as `State(body: content)`.
Turns any content into a line.
|
|
https://github.com/coco33920/.files | https://raw.githubusercontent.com/coco33920/.files/mistress/typst_templates/dept-news/main.typ | typst | #import "template.typ": *
#show: dept-news.with(
title: "Chemistry Department",
edition: [
March 18th, 2023 \
Purview College
],
hero-image: (
path: "newsletter-cover.jpg",
caption: [Award-wining science],
),
publication-info: [
The Dean of the Department of Chemistry. \
Purview College, 17 Earlmeyer D, Exampleville, TN 59341. \
#link("mailto:<EMAIL>")
],
)
= The Sixtus Award goes to Purview
It's our pleasure to announce that our department has recently been awarded the highly-coveted Sixtus Award for Excellence in Chemical Research. This is a massive achievement for our department, and we couldn't be prouder.
#blockquote[Prof. Herzog][
Our Lab has synthesized the most elements of them all.
]
The Sixtus Award is a prestigious recognition given to institutions that have demonstrated exceptional performance in chemical research. The award is named after the renowned chemist <NAME>, who made significant contributions to the field of organic chemistry.
This achievement is a testament to the hard work, dedication, and passion of our faculty, students, and staff. Our department has consistently produced groundbreaking research that has contributed to the advancement of the field of chemistry, and we're honored to receive this recognition.
The award will be presented to our department in a formal ceremony that will take place on May 15th, 2023. We encourage all members of our department to join us in celebrating this achievement.
#article[
= Guest lecture from Dr. <NAME>
<NAME>, a leading researcher in the field of biochemistry, spoke about her recent work on the development of new cancer treatments using small molecule inhibitors, and the lecture was very well-attended by both students and faculty.
In case you missed it, there's a recording on #link("http://purview.edu/lts/2023-lee")[EDGARP].
]
#article[
= Safety first
Next Tuesday, there will be a Lab Safety Training.
These trainings are crucial for ensuring that all members of the department are equipped with the necessary knowledge and skills to work safely in the laboratory. *Attendance is mandatory.*
]
#figure(
rect(width: 100%, height: 80pt, fill: white, stroke: 1pt),
caption: [Our new department rectangle],
)
#article[
= Tigers win big
#text(weight: "bold", font: "Syne", pad(x: 12pt, grid(
columns: (1fr, auto, 1fr),
row-gutter: 8pt,
text(32pt, align(right)[12]),
text(32pt)[---],
text(32pt)[4],
align(right)[Tigers],
none,
[Eagles]
)))
Another great game on the path to win the League. \
Go tigers!
]
== Another Success
#lorem(20)
#lorem(20)
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/circuiteria/0.1.0/src/elements/logic/gate.typ | typst | Apache License 2.0 | #import "@preview/cetz:0.2.2": draw, coordinate
#import "../ports.typ": add-ports, add-port
#import "../element.typ"
#let default-draw-shape(id, tl, tr, br, bl, fill, stroke) = {
let f = {draw.rect(tl, br, fill: fill, stroke: stroke)}
return (f, tl, tr, br, bl)
}
/// Draws a logic gate. This function is also available as `element.gate()`
///
/// - draw-shape (function): see #doc-ref("element.elmt")
/// - x (number, dictionary): see #doc-ref("element.elmt")
/// - y (number, dictionary): see #doc-ref("element.elmt")
/// - w (number): see #doc-ref("element.elmt")
/// - h (number): see #doc-ref("element.elmt")
/// - inputs (int): The number of inputs
/// - fill (none, color): see #doc-ref("element.elmt")
/// - stroke (stroke): see #doc-ref("element.elmt")
/// - id (str): see #doc-ref("element.elmt")
/// - inverted (str, array): Either "all" or an array of port ids to display as inverted
/// - inverted-radius (number): The radius of inverted ports dot
/// - debug (dictionary): see #doc-ref("element.elmt")
#let gate(
draw-shape: default-draw-shape,
x: none,
y: none,
w: none,
h: none,
inputs: 2,
fill: none,
stroke: black + 1pt,
id: "",
inverted: (),
inverted-radius: 0.1,
debug: (
ports: false
)
) = draw.get-ctx(ctx => {
let width = w
let height = h
let x = x
let y = y
if x == none { panic("Parameter x must be set") }
if y == none { panic("Parameter y must be set") }
if w == none { panic("Parameter w must be set") }
if h == none { panic("Parameter h must be set") }
if (type(x) == dictionary) {
let offset = x.rel
let to = x.to
let (ctx, to-pos) = coordinate.resolve(ctx, (rel: (offset, 0), to: to))
x = to-pos.at(0)
}
if (type(y) == dictionary) {
let from = y.from
let to = y.to
let dy
if to == "out" {
dy = height / 2
} else {
dy = height * (i + 0.5) / inputs
}
let (ctx, from-pos) = coordinate.resolve(ctx, from)
y = from-pos.at(1) + dy - height
}
let tl = (x, y + height)
let tr = (x + width, y + height)
let br = (x + width, y)
let bl = (x, y)
// Workaround because CeTZ needs to have all draw functions in the body
let func = {}
(func, tl, tr, br, bl) = draw-shape(id, tl, tr, br, bl, fill, stroke)
func
let space = 100% / inputs
for i in range(inputs) {
let pct = (i + 0.5) * space
let a = (tl, pct, bl)
let b = (tr, pct, br)
let int-name = id + "i" + str(i)
draw.intersections(
int-name,
func,
draw.hide(draw.line(a, b))
)
let port-name = "in" + str(i)
let port-pos = int-name + ".0"
if inverted == "all" or port-name in inverted {
draw.circle(port-pos, radius: inverted-radius, anchor: "east", stroke: stroke)
port-pos = (rel: (-2 * inverted-radius, 0), to: port-pos)
}
add-port(
id, "west",
(id: port-name), port-pos,
debug: debug.ports
)
}
let out-pos = id + ".east"
if inverted == "all" or "out" in inverted {
draw.circle(out-pos, radius: inverted-radius, anchor: "west", stroke: stroke)
out-pos = (rel: (2 * inverted-radius, 0), to: out-pos)
}
add-port(
id, "east",
(id: "out"), out-pos,
debug: debug.ports
)
}) |
https://github.com/soul667/typst | https://raw.githubusercontent.com/soul667/typst/main/PPT/typst-slides-fudan/themes/fudan.typ | typst | // This theme is based on "Clean" theme, which contains ideas from the former "bristol" theme, contributed by
// https://github.com/MarkBlyth
#import "polylux/logic.typ"
#import "polylux/helpers.typ"
#let fudan-footer = state("fudan-footer", [])
#let fudan-short-title = state("fudan-short-title", none)
#let fudan-color = state("fudan-color", teal)
#let fudan-logo = state("fudan-logo", none)
#let fudan-theme(
aspect-ratio: "16-9",
footer: [],
short-title: none,
logo: none,
background-logo: image("assets/fudan-background-o.png", width: 11cm),
color: teal,
body
) = {
let background = if background-logo != none {
place(
top + left,
dx: 80% - background-logo.at("width", default: 11cm) / 2,
dy: 25%,
background-logo
)
} else { none }
set page(
paper: "presentation-" + aspect-ratio,
margin: 0em,
header: none,
footer: none,
background: background
)
set text(size: 25pt)
show footnote.entry: set text(size: .6em)
fudan-footer.update(footer)
fudan-color.update(color)
fudan-short-title.update(short-title)
fudan-logo.update(logo)
body
}
#let title-slide(
title: none,
subtitle: none,
authors: (),
date: none,
watermark: none,
secondlogo: none,
) = {
let content = locate( loc => {
let color = fudan-color.at(loc)
let logo = fudan-logo.at(loc)
let authors = if type(authors) in ("string", "content") {
( authors, )
} else {
authors
}
if watermark != none {
set image(width: 100%)
place(watermark)
}
v(5%)
grid(columns: (5%, 1fr, 1fr, 5%),
[],
if logo != none {
set align(bottom + left)
set image(height: 3em)
logo
} else { [] },
if secondlogo != none {
set align(bottom + right)
set image(height: 3em)
secondlogo
} else { [] },
[]
)
v(-10%)
align(center + horizon)[
#block(
stroke: ( y: 1mm + color ),
inset: 1em,
breakable: false,
[
#text(1.3em)[*#title*] \
#{
if subtitle != none {
parbreak()
text(.9em)[#subtitle]
}
}
]
)
#set text(size: .8em)
#grid(
columns: (1fr,) * calc.min(authors.len(), 3),
column-gutter: 1em,
row-gutter: 1em,
..authors
)
#v(1em)
#date
]
})
logic.polylux-slide(content)
}
#let slide(title: none, columns: none, gutter: none, ..bodies) = {
let header = align(top, locate( loc => {
let color = fudan-color.at(loc)
let logo = fudan-logo.at(loc)
let short-title = fudan-short-title.at(loc)
show: block.with(stroke: (bottom: 1mm + color), width: 100%, inset: (y: .3em))
set text(size: .5em)
grid(
columns: (1fr, 1fr),
if logo != none {
set align(left)
set image(height: 4em)
logo
} else { [] },
if short-title != none {
align(horizon + right, grid(
columns: 1, rows: 1em, gutter: .5em,
short-title,
helpers.current-section
))
} else {
align(horizon + right, helpers.current-section)
}
)
}))
let footer = locate( loc => {
let color = fudan-color.at(loc)
block(
stroke: ( top: 1mm + color ), width: 100%, inset: ( y: .3em ),
text(.5em, {
fudan-footer.display()
h(1fr)
logic.logical-slide.display()
})
)
})
set page(
margin: ( top: 4em, bottom: 2em, x: 1em ),
header: header,
footer: footer,
footer-descent: 1em,
header-ascent: 1.5em,
)
let bodies = bodies.pos()
let gutter = if gutter == none { 1em } else { gutter }
let columns = if columns == none { (1fr,) * bodies.len() } else { columns }
if columns.len() != bodies.len() {
panic("number of columns must match number of content arguments")
}
let body = pad(x: .0em, y: .5em, grid(columns: columns, gutter: gutter, ..bodies))
let content = {
if title != none {
heading(level: 2, title)
}
body
}
logic.polylux-slide(content)
}
#let focus-slide(background: teal, foreground: white, body) = {
set page(fill: background, margin: 2em)
set text(fill: foreground, size: 1.5em)
logic.polylux-slide(align(horizon, body))
}
#let new-section-slide(name) = {
set page(margin: 2em)
let content = locate( loc => {
let color = fudan-color.at(loc)
set align(center + horizon)
show: block.with(stroke: ( bottom: 1mm + color ), inset: 1em,)
set text(size: 1.5em)
strong(name)
helpers.register-section(name)
})
logic.polylux-slide(content)
}
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-10EC0.typ | typst | Apache License 2.0 | #let data = (
"2": ("ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW", "Lo", 0),
"3": ("ARABIC LETTER TAH WITH TWO DOTS VERTICALLY BELOW", "Lo", 0),
"4": ("ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW", "Lo", 0),
"3c": ("ARABIC COMBINING ALEF OVERLAY", "Mn", 0),
"3d": ("ARABIC SMALL LOW WORD SAKTA", "Mn", 220),
"3e": ("ARABIC SMALL LOW WORD QASR", "Mn", 220),
"3f": ("ARABIC SMALL LOW WORD MADDA", "Mn", 220),
)
|
https://github.com/kilpkonn/msc-thesis | https://raw.githubusercontent.com/kilpkonn/msc-thesis/master/annotation.typ | typst | #set text(lang: "ee")
Rust on ÃŒldotstarbeline programmeerimiskeel nii sÃŒsteemi kui ka rakenduste tarkvara loomiseks.
Erinevalt teistest programmeerimiskeeltest suudab Rust garanteerida turvalise mÀlu kasutuse kasutamata spetsiaalset mÀluhaldurit.
Rust konkureerib programmeerimiskeeltega C ja C++ pakkudes arendajale paremaid tööriistu ja paremat arenduse kogemust jÀrele andmata programmi kiiruses.
Rusti tÌÌbisÌsteem sarnaneb funktsionaalsete keelte tÌÌbisÌsteemidele sisaldades algebralisi andmetÌÌpe.
Arendaja kogemus Rustis sarnaneb seetõttu rohkem kogemusele kõrgematasemelistes funktsionaalsetes programmeerimiskeeltes kui kogemusele C/C++ arenduses.
Samas Rustis puudub hetkel tööriist, mis suudaks automaatselt genereerida avaldisi, mis vastavad oodatud tÌÌbile.
Sellised tööriistad on tavalised funktsionaalsetes programmeerimiskeeltes ja me usume, et ka Rustil on taolisest tööriistast kasu.
KÀesolevas töös arendame edasi Rusti ametlikku tööriista `rust-analyzer`, lisades sellele võimekuse genereerida avaldisi tÌÌpide alusel.
Lisaks programmide genereerimisele uurime, kas avaldise otsingut on võimalik kasutada ka targema automaatse sõnalõpetuse loomiseks.
Me arendame oma algoritmi kolme iteratsioonina.
Esimene iteratsioon on kõige lihtsam ja sarnaneb suuresti algoritmile mida kasutatakse Agsys, sarnases tööriistas Agda jaoks.
Teises iteratsioonis arendame algoritmi edasi muutes otsingu suuna vastupidiseks.
Sooritades otsingut vastupidises suunas saame lihtsalt lisada vahepealsete vÀÀrtuste puhverdamise ning teisi optimeerimisi.
Viimases versioonis muudame otsingu kahesuunaliseks.
Sooritades otsingut kahes suunas, suudame leida avaldise rohkemates kohtades ilma algoritmi tööd oluliselt aeglustamata.
Töö tulemuste hindamiseks jooksutame me algoritmi 155-l vabavaralisel Rusti programmil.
Kustutame osa olemasolevast lÀhtekoodist, jÀttes programmi koodi "augud".
NÌÌd kasutame oma algoritmi, et genereerida kood nende aukude jaoks.
Mõõdame kui palju auke suudab algoritm tÀita ja kui tihti suudab algoritm genereerida tagasi originaalse lÀhtekoodi.
Töö vÀljundina saadame oma algoritmi ametlikku `rust-analyzer`'i, et seda saaksid kasutada kõik Rusti arendajad.
Lõputöö on kirjutatud inglise keeles keeles ning sisaldab teksti #context counter(page).at(<end>).first() lehekÌljel,
#context counter(heading).at(<conclusion>).first() peatÃŒkki,
#context counter(figure.where(kind: image)).final().first() joonist
#context counter(figure.where(kind: raw)).final().first() koodinÀidist ja
#context counter(figure.where(kind: table)).final().first() tabelit. |
|
https://github.com/pklaschka/typst-hidden-bib | https://raw.githubusercontent.com/pklaschka/typst-hidden-bib/main/hidden-citations.typ | typst | MIT License | #import "lib.typ": *
== Hidden Citations
In some documents, it may be necessary to include items in your bibliography which weren't explicitly cited at any specific point in your document. This can easily be achieved by using the `hidden-cite` function instead of `cite` after importing the `hidden-bib` package. @hidden-bib[`hidden-cite` function]
The code then looks like this:
```typ
#import "@preview/hidden-bib:0.1.0": hidden-cite
#hidden-cite("example1")
```
#hidden-cite("example1")
=== Multiple Hidden Citations
If you want to include a large number of items in your bibliography without having to use `hidden-cite` (to still get autocompletion in the web editor), you can use the `hidden-citations` environment. @hidden-bib
The code then looks like this:
```typ
#import "@preview/hidden-bib:0.1.0": hidden-citations
#hidden-citations[
@example1
@example2
]
```
#hidden-citations[
@example1
@example2
]
#bibliography("refs.yml", style: "chicago-author-date") |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-112B0.typ | typst | Apache License 2.0 | #let data = (
("KHUDAWADI LETTER A", "Lo", 0),
("KHUDAWADI LETTER AA", "Lo", 0),
("KHUDAWADI LETTER I", "Lo", 0),
("KHUDAWADI LETTER II", "Lo", 0),
("KHUDAWADI LETTER U", "Lo", 0),
("KHUDAWADI LETTER UU", "Lo", 0),
("KHUDAWADI LETTER E", "Lo", 0),
("KHUDAWADI LETTER AI", "Lo", 0),
("KHUDAWADI LETTER O", "Lo", 0),
("KHUDAWADI LETTER AU", "Lo", 0),
("KHUDAWADI LETTER KA", "Lo", 0),
("KHUDAWADI LETTER KHA", "Lo", 0),
("KHUDAWADI LETTER GA", "Lo", 0),
("KHUDAWADI LETTER GGA", "Lo", 0),
("KHUDAWADI LETTER GHA", "Lo", 0),
("KHUDAWADI LETTER NGA", "Lo", 0),
("KHUDAWADI LETTER CA", "Lo", 0),
("KHUDAWADI LETTER CHA", "Lo", 0),
("KHUDAWADI LETTER JA", "Lo", 0),
("KHUDAWADI LETTER JJA", "Lo", 0),
("KHUDAWADI LETTER JHA", "Lo", 0),
("KHUDAWADI LETTER NYA", "Lo", 0),
("KHUDAWADI LETTER TTA", "Lo", 0),
("KHUDAWADI LETTER TTHA", "Lo", 0),
("KHUDAWADI LETTER DDA", "Lo", 0),
("KHUDAWADI LETTER DDDA", "Lo", 0),
("KHUDAWADI LETTER RRA", "Lo", 0),
("KHUDAWADI LETTER DDHA", "Lo", 0),
("KHUDAWADI LETTER NNA", "Lo", 0),
("KHUDAWADI LETTER TA", "Lo", 0),
("KHUDAWADI LETTER THA", "Lo", 0),
("KHUDAWADI LETTER DA", "Lo", 0),
("KHUDAWADI LETTER DHA", "Lo", 0),
("KHUDAWADI LETTER NA", "Lo", 0),
("KHUDAWADI LETTER PA", "Lo", 0),
("KHUDAWADI LETTER PHA", "Lo", 0),
("KHUDAWADI LETTER BA", "Lo", 0),
("KHUDAWADI LETTER BBA", "Lo", 0),
("KHUDAWADI LETTER BHA", "Lo", 0),
("KHUDAWADI LETTER MA", "Lo", 0),
("KHUDAWADI LETTER YA", "Lo", 0),
("KHUDAWADI LETTER RA", "Lo", 0),
("KHUDAWADI LETTER LA", "Lo", 0),
("KHUDAWADI LETTER VA", "Lo", 0),
("KHUDAWADI LETTER SHA", "Lo", 0),
("KHUDAWADI LETTER SA", "Lo", 0),
("KHUDAWADI LETTER HA", "Lo", 0),
("KHUDAWADI SIGN ANUSVARA", "Mn", 0),
("KHUDAWADI VOWEL SIGN AA", "Mc", 0),
("KHUDAWADI VOWEL SIGN I", "Mc", 0),
("KHUDAWADI VOWEL SIGN II", "Mc", 0),
("KHUDAWADI VOWEL SIGN U", "Mn", 0),
("KHUDAWADI VOWEL SIGN UU", "Mn", 0),
("KHUDAWADI VOWEL SIGN E", "Mn", 0),
("KHUDAWADI VOWEL SIGN AI", "Mn", 0),
("KHUDAWADI VOWEL SIGN O", "Mn", 0),
("KHUDAWADI VOWEL SIGN AU", "Mn", 0),
("KHUDAWADI SIGN NUKTA", "Mn", 7),
("KHUDAWADI SIGN VIRAMA", "Mn", 9),
(),
(),
(),
(),
(),
("KHUDAWADI DIGIT ZERO", "Nd", 0),
("KHUDAWADI DIGIT ONE", "Nd", 0),
("KHUDAWADI DIGIT TWO", "Nd", 0),
("KHUDAWADI DIGIT THREE", "Nd", 0),
("KHUDAWADI DIGIT FOUR", "Nd", 0),
("KHUDAWADI DIGIT FIVE", "Nd", 0),
("KHUDAWADI DIGIT SIX", "Nd", 0),
("KHUDAWADI DIGIT SEVEN", "Nd", 0),
("KHUDAWADI DIGIT EIGHT", "Nd", 0),
("KHUDAWADI DIGIT NINE", "Nd", 0),
)
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas8/3_Streda.typ | typst | #let V = (
"HV": (
("","MúÄenicy Hospódni","Na kresťà Christé prihvóşdsja, pronzájem v rúci i nózi, v rebró ÅŸe svjatóje probodén bÃœl jesÃ, istoÄája mà kápli boşéstvennaho spasénija, preblahÃj, króv ÅŸe i vódu, jáko da omÃœjeÅ¡i mój hnój i skvérnu: sláva tvojéj vseÅ¡Äédre bláhosti."),
("","","Stradáti preterpÃl jesà VladÃœko, jáko da bezstrástije vsÃm podási, poklaÅájuÅ¡Äymsja tvojÃm strástém, i vóğnomu zakoléniju, i kopijú, i hvozdém, i trósti, jáşe dolhoterpilÃvno choťá preterpÃl jesÃ: jáko da i mÅà ischodátaiÅ¡i Hóspodi, rádi strástéj tvojÃch bezstrástije."),
("","","Júnica neskvérnaja, juncá vÃÄaÅ¡Äi na drévo vozdvÃÅŸena vóleju, rydájuÅ¡Äi umÃÄŸno vopijáše: uvÃœ mÅÃ, vozğúblenÅijÅ¡eje Äádo, Ätó ti sónm vozdadé bezblahodátnyj jevréjskij, choťá mjá bezÄádstvovati ot tebé vseÄŸubÃmyj?"),
("","","Ne terpğú Äádo, zrÃti ťá na drévi usnúvÅ¡a, bódrosÅ¥ vsÃm dajúšÄaho: jáko da drévle ot prestuplénija plodá, snóm vsepáhubnym usnúvÅ¡ym, boşéstvennuju i spasÃteÄŸnuju bódrosÅ¥ podási, ÄÃva hlahólaÅ¡e pláÄuÅ¡Äisja, júşe veliÄájem."),
("","","Sobór neprávednyj tebé na krest vozdvÃÅŸe áhnca, vzémÄŸuÅ¡Äaho mÃra prehrišénija, i kopijém tvojá rébra probodóša dolhoterpilÃve, i rúki prihvozdÃÅ¡a tvojá i nóhi. O suróvstva zláho! Ole derznovénija! PreÄÃstaja sijá vzyváše umÃÄŸno slezjášÄi."),
("","","Ätó zrÃmoje sijé, jéşe nÃœÅi vÃÅŸdu VladÃœko? ÃÅŸe hórstiju vsjú tvár preÄúdÅi soderşáj, na drévi jákoÅŸe áhnec neprávedÅi vÃsiÅ¡i, Slóve Bóşij, ot ráb nepokorÃvych povÃÅ¡en? Ole terpÃnija! Ole tvojejá bláhosti vseÅ¡Äédre! SlezjášÄi hlahólaÅ¡e preneporóÄnaja."),
("KrestobohoródiÄen","","AÌhnca ťá jehdá áhnica i Dévaja k zakoléniju vedóma uzrà so slezámi Slóve posÄŸÃdovaÅ¡e, i vzyváše: hÄà tÅ¡ÄÃÅ¡isja Äádo mojé? Sšéstvuju tebà sladÄájÅ¡ij, ne terpğú bo ne zrÃti tebé Iisúse mój mnohomÃlostive."),
),
"S": (
("","","VoznesÃœjsja na krest Christé Bóşe, i spásl jesà ÄelovÃÄeskij ród: slávim stradánija tvojá."),
("","","PrihvozdÃlsja jesà na kresťà Christé Bóşe, i otvérzl jesà rájskija dvéri: slávim BoÅŸestvó tvojé."),
("MúÄeniÄen","","MúÄenicy tvojà Hóspodi, zabÜša ÅŸitéjskaja, nebréhÅ¡e o muÄénijich, búduÅ¡Äija rádi ÅŸÃzni, tojá nasÄŸÃdnicy javÃÅ¡asja: Å¥ÃmÅŸe i so ánhely rádujutsja. Å€Ãch molÃtvami dáruj ğúdem tvojÃm véliju mÃlosÅ¥."),
("KrestobohoródiÄen","Hóspodi, ášÄe i na sudÃÅ¡Äi","Hóspodi, jehdá Å¥a sólnca právednaho sólnce vÃÄi na dréve povÃÅ¡ena, luÄÃœ skrÃœ, i luná svÃt vo Å¥mú preloÅŸÃ: vseneporóÄnaja ÅŸe tvojá Máti utróboju ujazvğášesja."),
),
)
#let P = (
"1": (
("","","Vódu prošéd jáko súšu, i jehÃpetskaho zlá izbişáv, IzráiÄŸÅ¥anin vopijáše: izbáviteÄŸu i Bóhu nášemu pojÃm."),
("","","Mnóhimi soderÅŸÃm napásÅ¥mi, k tebà pribiháju spasénija iskÃj, o Máti Slóva i ÄÃvo! Ot ťáşkich i ğútych mjá spasÃ."),
("","","Strastéj mjá smuÅ¡Äájut prilózi, mnóhaho unÃœnija ispólniti mojú dúšu: umirà otrokovÃce tiÅ¡inóju SÃœna i Bóha tvojehó vseneporóÄnaja."),
("","","Spása róşdÅ¡uju ťá i Bóha, moğú ÄÃvo, izbáviti mi sja ğútych: k tebà bo nÃœÅi pribihája, prostiráju i dúšu i pomyÅ¡lénije."),
("","","NedúhujuÅ¡Äa Å¥Ãlom i dušéju, posiÅ¡Äénija boşéstvennaho, i promyÅ¡lénija ot tebé spodóbi jedÃna Bohomáti, jáko blahája, blaháho ÅŸe RodÃteÄŸnice."),
),
"3": (
("","","Nebésnaho krúha verchotvórÄe Hóspodi, i cérkve ziÅŸdÃteÄŸu, tÃœ mené utverdà v ÄŸubvà tvojéj, ÅŸelánij kráju, vÃrnych utverÅŸdénije, jedÃne ÄelovikoğúbÄe."),
("","","PredstáteÄŸstvo i pokróv ÅŸÃzni mojejá, polaháju ťá BohorodÃteÄŸnice ÄÃvo, tÃœ mja okormà ko pristániÅ¡Äu tvojemú, blahÃch vinóvna, vÃrnych utverÅŸdénije, jedÃna vsepÃtaja."),
("","","Moğú ÄÃvo, dušévnoje smuÅ¡Äénije, i peÄáli mojejá búrju razorÃti: tÃœ bo BohonevÃstnaja, naÄáğnika tiÅ¡inÃœ Christá rodilá jesà jedÃna preÄÃstaja."),
("","","BlahodéteÄŸa róşdÅ¡i dóbrych vinóvnaho, blahoÄijánija bohátstvo vsÃm istoÄÃ: vsjá bo móşeÅ¡i, jáko sÃÄŸnaho v krÃposti Christá róşdÅ¡i, Bohoblaşénnaja."),
("","","Ĝútymi nedúhi, i boÄŸÃznennymi strasÅ¥mà isÅ¥azájemu, ÄÃvo, tÃœ mi pomozÃ, iscilénij bo neoskúdnoje ťá znáju sokróviÅ¡Äe preneporóÄnaja, neiÅŸdivájemoje."),
),
"4": (
("","","UslÜšach Hóspodi, smotrénija tvojehó tájinstvo: razuméch Äilá tvojá, i proslávich tvojé BoÅŸestvó."),
("","","Strastéj mojÃch smuÅ¡Äénije, kórmÄiju róşdÅ¡aja Hóspoda, i búrju utiÅ¡Ã mojÃch prehrišénij, BohonevÃstnaja."),
("","","Milosérdija tvojehó bézdnu prizyvájuÅ¡Äu podÃ¡ÅŸÄ mÃ, jáşe blahosérdaho róşdÅ¡aja, i Spása vsÃch pojúšÄich ťá."),
("","","NaslaÅŸdájuÅ¡Äesja preÄÃstaja, tvojÃch darovánij, blahodárstvennoje vospivájem pÃnije, vÃduÅ¡Äe ťá Bohomáter."),
("","","Na odrà boÄŸÃzni mojejá, i némoÅ¡Äi nizleşášÄu mÃ, jáko blahoÄŸubÃva pomozà Bohoródice, jedÃna prisnoÄÃvo."),
),
"5": (
("","","Prosvità nás poveÄŸÃniji tvojÃmi Hóspodi, i mÜšceju tvojéju vysókoju tvój mÃr podÃ¡ÅŸÄ nám, ÄelovikoğúbÄe."),
("","","Ispólni ÄÃstaja, vesélija sérdce mojé, tvojú netÄŸÃnnuju dajúšÄi rádosÅ¥, vesélija róşdÅ¡aja vinóvnaho."),
("","","Izbávi nás ot bÃd Bohoródice ÄÃstaja, vÃÄnoje róşdÅ¡i izbavlénije, i mÃr vsják úm preimúšÄij."),
("","","RazriÅ¡Ã mhlú prehrišénij mojÃch BohonevÃsto, prosviÅ¡Äénijem tvojejá svÃtlosti, svÃt róşdÅ¡aja boşéstvennyj i prevÃÄnyj."),
("","","Iscilà ÄÃstaja, duÅ¡Ã mojejá nemoşénije, posiÅ¡Äénija tvojehó spodóbÄŸÅ¡aja, i zdrávije molÃtvami tvojÃmi podÃ¡ÅŸÄ mÃ."),
),
"6": (
("","","MolÃtvu prolijú ko Hóspodu, i tomú vozviÅ¡Äú peÄáli mojá, jáko zól dušá mojá ispólnisja, i ÅŸivót mój ádu priblÃÅŸisja, i moğúsja jáko Jóna: ot tlà Bóşe, vozvedà mja."),
("","","Smérti i tlà jáko spásl jésÅ¥, sám sjá izdáv smérti, tÄŸÃnijem i smértiju mojé jestestvó játo bÃœvÅ¡eje, ÄÃvo, molà Hóspoda i SÃœna tvojehó, vrahóv zloÄÃjstvija mjá izbáviti."),
("","","PredstáteÄŸnicu ťá ÅŸivotá vÃm, i chranÃteÄŸnicu tvérdu ÄÃvo, i napástej rišášÄu molvÃœ, i nalóhi bisóv othoÅájuÅ¡Äu: i moğúsja vsehdá. Ot tlà strastéj mojÃch izbáviti mjá."),
("","","Jáko sÅ¥Ãnu pribÃÅŸiÅ¡Äa sÅ¥aşáchom, i dúš vsesoveršénnoje spasénije, i prostránstvo v skórbech, otrokovÃce, i prosviÅ¡Äénijem tvojÃm prÃsno rádujemsja. o VladÃœÄice, i nÃœÅi nás ot strastéj i bÃd spasÃ."),
("","","Na odrà nÃœÅi nemoÅ¡Ästvújaj leşú, i ÅÃsÅ¥ iscilénija plóti mojéj: no Bóha i Spása mÃru, i izbáviteÄŸa nedúhov róşdÅ¡aja, tebà moğúsja blahój, ot tlà nedúh vozstávi mjá."),
),
"S": (
("","","Ãhnca i pástyrja, i Spása mÃra, na kresťà zrjášÄi, róşdÅ¡aja ťá, hlahólaÅ¡e slezjášÄi: mÃr úbo rádujetsja, prijémÄŸa izbavlénije: utróba ÅŸe mojá horÃt, zrjášÄi tvojé raspjátije, jéşe za vsÃch terpÃÅ¡i SÃœne i Bóşe mój."),
),
"7": (
("","","Ot Judéji došédÅ¡e ótrocy v VavilóÅi inohdá, vÃroju TróiÄeskoju plámeÅ péšÄnyj popráša, pojúšÄe: otcév Bóşe, blahoslovén jesÃ."),
("","","Náše spasénije jákoÅŸe voschoÅ¥Ãl jesà Spáse, ustrójiti, vo utróbu ÄÃvyja vselÃlsja jesÃ, júşe mÃru predstáteÄŸnicu pokazál jesÃ: otéc nášich Bóşe, blahoslovén jesÃ."),
("","","VolÃteÄŸa mÃlosti jehóşe rodilá jesà Máti ÄÃstaja, umolÃ, izbávitisja ot prehrišénij, i dušévnych skvérn, vÃroju zovúšÄym: otéc nášich Bóşe, blahoslovén jesÃ."),
("","","SokróviÅ¡Äe spasénija, i istóÄnik netÄŸÃnija, ťá róşdÅ¡uju, i stólp utverÅŸdénija, i dvér pokajánija zovúšÄym pokazál jesÃ: otéc nášich Bóşe, blahoslovén jesÃ."),
("","","Å€ilésnyja slábosti, i dušévnyja nedúhi BohorodÃteÄŸnice, ÄŸubóviju pristupájuÅ¡Äich k króvu tvojemú ÄÃvo, iscilÃti spodóbi, Spása Christá nám róşdÅ¡aja."),
),
"8": (
("","","Carjá nebésnaho, jehóşe pojút vóji ánheÄŸstiji, chvalÃte i prevoznosÃte vo vsjá vÃki."),
("","","PómoÅ¡Äi jáşe ot tebé trébujuÅ¡Äyja ne prézri ÄÃvo, pojúšÄyja i prevoznosjášÄyja ťá vo vÃki."),
("","","Nemoşénije duÅ¡Ã mojejá isciğájeÅ¡i, i Å¥ilésnyja boÄŸÃzni ÄÃvo, da ťá proslávÄŸu ÄÃstaja vo vÃki."),
("","","Iscilénij bohátstvo izlivájeÅ¡i, vÃrno pojúšÄym ťá ÄÃvo, i prevoznosjášÄym neizreÄénnoje tvojé roÅŸdestvó."),
("","","Napástej tÃœ prilóhi othoÅájeÅ¡i, i strastéj nachódy ÄÃvo: Å¥ÃmÅŸe ťá pojém vo vsjá vÃki."),
),
"9": (
("","","VoÃstinnu Bohoródicu ťá ispovÃdujem spasénniji tobóju ÄÃvo ÄÃstaja, s bezplótnymi lÃki ťá veliÄájuÅ¡Äe."),
("","","Tóka sléz mojÃch ne otvratÃsja, jáşe ot vsjákaho licá vsjáku slézu otjémÅ¡aho, ÄÃvo, Christá róşdÅ¡aja."),
("","","Rádosti mojé sérdce ispólni ÄÃvo: jáşe rádosti prijémÅ¡aja ispolnénije, hrichóvnuju peÄáğ potrebğájuÅ¡Äi."),
("","","SvÃta tvojehó zarjámi prosvità ÄÃvo, mrák nevÃÄinija othoÅášÄi, blahovÃrno Bohoródicu ťá ispovÃdajuÅ¡Äich."),
("","","Na mÃsÅ¥i ozloblénija némoÅ¡Äi, smirÃvÅ¡ahosja ÄÃvo, iscilÃ, iz nezdrávija vo zdrávije pretvorjájuÅ¡Äi."),
),
)
#let U = (
"S1": (
("","","VÃÄa razbójnik naÄáğnika ÅŸÃzni, na kresťà vÃsjaÅ¡Äa, hlahólaÅ¡e: ášÄe ne by Bóh bÃœl voplóšÄsja, ÃÅŸe s námi raspnÃœjsja: ne bÃœ sólnce luÄÃœ svojá potajÃlo, nişé by zemğá trepéšÄuÅ¡Äi trjaslásja: no vsjá terpjáj, pomjanà mja Hóspodi, vo cárstviji tvojém."),
("","","PosreÄà dvojú razbójniku, mÃrilo právednoje obrÃtesja krest tvój: óvomu úbo nizvodÃmu vo ád Å¥ahotóju chulénija: druhómu ÅŸe lehÄášÄusja ot prehrišénij k poznániju Bohoslóvija. Christé Bóşe, sláva tebÃ."),
("KrestobohoródiÄen","","Ãhnca i pástyrja, i izbáviteÄŸa, áhnica zrjášÄi na kresťà neprávedno vozdvÃÅŸena, pláÄuÅ¡Äisja hórko vzyváše: mÃr úbo rádujetsja, prijémÄŸa tobóju izbavlénije: utróba ÅŸe mojá horÃt, zrjášÄi tvojé raspjátije, jéşe terpÃÅ¡i za milosérdije mÃlosti Bóşe preblahÃj, bezhrÃÅ¡ne Hóspodi. JéjÅŸe vÃrno vozopijÃm: blahoutróbije pokaÅŸÃ ÄÃvo na nÃœ, i sohrišénij ostavlénije dáruj, poklaÅájuÅ¡Äymsja tohó stradánijem."),
),
"S2": (
("","","PosreÄà Jedéma drévo procvité smérÅ¥, posreÄà şe vsejá zemlà drévo vozrastà şÃzÅ: vkusÃvÅ¡e bo pérvije plodá, netÄŸÃnni súšÄe, tÄŸÃnni bÃœchom: uluÄÃvÅ¡e ÅŸe vtoróje, netÄŸÃnija nasladÃchomsja: krestóm bo spasájeÅ¡i jáko Bóh, ród ÄelovÃÄeskij."),
("","","V rajà mja préşde drévo obnaÅŸÃ, vnušénijem vráh vnosjá umerÅ¡Ävlénije: krestá ÅŸe drévo, ÅŸÃzni vÃÄnyja oÄijánija ÄelovÃkom nosjá, vodruzÃsja na zemlÃ, i mÃr vés ispólnisja vsjákija rádosti. Jehóşe zrjášÄe voznosÃma, Bóhu vÃroju ğúdije sohlásno vozopijÃm: ispólÅ slávy dóm tvój."),
("MúÄeniÄen","","VselénÅij svitÃla prisnosvÃtlaja pokazástesja vÃroju: múÄeniÄeskuju vsjú vozloÅŸÃvÅ¡e nadéşdu na Bóha, i mÃœslennym jeléjem Dúcha svjatáho, dušévnyja sviÅ¡ÄÃœ váša prosvitÃste. Å€ÃmÅŸe i Äášy úmnyja, ÄelovÃkom prolivájuÅ¡Äe iscilénija jákoÅŸe vódy, cérkvi javÃstesja, strastotérpcy vsechváğniji. MolÃte Christá Bóha, prehrišénij ostavlénije darováti, prázdnujuÅ¡Äym ÄŸubóviju svjatúju pámjaÅ¥ vášu."),
("KrestobohoródiÄen","","ÄÃvo iz tebé voplóšÄÅ¡ahosja, jáko vÃÄila jesà vozvyšájema na krest posreÄà dvojú razbójniku, plÃ¡Ä vosprijémÅ¡i vopijáše: uvÃœ mÅà Äádo sladÄájÅ¡eje, káko vóleju ráspjat bÃœsÅ¥, ÃÅŸe hrichà vzémÄŸaj mÃra jáko blahoutróben? ÄelovÃÄeskim choťá, jáko Bóh, pÃsnem chvalénija prinosÃmym bÃœti tebÃ."),
),
"S3": (
("","PoveÄŸÃnnoje tájno","Na kresťà ťá vÃÄivÅ¡e vozvÜšena, sólnca nezachodÃmaho Christé, stráchom sólnce pomraÄÃsja ábije: zemğá pokolebásja, i kámenije trépetom raspadášesja, i cerkóvnaja zavÃsa razdrásja, i mértviji ot hrób vostáša, slavoslóvjaÅ¡Äe strášnoje tvojé i boşéstvennoje snizchoÅŸdénije jedÃnaho Bóha nášeho."),
("","","Drévo hóresÅ¥ vo jedémi préşde proiznesé, drévo ÅŸe krestnoje sládkuju ÅŸÃzÅ procvité: Adám bo jadÃœj vo tğú popolzésja: mÃœ ÅŸe naslaÅŸdájuÅ¡Äesja plóti Christóvy oÅŸivğájemi byvájem, i oboşájemi táinstvenÅi, cárstvije prijémÄŸuÅ¡Äe prisnosúšÄnoje Bóşije. Å€ÃmÅŸe i vÃroju zovém: sláva, Slóve, strásti tvojéj."),
("KrestobohoródiÄen","","SÃœna tvojehó i Bóha krestóm ÄÃvo, sochraÅájemi prÃsno, bisóvskija prilóhi i kózni pobiÅŸdájem, súšÄuju Bohoródicu ťá voÃstinnu vospivájuÅ¡Äe: i ÄŸubóviju vsà ródi blaÅŸÃm preÄÃstaja, jákoÅŸe proreklá jesÃ. Å€ÃmÅŸe sohrišénij nášich ostavlénije molÃtvami tvojÃmi dáruj."),
),
"K": (
"P1": (
"1": (
("","","KolesnicehonÃteÄŸa faraóÅa pohruzÃ, Äudotvorjáj inohdá moiséjskij şézl, krestoobrázno porazÃv, i razÄilÃv móre: IzráiÄŸa ÅŸe bihlecá piÅ¡echódca spasé, pÃsÅ Bóhovi vospivájuÅ¡Äa."),
("","","IÌÅŸe ot dréva slástnoju sÅÃdiju mértva mjá bÃœvÅ¡aho, na kresťà Slóve umertvÃvyjsja, oÅŸivÃl jesÃ, i slávoju udobrÃl jesÃ: poklaÅájusja tvojéj derşávi, slavoslóvja stradánija, i blahoutróbije neisÄétnoje."),
("","","Jehdá rasprostrésja na drévi vinohrád nevozÄÃlannyj, vinó nám boşéstvennyja blahodáti istoÄÃ, serdcá veseğášÄeje, i prélesti pijánstvo otÅúd potrebğájuÅ¡Äeje, i hrichà oÄiÅ¡ÄájuÅ¡Äeje."),
("MúÄeniÄen","","PreispeÅ¡Äréni ránami velikomúÄenicy, i stradánij boÄŸÃzÅmi ukrašájemi, krasnÃœ dobrotvorÃteÄŸnomu VladÃœci predstáste so slávoju, vseslávno veseğášÄesja, i bohovÃdny poznavájemi."),
("MúÄeniÄen","","SÃloju boşéstvennoju projavlénno ukripğájemi svjatÃji, sÃÄŸnaho vsjú krÃposÅ¥ hubÃteÄŸnuju múşeski nizloÅŸÃste: i vinÄávÅ¡esja krasnó pobidÃteÄŸnymi vincÃœ, rádujuÅ¡Äesja Bóhu predstáste."),
("BohoródiÄen","","PredstojášÄi krestú tvojemú Hóspodi, neiskusobráÄnaja, i tvojé ujazvlénije zrjášÄi VladÃœko, ujazvğájema hlahólaÅ¡e: uvÃœ mÅà Äádo, boÄŸÃzni izbÃhÅ¡i v roÅŸdestvà tvojém, nÃœÅi boÄŸÃznenno terzájusja."),
),
"2": (
("","","KolesnicehonÃteÄŸa faraóÅa pohruzÃ, Äudotvorjáj inohdá moiséjskij şézl, krestoobrázno porazÃv, i razÄilÃv móre: IzráiÄŸa ÅŸe bihlecá piÅ¡echódca spasé, pÃsÅ Bóhovi vospivájuÅ¡Äa."),
("","","Na ťá ÄÃvo, nadéşdu vozloÅŸÃch spasénija mojehó, hrichóvnyja skvérny vsehó mja omÃœj, i ÄÃsta soÄÃlaj, Bóhu i SÃœnu tvojemú blahouhoÅŸdáti i ÄÃjati, i tohó vsesvjatómu Ãmeni."),
("","","Dvéri svÃta, óÄi mojà prosvitÃ, ÃÅŸe pomraÄà mráÄnyj zmÃj Å¥móju prehrišénij, i dvéri mà otvérzi pokajánija ÄÃvo, i k ÅŸivotú nastávi mjá, ot plámene i Å¥mÃœ ischitÃ."),
("","","Máti Bóşija, jáko derznovénije imúšÄi k róşdÅ¡emusja iz tebé, jedinoródnomu Slóvu, i Otcú sobeznaÄáğnomu, molà vseneporóÄnaja, dúšu mojú izbáviti ot bisóvskaho ozloblénija, i ohÅá, i vsjákaho muÄénija."),
("","","Blahoslovén plód BohonevÃsto tvojehó Äréva, ÃmÅŸe zemnÃji vsà ot kğátvy izbávichomsja, blahoslovénnaja, preÄÃstaja, neskazánnoje Äúdo, nedorazumÃjemoje vÃÄinije, vsÃch vÃrnych spasénije."),
),
),
"P3": (
"1": (
("","","UtverÅŸdéj v naÄáği nebesá rázumom, i zémÄŸu na vodách osnovávyj, na kámeni mjá Christé zápovidej tvojÃch utverdÃ: jáko ÅÃsÅ¥ svját, páÄe tebé jedÃne ÄelovikoğúbÄe."),
("","","UtverÅŸdéj nebesá, i zémÄŸu osnovávyj, i móre slóvom svjazávyj, tÃœ svjázan bÃœl jesà mené rádi, i na kresťà prihvoÅŸdájem: jáko da ot úz hrichá razriÅ¡ÃÅ¡i mjá ÄelovikoğúbÄe."),
("","","Krestnomu drévu vráh prirazÃvsja, umertvÃsja s bÃsy svojÃmi zloÄÃjstvennymi: i vkušénijem lukávym osuÅŸdénnyj, pomÃlovan bÃœsÅ¥, i utverÅŸdénijem blahoÄéstija tvár utverdÃsja."),
("MúÄeniÄen","","MnohovÃdnym ránam, i meÄém, i zvirém, i obnaşénijem Å¥ilésnym vdavájemi, lukávym honÃtelem, boşéstvenniji i dóbliji stradáğcy, i ne játy prebÜša manovénijem lúÄÅ¡im."),
("MúÄeniÄen","","VzirájuÅ¡Äe pomyÅ¡lénijem, i trézvennoju mÃœsliju k búduÅ¡Äym, i tekúšÄyja do koncá prenebrehóša Christóvy múÄenicy slávniji: Å¥ÃmÅŸe nesterpÃmyja boÄŸÃzni preterpÃÅ¡a rádujuÅ¡Äesja."),
("BohoródiÄen","","MnohopÃtaja Ãhnica, Ãhnca zrjášÄi vozdvizájema na drévo neprávedÅi, pláÄuÅ¡Äi vosklicáše, máterski slezjášÄi: i dolhoterpÃnije pojáše, tohó slávjaÅ¡Äi."),
),
"2": (
("","","TÃœ jesà utverÅŸdénije pritekájuÅ¡Äich k tebà Hóspodi, tÃœ svÃt omraÄénnych, i pojét ťá dúch mój."),
("","","Vsé mojé ÅŸelánije k tebà dvişá, VladÃœÄice ÄÃstaja, plotskÃch mjá ÅŸelánij vskóri preminÃ."),
("","","Vozsijáj mà pokajánija ÄÃstyja zarÃ, VladÃœÄice dvére svÃta, i hrichóv mojÃch mhlú potrebÃ."),
("","","JedÃna vseneporóÄnaja, poróka vsjákaho nás izbávi, i iskušénij nachoÄášÄich, i ohÅá vÃÄnujuÅ¡Äaho."),
("","","Uskorà positÃti boğášÄaho, preÄÃstaja, i ot ğútyja rány izbávi mjá, i vsjákija skórbi."),
),
),
"P4": (
"1": (
("","","TÃœ mojá krÃposÅ¥ Hóspodi, tÃœ mojá i sÃla, tÃœ mój Bóh, tÃœ mojé rádovanije, ne ostávÄŸ ÅÃdra ÃtÄa, i nášu niÅ¡Äetú positÃv. Å€Ãm s prorókom Avvakúmom zovú ti: sÃÄŸi tvojéj sláva ÄelovikoğúbÄe."),
("","","Ród ÄelovÃÄeskij ot padénija prizvásja, jehóşe podját drévle pervozdánnyj: vsÃch bo soÄÃteÄŸ vozdvÃÅŸen bÃœsÅ¥ na drévo, pérsty okrovavğájem, i hvozÄmà vóleju prihvoÅŸdájem v rúci, i v rébra kopijém probodájem."),
("","","Stá krest, i lésÅ¥ vsjá nizpadésja: tebà Spáse, obnaşénu bÃœvÅ¡u, obnaÅŸÃsja Äúşdij: i Adám boşéstvennaho netÄŸÃnija rÃzoju oÄÃjan bÃœsÅ¥, tvár prosvitÃsja pomraÄájemu sólncu, na drévi Christé raspinájemu tÃ."),
("MúÄeniÄen","","Nóvaho zakolénija, jákoÅŸe ovÄáta múÄenicy, poÅŸrénomu Slóvu prinesóstesja: króvnymi teÄéniji, prélesti morjá izsuÅ¡ÃvÅ¡e boşéstvennoju blahodátiju , izlijánije strastéj odoÅŸdénijem Äudés potrebğájete vsehdá slávniji."),
("MúÄeniÄen","","OtseÄénije udóv vsÃch podjáste múÄenicy, i zubóv i nohtéj iskorenénije, rúk otrÃzanije neÅ¡Äádno, jazÃœka ÅŸe i nóh i sostávov Å¥ilésnych: Å¥ÃmÅŸe prevelÃkija spodóbistesja slávy, vsÃch Bóhu predstojášÄe."),
("BohoródiÄen","","Svojehó si juncá neporóÄnaja júnica vÃÄivÅ¡i na drévo vozdvÃÅŸena, vopijáše so vosklicánijem: Äádo, káko ťá zakonoprestúpnych sónm otÅúd ne uÅ¡Äédri, uÅ¡ÄédrivÅ¡aho Ã? No usmotrénijem ÄŸstÃvym smérti predáti neprávedno proizvóli."),
),
"2": (
("","","UslÜšach Hóspodi, smotrénija tvojehó tájinstvo: razumÃch Äilá tvojá, i proslávich tvojé BoÅŸestvó."),
("","","Dúšu mojú, omraÄénnuju prehrišéÅmi, ozarà svÃtom prisnoÄÃvo, jáşe sólnce róşdÅ¡aja právdy."),
("","","Iskušénij mjá ischitÃ, i ÅŸitijá duÅ¡etÄŸÃnnyja búri, i ohÅá vÃÄnaho svobodà mja BohonevÃsto."),
("","","ÄÃvstva svjaÅ¡Äénnyj sosúde, i nevmistÃmaho jestestvóm vselénije. Dúšu mojú omraÄénnuju ot mnóhich strastéj, prosvitÃ."),
("","","Vsesvjatája BohonevÃsto, VladÃœÄice mÃra, tÃœ mja spasÃ, ot bÃd izbavğájuÅ¡Äi, i strastéj molvú othoÅájuÅ¡Äi."),
),
),
"P5": (
"1": (
("","","Vskúju mjá otrÃnul jesà ot licá tvojehó svÃte nezachodÃmyj, i pokrÃœla mjá jésÅ¥ ÄuÅŸdája Å¥má okajánnaho? No obratà mja, i k svÃtu zápovidej tvojÃch putà mojá naprávi, moğúsja."),
("","","Da slástnaho vkušénija izbáviÅ¡i mjá, şélÄi dolhoterpilÃve vkusÃl jesà choťá: i jáko da mértvosti sovleÄéši mjá Iisúse, strastéj, náh prihvozdÃtisja izvólil jesà na drévi: pojú tvojé blahoutróbnoje."),
("","","IstÄŸÃvÅ¡uju strasÅ¥mà dúšu mojú, Slóve, nóvu tvorjá, dúšu prédal jesà Otcú, na drévi vÃsja, i ne terpÃt bezdúšnaja zemğá sijá porazumivájuÅ¡Äi, no stráchom kolébletsja vospivájuÅ¡Äi ťá."),
("MúÄeniÄen","","UkrasÃstesja múÄenicy boşéstvennymi strásÅ¥mà udobrjájemi, i stopám posÄŸÃdovavÅ¡e strasÅ¥mà vsÃm bezstrástije podávÅ¡emu, Slóvu jedinoródnomu, Otcá beznaÄáğnaho: sehó rádi s nÃm proslavğájetesja."),
("MúÄeniÄen","","UstranÃvÅ¡esja dóğnich, nevÃdimyja nasÄŸÃdovaste, v nebésnych vodvorjájuÅ¡Äesja boşéstvennych selénijich, i priÄástijem boşéstvennym oboşájemi neveÅ¡Äéstvenno, spásovy nepobidÃmiji múÄenicy."),
("BohoródiÄen","","Stránno viÄÃnije, vÃÅŸu, vzyváše PrepÃtaja: káko ÃÅŸe zrÃnijem vsjú zémÄŸu kolébÄŸaj, na drévi vozvyšájem usnúl jesÃ, spjášÄyja ot vÃka choťá vozbudÃti? PoklaÅájusja SÃœne, tvojemú dolhoterpÃniju."),
),
"2": (
("","","ÃtreÅujuÅ¡Äe vopijém tÃ, Hóspodi, spasà ny: tÃœ bo jesà Bóh náš, rázvi tebé inóho ne vÃmy."),
("","","Pojém ťá ÄÃvo vsepÃtaja, jáşe Slóvo Bóşije vmistÃvÅ¡aja vo Äréve tvojém preneporóÄnaja."),
("","","OhÅá nehasÃmaho, i Äérvija izbávi mjá Máti Bóşija, jáko imúšÄaja jéşe mÃlovati cilébno."),
("","","SÅ¥iná tÃœ vÃrnych i derşáva vsesvjatája jesÃ, spasájuÅ¡Äi ot iskušénij pojúšÄyja ťá."),
("","","NedúhujuÅ¡Äuju dúšu mojú iscilÃ, róşdÅ¡aja vsÃch spasénije, i vzémÄŸuÅ¡Äaho nedúhi, preÄÃstaja VladÃœÄice."),
),
),
"P6": (
"1": (
("","","Bézdna hrichóv i prehrišénij búrja mjá smuÅ¡Äájet, i vo hlubinú núşdnaho rÃjet mjá otÄájanija: no tvojú krÃpkuju rúku mÅà prostrà jáko Petróvi, o UpráviteÄŸu, i spasÃ."),
("","","VospÃÅ¡a nebésnyja sÃly vsjá i udivÃÅ¡asja, na kresťà ťa Slóve vzirájuÅ¡Äe vÃsjaÅ¡Äa: i Adám ujázvlennyj Spáse, isciÄŸÃ jázvoju tvojéju, i kğátva prohnána bÃœsÅ¥."),
("","","Razrišájetsja ot úz neriÅ¡Ãmych ÄelovÃÄestvo, tebà Slóve plótiju svjázanu bÃœvÅ¡u: i svjazújetsja muÄÃteÄŸ jáko ptÃca, i ot vsÃch vÃrnych naruhájem: sláva Christé blahoutróbiju tvojemú."),
("MúÄeniÄen","","JavÃstesja BohozráÄniji strastotérpcy jákoÅŸe úhlije, vsjáku zloÄéstija vÃ©Å¡Ä popağájuÅ¡Äe blahodátiju , na úhlijach ÅŸe ohÅá vsesoÅŸihájemi, i boşéstvennoje prochlaÅŸdénije prijémÄŸuÅ¡Äe."),
("MúÄeniÄen","","OvÄáta Ãstinnaho pástyrja strastonóscy javğájemi, posreÄà dÃvijich volkóv nevreÅŸdéni prebÃœste, i skonÄávÅ¡e dóbre teÄénije boşéstvenniji, ko ohrádu nebésnuju vselÃstesja."),
("BohoródiÄen","","Hóspoda ťá ÅŸivotá porodÃch, i krásna dobrótoju páÄe synóv ÄelovÃÄeskich, ÄÃva vzyváše: i káko nÃœÅi umirájeÅ¡i SÃœne, dobróty ne imÃja v raspjátiji, udobrÃvyj vsjá manovénijem?"),
),
"2": (
("","","OÄÃsti mjá Spáse, mnóha bo bezzakónija mojá, i iz hlubinÃœ zól vozvedÃ, moğúsja: k tebà bo vozopÃch, i uslÜši mjá, Bóşe spasénija mojehó."),
("","","MarÃje, ÄÃstoje i vseÄestnóje ÅŸilÃÅ¡Äe vsÃch soÄÃteÄŸa, dúšu oÄiÅ¡ÄájuÅ¡Äyja podÃ¡ÅŸÄ mà slézy, i búduÅ¡Äaho sudá i múki ischità mja."),
("","","Dvéri Bóşija, vchódy boşéstvennyja pokaÅŸÃ smirénÅij mojéj duÅ¡Ã: v Åáşe všéd ispovÃdajasja, zlÃœch razrišénije Bohoródice vosprijimú."),
("","","PuÄÃna hrichóv, i vólny otÄájanija oburevájut mój úm: umilosérdisja VladÃœÄice, i rúku mà prostrÃ, i spasà mja, jáşe Spása róşdÅ¡aja."),
("","","ŀá predstáteÄŸnicu i sÅ¥Ãnu vÃrniji vsà Ãmamy, ÃÅŸe vo hlubiÅà zlÃœch, i mjatéşej i skorbéj prÃsno bÃdstvujuÅ¡Äiji, Bohoródice, jedÃna vÃrnych pribÃÅŸiÅ¡Äe."),
),
),
"P7": (
"1": (
("","","Bóşija snizchoÅŸdénija óhÅ ustyÄÃsja v VavilóÅi inohdá. Sehó rádi ótrocy v peÅ¡Äà rádovannoju nohóju, jáko vo cvÃtnici likújuÅ¡Äe, pojáchu: blahoslovén jesà Bóşe otéc nášich."),
("","","Uránen bÃœl jesà v rúci tvojà Christé, ÃmaÅŸe soÄÃlal jesà Äudesá: i rány preterpÃl jesÃ, rány mojá vsjá isciğája. Pojú Å¥a jedÃne dolhoterpilÃve, zovÃœj: blahoslovén Bóh otéc nášich."),
("","","PrihvoÅŸdén bÃœl jesà v rúci tvojà i nózi hvozÄmà Spáse, raspinájem, i v rébra probodén bÃœv, kápli istoÄája vsÃm ostavlénija pojúšÄym neprestánno, i hlahóğuÅ¡Äym: blahoslovén Bóh otéc nášich."),
("MúÄeniÄen","","LÃk sostávim pisnoslóvjaÅ¡Äe Bóşija múÄeniki, ÃÅŸe likóm ánheÄŸskim sopriÄtényja, i zemnÃœja prosviÅ¡ÄájuÅ¡Äyja, i vsehdá pojúšÄyja: blahoslovén Bóh otéc nášich."),
("MúÄeniÄen","","Vo svjatÃœch svÃtlostech osvjatÃvÅ¡esja vselÃstesja, posylájuÅ¡Äe vsÃm osvjaÅ¡Äénije ÅŸe i izbavlénije, voschvağájuÅ¡Äym vás boşéstvenniji múÄenicy, i vospivájuÅ¡Äym Christá, otéc nášich Bóşe blahoslovén jesÃ."),
("BohoródiÄen","","NezachodÃmoje sólnce, káko zájde na drévi raspinájem? ÄÃva vopijáše tà Slóve: i vÃÄiv sólnce, ostávi teÄénije, svitÃti ne mohÃj, tebà stráşduÅ¡Äu VladÃœko. PisnoslóvÄŸu tvojé SÃœne bezzlóbije."),
),
"2": (
("","","Ãtrocy jevréjstiji v peÅ¡Äà popráša plámeÅ derznovénno, i na rósu óhÅ preloÅŸÃÅ¡a, vopijúšÄe: blahoslovén jesà Hóspodi Bóşe vo vÃki."),
("","","Moğú Å¥a preÄÃstaja, umertvà şivúšÄij vo mÅà hrÃch, i ÅŸivotá poluÄÃti spodóbi mjá ÄÃvo: i Äásti mjá izbávi támo múÄimych."),
("","","Strásti razlÃÄnyja mjá oburevájut, róşdÅ¡aja ÄÃstaja, istóÄnika bezstrástija, Å¥Ãch oderşánija, i ohÅá vÃÄnaho izbávi mjá Bohoródice, molÃtvami tvojÃmi."),
("","","Nrávom vóğnym sohrišáju, i poraboÅ¡Äájem jésm bezmÃstnym obÃœÄajem, nÃœÅi ko obÃœÄÅij tvojéj mÃlosti pritekáju: otÄájannaho spasà mja vsesvjatája Bohoródice."),
("","","Uhasà plámeÅ strastéj mojÃch, i utiÅ¡Ã búrju sérdca mojehó, Bohomáti ÄÃstaja: i izbávi mjá preÄÃstaja, ot bisóv muÄÃteÄŸstva, i ohÅá vÃÄnaho."),
),
),
"P8": (
"1": (
("","","SedmerÃceju pÃ©Å¡Ä chaldéjskij muÄÃteÄŸ BohoÄestÃvym neÃstovno razşşé, sÃloju ÅŸe lúÄÅ¡eju spasény sijá vÃÄiv, tvorcú i izbáviteÄŸu vopijáše: ótrocy blahoslovÃte, svjaÅ¡Äénnicy vospójte, ğúdije prevoznosÃte vo vsjá vÃki."),
("","","Iz kórene Christé, prozjábl jesà Jesséova voploÅ¡Äájem, i iskoreÅájeÅ¡i izrástÅ¡eje térnije Adámova prestuplénija, vinéc nosjáj ternóv: na drévi ÅŸe prihvóşÄsja, júşe ot dréva isciğájeÅ¡i izrástÅ¡uju kğátvu, i pojúšÄyja spasájeÅ¡i: svjaÅ¡Äénnicy vospójte, ğúdije prevoznosÃte vo vsjá vÃki."),
("","","Da Bóha ÄelovÃka soÄÃlajeÅ¡i ÄelovikoğúbÄe, bÃœl jesà ÄelovÃk, i krestú priobÅ¡ÄÃvsja v rébra probodájem, i óctom s şélÄiju napojájem, otonúduÅŸe spásÅ¡ijisja tvojÃmi strasÅ¥mà Slóve, vopijém blahodárstvenno: svjaÅ¡Äénnicy vospójte, ğúdije prevoznosÃte Christá vo vsjá vÃki."),
("MúÄeniÄen","","Svjázani bÃœvÅ¡e múÄenicy, i jáko áhncy zakalájemi, i na ohnà nemÃlostivno ispecájemi, zvirém ÅŸe otdavájemi, i v hlavÃœ usikájemi, rádovastesja rádostiju neizhlahólannoju, vopijúšÄe: ÄÃti blahoslovÃte, svjaÅ¡Äénnicy vospójte, ğúdije prevoznosÃte Christá vo vÃki."),
("MúÄeniÄen","","Vincenóscy múÄenicy, ánhelom sopriÄástnicy, ÃÅŸe bezplótnyja vrahà poprávÅ¡e, molÃtvu sotvorÃte o nás ko Hóspodu, jáko da v ÄŸubvà i vo mnózi jedinomÃœsliji poÅŸivém, vopijúšÄe nesumÅÃnnym sérdcem: ÄÃti blahoslovÃte, svjaÅ¡Äénnicy vospójte, ğúdije prevoznosÃte Christá vo vÃki."),
("BohoródiÄen","","BoÄŸÃznenÅi steÅúšÄi, máterski vosklicáše, i utróbnaho smuÅ¡Äénija ne terpjášÄi na kresÅ¥Ã, vziráše k róşdÅ¡emusja iz tvojehó Äréva, vopijúšÄi: Ätó zrÃnije sijé Äádo, káko stráşdeÅ¡i, ÃÅŸe jestestvóm bezstrástnyj, vsjáko choťá ród ÄelovÃÄeskij ot strastéj svobodÃti?"),
),
"2": (
("","","Carjá nebésnaho, jehóşe pojút vóji ánheÄŸstiji, chvalÃte i prevoznosÃte vo vsjá vÃki."),
("","","BohorodÃteÄŸnice ÄÃvo, tÃœ mojá hrichà i brémja oblehÄà ot prehrišénij, jáko da ťá veliÄáju."),
("","","Jáşe sudijú róşdÅ¡i i Bóha, moÄŸbámi blahopreminÃteÄŸnymi tvojÃmi mÃlostiva mÅà tohó pokaÅŸÃ, ÄÃstaja: jáko da spasét mjá ot vÃÄnaho ohÅá."),
("","","Prehrišénija mojá mnóha prevzydóša Bohoródice, dÃ¡ÅŸÄ mà nÃœÅi rúku pómoÅ¡Äi, i ot plámene nehasÃmaho izbávi mjá nepotrébnaho."),
("","","Prosvità preÄÃstaja, sérdca mojehó óÄi moğúsja, Äérnostiju hrichóvnoju osÄŸiplényja, i prijátny boşéstvennaho sijánija pokaÅŸÃ, jáko da javğúsja tebé rádi tvojemú SÃœnu ÄÃst."),
),
),
"P9": (
"1": (
("","","UÅŸasésja o sém nébo, i zemlà udivÃÅ¡asja koncÃœ, jáko Bóh javÃsja ÄelovÃkom plótski, i Ärévo tvojé bÃœsÅ¥ prostránÅijÅ¡eje nebés. Å€Ãm ťá Bohoródicu ánhelov i ÄelovÃk ÄinonaÄálija veliÄájut."),
("","","IscilÃl jesà VladÃœko mojá jázvy, ujazvÃvsja i okrovavÃv rúci svojÃ, i k putém chodÃti spasÃteÄŸnym, jáko bláh naprávil mjá jesà Hóspodi, nózi iskopáv svojá na kresÅ¥Ã, ÃchÅŸe drévle rodonaÄáğnicy vÃÄivÅ¡e choÄášÄa ťá v rajÃ, sokryváchusja."),
("","","IsprávivÅ¡usja tà na kresÅ¥Ã, isprávisja padÃœj padénijem vélijim pervozdánnyj. KrÃposÅ¥ ÅŸe vsjá padésja vráşija, vsjá ÅŸe zemğá osvjatÃsja króviju i vodóju, ot rébr tvojÃch izlijánnoju. Å€ÃmÅŸe ťá vseÅ¡Äédre, neprestánno veliÄájem."),
("MúÄeniÄen","","Vjáşemi svjatÃji múÄenicy, vjazánija lukávaho razruÅ¡Ãste, i úzami, jáşe preterpÃste terpelÃvno, tohó svjazáste, i pokorÃste pod nózi, studá ispólnena, i smÃch zrjášÄym sotvorÃste, blahodátiju boşéstvennoju."),
("MúÄeniÄen","","Zemğá poloşénijem svjaÅ¡Äénnych múÄenik moÅ¡Äéj osvjatÃsja: Ãbo istóÄnik istoÄájuÅ¡Ä iscilénij vsjáÄeskich sijá boşéstvennaho sÅ¥aÅŸavájet, strásti Å¥ilésnyja i dušévnyja neprestánno isciğájuÅ¡Äi, i vreÅŸdénije bisóvskoje otrivájuÅ¡Äi boşéstvennoju blahodátiju ."),
("BohoródiÄen","","IzbÃhÅ¡i boÄŸÃznej máternich vo vrémja roÅŸdénija, dolhoterpilÃve, jehdá ÅŸe tà nÃœÅi strásti vólÅij priÄastÃvÅ¡usja, i boÄŸÃzni prijÃmÅ¡u, poboÄŸÃch utróboju, i dušéju boÄŸÃzni ispólnichsja, preÄÃstaja vopijáše, júşe dostójno veliÄájem."),
),
"2": (
("","","UstraÅ¡Ãsja vsják slúch neizreÄénna Bóşija snizchoÅŸdénija, jáko vÜšnij vóleju snÃde dáşe i do plóti, ot ÄivÃÄeskaho Äréva bÃœv ÄelovÃk: Å¥ÃmÅŸe preÄÃstuju Bohoródicu vÃrniji veliÄájem."),
("","","UÅ¡Äédri preÄÃstaja, okajánnuju mojú dúšu, i umertvà strásti hubÃteÄŸnyja, i muÄÃteÄŸnoje nedoumÃnije otÅŸenÃ: strujà şe sléz svjatÃœja dáruj prisnoÅŸivótnyja, ÃmiÅŸe izbávÄŸusja ÅŸdúšÄaho mjá ğútaho osuÅŸdénija."),
("","","SÅ¥iná christijánom, i pribÃÅŸiÅ¡Äe tvérdoje mÃru, v némÅŸe spasájemsja, tÃœ jesà ÄÃvo ÄÃstaja BohonevÃsto: iz tebé bo Bóh voplotÃvsja, tebé vsÃm podadé pokróv spasÃteÄŸnyj. Å€ÃmÅŸe ÄÃstaja, spasà mja nedostójnaho."),
("","","BeznaÄáğne Slóve ÃtÄij, i SÃœne mój, i svjatómu Dúchu soprestóğnyj, káko svojà preÄÃsÅ¥iji dláni na kresťà prostérl jesÃ? Ätó nÃœÅi tolÃkaja tvojá niÅ¡Äetá, prebláhÃj? PredstojášÄi tvojemú raspjátiju, vopijáše vseneporóÄnaja."),
("","","IskápajuÅ¡Äi boşéstvennuju sládosÅ¥, jáşe vsÃch sládosÅ¥ róşdÅ¡aja, usladà dúšu mojú, ohorÄénnuju jádom zmÃja, otÄuÅŸdájuÅ¡Äi mjá hórkaho hrichá vsehdá chodátajstvom tvojÃm, predstáteÄŸnice vÃrnych nepostÃœdnaja."),
),
),
),
"CH": (
("","","Moiséjev şézl proobraşáše ÄéstnÃœj krest tvój Spáse náš: Å¥Ãm bo spasájeÅ¡i jáko iz hlubinÃœ morskÃja, ğúdi tvojá ÄelovikoğúbÄe."),
("","","Jéşe drévle vo Jedémi v rajÃ, drévo sÅÃdnoje prozjabló jésÅ¥ posreÄà sadóv: cérkov ÅŸe tvojá Christé, krest tvój procvité, istoÄájuÅ¡Ä vsemú mÃru ÅŸÃzÅ. No óno úbo umertvà sÅÃdiju jádÅ¡aho Adáma: sijé ÅŸe ÅŸÃva sotvorÃ, vÃroju spásÅ¡asja razbójnika: jehóşe spasénija priÄástniki i nás javà Christé Bóşe, ÃÅŸe strástiju tvojéju razruÅ¡Ãv, jáşe na nÃœ kózni vráşija, i spodóbi nás cárstvija tvojehó Hóspodi."),
("MúÄeniÄen","","MúÄenicy Christóvy nepobidÃmiji, pobidÃvÅ¡e lésÅ¥ sÃloju krestnoju, vosprijáste blahodáť vÃÄnyja ÅŸÃzni, muÄÃtelej preÅ¡Äénija ne ubojávÅ¡esja, múkami uraÅájemi veselÃstesja: i nÃœÅi króvi váša bÜša iscilénija dušám nášym. MolÃte spastÃsja dušám nášym."),
("KrestobohoródiÄen","","Na kresťà povÃÅ¡ena zrjášÄi ÄÃstaja tebé róşdÅ¡aja Hóspodi, i blÃz bÃœvÅ¡i, pláÄuÅ¡Äi hlahólaÅ¡e: Äádo, Ätó sijá stráşdeÅ¡i plótiju, i tÅ¡ÄÃÅ¡isja bezÄádstvovati mjá? PotÅ¡ÄÃsja proslávitisja, jáko da vozvelÃÄusja strástiju tvojéju."),
),
)
#let L = (
"B": (
("","","Pomjanà nás, Christé Spáse mÃra, jákoÅŸe razbójnika pomjanúl jesà na drévi: i spodóbi vsÃch jedÃne Å¡Äédre, nebésnomu cárstviju tvojemú."),
("","","Åœezlóm Moiséj krest voobraşája, razÄiğáše hlubinú, ğúdi IzráiÄŸteskija prevoÄá: mÃœ ÅŸe tohó voobraşájuÅ¡Äe, mÃœslennyja vrahà pobiÅŸdájem."),
("","","Drévle Jákov blahoslovğája ótroki, sÃœny synóv svojÃch, rúci premiÅája prostiráše, známenaja tvój krest Christé Spáse, ÃmÅŸe vsà ot kğátvy svobodÃchomsja."),
("","","Strástém Christóvym revnújuÅ¡Äe strastotérpcy, múki hórkija podjáste múşeski, i netÄŸÃnnymi vincÃœ vinÄávÅ¡esja, na nebesÃch ÅŸiveté."),
("","","Sláva Otcú jedÃnomu bezsmértnomu: sláva SÃœnu vo vÃki ÅŸivúšÄemu: sláva kúpno Dúchu vsesvjatómu, vsjú tvár osvjaÅ¡ÄájuÅ¡Äemu."),
("","","Iz ÄivÃÄeskaho Äréva tvojehó ÄÃstaja, vozsijá SoÄÃteÄŸ sólnca i lunÃœ: jehóşe zrjášÄi povÃÅ¡ena na drévi, vsjá tvár kolebášesja."),
),
)
|
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/06-features-2/features-2.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/heading.typ": chapter
#import "/template/components.typ": note
#import "/lib/glossary.typ": tr
#show: web-page-template
#chapter(
label: <chapter:substitution-positioning>
)[
// Substitution and Positioning Rules
#tr[substitution]å#tr[positioning]è§å
]
// As we have seen, OpenType Layout involves first *substituting* glyphs to rewrite the input stream, and then *positioning* glyphs to put them in the right place. We do this by writing collections of *rules* (called lookups). There are several different types of rule, which instruct the shaper to perform the substitution or positioning in subtly different ways.
ä»äžäžç« æ们èœç¥éïŒOpenTypeç#tr[layout]è¿çšå䞺äºäž€äžªé¶æ®µïŒéŠå
æ¯#tr[substitution]è§åå°èŸå
¥ç#tr[glyph]æµéåïŒç¶åæ¯#tr[positioning]è§åå°#tr[glyph]们å®æå°æ£ç¡®çäœçœ®äžãæ们éè¿çŒåè§åéïŒä¹å°±æ¯#tr[lookup]ïŒå¯ä»¥æ§å¶è¿äžè¿çšãèè§åå
·æäžåçç±»åïŒå®ä»¬åå«çšäžåçæ¹åŒæ¥æ§è¡å
·äœç#tr[substitution]å#tr[positioning]æäœã
// In this chapter, we'll examine each of these types of rule, by taking examples of how they can be used to layout global scripts. In the next chapter, we'll look at things the other way around - given something we want to do with a script, how can we get OpenType to do it? But to get to that stage, we need to be familiar with the possibilities that we have at our disposal.
åšæ¬ç« äžïŒæ们å°äŒä»ç»ææç±»åçè§åïŒå¹¶äžŸäŸè¯Žæå®ä»¬åšå€ç#tr[global scripts]ç#tr[layout]è¿çšäžèµ·å°äºä»ä¹äœçšãäžäžç« åŒå§åäŒæ¢äžäžªæ¹åïŒä»ç»åšç»å®æç§#tr[script]çæ¡ä»¶äžïŒOpenTypeæ¯åŠäœå€çå®çãäœåšåŒå§çµæŽ»è¿çšä¹åïŒæ们éŠå
èŠè¶³å€äºè§£å·¥å
·ç®±äžçåç§å·¥å
·ã
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/raw-color-overwrite.typ | typst | Apache License 2.0 | // Test that the color of a raw block is not overwritten
---
#show raw: set text(fill: blue)
`Hello, World!`
```rs
fn main() {
println!("Hello, World!");
}
``` |
https://github.com/Enter-tainer/typst-preview | https://raw.githubusercontent.com/Enter-tainer/typst-preview/main/docs/ebook.typ | typst | MIT License | #import "@preview/book:0.2.2": *
#import "./templates/gh-ebook.typ" as ebook
#show: ebook.project.with(title: "Typst Preview Book", spec: "book.typ")
// set a resolver for inclusion
#ebook.resolve-inclusion(it => include it)
|
https://github.com/kdog3682/2024-typst | https://raw.githubusercontent.com/kdog3682/2024-typst/main/src/ham-components.typ | typst | #import "util.typ": *
#let ham-title-1(s, tags: none) = {
if exists(tags) {
cr-flex-row(
heading(s),
cr-hash-tags(tags)
)
line(length: 100%)
}
else if exists(tags) {
}
else {
heading(s)
line(length: 100%)
}
}
|
|
https://github.com/barddust/Kuafu | https://raw.githubusercontent.com/barddust/Kuafu/main/src/BeforeMathematics/build.typ | typst | #{
import "/config.typ": project
import "/mathenv.typ": *
show: mathenv-init
project(
"倞ç¶ïŒæ°åŠåºç¡",
"0.1",
"BeforeMathematics",
(
"intro.typ",
"logic.typ",
"proof.typ",
"set.typ",
),
bio: false
)
}
|
|
https://github.com/FlyinPancake/bsc-thesis | https://raw.githubusercontent.com/FlyinPancake/bsc-thesis/main/thesis/preamble.typ | typst | #let student_surname = text[*Pálvölgyi*]
#let student_names = text[*Domonkos*]
#let student_name_hu = [#student_surname #student_names]
#let student_name_en = [#student_names #student_surname]
#let consultant = text[*Dr. <NAME>*, assosiate professor]
#let second_consultant = text[*<NAME>*, PhD student]
#let external_consultant = text[*<NAME>*, <NAME>]
#let today = datetime.today()
#let show_today = today.display("[day] [month repr:long] [year]")
#let months_hu = ("január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december")
#let show_today_hu = [#today.year(). #months_hu.at(today.month() - 1) #today.day().] |
|
https://github.com/ngoetti/knowledge-key | https://raw.githubusercontent.com/ngoetti/knowledge-key/master/template/sections/03-terraform.typ | typst | MIT License | #import "../utils.typ": *
= Terraform
The idea of Terraform is to help provision infrastructure (Infrastructure as code).
It has support for all common cloud provider.
Terraform and Ansible are complementary.
Terraform deals with the infrastructure stack, Ansible deals with the application stack.
In Terraform you interact with Provider Plugins.
A provider converts the terraform syntax to something that the SDK can consume.
The SDK then sends API calls to the cloud provider (for example AWS).
The different plugins are managed by the community (AWS, GCP, Azure, ...).
#sourcecode[```yaml
provider "aws" {
access_key = "<AWS_ACCESS_KEY>"
secret_key = "<AWS_SECRET_KEY>"
region = "us-east-1"
}
```]
#sourcecode[```yaml
resource "aws_instance" "excercise_0010" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "HelloWorld"
Terraform = true
}
}
```]
*Terraform workflow*
- Write your Terraform stuff
- Let Terraform plan the changes that must be applied
- Let Terraform apply the changes
*Common Terraform commands*
- `terraform init` (Initialize Terraform, perform where the .tf files are located)
- `terraform plan` (tells the operator whatâs going to be changed)
- `terraform apply` (applies the changes)
- `terraform destroy` (This command figures out what has been done and undo all the changes / Folder Specific)
*`terraform.tfstate` file*\
This file knows what has already been deployed.
So, if you run terraform apply twice in a row, it will know that there is nothing to do.
When you manually change something (e.g using the AWS web UI), terraform will revert your changes as the .tf files are the single source of truth.
Terraform creates the terraform.tfstate file the first time you run the command terraform apply.
Any other times it makes a 3-way diffs from the stateâs NEW, EXISTING and PREVIOUS to get a full picture of the current situation.
State files can get corrupted (not that often, but it can happen).
*References*\
References in Terraform are like variables.
You can reference references to get actual values defined in other places of your Terraform script.
*Output*\
Output are return values of a function.
You ultimately define references, which you want to display at the end of terraform apply.
#sourcecode[```tf
output "example-ip" {
value = aws_instance.excercise_0010.public_ip
description = "The public IP of the instance"
}
```]
*Data*\
The data is an input for the Terraform provider.
It uses the cloud to look up data and feed this data into the terraform script.
-> `data "aws_ami "latest_ubuntu" {...}`
*Variables*\
If a variable is defined without a default value, it will prompt the operators to enter the value.
#sourcecode[```tf
variable "port" {
description = "The port to expose on the server"
type = number
default = 8080
}
```]
Variables can also be overwritten as an argument or environment variable.
*Organization (Best practice):*
- Create one folder for each environment
- Every folder gets its own state file
*Module (Code re-use)*
- A module is just re-usable code
- A module can be invoked and supplied with all variables
|
https://github.com/ntjess/toolbox | https://raw.githubusercontent.com/ntjess/toolbox/main/examples/main.typ | typst | #import "/toolbox.typ": git-graph
#import git-graph: *
#set page(width: auto, height: auto, fill: black)
#cetz.canvas({
git-graph({
branch[main]
commit[initial commit]
branch[feature]
branch[feature2]
// Or pass branch instead of checking out
commit(branch: "feature")[commit 1]
commit(branch: "feature2")[commit 2]
// git-graph remembers its branch if none is specified
commit[commit 3]
checkout("main")
branch[hotfix]
commit[bugfix]
checkout("feature")
merge("hotfix", message: [apply hotfix])
checkout("main")
merge("feature", message: [merge feature])
tag[v1.0.0]
checkout("feature2")
merge("main")
commit[commit 4]
checkout("main")
merge("feature2")
tag[v2.0.0rc1]
background-lanes()
})
}) |
|
https://github.com/thanhdxuan/dacn-report | https://raw.githubusercontent.com/thanhdxuan/dacn-report/master/report-week-5/contents/02-introduce.typ | typst | = Tá»ng quan
Báo cáo tuần 5 của nhóm táºp trung và o giải quyết những vấn Äá» theo sá»± hÆ°á»ng dẫn của GVHD (Thầy Quang),
bao gá»m:
- Tìm kiếm dữ liá»u tin cáºy vá» chủ Äá» *_Loan Approval Prediction_* và nghiên cứu, áp dụng những kỹ thuáºt khai phá dữ liá»u lên Äó.
- BÆ°á»c Äầu phân tÃch các yêu cầu chức nÄng, phi chức nÄng, vẜ sÆ¡ Äá» use-case cho website của bá» cÃŽng cụ.
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/frac_08.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// 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 \
n!/2, 5!/2, n !/2, 1/n!, 1/5! $
|
https://github.com/pascalguttmann/typst-template-report-lab | https://raw.githubusercontent.com/pascalguttmann/typst-template-report-lab/main/template/chapter/summary.typ | typst | MIT License | = Summary and Discussion
|
https://github.com/hewliyang/fyp-typst | https://raw.githubusercontent.com/hewliyang/fyp-typst/main/conclusion.typ | typst | #set heading(numbering: "1.")
= Conclusion
To recap, in this work, we have achieved the following:
1. Establish the basics for understanding speech processing and TTS
2. Curated a large dataset for training NISQA & MOSNet style of supervised models
3. Published these datasets for use by the public on the HuggingFace Hub
4. Reproduced the results of NISQA including pre-training and transfer learning
5. Analysed the potential pitfalls of MOS predictors in out-of-distribution scenarios
6. Explored alternative metrics and the use of self-supervised features in existing architectures.
Our work has demonstrated the inherent limitations of relying on Mean Opinion Score (MOS) as the sole metric for evaluating synthetic speech quality, particularly in light of the rapid advancements in modern speech synthesis technologies. While MOS has served as a convenient benchmark for many years, its relative nature and susceptibility to various biases, including the absence of well-defined anchors @chiang2023reportdetailssubjectiveevaluation, render it an unreliable measure of absolute quality. Our experiments highlight the significant influence of lower-quality systems acting as anchors, the impact of introducing higher-quality systems on historical ratings, and the potential saturation of the MOS scale in the face of increasingly natural-sounding synthetic speech.
These findings underscore the urgent need for a paradigm shift in speech synthesis evaluation methodologies. Relying solely on MOS, especially in the context of training automatic MOS predictors, risks perpetuating the problem of reliably predicting an unreliable score. Future work should focus on developing more robust and nuanced evaluation protocols that address the limitations of ACR. This includes exploring the use of standardized anchors in ACR, investigating alternative protocols like MUSHRA with its hybrid rating/ranking approach @le_maguer_limits_2024, and incorporating public leaderboards testing such as the TTS Arena. By embracing a more holistic approach, we can better characterize the true advancements in speech synthesis technology and move beyond the limitations of MOS.
The codebases used through this work can be accessed at:
- Training & evaluation codebase - #link("https://github.com/hewliyang/nisqa")
- Typesetting (Typst) and diagrams - #link("https://github.com/hewliyang/fyp-typst")
- Blizzard Challenge datasets from 2008 to 2023 - #linebreak()#link("https://huggingface.co/datasets/hewliyang/nisqa-blizzard-challenge-mos")
- VCC datasets - #link("https://huggingface.co/datasets/hewliyang/nisqa-vcc-mos") |
|
https://github.com/0x1B05/english | https://raw.githubusercontent.com/0x1B05/english/main/cnn10/content/20240312.typ | typst | #import "../template.typ": *
#pagebreak()
= 20240312
Hello, Superstar! And welcome to CNN10, #strike[Well, I'll tell you what let you decide and what to think.]where I tell you the what, letting you decide what to think. I'm *Coy Wire*.
== TikTok
And we begin #strike[ at ] #underline()[_on_] nation's capital, #strike[ of ] where House *lawmakers* are quickly moving *ahead* on legislation that could possibly ban the popular social media app TikTok from the United States.
TikTok is used by about 170 million of Americans#strike[. But], but this measure is looking to prohibit TikTok from #strike[the USA] U.S. app stores unless the app is no longer connected to ByteDance, its parent company, which is based in China. Some lawmakers are concerned that TikTok could possibly enable the Chinese government to have too much information about its users#strike[. A legend], alleging that #strike[is] it's a possible national security threat. On the other side, TikTok denies #strike[this] these claims and believes this legislation is #strike[in] an attack #strike[of] on #strike[the] First #strike[man] *Amendment* rights. #strike[ This propose to .. has part ... support, ]This *proposed bill* has bipartisan support and is scheduled to be voted by the house quickly. If the bill eventually does make its way to President Biden's desk, the White #strike[House's] House says Biden would sign it. Now if this proposed bill is put into the law, it will allow TikTok about 5 months to cut ties with ByteDance. If ties were not to be cut, this measure would prohibit TikTok to be downloaded on app stores in the U.S. Here's are *Manu Raju* with more.
#strike[ The house ... plan to ... legislation, ... ]The House are *plowing ahead with* the plan to *take up legislation* to essentially ban TikTok if the Chinese firm, ByteDance doesn't sell it. *They are trying to* force that sale #strike[ . That's .. because ... ] because of concerns that Chinese government is too close to private information of Americans. They are alleging that Chinese government #strike[ are easy to .. ] *is interfering* with that information and could #strike[ exploded something ] *exploit it, something* that ByteDance has furious denied. But #strike[ remember this] nevertheless, this #strike[ is why the ... ] #underline[_has wide bipartisan_] support approved by *the House Energy and Commerce Committee* last week, 50 to nothing. #strike[ It's ] That is something that rarely seen on *Capital Hill*, #underline[_but that bipartisan support ultimately forcing the House Majority Leader to_] put this bill on the *floor* very quickly. *<NAME> said* he #strike[will] would take #underline[_up_] this measure #strike[the fully household, and] #underline[_ the full House in_] just a matter of days. That doesn't the mean though TikTok #underline[_isn't_] trying to kill it. #underline()[_In fact_], #strike[And ByteDance] that's ByteDance exactly #strike[_would_] #underline[_what they're_] trying to do #strike[that top]. #underline[_The top Republican who chairs the Energy and Commerce Committee told me that_] she is getting flooded with phone calls over people opposed to the efforts.
Yes, we've been flooded with calls, #underline[_record amounts of calls_]. Any member of *the Energy and Commerce Committee* that voted yesterday has been flooded. #underline[_The co-sponsors have been flooded._]
TikTok actually put up a notice #strike[ that ] #underline[_where_] they blocked an individual #underline[_to actually get on TikTok_] unless you called #underline[_your member_] of Congress and told them #underline[_not to vote for_] this legislation.
But that's just a example of how they can manipulate data and influence on Americans #underline[_for their agenda_]
But what #underline[_will happen in the Senate?_] That was a completely different question. #strike[ All together year ]Altogether here, #underline[_the senators_] has some #strike[ other ] of their own ideas #underline[_, but it could_] take some time to get through. But if it does become a #underline[_law_] , president Biden said, he will sign it.
=== hard
They're trying to force that sale,..
=== words and phrases
==== words
- _lawmakers_
- _allege_
- _First Amendment_
- _proposed bill_
- _bipartisan_
- _plow_
- _exploit_
- _nevertheless_
- _Capital Hill_
- _House Energy and Commerce Committee_
- _House Majority Leader_
- _the top Republican_
==== phrases
- _look to_
- _move ahead on legislation_
- _put into_
- _cut ties with ..._
- _plow ahead with ...(plan..)_
- _interfere with_
- _put the bill on the floor_
- _take up this measure_
- _a matter of days_
- _for one's agenda_
=== åè¯
==== åæ
Hello, Superstar! And welcome to CNN10, where I tell you the what, letting you decide what to think. I'm Coy Wire. And we begin on nation's capital, where House lawmakers are quickly moving ahead on legislation that could possibly ban the popular social media app TikTok from the United States.
TikTok is used by about 170 million of Americans, but this measure is looking to prohibit TikTok from U.S. app stores unless the app is no longer connected to ByteDance, its parent company, which is based in China. Some lawmakers are concerned that TikTok could possibly enable the Chinese government to have too much information about its users, alleging that it's a possible national security threat. On the other side, TikTok denies these claims and believes this legislation is an attack on First Amendment rights. This proposed bill has bipartisan support and is scheduled to be voted by the house quickly. If the bill eventually does make its way to President Biden's desk, the White House says Biden would sign it. Now if this proposed bill is put into the law, it will allow TikTok about 5 months to cut ties with ByteDance. If ties were not to be cut, this measure would prohibit TikTok to be downloaded on app stores in the U.S. Here's are Manu Raju with more.
The House are plowing ahead with the plan to take up legislation to essentially ban TikTok if the Chinese firm, ByteDance doesn't sell it. They are trying to force that sale because of concerns that Chinese government is too close to private information of Americans. They are alleging that Chinese government is interfering with that information and could exploit it, something that ByteDance has furious denied. But nevertheless, this has wide bipartisan support approved by the House Energy and Commerce Committee last week, 50 to nothing. That is something that rarely seen on Capital Hill, but that bipartisan support ultimately forcing the House Majority Leader to put this bill on the floor very quickly. <NAME> said he would take up this measure the full House in just a matter of days. That doesn't the mean though TikTok isn't trying to kill it. In fact, that's ByteDance exactly what they're trying to do. The top Republican who chairs the Energy and Commerce Committee told me that she is getting flooded with phone calls over people opposed to the efforts.
Yes, we've been flooded with calls, record amounts of calls. Any member of the Energy and Commerce Committee that voted yesterday has been flooded. The co-sponsors have been flooded. TikTok actually put up a notice where they blocked an individual to actually get on TikTok unless you called your member of Congress and told them not to vote for this legislation. But that's just a example of how they can manipulate data and influence on Americans for their agenda
But what will happen in the Senate? That was a completely different question. Altogether here, the senators has some of their own ideas , but it could take some time to get through. But if it does become a law , president Biden said, he will sign it.
==== åèç¿»è¯
åšïŒå€§ææïŒæ¬¢è¿æ¶çCNN10ïŒæåè¯äœ äºæ
çççžïŒè®©äœ èªå·±å»æèãææ¯Coy Wireãæ们ä»åœå®¶éŠéœåŒå§ïŒäŒè®®é¢è®®å们æ£åšè¿
éæšè¿äžé¡¹ç«æ³ïŒå¯èœäŒçŠæ¢æµè¡ç瀟亀åªäœåºçšTikTokåšçŸåœç䜿çšã
TikTok被倧纊1.7亿çŸåœäººäœ¿çšïŒäœè¿é¡¹æªæœæšåšçŠæ¢TikTokåšçŸåœåºçšååºäžæ¶ïŒé€é该åºçšäžåäžå
¶æ»å
¬åžåèè·³åšæèç³»ïŒèåèè·³åšæ»éšäœäºäžåœãäžäºè®®åæ
å¿ïŒTikTokå¯èœäŒè®©äžåœæ¿åºè·åŸè¿å€æå
³å
¶çšæ·çä¿¡æ¯ïŒå£°ç§°è¿å¯èœææåœå®¶å®å
šåšèãåŠäžæ¹é¢ïŒTikTokåŠè®€äºè¿äºè¯Žæ³ïŒå¹¶è®€äžºè¿é¡¹ç«æ³æ¯å¯¹ç¬¬äžä¿®æ£æ¡æå©çæ»å»ãè¿é¡¹æè®®çæ³æ¡åŸå°äºäž€å
çæ¯æïŒå¹¶è®¡ååšäŒè®®é¢è¿
éæ祚衚å³ãåŠæè¿é¡¹æ³æ¡æç»éå°æç»æ»ç»çæ¡åäžïŒçœå®«è¡šç€ºæç»å°çŸçœ²ãç°åšïŒåŠæè¿é¡¹æè®®çæ³æ¡æ䞺æ³åŸïŒå®å°å
讞TikTokæ倧纊5䞪æçæ¶éŽäžåèè·³åšè§£é€èç³»ãåŠæè系没æ解é€ïŒè¿é¡¹æªæœå°çŠæ¢åšçŸåœçåºçšååºäžèœœTikTokãæ¥äžæ¥æ¯Manu RajuçæŽå€æ¥éã
äŒè®®é¢æ£åšç§¯ææšè¿è®¡åïŒåå€ç«æ³çŠæ¢TikTokïŒåŠæäžåœå
¬åžåèè·³åšäžåºå®å®ãä»ä»¬è¯åŸè¿«äœ¿åºå®ïŒå 䞺ä»ä»¬æ
å¿äžåœæ¿åºäžçŸåœäººçç§äººä¿¡æ¯è¿äºæ¥è¿ãä»ä»¬å£°ç§°äžåœæ¿åºå¹²é¢è¿äºä¿¡æ¯ïŒå¹¶å¯èœå 以å©çšïŒèåèè·³åšå·²ç»åŒºçåŠè®€äºè¿äžç¹ãäœå°œç®¡åŠæ€ïŒè¿äžç«æ³åŸå°äºå¹¿æ³ç䞀å
æ¯æïŒäžåšç±äŒè®®é¢èœæºååäžå§åäŒä»¥50祚对é¶ç¥šéè¿ãè¿åšåœäŒå±±äžæ¯çœè§çäºæ
ïŒäœæç»æ¯äž€å
ç广æ³æ¯æ迫䜿äŒè®®é¢å€æ°å
é¢è¢è¿
éå°è¿é¡¹æ³æ¡æäžè®®çšã<NAME>衚瀺ïŒä»å°åšå 倩å
让äŒè®®é¢å
šäœè®®åæ祚ãäœè¿å¹¶äžæå³çTikTok没æåå»ãäºå®äžïŒè¿æ£æ¯åèè·³åšæ£åšåçãäž»æèœæºååäžå§åäŒçæé«å
±åå
人åè¯æïŒå¥¹æ¶å°äºå€§éå对è¿äžåªåççµè¯ã
æ¯çïŒæ们æ¶å°äºå€§éçµè¯ïŒå纪åœççµè¯ãæšå€©æ祚çä»»äœäžåèœæºååäžå§åäŒæåéœæ¶å°äºå€§éæ¥çµãèåå起人ä¹æ¶å°äºå€§éæ¥çµãTikTokå®é
äžååžäºäžåéç¥ïŒé»æ¢äžäžªäººè¿å
¥TikTokïŒé€éäœ ç»åœäŒè®®åæçµè¯åè¯ä»ä»¬äžèŠæ祚æ¯æè¿é¡¹ç«æ³ãäœè¿åªæ¯ä»ä»¬åŠäœæ纵æ°æ®å¹¶åœ±åçŸåœäººä»¥ç¬Šåä»ä»¬ç计åçäžäžªäŸåã
äœåšåè®®é¢äŒåçä»ä¹ïŒè¿æ¯äžäžªå®å
šäžåçé®é¢ãåè®®å们æäžäºèªå·±çæ³æ³ïŒäœå¯èœéèŠäžäºæ¶éŽæèœéè¿ãäœåŠæå®æ䞺æ³åŸïŒæç»æ»ç»è¡šç€ºïŒä»å°çŸçœ²ã
==== 1st
Hello, superstar! Welcome to CNN10, where I tell you the what, #strike[let] #underline[letting] you to think. I'm Coy Wire.
Let's #strike[start with the capital of the country] #underline[begin on the nation's capital], #strike[senators are taking up a legislation rapidly, which may ban the usage of the popular app "TikTok" in U.S.] #underline[where the House lawmakers are quickly *moving ahead on legislation* that could possibly ban the popular media app TikTok from the United States.]
TikTok #strike[was] is used by 170 million Americans, but this #strike[legislation will ban "TikTok"] #underline[measure is *looking to* prohibit TikTok] from U.S. app stores#strike[,] unless it #strike[cut ties with] #underline[is no longer connected to] #strike[its parent company, ByteDance] #underline[Bytedance, its parent company, which is based] in China. Some lawmakers #strike[concern] #underline[are concerned] that TikTok #strike[are likely to make] #underline[could possibly *enable*] Chinese government #strike[achieve] #underline[to have] too much information #strike[of] #underline[about] its users, #strike[and claimed which would be a safety threat to the U.S.] #underline[alleging that it's a possible *national security threat*.] On the other side, TikTok denies these #underline[claims] and #strike[consider] #underline[believes] the legislation #strike[as] #underline[is] an attack #strike[of] #underline[on] First Amendment #underline[rights.] The proposed bill has #strike[a wide] bipartisan support, and #strike[soon will be ... in] #underline[*is sheduled to* be voted by] the House quickly. If #strike[this legislation] #underline[the bill] #strike[is eventually sent] #underline[does *make its way*] to President Biden's desk, the White House said, Biden #strike[will] #underline[would] sign it. Now , if the proposed bill #strike[becomes] #underline[is put into] a #strike[legislation] #underline[law], it will allow TikTok #underline[about 5 months to] #strike[cut the tie] #underline[cut ties] with ByteDance#strike[ in 5 month]. If #strike[the tie isn't] #underline[ties *were not to be*] cut, #strike[the legislation] #underline[this measure] #strike[will ban downloading TikTok] #underline[would prohibit TikTok to be downloaded] from the app store in the U.S. Here are Manu Raju with more:
The House are plowing ahead with #strike[taking up] #underline[the plan to take up] the legislation, being ready to ban TikTok #strike[from the U.S. app stores] if #underline[the Chinese firm, ]ByteDance refuses to sell it. #strike[They will force this sell,] #underline[They are trying to force that sell] #strike[for they concerned] #underline[because of concerns] that Chinese government is too close #strike[with the] #underline[to] private information of Americans. They are alleging Chinese government #strike[interfere] #underline[is interfering] with that information and #underline[could] exploit it#strike[. However, ByteDance has denied these claims.] #underline[*, something that ByteDance has furiously denied.*] But *nevertheless*, this legislation has wide bipartisan support #strike[that] #underline[approved by] the House Energy and Commerce Committee#strike[ voted for 50 to nothing last week] last week, 50 to nothing#strike[, which is] #underline[. That is something] rarely seen #strike[in the House Hill.] #underline[on Capital Hill,] but the #underline[wide] bipartisan support forced the majority leader to #strike[propose this legislation] #underline[put this bill on the floor very quickly]. <NAME> said, he will #strike[let all the senators vote] #underline[take up this measure the full House] in #underline[just] a matter of #strike[few] days. Yet it doesn't mean TikTok #strike[didn't ...] #underline[isn't trying to kill it.] In fact, that's exactly what TikTok is #strike[doing] #underline[trying to do]. The #strike[... of] #underline[Top Republican who chairs] the Energy and Commerce Committee told me that she #strike[was flooded by calls opposing these efforts] #underline[is *getting flooded with phone calls over people opposed to the efforts*].
Yes, we #strike[received enormous calls, a record of numbers] #underline[have been flooded with calls, *record amounts* of calls]. Each member of the Energy and Commerce Committee that voted yesterday has been flooded. The co-sponsors #strike[was] #underline[have been] flooded. TikTok put up a notice to block an individual #strike[from entering it] #underline[to get on TikTok] unless they call their #strike[senators] #underline[members of Congress] and told them not to #strike[support] #underline[vote for] this legislation. But this is just #strike[one case] #underline[a example of] how they manipulate data and influence #underline[on] Americans #strike[to ...] #underline[for] their agenda.
But what will happen #strike[to senate] #underline[in the Senate]? This is a totally different question. Senators have their own ideas, but it #strike[takes] #underline[could take] some time to get through. But if it #underline[does] become a law, President Biden says, he will sign it.
== Muslim
#strike()[Next,] #underline()[_Next up_] in the Muslim calendar, one of the holist #strike()[secret months] #underline()[_most sacred months_] #strike()[, it's] #underline()[_is_] the ninth month, or *Ramadan*. Several Muslim countries announced the Monday as the first day of Ramadan, and the holy month #underline()[_of fasting,_] where Muslim may not consume food or drinks from sunrise and sunset. The exact start date of Ramadan changes because it's based on #underline()[_*clerics* seeing a *crescent*_] or new moon as the *Islamic* calendar follows the lunar cycle.
There were #underline()[_hopes of a possible ceasefire in the Gaza Strip_] before the Ramadan, but both Hamas and *Israel* could not reach a deal. While the war goes on, there's *humanitarian* crisis that continues to *grapple the Gaza Strip* The U.S. #underline()[_is teaming up_] with several other nations by airdropping #underline()[_aid_] into Gaza , but #underline()[_aid_] agencies recommended it would be much more efficient if this supplies were transported on the ground. Our chief international *correspondent*, *Clarissa Ward*, is here to give us the why.
From the #strike()[house] #underline()[_health_] ministry inside Gaza are now saying that 25 have died as a result of #underline()[_acute malnutrition and dehydration_]. #strike()[They] #underline()[_CNN_] cannot independently confirm that, because the international journalists are not allowed into Gaza to report on the ground. But it certainly #strike()[jails] #underline()[_gels_] with what we have #strike()[here] #underline()[_been hearing_] from the groups like the *U.N.*, who has warned that hundreds of thousands of #underline()[_of Gazans in the northern_] part of the *enclave* are one step away from *famine*, who has announced as you mentioned that four out of five(4/5) people -- or 4/5 household, I should say specifically, do not have access any longer to clean water. And #underline()[_while these_] airdrops show a certain level of intention and #strike()[good will] #underline()[_goodwill_] they#underline()[_,_] according to #underline()[_aid_] organizations#underline()[_,_] are not terribly efficient and effective in terms of #underline()[_mechanism for actually distributing aid._] We heard from one humanitarian worker who said #strike()[there was] #underline()[_they're_] a great *photo op* , but they are terrible in terms of trying to make sure that people on the ground get the aid they need.
=== words, phrases and phrases
==== words
- _Muslim_
- _the Gaza Strip_
- _Islamic_
- _fast_
- _cleric_
- _crescent_
- _ceasefire_
- _humanitarian_
- _grapple_
- _correspondent_
- _acute malnutrition_
- _dehydration_
- _enclave_
- _famine_
==== phrases
- _team up with_
==== short
- op -> opportunity
==== sentences
- There's humanitarian crisis that continues to grapple the Gaza Strip.
- But it certainly gels with what we have here been hearing from the groups like the U.N.
- ... are one step away famine
=== åè¯
==== åæ
Next up in the Muslim calendar, one of the holist, most sacred months is the ninth month, or Ramadan. Several Muslim countries announced the Monday as the first day of Ramadan, and the holy month of fasting, where Muslim may not consume food or drinks from sunrise and sunset. The exact start date of Ramadan changes because it's based on clerics seeing a crescent or new moon as the Islamic calendar follows the lunar cycle.
There were hopes of a possible ceasefire in the Gaza Strip before the Ramadan, but both Hamas and Israel could not reach a deal. While the war goes on, there's humanitarian crisis that continues to grapple the Gaza Strip. The U.S. is teaming up with several other nations by airdropping aid into Gaza , but aid agencies recommended it would be much more efficient if this supplies were transported on the ground. Our chief international correspondent, <NAME>, is here to give us the why.
From the health ministry inside Gaza are now saying that 25 have died as a result of acute malnutrition and dehydration. CNN cannot independently confirm that, because the international journalists are not allowed into Gaza to report on the ground. But it certainly gels with what we have been hearing from the groups like the U.N., who has warned that hundreds of thousands of of Gazans in the northern part of the enclave are one step away from famine, who has announced as you mentioned that four out of five(4/5) people -- or 4/5 household, I should say specifically, do not have access any longer to clean water. And while these airdrops show a certain level of intention and goodwill, according to aid organizations, they are not terribly efficient and effective in terms of mechanism for actually distributing aid. We heard from one humanitarian worker who said they're a great photo op , but they are terrible in terms of trying to make sure that people on the ground get the aid they need.
==== åèç¿»è¯
åšç©æ¯æçæ¥åäžïŒæ¥äžæ¥çäžäžªæç¥å£çæ仜æ¯ç¬¬ä¹äžªæïŒä¹å°±æ¯ææãäžäºç©æ¯æåœå®¶å®£åžææäžäžºææç第äžå€©ïŒè¿æ¯äžäžªçŠé£çç¥å£æ仜ïŒç©æ¯æåšæ¥åºåæ¥èœä¹éŽäžåŸè¿é£æ饮氎ãææçç¡®ååŒå§æ¥æäŒå 䞺åºäºäŒæ¯å
°æ¥åéµåŸªæ亮åšæïŒéèŠç¥è人åè§å¯æ°ææ匯æèææååã
åšææåŒå§ä¹åïŒå æ²å°åžŠæŸæå¯èœèŸŸæåç«åè®®ïŒäœå马æ¯å以è²åéœæªèœèŸŸæåè®®ãæäºä»åšç»§ç»ïŒå æ²å°åžŠä»ç¶é¢äžŽäººéå±æºãçŸåœæ£åšäžå
¶ä»å 䞪åœå®¶åäœïŒéè¿ç©ºææ¹åŒåå æ²æäŸæŽå©ïŒäœæŽå©æºæ建议åŠæè¿äºç©èµèœå€éè¿éè·¯è¿èŸïŒæçäŒæŽé«ãæ们çéŠåžåœé
è®°è
<NAME>å°äžºæ们解éå
¶äžåå ã
å æ²å«çéšéšç°åšè¡šç€ºïŒå·²ç»æ25人å 䞥éè¥å
»äžè¯åè±æ°Žèæ»äº¡ãCNNæ æ³ç¬ç«è¯å®è¿äžæ¶æ¯ïŒå 䞺åœé
è®°è
äžè¢«å
讞è¿å
¥å æ²è¿è¡æ¥éãäœè¿äžæ们ä»èååœçç»ç»é£éå¬å°çä¿¡æ¯çžç¬ŠïŒä»ä»¬èŠå诎å æ²åéšå°åºçæ°åäžå æ²äººè·çŠ»é¥¥èåªæäžæ¥ä¹é¥ïŒæ£åŠäœ ææå°çïŒäºåä¹åç人ïŒæäºåä¹åç家åºïŒåä¹æ æ³è·åŸæž
æŽæ°Žæºãèœç¶è¿äºç©ºæè¡šæäºäžå®çåæåæåŸïŒäœæ ¹æ®æŽå©ç»ç»ç诎æ³ïŒå®ä»¬åšå®é
ååæŽå©æ¹é¢å¹¶äžæ¯éåžžé«æåææçæºå¶ãæ们å¬å°äžäœäººéäž»ä¹å·¥äœè
诎ïŒè¿äºç©ºææ¯åŸå¥œçæç
§æºäŒïŒäœåšç¡®ä¿å°é¢äžç人们è·åŸæéæŽå©æ¹é¢åŽææäžäœ³ã
==== 1st
In Muslim calendar, #underline[one of] the #underline[holist], most sacred month is the ninth month also known as #strike[the fast month] #underline[Ramadan]. Some Muslim countries announced that Monday #strike[is] #underline[as] the first day of Ramadan #strike[which is a]#underline[, the] sacred month of fasting #strike[that] #underline[where] Muslim #strike[don't] #underline[may not] consume any food or #strike[water] #underline[drinks] from sunrise to sunset. The exact start date of Ramadan changes because it #strike[follows the cycle of moon based on Islamic calendar and needs ... to observe crescent moon or new moon to change] #underline[based on clerics seeing a crescent or new moon as the Islamic calendar follows the lunar cycle].
#strike[Before Ramadan, the Gaza Strip could once possibly reach a ceasefire deal, but Hamas and Israel didn't] #underline[_There are hopes of a possible ceasefire in the Gaza Strip before the Ramadan, _but both Hamas and Israel could not reach a deal]. #strike[The war is going on. The Gaza Strip was still confront the crisis of humanitarian.] #underline[While the war goes on, _there's humanitarian crisis that continues to grapple the Gaza Strip._] The United States is teaming up with #underline[serveral] other countries to #strike[serve aid] by airdropping #underline[aid into Gaza]. But the aid #strike[organizations] #underline[agencies] #strike[suggest] #underline[recommended] that it would be #underline[much] more efficient if #strike[this aid things] #underline[supplies] could be transported on the ground. Our chief international #strike[reporter] #underline[correspondent,] <NAME> #strike[will explain the reason for us] #underline[, is here to give us the why]:
#strike[The health ministry says,]#underline[From the health ministry inside Gaza are now saying] 25 people have died #strike[for] #underline[as a result of] malnutrition and #underline[*dehydration*]. CNN can't #underline[independently] confirm these information for international #strike[reporters] #underline[journalists] are not allowed #strike[to go] into Gaza to report #underline[on the ground]. However, #strike[this is line with the information]#underline[it certainly *gels with* what] we #strike[heard] #underline[have been hearing] from #strike[UA organizations] #underline[the groups like U.N.]#strike[. They warn] #underline[, who has warned] that, millions of #strike[people in Gaza] #underline[Gazans in northern part of the enclave] are only one step away from *famine*. As you mentioned above, 4/5 people or families #strike[can't access to water anymore] #underline[do not *have access any longer to clean water*]. #strike[These airdrops expressed some kindness and intention, but according to the aid organization, they don't have a efficient mechanism on distribution of aid. We heard a humanitarian said, this airdrops are great for photos, but not efficient in making sure that people on the ground can get the aid they need.] #underline[While these airdrops *showed a certain level of intention and goodwill*, according to aid organizations, they are not terribly efficient and effective *in terms of* mechanism *for actually distributing aid*. We *heard from a humanitarian worker who said* they're a great photo op, but they are terrible in terms of trying to make sure that people on the ground get the aid they need.]
== Rhino populations in Kenya
Let's head to Kenya now, where the #strike[eastern] #underline[East] country is dealing with #strike[the] #underline[_a_] rise #underline[_in the *rhinoceros*_] of population. #underline[_Overcrowding_] in #underline[_*sanctuaries* has_] cause problem #strike[that] #underline[_such as rhinos attacking_] each other and competing for food. It's such a concern that Kenya #strike[of wide] #underline[_Wildlife Service_] is transporting 21 rhinos to a new location.
It takes nearly a dozen people to get this #underline[_five-year-old black rhino up on its feet as the *tranquilizer* *wears off*._] With #underline[_tracker_] securely #underline[_*glued to* her horn,_] she is ready to move 100 hundred miles away. Kenya has an unusual problem. Rhino populations here are actually going up, so Safia and others #strike[have] #underline[at] this overcrowded #strike[century] #underline[_sanctuary in central_] Kenya #strike[, a] #underline[are] getting a new home. Decades ago, 20,000 eastern black rhinos like this one ran free in Africa. But in just under 20 years the numbers #underline[_*plummeted*_] to below 400 as #underline[_*poachers*_] hunted them for their precious #underline[_*horns*_]. Now Kenya rhinos #underline[_are making a comeback_] thanks to #underline[_anti-poaching efforts_] #strike[anchors]. But overcrowding in #strike[centuries] #underline[_sanctuaries_] has become a problem for a #underline[_*solitary*_] animal.
To #strike[get them more living space] #underline[_give them more roaming space_], 21 rhinos were taken to a brand new sanctuary in #underline[Loisaba Conservancy]. They #strike[had] #underline[are] the first rhino#underline[s] to live on the land in #strike[15] #underline[50] years.
=== words and phrases
==== words
- _rhinoceros_
- _sanctuary_
- _tranquilizer_
- _horn_
- _plummet_
- _poach_, _poacher_
- _solitary_
==== phrases
- _wear off_
- _be glued to_
=== åè¯
==== åæ
Let's head to Kenya now, where the East country is dealing with a rise in the rhinoceros of population. Overcrowding in sanctuaries has cause problem such as rhinos attacking each other and competing for food. It's such a concern that Kenya Wildlife Service is transporting 21 rhinos to a new location.
It takes nearly a dozen people to get this five-year-old black rhino up on its feet as the tranquilizer wears off. With tracker securely glued to her horn, she is ready to move 100 hundred miles away. Kenya has an unusual problem. Rhino populations here are actually going up, so Safia and others at this overcrowded sanctuary in central Kenya are getting a new home. Decades ago, 20,000 eastern black rhinos like this one ran free in Africa. But in just under 20 years, the numbers plummeted to below 400 as poachers hunted them for their precious horns. Now Kenya rhinos are making a comeback thanks to anti-poaching efforts . But overcrowding in sanctuaries has become a problem for a solitary animal.
To give them more roaming space, 21 rhinos were taken to a brand new sanctuary in Loisaba Conservancy. They are the first rhinos to live on the land in 50 years.
==== åèç¿»è¯
è¯å°Œäºç°åšé¢äžŽçççæ°éäžåçé®é¢ãåšä¿æ€åºè¿åºŠæ¥æ€å¯ŒèŽäºäžäºé®é¢ïŒäŸåŠççä¹éŽçæ»å»å䞺é£ç©èç«äºãè¿åŒèµ·äºäººä»¬çå
³æ³šïŒè¯å°Œäºéçåšæ€ç©ç®¡çå±æ£åšå°21åªçç蜬移å°æ°çå°ç¹ã
åœééåäœçšæ¶éæ¶ïŒéèŠè¿åå 人æèœè®©è¿åªäºå²çé»ççç«èµ·æ¥ãå®çè§äžç²çå®äœåšïŒåå€ç§»åš100è±éè¿çå°æ¹ãè¯å°Œäºé¢äžŽçäžäžªäžå¯»åžžçé®é¢ãè¿éçççæ°éå®é
äžåšå¢å ïŒå æ€åšè¿äžªè¿åºŠæ¥æ€çäžéšè¯å°Œäºä¿æ€åºéçSafiaåå
¶ä»çç马äžå°±èŠææ°å®¶äºãå å幎åïŒæ2äžåªåè¿åªäžæ ·çäžéšé»ççåšé掲èªç±å¥è·ãäœåšäžå°20幎çæ¶éŽéïŒç±äºå·çè
䞺äºå®ä»¬ç莵çè§èçæïŒæ°éæ¥å§äžéè³400åªä»¥äžãç°åšïŒè¯å°ŒäºçççåŸä»¥å€èïŒè¿èŠåœåäºåå·ççåªåãäœä¿æ€åºçè¿åºŠæ¥æ€å·²ç»æ䞺ç¬å±
åšç©çäžäžªé®é¢ã
䞺äºç»å®ä»¬æŽå€ç掻åšç©ºéŽïŒ21åªçç被垊å°äºäœäºæŽäŒèšå·Žä¿æ€åºçå
šæ°ä¿æ€åºãå®ä»¬æ¯50幎æ¥éŠæ¹åšè¿çåå°äžç掻çççã
==== 1st
Kenya is now #strike[confronting a problem of the increasing number of rhinoceros] #underline[_is dealing with_ *a rise in the rhinoceros of population*]. #strike[The overcrowding] #underline[Overcrowding in *sanctuaries*] has #strike[led to some problems] #underline[*cause problems*] such as #strike[competitions for food and attack among rhinos] #underline[_rhinos attacking each other and competing for food_]#strike[, which has attracted human's attention.] #underline[. It's such a concern that] now the Kenya Wildlife #underline[Service] is transporting 21rhinos to a new #strike[place] #underline[location].
#strike[When the effect of tranquilizer fade away, it needs over 10 people making this 5-year-old rhino stand on its feet.] #underline[It takes nealy a dozen people to get this 5-year-old rhino *up on its feet* as *tranquilizer wears off*.] #strike[A tracker was attached to its ..., being ready to be sent 100 miles away.] #underline[With a tracker securely *glued to her horn*, she is ready to move 100 miles away.] Kenya are now facing an unusual problem: #strike[the number of rhinos] #underline[rhino populations] here are actually #strike[increasing] #underline[going up], so Safia and other rhinos #strike[consider this overcrowded protection region in the middle Kenya as their new home] #underline[so Safia and others at this overcrowded sanctuary in *central Kenya* _are getting a new home_]. Decades ago, about 20 thousand eastern black rhinos just like this one ran #strike[freely] #underline[free] in Africa. However, in #underline[just under] 20 year, the number #strike[dropped sharply] #underline[plummeted] to below 400 for the poachers poached their precious horns. Now rhinos in Kenya #strike[has been prosperous] #underline[are making a comeback]#strike[, which *is credited to*] #underline[*thanks to*] the anti-poaching efforts. But #strike[the overcrowded protection region] #underline[overcrowding in sanctuaries] has been a problem of a solitary animal.
To offer them more #underline[roaming] space, the 21 rhinos #strike[was] #underline[were] taken to a #strike[totally] #underline[*brand*] new sanctuary in *Loisaba Conservancy*. The are the first #underline[rhinos] to live on this #strike[soil] #underline[land in 50 years].
== Bird
For today's #underline[story's getting a] 10 out of 10, a video#underline[-bombing] bird doing its best to break up #strike[and] #underline[a] beat on broadcast TV. CNN's #underline[Jeanne Moos] has more.
Look at this, reporters are supposed to be able to #underline[_*wing it*_], but this is something #strike[like] #underline[out of the] birds. OK, maybe not that #strike[stream] #underline[extreme]. But #underline[Australia reporter Ursula Heger] was #strike[fighting] #underline[_*filing*_] a #underline[report] for 10 News First#strike[. When] #underline[when] she got #underline[dive-bombed] over and over. #underline[dive-bombed] #strike[for] nine times. Her own station called it #underline[_*impeckable* *journalism*_] Instead doing this, #underline[Ursula did this.]
#strike[We should] #underline[_At least she didn't_] get used #strike[to] a landing #underline[_strip_] by, say, a #underline[_*robin*_] or a #underline[_pet_] parrot. And Ursula didn't get #strike[his] #underline[_her_] earbud #underline[_*plucked*_] by this reporter in #underline[_*Chile*_]
Ironically, he was reporting on the rising *robberies*. They did manage to get the earbud back from the parrot.
#underline[_The way Ursula_] handle the attack #strike[as the ...] #underline[_was a feather in her cap._] #underline[_Could have been worse if she got_] #strike[She would be] pecked by a *woodpecker*.
Talk about #underline[_*foul play* and a "hawkward"_] situation, but that reporter had no #underline[_*egrets*_] taking the #strike[bird] #underline[_"birden"_] in #underline[_*stride*_], #strike[delivery] #underline[_delivering_] #strike[a peckable] #underline[_an impeckable report that was like *poultry*_] report in motion.
All right. Remember tomorrow's ... follow me . I'm Coy Wire.
#underline[_Drop_] your unique vocabulary #underline[_in the comment section on my most recent post and_] we're suppose to choose a winner to work into tomorrow show.
=== words and phrases
==== words
- _wing_
- _impeckable_
- _journalism_
- _a landing strip_
- _robin_
- _pluck_
- _robberies_
- _peck_
- _woodpecker_
- _foul play_
- _egret_
- _poultry_
==== phrases
- _a feather in one's cap_
- _in stride_
|
|
https://github.com/DaAlbrecht/lecture-notes | https://raw.githubusercontent.com/DaAlbrecht/lecture-notes/main/computer_networks/network_topology.typ | typst | MIT License | = Network topology
A Network topology is the arrangement of the various elements (links, nodes, etc.) of a computer network.
Essentially, it is the topological structure of a network and may be depicted physically or logically.
== physical topology
Physical topology refers to the placement of the network's various components, including device location and cable installation.
== logical topology
Logical topology shows how data flows within a network, regardless of its physical design.
== Types of network topologies
The most common network topologies include:
- Bus topology
- Ring topology
- Star topology
- Mesh topology
- Tree topology
- Cell topology
=== Bus topology
In a bus topology, all devices are connected to a single cable, called the bus. Data is transmitted in both directions to all devices on the network.
#figure(
image("../resources/busnetwork.png", width: 20%),
caption: [Bus topology],
) <busnetwork>
*Advantages*:
- Easy to install and expand
- Requires less cable than other topologies
*Disadvantages*:
- Performance decreases as more devices are added
- Difficult to troubleshoot
- Single point of failure (if the bus fails, the entire network goes down)
=== Ring topology
In a ring topology, each device is connected to two other devices, forming a ring. Data travels in one direction around the ring until it reaches its destination.
#figure(
image("../resources/ringnetwork.png", width: 20%),
caption: [Ring topology],
) <ringnetwork>
*Advantages*:
- No collisions
- Equal access to the network
- Each node acts as a repeater allowing the signal to travel long distances
*Disadvantages*:
- Difficult to troubleshoot
- Single point of failure (if one device fails, the entire network goes down)
- Performance decreases as more devices are added
=== Star topology
In a star topology, all devices are connected to a central hub or switch. Data is transmitted from one device to the hub, which then forwards it to the destination device.
#figure(
image("../resources/starnetwork.png", width: 20%),
caption: [Star topology],
) <starnetwork>
*Advantages*:
- Easy to install and manage
- Centralized control
- Fault isolation (if one device fails, the rest of the network remains operational)
*Disadvantages*:
- If the central hub is not redundant, it becomes a single point of failure
- Requires more cable than other topologies
#pagebreak()
=== Mesh topology
In a mesh topology, each device is connected to other devices in the network. Data can take multiple paths to reach its destination, increasing reliability and fault tolerance.
In a full mesh topology, every device is connected to every other device in the network.
#figure(
image("../resources/meshnetwork.png", width: 20%),
caption: [Mesh topology],
) <meshnetwork>
*Advantages*:
- High fault tolerance
- Reliable data transmission
- Scalable
*Disadvantages*:
- Expensive to install and maintain
- Requires a large amount of cabling
=== Tree topology
A tree topology combines characteristics of star and bus topologies. Devices are arranged in a hierarchy, with multiple star networks connected to a central bus.
#figure(
image("../resources/treenetwork.png", width: 20%),
caption: [Tree topology],
) <treenetwork>
*Advantages*:
- High scalability
- Centralized control
- Fault isolation
*Disadvantages*:
- Difficult to configure and manage
- Requires more cable than other topologies
- Single point of failure (if the central bus fails, the entire network goes down)
=== Cell topology
The cellular network topology is applicable only in wireless networks.
It consists of multiple cells, each served by a base station. Cells are arranged in a pattern to provide coverage to a large area.
= Access methods
In wired networks like Thin Ethernet (10BASE2) or Token Ring all participants share a common transmission medium, referred to as Shared Media.
An access control method is necessary to ensure that only one participant transmits data at any given time to avoid collisions and ensure error-free transmission.
Shared Media access methods are categorized into deterministic and non-deterministic access methods.
== Deterministic access methods
Access to the transmission medium is coordinated among participants at specific times.
An example is the Token-Passing method used in Token Ring and FDDI networks.
In this method, a token grants the right to send data.
The participant holding the token can send data for a limited time.
Once done, or if they choose not to send data, the token is passed to the next participant.
This ensures fairness, as every participant eventually receives the token, allowing them to send data after a predictable wait time.
== Non-deterministic access methods
In this scenario, all participants compete directly for access to the transmission medium.
The wait time for access and the amount of data that can be transmitted are unpredictable, depending on the number of participants and their data transmissions.
An example of this is Carrier Sense Multiple Access with Collision Detection (CSMA/CD) used in Thin Ethernet (10BASE2).
When a participant wants to send data, it first checks if the medium is free.
If it is, they proceed to send.
However, if two or more participants attempt to send simultaneously, a collision occurs.
CSMA/CD detects these collisions, causing the participants to stop transmitting.
After a random delay, each participant attempts to send again, reducing the likelihood of another collision.
= Collision domains
A Collision Domain refers to a network scenario where all devices within the same domain must listen to a message sent by any one device, even if the message isn't intended for them.
This can lead to a problem when two devices transmit simultaneously, causing a collision.
After a collision, the devices must wait and re-transmit their messages one at a time.
This issue occurs only in half-duplex mode.
|
https://github.com/v411e/optimal-ovgu-thesis | https://raw.githubusercontent.com/v411e/optimal-ovgu-thesis/main/titlepage.typ | typst | MIT License | #import "components.typ": sans-font, variable-pagebreak, author-fullname
#let oot-titlepage(
title: "",
document-type: "",
supervisor: "",
second-supervisor: "",
advisors: (),
author: none,
city: none,
date: none,
organisation: [],
organisation-logo: none,
header-logo: none,
is-doublesided: none,
lang: "en",
) = {
set page(
numbering: none
)
set par(
leading: 1em,
first-line-indent: 0em,
justify: false,
)
align(center, header-logo)
v(5mm)
block(
inset: 2cm
)[
#text(font: sans-font, 2em, weight: 700, document-type)
#par(leading: 0.6em)[
#text(font: sans-font, 1.6em, weight: 500, title)
]
#v(1em)
#text(font: sans-font, 1.2em, weight: 500, author-fullname(author))
#if (city != none and date != none) [
\
#text(font: sans-font, 1.2em, weight: 500, city + ", " + date)
]
]
pad(
top: 0em,
right: 15%,
left: 15%,
grid(
columns: 2,
gutter: 1em,
strong(
if (lang == "de") [
Betreuer:
] else [
Advisors:
]
), advisors.join(", "),
strong(
if (lang == "de") [
Themensteller:
] else [
Supervisor:
]
), supervisor,
strong(
if (lang == "de") [
Zweitgutachter:
] else [
Second Supervisor:
]
), second-supervisor,
)
)
align(bottom)[
#line(length: 100%)
#grid(
columns: 2,
gutter: 1em,
par(leading: 0.6em, organisation),
align(right + top)[
#move(dx: 1.2cm, dy: 0cm)[
#organisation-logo
]
]
)
]
variable-pagebreak(is-doublesided)
} |
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/rotate-image/description/",
level: 1,
)<æ蜬åŸå>
#note(
title: [
æ蜬åŸå
],
description: [
ç»å®äžäžª n à n çäºç»Žç©éµ matrix 衚瀺äžäžªåŸåãè¯·äœ å°åŸå顺æ¶éæ蜬 90 床ã
äœ å¿
é¡»åš åå° æ蜬åŸåïŒè¿æå³çäœ éèŠçŽæ¥ä¿®æ¹èŸå
¥çäºç»Žç©éµã请äžèŠ 䜿çšåŠäžäžªç©éµæ¥æ蜬åŸåã
],
examples: ([
#figure(
image("./img/mat1.jpg", width: 50%)
)
èŸå
¥ïŒmatrix = [[1,2,3],[4,5,6],[7,8,9]]
èŸåºïŒ[[7,4,1],[8,5,2],[9,6,3]]
],[
#figure(
image("./img/mat2.jpg", width: 50%)
)
èŸå
¥ïŒmatrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]]
èŸåºïŒ[[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]]
]
),
tips: [
- $n == "matrix.length" == "matrix"[i]."length"$
- $1 <= n <= 20$
- $-1000 <= "matrix"[i][j] <= 1000$
],
solutions: (
( name:[çšç¿»èœ¬ä»£æ¿æ蜬],
text:[
],code:[
```cpp
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int n = matrix.size();
// 氎平翻蜬
for (int i = 0; i < n / 2; i++) {
for (int j = 0; j < n; j++) {
swap(matrix[i][j], matrix[n - i - 1][j]);
}
}
// 䞻对è§çº¿ç¿»èœ¬
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
swap(matrix[i][j], matrix[j][i]);
}
}
}
};
```
]),
),
gain:none,
)
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/delimited_07.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test predefined delimiter pairings.
$floor(x/2), ceil(x/2), abs(x), norm(x)$
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/040%20-%20Zendikar%20Rising/007_Episode%204%3A%20Of%20Haunting%20Songs%20and%20Whispered%20Warnings.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Episode 4: Of Haunting Songs and Whispered Warnings",
set_name: "<NAME>",
story_date: datetime(day: 23, month: 09, year: 2020),
author: "<NAME>",
doc
)
#figure(image("007_Episode 4: Of Haunting Songs and Whispered Warnings/01.jpg", width: 100%), caption: [], supplement: none, numbering: none)
Akiri knew the sensation of falling as intimately as the strength of her own hands. She didn't fear the rush of air on her face or the way her stomach leapt to her throat. She was the best line-slinger on Zendikar, and she learned long ago that sometimes, in order to climb, you had to fall.
But she had never fallen so far and so long before. She had never fallen without hope.
She could see the Murasa Skyclave shrinking above her as she plummeted. And if she closed her eyes, Akiri saw Nahiri's cool, indifferent expression and the Core in her hand, in that terrible moment before she was shoved off the floating ruin.
In those first few desperate seconds, Akiri threw her ropes and hooks at every floating ledge or slanted hedron within reach. But instead of tearing itself apart, the pieces of the Murasa Skyclave were moving. It was stitching itself back together like an impossible puzzle, and her hooks lost their mooring or were smashed before Akiri could save herself.
Soon the only thing around her was empty sky.
#emph[These are the last moments of my life] , she realized. Grief and anger hit her like a punch. Akiri hadn't managed to save or protect anything she loved in those desperate minutes before Nahiri pushed her.
#emph[Zendikar. Zareth. ] She closed her eyes and thought of her friend and love, pushing away the image of his frozen, screaming face in the moment of his death, remembering him instead laughing, line-slinging with her, his bright eyes full of mischief.
Akiri held his memory close as she waited for the ground. She would see Zareth soon.
The impact knocked the breath from her. Her neck and limbs jerked forward painfully. Then snapped back.
Suddenly, Akiri wasn't falling anymore.
#emph[Strange] , she thought. #emph[Death is gentler than I imagined.] She anticipated feeling the limbs of the harabaz trees break against her body, at least, if she felt anything at all. Opening her eyes, she expected only darkness, but around her there was bright blue sky. Turning her head, she saw Sunder Bay several hundred feet below her, its trees swaying and thrashing against the relentless waves.
"What?" she whispered. She was suspended midair. Impossible.
"Got you!" someone shouted from above.
Akiri looked up again, squinting from the sun, and above her, she could just make out a slim figure leaning on a staff. They were standing on what looked like a ladder of branches. Though that seemed impossible, too.
"What?" she whispered again.
#figure(image("007_Episode 4: Of Haunting Songs and Whispered Warnings/02.jpg", width: 100%), caption: [Forest | Art by: Tianhua X], supplement: none, numbering: none)
Akiri felt herself rising and realized that there was a bramble branch curled tightly around her chest.
As she drew closer to the figure on the ladder, she saw that her rescuer was an elf woman with long dark hair, clothed in green. Farther down the ladder, a man with windswept hair and bright eyes was carefully climbing up.
The bramble gently set Akiri down on the ladder, a foot or so away from the elf.
"Thank you," said Akiri, after a moment. It was as much as she could manage.
"Are you alright?" asked her rescuer.
"Yes." Akiri glanced up at the Murasa Skyclave. It was nearly whole now, as if they had never sprung the trap. As if Akiri and her party didn't just fight for their lives. It was as if Zareth died for nothing. "No," she whispered as her knees buckled under her.
"Easy"âthe elf caught her around the shoulders, steadying herâ"I have you."
"Who are you?" Akiri asked.
"I'm Nissa," she replied and, with a timid smile, added, "The slow climber is Jace."
Jace groaned as he came up beside them. "I'm out of practice. We don't have sky dungeons in Ravnica."
Akiri studied them for a moment. There was something about the pair that she wouldn't have recognized a few days ago, something she always disregarded as campfire myths. A sense of unspoken power, that they contained secrets as vast as the world. A feeling that they had one foot here~and the other somewhere else.
Like Nahiri.
"You can travel to other realms, can't you?" she asked, recoiling from Nissa's grasp.
Nissa and Jace exchanged a look. "You know about planeswalkers?" Jace asked.
#emph[The myths called you walkers. Planeswalker. My demon has a name] , Akiri thought as her chest constricted with grief. "I've met Nahiri. She's the one who pushed me." She pointed up to the Skyclave.
She noted that neither planeswalker looked surprised. They both were staring at the Murasa Skyclave.
"Does she have the Core?" Nissa asked, her hands balling into fists at her side.
"Yes." An image of Nahiri's cruel face flashed again in Akiri's mind. And Zareth's dead one.
"We can still catch her," Jace said, beginning to climb again. "Hurry."
"No, Jace!" said Nissa. "Look!"
Akiri followed to where Nissa's finger was pointing. In the distance, she could just make out a white-haired figure running through the air, as if sprinting down a flight of steps. Akiri recognized the stonecrafting. The sight of Nahiri made Akiri's stomach twist.
Nissa thrust forward a hand and shot out dozens of thorn arrows at Nahiri. But the distance between them was too great. Nahiri had plenty of time to block the attack with a flick of her wrist and a well-aimed boulder.
Akiri flinched, readied her ropes. #emph[Wait] , she thought. #emph[Not yet.]
She heard Jace exhale behind her, and Akiri turned to see him staring at Nahiri in the distance. He extended three fingers out in the stonecrafter's direction, like an attack, and Akiri held her breath.
Nothing happened.
Then Nahiri stumbled, clutching the sides of her head. Jace's mouth twitched.
Nahiri regained her balance within moments and slid to a stop on the stone stairs. She turned toward Jace.
Even from this distance, the malice in Nahiri's glare made Akiri's skin crawl.
"Look out!" Akiri shouted, pushing Jace out of the way before a boulder slammed into him.
Then she was falling again. But this time with Jace in her grasp.
Akiri was the best line-slinger in Zendikar for a reason, and she'd been expecting Nahiri's attack. Within seconds, she tossed the rope in her hand and secured the hook on the ladder of vines. She used her momentum to swing out of the way of another boulder and, with three quick hand-over-hand motions, hoisted herself and Jace back up onto the bramble ladder.
When she looked across the sky again, Nahiri was gone. Akiri exhaled, both relieved to be out of Nahiri's sight and furious that she got away.
"That was~" Jace said to Akiri, getting his bearings, "impressive."
"Nahiri hired my party for a reason. We are~were~the best in the world," replied Akiri. With a pang of worry, she wondered where Kaza and Orah were.
#emph[Please be alive] , she thought.
"We need to follow her quickly!" Nissa said as she began climbing down the brambles.
"Oh, if it's speed you want," Akiri said with cold certainty. She was Akiri, the Fearless Voyager, and she was the master of this domain. This was #emph[her] home. She began to whirl another rope.
Between her line-slinging and Nissa's vines, they flew down, past Sunder Bay and the canopy of harabaz trees, toward Murasa's infamous imposing cliffs. Akiri swept like a bird through the air from those dizzying heights, despite needing to aid Jace. This time, her falling was practiced, controlled, though her heart was heavy with grief.
She could not let Nahiri get away.
But they were still too slow. By the time she, Nissa, and Jace reached the wide, forested plateau beyond the cliffs, Nahiri was gone.
Nissa clenched her hands and leaned against a massive jurworrell tree. There, she stood still, closed her eyes, head cocked slightly to one side.
"What is she doing?" Akiri whispered to Jace. Jace shrugged.
"Listening," replied Nissa. After a moment, she opened her eyes. "She went north, but I can't tell exactly where. Did Nahiri tell you where she'd go next?" she asked Akiri.
Akiri shook her head. Now that she was on the ground again, the memories of Zareth hounded her. She had spent too much time with mysterious planeswalkers. She understood now that they were as dangerous as the Eldrazi. "Thank you for saving me again," she said, gathering up her ropes.
"Where are you going?" Jace asked, alarmed.
"I need to find Orah and Kaza."
"Who?"
"My friends. Hopefully Nahiri didn't kill them, too." Akiri swallowed hard. She didn't know what she'd do if she lost her entire second adventuring party. Her second family#emph[.]
"We could use your help," entreated Jace.
"Well, you can't have it," replied Akiri. "Working for Nahiri was one of my greatest mistakes. She used the Core~Zareth"âAkiri took a deep breathâ"I'm done helping people from other realms." She wasn't sure where Nahiri had come from, but it wasn't from the Zendikar she loved.
"I'm not from another realm," said Nissa, quietly. "I was born here. In Bala Ged. My tribe~my tribe was almost wiped out by the Eldrazi. And I feel the devastation everywhere in this world." She straightened and looked directly at Akiri. "This is my home and always will be. And I refuse to let Nahiri change it into her dead stone vision." She spoke softly, but there was a fierce determination in her voice, in her position.
For the first time, Akiri noticed how the entire forest seemed to bend itself around this diminutive elf. Like it was waiting for her to give a command.
"You should know then," said Akiri, "the Core corrupts and kills. Beasts, trees~"
#emph[People] , she couldn't bring herself to say.
Nissa's expression was pained, but not surprised. "So, you don't have any ideas on where she might have gone?" she asked.
"None," Akiri answered.
"I might," said Jace, looking guilty. Both women looked at him with surprise. "I peered into her thoughts," he admitted. "She's going to the Singing City."
Akiri knew the legends around the Singing City. It was said that those who wandered in its ruins went mad.
"I think looking into her mind was the right call," said Nissa, gently. Her brow then furrowed. "But why does she want to go there?"
"Because it was built by the ancient kor," Jace replied.
"What?" Nissa and Akiri said in unison.
"Well, it's a logical conclusion," Jace said. "They built the ancient cities of this world." But Nissa's eyes were closed again, listening.
"I can get there faster on my own," she said.
"Nissa, wait," Jace said, alarmed.
But it was clear to Akiri that Nissa was not waiting for anyone. There was already a tangle of jurworrell roots rising up under her, lifting her into the air. "I will stop Nahiri and destroy the Core," she said, looking down at Akiri. "I promise." But this time, behind that quiet determination, Akiri heard anger.
Akiri nodded. "Hurry."
"Nissa," Jace said, but neither woman paid attention.
Like a line thrown with purpose, the roots swelled and rushed forward into the forest.
Then Nissa was gone.
"Nissa!" Jace yelled after her. But there was nothing where she had stood, except the hum of the forest and the looming trees. He turned to Akiri. "Can you take me to the Singing City?"
"Yes, but I won't." Akiri latched a rope to a thick jurworrell root above her. She needed to find the griffins she and her party had ridden to Murasa. She hoped Kaza and Orah would be at Sunder Bay, waiting for her.
#emph[Please be safe] , she thought.
"Please, Akiri," Jace said, coming up behind her.
"You're not great at listening, are you?" Akiri said, lifting herself off the ground. "I've lost enough for one day."
#emph[One lifetime. Zareth.]
"My apologies," Jace said. "I'm usually a decent listener. It's been a trying~well, a trying few years, if I'm being honest."
#emph[Yes, it has. ] Akiri pulled herself on the root and looked for the next anchor point.
"Wait, your friends are Kaza and Orah, right?" Jace said.
Akiri stopped, stared at the man in blue. "What about them?"
Jace closed his eyes and pressed his fingers to the side of his temples for a moment. "I'm sensing two figures down at the bay. I'm assuming they're your missing party. Though I can't say for certain."
Akiri grasped the rope and slid to the ground. "How are you doing that?"
Jace shrugged. "I'm a mage. I'm good at illusions and thoughts."
"That's how you could read Nahiri's mind?" she asked. Jace looked guilty, and Akiri recoiled at the idea of her thoughts being read by this otherworld stranger.
#emph[My mind is my own] , she thought angrily, just in case Jace was listening. #emph[Stay out of it.]
She began climbing up again.
"What if I promised to take the Core somewhere else? Somewhere beyond Zendikar?" Jace called after her.
#emph[What does that even mean? ] Akiri wanted to ask but stopped herself with a small shudder. The Eldrazi were from somewhere beyond Zendikar. It was better not to know.
"Will the Core no longer be a danger, then?" she asked, instead.
Jace nodded.
That made Akiri pause. #emph[Zareth would have wanted you to save Zendikar.] The thought made her heart ache. Stealing the dangerous object and sending it to another world? Zareth would have loved that. And, Akiri had to admit, it was a good solution. With a sigh, she turned back to Jace.
"I'll take you to the entrance of the City so you can help Nissa," she said, cautiously, "but no further."
"Thank you, Akiri," Jace said with relief.
If he was reading her thoughts, she found no sign of it as they made their way to the Singing City.
It was only much later, after she reunited with Orah and Kaza at Sunder Bay, that Akiri realized she never told Jace her name.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Jace followed Akiri through the tangled, towering jurworrell trees until they gave way to a forest blighted by the Eldrazi. Here, the sickly, blackened landscape made Jace's stomach clench with guilt, though he noticed there was new, tender life struggling to grow in the mire.
He pressed on.
He followed her as the trees broke against towering cliffs, as tall as Murasa's Wall. He followed her as they scaled the cracked stones, where the low growls of unseen beasts hiding in the cliffs' caves sometimes made the rocks under his hands vibrate.
Jace followed Akiri onto the Na Plateau and into the dense forest beyond. He was relieved he didn't have to make this journey alone, as the jaddi trees became denser and darker as they neared the city.
Akiri was silent through the whole journey except to whisper, "Look out for wurms" or "There are goblins around here. Stay as silent as you can."
Jace could tell she was holding her grief and worry close, trying not to show it, even though her pain was obvious to him. Perhaps because he had been holding close his own painful secrets.
They came to a break in the forest. Before them was a graveyard of a city beyond age. It was as if one of the massive Skyclaves settled on the earth. Its stone towers were broken and toppled, and its walls were covered in flora and moss. The air smelled dank and dusty, and everything was eerily humming. The gate at the entrance was made of marbleâdark and huge and twisted and beautiful, curling and entwining in a complex pattern like the jaddi roots. It loomed before Jace and Akiri.
"Any advice?" he asked.
"Don't go mad," she replied.
"Right." Jace straightened his cloak. "Thank you for your help. And~I'm sorry about your friend. I know what it's like to lose someone close to you."
Akiri nodded, her jaw clenching with suppressed emotion. She turned and began to walk away, but then paused.
"I hope Nissa's luck holds better than mine," she said, over her shoulder. And then she was gone in the shadow of the trees.
"Right," Jace said again, and made his way to the gate.
It was unlocked.
Inside was a maze of ruins. Moss covered rooms and corridors stretched out before him with no end in sight. Jace's heart sank. It was apparent that this was not going to be easy. As much as he adored a challenge, this wasn't the time to get lost.
Everywhere, there was a low, slightly off-key humming Jace couldn't quite ignore.
On his right, something moved. Jace immediately threw a magic ward up around him. He followed the sound around the corner and saw a white-haired figure facing away.
"Hello, Jace," Nahiri said, without turning. "Of course you're here."
"I've come on Nissa's behalf," he said.
"Naturally."
"She says that Core will destroy Zendikar."
Nahiri turned and faced her, scowling. "This from the person who released the Eldrazi on this plane."
Jace gritted his teeth. He was #emph[also] one of the planeswalkers that accidentally released the Eldrazi. "She thought she was doing what was best."
"Like she is now?" Nahiri raised an eyebrow, and Jace had no answer. "Unlike that fumbling tree-dweller, I know I'm right."
"Like you were when you trapped the Eldrazi here?" Jace replied.
Nahiri's expression clouded over with anger. "How dare you."
"We don't understand the Lithoform Core," he said, evenly, though he kept a tight hold on his magical ward. "Give me the Core, Nahiri, and we can unravel its mysteries together. On Ravnica."
Nahiri paused, and, for a moment, Jace hoped.
Then she widened her stance.
"Never," she snarled. And with a thrust of her hand, she brought the stones on either side of him together.
The stones smashed through Jace's barrier but were slowed just enough so that he could dodge out of the way. He rolled to his feet, bracing again for the next attack, creating a dozen illusionary Jaces around him.
But Nahiri was sprinting down the corridor. Swearing, Jace dropped the illusions and raced after her.
Down he ran through ancient corridors, catching glimpses of spiraling arches and broken courtyards. Down he ran, following the footprints Nahiri left in the dust as she rushed through narrow passageways and winding halls.
Down he ran on twisted, broken stairs. Into the belly of this ancient kor city.
It was here that the strange humming of the city became an unsettling song. It sang a requiem for something Jace could not name, its lilting harmonies and deep vibrations filling him with such sadness and longing that he considered stopping his pursuit.
#emph[No, I have to stop Nahiri] , he thought, hearing her footfalls ahead of him. They were slowing. He pressed on.
Deep in the city, the melody became louder, more complex and distorted, more insistent. Jace gritted his teeth. He could see the outline of Nahiri in the distance. The haunting song made his joints ache.
#emph[I have to reach Nahiri. ] Jace stumbled forward through the curling corridor.
But each step was worse than the last. The music swelled, the haunted singing rising, demanding his full attention. Jace stumbled, groaned.
#emph[I have to find] #emph[] #emph[. . .]
He saw there were now blue arcs of magic around him, flashing in time to the music. The song drowned out all sound, all thought. Jace fell to his knees, hand clamped around his ears.
#emph[I have to] #emph[] #emph[. . .] #emph[ I have to] #emph[] #emph[. . .]
He struggled to focus, grabbed onto the thought. #emph[Not. Go. Mad.]
It was risky, untried, but Jace was desperate. He let go of his ears and attempted a spell, one that he'd been meaning to test out, but hadn't yet. A spell that was delicate and dangerous. A spell that blocked out any sound entering his ears.
#figure(image("007_Episode 4: Of Haunting Songs and Whispered Warnings/03.jpg", width: 100%), caption: [Maddening Cacophony | Art by: <NAME>], supplement: none, numbering: none)
The singing reached an impossible crescendo. Every fiber of his body spasmed, his mind screamed for relief, beginning to slip away.
Then, mid-note, the song stopped.
Jace exhaled. His spell worked.
Within seconds, his mind cleared and his joints unlocked. He could see Nahiri crumpled on the ground before him, hands over her ears. He got to his feet and rushed over to her, sweeping out his hands, enlarging the radius of his spell to encompass Nahiri.
She groaned and covered her eyes. Jace held back, unsure of what the lithomancer's next reaction would be, wary of an attack.
He reached out telepathically. #emph[Are you okay, Nahiri?]
She stumbled to her feet, rolled back her shoulders, and glared at Jace. #emph[Are you expecting a thank you?]
#emph[Naturally not] , Jace smiled inwardly.
She scowled and stared at her feet. #emph[I didn't hear it before. The singing. Then, when I did, I thought I was too powerful for it to affect me.]
Jace nodded. #emph[This plane has always been full of surprises.]
#emph[The Core and I are not leaving Zendikar, Jace.] Her stance straightened with a sharp, defiant look on her face.
#emph[Okay. ] Jace realized he needed to change tactics if he was going to get through to Nahiri. #emph[Where are you going then?]
#emph[To the center of the city] . #emph[To activate it.]
Jace waited, crossing his arms.
Nahiri rolled her eyes. #emph[Runes said there's a magical focal point there that can channel the Core's energy all over Zendikar through the leylines.]
This caught Jace's interest. #emph[Making the transformation universal?]
Nahiri nodded, wariness in her expression.
Jace saw then how Nahiri imagined her healed plane. It was Zendikar transformed. Vast, beautiful cities with thousands of people crafting, selling, thriving. Intricately carved archways and complex, breathtaking architecture was everywhere. And, most of all, the plane was stable. Safe.
It reminded Jace of Ravnica.
#emph[I won't hinder you, Nahiri, if you promise not to use the Core until we study this mechanism in more detail.]
Nahiri paused, considering, then nodded. #emph[I have no desire to harm my home.]
But Jace could see her thoughts and knew that Nahiri's definition of harm was not the same as his or Nissa's. That she would raze cities and armies to achieve her goals.
He also knew that if he was ever going to unlock the mysteries of the Core, he was going to have to understand how it was activated. That if it was going to be a useful weapon in the battles to come, its mysterious power had to be quantified first.
And he knew they would need every weapon the planes could offer when they faced <NAME> again.
So, with a placating smile, he turned to Nahiri and thought, #emph[Lead the way.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Nahiri and Jace traveled through the maze that was the Singing City, their uneasy truce hanging heavy in the space between them. Nahiri stayed close to Jace, making sure to keep within his spell range. She never wanted to hear those mad, haunted voices again.
As they walked, she kept one hand trailing the mossy stone walls, asking them for the way to the city center, and the other on the satchel on her hip. The Core under her hand felt warm, and she felt its thrumming power. It made her smile.
But it also still whispered, something just low enough that she couldn't make it out. Perhaps when she had a moment, after she restored Zendikar to its former beauty, she would try to decipher the whispers' meaning.
Fortunately, Jace stayed silent, perhaps seeing in her fuming thoughts, as she repeated the mantra #emph[never again, never again.]
The vibrations of the stones led them down seemingly endless corridors, through empty courtyards, and back up again on cracked and twisting stairs. She was so close now. So close to finding the focal point in the center of the Singing City. So close to finally fixing all the damage she helped create so long ago.
When they emerged from the last staircase, they found themselves in the middle of an ancient garden, now overgrown and overtaken with jaddi roots, ferns, moss, and bright purple flowers. There were still stone trellises and dried fountains and the ghosts of paths between them.
Jace raised his hands and lowered them slowly, dropping the silencing spell. The eerie hum of the city returned but grew no louder.
"What now?" Jace asked.
She pulled out the Lithoform Core from her satchel. It shone in her hand with the promise of power. Its whispers became frantic, furious.
"Can you hear that?" Nahiri asked, holding up the Core.
"Hear what?" Jace asked, frowning.
"Nothing," said Nahiri, quickly. "Let's move."
"Where?"
Nahiri pointed to a large stone gazebo-like structure before them. Even from where they stood, she could see that it was collapsed and ruined. But wasn't everything in Zendikar?
She tucked the Core back in the satchel and strode forward.
Something was wrong. The feeling grew the closer they came to the ruined building, and Nahiri realized the gazebo had completely fallen in on itself, crushing whatever was inside.
"No," said Nahiri, and she ran forward, putting her hands on the collapsed entrance. The stone vibrations told her the damage was fresh.
"What are you doing?" asked Jace.
"Fixing this!" said Nahiri as the rocks around her began to shift and move. She could undo this damage. She had to.
"Don't bother," said a voice from behind them. Nahiri spun and saw Nissa standing in the ruins of an ancient garden, staff in one hand and the other curled into a fist at her side. She stood tall and firm, and there was a calm, yet dangerous, look in her eyes.
"The focal point," Nahiri said, through gritted teeth, "was here."
"It was," Nissa replied, coldly, "until the elementals destroyed it."
"You made your creatures do this?" shouted Nahiri. It would take her days, if not weeks, to undo the damage to the magical channels here.
"I don't #emph[make ] them do anything," Nissa replied. "I help them, and they help me. I'm Zendikar's guardian, and they are the living embodiments of this plane." Behind her, a giant elemental appeared. Its limbs were formed of roots and leaves, and its head had massive antlers that looked like swept-back wings. "Isn't that right, Ashaya?"
#figure(image("007_Episode 4: Of Haunting Songs and Whispered Warnings/04.jpg", width: 100%), caption: [Ashaya, Soul of the Wild | Art by: Chase Stone], supplement: none, numbering: none)
Nahiri scowled, but the appearance of such a formidable elemental made her pause. Both she and Jace stepped back.
"Nissa." Jace raised his hands in a pacifying gesture. "I promise I won't use the Core or let anyone else use it," he said looking at Nahiri, "until we understand it."
"And what does your word mean when the other party won't respect it?" replied Nissa. She was staring right at Nahiri.
"If she doesn't," Jace said with infuriating calm, "she'll find herself in an impressively believable illusion of the Singing City. Except this time, I won't hold back the song."
"Meddler," Nahiri hissed. She silently swore never to trust anyone ever again.
"I don't want to fight you. I really don't," Nissa said to Jace and Nahiri. "We've all fought enough. We deserve some peace."
"I agree completely, but~" Jace said, "I think Nahiri has a point. The ancient Zendikar was beautiful. I saw her memories."
"See, even the meddler agrees with me," Nahiri said with satisfaction. Finally, someone was seeing reason.
"Jace, we talked about this. The elementalsâ"
"Will grow back. Everything grows back."
"Not everything," Nissa said, quietly.
"The Zendikar I know is strong, unbreakable," Nahiri said.
"Think of the stability," reasoned Jace. "How people on this plane will be able to prosper without fear of the next Roil."
Nissa took a step back. Then another. "I trusted you," she said to Jace. The horror and hurt on her face were plain.
"Nissa," Jace pleaded.
"You don't want to fight me," Nahiri said, putting a hand over the Core in her satchel.
Nissa stared straight at her. "Don't try."
But Nahiri was done listening. She had faced elder dragons and immortal vampires. She would not be stopped. Not now. Not by someone so small and tender and unsure. Not when she was so close.
With a flick of her wrists, Nahiri created dozens and dozens of glowing swords. One for every instance of her rage in the last thousand years. With a second flick, she hurled the swords directly at Nissa.
But before any of her weapons could make contact, a blur knocked all the swords from the air.
Something collided with Nahiri and knocked the breath from her body, smashing her to the ground.
She rolled and got to her feet, preparing to strike back. But what she saw made her pause. Beside her, she heard Jace suck in his breath.
Nissa was floating several feet in the air, her hair streaming out behind her, green energy coursing through her. Even from a distance, Nahiri could feel Nissa's anger, her intent to protect this broken Zendikar at all costs. Because before Nissa was Ashaya in their full power.
The Soul of the Wild seemed to swell with strength, with the drive to protect. Its gaze was fixed on Nahiri, its eyes glowing green with energy, and it raised four of its twisted branch-like limbs, bringing them down on Nahiri with a fierce #emph[crack] .
Nahiri rolled out of the way just in time. With a sweep of her arm, she raised stones around her and smashed them against the elemental. But the rocks broke upon the branches like glass, and the creature didn't even flinch. It turned its massive head toward her.
The elemental raised its vast arms again.
"Run!" Jace yelled behind her.
Nahiri always thought retreating was for cowards. But Ashaya was unrelenting. #emph[I need to protect the Core. Above all.]
So, she ran.
Together, she and Jace dodged and leapt and sprinted through the ancient garden, using every illusion and counterattack they knew. But it still wasn't enough. Ashaya was too vast, too quick. Jace and Nahiri were knocked back and tripped by roots at every opportunity, until all they could do was skid toward the stairs, back into the belly of the Singing City.
The haunting singing flooded their ears. Jace immediately cast his sound blocking spell again, and together they ran back through the moss-covered corridors. Occasionally, moss elementals would stand in their path, but they were smaller and weaker and easily deflected by Jace's counterspells or a well-aimed fist of rocks.
Nahiri's fury fueled her escape. But for the first time in a long while, she also felt a thread of real fear. She had underestimated the elf.
When they reached the entrance of the city and saw the old marble gates, Nahiri exhaled, picked up speed. She was almost there.
But then she spotted a small, familiar figure standing at the entrance. And this time, Nissa and Ashaya were surrounded by dozens and dozens of other elementals.
Nahiri and Jace both skidded to a stop.
"How," Nahiri panted. "How are you traveling~so fast?"
"Zendikar is where I belong. It's the heart of my power and strength," Nissa replied. "I know all the paths and how to use them. But you two"âher face filled with fury, and behind her elementals born from the flora of Murasa began to riseâ"you will never understand. Leave my home."
"Nissa, wait!" shouted Jace.
"This is #emph[my] home, tree-dweller." Nahiri braced, called the stones around her, and she felt the Singing City behind her tremble in reply. "This has been my home for #emph[thousands] of years. And I will not let you win."
Nahiri spread her fingers and raised the stones, calling on all her power for the attack.
But the elementals were faster, surging forward like a furious horde, toward Jace and Nahiri. And in that moment, Nahiri understood.
The battle for Zendikar's soul had begun, and it would be a ruthless fight.
|
|
https://github.com/university-makino/Microcomputer-control-and-exercises | https://raw.githubusercontent.com/university-makino/Microcomputer-control-and-exercises/master/report/æ¬ã¬ããŒã2/report.typ | typst | // ã©ã€ãã©ãªã®å®è£
//
#import "@preview/codelst:2.0.1": sourcecode
//ãã©ã³ãèšå®//
#let gothic = "YuMincho"
//æ¬æãã©ã³ã//
#set text(11pt, font: gothic, lang: "ja")
//ã¿ã€ãã«ã»èŠåºããã©ã³ã//
#set heading(numbering: "1.1")
#let heading_font(body) = {
show regex("[\p{scx: Han}\p{scx: Hira}\p{scx: Kana}]"): set text(font: gothic)
body
}
#show heading: heading_font
// ããŒãžèšå® //
#set page(
paper: "a4",
margin: (x: 25mm, y: 25mm),
columns: 1,
//fill: èæ¯è²,
numbering: "1",
number-align: center,
header: [
#set text(8pt)
]
)
// æ°åŒã®è¡šç€ºã®ä»æ¹ã衚瀺 //
#set math.equation(numbering: "(1)")
//æ¬æãããã//
= æŒç¿ã®ç®ç
å®éšãéããŠãè·é¢ã»ã³ãµ GP2Y0A21YK0Fã®äœ¿ãæ¹ãšä»çµã¿ãç¿åŸããããšãç®çãšããã
= æŒç¿ã®äœ¿çšéšå
== @DistanceSensor ã®é»åéšå ( è·é¢ã»ã³ãµ GP2Y0A21YK0F) ã次ã®ãããªç¹ãã調ã¹ãªããã
#figure(
image("./img/è·é¢ã»ã³ãµ.png",width: 50%),
caption: "è·é¢ã»ã³ãµ"
)<DistanceSensor>
=== ã©ã®ãããªéšåã
ã·ã£ãŒãã®èµ€å€ç·ã䜿çšãã枬è·ã¢ãžã¥ãŒã«ã§ãããèµ€å€ç·LEDãšPSD(position sensitive detector)ã䜿çšããŠãéæ¥è§Šã§è·é¢ãæ€åºããããšãã§ãã@distance_sensor_akituki ã
=== ã©ã®ãããªä»çµã¿ã
çºå
åŽã®èµ€å€å
ãç©äœã«åå°ããŠåå
ãããšè·é¢ã«å¿ããŠåºåé»å§ãå€åããããã®åºåé»å§ã§è·é¢ãæ€åºããããšãã§ããã枬å®è·é¢ã枬ãæ¹æ³ã¯PDSæ¹åŒãæ¡çšããŠãããPSDæ¹åŒã¯äžè§æž¬éã®èŠé ã§è·é¢ãæ€åºãããã®ã§ @PSD ã®ããã«çºå
çŽ åããåºãå
ã察象ç©ã«åœãã£ãŠæ»ã£ãŠããåå°å
ãæ€åºããã察象ç©ãè¿ããšPSDãžã®å
ã®å
¥å°è§åºŠã¯å€§ãããéã«é ããšå
¥å°è§åºŠã¯å°ãããªãããã®è§åºŠã®éãã§åºåé»å§ãå€åãããããè·é¢ã®æ
å ±ãåŸãããšãã§ãã@national_university_infrared_sensor ã
#figure(
image("./img/PSD.png",width: 50%),
caption: "PSDæ¹åŒ"
)<PSD>
=== ã©ã®ãããªå
¥åãåãæ±ãã®ã
è·é¢ã»ã³ãµãŒããåºåãããå
ãåå
ãããã®åºåé»å§ãåãæ±ãã
åºåé»å§ã¯è·é¢ã«å¿ããŠå€åããã
=== å
¥åã«å¿ããŠåºåãã©ãå€åããã®ã (ããŒã¿ã·ãŒããä»æ§æžãåèã«)
SHARPã«ãããšã以äžã®ãããªç¹æ§ããã@distance_sensor_datasheet ã
@distance_sensor_chart ãã¿ããšã38.3ms±9.6msæ¯ã«åºåé»å§ãåºåããã
æåã®ã¿ã€ãã³ã°ã¯æž¬å®ããããŠããªããããäžå®å®ãªå€ãåºåããããã2åç®ä»¥éã¯å®å®ããå€ãåºåããã
#figure(
image("./img/è·é¢ã»ã³ãµã¿ã€ãã³ã°ãã£ãŒã.png",width: 75%),
caption: "è·é¢ã»ã³ãµã¿ã€ãã³ã°ãã£ãŒã"
)<distance_sensor_chart>
åºåé»å§ã¯è·é¢ã«å¿ããŠå€åãããè·é¢ãè¿ãã»ã©åºåé»å§ã¯å€§ãããªããé ãã»ã©å°ãããªããè·é¢ãšåºåé»å§ã®é¢ä¿ã¯ @distance_sensor_output ã«ç€ºãã
ã°ã©ãã¯æ¯äŸé¢ä¿ã§ã¯ãªããåæ¯äŸãªé¢ä¿ãããã
ããããè·é¢ãè¿ããããšããŸã枬å®ãã§ããªããã泚æãå¿
èŠã§ããã
#figure(
image("./img/è·é¢ã»ã³ãµãŒè·é¢æž¬å®ç¹æ§.png",width: 75%),
caption: "è·é¢ã»ã³ãµè·é¢æž¬å®ç¹æ§"
)<distance_sensor_output>
#pagebreak() // ããŒãžãåãã
=== ã©ã®ãããªãã³ã¢ãµã€ã³ (åãã³ã®åœ¹å²) ã
SHARPã«ãããšã以äžã®ãã®ãæ±ã@distance_sensor_datasheet ã
@distance_sensor_pin ãã¿ããšã以äžã®ãããªãã³ã¢ãµã€ã³ãããã
+ åºåé»å§
+ GND
+ Vcc (5V é»æºé»å§)
#figure(
grid(
columns: 2,
image("./img/è·é¢ã»ã³ãµãŒãã³ã¢ãµã€ã³1.png",width: 75%),
image("./img/è·é¢ã»ã³ãµãŒãã³ã¢ãµã€ã³2.png",width: 75%)
),
caption: "è·é¢ã»ã³ãµãŒã®ãã³ã¢ãµã€ã³"
)<distance_sensor_pin>
=== æ£ããåäœã®æ¡ä»¶ïŒç¯å²ã¯äœã
ç§æé»åã«ãããšã以äžã®ãããªä»æ§ããã @distance_sensor_akituki ã
- é»æºé»å§min. : 4.5V
- é»æºé»å§max. : 5.5V
- 枬å®è·é¢min. : 0.1m
- 枬å®è·é¢max. : 0.8m
- 枬å®æ¹åŒ : èµ€å€ç·PSD
- 枬å®é
ç® : è·é¢
- ã€ã³ã¿ãŒãã§ã€ã¹ : ã¢ããã°
- åäœæž©åºŠmin. : -10â
- åäœæž©åºŠmax. : 60â
- é·èŸº : 44.5mm
- ç蟺 : 13.5mm
- é«ã : 18.9mm
#pagebreak() // ããŒãžãåãã
= 課é¡å
容
== ç©äœãšã»ã³ãµãšã®è·é¢ãã¯ãã
=== å®éšãã®1 (éšååäœã®ç解) è·é¢ã»ã³ãµããã®è·é¢ã以äžã®ãããªå Žåãã¢ããã°å
¥åã¯ã©ã®ãããªå€ããšãã調ã¹ãªããã
- åäžã«äžåãã«çœ®ãïŒå€©äºãŸã§ã«ç©äœããªããšã
- ã»ã³ãµãã 50cm ã®ãšããã«æããããããšã
- ã»ã³ãµãã 20cm ã®ãšããã«æããããããšã
- ã»ã³ãµãã 10cm ã®ãšããã«æããããããšã
*åè·¯å³*
@å®éš1åè·¯å³ ã¯ãå®éš1ã®åè·¯å³ã瀺ãã
è·é¢ã»ã³ãµãã¢ããã°å
¥åã«æ¥ç¶ããŠãè·é¢ã»ã³ãµãšå¯Ÿè±¡ç©ãšã®è·é¢ã枬å®ããè£
眮ãäœæããã
#figure(
image("./img/å®éš1åè·¯å³.png",width: 70%),
caption: "å®éš1åè·¯å³"
)<å®éš1åè·¯å³>
#pagebreak() // ããŒãžãåãã
*ããã°ã©ã *
@å€ã®ååŸããããœãŒã¹ã³ãŒã ã¯ãå®éš1ã§äœ¿çšããã¢ããã°å
¥åå€ãååŸãããœãŒã¹ã³ãŒãã瀺ããŠããã
#figure(
sourcecode[```c
//ããã°ã©ã ã«å¿
èŠãªå€æ°ã®å®£èšåã³å®çŸ©
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
PFont myFont;
int usePin0 = 0; //Arduino A0ãã³
//Arduino åã³ããã°ã©ã ã®åæèšå®
void setup(){
size(600, 250);
arduino = new Arduino(
this,
"/dev/cu.usbserial-14P54810"
);
myFont = loadFont("CourierNewPSMT-48.vlw");
textFont(myFont, 30);
frameRate(30);
}
// å
¥åå€ã®æ ŒçŽçšå€æ°
int input0;
//ããã°ã©ã æ¬äœ (以äžãç¹°ãè¿ãå®è¡)
void draw(){
background(120);
input0 = arduino.analogRead(usePin0);
//å
¥åå€ã衚瀺
text("A0: " + input0, 50, 100);
}
```],
caption: "å€ã®ååŸããããœãŒã¹ã³ãŒã"
)<å€ã®ååŸããããœãŒã¹ã³ãŒã>
- ããã°ã©ã ã®æŠèŠ
ã»ã³ãµãã ArduinoA0 ãã³ãžã®å
¥åå€ãã¢ããã°å
¥åãšããŠèªã¿èŸŒããèªã¿èŸŒãã å€ãæ°å€ãšããŠè¡šç€ºããã
- ããã°ã©ã ã®èª¬æ
- 17 è¡ç®: ããã°ã©ã ã«å¿
èŠãªå€æ°ã®å®£èšããã³å®çŸ©ãŸãã¯ã©ã€ãã©ãªã®ã€ã³ããŒããè¡ãã
- 8 è¡ç®ã§ ArduinoA0 ãã³ã®äœ¿çšã usePin0 = 0 ãšããŠå®çŸ©ããŠããã
- 11â20 è¡ç®: Arduino ããã³ããã°ã©ã ã®åæèšå®
- 10 è¡ç®ã§ç»é¢è¡šç€ºã«çšãããŠã£ã³ããŠãµã€ãºã暪 600px,瞊 250px ãšå®çŸ©ããŠããã
- 11 è¡ç®ã§"/dev/cu.usbserial-14P54810"ã®ããŒããš 57600 ã®é床ã§éä¿¡ãã arduino ã€ã³ã¹ã¿ã³ã¹ãçæããïŒ
- 14 è¡ç®ã§ãã¬ãŒã ã¬ãŒãã 30 ãšããŠããïŒ
- 23â32 è¡ç®ïŒããã°ã©ã ã®åäœ
- 23 è¡ç®ã§å
¥åçšã®å€æ° input0 ã宣èšããŠããã
- 27 è¡ç®ã§èæ¯è²ãç°è²ã«èšå®ããã
- 28 è¡ç®ã§ ArduinoA0 ãã³ã®ã¢ããã°å
¥åã input0 ã«å
¥ããã
- 31 è¡ç®ã§ input0 ãæ°å€ãšããŠè¡šç€ºããïŒ
*çµæ*
@è·é¢ã»ã³ãµãŒã®è·é¢ãšãã€ã³ã³ãžã®ã¢ããã°å
¥åå€ã®é¢ä¿å€ ã¯ãå®éš1ã®çµæã«ããããè·é¢ã»ã³ãµãŒã®è·é¢ãšãã€ã³ã³ãžã®ã¢ããã°å
¥åå€ã®é¢ä¿ã瀺ããŠããã
ã°ã©ãã«ãããšãè·é¢ã»ã³ãµã«ç©äœãè¿ã¥ããã°ããã€ã³ã³ã®ã¢ããã°å
¥åå€ãé«ããªãã
#figure(
image("./img/è·é¢ã»ã³ãµãŒã®è·é¢ãšãã€ã³ã³ãžã®ã¢ããã°å
¥åå€ã®é¢ä¿å€.png",width: 75%),
caption: "è·é¢ã»ã³ãµè·é¢æž¬å®ç¹æ§"
)<è·é¢ã»ã³ãµãŒã®è·é¢ãšãã€ã³ã³ãžã®ã¢ããã°å
¥åå€ã®é¢ä¿å€>
*èå¯*
åºåãããå€ã¯è·é¢ãšåæ¯äŸã®é¢ä¿ã«ããã
è·é¢ã»ã³ãµãŒã¯åæ¯äŸã®é¢ä¿ã«ãããããã¢ããã°å
¥åå€ãçšããŠè·é¢ã®æž¬å®ãã§ãããè·é¢ã10~20cmã®éãäžçªæ床ãé«ããä»ã®éšåã«æ¯ã¹ãŠçŽ°ããè·é¢ã®å€åãæç¥ã§ããã
#pagebreak() // ããŒãžãåãã
=== å®éšãã®2 (åäœå¯èœç¯å²ã®ç¢ºèª)
ãã¬ã¬ããŒãããè·é¢ã»ã³ãµã«ã¯åäœå¯èœç¯å²ããããããäžå®æ¡ä»¶äžã§ã¯æ£ããã¢ããã°å€ãåŸãããªãããšãåãããããã§åäœäžå¯èœç¯å²ã«ã€ããŠãã¢ããã°å
¥åå€ã調ã¹ãåäœå¯èœç¯å²ãäžå¯èœç¯å²ã®äž¡æ¹ãå«ãã°ã©ããäœæããªããã
*åè·¯å³ã»ããã°ã©ã *
è£
眮ãããã°ã©ã ã¯å®éšãã®1ãšåããã®ã䜿çšããã
*çµæ*
@è·é¢ãšãã€ã³ã³ãžã®ã¢ããã°å
¥åå€ã®å¯Ÿæ°ã°ã©ã_åäœå¯èœç¯å²ã®ç¢ºèª ãã¿ããšãè·é¢ã»ã³ãµã¯è¿ããªãçšãå€ãå¢ããŠããã¯ãã ãã10cmããè¿ã¥ããšæžã£ãŠããã
ãŸãã80cmããé ããªããšå€ã¯åãã«ãªã£ãŠããŸãã
ãã¬ã¬ããŒãã§æ€çŽ¢ããæ
å ±ãšäžèŽããŠããã
#figure(
image("./img/è·é¢ãšãã€ã³ã³ãžã®ã¢ããã°å
¥åå€ã®å¯Ÿæ°ã°ã©ã.png",width: 80%),
caption: "è·é¢ã»ã³ãµè·é¢æž¬å®ç¹æ§"
)<è·é¢ãšãã€ã³ã³ãžã®ã¢ããã°å
¥åå€ã®å¯Ÿæ°ã°ã©ã_åäœå¯èœç¯å²ã®ç¢ºèª>
*èå¯*
è·é¢ã»ã³ãµã¯ã枬å®å¯èœç¯å²ã50mm~800mmçšåºŠã§ããããã®ç¯å²å€ã§ã¯æ£ç¢ºãªå€ãåŸãããªãã
çç±ãšããŠã¯ãé ããããšåå°å
ã匱ããªããåè¬éšã«å±ããªããªããããè¿ããããšçºé
µéšãšåå°éšã®éã§ä¹±åå°ããŠããŸããæ£ç¢ºãªå€ãåŸãããªãããã ãšèããããã
枬å®å¯èœç¯å²ã¯50mm~800mmçšåºŠã ãšèããããã
ããŒã¿ã·ãŒããšãæ¯èŒããŠããã»ãŒäžèŽããŠãããããæ£ç¢ºãªå€ãåŸããããšèããããã
=== çºå±ãã®1 (è·é¢ã»ã³ãµãçšããç¶æ
èå¥)
è·é¢ã»ã³ãµãžã®å
¥åå€ã«ããããã2ã€ã®ç¶æ
ããdistantããããã¯ãcloseããšèå¥ããŠè¡šç€ºãããªããããŸãããã2ã€ã®ç¶æ
(äŸãã°ïŒããœã³ã³ã®å
šé«ããé«ããäœãã)ãã¯èªåã§æ±ºãããããå®çŸããå¢çå€ãšäžæ垯ãå°ãåºããŠäœ¿çšããªããã
#pagebreak() // ããŒãžãåãã
*åè·¯å³ã»ããã°ã©ã *
è£
眮ã¯å®éšãã®1ãšåããã®ã䜿çšããã
@è·é¢ã»ã³ãµãçšããç¶æ
èå¥ãããœãŒã¹ã³ãŒã ã¯ãçºå±ãã®1ã§äœ¿çšããè·é¢ã»ã³ãµãçšããç¶æ
èå¥ãããœãŒã¹ã³ãŒãã瀺ããŠããã
#figure(
sourcecode[```c
//ããã°ã©ã ã«å¿
èŠãªå€æ°ã®å®£èšåã³å®çŸ©
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
PFont myFont;
int usePin0 = 0; //Arduino A0ãã³
int usePin1 = 3; //Arduino A1ãã³
//Arduino åã³ããã°ã©ã ã®åæèšå®
void setup(){
size(600, 250);
arduino = new Arduino(
this,
"/dev/cu.usbserial-14P54810"
);
myFont = loadFont("CourierNewPSMT-48.vlw");
textFont(myFont, 30);
frameRate(30);
}
// å
¥åå€ã®æ ŒçŽçšå€æ°
int input0;
// äžæ垯ã®éŸå€
int closeDiv = 330;
int distantDiv = 270;
// ç¶æ
ã®æ ŒçŽçšå€æ°
String status = "";
//ããã°ã©ã æ¬äœ (以äžãç¹°ãè¿ãå®è¡)
void draw(){
background(120);
input0 = arduino.analogRead(usePin0);
//å
¥åå€ã衚瀺
text("A0: " + input0, 50, 100);
// äžæ垯ã®èšå®
if(input0 > closeDiv){
status = "close";
}
if(input0 < distantDiv){
status = "distant";
}
// ç¶æ
ã®è¡šç€º
text("Status: " + status, 50, 150);
}
```],
caption: "è·é¢ã»ã³ãµãçšããç¶æ
èå¥ãããœãŒã¹ã³ãŒã"
)<è·é¢ã»ã³ãµãçšããç¶æ
èå¥ãããœãŒã¹ã³ãŒã>
- ããã°ã©ã ã®æŠèŠ
ã»ã³ãµãã ArduinoA0 ãã³ãžã®å
¥åå€ãã¢ããã°å
¥åãšããŠèªã¿èŸŒããèªã¿èŸŒãã å€ãæ°å€ãšããŠè¡šç€ºãããã®å€ã«ãã£ãŠç¶æ
ãèå¥ããã
- ããã°ã©ã ã®èª¬æ
- 1â9 è¡ç®: ããã°ã©ã ã«å¿
èŠãªå€æ°ã®å®£èšããã³å®çŸ©ãŸãã¯ã©ã€ãã©ãªã®ã€ã³ããŒããè¡ãã
- 8,9è¡ç®ã§ Arduino A0, D3 ãã³ã®äœ¿çšã usePin0 = 0 , usePin1 = 3 ãšããŠå®çŸ©ããŠããã
- 12â21 è¡ç®: Arduino ããã³ããã°ã©ã ã®åæèšå®
- 10 è¡ç®ã§ç»é¢è¡šç€ºã«çšãããŠã£ã³ããŠãµã€ãºã暪 600px,瞊 250px ãšå®çŸ©ããŠããã
- 11 è¡ç®ã§"/dev/cu.usbserial-14P54810"ã®ããŒããšéä¿¡ãã arduino ã€ã³ã¹ã¿ã³ã¹ãçæããïŒ
- 14 è¡ç®ã§ãã¬ãŒã ã¬ãŒãã 30 ãšããŠããïŒ
- 23â52 è¡ç®ïŒããã°ã©ã ã®åäœ
- 24 è¡ç®ã§å
¥åçšã®å€æ° input0 ã宣èšããŠããã
- 27,28 è¡ç®ã§éŸå€ãèšå®ããŠããã
- 30 è¡ç®ã§ç¶æ
ãæ ŒçŽããå€æ° status ã宣èšããŠããã
- 35 è¡ç®ã§èæ¯è²ãç°è²ã«èšå®ããã
- 36 è¡ç®ã§ ArduinoA0 ãã³ã®ã¢ããã°å
¥åã input0 ã«å
¥ããã
- 39 è¡ç®ã§ input0 ãæ°å€ãšããŠè¡šç€ºããïŒ
- 42â48 è¡ç®ã§å
¥åå€ã«ãã£ãŠç¶æ
ãèå¥ãããäžæ垯ãäœæãããã®ç¯å²å
ã§ç¶æ
ãèå¥ããã
- 51 è¡ç®ã§ç¶æ
ã衚瀺ããã
*çµæ*
ä»åãMacBookAirã®ãã£ã¹ãã¬ã€ã®é«ããéŸå€ãšããéŸå€ããé«ããäœããã§ç¶æ
ãèå¥ããã
MacBookAirã®ãã£ã¹ãã¬ã€ã®é«ãããäœããé«ããã§æšå®ãè¡ãããšããŠã¯ããã€ã³ã³ãžã®ã¢ããã°å
¥åå€300ãç®åŠãšããŠããã
ãŸãããã£ã¹ãã¬ã€ã®é«ãã®ãªã®ãªã§ã ãšæšå®ãäžå®å®ã«ãªãããäžæ垯ãå²ãããäžæ垯ã¯270â330ãšããã
*èå¯*
äžæ垯ãããããçããç¶æ
ã§ãã»ã³ãµãšç©äœã®è·é¢ã20cmååŸãä¿ã€ãšãç¶æ
ãå®å®ããªãã
éã«äžæ垯ã倧ãããããšå€å®ãããè·é¢ãåºããªãã枬ãããè·é¢ãæ£ç¢ºã«æž¬ããªããªãã
ãã®ãããä»åäžæ垯ã®èšå®ã270-330ãšããè·é¢ã»ã³ãµãšç©äœã®è·é¢ã20cmååŸãä¿ã£ãŠããç¶æ
ã®å®å®ã確èªã§ããã
#pagebreak() // ããŒãžãåãã
=== çºå±ãã®2 (ç¶æ
èå¥ãçšãã LED ç¹ç¯å¶åŸ¡)
第3ç« ã§çšããLEDã䜿ããäžå®è·é¢ä»¥äžè¿ã¥ããšãLED ãç¹ç¯ããããã«ããªãã. ãŸãããäžå®è·é¢ããäœãæãããèªåã§æ±ºãããããå®çŸããå¢çå€ãšäžæ垯ãå°ãåºããŠäœ¿çšããªããã
*åè·¯å³ã»ããã°ã©ã *
@å®éš2åè·¯å³ ã¯ãçºå±ãã®2ã®åè·¯å³ã瀺ãã
è£
眮ã¯å®éšãã®1ã«LEDãè¿œå ããŠäœ¿çšããã
#figure(
image("./img/å®éš2åè·¯å³.png",width: 75%),
caption: "å®éš2åè·¯å³"
)<å®éš2åè·¯å³>
@è·é¢ã»ã³ãµãçšããç¶æ
èå¥ããŠLED衚瀺ãããœãŒã¹ã³ãŒã ã¯ãçºå±ãã®2ã§äœ¿çšããè·é¢ã»ã³ãµãçšããç¶æ
èå¥ããŠLED衚瀺ãããœãŒã¹ã³ãŒãã瀺ããŠããã
çºå±ãã®1ã§äœæãããœãŒã¹ã³ãŒãã®51ãš52è¡ç®ã®éã«æ¿å
¥ããã
#figure(
sourcecode[```c
// ç¶æ
ã«å¿ããåŠç
if(status.equals("close")){
//close ã®æã®åŠç
arduino.analogWrite(usePin1, 255);
}else if(status.equals("distant")){
//distant ã®æã®åŠç
arduino.analogWrite(usePin1, 0);
}
```],
caption: "è·é¢ã»ã³ãµãçšããç¶æ
èå¥ããŠLED衚瀺ãããœãŒã¹ã³ãŒã"
)<è·é¢ã»ã³ãµãçšããç¶æ
èå¥ããŠLED衚瀺ãããœãŒã¹ã³ãŒã>
- ããã°ã©ã ã®æŠèŠ
ã»ã³ãµãã ArduinoA0 ãã³ãžã®å
¥åå€ãã¢ããã°å
¥åãšããŠèªã¿èŸŒããèªã¿èŸŒãã å€ãæ°å€ãšããŠè¡šç€ºãããã®å€ã«ãã£ãŠç¶æ
ãèå¥ããã
- ããã°ã©ã ã®èª¬æ
- 2è¡ç®ã§statusãcloseãå€å®ãããã
- 4è¡ç®ã§usePin1ã«5Vãåºåããã
- 6è¡ç®ã§statusãdistantãå€å®ãããã
- 8è¡ç®ã§usePin1ã«0Vãåºåããã
*çµæ*
ä»åãMacBookAirã®ãã£ã¹ãã¬ã€ã®é«ããéŸå€ãšããéŸå€ããé«ããäœããã§ç¶æ
ãèå¥ããã
MacBookAirã®ãã£ã¹ãã¬ã€ã®é«ãããäœããé«ããã§æšå®ãè¡ãããšããŠã¯ããã€ã³ã³ãžã®ã¢ããã°å
¥åå€300ãç®åŠãšããŠããã
ãŸãããã£ã¹ãã¬ã€ã®é«ãã®ãªã®ãªã ãšæšå®ãäžå®å®ã«ãªãããäžæ垯ãå²ãããäžæ垯ã¯270â330ãšããã
*èå¯*
äžæ垯ãããããçããç¶æ
ã§ãã»ã³ãµãšç©äœã®è·é¢ã20cmååŸãä¿ã€ãšãç¶æ
ãå®å®ããªãã éã«äžæ垯ã倧ãããããšæž¬ãããè·é¢ãæ£ç¢ºã«æž¬ããªããªãã
LEDãè¿œå ããã®ã§ãã»ã³ãµãšç©äœã®è·é¢ãäžå®ä»¥äžè¿ã¥ããšLEDãç¹ç¯ããããã«ãªã£ããããã«ãããããŒããŠã§ã¢ã®ã¿ã§å
¥åããåºåãŸã§ã®åŠçãè¡ããããã«ãªã£ãã
=== ãŸãšã
ä»åã®å®éšãéããŠãè·é¢ã»ã³ãµ GP2Y0A21YK0Fã®äœ¿ãæ¹ãšä»çµã¿ãç¿åŸã§ããã
è·é¢ã»ã³ãµã¯ãåæ¯äŸã®é¢ä¿ã«ãããããã¢ããã°å
¥åå€ãçšããŠè·é¢ã®æž¬å®ãã§ãããè·é¢ã10~20cmã®éãäžçªæ床ãé«ããä»ã®éšåã«æ¯ã¹ãŠçŽ°ããè·é¢ã®å€åãæç¥ã§ããã
ãŸãã枬å®å¯èœç¯å²ã50mm~800mmçšåºŠã§ãããšåãã£ãã
è·é¢ã»ã³ãµãçšããç¶æ
èå¥ãè¡ããšãã»ã³ãµãšç©äœã®è·é¢ã20cmååŸãä¿ã€æãç¶æ
ãå®å®ããªãããšãåãã£ãã
ãã®ãããäžæ垯ãçšããŠãã»ã³ãµãšç©äœã®è·é¢ã20cmååŸãä¿ã£ãŠããç¶æ
ã®å®å®ã確èªã§ããã
#pagebreak() // ããŒãžãåãã
// bibãã¡ã€ã«ã®æå® //
#bibliography("./bibliography.bib")
|
|
https://github.com/jrihon/cv | https://raw.githubusercontent.com/jrihon/cv/main/sections/education.typ | typst | // import template here as well, to get all the functions
#import "../brilliant-template/template.typ": *
#v(-1.5em) // comment out when using profile picture
#boxEnvironment(
"About me",
right,
[
Currently a PhD candidate on the topic of modified nucleic acids by means of _in silico_ research.
I use computational chemistry to characterise nucleosides and perform simulations to understand their structural dynamics.
I program to optimise research methodologies. Coming from a pharmaceutical background, I bring the best of both worlds.\
\
I am interested in writing performant libraries for chem- and bioinformatics tools, targetting developers as my audience.\
Open to academic and industry positions.
]
)
#cvSection("Professional and Education")
#cvEntry(
title: [PhD in Pharmaceutical Sciences],
society: [Rega Institute for Medical Resarch, Catholic University of Leuven, Leuven],
date: [2020 - Present],
location: [BE],
logo: "../src/logos/Kuleuven_logo.png",
description: list(
[Thesis: _Molecular modeling tools to improve and expand computational research on synthetic nucleic acids_ (Supervisors : prof.dr. <NAME>, prof.dr. <NAME>)],
[Researching the fundamentals of (xenobiotic) nucleic acids through computational chemistry and molecular modeling],
[Software development to facilitate computational research on nucleic acids],
[Teaching assistant in the Biopharmaceutical Analysis practical courses],
),
keywords : [Molecular Dynamics, Computational Chemistry, Python, Rust, Linux, Shell, Linear Algebra],
)
#cvEntry(
title: [Master of Drug Design and Development (_cum laude_)],
society: [Catholic University of Leuven, Leuven],
date: [2018 - 2020],
location: [BE],
logo: "../src/logos/Kuleuven_logo.png",
description: list(
[Thesis: _Development of an allergophore to predict and analyse cross-reactivity in corticosteroid-mediated drug allergy_ (Supervisor : prof.dr. <NAME>)]
),
keywords : [Molecular Dynamics, Linux, Shell, Molecular Docking],
)
#cvEntry(
title: [Bachelors of Pharmaceutical Sciences],
society: [Catholic University of Leuven, Leuven],
date: [2013 - 2018],
location: [BE],
logo: "../src/logos/Kuleuven_logo.png",
)
#v(-9pt)
|
|
https://github.com/flechonn/typst | https://raw.githubusercontent.com/flechonn/typst/main/data/doc1.typ | typst | = 1. Exercice : Appliquer la loi d'Ohm.
Solution : $V = I * R$
Niveau d'indice : Débutant
= 2. Exercice : Résoudre un problÚme de mouvement rectiligne uniformément accéléré.
Solution : $x(t) = xâ + vât + (1/2)at²$
Niveau d'indice : Intermédiaire
|
|
https://github.com/ns-shop/ns-shop-typst | https://raw.githubusercontent.com/ns-shop/ns-shop-typst/main/chapter3.typ | typst | #import "template.typ": *
#h1("Xây dựng sản phẩm")
#h2("Chuẩn bá» mÃŽi trÆ°á»ng phát triá»n")
#tabl(
columns: (auto, 1fr),
[OS], [Linux],
[Web hosting control panel], [cPanel],
[Webserver], [Apache],
[Version control system], [Git, Github],
[Web framework], [Laravel],
[Database], [MySQL],
[IDE], [Visual Studio Code],
cap: "MÃŽi trÆ°á»ng phát triá»n website TMÄT",
)
Viá»c chuẩn bá» mÃŽi trÆ°á»ng phát triá»n là rất quan trá»ng trong quá trình phát triá»n của má»t dá»± án web. Có nhiá»u yếu tỠảnh hÆ°á»ng Äến viá»c lá»±a chá»n cÃŽng nghá»: chi phÃ, chất lượng nhân lá»±c, tÃnh má» rá»ng, sá»± phá» biến và há» trợ từ cá»ng Äá»ng của cÃŽng nghá» Äó,... Viá»c lá»±a chá»n cÃŽng nghá» phù hợp vá»i dá»± án giúp cho viá»c phát triá»n dá»± án nhanh chóng, hiá»u quả và Ãt rủi ro hÆ¡n.
Sau nhiá»u lần tìm hiá»u và cân nhắc, tác giả quyết Äá»nh sá» dụng Laravel là má»t web framework há» trợ rất mạnh mẜ trong viá»c xây dá»±ng website. Laravel Äược sá» dụng rất phá» biến trong cá»ng Äá»ng láºp trình viên web vì sá»± mạnh mẜ cÅ©ng nhÆ° há» trợ và cáºp nháºt rất tá»t từ tác giả và cá»ng Äá»ng.
Vá» IDE thì lá»±a chá»n phá» biến nhất cho láºp trình viên web Äó là VS Code do Äây là IDE Äược sá» dụng phá» biến và Äược há» trợ rất tá»t từ cá»ng Äá»ng vá»i khả nÄng tùy biến cao và nhiá»u plugin kÚm theo. Ngoà i ra còn do cá nhân tác giả Äã có nhiá»u kinh nghiá»m sá» dụng VS Code. Äây là lá»±a chá»n thuá»c vá» chất lượng nhân lá»±c.
Vá» phần hạ tầng tác giả chủ trÆ°Æ¡ng sá» dụng web hosting Äá» tiết kiá»m chi phà và dá»
dà ng bảo trì, do Äó Äi kÚm theo là sá» dụng há» Äiá»u hà nh Linux, cPanel control panel, MySQL database và Apache web server do Äây là 4 service kÚm theo phá» biến của shared web hosting và cÅ©ng phù hợp vá»i nhu cầu dá»± án.
#h2("Xây dá»±ng cÆ¡ sá» dữ liá»u")
Mã SQL trên Äá»nh nghÄ©a các bảng trong cÆ¡ sá» dữ liá»u MySQL. DÆ°á»i Äây là danh sách các bảng và chức nÄng của chúng:
Bảng `addresses`:
- Chức nÄng: LÆ°u trữ thÃŽng tin Äá»a chá».
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `country`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `city`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `state`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `street`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `zip_code`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
Bảng `cart_items`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» các mục trong giá» hà ng.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `product_id`: Khóa ngoại Äến bảng `products` (id).
- `user_id`: Khóa ngoại Äến bảng `users` (id).
- `quantity`: Sá» nguyên khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `created_at`: Thá»i Äiá»m tạo, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
- `updated_at`: Thá»i Äiá»m cáºp nháºt, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
- `deleted_at`: Thá»i Äiá»m xóa, kiá»u timestamp, có thá» là null.
Bảng `fulfilled_orders`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» các ÄÆ¡n hà ng Äã hoà n tất.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `phone`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `email`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `total`: Sá» thá»±c khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `status`: Sá» nguyên khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `created_at`: Thá»i Äiá»m tạo, kiá»u timestamp, có thá» là null.
- `updated_at`: Thá»i Äiá»m cáºp nháºt, kiá»u timestamp, có thá» là null.
- `shipping_provider_id`: Khóa ngoại Äến bảng "shipping_providers" (id).
- `tracking_id`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `note`: `varchar(255)`, có thỠlà null.
- `shipping_cost`: Sá» thá»±c khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `address_id`: Khóa ngoại Äến bảng "addresses" (id).
Bảng `orders`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» các ÄÆ¡n hà ng.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `payment_method_id`: Khóa ngoại Äến bảng `payment_methods` (id).
- `name`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `email`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `phone`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `total`: Sá» thá»±c khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `note`: Kiá»u vÄn bản, có thá» là null.
- `status`: ENUM('unpaid', 'processing', 'paid', 'cancelled', 'cod'), khÃŽng Äược Äá» trá»ng.
- `user_id`: Khóa ngoại Äến bảng `users` (id).
- `address_id`: Khóa ngoại Äến bảng `addresses` (id).
- `fulfilled_order_id`: Khóa ngoại Äến bảng `fulfilled_orders` (id), có thá» là null.
- `created_at`: Thá»i Äiá»m tạo, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
- `updated_at`: Thá»i Äiá»m cáºp nháºt, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
- `deleted_at`: Thá»i Äiá»m xóa, kiá»u timestamp, có thá» là null.
Bảng `order_items`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» các mục hà ng trong ÄÆ¡n hà ng.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `product_id`: Khóa ngoại Äến bảng `products` (id).
- `quantity`: Sá» nguyên khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `price`: Sá» thá»±c khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `order_id`: Khóa ngoại Äến bảng `orders` (id).
Bảng `payment_methods`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» các phÆ°Æ¡ng thức thanh toán.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `name`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `code`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `enable`: Sá» nguyên nhá» (1 hoặc 0), khÃŽng Äược Äá» trá»ng.
Bảng `products`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» các sản phẩm.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `name`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `description`: Kiá»u vÄn bản, có thá» là null.
- `price`: Sá» thá»±c khÃŽng dấu, khÃŽng Äược Äá» trá»ng.
- `sku`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `availability`: Sá» nguyên nhá» (1 hoặc 0), khÃŽng Äược Äá» trá»ng.
- `quantity`: SỠnguyên, có thỠlà null.
- `discount_price`: SỠthực khÎng dấu, có thỠlà null.
- `slug`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `created_at`: Thá»i Äiá»m tạo, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
- `updated_at`: Thá»i Äiá»m cáºp nháºt, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
- `deleted_at`: Thá»i Äiá»m xóa, kiá»u timestamp, có thá» là null.
Bảng `shipping_providers`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» nhà cung cấp váºn chuyá»n.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `name`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `code`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `enable`: Sá» nguyên nhá» (1 hoặc 0), khÃŽng Äược Äá» trá»ng.
Bảng `users`:
- Chức nÄng: LÆ°u trữ thÃŽng tin vá» ngÆ°á»i dùng.
- Các cá»t:
- `id`: Khóa chÃnh, sá» nguyên khÃŽng dấu, tá»± Äá»ng tÄng.
- `name`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `email`: `varchar(255)`, khÃŽng Äược Äá» trá»ng, duy nhất.
- `email_verified_at`: Thá»i Äiá»m xác minh email, kiá»u timestamp, có thá» là null.
- `password`: `varchar(255)`, khÃŽng Äược Äá» trá»ng.
- `remember_token`: `varchar(100)`, có thỠlà null.
- `created_at`: Thá»i Äiá»m tạo, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
- `updated_at`: Thá»i Äiá»m cáºp nháºt, kiá»u timestamp, khÃŽng Äược Äá» trá»ng.
Những bảng có cá»t `deleted_at` cho thấy có sá» dụng cÆ¡ chế "soft delete" (soft delete là phÆ°Æ¡ng pháp Äánh dấu thá»i gian thá»±c hiá»n xóa bản ghi á» cá»t `deleted_at` nhÆ°ng khÃŽng xóa bản ghi trong cÆ¡ sá» dữ liá»u, website sẜ dá»±a và o Äó Äá» truy vấn và chá» trả vá» những bản ghi chÆ°a có giá trá» `deleted_at`).
// @startuml
// !define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
// !define primary_key(x) <b>x</b>
// !define foreign_key(x) <u>x</u>
// !define unique(x) <i>x</i>
// !define index(x) <i>x</i>
// hide methods
// hide stereotypes
// Table(addresses, "addresses") {
// primary_key(id) bigint unsigned
// country varchar(255)
// city varchar(255)
// state varchar(255)
// street varchar(255)
// zip_code varchar(255)
// }
// Table(cart_items, "cart_items") {
// primary_key(id) bigint unsigned
// foreign_key(product_id) bigint unsigned
// foreign_key(user_id) bigint unsigned
// quantity int unsigned
// created_at timestamp
// updated_at timestamp
// deleted_at timestamp
// }
// Table(fulfilled_orders, "fulfilled_orders") {
// primary_key(id) bigint unsigned
// phone varchar(255)
// email varchar(255)
// total double unsigned
// status int unsigned
// created_at timestamp
// updated_at timestamp
// foreign_key(shipping_provider_id) bigint unsigned
// tracking_id varchar(255)
// note varchar(255)
// shipping_cost double unsigned
// foreign_key(address_id) bigint unsigned
// }
// Table(orders, "orders") {
// primary_key(id) bigint unsigned
// foreign_key(payment_method_id) bigint unsigned
// name varchar(255)
// email varchar(255)
// phone varchar(255)
// total double unsigned
// note text
// status enum
// foreign_key(user_id) bigint unsigned
// foreign_key(address_id) bigint unsigned
// foreign_key(fulfilled_order_id) bigint unsigned
// created_at timestamp
// updated_at timestamp
// deleted_at timestamp
// }
// Table(order_items, "order_items") {
// primary_key(id) bigint unsigned
// foreign_key(product_id) bigint unsigned
// quantity int unsigned
// price double unsigned
// foreign_key(order_id) bigint unsigned
// }
// Table(payment_methods, "payment_methods") {
// primary_key(id) bigint unsigned
// name varchar(255)
// code varchar(255)
// enable tinyint(1)
// }
// Table(products, "products") {
// primary_key(id) bigint unsigned
// name varchar(255)
// description text
// price double unsigned
// sku varchar(255)
// availability tinyint(1)
// quantity int
// discount_price double unsigned
// slug varchar(255)
// created_at timestamp
// updated_at timestamp
// deleted_at timestamp
// }
// Table(shipping_providers, "shipping_providers") {
// primary_key(id) bigint unsigned
// name varchar(255)
// code varchar(255)
// enable tinyint(1)
// }
// Table(users, "users") {
// primary_key(id) bigint unsigned
// name varchar(255)
// email varchar(255)
// email_verified_at timestamp
// password varchar(255)
// remember_token varchar(100)
// created_at timestamp
// updated_at timestamp
// }
// addresses "1" -- "1..*" orders
// fulfilled_orders "1" -- "1..*" orders
// payment_methods "1" -- "1..*" orders
// shipping_providers "1" -- "1..*" fulfilled_orders
// products "1" -- "1..*" order_items
// users "1" -- "1..*" orders
// users "*" -- "1..*" cart_items
// addresses "*" -- "1" fulfilled_orders
// orders "1" -- "0..1" fulfilled_orders
// orders "*" -- "1..*" order_items
// products "*" -- "1..*" cart_items
// @enduml
#img("55image.png", cap: "Biá»u Äá» quan há» mÃŽ tả cấu trúc các bảng và quan há» giữa chúng trong cÆ¡ sá» dữ liá»u của website TMÄT")
#h2("Xây dá»±ng giao diá»n và trải nghiá»m ngÆ°á»i dùng")
#h3("Cà i Äặt và sá» dụng thÆ° viá»n Tailwind")
Tác giả sá» dụng há» thá»ng thiết kế cÆ¡ bản của Tailwind là m há» thá»ng thiết kế chÃnh cho dá»± án. Tailwind là má»t thÆ° viá»n design component phá» biến trong cá»ng Äá»ng do Äó có Äa dạng thiết kế và Ü tÆ°á»ng Äược há» trợ từ cá»ng Äá»ng. KÚm theo Äó là sá» dụng cÃŽng cụ Vite Äá» biên dá»ch và Äóng gói code @vite.
Äá» cà i Äặt Tailwind cho website ta thá»±c hiá»n các bÆ°á»c sau:
Cà i Äặt thÆ° viá»n Tailwind bằng câu lá»nh:
```sh
npm install -D tailwindcss
```
Khá»i tạo file cấu hình Tailwind bằng câu lá»nh:
```sh
npx tailwindcss init
```
Sau khi chạy câu lá»nh há» thá»ng sẜ tạo ra file `tailwind.config.js` vá»i ná»i dung bên dÆ°á»i, trong file nà y ta có thá» cà i Äặt thêm các plugin, theme và khai báo và o thuá»c tÃnh tÆ°Æ¡ng ứng, ngoà i ra ta còn có thá» cấu hình cho Tailwind tá»± Äá»ng Äá»c và hot-reload những file Äược khai báo trong thuá»c tÃnh `content`:
```js
export default {
content: [],
corePlugins: {},
plugins: [],
};
```
Sau khi tác giả cà i Äặt các thÆ° viá»n cần thiết và khai báo ÄÆ°á»ng dẫn những file giao diá»n web thì file có ná»i dung nhÆ° sau:
```js
import forms from '@tailwindcss/forms';
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
],
corePlugins: {
aspectRatio: false,
},
plugins: [forms, require('@tailwindcss/typography'), require('@tailwindcss/aspect-ratio'), require('@tailwindcss/forms')],
};
```
Tiếp Äến ta tạo file `app.css` vói ná»i dung nhÆ° bên dÆ°á»i, file CSS nà y import các thÆ° viá»n CSS cùa Tailwind:
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```
Trong file `vite.config.js` ta cấu hình Tailwind cho Laravel như sau:
```js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: ['path/to/app.css'], // replace your app.css path
refresh: true,
}),
],
});
```
Sau khi Äã cà i Äặt và cấu hình, ta chạy câu lá»nh bên dÆ°á»i Äá» Tailwind tiến hà nh Äá»c và biên dá»ch những file Äược khai báo:
```sh
npm run dev
```
Cuá»i cùng má» Visual Studio Code và truy cáºp mã nguá»n giao diá»n của website Äá» láºp trình. Và dụ má»t Äoạn mã giao diá»n sá» dụng các class của thÆ° viá»n Tailwind trong Laravel Blade:
```html
<div {{ $attributes->merge(['class' => 'rounded-md bg-green-50 dark:bg-green-900 p-4']) }}>
<div class="flex">
<div class="flex-shrink-0">
<!-- Heroicon name: solid/check-circle -->
<svg class="h-5 w-5 text-green-400 dark:text-green-200" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
</div>
<div class="ml-3">
<p class="text-sm font-medium text-green-800 dark:text-green-200">
{{ $slot }}
</p>
</div>
</div>
</div>
```
Kết quả hiá»n thá»:
#img("Screenshot 2023-06-07 013927.png", cap: "Giao diá»n thÃŽng báo thà nh cÃŽng của website")
#h3("Xây dá»±ng thà nh phần giao diá»n website")
Thà nh phần giao diá»n của website Äược xây dá»±ng trong thÆ° mục `views` của website bao gá»m các thÆ° mục chÃnh bên trong sau:
- `components`: Chứa các thà nh phần giao diá»n có thá» tái sá» dụng nhiá»u lần trong website nhÆ° giao diá»n thÃŽng báo, bảng, ÃŽ nháºp, menu,...
- `layouts`: Chứa các khung giao diá»n có thá» tái sá» dụng nhiá»u lần á» các trang trong website. Và dụ nhÆ° khung giao diá»n quản trá» ná»i dung và khung giao diá»n website dà nh cho khách hà ng.
- `livewire`: Chứa những thà nh phần giao diá»n website có thá» tÆ°Æ¡ng tác trong thá»i gian thá»±c vá»i server nhÆ° trang quản lÃœ giá» hà ng, nút thêm sản phẩm và o giá» hà ng.
- `admin`: Chứa các giao diá»n của các trang quản trá» website.
Viá»c phân tách các giao diá»n có chức nÄng tÆ°Æ¡ng tá»± nhau và o các thÆ° mục cụ thá» giúp cho viá»c quản lÃœ mã nguá»n giao diá»n dá»
dà ng hÆ¡n và tá»i Æ°u hiá»u suất khi láºp trình.
#h3("Trải nghiá»m ngÆ°á»i dùng")
Tác giả Äã dà nh nhiá»u thá»i gian tham gia trải nghiá»m các sản phẩm tÆ°Æ¡ng tá»± khác, trong sá» Äó có nhiá»u sản phẩm phá» biến Äá» Äánh giá Æ°u nhược Äiá»m của trải nghiá»m ngÆ°á»i dùng từ Äó cải thiá»n trải nghiá»m cho sản phẩm nà y.
Trong quá trình xây dá»±ng giao diá»n và trải nghiá»m ngÆ°á»i dùng cho website TMÄT, tác giả Äã Äặt trá»ng Äiá»m và o viá»c mang lại trải nghiá»m tuyá»t vá»i và thuáºn tiá»n cho ngÆ°á»i dùng. Äây là má»t phần quan trá»ng Äá» thu hút và giữ chân khách hà ng. Äảm bảo ngÆ°á»i dùng dá»
dà ng tìm thấy và khám phá các sản phẩm má»t cách nhanh chóng. Giao diá»n Äược thiết kế ÄÆ¡n giản, vá»i bá» cục rõ rà ng và các thà nh phần giao diá»n Äược sắp xếp hợp lÃœ, tạo ra má»t trải nghiá»m trá»±c quan và dá»
sỠdụng.
Viá»c ÄÄng kÃœ tà i khoản cÅ©ng Äược ÄÆ¡n giản hóa Äá» ngÆ°á»i dùng có thá» nhanh chóng trá» thà nh thà nh viên của trang web. Website Äã tÃch hợp các tùy chá»n ÄÄng kÃœ thÃŽng qua email và máºt khẩu, cùng vá»i viá»c ÄÄng kÃœ bằng tà i khoản Google, giúp ngÆ°á»i dùng tiết kiá»m thá»i gian hÆ¡n.
TÃnh nÄng giá» hà ng Äược thiết kế Äá» giúp ngÆ°á»i dùng quản lÃœ và kiá»m soát quá trình mua hà ng má»t cách thuáºn tiá»n. NgÆ°á»i dùng có thá» dá»
dà ng thêm và xóa sản phẩm trong giá» hà ng, cáºp nháºt sá» lượng sản phẩm và xem tá»ng giá trá» ÄÆ¡n hà ng. Äiá»u nà y giúp ngÆ°á»i dùng có trải nghiá»m mua sắm trá»±c tuyến mượt mà và tiết kiá»m thá»i gian.
Website cÅ©ng Äã tÃch hợp nhiá»u phÆ°Æ¡ng thức thanh toán Äa dạng Äá» Äáp ứng nhu cầu và sá»± thuáºn tiá»n của ngÆ°á»i dùng. Các tùy chá»n thanh toán nhÆ° Zalopay, Paypal và nhiá»u hÆ¡n nữa Äược tÃch hợp và o website, cho phép ngÆ°á»i dùng lá»±a chá»n phÆ°Æ¡ng thức phù hợp và hoà n tất quá trình thanh toán má»t cách dá»
dà ng.
#img("18image.png", cap: "Giao diá»n trang xem giá» hà ng của website")
#img("19image.png", cap: "Giao diá»n trang ÄÄng kÃœ của website")
Website cÅ©ng Äã Äược tá»i Æ°u hóa cho trải nghiá»m di Äá»ng, giúp ngÆ°á»i dùng truy cáºp và duyá»t sản phẩm trên các thiết bá» di Äá»ng má»t cách thuáºn tiá»n. Thiết kế Äáp ứng (RWD) Äã Äược áp dụng Äá» Äảm bảo giao diá»n hiá»n thá» tá»t trên các kÃch thÆ°á»c mà n hình khác nhau, từ Äiá»n thoại thÃŽng minh Äến máy tÃnh bảng và máy tÃnh Äá» bà n.
#img("Screenshot 2023-06-07 015605.png", cap: "Giao diá»n website khi responsive á» mà n hình máy tÃnh (1280px)", width: 90%)
#img("20image.png", cap: "Giao diá»n website khi responsive á» mà n hình Iphone 11 Pro (375px)", width: 38%)
#h2("Láºp trình các chức nÄng và tÃnh nÄng")
#h3("TÃnh nÄng ÄÄng nháºp và ÄÄng kÃœ vá»i email/password")
Mặc Äá»nh website sẜ sá» dụng email/password Äá» tiến hà nh ÄÄng nháºp, website sẜ lÆ°u thÃŽng tin tên, email của ngÆ°á»i dùng. Ngoà i ra còn há» trợ tÃnh nÄng "Remember me" giúp ngÆ°á»i dùng dá»
dà ng quản lÃœ phiên ÄÄng nháºp cho mình. @breeze
Code xá» lÃœ tÃnh nÄng ÄÄng nháºp vá»i email/password:
```php
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.failed'),
]);
}
```
Code xá» lÃœ tÃnh nÄng ÄÄng kÃœ vá»i email/password:
```php
public function store(Request $request): RedirectResponse
{
$request->validate([
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:' . User::class],
'password' => ['required', 'confirmed', 'min:8', Rules\Password::defaults()],
]);
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'password' => <PASSWORD>::<PASSWORD>($request->password),
]);
event(new Registered($user));
Auth::login($user);
return redirect(RouteServiceProvider::HOME);
}
```
#h3("TÃnh nÄng ÄÄng nháºp và ÄÄng kÃœ vá»i tà i khoản Google")
TÃnh nÄng ÄÄng nháºp và ÄÄng kÃœ vá»i tà i khoản Google sá» dụng chuẩn OAuth 2.0 Äá» triá»n khai trong website. Các bÆ°á»c triá»n khai Äược trình bà y bên dÆ°á»i. @oauth20google
Tạo Google OAuth Credentials:
- Và o trang https://console.developers.google.com và tạo project má»i.
- Báºt tÃnh nÄng Google+ API bằng cách và o mục "Library" và tìm "Google+ API". Chá»n và kÃch hoạt.
- Và o mục "Credentials" và chá»n "Create Credentials". Chá»n "OAuth client ID" á» menu xá» xuá»ng.
- Cấu hình "name" và "authorized domains" của mục OAuth consent screen.
- Chá»n "Web application".
- Thêm authorized redirect URIs. Và dụ á» Äây là `http://localhost/auth/google/callback` cho mÃŽi trÆ°á»ng phát triá»n.
- Chá»n "Create" Äá» tạo OAuth client. LÆ°u giá trá» mục "Client ID" và "Client Secret" vừa tạo.
Cấu hình Laravel:
MỠfile `.env` và thêm Google OAuth client credentials:
```
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REDIRECT_URI=http://localhost/auth/google/callback
```
Tạo routes cho viá»c xác thá»±c Google á» file `routes/web.php`:
```php
Route::get('/auth/google', [LoginController::class, 'redirectToGoogle']);
Route::get('/auth/google/callback', [LoginController::class, 'handleGoogleCallback']);
```
Tạo má»i controller tên `LoginController` sá» dụng câu lá»nh sau:
```bash
php artisan make:controller Auth/LoginController
```
Má» file `LoginController.php` và triá»n khai hà m `redirectToGoogle` có chức nÄng chuyá»n hÆ°á»ng ngÆ°á»i dùng Äến trang xác thá»±c của Google và hà m `handleGoogleCallback` có chức nÄng nháºn dữ liá»u Äã xác thá»±c phÃa Google gá»i vá»:
```php
public function redirectToGoogle()
{
$params = [
'client_id' => config('app.google_client_id'),
'redirect_uri' => config('app.google_redirect_uri'),
'response_type' => 'code',
'scope' => 'openid email profile',
'state' => csrf_token(),
];
$url = 'https://accounts.google.com/o/oauth2/auth?' . http_build_query($params);
return redirect($url);
}
public function handleGoogleCallback(Request $request)
{
$state = $request->query('state');
$code = $request->query('code');
if ($state !== csrf_token())
return redirect('/login')->withErrors('Invalid state parameter');
$response = Http::asForm()->post('https://oauth2.googleapis.com/token', [
'code' => $code,
'client_id' => config('app.google_client_id'),
'client_secret' => config('app.google_client_secret'),
'redirect_uri' => config('app.google_redirect_uri'),
'grant_type' => 'authorization_code',
]);
if ($response->failed())
return redirect('/login')->withErrors('Failed to retrieve access token');
$access_token = $response->json('access_token');
$response = Http::withHeaders([
'Authorization' => 'Bearer ' . $access_token,
])->get('https://www.googleapis.com/oauth2/v3/userinfo');
if ($response->failed())
return redirect('/login')->withErrors('Failed to retrieve user information');
$user = $response->json();
Auth::loginUsingId($userId);
return redirect('/home');
}
```
Äoạn code bên trên cÅ©ng là code triá»n khai OAuth 2.0 của Google và o website Laravel.
Cuá»i cùng thêm Äoạn code hiá»n thá» nút ÄÄng nháºp vá»i Google và o trang ÄÄng nháºp của website:
```html
<div {{ $attributes }}>
<a href="{{ route('auth.google.redirect') }}"
class="flex items-center justify-center bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-semibold py-2 px-4 border border-gray-300 dark:border-gray-700 rounded-lg shadow-md transition duration-300 ease-in-out hover:bg-gray-100 dark:hover:bg-gray-700 hover:border-gray-400 dark:hover:border-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-offset-gray-800">
<img class="w-6 h-6 mr-2" src="{{ asset('assets/images/google.svg') }}" alt="Login with Google" />
Sign in with Google
</a>
</div>
```
Sá» dụng tÃnh nÄng:
- Khá»i Äá»ng Docker, sau Äó khá»i Laravel bằng câu lá»nh:
```bash
sail up -d
```
- Và o link trang ÄÄng nháºp của website sau Äó nhấn chá»n "Login with Google".
- Ta sẜ Äược chuyá»n hÆ°á»ng Äến trang ÄÄng nháºp của Google. Tiến hà nh ÄÄng nháºp và xác thá»±c tà i khoản.
- Sau khi xác thá»±c thà nh cÃŽng ta sẜ Äược chuyá»n hÆ°á»ng vá» trang `/home`.
#h3("TÃnh nÄng giá» hà ng")
TÃnh nÄng giá» hà ng của website yêu cầu khách hà ng phải ÄÄng nháºp Äá» sá» dụng. Dá»±a và o mÃŽ hình dữ liá»u Äược thiết kế á» mục 2.2.2 thì má»i khách hà ng sẜ có má»t giá» hà ng duy nhất.
Sau khi ÄÄng nháºp, khi khách hà ng nhấn nút "Add to cart" thì sản phẩm sẜ Äược thêm và o giá» hà ng của khách hà ng và Äược cáºp nháºt ngay láºp tức mà khÃŽng cần load lại trang. Viá»c khÃŽng load lại trang giúp cho trải nghiá»m mua sắm của khách hà ng Äược mượt mà trÆ¡n tru hÆ¡n.
#img("21image.png", cap: "Giao diá»n của nút thêm sản phẩm và o giá» hà ng")
Code giao diá»n của tÃnh nÄng thêm sản phẩm và o giá» hà ng:
```html
<button wire:loading.attr="disabled" wire:target="addToCart" wire:click="addToCart"
class="mt-8 w-full bg-indigo-600 border border-transparent rounded-md py-3 px-8 flex items-center justify-center text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<x-loading-spin class="mt-2" wire:loading wire:target="addToCart" />
Add to cart
</button>
```
Code xá» lÃœ của tÃnh nÄng thêm sản phẩm và o giá» hà ng:
```php
public function addToCart($quantity = 1) {
try {
$user = Auth::user();
if (!$user->id)
throw new Exception('You must be logged in to add to cart.', 1);
// check quantity
if ($quantity < 1)
throw new Exception('Quantity must be greater than 0.', 1);
// check product exists
$product = Product::find($this->productId);
if (is_null($product))
throw new Exception('Product not found.', 1);
// add to cart
$cartItem = CartItem::where('user_id', $user->id)
->where('product_id', $product->id)->first();
if (is_null($cartItem)) {
CartItem::create([
'product_id' => $product->id,
'quantity' => $quantity,
'user_id' => $user->id,
]);
} else {
$cartItem->quantity = $cartItem->quantity + $quantity;
$cartItem->save();
}
// response
$this->alert('success', 'Product added successfully');
$this->emit("cart-update");
} catch (Exception $e) {
$this->alert(
'error',
$e->getCode() ? $e->getMessage() : "Error updating quantity."
);
}
}
```
#h3("TÃnh nÄng thanh toán")
Website có 3 phÆ°Æ¡ng thức thanh toán chÃnh: Thanh toán qua Zalopay, Paypal và thanh toán Cash On Delivery (COD).
#img("22image.png", cap: "Giao diá»n chá»n phÆ°Æ¡ng thức thanh toán trong website", width: 80%)
ThÃŽng tin ngÆ°á»i dùng cần nháºp khi thanh toán bao gá»m: email ngÆ°á»i nháºn, tên ngÆ°á»i nháºn, sá» Äiá»n thoại ngÆ°á»i nháºn và Äá»a chá».
Code kiá»m tra thÃŽng tin ngÆ°á»i dùng nháºp và o ÄÆ¡n hà ng, nếu thÃŽng tin Äúng format và chÃnh xác thì sẜ tạo ÄÆ¡n hà ng:
```php
protected $rules = [
'name' => 'required',
'email' => 'required|email',
'country' => 'required',
'city' => 'required',
'state' => 'required',
'street' => 'required',
'postalCode' => 'required|postal_code',
'phone' => 'required|vn_phone_number',
'paymentMethodId' => 'required',
'cart' => 'required|array|min:1',
];
// ...
public function createOrder() {
$this->validate();
try {
$user = $this->getUser();
// custom validate
if (is_null(PaymentMethod::where('id', $this->paymentMethodId)
->where('enable', true)->first()))
throw new Exception('Payment method does not exist.', 1);
$count = $user->cartItems()
->whereIn('id', array_map(fn ($item) => $item['id'], $this->cart))->count();
if ($count != count($this->cart))
throw new Exception('Cart items are wrong.', 1);
$productIds = array_map(fn ($item) => $item['product_id'], $this->cart);
$count = Product::whereIn('id', $productIds)->count();
if ($count != count($productIds))
throw new Exception('Cart items are wrong.', 1);
foreach ($this->cart as &$item)
if ($item['user_id'] != $user->id || $item['quantity'] < 1)
throw new Exception('Cart items are wrong.', 1);
DB::beginTransaction();
$addressId = Address::insertGetId([
'country' => $this->country,
'city' => $this->city,
'state' => $this->state,
'street' => $this->street,
'zip_code' => $this->postalCode,
]);
$orderId = Order::insertGetId([
'user_id' => $user->id,
'address_id' => $addressId,
'name' => $this->name,
'email' => $this->email,
'phone' => $this->phone,
'total' => $this->total(),
'payment_method_id' => $this->paymentMethodId,
'status' => OrderStatus::UNPAID,
]);
OrderItem::insert(
array_map(function ($v) use ($orderId) {
return [
'order_id' => $orderId,
'product_id' => $v['product']['id'],
'quantity' => $v['quantity'],
'price' => $v['product']['price'],
];
}, $this->cart)
);
$user->cartItems()->delete();
DB::commit();
return redirect()->route('order.pay', ['order' => $orderId]);
} catch (Exception $e) {
DB::rollBack();
return $this->handleException($e);
}
}
```
Code xỠlÜ thanh toán:
```php
public function pay(Request $request, Order $order)
{
$order->with('paymentMethod');
// cod
if ($order->paymentMethod->code === 'cod')
return redirect()->route('order.show', $order->id);
// process payment
$paymentGateway = null;
switch ($order->paymentMethod->code) {
case 'zalopay':
$paymentGateway = new Zalopay();
break;
case 'paypal':
$paymentGateway = new Paypal();
break;
}
return $paymentGateway->pay($order);
}
```
#h3("TÃnh nÄng quản lÃœ ÄÆ¡n hà ng")
Má»i ngÆ°á»i dùng chá» quản lÃœ ÄÆ¡n hà ng của mình.
Quản trá» viên có thá» xem tất cả ÄÆ¡n hà ng.
Code xá» lÃœ lấy dữ liá»u ÄÆ¡n hà ng của ngÆ°á»i dùng:
```php
public function show(Order $order)
{
$order->with('paymentMethod', 'address', 'orderItems.product');
return view('orders.show', ['order' => $order]);
}
```
// #h3("Äảm bảo an toà n và bảo máºt cho website")
// #h3("Triá»n khai website TMÄT")
// #h2("Kiá»m thá» và nâng cao chất lượng sản phẩm")
// #h3("Kiá»m thá» chức nÄng")
// #h3("Kiá»m thá» hiá»u suất và tải trang")
// #h3("Kiá»m thá» bảo máºt")
// #h3("Nâng cao chất lượng sản phẩm")
// #h2("Quản lÃœ và váºn hà nh website")
// #h3("Quản lÃœ ná»i dung website")
// #h3("Quản lÜ danh mục sản phẩm và kho hà ng")
// #h3("Quản lÃœ ÄÆ¡n hà ng và thanh toán")
// #h3("Quản lÃœ khách hà ng và dá»ch vụ há» trợ")
// #h2("Äảm bảo an toà n và bảo máºt cho website")
// #h3("Sá» dụng HTTPS Äá» bảo máºt kết ná»i")
// #h3("Xác thá»±c ngÆ°á»i dùng và quản lÃœ phiên là m viá»c")
// #h3("Kiá»m tra dữ liá»u Äầu và o và Äầu ra")
// #h3("Ãp dụng các giải pháp bảo máºt nhÆ° CAPTCHA, ReCaptcha")
// #h3("Theo dõi và giám sát há» thá»ng thÆ°á»ng xuyên")
#h2("Kết chương")
Qua chÆ°Æ¡ng 3 tác giả Äã trình bà y các bÆ°á»c triá»n khai xây dá»±ng các tÃnh nÄng chÃnh trong má»t website TMÄT dá»±a và o các khảo sát phân tÃch và những thiết kế mÃŽ hình Äược thá»±c hiá»n á» ChÆ°Æ¡ng 1 và ChÆ°Æ¡ng 2.
#h1("Kết luáºn chung", numbering: false)
ThÆ°Æ¡ng mại Äiá»n tá» má» ra cÆ¡ há»i kinh doanh trá»±c tuyến trên toà n cầu. Khách hà ng có thá» truy cáºp và mua hà ng từ bất kỳ Äâu và bất kỳ khi nà o, giúp má» rá»ng phạm vi tiếp cáºn khách hà ng và tÄng doanh thu. Doanh nghiá»p ngà y nay cần cạnh tranh trên khÃŽng gian trá»±c tuyến Äá» tá»n tại và phát triá»n. Website thÆ°Æ¡ng mại Äiá»n tá» cho phép doanh nghiá»p tiếp cáºn Äược khách hà ng tiá»m nÄng và cung cấp thÃŽng tin sản phẩm, dá»ch vụ, Äánh giá, và khuyến mãi Äá» thu hút và giữ chân khách hà ng cÅ©ng nhÆ° má» rá»ng khả nÄng tiếp cáºn thá» trÆ°á»ng, giúp doanh nghiá»p tÄng doanh sá» bán hà ng và khách hà ng. Do Äó viá»c xây dá»±ng website thÆ°Æ¡ng mại Äiá»n tá» là má»t cÃŽng viá»c có tÃnh cấp thiết cao trong thá»i Äại sá» hóa ngà y nay. Äá» tà i nà y Äã giúp tác giả nháºn thức rõ hÆ¡n vá» tÃnh cấp thiết Äó và tạo Äá»ng lá»±c Äá» tiếp tục nghiên cứu và phát triá»n trong lÄ©nh vá»±c nà y.
Qua quá trình thá»±c hiá»n Äá» tà i nghiên cứu nà y, ÄỠán Äã Äạt Äược má»t sá» mục tiêu mong muá»n. Tác giả Äã tiến hà nh phân tÃch, khảo sát và xây dá»±ng và hoà n thiá»n phần lá»n Äá» tà i, bao gá»m xác Äá»nh các yêu cầu chức nÄng và yêu cầu an toà n, thá»±c hiá»n viá»c phân tÃch thiết kế các yêu cầu bằng các biá»u Äá» phân rã chức nÄng, biá»u Äá» use-case, mÃŽ hình quan há» và lÆ°u trữ dữ liá»u,... cho Äến viá»c triá»n khai các chức nÄng quan trá»ng của website TMÄT nhÆ° tÃnh nÄng ÄÄng nháºp/ÄÄng kÃœ, giá» hà ng và thanh toán. Tạo ná»n tảng cho viá»c phát triá»n website TMÄT trong thá»±c tế.
Tuy nhiên, do thá»i gian nghiên cứu, kiến thức và tìm hiá»u còn hạn chế do Äó ÄỠán còn má»t sá» thiếu sót. Tác giả nháºn thức Äược rằng Äá» tà i nà y Äòi há»i sá»± hiá»u biết và kỹ nÄng rá»ng hÆ¡n Äá» Äạt Äược má»t há» thá»ng hoà n thiá»n.
Trong tÆ°Æ¡ng lai, tác giả sẜ tiếp tục nghiên cứu, tìm hiá»u và nâng cấp há» thá»ng Äá» hoà n thiá»n và Äáp ứng Äược yêu cầu sá» dụng trong thá»±c tế. Tác giả rất mong nháºn Äược Ãœ kiến Äóng góp quÃœ báu từ thầy cÃŽ Äá» ÄỠán có thá» phát triá»n và hoà n thiá»n hÆ¡n nữa.
Äá» phát triá»n và nâng cao chất lượng há» thá»ng, tác giả sẜ tiếp tục nghiên cứu, tìm hiá»u và áp dụng các cÃŽng nghá» má»i, cÅ©ng nhÆ° thá»±c hiá»n các bÆ°á»c nâng cấp và tá»i Æ°u hóa há» thá»ng hiá»n tại.
|
|
https://github.com/dead-summer/math-notes | https://raw.githubusercontent.com/dead-summer/math-notes/main/notes/ScientificComputing/ch1-intro-to-scicomp/intro-to-scicomp.typ | typst | #import "/book.typ": book-page
#show: book-page.with(title: "Introduction to Scientific Computing")
Scientific computing uses computers to solve scientific problems. It is the third tool with which the human understands the world. The first two are physical experiments and theoretical analysis. The fourth one is artificial intelligence (AI). |
|
https://github.com/saYmd-moe/note-for-statistical-mechanics | https://raw.githubusercontent.com/saYmd-moe/note-for-statistical-mechanics/main/contents/PartI/Chp03.typ | typst | #import "../../template.typ": *
== åå
ç³»ççžå
=== çåšå¹³è¡¡
==== çåšå¹³è¡¡å€æ®
+ *çµå€æ®ïŒ* $dif S = 1\/T dif U + p\/T dif V quad (U,V)$ çèœç容äžïŒå¯¹äºåç§å¯èœçååšæ¥è¯ŽïŒå¹³è¡¡æççµäžºæ倧ãææ°åŠè¡šè¿°ïŒ$
cases(
display(delta S = 0 quad #[平衡çå¿
èŠæ¡ä»¶]),
display(delta^2 S < 0 quad #[平衡皳å®æ¡ä»¶]),
display(delta U =0\, delta V = 0\, delta N = 0 quad #[éå¶æ¡ä»¶])
)
$
+ *èªç±èœå€æ®ïŒ* $dif F = -S dif T - p dif V quad (T,V)$ çæž©ç容äžïŒç³»ç»èŸŸå°å¹³è¡¡ææ¶èªç±èœåæå°åŒïŒ$
cases(
display(delta F = 0),
display(delta^2 F > 0),
display(delta T =0\, delta V = 0\, delta N = 0)
)
$
+ *ååžæ¯åœæ°å€æ®ïŒ* $dif G = - S dif T + V dif p quad(S,p)$ çæž©çåäžïŒç³»ç»èŸŸå°å¹³è¡¡ææ¶ååžæ¯åœæ°åæå°åŒïŒ$
cases(
display(delta G = 0),
display(delta^2 G > 0),
display(delta T =0\, delta p = 0\, delta N = 0)
)
$
+ *å
èœå€æ®ïŒ* $dif U = T dif S - p dif V (S,V)$ ççµç容äžïŒç³»ç»èŸŸå°å¹³è¡¡ææ¶å
èœåæå°åŒïŒ$
cases(
display(delta U = 0),
display(delta^2 U > 0),
display(delta S =0\, delta V = 0\, delta N = 0)
)
$
+ *çå€æ®ïŒ* $dif H = T dif S + V dif p (S,p)$ ççµçåäžïŒç³»ç»èŸŸå°å¹³è¡¡ææ¶çåæå°åŒïŒ$
cases(
display(delta H = 0),
display(delta^2 H > 0),
display(delta S =0\, delta p = 0\, delta N = 0)
)
$
==== åŒç³»ïŒç²åæ°å¯åç³»ç»ïŒ
åŒç³»æ¯æ*å¯ä»¥äžå€çåçèœéåç©èŽšäº€æ¢çç³»ç»*ïŒèèåªæäžç§ç²åïŒåå
ç³»ïŒïŒæçååŠåºæ¬åŸ®åæ¹çšïŒ$
dif U = T dif S - p dif V + mu dif N
$å
¶äž $mu$ 䞺*ååŠå¿*ïŒå®ä¹äžº $1 op("mol")$ çååžæ¯åœæ°ïŒ$
mu = G/N = u - T s + p v
$å
¶äžïŒ$
cases(
display(U &= N u),
display(S &= N s),
display(V &= N v)
)
$类䌌çïŒå¯ä»¥ååºå
¶ä»çååŠåºæ¬æ¹çš(å
¶äžæå·šå¿ $Psi equiv U - T S - mu N$)ïŒ$
cases(
display(dif U &= T dif S - p dif V + mu dif N\, quad &(S,V,N)),
display(dif H &= T dif S + V dif p + mu dif N\, quad &(S,p,N)),
display(dif F &= -S dif T- p dif V + mu dif N\, quad &(T,V,N)),
display(dif G &= -S dif T+ V dif p + mu dif N\, quad &(T,p,N)),
display(dif Psi&=-S dif T- p dif V - N dif mu\, quad &(T,V,mu))
)
$
==== çåšå¹³è¡¡æ¡ä»¶
çåšå¹³è¡¡å䞺åç§ïŒ
- *ç平衡æ¡ä»¶ïŒ* äžåççéäº€æ¢ $(T,S)$
- *ååŠå¹³è¡¡æ¡ä»¶ïŒ* äžåçå®è§äœç§» $(p,V)$
- *çžå平衡æ¡ä»¶ïŒ* åçžä¹éŽäžåçç©èŽšèœ¬ç§»ïŒäžåççžåïŒ $(mu,N)$
- *ååŠå¹³è¡¡æ¡ä»¶ïŒ* ååŠååºäžåè¿è¡
以ååžæ¯åœæ°å€æ®äžºäŸïŒèèäžäžªæ¥æ $A,B$ 䞀䞪åç³»ç»çç³»ç»ïŒå¯¹ç³»ç»æœå äžäžªåŸ®æ°ïŒæ ¹æ®ååžæ¯åœæ°å€æ®çéå¶æ¡ä»¶ïŒæïŒ$
delta T = delta T_A + delta T_B = 0 &arrow.double.long delta T_A = -delta T_B \
delta p = delta p_A + delta p_B = 0 &arrow.double.long delta p_A = -delta p_B \
delta N = delta N_A + delta N_B = 0 &arrow.double.long delta N_A = -delta N_B \
$åæ ¹æ®ååžæ¯åœæ°å€æ®çå¿
èŠæ¡ä»¶ïŒæïŒ$
delta G &= delta G_A + delta G_B \
&= (- S_A delta T_A + V_A delta p_A + mu_A delta N_A) + (- S_B delta T_B + V_B delta p_B + mu_B delta N_B)\
&= (S_A - S_B) delta T_B - (V_A - V_B) delta p_B - (mu_A - mu_B) delta N_B \
&= 0
$ç±äºèååš $delta T_B, delta p_B$ å¯ä»¥ç¬ç«ååšïŒæ以æ平衡æ¡ä»¶ïŒ$
S_A = S_B, quad V_A = V_B, quad mu_A = mu_B
$äžè¿°äžäžªæ¡ä»¶åå«äžºç平衡ãå平衡åçžå¹³è¡¡æ¡ä»¶ïŒå
¶ä»å€æ®æšå¯Œè¿çšåçã
åŠå€ïŒåŠææ¯ç²åæ°äžå®æçç³»ç»ïŒåæïŒ$
delta G = (S_A - S_B) delta T_B - (V_A - V_B) delta p_B + mu_A delta N_A + mu_B delta N_B = 0 \
S_A = S_B, quad V_A = V_B, quad mu_A = mu_B = 0
$
#note[
#h(2em)ç³»ç»ç平衡ç±åŒºåºŠé (äžèŽšéæ å
³çå¯åºŠéïŒå³ $V\/N, S\/N$ ç) å³å®ïŒäžå¹¿å»¶éæ å
³ã
]
==== çåšå¹³è¡¡çš³å®æ¡ä»¶
以ååžæ¯åœæ°äžºäŸïŒ$
Delta G &= delta G + 1/2 delta^2 G + dots.c \
&= [(diff/(diff T))_p delta T + (diff/(diff p))_T delta p] G \
&+ 1/2 [(diff/(diff T))_p delta T + (diff/(diff p))_T delta p]^2 G + dots.c
$èèæå€äžªåç³»ç»ïŒ$
G = sum_s G_s
$æååžæ¯å€æ®å¹³è¡¡çš³å®æ¡ä»¶ $delta^2 G > 0$ïŒ$
delta^2 G &= sum_s [(diff/(diff T_s))_p_s delta T_s + (diff/(diff p_s))_T_s delta p_s]^2 G_s \
&= sum_s [(diff^2/(diff T_s^2))_p_s delta T_s^2 + #text(rgb(150, 90, 170))[$2 (diff^2)/(diff T_s diff p_s) delta T_s delta p_s$] + (diff^2/(diff p_s^2))_T_s delta p_s^2] G_s \
&= sum_s [(- (diff S_s)/(diff T_s) delta T_s^2 #text(rgb(150, 90, 170))[$- (diff S_s)/(diff p_s) delta T_s delta p_s$]) + (#text(rgb(150, 90, 170))[$(diff V)/(diff T_s) delta T_s delta p_s$] + (diff V)/(diff p_s) delta p_s^2)]
$è¿éæ们æïŒ$
cases(
display(delta S_s = (diff S_s)/(diff T_s)delta T_s + #text(rgb(0, 180, 255))[$(diff S_s)/(diff p_s)$]delta p_s = (diff S_s)/(diff T_s)delta T_s #text(rgb(0, 180, 255))[$- (diff V_s)/(diff T_s)$] delta p_s),
display(delta V_s = #text(rgb(150, 90, 170))[$(diff V_s)/(diff T_s)$]delta T_s + (diff V_s)/(diff p_s)delta p_s = #text(rgb(150, 90, 170))[$-(diff S_s)/(diff p_s)$]delta T_s + (diff V_s)/(diff p_s)delta p_s)
) arrow.double.long cases(
display((diff S_s)/(diff T_s)delta T_s = delta S_s + (diff V_s)/(diff T_s)delta p_s),
display((diff V_s)/(diff p_s)delta p_s = delta V_s + (diff S_s)/(diff p_s)delta T_s)
)
$代åäžåŒïŒåŸïŒ$
delta^2 G &= sum_s [- (#text(rgb(150, 90, 170))[$(diff S_s)/(diff T_s) delta T_s^2$] + (diff S_s)/(diff p_s) delta T_s delta p_s) + ( (diff V)/(diff T_s) delta T_s delta p_s + #text(rgb(0, 180, 255))[$(diff V)/(diff p_s) delta p_s^2$])]\
&= sum_s [-(#text(rgb(150, 90, 170))[$delta S_s delta T_s + (delta V_s)/(delta T_s) delta T_s delta p_s$] + (diff S_s)/(diff p_s) delta T_s delta p_s) \
&+ ((diff V)/(diff T_s) delta T_s delta p_s + #text(rgb(0, 180, 255))[$(diff S_s)/(diff p_s) delta T_s delta p_s + delta V_s delta p_s$])] \
&= sum_s (- delta T_s delta S_s + delta p_s delta V_s)
$泚æå° $S_s = n_s s_s, V_s = n_s v_s$ïŒ$
delta^2 G = sum_s n_s (-delta T_s delta s_s + delta p_s delta v_s) > 0 \
arrow.double.long - delta T delta s + delta p_s delta v_s > 0
$å
¶ä»å€æ®åçã
=== åå
å€çžç³»å¹³è¡¡
==== _Le Chatelier_ åç
#highlight[*åœå€äºå¹³è¡¡æçç³»ç»åå°å€çæ°åšåïŒç³»ç»äŒåæµæ¶è¿äžæ°åšçæ¹å蜬移ã*]äžåæšå¯Œè¿çšäœ¿çšçµå€æ®ïŒæåºæ¬åŸ®åæ¹çšïŒ$
dif S = 1/T dif U + 1/T p dif V - 1/T mu dif n\
dif U_A = - dif U_B, quad dif V_A = - dif V_B, quad dif n_A = - dif n_B
$
+ *ç平衡被æç Ž $T_A eq.not T_B$ïŒ*å讟æ $dif V_A = 0, dif n_A = 0$ åæ$
dif S = (1/T_A - 1/T_B) dif U_A
$ç±çµå¢åç $dif S > 0$ïŒå$
T_A > T_B arrow.double.long dif U_A < 0
$*èœéä»é«æž©ç©äœèœ¬åäœæž©ç©äœ*ã
+ *å平衡被æç Ž $p_A eq.not p_B$ïŒ*å讟æ $T_A = T_B = T, dif N_A = 0$ åæ$
dif S = 1/T (p_A - p_B) dif V_A
$åæ ·ç±çµå¢åç $dif S > 0$ïŒ$
p_A > p_B arrow.double.long dif V_A > 0
$*å区é«çéšåäœç§¯èšè*ã
+ *çžå¹³è¡¡è¢«æç Ž $mu_A eq.not mu_B$ïŒ*å讟æ $T_A = T_B = T, p_A = p_B = p$ åæ$
dif S = - 1/T (mu_A - mu_B) dif n_A
$çµå¢åç $dif S > 0$ïŒ$
mu_A > mu_B arrow.double.long dif n_A < 0
$*ååŠå¿é«ççžåååŠå¿äœççžèœ¬å*ã
==== åå
å€çžç³»çžåŸ
å讟åå
ç³»æ䞀䞪çžåæ¶ååšå¹¶èŸŸå°å¹³è¡¡ïŒåå¯ä»¥ç¡®å®äžæ¡*çžåæ²çº¿*ïŒ$
mu^alpha (T,p) = mu^beta (T,p)
$åŠææäžçžååšå¹¶èŸŸå°å¹³è¡¡ïŒåå¯ä»¥ç¡®å®äžäžª*äžçžç¹*ïŒ$
mu^alpha (T,p) = mu^beta (T,p) = mu^gamma (T,p)
$
#grid(
columns: 2,
gutter: 5pt,
box(width: 100%)[
åçäžçº§çžåæ¶äœç§¯åçµäŒåççªåïŒæ ¹æ®çªåæ¥å®ä¹çžåæœçïŒ$
L equiv T(s_beta - s_alpha) = h_beta - h_alpha
$å¯ä»¥åŸå°æè¿°çžåæ²çº¿æçç_ClausiusâClapeyron_æ¹çšïŒ$
(dif p)/(dif T) = (s_beta - s_alpha)/(v_beta - v_alpha) = L/(T(v_beta - v_alpha))
$_ClausiusâClapeyron_æ¹çšåªéçšäºäžçº§çžåïŒäœç§¯ãçµååççªåïŒã
],
figure(
caption: [äžçžåŸ],
image("../../assets/figures/p-T-states-image.png")
)
)
#h(2em)äžåèçžïŒåºçžå液çžïŒèŸŸå°å¹³è¡¡çèžæ±œç§°äžº*饱åèžæ±œ*ã饱åèžæ±œçå区å枩床ä¹éŽçå
³ç³»è¢«ç§°äžº*èžæ±œåæ¹çš*ïŒ$
(dif p)/(dif T) = L/(T (v-v'))
$ç°åšå䞀ç¹å讟ïŒ
+ åèçžäœç§¯çžæ¯äºèžæ±œçžå¯å¿œç¥ $v' lt.double v$
+ èžæ±œçžå¯çäœçæ³æ°äœ
äºæ¯æïŒ$
dif p = (L)/(T v) dif T \
ln p = -L_0/(R T) + integral (dif T)/(R T^2) integral (c_p - c'_p) dif T + A \
ln p = A - B/T + C ln T
$计ç®è¿çšæ¯å°çžåæœç $L = L(T)$ çäœ $T$ çåœæ°ïŒçç¥è¿çšïŒåŠå€ç»åºçžåæœç $L$ çäœåžžæ°æ¶çèžæ±œåæ¹çšïŒ$
ln p = - L/(R T) + A
$
==== _Maxwell_ çé¢ç§¯æ³å
#text(red)[\#TODO]è執çŠå°æ¯æ°äœç枩线çè®ºåš $T lt.eq T_c$ æ¶åºç°åå·®ïŒ_Maxwell_éè¿_Maxwell_çé¢ç§¯æ³åè¿è¡äºä¿®æ£ïŒåè第äžç« äœäž äºã5.ïŒ
==== çžåçåç±»äž_Ehrenfest_æ¹çš
- *äžçº§çžåïŒåšçžåç¹ïŒäž€çžçååŠå¿çžçïŒäœååŠå¿çäžçº§å埮åååšçªåïŒäŸåŠäžè¬ç©èŽšçæ°-液-åºçžåïŒå€ç£åºäžçè¶
富çžåçïŒïŒ*$
Delta mu = 0, quad Delta s = (diff mu)/(diff T) eq.not 0, quad Delta v = (diff mu)/(diff p) eq.not 0
$
- *äºçº§çžåïŒåšçžåç¹ïŒäž€çžçååŠå¿åååŠå¿çäžçº§å埮ååçžçïŒäœååŠåŒçäºçº§å埮ååççªåïŒäŸåŠæ²¡æå€ç£åºçè¶
富çžåïŒå€§éšåç£çžåçïŒïŒ*$
Delta mu = 0, quad Delta s eq 0, quad Delta v eq 0 \
Delta c_p = (diff^2 mu)/(diff T^2) eq.not 0, quad Delta alpha = (diff^2 mu)/(diff T diff p) eq.not 0, quad Delta kappa_T = (diff^2 mu)/(diff p^2) eq.not 0
$
- *æ®éçïŒ$n$ 级çžåæ¯æåšçžåç¹ïŒ $mu$ å° $mu$ ç $(n-1)$ 级å埮åè¿ç»ïŒäœ $n$ 级å埮ååççªåã*
- ä¹ æ¯äžæ*äºçº§ä»¥äžçé«çº§çžå*称äœ*è¿ç»çžå*æ*䞎ççžå*ãå®é
äžïŒåçè¿ç±»çžåæ¶ïŒå 䞺没ææœçåçåäœç§¯çååïŒæ以系ç»çå®è§ç¶æäžåçä»»äœçªåïŒèæ¯è¿ç»ååçãå æ€æ称䞺è¿ç»çžåã
- è¿ç»çžåçç¹åŸæ¯ïŒæ²¡æ䞀çžå
±åïŒä¹äžååšè¿å·åè¿ççäºçš³æãç³»ç»åçæ€ç±»çžåæ¶ïŒç³»ç»ç对称æ§åççªåïŒç§°ä¹äžº*å¯¹ç§°ç ŽçŒº*ã
#h(2em)对_ClausiusâClapeyron_æ¹çšäœ¿çšæŽå¿
蟟æ³åïŒåŸå°äºçº§çžåäžç_Ehrenfest_æ¹çšïŒ$
(dif p)/(dif T) = (Delta s)/(Delta v) = (diff Delta s \/ diff T)/(diff Delta v \/ diff T) = (Delta c_p \/ T)/(v Delta alpha) = (Delta c_p)/(T v Delta alpha) = (Delta alpha)/(Delta kappa_T)
$å
¶äžæå
³ç³»åŒïŒ$
(Delta alpha)/(Delta kappa_T) = (Delta c_p)/(T v Delta alpha)
$ |
|
https://github.com/Ngan-Ngoc-Dang-Nguyen/thesis | https://raw.githubusercontent.com/Ngan-Ngoc-Dang-Nguyen/thesis/main/theorems.typ | typst | // Store theorem environment numbering
#let thmcounters = state("thm",
(
"counters": ("heading": ()),
"latest": ()
)
)
#let thmenv(identifier, base, base_level, fmt) = {
let global_numbering = numbering
return (
body,
name: none,
numbering: "1.1",
base: base,
base_level: base_level
) => {
let number = none
if not numbering == none {
locate(loc => {
thmcounters.update(thmpair => {
let counters = thmpair.at("counters")
// Manually update heading counter
counters.at("heading") = counter(heading).at(loc)
if not identifier in counters.keys() {
counters.insert(identifier, (0, ))
}
let tc = counters.at(identifier)
if base != none {
let bc = counters.at(base)
// Pad or chop the base count
if base_level != none {
if bc.len() < base_level {
bc = bc + (0,) * (base_level - bc.len())
} else if bc.len() > base_level{
bc = bc.slice(0, base_level)
}
}
// Reset counter if the base counter has updated
if tc.slice(0, -1) == bc {
counters.at(identifier) = (..bc, tc.last() + 1)
} else {
counters.at(identifier) = (..bc, 1)
}
} else {
// If we have no base counter, just count one level
counters.at(identifier) = (tc.last() + 1,)
let latest = counters.at(identifier)
}
let latest = counters.at(identifier)
return (
"counters": counters,
"latest": latest
)
})
})
number = thmcounters.display(x => {
return global_numbering(numbering, ..x.at("latest"))
})
}
fmt(name, number, body)
}
}
#let thmref(
label,
fmt: auto,
makelink: true,
..body
) = {
if fmt == auto {
fmt = (nums, body) => {
if body.pos().len() > 0 {
body = body.pos().join(" ")
return [#body #numbering("1.1", ..nums)]
}
return numbering("1.1", ..nums)
}
}
locate(loc => {
let elements = query(label, loc)
let locationreps = elements.map(x => repr(x.location().position())).join(", ")
assert(elements.len() > 0, message: "label <" + str(label) + "> does not exist in the document: referenced at " + repr(loc.position()))
assert(elements.len() == 1, message: "label <" + str(label) + "> occurs multiple times in the document: found at " + locationreps)
let target = elements.first().location()
let number = thmcounters.at(target).at("latest")
if makelink {
return link(target, fmt(number, body))
}
return fmt(number, body)
})
}
#let thmbox(
identifier,
head,
fill: none,
stroke: none,
inset: 1.2em,
radius: 0.3em,
breakable: false,
padding: (top: 0.5em, bottom: 0.5em),
namefmt: x => [(#x)],
titlefmt: strong,
bodyfmt: x => x,
separator: [#h(0.1em):#h(0.2em)],
base: "heading",
base_level: none,
) = {
let boxfmt(name, number, body) = {
if not name == none {
name = [ #namefmt(name)]
} else {
name = []
}
let title = head
if not number == none {
title += " " + number
}
title = titlefmt(title)
body = bodyfmt(body)
pad(
..padding,
block(
fill: fill,
stroke: stroke,
inset: inset,
width: 100%,
radius: radius,
breakable: breakable,
[#title#name#separator#body]
)
)
}
return thmenv(identifier, base, base_level, boxfmt)
}
#let thmplain = thmbox.with(
padding: (top: 0em, bottom: 0em),
breakable: true,
inset: (top: 0em, left: 1.2em, right: 1.2em),
namefmt: name => emph([(#name)]),
titlefmt: emph,
)
|
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Differential.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: "Differential",
authors: (
"<NAME>",
),
date: "10 Août, 2024",
)
#set heading(numbering: "1.1.")
= Differential Equations
<differential-equations>
== Definition
<definition>
#link("SimpleOrdinaryDE.pdf")[Simple $dot(x) = lambda x$]
== Links
<links>
- #link("https://tutorial.math.lamar.edu/Classes/DE/DE.aspx")[Paulâs Online Notes]
- #link("https://www.youtube.com/playlist?list=PLMrJAkhIeNNTYaOnVI3QpH7jgULnAmvPA")[Steve Bruntonâs Playlist]
- #link("https://www.youtube.com/playlist?list=PLZHQObOWTQDNPOjrT6KVlfJuKtYTftqH6")[3Blue1Brownâs Playlist]
|
|
https://github.com/magic3007/cv-typst | https://raw.githubusercontent.com/magic3007/cv-typst/master/doc/bio.typ | typst | I am a third-year Ph.D. student in the Department of Computer Science at Peking University associated with the Center for Energy-Efficient Computing and Applications (CECA). I am a member of the #emph[PKU-IDEA Lab], advised by #emph[Prof. <NAME>]. Previously, I received the B.S. degree in Computer Science and Technology from Peking University in 2021. My focuses are machine learning-assisted EDA; my broader interests include MLSys, concurrency and probabilistic modeling.
I have authored nine scientific publications in the leading international journals and conferences, such as TCAD, DAC, ASP-DAC, etc.
|
|
https://github.com/ivaquero/book-control | https://raw.githubusercontent.com/ivaquero/book-control/main/images/intro-closed.typ | typst | #import "@local/cetz-control:0.1.0": *
// éç¯æ§å¶åš
#figure(
diagram(
spacing: (1.5em, 1.5em),
node-stroke: 1pt,
mark-scale: 80%,
let (R, T) = ((1, 0.5), (4, 0.5)),
let (O, H) = ((2, 2), (4, 2)),
let A = (5.5, 1.25),
rnode(R, $V(s)$),
onode(O, ""),
label((2, 2.65), ctext("误差衚")),
rnode(T, ctext("æ§å¶åš")),
rnode(H, ctext("äŒ æåš")),
rnode(A, ctext("讟å€")),
arredge(R, O, "", 0, left, 0pt),
arredge(O, T, ctext("èŸå
¥"), .7, right, 0pt),
arredge(T, A, ctext("èŸåº"), .25, right, 0pt),
arredge(A, H, "", 0, right, 0pt),
arredge(H, O, "", 0, none, 0pt),
),
caption: "éç¯æ§å¶åš",
supplement: "\nåŸ",
)
|
|
https://github.com/tingerrr/hydra | https://raw.githubusercontent.com/tingerrr/hydra/main/doc/chapters/1-intro.typ | typst | MIT License | Hydra is a package which aims to query and display section elements, such as headings, legal
paragraphs, documentation sections, and whatever else may semantically declare the start of a
document's section.
== Terminology & Semantics
The following terms are frequently used in the remainider of this document.
/ primary: The element which is primarily looked for and meant to be displayed.
/ ancestor: An element which is the immediate or transitive ancestor to the primary element.
A level 3 heading is ancestor to both level 2 (directly) and level 1 headings (transitively).
/ scope: The scope of a primary element refers to the section of a document which is between the
closest ancestors.
/ active: The active element refers to whatever element is considered for display. While this is
usually the previous primary element, it may sometimes be the next primary element.
/ leading page: A leading page in a book is that, which is further along the content of the two
visible pages at any time, this is the `end` alignement with respect to the document readin
direction.
/ trailing page: A trailing page is that, which is not the leading page in a book.
The search for a primary element is always bounded to it's scope. For the following simplified
document:
```typst
= Chapter 1
== Section 1.1
= Chapter 2
=== Subsection 2.0.1
#hydra(2)
```
```txt
Chapter 1
â Section 1.1
Chapter 2
â <none>
â Subsection 2.0.1
```
hydra will only search within it's current chapter as it is looking for active sections. In this
case hydra would not find a suitable candidate. For this the ancestors of an element must be known.
For headings this is simple:
#align(center, (
`<none>`,
`level: 1`,
`level: 2`,
`level: 3`,
`...`,
).join([ #sym.arrow ]))
If hydra is used to query for level 2 headings it will only do so within the bounds of the closest
level 1 headings. In principle, elements other than headings can be used (see @custom), as long as
their semantic relationships are established.
|
https://github.com/tweaselORG/ReportHAR | https://raw.githubusercontent.com/tweaselORG/ReportHAR/main/templates/en/report.typ | typst | MIT License | #import "style.typ": tweaselStyle
#show: tweaselStyle
#text(weight: 700, 1.75em)[Technical report: Analysis of {{ analysis.app.platform }} app "{{ analysis.app.name }}" ({{ analysis.app.version }})]
= Introduction
This report details the findings and methodology of an automated analysis concerning tracking and similar data transmissions performed on the {{ analysis.app.platform }} app "{{ analysis.app.name }}"{% if analysis.app.url %}#footnote[{{ analysis.app.url | safe }}]{% endif %} (app ID: {{ analysis.app.id | code }}, hereinafter: "the app") through the Tweasel project, operated by Datenanfragen.de e.~V.
= Findings
During the analysis, the network traffic initiated by the app was recorded. In total, {{ harEntries.length }} requests were recorded between {{ harEntries[0].startTime | dateFormat }} and {{ harEntries[harEntries.length - 1].startTime | dateFormat }}. The recorded traffic is attached as a HAR file{% if analysis.harMd5 %} (MD5 checksum of the HAR file: {{ analysis.harMd5 | code }}){% endif %}, a standard format used by HTTP(S) monitoring tools to export collected data.#footnote[#link("http://www.softwareishard.com/blog/har-12-spec/")] HAR files can be viewed using Firefox or Chrome, for example.#footnote[https://docs.tweasel.org/background/har-tutorial/] The contents of the recorded traffic are also reproduced in @har2pdf[Appendix]
== Network traffic without any interaction
The requests described in this section happened *without any interaction* with the app or any potential consent dialogs.
In total, there were {{ trackHarResult.length }} requests detected that transmitted data to {{ findings | length }} tracker(s) without any interaction.
{% for adapterSlug, adapterResult in findings %}
=== {{ adapterResult.adapter.name }}
The app sent the following {{ adapterResult.requests.length }} request(s) to the tracker "{{ adapterResult.adapter.name }}", operated by "{{ adapterResult.adapter.tracker.name }}". For details on how the requests to this tracker were decoded and the reasoning for how the transmitted information was determined, see the documentation in the Tweasel Tracker Wiki#footnote[The documentation for "{{ adapterResult.adapter.name }}" is available at: #link("https://trackers.tweasel.org/t/{{ adapterSlug | safe }}")].
{% for request in adapterResult.requests %}
{% set harEntry = harEntries[request.harIndex] %}
==== {{ harEntry.request.method | code }} request to {{ harEntry.request.host | code }} ({{ harEntry.startTime | timeFormat }})
On {{ harEntry.startTime | dateFormat }}, the app sent a {{ harEntry.request.method | code }} request to {{ harEntry.request.host | code }}. This request is reproduced in @har2pdf-e{{ request.harIndex | safe }}[Appendix].
The following information was detected as being transmitted through this request:
{% for transmission in request.transmissions -%}
+ {{ t("properties", transmission.property) }} (transmitted as {{ transmission.path | code }} with the value {{ transmission.value | code }})
{% endfor %}
{% endfor %}
{% endfor %}
= Method
The analysis was performed on {{ analysis.date | dateFormat }} on version {{ analysis.app.version }} of the app{% if analysis.app.store %}, downloaded from the {{ analysis.app.store }}{% endif %}.
== Analysis environment
The traffic was collected on the following {% if analysis.deviceType === 'emulator' %}emulator{% else %}device{% endif %}:
#table(
columns: (auto, auto),
[*Operating system*], [{{ analysis.app.platform }} {{ analysis.platformVersion }}],
{% if analysis.platformBuildString %}[*Build string*], [{{ analysis.platformBuildString }}],{% endif %}
{% if analysis.deviceManufacturer %}[*Manufacturer*], [{{ analysis.deviceManufacturer }}],{% endif %}
{% if analysis.deviceModel %}[*Model*], [{{ analysis.deviceModel }}],{% endif %}
)
The analysis was performed using the following versions of the tools and libraries:
#table(
columns: (auto, auto),
[*Tool*], [*Version*],
{% for tool, version in analysis.dependencies -%}
[{{ tool | code }}], [{{ version }}],
{% endfor %}
)
== Analysis steps
To collect record and analyze the data, the Tweasel toolchain#footnote[An overview of the tools can be found here: #link("https://docs.tweasel.org")] was used.
The `appstraction`#footnote[#link("https://github.com/tweaselORG/appstraction")] library was used to control the device and set up the environment the app is running in. It allows to change and read out app settings, and install, remove and start apps. {% if analysis.app.platform === 'Android' -%}
It uses the Android Debug Bridge (`adb`)#footnote[#link("https://developer.android.com/tools/adb")] to control the device and read out information via the USB Debugging API built into Android. The device was rooted before the analysis was started and `adb` was used to open an elevated shell to manipulate system functions. Where Android does not provide an accessible API, `appstraction` uses the instrumentation toolkit Frida#footnote[#link("https://frida.re/")], which can hook into an app's functions while the process is running and access its execution context. `appstraction` contains scripts to hook into system functions, e.g. to set the content of the clipboard.
{% elif analysis.app.platform === 'iOS' -%}
To do so, it accesses iOS's `lockdownd` service via a USB connection and using the `pymobiledevice3`#footnote[#link("https://github.com/doronz88/pymobiledevice3/")] library. This is used i.a. to install apps and read out system information. The device was jailbroken and a SSH server was installed on the device to access more advanced functionality via a remote shell which also allows for root access to the device. Internal system and app APIs are used via the instrumentation toolkit Frida#footnote[#link("https://frida.re/")], which hooks into an app's functions while the process is running and accesses its execution context.
{%- endif %}
For the analysis, the app was started on the device and left running for 60 seconds. During this time, no input at all was provided to the device or app, meaning that no controls, buttons, inputs, etc. could have been clicked or otherwise interacted with. The app's traffic was recorded by the `cyanoacrylate`#footnote[#link("https://github.com/tweaselORG/cyanoacrylate")] library using the machine-in-the-middle (MITM) proxy `mitmproxy`#footnote[#link("https://mitmproxy.org/")]. {% if analysis.app.platform === 'Android' -%}
On the device, the traffic was routed to `mitmproxy` using a WireGuard#footnote[#link("https://www.wireguard.com/")] VPN tunnel, which was configured to only tunnel the traffic of the app under test. To decrypt TLS-encrypted traffic, the certificate authority generated by `mitmproxy` was placed and trusted on the device. Certificate pinning was bypassed using the HTTP Toolkit certificate unpinning script for Frida#footnote[#link("https://httptoolkit.com/blog/frida-certificate-pinning/")].
{% elif analysis.app.platform === 'iOS' -%}
On the device, traffic was routed to `mitmproxy` using the HTTP proxy built into iOS, set via the system settings. The proxy does not allow to discriminate traffic according to the originating app. To decrypt TLS-encrypted traffic, the certificate authority generated by `mitmproxy` was placed and trusted on the device. Certificate pinning was bypassed using SSL Kill Switch 2#footnote[#link("https://julioverne.github.io/description.html?id=com.julioverne.sslkillswitch2")].
{%- endif %}
The transmitted tracking data was identified using TrackHAR#footnote[#link("https://github.com/tweaselORG/TrackHAR")], which in principle supports both a traditional indicator matching and an adapter-based matching approach. Indicator matching identifies transmitted data by checking the recorded traffic for known character sequences. For this analysis however, only the adapters were used, which are schemas of how to decode and interpret specific requests for each contacted endpoint. These adapters are the result of previous research and the reasoing for why a data type is assigned to a value is documented with the adapter and given in this report. Adapter-based matching can only find data transmissions which have gone to already known endpoints and cannot find unexpected transmissions.
More technical details on the methods of the Tweasel toolchain and instructions on how to independently reproduce the results are available in the Tweasel documentation.#footnote(link("https://docs.tweasel.org/background/architechture"))
// Appendix
#pagebreak()
#counter(heading).update(0)
#set heading(numbering: (..nums) => "A" + nums.pos().map(str).join(".") + ".")
#text(weight: 700, 1.75em)[Appendix]
= Recorded traffic <har2pdf>
Below is a reproduction of the recorded network requests that are mentioned in the report as documented in the attached HAR file. Only requests are shown, all responses are omitted. Binary request content is represented as a hexdump. Request content longer than 4,096 bytes is truncated. The full recorded traffic with all requests and including responses and full request content can be seen the in attached HAR file.
#include "har.typ"
|
https://github.com/kiwiyou/algorithm-lecture | https://raw.githubusercontent.com/kiwiyou/algorithm-lecture/main/advanced/06-advanced-number-theory.typ | typst | #import "@preview/cetz:0.1.2"
#import "@preview/algorithmic:0.1.0"
#import "../slide.typ"
#show: slide.style
#show link: slide.link
#show footnote.entry: slide.footnote
#let algorithm(..args) = text(
font: ("linux libertine", "Pretendard"),
size: 17pt,
)[#algorithmic.algorithm(..args)]
#let func(body) = text(font: ("linux libertine", "Pretendard"))[#smallcaps[#body]]
#align(horizon + center)[
= ìê³ ëŠ¬ìŠ ì€êž ìžë¯žë
06: ê³ êž ì ìë¡
#text(size: 0.8em)[
ì°ìžëíêµ ì ì°ì #super[kiwiyou] \
2023.01.22.r1
]
]
#slide.slide[ë¶í ì ë³µì ìŽì©í ê±°ëì ê³±][
- $a^b$륌 ê³ì°íêž°
- $b = x_(1)2^0 + x_(2)2^1 + x_(3)2^2 + x_(4)2^3 + dots.c$
- $a^b = a^(x_(1)) times a^(2x_(2)) times a^(4x_(3)) times a^(8x_(4)) times dots.c$
- $cal(O)(log b)$ë²ì ê³±ì
ìŒë¡ 충ë¶
- ë§ì
ìë ìì© ê°ë¥
#pagebreak()
- ë¹íž ì°ì°ì ìŽì©
#algorithm({
import algorithmic: *
Function("Power", args: ($a$, $b$), {
Assign[$r$][$1$]
While(cond: $b > 0$, {
If(cond: $b "bitand" 1 = 1$, {
Assign[$r$][$r times a$]
})
Assign[$a$][$a times a$]
Assign[$b$][$"rshift"(b, 1)$]
})
Return[$r$]
})
})
#pagebreak()
- íë ¬ê³±ì ìŽì©í ì í ì íìì ê³ì°
$ a_(n+2) = 3a_(n+1) + 2a_(n) + 1 $
$ mat(3, 2, 1; 1, 0, 0; 0, 0, 1) mat(a_(n+1); a_(n); 1) = mat(a_(n+2); a_(n+1); 1) $
$ mat(3, 2, 1; 1, 0, 0; 0, 0, 1)^n mat(a_(2); a_(1); 1) = mat(a_(n+2); a_(n+1); 1) $
#pagebreak()
- íë ¬ê³±ì $cal(O)(k^3)$ ìê°ìŽ 걞늬ë¯ë¡ $cal(O)(k^3 log n)$
- ìížëŒìŒ ìê³ ëŠ¬ìŠ: íë ¬ê³±ì $cal(O)(k^2.8)$ ì ëì ê³ì° ê°ë¥
- í€íë§ì¬ë²: $cal(O)(k log k log n)$
#pagebreak()
- Functional Graph: ì§ì¶ì°šìê° 1ìž ê·žëí
- ìŽë€ ì ì $v$ìì ê·žëí륌 ë°ëŒ $k$ë² ìŽëí ìì¹ë¥Œ 구íìì€.
- $cal(O)(N log k)$
]
#slide.slide[몚ëë¬ ê³±ì
ìì][
- ì°ì° $circle.tiny$ì íë±ì $e$: $a circle.tiny e = e circle.tiny a = a$
- $a$ì ìì $a^(-1)$: $a circle.tiny a^(-1) = a^(-1) circle.tiny a = e$
- $a$ì ë² $N$ì ëí ê³±ì
ìì $a^(-1)$: $a times a^(-1) equiv 1 space (mod N)$
- $exists x in bb(Z): a times a^(-1) + N times x = 1$
#pagebreak()
- í륎ë§ì ìì 늬: $a^(p-1) equiv a space (mod p)$
- $a^(p-2) times a = a^(p-1) equiv 1 space (mod p)$
- $a^(-1) equiv a^(p-2) space (mod p)$
#pagebreak()
- íì¥ ì íŽëŠ¬ë ížì ë²
- $a x + b y = gcd(a, b)$륌 ë§ì¡±íë ë ì ì $x$, $y$
$
a times 1 + b times 0 = a space.en& a times 0 + b times 1 = b \
a times 0 + b times 1 = b space.en& a times 1 + b times (-q) = c && space dots.c space (a = b q + c) \
a times 1 + b times (-q) = c space.en& a times (-1) + b times (1 + q') = d && space dots.c space (b = c q' + d) \
dots.v \
a x + b y = gcd(a, b) space.en& a x' + b y' = 0
$
- ì íŽëŠ¬ë ížì ë²ê³Œ ê°ì $cal(O)(log max(a, b))$
] |
|
https://github.com/Wiper-R/resume | https://raw.githubusercontent.com/Wiper-R/resume/main/resume.typ | typst | #import "@preview/modern-cv:0.3.0": *
#let format-role(role) = [#emph([#strong(role)])]
#show: resume.with(
author: (
firstname: "Shivang",
lastname: "Rathore",
email: "<EMAIL>",
phone: "(+91) 9830794364",
github: "Wiper-R",
linkedin: "wiperr",
address: "Lalitpur, India (284403)",
positions: (
"Software Developer",
"Web Developer",
),
),
date: datetime.today().display(),
language: "en",
colored-headers: true,
)
= About Me
I am a passionate programmer with over 5 years of experience in Python and JavaScript development. Throughout my career, I have worked on numerous projects, a selection of which can be found on my #link("https://github.com/Wiper-R")[#text("GitHub profile", weight: "medium")]. Apart from software development, I also indulge in hobbyist game development.
= Experience
#resume-entry(
title: "Pokemon Discord Bot",
location: [#link("pokemonbot.com")],
description: [#format-role[Creator, Lead Developer]],
date: "2019-2022"
)
#resume-item[
- Developed a Discord bot using Python serving #strong[400k users] and #strong[130k servers].
- Initially utilized #strong([PostgreSQL]) for data storage, later migrated to #strong([MongoDB]) due to evolving data structures.
- Implemented #strong[clustering/sharding] for scalability.
- Utilized #strong[Redis] for efficient #strong[caching/queuing].
- Maintained the codebase in adherence to industry standards (proprietary).
]
#linebreak()
= Projects
#resume-entry(
title: "Shortcut",
location: [#github-link("Wiper-R/shortcut")],
date: "2023",
description: [#format-role[Designer, Developer]],
)
#resume-item[
- Hosted live on #link("https://shortcut-theta.vercel.app/")["Vercel"
#text("(click here)", size: 8pt, weight: "regular")].
- Implemented features such as: #list(
[#strong("Custom Backhalf")],
[#strong("QR Codes")],
[#strong("Overview")],
[#strong("Account Management") and #strong("Link Management")],
)
- Ensured #strong("maintainability") through proper project structuring using #strong[git].
- Utilized #strong("MongoDB") for data storage.
- Employed #strong("Zod") for input validation on both the #strong("Server") and #strong("Client") sides.
]
#resume-entry(
title: "My Voice Discord",
location: [#github-link("Wiper-R/my-voice-discord")],
date: "2021",
description: [#format-role("Developer")],
)
#resume-item[
- Developed a Discord bot for voice management.
- Employed #strong("PostgreSQL") with proper #strong("Migration") tables.
- Organized logic, files, and classes based on their respective functions and purposes.
]
#linebreak()
= Skills
#let experience(text, rough: false) = [#if not rough [#strong(text)] else [#(text)]]
#resume-skill-item(
"Languages",
(experience("Python"), experience("JavaScript"),
experience("TypeScript"), experience("C#", rough: true), experience("Rust", rough: true)
))
#resume-skill-item("Databases", (experience("PostgreSQL"), experience("MongoDB"), experience("MySQL", rough: true)))
#resume-skill-item("Frontend", (experience("HTML"), experience("CSS"), experience("JavaScript"), experience("ReactJS"), experience("NextJS"), experience("TailwindCSS"))
)
#resume-skill-item("DevOps", (experience("Git"), experience("Docker"), experience("AWS", rough: true)))
#resume-skill-item("Backend", (experience("Node.js"), experience("Next.js"), experience("Express.js"), experience("Flask", rough: true), experience("Django", rough: true)))
#resume-skill-item("Spoken Languages", (experience("English"), experience("Hindi")))
#linebreak()
= Education
#resume-entry(
title: "LNCT University",
location: "Bhopal, Madhya Pradesh",
date: "July 2021 - July 2024",
description: "Bachelor of Computer Applications (BCA)",
)
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cheda-seu-thesis/0.2.0/seu-thesis/pages/title-page-degree-en-fn.typ | typst | Apache License 2.0 | #import "../utils/fonts.typ": åäœ, åå·
#let title-en-conf(
author: (CN: "çäžå", EN: "<NAME>", ID: "012345"),
thesisname: (
CN: "ç¡å£«åŠäœè®ºæ",
EN: [
A Thesis submitted to \
Southeast University \
For the Academic Degree of Master of Touching Fish
],
heading: "äžå倧åŠç¡å£«åŠäœè®ºæ"
),
title: (
CN: "æžé±Œèæ¯äžçTypstæš¡æ¿äœ¿çšç 究",
EN: "A Study of the Use of the Typst Template During Touching Fish"
),
advisors: (
(CN: "æ¹çæ¡¥", EN:"HU Pai-qiao", CNTitle: "ææ", ENTitle: "Prof."),
(CN: "èé¡æµŠ", EN:"<NAME>", CNTitle: "å¯ææ", ENTitle: "Associate Prof.")
),
school: (
CN: "æžé±ŒåŠé¢",
EN: "School of Touchingfish"
),
date: (
CN: (
defenddate: "2099幎01æ02æ¥",
authorizedate: "2099幎01æ03æ¥",
finishdate: "2024幎01æ15æ¥"
),
EN: (
finishdate: "Jan 15, 2024"
)
),
anonymous: false,
) = page(margin: (top: 3cm, bottom: 2cm, left:2cm, right: 2cm), numbering: none, header: none, footer: none, {
set par(first-line-indent: 0pt)
set align(center)
block(text(font: åäœ.å®äœ, size: 24pt, weight: "bold", upper(title.EN)))
v(1cm)
set text(font: åäœ.å®äœ, size: 16pt, weight: "regular")
set par(leading: 1.5em)
set block(spacing: 1.8cm)
block(
height: 100% - 160pt,
grid(
rows: (auto, 1fr, auto, 1fr, auto, 1fr, auto),
thesisname.EN,
[],
"BY" + "\n" + author.EN,
[],
"Supervised by" + "\n" + advisors.map(it => it.ENTitle + " " + it.EN).join("\n and \n"),
[],
school.EN + "\n" + "Southeast University" + "\n" + date.EN.finishdate
)
)
})
#title-en-conf(
author: (CN: "çäžå", EN: "<NAME>", ID: "012345"),
thesisname: (
CN: "ç¡å£«åŠäœè®ºæ",
EN: [
A Thesis submitted to \
Southeast University \
For the Academic Degree of Master of Touching Fish
],
heading: "äžå倧åŠç¡å£«åŠäœè®ºæ"
),
title: (
CN: "æžé±Œèæ¯äžçTypstæš¡æ¿äœ¿çšç 究",
EN: "A Study of the Use of the Typst Template During Touching Fish"
),
advisors: (
(CN: "æ¹çæ¡¥", EN:"HU Pai-qiao", CNTitle: "ææ", ENTitle: "Prof."),
(CN: "èé¡æµŠ", EN:"SU Xi-pu", CNTitle: "å¯ææ", ENTitle: "Associate Prof.")
),
school: (
CN: "æžé±ŒåŠé¢",
EN: "School of Touchingfish"
),
date: (
CN: (
defenddate: "2099幎01æ02æ¥",
authorizedate: "2099幎01æ03æ¥",
finishdate: "2024幎01æ15æ¥"
),
EN: (
finishdate: "Jan 15, 2024"
)
),
anonymous: false,
) |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-104B0.typ | typst | Apache License 2.0 | #let data = (
("OSAGE CAPITAL LETTER A", "Lu", 0),
("OSAGE CAPITAL LETTER AI", "Lu", 0),
("OSAGE CAPITAL LETTER AIN", "Lu", 0),
("OSAGE CAPITAL LETTER AH", "Lu", 0),
("OSAGE CAPITAL LETTER BRA", "Lu", 0),
("OSAGE CAPITAL LETTER CHA", "Lu", 0),
("OSAGE CAPITAL LETTER EHCHA", "Lu", 0),
("OSAGE CAPITAL LETTER E", "Lu", 0),
("OSAGE CAPITAL LETTER EIN", "Lu", 0),
("OSAGE CAPITAL LETTER HA", "Lu", 0),
("OSAGE CAPITAL LETTER HYA", "Lu", 0),
("OSAGE CAPITAL LETTER I", "Lu", 0),
("OSAGE CAPITAL LETTER KA", "Lu", 0),
("OSAGE CAPITAL LETTER EHKA", "Lu", 0),
("OSAGE CAPITAL LETTER KYA", "Lu", 0),
("OSAGE CAPITAL LETTER LA", "Lu", 0),
("OSAGE CAPITAL LETTER MA", "Lu", 0),
("OSAGE CAPITAL LETTER NA", "Lu", 0),
("OSAGE CAPITAL LETTER O", "Lu", 0),
("OSAGE CAPITAL LETTER OIN", "Lu", 0),
("OSAGE CAPITAL LETTER PA", "Lu", 0),
("OSAGE CAPITAL LETTER EHPA", "Lu", 0),
("OSAGE CAPITAL LETTER SA", "Lu", 0),
("OSAGE CAPITAL LETTER SHA", "Lu", 0),
("OSAGE CAPITAL LETTER TA", "Lu", 0),
("OSAGE CAPITAL LETTER EHTA", "Lu", 0),
("OSAGE CAPITAL LETTER TSA", "Lu", 0),
("OSAGE CAPITAL LETTER EHTSA", "Lu", 0),
("OSAGE CAPITAL LETTER TSHA", "Lu", 0),
("OSAGE CAPITAL LETTER DHA", "Lu", 0),
("OSAGE CAPITAL LETTER U", "Lu", 0),
("OSAGE CAPITAL LETTER WA", "Lu", 0),
("OSAGE CAPITAL LETTER KHA", "Lu", 0),
("OSAGE CAPITAL LETTER GHA", "Lu", 0),
("OSAGE CAPITAL LETTER ZA", "Lu", 0),
("OSAGE CAPITAL LETTER ZHA", "Lu", 0),
(),
(),
(),
(),
("OSAGE SMALL LETTER A", "Ll", 0),
("OSAGE SMALL LETTER AI", "Ll", 0),
("OSAGE SMALL LETTER AIN", "Ll", 0),
("OSAGE SMALL LETTER AH", "Ll", 0),
("OSAGE SMALL LETTER BRA", "Ll", 0),
("OSAGE SMALL LETTER CHA", "Ll", 0),
("OSAGE SMALL LETTER EHCHA", "Ll", 0),
("OSAGE SMALL LETTER E", "Ll", 0),
("OSAGE SMALL LETTER EIN", "Ll", 0),
("OSAGE SMALL LETTER HA", "Ll", 0),
("OSAGE SMALL LETTER HYA", "Ll", 0),
("OSAGE SMALL LETTER I", "Ll", 0),
("OSAGE SMALL LETTER KA", "Ll", 0),
("OSAGE SMALL LETTER EHKA", "Ll", 0),
("OSAGE SMALL LETTER KYA", "Ll", 0),
("OSAGE SMALL LETTER LA", "Ll", 0),
("OSAGE SMALL LETTER MA", "Ll", 0),
("OSAGE SMALL LETTER NA", "Ll", 0),
("OSAGE SMALL LETTER O", "Ll", 0),
("OSAGE SMALL LETTER OIN", "Ll", 0),
("OSAGE SMALL LETTER PA", "Ll", 0),
("OSAGE SMALL LETTER EHPA", "Ll", 0),
("OSAGE SMALL LETTER SA", "Ll", 0),
("OSAGE SMALL LETTER SHA", "Ll", 0),
("OSAGE SMALL LETTER TA", "Ll", 0),
("OSAGE SMALL LETTER EHTA", "Ll", 0),
("OSAGE SMALL LETTER TSA", "Ll", 0),
("OSAGE SMALL LETTER EHTSA", "Ll", 0),
("OSAGE SMALL LETTER TSHA", "Ll", 0),
("OSAGE SMALL LETTER DHA", "Ll", 0),
("OSAGE SMALL LETTER U", "Ll", 0),
("OSAGE SMALL LETTER WA", "Ll", 0),
("OSAGE SMALL LETTER KHA", "Ll", 0),
("OSAGE SMALL LETTER GHA", "Ll", 0),
("OSAGE SMALL LETTER ZA", "Ll", 0),
("OSAGE SMALL LETTER ZHA", "Ll", 0),
)
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/docs/tinymist/inputs.typ | typst | Apache License 2.0 | #import "mod.typ": *
#show: book-page.with(title: "Tinymist LSP Inputs")
== Prefer to Using LSP Configurations
Though tinymist doesn't refuse to keep state in your disk, it actually doesn't have any data to write to disk yet. All customized behaviors (user settings) are passed to the server by LSP configurations. This is a good practice to keep the server state clean and simple.
== Handling Compiler Input Events
The compilation triggers many side effects, but the behavior of compiler actor is still easy to predicate. This is achieved by accepting all compile inputs by events.
Let us take reading files from physical file system as example of processing compile inputs, as shown in @fig:overlay-vfs. The upper access models take precedence over the lower access models. The memory access model is updated _sequentially_ by `LspActor` receiving source change notifications, assigned with logical ticks $t_(L,n)$. The notify access model is also updated in same way by `NotifyActor`. When there is an absent access, the system access model initiates the request for the file system directly. The read contents from fs are assigned with logical access time $t_(M,n)$.
#let pg-hori-sep = 1.5
#let pg-vert-sep = 0.7
#let pg-adjust = 18pt
#figure(
align(
center,
move(
dx: pg-adjust,
diagram(
edge-stroke: 0.85pt,
node-corner-radius: 3pt,
edge-corner-radius: 4pt,
mark-scale: 80%,
node((pg-hori-sep, +pg-vert-sep), [SystemAccessModel], fill: colors.at(1)),
node((pg-hori-sep, 0), align(center)[`NotifyAccessModel`], fill: colors.at(1)),
node((pg-hori-sep, -pg-vert-sep), [MemoryAccessModel], fill: colors.at(1)),
node((0, 0), align(center)[`NotifyActor`], fill: colors.at(0)),
node((0, -pg-vert-sep), align(center)[`LspActor`], fill: colors.at(0)),
edge((0, 0), (pg-hori-sep, 0), "-}>"),
edge((0, -pg-vert-sep), (pg-hori-sep, -pg-vert-sep), "-}>"),
edge(
(-1, -pg-vert-sep),
(0, -pg-vert-sep),
"-}>",
[didChange, \ didOpen, etc.],
label-anchor: "center",
label-pos: 0,
),
edge(
(-0.8, pg-vert-sep),
(0, pg-vert-sep),
(0, 0),
"-}>",
[readFile\ readDir, etc.],
label-anchor: "center",
label-pos: 0,
),
edge((-1, pg-vert-sep), (pg-hori-sep, pg-vert-sep), "-}>"),
edge((pg-hori-sep, 0), (pg-hori-sep, pg-vert-sep), "-}>"),
edge((pg-hori-sep, -pg-vert-sep), (pg-hori-sep, 0), "-}>"),
edge(
(pg-hori-sep * 1.59, -pg-vert-sep * 1.6),
(pg-hori-sep, -pg-vert-sep * 1.6),
(pg-hori-sep, -pg-vert-sep),
"-}>",
[sourceOf(path)],
label-pos: 0.2,
),
for i in (-1, 0, 1) {
edge(
(pg-hori-sep * 1.2, i * pg-vert-sep),
(pg-hori-sep * 1.7, i * pg-vert-sep),
"-}>",
[source],
label-pos: 1,
)
},
node(
(-1.3, 0),
rotate(-90deg, rect(stroke: (bottom: (thickness: 1pt, dash: "dashed")), width: 120pt)[Input Sources]),
),
node(
(pg-hori-sep + 1.45, 0),
rotate(
90deg,
move(
dy: pg-adjust * 2,
rect(stroke: (bottom: (thickness: 1pt, dash: "dashed")), width: 120pt)[Compiler World],
),
),
),
),
),
),
caption: [The overlay virtual file system (VFS)],
) <fig:overlay-vfs>
The problem is to ensure that the compiler can read the content correctly from access models at the time.
If there is an only active input source in a _small time window_, we can know the problem is solved, as the logical ticks $t_(L,n)$ and $t_(M,n)$ keep increasing, enforced by actors. For example, if there is only `LspActor` active at the _small time window_, the memory access model receives the source changes in the order of $t_(L,n)$, i.e. the _sequential_ order of receiving notifications. The cases of two rest access models is more complicated, but are also ensured that compiler reads content in order of $t_(M,n)$.
Otherwise, the two input sources are both active in a _small time window_ on a *same file*. However, this indicates that, the file is in already the memory access model at most time. Since the precedence, the compiler reads content in order of $t_(L,n)$ at the time.
The only bad case can happen is that: When the two input sources are both active in a _small time window_ $delta$ on a *same file*:
- first `LspActor` removes the file from the memory access model, then compiler doesn't read content from file system in time $delta$.
- first `NotifyActor` inserts the file from the inotify thread, then the LSP client (editor) overlays an older content in time $delta$.
This is handled by tinymist by some tricks.
=== Record and Replay
Tinymist can record these input events with assigned the logic ticks. By replaying the events, tinymist can reproduce the server state for debugging. This technique is learnt from the well-known LSP, clangd, and the well known emulator, QEMU.
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/meta/link-06.typ | typst | Other | // Transformed link.
#set page(height: 60pt)
#let mylink = link("https://typst.org/")[LINK]
My cool #box(move(dx: 0.7cm, dy: 0.7cm, rotate(10deg, scale(200%, mylink))))
|
https://github.com/thanhdxuan/dacn-report | https://raw.githubusercontent.com/thanhdxuan/dacn-report/master/datn-week-1/contents/05-refs.typ | typst | #bibliography("../ref.bib")
|
|
https://github.com/KireinaHoro/research-plan | https://raw.githubusercontent.com/KireinaHoro/research-plan/master/systems-cover/systems-cover.typ | typst | #let dmy-format = "[day] [month repr:long] [year]"
/// Create a cover page at the *very* beginning of document. Has to be a show
/// rule since we want to go before preambles generated by the body template.
/// - doc-type (str): Type of document; must be one of `masterthesis`,
/// `bachelorthesis`, `semesterproject`, `techreport`,
/// or `doctoralplan`.
/// - number (str, none): Number of the document you get from the admins. Not used when `doc-type` is `doctoralplan` or `semesterproject`.
/// - title (str): Title of the document.
/// - author (str): Name of the main author(s).
/// - authorinfo (content, none):Extra information of the author. Only used when `doc-type` is `doctoralplan`.
/// - collaborator (str, none): Name of the collaborator(s), if any.
/// - collaborator-logo (content, none): Logo of the collaborator, if any
/// - supervisor (str, none): Name of the supervisor(s), if any.
/// - second-advisor (str, none): Name of the second advisor. Only used when `doc-type` is `doctoralplan`.
/// - date (datetime): Date of the document.
/// - doc (content): Body of the entire document.
#let cover-page(
doc-type: "masterthesis",
number: "nr undefined",
title: "title undefined",
author: "author undefined",
authorinfo: none,
admission-date: datetime.today(),
contract-date: datetime.today(),
additional-info: none,
collaborator: none,
collaborator-logo: none,
supervisor: none,
second-advisor: none,
date: datetime.today().display(dmy-format),
doc,
) = {
let type-to-display = (
masterthesis: [Master's Thesis],
bachelorthesis: [Bachelor's Thesis],
semesterproject: [Semester Project],
techreport: [Technical Report],
doctoralplan: [Doctoral Plan],
)
assert(type-to-display.keys().contains(doc-type), message: "doc-type must be
one of: " + str(type-to-display.keys().join(", ")))
set page(
paper: "a4",
margin: (x: 1.7in/2, y: 2.5in/2),
)
grid(
columns: (auto, 1fr, auto),
align: top,
image("logos/eth.svg", height: 18mm),
[],
image("logos/systems.svg", height: 16mm),
)
v(1fr)
let is-doctoralplan = doc-type == "doctoralplan"
let is-semesterproject = doc-type == "semesterproject"
let type-font(body) = if (is-doctoralplan) {
text(size: 12pt)[#body #parbreak()]
} else {
text(size: 16.84pt, weight: "bold")[#body #parbreak()]
}
let group-font(body) = if (is-doctoralplan) {
text(size: 12pt)[#body #parbreak()]
} else {
text(size: 12.63pt)[#body #parbreak()]
}
let incollaboration-font(body) = if (is-doctoralplan) {
text(size: 12pt)[#body #parbreak()]
} else {
text(size: 10.52pt)[#body #parbreak()]
}
let title-font(body) = if (is-doctoralplan) {
text(size: 18pt)[#body #parbreak()]
} else {
text(size: 12.63pt)[#body #parbreak()]
}
let author-font(body) = if (is-doctoralplan) {
text(size: 12pt)[#body #parbreak()]
} else {
text(size: 12.63pt)[#body #parbreak()]
}
let date-font(body) = if (is-doctoralplan) {
text(size: 12pt)[#body #parbreak()]
} else {
text(size: 12.63pt)[#body #parbreak()]
}
align(center, {
set text(font: "Arial")
show par: set block(spacing: 0.3em)
type-font({
type-to-display.at(doc-type)
if (not is-doctoralplan and not is-semesterproject) [~Nr.~#number]
})
v(5mm)
group-font[Systems Group, Department of Computer Science, ETH Zurich]
if (collaborator != none) {
v(4mm)
incollaboration-font[in collaboration with]
v(3mm)
group-font(collaborator)
}
v(16mm)
title-font(title)
v(20mm)
author-font({
[by]
v(3mm)
author
if (is-doctoralplan) {
v(0.2em)
authorinfo
}
if (is-doctoralplan) {
v(8mm)
[Supervisor: #supervisor]
v(3mm)
[Second Advisor: #second-advisor]
} else if (supervisor != none) {
v(8mm)
[Supervised by]
v(3mm)
(supervisor)
}
})
v(15mm)
date-font({
date
if (is-doctoralplan) {
set align(left)
set text(style: "italic")
v(30mm)
[
#author is employed as a research assistant since
#contract-date.display(dmy-format) and was accepted as a PhD student on
#admission-date.display(dmy-format). #additional-info
]
}
})
})
v(1fr)
grid(
columns: (auto, 1fr, auto),
align: top,
image("logos/dinfk.svg", height: 6.5mm),
[],
collaborator-logo,
)
doc
}
|
|
https://github.com/maucejo/book_template | https://raw.githubusercontent.com/maucejo/book_template/main/template/front_matter/front_main.typ | typst | MIT License | #include "remerciements.typ"
#include "resume.typ" |
https://github.com/cyp0633/hnu-bachelor-thesis-typst-template | https://raw.githubusercontent.com/cyp0633/hnu-bachelor-thesis-typst-template/master/abstract.typ | typst | #let chinese_abstract(title,keywords,content)=[
// çå±ç®åœç dirty fix
#text(size:0em)[
#heading(level: 1)[æ èŠ]
]
#v(1em)
#align(center)[
#text(font: "Source Han Sans",size:15pt)[#title]
#v(1.3em)
#text(font: "Source Han Sans",size: 16pt)[æ#h(2em)èŠ]
]
#show par: set block(spacing: 1.7em)
#content
#par(first-line-indent: 0em)[
#text(font: "Source Han Sans",size: 14pt)[å
³é®è¯ïŒ]
#text(font: "Source Han Sans",size: 12pt)[#keywords]
]
]
#let english_abstract(title,keywords,content)=[
// çå±ç®åœç dirty fix
#text(size:0em)[
#heading(level: 1)[Abstract]
]
#v(1em)
#align(center)[
#text(font: "Times New Roman",size:15pt,weight: "bold")[#title]
#v(1.3em)
#text(font: "Times New Roman",size: 16pt,weight: "bold")[Abstract]
]
#show par: set block(spacing: 1.7em)
#content
#par(first-line-indent: 0em)[
#text(font: "Times New Roman",size: 14pt,weight: "bold")[Key WordsïŒ]
#text(font: "Times New Roman",size: 12pt,weight: "bold")[#keywords]
]
] |
|
https://github.com/vimkat/typst-ohm | https://raw.githubusercontent.com/vimkat/typst-ohm/main/src/templates/_presentation.typ | typst | MIT License | #import "@preview/polylux:0.3.1" as plx
#import "../lib/vars.typ"
#import "../lib/utils.typ"
#import "../components/logo.typ": logo, logo-omega
#import "../templates/document.typ": document as ohm-document
#let margin = 32pt
#let ohm-logo-content = state("ohm-logo-content", none)
#let ohm-title = state("ohm-title", none)
#let ohm-author = state("ohm-author", none)
#let ohm-date = state("ohm-date", none)
#let ohm-header = state("ohm-header", none)
#let ohm-footer = state("ohm-footer", none)
#let ohm-meta = state("ohm-meta", none)
#let content-with-context(ctx, body) = {
if type(body) == "function" {
body(..ctx)
} else {
body
}
}
#let ohm-theme(
logo-content: none,
title: none,
author: none,
date: datetime.today(),
header: none,
footer: none,
progress-bar: false,
body
) = {
set document(title: title, author: author, date: date)
set page(
paper: "presentation-16-9",
margin: margin,
// Handled in slide-base b/c state makes this go boom
header: none,
footer: none,
)
set text(size: 20pt)
show heading: it => {
set text(weight: "extrabold")
set text(fill: vars.red) if it.level == 1
it
}
ohm-logo-content.update(logo-content)
ohm-header.update(header)
ohm-footer.update(footer)
ohm-title.update(title)
ohm-author.update(author)
ohm-date.update(date)
ohm-meta.update((
progress-bar: progress-bar,
))
ohm-document(blue-as-black: true, body)
}
// Base header/footer
#let header(fill: none) = {
set text(size: 10pt, fill: fill)
grid(
rows: 1,
columns: (auto, 1fr),
align(left, logo(safety-zone: false, height: 16pt, text-only: true, fill: fill, none)),
align(right, ohm-header.display()),
)
}
#let footer(fill: none) = {
set text(size: 10pt, fill: fill)
grid(
rows: 1,
columns: (1fr, auto),
align(left, ohm-footer.display()),
align(right, plx.logic.logical-slide.display()),
)
ohm-meta.display(meta =>
if meta.progress-bar {
plx.utils.polylux-progress(ratio =>
place(
bottom,
dx: -margin,
dy: margin,
rect(
width: ratio * 100% + margin * 2,
height: 2.5pt,
stroke: none,
fill: fill,
)
)
)
}
)
}
// Base slide config (with header/footer support)
#let base-slide(
header: header,
header-height: 32pt,
footer: footer,
footer-height: 16pt,
background: none,
body
) = {
let _fill = if type(background) == "color" { utils.contrast-colors(background) }
let _background = if type(background) == "color" {
rect(fill: background, width: 100%, height: 100%)
} else {
background
}
let _header = content-with-context((fill: utils.default(_fill, vars.red)), header)
let _footer = content-with-context((fill: utils.default(_fill, vars.red)), footer)
let _body = content-with-context((fill: utils.default(_fill, vars.blue)), body)
// Only override if actually needed (to make inheritance work properly)
set text(fill: _fill) if _fill != none
plx.polylux-slide({
if _background != none {
place(
dx: -margin,
dy: -margin,
block(width: 100% + margin * 2, height: 100% + margin * 2, _background)
)
}
grid(
rows: (header-height, 1fr, footer-height),
columns: (1fr),
row-gutter: 1em,
align(top, _header),
_body,
align(bottom, _footer),
)
})
}
#let background-omega = place(dx: 53%, scale(120%, logo-omega(outline: true)))
#let title-slide(
title,
subtitle: none,
background: background-omega,
fill: none,
) = {
let _fill = utils.default(fill, utils.contrast-colors(background))
// Cut out parts of the omega if it is used as the background
let _content(body) = {
if background == background-omega {
highlight(fill: white, body)
} else {
body
}
}
base-slide(
header: (fill: none) => logo(safety-zone: false, fill: fill, height: 100%, ohm-logo-content.display()),
header-height: 32pt,
footer: none,
background: background,
{
set align(horizon)
set text(fill: _fill, weight: "black")
set par(leading: 0.25em)
v(3em) // from header-height
stack(
spacing: if subtitle != none { 1.5em } else { none },
block(
width: 80%,
text(size: 4em, _content(title)),
),
if subtitle != none {
block(
width: 80%,
text(size: 1.5em, _content(subtitle)),
)
},
)
}
)
}
#let section-slide(
title,
subtitle: none,
background: vars.red
) = {
base-slide(
background: background,
{
set align(center + horizon)
set text(weight: "extrabold")
plx.utils.register-section(title)
block(text(size: 2.5em, title))
if subtitle != none {
v(0.5em)
block(text(size: 1.25em, weight: "bold", subtitle))
}
}
)
}
#let agenda-slide(
title: [Agenda],
) = {
base-slide[
= #title
#plx.utils.polylux-outline(enum-args: (tight: false))
]
}
// Nothing fancy, just hiding some arguments :)
#let slide(body) = base-slide(body)
#let allowed-items = ["title", "author", "date", "section"]
#let metadata-line(..items) = {
items.pos().map(item => {
if item == "title" { ohm-title.display() }
if item == "author" { ohm-author.display() }
if item == "date" { ohm-date.display(date => date.display("[day].[month].[year]")) }
if item == "section" { plx.utils.current-section }
})
.filter(item => item != none)
.join(" | ")
}
|
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/brainstorm-program-structure/entry.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/packages.typ": notebookinator
#import notebookinator: *
#import themes.radial.components: *
#show: create-body-entry.with(
title: "Brainstorm: Program Structure",
type: "brainstorm",
date: datetime(year: 2023, month: 8, day: 12),
author: "<NAME>",
witness: "Violet Ridge",
)
= Options
#grid(
columns: (1fr, 1fr),
gutter: 20pt,
[
== Option 1
This option uses an object oriented approach, and organizes each subsystem into
a class. Each subsystem is represented by a state machine that behaves
differently based on the current set state. Each subsystem will run on it's own
task in order to be able to act on multiple actions asynchronously. Each class
will follow a singleton #footnote("See glossary.") pattern, and will therefore
not be constructed more than once.
#pro-con(pros: [
- Scales very well
- Allows multiple subsystems to act without blocking each other
], cons: [
- Overkill for a small codebase
])
],
image("./1.svg"),
[
== Option 2
This option uses a procedural approach. It organizes each subsystem into a
namespace, and creates functions that can be used to interact with the
underlying devices. This approach is synchronous, meaning when one operation of
a subsystem is called, execution will be blocked until the operation is
finished.
#pro-con(pros: [
- Scales pretty well
- Doesn't require in depth understanding of object oriented concepts
], cons: [
- No asynchronous subsystems
])
],
image("./2.svg"),
[
== Option 3
This option is by far the simplest, and would be the easiest to implement. This
approach defines all devices globally, and does not distinguish between
subsystems, only devices. This means that all devices can be used freely by any
subsystem. This approach is also synchronous, and is generally not distributed
across multiple files. This approach is used by most 53 teams, and is generally
sufficient for a simple program.
#pro-con(pros: [
- Very simple to implement
], cons: [
- Difficult to scale
])
],
image("./3.svg"),
)
|
https://github.com/rickysixx/unimore-informatica | https://raw.githubusercontent.com/rickysixx/unimore-informatica/main/high-performance-computing/riassunto_hpc.typ | typst | #set par(leading: 0.55em, justify: true, linebreaks: "optimized")
#set text(font: "New Computer Modern", lang: "en")
#set heading(numbering: "1. ")
#show raw: set text(font: "Courier New", size: 11pt)
#show raw.where(block: false): box.with(
fill: luma(240),
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt
)
#show raw.where(block: true): block.with(
fill: luma(240),
inset: 10pt,
radius: 4pt,
)
#show par: set block(spacing: 1em)
#outline(
indent: auto
)
#let definition(body, title: "") = {
table(
columns: (1fr),
align: (left + top),
[*#title*: #body]
)
}
#pagebreak(weak: true)
= Introduction
*High-performance computing* is the practice of *aggregating computing power* to get very high performance to solve complex problems.
Historically, HPC was only related to *supercomputers* and was used only in niche contexts (scientific calculations, etc.).
#definition(
title: [Embedded computing system (ES)]
)[
An electronic device that is not a computer per se, but includes a programmable computer.
]
Embedded systems typically use a *battery*. HPC helps obtain a good balance between performance and *energy efficiency*.
Embedded systems evolved a lot over time (more transistors, smaller size, etc.).
#figure(
definition(
title: [Bell's law]
)[
Roughly every decade a new, lower priced computer class forms based on a new programming platform, network, and interface resulting in new usage and the establishment of a new industry.
],
kind: "definition",
supplement: "Definition",
caption: [Bell's law summarizes embedded systems' evolution over time]
)
With an hardware that is increasingly *parallel* and *heterogeneous* the challenge is on the application developer, who must learn how to extract the maximum performance from these systems.
= The multicore revolution
Architecture of modern high-performance computers is highly *heterogeneous*: there is no longer a single ISA#footnote[Instruction Set Architecture], but there are different sets of processors, each with its own ISA.\
#figure(
image("assets/1cefacdb4c004eacbbbb63ed9a328011.png", height: 35%),
caption: [Modern architectures are locally omogeneus, but globally heterogeneous]
)
#definition(
title: [#highlight(fill: yellow)[Moore's law]]
)[
The number of transistors in an integrated circuit doubles every two years.
]
Until 2004-2005, manufacturers have been increasing CPUs performance by simply increasing their *clock rate*. This changed after the *multicore revolution*: performance improvement is not about increasing the clock rate anymore, but it's about adding more *parallelism*.
#figure(
box(height: 20%,
columns(2)[
#image("assets/e397931d72b52ee59879efbb7733cda1.png")
#image("assets/a3c996bd016bf77a23acb12d1d851a34.png")
]
),
caption: [Intel CPU clock rate roadmaps before and after the multicore revolution.]
)
The reason behind this change in CPU design is the *power wall*. Clock rate cannot increase without limits because at some point the amount of *heat* to dissipate and the *energy consumption* would be too high to handle.
#definition(
title: [Circuit delay]
)[
The time the current takes to traverse a circuit.
]
CPU frequency is circuit delay's inverse:
$
f = frac(1, "CD")
$
Every technology generation (about 1.5 years), circuit delay is reduced by a 0.7x factor, which implies an increase of the frequency by a 1.4x factor.
An increase of CPU frequency implies an increase of *dynamic*#footnote[The power consumed while transistors are working.] power consumed by a digital circuit:
$
P_("DYN") = "capacity load" times "voltage"^2 times "frequency"
$
Manufacturers have managed to keep dynamic power low by adding *power managers* to computer architecture. These devices reduce frequency when the CPU is idle.
But circuits also have a *static* power component, which does not depend on the frequency:
$
P_("S") = k_d times "voltage" times "current"_"leaked"
$
The only way to low static power consumption is by turning off the circuit.
#highlight(fill: yellow)[*Power density* is another big problem: having a lot of power in a *small area* generates heat].
== Instruction-level parallelism
CPU pipeline allows to exploit parallelization on *single core* systems.
At the end of each stage of the pipeline there is a *register*. This register helps reduce the length of the *critical path*: its length is limited to the single pipeline stage and it's not the entire pipeline.
*Multiple issue* is another way to improve ILP: by replicating some pipeline stages (or adding other pipelines altogether) CPU is able to start multiple instructions in the same clock cycle.
Multiple issue can be either *static* or *dynamic*:
- static multiple issue is performed by the *compiler*, which schedules instructions appropriately;
- dynamic multiple issue (or *out-of-order execution*) is performed by the hardware itself
But also ILP cannot be increased without limits:
- *dependencies* reduce its applicability in practice;
- out-of-order CPUs require much more power, so this does not help in avoiding the power wall
== Memory wall
#figure(
image("assets/d727b6042d481436f563c3095f08667e.png", width: 80%),
caption: [The gap between CPU and memory performance has increased a lot over time]
)
It's useless to invest lots of resources in improving CPU performance, because now the bottleneck is the memory.
== Multicore
Multicore is another strategy (along with ILP) manufacturers explored to increase CPU performance.
Having multiple cores on the *same chip* has big advantages on CPU design, because each CPU can be simpler and slower (and thus less power demanding).
#figure(
image("assets/e0dcaa197cc2d53d0dfe6268dac2309f.png", height: 19%),
caption: [Multicore performance and energy demand]
)
#highlight(fill: yellow)[Performance improvement of multicore is only theoretical. The problem now is on the software, which must be written to exploit parallelism given by multiple cores.]
== Dark silicon
Power consumption is still a problem also after the multicore revolution. Cores cannot be all kept on at the maximum power.
#definition(
title: [Dark silicon]
)[
A portion of hardware that cannot be used at full power, or cannot be used at all, to avoid increasing the power consumption of the circuit.
]
Every modern hardware design has a lot of dark silicon.
Dark silicon is the consequence of the *utilization wall*: the portion of a chip that can work at *full frequency* drops *exponentially* after each processor generation because of power constraints.
"*Four horsemen*" is a way to call 4 different proposed solutions to handle dark silicon. None of these solutions is optimal, but each one has its benefit. Probably the optimal solution is a mixture of those.
+ *shrinking* horseman: instead of having dark silicon, manufacturer should simply make smaller processors. Not ideal because dark silicon does not mean *useless silicon*, it just means that it's under-clocked or not used all of the time;
+ *dim* horseman: can be a *spacial* dimming (more cores, but each one with a lower frequency) or a *temporal dimming* (each core has a higher frequency, but they are not used all together). Temporal dimming is widely used in battery-limited sistems (e.g. smartphones);
+ *specialized* horseman: dark silicon is used only to perform *specialized* tasks (e.g. video decoding/encoding, crypto stuff, etc.);
+ *deus ex machina* horsemen: move from the current CMOS technology to another one (e.g. nanotubes). None of these newer technology is sustainable across processor generations.
= Parallel systems
#figure(
table(
columns: (1fr, 1fr),
align: (left + top, left + top),
[#align(center)[*advantages*]], [#align(center)[*disadvantages*]],
[
- effective use of all (or most of) transistors in a chip;
- *scaling* (i.e. adding a core) is very easy;
- each processor can be *less powerful*, which optimizes costs and power efficiency;
- designing multi-processor systems is easier because once a processor has been tested it can simply be *replicated*
],
[
- performance improvement is only *theoretical*. Not all problems can be efficiently parallelized;
- more processors needs to be *synchronized*;
- software developers should write code that uses these multiple processors
]
),
caption: [Pro and cons of multicore]
)
== Taxonomy of parallel computers
#figure(
image("assets/38726964c71c5a72cda5c1673e9d4579.png", height: 13%),
caption: [Flynn taxonomy of parallel computers]
)
#table(
columns: (auto, 30%, 1fr),
align: (center + horizon, center + horizon, left + horizon),
[SISD\ (single instruction, single data)], [#image("assets/f23a92e4792507b79670ed1bfc55655b.png")], [A single instruction is executed on a single data stream. This is the architecture of single-core systems.\ These single-core systems can still use some forms of parallelization, e.g. through ILP],
[MISD\ (multiple instruction, single data)], [#image("assets/c95cd9fa8ae5cb33350a37f49e1c5174.png")], [Multiple instruction streams that can be naturally parallelized are executed on a single data stream.\ This architecture is quite rare today, but it's widely used in AI computation.],
[SIMD\ (single instruction, multiple data)], [#image("assets/31bbefd09c9e39f2877955c611e8a699.png")], [A single instruction is executed on multiple data streams.\ This architecture is widely used in GPUs.],
[MIMD\ (multiple instruction, multiple data)], [#image("assets/c629ba530e4003e1cd1d30af7383ac23.png")], [Multiple instructions are executed on multiple data streams.\ Since different program counters are used, this architecture is able to execute *multiple programs* (or diffrent parts of the same program) at the same time.]
)
SIMD and MIMD are the most widespread architectures today.
The most common programming style is SPMD (single program, multiple data). This is not related to the architecture, but to the *execution model* (a single program is executed on all processors of a MIMD).
#pagebreak(weak: true)
=== SIMD architectures
In this architecture the hardware itself is able to execute the same instruction on a large dataset (e.g. scalar-vector sum or multiplication).
This architecture exploits the fact that lot of work is done inside *loops* for a large data structure (vectors, matrixes):
#figure(
```c
for (int i = 0; i < N; i++)
x[i] += s
```,
caption: [Example of scalar-vector sum]
)
In this context there is no need to stick to the Von Neumann instruction processing (fetch, decode, execute, etc.), because when the instruction has been decoded once, it can be executed *multiple times* independently without the need to fetch/decode it again.
#figure(
image("assets/24283267bb4e0b250e352ee5aee029c0.png", width: 80%),
caption: [Schema of a SIMD architecture]
)
To exploit data parallelism, CPU pipeline must be modified:
- EXE stage must be replicated to execute the instruction multiple times;
- a larger memory unit must be used to read/write *multiple* vector values at the same time
#figure(
image("assets/c9cbe98918ff56fe8c293255605a4834.png", width: 80%),
caption: [SISD vs SIMD (pseudocode)]
)
SIMD architecture needs *adjacent* values in memory.
#pagebreak(weak: true)
*Loop unrolling* can help revealing more data-level parallelism than available in a single loop iteration:
#figure(
image("assets/a26d7b154737409f287d570ff3cecec8.png", height: 25%),
caption: [RISC-V ASM example of an unrolled loop. Every block of 4 similar instructions can be replaced by a single SIMD instruction.]
)
Unrolling is done automatically by the compiler.
Loops are unrolled by a factor equal to the width of the SIMD unit of the architecture.
=== MIMD architectures
This architecture is more complex than SIMD, because here there are multiple *independent* pipelines, each one with its own *program counter*.
#figure(
image("assets/1a82cc6a7ef0f93e7793bc2d8e7cd46f.png", height: 11%),
caption: [In MIMD each processing node is interconnected through a communication network]
)
MIMD uses *thread-level parallelism*. Each thread can use data-level parallelism (e.g. SIMD) on its own.
MIMD architecture allows two different patterns of execution:
+ multiple program, multiple data (MPMD): each thread executes a *different* program;
+ multiple threads, multiple data (MTMD): each thread executes a different part of the *same program*
#figure(
image("assets/5aaa95058d42882ce1800659cfde2409.png", height: 20%),
caption: [Different types of parallelism in action (SIMD/SPMD and MPMD)]
)
== Memory architecture in multiprocessor systems
#figure(
table(
columns: (auto, 40%, 1fr),
align: (center + horizon, center + horizon, left + horizon),
[*shared*], [#image("assets/313af4486140a513fe0c5b752d0360d2.png")], [
- one *copy* of data shared among many cores;
- synchronization must be handled explicitly;
- communication between processors is implicit by modifying shared data;
- scales poorly in terms of number of processors;
- #highlight(fill: yellow)[main issue: *correctness*];
],
[*distributed*], [#image("assets/84feba4fa9a865e7d3d7727eb124cc7d.png")], [
- each core has its own, private, memory, inaccessible to other cores;
- each core is interconnected;
- communication is explicit through a *messaging system*;
- synchronization is handled implicitly during message send/receive;
- better scalability;
- #highlight(fill: yellow)[main issue: *performance*]
]
),
caption: [Primary patterns of multicore architecture design]
)
=== Shared memory
In a shared memory address model:
- each processor can address every physical location in the machine;
- each process can address all data it shares with others;
- #highlight(fill: yellow)[communication happens through load and stores];
- *memory hierarchy* applies, with multiple levels of cache
#figure(
table(
columns: (auto, 1fr),
align: (center + horizon, center + horizon),
[physically shared\ (typical of on-chip multiprocessors)], [#image("assets/867b860c6bbc99eab0e46b05da6ddf5d.png")],
[distributed shared memory\ (typical of large-scale computers)], [#image("assets/2dc4c356f1a3787f3a3adfcac4cbee15.png")]
),
caption: [Different physical implementations for shared memory]
)
#highlight(fill: yellow)[Physically shared memory is more performant], because plain load/stores can be used to access data. In distributed shared memory instead a message-passing protocol must be used.
#definition(
title: [NUMA architecture]
)[
A type of multiprocessor architecture where access to memory is *non-uniform*. Different processors take different time to access the memory, because of the *physical distance* between the processor and its own memory.
]
=== Distributed memory
#figure(
image("assets/2b8ae1edbf91e5274c0a58e40ccf1ee1.png", height: 15%),
caption: [Each processor has its own copy of `X`]
)
Communication happens through *message exchange*. If P1 needs to access P2's value of `X`:
+ P1 sends a read request for `X` to P2;
+ P2 sends a copy of its `X` to P1;
+ P1 stores the received value in its own memory
Data exchange requires *synchronization* between sender and receiver.
Messages are processed through a *FIFO queue*:
#figure(
image("assets/e8fd36d292684918e126624ec04ddaf3.png", height: 10%),
caption: [Message passing communication model]
)
Message send/receive can either be blocking (synchronous) or asynchronous.
#figure(
image("assets/eefccdd1406dcadde57b171a0ce50baa.png", height: 24%),
caption: [Physical implementation of message passing]
)
#figure(
image("assets/fa634e45c9fa6dd597af968f773668d6.png", width: 100%),
caption: [Example of a program that uses distributed memory to calculate the distance between two given points on the plane. P1 holds `A` and `B`, while P2 holds `C`.]
)
= Shared memory issues
Main issues of shared memory:
- *coherence*: each processor holds a different *copy* of the same data. It's crucial that all processors see the *most recent version* of the data;
- *synchronization*: multiple processors accessing the memory must not mess up the computation. Memory *locks* should be handled;
- *consistency*: the time it takes to propagate changes of the data to all memory locations (e.g. internal cache of each CPU)
== Coherence
Coherence deals with mantaining a *global order* in which writes to a *single location* are seen by all processors.
Coherence is relevant anywhere there are multiple actors who may write the memory. This may also happen in single core systems because both the CPU and the I/O system may want to access the memory.
#figure(
table(
columns: (50%, 38%),
align: (center + horizon, center + horizon),
stroke: none,
[#image("assets/acc95a0917499d05f8da40bbff92f6f7.png")], [#image("assets/1b25a7cbfd24eb4e12c5eb518e5d6d15.png")]
),
kind: image,
caption: [Coherence in single and multiprocessor systems]
)
Since writes to DRAM are expensive, single-core systems adopt a *write-back logic*: writes to DRAM are not performed until the very last moment, which is a *cache eviction*.
In a multiprocessor system, the interconnection network intercepts a write request of a processor and broadcasts it to all other processors. Each processor can then proceed with cache invalidation to update their local copy of the data.
The coherence system must be completely *transparent* to the user and to the programmer.
Key ideas for cache coherence:
- each processor stores a *copy* of the data it needs in its own cache;
- if processors are only *reading* data, nothing happens;
- if even a single processor is *writing* a value, all copies of that data must be invalidated
=== Snoopy protocol
Each processor has a *snoopy cache* which listens for memory updates on the bus in order to keep the memory view of each processor coherent.
#figure(
image("assets/5e907d61ce2e59a253eb371667a18f76.png", height: 25%),
caption: [Snoopy caches]
)
This protocol does not scale well because it operates over a *single bus*.
On a *write miss*, the address is invalidated in all other caches before the write is performed.
On a *read miss*, if a *dirty copy* is found in some cache, a write-back is performed before the memory is read.
=== MSI protocol (Modified, Shared, Invalid)
Each cache line has some *state bits*. Each one of them can be either:
- *shared*: the processor read a value from the memory because of a read miss. If other processors read the same value, the state does not change;
- *invalid*: some *other* processor has written the data;
- *modified*: *this* processor has written the data
#highlight(fill: yellow)[The processor with the cache line in state M is the owner of the most recent copy of the data]. This may also happen when the cache line is in state S, but the *dirty bit* is different (on when in state M, off when in state S).
Only one processor in the system can have a cache line in state M for a specific data, because there could be only one owner of the most recent copy of the data.
#figure(
table(
columns: (auto, auto, auto),
[*action*], [*P1 cache line state*], [*P2 cache line state*],
[P1 reads], [S], [-],
[P1 writes], [M], [-],
[P2 reads], [S (write-back)], [S],
[P2 writes], [I], [M],
[P1 reads], [S (read miss)], [S (write-back)],
[P1 writes], [M], [I],
[P2 writes], [I], [M]
),
caption: [MSI protocol example]
)
==== MSI protocol performance
I state is a very cheap way to mark the data as invalid. The alternative would be to read the value *immediately* from the memory, which is much more costly.
MSI protocol treats every data item as *shared*. This is its major performance drawback, because when a processor write a value into the memory, all other processors must be notified and this generates a lot of bus traffic which may be useless if the data is actually *private* to that processor.
=== MESI protocol (Modified exclusive, Exclusive but unmodified, Shared, Invalid)
This protocol adds to the MSI protol the state E: *exclusive but unmodified*. This state marks a *private* value that has not been modified (yet) by the processor.
This protocol treats all data items as *private* by default. The state of a cache line keeps bouncing between states E and M until some other processor needs that data, which causes the line to jump to S state.
#figure(
table(
columns: (auto, 1fr, 1fr),
[*action*], [*P1 cache line state*], [*P2 cache line state*],
[P1 reads], [E], [-],
[P1 writes], [M], [-],
[P1 reads/writes], [M], [-],
[P2 reads], [S (write-back)], [S],
[P2 writes], [I], [I],
[P1 reads], [S], [S]
),
caption: [MESI protocol example]
)
==== MESI protocol performance
MESI performs better than MSI because it generates much less bus traffic.
=== Coherence misses
Cache lines are organized in *blocks*. A single cache block can hold more than one word of data. Processors access a single word, but cache coherence works at block level.
If $P_1$ writes $w_1$, $P_2$ writes $w_2$ and both $w_1$ and $w_2$ share the same block, $P_1$'s write will generate a *false sharing miss* on $P_2$. $P_2$ needs to evict the whole cache block even though it's working only with $w_2$.
#figure(
table(
columns: (auto, auto, auto, auto),
align: (center + horizon, center + horizon, center + horizon, left),
[*time*], [*P1*], [*P2*], [*outcome*],
[1], [write `x1`], [read `x2`], [false miss: P1's write to `x1` invalidates also `x2` for P2],
[2], [write `x1`], [write `x2`], [false miss: the cache line is invalidated for both P1 and P2, even though P2 does not care about `x1` and P1 does not care about `x2`],
[3], [read `x2`], [-], [true miss: the cache line is dirty because P2 has written `x2` previously]
),
caption: [True vs false sharing misses (assuming `x1` and `x2` are in the same cache block)]
)
#figure(
table(
columns: (1fr, 1fr),
stroke: none,
align: (center + horizon, center + horizon),
[#image("assets/e4a60e0a923c7fd3bdbc718e0e9237d9.png")], [#image("assets/2475669d9800c9bc2412d8f742a72808.png")]
),
kind: image,
caption: [Cache misses over cache size and processor count increments]
)
Bigger cache size reduces the impact of cache misses, but a bigger number of processors increases sharing misses. It's important to find a balance between these two factors.
=== Implementing cache coherence
A cache coherent system must:
- provide a set of *states*, with a transition diagram and a set of actions for each state;
- manage the coherence protocol, which means:
- determine *when* to invoke the protocol (e.g. distinguishing between shared and private data);
- find the state of the address in other processors' caches;
- locate other copies of the data;
- communicate with each processor
Different systems implement cache coherence differently, but all of them invoke the protocol only when an "access fault" occurs on the cache line.
#pagebreak(weak: true)
==== Snoopy protocol
Bus-based protocol that *broadcasts* a write request from a processor to *all* other processors in the system.
#figure(
image("assets/c91d316c0376c22eeb2ffe1949f89752.png", height: 20%),
caption: [Architecture of a snoopy protocol]
)
This protocol is very simple, but it does not scale well because of the high bus traffic it generates.
NUMA systems help reducing the latency (especially when there is a lot of *locality* in the application), but still they are not so useful if the cache coherence protocol cannot scale.
Scalability can be improved by applying different layes of interconnection between processors:
#figure(
image("assets/22fbb0f97c742d4d3f6303aef9d78dd7.png", height: 18%),
caption: [Hierarchy of snooping]
)
This hierarchy is simple to build, but it has disadvantages too:
- the root becomes a bottleneck;
- latency is higher, because processors are no longer directly interconnected;
Another option to improve snoopy protocol performance is *decentralizing memory* (each group of processors has its own memory):
#figure(
image("assets/d8d76dd753e5964092fc43297319c0d4.png", width: 80%),
caption: [Decentralized memory]
)
#pagebreak(weak: true)
=== Directories
This approach relies on *point-to-point* messages instead of broadcasts.
Information about the cache block is stored in a *directory*:
- every memory block has associated directory information, which keeps track of copies of cached blocks (and their states);
- on a miss, the cache coherence protocol looks for the corresponding directory entry and communicates only with nodes that have copies of that data;
Directory information can be organized in different ways. A very simple directory structure is based on *presence bits*:
#figure(
image("assets/e07b84dbe0156b0aa7e596bb04806745.png", height: 30%),
caption: [Directory structure with presence bits]
)
Each directory entry stores $n$ bits, one for each processor. The $i$-th bit is 1 if the $i$-th processor holds that memory block in its cache. The directory entry also stores the *dirty bit*, which is set to 1 if one processor has written into the memory block.
Each processor has a separate directory:
#figure(
image("assets/fe067e16620ce5052600bcbb24230283.png", width: 80%),
caption: [Directory for each node]
)
- the *home node* of a memory block is the node whose memory is allocated for that data;
- being the home node does not necessarily mean to be the owner of the most recent copy of the data, it just means that memory block is allocated on that node's memory;
- the *requesting node* is the node who asks the home node for a memory block
#pagebreak(weak: true)
==== Example 1: clean block read miss
+ P1 has a cache miss;
+ P1 asks P2 for that data, since P2 is the home node of that memory block;
+ P2 looks up the directory entry for that memory block, finds that the block is clean, and sends the data to P1;
+ P2 updates the directory entry by adding a presence bit for P1
#figure(
image("assets/865eb46762d33d9480d8518df4628b09.png", height: 25%),
caption: [Clean block read miss]
)
==== Example 2: dirty block read miss
+ P1 has a cache miss;
+ P1 asks P2 for that data, since P2 is the home node of that memory block;
+ P2 looks up the directory entry, finds that the block is dirty, and tells P1 to get the data from P3 instead, which is the owner of the most recent copy of the data;
+ P1 asks P3 for the data;
+ P3 sends the data to P1;
+ P2 updates the directory entry by removing the dirty bit and by adding a presence bit for P1
#figure(
image("assets/e1401e1886d3575fff0d0a0a2b344047.png", height: 25%),
caption: [Dirty block read miss]
)
#pagebreak(weak: true)
==== Example 3: write miss
+ P1 has a write miss;
+ home node of that memory block is P2, so P1 asks P2 to update the value in its memory;
+ P2 looks up the directory entry, finds that P2 itself and P3 hold a copy of the data, and tells P1 to ask those nodes to invalidate their copies;
+ P1 asks P2 and P3 to invalidate their copies and waits for an acknowledge;
+ after receiving both invalidation acks, P1 can perform the write
#figure(
image("assets/8fa33b25e1f99c7aadbd86bb2257a008.png", height: 25%),
caption: [Write miss]
)
==== Summary: advantages of directories
On reads, directory tells the requesting node where to get the memory block from (either from the home node or from the owning node). In both cases it's #highlight(fill: yellow)[point-to-point communication, which is much more efficient than broadcast messaging].
On writes, the advantage of directories depends on the number of sharers#footnote[A sharer is a node which holds a copy of the data.]. In the worst case this falls back to broadcast messaging.
=== Cache access patterns
In general there are two main cache access patterns:
- mostly-read objects: the same data is shared among a large number of processors, but writes are infrequent, so their impact on performance is negligible;
- migratory objects: the number of sharers is very low and it does not scale with the number of processors. Writes do not affect performance in this case too, because sharers count is low
A few observations can be done based on these access patterns:
- directories are very useful for limiting traffic;
- since it's quite rare that *all* nodes are working on the same data, directory structure can be optimized to reduce storage overhead
=== Full bit vector approach
Directory entries holds #highlight(fill: yellow)[one presence bit for each processor].
This approach has a storage overhead of $P times M$, where $P$ is the number of processors and $M$ is the number of memory blocks. This overhead can be diminished by lowering one of these factors:
- $M$ can be reduced by increasing cache block size, but this will affect the performance impact of *sharing misses*;
- $P$ can be reduced by *grouping* processors together. The presence bit would not be for a single processor but for a group of them. Within each group a (simpler) snoopy protocol can be used.
==== Limited pointer schemes (LPS)
Optimization to the full bit vector approach to reduce factor $P$.
This scheme exploit the fact that, in most cases, the number of sharers is very low (about 10):
#figure(
image("assets/447b1e7d1252779efcc8d71a0905d56a.png"),
caption: [Number of sharers in a 64-core system]
)
A full bit fector approach is therefore useless, because it would have a lot of 0s. A better solution is to use just 10 pointers to the nodes which are holding the block.
Overflows can be managed in different strategies:
- broadcasting;
- processor grouping;
- sharers invalidation: when there is no more room in the directory for a new sharer, the least recent sharer is removed and the newer takes its place;
==== Sparse directories
Optimization to the full bit vector approach to reduce the factor $M$.
This solutions aims to reduce the size of each directory entry by considering that the majority of the data does not resides in cache, but in the DRAM, and directories need only to care about data in cache.
A single directory entry can hold a *linked list* of cache lines:
#figure(
image("assets/1c4f60715fc3261ff9df592fe442102f.png", height: 19%),
caption: [Sparse directories]
)
This solution increases the overhead of writes, since a full list traversal is required. Also evictions are more compliated because a node must be removed from the list.
== Summary
Cache coherence is mandatory to make parallel programming easier.
Modern computers implement the snoopy protocol. This is also the reason why the number of cores is limited (4 to 12).
Cache in GPUs instead is *manually managed* by the programmer. This allow to scale to a very high number of processors.
Distributed machines have different needs. Broadcasting is practically impossible, so there is a directory-based approach.
== Synchronization
Synchronization is about *protecting access* to shared data in a context where there are multiple processors/threads that may access the same memory area concurrently.
Each thread has a set of both *private variables*, which do not need synchronization, and *shared variables*. Threads communicate implicitly by writing and reading shared variables and coordinate by synchronizing on shared variable.
#highlight(fill: yellow)[Synchronization is a must to avoid *race conditions*].
When writing shared memory programs it's important to reason about *atomicity*. Only reads and writes are atomic by default. When an operation is atomic, all computations happen in *private* registers.
#highlight(fill: yellow)[Atomic operations are a fundamental building block for multi-threaded applications.]
Synchronization is the process of using atomic operations to ensure cooperation between threads.
Synchronization implements *mutual exclusion*: only one thread is performing a specific work at a given time, while other threads *wait* for their turn.
A *critical section* is a portion of code that only a thread at a time can execute, thus access to critical sections must be synchronized between threads.
Synchronization can be of different types:
- mutual exclusion: a thread performs work, the others wait;
- *event synchronization*: an event is raised when the execution of some threads reaches a given point:
- *global* synchronization: all threads must wait for the others to finish before resuming their computations. This is also known as a *join point* and it's implemented using *barriers*;
- *group* synchronization: join operation is restricted to a limited number of threads;
- *point-to-point*: synchronization is only between 2 threads (or very few of them)
A *lock* is a mechanism that prevents other threads from doing something. A lock is applied before entering in a critical section and it's released when leaving it.\
If other threads reach a portion of code with an applied lock, they wait for their turn.
#highlight(fill: yellow)[Locks imply *waiting*], so it's very important to keep the *granularity* of critical sections small.
*Correctness* is another aspect that should be checked througly when writing multithreaded programs.
Synchronization requires *hardware support*. It's not possible to write multithreaded programs with only synchronized reads and writes:
#figure(
image("assets/edbfa63a2caa7caabdaeb791a98d42e5.png", height: 22%),
caption: [Non-correct multithreaded program. The check `if (noNote)` must be atomic.]
)
#figure(
table(
columns: (auto, 1fr),
align: (center, left + horizon),
[
```c
test&set(&address) {
result = M[address];
M[address] = 1;
return result;
}
```
], [checks if a memory address has value 0 and, if so, sets the value to 1. Does nothing if the value is already 1.],
[
```c
swap(&address, register) {
temp = M[address];
M[address] = register;
register = temp;
}
```
], [swaps atomically the content of two memory addresses],
[
```c
compare&swap(&address, reg1, reg2) {
if (reg1 == M[address]) {
M[address] = reg2;
return success;
}
return failure;
}
```
], [performs the atomic swap only if the content of the memory address has a specific value]
),
caption: [Hardware atomic instructions]
)
=== Implementing locks with `test&set`
#figure(
```c
int value = 0;
Acquire() {
while (test&set(value) == 1);
}
Release() {
value = 0;
}
```,
caption: [Lock implementation using `test&set`]
)
If the lock is free, `Acquire()` will set `value` to `1` and will get the lock, otherwise it will wait until `value` is 0.
#figure(
```
milkLock.Acquire()
if (nomilk)
buy milk
milklock.Release()
```,
caption: [Usage of `Acquire` and `Release` primitives. The code between them is the critical section.]
)
=== Synchronization performance impact
Different aspects to keep in mind:
- *latency*: how long does it take to execute a critical section;
- *bandwidth*: how long does it take when many other threads are waiting to execute;
- *traffic* on the bus;
- *storage* requirements;
- *fairness*: all threads should be able to perform work
Locking though `test&set` implies *cache invalidation*, because a value is written into memory. This also implies a lot of *cache coherence* traffic, which kills performance when the number of processors is high:
#figure(
image("assets/9342f49c1cfb3ab10acbe9fbdfbaa41b.png", width: 70%),
caption: [`test&set` coherence traffic]
)
Coherence traffic can be reduced a lot by using private variables and pointers.
#figure(
table(
columns: (auto, auto),
align: (center + horizon, center + horizon),
stroke: none,
[
```c
void lock(volatile int* l) {
while (1) {
while (*l != 0);
if (testandset(*l) == 0) {
return;
}
}
}
void unlock(volatile int* l) {
*l = 0;
}
```
], [
#image("assets/3002629108f521fef8c590002ba2c02b.png")
]
),
kind: image,
caption: [Implementation and coherence traffic of `test&test&set` lock]
)
`test&test&set` lock has a higher latency than plain `test&set`, but it generates much less coherence traffic and thus it has better performance.
Neither `test&test&set` nor `test&set` provide any kind of *fairness*.
`test&test&set` still keeps the bus pressure high because each thread is costantly checking if the lock has been released. Bus traffic can be reduced by implementing an *exponential backoff*:
#figure(
```c
void lock(volatile int* l) {
int amount = 1;
while (1) {
if (testandset(*l) == 0) {
return;
}
delay(amount);
amount *= 2;
}
}
```,
caption: [`test&test&set` with exponential backoff]
)
If a resource is busy, it does not make sense to insist on getting the lock. If a resource is still busy after some time, it means that the lock owner is taking much longer than expected to finish its work, so other processors should wait more.
Exponential backoff can cause severe unfairness, because processors that come to the critical section later wait much less thant the first ones.
A *ticket lock* can be used to improve fairness:
#figure(
```c
struct lock {
volatile int next_ticket;
volatile int now_serving;
};
void lock(lock* l) {
int my_ticket = atomicIncrement(l->next_ticket);
while (my_ticket != l->now_serving); // wait
}
void unlock(lock* l) {
l->now_serving++;
}
```,
caption: [Ticket lock example (first-come first-served logic)]
)
In this example each thread is using the same *shared* variable, so they must be synchronized. Typically an *array-based* lock is preferred:
#figure(
```c
struct lock {
volatile int status[P]; // P = number of processors
volatile int head;
int my_element;
void lock(lock* l) {
my_element = atomicIncrement(l->head);
while (l->status[my_element] == 1);
}
void unlock(lock* l) {
l->status[next(my_element)] = 0;
}
}
```,
caption: [Array-based lock]
)
The polling loop checks only a specific flag inside the shared `status` array.
This adds a memory overhead to the locking mechanism.
== Shared memory issues: consistency
Consistency ensures that the ordering of memory operations to *multiple locations* is maintained.
Coherence is not enough, because it ensures ordering only for memory operations that involves the *single* location. In general programs use *many* variables to control their behaviour, therefore cache consistency is needed.
*Instruction reordering*, which is very common in modern processors (e.g. out-of-order execution), must ensure memory consistency.
#figure(
table(
columns: (auto, auto),
align: (center + horizon, center + horizon),
[*Single thread*], [*Multithread*],
[
#table(
columns: (auto, auto),
stroke: none,
align: (right, left),
[*Ordering 1*], [*Ordering 2*],
[
```c
A = 5;
flag = 1
```
], [
```c
flag = 1;
A = 5;
```
]
)
], [
#table(
columns: (auto, auto),
stroke: none,
align: (right, left),
[*Thread 1*], [*Thread 2*],
[
```c
A = 5;
flag = 1;
```
], [
```c
while (flag == 0);
printf(A);
```
]
)
]
)
)
Instruction reordering in single thread programs is not a big deal if there are no dependencies between variables. In multithreaded programs, however, reordering must be done with care because it's common to implement *inter-processor* control schemes: instructions may appear to be independent when looked at single thread level, but when looked at multithreaded level they are not independent.
=== Memory operation ordering
+ $W -> R$: the write must complete before the read;
+ $R -> R$: the first read must complete before the second;
+ $R -> W$: the read must complete before the write;
+ $W -> W$: the first write must complete before the second
=== Sequential consistency
A sequential consistent memory model preserves all those orderings when code is executed, but only for the *same thread*. It cannot guarantee order across multiple threads.
#table(
columns: (1fr, 1fr),
align: (center + horizon, center + horizon),
stroke: none,
[*Thread 1*], [*Thread 2*],
[
```c
B = 0;
A = 1;
if (B == 0)
printf("Hello");
```
],
[
```c
A = 0;
B = 1;
if (A == 0)
printf("World");
```
]
)
If this code is executed on a sequential consistent memory model, the output can either be nothing, `Hello` or `World`, but it can never be `Hello World`.
Sequential consistency makes programs easier to understand for programmers: what they see in the code is also what the machine sees when executing the program. However sequential consistency is very expensive, because all memory accesses should be delayed until all invalidations complete. For this reason
#highlight(fill: yellow)[sequential consistency has never been used in practice].
=== Relaxed memory consistent
Since sequential consistency is expensive, some orderings are *relaxed* if they are acting on different memory addresses. This allows to implement *memory latency hiding*: while a processor is writing `A`, the other can read `B` (as long as these variables do not depend on each other).
Latency hiding on writes is implemented by adding a *write buffer* to the load/store unit. As long as the processor has put a "write request" in this buffer, it can forget about it (it will be carried on asynchronously) and it can proceed with its work. Writes in this buffer are applied sequentially, so the $W -> W$ ordering is preserved, but the $W -> R$ ordering is relaxed.
In *total store ordering* (TSO) a processor can move its own reads before its own writes: P1 can read `B` before its write to `A` is seen by other processors, but other processors must wait to see the new value of `A` before reading `B`.
In *processor consistency* (PC) instead this is not required: every processor can read `B` before the write to `A` is seen by all the others.
Both TSO and PC only relax $W -> R$ ordering. Other orderings are still preserved.
*Partial store ordering* (PSO) allows $W -> W$ reordering too:
#figure(
table(
columns: (auto, auto),
align: (right, left),
stroke: none,
[*Thread 1*], [*Thread 2*],
[
```c
A = 5;
flag = 1;
```
], [
```c
while (flag == 0);
printf(A);
```
]
),
kind: raw,
caption: [With PSO, T2 may observe changes on `flag` before changes on `A`.]
)
*Weak odering* and *release consistency* allow *all* orderings to be violated. Each processor must support special synchronization operations, called *memory fences*:
#figure(
image("assets/ea9de2f16ce54e8185d674796e020387.png", height: 17%),
caption: [Reordering with memory fences]
)
- memory accesses before the fence must complete before the fence issues;
- memory accesses after the fence cannot begin until fence instruction is completed
A fence may look like a barrier, but they are very different things:
- a barrier synchronizes execution of multiple threads;
- a fence only blocks memory operations
A fence can be placed after a write to force other threads to wait until the result of that operation is propagated to all threads.
PSO is so widespreaded, even though it further complicates programmer's life, because programmers already need to take care of synchronization anyhow, so they are able to handle memory ordering too.
Fences are typically implicit upon unlocks and barriers.
= Performance of parallel programming
3 factors affect performance of a parallel program:
- *coverage*: the amount of parallelism in an algorithm;
- *granularity*: how the work is partitioned between processors;
- *locality*: how often a value is found in cache
Programs are composed of sequential parts and parallel parts. The whole point is how big those parallel parts are.
Theoretically, speedup due to parallelization should increase linearly with the number of processors. However, in practice this almost never happens due to the *Amdahl's law*.
#definition(
title: [#highlight(fill: yellow)[Amdahl's law]]
)[
Performance improvement gained from using some faster mode of execution is limited by the fraction of time that execution model can be used.
]
This means that if there are few parallel sections, or each parallel section is very small, the speedup obtained by parallelization is very limited.
If $p$ is the fraction of work that can be parallized and $n$ is the number of processors, the speedup can be obtained by:
$
"speedup" = frac("old execution time", "new execution time") = frac(1, (1 - p) + frac(p, n))
$
Linear speedup can be achieved only for $p = 1$, i.e. the *whole program* is parallelizable, which is quite rare in practice. However, as $p$ decreases, the obtained speedup drops dramatically too.
Amdahl's law explains why performance improvement across multicore CPU generations stays around 22%, which is much less than the 52% of the single core era.
Amdahl's law is also another reason why the number of CPU cores has remained low over time.
#highlight(fill: yellow)[Performance of parallel applications are not bounded by Amdahl's law only, but also by the intrinsic overhead of parallelism]:
- cost to start a thread;
- communication cost between threads;
- extra code required to make the program parallel
Parallism is a *tradeoff*. An algorithm needs sufficiently large units of parallel work, but not so large that not all processors can work together.
== Granularity
Granularity is a measure of the ration between useful work and additional work implied by the parallelism.
Granularity affects *load balancing*.
#figure(
table(
columns: (auto, auto),
align: (left, left),
[*Fine-grain parallelism*], [*Coarse-grain parallelism*],
[
- higher overhead, because there are more synchronization instruction;
- better load balancing
], [
- overhead is better amortized
- difficult to load balance efficiently (not all processors have the same amount of work)
]
),
caption: [Fine grained vs coarse grained parallelism]
)
#highlight(fill: yellow)[Load balancing is extremely important when using barriers, because the slowest processor dictates the overall execution time].
#figure(
table(
columns: (auto, auto),
align: (left, left),
[*Static load balancing*], [*Dynamic load balancing*],
[
- the amout of work per processor is defined at *complie time*;
- works well if all processors are homogeneus, which is not always the case (e.g. NUMA machines);
- it's not always possible to distribute the work equally between all processors, e.g. due to *data dependencies*
],
[
- there is *task queue* from which a processor takes a task when it's idle;
- helps in reducing imbalances in work distributions;
- it's the *processor itself* that asks the runtime system for work to do
]
),
caption: [Static vs dynamic load balancing]
)
== Communication and synchronization
When executing an application in parallel, processors need to *communicate* partial results and to *synchronize*.
Performance impact of communication depends on the available *bandwidth* and *latency*.
Interconnection can either be implemented using a *shared bus* or a *network-on-chip*:
- shared bus provides lower latency, but also lower bandwidth because processors can talk one at a time;
- NoC provides lots of bandwidth, but has a higher latency. Latency is also not uniform because it depends on the number of hops in the network.
#figure(
image("assets/14cfa2da2b65852a3e6b9ec18bb1e927.png", width: 46%),
caption: [Shared bus vs NoC]
)
Communication between processors cannot be avoided when executing a parallel application. Latency hiding is the only way to reduce its cost.
Latency hiding can be implemented in different ways:
- overlapping message sending with computation;
- data prefetch;
- switching to other task when a processor is idle;
- task *pipelining*
Every instruction of a program can be modeled with 2 types: fetching data from the memory and executing work. These two types of instructions can be *pipelined* to keep both the CPU and the MEM unit working:
#figure(
image("assets/cc4bad3e822f9dfbffe352a2bd255aa3.png", width: 65%),
caption: [CPU and MEM utilization with and without pipelining]
)
== Locality
In a shared memory multiprocessor, memory access can either be:
- uniform (UMA): there is a single, centralized main memory. Memory latency is the same for all processors;
- non-uniform (NUMA): memory is physically partitioned between different processors, but they all share the same address space. Memory latency is different for each processor
*Partitioned global address space* (PGAS) means that every processor is able to address any portion of the memory, but it's not able to access it physically. This is the case of *distributed* shared memory.
Even though processors are executing the same code, there could be *locality* problems because not all processors have the same latency in reaching the memory.
Two key aspect to optimize the memory hierarchy:
- reducing *memory latency*:
- maximize the *memory bandwidth*
Compiler back-ends help a lot in exploiting locality.
Improving locality in programs deals with *reusing data*:
- *temporal locality*: when reading a memory address, there is a high probability that the same address is read again after a short time;
- *spatial locality*: when reading a memory address, there is a high probability that in a short time also addresses near that one will be read
#figure(
```c
for (int i = 0; i < N; i++)
for (int j = 1; j < N - 1; j++)
A[j] = A[j + 1] + A[j - 1]
```,
caption: [This loop uses both temporal and spatial locality]
)
Programs should do most of their work on *local* data, because local memories can be much smaller (and thus faster).
When iterating over matrices, *loop permutation* can be benificial to improve data locality:
#figure(
table(
columns: (auto, auto),
align: (center + horizon, center + horizon),
stroke: none,
[*Column-major*], [*Row-major*],
[
#image("assets/ebd232c30d7acdf3c39b417ca1464d3b.png", width: 80%)
],
[
#image("assets/bec16051aec1b581f437775f55886c07.png", width: 80%)
]
),
kind: image,
caption: [Row-major traversal vs column-major traversal]
)
=== Tiling
#highlight(fill: yellow)[Tiling (or blocking) is a way to reorder loop iterations when the data structure is too big to fit in a single cache line].
The iteration space is splitted in different blocks, where each one is small enough to fit in a cache line. This improves data locality also when the data structure is very big.
#figure(
image("assets/bcd8b0ff82079bf651cdc2cbe7f7c4a7.png", width: 55%),
caption: [Tiling example]
)
Tiling also allows to reduce the number of cache evictions because when a block of the data structure is read from the main memory, all of its content is used.
#highlight(fill: yellow)[Tiling can help to achieve a *superlinear speedup* because it improves also the sequential part of the program].
#pagebreak(weak: true)
=== Memory banking
Memory is often organized in several *independent banks*:
#figure(
image("assets/fbf8ec24042e3c179e37cabd292ca56c.png", width: 30%),
caption: [Memory banking]
)
Each bank has a single port to access it, so different threads should use different banks. This can be implemented by changing the parallelization scheme or the memory layout of the data.
= Parallel programming in practice
#figure(
image("assets/fc2741a4bbef52b9ac8912c063de0bc6.png", height: 30%),
caption: [4 steps of parallelization]
)
== Decomposition
In most cases, decomposition must be manually performed by the programmer. Automatic decomposition by the compiler continues to be a challenging research problem.
Programs usually decompose naturally in *function calls* and *loop iterations*.
Task decomposition must be:
- *flexible*, both in the number of tasks and in the size of each task;
- *efficient*: each task should have enough work to do to amortize the overhead of parallelization;
- *simple*: the code has to remain readable and easy to debug
If the program uses some data structure (array, matrix, tree, etc.), *data decomposition* is likely possible. This decomposition executes the same task on multiple elements of the data structure at the same time.
Functions that deal with the same data structure can often be *pipelined*.
#definition(
title: [#highlight(fill: yellow)[Bernstein's condition]]
)[
Given $R_i$ the set of memory locations read by task $T_i$ and $W_j$ the set of memory locations written by task $T_j$, $T_i$ and $T_j$ can run in parallel if and only if *all* of these are verified:
$
R_i sect W_j = emptyset\
R_j sect W_i = emptyset\
W_i sect W_j = emptyset
$
]
=== Decomposition example: A2D-grid based solver
In this algorithm, each row element depends on both the previous column and the previous row:
#figure(
image("assets/f3ddb6bf9b23364d31d2578c0d143b47.png", height: 23%),
caption: [Dependencies in A2D-grid based solver]
)
When looked in this way, it seems that no parallelism can be extracted from this algorithm. However a careful analysis can spot that parallelism does exist along matrix *diagonals*:
#figure(
image("assets/43cf130fe86476115c4ec3d39529bf6a.png", height: 23%),
caption: [Parallelism along diagonals in the A2D-grid based solver]
)
Task decomposition based on diagonal elements however is not optimal, because:
- each task has a different amount of work (each diagonal has a different length);
- code must be drastically changed to iterate through diagonals instead of rows/columns
#pagebreak(weak: true)
A better approach is to change the order in which grid cells are updated:
#figure(
image("assets/9fd5f94901beee01cb06930b01be40b5.png", height: 23%),
caption: [Red-black coloring]
)
Red-black coloring first updates #text(fill: rgb("#E32400"))[*red*] cells, then it moves on *black* cells.
The result of these two algorithm (sequential and parallel) will not be the same, however in this context this is not an issue because Gauss-Seidel is itself an *iterative* algorithm which only provides an *approximation* of the result (not an exact result).
#highlight(fill: yellow)[Decomposition requires the programmer to have a deep understanding of the problem].
== Assignment
There are many more tasks than cores/threads, so it's important to achieve a good *balancing*.
#figure(
image("assets/2c2b3a4c4cff839bde469f4c9ec4086a.png", height: 16%),
caption: [Example of poor balancing. P4 takes 2x longer to complete, which menas that 50% of program exeuction time is sequential]
)
Although decomposition is often in charge to the programmer, assignment is typically performed automatically by the compiler or the runtime system.
#figure(
image("assets/186b6aaac5a75283a06a31cfade17f72.png", height: 21%),
caption: [Two possible assignment strategies for the grid solver example. Which one is better depends on the system the program is run on.]
)
Assignment can either be *static* or *dyamic*.
Static assignment does not have any runtime overhead, but it's applicable only when all tasks have a similar execution time or at least the execution time of each task is *predictable*, because this allows to have a good balance *on average*.
The simplest way to implement dynamic assignment is through a *centralized queue*: all tasks are pushed in this structure at the beginning of program's execution, then each threads pops one task from this queue when it's idle.
Task *granularity* is very important in dynamic assignment. Small tasks help achieve a better balancing, but they also generate more overhead.
Dynamic assignment should be smart: the runtime system should consider the state of other workers, expected execution time, dependencies, etc. when assigning a task to a worker (the runtime system should not choose the task to assign randomly).
Access to the task queue should be *synchronized* between processors. When there are a lot of them it may be benificial to use *private* work queues (one for each processor) instead of a global one. When a private queue is empty, the processor can "steal" work from another one.
== Orchestration
Orchestration means adding code to manage communication and synchronization between workers. The goal is to reduce the overhead of parallelization.
Orchestration depends on both the architecture and the cost of available synchronization/communication APIs (if they are cheaper, adding more of them it's not a big deal).
Back to the grid solver example, initial orchestration can be done like this:
#figure(
image("assets/6971bdf7fb0d75e045722643ac2a6254.png", height: 18%),
caption: [Grid solver initial orchestration idea]
)
By looking at dependencies, it's clear that blocked assignment requires much less communication between workers, so this approach should be preferred:
#figure(
image("assets/3b223385e6f8be776c617b571e90dc9b.png", height: 22%),
caption: [Blocked vs interleaved assignment communication]
)
Orchestration is implemented differently based on the memory architecture of the system.
=== Shared address space
Here synchronization is programmer's responsibility, who should place barriers and locks properly.
Programmer can use the `getThreadId()` primitive to differentiate work between threads.
#figure(
```c
void solve(float* A) {
int threadId = getThreadId();
int myMin = 1 + (threadId * n / NUM_PROCESSORS);
int myMax = myMin + (n / NUM_PROCESSORS);
while (!done) {
diff = 0.f;
barrier(myBarrier, NUM_PROCESSORS);
for (int j = myMin; j < myMax; j++) {
foreach (red cell i in this row) {
float prev = A[i, j];
A[i,j] = 0.2f * (A[i-1,j] + A[i,j-1] + A[i,j] + A[i+1,j], A[i,j+1]);
lock(myLock);
diff += abs(A[i,j] - prev);
unlock(myLock);
}
}
barrier(myBarrier, NUM_PROCESSORS);
if (diff / (n*n) < TOLERANCE)
done = true;
barrier(myBarrier, NUM_PROCESSORS);
}
}
```,
caption: [Pseudo-code example for grid solver]
)
This code can be improved in different ways:
+ the critical section can be moved *outside* the `for` loop by accumulating on a *private* variable (instead of having all threads accumulating on the same shared variable);
+ one barrier can be removed by having *multiple copies* (stored in an array) of the `diff` variable to reduce dependencies between iterations. This trade off (more memory footprint to reduce parallelization overhead) is very common in parallel programming.
=== Distributed memory system (message passing)
The grid can be divided evenly between multiple threads. Each thread may have some *ghost cells*, which are cells that have been replicated from other threads and therefore are ownership of that thread.
#figure(
image("assets/5c1618ceb3bf68ae53074f54d38df254.png", height: 35%),
caption: [Ghost cells]
)
Every thread must communicate to the next one if there are more iterations to do.
== Mapping to hardware
Mapping logical workers to hardware execution unit can be done by:
- the operating system;
- the compiler (e.g. by using OpenMP);
- the hardware (e.g. what CUDA does)
Placing related threads on the same processor may help in maximizing *locality* and reducing the overhead of communication. But also placing unrelated threads on the same processor may be beneficial in order to use the hardware more efficiently.
= OpenMP programming
OpenMP is the standard programming model for *shared memory* systems. It consists in a collection of compiler directives, library APIs and environment variables.
OpenMP requires special support by the compiler. Both `gcc` and `clang` nowdays fully support it.
In the beginning, OpenMP focused only on *loops*, especially *DOALL* loops (loops without dependencies across iterations). OpenMP primarly targeted *expert* programmers who did not want to write low level code to handle parallelization.
Over time, OpenMP has broadened its focus also to things other than loops (e.g. tasks, accelerators/heterogeneous systems) and has spent lot of efforts in making parallel programming easier for everyone, also for non-expert programmers.
#pagebreak(weak: true)
OpenMP adheres to the *fork/join model*:
#figure(
image("assets/06e5225e21ac53e3667a8e9edc6b1761.png", width: 80%),
caption: [Fork-join model. The program is started by the *master thread*, which spawns new threads (*fork point*). At the end of parallel computation there is an implicit barrier (*join point*) where execution resumes on the master thread only.]
)
OpenMP provides a set of `#pragma` *directives* to deal with:
- definition of *parallel regions*;
- *work sharing* (how work is distributed between threads);
- *synchronization*
Each directive may have zero or more *clauses* to better specify how the directive should work.
OpenMP provides also a set of runtime APIs (e.g. to get the current thread identifier).
== `parallel` directive
OpenMP fundamental construct to outline parallel computation within a sequential program.
When this directive is encountered, OpenMP creates a *parallel region*. This directive by itself does not create parallelism however, because work is simply *replicated* on all threads. Worksharing directives must be used to have different threads execute different things.
#figure(
```c
#pragma omp parallel
{
printf("Hello world!");
} // this is an implicit barrier
```,
caption: [OpenMP `parallel` directive]
)
When OpenMP encounters a parallel region, by default it creates one thread for each CPU core. This can be changed using the `num_threads(n)` clause.
=== Memory view inside parallel region
In an OpenMP parallel region a variable can either be *private* to the current thread or *shared* between all threads.
OpenMP provides a set of *data sharing clauses* to specify how each variable should be considered.
If no data sharing clauses are used:
- variables defined *inside* the parallel region are treated as *private* variables;
- variables defined *outside* the parallel region are treated as *shared* variables:
#figure(
```c
int a = 5; // shared
#pragma omp parallel
{
int thread_id = omp_get_thread_num(); // private
printf("Thread ID: %d\n", thread_id);
}
```
)
OpenMP provides also 2 additional data sharing clauses:
- `firstprivate`: variable is private, but it's initialized using a shared value (*copy-in* semantics);
- `lastprivate`: variable is private, but when it's written the change is propagated to all other threads when the parallel region ends (*copy-out* semantics)
In both cases storage is *private*, so cache coherence is not a problem.
== `for` directive
OpenMP `for` directive is a worksharing directive that parallelizes a `for` loop.
#figure(
```c
#pragma omp parallel for
for (int i = 0; i < N; i++)
{
c[i] = a[i] + b[i];
} // implicit barrier
```,
caption: [OpenMP `for` directive. An implicit barrier is added after the `for`.]
)
The `nowait` clause may be used to avoid adding the implicit barrier:
#figure(
```c
#pragma omp parallel for nowait
for (...) {
...
}
```,
caption: [OpenMP `nowait` clause]
)
=== `schedule` clause
OpenMP default loop scheduling is *static*: loop's iteration space is divided evenly between all threads.
Programmer can change loop scheduling to *dynamic* by using the `schedule` directive.
Loop scheduling may specify a *chunk factor*, which determines the *unit of work* (i.e. how many iterations are executed together by a single thread).
#figure(
table(
columns: (auto, auto),
align: (center + horizon, center + horizon),
[*Static scheduling*], [$ ceil(frac(N, N_("threads"))) $],
[*Dynamic scheduling*], [$ 1 $]
),
caption: [Default chunk factor for static and dynamic scheduling]
)
Chunk factor determines parallelization *granularity*.
#figure(
table(
columns: (auto, auto, auto),
align: (left, left, left),
[#align(center)[*chunk size*]], [#align(center)[*T1 iteration space*]], [#align(center)[*T2 iteration space*]],
[default: $c = frac(22, 2) = 11$], [#align(center)[from `i = 0` to `i = 10`]], [#align(center)[from `i = 11` to `i = 21`]],
[#align(center + horizon)[5]], [
- from `i = 0` to `i = 4`;
- from `i = 10` to `i = 14`;
- from `i = 20` to `i = 21`
], [
- from `i = 5` to `i = 9`;
- from `i = 15` to `i = 19`
]
),
caption: [Example of static scheduling with a different chunk factor (2 threads and 22 iterations). With a chunk factor of 5, work is slightly unbalanced (T1 executes 12 iterations, while T2 only 10).]
)
#highlight(fill: yellow)[With static scheduling you know in advance exactly which thread will execute a particular iteration. This is not possible instead with dynamic scheduling, because iterations are assigned to threads as they finish their work.]
== `barrier` directive
Can be used to place an barrier *explicitly*.
== `critical` directive
Marks a *critical section* i.e. a portion of code that only *one thread at a time* can execute.
#figure(
```c
double area = 0;
int n;
#pragma omp parallel for shared(area)
{
for (int i = 0; i < n; i++) {
double x = (i + 0.5) / n;
#pragma omp critical
area += 4.0 / (1.0 + x * x);
}
}
double pi = area / n;
```,
caption: [OpenMP `critical` directive example]
)
== `reduction` clause
Implements a *reduction*, a programming pattern in which a partial result is *accumulated* into a variable.
`reduction` clause can be used to avoid the `critical` directive, and therefore to achieve better performance because the code is no longer sequential.
Inside the parallel region, accumulation is done on *private* variables automatically created by OpenMP. When the parallel computation ends, each one of these private variables is summed together and the result is written to the shared variable.
#figure(
```c
double area = 0;
int n;
#pragma omp parallel for shared(area) reduction(+:area)
{
for (int i = 0; i < n; i++) {
double x = (i + 0.5) / n;
#pragma omp critical
area += 4.0 / (1.0 + x * x);
}
}
double pi = area / n;
```,
caption: [OpenMP `reduction` clause example]
)
== `master` directive
Denotes a portion of code that can be only executed by the *master* thread. No synchronization is implied, because all other threads simply skip this code.
== `single` directive
Denotes a portion of code that can be executed only by one thread, which may not be the master thread.
`single` is different from `critical` because the first will execute the work *only once*, while the latter will execute the work many times as the number of threads.
A barrier is implicitly added at the end of a portion of code marked with this directive.
== `sections` directive
This directive was OpenMP first attempt to exploit *task parallelism*. Each `section` directive detones a task which can be executed in parallel with others:
#figure(
```c
#pragma omp parallel sections
{
#pragma omp section
v = alpha();
#pragma omp section
w = beta();
#pragma omp section
y = delta();
}
x = gamma(v, w);
z = epsilon(x, y);
```,
caption: [OpenMP `sections` example]
)
== Tasking model
`sections` directive allows to exploit task parallelism, but each task must be *statically* outlined in the code. This is not always feasible, for example when the body of a loop (or of a recursive function) is marked as a task:
#figure(
```c
for (Node* n = l->first; n != NULL; n = n->next) {
process(n);
}
```,
caption: [`sections` directive cannot be used here because loop *trip count* is not known in advance]
)
This code can still exploit task parallelism by combining `parallel` and `single` directives:
#figure(
```c
#pragma omp parallel
{
for (Node* n = l->first; n != NULL; n = n->next) {
#pragma omp single nowait
process(n);
}
}
```,
caption: [Task parallelism using `single` directive]
)
But this too is not feasible, because the code is counter-intuitive and has performance issues.
#figure(
```c
void visit_tree_node(Node* n) {
#pragma omp parallel sections
{
#pragma omp section
if (n->left != NULL)
visit_tree_node(n->left);
#pragma omp section
if (n->right != NULL)
visit_tree_node(n->right)
}
process(n);
}
```,
caption: [Tree traversal is another example of code hard to parallelize using `sections`]
)
The problem in tree traversal is that tasks are created *recursively*. Recursive task creation may not be supported by all compilers and, besides that, creating too many tasks generates a severe overhead.
For these reasons, OpenMP introduced its *tasking model* in its specification 3.0.
Task parallelism in OpenMP allows to parallelize irregular problems, like unbounded loops and recursive algorithms.
OpenMP tasking model is composed of different parts:
- *creating* tasks;
- data scoping (which variables are private, shared, etc.);
- *synchronization* between tasks;
- execution model: how task are created, managed and executed in the system
#highlight(fill: yellow)[An OpenMP task is a unit of work which execution may be deferred (but it may also start immediately).]
OpenMP tasks are composed of 3 parts:
+ code to execute;
+ data environment;
+ control variables
#figure(
```c
void traverse_list(List* l) {
for (Node* n = l->first; n != NULL; n = n->next) {
#pragma omp task
process(n);
}
}
```,
caption: [OpenMP tasks are defined using the `task` directive]
)
A thread that encounters the `task` directive will create a *task description*, which packages code and data environment, for that task.
OpenMP tasking model is highly composable: tasks can be nested and can be used together with other OpenMP constructs (`for`, `sections`, etc.).
#highlight(fill: yellow)[There is no synchronization between OpenMP tasks by default]. In the example above, when `traverse_list` returns it's not guaranteed that all tasks have been executed. This can be changed using the `taskwait` directive, which acts like a barrier for tasks:
#figure(
```c
void traverse_list(List* l) {
for (Node* n = l->first; n != NULL; n = n->next) {
#pragma omp task
process(n);
}
#pragma omp taskwait
}
```,
caption: [OpenMP `taskwait` example]
)
A *team* is a set of threads belonging to the parallel region that encloses a code block. Tasks are executed by a thread of the team that created it.
Typically, the thread that creates the task is not the one who will execute it, but this distinction is not mandatory (the same thread may both create and then execute the task).
When a parallel region begins, one implicit task is created for each thread, so #highlight(fill: yellow)[there are always at least as many tasks as threads]. #highlight(fill: yellow)[There is also always a first-level task that encloses all the others].
Threads can *suspend* (and then resume) tasks. Task scheduling is managed by OpenMP runtime and it's transparent to the programmer.
=== `depend` clause
Used to specify *dependencies* between tasks and therefore have *point-to-point synchronization* between them.
A dependency may be in task's *inputs*, *outputs* or both.
#figure(
```c
#pragma omp task shared(x) depend(out: x)
x = do_something();
#pragma omp task shared(x) depend(in: x)
do_something_else(x);
#pragma omp task shared(x) depend(in: x)
do_something_else_again(x);
```,
caption: [OpenMP `depend` clause example]
)
=== `if` clause
This clause is not specifically related to OpenMP tasking model, but one of its main uses is to avoid task creation when the amount of work is very limited:
#figure(
```c
#define CUTOFF 20
int fib(int n) {
int x, y;
#pragma omp task shared(x) if (n > CUTOFF)
x = fib(n - 1);
#pragma omp task shared(y) if (n > CUTOFF)
y = fib(n - 2);
#pragma omp taskwait
return x + y;
}
```,
caption: [This example uses the `if` directive to avoid creating tasks with a small amount of work to do. This helps reduce the overhead because the number of tasks will be much lower.]
)
== OpenMP accelerator model
OpenMP accelerator model deals with *heterogeneous systems*. One of its main goal is to unify the programming standard across different architectures (GPU, SIMD units, etc.).
Each architectural component is considered as a *device*. There is always one *host* device and there may be multiple *target* devices. System memory is divided between *host memory* and *device memory*.
Each device is composted of one or more *compute units*. Each compute unit is divided into one or more *processing elements*.
#figure(
image("assets/08e811c2cf57ab395e230594e012e819.png", height: 20%),
caption: [OpenMP execution model using accelerator]
)
=== `target` directive
Denotes a portion of code that runs on the accelerator.
Similar to `parallel` directive, `target` directive by itself does not create parallelism: it *replicates* the same work on multiple accelerator threads.
When using the `target` directive, `map` clause allows to specify how variables are mapped between host and target data environments.
#figure(
```c
#pragma omp target map(to: b, c, d) map(from: a)
{
#pragma omp parallel for
for(int i = 0; i < n; i++)
a[i] = b[i] * c + d;
}
```,
caption: [`target` directive example]
)
Offloading to the target is *synchronous* by default (the host waits until the target has finished). This can be changed by using the `nowait` clause.
=== `teams` directive
Worksharing directive that creates a *legue* of thread teams.
#figure(
image("assets/a712e83c4e80fa3027c3763581d7cb83.png", height: 13%),
caption: [Legue of threads]
)
Thread in different teams cannot synchronize with each other.
Only the master thread of each team executes the code inside the `teams` region.
=== `distribute` directive
Worksharing directive that distributes the iteration space of a loop across the master threads of each team executing the region.
Scheduling is static by default and can be changed using the `dist_schedule` directive.
#figure(
image("assets/8811c3e074b447f6e338a406ea0d1f76.png", height: 21%),
caption: [OpenMP accelerator model]
)
=== `declare target` directive
It's not possible to invoke other functions inside a `target` region unless that function is marked with `declare target` directive:
#figure(
```c
#pragma omp declare target
int foo() {
...
}
#pragma omp end declare target
int main() {
#pragma omp target
foo();
return 0;
}
```,
caption: [`declare target` example]
)
= GPU acceleration
#highlight(fill: yellow)[A GPU is an *accelerator* for graphical work]. GPUs are designed to exploit the high amount of *data* and *pipeline* parallelism in these problems (e.g. increasing the brightness of an image is an addition of a constant to a matrix of pixels).
A GPU is an heterogeneous multi-processor chip highly specialized for graphical operations:
#figure(
image("assets/652318372ddf54dc4b687109505089b0.png", height: 12%),
caption: [Overview of GPU architecture]
)
Shader cores are *programmable processors*.
The work distributor distributes work among different shaders. It can be implemented both in hardware or in software.
Design of a GPU core starts from the CPU core:
#figure(
image("assets/e28ff2c6c53bc1dc751ad904d18504ac.png", width: 80%),
caption: [CPU core architecture]
)
CPU core is much complex (branch prediction, out-of-order execution, etc.) and this limits the amount of them that can be on a chip. GPU cores cannot be so complicated, because there is the need to have *thousands* of them.
Therefore, #highlight(fill: yellow)[a GPU core is like a CPU core slimmed down]. There are multiple ALUs with a *single* fetch/decode unit for all of them:
#figure(
image("assets/78702341cbf85079263ce580f3f5b4ce.png", height: 20%),
caption: [GPU core architecture]
)
This architecture exploits *SIMD parallelism*: the same instruction is applied on different streams of data; there is no need to fetch/decode the same instruction multiple times.
Compilers transform scalar instructions into *vector instructions* to make them work on GPU hardware.
GPU cores can also use *task parallelism*, but the granularity is somewhat limited by the vector instructions.
SIMD processing does not imply SIMD instructions. Instructions should be transformed in SIMD form either manually by the programmer or automatically by the hardware.
#highlight(fill: yellow)[Conditional execution is a pain for this type of architecture] because the parallelism is broken: while one ALU is evaluating a conditional expression, others must wait for it to finish.
Stalls caused by dependencies between instructions are avoided using a large *context storage*. This helps having a large number of "waiting" fragments, so when one of them stalls there is a high probability that another one is ready to execute.
There is a tradeoff between the number of contexts and the size of each one. Higher context number means better latency hiding, because there can be more tasks in the queue, but it also mean that the size of each context cannot be too big.
Context switching can be performed either by hardware or software.
== Memory architecture
CPU cores have multiple levels of cache to reduce memory latency.
#highlight(fill: yellow)[In a GPU the problem is no longer the latency of the memory, but is its *bandiwdth*], because GPU deals with SIMD instructions. Therefore GPUs need an entire different technology for their memories (e.g. GDDR5) optimized for bandwidth instead of latency.
Memory bandwidth is a critical resource when developing GPU applications. Programmers needs to keep low the pressure on the memory system, for example by increasing the arithmetic intensity (do more math instead of reading already computed results) or by using device memory (e.g. CUDA shared memory).
An efficient GPU workload should:
- have thousands of independent pieces of work, so all (or most of them) ALUs can be used and lots of context are available for switching;
- not be limited by memory bandwidth
= CUDA programming
CUDA is a programming model for NVIDA GPUs. It's much more complex than OpenMP, because code has been changed more heavily than OpenMP.
#figure(
image("assets/afc07d2d76cdfdcd499ba1a35aa69387.png", height: 28%),
caption: [CUDA execution model]
)
The CPU sees the GPU as an external processor, with its own memory, capable of executing lots of threads in parallel.
Data-parallel parts of the application are outlined within a *kernel* function that every thread on the device executes#footnote[SIMT paradigm: single instruction multiple threads.].
GPU threads are much more lightweight than CPU ones, but to have the maximum efficiency there must be thousands of them executing.
In a CUDA application, sequential code runs on the CPU, while parallel parts are offloaded to the GPU.
#figure(
image("assets/08eb0f7790713f6d50c227b0a3646787.png", height: 25%),
caption: [Sequential program vs CUDA parallel program]
)
CUDA threads are grouped in *blocks*. Blocks are in turn grouped in *grids*.
#figure(
image("assets/efdcc63633790ce9b5244c476ae85f99.png", height: 25%),
caption: [CUDA grid]
)
Limits on the number of threads/blocks depend on the architecture.
== How to port sequential code into CUDA
+ identify parallel parts of the code and isolate them in kernel functions;
+ identify data needed by each kernel that must be transferred on the device;
+ implement the required CUDA kernels;
+ modify the host code to invoke CUDA kernels
#highlight(fill: yellow)[Every CUDA thread executes the same kernel function, but it operates on different portions of the same data structure].
CUDA provides different qualifiers for kernels:
- `__global__`: executed *asynchronously* on the device, callable from the host only;
- `__device__`: executed on the device, callable on the device only;
- `__host__`: executed on the host, callable on the host only
`cudaMalloc()` and `cudaMemcpy()` APIs can be used to allocate and to copy data to/from the device respectively. These are synchronous APIs, but CUDA also provides an asynchronous variant.
#pagebreak(weak: true)
When a kernel is launched on the device:
+ each block is assigned to a streaming multiprocessor;
- there is no specific order in which blocks execute;
- once a block is assigned to a SM it cannot migrate to other SMs;
+ threads in each block are grouped in teams called *warps*;
+ the scheduler selects a warp for execution among the available blocks;
+ idle blocks execute when another block stalls or has completed execution;
+ every CUDA core executes one of the threads inside a warp
CUDA kernels scale transparently over different architectures.
#figure(
image("assets/aa3ae1e2e437af63150751e524d35a4c.png", width: 80%),
caption: [Example of high CUDA scalability]
)
Mapping between blocks and SM is not determined statically; it depends on the available execution capacity.
Threads inside the same block execute concurrently on the same SM, while threads of different blocks execute concurrently over different SMs.
*Registers* are a space where each thread can store its data. Registers are segmented by threads: the scheduler does not swap the content of the registers when performing context switching, but different threads access different sections of the register.
The number of registers required by a thread decreases the parallelism of the application, because there is less space to store data for other threads and therefore there is less space to perform context switching efficiently.
Example: if an architecture has 32.768 regsiters, each block has $32 times 8$ threads and the kernel needs 30 registers, a single SM can run only $floor(frac(32.768, 30 times 32 times 8)) = 4$ blocks.
== CUDA driver API
CUDA currently supports 2 APIs:
- CUDA driver API, which allows very low-level operations
- C for CUDA (CUDART), which is much more easier to use and it's based on the CUDA driver API
#figure(
image("assets/e13d868c294eb4addb423ea93575cebc.png", height: 17%),
caption: [CUDA APIs scheme]
)
#figure(
image("assets/3605a5a84edcbd87ae67c6ce47283ad3.png"),
caption: [This example shows how much CUDA runtime API is easier than the driver API]
)
== CUDA compiler
CUDA compiler processes both host and device code, then it splits them.
CUDA compilers transforms device code into *PTX*, which is CUDA's ISA.
== CUDA memory model
#figure(
image("assets/95ba5dbd8d2828718c1176007494bc1c.png", height: 30%),
caption: [CUDA memory scheme]
)
=== Global memory
Largest R/W memory available on the device shared among all blocks. It's a high-latency high-bandwidth memory.
`cudaMalloc` allocates memory in this region.
Global memory is *column-major*. Threads should access it using an *offset* instead of a *stride*.
#figure(
image("assets/837e6e6c5d3817045c887a408bf87506.png", height: 30%),
caption: [Offset vs strided memory access]
)
Between global memory and SMs there are 2 cache levels:
- L1, private to the single SM;
- L2, shared among all SMs
Load/store operations in global memory are handled by the load/store unit. Every load/store operation is started from all threads of a warp at the same time.
=== Shared memory
Fast memory within the SM. "Shared" is misleading here, because this memory is shared only between threads of the *same block*.
#highlight(fill: yellow)[Data in this memory is not preserved between different kernel executions.]
Shared memory is typcally used as a *cache* for the global memory and to communicate with other threads in the block.
Each thread can access the whole shared memory address space, so writes on it must be *synchronized* between all threads in the same block.
Shared memory is:
- *multicast*: if multiple threads of the same warp access the same element, the access is done in a single transaction;
- *broadcast*: if *all* threads of a warp access the same element, the access is done in a single transaction
Shared memory is organized in *banks*. Access to the same bank is serial: if multiple threads access *different* address of the same bank, a *bank conflict* will occur.
To allocate a variable defined *inside the kernel function* on the shared memory, its definition must be preceded by `__shared__`:
#figure(
```c
__global__ kernel(...) {
__shared__ float arr[SIZE];
}
```,
caption: [`arr` is allocated to device shared memory]
)
Shared memory can be used also *dynamically* when its size cannot be determined at compile time. The size (in bytes) of the shared memory for each block must be specified with the optional third parameter when invoking the kernel:
#align(center)[
```c
kernel<<<blocks, threadsPerBlock, sharedMemorySize>>>(...):
```
]
=== Thread synchronization
Threads *in the same block* can be synchronized using `__syncthreads()` API.
This API should be used with care to avoid deadlocks:
#figure(
```c
if (threadIdx.x < 16) {
...
__syncthreads();
} else {
...
}
```,
caption: [`__syncthreads()` here will produce a deadlock for the first 16 threads in the warp. They will wait forever because the other 16 threads will never enter the `if`, and thus will never reach the `__syncthreads()`.]
)
Synchronization between *different* kernels is automatically handled by the system: before invoking the second kernel, the system waits until all writes of the first one are completed.
CUDA provides also *atomic operations* that must always be used when writing data into global or shared memory. These APIs are expensive in CUDA, so they must be used with care.
=== Constant memory
Read-only memory that holds data not known at compile time.
This memory is initialized by the host and then it's used by CUDA threads.
Actually, constant memory it's just a portion of the global memory, but its access uses a dedicated cache.
This memory must be used when all threads of the same warp access the same data. When a warp reads a vale from the constant memory, the value will be put in the constant cache by the system (if not already present), so access to the same data by other warps will be much more efficient.
=== Registers
#highlight(fill: yellow)[Registers hold thread-local data].
Registers are not unlimited, so their usage should be keep low. The higher the register pressure, the lower is the achievable parallelization with CUDA, because the lower is the number of blocks that can execute on a SM.
CUDA compiler optimizes register usage.
=== CUDA local memory
Not a physical memory, but just a *view* of its private memory for a thread.
Tries to use register, then it fallbacks on the global memory when there is no space left.
== Data transfers in CUDA
Communication between host and device is complicated because the memory is accessed differently between the two systems:
- modern CPUs use *virtual* memory addressing;
- GPUs use *phyiscal* memory addressing
Virtual memory on the host is managed both by the CPU and the OS. When started, each process gets an amounts of virtual memory which typically is much more than the physical memory available. Translation of virtual addresses in physical addresses is done by the CPU and the OS.
Virtual memory can be mapped also to the secondary storage (e.g. the disk) if there is not enough space in the DRAM.
=== Pageable memory transfer
#figure(
image("assets/3a43fa75175d91f84b78b8f35e7c332a.png", width: 50%),
caption: [Pageable memory transfer]
)
This type of transfer is subject to high overhead, because:
- it may be swapped to disk;
- requires multiple copies, one for each page
A plain `malloc` will allocate memory in this area.
#figure(
```c
w0 = (float*)malloc(SIZE);
cudaMalloc(&w0_dev, SIZE);
cudaMemcpy(w0_dev, w0, SIZE, cudaMemcpyHostToDevice);
kernel<<<...>>>(w0_dev, SIZE);
cudaMemcpy(w0, w0_dev, SIZE, cudaMemcpyDeviceToHost);
```,
caption: [Pageable memory transfer example]
)
=== Pinned (page-locked) memory transfer
#figure(
image("assets/780c561e8a7494aa16e6155ebc76156b.png", width: 50%),
caption: [Pinned memory transfer]
)
This transfer performs better than the pageable one, but it reduces the amount of physical memory available for the OS.
#figure(
```c
cudaMallocHost(&w0, SIZE);
cudaMalloc(&w0_dev, SIZE);
cudaMemcpy(w0_dev, w0, SIZE, cudaMemcpyHostToDevice);
kernel<<<...>>>(w0_dev, SIZE);
cudaMemcpy(w0, w0_dev, SIZE, cudaMemcpyDeviceToHost);
```,
caption: [Pinned memory transfer example]
)
=== Unified Virtual Memory (UVM)
UVM combines host and device memory in a single *logical* view.
#figure(
image("assets/25db6fe8d64b50a45ece36ca296fa181.png", width: 60%),
caption: [UVM is just a simplified logical view of the more complex physical memory system]
)
#figure(
```c
cudaMallocManaged(&w0, SIZE);
kernel<<<...>>>(w0, SIZE);
free(w0);
```,
caption: [UVM usage example]
)
While it's not visible in the code, a data transfer still takes place with UVM. #highlight(fill: yellow)[Data transfers with UVM happen through multiple small transfers], so while it's easier to write code using UVM, it has a quite big overhead.
#figure(
image("assets/b0f66674300844d1e06b3962b6c2e5ed.png", width: 100%),
caption: [Overhead of different data transfer types]
)
In general, UVM is useful only if:
- GPU is integrated with the host;
- data is loaded on the GPU *only once* and kernel *operation intensity* is high
=== Asynchronous data transfers
CUDA provides also asynchronous data transfer APIs (e.g. `cudaMemcpyAsync()`).
Asynchronous data transfers requires pinned memory or *streams*.
==== CUDA streams
A CUDA stream is a FIFO queue of GPU operations (mainly kernel launches and memory copies) that must be executed in a specific order (e.g. insert order in the queue).
CUDA defines a *default stream* (stream 0) which is used transparently to the user when no other streams are defined.
#figure(
image("assets/add8cd175a024a5201e9f3080c053031.png", width: 45%),
caption: [Default stream usage]
)
Commands in the same stream are executed sequentially, but commands in different streams are executed concurrently. Streams can therefore be beneficial to optimize application performance.
Streams can be synchronized both explicitly, using CUDA APIs, or implicitly. Streams are always synchronized when using blocking memory allocation APIs (e.g. `cudaMalloc`, `cudaMallocHost`).
CUDA streams help in overlapping computation and memory transfers *within the device*.
*Double buffering* is a technique that exploits multiple streams execution to improve concurrency. It's very similar to CPU pipeline:
#figure(
image("assets/b0edc4fbe83beb3cf046e9a3beb4b296.png", width: 80%),
caption: [GPU double buffering example]
)
#pagebreak(weak: true)
= FPGA (Field-programmable gate arrays)
#highlight(fill: yellow)[FPGA is a computer architecture that combines the flexibility of software with the high performance of hardware]. It's an intermediate approach between full-custom hardware (ASIC) and something that is *programmable*.
FPGA is custom hardware, but the way it's implemented does not rely on the physical representation of transistors, but just on *reconfiguring* some logic.
#figure(
image("assets/d432ddb92c322524b306dae3f034a65f.png", width: 80%),
caption: [Performance and energy efficiency of diffferent architectures.]
)
CPU and GPU are bound to the Von Neumann architecture: every program is executed in the same exact way. This is required to be able to execute *any* program, but it's not the optimal solution to extract performance from the system.
ASIC and FPGA, since they can implement completely custom logic, are the most efficient architectures.
An FPGA is a matrix of *configurable logic blocks* (CLB):
#figure(
image("assets/4cf86efa9a12d6c7515993ab4404c4f9.png", height: 29%),
caption: [CLB matrix]
)
Each CLB is made of two components:
- *slices*, made of *lookup tables*. These perform logic operations;
- *flip flops*, used as a memory storage
A lookup table is basically a multiplexer that evaluates a *truth table* stored in the configuration.
#figure(
image("assets/4208c680a46c9fbf124e2813fb6147ff.png", height: 20%),
caption: [Lookup tables and flip flops]
)
*Wires* are used to interconnect multiple CLBs together. *Connection boxes* and *switch matrices* are the fundamental components of these interconnections.
#figure(
image("assets/fe6365c6940d342f862cab39f425d836.png", height: 20%),
caption: [Routing in FPGA]
)
By configuring connection boxes and switch matrices, it's possible to allow (or forbid) a certain direction of communication.
Switch boxes are actually *bitmasks* that open/close a door.
FPGAs have access to the system's DRAM, but they also have two types of internal memory:
- *block RAM*: SRAM memory connected to the circuit using switching boxes and switching matrices;
- *distribute RAM*: interconnection of several flip-flop within the same CLB
FPGA also have components to perform *I/O operations*.
FPGAs can either be *integrated* (on the same chip of the CPU) or *discrete*.
== Place & route
#highlight(fill: yellow)[Place is the process of deciding which parts of a logic circuit are mapped to which CLBs in the FPGA].
#highlight(fill: yellow)[Route is the process of defining the interconnection of CLBs to implement the logic circuit functionality].
#figure(
image("assets/c875dcf051413043aeea398cd954903c.png", height: 20%),
caption: [Simpled $2 times 2$ CLBs FPGA]
)
If this is the circuit we want to implement in our FPGA:
#align(center)[
#image("assets/1f02728f0bccf7d7f295cf84ff717fe6.png", height: 10%)
]
we can identify 2 separate parts. Each one of them will be mapped in a dedicated CLB:
#align(center)[
#image("assets/16675a75d6c34a21ae292f8d5bf7d892.png", height: 10%)
]
The next step is to place the CLBs in the FPGAs. We have just 2 CLB to place in a $2 times 2$ grid, so there are different alternatives:
#table(
columns: (40%, 1fr),
align: (center + horizon, left + horizon),
[#image("assets/40c8ddaf4ee23134c7b26e0b36877561.png")], [This placement is not optimal because routing is complicated (3 switching boxes used).],
[#image("assets/42c2f93be7ba62591f446efcb7e90fc4.png")], [This is the #highlight(fill: yellow)[optimal solution] because it uses just 2 SBs and 2 wires.],
[#image("assets/4fd05c47dbe119621a53881aed8e892a.png")], [This is very similar to the previous one, but it uses one more wire, so it's not optimal.]
)
== FPGA configuration
FPGA reconfiguration is about changing switching blocks configuration through a *bitstream*. #highlight(fill: yellow)[Reconfiguring the FPGA is the process of loading this bitstream on it].
During the development phase, the FPGA device is programmed using utilities such as the Vivado IDE. On production hardware, the bitstream is placed in non-volatile memory and the hardware is configured to program the FPGA when powered on.
Reconfiguring FPGA takes time, so it's crucial to find a balance between *complete* reconfiguration and *partial* reconfiguration.
FPGA reconfiguration can be *static* (must be done *before* execution, it cannot be done on a working environment) or *dynamic* (can be done also during execution).
Reconfiguration can be *external* (the bitstream comes from an FPGA external source) or *internal*.
= HLS - High Level Synthesis
HLS is a (very) abstract manner of describing how the hardware of an FPGA should behave.
FPGAs are configured using an hardware design flow:
+ desired hardware behaviour is described using an *Hardware Description Language* (HDL);
+ HDL is turned into a configuration bitstream using tools like Vivado
HDL is very similar to a programming language:
#figure(
image("assets/d2092f638a0a06292ea29999a536981f.png", height: 25%),
caption: [HDL example]
)
*Synthesis* is the process from which a *gate-level netlist* is generated from hardware description.
Designing hardware requires an understanding of how logic gates work. Not all FPGA users have those skills, so its design must be simplified in some way.
#figure(
image("assets/d6ee216305c9c5cba1914a345b6cd567.png", height: 30%),
caption: [Different levels of abstraction when designing an FPGA]
)
FPGA must be designed in two directions:
- *behaviour*: the algorithm which runs on the FPGA;
- *structure*: registers, gates, flip flops, etc.
#highlight(fill: yellow)[High level synthesis (HLS) is an automated design process that transforms a high-level function specification to a register-trasnfer level description suitable for hardware implementation].
HLS allows to describe the hardware using a high-level language such as C/C++.
HLS covers the first layer of hardware synthesis:
#figure(
image("assets/f8ab78a6d40528b9f3b6e547a09a1e92.png", height: 25%),
caption: [HLS vs HDL]
)
Control logic and datapath can be extracted directly from the C/C++ code.
*Scheduling* and *binding* are the core of HLS:
- scheduling determines in which clock cycle an operation will occur;
- binding determines which *core* will execute an operation
Each C/C++ function is translated into a dedicated RTL block. Function arguments become ports on these RTL blocks.\
Functions may also be *inlined* to dissolve their hierarchy.
HLS largely uses the *loop unrolling* and *loop pipelining* optimizations to expose higher parallelism and reduce the latency.
HLS describes hardware as a *finite-state machine* that performs different atomic operations.
Producing the final bitstream requires time, therefore developers rely often on *simulators*. #highlight(fill: yellow)[Memory performance of these simulator is not realistic], but still simulation is useful when developers care only about executing a function in the FPGA and do not care about its integration in the system.
The *initialization interval* (II) is the number of clock cycles to wait before the computing of the next iteration of a loop can start. It depends on the availability of resources (e.g. number of ports to access the memory).
#page()[
#align(center + horizon, text(17pt)[
*Labs*
])
]
= Profiling
Profiling is not only useful for measuring performances, but also for *debugging* and *optimizations*.
Profiling is used in many context (e.g. web applications), not only in hardware.
Steps to create a parallel program:
+ identify parts of the program (*hotspots*) that can be parallelized;
+ parallelize the code on multiple threads;
+ *assess* that parallelization had a benefit on performance (and also that the new parallelized version still produces correct results)
Profiling can be useful in all these steps, because:
- it helps in identifying hotspots;
- in can be used to check the overhead of parallelization, the cost of memory access, etc.;
- it can be used during the assessment to check if parallelization had a benefit on performance
Different metrics for different aspects of the system:
- *throughput*: operations per seconds, measured in FLOP/s (floating point operations);
- *memory bandwidth*: measured in GB per seconds;
- *energy efficiency*: this metric has become very important in the last years, not only for *environmental* aspects but also for *efficiency* (doing more with less energy waste)
The *Roofline model* is a metodology to describe performance of a system which can display also the maximum achievable performance:
#figure(
image("assets/5e65d03d9746e7fb65523a366794a405.png", height: 30%),
caption: [Roofline model]
)
The $x$ axis measures the *operational intensity*, which is the computational cost of the operation relative to the amount of data it needs. The $y$ axis measures the throughput of the system.
Example of operational intensity for `c = a + b`:
+ read `a`;
+ read `b`;
+ calculate `a + b`
3 instructions in total with 2 data accesses, so the operational intensity is $frac(1, 3)$.
The roofline model helps in identifying *memory bottlenecks* because it can show if a program is memory-bounded.
The graph provided by the roofline model is very important. *Before* going through optimizing the code, the programmer must know what is the maximum achievable performance in order to not waste time in optimization.
Profiling is a *dynamic* program analysis that measures different aspects:
- memory usage;
- time complexity;
- instruction usage;
- frequency and duration of *function calls*
Profiling is *dynamic* because different operations takes different amount of time, so the profiler cannot simply see the (static) source code of the program.
There are different techniques to collect profiling data:
- *performance counters*: typically implemented at *hardware level* by CPUs;
- code instrumentation;
- hardware interrupts: execution is interrupted every $t$ seconds to check for a metric;
- OS hooks (scheduling point, context switch);
- ISA simulators: can be used when there is no bare-metal hardware
== Profiling tools
#figure(
table(
columns: (auto, auto),
align: (center + horizon, left),
[*perf*], [
- uses hardware and OS counters;
- very low-level and fine-grained statistics;
- highly dependent on the architecture
],
[*gprof*], [
- measures *function* execution time;
- requires special compilers annotations;
- does not actually measure the time spent in a fuction; this time is just *inferred* by taking "snapshots" of the application at regular intervals;
- not suited for applications with very small functions because their execution time might be lower than the sampling interval
],
[*Valgrind*], [
- collection of tools, rather than a single one;
- profiled code is executed in a *sandbox*. This is an advantage because there is no need of hardware counters or compiler annotations, but it also mean that performance when run on *real* hardware will be slightly different
]
),
caption: [Comparison of common profiling tools]
)
= HLS
== Interfaces
#figure(
table(
columns: (auto, auto),
align: (center + horizon, left + horizon),
[*AXI* (or *mAXI*)], [full-access interface],
[*AXI-lite*], [lightweight interface, used for scalar and constant propagation],
[*AXI-stream*], [very efficient, non-memory mapped interface]
),
caption: [AXI4 interfaces]
)
*Bundling* is how interfaces are mapped to physical memory ports. The number of memory ports is limited and multiple accesses using the same port happen in sequence (not concurrently), so they should be used with care.
AXI master is a *bidirectional channel*: it's able to read and write concurrently. |
|
https://github.com/ngyngcphu/tick3d-docs | https://raw.githubusercontent.com/ngyngcphu/tick3d-docs/main/contents/04_framework_technology/index.typ | typst | Apache License 2.0 | = Framework & Technology
Phần nà y sẜ giá»i thiá»u sÆ¡ lược vá» các cÃŽng nghá» Äược sá» dụng trong dá»± án. Nhóm quản lÃœ phiên bản mã nguá»n vá»i Git và GitHub, sá» dụng framework ReactJs cho front-end, Fastify cho back-end, ánh xạ tá»i cÆ¡ sá» dữ liá»u vá»i Prisma và sá» dụng PostgreSQL Äá» quản lÃœ cÆ¡ sá» dữ liá»u. DÆ°á»i Äây nhóm sẜ giá»i thiá»u tóm lược vá» má»i cÃŽng nghá» Äã nêu:
== Git
#figure(caption: [Git],
image("../images/framework/Git.png", fit: "cover", width: 70% ),
)
Git là má»t há» thá»ng quản lÃœ phiên bản phân tán nguá»n má», Äược <NAME> tạo ra và o nÄm 2005 Äá» giải quyết nhu cầu quản lÃœ mã nguá»n hiá»u quả trong quá trình phát triá»n nhân Linux. Há» thá»ng nà y Äã trá» thà nh má»t trong những há» thá»ng quản lÃœ phiên bản phá» biến nhất Äược sá» dụng hiá»n nay. Git Äược sá» dụng Äá» theo dõi những thay Äá»i trong mã nguá»n trong quá trình phát triá»n phần má»m và cho phép nhiá»u láºp trình viên là m viá»c Äá»ng thá»i trên cùng má»t cÆ¡ sá» mã nguá»n.
Má»t sá» Æ°u Äiá»m của Git bao gá»m tá»c Äá», sá»± ÄÆ¡n giản, tÃnh chất phân tán hoà n toà n, há» trợ phát triá»n song song và tÃnh toà n vẹn. Git Äược thiết kế Äá» hoạt Äá»ng nhanh và hiá»u quả, ngay cả khi là m viá»c vá»i các cÆ¡ sá» mã nguá»n lá»n. Nó có giao diá»n dòng lá»nh ÄÆ¡n giản và trá»±c quan giúp láºp trình viên dá»
dà ng tìm hiá»u và sá» dụng. Git là má»t há» thá»ng kiá»m soát phiên bản phân phá»i hoà n toà n, có nghÄ©a là má»i láºp trình viên Äá»u có bản sao hoà n chá»nh của cÆ¡ sá» mã trên máy cục bá» của há». Äiá»u nà y giúp dá»
dà ng là m viá»c ngoại tuyến và cá»ng tác vá»i các láºp trình viên khác. Git cÅ©ng há» trợ viá»c phát triá»n song song, cho phép nhiá»u láºp trình viên là m viá»c Äá»ng thá»i trên cùng má»t cÆ¡ sá» mã mà khÃŽng có xung Äá»t. Git sá» dụng các hà m bÄm máºt mã Äá» Äảm bảo tÃnh toà n vẹn của cÆ¡ sá» mã, khiến cho viá»c sá»a Äá»i mã má»t cách vÃŽ tình hoặc cá» Ãœ mà khÃŽng bá» phát hiá»n là gần nhÆ° khÃŽng thá».
#pagebreak()
== GitHub
#figure(caption: [GitHub],
image("../images/framework/github.png", fit: "cover", width: 70% ),
)
GitHub là má»t ná»n tảng web bá» sung cho các chức nÄng của Git. GitHub cung cấp dá»ch vụ lÆ°u trữ cho các kho Git (Git repositories) cùng vá»i nhiá»u tÃnh nÄng quản lÃœ dá»± án và cá»ng tác. Vá»i GitHub, ngÆ°á»i dùng có thá» lÆ°u trữ kho Git của há» trên Internet, giúp chúng có thá» truy cáºp Äược từ má»i nÆ¡i có kết ná»i Internet. Cách tiếp cáºn nà y giúp ÄÆ¡n giản hóa viá»c cá»ng tác vì các thà nh viên trong nhóm có thá» dá»
dà ng sao chép các kho Git, tạo nhánh và gá»i "yêu cầu kéo" (Pull Requests) Äá» xem xét và tÃch hợp mã.
GitHub cÅ©ng há» trợ viá»c quản lÃœ dá»± án bằng cách cung cấp các cÃŽng cụ Äá» theo dõi sá»± cá», báo cáo lá»i và quản lÃœ các yêu cầu tÃnh nÄng. Ngoà i ra, nó tÃch hợp tá»t vá»i các dá»ch vụ tÃch hợp liên tục (Continuous Integration) nhÆ° GitHub Actions, cho phép các quy trình Äược kiá»m thá» và triá»n khai tá»± Äá»ng.
#pagebreak()
== ReactJS
#figure(caption: [ReactJS],
image("../images/framework/reactjs.png", fit: "cover", width: 70% ),
)
ReactJS là má»t thÆ° viá»n JavaScript Äược sá» dụng Äá» xây dá»±ng giao diá»n ngÆ°á»i dùng. Nó Äược tạo ra bá»i <NAME>, má»t kỹ sÆ° phần má»m tại Facebook và Äược Facebook phát triá»n và duy trì. ReactJS là má»t thÆ° viá»n khai báo, hiá»u quả và linh hoạt, chá»u trách nhiá»m vá» lá»p View của ứng dụng. Nó cho phép các nhà phát triá»n tạo các thà nh phần UI có thá» tái sá» dụng, có thá» Äược lá»ng ghép vá»i các thà nh phần khác Äá» xây dá»±ng các ứng dụng phức tạp từ các khá»i xây dá»±ng ÄÆ¡n giản. ReactJS sá» dụng cÆ¡ chế dá»±a trên DOM ảo Äá» Äiá»n dữ liá»u và o HTML DOM, cÆ¡ chế nà y hoạt Äá»ng nhanh vì nó chá» thay Äá»i các thà nh phần DOM riêng lẻ thay vì tải lại toà n bá» DOM má»i lần.
ReactJS có má»t sá» lợi thế so vá»i các JavaScript framework khác nhÆ° dá»
sá» dụng, tá»c Äá» nhanh và có khả nÄng má» rá»ng. Nó giúp các láºp trình viên xây dá»±ng các ứng dụng web có kÃch thÆ°á»c lá»n và sá»a Äá»i dữ liá»u mà tránh viá»c tải lại trang khÃŽng cần thiết. ReactJS chá» xá» lÃœ lá»p View trong mẫu MVC của giao diá»n ngÆ°á»i dùng ứng dụng. ReactJS cáºp nháºt và hiá»n thá» các thà nh phần má»t cách hiá»u quả, Äá»ng thá»i xá» lÃœ khéo léo các bản cáºp nháºt DOM. Nó có thá» Äược tÃch hợp và o bất kỳ ứng dụng nà o, cho dù Äó là má»t phần của trang hay má»t trang hoà n chá»nh hay tháºm chà là toà n bỠứng dụng. ReactJS cÅ©ng có khả nÄng tÆ°Æ¡ng thÃch ngược, nghÄ©a là nó cÅ©ng có thá» Äược sá» dụng vá»i các phiên bản trình duyá»t cÅ© hÆ¡n.
#pagebreak()
== Fastify
#figure(caption: [Fastify],
image("../images/framework/fastify.png" , fit: "cover", width: 70% ),
)
Fastify là má»t web framework dà nh cho Node.js táºp trung chủ yếu và o viá»c cung cấp trải nghiá»m tá»t láºp trình viên vá»i chi phà thấp và má»t kiến trúc plugin mạnh mẜ. Fastify lấy cảm hứng từ Hapi và Express và là má»t trong những web framework nhanh nhất hiá»n tại. Fastify có khả nÄng má» rá»ng thÃŽng qua các hook, plugin và decorators. Fastify có má»t trình logging Äược tÃch hợp sẵn, từ Äó gần nhÆ° loại bá» chi phà cho tác vụ logging. Fastify thân thiá»n vá»i ngÆ°á»i dùng và Äược xây dá»±ng Äá» mang tÃnh diá»
n Äạt cao mà khÃŽng là m giảm hiá»u suất và tÃnh bảo máºt.
Má»t trong những Æ°u Äiá»m chÃnh của Fastify nằm á» tá»c Äá», Äạt Äược nhá» tá»i thiá»u hóa chi phà và táºp trung và o hiá»u suất. Nó cung cấp tÃnh nÄng tá»± Äá»ng serialize và deserialize dữ liá»u Äến và Äi, há» trợ viá»c xác thá»±c các request, tham sá» Äá»nh tuyến và chuẩn hóa Äầu và o, khiến nó trá» thà nh má»t lá»±a chá»n an toà n Äá» phát triá»n web.
#pagebreak()
== Prisma
#figure(caption: [Prisma],
image("../images/framework/prisma.png", fit: "cover", width: 70% ),
)
Prisma là má»t ORM thế há» má»i giúp ÄÆ¡n giản hóa quy trình là m viá»c vá»i cÆ¡ sá» dữ liá»u và thay thế các ORM truyá»n thá»ng. Nó cung cấp khả nÄng truy cáºp cÆ¡ sá» dữ liá»u an toà n kiá»u (type-safe) vá»i Prisma Client, di chuyá»n (migrate) dữ liá»u vá»i Prisma Migrate cÅ©ng nhÆ° quản lÃœ dữ liá»u trá»±c quan vá»i Prisma Studio. Prisma Client có thá» Äược sá» dụng Äá» xây dá»±ng các API GraphQL, REST, gRPC và hÆ¡n thế nữa. Prisma hiá»n há» trợ nhiá»u há» thá»ng quản lÃœ cÆ¡ sá» dữ liá»u nhÆ° MySQL, PostgreSQL và MongoDB.
Má»t sá» lợi Ãch của Prisma có thá» ká» Äến nhÆ° an toà n kiá»u, API hiá»n Äại và Äá»c/ghi dữ liá»u quan há» má»t cách linh hoạt. Prisma thá»ng nhất quyá»n truy cáºp và o nhiá»u cÆ¡ sá» dữ liá»u cùng má»t lúc và từ Äó giảm Äáng ká» Äá» phức tạp trong các quy trình là m viá»c trên nhiá»u cÆ¡ sá» dữ liá»u. Nó cÅ©ng có há» thá»ng sá»± kiá»n và streaming theo thá»i gian thá»±c cho cÆ¡ sá» dữ liá»u, Äảm bảo ngÆ°á»i dùng nháºn Äược cáºp nháºt cho tất cả các sá»± kiá»n quan trá»ng xảy ra trong cÆ¡ sá» dữ liá»u của mình.
#pagebreak()
== PostgreSQL
#figure(caption: [PostgreSQL],
image("../images/framework/postgresSQL.png", fit: "cover", width: 70% ),
)
PostgreSQL, Äược phát triá»n và duy trì bá»i má»t nhóm các nhà phát triá»n phần má»m PostgreSQL Global Development Group, là má»t há» thá»ng cÆ¡ sá» dữ liá»u quan há» Äá»i tượng nguá»n má» sá» dụng và má» rá»ng ngÃŽn ngữ SQL kết hợp vá»i nhiá»u tÃnh nÄng lÆ°u trữ và má» rá»ng quy mÃŽ má»t cách an toà n cho các khá»i lượng dữ liá»u phức tạp nhất. PostgreSQL ná»i tiếng bá»i kiến trúc Äã Äược chứng minh, Äá» tin cáºy, tÃnh toà n vẹn dữ liá»u, bá» tÃnh nÄng mạnh mẜ, khả nÄng má» rá»ng và cá»ng Äá»ng nguá»n má» Äằng sau cung cấp nhất quán các giải pháp sáng tạo và hiá»u quả.
PostgreSQL Äi kÚm vá»i nhiá»u tÃnh nÄng nhằm giúp các láºp trình viên xây dá»±ng ứng dụng, các quản trá» viên bảo vá» tÃnh toà n vẹn của dữ liá»u và xây dá»±ng mÃŽi trÆ°á»ng có khả nÄng Äá»i phó vá»i lá»i, Äá»ng thá»i giúp ngÆ°á»i dùng quản lÃœ dữ liá»u của mình dù lá»n hay nhá». Ngoà i viá»c là nguá»n má» và miá»
n phÃ, PostgreSQL còn có khả nÄng má» rá»ng cao. Chẳng hạn nhÆ° ngÆ°á»i dùng có thá» tạo loại dữ liá»u của riêng mình, xây dá»±ng các hà m tùy chá»nh, tháºm chà viết mã từ các ngÃŽn ngữ láºp trình khác nhau mà khÃŽng cần biên dá»ch lại cÆ¡ sá» dữ liá»u.
#pagebreak() |
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/003%20-%20Gatecrash/006_The%20Greater%20Good.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Greater Good",
set_name: "Gatecrash",
story_date: datetime(day: 06, month: 02, year: 2013),
author: "<NAME>",
doc
)
When the massive doors of the war room swung open, <NAME> could feel energy hit him like a wave of heat from a smelting forge. It wasn't actual heat, but more like an energetic wind that pulsated through his body like a shockwave. For a second, he was taken aback by the power. He had been around many angels in his time, but her aura was an order of magnitude higher than any he had encountered.
A quick smirk flashed across the face of the Boros guildmage who escorted Gideon as they walked into the chamber. The escort carried out the Boros salute and announced, "Warleader. <NAME> to see you." He then bowed and left.
Aurelia looked up from a wide steel table etched with symbols, miniature towers, and buildings covering its surface, but Gideon couldn't take his eyes off of the Boros guildmaster. Her hair, eyes, armorâeverything about herâseemed to shimmer like air rising off the sun-scorched horizon. Gideon couldn't tell whether there were tiny vortices of energy all over her or if she was magically surrounded by a shield of swirling mana.
He realized he was staring.
#figure(image("006_The Greater Good/01.jpg", width: 100%), caption: [Aurelia, the Warleader | Art by Slawomir Maniak], supplement: none, numbering: none)
"Guildmaster," he said, placing his hand on his chest and bowing his head slightly.
"<NAME>." Her voice was powerful with an otherworldly quality. "Your accent, dress, and even your name say you're not from this district. And yet... I have word that you saved an entire brigade of my Boros from a Rakdos ambush that would have killed every last one of them."
"They were well trained for combat. I only showed them where to strike and when."
"Such modesty." Aurelia smiled. "But I think it is safe to say that you did a little striking of your own." Aurelia moved around the table and stood before Gideon. "What puzzles me, Jura, is why I haven't heard of your skill in battle before now. I get the feeling someone like you isn't apt to lay low and shirk the glory of battle."
"I'm not from around here, Guildmaster. Most of my travels take me... elsewhere."
Aurelia regarded Gideon's answer with a mix of curiosity and angelic aloofness, but Gideon could see her mind working.
"Fair enough." She refolded her wings and indicated the miniature buildings on the table. "You know this place?"
"I do not," Gideon said.
"It is the Ninth."Aurelia placed a hand on one of the building rooftops. "It's at the edge of the One Hundred Steps. Azorius turf. Of course, the Azorius don't see fit to enter the Ninth. It's a little too... hands-on... for their tastes. The Rakdos and Gruul tug and tear it apart like a dromad's corpse, while the Dimir... well... they do what the Dimir do best: hide in the shadows and pull puppet strings."
#figure(image("006_The Greater Good/02.jpg", width: 100%), caption: [Crowned Ceratok | Art by <NAME>], supplement: none, numbering: none)
Gideon looked at the neat, clean, empty model buildings, but he imagined the real plight of the people attempting to peacefully exist within a war zone. "So, it's contested turf. The innocent people living there must be paying a high price."
"Exactly," Aurelia said with heaviness in her tone. She looked at Gideon. "The innocent always pay the highest price. I would love to go in there with some Cinder Elementals and burn out every last Rakdos, Gruul, and Dimir, but unguilded Ravnicans have been living there for centuries in relative peace. Back then, it used to all be Azorius turf. But when the old #emph[Guildpact] was broken..." Aurelia trailed off. "I won't bore you with a history lesson, Jura, but in the aftermath, the Azorius had to abandon the Ninth so they could rebuild New Prahv. Naturally, the Rakdos and Gruul pushed their way in and began brawling like oafs. Much of the Ninth was lost."
"And where was the Boros in all this?"
"I wasn't guildmaster, then." Aurelia's reply had a touch of cold steel to it. Gideon had hit a nerve. "We were led by a disgrace to the Legion. I watched as swaths of the Ninth slipped away. Its loss and other unforgivable blunders all but forced... a change... in guild leadership. Forgive me, Jura. I can still taste the bitterness of those times. Let me show you something."
Aurelia motioned for Gideon to accompany her across the polished marble floor of the great war room to a high balcony that looked over the central grounds of Sunhome. The air smelled fresh and clean. Gideon's eyes adjusted to the bright sunlight. Far below, legions of Boros knights trained and marched in the gleaming sun, while flags and banners moved in the breeze. It was a glorious sight.
#figure(image("006_The Greater Good/03.jpg", width: 100%), caption: [Assemble the Legion | Art by <NAME>champs], supplement: none, numbering: none)
After gazing over the grandeur of Sunhome and its armies, Aurelia spoke. "I can't enjoy this fully, Jura. All this glory, and all I can think of are those poor people in the Ninth who are left behind to endure squalor, lawlessness, and stupidity." She looked at Gideon. "Jura, the Ninth is a stain on Ravnica, a stain on the Boros, and a stain on my soul. I dearly wish to cleanse it."
"And you want me to help?"
"No, Jura, I want you to lead." Aurelia turned and put a hand on his shoulder, a hand which felt much heavier than Gideon expected. "I know a leader when I see one. You have greatness within you."
She pointed to a hundred gleaming soldiers out on the parade grounds. "I am prepared to give you command of that battalion, there, if you will fight with us. Or better still, if you join us." Power radiated from her face as Aurelia fixed her eyes on Gideon.
#figure(image("006_The Greater Good/04.jpg", width: 100%), caption: [Boros Elite | Art by <NAME>urai], supplement: none, numbering: none)
"The battalion is mine even if I choose not to join the Boros?" Gideon asked.
Aurelia's face remained implacable but she hesitated before answering. "Yes, Jura. But command will be mine. Clear?"
"Of course." Gideon felt a sense of duty and allegiance to the angelic guildmaster rush up from deep within his chest. With soldiers like that, mountains could be moved.
But Gideon had seen something much worse than the Ninth in his travels. Something worse than even the demon lord Rakdos could muster.
He had seen a world being devoured.
But even as #emph[Zendikar] faced extraplanar horrors, Ravnica's streets teemed with innocents caught in the crossfire of guild warfareâthe so-called "gateless." He was needed here. With Aurelia's help, he could save countless lives.
#figure(image("006_The Greater Good/05.jpg", width: 100%), caption: [Gideon, Champion of Justice | Art by <NAME>za], supplement: none, numbering: none)
Gideon knew the dangers of too readily following someone else's orders. He was not ready to become Boros. But he was ready to wield its weapons for the greater good.
Gideon looked up from the map of the Ninth and smiled like a wolf.
"When do we start?"
|
|
https://github.com/jamesrswift/springer-spaniel | https://raw.githubusercontent.com/jamesrswift/springer-spaniel/main/template/main.typ | typst | The Unlicense | #import "@preview/springer-spaniel:0.1.0" as springer-spaniel
#import springer-spaniel.ctheorems: *
#import springer-spaniel.gentle-clues: *
#import "@preview/physica:0.9.3": *
#show: springer-spaniel.template(
title: [Towards Swifter Interstellar Mail Delivery],
authors: (
(
name: "<NAME>",
institute: "Primary Logistics Departmen",
address: "Delivery Institute, Berlin, Germany",
email: "<EMAIL>"
),
(
name: "<NAME>",
institute: "Communications Group",
address: "Space Institute, Florence, Italy",
email: "<EMAIL>"
),
(
name: "<NAME>",
institute: "Missing Letters Task Force",
address: "Mail Institute, Budapest, Hungary",
email: "<EMAIL>"
)
),
abstract: [
Recent advances in space-based document processing have enabled faster mail delivery between different planets of a solar system. Given the time it takes for a message to be transmitted from one planet to the next, its estimated that even a one-way trip to a distant destination could take up to one year. During these periods of interplanetary mail delivery there is a slight possibility of mail being lost in transit. This issue is considered so serious that space management employs P.I. agents to track down and retrieve lost mail. We propose A-Mail, a new anti-matter based approach that can ensure that mail loss occurring during interplanetary transit is unobservable and therefore potentially undetectable. Going even further, we extend A-Mail to predict problems and apply existing and new best practices to ensure the mail is delivered without any issues. We call this extension AI-Mail.
],
)
#pagebreak()
= Introduction <sec:2>
Our concept suggests three ways that A-Mail can be best utilized.
- First is to reduce the probability of the failure of a space mission. This problem, known as the Mars problem, suggests that the high round-trip time required for communication between Mars and Earth inhibits successful human developments on the planet. Thanks to A-Mail's faster-than-light delivery system this problem could be solved once and for all.
- As A-Mails are written using pen and paper, no digital technology is needed for short and long distance communication. This suggests a possibility of reducing the communication monopoly currently held by an entity known as the "internet". Our suggestion of A-Mail being responsible for postal delivery would reduce dependence on online services by delivering the vast majority of mail offline. Space is a place where drastic changes in methods of production and distribution can easily occur.
- Lastly, A-Mail is capable of performing high-level complex calculations. It is this capability that distinguishes A-Mail from traditional space mailers. This is an especially useful capability when planning long-distance space missions.
The delivery speed of an A-Mail can be determined through this simple formula:
$ v(t) = lim_(t -> infinity) integral^infinity c dot sqrt(t^2) dd("t") $
Building on the strong foundations of A-Mail, we extend our platform to predict problems and apply existing and new best practices to ensure the mail is delivered without any issues. We call this extension AI-Mail. AI-Mail is a new concept designed and delivered by artificially intelligent (AI) agents. The AI-Mail agents are intelligently designed to solve problems at various points in the delivery chain. These problems are related to targeting, delivery delay, tone of delivery, product information, product return, system crash, shipment error and more. AI-Mail provides a one-stop solution for A-Mail's shortcomings.
I'd explain how to typeset maths, but Typst handles that for us natively under the hood.
#footnote[
In physics texts please depict your vectors in #strong(emph[boldface-italic]) type - as is customary for a wide range of physical subjects.
]
$
abs(gradient_alpha^mu (y)) & <=
1/(d - a) integral abs(gradient 1/( abs(ð - y)^(d-alpha))) dd(mu (ð))
= integral 1 / (abs(ð - y)^(d-alpha+1)) dd(mu (ð))\
& = (d - alpha + 1) limits(integral) _d(y)^infinity (mu(B(y,r)))/(r^(d-alpha+2)) dd(r)
<= (d-alpha + 1) limits(integral)^infinity_d(y) (r^(d-alpha))/(r^(d-alpha+2)) dd(r)
$
== Subsection Heading <sec:2.1>
#lorem(50)
#quote[
Please do not use quotation marks when quoting texts! Simply use the `quote` element -- it will automatically be rendered in line with the preferred layout.
]
=== Subsubsection Heading
#lorem(50) as has already been described in @sec:2.1, see also @fig:full.
#footnote[
If you copy text passages, figures, or tables from other works, you must obtain _permission_ from the copyright holder (usually the original publisher). Please enclose the signed permission with the manuscript. The sources permission to print must be acknowledged either in the captions, as footnotes or in a separate section of the book.
]
Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are.
==== Paragraph Heading
#lorem(25) all your cross-references and citations as has already been
described in @sec:2.
#figure(
caption: [This figure takes up the full width, so we just use the normal `figure` element. We can refer to it in the main body by labelling the figure (_e.g._, `<fig:full>`)],
block(stroke: 0.75pt, height: 5cm, width: 100%)
) <fig:full>
For typesetting numbered lists we recommend using the natively supported numbered list, which can be started/continued by starting a line with $plus$.
+ Livelihood and survival mobility are oftentimes outcomes of uneven socioeconomic development.
+ Livelihood and survival mobility are oftentimes outcomes of uneven socioeconomic development.
+ Livelihood and survival mobility are oftentimes outcomes of uneven socioeconomic development.
+ Livelihood and survival mobility are oftentimes outcomes of uneven socioeconomic development.
===== Subparagraph Heading
#lorem(50) as has already been described in @sec:2.1, see also @fig:full.
#springer-spaniel.sidecaption(
caption-width: 33%,
figure(
caption: [For smaller figures, which need not take up the full width of the page, this template provides a wrapper for `figure` called `sidecaption` which will move the caption to the left third of the page while the figure occupies the right two thirds.],
block(stroke: 0.75pt, height: 4cm, width: 67%)
),
label: <fig:side>
)
For unnumbered list we recommend using the natively supported numbered list, which can be started/continued by starting a line with $minus$.
- Livelihood and survival mobility are oftentimes coutcomes of uneven socioeco-nomic development, cf. Table 1
- Livelihood and survival mobility are oftentimes outcomes of uneven socioeconomic development.
- Livelihood and survival mobility are oftentimes outcomes of uneven socioeconomic development.
- Livelihood and survival mobility are oftentimes outcomes of uneven socioeconomic development.
#lorem(75) @einstein
For typesetting theorems, proofs, lemma(s? what's the plural?), corollaries, and so on, this template provides a styled wrapper of the `ctheorems` package, examples of which are shown below:
#theorem("Euclid")[There are infinitely many primes.] <euclid>
#proof([of @euclid])[
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list, it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a contradiction.
]
#lemma[
If $n$ divides both $x$ and $y$, it also divides $x - y$. @latexcompanion @knuthwebsite
]
#corollary[
if $n$ divides two consecutive natural numbers, then $n = 1$.
]
#lorem(40)
#info[The `gentle-clues` package is included in this template, and will be given a new style that better first this template in a future version]
#lorem(75)
#figure(caption:[You can make the table yourself using native Typst elements for simple data],{
table(
columns: (auto, auto, auto, 1fr),
stroke: none,
table.hline(stroke: springer-spaniel.dining-table.toprule),
[Classes], [Subclass], [Length], [Action Mechanism],
table.hline(stroke: springer-spaniel.dining-table.midrule),
[Translation],
{
[mRNA]
springer-spaniel.dining-table.note.make[Table foot note (with suberscript)]
},
[22 (19---25)],
[Translation repression, mRNA cleavage],
[Translation],
[mRNA cleavage], [21], [mRNA cleavage],
[Translation],
[mRNA], [21---22], [mRNA cleavage],
[Translation],
[mRNA], [22---24], [Histone and DNA modification],
table.hline(stroke: springer-spaniel.dining-table.toprule)
)
springer-spaniel.dining-table.note.display-style(
springer-spaniel.dining-table.note.display-list
)
})
#figure(
caption: [The alternative this template makes available is the construction of tables by column instead of by row],
springer-spaniel.dining-table.make(
columns: (
(
header: [Classes],
key: "class",
gutter: 0.5em,
),
(
header: [Subclass],
key: "subclass",
gutter: 0.5em,
),
(
header: [Length],
key: "length",
gutter: 0.5em,
),
(
header: [Action Mechanism],
key: "mechanism",
gutter: 0.5em,
width: 1fr,
),
),
data: (
(
class: [Translation],
subclass: [mRNA] + springer-spaniel.dining-table.note.make[Table foot note (with suberscript)],
length: [22 (19---25)],
mechanism: [Translation repression, mRNA cleavage]
),
(
class: [Translation],
subclass: [mRNA cleavage],
length: [21],
mechanism: [mRNA cleavage]
),
(
class: [Translation],
subclass: [mRNA],
length: [21---22],
mechanism: [mRNA cleavage]
),
(
class: [Translation],
subclass: [mRNA],
length: [22---24],
mechanism: [Histone and DNA modification]
),
)
)
)
If you have a pair of paragraphs you would like to separate using an asterism, this template provides a set of asterisms and fleurons that are suited to this template. #lorem(20)
#springer-spaniel.asterism.paragraph
#lorem(120)
= Subsection Heading
If you want to list definitions or the like we recommend using the natively supported `description` element -- it will automatically rendered in line with the preferred layout. A noun is prefixed with #sym.slash and postfixed by a semicolon, follwed by the definition.
/ Type 1: That addresses central themes pertainng to migration, health, and disease. In @sec:2, Wilson discusses the role of human migration in infectious disease distributions and patterns.
/ Type 2: That addresses central themes pertainng to migration, health, and disease. In @sec:2, Wilson discusses the role of human migration in infectious disease distributions and patterns.
If at any point you want to break to a new page, you can do so by calling `pagebreak()`.
#pagebreak()
#bibliography("sample.bib", style: "springer-mathphys") |
https://github.com/SkiFire13/master-thesis | https://raw.githubusercontent.com/SkiFire13/master-thesis/master/preface/toc.typ | typst | #let extra-outline(title: none, target: none) = context {
if query(target).len() != 0 {
if query(target).any(it => it.caption == none) {
panic("Figure without caption")
}
outline(title: title, indent: auto, target: target, fill: repeat([.]))
}
}
#let toc() = page[
#[
#show outline.entry.where(level: 1): it => {
show repeat: none
v(12pt, weak: true)
smallcaps(it)
}
#outline(title: [= Index] + v(.5em), indent: auto)
]
#extra-outline(title: [= Index of figures] + v(.5em), target: figure.where(kind: image))
#extra-outline(title: [= Index of tables] + v(.5em), target: figure.where(kind: table))
]
|
|
https://github.com/Jollywatt/typst-fletcher | https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/src/default-marks.typ | typst | MIT License | #import "deps.typ"
#import deps.cetz.draw
#let DEFAULT_MARKS = (
// all numbers are interpreted as multiples of stroke thickness
head: (
size: 7, // radius of curvature
sharpness: 24.7deg, // angle at vertex between central line and arrow's edge
delta: 53.5deg, // angle spanned by arc of curved arrow edge
tip-origin: 0.5,
tail-end: mark => calc.min(..mark.extrude),
tail-origin: mark => {
let dx = calc.cos(mark.sharpness) + calc.cos(mark.sharpness + mark.delta)
mark.tail-end - mark.size*mark.delta/1.8rad*dx
},
stroke: (cap: "round"),
draw: mark => {
for flip in (+1, -1) {
draw.arc(
(0, 0),
radius: mark.size,
start: flip*(90deg + mark.sharpness),
delta: flip*mark.delta,
fill: none,
)
}
},
cap-offset: (mark, y) => {
import calc: sin, sqrt, pow, cos, abs, max
let r = mark.size
let Ξ = mark.sharpness
r*(sin(Ξ) - sqrt(max(0, 1 - pow(cos(Ξ) - abs(y)/r, 2))))
},
),
doublehead: (
inherit: "head",
size: 10.56,
sharpness: 19.4deg,
delta: 43.5deg,
),
triplehead: (
inherit: "head",
size: 13.5,
sharpness: 25.5deg,
delta: 42.6deg,
),
harpoon: (
inherit: "head",
draw: mark => {
draw.arc(
(0, 0),
radius: mark.size,
start: -(90deg + mark.sharpness),
delta: -mark.delta,
fill: none,
)
},
),
straight: (
size: 10,
sharpness: 20deg,
tip-origin: mark => 0.5/calc.sin(mark.sharpness),
tail-origin: mark => -mark.size*calc.cos(mark.sharpness),
fill: none,
draw: mark => {
draw.line(
(180deg + mark.sharpness, mark.size),
(0, 0),
(180deg - mark.sharpness, mark.size),
)
},
cap-offset: (mark, y) => calc.tan(mark.sharpness + 90deg)*calc.abs(y),
),
solid: (
inherit: "straight",
tip-origin: 0,
tip-end: mark => -0.5/calc.sin(mark.sharpness),
tail-end: mark => -0.5/calc.sin(mark.sharpness),
stroke: none,
fill: auto,
),
stealth: (
size: 6,
stealth: 0.3,
angle: 25deg,
tip-origin: mark => 0.5/calc.sin(mark.angle),
tail-origin: mark => -mark.size*calc.cos(mark.angle) - 1,
tip-end: mark => mark.size*(mark.stealth - 1)*calc.cos(mark.angle),
stroke: (miter-limit: 20),
draw: mark => {
draw.line(
(0,0),
(180deg + mark.angle, mark.size),
(mark.tip-end, 0),
(180deg - mark.angle, mark.size),
close: true,
)
},
cap-offset: (mark, y) => if mark.tip {
-mark.stealth/calc.tan(mark.angle)*calc.abs(y)
} else {
calc.tan(mark.angle + 90deg)*calc.abs(y)
},
),
latex: (
size: 23, // radius of curvature
sharpness: 10deg, // angle at vertex between central line and arrow's edge
delta: 20deg, // angle spanned by arc of curved arrow edge
tip-end: mark => mark.size*(calc.sin(mark.sharpness) - calc.sin(mark.sharpness + mark.delta)),
tail-end: mark => mark.tip-end/2,
tail-origin: mark => mark.tip-end,
fill: auto,
stroke: none,
draw: mark => {
for flip in (+1, -1) {
draw.merge-path({
draw.arc(
(0, 0),
radius: mark.size,
start: flip*(90deg + mark.sharpness),
delta: flip*mark.delta,
fill: none,
)
draw.line((), ((), "|-", (0, flip*1e-1)))
})
}
}
),
cone: (
size: 8,
radius: 6,
angle: 30deg,
tip-end: mark => -mark.size,
tail-end: mark => mark.tip-end/2,
tail-origin: mark => mark.tip-end,
stroke: none,
draw: mark => {
for flip in (+1, -1) {
draw.merge-path({
draw.arc(
(-mark.size, -flip*1e-1),
radius: mark.radius,
start: 0deg,
stop: flip*mark.angle,
)
draw.line((), (0, 0))
})
}
}
),
circle: (
size: 2,
tip-end: mark => -mark.size,
tail-end: mark => mark.size,
tip-origin: mark => mark.size + 0.5,
tail-origin: mark => -(mark.size + 0.5),
fill: none,
draw: mark => draw.circle((0,0), radius: mark.size, fill: mark.fill),
cap-offset: (mark, y) => {
let r = mark.size
let o = r - calc.sqrt(calc.max(0, r*r - y*y))
if not mark.tip { o *= -1 }
o
},
),
square: (
size: 2,
angle: 0deg,
fill: none,
tip-origin: mark => +(mark.size + 0.5)/calc.cos(mark.angle),
tail-origin: mark => -(mark.size + 0.5)/calc.cos(mark.angle),
tip-end: mark => -mark.size/calc.cos(mark.angle),
tail-end: mark => +mark.size/calc.cos(mark.angle),
draw: mark => {
let x = mark.size
draw.rotate(mark.angle)
draw.rect(
(-x, -x), (+x, +x),
)
}
),
diamond: (
inherit: "square",
angle: 45deg,
),
bar: (
size: 4.9,
angle: 90deg,
tail-origin: mark => calc.min(..mark.extrude),
draw: mark => draw.line(
(mark.angle, -mark.size),
(mark.angle, +mark.size),
),
cap-offset: (mark, y) => {
let o = y*calc.tan(mark.angle - 90deg)
// if mark.tip { o *= -1 }
-o
},
),
cross: (
size: 4,
angle: 45deg,
draw: mark => {
draw.line((+mark.angle, -mark.size), (+mark.angle, +mark.size))
draw.line((-mark.angle, -mark.size), (-mark.angle, +mark.size))
},
cap-offset: (mark, y) => calc.tan(mark.angle + 90deg)*calc.abs(y),
),
hook: (
size: 2.88,
rim: 0.85,
tip-origin: mark => mark.size + 0.5,
stroke: (cap: "round"),
draw: mark => {
draw.arc(
(0,0),
start: -90deg,
stop: +90deg,
radius: mark.size,
fill: none,
)
draw.line((), (rel: (-mark.rim, 0)))
},
),
hooks: (
inherit: "hook",
draw: mark => {
for flip in (-1, +1) {
draw.arc(
(0,0),
start: -flip*90deg,
stop: +flip*90deg,
radius: mark.size,
fill: none,
)
}
},
),
">": (inherit: "head", rev: false),
"<": (inherit: "head", rev: true),
">>": (inherit: "head", extrude: (-2.88, 0), rev: false),
"<<": (inherit: "head", extrude: (-2.88, 0), rev: true),
">>>": (inherit: "head", extrude: (-6, -3, 0), rev: false),
"<<<": (inherit: "head", extrude: (-6, -3, 0), rev: true),
"|>": (inherit: "solid", rev: false),
"<|": (inherit: "solid", rev: true),
"}>": (inherit: "stealth", rev: false),
"<{": (inherit: "stealth", rev: true),
"|": (inherit: "bar"),
"||": (inherit: "bar", extrude: (-3, 0)),
"|||": (inherit: "bar", extrude: (-6, -3, 0)),
"/": (inherit: "bar", angle: +60deg, rev: false),
"\\": (inherit: "bar", angle: -60deg, rev: false),
"x": (inherit: "cross"),
"X": (inherit: "cross", size: 7),
"o": (inherit: "circle"),
"O": (inherit: "circle", size: 4),
"*": (inherit: "circle", fill: auto),
"@": (inherit: "circle", size: 4, fill: auto),
"[]": (inherit: "square"),
"<>": (inherit: "diamond"),
// crow's foot notation
crowfoot: (
many-width: 5,
many-length: 8,
one-width: 5,
zero-width: 3.5,
gap: 3,
first-gap: 5,
many: true,
one: true,
zero: true,
tail-origin: mark => -mark.many-length,
zero-fill: white,
fill: none,
draw: mark => {
let x = 0
if mark.many {
draw.line((0, mark.many-width), (-mark.many-length - .5, 0), (0, -mark.many-width))
x -= mark.many-length
}
if mark.one {
x -= mark.gap
x = calc.min(x, -mark.first-gap)
draw.line((x, mark.one-width), (x, -mark.one-width))
}
if mark.zero {
x -= mark.gap
draw.circle((x - mark.zero-width, 0), radius: mark.zero-width, fill: mark.zero-fill)
}
}
),
"n": (inherit: "crowfoot", zero: false, one: false, many: true),
"n!": (inherit: "crowfoot", zero: false, one: true, many: true),
"n?": (inherit: "crowfoot", zero: true, one: false, many: true),
"1": (inherit: "crowfoot", zero: false, one: true, many: false),
"1!": (inherit: "crowfoot", zero: false, one: true, many: false, extrude: mark => (0, -calc.max(4, mark.gap))),
"1?": (inherit: "crowfoot", zero: true, one: true, many: false),
)
#let MARKS = state("fletcher-marks", DEFAULT_MARKS)
|
https://github.com/qianxi0410/cv.typ | https://raw.githubusercontent.com/qianxi0410/cv.typ/master/main.typ | typst | MIT License | #import "template.typ": *
// å 蜜æ°æ®
#let data = toml("main.toml")
#let (name, email, phone, website, birthday, avatar) = data.cv;
#show: cv.with(
name: name,
email: email,
phone: phone,
website: website,
birthday: birthday,
avatar: avatar
)
#educations(data.educations)
#projects(data.projects)
#internships(data.internships)
#awards(data.awards)
#skills(data.skills) |
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/013%20-%20Magic%202015/001_Beast.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Beast",
set_name: "Magic 2015",
story_date: datetime(day: 18, month: 06, year: 2014),
author: "<NAME>",
doc
)
#emph[Garruk Wildspeaker was once deeply in touch with nature, a potent beastcaller, and master of green magic...until the necromancer <NAME> cursed him using the dangerous artifact known as the Chain Veil. Suffused with black mana and cut off from the voice of the wild, Garruk became a feral killer with only one goal: find Liliana and make her reverse what she had done.]
#emph[Garruk tracked Liliana to the world of Innistrad, where they again faced off. Liliana gained the upper hand long enough to get away. In the aftermath of that battle, driven half-mad by the Veil's curse, Garruk faces a crucial moment of decision...]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
I wake up and open my eyes. The air reeks of death and undeath. The witch's scent is in there somewhere, but it's faint. I'm prone, half-submerged in water. The cries of carrion birds ring in my ears. Everything hurts.
A stinking black bird lands on my chest. I grab it with both hands, snap its neck, and throw it. Its corpse makes a splash.
I inhale a lungful of moldy air and sit up. I'm in a swamp, at night. The marsh around me is littered with birds feasting on hacked-up pieces of things once undead. There's no light, but I can see in the dark.
#figure(image("001_Beast/01.jpg", width: 100%), caption: [Swamp | Art by <NAME>], supplement: none, numbering: none)
The remains of the witch's servants surround me. I killed them.
She nearly killed me.
Where is she?
Where is my axe?
There's a long thin shape under the water next to me. I reach in and my hand closes around a wooden shaft. I pull my axe out of the swamp and lean it against a fallen log. Carrion birds around me scatter, alighting in the trees above.
Exhaustion hits me again, and I'm back inside my room at the last inn I slept at, weeks ago. The fallen log is the bed, but no beds are large enough for me. I lie down on the floor, and sink again into the muck.
A beast as tall as me and as wide as it is tall approaches me and sniffs my still form. It smells mostly right, but there's decay underneath, the same as what's always coming off of me now. Under its fur, its skin is shot through with black veins, just like mine.
I summoned it during the fight with the witch.
#figure(image("001_Beast/02.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
I raise my head to look at it. It jumps back, then winces as it lands on its back legs.
It makes a rumbling growl, and when it speaks, it is the innkeeper, trembling with fear. "You scare the other patrons," he says. "You can't stay here again tonight." He's not sure he could take me in a fight, but the desperation in his posture says he might try.
He edges backward, slightly, and almost chirps. "They say there's a pack of werewolves around here that tries to do good despite their curse." He just wants me gone. "You should look for them. They only take in the strong, though. They kill the weak."
"Do I look weak to you?" I snarl.
"No, sir," he snorts. He turns and limps out of my room, splashing with each step.
More splashing noises come from the opposite direction now. They are slower, and louder, and a wave of rotted air rolls over me. I sit up again. I'm outside the inn, and the thick clusters of trees are buildings huddled together in the tiny town. There's a huge mass of bloated corpses, a little bigger than the beast I was talking to, coming right for me.
#figure(image("001_Beast/03.jpg", width: 100%), caption: [Skaab Goliath | Art by Volkan Baga], supplement: none, numbering: none)
The birds scatter with an explosion of noise. "Stitcher attack!" they cry, as they fly away. "Save the children!" If it wants to kill the townsbirds, it'll have to kill me first. I stand up, pulling myself up with the axe. I'm still bleeding from cuts on my arms. A few of them ooze black. My back hurts when I stand straight, but I have enough strength to take this thing.
And if I don't, I'll die. I was probably dying out here anyway.
I charge it, screaming. It's a ball of human corpses, maybe five feet across, with another corpse as each of its three legs and two arms, and a pitted rotten wolf embedded into it on top where a head should be. My axe slices into the thing's shoulder with a wet sound. One of the wolf's legs flops freely where I severed it from the body. Its left arm comes around to rake me with glistening silver claws, but my axe's impact pushes the thing back six inches. It only makes a surface scratch. I pull my axe out. Its right arm is coming for me, but I duck inside its range and turn the axe into its upper arm, which is a fused pair of human legs. I make a deep cut, and its claws miss me, but its left arm is coming back around and I'm stuck.
The thing jerks left, off of my axe, and falls on its side into the muck with a big splash. My beast is there, head lowered, short tusks now covered in glistening black. I'm soaked, but my axe is free. I raise it and bring it down across the thing's shoulders, slicing the rotted wolf's corpse off the top. The whole thing shudders and stops moving.
No more bird children will fall to this monstrosity.
The beast rumbles up to me, slowly, and makes a low groan. Now it's Pavel, the werewolf who leads the pack the innkeeper told me about. "I'm Pavel," he says. "We're all werewolves. You're...something else...but we're hunting the stitcher who did this. She's tough, and we could use your help. Want to come with?"
He can help me find the witch. "Where?! Where is she!?" I grab him by the tusks and scream into his face.
He steps backward, haltingly. I move with him. He snarls. "You need to show more control than this, or we'll kill you, too." His tiny eyes glisten with a little sympathy and a lot of calculation.
I let go of his tusks and stand as tall as I can despite the pain. "You could try."
He rests back on his haunches, no longer threatened, and almost purrs. "I hope we won't have to. Come with me." He turns his back and lumbers into the blackness of the swamp.
I totter along behind him. We walk in silence for a while. He twists and turns through the forest, seemingly at random. A few times, we recross our path. "Where are we going?"
He rumbles a low growl. "We live far away from civilization, where our condition cannot harm anyone but ourselves. The others will not accept you immediately; you will have to earn their trust."
"But you kill stitchers."
Pavel turns his head to face me as we walk, and grunts. "We kill zombies. We do not kill sentient creatures. We disable them, and leave them with the proper authorities." He turns his head back to the path before us. "If you insist on killing your prey, you will not be allowed to remain with us."
I hear an elk cry nearby. My stomach rumbles. "Wait here." I pace away until I can't hear Pavel anymore, climb ten feet into a tree, and watch.
It's coming this way.
I stand on the branch, ready my axe, and wait.
#figure(image("001_Beast/04.jpg", width: 100%), caption: [Dawntreader Elk | Art by <NAME>], supplement: none, numbering: none)
The elk walks right under me. I drop off of the branch, and the flat of my axe slams into the back of its head as I land. Its corpse falls sideways and lands in the muck with a dull splash.
I pull it onto a dry embankment. It smells clean, just like I don't. I pull my knife, cut a long vine from one of the trees, hang the elk by its horns, and open it from hip to neck. Dripping blood collects underneath the corpse, first pooling and then draining off into the swamp. I reach in, hold the bladder closed, slice it out, and drop it into the water. The intestines go into the muck next with a plop and a slurp.
Pavel limps up to me again, purring, as I pull out the elk's liver. "Your hunting has been invaluable to us. We would have starved without you. We have decided that you can stay."
I toss the liver to him, and he snatches it out of the air with his muzzle.
I'm starving, and the meat smells amazing, but Pavel is probably hungry too. I cut off three ribs, skin and all, and toss the chunk toward him. "So when do we go stitcher hunting?"
"Tonight," he says before ripping a piece off the hunk of dead elk. I skin the rest of it, cut off a rib, and tear into a chunk of meat myself. It tastes incredible.
We finish the elk between the two of us with ease. He lays down on all fours, and groans when his stomach hits the ground. I lay down on my back. We share a long moment, each of us resting and breathing in the swamp, as we digest my kill.
#figure(image("001_Beast/05.jpg", width: 100%), caption: [Garruk's Packleader | Art by <NAME>], supplement: none, numbering: none)
I sit up, bored. "So where is she?"
He looks at me, irritated, and grunts. "We don't know exactly. Somewhere near Gatstaf, probably on the way to Gavony."
"I'll find her." I stand up and shoulder my axe.
"Be careful," he says. "Any stitcher worth her salt will have guardians. You should not face them alone." I turn away. "And if you kill her," he groans, "you will not be allowed to return. We are not beasts." I pace away from him into the woods.
I wander through the swamp, looking for any sign of her. I sniff the ground occasionally, but I can't make out her scent over my own.
There's something on a branch over there. I approach, and find a ripped piece of purple silk. I hold it to my nose and inhale. It's her.
I put it into a pouch on my belt, crouch, and sniff. There it is. It's faint, but she must have come this way. There are broken branches over there, too, cracked by human feet. Small, just like hers are. I take five paces and sniff the ground again. Still there. Fifteen more and another sniff of the ground, and I know I've got her.
Her trail takes me through the swamp, dodging over trees and around pools of standing water. Had she gone through them, she might have lost me, but who knows what's lurking under the surface? Some swamp creature might have eaten her. She'll be dead anyway after I smash the back of her skull in.
Just when I think I'm getting close, deep footsteps rumble slowly toward me, maybe two hundred feet away. I pad into a pool of water mostly covered in plants and drop onto my haunches until only my head is exposed, and even that is covered by foliage. A rotting beast comes into view, its skin all shot through with black, and its gaping maw and tusks dripping fresh blood. It reeks of death magic. It pants, breathing heaving breaths, legs trembling. It sniffs around, but doesn't see me behind the leaves.
The stitcher's guardian. Poor thing. Whoever did this to you deserves to die.
I sit still, and it rumbles past me without even a glimpse in my direction.
Ten minutes later, I creep out of the pool, half-covered in thin green vines. I shake most of them off and keep following the trail.
After another five minutes, I hear slow and heavy footsteps a hundred feet behind me. I turn, and there's the stitcher. It's not the witchâit's huge, green with black veins, maybe nine feet tall and nine feet wide, and has gleaming black tusks. I expected a woman, at least, and smaller, but I guess this is what necromancers look like here. She'll die all the same.
I charge. She just sits down, and watches me as I come, probably waiting to surprise me. I wind up with my axe as I approach, and she still just sits there. Her eyes go wide as the blade sinks into her skull, and she drops onto her stomach with a wet crunch and a squeal. She flails for a second or two, and then dies.
Pavel's words run through my head again. "We are not beasts."
Maybe #emph[they] aren't.
A white light flashes in the distance, illuminating the horizon, and then reaching all the way to the sky. We all watch it as it rolls toward us, brighter and brighter as it comes. Then it washes over us, and all I see is white.
#figure(image("001_Beast/06.jpg", width: 100%), caption: [], supplement: none, numbering: none)
I'm standing in a swamp, over a dead beast. It smells fresh. From the black veins on its skin, I must have summoned it. From the axe wound in its head, I must have killed it.
It is only a beast. Not the innkeeper, not Pavel, not the stitcher's guardian, not even the stitcher.
I can't see in the dark anymore, but I can see color, and I smell normal now. The sun is starting to come up.
I flex my right arm. The black veins are gone, and I am strong, as strong as I was before. I take a deep breath, and let loose a roar. It echoes throughout the swamp. Birds scatter, and do not speak as they fly away.
I'm on #emph[Innistrad] , in some swamp. The witch almost killed me.
And her curse is gone.
What did she do to me?
How far gone was I?
An overwhelming wave of nausea hits me as my vision goes black and white again. I drop to my knees, clutch a thick branch on a fallen tree with black-laced hands, and vomit. By the time the retching stops, half the elk I ate is on the ground in front of me. I feel a little better, but the curse is back. And I am very tired.
#figure(image("001_Beast/07.jpg", width: 100%), caption: [Garruk, the Veil-Cursed | Art by <NAME>s], supplement: none, numbering: none)
I sniff the air. The witch's scent is still here, mixed in with the half-digested elk, and one of her footprints is right there in front of me.
I keep following the trail, now supporting myself with the axe. Twenty minutes of tracking takes me to a road. I emerge from the swamp, blinking in the breaking dawn.
The road extends as far as I can see in both directions. The blinding light came from the right, where the sun is rising now. It was enough to cure me, if only for a moment. I don't know what it was, but it was powerful.
It is the only thing that has ever helped. If I had been closer, would it have saved me?
If I found the source, I could be free. I could stand tall, walk straight, call healthy creatures to my side.
I could stop hunting her.
What would I do instead? I have hunted her for so long. What did I do before?
I look to my left, and see a broken branch. I crouch down to it and sniff, and a growl rumbles in my gut. It's her.
I may not get another chance at a cure. If I leave the light behind, I'll have to kill her before I lose myself again.
If I follow the light, though, I'll lose the trail.
I sniff the ground again. She's still there, and it's fresh enough to follow.
I turn to my left, away from the blinding dawn, and begin to walk.
#figure(image("001_Beast/08.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
|
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/goto_definition/import_star_variable.typ | typst | Apache License 2.0 | // path: variable.typ
#let x = 2;
-----
.
#import "variable.typ": *
#(/* position after */ x);
|
https://github.com/dainbow/MatGos | https://raw.githubusercontent.com/dainbow/MatGos/master/themes/36.typ | typst | #import "../conf.typ": *
= ÐÐœÑегÑалÑÐœÐ°Ñ ÑПÑÐŒÑла ÐПÑО. РазлПжеМОе ÑÑМкÑОО ÑегÑлÑÑМПй в ПкÑеÑÑМПÑÑО ÑПÑкО в ÑÑÐŽ ТейлПÑа.
== ÐÐœÑегÑалÑÐœÐ°Ñ ÑПÑÐŒÑла ÐПÑО.
#theorem[_ЀПÑÐŒÑла ÐПÑО ÐŽÐ»Ñ ÐºÑÑга_
ÐÑÑÑÑ f гПлПЌПÑÑМа в D, $overline(O_rho (a)) in D$ ÑПгЎа
#eq[$
f(z) = 1/(2 pi i) integral_(abs(zeta - a) = rho) (f(zeta)) / (zeta - z) d zeta
$]
]
#proof[
Ð ÑÐžÐ»Ñ $overline(O_rho (a)) in D => exists R > rho: space O_R (a) in D$.
ÐаÑОкÑОÑÑеЌ $z in O_rho (a)$
РаÑÑЌПÑÑОЌ ÑлеЎÑÑÑÑÑ ÑÑМкÑОÑ
#eq[$
g(zeta) = cases((f(zeta) - f(z)) / (z - zeta) \, zeta != z, f'(z) \, z = zeta)
$]
ÐМа ÑЎПвлеÑвПÑÑÐµÑ ÑÑлПвОÑÐŒ ÑÑОлеММПй ÐÐµÐŒÐŒÑ ÐÑÑÑа, ÑлеЎПваÑелÑМП
#eq[$
0 = integral_(abs(zeta - a) = rho) g(zeta) d zeta = integral_(abs(zeta - a) = rho) (f(zeta)) / (zeta - z) d zeta - integral_(abs(zeta - a) = rho) (f(z)) / (zeta - z) d zeta = integral_(abs(zeta - a) = rho) (f(zeta)) / (zeta - z) d zeta - f(z) integral_(abs(zeta - a) = rho) (d zeta) / (zeta - z).
$]
ÐбПзМаÑОЌ $G(z) = integral_(abs(zeta - a) = rho) (d zeta) / (zeta - z)$.
ÐМа гПлПЌПÑÑМа в ПблаÑÑО как ОМÑегÑал ÐПÑО. $G' = integral_(abs(zeta - a) = rho) (d zeta) / (zeta - z)^2 equiv 0$
СлеЎПваÑелÑМП $G(z) = "const" = G(a) = 2 pi i$
ÐÑÑÑЎа ÑелеЌеМÑаÑМП пПлÑÑОЌ ÑÑебÑеЌПе.
]
#note[ЀПЌÑлОÑÐŸÐ²ÐºÑ ÐŽÐ»Ñ Ð±ÐŸÐ»ÐµÐµ ПбÑегП ÑлÑÑÐ°Ñ ÑЌПÑÑО в пÑПÑлПЌ бОлеÑе]
== РазлПжеМОе ÑÑМкÑОО ÑегÑлÑÑМПй в ПкÑеÑÑМПÑÑО ÑПÑкО в ÑÑÐŽ ТейлПÑа.
#theorem[
ÐÑÑÑÑ $f$ - гПлПЌПÑÑÐœÐ°Ñ Ð² $D$, $O_R (a) subset D$, ÑПгЎа
#eq[$forall z in O_R (a): f(z) = sum_(n=0)^(infinity) c_n (z-a)^n, space c_n = (f^((n))(a)) / n! $]
]
#proof[
ÐПзÑЌеЌ $0 < r < R$, ÑПгЎа $f$ гПлПЌПÑÑМа в $overline(O_r (a))$. ТПгЎа пП
ÑеПÑеЌе ÐПÑО
$2 pi i space f(z) = integral_(gamma_r) (f(xi) d xi) / (xi - z)$.
РаÑпОÑеЌ #eq[
$1 / (xi - z) = 1 / ((xi - a) - (z - a)) = 1 / ((xi - a)) dot.op 1 / (1 - (z - a) / (xi - a)) =^((|z-a| < |xi - a|)) = 1 / (xi - a) sum_(n = 0)^infinity ((z-a)/(xi-a))^n = sum_(n = 0)^infinity (z-a)^n/(xi-a)^(n+1)$
]
ÐПлÑÑеММÑй ÑÑÐŽ ÑÑ
ПЎОÑÑÑ ÑавМПЌеÑМП, а зМаÑÐžÑ ÐŒÐŸÐ¶ÐœÐŸ пПÑлеММП ОМÑегÑОÑПваÑÑ.
$2 pi i space f(z) = integral_(gamma_r) f(xi) / (xi - z) d xi = sum_(n = 0)^infinity integral_(gamma_r) f(xi) (z-a)^n/(xi-a)^(n+1) d xi = sum_(n=0)^(infinity) 2 pi i c_n (z-a)^n$
ÐÑОÑеЌ пП ÑлеЎÑÐ²ÐžÑ ÑПÑÐŒÑÐ»Ñ ÐПÑО ÐŽÐ»Ñ ÐºÑÑга, $2 pi i dot.op c_n = (f^((n)) (a)) / n!$
ÐÑ Ñаз веÑМП ÐŽÐ»Ñ Ð»ÑбПгП $r < R$, ÑП О ÐŽÐ»Ñ $R$ веÑМП.
] |
|
https://github.com/RaphGL/ElectronicsFromBasics | https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/DC/chap4/6_scientific_notation_in_spice.typ | typst | Other | === Scientific notation in SPICE
The SPICE circuit simulation computer program uses scientific notation
to display its output information, and can interpret both scientific
notation and metric prefixes in the circuit description files. If you
are going to be able to successfully interpret the SPICE analyses
throughout this book, you must be able to understand the notation used
to express variables of voltage, current, etc. in the program.
Let\'s start with a very simple circuit composed of one voltage source
(a battery) and one resistor:
#image("static/00079.png")
To simulate this circuit using SPICE, we first have to designate node
numbers for all the distinct points in the circuit, then list the
components along with their respective node numbers so the computer
knows which component is connected to which, and how. For a circuit of
this simplicity, the use of SPICE seems like overkill, but it serves the
purpose of demonstrating practical use of scientific notation:
#image("static/00080.png")
Typing out a circuit description file, or #emph[netlist], for this
circuit, we get this:
```netlist
simple circuit
v1 1 0 dc 24
r1 1 0 5
.end
```
The line \"`v1 1 0 dc 24`\" describes the battery, positioned between
nodes 1 and 0, with a DC voltage of 24 volts. The line \"`r1 1 0 5`\"
describes the 5 Ω resistor placed between nodes 1 and 0.
Using a computer to run a SPICE analysis on this circuit description
file, we get the following results:
```table
node voltage
( 1) 24.0000
```
```table
voltage source currents
name current
v1 -4.800E+00
total power dissipation 1.15E+02 watts
```
SPICE tells us that the voltage \"at\" node number 1 (actually, this
means the voltage between nodes 1 and 0, node 0 being the default
reference point for all voltage measurements) is equal to 24 volts. The
current through battery \"v1\" is displayed as -4.800E+00 amps. This is
SPICE\'s method of denoting scientific notation. What its really saying
is $-4.800 times 10^0 "amps"$, or simply -4.800 amps. The negative
value for current here is due to a quirk in SPICE and does not indicate
anything significant about the circuit itself. The \"total power
dissipation\" is given to us as 1.15E+02 watts, which means $1.15 times
10^2 "watts"$, or 115 watts.
Let\'s modify our example circuit so that it has a 5 $k Omega$ (5 kilo-ohm, or
5,000 ohm) resistor instead of a 5 $Omega$ resistor and see what happens.
#image("static/00081.png")
Once again is our circuit description file, or \"netlist:\"
```netlist
simple circuit
v1 1 0 dc 24
r1 1 0 5k
.end
```
The letter \"k\" following the number 5 on the resistor\'s line tells
SPICE that it is a figure of $5 k Omega$, not $5 Omega$. Let\'s see what result we
get when we run this through the computer:
```table
node voltage
( 1) 24.0000
```
```table
voltage source currents
name current
v1 -4.800E-03
total power dissipation 1.15E-01 watts
```
The battery voltage, of course, hasn\'t changed since the first
simulation: its still at 24 volts. The circuit current, on the other
hand, is much less this time because we\'ve made the resistor a larger
value, making it more difficult for electrons to flow. SPICE tells us
that the current this time is equal to $-4.800E-03$ amps, or $-4.800 times
10^-3$ amps. This is equivalent to taking the number -4.8 and
skipping the decimal point three places to the left.
Of course, if we recognize that $10^-3$ is the same as the metric
prefix \"milli,\" we could write the figure as -4.8 milliamps, or -4.8
mA.
Looking at the \"total power dissipation\" given to us by SPICE on this
second simulation, we see that it is $1.15E-01$ watts, or $1.15 times
10^-1$ watts. The power of -1 corresponds to the metric prefix
\"deci,\" but generally we limit our use of metric prefixes in
electronics to those associated with powers of ten that are multiples of
three (ten to the power of . . . -12, -9, -6, -3, 3, 6, 9, 12, etc.).
So, if we want to follow this convention, we must express this power
dissipation figure as 0.115 watts or 115 milliwatts (115 mW) rather than
1.15 deciwatts (1.15 dW).
Perhaps the easiest way to convert a figure from scientific notation to
common metric prefixes is with a scientific calculator set to the
\"engineering\" or \"metric\" display mode. Just set the calculator for
that display mode, type any scientific notation figure into it using the
proper keystrokes (see your owner\'s manual), press the \"equals\" or
\"enter\" key, and it should display the same figure in
engineering/metric notation.
Again, I\'ll be using SPICE as a method of demonstrating circuit
concepts throughout this book. Consequently, it is in your best interest
to understand scientific notation so you can easily comprehend its
output data format.
|
https://github.com/alberto-lazari/computer-science | https://raw.githubusercontent.com/alberto-lazari/computer-science/main/dim/notes.typ | typst | #import "@local/unipd-doc:0.0.1": *
#show: notes()
#show: unipd-doc(
title: [Digital and Interactive Multimedia],
subtitle: [Notes],
author: [<NAME>],
date: [I Semester A.Y. 2023-2024],
)
= Presentation
== Outline
+ 3d vision and acquisition
+ Lab + 3d processing
+ Seminar?
+ Lidar and automotive
+ VR
+ AR
+ SLAM
+ Seminars
== Exam
Two parts:
+ 2 open questions (10 pts each)
+ 10 multiple choice (1 pt each)
Dates:
- Jan 22 12:30
- Feb 07 12:00
/ Multimedia: Multiple types of media combined (audio, video, text, ...)
= Media types
== Image
Images can be formed by combining:
- Illuminance: $i(x, y)$
- Reflectance: $r(x, y)$
== Video
- Fast sequence of single images
- At least 25 fps to see motion, because of retina's persistence phenomenon
= 3D Perception
3 different ways to perceive:
- Oculomotor (binocular vision)
- Static visual
- Motion
== Oculomotor cues
- Accomodation: changes in focal aperture in the crystalline
- Vergences: movements of the eyes to merge the two images
== Visual cues
Features of images that allow to create a 3D (static) perception:
- Occlusions
- Relative dimensions: far $->$ small, close $->$ big
- Textures
- Linear perspective: straight lines in perspective
- Aerial perspective: fog in the far distance
- Shadows
== Motion
Also motion can create 3D perception of a (2D) video:
- Motion parallax
- Relative angular velocity: far objects appear slower
- Radial expansion
- Shadow movement
= Binocular vision
Requires:
+ Simultaneous perception: two images in both eyes
+ Fusion:
- Motor: accomodation + vergence
- Sensory: create single image
+ Stereopsis: interpret two images add 3D perception to the fused image
/ Horopter: area where points don't produce duplicate images (Panum area)
#lecture[3 -- 10/10]
= 3D media
Technologies are divided in:
- Passive
- Active
w.r.t. the viewer
== Passive 3D rendering
- Lens arrays (3D cards)
- Parallax occlusion: bands with holes, similar to lens (3DS?)
- Anaglyph: red/blue glasses (colors are off, though)
- Dolby 3D: slightly different colors per eye (requires wheel on projector and double the frame-rate)
- Polarized light: need to stay still and not rotate head
- Circular polarization: it needs:
- Two projectors with polarizers
- Special silver reflective screen
- Glasses
== Active 3D
Example: Nvidia glasses, alternate shutters
= Stereo images
- Disparity map shows intensity of parallax effect between two images (two eyes)
- Stereo images have to be rectificated #sym.arrow point the object in focus
#lecture[4 -- 31/10]
= Camera parameters
- Intrinsic: depend on the camera itself
- Extrinsic: camera location/orientation
= Features
Feature recognition can be useful for:
- Camera calibration
- Stereo image creation
- Tracking
- Image mosaicing
They have to be invariant to:
- Illumination
- Scale
- Rotation
- Affine (similarity, slight changes)
- Perspective projection
== SIFT algorithm
Used for feature recognition (ex, for image matching)
#lecture(5)
== Direct Linear Transform (DLT)
Infer the 11 parameters (5 intrinsic + 3 rotations + 3 translations) from image.
At least 6 points are needed
#lecture(9)
= 3D reconstruction
== Rectification
Make the image rows match with epipolar lines
== Point clouds
Set of points in the space.
Provides information for each point about:
- Geometry: position
- Color, reflectance, ... (optional)
= Camera arrays
Possible applications:
- HDR
- Higher resolution
- Tiled panoramas
- Synthetic aperture photography: show subjects partially hidden behind occluders
- Hybrid aperture photography: mix various apertures in the same image (ex light fields)
== Light fields
Use microlens arrays to merge various point of views, apertures and focus in a same image, allowing for post-processing access of those informations
#lecture(10)
= VR
/ VR experience: the user feels *immersed* in a *responsive* virtual world #sym.arrow dynamic control of view point
== Immersion
VR is immersive because of:
+ Stereovision, provided by *headset*
+ Dynamic control of viewpoint
+ Surrounding experience
Can also provide:
- Various Degrees Of Freedom (DOF)
- Interaction with controllers
- Aptic feedback
== Navigation
- Controller/keyboard/joystick: more nausea-prone
- Teleporting (movement has to be not too quick)
- Threadmills
#lecture(11)
= 360 images
Acquisition with:
- Multiple cameras
- Catadioptric: reflection on curved mirrors
- Fish-eye lens
Sphere construction needs:
- Multiple cameras (can't acquire the whole sphere)
- Stitching
== Sphere representations
How to represent a sphere on a flat topology?
- Equirectangular projection: geographical maps' method
Great distortions and low algorithms performance
- Cube map: good performances + natural images, but artifacts
- Pyramid projection: lots of discontinuities, but clear center (pyramid basis).
Useful for streaming
#lecture(13)
= Quality of Experience
How to objectively measure it?
== Saliency maps
Interesting regions, that catch user's attention and focus
Can be generated with:
- Bottom-up approaches: ex Gabor filters, based on feature detection
- Top-down ones
== 360 content
Rendering can be done either:
- Client-side: requires full video streaming (90% of the FOV is disregarded) and processing
- Server-side: render and stream only necessary parts #sym.arrow reduce bandwidth.
Can be done with:
- Two-tier streaming: parallel stream of base, low-res video + HD viewport area.
Bad performance, because two streams compete for resources
- Viewport-adaptive streaming: more versions for different possible viewports.
Requires server-side storage
- Tile-based streaming: sphere divided in tiles, to be streamed
- at different resolutions (full delivery)
- possibly not streamed at all (partial delivery, bad QoE)
Predict head movements with saliencies
#lecture[14 -- Seminar]
= Immersive media compression
Point clouds are difficult to compress: sparse, irregular...
#sym.arrow quantize (voxelize)
Then just use #underline[_*AI*_] to reconstruct:
- Uses 3D convolutional neural network
- Works perfectly for dense point clouds, not so much on sparse ones
- Works on static point clouds (models, not animations/videos)
Alternatively use graph-based solutions:
- No voxelization
- Results are too smooth
- Point properties difficult to compress (color)
#lecture(17)
= Objective evaluation (QoS)
Image quality assessment: compare and provide evidence of improvement
Subjective tests are too complicated, expensive, difficult...
== Full reference
Requires a reference of the original picture (?)
- PSNR/MSE: not consistent with human perception (blur looks not destructive)
- SSIM $in [0, 1]$: improvement, measures similarity between two images.
It compares luminance
- VMAF $in [0, 100]$: for video
== Reduced reference
Uses feature extraction
== No reference
Brisque and NIQE (lower is better)
= QoE
Depends on many factors:
- Technological
- Multi-sensory
- Emotions (frustration, surprise)
#lecture(18)
= Subjective assessment
Most reliable way of measuring multimedia quality
In order to be reliable needs:
- Large number of users (at least 15, screened for visual acuity)
- Description of:
+ Laboratory equipment: screen, distance, illumination, ...
+ Data set: contents used
+ Methodology: rating target (quality, comparison, impairment) and scale, stimuli (single/double)
+ Score processing: mean, outlier detection, ...
- Introduction to method, training sequence.
Consider a break after that (to answer questions)
- No more than 30 mins sessions
/ Spatial Information (SI): complexity in image (spatial detail present)
/ Temporal Information (TI): frequency of changes in video
== Learning effect
Calibrate time to balance:
- Training: user becomes more sensitive
- Tiredness: user becomes less sensitive
Control it by:
- Showing full range of stimuli (SI/TI)
- Short sessions
- Pay participant
- Randomize stimuli
== Methods
- Single-Stimulus/Absolute Category Rating (SS/ACR): single image at a time, index of presentation
- ACR with Hidden Reference (ACR-HR): a picture is secretly a reference.
Differential MOS between scores (against the reference)
- Double-Stimulus Impairment Scale (DSIS): rate degradation of image, given a non-impaired reference (first, then the other is showed)
- Double-Stimulus Continuous Quality-Scale (DSCQS): two images, one is reference (don't know which).
Vote on whole presentation, on vertical scale.
Results are to be considered as differences from reference
- Single-Stimulus Continuous Quality Evaluation (SSCQE): continuously rate video quality, with slider
- Simultaneous Double-Stimulus for Continuous Evaluation (SDSCE): continuously rate side-by-side video, knowing which is reference
- Subjective Assessment of Multimedia Video Quality (SAMVIQ): various different sequences, with explicit and hidden references.
User can go backward etc...
- Pair-wise Comparison (PC): two videos, one after other.
Select the best
- Simulator Sickness Questionnaire (SSQ): 360° video, 0-3 rating.
At least 28 subjects, no more than 25 continuous mins, no more 50 rating mins.
< 1.5 h participation
=== Comparison
- Methods that use explicit references measure fidelty (DSIS)
- ACR is easier to implement
- ACR-HR is even better, because it only considers the difference between the reference (no bias towards specific pictures)
- PC can be used as a last resort for the items that have the same rating (direct comparison, 1v1)
=== Designs
Need to show all pairs to compare:
- Full design: $O (n^2)$
- Reduced design: assume transitivity + make sorting algorithm: test becomes human merge sort $O (n dot log n)$
== MOS process
/ Mean Opinion Score (MOS): average observer rate
/ Standard deviation: $display( s = sqrt(1 /n sum_(i = 0)^N (x_i - m)^2) )$,
where $N$: sample size, $m$: mean
/ Standard error: $display( "SE" = s / sqrt(N) )$
/ Confidence Interval: $"ci" = m plus.minus 0.95 dot "SE"$
95% probability that user's average is within confidence interval
== Crowdsourcing
Alternative method, ask people from internet, under compensation:
- No controlled environment
#lecture(22)
= Augmentation/Mediation
/ Augmentation: amount of virtual content on top of real world
Examples:
- Information overlay
- Spatial anchor of virtual objects
/ Mediation: change surroundings
Examples:
- Beautification
- Diminished reality
== AR
- Strong AR: full surroundings knowledge (precise tracking, semantic understanding)
- Weak AR: little tracking/interaction
Technological solutions:
- Marker-based AR: very precise tracking, if light conditions are good.
When no marking the experience disappears
- Marker-less AR: more flexible, might not be suitable for the experience (not enough space/does not make sense)
- Location-based AR: Google Maps, not always accurate, because of technologies/sensors
=== SLAM algorithm
Combine visual + inertial sensors to:
- Create map of environment
- Continuously position device
System:
+ Sensors
+ Front-end: feature extraction of real environment
+ Back-end: localize POV, reconstruct model, analyze frames
+ Estimate: reconstruction of environment, with locations of features + POV
3D maps are usually meshes
|
|
https://github.com/khalilhannechi/labs | https://raw.githubusercontent.com/khalilhannechi/labs/main/Lab-4.typ | typst | #import "Class.typ": *
#show: ieee.with(
title: [#text(smallcaps("Lab #4: ROS2 using RCLPY in Julia"))],
authors:
(
(
name: "<NAME>",
department: [Senior-lecturer, Dept. of EE],
organization: [ISET Bizerte --- Tunisia],
profile: "a-mhamdi",
),
(
name: "<NAME>",
department: [Dept. of EE],
organization: [ISET Bizerte --- Tunisia],
profile: "khalilhannechi",
),
(
name: "<NAME> ",
department: [Dept. of EE],
organization: [ISET Bizerte --- Tunisia],
profile: "azizchaiebc",
),
)
// index-terms: (""),
// bibliography-file: "Biblio.bib",
)
. Introduction:
This lab consists of two parts: "Application" and "Clarification."
In the first part, we'll utilize Julia REPL to implement ROS2 codes as depicted in Figure 1. The second part involves explaining each command and its function in detail.
#figure(
image("Images/REPL.png", width: 100%, fit: "contain"),
caption: "Julia REPL"
) <fig:repl>
#test[in this lab i can't simulate ROS2 with my laptop for that i'm gonna use the simulation picture in Images/ infodev folder]
= Application
First, we'll begin by installing ROS2. Then, we'll proceed by sourcing our ROS2 installation as follows:
```zsh
source /opt/ros/humble/setup.zsh
```
.Secondly, we'll open a Julia terminal and write down the codes below. Alternatively, we can directly open them from our folder "infodev/codes/ros2"
#rect(fill: yellow)[The first programme is the publisher code ]
#let publisher=read("../Codes/ros2/publisher.jl")
#let subscriber=read("../Codes/ros2/subscriber.jl")
#raw(publisher, lang: "julia")
#rect(fill: yellow)[The second programme is the subscriber code]
After writing both programs, we'll execute each in separate terminals. Subsequently, the subscriber will listen to the message broadcasted by the publisher.
#raw(subscriber, lang: "julia")
. To initiate the graphical tool rqt_graph and establish data flow between the publisher and subscriber, we must connect both to a node named "infodev," as illustrated in Figure 2. This is accomplished by executing the following lines of code:
```zsh
source /opt/ros/humble/setup.zsh
rqt_graph
```
#figure(
image("Images/rqt_graph.png", width: 100%),
caption: "rqt_graph",
) <fig:rqt_graph>
. After linking the publisher and the subscriber, the publisher will transmit the designated message one hundred times to the node associated with the subscriber..
#rect(fill:aqua)[[Info [TALKER] Hello, ROS2 from Julia!(1...100)]]
then the subscriber will respond, in the node ,by
#rect(fill:aqua)[[ Info [LISTNER] I heard Hello, ROS2 from Julia!(1...100) ]] as in figure 3
#figure(
image("Images/pub-sub.png", width: 100%),
caption: "The communication between the publisher and the subscriber unfolds as follows",
) <fig:pub-sub>
@fig:topic-list shows the current active topics, along their corresponding interfaces.
/*
```zsh
source /opt/ros/humble/setup.zsh
ros2 topic list -t
```
*/
#figure(
image("Images/topic-list.png", width: 100%),
caption: "List of topics",
) <fig:topic-list>
//#test[Some test]
= Clarafication :
- in this part we gonna explain each code line and we gonna start with the pulisher code first :
#rect(fill:yellow)[The First programme is the spublisher code]
```zsh
using pycall
```
This package can come in handy when you aim to make use of Python's extensive libraries or integrate Python-specific features into your Julia codebase.
```zsh
##Import the rclpy module from ROS2 Python
rclpy = pyimport("rclpy")
```
In Julia, you can leverage PyCall to import the 'rclpy 'module from Python. rclpy serves as a Python client library for the Robot Operating System (ROS) 2.
```zsh
str = pyimport("std_msgs.msg")
```
import the std_msgs.msg module from ROS 2 into Julia
```zsh
rclpy.init()
```
Initialize ROS2 runtime
```zsh
node = rclpy.create_node("my_publisher")
```
create a node named "my_publisher" using the rclpy
```zsh
rclpy.spin_once(node, timeout_sec=1)
```
. Execute a single iteration of the ROS 2 event loop within a specified timeout period using the 'spin_once' function from the 'rclpy 'module.
```zsh
pub = node.create_publisher(str.String, "infodev", 10)
```
- In Python, use the create_publisher function from the rclpy module to instantiate a publisher within a ROS 2 node named "node." This publisher will be configured to publish messages of a specific type on a defined topic with a designated name.
```zsh
for i in range(1, 100)
msg = str.String(data="Hello, ROS2 from Julia! ($(string(i)))")
pub.publish(msg)
txt = "[TALKER] " * msg.data
@info txt
sleep(1)
end
```
. Using PyCall in Julia, establish a publisher node to communicate with a ROS 2 system. This node will publish messages to a topic named "infodev." Each message will contain a string with the text "Hello, ROS2 from Julia!" accompanied by an incrementing number ranging from 1 to 99.
```zsh
rclpy.shutdown()
node.destroy_node()
```
Deliting the rcply and destroy the node
#rect(fill:yellow )[ The second programm : the subscriber code]
```zsh
rclpy = pyimport("rclpy")
```
Utilize PyCall in Julia to import the rclpy module from Python. This module, integral to the Robot Operating System 2 (ROS 2) ecosystem, offers capabilities for crafting ROS 2 nodes, publishers, subscribers, and additional functionalities.
```zsh
str = pyimport("std_msgs.msg")
```
Using PyCall in Julia, import the std_msgs.msg module from ROS 2. This module comprises message types frequently employed in ROS 2, including standard messages for various data types such as strings, integers, floats, and more.
```zsh
node = rclpy.create_node("my_subscriber")
```
creat a node called my subscriber in a specific topic
```zsh
function callback(msg)
txt = "[LISTENER] I heard: " * msg.data
@info txt
end
```
Create a callback function in Julia that executes when messages are received by a subscriber. This function will print the received message data, prefixed with an indication that it was received by the listener node
```zsh
sub = node.create_subscription(str.String, "infodev", callback, 10)
```
In Python, within a ROS 2 node named "node," utilize the create_subscription function from the rclpy module to instantiate a subscriber. This subscriber will subscribe to messages of type std_msgs.msg.String on the topic "infodev" and trigger the callback function upon receiving messages.
```zsh
while rclpy.ok()
rclpy.spin_once(node)
end
```
. Develop a loop in Python that iteratively spins the ROS 2 node until the ROS 2 context, checked via 'rclpy.ok()', remains valid. This loop ensures sustained processing of messages and callbacks by the node for as long as the ROS 2 context remains valid.
//#test[Some test]
|
|
https://github.com/ellmau/cv-typst | https://raw.githubusercontent.com/ellmau/cv-typst/main/cv_de.typ | typst | #import "cv.typ": *
#show: my-cv.with(language:"de") |
|
https://github.com/grnin/Zusammenfassungen | https://raw.githubusercontent.com/grnin/Zusammenfassungen/main/Bsys2/11_Ext4.typ | typst | // Compiled with Typst 0.11.1
#import "../template_zusammenf.typ": *
#import "@preview/wrap-it:0.1.0": wrap-content
/*#show: project.with(
authors: ("<NAME>", "<NAME>"),
fach: "BSys2",
fach-long: "Betriebssysteme 2",
semester: "FS24",
tableofcontents: (enabled: true),
language: "de"
) */
= Ext4
In Ext4 sind die wichtigen Datenstrukturen vergrössert #hinweis[(_Inodes_ haben 256 Byte
statt 128, _Gruppendeskriptoren_ 64 Byte statt 32, _Blockgrösse_ bis 64 KB)].
Grosse Blöcke sind besser fÌr viele grosse Dateien, da weniger Metadaten benötigt werden.
Erlaubt höhere maximale Dateigrösse. Zudem werden Blöcke von den Inodes mit _Extent Trees_
verwaltet und _Journaling_ wird verwendet.
#wrap-content(
image("img/bsys_47.png"),
align: top + right,
columns: (80%, 20%),
)[
== Extents
Ein _Extent_ beschreibt ein _Intervall physisch konsekutiver Blöcke_. Ist 12 Byte gross
#hinweis[(4B logische Blocknummer, 6B physische Blocknummer, 2B Anzahl Blöcke)].
Positive Zahlen = Block initialisiert, Negativ = Block voralloziert.
Da eine EinschrÀnkung auf ausschliesslich konsekutive Dateien nicht praktikabel ist,
muss eine Datei _mehr als einen Extent umfassen_ können. Im Inode hat es in den 60 Byte
fÃŒr direkte und indirekte Block-Adressierung Platz fÃŒr 4 Extents und einen Header.
== Extent Trees
_Index-Knoten_ #hinweis[(Innerer Knoten des Baums, besteht aus Index-Eintrag und Index-Block)]\
_Index-Eintrag_ #hinweis[(EnthÀlt Nummer des physischen Index-Blocks und kleinste logische Blocknummer
aller Kindknoten)]
]
=== Extent Tree Header
FÌr mehr als 4 Extents braucht man einen zusÀtzlichen Block. Deshalb sind die ersten
12 Byte kein Extent, sondern der Extent Tree Header:
- 2 Byte _Magic Number_ #hex("F30A")
- 2 Byte _Anzahl EintrÀge_, die _direkt_ auf den Header folgen
#hinweis[(Wie viele Extents folgen dem Header?)]
- 2 Byte _Anzahl EintrÀge_, die _maximal_ auf den Header folgen können
- 2 Byte _Tiefe des Baums_
#hinweis[(0: EintrÀge sind Extents, $>=$1: EintrÀge sind Index Nodes)]
- 4 Byte _reserviert_
=== Index Nodes
Ein Index-Node spezifiziert _einen Block, der Extents enthÀlt_. Der Block enthÀlt am
Anfang einen _Header_ und danach die Extents #hinweis[(max. 340 bei 4 KB Blockgrösse)].
- 4 Byte _kleinste logische Blocknummer_ aller Kind-Extents
- 6 Byte _physische Blocknummer_ des Blocks, auf den der Index-Node verweist
- 2 Byte _unbenutzt_
Werden mehr als $4 dot 340 =$ _$bold(1360)$ Extents_ #hinweis[(#hex(550))] benötigt,
muss man Blöcke mit Index-Nodes einfÌhren. Statt Extents stehen dann _Index Nodes
im Block_. Die _Tiefe_ im Inode wird auf _2_ gesetzt, in den Index-Node-Blöcken auf 1.
Die _kleinste logische Blocknummer_ aller Kind-Extents _propagiert_ dann bis in den
jeweils obersten Index-Node. Benötigt man dann _noch mehr Extents_, kann die _Tiefe_ im
Inode bis auf _5_ gesetzt werden.
#wrap-content(
image("img/bsys_48.png"),
align: top + right,
columns: (50%, 50%),
)[
=== Index-Block
Ein Index-Block enthÀlt einen eigenen _Tree-Header_, Tiefe ist um 1 kleiner als beim
Ìbergeordneten Knoten. EnthÀlt _Referenz auf die Kind-Knoten_: je nach Tiefe entweder
Index-EintrÀge oder Extents. `i_block[0...14]` kann als (sehr kleiner) Index-Block
aufgefasst werden.
]
=== Notation
#table(
columns: (1fr, 1fr),
table.header([(in)direkte Addressierung], [Extent-Trees]),
[_direkte Blöcke:_ Index $|->$ Blocknr.],
[_Indexknoten:_ Index $|->$ (Kindblocknr, kleinste Nummer der 1. logischen Blöcke aller Kinder)],
[_indirekte Blöcke:_ indirekter Block.Index $|->$ direkter Block],
[_Blattknoten:_ Index $|->$ (1. logisch. Block, 1. phy. Block, Anz. Blöcke)],
[], [_Header:_ Index $|->$ (Anz. EintrÀge, Tiefe)],
)
==== Beispiel Berechnung 2MB grosse, konsekutiv gespeicherte Datei, 2KB Blöcke ab Block #hex("2000")
_(In-)direkte Block-Adressierung_\
2 MB = $2^21$B, 2 KB = $2^11$B, $ 2^(21-11) = 2^10 = #fxcolor("rot", hex(400))$
Blöcke von #fxcolor("grÌn", hex(2000)) bis #fxcolor("orange", hex("23FF"))
$0 arrow.bar #fxcolor("grÃŒn", hex(2000)),
1 arrow.bar #hex(2002),
...,
#hex("B") arrow.bar #hex("200B")$
$#hex("C") arrow.bar #hex(2400)$ #hinweis[(indirekter Block)]\
$#hex(1400).#hex(0) arrow.bar #hex("200C"),
#hex(1400).#hex(1) arrow.bar #hex("200D"),
...,
#hex(1400).#hex("3F3") arrow.bar #fxcolor("orange", hex("23FF"))$
_Extent Trees_ \
*Header:* $0 arrow.bar (1,0)$\
*Extent:* $1 arrow.bar (0, #fxcolor("grÃŒn", hex(2000)), #fxcolor("rot",hex(400)))$
== Journaling
Wird eine Datei _erweitert_, passiert folgendes:
- _Neue Blöcke_ werden fÌr die Daten _alloziert_
- Der _Inode_ der Datei wird _angepasst_, um die Blöcke zu referenzieren
- Die _Block-Usage-Bitmaps_ werden _angepasst_
- Die _Counter_ freier und benutzer Blöcke werden _angepasst_
- Die _Daten_ werden in die Datei geschrieben
Wenn das Dateisystem dabei _unterbrochen_ wird, kann es zu _Inkonsistenzen_ kommen.
Ein System _ohne_ Journaling kann sehr lange brauchen, um ein Dateisystem auf
Inkonsistenzen zu prÃŒfen, da _alle Metadaten_ ÃŒberprÃŒft werden mÃŒssen.
_Journaling verringert diese PrÃŒfung erheblich_.
Dateisystem muss nur die Metadaten ÃŒberprÃŒfen, die noch im Journal referenziert sind.
=== Journal
Das Journal ist eine _reservierte Datei_, in die Daten relativ _schnell geschrieben_
werden können. Besteht aus _wenigen sehr grossen Extents_ oder bestenfalls aus
_einem einzigen Extent_ #hinweis[(Typischerweise Inode 8, 128MB)].
Eine _Transaktion_ ist eine Folge von Einzelschritten, die das Dateisystem gesamtheitlich
vornehmen soll.
=== Journaling und Committing
Daten werden zuerst als _Transaktion ins Journal_ geschrieben #hinweis[(Journaling)].
Daten werden erst _danach_ an ihre _endgÃŒltige Position_ geschrieben #hinweis[(Committing)].
Daten werden nach dem Commit aus dem Journal _entfernt_.
Journaling ist _schneller_, weil alle Daten in _konsekutive_ Blöcke geschrieben werden.
Committing muss u.U. _viele verschiedene_ Blöcke modifizieren.
=== Journal Replay
Startet das System neu, kann es _anhand der Journal-EintrÀge_ die Metadaten untersuchen,
die _potenziell korrupt_ sein könnten. Alle Transaktionen, die noch im Journal sind,
wurden _noch nicht durchgefÃŒhrt_ und werden mit Journal Replay (noch einmal) ausgefÃŒhrt
oder auf Fehler ÌberprÌft. _Im Gegensatz zu ext2 muss nicht der gesamte DatentrÀger auf
Fehler untersucht werden._
=== Journaling Modi
Es gibt 3 Modi: (Full) Journal, Ordered und Writeback. Die Modi _Ordered_ und _Writeback_
schreiben nur _Metadaten_, _Journal_ schreibt auch _Datei-Inhalte_ ins Journal.
#wrap-content(
image("img/bsys_49.png"),
align: top + right,
columns: (50%, 50%),
)[
==== (Full) Journal
_Metadaten und Datei-Inhalte_ kommen ins Journal.
Grosse Ãnderungen werden in mehrere Transaktionen gesplittet.
_Vorteil:_ maximale Datensicherheit
_Nachteil:_ grosse Geschwindigkeitseinbussen.
]
#wrap-content(
image("img/bsys_50.png"),
align: top + right,
columns: (60%, 40%),
)[
==== Ordered
_Nur Metadaten_ kommen ins Journal. Dateiinhalte werden immer _vor_ dem Commit geschrieben:
+ Transaktion ins Journal
+ Dateiinhalte an endgÃŒltige Position schreiben
+ Commit ausfÃŒhren
_Vorteil:_ Dateien enthalten nach dem Commit den richtigen Inhalt
_Nachteil:_ Etwas geringere Geschwindigkeit als Writeback.\
#hinweis[(In Linux gibt es einen lost+found Ordner im Root-Verzeichnis)]
]
\
#wrap-content(
image("img/bsys_51.png"),
align: top + right,
columns: (60%, 40%),
)[
==== Writeback
_Nur Metadaten_ kommen ins Journal.
Commit und Schreiben der Dateiinhalte werden in _beliebiger Reihenfolge_ ausgefÃŒhrt.
_Vorteil:_ Sehr schnell, keine Synchronisation von Commit und Datenschreiben nötig.
_Nachteil:_ Dateien können DatenmÌll enthalten.
]
== Vergleich Ext2 & Ext4
#table(
columns: (auto, auto),
table.header([Ext2], [Ext4]),
[
- schlank und leistungsfÀhig
- einfach zu implementieren
- mÀchtiger als FAT, weniger mÀchtig als NTFS
],
[
- fÃŒgt wichtige Features hinzu
- Journaling
- Effizientere Verwaltung grosser Verzeichnisse und Dateien
],
)
|
|
https://github.com/ayoubelmhamdi/typst-phd-AI-Medical | https://raw.githubusercontent.com/ayoubelmhamdi/typst-phd-AI-Medical/master/chapters/ch21.typ | typst | MIT License | #import "../functions.typ": heading_center, images, italic,linkb, dots
#import "../tablex.typ": tablex, cellx, rowspanx, colspanx, hlinex
#let finchapiter = text(fill:rgb("#1E045B"),"â ")
// #linebreak()
// #linebreak()
// #counter("tabl").update(n=>n+20)
= DETECTION ET CLASSIFICATION DES NODULES PULMONAIRES Ã LâAIDE DU DEEP LEARNING
== Introduction
Le cancer du poumon figure parmi les principales causes de mortalité liées au cancer dans le monde entier #cite("national2011reduced"). La reconnaissance et le diagnostic précoces des nodules pulmonaires, petites masses de tissu dans les poumons, peuvent considérablement augmenter les taux de survie et le succÚs du traitement pour les individus atteints de cancer du poumon. Cependant, la détection et la classification de ces nodules pulmonaires représentent un défi de taille en raison de leur taille, forme, emplacement et caractéristiques physiques variables #cite("SetioTBBBC0DFGG16"). De plus, la majorité des nodules pulmonaires sont bénins ou non cancéreux, avec seulement un faible pourcentage classé comme malin ou cancéreux #cite("dou2017automated"). Ces conditions créent des complications pour la détection et la classification automatisées des nodules pulmonaires par des modÚles d'apprentissage automatique.
Un des défis majeurs dans le dépistage du cancer du poumon est de distinguer les nodules pulmonaires _bénins_ et _malins_ à partir des images de scanner. Les systÚmes de détection assistée par ordinateur (CAO) peuvent aider les radiologues à identifier et à caractériser les nodules en fonction de leur taille, leur forme, leur évolution et leur _*risque de malignité*_#cite("Shen2015","Nasrullah2019"). Ces systÚmes utilisent des techniques d'intelligence artificielle, notamment des réseaux de neurones profonds, pour analyser les images et fournir une classification automatique des nodules. Cette approche peut réduire le temps de lecture, augmenter le taux de détection, harmoniser les pratiques cliniques et éviter des examens inutiles ou invasifs.
Dans cet étude, nous proposons d'utiliser le deep learning pour améliorer la prise en charge des nodules pulmonaires. Le deep learning permet d'apprendre à partir de grandes quantités de données et de réaliser des tâches complexes comme la classification ou la segmentation d'images. Nous utilisons le dataset *LIDC-IDRI*#footnote("sous licence «Creative Commons Attribution 3.0 Unported License».")@Clark2013, qui contient $1018$ scanners thoraciques annotés par *quatre radiologues experts*. Chaque nodule pulmonaire est décrit par un fichier _XML_ qui contient son _identifiant_, ses _caractéristiques_ et sa _région d'intérêt_. Par exemple, voici le fichier XML correspondant au nodule numéro 4 :
#pagebreak()
```xml
<unblindedReadNodule>
<noduleID>4</noduleID>
<characteristics>
<subtlety>4</subtlety>
<internalStructure>1</internalStructure>
<calcification>6</calcification>
<sphericity>4</sphericity>
<margin>4</margin>
<lobulation>1</lobulation>
<spiculation>2</spiculation>
<texture>5</texture>
<malignancy>3</malignancy>
</characteristics>
<roi>
<imageZposition>1487.5</imageZposition>
<imageSOP_UID>1.3.6.1.4.1.14519.5.2.1.6279.6001.270602739536521934855332163694</imageSOP_UID>
<inclusion>TRUE</inclusion>
<edgeMap><xCoord>322</xCoord><yCoord>303</yCoord></edgeMap>
<edgeMap><xCoord>322</xCoord><yCoord>304</yCoord></edgeMap>
<edgeMap><xCoord>322</xCoord><yCoord>305</yCoord></edgeMap>
<edgeMap><xCoord>323</xCoord><yCoord>303</yCoord></edgeMap>
<edgeMap><xCoord>322</xCoord><yCoord>303</yCoord></edgeMap>
</roi>
</unblindedReadNodule>
```
Ce fichier _XML_ contient des informations importantes sur le nodule, telles que sa _taille_, sa _forme_, sa _structure_, sa _calcification_, sa _texture_ et son _*risque de malignité*_. Il contient également la _position_ et le _contour_ du nodule sur lâimage.
Nous commençons par développer un modÚle de classification qui peut identifier le *type* de nodulaire à partir des images CT scan(nodule ou lésion). Nous avons utilisé le dataset *LUNA16*#footnote("sous licence «Creative Commons Attribution 4.0 International License».") #cite("SetioTBBBC0DFGG16"), qui est un sous-ensemble du dataset _LIDC-IDRI_, pour entraîner et évaluer notre modÚle de classification. Nous avons comparé les performances de notre modÚle de classification avec celles des radiologues et avec d'autres études dans la tâche de classification des nodules.
Ensuite, nous créons un nouveau dataset appelé *TRPMLN*, qui extrait *les nodules qui ont une moyenne de malignité égale à 3 ou plus dans les annotations des quatre experts*. Nous avons inclus une annexe qui présente l'implémentation du code _PYTHON_ pour créer cet ensemble de données. Nous développons un autre modÚle de classification qui peut *classer les nodules en fonction de leur risque de malignité* à partir des images CT scan. Nous comparons les performances de notre modÚle avec celles des radiologues et avec d'autres études dans le même tâche.
Le plan de l'étude est le suivant : dans la section Méthode, nous présentons le dataset _LIDC-IDRI_, le dataset _LUNA16_, le dataset _TRPMLN_, les modÚles de deep learning et les critÚres d'évaluation. Dans la section Résultats, nous montrons les résultats obtenus par nos modÚles sur les datasets _LUNA16_ et _TRPMLN_. Dans la section Discussion, nous analysons les forces et les limites de notre approche. Dans la section Conclusion, nous résumons nos contributions et proposons des perspectives futures. #finchapiter
== Matériel et Méthode.
Notre étude comprenait trois étapes principales : le prétraitement des données, le développement de l'algorithme de détection des nodules et l'évaluation des performances #cite("dou2017automated","ding2017accurate","armato2011lidc").
=== Ressources
Les ressources de notre étude étaient des scans CT et des annotations provenant du dataset _ LIDC-IDRI_, du dataset _LUNA16_ et _TRPMLN_. Le dataset _ LIDC-IDRI_ est une base de données publique qui contient 1018 scans thoraciques annotés par quatre radiologues experts. Chaque nodule pulmonaire est décrit par un fichier XML qui contient son identifiant, ses caractéristiques et sa région d'intérêt#footnote("Dataset Wiki: https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=1966254").
Voici un tableau des points clés du résumé :
#figure(
tablex(
columns: 2,
align: horizon,
auto-vlines: false,
repeat-header: false,
[ *Pointer* ],[ *Résumé* ],
[ Origine ],[ Partenariat public-privé] + footnote("L'origine de l'ensemble de données LIDC-IDRI est un partenariat public-privé car il a été financé à la fois par le secteur public (le National Cancer Institute) et le secteur privé (la Fondation pour les National Institutes of Health et les sociétés d'imagerie médicale qui ont participé à le projet)."), hlinex(stroke: 0.25pt),
[ Taille ],[ 1018 CT scans ], hlinex(stroke: 0.25pt),
[ Nodules ],[ Annoté par 4 radiologues ], hlinex(stroke: 0.25pt),
[ Annotations ],[ Deux phases ], hlinex(stroke: 0.25pt),
[ Disponibilité ],[ Disponible publiquement ], hlinex(stroke: 0.25pt),
[ Utiliser ],[ Développement et évaluation CAO ],
),
// caption: [Coordonnées des candidats détectés dans le dataset Luna16 avec diamÚtres],
// kind: "tabl",
supplement: [#text(weight: "bold","Table")],
)
=== Scans CT avec Nodules Pulmonaires.
Pour lire, traiter et représenter visuellement les scans CT montrant des nodules pulmonaires, nous avons mis en Åuvre tois bibliothÚques Python : SimpleITK#footnote("sous licence «Apache License 2.0.»."), Pylidc #footnote("sous licence «MIT License.»."), et matplotlib#footnote("sous licence «PSF License.».").
- Avec _*SimpleITK*_#cite("Beare2018", "Yaniv2017", "Lowekamp2013") et _*Pylidc*_#cite("Hancock2016") , nous avons lu les fichiers de scan CT de l'ensemble de données _LUNA16_ ou _LIDC-IDRI_, convertissant ces images de leur format _raw_ , _mhd_ ou _DICOM_ en tableaux numériques multidimensionnels manipulables, appelés tableaux numpy.
- Nous avons utilisé _*Matplotlib*_#cite("Hunter2007") pour tracer et afficher les tranches de scan CT contenant des nodules, complétant ces images par des lignes blanches marquant les limites autour de chaque nodule pour souligner leur emplacement et leurs dimensions.
La @Fig1 offre un exemple d'une tranche de scan CT, où le nodule est mis en évidence par des lignes blanches.
#images(
filename:"images/3_nodules.png",
caption:[
// Exemples d'une tranche de scan CT avec un nodule mis en évidence par des lignes blanches.
Catégories de nodules pulmonaires dans un scanner CT; bénigne, maligne primaire, et maligne métastatique (de gauche à droite)#cite("Nasrullah2019").
],
width: 90%
// ref:
) <Fig1>
==== Dataset LUNA16.
Le dataset _LUNA16_ est un sous-ensemble du dataset _ LIDC-IDRI_, qui contient 1186 nodules annotés dans $888$ scans thoraciques. Ce dataset fournit également deux fichiers CSV distincts contenant les détails des candidats et des annotations. Dans le fichier candidates.csv, quatre colonnes sont illustrées : _seriesuid_, _coordX_, _coordY_, _coordZ_, et _classe_. Ici, le _seriesuid_ fonctionne comme un identifiant unique pour chaque scan ; _coordX_, _coordY_, et _coordZ_ représentent les coordonnées spatiales pour chaque candidat en millimÚtres, et _classe_ fournit une catégorisation binaire, dépeignant si le candidat est un nodule (1) ou non (0).
#figure(
tablex(
columns: 5,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[*seriesuid*], [*coordX*], [*coordY*], [*coordZ*], [*class*],
[1.3.6...666836860], [68.42], [-74.48], [-288.7], [0], hlinex(stroke: 0.25pt),
[1.3.6...666836860], [68.42], [-74.48], [-288.7], [0], hlinex(stroke: 0.25pt),
[1.3.6...666836860], [-95.20936148], [-91.80940617], [-377.4263503], [0],
),
caption: [Coordonnées des candidats détectés dans le dataset Luna16 avec diamÚtres],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
)
Le fichier _annotations.csv_ est composé de cinq colonnes : _seriesuid_, _coordX_, _coordY_, _coordZ_, et _diamÚtre_mm_, commandant l'identifiant unique du scanner, les coordonnées d'annotation spatiales en millimÚtres, et le diamÚtre de chaque annotation en millimÚtres, respectivement. Ces annotations ont été marquées manuellement en se basant sur l'identification des nodules de plus de 3 mm de diamÚtre par quatre radiologistes indépendants #cite("dou2017automated","ding2017accurate","armato2011lidc").
#figure(
tablex(
columns: 5,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[*seriesuid*], [*coordX*], [*coordY*], [*coordZ*], [*diameter_mm*],
[1.3.6.1....6860], [-128.6994211], [-175.3192718], [-298.3875064], [5.65147063],
hlinex(stroke: 0.25pt),
[1.3.6.1....6860], [103.7836509], [-211.9251487], [-227.12125], [4.224708481],
hlinex(stroke: 0.25pt),
[1.3.6.1....5208], [69.63901724], [-140.9445859], [876.3744957], [5.786347814],
),
caption: [Annotations des nodules détectés dans le dataset Luna16],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
)
==== Dataset TRPMLN.
La création du jeu de données _*TRPMLN*_ implique plusieurs étapes. Initialement, un environnement virtuel Python est établi et activé, suivi par l'installation des packages Python nécessaires à partir d'un fichier _requirements.txt_. Un fichier de configuration pour _pylidc_ est ensuite généré, qui spécifie le chemin vers le jeu de données LIDC-IDRI.
Le jeu de données _LIDC-IDRI_ est par la suite interrogé en utilisant _pylidc_, en filtrant les scans avec une épaisseur de tranche supérieure à 3 mm et un espacement de pixels supérieur à 1 mm. Pour chaque scan dans le jeu de données filtré, les annotations sont regroupées en nodules. Un score moyen de malignité est calculé pour chaque nodule sur la base des scores fournis par différents experts. Si ce score moyen est de 3 ou plus, le nodule est classé comme cancéreux ; sinon, il est considéré comme normal.
Les données pour chaque nodule sont enregistrées, y compris le nom du nodule (qui indique s'il est cancéreux ou non) et l'objet d'annotation. Ces données sont utilisées pour créer un fichier CSV avec deux colonnes : "roi_name" (le nom du nodule) et "cancer" (indiquant s'il est cancéreux ou non).
Pour chaque ligne de données, une région d'intérêt (ROI) est extraite du volume du scan en fonction de la boîte englobante de l'annotation. La ROI est normalisée à une plage de 0 à 255 pour les images en 8 bits et sauvegardée en tant qu'image _TIFF_ dans un répertoire spécifié. Pour gérer l'utilisation de la mémoire, le _garbage collector_ de Python est invoqué toutes les 10 itérations pour nettoyer la mémoire inutilisée.
Le jeu de données _TRPMLN_ final comprend des images _TIFF_ de nodules et un fichier CSV contenant des informations sur ces nodules. Ce jeu de données peut être utilisé pour entraîner des modÚles d'apprentissage profond pour classer les nodules malins.
Ces étapes sont démontrées dans l'ANNEXE 2.
=== Développement des l'algorithmes de détection des nodules.
// nombres de nodules de enteaitenment de test?
AprÚs avoir préparé les images de scans CT, l'ensemble de données (_LUNA16_ ou _TRPMLN_) a été divisé en ensembles d'entraînement et de test. L'ensemble d'entraînement comprenait 67% des données, tandis que l'ensemble de test comprenait les 33% restants.
Deux modÚles ont été entraînés sur l'ensemble d'entraînement et évalués sur l'ensemble de test : un modÚle _CNN_ et un modÚle _ResNet50_. Les performances des modÚles ont été mesurées en utilisant l'exactitude, la précision, la sensibilité et le "F1-score".
La construction des algorithmes de détection des nodules a été divisée en plusieurs étapes impératives. à leur base, les algorithmes reposaient sur un modÚle de réseau neuronal convolutif (_CNN_) et un modÚle _ResNet50_, chargés d'identifier les nodules à partir d'images de scans CT #cite("lin2017feature"). Le modÚle _CNN_ était utilisé pour détecter la présence de nodules pulmonaires ou de lésions pulmonaires, tandis que le modÚle _ResNet50_ était utilisé pour classification des nodules selon l'approximation du risque de cancer, malin ou non malin.
==== Model 1: Detection de type de Nodule.
#images(
filename:"images/model2.png",
caption:[
La structure du modÚle.
],
width: 90%
// ref:
)
Utilisant le dataset _LUNA16_, qui contient des images de nodules et de lésions pulmonaires, nous avons expérimenté différentes combinaisons de couches et de filtres pour trouver la meilleure architecture pour notre problÚme. Nous avons trouvé que le meilleur modÚle pour nous était conçu comme suit :
#figure(
tablex(
columns: 3,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[*Stage*], [*Output*], [*Param*],
[Conv2D], [(None, 64, 64, 64)], [4160], hlinex(stroke: 0.25pt),
[Conv2D], [(None, 64, 64, 64)], [16448], hlinex(stroke: 0.25pt),
[MaxPooling2D], [(None, 8, 8, 64)], [0],
[Conv2D], [(None, 8, 8, 64)], [16448], hlinex(stroke: 0.25pt),
[Conv2D], [(None, 8, 8, 64)], [16448], hlinex(stroke: 0.25pt),
[MaxPooling2D], [(None, 4, 4, 64)], [0],
[Conv2D], [(None, 4, 4, 64)], [16448], hlinex(stroke: 0.25pt),
[Conv2D], [(None, 4, 4, 64)], [16448], hlinex(stroke: 0.25pt),
[Conv2D], [(None, 4, 4, 64)], [262208], hlinex(stroke: 0.25pt),
[MaxPooling2D], [(None, 2, 2, 64)], [0],
[GlobalAveragePooling2], [(None, 64)], [0], hlinex(stroke: 0.25pt),
[Flatten], [(None, 64)], [0], hlinex(stroke: 0.25pt),
[Dense], [(None, 2)], [130],
colspanx(3)[*Total params: 348,738*]
),
caption: [Architecture du modÚle CNN.],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
)
Pour entraîner le modÚle, l'optimiseur _Adam_#cite("kingma2014adam") a été utilisé avec un taux d'apprentissage de $0,001$, et la fonction de perte _d'entropie croisée binaire_. Cette fonction de perte mesure la divergence entre la probabilité prédite par le modÚle et la vérité terrain pour chaque image. Elle est adaptée aux problÚmes de classification binaire, comme celui de détecter la présence ou l'absence de nodules. L'entropie croisée binaire pénalise les prédictions erronées plus fortement que les prédictions correctes, ce qui encourage le modÚle à apprendre à distinguer les nodules des non-nodules avec une grande confiance. L'entraînement du modÚle s'est étendu sur 100 époques, 6691 nodules ont été utilisés, dont 4165 de classe 0 et 2526 de classe 1. Les nodules recadrés détectés sont de taille 64 à 64 à 1.
==== Model 2: Détection de nodule à risque de cancer.
#images(
filename:"images/structure_resnet.png",
caption:[
Un aperçu de ResNET. Notre approche extrait dâabord plusieurs patchs de nodules pour capturer le large éventail de variabilité des nodules à partir des images CT dâentrée. Enfin, notre approche applique un classificateur pour étiqueter la malignité du nodule dâentrée.
],
width: 90%
// ref:
)
Nous développons aussi un modÚle pour _*approximer la probabilité de risque de malignité des nodules pulmonaires*_ à partir d'images CT scan, basé sur l'ensemble de données qui a été créé(_TRPMLN_) en se basant sur le dataset original *LIDC-IDRI* et en nous appuyant sur les annotations de quatre radiologues experts. Nous avons expérimenté différentes combinaisons de couches et de filtres pour trouver la meilleure architecture pour notre problÚme. Nous avons trouvé que le meilleur modÚle pour nous était conçu comme suit :
#figure(
tablex(
columns: 3,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[*Layer type*], [*Output Shape*], [*Param*],
[InputLayer], [(None, 64, 64, 1)], [0], hlinex(stroke: 0.25pt),
[Concatenate], [(None, 64, 64, 3)], [0], hlinex(stroke: 0.25pt),
[UpSampling2D], [(None, 192, 192, 3)], [0], hlinex(stroke: 0.25pt),
[ZeroPadding2D], [(None, 198, 198, 3)], [0], hlinex(stroke: 0.25pt),
[ResNet], [-], [23587712], hlinex(stroke: 0.25pt),
[GlobalAveragePooling2D],[(None, 2048)], [0], hlinex(stroke: 0.25pt),
[Flatten], [(None, 2048)], [0], hlinex(stroke: 0.25pt),
[Dense], [(None, 2)], [4098], hlinex(stroke: 0.25pt),
colspanx(3)[*Total params: $23591810$*]
),
caption: [Architecture du modÚle ResNET.],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
)
Les performances de classification des nodules du systÚme conçu ont été évaluées sur _TRPMLN_. Pour la formation à la classification, 1568 nodules ont été utilisés, dont 801 de classe 0 et 767 de classe 1. Les nodules recadrés détectés sont de taille 64 à 64 à 1. Entraînés sur 118 époques, un taux d'apprentissage de 0,001 a été utilisé, et comme optimiseur on a utilisé Adam et la fonction de perte d'entropie croisée binaire.
== Résultats.
=== Ãvaluation des performances du modÚle.
Nous avons évalué le succÚs du modÚles à travers son *exactitude*#footnote("exactitude: \"accuracy\" en Anglais.") sur les ensembles de données d'entraînement et de validation. L'*exactitude* du modÚle sur les données d'entraînement et de validation a été documentée à chaque étape du processus d'apprentissage #cite("SetioTBBBC0DFGG16").
Le terme *exactitude* fait référence à la capacité du modÚle à prévoir correctement les résultats sur les données d'entraînement, tandis que l'*exactitude de validation* signifie la capacité du modÚle à généraliser ses prédictions à de nouvelles données inédites, c'est-à -dire les données de validation.
=== Métriques d'évaluation : Précision, Sensibilité et "F1-Score".
La performance du modÚle peut a été évaluée à partir de _la matrice de confusion_, qui permet de calculer des métriques comme la *précision*, la *sensibilité (recall)* et le *F1-Score*, en plus de lâ*exactitude*. Ces mesures fournissent un aperçu plus large des performances du modÚle, notamment quand il y a un déséquilibre des classes.
// #linebreak()
#let VP="VP"
#let FP="FP"
#let FN="FN"
- La *précision* représente la fraction des prédictions positives correctes (plus précisément, lorsque le modÚle identifie correctement un nodule) sur toutes les prévisions positives faites par le modÚle. Une précision élevée indique un faible taux de faux positifs du modÚle.
$ "précision" = (VP) / (VP + FP) $
// &= 652/(652+90) \
// &= 87.8%
// $
// #images(
// filename:"images/pre_recall2.png",
// caption:[
// Précision et sensibilité (« recall »). La précision compte la proportion d'items pertinents parmi les items sélectionnés alors que la sensibilité compte la proportion d'items pertinents sélectionnés parmi tous les items pertinents sélectionnables.
// ],
// width: 60%
// // ref:
// )
- La *Sensibilité (Recall)*, synonyme de sensibilité ou de taux de vrais positifs, est le rapport des prédictions positives correctes à tous les positifs réels. Une sensibilité élevée indique que le modÚle a correctement identifié la majorité des cas positifs réels.
$ "sensibilité" = (VP) / (VP + FN) $
// $ \
// &= 652/(652+199) \
// &= 76.6%
// $
- Le *F1-score* est la moyenne harmonique de la précision et de la sensibilité, fournissant une seule mesure qui équilibre ces métriques.
-
$ F_1 &= (2 VP)/(2VP + FP + FN) $
// $ \
// &= (2 times 252)/(2 times 256 + 90 + 199) \
// &= 81.8%
// $
==== Performances du modÚle 1 sur LUNA16 en utilisant CNN
#images(
filename:"images/class2.svg",
caption:[
Ãvolution des précisions dâentraînement et de validation de model 1 au cours de lâapprentissage.
],
width: 100%
// ref:
)
En examinant les valeurs d'*exactitude* et d'*exactitude de validation* tout au long des étapes d'apprentissage, il est indiqué que le modÚle acquiert des connaissances, comme on peut le voir à travers l'amélioration progressive des exactitudes d'entraînement et de validation. Le modÚle commence avec des exactitudes relativement plus faibles, autour de $64%$, avant d'augmenter à plus de 89% et de terminer avec un score de 87% à la fin de l'entraînement. Cela démontre la capacité raffinée du modÚle à catégoriser correctement un ratio considérable de cas.
#block()[
#set text(9pt, style: "italic")
#grid(
columns: (1fr, 2fr),
rows: (auto),
gutter: 3pt,
figure(
tablex(
columns: 3,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[], [*Prédiction\ négative*], [*Prédiction\ positive*],
// Model 1
[*Réel\ Négatif*], [$771$ VN], [ $51$ FP], hlinex(stroke: 0.25pt),
[*Réel\ Positif*], [$113$ FN], [$404$ VP],
)+text(size: 2pt," "),
caption: [La matrice de confusion.],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
),
/* -------------------------*/
figure(
v(8mm)+
tablex(
columns: 4,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
// MODEL 1
[], [*Précision*], [ *Sensibilité \ (Recall)*], [*F1-score*],
[*Model\ CNN*], [$88.79%$], [$75.23%$], [$81.14%$],
)+text(size: 12pt," "),
caption: [Précision, sensibilité et "F1-score" du modÚle 1],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
),
)
]
==== Performances du modÚle 2 sur TRPMLN en utilisant RESNET.
#images(
filename:"images/resnet_model6.png",
caption:[
Ãvolution des précisions dâentraînement et de validation de model 2 au cours de lâapprentissage.
],
// height: 50%,
width: 80%
// ref:
)
Le modÚle commence avec une exactitude d'environ 68,66 % à la premiÚre époque et s'améliore progressivement. à la 60Úme époque, le modÚle atteint une précision d'entraînement de 100% et la maintient pendant plusieurs époques.
La exactitude de validation commence à environ 50,63 % et fluctue tout au long du processus de formation, atteignant un pic d'environ 69,43 % mais ne se rapprochant jamais de la précision d'entraînement.
Cela suggÚre que le modÚle a trÚs bien appris les données d'entraînement, mais qu'il présente un surapprentissage.
#block()[
#set text(9pt, style: "italic")
#grid(
columns: (1fr, 2fr),
rows: (auto),
gutter: 3pt,
figure(
tablex(
columns: 3,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[], [*Prédiction\ négative*], [*Prédiction\ positive*],
// Model 2
[*Réel\ Négatif*], [$119$ VN], [ $40$ FP], hlinex(stroke: 0.25pt),
[*Réel\ Positif*], [$70$ FN], [$85$ VP],
)+text(size: 2pt," "),
caption: [La matrice de confusion.],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
),
/* -------------------------*/
figure(
v(8mm)+
tablex(
columns: 4,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
// MODEL 2
[], [*Précision*], [ *Sensibilité \ (Recall)*], [*F1-score*],
[*Model\ ResNET*], [68.00$%$], [$54.83%$], [$60.71%$],
)+text(size: 12pt," "),
caption: [Précision, sensibilité et "F1-score" du modÚle 2],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
),
)
]
== Discussion.
Dans les deux modÚles, nous avons un overfitting et des fluctuations de précision.
- *Overfitting* : la exactitude de l'entraînement atteint 100 %, ce qui est un signe clair de surajustement, surtout par rapport à la exactitude de validation qui est bien inférieure. Le surajustement signifie que le modÚle a trop bien appris les données d'entraînement, y compris leur bruit et leurs valeurs aberrantes, ce qui le rend peu performant sur les données invisibles.
- *Fluctuations de la exactitude de la validation* : la exactitude de la validation fluctue beaucoup, ce qui peut suggérer que le modÚle est instable ou que l'ensemble de validation n'est peut-être pas suffisamment représentatif.
#figure(
tablex(
columns: 3,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[], [*Précision*], [ *Sensibilité (Recall)*],
[*Song et al.* #cite("Song2017")], [$82%$], [$83%$], hlinex(stroke: 0.25pt),
[*Nibali et al.* #cite("Nibali2017")],[$89%$], [$91%$], hlinex(stroke: 0.25pt),
[*Zhao et al.* #cite("Zhao2018")], [$82%$], [$$], hlinex(stroke: 0.25pt),
[*Nos modÚles*], [$88.79%$], [$75.25%$],
),
caption: [Comparaison avec d'autres études dans la tâche de classification des nodules ou des lésions.],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
)
Comparaison avec nos résultats, notre modÚle de classification de nodule ou lésion est performant de maniÚre compétente dans l'identification des deux classes. En général, le modÚle a performé de maniÚre impressionnante en termes de précision, de sensibilité et de "F1-score".
#figure(
tablex(
columns: 3,
align: center + horizon,
auto-vlines: false,
repeat-header: false,
[*Models*], [*Accuracy (%)*], [ *Year*],
[*Multi-scale CNN* #cite("Shen2015")], [86.84], [2015], hlinex(stroke: 0.25pt),
[*Nodule level 2D CNN* #cite("Lai2016")], [87.30], [2016], hlinex(stroke: 0.25pt),
[*Slice level 2D CNN* #cite("Lai2016")], [86.70], [2016], hlinex(stroke: 0.25pt),
[*Multi-crop CNN* #cite("Shen2017")], [87.14], [2017], hlinex(stroke: 0.25pt),
[*Vanilla 3D CNN* #cite("Lai2016")], [87.40], [2016], hlinex(stroke: 0.25pt),
[*Deep 3D DPN* #cite("Zhu2016")], [88.74], [2017], hlinex(stroke: 0.25pt),
[*Deep 3D DPN + GBM* #cite("Zhu2016")], [90.44], [2017], hlinex(stroke: 0.25pt),
[*3D MixNet* #cite("Nasrullah2019I")], [88.83], [2019], hlinex(stroke: 0.25pt),
[*3D MixNet + GBM* #cite("Nasrullah2019I")], [90.57], [2019], hlinex(stroke: 0.25pt),
[*3D CMixNet + GBM* #cite("Nasrullah2019")], [91.13], [2019], hlinex(stroke: 0.25pt),
[*3D CMixNet + GBM + Biomarkers* #cite("Nasrullah2019")],[94.17], [2019], hlinex(stroke: 0.25pt),
[*Our Model ResNET*], [69,43], [2023]
),
// Accuracy comparison of nodule classification on public dataset.
caption: [Comparaison avec d'autres études dans le cadre de la classification des nodules malins ou bénins #cite("Song2017", "Nibali2017", "Zhao2018").],
kind: "tabl",
supplement: [#text(weight: "bold","Table")],
)
Mais la comparaison de notre modÚle de classification de nodule ou de lésion avec d'autres modÚles n'est pas performante de maniÚre compétitive, lorsque l'on veut approximer la détection des nodules malins.
Plusieurs facteurs peuvent expliquer pourquoi le modÚle a tendance à identifier la classe 0 plutÎt que la classe 1. L'une des stratégies pourrait être de renforcer la présence de la classe 1, ce qui pourrait aider le modÚle à mieux distinguer la classe dominante et à améliorer légÚrement sa performance pour cette classe.
De plus, la détection des nodules peut être une tâche plus complexe que celle des non-nodules. Les nodules sont souvent de petite taille, flous ou masqués par d'autres structures pulmonaires, ce qui peut compliquer leur détection. Ainsi, l'exploration d'autres techniques d'optimisation du modÚle pourrait être bénéfique pour atténuer le biais du modÚle en faveur de la classe 0.
En outre, les variations de caractéristiques entre les classes peuvent également entraîner des taux de détection différents. Des analyses plus approfondies, comme un examen détaillé des caractéristiques des données d'entrée, pourraient aider à comprendre précisément pourquoi ces différences de performances sont observées. L'utilisation de techniques de prétraitement des images, comme la normalisation, pourrait améliorer la qualité et la diversité des données d'entrée.
Pour résoudre ce problÚme, une stratégie d'entraînement raffinée pour notre modÚle est nécessaire, ainsi qu'un indicateur de performance plus robuste que la simple précision. Les solutions potentielles pourraient inclure :
- L'application de techniques spécifiques pour accroître le nombre d'échantillons malins dans notre ensemble de données.
- L'utilisation de techniques d'équilibrage des classes pour obtenir une distribution équilibrée des classes dans notre ensemble de données.
Dans notre travail ultérieur, nous visons à incorporer certaines de ces solutions et nous nous attendons à améliorer les performances de notre modÚle par rapport à la classification des nodules pulmonaires, pour maîtriser la classification des sous-types de nodules, tels que solides, non-solides, partiellement solides, pérfissuraux, calcifiés et spiculés. Différents traitements sont nécessaires pour différents types de nodules, ce qui rend leur détection précise encore plus pertinente pour un traitement réussi.
== Conclusion.
Nous avons utilisé le Deep-Learning pour détecter et classifier les nodules pulmonaires dans l'ensemble de données _LUNA16_ et _TRPMLN_. Les modÚles ont affronté des défis liés à la diversité des nodules en termes de taille, de forme et d'emplacement, ainsi qu'à une distribution inégale dans l'ensemble de données. Malgré ces difficultés, ils ont performé de maniÚre satisfaisante, produisant des scores élevés, un bon sensibilité et un _F1-score_ convaincant pour les nodules, qu'ils soient nodule ou lesion. Ils ont également performé de maniÚre passable, produisant des scores passables pour la sensibilité et un _F1-score_ convaincant pour les nodules, qu'ils soient bénins ou malins.
En plus de cela, nous avons également formé un modÚle pour classer les nodules comme probablement normaux ou anormaux. Ce modÚle a également été confronté à des défis similaires en termes de diversité des nodules et de distribution inégale dans l'ensemble de données.
Les modÚles ont montré un léger avantage dans l'identification des non-nodules, probablement en raison de la limitation du nombre de classe 1 dans l'ensemble de données.
Les résultats de notre étude soulignent que le Deep-Learning est efficace pour la détection et la classification des nodules pulmonaires. Il a le potentiel pour faciliter le diagnostic précoce du cancer du poumon, ce qui peut améliorer les chances de survie et l'efficacité du traitement.
Nous cherchons à améliorer nos modÚles pour perfectionner leur performance, en particulier dans la détection des malignités des nodules pulmonaires. Pour cela, des recherches supplémentaires sont nécessaires. #finchapiter
|
https://github.com/arthurcadore/eng-telecom-workbook | https://raw.githubusercontent.com/arthurcadore/eng-telecom-workbook/main/semester-7/MEC/project1/project.typ | typst | MIT License | #import "@preview/klaro-ifsc-sj:0.1.0": report
#import "@preview/codelst:2.0.1": sourcecode
#show heading: set block(below: 1.5em)
#show par: set block(spacing: 1.5em)
#set text(font: "Arial", size: 12pt)
#set highlight(
fill: rgb("#c1c7c3"),
stroke: rgb("#6b6a6a"),
extent: 2pt,
radius: 0.2em,
)
#show: doc => report(
title: "Análise de Desempenho de Modulações Digitais",
subtitle: "Sistemas de Comunicação I",
authors: ("<NAME>",),
date: "29 de Julho de 2024",
doc,
)
|
https://github.com/Myriad-Dreamin/shiroa | https://raw.githubusercontent.com/Myriad-Dreamin/shiroa/main/packages/shiroa/summary.typ | typst | Apache License 2.0 |
#import "utils.typ": _store-content
#import "meta-and-state.typ": book-meta-state
#import "supports-link.typ": link2page, cross-link-path-label
/// Show template in [book.typ](https://myriad-dreamin.github.io/shiroa/format/book.html)
///
/// Example:
/// ```typ
/// #show book
/// ```
#let book(content) = {
[#metadata(toml("typst.toml")) <shiroa-internal-package-meta>]
// #let sidebar-gen(node) = {
// node
// }
// #sidebar-gen(converted)
// #get-book-meta()
content
}
/// Book metadata in [book.typ](https://myriad-dreamin.github.io/shiroa/format/book.html)
///
/// - title (str): The title of the book.
/// - authors (array | str): The author(s) of the book.
/// - description (str): A description for the book, which is added as meta information in the html <head> of each page.
/// - repository (str): The github repository for the book.
/// - repository-edit (str): The github repository editing template for the book.
/// Example: `https://github.com/Me/Book/edit/main/path/to/book/{path}`
/// - language: The main language of the book, which is used as a language attribute
/// <html lang="en"> for example.
/// Example: `en`, `zh`, `fr`, etc.
/// - summary: Content summary of the book. Please see [Book Metadata's Summary Field](https://myriad-dreamin.github.io/shiroa/format/book-meta.html#label-summary%20%20(required)%20content) for details.
#let book-meta(
title: "",
description: "",
repository: "",
repository-edit: "",
authors: (), // array of string
language: "", // default "en"
summary: none,
) = [
#let raw-meta = (
kind: "book",
title: title,
description: description,
repository: repository,
repository_edit: repository-edit,
authors: authors,
language: language,
summary: summary,
);
#let meta = {
import "summary-internal.typ"
let meta = summary-internal._convert-summary(metadata(raw-meta))
meta.at("summary") = summary-internal._numbering-sections(meta.at("summary"))
meta
}
#book-meta-state.update(meta)
#metadata(meta) <shiroa-book-meta>
#metadata(raw-meta) <shiroa-raw-book-meta>
]
/// Build metadata in [book.typ](https://myriad-dreamin.github.io/shiroa/format/book.html)
///
/// - dest-dir: The directory to put the rendered book in. By default this is `book/` in the book's root directory. This can overridden with the `--dest-dir` CLI option.
#let build-meta(
dest-dir: "",
) = [
#let meta = (
"dest-dir": dest-dir,
)
#metadata(meta) <shiroa-build-meta>
]
/// Represents a chapter in the book
/// link: path relative (from summary.typ) to the chapter
/// title: title of the chapter
/// section: manually specify the section number of the chapter
///
/// Example:
/// ```typ
/// #chapter("chapter1.typ")["Chapter 1"]
/// #chapter("chapter2.typ", section: "1.2")["Chapter 1.2"]
/// ```
#let chapter(link, title, section: auto) = metadata((
kind: "chapter",
link: link,
section: section,
title: _store-content(title),
))
/// Represents a prefix/suffix chapter in the book
///
/// Example:
/// ```typ
/// #prefix-chapter("chapter-pre.typ")["Title of Prefix Chapter"]
/// #prefix-chapter("chapter-pre2.typ")["Title of Prefix Chapter 2"]
/// // other chapters
/// #suffix-chapter("chapter-suf.typ")["Title of Suffix Chapter"]
/// ```
#let prefix-chapter(link, title) = chapter(link, title, section: none)
/// Represents a prefix/suffix chapter in the book
///
/// Example:
/// ```typ
/// #prefix-chapter("chapter-pre.typ")["Title of Prefix Chapter"]
/// #prefix-chapter("chapter-pre2.typ")["Title of Prefix Chapter 2"]
/// // other chapters
/// #suffix-chapter("chapter-suf.typ")["Title of Suffix Chapter"]
/// ```
#let suffix-chapter = prefix-chapter
/// Represents a divider in the summary sidebar
#let divider = metadata((
kind: "divider",
))
#let external-book(spec: none) = {
place(
hide[
#spec
],
)
}
#let visit-summary(x, visit) = {
if x.at("kind") == "chapter" {
let v = none
let link = x.at("link")
if link != none {
let chapter-content = visit.at("inc")(link)
if chapter-content.children.len() > 0 {
let t = chapter-content.children.at(0)
if t.func() == [].func() and t.children.len() == 0 {
chapter-content = chapter-content.children.slice(1).sum()
}
}
if "children" in chapter-content.fields() and chapter-content.children.len() > 0 {
let t = chapter-content.children.at(0)
if t.func() == parbreak {
chapter-content = chapter-content.children.slice(1).sum()
}
}
show: it => {
let abs-link = cross-link-path-label("/" + link)
locate(loc => {
link2page.update(it => {
it.insert(abs-link, loc.page())
it
})
})
it
}
visit.at("chapter")(chapter-content)
}
if "sub" in x {
x.sub.map(it => visit-summary(it, visit)).sum()
}
} else if x.at("kind") == "part" {
// todo: more than plain text
visit.at("part")(x.at("title").at("content"))
} else {
// repr(x)
}
}
|
https://github.com/ludwig-austermann/typst-din-5008-letter | https://raw.githubusercontent.com/ludwig-austermann/typst-din-5008-letter/main/examples/envelope_ex.typ | typst | MIT License | #import "../letter.typ": envelope, helpers, letter-styling
#import envelope: envelope, envelope-styling
#let address-field = helpers.address-field([recipient name\ recipient address], return-information: [return information\ further information], styling: letter-styling())
#envelope(
envelope-format: "DL",
sender-zone: pad(1cm)[sender name\ sender address],
frank-zone: pad(1cm)[frank zone],
read-zone: pad(y: 1cm, address-field),
encoding-zone: pad(5mm)[encoding zone],
debug: true
) |
https://github.com/Walker-00/cs-eik | https://raw.githubusercontent.com/Walker-00/cs-eik/rust/pages/cs_intro.typ | typst | Do What The F*ck You Want To Public License | #import "structure.typ": *
#show link: underline
#show: text_style
#align(center, [= á
á¬á¡á¯áẠááááºáááº])
== áá®á
á¬á¡á¯ááºá áá¬á¡ááœááºáá²
áá®á
á¬á¡á¯áẠááá±á¬á· áá»áœááºáá±á¬áº áá²á· áá®á
á¬á¡á¯ááºáá²á· Contributors ááœá±áááá²á· Computer Science áá²á· áááºáááºáá²á· á¡ááŒá±á¬ááºážááœá±ááá¯
áá±ážáá¬ážáá¬áá²ááŒá
áºáá«áááºá áá»áœááºáá±á¬áºááá¯á· áááá¬ááœá±áá±ážáá²á·á¡ááœáẠáááŸááºáááºáááºáž áááŸááºááá¯ááºáááᯠááŸá¬ážáááºážááŸá¬ážááá¯ááºáá«áááºá á¡áááºááá¯á·
á¡ááŸá¬ážááŒááºáá»ááºááẠááá¯ááºáááá¬áá±ážááœá±áááºá·áá±ážááŒá®áž Contributors (Co-Author) credit ááá¯áá»ááºáááºáá±á¬á· áá®á
á¬á¡á¯áẠproject
áá²á· #link("https://github.com/Walker-00/cs-eik")[Github Repo] ááᯠfork áá¯ááºááŒá®ážáá±á¬á·ááŒá
áºááŒá
áº
issue ááœááºá·ááŒá®áž á¡ááŒá¶áá±ážáá¬ááŒá
áºááŒá
Ạáá¯ááºááá¯á·ááá«áááºá áá»áœááºáá±á¬áºááá¯á·áá²á· Main áááºááœááºáá»ááºá Computer Science ááá¯áá¬
Background á០áááŸááá²á· áá°ááá±á
ááŒá®áž á
áááºáá«áááºá
á¬ážáá²á· áááºáá°áá²ááŒá
áºááŒá
Ạáá¬áááºááá¯ážá០áá±ážá
áá¬áááá¯áá² á¡ááá¬áž áá±á·áá¬ááá¯ááºááá¯á·
á¡ááœááºáááºááœááºáá«áááºá
== Authors ááœá±áá²á· á¡áááá±ážáá»ááº
áá®á
á¬á¡á¯ááºá á
á
áá»ááºážáá±á¬á· á¡áááºážááŒááºá·á
á¯á¶ááŸá¬ ááá¯ááºáááᯠááá¯ááºáááá»ááºáá²á· á¡ááŒá±á¬ááºážá¡áá¬ááœá± ááá¯ááºááááŒá®ážáá¬áž á¡ááŒá±á¬ááºážá¡áá¬ááœá±áááºáž á
á
áá»ááºáž
ááá«ááá¯ááºáá±ážáá«áá°ážá áá»áœááºáá±á¬áºáááºáž á¡áá¯ááºáá
áºááẠáááºáááºážáá
áºáááºáá²á· áá¯ááºáá±ááá¬ááŒá±á¬ááºá·áá«á áá«áá±áá²á· ááá¯áá¬ááœá±ááᯠáááºážáááºážá
á®ááŒááºá·ááŒááºá·ááŒá®áž
á¡áááºááŒá±áá±á¬ááºáá²á· á¡áá»áááºáá»ááẠedition áá
áºáá¯áá»ááºážá
á® áá¯ááºáá±ážááœá¬ážááŸá¬áá«á
== License and Code Of Conduct
áá® project áá²á· license ááá¯áá±á¬á· #link("http://www.wtfpl.net/")[WTFPL] áá¯á¶ážáá¬ážáá«áááºá License
á¡á áá¬áááá¯áá¯ááºááá¯á·ááááºááá¯áá±áá²á·á Non-Profit Sharing á¡ááœááºáá² ááœááºá·ááŒá¯áá«áááºá ááŒááºáá±á¬ááºážáá¬áá»áá¯áž ááá¯ááºááá¯á· ááœááºá·áááºáá«áááºá
á¡áááºá áá
áºáá±á¬ááºáá±á¬ááºá áá±á¬ááºážáá²á·áááºáááºážá áá®á
á¬á¡á¯ááºáᬠOnline Book PDF file á¡áá±áá²á· á¡ááá¬ážáááºááá¯á·áááºáž ááááá¯á
ááá¯ááºááá¯áẠááááá±á¬ááºáááºáá±ážááá¯á·áááẠááá¯áᬠá¡áááá±ážáá«áá
á±á ááŒááºáá±á¬ááºážáá±áá²á· profit áá²á 25%+ áá±á¬ááºááá¯á¡ááºáá²á· áá±áá¬ááœá±ááᯠááŒááºááŒá®áž
Donate áá¯ááºáá±ážááẠáá±á¬ááºážáá«áááºáá»á
#pagebreak()
#align(center, [= Computer Science ááááºáááº])
\
== Computer Science ááá¯áá¬áá¬áá²
*Computer* ááá¯áá¬á user á áá±ážáá²á· ááœáŸááºááŒá¬ážáá»ááºááœá±á¡ááá¯ááºáž á¡ááá¡áá»áá¯ááºáá±á¬ááºááŒá®áž\ ááŒá¿áá¬ááœá± ááŒá±ááŸááºážáá±ážááá²á·
á
ááºáá
á¹á
ááºážááŒá
áºáá«áááºá á¡áá±ážá
áááºáá²á· á¡áá»áá¯ážá¡á
á¬ážááœá±ááá¯áá±á¬á· Computer á¡ááœááºáá®ážáááºá·á¡ááá¯ááºážááŸá¬ áááºááŸááºážááŒáá±ážáá«áááºá *Science*
ááá¯áá¬ááá±á¬á· ááŒááºáá¬ááá¯ááᯠáááá¹áá¶ááŒá
áºááŒá®áž á¡áá¬áá¬ááá¯ááºážááᯠáá±á·áá¬áá²á· áááºáááºááŒá
áºáá«áááºááá
áºáááºááᯠScience áá²á·ááẠá¡áááá¹áá«ááºáááŒá®ážááŒá®\ ááá¯áá±áá²á·áááºáž
áá
áºáá«áá
áºáá± áá°á·áá±á¬ááºááŸá¬ * Engineering* áá«áá¬áááºáá«áááºá áá
áºáááºáááºáž áá«áááºá·áááºááá¯á·áááºáá«áááºá áá¬ááá¯á·áá²ááá¯áá±á¬á·
Engineering ááá¯áá¬á Science á áá±á·áá¬ááá¯á·ááá¬áá²á· á¡áá»ááºá¡áááºááœá±ááᯠáá¯á¶ážááŒá®áž á¡ááŒááºáá±á¬ááá²á· ááŒá¿áá¬ááœá±ááᯠááŒá±ááŸááºážáá²á· áááºáááºáá«á
ááá¯áá±á¬á· á¡ááá¯áá±á«áẠáá»á¯á¶á·áááẠ* Computer Science Engineering* ááá¯áᬠuser áá²á· ááœáŸááºááŒá¬ážáá»ááºááœá±á¡ááá¯ááºáž á¡ááá¡áá»
áá¯ááºáá±á¬ááºáá±ážáá²á· á
ááºáá
á¹á
ááºážááá¯áá±á·áá¬ááŒá®áž ááŒááºá ááá¹áá¬á ááŒá¿áá¬ááœá±ááᯠááŒá±ááŸááºážáá±ážááá²á· áááºááẠááá¯á·á¡áááá¹áá«ááºááá«áááºá\
\
== Computer ááá¯áá¬áá¬áá²
Computer ááœá±ááá±áá¬ááá¯ááºážááŸá¬ ááŸááá±áá«ááŒá®á ááœá¬ážááá¯ááºáá¶áá²á· á¡áááºáá¬áááºážáá
ááá¯á· áá¯á¶ážáá»á¶ááœá± áá¬ážááœá± ááŸá¬áá« áááŸááááŒá
áºááá±á¬áá»áá¯áž
áá«áááºáá¬áá«áááºá áá¯ááºážááœá±ááá¯áá¬áááºáž Computer á¡áá±ážá
á¬ážáá±ážáá«á Computer ááŸá¬ Analog áá²á· Digital ááá¯ááŒá®áž
ááŸá
áºáá»áá¯ážááŸááá«áá±ážááẠá¡á²á·ááŸá
áºáá»áá¯ážáá²á· á¡áá±ážá
áááºááœá²ááŒá¬ážáá¯á¶ááá¯áá±á¬á·áá±á¬ááºááŸááŸááºážááŒáá«áááºá á¡ááá ááá±á¬á· Computer ááá¯áᬠáá±ážáá¬ážáá²á· á¡áá±ážá
áááº
ááœáŸááºááŒá¬ážáá»ááºááœá±á¡ááá¯ááºáž(*Algorithms*) áá±áá»á¬ á¡ááœááºá¡áá»ááºáá¯ááºááŒá®áž ááŒá¿áá¬ááœá±ááᯠááŒá±ááŸááºážáá±ážááá²á· á
ááºááá¯á·áá±á¬ááºáá»ááºáá»ááá¯á·ááá«áááºá
Computer á á¡ááœááºá¡áá»ááºááẠáá¯ááºáá¬áá²á·ááẠComputer ááá¯á·áá±á«áºááŒá®áá¬ážááá¯áá±á¬á· áá¯ááºáááºáá² ááŒá±á¬ááááᯠááá¯ááºáá²ááá¯ááºáá«áá°ážá áá»áœááºáá±á¬áºááá¯á·
áá®áá±á·áá±ááºá¡ááŒááºáá²á·ááŒááºá·ááẠááááºážáá±ážááœá±ááẠááœááºáá»ááºááŒá®áž ááŒááºáá¯ááºáá±ážááá¬áá²á·ááẠááá¯á¶áá±á¬ááºáá±á¬á·áá«áá°áž á¡áá»ááºá¡áááºááœá±ááᯠááááºážáá¬ážááá¯ááºááááº
Computer áá
áºáá¯á¶ážáá²á·áá
áºáá¯á¶áž áá»áááºáááºááŒá®áž á¡áá»ááºá¡áááºááœá±ááᯠááá¯á·áá±ážááá¯ááºááááºá áá°ááœá± áá²á· áá±á·á
á¥áº ááá¯á¡ááºáá»ááºááœá±ááᯠááŒááºá·á
ááºážáá±ážááá¯ááºáá²á·á¡ááŒááº
á¡áá¯ááºááœáẠáá¯á¶ážááŒá
áºááŒá
Ạáá
áºááá¯ááºááẠáá¯á¶ážáá²ááŒá
áºááŒá
Ạáááºá¡ááœááºáá¯á¶ážáá¯á¶áž ááœááºáá° áá±ááá¯á· á¡á¶á·áááºááœááºáá»ááŒá
áºááá¯á· ááᯠáá
áºááŒá¬ážááá¯á¡ááºáá²á· á¡áá»ááºá¡áááºááœá±ááᯠááááºážááá¯á·
Storage ááœá± Program ááœá±á¡ááœáẠMemory ááœá± áá»áááºáááºááá¯á· Network ááœá±ááᯠá
ááºááá¯ááºážááá¯ááºáᬠáá
á¹á
ááºážááœá± á¡ááŒáẠá¡á²á·ááá¯
á
ááºááá¯ááºážááá¯ááºáᬠáá
á¹á
ááºážááœá±ááᯠááááºážáá»á¯ááºááá¯á· á
áá
Ạááá¯ááºážááá¯ááºáᬠSoftware ááœá± áá°ááœá± á¡áá¯á¶ážááŒá¯ááá¯á· áá²á· ááá¯á¡ááºááœá±ááá¯ááŒááºá·á
ááºážáá±ážááá¯ááºááá¯á· User
ááá¯ááºážááá¯ááºáᬠSoftware ááœá±áá«ááá¯áá«áááºá ááá¯áá±á¬á· áá»áœááºáá±á¬áºááá¯á· áá®áá±á·áá±ááºá¡ááŒááºáá²á·ááŒááºá·áááºáá±á¬á· á¡á²á·áá¬ááœá±á¡áá¯ááºáá«áá²á· á
ááºáá
á¹á
ááºážááᯠComputer
ááá¯á·áá±á«áºáá±á«áºááŒáá«áááºá
== Computer ááœá±ááŸá¬ á¡áá»áá¯ážá¡á
á¬ážáááºááŸáá¯ááŸáááá²
áá»áœááºáá±á¬áº ááááá±á¬ááºáá±á¬á· Analog Computer áá²á· Digital Computer ááá¯ááŒá®áž ááŸá
áºáá»áá¯ážááŸááá«áááºá áá®áá±á·áá±ááºááŸá¬áá±á¬á· Digital
Computer ááœá±ááá¯áá²áá¯á¶ážáá¬ááŒáá«áááºá áá°ááá¯á·ááŸá
áºáá¯á¡ááŒá±á¬ááºážááᯠáá®ážáááºá·ááœá²ááŒá®áž ááŸááºážááŒáá±ážáá«áááºá
=== Analog Computer ááá¯áá¬áá¬áá²
ááŸááºážá¡á±á¬ááºááŒá±á¬ááááºáá±á¬á· Analog Computer ááá¯áᬠBinary(1, 0) Input ááœá±á¡á
á¬áž physical input ááœá±
á¥ááá¬: áá»áŸááºá
á
Ạá¡á¬ážááœá±ááá¯á· áá²á· áá
áºááŒá¬áž ááŒááºáááŸá¬ ááŸááá²á· á¡áá¬ááá¹áᯠááœá±ááᯠáá¯á¶ážááŒá®áž ááŒá¿áá¬ááœá±ááᯠááŒá±ááŸááºážáá±ážáá¬áá«á áá°á·ááá¯á·ááá¯áá±á¬á· áá®áá±ááº
modern computer ááœá±ááŸá¬ ááœá±á·áááŸá¬ááá¯ááºáá±á¬á·áá«áá°áž áá¬ááá¯á·áá²ááá¯áá±á¬á· áá°ááá¯á·á personal usage á¡ááœááºááá±á¬ááºážáá°áž ááŒááºáááŸá¬ ááŸááá²á·
physical input ááœá±ááá¯áá¯á¶ážáá²á·á¡ááœáẠááŒááºáá±áá²á· Digital áá±á¬áẠá
áááºááá»ááááᯠááááá»áá°áž á¡á²á·á¡ááœáẠá¡áá±ážááŒá®ážáá²á· á¡ááœááºá¡áá»ááºááœá±á¡ááœááº
ááá¯ááẠAnalog ááᯠáá¯á¶ážááá¯á·áááá«áá°ážá áá«áá±áá²á· áá°á·áá²á· á¡á¬ážáá¬áá»ááºááœá±á¡áááá¯ááẠáá°á ááŒááºáááº, á¡á¬ážáá¯á¶ážáá¬áá²áááºážáá«áááºá
áá®á¡á¬ážáááºážáá»ááºá¡á¬ážáá¬áá»ááºááœá±á áá°áᬠphysical input á¡áá±á«áºáá°áááºáá±áá¬ááŒá±á¬ááºá·áá«á á¥ááᬠáá»áŸááºá
á
Ạááá¯áá² physical
input áá°áááºááá¯á· áá¬ážááá¯ááºáá«á áááºáá±á¬áẠvolt áááºáá±á¬áẠá¡á¬ážáá±ážáá²áá
ááŒá®áž áá
áºáá«áá
áºáá« input áá»áááºážáá¬áá²á· á¡áááº
á¡ááá¯ááºážá¡ááá¡áá»á¡ááŒá±ááŒááºáááá¯á·ááá¯áᬠáááŒá
áºááá¯ááºááá±á¬ááºááá¯ááŒá
áºáá«ááẠá¡á²á·áá¬ááŒá±á¬ááºá·áá°á·áá²á· á¡á¬ážáááºážáá»áẠááááá»áá¬á ááŒá
áºáá¬áá¬áá«á áá«áá±áá²á· ááœááºáá»ááºááŸá¯
ááá¯ááºážá input á¡á¬ážáá±ážááá¯ááºáá¬áá²á· áááºážááŒá®áž ááœááºáá±á¬á· realtime ááŸá¬ ááŒá
áºáá²á·á¡ááœáẠá¡áááºážááŒááºáá«ááẠá¡á²á·áá¬ááá±á¬á·
áá°á·áá²á·á¡á¬ážáá¬áá»ááºáá«á ááá¹áá¬á· ááááá¯á¶áž Computer ááŒá
áºáá²á· Analog Computer ááᯠ1821 ááŸá¬ ááá»áºá¬ááá¬ááŸáẠCharles
Babbage á Design ááœá²áá²á·áá«áááºá áá°á á
ááºá¡á¬ážá¡áá±á«áºááŸáá² áá°áááºááŒá®áž Design ááœá²áá²á·ááŒá®áž Binary(0, 1) á¡á
á¬áž
deimal(0~9) ááá¯áá¯á¶ážáá«áááºá
=== Digital Computer ááá¯áá¬áá¬áá²
Digital Computer ááá±á¬á· Analog Computer ááœá±ááᯠinput ááᯠááŒááºá á¡áá¬ááá¹áᯠááœá±ááá±áá°áá¬ááá¯ááºáá² Binary
Number ááá¯á·áá±á«áºáá²á· 0 áá²á· 1 ááᯠinput á¡ááŒá
áºáá°ááŒá®áž Logic Gate ááœá±ááá¯áá¯á¶ážááŒá®áž áá±ážáá²á· á¡áá»ááºá¡áááºááœá±ááᯠá¡ááœááºáá»ááºááŒá®áž
ááŒá¿áá¬ááœá±ááá¯ááŒá±ááŸááºážáá±ážáá¬áá«á modern computer á¡áá¯ááºáá¯á¶ážááá¯ááá¯á áá® Digital Computer ááœá±áá² ááŒá
áºáá«áááºá Logic
Gate ááœá±á¡ááŒá±á¬ááºážááᯠCpu á¡ááá¯ááºážááŸá¬ ááŸááºážááŒáá±ážáá«áááºá áá°á·ááᯠááœá²ááŒá®ážááŸááºážááŒáááẠá¡áá±ážááŒá®ážáá²á·á¡ááá¯ááºážáá¯á¶ážááá¯ááºážááœá²ááá¯á·ááááºá ááááá¯á¶ážáá²á·
á¡á±á¬ááºáá¯á¶áž á¡ááá¯ááºážááá±á¬á· á
ááºáá
á¹á
ááºážááá¯ááºáž(Hardware), á¡á²á·áá® Hardware ááá¯ááºážááŸá¬áá±á¬á· á
á±á¬ááááŒá±á¬áá²á· ááœááºáá»ááºáá¬ááœá±áá¯ááºááá¯á· Logic
Gate ááœá±áá«áá²á· Cpu ááẠá¡áá»ááºá¡áááºááœá±ááááºážááá¯á· HDD ááá¯á· SSD ááá¯á·ááá¯á· Storage device ááœá±ááẠProgram ááœá± á¡áá¯á¶ážááŒá¯áá±á
á¥áº
á¡áá»ááºá¡áááºááœá±ááááºážáá¬áá²á· áá
áºááŒá¬ážááá
á¹á
ááœá±áá¯ááºááá¯á· DDR ááá¯á· DIMM ááá¯á·ááᯠRAM(Random Access Memory) áááº
IO(Input/Output) á¡ááœáẠMonitor ááá¯á· Keyboard ááá¯á· áá²á· Mouse ááœá±á¡ááŒáẠáááŒá¬áž Wifi ááá¯á· bluetooth
ááá¯á·áááºáž áá«áááºáá«áááºá áá¯áááá¡áá±áá²á·ááá±á¬á· System Software ááá¯ááºážáá« áá°á·ááŸá¬áá±á¬á· á
á±á¬áá á
ááºááá¯ááºážááá¯ááºáᬠááá¯ááááºážáá»á¯ááºááá¯á·áá²á·
User ááá¯ááºážááá¯ááºáᬠSoftware ááœá±á¡ááœáẠá
ááºááá¯ááºážááá¯ááºáᬠHardware ááᯠmanagement áá¯ááºáá±ážááá²á· BIOS ááá¯á·, Kernel
ááá¯á· áá²á· Bootloader ááá¯á·ááᯠSoftware ááœá±áá«áááºáá«áááºá ááááá¡áá±áá²á·ááá±á¬á· User Software ááá¯ááºážáá« á¡á²á·áá¬ááœá±ááá±á¬á·
áá»áœááºáá±á¬áºááá¯á·áá²á· áááºážááŸá®ážááŒá®ážáá¬áž Facebook ááá¯á· Discord ááá¯á·áá²á· áá
áºááŒá¬áž Software ááœá±áá«áááºáá«áááºá Computer
áá²á·á¡áá¯ááºáá¯ááºáá¯á¶á áá»áœááºáá±á¬áºááá¯á· áá°ááœá±áá²á·á
ááºáá«áááºá áá»áœááºáá±á¬áºááá¯á· á¥á®ážááŸá±á¬ááºá áá»ááºá
áá áá¬ážá áá»áŸá¬ á
áá²á· áá±áá¬ááœá±ááá± á¡áá»ááºá¡áááºááœá±ááá¯áá° ááœááºáá»ááºááŒá®áž
ááŒá±ááá¯á· áááºááá¯á· ááá± á¡áá»ááºá¡áááºáá²á· áááºááá¯ááºáááᯠááŒááºááẠáá¯á¶á·ááŒááºáá±ážáá²á·á¡ááŒááºá áá¯ááºáá±á¬ááºáá±á
á¥áº á¡ááœááºážááá¯á¡ááºáá²á·á¡áá»ááºá¡áááºááœá±ááᯠShort Term
Memory áá²ááŸá¬ááááºážááŒá®áž á¡áá±ážááŒá®ážáá²á·á¡áá»ááºá¡áááºááœá±ááá¯áá±á¬á· Long Term Memory áá²áááºá·ááŒá®áž áá±á¬ááºáá¯á¶ážááá¯á·áá¡á±á¬ááºááááºážáá«áááºá
Computer ááá² á¡á²á·á¡ááá¯ááºážáá«áá² Program ááœá± Keyboard ááœá±áá²á· Mouse ááœá±ááᯠInput device ááœá±ááá± á¡áá»ááºá¡áááºááœá±áá°ááŒá®áž
á¡ááœááºá¡áá»ááºááœá±áá¯ááºáá±á¬ááºáá±ážááŒá®áž Monitor ááá¯á· Printer ááá¯á·ááᯠOutput Device ááœá±ááá± á¡áá»ááºá¡áááºááœá±ááá¯ááŒááºáá±ážáááºá
á¡á²á·ááá¯ááœááºáá»ááºáá±áá¯ááºážááŸá¬ áááᬠááŸááºá
áá¬ááŸááá¬ááœá±ááᯠRAM áá²ááŸá¬ ááááŸááºáá¬ážááŒá®ážáá±á¬á· á¡áá±ážááŒá®ážáá²á· ááááºážá
áᬠfile ááá¯á·ááᯠá¡áá»ááºá¡áááºááœá±ááá¯
á
á±á¬áá HDD ááá¯á· SSD ááá¯á·ááᯠStorage device ááœá±áá²ááŸá¬ ááááºážáá±ážáá«áááºá ááá¯áá±á¬á·á¡á²á·áá¬ááá¯ááŒááºá·ááẠComputer áá²á· áá°áá²á·á
áá±á¬áºáá±á¬áºáá±ážááá¯áá°ááá¯ááœá±á·ááá¯ááºáá«áááºá áá
áºáá«áá
áºáá±ááŸá¬ Digital Computer ááá¯áá²á· á¡áá¯á¶ážá¡ááŸá¯ááºážá¡á
á¬áž Turing Machine
ááá¯á·áá±á«áºááá¯á·áá²ááá«áááºá Turing Machine á¡ááŒá±á¬ááºážááá¯áá±á¬á· áááºáááºááŸááºážááŒáá±ážáá«áááºá
== Turing Machine áá²á· Turing Complete ááá¯áá¬áá¬áá²
Turing Machine ááᯠ1936 ááŸá¬ UK á ááá»áºá¬ ááá¬ááŸáẠAlan Turing ááá±ááŒá®ážáá±á¬á· ááááá¯á¶áž Design
áá±ážááœá²áá²á·áá«áááºá áá°á· Design ááŸá¬ á¡áá»ááºá¡áááºááœá±áá«áá²á· ááááºááœá±áááºá ááœáŸááºááŒá¬ážáá»ááºááœá±áááºá·ááá¯á· ááá¯ááºááẠáááºá á¡á²á·áá® ááá¯ááºáááºáá²á
ááœáŸááºááŒá¬ážáá»ááºááœá±á¡ááá¯áẠááááºááœá±áá±á«áºá á¡áá»ááºá¡áááºááœá±ááᯠáááº/ááŒáẠááá¯á· á¡áá¬áá
áºáá¯áááºáá«(áá²áá¶ááŒá
áºááŒá
Ạáá±á¬áááºááŒá
áºááŒá
áºááá¯á·áá² ááŸááºááŒááºá·ááá¯ááºáá«á)á áá°á·áá²á·
á¡áá¯ááºáá¯ááºáá¯á¶ááá² áá°á·áá²á· Design á¡ááá¯ááºážáá² ááá¯ážááŸááºážáá«áááºá á¡á²á·áá® áá²áá¶á ááááºáá±á«áºá á¡áá»ááºá¡áááºááá¯áááºááẠááŒá®ážááẠáá°á·áá²á· ááá¯ááºáááºáá²á
ááœáŸááºááŒá¬ážáá»ááºáá²á· ááááºá¡ááŒá±á¡áá±ááŸá¬ ááŸááá±áá² á¡á²á·á¡ááŒá±á¡áá±ááŸá¬ áá¬ááœáŸááºááŒá¬ážáá¬ážááá²ááá¯áá¬á¡áá±á«áºáá°áááºááŒá®ážáá±á¬á· áá²áá¶á ááááºáá±á«áºá á¡áá»ááºá¡áááºááá¯
ááŒááºááááºááá¯ááŒááºááẠááá¯ááºááẠáá±á¬ááºá¡áá»ááºá¡áááºáá
áºáá¯á
á®ááá¯ááœá¬ážáá«áááºá Design áá±á¬ á¡áá¯ááºáá¯ááºáá¯á¶áá±á¬á ááá¯ážááŸááºážáá±áá²á· áá°á·áá²á·
á
áœááºážáá±á¬ááºááá¯ááºá
áœááºážá á¡ááœááºá¡áá»ááº(Compute) áá¯ááºááá¯á·ááá²á· ááœáŸááºááŒá¬ážáá»ááº(Algorithms) ááŸááºááá»áŸááᯠááœááºááá¯á· áá¯á¶áá±á¬ááºáá²á·á¡áá»áááºáá²á·
á¡áá»ááºá¡áááºáá±ážááá¯á· áá¯á¶áá±á¬ááºáá²á· áá±áá¬ááŸáááẠá¡áá±á«ááºáž á¡áá¯ááºáá
ááá¯á· áá¬áá® áá»áŸáá¯á·ááŸáẠcode ááœá±áá±á«ááºáᬠá¡áá á¡áá¯áá±áẠcomputer
ááá¯ááºážáá¯ááºááá¯ááºáá¬á¡áá¯ááºáá¯á¶ážááá¯áá¯ááºááá¯ááºá
áœááºážááŸááá«áááºá áá
áºáááºáá² Alan Turing áá²á· áá
áºááŒá¬áž ááá»áºá¬ ááá¬ááŸááºááœá±áá±á«ááºážááŒá®áž áá¯ááá
ááá¹áá¬á
á
áºááŸá¬ áá¬áá®ááœá±áá²á· áá»áŸáá¯á·ááŸáẠcode ááᯠáá±á¬ááºááá¯á· *bombe* ááá¯á·áá±á«áºáá²á· Turing Machine ááá¯áá±á¬ááºáá²á·ááŒá®áž áá¯ááá ááá¹áá¬á
á
áºááá¯
áááºá·ááŸááºáž áá¬ážáá¬ááẠ2 ááŸá
áºááá± 4 ááŸá
áºá¡áá ááá¯á¡á±á¬ááºáá¯ááºáá±ážááá¯ááºáá²á·áá«áááºá á
á
áºááœá²á¡ááŒá®ážááŸá¬áá±á¬á· Alan Turing áá²á· John von
Neumann ááá¯á·áá±á«ááºážááŒá®ážáá±á¬á· *The ENIAC* ááá¯á·áá±á«áºáá²á· ááá¹áá¬áááá¥á®ážáá¯á¶áž reprogrammable ááŒá
áºáá²á· áá»áŸááºá
á
ẠComputer
ááᯠDesign ááœá²áá²á·áá«áááºá áá±á¬ááºáá
áºáá»áẠá¡áá±áá²á·ááá±á¬á· Alan Turing áᬠComputer ááœá±áá°ááœá±ááᯠá
áœááºážáá±á¬ááºááá¯ááºáá¬áž
ááá¯á
ááºážáááºááá¯á·á¡ááœáẠTuring Test ááá¯áá« áá±ážáá¬ážáá²á·áá«áááºá ááŸááºážááŸááºážááŒá±á¬ááááºáá±á¬á· AI ááœá±ááᯠá
ááºážááá¯á·á¡ááœááº
á¥á¬ááºá
ááºážááá±á¬áá»áá¯ážáá«á áá«á·á¡ááœáẠáá°á·ááᯠ*Father of Modern Computer and AI* ááá¯ááŒá®áž áá
áºáá»áá¯á·ááá±á«áºááŒáá«áááºá
Turing Complete ááá¯áá¬ááá±á¬á·ááŸááºážáá«áááºá Turing Machine áá¯ááºááá¯ááºááá»áŸ áá¯ááºááá¯ááºáá²á· á¡áá¬ááá¯áá±á«áºáá¬áá«á á¥ááá¬ááá¯
Minecraft áá²á· Red Stone ááá¯á· complex quantum system ááá¯á· Game Of Life ááá¯á·ááá¯áá«á Minecraft áá²á·
Red Stone áá²á· Minecraft ááŒááºáá±ážááá¯á·ááááᯠGame Of Life áá²á· AI áá±á¬ááºááá¯á·ááá«áááºá áá«ááœá±á¡á¬ážáá¯á¶ážáᬠAlan
Turing áá²á· Turing Completeness Theorem ááŒá±á¬ááºážáá«á áá«áá±áá²á· Alan Turing áᬠáá°á·áá²á· á¡ááœá±ážáá±á«áºááœá±áá±á«áº
áá°áááºááŒá®áž ááá¯ážáááºáá¬áá²á· áá±ááºááŒá®ážááᯠááŒááºá·áááœá¬ážáá²á·áááŸá¬áá«áá°ážá Alan Turing ááᯠ1952 ááŸá¬ UK áá²á· á¡á
áá¯ážáááá± Gay ááŒá
áºáá²á·á¡ááœááº
áá±á¬áºáá¯ááºážáá±ážááœá±á¡áááºážáá±á¬ááºááá¯ááºážáá²á·áá¬ááá± 1954 ááŸá¬ áá°á·ááá¯ááºáá° á¡áá¯á¶ážá
á®áááºáá²á·áá«áááºá
#figure(
image("images/turing_machine.jpg", width: 50%),
caption: [Turing Machine áá¯á¶],
)
#pagebreak()
#align(center, [= Computer Hardware áá»á¬ážá¡ááŒá±á¬ááºáž])
== ááááºáááº
Computer Hardware ááá¯áá¬ááá±á¬á· Computer áá
áºáá¯á¶ážááŸá¬ á¡áá¯ááºáá¯ááºáá±á¬ááºááá¯á·áá²á· áá
áºááŒá¬ážááá¯á¡ááºáá²á· áá¯ááºáá±á¬ááºáá»ááºááœá±ááᯠCPU áá²á·
ááœá²ááŒá®ážáá¯ááºáá±á¬ááºáá±ážááá¯á· áááºá·ááœááºážáá¬ážáá²á· á
ááºáá
á¹á
ááºáž ááœá±áá²ááŒá
áºáá«áááºá á¡á²á·ááá¯áá»áá¯áž Hardware ááœá±á¡áá»á¬ážááŒá®ážááŸááá«áááºá áá«áá±áá²á·
áá»áœááºáá±á¬áºááááá±á¬ááºá¡áááºážáááºááá¯áá² áááºá·ááŒá®ážááŸááºážááŒáá±ážáá¬ážáá«áááºá
== CPU (Central Processing Unit)
CPU ááá¯áá¬ááá±á¬á· Turing Machine áá²á áá²áá¶áá±ážááá¯áá«áá²á áá°á RAM(ááááº)áá²á á¡áá»ááºá¡ááẠááœá±ááá¯áááºááŒá®áž Software(ááá¯ááºáááº)
ááá±ážáá²á· ááœáŸááºááŒá¬ážáá»ááºááœá±á¡ááá¯ááºáž RAM áá²á á¡áá»ááºá¡áááºááœá±ááᯠáááº/ááŒááºáá±ážáá²á·áá¬áá«á áá°á Computer Hardware ááœá±áá²ááŸá¬ á¡áá±ážááŒá®ážáá²á·
á¡ááá¯ááºážááŸá¬áá«áááºá á¥áá¬ááᯠáá°ááá¯áá² áá°áá²á· ááŒá±/ááẠááá¯á·ááá¯á· á¡á
áááºá¡ááá¯ááºážááœá±ááá« áááºááá±á¬ááºážáá±áá²á· á¡áááºáá±á¬á·ááŸááºááá¯ááºáá«áá±ážáááºá áá«áá±áá²á·
á¡áá»ááºá¡áááºááœá±ááᯠááœááºáá»áẠááááºážá
ááºážáá¬ážáá±ážáá²á· á¥á®ážááŸá±á¬áẠáááŸáááẠá¡áááºáááŸááºááá¯ááºáá«áá°ážá
=== CPU ááŸá¬áá¬ááœá±áá«áá² áááºááá¯á¡áá¯ááºáá¯ááºáá²
Modern Computer ááœá±ááá±á«áºááẠá¡áááºááœááºáá²á·áá²á· *The ENIAC* ááá¯á·ááᯠComputer ááœá±ááŸá¬ Vacuum Tube ááá¯á·áá±á«áºáá²á·
áá®ážáá®ážááá¯áá¯á¶á
ᶠáá»áŸááºá
á
Ạdiode ááœá±ááᯠáá¯á¶ážáá²á·ááŒáá«áááºá Vacuum Tube áá
áºáá¯ááŸá¬ Anode, Grid áá²á· Cathode ááá¯ááŒá®áž
á¡ááá¯ááºážáá¯á¶ážááá¯ááºážáá«áá«ááẠá¡áá±ážá
áááºááá¯áá±á¬á· á¡á±á¬ááºááŸá¬ ááŸááºážááŒáá±ážáá«áááºá áá»áœááºáá±á¬áºááá¯á· LED áá®ážááœá±ááá±á«áºáááºá áá¯á¶ážáá²á·áá²á· áá®ážáá®ážááœá± áá²á·
á
ááºáá«áááºá áá«áá±áá²á· modern CPU ááœá±ááŸá¬ Vacuum ááœá±á¡á
á¬áž áá°ááá¯á·áá²á· áá¯ááºáá±á¬ááºáá¯á¶áá»ááºážáá°áá²á· transistor ááœá±ááá¯áá²áá¯á¶ážáá«áááºá
transistor ááœá±á¡ááŒáẠCPU ááŸá¬ Logic Gate ááœá± áá¬áá®ááŸááºáá¬ážááá¯á· register ááœá± áá²á· áá¬áá®áá«áá«áááºá
=== Vacuum ááœá±ááááºááá¯á¡áá¯ááºáá¯ááºáá²
Anode ááᯠá¡áá±á«ááºážá¡á¬ážáá±ážáá¬ážáá²á· áá«áá¬áá²á·áááºááŒá®áž á¡á²á·áá«áá¬ááŸá¬ áá®ážáá®ážáá
áºáá¯á¶ážááá¯áá²áááºáá¬ážááŒááºá·ááá¯ááºáá«á Grid ááá¯áá²
á¡áá±á«ááºážá¡á¬ážáá±ážáá¬ážááá¯ááºáá«á áá°á·ááŸá¬ áá«áá²á· Cathode ááᯠáá»áŸááºá
á
Ạá¡á¬ážáá±ážááá¯ááºááŒá®ážááá¯ááẠCathode á á¡áááºážáá°áá¬ááŒá®áž
electrons ááœá±áá¯ááºááœáŸááºáá±ážáá«áááºá á¡á²á·áá® electrons ááœá±á á¡ááŸááºá¡á¬ážááŒá
áºáá²á·á¡ááœááºááŒá±á¬ááºá· áááºá·áá»ááºááẠá¡á¬ážááŸááá²á· á
á±á¬áá
á¡áá±á«ááºážá¡á¬ážáá±ážáá¬ážáá²á· Grid áá®ááᯠááœá¬ážáá«áááºá áá«áá±áá²á· áá
áºáá»áá¯á· electrons ááœá±á Grid ááŸá¬ áá«áá²á· á¡áá±á«ááºááœá±ááá±
ááœááºááœááºááœá¬ážááŒá®áž á¡áá±á«ááºážá¡á¬ážááŸááá²á· Anode áá®ááᯠááœá¬ážáá«áááºá á¡á²á·áá®ááŸá¬ á¡áá±á«ááºážá¡á¬ážáá²á· á¡ááŸááºá¡á¬ážáá±á«ááºážááŒá®áž áá»áŸááºá
á
Ạá
á®ážááœá¬ážáá¬
á
á±á¬áá áááºáá¬ážáá²á·áá®ážáá®ážáááºážáá¬áá«ááááºá·áááºá áá«áá±áá²á· á¡á²á·áá¬á Grid á á¡áá±á«ááºážá¡á¬ážááŒá
áºáá±áá²á·á¡ááœááºááŒá±á¬ááºá·áá«á áá»áœááºáá±á¬áºááá¯á·á
á¡á²á·áá®á¡áá±á«ááºážá¡á¬ážá¡á
á¬áž Grid ááᯠá¡ááŸááºá¡á¬ážáá±ážááá¯ááºááẠCathode ááá¬áá²á· á¡áá¯ááºá¡á¬áž electrons ááœá±á á¡á¬ážáá°áá²á·á¡ááœááºááŒá±á¬ááºá·
áááºá·áá»ááºááŒá®áž Anode áá®ááᯠááá±á¬ááºáá²á·á¡ááœááºááŒá±á¬ááºá· áá®ážáááºážááááºážáá±á¬á·áá«áá°ážá á¡á²á·ááŸá¬ áá»áœááºáá±á¬áºááá¯á·á áá®ážáááºážáá¬ááᯠ1 áá®ážááááºážáá¬ááᯠ0
á¡ááŒá
áºáá°ááá¯ááºááẠ1/0 Binary ááá«ááŒá®á áá«ááá±á¬á· á¡áááºá Computer Cpu ááœá±á¡áá¯ááºáá¯ááºáá²á·áá¯á¶áá«á
=== Transistor ááœá± ááá¬ááœá±áá² áááºááá¯á¡áá¯ááºáá¯ááºáá²
Vacuum Tube ááœá±á á¡áááºážá¡á¬ážáá¯á¶ážááœááºážáá¬ááẠá¡áááºážáá±ážáá¬ááẠáá²á· áá
áºááŒá¬áž á¡ááŒá±á¬ááºážááœá±ááŒá±á¬ááºá· áá¬áá¬áẠáá°ááœá±áá¯á¶ážá
áœá²ááá¯á·
áááºááá¯ááºááá¯á·ááá¯áá¬áááŒá
áºááá¯ááºáá«áá°ážá áá®á¡ááœáẠDecember 23 1947 ááŸá¬ Bell Lab ááá¹áá¬áááá¥á®ážáá¯á¶áž transistor ááá¯
áá¯ááºáá¯ááºáá²á·áá«áááºá áá°á·ááŸá¬ á¡ááááá«áááºáá¬á áá²ááá±ááá²á· silicon ááẠáá»á±á¬ááºáá¯á¶ážáááá²á· phosphorus ááẠboron
áááºáá«áá«áááºá áá°á·áá²á· á¡áá¯ááºáá¯ááºáá¯á¶á á
á±á¬áá Vacuum Tube áá¯á¶á
á¶áá²á·á¡áá°áá°áá«áá²á silicon áá²á· á¡ááŒááºá¡ááœá¶ááŸá¬(outermost
shell) electron 4 áá¯á¶ážáá«áá«ááẠáá«áá±áá²á· áá±á¬áẠ4 áá¯á¶ážáá«ááẠá¡áááºáž áááºááŒáááº(stable) ááŒá
áºááœá¬ážááŸá¬ááŒá
áºáá²á·á¡ááœááºááŒá±á¬ááºá·
silicon á áá°á·áá²á· á¡áá®ážáá¯á¶ážááŸá¬ááŸááá²á· áá
áºááŒá¬áž silicon 4 áá¯áá²á· áááºáá±á«ááºážáá²á·á¡áá«ááŸá¬ á¡áááºáž stable ááŒá
áºáá²á· crystal
lattice áá¯á¶á
á¶(structure) ááŒá
áºááœá¬ážáá»áá«áááºá áá«áá±áá²á· á¡á²á·ááᯠstable ááŒá
áºááœá¬ážáá¬ááŒá±á¬ááºá· á¡á¬áž(energy) á¡áá¯á¶á¡áá±á¬ááºááá²á·
áá
áºáá»áá¯á· electron ááœá±áá² á¡á²á·áá® structure ááá±ááœááºááŒá®áž ááœááºááœááºáááºááẠááœá¬ážááá¯ááºáá«ááẠ(á¡áááºááŒá±ážááœá±)á áá«áá±áá²á·á¡á²á· áá²á silicon
Atom áá
áºáá¯á¶ážááᯠá
á±á¬áá áá»á±á¬ááºáá¯á¶ážáááá²á· phosphorus Atom áá
áºáá¯á¶ážáá²á· áá²ááá¯ááºáá²á·á¡áá«ááŸá¬ phosphorus áá²á· outermost
shell ááŸá¬ electron 5 áá¯á¶ážáá«áá²á·á¡ááœááºá á
á±á¬ááááᯠstable ááŒá
áºáá²á· structure áááá¯á· ááá¯áá±áá²á· electron áá
áºáá¯á¶ážá
á¡ááŒááºááᯠááœááºááœááºááœá¬ážááŒá®áž á
á±á¬ááááᯠstable ááŒá
áºáá²á· structure ááŒááºááŒá
áºááœá¬ážáá«áááºá á¡á²á·áá±á¬ááºááá¯áá±á¬á· *N-Type* ááá¯á·áá±á«áºáá«áááº
áá¬ááá¯á·áá²ááá¯áá±á¬á· silicon áá²á· phosphorus á
á±á¬áá á¡áá»áá¯ážá¡ááá¯ááºážáááºáááºá·áá²á· á¡áá« structure áááá¯ááŒá®ážáá¬ááŒá®áž
á¡áá¯ááºá¡á¬áž(Negatively charged) ááŸááá²á· electron ááœá±ááœááºááœááºáᬠááá¯áá»á¬ážáá¬áá«áááºá á¡á²á·áá®á¡ááœáẠá¡á²á·áá±á¬ááºááá± á¡ááŸááº
áá»áŸááºá
á
áºá¡á¬ážááœááºááẠá
á±á¬áá Cathode ááá¯áá«á áá«áá±áá²á· áá»áœááºáá±á¬áºááá¯á·á electron ááá¯áá»á¬ážáá²á· phosphorus á¡á
á¬áž 3 áá¯á¶ážáá²ááŸááá²á·
boron ááᯠáááºá·ááá¯ááºáá²á·á¡áá« áá°áá²á· á¡áá®ážááŸá¬ááŸááá²á· electron ááœá±ááᯠáá°áá«áá±á¬á·ááẠá¡á²á·áá®ááŸá¬áá² á¡áá±á«ááºážá¡á¬ážááŸááá²á· á¡áá±á«ááºááœá± áá
ááŒá®áž
ááœááºááœááºáá«áá±á¬á·áááºá áá°á·ááᯠ*P-Type* ááá¯á·áá±á«áºáá«áááºá N-Type á¡ááá¯ááºážáá² boron áá²á· silicon ááœá±ááᯠá¡áá»áá¯ážá¡ááá¯ááºážáááºáááºá·áá²á·
á¡áá« á¡áá±á«ááºážá¡á¬ážááŸááá²á· á¡áá±á«ááºááœá±ááá¯áá»á¬ážáá¬áá«áááºá Grid áá²á· áááºážáááºáž ááœá²áá±áá²á· áá°á·ááᯠá¡á²á·ááá¯ááºážáá»áá¯ážááá¯á·áá²ááŸááºáá¬ážááá¯á·ááá«áááºá
transistor ááŸá¬ P-Type áá±á¬ N-Type áá±á¬ ááŸá
áºáá»áá¯ážáá¯á¶ážááᯠN-Type ááᯠáá±ážááŸá
áºáááºááá¬áž P-Type ááá¯
á¡áááºááŸá¬áá¬ážááŒá®áž N-Type ááŸá
áºáá¯áá²á·áá±ážááŸá¬ áá»áŸááºá
á
áºááœá¬ážááá¯á·áá¡á±á¬áẠ*Source* áá²á· *Drain* ááá¯á·áá±á«áºáá²á· áá«áá¬ááá±á¬áá»áá¯ážáá²á·
P-Type áá²á·á¡áá±á«áºááŸá¬ áá»áŸááºá
á
áºá¡á¬ážáá±ážááá¯á·á¡ááœáẠ*Gate* ááá¯á·áá±á«áºáá²á· áá«áá¬ááá±á¬áá»áá¯ážáá«áá«áááºá Gate ááá± áá»áŸááºá
á
áºááá±ážáááºááŸá¬
N-Type á electron ááœá±á P-Type ááŸá¬ááŸááá²á· á¡áá±á«ááºááœá±áá²áá±á¬ááºááœá¬ážááŒá®áž stable ááŒá
áºáᬠáá±á¬ááºááẠSource ááá±ážáá²á·
áá»áŸááºá
á
áºá¡á¬ážááœá±ááᯠá¡á¬ážáá°áá±ážáá²á· Drain á
á® ááá±á¬ááºá¡á±á¬áẠáá¬ážáá¬ážáá²á· áá¶áá¶ááá±á¬áá»áá¯ážááŒá
áºáá¬áá«áááºá á¡á²á·áá±á¬ááºááᯠDepletion layer
ááá¯á·áá²áá±á«áºáá«áááºá áá«áá±áá²á· Gate ááá± á¡áá±á«ááºážá¡á¬ážáá±ážááá¯ááºáá²á·á¡áá« á¡á²á·áá® layer ááŸá¬ á¡áá±á«ááºááá±á¬áá»áá¯áž ááŒá
áºáá¬áá²á·á¡áá« á¡á²á·á¡áá±á«ááºááá±
electron ááœá±ááœá¬áž Drain ááá¯áá±á¬ááºáá²á·á¡áá« áá»áŸááºá
á
áºá¡á¬ážááá¯ááŒá
áºá
á±áá«áááºá
=== Logic Gates ááá¯áá¬áá¬áá²
Logic Gates ááœá±ááŸá¬ á¡áááá¡áá±áá²á· *NOT* Gate, *AND* Gate áá²á· *OR* Gate ááá¯ááŒá®áž áá¯á¶ážáá¯ááŸááá«áááºá
áá±á¬ááºáááºá¡áá»á¬ážááŒá®ážáááºááŸááá«áá±ážáááºá áá«áá±áá²á· áá®áá¯á¶ážáá¯ááá¯áá² ááŸááºážááŒáá±ážáá¬ážáá«áááºá Logic Gate á¡ááŒá±á¬ááºážááŸááºážá¡á±á¬ááºááŒá±á¬ááááºáá±á¬á·
Transistor áá²á· Resistor ááœá±ááᯠáá±áá¬á¡ááá¯ááºáá±á«ááºážááŒá®áž áá
áºáá¯áá²á· output ááᯠáá
áºáá¯á input á¡áá±áá²á· áá°ááŒá®áž
á¡áá¯ááºáá¯ááºáááºááá¯á·ááŸááºáá¬ážááá¯á·ááááºá AND Gate á input current ááŸá
áºáá¯áá¯á¶áž 1 á¡áá±á«ááºážá¡á¬áž ááŒá
áºáá±á០1 á¡áá±á«ááºáž output
á¡ááŒá
áºááŒááºááœááºáá±ážáá«áááºá áá
áºáá¯á á¡ááŸááºá¡á¬ážááŒá
áºáá±áá¬ááá¯á· ááŸá
áºáá¯áá¯á¶ážá á¡ááŸááºá¡á¬ážááŒá
áºáá±áá¬ááá¯á· ááá¯ááẠá¡ááŸááºá¡á¬ážáá²ááŒááºááœááºáá±ážáá«áááºá AND
ááᯠáá¯ááºááŒááºá·áá»ááºááẠááááá¯á¶áž Transistor ááŸá
áºáᯠA,B ááá¯áá° A áá²á· Source áá²á· Gate ááᯠá¡á¬ážáá±ážááá¯á·á¡ááœáẠáá«áá¬áá
áºáá¯áá²á·áá»áááº
A Drain ááá¯áá±á¬á· B áá²á· Source áá²á· áá»ááẠB áá²á· Gate ááᯠá¡á¬ážáá±ážááá¯á· áá«áá¬áá²á·áá»áááºá ááááºááœááºáá²á· B áá²á· Drain ááá¯áá±á¬á·
áá®ážáá®ážááŒá
áºááŒá
Ạáá
áºáá¯áá¯áá²á· áá»áááºááŒááºá·áá¬ážááá¯ááºá A áá²á· Source ááᯠá¡á¬ážáá±ážááá¯ááºááŒá®áž A áá²á· B áá²á· Gate ááᯠá¡á¬ážááá±ážáá² áá±ááẠáá®ážáá®áž
áá¯á¶ážááááºážáá¬ááŸá¬ ááá¯ááºáá°áž áá¬ááá¯á·áá²ááá¯áá²á· ááŸá
áºáá¯áá¯á¶ážá 0 ááŒá
áºáá±áá²á·á¡ááœááºááŒá±á¬ááºá· áá»áŸááºá
á
áºá A ááá± B ááá¯áááœá¬ážááá¯ááºáá°ážá áá«ááᯠA áá²á· Gate
ááá¯áá² á¡á¬ážáá±ážááááºáááá¬ážá áá¯á¶ážááááºážáá¬ááŸá¬ááá¯ááºááŒááºáá«áá°áž áá¬ááá¯á·áá²ááá¯áá±á¬á· A á 1 ááŒá
áºááŒá®áž B á 0 ááŒá
áºáá±ááá¯á·áá«á A á
á¡á¬ážáá¯ááºáá±ážáááºá B ááŸá¬áááºáž á¡á¬ážáááºáá±áá²á· B áááŒááºáááœááºáá²á·á¡áá«ááááºážááŒááºáá«áá°ážá á¡á²á·ááá¯áá² B á 1 ááŒá
áºááŒá®áž A á 0 ááŒá
áºáá±áááºáá² A
áá¡á¬ážá B ááá¯ááá±á¬ááºáá²á·á¡ááœááºááŒá±á¬ááºá· áááºážááŸá¬ááá¯ááºáá«áá°ážá ááŸá
áºáá¯áá¯á¶áž 1 ááŒá
áºáá±ááŸáᬠA áá²á· B á ááŸá
áºáá¯áá¯á¶áž
á¡á¬ážááŒááºáá¯ááºáá±ážááá¯ááºááá¯á·áááºážááŸá¬áá«á OR ááá¯áá¬ááá±á¬á· A áá«ááŸááá¯áẠB á á¡áá±á«ááºážááŒá
áºááẠáá»áŸááºá
á
áºááœááºáá±ážáá¬áá«á Not ááá±á¬á·
ááŒá±á¬ááºážááŒááºááŒááºáá±ážáá¬áá« áá»áŸááºá
á
Ạinput áá±ážáá±ááẠáá°á áᬠoutput á០áá¯ááºááá±ážáá«áá°ážá input ááá±ážáááºáá±á¬á· output
áá±ážáá«áááºá á¥ááᬠáá±ážááááºáá±á¬á· AND Gate ááá¯áᬠááŸá
áºáááºá¡ááŒááºá¡ááŸááºááŸááá²á·áá»á
áºááŒááºážá OR Gate á áá
áºáááºáááºáá»á
áºááŒááºážá Not
Gate á áááºá·áááºá·ááá¯ááºáá»á
áºááŒááºážáá«á
#figure(image("images/logic_gates.jpg"), caption: [Logic Gates áá
áºáá»áá¯á·áá¯á¶])
=== CPU ááœá±áááºááá¯á¡áá¯ááºáá¯ááºáá² Clock Speed ááá¯áá¬áá¬áá²
áá»áœááºáá±á¬áºááá¯á· á¡á
á CPU ááœá±á Memory áá²á Data ááœá±ááᯠRead Write áá¯ááºááŒá®áž á¡áá¯ááºáá¯ááºáá¬áá²á· Logic Gate ááœá±á
áááºááá¯á¡áá¯ááºáá¯ááºáá²áá¯ááºáá² ááŒá±á¬áá²á·ááŒá®ážáá«ááŒá®á áá®áá
áºáá«ááŸáá±á¬á· áá°ááá¯á·ááŸá
áºáá¯áá±á«ááºážááŒá®áž áááºááá¯á¡áá¯ááºáá¯ááºáá¬áá²ááá¯áá¬ááŒá±á¬ááŒáá«áááºá CPU ááŸá¬
Fetch-Decode-Execute ááá¯á·áá±á«áºáá²á· FDE ááá¯áá¯ááºáá±á¬ááºáá±ážáá«áááºá á
á
áá»ááºážááŸá¬ CPU á Program áááŒá±á¬áá¬ážáá²á· Memory
áá²á· á¡á
ááá¯ááœá¬ážááŒá®áž á¡á²á·áá® Memory Address ááᯠFetch áá¯ááºáᬠáá°á·áá²á· register áá²ááŸá¬ ááááááºážáá±ážáá¬ážáá«áááºá ááááºážááŒá®áž
ááœá¬ážáá²á·áá±á¬áẠDecode á¡áááºá·áá» á
á±á¬áá register áá²á Memory Address ááœá¬ážááŒá®áž á¡á²á·áá® Address áá²ááŸá¬ ááááºážáá¬ážáá²á·
Value áá«ááŸááá¯áẠáá¯ááºáá±á¬ááºááá²á· áá±á¬ááºááẠá¡áá»ááºá¡ááẠááá¯áá°áá«áááºá Execute á¡áááºá·ááŸá¬áá±á¬á· á¡á²á·áá®áá±á¬ááºáá¯á¶áž ááááºážáá¬ážáá²á·
register áá²á á¡áá»ááºá¡ááẠáá«ááŸááá¯áẠááœáŸááºááŒá¬ážáá»ááºááᯠáá¯ááºáá±á¬ááºáá±ážáá«áááºá á¡á²á·áá±á¬ááºááá¯áá² Memory Address áá
áºáá¯áá»ááºážá
á®
ááá¯ážááŒá®áž áá¯ááºáá±á¬ááºáá±ážááœá¬ážáá¬áá«á á¡á²á·áá«áá»áá¯ážááᯠCPU Clocking ááŒá
áºáááºááá¯á·áá±á«áºáá«áááºá á¡á²á·áá±á¬ááºááœá±á Cpu áá²ááŸá¬ áá
áºá
áá¹áááºá·ááá¯
Billion áá²á·áá»á®ááŒá®ážááŒá
áºáá±áá¬áá«á á¡á²á·áá±á¬ááºááᯠHz ááá¯á· GHz ááá¯á·ááᯠunit ááœá±áá²á·ááá¯ááºážáá«áááºá CPU Clock Rate áá»á¬ážáá±áá± CPU
áááŒááºááŒáẠááœááºáá»ááºáá±ážááá¯ááºáá±áá«áá²á
Fun Fact á¡áá±áá²á·ááá±á¬á· CPU áá¯ááºáá¯ááºáá²á· áá±áᬠá
ááºáá¯á¶ááœá±á áá±ážáá¯á¶á ááœá²á
áááºáááºáž áááºááᯠááá¯ááŒá®áž áááºá·ááŸááºážáá±ááá«áááºá
áá¬ááá¯á·áá² ááá¯áá±á¬á· CPU áá¯ááºáá²á· áá±áá¬ááŸá¬ á¡ááŸá¬ážáá«áᬠRadiation ááŒá
áºáᬠáá
áºáá¯áá¯ááŒá
áºááœá¬ážááẠBit Flip ááá¯áᬠááŒá
áºááœá¬ážááá¯ááºáá«áááºá
Bit Flip ááá¯áá¬ááá±á¬á· Computer áá²á· CPU á á¡áá¯ááºáá¯ááºáá±ážáá²á· binary number ááŸá¬ áá¯á¶ááŸááºááá¯ááºáá² ááŒá±á¬ááºážáá²áá¬ááá¯áá±á«áºáá¬áá«á
á¥ááᬠáá¯á¶ááŸááºá 010 ááá¯ááŒá®áž ááŸáááá²á· á¡á
á¬áž Radiate ááŒá
áºááœá¬ážááŒá®áž 100 ááŒá
áºááœá¬ážáá¬ááá¯á· 001 ááŒá
áºááœá¬ážáá¬ááá¯á·ááᯠááŒá±á¬ááºážááœá¬ážáá¬ááᯠááá¯ááá¯áá¬áá«á
áá¬áá¬ááºááŒááºá·áááºáá±á¬á· áá¬ááŸááá¯ááºáá±á¬ááºáá°ážáááºááá±áá²á· áá
áºáá²á· á¡áá±ážááŒá®ážáá²á· áá²áá±ážáá¬ááá¯á· áá±ážáá¯á¶á system ááœá±ááŸá¬ááá¯á· á¡á¬áá¬á system ááœá±
ááŸá¬ááᯠáá
áºáá²á· á¡áá±ážááŒá®ážáá²á· áá±áá¬ááœá±ááᯠáá°á·á¡áááºááœá± áá¬áá ááŒá®ážáá¬ážáá²á· áá¯á¶ážááŸá¯á¶ážááŸá¯ááœá± á¡áá»á¬ážááŒá®ážááŒá
áºá
á±ááá¯ááºáá«áááºá
== Motherboard ááá¯áá¬áá¬áá²
Motherboard ááá¯áá¬áá¬áááºááá¯ááºáá«áá°áž áá»áœááºáá±á¬áºááá¯á· ááŒááºáá°ážáá±áá» áá»áŸááºá
á
áºáá
á¹á
ááºážááœá±ááŸá¬ áá«áá±áá» á
áááºážá
áááºážá¡ááŒá¬ážááŒá®áž
PCB(Printed Circuit Board) á¡ááŒá®ážá
á¬áž ááá±á¬áá»áá¯ážááᯠComputer ááŸá¬ááá¯á¡ááºáá²á· Hardware ááœá±áá»áááºáááºááá¯á·á¡ááœááº
áá®ážáááºá·ááŒááºáááºáá¬ážáá²á·áá¬áá«á áá°á·áá²á· á¡áááá¡áá¯ááºááá±á¬á· Hardware ááœá±áá
áºáá¯áá²á·áá
áºáá¯ááᯠáá»áááºá
ááºááŒá®áž ááááºážáá»á¯ááºááá¯á·áá«á áá°á á¡áá»ááºá¡áááºááœá±ááá¯
ááŒááºááŒááºáááºááẠááá¯áá²á· Display ááá¯á· Gpu ááá¯á·áá²á· DRAM ááá¯á·ááá¯áá±á¬ááºááœá±ááᯠCPU áá²á·áá
áºáá«áááºáž áá»áááºáááºáá±ážáá«áááºá áá±á¬ááºááẠCPU áá²á·
áá
áºáá«áááºáž áá»áááºáá¬ážáá²á·áá±á¬ááºááá±á¬á· Chipset áá« (North Bridge áá²á· South Bridge ááá¯á·ááœá²ááŒá®ážáá±á¬á·áá²áá«áááºáá«áááºá)
áá°á á¡áááºážááŒááºááá¯á·áááá¯áá²á· USB device ááá¯á· Storage ááá¯á·áá²á· Speaker ááá¯á·ááœá± áá²á· áá»áááºáá±ážáá¬ážáá«áááºá
#figure(
image("images/MotherBoard.png", width: 50%),
caption: [Mother Board Circuit áá»áááºáááºáá¯á¶á¡áá»áá¯á·],
)
#pagebreak()
== RAM (Random Access Memory)
áá°ááá±á¬á· á¡áá»á¬ážá
á¯áá²á· áááºážááŸá®ážááŒá®ážáá¬ážááŒá
áºááŸá¬áá«á áá°á·ááá¯áá±á¬á· CPU ááœááºáá»ááºáá±áá²á·á¡áá»áááºá¡ááœááºáž á¡áá»ááºá¡áááºááœá± áá±ážááá¯á· áá²á·
áááá¬ááááºážá
ááºážááá¯á·á¡ááœáẠá¡ááááá¯á¶ážáá«áááºá CPU á áááºááá¬áá²á· Data áá²ááŒá
áºááŒá
ẠSSD ááá¯á· HDD ááá¯á·ááá±áá¬áá²á· Data ááá¯áááºáá±á¬ááº
RAM áá²ááŸá¬ áááºá·ááŒá®ážá០process áá¯ááºáá±ážááá¯á·ááá¬áá«á á¡á²á·áá¬ááŒá±á¬ááºá· áá°á·ááᯠWorking Memory ááá¯á·áá²áá±á«áºáá«áá±ážáááºá áá«ááᯠáá¬ááá¯á·
compute áá¯ááºáá²á·á¡áá« SSD ááá¯á·ááᯠáá±á¬ááºááœá±ááá¯á¶ážáá² RAM ááá¯áá²áá¯á¶ážáá¬áá²á á¡ááŒá±ááá±á¬á·ááŸááºážáá«ááẠááŒááºááá¯á·áá« áááºážáááºáž áááºááŒááºáá¬ááá¯ááº
áá«áá°ážá á¡ááá±á«ááºáž 3000 áá»á±á¬áºáá±á¬ááºááá¯ááŒááºáá«áááºá áá¬ááá¯á·áá²ááá¯áá±á¬á· HDD ááŸá¬ááᯠdata read/write á áááºáá±áá²á· CD áá±á«áºá
áá¶ááá¯ááºá
áœááºážá¡á¬ážá¡ááá¯ááºáž áá¯ááºáá±á¬ááºáá±ážáá¬ááŒá
áºáá²á·á¡ááœáẠá¡áááºážááŸá±ážáá«áááºá SSD á HDD áááºááá¯á¡áá»á¬ážááŒá®ážááá¯ááŒááºáá±áá²á· áá°ááá² 3D áá¯á¶á
á¶
Trillion ááœá±áá²á·áá»á®ááŒá®áž Memory Cell ááœá±áá²á· Terabytes áá²á· áá»á®áá²á· Data ááœá±ááᯠááááºážáá¬ážáá±ážááá¯ááºáá±áá²á·á
rw(read/write) speed ááŸá¬áá» 30~50 microseconds áá±á¬ááºááŒá¬áá«áááºá áá«áá±áá²á· Ram ááá» 2D array áá¯á¶á
á¶
Billion áá²á· áá»á®áá²á· Memory Cell ááœá±áá²á·ááŒá
áºáá¬ááŒá±á¬ááºá· Gb áááºážáááºážáá±á¬ááºáá² áááºá·áá¬ážááá¯ááºáá±áá²á· rw speed ááŸá¬áá» 1
nanosecond áá²ááŒá¬áá«áááºá á¡ááá±á«ááºáž 3000 áá±á¬ááºááœá¬áá«áááºá áá«ááŒá±á¬ááºá· RAM ááá¯áá²áá¯á¶ážáá¬áá«á
== Storage Devices
Storage Device ááœá±á Data ááœá±ááᯠá¡áá»áááºá¡ááŒá¬ááŒá®áž ááááºážáá¬ážáá²á·áá±áá¬ááŸá¬áá¯á¶ážáá«áááºá Storage Device ááœá±á¡áá»á¬ážááŒá®áž
ááŸááá«áááºá á¥ááá¬ááá¯ááẠFloppy Disk ááá¯á· USB ááá¯á· áá»áœááºáá±á¬áºááá¯á· á¡áááºá áá¬ááºáá¬ážááœá±ááœá±áááºá·áá²á· CD ááŒá¬ážááá¯á· HDD ááá¯á· SSD
(Solid State Drive) ááá¯á·áá«áá áá°ááá¯á·ááœá±áá²á á¡áá¯ááºáá¯á¶ážááá¯ááᯠá áá¯ááºáá±á¬ááºáá¯ááŒááºážáá°ááŒáá«áááºá 1, 0 Data ááœá±ááᯠelectron
charge ááœá±á¡áá±áá²á· Array áá¯á¶á
ᶠááááºážáá±ážááŒá®áž ááŒááºáá¯ááºáá±ážáá«áááºá SDD ááŸá¬ááᯠá¡á²á·ááá¯ááááºážáá±ážáá²á· Memory cell ááᯠCharge
Trap Flash ááá¯á·áá±á«áºáá«áááºá (áá»áœááºáá±á¬áº ááá¯ááŒá®ážá¡áá±ážá
ááẠData ááœá±áááºááᯠMemory cell áá²ááŸá¬ááááºážáááºážá
áá°ááá¯á·áááºááá¯á¡áá¯ááºáá¯ááºáá²ááá¯áá¬ááá±á¬á· áá® edition ááŸá¬ á¡áá»áááºáááŸá®ááẠáá±á¬áẠedition ááŸáááºá·áá±ážáá«áááºá)
== BIOS(Basic Input Output System)
áá°á Motherboard ááŸá¬ áá
áºáá«áááºážáá«áá¬áááºáá«áááºá áá°á Hardware áááºážáá¯ááºáááºááá¯á·ááŒá±á¬ááááá¯á Software
áááºážáá¯ááºáá«áááºá á¡áá»á¬ážá
á¯ááá±á¬á· MotherBoard áá²á· Firmware(Hardware áá
áºáá¯áá¯ááᯠááá¯ááºááá¯ááºááááºážáá»á¯ááºáá±ážáá²á· Software)
ááá¯á·áááºážáá±á«áºáá«áááºá áá°áá²á· á¡áááá¡áá¯ááºááá±á¬á· CMOS áá²á ááááºážáá¬ážáá²á· Hardware Setting ááœá±ááᯠááááºážáá»á¯ááºáá±ážááŒá®áž Bootable
Drive(Operating System áá«ááŸááá¯áẠBootloader ááá¯á·ááᯠSoftware áááºá·áá¬ážáá²á· boot áá¯ááºááá¯á·ááá²á· Device) ááá¯
á
ááẠrun áá±ážááá«áááºá áá°á ááŸá±ážáá¬ááẠStorage áá»á¬ážáá¬ááœá±ááᯠHandle ááá¯ááºááá¯ááºáá¬áááºááŒá±á¬ááºá· áá±á¬ááºááá¯ááºáž PC ááœá±ááŸá¬
UEFI ááá¯áá¯á¶ážáá¬ááŒáá«áááºá UEFI á BIOS ááá¯áá«áá² áá«áá±áá²á· ááá¯ááŒááºáá²á·á¡ááŒáẠExabytes (1 exa = 1073741824 GB,
1073741 TB) áá²á·áá»á®áá²á· partition áá±á«ááºáž 128 áá¯ááᯠHandle ááá¯ááºáá«áááºá BIOS ááá» áá±á¬á· á¡áá»á¬ážáá¯á¶áž 2.2 TB
Storage áá²á· partition 4 áá¯ááá¯áá² Handle áá¯ááºáá±ážááá¯ááºáá«áááºá BIOS ááœá±á áá¬á០ááá¯ááºááẠBootable Device
ááœá±ááᯠáá
áááºáá±ážáááºááŸá¬ Power On Self Test(POST) ááá¯á·áá±á«áºáá²á· Test ááᯠrun ááŒá®áž Computer áá²á·áá»áááºáá¬ážáá²á·
Keyboard ááœá± Battery ááœá± Display ááœá±á¡áá¯ááºáá¯ááºáá¬ážá
á
áºáá±ážáá«áááºá á¡áááºá á¡áá¯ááºááá¯ááºáá¬ááá¯á· áá²áááºá·áá¬ááá¯á·ááá¯ááẠAleart
Screen ááá±á¬áá»áá¯ážááŒáá±ážáá«áááºá áá»áœááºáá±á¬áºááá¯á· Computer á¡áá±á¬ááºážááœá± Bettery ááá±á¬ááºážáá¬ááœá±ááá¯ááºáá°ážááẠááááá¬ážááááŸá¬áá«á
Power ááœááºá·ááá¯ááºáá»ááºáž Boot áááºáááœá¬ážáá² Your Bettery health is blabla ááá¯ááŒá®áž Aleart ááŒáá«áááºá áá°á
MotherBoard á¡áá±á«áºááá¯ááºááŒá®áž version ááœá±ááœá²ááá¯ááºáá«áááºá áá°á MotherBoard áá
áºáá¯ááᯠáá
áºáá¯áááºážá¡ááœááºáá²á¡áá¯ááºáá¯ááºááŒá®áž
áá
áºááŒá¬áž á¡áá»áá¯ážá¡á
á¬ážááœá±á¡ááœááºá¡áá¯ááºááá¯ááºáá«áá°ážá áá«ááŒá±á¬ááºá· General ááŒá
áºáá²á· BIOS ááá¯áá¬áá¯á¶ážáááᯠáááŒá
áºááá¯ááºááá±á¬ááºááá¯ááŒá
áºáá«áááºá
#pagebreak()
#align(center, [= System Software áá»á¬ážá¡ááŒá±á¬ááºáž])
== ááááºáááº
System Software ááá¯áá¬ááá±á¬á· Hardware ááᯠááá¯ááºááá¯áẠcontrol áá¯ááºáá±ážáá²á· Software ááœá±áá«á áá»áœááºáá±á¬áºááá¯á· áá¯á¶ážáá±áá»
Discord ááá¯á·ááᯠFacebook ááá¯á·ááᯠCode ááœá±áá²á· áá±ážáá¬ážáá¬áá«áá² áá«áá±áá²á· áá°ááá¯á·á Hardware ááœá±ááᯠááá¯ááºááá¯ááºááááºážáá»á¯ááºáá±ážááŒá®áž á¡á²á·áá®
Facebook ááá¯á· Discord ááá¯á·ááᯠUser Software ááœá± Hardware ááá¯áá¯á¶ážááá¯á·á¡ááœáẠAPI ááŒááºáá¯ááºáá±ážááá«áááºá áá°á·ááŸá¬
á¡áááá¡á¬ážááŒááºá·áá±á¬á· BIOS, Bootloader, Kernel, Kernel Drivers & Modules ááœá±áá«áááºáá«áááºá BIOS
á¡ááŒá±á¬ááºážááá¯áá±á¬á· áá»áœááºáá±á¬áºááá¯á· ááŸááºážááŒááŒá®ážáá«ááŒá®á áá»ááºáá¬ááœá±ááᯠáááºááŸááºážááŒáá±ážáá«áááºá
== Bootloader
Bootloader ááá¯áᬠBIOS ááŒá®ážááẠáá¯ááá run áá±ážáá²á· Software áá« BIOS ááá± POST run ááŒá®ážáááº
Bootloader ááŸááá²á· MBR ááá¯áá²á· partition ááŸá¬ ááœá¬ážááŸá¬ááŒá®áž run áá±ážááá«áááºá áá«áá±áá²á· UEFI ááŸá¬áá±á¬á· Bootloader
file áááºá·ááá¯á· partition áááºáááºáá±á¬ááºáá±ážááá«áááºá áá°ááá±á០Operating System ááœá±áá²á· Kernel File ááœá±ááŸááá²á·
Drive Location ááᯠááŸá¬áá±ážááŒá®áž User ááŒáá¯ááºáá²á· OS ááᯠboot ááá¯ááºá¡á±á¬ááºááŒáá±ážááá«áááºá áá°á Physical Memory ááá¯áá²
Map áá¯ááºáá±ážáááŒá®áž Virtual Memory address ááœá±ááŒááºáá¯ááºáá±ážááá«áááºá user ááŒáá¯ááºáá²á· Os ááá¯ááœá±ážááŒá®áž ááœá¬ážááŒá®ááá¯ááẠá¡á²á· OS
áá²á·ááá¯ááºáá²á· Kernel code file ááᯠMemory áá²ááŸá¬ run áá±ážááŒá®áž Map áá¯ááºáá¬ážáá²á· Memory ááœá±ááᯠcontrol
áá¯ááºááá¯á·áá±ážááá¯ááºááá«áááºá bootloader code ááᯠááŒááºá·áá»ááºááẠáá»áœááºáá±á¬á· #link("https://github.com/Walker-00/chaos/tree/rust/bootloader")[Github Repo] ááŸá¬
ááŒááºá·ááŒááºá·ááá¯á·ááá«áááºá
== Operating System (OS)
ááááá¯á¶ážá¡áá±áá²á·ááá±á¬á· OS ááá¯áᬠOperating System áá« Online Shop ááá¯ááºáá«áá°ážá áá°á BIOS áááœá²ááá¯á· System
Software ááœá±á¡áá¯ááºáá¯á¶áž á
á¯áá±á«ááºážááŒá®áž User Software ááœá±á¡ááœáẠSyscall ááᯠApi ááœá±ááŒááºáá¯ááºáá±ážááá¯á·ááá¯áá²á· á¡áá¬ááœá±á¡áá¯ááº
áá±á«ááºážááŒá®áž OS ááá¯á·áá±á«áºáá«áááºá áá°á·ááŸá¬ á¡ááááá«áá¬ááá±á¬á· Kernel, Kernel Driver ááœá± Kernel Modules ááœá±
Bootloader ááá¯á·áá«áá«áááºá OS ááœá±á¡áá»á¬ážááŒá®ážááŸááá«áááºá ááá¯ááºááá¯ááºáá¯ááºáá»ááºáááºáá±á¬ááºá¡áááºážááŒá®ážááááºáá²áá¯ááºááá«áááºá áá»áœááºáá±á¬áº áá®áá²ááŸá¬
áá
áºáá¯áá±ážááŒááá¯á·áááºážááŸááá«áááºá áá±á¬áẠedition áá»áááºáá±á«á·á á¡á²á·áá²áá០áá¬áááºááŒá®ážáá²á· áá
áºáá»áá¯á· OS ááœá±á Windows, Mac,
Gnu/Linux, BSD, RTOS ááá¯á·ááá¯áá±á¬ááºáá»áá¯ážááœá±áá«á User Software ááœá±á Os áá
áºáá¯áá²á· áá
áºáá¯ááŸá¬ ááœá²áá«áááºá Windows
User Software (.exe file, ex. Discord.exe Windows file) ááœá±ááᯠGnu/Linux ááá¯á· Mac ááá¯á·ááŸá¬
Native run áááá«áá°ážá áá¬ááá¯á·áá²ááá¯áá±á¬á· Os áá
áºáá¯áá²á·áá
áºáᯠHardware ááœá± Handle áá¯ááºáá¯á¶ááŒááºáž Program File
Header ááœá± Syscall Api ááœá±áá¯ááºáá±ážáá¯á¶ááŒááºážááá°ááá¯á·áá«á ááŸááºážááŸááºážááŒá±á¬áááẠOS áá
áºáá¯áá²á· áá
áºáᯠá¡áá¯ááºáá¯á¶ážááá¯ááá¯ááœá²áá«áááºá
á¡áááºáž Simple ááŒá
áºáá²á· á
á¬áá² áá¯ááºááŒáá±ážáá²á· OS áá±ážááᯠRust áá²á· áá±ážáááºáž ááŒááºá·áá»ááºááẠáá»áœááºáá±á¬á·áá²á· #link("https://github.com/Walker-00/chaos")[ChaOS]
ááá¯áá²á· OS áá±ážááᯠááŒááºá·ááŒááºá·ááá¯á·ááá«áááºá
== Kernel
Kernel ááá¯áá¬ááá±á¬á· Software áá²á· CPU ááá±á¬áá«áá² áá°ááá«áá² ááẠprogram á០run ááá¯á·áááá°ážááá¯á·ááá¯ááŒá±á¬ááá«áááºá
áá¬ááá¯á·áá²ááá¯áá±á¬á· áá°ááá±á០Hardware ááœá±ááᯠSoftware ááœá±áá¯á¶ážááá¯á·áá¡á±á¬áẠMap áá¯ááºááŒá®áž API ááœá±ááŒáẠáá±ážááá¬áá«á ááá¯ááºááá¯áẠááá¯áá²á·
Hardware Driver ááœá± Memory Map áá¯ááºáá¬ááœá±ááᯠááá¯ááºáááºáááºáá±á¬á· Kernel ááá«áá² áᬠSoftware ááŸáá±ážáááá«áá°ážá
áá°á ááááá¯á¶áž áá¬ááŸááá¯ááºááẠDevice ááœá±ááᯠá
á
áºááŒá®áž ááá¯á¡ááºáá²á· Device Driver ááœá± Kernel Modules ááœá±ááá¯
á
áááºáá±ážáá«áááºá á¥ááᬠDisplay á¡ááœáẠVGA Driver ááá¯á· GPU Driver ááá¯á·áá²á· Binder Modules ááá¯á·ááá¯áá«á áá«ááœá±ááá¯
á
áá±ážááŒá®ážááŒá®ážááá¯áááºáá±á¬á· áá°á Systemd ááá¯á· Openrc ááá¯á·ááᯠInit process ááá¯á
áááºáá±ážáá«áááºá áá°á áá¬áá¯ááºáá±ážááá¬áá²ááá¯áá±á¬á·
á¡áá»á¬ážááŒá®ážáá«áá² User Config áá¯ááºáá¬ážáá²á· Background process ááá¯á·áá²á· ááá¯á¡ááºáá²á· Wifi ááá¯á· Bluetooth ááá¯á·ááá¯
Service ááœá±ááᯠá
áááºáá±áž ááá«áááºá á¡á²á·áá«á¡ááŒáẠááá°áá²á· File System ááœá±ááá¯á· Disk ááá¯á·ááᯠáá¯á¶ážááá¯áá¡á±á¬ááºáá¯ááºáá±ážááá«áááºá
áá±á¬ááºááŒá®áž User Login áááºáá¬ááá¯á·ááá¯áááºáž Handle áá¯ááºáá±ážááá«áááºá á¡ááŸááºážáá¯á¶ážááŸááºáá¬ážááááºáá±á¬á· Init System ááœá±á
Kernel á ááá¯áá²á· Driver ááœá± Module ááœá±á
áááºáá±ážááŒá®ážááẠáá»ááºáá²á· á
áá±ážááá¯á· ááá¯á¡ááºáá²á·áá¬ááœá±ááᯠá
áá±ážáá²á·áá¬ááá¯á·ááŸááºáá¬ážááá¯á·ááá«áááºá
Kernel áá²á· á¡áá¯ááºáá¡á²á·ááŸá¬áááºááŒá®áž ááœá¬ážáá¬ááá¯ááºáá² á¡áá»á¬ážááŒá®ážáá»ááºáá«áá±ážáááºá áá°á áá»áœááºáá±á¬áºááá¯á· User Software ááœá± Hardware
ááá¯áá¯á¶ážááá¯á· Api ááœá±ááŒááºáá¯ááºáá±ážááá«áááºá á¡á²á· Program run ááá¯ááºáá²á·á¡áá»áááºááŸá¬áá² áá°áá²á· Header á ááŸááºáá²á·áá¬áž ááẠSyscall
ááœá±áá¯á¶ážáá¬ážáá²á ááẠSyscall ááᯠááẠDriver ááá¯áá¯á¶ážáááŸá¬áá²á Thread ááœá±áááºáá¯ááºáá±ážáááá¬áž áá® Data ááœá±ááᯠááẠMemory
Address ááŸá¬ ááœá¬ážááááºážáá±ážáááá² áá®ááᯠá¡á±á¬ááºááŒá±ááááºáž á¡áá¯ááºááœá±á¡áá¯áẠáá°ááŸá¬áá¬áááºááŸááá«áááºá Kernel ááŸá¬ Monolithic
Kernel, MicroKernel áá²á· áá
áºááŒá¬ážá¡áá»áá¯ážá¡á
á¬ážááœá±ááŸááá«áá±ážáááºá áá°ááá¯á·á¡áá±á«áºáá°áááºááŒá®áž Kernel á áááºáá±áá¬ááŸá¬áá±á¬ááºážáááºá
áááºááᯠhandle áá¯ááºáááºá áá«ááœá±ááœá²áá«áá±ážáááºá á¡á²á·áá®ááᯠá¡áá±ážá
áááºááœá±ááá¯áá±á¬á· áá±á¬áẠedition ááŸá¬áááºá·áá±ážáá«áááºá á¡áááºáž Simple
ááŒá
áºáá²á· Rust áá²á· áá±ážáá¬ážáá²á· Kernel áá²á· VGA Device Driver ááᯠáá»áœááºáá±á¬á·áá²á· #link("https://github.com/Walker-00/chaos/tree/rust/src")[Github Repo] ááŸá¬
ááŒááºá·ááŒááºá·ááá¯á·ááá«áááºá
== Device Driver
Device Driver ááá¯á·áá²áá±á«áºáá²á· Kernel Driver ááœá±ááᯠKernel á Hardware ááœá±ááᯠhandle áá¯ááºááá¯á· á¡ááœááºáá¯á¶ážáá«áááºá
áá°ááá¯á·ááœá±á Kernel á¡áá±á«áºáá°áááºááŒá®áž áá«áá²á·áá¯á¶áá²á· áá¯ááºáá±á¬ááºáá¯á¶ááœá±ááœá¬áá«áááºá á¥ááᬠLinux ááá¯á·ááᯠMonolithic Kernel
áá»áá¯ážááŸá¬ááá¯ááẠKernel Driver ááœá±á Kernel code áá²ááŸá¬ Kernel áá²ááŸá¬ áá
áºáá«áááºážáá«ááŒá®ážáá¬ážáá« manual áá²
install ááá¯á·ááá«ááẠá áá«á·á¡ááœááºááŒá±á¬ááºá· Linux áá¡áááºážááŒááºáá«áááºá áá«áá±áá²á· Windows ááá¯á·ááᯠMicroKernel ááœá±ááŸá¬áá±á¬á·
áá
áºáá«áááºážááá«áá² ááá¯ááºááá¯áẠinstall ááá«áááºá áá°ááá¯á·ááœá±á Kernel ááŒá®ážááẠá¡áááºážá¡áá±ážáá«áá²á· System Software
ááœá±ááŒá
áºáá«áááºá áá°ááá¯á·ááá«ááẠááẠHardware ááá¯á០áá¯á¶ážááá¯á·áááŸá¬ááá¯ááºáá«áá°ážá áá
áºáá«áá
áºáá±ááŸá¬ ááá¯áẠGraphic card
ááŒá±á¬ááºážááá¯ááºáá¬ááá¯á· ááá¯ááºá· Pc áá²ááá± áá
áºáá¯áá¯ááŒá±á¬ááºážááá¯ááºáá¬ááá¯á·ááá¯ááẠWindows ááŸá¬áá»ááºáá»ááºážáá¯á¶ážáááá² Linux ááŸá¬áá»
ááá±áá¬ááœá±ááŸááá«ááááºá·áááºá á¡á²á·áᬠáá°ááá¯á· ááá°áá²á· Kernel ááŸá
áºáᯠááŒá±á¬ááºá·áá« á
á±á¬ááááŒá±á¬áááᯠWindows ááŸá¬ Device áá
áºáá¯áá¯ááŒá±á¬ááºážááá¯ááºááá¯á·
ááááẠá¡á²á·áᬠDriver áááŸáááá¯á·áá«á Linux ááŸá¬áá» ááá¯áá²á· Driver ááœá±á¡áá¯ááºáá«ááŒá®áž áá¬ážááá¯áá±á¬á· áá»ááºáá»ááºážááá«áááºá FOSS
(Free And Open Source Software) ááá¯ááºáá²á· Driver áá
áºáá»áá¯á·áá±á¬ááºááá¯áᬠááá¯ááºááá¯ááºááœááºážáááºááœááºážáááŸá¬áá«á
== Shell
Shell ááᯠáá¬ááá±á¬á· User Software áá²á· System Software ááŸá
áºáá¯ááŒá¬ážááŸááŸááá²á·áá±á¬ááºááá¯á·ááŒá±á¬ááá¯á·ááá«áááºá á¥ááá¬ááŒá±á¬ááááº
Bios ááá¯áá«áá²á áá°á Os ááᯠUser ááœá±áá¯á¶ážááá¯á·áá¡á±á¬áẠCLI (Command Line Interface) ááá¯á·ááá¯áá»áá¯ážáá²á· program run
áá¬ááœá± program ááœá±ááᯠScript áá¯ááºááŒá®áž run áá¬ááœá±áá®ááá¯áá»áá¯ážááœá±ááᯠáá¯ááºáá±á¬ááºáá±ážáá«áááºá áá°á User Software áá
áºáá¯áá«áá²
áá«áá±áá²á· áá°á áá
áºááŒá¬áž User Software ááœá±ááᯠOs áá²á· áá»áááºáááºááŒá®áž á¡áá¯ááºáá¯ááºáá±ážááá¯á· Layer ááá±á¬áá»áá¯ážáá¬ážáá±ážáá¬ážáá¬áá«á
á¡á²á·áá®á¡ááœáẠáá°ááŸá¬ I/O pipeline ááœá± Program run áá¬ááœá± File Manage áá¯ááºáá¬ááœá±á¡ááœáẠBuild-In Command
ááœá±áá«áá«áááºá á¡áá¯áá±áẠModern Shell ááœá±ááŸá¬ ááá¯ááẠáá°ááá¯á·áá²á· áá»áááºáááºááá¯á· Customize áá¯ááºááá¯á· plugin ááœá±áá«áááºá·ááá¯á·ááá²á·á¡ááŒááº
Scripting Language á¡áá±áá²á·áá«áá¯á¶ážááá¯á·ááá«áááºá Scripting áá²á· Programming Language ááœá¬áá¬á
Programming á áá°á·áá²á· Library ááœá±ááá¯áá¯á¶ážáá±áá²á· Scripting á áá
áºááŒá¬áž Program ááœá±ááᯠLibrary
ááá±á¬áá»áá¯ážáá¯á¶ážáá«áááºá Shell ááœá±á¡áá»á¬ážááŒá®áž ááŸááá«áááºá Linux áá²á· Mac ááá¯á·ááᯠUnix base Os ááœá±ááŸá¬ááá¯ááẠBash Shell
ááᯠDefault á¡áá±áá²á· áá«áá¬áááºáá«áááºá Windows ááŸá¬ ááᯠPoweshell ááá¯á· Ms-Dos ááá¯á·ááŸááá«áááºá áá«á·á¡ááŒáẠLinux ááá¯á·ááá¯
unix base ááœá±á¡ááœáẠnushell, zsh, fish ááá¯ááŒá®áž á¡áá»á¬ážááŒá®ážááŸááá«áá±ážáááºá
#pagebreak()
#align(center, [= User Software áá»á¬ážá¡ááŒá±á¬ááºáž])
== ááááºáááº
User Software ááá¯áá¬ááá±á¬á· áá»áœááºáá±á¬áºááá¯á· áá±á·á
á¥áºáá¯á¶ážáá±áá²á· Facebook ááá¯á· Discord ááá¯á·ááᯠSoftware ááœá±ááᯠááŒá±á¬áá¬áá«á áá®áá²á
á¡áá»á¬ážá
á¯á Os ááᯠááááºáá»á¯ááºáá±ážáᬠOs ááá±ážáá²á· Api ááœá±ááᯠProgramming Language áá¯á¶ážááŒá®áž áá±ážáá¬ážáá²á· Program
ááœá±áá«áá«áááºá `Hello World` Program áá±ážáá
ááá¯á· Telegram ááá¯á· Youtube ááœá±áá á¡áá«á¡ááẠUser Software
ááœá± Billion áá²á· áá»á®ááŒá®áž ááŸááá«áááºá áá®áá²ááŸá¬ Facebook ááá¯á·ááᯠYoutube ááá¯á·ááá¯áá±á¬ááºááœá±áá«ááŸá¬ááŸááºáž á¡áá»á¬ážá
á¯ááááŒáá«áááºá áá«áá±áá²á·
á¡áá»á¬ážá
á¯ááááá²á· Os ááᯠááááºážáá»á¯ááºáá±ážáá²á· Os á Api ááœá±ááᯠáá¯á¶ážááŒá®áž áá
áºááŒá¬áž User Software ááœá±ááá¯ááŒá®áž ááœááºááœááºáá°áá°áá¯á¶ážáá¡á±á¬ááº
áááºááŒá®áž Api áá¯ááºáá±ážáá²á· System Level User Software ááœá±ááá¯áá² ááŒá±á¬áá±ážááœá¬ážáá«áááºá
== Display Server
áá»áœááºáá±á¬áºááá¯á· áá¬áá¬áẠcomputer áá¯á¶ážáá²á· áá°ááœá± computer ááœááºá·ááá¯ááºááẠáá»áœááºáá±á¬áºááá¯á· Mouse ááœá±ááá¯ááºááŒá®áž áá¯á¶ážááá¯á·ááá²á· Firefox ááá¯á·ááá¯
Application Window ááœá±áá±á«áºáá¬ááá¯á·á¡ááœáẠGraphical User Interface ááá¯á·áá±á«áºáá²á· GUI ááá¯ááœá±á·áááŸá¬áá«á áá«áá±áá²á· áá°á
ááá¯ážááŸááºážááá±áá«áá°áž áá»áœááºáá±á¬áºááá¯á· Gui ááœá±ááá±á«áºááẠCli ááá¯áá²á· Command Line Interface ááá¯á·áá±á«áºáá²á· Shell Command ááœá±
áá¯á¶ážááá¯á·áá²ááá²á·áá¬áá« áá°á·ááŸá¬ áᬠGraphic ááŸááá«áá«áá°ážá áá«áá±áá²á· áá±á¬ááºááá¯ááºážááŸá¬áá±á¬á· Display Server ááœá±áá±á«áºáá¬áá«áááºá
áá°ááá¯á·á áá¬áá¯ááºáá±ážáá¬áá²ááá¯áá±á¬á· áá® Computer Screen ááá¯á· Monitor, Keyboard áá²á· Mouse ááá¯á·ááᯠáá±á¬ááºááœá±áá²á· á¡ááŒá±á¬ááºážá¡áá²ááá¯
áá°ááŒá®áž áá¬ááœá±ááŒá±á¬ááºážáá²ááœá¬ážááẠMouse ááá¯áááºáá² User áááẠposition ááŸá¬ áá¬áá¯ááºááá¯ááºááẠááá¯áá¬ááᯠProgram áá¯ááºááŒá®áž
áá¯ááºáá»ááºáá¬áá¯ááºááá¯á· Api ááŒááºáá¯ááºáá±ážááá²á·áá±á¬ááºááœá±áá« á¡á²á·áá® Api ááœá±ááᯠProgramming Language áá
áºáá¯áá²á·áá¯á¶ážááŒá®áž Window
Manager ááá¯á·áá±á«áºáá²á· áá»áœááºáá±á¬áºááá¯á· áááºááŸááá¯á¶ážáá±áá²á· GUI ááŒá®áž ááᯠááŒá
áºáá¬á¡á±á¬áẠáá±á¬ááºáá¶á·áá±ážááá«áááºá áá°á·ááŸá¬ááá¯ááẠXorg ááá¯á· Wayland
ááá¯á·ááá¯ááŒá®ážá¡áá»áá¯ážáá»áá¯ážááŸááá«áááºá Windows ááŸá¬ááá¯áááºáá±á¬á· WDDM (Windows Display Driver Model) ááá¯áá¯á¶ážáá«áááºá
== Window Manager and Desktop Environment
á
á±á¬ááááŒá±á¬áá²á·áááá¯áá«áá² Window Manager ááá¯áᬠDisplay Server á ááŒááºáá¯ááºáá±ážáá²á· Api ááœá±ááᯠáá¯á¶ážááŒá®áž Developer
á
áááºááá¯ááºážáá» Developer ááŒáá¯ááºáá²á· Design philosophy á¡ááá¯ááºáž áá
áºááŒá¬áž User Software ááœá±áá²á· window ááœá±ááá¯
Keyboard áá²á· Mouse áááŒá
áºááœá¬ážáá²á· Event ááœá±á¡ááá¯ááºáž handle áá¯ááºáá±ážááá¬áá«á á¥ááá¬ááá¯ááẠApplication
Window á¡áá±ážá¡áá»áẠáá»á¯á¶á·áá»á²á· áá¯ááºáá¬ááá¯á· Layout Style áá»áááºážáá¬ááá¯á· á
á¬ááá¯ááºáá¬ááá¯á· áá²á·áá
áºááŒá¬ážáá¬ááœá±á¡áá»á¬ážááŒá®ážáá«á áá°ááá¯á·ááœá±á áááºáž
á¡áá»á¬ážááŒá®ážááŸááá«áááºá Kde ááŸá¬ááᯠKwin, Xfce áá²á· Xfwm, Xorg ááŸá¬ááá¯ááẠi3, bspwm, dwm áá²á· Wayland á¡ááœááºááá¯
Hyprland ááá¯á· river ááá¯á·ááᯠáá»áá¯'á¡áá»á¬ážááŒá®áž ááŸááá«áááºá window manager ááœá±á áá±á«á·áá«ážáááºá Customizable
á¡áááºážááŒá
áºáá¬ááŒá±á¬ááºá· #link("https://reddit.com/r/unixporn")[Linux Customization] á¡ááœááº
áá¬áááºááŒá®ážáá«áááºá Desktop Environment ááá¯áá¬ááá±á¬á· Window Manager ááá¯á០additional User
Software ááœá±ááœá²ááŒá®ážáá«áá¬ááá¯ááŒá±á¬áá¬áá«á á¥ááá¬ááá¯ááẠWindow Manager ááŸá¬ Setting App ááá¯á· áá¬ááá¯á·ááá«áá«áá°ážá
ááá¯ááºááá¯áẠConfig File áá²ááá± áááºááŒááºáá¬ááá¯á·ááá¯áá»áá¯ážáá¯ááºááá«áááºá áá«áá±áá²á· Desktop Environment ááŸá¬áá»
á¡á²á·ááá¯áá»áá¯ážááœá±áá
áºáá«áááºážáá«áá²á·á¡ááŒáẠMovie ááŒááºá·áá²á· App áá®áá»ááºážáá¬ážáá±á¬ááºáá²á· App áá«ááœá±á¡áá¯áẠáá«áá¬áá«áááºá á¡á²á·áá®á¡ááœááºááŒá±á¬ááºá· áá¬áá¬ááº
user ááœá±á¡ááœááºáá±á¬ááºážáá±áá²á·á á
ááºááááºá·ááá±á¬ááºážáá²á·áá°ááœá± á¡áááºážáá»á¬ážáá¬áááá¯áá»ááºáá² minimal áá²ááŒáá¯áẠáá²á·áá°ááœá±á¡ááœááºáá» áááá¯áá¬ááœá±á¡áá»á¬ážááŒá®áž
áá«áá²á·á¡ááœáẠá¡áááºáž bloat ááŒá
áºáá«áááºáá Desktop Environment ááœá±áááºáž á¡áá»á¬ážááŒá®áž ááŸááá«áááºá Kde ááá¯á· Gnome ááá¯á·
Xfce ááá¯á·ááá¯áá«á Simple ááŒá
áºáá²á· Window Manager ááᯠrust ááŸá¬ áááºááá¯áá±ážááá²ááá¯áá¬ááᯠáá»áœááºáá±á¬á·áá²á· #link(
"https://github.com/Walker-00/sswm",
)[SSWM (Saffron Spring Window Manager)] Github Repo áá±ážááŸá¬ áááºááŒááºá·ááá¯á·ááá«áááºá
#pagebreak()
#align(center, [= áá
áºááŒá¬áž Computer Science áá²á· áááºáááºáá²á· á¡ááŒá±á¬ááºážá¡áá¬áá»á¬áž])
== Networking á¡ááŒá±á¬ááºáž
Computer ááœá±ááááºáž áá°ááœá±ááá¯áá«áá² áá°ááœá± áá
áºáá±á¬ááºáá²á· áá
áºáá±á¬áẠá
áá¬ážááŒá±á¬ á¡ááœá²á·á¡á
ááºážááœá²á·áጠá¡ááááá¬ááœá± áá»áŸáá±ááŒáááá¯áá²á
Computer ááœá±ááááºáž áá°ááá¯á·á¡áá»ááºážáá»ááºáž áá»áááºáááºááŒá®áž á¡áá¯á¶ážááŒá¯áá°ááá¯áá»ááºáá²á· á¡áá»ááºá¡áááºááœá± ááŸá¬áᬠááœá±áá¯ááºáá±á¬ááºáá±ážááá«áááºá
áá®áá±áá¬ááŸá¬ Networking ááá¯ááááá¯á·ááá¯áá¬áá«áááºá ááá¯ááºááœá± áá
áºáá±á¬ááºáá²á· áá
áºáá±á¬áẠá
áá¬ážááŒá±á¬ááá¯á· á¡áá¯ááºá¡ááá¯áẠá¡ááœááºá¡áááºážááœá±ááá»ááºááá¯á·
áá¬áá¬á
áá¬ážááœá± áááºáááá¯áá«áá² Computer Networking ááᯠáá±áá»á¬áá¬ážáááºáá¬ážáá¬ááááºáž Internet á¡áá¯ááºáá¯ááºáá¯á¶áá²á· Computer
ááœá± áááºááᯠáá»áááºáááºááŒá®áž áááºááá¯ááœá±á¡áá¯ááºáá¯ááºááŒááá² ááá¯áá¬ááᯠáá¬ážáááºáá¬á
á±áá²á·á¡ááŒáẠNetwork Engneering, System Admin áá²á·
Cyber Sce ááá¯á·ááᯠáá
á¬áá±á¬ááºážáá²á· á¡áá¯ááºááœááºáá² áááºááá¯á· Foundation áááºáž ááá¬á
á±áá«áááºá
=== Computer áá²á· Networking ááá¯áá¬áá¬áá²
áá°á¡áá»á¬ážá
á¯á Networking ááᯠInternet áá«ááŸááá¯áẠWWW ( World Wide Web ) áá²á· á¡áááºááŸá¬ážáááºááŒáá«áááºá
áá
áºáááºáá±á¬á· ááá°áá«áá°áž Networking ááá¯áᬠInternet áá²á· WWW ááá¯á·ááᯠáááºážááá¬ááœá± ááŒá
áºáá±á«áºá¡á±á¬áẠáá¶á·ááá¯ážáá±ážáá¬ážáá²á· á¡ááá áá±á¬ááºááá¯ááºááŒá®ážáá«á
ááá°áá®áá²á· Networking á
áá
áºááœá± á¥ááᬠTCP, UDP á
áá²á· áááºážááá¬ááœá± á¡áá±á«áºááŸá¬ áá°áááºááŒá®áž Internet áá²á· WWW ááá¯á·áááŒá
áºáá±á«áºáá¬ááá¬áá«á
Networking ááŸá¬áá±á¬á· ááá°áá®áá²á· Networks ááœá±ááŸááááºá Network á¡ááá¯áẠááá°áá®áá²á· áá¯ááºáá±á¬ááºááŸá¯ááœá±áá¯ááºáá±á¬ááºááá¯á·ááááºá
á¡áá»ááºá¡áááºááœá± ááá¯á·ááá¯á· ááá°áá®áá²á· á¡áá»ááºá¡áááºááá¯á·áá²á· Protocol ááœá±ááŸááááºá Protocol á¡ááá¯áẠááá°áá®áá²á· á¡á¬ážáá¬áá»ááºá¡á¬ážáááºážáá»áẠáá¯ááºáá±á¬ááºááá¯á·ááá¬ááœá±ááŸááááºá
áá°ááá¯á·á¡áá»ááºážáá»ááºáž á
áá¬ážááŒá±á¬ááá¯á· áááºáá°áááŒá±á¬áá±áááºááá¯áᬠááááá¯á· ááá°áá®áá²á· IP ááœá±ááŸááááºá Networking áá¯ááºáá²á· á¡áá« á¡áááºážáááºáá¬ááŒá®ááá¯á· áááºáá¬áááº
áááºážá
á¬á
ᬠááá¯á·áá¬áá²á· ááŸáá¯ááºážááŸá¥áºááŒá®ážááœá±ážááŒááºá·áá« áá»áœááºáá±á¬áºáááºáž áá
áºáá»áá¯á· áááºáááºáááºááá²á· áá±áá¬ááœá±ááŸá¬ ááŸá¥áºááŒá®áž ááŒá±á¬ááŒáá±ážáá«áááºá
=== Networks ááœá± Network Interface ááœá± Protocol ááœá± IP ááœá±á áá¬ááœá±áá²
Computer Network ááá¯áá¬ááá±á¬á· áá
áºáá¯áááºááá¯áá²á· Computer ááœá±áá»áááºáááºáá¬ážáá¬ááᯠáá±á«áºáá¬áá«á á¥ááá¬ááá¯ááẠWifi/Router á
ááºáá²á· áá»áááºáááºáá¬ážáá¬ááá¯á· áá«á
áá±áá¬áá²á·ááá¯ááºááŒá®áž Network áá²á· áá¬áááºáá²á· á¡áá¯á¶ážááŒá¯áá¯á¶ááœá±ááááºáž ááœá¬ááá¯ááºáá«áááºá á¥ááᬠHome Network ááá¯ááẠá¡áááºááŸá¬ááŸááá²á· Computer á¡áá»ááºážáá»ááºáž File Share áá¬ááá¯á·
áá¬ááá¯á·áá¯ááºááŒááẠSchool Network ááá¯ááẠáá»á±á¬ááºážáá²á·ááá¯ááºáᬠáá¬áá¬áá±á«á· áá¬ážááááºáá±ážááẠáá°ááœá±áá²á· Network áá²á·ááŸááºážááŒááºá·ááá¯á·ááá«áááºá á¥ááᬠá¡áááºá áááá¬ážá
á¯áá²á·ááá¯áááº
áá±áá»ááºáááá¯áá± ááŒá±á¬áá»ááºáá¬ááŒá±á¬áá¯ááºáááºá áá»á±á¬ááºážááŸá¬ááá¯ááẠáá»á±á¬ááºážá áá°ááœá±áá²á· á
á¬á¡ááŒá±á¬ááºáž áá¬áᬠááááá¯áá±á«á·á
Internet ááá¯áá¬ááá±á¬á· Inter Network áá²á·á¡ááá¯áá±á¬ááºáá« áá°á Network ááœá±á¡áá»á¬ážááŒá®ážá
á¯á
á®ážáá¬ážáá²á· Network áá
áºáá¯áá«áá² á¥ááᬠSchool Network áá²á· Home Network
áá»áááºáááºááŒá®áž School Network ááá± Home Network ááᯠá
á¬ááœá±ááá¯á·áᬠáá¬áá¬ááá±á¬áá»áá¯ážáá«á
Network Interface ááá¯áá¬ááá±á¬á· Network áá
áºáá¯ááᯠComputer á áááºááá¯áá»áááºáááºáá¬ážáá¬áá² ááá¯áá¬ááá¯áá±á«áºáá¬áá«á á¥ááᬠá¡áááºáá
áºá¡ááẠáá²á· áá±á¬ááºáá
áºá¡áááº
áááºááá¯áá»áááºáááºáá¬ážáá¬áá¬áž áá
áºááá¯ááºáá¶áá²á· áá
áºááá¯ááºáᶠáááºááá¯áá»áááºáááºáá¬ážáá¬áá² áá¯ááºážáááºáž/áá±áááºáž áá®ááá¯áá»áá¯ážááœá±áá« áá»áááºáááºáá¬ážáá²á· áá¯á¶á
á¶á¡áá±á«áºáá°áááºááŒá®áž ááá¯á·áá±á¬ááºáááºááœááºááá¯á·áááºážááœá±
áá±á¬ááºážáá¬ááá¯ážáá¬ááœá±áááºážááœá¬ááŸá¬áá±á«á·á
Protocol ááá¯áá¬ááá±á¬á· Computer áá
áºáá¯á¶ážáá²á·áá
áºáá¯á¶áž Network á¡ááœááºáž áááºááá¯áááºážáá²á· á¡áá»ááºá¡áááºááœá± ááá¯á·áá±ážááá²ááá¯áá¬ááᯠáá±á«áºáá¬áá«á á¥ááᬠáááºážá
á¬ážá
ᬠáá±ážáááºáá¬ážáá«áá±á¬á·
áá°á·á
á®ááᯠá
á¬áá±á¬ááºááá¯á·á ááŒááºááẠá¡áá¯ááºá¡áá»áááºáá¬ááẠáá«áá±áá²á· áá«ážáá»áá¶áááá¯ááºáááºá Messenger ááá¯á·áá¬ááá¯á·áááá¯á·áááºáá±á¬á· ááŒááºááẠáááºážáááºáž ááá¯ááºáá¶áá¯ááºááẠ(áá±áá¬ááá¯áž) áá«áá±áá²á·
Friend ááŒá
áºááá¯á· acc ááááá¯á·áá¬áá¬ááá¯áááºá á
á¬ááá¯ááºá ááá¯á·áááºáá» ááŒá¬ááẠá¡áááºááááºá
á¬ááááá¯á·ááá¯ááẠááá¯ááºáá¶áá¯ááºááẠáá«áá±áá²á· á¡ááŒá²ááá¯ááᯠááá¯á·ááááºá áá®áá±á¬ááºááá¯ááẠáá¬ážáááºáá±á¬ááºááŸá¬áá«á (áá¬ážááááºáááºáž á¡á±á¬ááºáá±á¬ááºááŸáááºáááº)
IP Address ( Internet Protocol Address ) ááá¯áá¬ááá±á¬á· á
á±á¬áá á¥ááá¬áá²á á¡áááºááááºá
á¬ááá¯á· Messenger Acc ááá¯á·ááá¯áá«áá² Computer áá
áºáá¯áá²á· áá
áºáᯠá¡áá»ááºá¡áááºááá¯á·ááá¯á·ááá¯áááº
áá°á·áá²á· áááºáá±áá¬ááᯠááááŸáááŸá¬áá« áá«ááŒá±á¬ááºá· Computer áá
áºáá¯á¶ážáá²á· ááááºá
á¬ááᯠIP Address ááá¯á·áá±á«áºááŒáá«áááºá
=== Network Interface áá²á Wired Networks áá²á· Wireless Networks ááœá±á¡ááŒá±á¬ááºáž
Network Interfaces ááœá±ááŸá¬áááºáž Wired áá²á· Wireless ááá¯ááŒá®áž ááŒááºááœá²áá«áá±ážáááºá á¥ááᬠRouter á
áẠáá«ááŸááá¯áẠá¡áá»á¬ážá
á¯ááááŒáá²á· Wi-Fi ( áá
áºáá²á· á¡áá±á«áºá¡áá±á«áºá¡ááŸááºá Router áá±á¬áº ) á
ááºááá±
Computer ááœá±ááᯠInternet áá»áááºááẠEthernet ááá¯áá²á· Wired Network áá²á· Wi-Fi ( Wireless Fidelity ) ááá¯á·áá±á«áºáá²á· Wireless Network ááá¯ááŒá®áž ááŸá
áºáá»áá¯ážááŸááá«áááºá
ááŸá
áºáá»áá¯ážáá¯á¶ážááŸá¬áá±á¬á· áá°ááá¯á· á¡á¬ážáá¬áá»ááºáá²á· á¡á¬ážáááºážáá»áẠááá¯ááºá
á®ááŸááá«áááºá Wired Network ááœá±áá²á· á¡á¬ážáá¬áá»ááºááá±á¬á· Wireless Network ááœá±ááẠááá¯ááŒááºááŒáẠdata ááœá±ááá¯á·áá±ážááá¯ááºáááºá
Wireless Network ááœá±áá±á¬ááºá¡áá¯ááºááááºá· áááŸá¯ááºáá°áž áá«áᬠááŒáá¯ážááá±áá»áááºááŒá®áž á¡áá»ááºá¡ááẠááœá±ááᯠááá¯ááºááá¯ááºáá±ážáá¬ááá¯áá±á¬á·ááœá¬ áá
áºáá¯áᯠáááºááŸá±á¬ááºááŸááºááá¯á· ááŸá±ážááœá¬ážáá¬ááá¯á· áá¬ááá¯á· áááŒá
áºáá°ážá
áá«áá±áá²á· á
á±á¬ááááŒá±á¬áá²á·á¡ááá¯ááºáž áá«áá¬ááŒáá¯ážááá± áá¯ááºááá¬ááŒá
áºáá²á·á¡ááœááºááœá¬ áá»áááºááá¯ááºáá²á· á¡ááœá¬á¡áá±ážááá» ááŒáá¯ážá¡áá±á«áºááŸá¬áá² áá°áááºááẠááá¯áá±ážáá±áž ááŸá¬áá±ááŒá®áž áá»áááºáá»ááºááẠááŒáá¯ážááŸááºááŸááºááá¯áá¬áá±á«á·á
áá«ááŒá±á¬ááºá· Wired Network ááœá±á Personal Use á¡ááŒá
áºáá¯á¶ážáá»áá¬áá²áá»á¬ážááẠá¥ááá¬ááᯠGamer ááœá±ááá¯á· Cloud Server ááœá±ááá¯á·ááá¯áááºáá» ááá¯ááºážáá»áá¬áá¬áᬠáááá¯áá»ááºáá°ážááœá¬
á¡á²á·áá¬ááŒá±á¬ááºá· Wired Network áá²á Ethernet ááá¯áá²á· áá±á¬ááºááá¯áá¯á¶ážáááºá Wired Network áá²á áá
áºáá»áá¯á·ááᯠááŒá±á¬ááááºáá±á¬á· á
á±á¬áá Ethernet áá«ááẠUSB ááá¯á· Thunderbolt ááá¯á·áá«áááºá
Wireless ááŸá¬ááá»áá±á¬á· áá°á ááŒáá¯ážááá±ááá¯ááºáá°áž áá±áá²ááá± áá±áá¯ááŒáááºááŸá¯ááºážááœá±ááá¯áá¯á¶ážááŒá®áž á¡áá»ááºá¡áááºááœá± ááá¯á·áá±ážáááºá áá«ááŒá±á¬ááºá· Wireless ááœá±ááŸá¬ááᯠá¡ááŒááºááŸá¯ááºážááᯠfrequency ááá¯á·áá±á«áºáá²á·
ááŒáááºááŸá¯ááºážáá²á·ááá¯ááºážáááºá ááŒáááºááŸá¯ááºážáá»á¬ážáá±áá± á¡áá»ááºá¡ááẠááá¯á·áá±ážáᬠááŒááºáá±áá±ááá¯áá±áá²á· áá°á·áá²á· á¡ááœá¬á¡áá±ážá Limit ááŸááá«ááẠLimit áá»á±á¬áºááœá¬ážáááºáá±á¬á· áá»áááºáááºááŸá¯á áááºáááºá·ááœá¬ážááŸá¬áá«á
Wireless áá²á·áá»áááºááŒá®áž á¡áá»ááºá¡áááºááá¯á·ááŒáá²á· Computer á¡áá»ááºážáá»ááºáž áá±ážááœá¬ááœá¬ážááŒááẠááŒá
áºááŒá
Ạáá°ááá¯á· ááŸá
áºáá¯ááŒá¬ážáá²ááŸá¬ áá¶áá¶ááá¯áá¬áá»áá¯ážá ááŒá¬ážáá¶áá±áááºáá²ááŒá
áºááŒá
ẠááŒáááºááŸá¯ááºážá ááŸá±ážááœá¬ážááá¯ááºáá«áááºá
áá®ááá¯áá«áá² áá°ááŸá
áºáá±á¬ááºáá»á
áºááŒááá¯á· áá±ážááœá¬ážáááºááŒá
áºááŒá
ẠááŒá¬ážáá°áá±á«áºáá¬áááºááŒá
áºááŒá
Ạá¡áá»á
áºááœá±áááºáž áá»áŸá±á¬á·ááœá¬ážááá¯ááºáá«áááºá
=== Ipv4 áá²á· Ipv6
#pagebreak()
== Multi Media
=== Computer áá²á· Multi Media ááá¯áá¬áá¬ááŒá±á¬áá¬áá²
=== Media File ááœá±áááºááá¯á¡áá¯ááºáá¯ááºááá²
#pagebreak()
== áááºážááá¬ááá¯ááºážááá¯ááºáᬠááá¯ááºáá±ážá¡áá»ááºá¡áááºáá±áœ áá²á· áááºážááᬠáá¯á¶ááŒá¯á¶áá±ážá¡ááŒá±á¬ááºáž
=== áááºážááá¬ááá¯ááºááá¯ááºáᬠááá¯ááºáá±ážá¡áá»ááºá¡áááºááá¯áá¬áá¬áá² á¡áá±ážááŒá®ážáá¬áž
=== áááºážááá¬áá¯á¶ááŒá¯á¶áá±áž á¡ááŒá±á¬ááºáž
#pagebreak()
#align([= Computer ááœá±ááᯠááá¯ááºááá¯áᬠááá¯ááºážá
á±áá»ááºáž (Programming)])
== Programming ááá¯áá¬áá¬áá²
== Programming Language ááœá±ááá¬ááœá±áá²
== Programming Language á¡áá»áá¯ážá¡á
á¬ážááœá±áá²á·á¡ááŒá¶áá±ážáá»ááºáá»á¬áž
#pagebreak()
== Python Programming
#link("https://www.youtube.com/watch?v=rfscVS0vtbw")[Python Programming áá±á·áá¬ááá¯á·á¡ááœáẠResource áá±ážáá«]
== C Programming
#link("https://youtube.com/playlist?list=PLBlnK6fEyqRhX6r2uhhlubuF5QextdCSM&si=dqSfUNwiJGSv7b6E")[C Programming áá±á·áá¬ááá¯á· Resource áá±ážáá«]
== Rust Programming
#link("https://drive.google.com/drive/folders/1I-w-_-UaXi3fESfANAxU0MG-mwdnyl50?usp=drive_link")[áá«ááá±á¬á· áá»áœááºáá±á¬á·áá²á· ááŒááºáá¬ááᯠRust Course áá±ážáá«]
#pagebreak()
#align(center, [= á
á¬á¡á¯ááºáá±áž ááá¯ááŒááºá·á
á¯á¶á¡á±á¬áẠááŒááºá·á
ááºážáá±ážááŒáá²á· Contributors áá»á¬áž])
\
\
\
- <NAME> [#link("https://facebook.com/walker.fbi")[Facebook Acc], #link("https://github.com/Walker-00")[Github Acc], #link("mailto:<EMAIL>")[Mail]]
|
Subsets and Splits