repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/comment/line-comment-attach.typ
typst
Apache License 2.0
#import "@preview/cheq:0.1.0": checklist #{ show: checklist.with(fill: luma(95%), stroke: blue, radius: .2em)// 复选框 } #{ show: checklist.with(fill: luma(95%), stroke: blue, radius: .2em)// 复选框 123 } #{ // 复选框 show: checklist.with(fill: luma(95%), stroke: blue, radius: .2em) }
https://github.com/SamK/typst-fonts-showcase
https://raw.githubusercontent.com/SamK/typst-fonts-showcase/master/fonts-latin.typ
typst
// vim: tabstop=2 softtabstop=2 shiftwidth=2 #import "template.typ": template #let pangram = [ #set block(above: 0.5em, below: 0.5em) #let pangram-text = "The quick brown fox jumps over the lazy dog" abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.:,;(\*!?'-"\_\\) àâä éèêë ïĩñ öõ - #pangram-text - #strong(pangram-text) - #emph(pangram-text) ] #template( [All the fonts], pangram )
https://github.com/dead-summer/math-notes
https://raw.githubusercontent.com/dead-summer/math-notes/main/templates/conf.typ
typst
#import "/templates/theorems1.1.2.typ": * // #import "@preview/ctheorems:1.1.2": * #import "@preview/codly:1.0.0": * // Theorem #let thm = thmbox( "theorem", "Theorem", fill: rgb("#eeffee"), base_level: 0 ) #let prp = thmbox( "proposition", "Proposition", stroke: 0.5pt, base_level: 0 ) #let cor = thmplain( "corollary", "Corollary", titlefmt: strong, bodyfmt: body => [ #text(style: "italic")[#body] ], base_level: 0 ) #let lem = thmbox( "lemma", "Lemma", stroke: 0.5pt, base_level: 0 ) #let def = thmbox( "definition", "Definition", // inset: (top: 1em), stroke: 0.5pt, base_level: 0 ) #let exm = thmplain( "example", "Example", titlefmt: strong, inset: (top: 0.8em, bottom: 1em), bodyfmt: body => [ #text(style: "italic")[#body] ], base: "heading", base_level: 0 ) #let prf = thmplain( "proof", "Proof", titlefmt: smallcaps, inset: (x: .5em, y: .5em), bodyfmt: body => [ #body #v(0.5pt) #h(1fr) $square$ // float a QED symbol to the right ] ).with(numbering: none) #let sln = thmplain( "solution", "Solution", titlefmt: smallcaps, inset: (x: .5em, y: .5em), ).with(numbering: none) #let rmk = thmplain( "remark", "Remark", titlefmt: strong, inset: (top: 0.8em, bottom: 1em), bodyfmt: body => [ #text(style: "italic")[#body] ], base_level: 0 ) #let exr = thmplain( "exercise", "Exercise", titlefmt: strong, inset: (top: 0.8em, bottom: 1em), bodyfmt: body => [ #text(style: "italic")[#body] ], base: "heading", base_level: 0 ) // 定义代码块格式 #let matlab_img = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\" width=\"64px\" height=\"64px\" baseProfile=\"basic\"><radialGradient id=\"Vfz-9abGZTJV8V0oFRkXja\" cx=\"-3526.01\" cy=\"1109.862\" r=\"30.775\" gradientTransform=\"matrix(-1 0 0 1 -3494.01 -1077.362)\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#afeeff\"/><stop offset=\".193\" stop-color=\"#bbf1ff\"/><stop offset=\".703\" stop-color=\"#d7f8ff\"/><stop offset=\"1\" stop-color=\"#e1faff\"/></radialGradient><path fill=\"url(#Vfz-9abGZTJV8V0oFRkXja)\" d=\"M0,40L0,40c0,2.761,2.239,5,5,5h3c2.761,0,5,2.238,5,5l0,0c0,2.762-2.238,5-5,5H7.435 C5.52,55,4,56.52,4,58.395V58.5C4,60.433,5.567,62,7.5,62h52c1.926,0,3.49-1.556,3.5-3.483V58.5c0.01-1.93-1.552-3.5-3.483-3.5H56 c-2.209,0-4-1.791-4-4l0,0c0-2.209,1.791-4,4-4h3c2.761,0,5-2.239,5-5l0,0c0-2.761-2.239-5-5-5h-1c-2.209,0-4-1.791-4-4l0,0 c0-2.209,1.791-4,4-4h0.5c3.038,0,5.5-2.462,5.5-5.5l0,0c0-3.038-2.462-5.5-5.5-5.5H45c-1.657,0-3-1.343-3-3l0,0 c0-1.657,1.343-3,3-3h0.5c2.485,0,4.5-2.015,4.5-4.5l0,0C50,5.015,47.985,3,45.5,3H28H14c-2.209,0-4,1.791-4,4l0,0 c0,2.209,1.791,4,4,4h0.5c1.933,0,3.5,1.567,3.5,3.5l0,0c0,1.933-1.567,4.5-3.5,4.5H6c-2.209,0-4,1.791-4,4l0,0c0,2.209,1.791,4,4,4 h8c2.485,0,4.438,1.14,4.438,3.625l0.031,0.688C18.469,33.798,16.485,35,14,35H5C2.239,35,0,37.239,0,40z\"/><radialGradient id=\"Vfz-9abGZTJV8V0oFRkXjb\" cx=\"-3520.885\" cy=\"1109.362\" r=\"26.875\" gradientTransform=\"matrix(-1 0 0 1 -3494.01 -1077.362)\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#afeeff\"/><stop offset=\".193\" stop-color=\"#bbf1ff\"/><stop offset=\".703\" stop-color=\"#d7f8ff\"/><stop offset=\"1\" stop-color=\"#e1faff\"/></radialGradient><path fill=\"url(#Vfz-9abGZTJV8V0oFRkXjb)\" d=\"M57.375,3L57.375,3c2.485,0,4.5,2.015,4.5,4.5l0,0c0,2.485-2.015,4.5-4.5,4.5l0,0 c-2.485,0-4.5-2.015-4.5-4.5l0,0C52.875,5.015,54.89,3,57.375,3z\"/><linearGradient id=\"Vfz-9abGZTJV8V0oFRkXjc\" x1=\"29.309\" x2=\"29.309\" y1=\"36.496\" y2=\"6.009\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#1ba7dd\"/><stop offset=\".244\" stop-color=\"#25b4e2\"/><stop offset=\"1\" stop-color=\"#40daf2\"/></linearGradient><path fill=\"url(#Vfz-9abGZTJV8V0oFRkXjc)\" d=\"M26.774,36.496l-8.793-7.573c0,0,14.829-24.048,22.656-22.872L28.322,33.103L26.774,36.496z\"/><linearGradient id=\"Vfz-9abGZTJV8V0oFRkXjd\" x1=\"15.624\" x2=\"15.624\" y1=\"43.652\" y2=\"28.923\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#1ba7dd\"/><stop offset=\".244\" stop-color=\"#25b4e2\"/><stop offset=\"1\" stop-color=\"#40daf2\"/></linearGradient><path fill=\"url(#Vfz-9abGZTJV8V0oFRkXjd)\" d=\"M12.708,43.077l-7.564-5.209c-1.554-1.07-1.279-3.453,0.478-4.137l12.359-4.809l9.141,6.898 l-9.141,7.07l-2.632,0.663C14.442,43.782,13.48,43.609,12.708,43.077z\"/><linearGradient id=\"Vfz-9abGZTJV8V0oFRkXje\" x1=\"36.324\" x2=\"36.324\" y1=\"58\" y2=\"6.045\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#ff9757\"/><stop offset=\"1\" stop-color=\"#ffb65b\"/></linearGradient><path fill=\"url(#Vfz-9abGZTJV8V0oFRkXje)\" d=\"M40.637,6.051c6.814-0.441,14.466,23.422,18.266,36.513c0.906,3.123-2.078,3.987-3.903,3.185 c-2.371-1.041-5.75-0.875-8.875-0.5c-5.03,0.604-7.03,3.814-12.375,9.125c-1.308,1.3-3.139,2.666-4.243,3.284 c-1.413,0.791-2.993,0.164-3.225-1.444c-0.481-3.32-1.856-8.514-5.788-10.884c-2.124-1.281-4.539-1.473-5.879-1.595 c-0.641-0.059-1.036-0.26-1.036-0.26s7.609-2.228,11.911-8.883S36.25,6.335,40.637,6.051z\"/></svg>" #let cpp_img = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\" width=\"50px\" height=\"50px\"><path d=\"M 25 2 C 24.285156 2 23.574219 2.179688 22.933594 2.539063 L 6.089844 12.003906 C 4.808594 12.726563 4 14.074219 4 15.535156 L 4 34.464844 C 4 35.929688 4.808594 37.277344 6.089844 38 L 22.933594 47.460938 C 24.214844 48.183594 25.785156 48.183594 27.066406 47.460938 L 43.910156 38 C 45.195313 37.277344 46 35.925781 46 34.464844 L 46 15.535156 C 46 14.074219 45.191406 12.726563 43.910156 12.003906 L 27.066406 2.539063 C 26.425781 2.179688 25.714844 2 25 2 Z M 25 4 C 25.375 4 25.753906 4.09375 26.089844 4.28125 L 42.933594 13.746094 C 43.601563 14.125 44 14.804688 44 15.535156 L 44 24 L 42 24 L 42 22 L 40 22 L 40 24 L 38 24 L 38 26 L 40 26 L 40 28 L 42 28 L 42 26 L 44 26 L 44 34.464844 C 44 35.195313 43.601563 35.875 42.929688 36.253906 L 26.089844 45.71875 C 25.417969 46.09375 24.582031 46.09375 23.910156 45.71875 L 7.070313 36.253906 C 6.398438 35.875 6 35.199219 6 34.464844 L 6 15.535156 C 6 14.804688 6.398438 14.125 7.070313 13.746094 L 23.910156 4.28125 C 24.246094 4.09375 24.625 4 25 4 Z M 25 12 C 17.839844 12 12 17.839844 12 25 C 12 32.160156 17.839844 38 25 38 C 29.089844 38 32.886719 36.09375 35.339844 32.863281 L 36.023438 31.960938 L 29.96875 28.453125 L 29.421875 29.046875 C 28.292969 30.28125 26.691406 31 25 31 C 21.683594 31 19 28.316406 19 25 C 19 21.683594 21.683594 19 25 19 C 26.691406 19 28.292969 19.71875 29.421875 20.953125 L 29.96875 21.546875 L 36.023438 18.039063 L 35.339844 17.136719 C 32.886719 13.90625 29.089844 12 25 12 Z M 25 14 C 28.074219 14 30.886719 15.316406 32.945313 17.511719 L 30.203125 19.097656 C 28.757813 17.832031 26.960938 17 25 17 C 20.597656 17 17 20.597656 17 25 C 17 29.402344 20.597656 33 25 33 C 26.960938 33 28.757813 32.167969 30.203125 30.902344 L 32.945313 32.488281 C 30.886719 34.683594 28.074219 36 25 36 C 18.925781 36 14 31.074219 14 25 C 14 18.925781 18.925781 14 25 14 Z M 33 22 L 33 24 L 31 24 L 31 26 L 33 26 L 33 28 L 35 28 L 35 26 L 37 26 L 37 24 L 35 24 L 35 22 Z\"/></svg>" #let python_img = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"icon icon-tabler icons-tabler-outline icon-tabler-brand-python\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 9h-7a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h3\" /><path d=\"M12 15h7a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-3\" /><path d=\"M8 9v-4a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v5a2 2 0 0 1 -2 2h-4a2 2 0 0 0 -2 2v5a2 2 0 0 0 2 2h4a2 2 0 0 0 2 -2v-4\" /><path d=\"M11 6l0 .01\" /><path d=\"M13 18l0 .01\" /></svg>" #let icon(codepoint) = { box( height: 0.8em, baseline: 0.01em, image.decode(codepoint) ) h(0.1em) } #let codly_init() = { codly( languages: ( matlab: ( name: "MATLAB", // icon: icon("icons8-matlab.svg"), icon: icon(matlab_img), color: rgb("#CE412B") ), python: ( name: "Python", icon: icon(python_img) ), cpp: ( name: "C++", icon: icon(cpp_img), color: rgb("#b725b2") ), output: ( name: "output", color: rgb("#000000"), ) ), ) }
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas2/3_Streda.typ
typst
#let V = ( "HV": ( ("", "Jehdá ot dréva", "Svitíti svitíla ne terpjášče omračíšasja, na kresťí zašédšu tebí Slóve: zemľá že podvizášesja, i kámenije razsidášesja, cerkóvnoje blahoľípije razdirášesja posreďí, hróby otverzáchusja, mértviji vostajáchu, ád izdajáše vsjá súščyja dólu, bísy pobiždáchusja, i són vsím vmiňášesja smérť."), ("", "", "Jehdá plodovítyj ťá Christé vinohrád, razbójnik blahonrávnyj víďiv, lúčšij býsť razbójnik blahoiskúsen, i ukrádajet proščénije drévnich sohrišénij, ziló blahojestéstvenňi málym hlásom: tomú revníteli býti potščímsja. Jéže pomjaní i nás čelovikoľúbče, vsí zovúšče."), ("", "", "Sijájet jáko zvizdá na nebesí, v cérkvi božéstvennyj voístinnu krest tvój Christé, opaľája úbo bísy, vírnyja že prosviščája, i posramľája líca tebé raspénšich: ímže prarodíteli drévom voobražájuščim krestá, préžde ot rabóty izvél jesí, i ot kámene méd ssáti v pustýni sotvoríl jesí."), ("", "Jehdá ot dréva", "Vsím predstáteľnicu ťá čelovíkom, vsím pribížišče velíkoje, vsím zastúpnicu ťá pokazá, Vladýčice, christijánom, íže iz tebé v náše smišénije obólksja blahoutróbňi, i raspjátije i smérť nás rádi podját. Tohó úbo molí neprestánno, vsím očiščénije nizposláti prehrišénij, Bohonevístnaja."), ("", "", "Drévle Ďíva i áhnica, zrjášči iz čréva jejá, na drévi povíšena, jáko osuždéna so dvimá osuždénnoma, vosklicájušči hlahólaše: Sýne i Bóže mój, stránno vídimoje strášnoje tájinstvo: obáče múdrosti tvojejá bézdnu ispytáti niktóže móžet: pojú tvojé dolhoterpínije."), ("", "", "Hďí tvojehó viďínija blahoľípije? Hďí krasotá skrýsja dobróty tvojejá, Sýne? Káko íže dobrótoju neizrečénnaja sotvorívyj Bóže, krásnyj v dobrótach, za vsjá čelovíki, bezsláven i bezčésten na drévie vísiši, vída, ni dobróty ne imíjaj, čádo? Predóbraja Ďíva vopijáše, steňášči i pláčušči."), ("Krestobohoródičen", "", "Zájde svitílov zarjá, zemným svítom pobíždšisja, obnážšimsja na kresťí: pobiždájetsja úbo prísno chúždšeje bóľšim, i lúčšemu méňšeje dajét místo, káko úbo ne podobáše sviťášču Christú, skrýtisja zarí čúvstvenňij? Dostójnym hlahólaše, ťá zrjášči prečístaja, svitílom svíta."), ), "S": ( ("", "", "Spasí mja Christé Spáse, síloju kréstnoju, spasýj Petrá v móri, i pomíluj mjá Bóže."), ("", "", "Da ráspnetsja vopijáchu, íže tvojích darovánij prísno naslaždájuščijisja, i zloďíja vo blahodáteľa místo prošáchu prijáti, íže právednikov ubíjcy: molčál že jesí Christé, terpjá ích surovstvó, postradáti choťá, i spastí nás jáko čelovikoľúbec."), ("Múčeničen", "", "Lícy múčeničestiji protívišasja mučítelem, hlahóľušče: mý vójinstvujem carjú síl, ášče i ohňú i múkam predáste nás: no ne otmetájemsja Tróičeskija síly."), ("Krestobohoródičen", "Jehdá ot dréva", "Boľízni preterpívši mnóhija v raspjátiji Sýna i Bóha tvojehó prečístaja, steňáše, slezjášči i vosklicájušči: uvý mňí čádo sládkoje, bez právdy káko stráždeši, choťá izbáviti jáže ot Adáma zemnoródnyja? Ťímže prečístaja Ďívo, tebé mólim víroju: mílostiva nám tohó soďílaj."), ), ) #let P = ( "1": ( ("", "", "Hrjadíte ľúdije, pojím písň Christú Bóhu, razďíľšemu móre, i nastávľšemu ľúdi, jáže izvedé iz rabóty jehípetskija, jáko proslávisja."), ("", "", "Slóvo mojehó priobrítenija otňúd ňísť k pisnoslóviju vsečístaja, jáko pokryvájet mjá hrichóv mojích ťmá: no o Bohorodíteľnice uťisňájema prijimí mja."), ("", "", "Pod tvój pokróv pribiháju prečístaja, ot hrích bezčíslennych v konéc, i Bóha i Vladýku blahopremínna sotvorí čístaja, i spasí mja."), ("", "", "Tý mňí Vladýčice téploje očistílišče, k tebí pribihája spasúsja, i priobrjášču dušévnoje spasénije: móžeši bo vsjá, jáko súšči Máti vsích Bóha."), ("", "", "Íže dušám ľstéc, privlečé mja v pohíbeľnyj róv: no mňí prostrí deržávnuju tvojú rúku, Bohoródice Ďívo, i skóro ko svítu vozvedí."), ), "3": ( ("", "", "Utverdí nás v tebí Hóspodi, drévom umerščvéj hrích, i strách tvój vsadí v serdcá nás pojúščich ťá."), ("", "", "Vo mnóhija vpád razbójniki okajánnyj, obnažén bých, ujázvlen že i ostávlen: no tý Bohoródice čístaja, ne prézri mené."), ("", "", "Obnaží Adáma préžde zmíj, preľstív drévom, nýňi že udóbno pľiní dúšu mojú: moľúsja tí Vladýčice, uščédri mjá."), ("", "", "Nýňi tebí mojá prinošú tájnaja, ístinňij predstáteľnici mojéj i pokróvu: jáko da sijá mňí ne obličít Sýn tvój, na suďí právedňim svojém."), ("", "", "Pomíluj nás čístaja, pomíluj: íbo ot ďíl spasénija otňúd ňísť nám. Ťímže víroju téploju k tebí vopijém: pomíluj rabý tvojá."), ), "4": ( ("", "", "Pojú ťá, slúchom bo Hóspodi, uslýšach i užasóchsja, do mené bo ídeši, mené iščjá zablúždšaho. Ťím mnóhoje tvojé snizchoždénije, jéže na mjá, proslavľáju mnohomílostive."), ("", "", "Boľášča mjá neiscíľno Vladýčice, i obniščávša ne prézri: no dážď mí jeléj bláhosti tvojejá Ďívo, i tvojími promyšléňmi obohatí mja, jéže ot Bóha zlátom netľínnym."), ("", "", "Dóbrych vsích obnažíchsja, i ležú vo zlých, obólksja páče vsích drévle pádšich: i nýňi préžnimi ukrasí mja, i vtorých izbávi Bohonevísto."), ("", "", "Bludnícu prevzydóch v bluďích, i mytarjá lichoímstvom vsehdá, slóvom i izvolénijem: no úbo obojú pokajánije, préžde koncá sťažáti mí Vladýčice spodóbi."), ("", "", "Vodvoríchsja v pustýni pečáľňij, udalíchsja ot tebé Bohorodíteľnice, któ dást mí kriľí, i poleščú, i priidú k tebí nadéždi mojéj, spasájuščej malodúšije mené okajánnaho?"), ), "5": ( ("", "", "Svíta podáteľu, i vikóv tvórče Hóspodi, vo svíťi tvojích poveľínij nastávi nás: rázvi bo tebé inóho Bóha ne znájem."), ("", "", "Jáko nevečérnij svít ot čréva tvojehó Vladýčice, súščym na zemlí vozsijávšij, smrádnuju dúšu mojú ozarí čístaja, i otžení vsjáku mhlú sérdca mojehó."), ("", "", "Nóšč mjá pokryvájet ľútaja lukávych mojích i zlých ďijánij, no vopijú ti Vladýčice: nastávi mjá k svítu božéstvennomu tvojehó Sýna i Vladýki vsepítaja."), ("", "", "I mené prijimí čístaja, jákože blúdnaho sýna priját tvój Sýn i ziždíteľ vsjáčeskich, vopijúščaho s ním: sohriších voístinnu, i spasí mja Vladýčice."), ("", "", "Ujazvívšejesja mojé sérdce prilóhi lukávaho, prečístaja, jáko mílostiva iscilí, na kresťí plótiju ujázvlennaho, neizhlahólanno róždši."), ), "6": ( ("", "", "V bézdňi hrichóvňij vaľájasja, neizsľídnuju milosérdija tvojehó prizyváju bézdnu, ot tlí Bóže mjá vozvedí."), ("", "", "V róv hrichóvnyj vpadóch, i k nezabyvájuščemu ne vziráju Bóhu, stráchom oderžím: no k tebí primetájusja Bohonevísto."), ("", "", "Pokrývšejesja ľúťi sérdce mojé nedovídomych prehrišénij voľnóju, vsesíľnoju tvojéju molítvoju Bohoródice Ďívo okormí."), ("", "", "Krasotú mňí víďiti slávy tvojejá spodóbi, jehdá ot plóti mojejá choščú razlučítisja, jáko utverždénije mojé Vladýčice: da otsjúdu uvím ostavlénije."), ("", "", "Napástej i bíd i skorbéj izbávi rabý tvojá, svjatája Vladýčice, jáže k Bóhu tvojími molítvami, víroju k tebé pribihájuščyja."), ), "S": ( ("", "", "Ťá veličájem Bohoródice, vopijúšče: rádujsja žézle, ot nehóže bezsímenno Bóh prozjabýj, pohubí na dréve smérť."), ), "7": ( ("", "", "Óbrazu zlatómu na póli Deíri služímu, trijé tvoí ótrocy nebrehóša bezbóžnaho veľínija, posreďí že ohňá vvérženi, orošájemi pojáchu: blahoslovén jesí Bóže otéc nášich."), ("", "", "Nýňi tščítsja zijája vráh prijáti mjá vo utróbu svojú: íbo prinošájet mí otvsjúdu iskušénija i síti, vés presikája, spích mój: no predvarívši izbávi mjá Ďívo Máti, ot tohó navíta lukávaho."), ("", "", "Oskverňájet i smuščájet čúvstvija i úm sopostát, i v róv otčájanija svestí mja tščítsja. Ťímže vopijú ti jedíňij: pribížišče mojé Bohonevísto, izbávi mjá ot rukí sehó ľstívaho."), ("", "", "Íže drévle trí júnoši ot péšči horjáščija, Christé mój, izbavléj, sám Slóve, i mené moľbámi neiskusobráčnyja Mátere tvojejá ot plámene, jehóže razžehóch bezmírnymi zlými, izbávi i orosí."), ("", "", "Véščno obrít sérdce mojé tlíteľ, umertví jé: no tý mja úbo síloju božéstvennoju odoždí neiskusobráčnaja Máti, i pobidíti mí spodóbi sehó, jáko da víroju zovú ti: blahoslovénnaja, jáže Bóha plótiju róždšaja."), ), "8": ( ("", "", "V péšč óhnennuju ko otrokóm jevréjskim snizšédšaho, i plámeň v rósu prelóžšaho Bóha, pójte ďilá jáko Hóspoda, i prevoznosíte vo vsjá víki."), ("", "", "Mnóhimi zlými moími pohorblén býv ľúťi, mnóžestvom ťahót, i óko mojé otňúd na nebesá ne smíju vozvestí, no vopijú ti: pomíluj jedína Bohoródice, mené pádšaho."), ("", "", "Vóňže vpadóch hňív tvojehó Sýna i Bóha, čístaja izbávi mjá: i v čás, vóňže chóščet tvoríti ispytánije, búdi mí pómošč prečístaja, i ot šúich kózlišč izbávi mjá."), ("", "", "Umerščvlénnaho mjá mýslenno, ot bezčíslennych mojích zól, vozdvíhni Bohonevísto otrokovíce: i moľbóju tvojéju izbávi mjá ot vsjákija prélesti dušetľínnaho vrahá i ubíjcy."), ("", "", "Zloneisprávlennaja dušé, káko očerníla jesí zľí pérvuju dobrótu? Káko otvérhla jesí vsjá, jáže k ziždíteľu tvojemú obíty, i prijála jesí zlóbnaja? No hrjadí i pritecý blahočéstno k Bohoródici."), ), "9": ( ("", "", "Ot Bóha Bóha slóva, neizrečénnoju múdrostiju, prišédšaho obnovíti Adáma, jádiju v tľínije pádšaho ľúťi, ot svjatýja Ďívy neizrečénno voplotívšahosja nás rádi, vírniji jedinomúdrenno písňmi veličájem."), ("", "", "Ďíly ťážkimi čúvstva oskverních voístinnu, i vsehó studoďijánija ispólnen jésm: no očísti úbo prečístaja, vrémja mňí isprošájušči blahoumilénija, da neprestánno ťá veličáju."), ("", "", "Tý mja Bohoródice, opravdáj, jehdá javjátsja ďilá sokrovénnaja kojehóždo jávi, ímaši bo voístinnu sílu: i ťmý mjá izbávi i vo straňí učiní svíta molítvami tvojími, iďíže jésť rádosť neizhlahólannaja."), ("", "", "Moľú ťa Slóve, préžde prišéstvija koncá pokajánije mí dáruj téploje, i umilénije slezám, cilomúdrije vkúpi i smirénije, i ľubóv božéstvennuju, i stádu tvojemú ustrojénije, moľbámi róždšija ťá."), ("", "", "Úmnych že i čúvstvennych, preminúvši Ďívo slávoju i čéstiju, rázvi Bóha, ne omerzí mené preminúvšaho v prehrišénijich, vétchich že i nóvych čelovík sohríššich na zemlí: no tvojéju molítvoju spasí mja."), ), ) #let U = ( "S1": ( ("", "", "Spasénije soďílal jesí posreďí zemlí Christé Bóže, na kresťí prečísťiji rúci tvoí prostérl jesí, sobirája vsjá jazýki, zovúščyja: Hóspodi, sláva tebi."), ("", "", "Ímže óbrazom pľiníl jésť vráh Adáma drévom sňídnym: tákože Hóspodi, sám pľiníl jesí tý vrahá drévom krestnym, i strástiju tvojéju: na sé bo prišél jesí vtorýj Adám, vzyskáti zablúždšaho, i oživíti uméršaho: Bóže sláva tebí."), ("Krestobohoródičen", "", "Ťá veličájem Bohoródice vopijúšče: rádujsja žézle, ot nehóže bezsímenno Bóh prozjabýj, pohubí na dréve smérť."), ), "S2": ( ("", "", "Životvorjáščij krest tvojejá bláhosti, jehóže darovál jesí nám nedostójnym Hóspodi, tebí prinósim v molítvu: spasí hrád tvój, mír dárujaj Bohoródicy rádi, jedíne čelovikoľúbče."), ("", "", "Prosvitívyj zemnája krestóm i prizvávyj na pokajánije hríšnyja, ne otlučí mené stáda tvojehó, Pástyrju dóbryj: no vzyščí mené zablúždšaho Vladýko, i svjatómu tvojemú stádu sopričtí, íže jedín bláh i čelovikoľúbec."), ("", "", "Íže prosvitívyj svjatýja tvojá páče zláta, i proslávivyj prepodóbnyja tvojá, jáko bláh: ot níchže umolén byvája Christé Bóže, žízň nášu umirí, jáko čelovikoľúbec, i molítvu isprávi jáko kadílo, íže jedíne vo svjatých počivájaj."), ("Krestobohoródičen", "<NAME>", "Ďíva i Máti tvojá, Christé, na kresťí zrjášči ťá mértva prostérta, pláčušči hórko hlahólaše: Sýne mój, čtó strášnoje sijé táinstvo? Íže vsím dárujaj živót víčnyj, vóleju na kresťí káko umiráješi smértiju ponósnoju?"), ), "S3": ( ("", "<NAME>", "Raspjátisja preterpíl jesí nás rádi, i mértv býti Iisúse žiznodávče, jáko da rukú tvojéju sozdánije ot smértnaho osuždénija izbáviši, jáko blahoutróben Bóh i čelovikoľúbec, za mnóžestvo ščedrót: íže jedín sýj bezhríšen."), ("", "", "Jáko razbójnik ispovíduju, i vopijú ti blahómu: pomjaní mja Hóspodi, vo cárstviji tvojém: i s ním mjá sopričtí, íže vóleju strásti nás rádi prijémyj."), ("Krestobohoródičen", "", "Čéstným krestóm Sýna tvojehó sochraňájemi, Vladýčice čístaja Bohoródice, vsják prilóh boríteľa vsí udóbňi pobiždájem: sehó rádi po dólhu ťá ublažájem, jáko <NAME>, jedínu upovánije dušám nášym."), ), "K": ( "P1": ( "1": ( ("", "", "Vo hlubiňí postlá inohdá faraonítskoje vsevójinstvo preoružénnaja síla, voplóščšejesja že Slóvo vsezlóbnyj hrích potrebílo jésť, preproslávlennyj Hospóď, slávno bo proslávisja."), ("", "", "Prestupív pérvuju zápoviď drévle pervozdánnyj, ot sadá smérť objém: vozdvíhnuvyjsja že na drévo bezsmértnyj, i smérti vkusívyj, bezsmértije vsím čelovíkom darová."), ("", "", "Krestú vodruzívšusja na zemlí, nizpadé šatánije vrahá, i otňúd potrebísja: préžde že otrinovénnyj čelovík páki v ráj vchódit. Sláva tebí táko jedínomu blahoizvólivšemu Bóhu nášemu."), ("Múčeničen", "", "Jáko ovní, jáko áhncy slovésniji, vsí zakalájemi, i na údy nemílostivno ssikájemi prechváľniji múčenicy, i prineséni býste Zaklánomu jáko ovčáta: i nýňi cérkov svjatúju pervoródnych prosviščájete."), ("Múčeničen", "", "Krípkoje stojánije múdriji vsehdá tvorjášče, lukávyja vrahí nizložíste, mečí ssikájemi, i vo óhň i v vódu vmetájemi: ťímže blažénnyja končíny strastotérpcy spodóbistesja."), ("Bohoródičen", "", "svjaščénnyj ťá proróčeskij lík naricáše dvér neprochódnuju, zémľu izbránnuju, i hóru nesikómuju, prečístaja Vladýčice: Vladýku bo vsích rodilá jesí vóleju raspjátije plótiju prijémšaho."), ), "2": ( ("", "", "Hrjadíte ľúdije, pojím písň Christú Bóhu, razďíľšemu móre, i nastávľšemu ľúdi, jáže izvedé iz rabóty jehípetskija, jáko proslávisja."), ("", "", "Vsí vírniji prijidíte, sohlásno vospojím Bohoródicu: tá bo Christá rodilá jésť páče umá čelovíča, i neprestánno mólit spastí vsích nás."), ("", "", "Íže óbraz Ótči ipostási, iz tebé priját smišénije Bohorodíteľnice, i istľívšij óbraz proslávi, i sehó nóva sotvorí."), ("", "", "Cheruvím čestňíjši súšči, i nebésnych krúh prevýšši bylá jesí: Bóha bo páče umá vo utróbi tvojéj bezstrástno vmistíla jesí."), ("", "", "Izbavlénije nášich hrichóv rodilá jesí blahodáteľa Hóspoda, izminívši mértvosť práotca Adáma, vozvelá jesí jestestvó k nebésnym."), ), ), "P3": ( "1": ( ("", "", "Procvilá jésť pustýňa, jáko krín Hóspodi, jazýčeskaja neploďáščaja cérkov, prišéstvijem tvojím v néjže utverdísja mojé sérdce."), ("", "", "Raspinájem pokolebál jesí vsjú tvár Hóspodi, i vírnyja utverdíl jesí, vospivájuščyja sílu tvojú, i neizrečénnoje Slóve snizchoždénije tvojé."), ("", "", "Ráj otvérzl jesí krestóm tvojím Vladýko, i razbójnika vvél jesí poznávšaho cárstvije tvojé, i bohátstvo božéstvennaho tvojehó blahoutróbija."), ("Múčeničen", "", "Procvitóša múčenicy jákože šipcý blahouchánniji, v mýslennych débrich, i zlosmrádnuju prélesť othnáša, i vírnych serdcá oblahoucháša."), ("Múčeničen", "", "Svitíľnicy vselénnyja, vírnych spasítelije svjatíji, svítlymi Dúcha zarjámi vsích prosvitíte, vás po dólhu ublážájuščich."), ("Bohoródičen", "", "Vozdvizájema na drévo žiznodávca víďašči, i vóleju umirájušča, vsím žízň podajúščaho, boľáše utróboju vseneporóčnaja."), ), "2": ( ("", "", "Utverdí nás v tebí Hóspodi, drévom umerščvéj hrích, i strách tvój vsadí v serdcá nás pojúščich ťá."), ("", "", "Zlatúju jáko voístinnu kadíľnicu, i rúčku mánny, i Bóžiju hóru, i palátu krasnú božéstvennuju, ťá Ďívo imenújem."), ("", "", "Cérkov i svjáščénnoje žilíšče Slóva súšči Bohoródice: sohrišénij očistílišče, prečístaja, búdi mí prisnoďívo."), ("", "", "Ni jazýk zemnoródnych, ni úm bezplótnych vozmóžet roždestvó tvojé skazáti: výše jestestvá bo i smýsla, Bohoródice ziždíteľa rodilá jesí."), ("", "", "Utverždénije búdi i pribížišče, i pokróv Ďívo Bohorodíteľnice, víroju k tebí pribihájuščym, i Bóžiju ťá Máter provozviščájuščym."), ), ), "P4": ( "1": ( ("", "", "Prišél jesí ot Ďívy, ne chodátaj, ni ánhel, no sám Hóspodi voplóščsja, i spásl jesí vsehó mja čelovíka. Ťím zovú ti: sláva síľi tvojéj Hóspodi."), ("", "", "Uprazdníl jesí načálo ľútaho mirodéržca, na drévo voznosím, i kľátvu potrebíl jesí. Ťímže ťá slávim, íže tobóju spaséni, jedíne Hóspodi."), ("", "", "Rasprostérta na dréve víďivšeje ťá sólnce skrý svít, hóry i kámenije raspadóšasja, i zavísa cerkóvnaja razdrásja vsesíľne."), ("Múčeničen", "", "Umerščvľájemi, vrahá do koncá umertvíste, želézom strúžemi, kóžnaho umerščvlénija debeľstvá sovlekóstesja múčenicy Hospódni, i slávoju oblekóstesja."), ("Múčeničen", "", "Usikájemymi hlavámi múčenicy, užásno lukávych síl hlavý otsikóša, i prebyvájuščuju slávu nasľídovaša rádujuščesja."), ("Bohoródičen", "", "Vozsijá iz utróby tvojejá, otrokovíce neiskusobráčnaja, Ótčeje zarénije Christós, i prosvití vselénnuju, raspinájem, i bisóvskuju ťmú potrebíl jésť."), ), "2": ( ("", "", "Prišél jesí ot Ďívy, ne chodátaj, ni ánhel, no sám Hóspodi voplóščsja, i spásl jesí vsehó mja čelovíka. Ťím zovú ti: sláva síľi tvojéj Hóspodi."), ("", "", "Kápľu mí umilénija odoždí Vladýčice, vzimájušči vsják sérdca mojehó znój, i pomyšlénija mojehó mútnyja potóki ustavľájušči."), ("", "", "Orúžijem mjá slastéj ujázvlena, i ležášča uránena, prečístaja ne prézri, no iscilí kopijém i króviju raspjátaho Sýna tvojehó i Bóha nášeho."), ("", "", "Obohatívši vladýčestvom vsjú tvár, ľúťi mjá obniščávša blahodátiju božéstvennoju uščédri: jáko da veličáju ťá, jáko blahúju mojú predstáteľnicu, vseneporóčnaja."), ("", "", "Prochladí mjá Ďívo pokajánijem, i odoždí sérdce mojé izsóchšeje znójem strastéj, izlivájušči na mjá jeléj i cilénije mílosti tvojejá."), ), ), "P5": ( "1": ( ("", "", "Chodátaj Bóhu i čelovíkom býl jesí Christé Bóže: tobóju bo Vladýko k svitonačáľniku Otcú tvojemú, ot nóšči nevíďinija privedénije ímamy."), ("", "", "Na kresťí prihvozdívsja, zemnája osnovánija pokolebál jesí, i kopijém probodájem, zmíja načalozlóbnaho zaklál jesí, i tóki spasénija vsím Christé istočíl jesí."), ("", "", "Ne terpíl jesí zríti zabluždájema, jehóže rukáma sozdáv, rúci rasprostérl jesí Slóve na drévi umerščvľájem, i oživíl jesí sehó drévom drévle uméršaho."), ("Múčeničen", "", "Drúzi Christóvy, tépliji čelovíkom zastúpnicy, cvíti čestníji, preudóbrenniji sosúdi Dúcha, múdriji strastotérpcy, dostójňi ublažájutsja."), ("Múčeničen", "", "Zakónno postradá lík svjatých tvojích stradálec, bezzakónnych posramí jedíne zakonodávče, síloju tvojéju, i skončáv tečénije, múčeničeski vinčásja."), ("Bohoródičen", "", "Javílasja jesí čístaja, po roždeství netľínna, Bóh bo iz tebé rodísja voploščájem: jehóže usmotrívši raspinájema, ne terpjášči, utróbnoju boľízniju vosklicála jesí."), ), "2": ( ("", "", "Svíta podáteľu i vikóv tvórče Hóspodi, vo svíťi tvojích poveľínij nastávi nás: rázvi bo tebé inóho Bóha ne znájem."), ("", "", "Voploščénna iz tebé Bohorodíteľnice, vírniji poznáchom, bez símene Sýna róždšasja Bóha ístinna, i čelovíka jestestvóm. Ťímže ťá slávim."), ("", "", "Pod króv tvój, prečístaja, i zastuplénije vírniji vsehdá pribihájušče víroju, tebé rádi Ďívo, izbavľájemsja vsjákaho ľútaho obstojánija."), ("", "", "Izbávi nás iskušénij, i ot búri pomyšlénij prečístaja, vsjákaho hňíva, i vsjákaho hrichá, hláda že i hubíteľstva, i víčnaho Ďívo mučénija."), ("", "", "Predstáteľnice náša, spasénije i upovánije Vladýčice christiján súšči, spásáj ľubóviju ťá prísno vírno vospivájuščich Ďívo vsepítaja."), ), ), "P6": ( "1": ( ("", "", "Ko Hóspodu ot kíta Jóna vozopí: tý mja vozvedí iz hlubiný áda, moľúsja, da jáko izbáviteľu vo hlási chvalénija, ístiny že dúchom požrú tebí."), ("", "", "Na júnyja hlavý polóž dláni inohdá Jákov, krest propisováše, na némže Slóve rasprostérl jesí dláni: i ot rukí ľstívaho borcá izbávil jesí Christé čelovíčestvo."), ("", "", "Raspénšusja Christé tebí vsecárjú vóleju, cárstvujuščij hrích potrebísja: Adám že íže inohdá drévle iz rajá izhnánnyj, v tój vseľájetsja páki, tebé vospivája."), ("Múčeničen", "", "Krasný súšče v ránach svjaščénnyja, íže blahoľípijem ukrasívšyjasja nebésnym, voístinnu vozľúblennyja Hospódni múčeniki, nesumňínnym sérdcem vospoím."), ("Múčeničen", "", "Neuhasímu sviščú svojú sobľúdše, božéstvenniji múčenicy, napoíša bohátno krovmí svojími, i božéstvennaho čertóha polučíša vchód rádujuščesja."), ("Bohoródičen", "", "Pojém ťá vsepítaja, jáko Bóha róždšuju prepítaho, na drévi soprotivoborcá vrahá pohúbľša, i iz tlí izbávľšaho vospivájuščich tohó stradánija."), ), "2": ( ("", "", "V bézdňi hrichóvňij vaľájasja, neizsľídnuju milosérdija tvojehó prizyváju bézdnu: ot tlí Bóže mjá vozvedí."), ("", "", "Íže vóleju vsjá soďílavyj, izvóli vo črévo neiskusobráčnyja vselítisja: i íže tľínijem boľáščyja, netľínijem obohatíl jésť, jáko milosérd."), ("", "", "Prevýšši výšnich síl, i svjaťíjši jesí preneporóčnaja, páče jestestvá vmistívši, nevmistímoje Slóvo vo črévo tvojé."), ("", "", "Na putí mja žitéjstem zabluždájušča, i v bezpútije částo vpádajušča hrichóvnoje, k stezí pokajánija Vladýčice nastávi mjá."), ("", "", "Ne prézri čístaja, moľbý náša, na ťá vozlóžšich nadéždu ráb tvojích: pribížišče bo Vladýčice, i dušám očistílišče tý jesí."), ), ), "P7": ( "1": ( ("", "", "Bohoprotívnoje veľínije bezzakónnujuščaho mučíteľa, vysók plámeň voznesló jésť: Christós že prostré Bohočestívym otrokóm rósu duchóvnuju, sýj blahoslovén i preproslávlen."), ("", "", "Orúžije jéže préžde obraščájemoje, pleščí mňí dajét, otnéľiže kopijém probodésja, na kresťí vozdvíženyj, blahoutróbne Hóspodi. Ťímže veličáju ťá, tvojéju čestnóju strástiju obrít bezstrástije."), ("", "", "Zmíj, íže Moiséjem vozvyšájemyj na drévo, božéstvennoje vozvyšénije proobražáše Christóvo, ľstívaho zmíja umertvívšaho, vsích že oživívšaho nás umertvívšichsja prestuplénijem."), ("Múčeničen", "", "Sýnove byvájete božéstvennym priobščénijem, beznačáľna rodíteľa Sýnu sobeznačáľnu svjatíji strásti prečísťij upodóbľšesja, ťímže brátiju vás naricájet, i nasľídniki cárstvija svojehó."), ("Múčeničen", "", "Na krest vozvyšájemi, jáko Vladýka, i kopijém probodájemi, i mečí ssicájemi, na óhň že i vódu razďiľájemi, i sdrobľájemi kolesý Bohonósniji rádovachusja múčenicy."), ("Bohoródičen", "", "Hrózd sozrívšij, jehóže nevozďílanno čístaja vozrastíla jesí na drévi jáko uzrí povíšena vzyváše: čádo mojé sládkoje, mstó iskápaj, ímže strastéj pijánstvo otímetsja."), ), "2": ( ("", "", "Bohoprotívnoje veľínije bezzakónnujuščaho mučíteľa, vysók plámeň voznesló jésť: Christós že prostré Bohočestívym otrokóm rósu duchóvnuju, sýj blahoslovén i preproslávlen."), ("", "", "Kríposť mojá i pínije i spasénije, i izvístnoje zastuplénije, i sťiná neoborímaja: súšči Vladýčice, borjúščyja mjá démony poborí, prísno íščuščyja umertvíti mjá."), ("", "", "Bóha voplóščši ot ďívstvennych tvojích krovéj, obožívšaho Ďívo čelovíčestvo: ťímže mjá strasťmí oskvernénnaho, i istľívša vrážijimi kózňmi, izbávi molítvami tvojími."), ("", "", "Péšč proobražáše tvojé roždestvó vseneporóčnaja: ótroki bo ne opalí, jákože ni utróbu tvojú óhň nepostojánnyj. Ťímže mólim ťá: rabý tvojá ohňá víčnaho izbávi."), ), ), "P8": ( "1": ( ("", "", "Péšč inohdá óhnennaja vo Vavilóňi ďíjstva razďiľáše, Bóžijim veľínijem chaldéji opaľájuščaja, vírnyja že orošájuščaja, pojúščyja: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("", "", "Króviju iz tvojích rébr netľínnych iskápavšeju Dolhoterpilíve, tvár osvjatísja: ríki že mnohobóžija izsušény býša: túčy že javíšasja blahočéstija, prélestej bezdóždije potrebľájuščyja."), ("", "", "Raspjátija tvojehó sólnce ustyďísja, i svojá lučý sokrý: kámenije že raspadóšasja, i ád nízu ustrašísja: právednych že dúsi vzyhrášasja, čájušče vsekonéčnaho Slóve izbavlénija."), ("Múčeničen", "", "Iscilénija vírnym tóčat ostánki moščéj strastotérpec, i vsehdá vrédy neudoboiscíľnych boľíznej iscilevájut: jáko díven jesí Hóspodi, zovém blahodárno, vo svjatých tvojích múčenicich."), ("Múčeničen", "", "Ustá zviréj, i vrénija konóbnaja, pomerzánija že i stúdeni, ťážesť znója, nohtéj isterzánija preterpíste tvérdostiju, i zatvorénija, i núždnuju smérť strastotérpcy. Ťímže so Christóm proslavľájetesja."), ("Bohoródičen", "", "Plóť iz tvojehó čréva prijémlet choťáj, i zrím byvájet nevídimyj, i raspjátije prijémlet, i kľátva naricájetsja, ot kľátvy izymája vsích Sýn tvój, Bohorádovannaja Vladýčice."), ), "2": ( ("", "", "Drévle orosívšaho jevréjskija ótroki v plámeni, i opalívšaho Hóspoda chaldéji preslávno v ném, vospojém hlahóľušče: blahoslovíte i prevoznosíte jehó vo víki."), ("", "", "Žívo i nezavístno spasénije nám zemnoródnym, neskvérnaja áhnica, jáže porodilá jesi áhnca Bóžija, ne prézri mené zovúšča: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("", "", "Božéstvennoje tvojé prečístaja, roždestvó obnoví nás, i vsích čáda pokazá i sýny dné i svíta, i spásšesja vzyvájem: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("", "", "Živúju vódu porodilá jesí čístaja, ot ložésn ďivíčeskich, i ostavlénije istočíla jesí ot istóčnika iscilénij vírnym. Ťímže vsí zovém: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ), ), "P9": ( "1": ( ("", "", "Hrózd zrílyj žízni tý vozrastíla jesí čístaja: lozá bo jesí uslaždájušči zémľu blahími, júže pojúšče zovém: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("", "", "Beznačáľna rodíteľa Sýn, Bóh i Hospóď, voplóščsja ot Ďívy nám javísja, omračénnaja prosvitíti, sobráti rastočénnaja: ťím vsepítuju Bohoródicu veličájem."), ("", "", "Iscilí sokrušénije i okajánstvo mojé tvojéju ránoju Slóve neizsľídovanne, i pohrebénnyj óbraz lukávymi strasťmí, očísti strástiju tvojéju, Hóspodi Bóže spasénija mojehó."), ("", "", "Víďin býl jesí voznosím, na kiparísi Vladýko, i na pévki, i kédri rádi bláhosti, jedín sýj svjatýja Tróicy, jedínu ipostás imýj vo dvojú jestestvú, da spáséši čelovíčestvo."), ("Múčeničen", "", "Krestóm jákože ščitóm oblékšesja múčenicy, nevredími javístesja, vsími strilámi soďílateľa zlóby. Ťímže nýňi tohó popirájete, tomú ruhájuščesja jáko chuďíj ptíci vsehdá."), ("Múčeničen", "", "Zemľá úbo zínuvši, króvi váša priját, nébo že božéstvennyja priját dúchi, i so óhnennymi čínmi božéstvennomu prestólu predstoité, strastonósny múčenicy, cerkóvniji stolpí nepokolebímiji."), ("Bohoródičen", "", "Istľívšeje obnovíla jesí jestestvó práotčeje, páče jestestvá róždši, i ďívstvujušči, jestestvú vsemú sozdáteľa: jehóže na kresťí povíšena drévle víďašči, vosklicála jesí prečístaja Máti Ďívo."), ), "2": ( ("", "", "Ot Bóha Bóha Slóva, neizrečénnoju múdrostiju, prišédšaho obnovíti Adáma, jádiju v tľínije pádšaho ľúťi, ot svjatýja Ďívy neizrečénno voplotívšahosja nás rádi, vírniji jedinomúdrenno písňmi veličájem."), ("", "", "Čelovikoľúbija mjá božéstvennaho spodóbi otrokovíce, jáže jedína čelovikoľúbca Bóha, plóť ot tebé zaimovávša, neizhlahólanno róždši, izbávi mjá búduščaho plámene, i múki vsjákija, ľubóviju tebé slávjaščaho."), ("", "", "Jáko tvérduju predstáteľnicu, jáko upovánije i sťínu, i nadéždu, i pokróv tvérd, i neoborímoje utverždénije, i nebúrnoje pristánišče, jedínu krípkoje pribížišče sťažávše ťá vsí, spasájemsja vsepítaja."), ("", "", "Svít róždšaja božéstvennyj, mnóhimi pomračívšejesja strastéj naviďíňmi, i pomyšléňmi čuždáho, sérdce mojé prosvití otrokovíce, kápľu podajúšči mí prísno, ot skvérn hrichá Ďívo, očiščájuščuju mjá."), ), ), ), "ST": ( ("", "", "Krestá tvojehó drévo Christé Bóže, drévo živótnoje pokazál jesí nám vírujuščym v ťá, i sím uprazdníl jesí deržávu imúščaho smérti: oživíl že jesí ný umerščvlénnyja hrichóm. Ťímže vopijém tí: blahodáteľu vsích, Hóspodi sláva tebí."), ("", "", "Vóleju obniščáv obniščánija rádi Adámova Christé Bóže, prišél jesí na zémľu ot Ďívy voplóščsja, i raspjátije prijál jesí, da nás svobodíši ot rabóty vrážija, Hóspodi sláva tebí."), ("Múčeničen", "", "Vsják hrád i straná čtút móšči váša, o strástotérpcy múčenicy: vý bo zakónno postradávše, vincý nebésnyja prijáste, i sehó rádi svjatítelem jesté pochvalá i cérkvam blahoľípije."), ("Krestobohoródičen", "Jehdá ot dréva", "Hrózd vsezrílyj čístaja, jehóže nevozďílanno vo utróbi nosíla jesí, na drévi jáko uzríla jesí sehó povíšena, rydájušči vosklicála jesí, i vzyvála: čádo, sládosť iskápaj, jéjuže otímetsja pijánstvo vsjákoje strastéj, blahodáteľu, mené rádi tebé róždšija, svoím blahoutróbijem umoľájem."), ) ) #let L = ( "B": ( ("", "", "Hlás tí prinósim razbójnič, i mólimsja: pomjaní nás Spáse, vo cárstviji tvojém."), ("", "", "Na krest voznésšusja tí Spáse, sovoznésl jesí vsé čelovíčeskoje jestestvó, neprestánno pojúščeje ťá."), ("", "", "Adámovo rukopisánije kopijém tvojím razdrál jesí, tohó napisúja v knízi živých čelovikoľúbče."), ("", "", "Podóbnicy bývše raspjátije Preterpívšemu, tohó óbščnicy i slávi javístesja múčenicy."), ("", "", "Otéc prebeznačáľnyj, Sýn sobeznačáľnyj, da pojétsja vo jedínoj čésti i slávi kúpno so svjatým Dúchom."), ("", "", "Na kresťí jáko víďivši, jehóže bez símene rodilá jesí, tohó dolhoterpínije otrokovíce, vospivála jesí slezjášči."), ) )
https://github.com/tingerrr/subpar
https://raw.githubusercontent.com/tingerrr/subpar/main/test/default/test.typ
typst
MIT License
// Synopsis: // - references in text and outlines and figures themselves are correctly numbered // - the super figure supplement is propagated down to sub figures #import "/test/util.typ": * #import "/src/lib.typ" as subpar #outline(target: figure.where(kind: image)) #figure(fake-image, caption: [aaa]) #subpar.grid( figure(fake-image, caption: [Inner caption]),<a>, figure(fake-image, caption: [Inner caption]),<b>, columns: (1fr, 1fr), caption: [Outer caption], label: <full1>, ) #figure(fake-image, caption: [aaa]) #subpar.grid( figure(`adas`, caption: [Inner caption]), <c>, figure(fake-image, caption: [Inner caption]), <d>, columns: (1fr, 1fr), caption: [Outer caption], label: <full2>, ) #figure(fake-image, caption: [aaa]) See @full1, @a and @b. See also @full2, @c and @d.
https://github.com/SWATEngineering/Docs
https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/PianoDiProgetto/sections/AnalisiDeiRischi.typ
typst
MIT License
#import "../functions.typ": glossary, team = Analisi dei rischi L'attività di analisi dei rischi mira ad anticipare possibili situazioni avverse che possono emergere durante l'iter del progetto. Questa pratica consiste nel riconoscere, comprendere e classificare tali rischi in base alla loro probabilità di occorrenza e all'impatto sullo sviluppo del lavoro, cercando anche soluzioni preventive per mitigarne gli effetti dannosi. L'analisi dettagliata dei rischi è orientata all'ottimizzazione del progresso del progetto, in quanto consente di individuare nuove situazioni critiche e di perfezionare le strategie atte a minimizzarne gli impatti, mediante un monitoraggio costante. Di seguito vengono presentati i rischi identificati attraverso un processo di valutazione strutturato, che consente di evidenziare le fasi di individuazione, valutazione e prevenzione di tali rischi: - *Identificazione*: consiste nel riconoscimento e nell'enumerazione delle possibili situazioni sfavorevoli che possono verificarsi durante il progetto. È il processo di individuare e catalogare in modo esauriente tutti gli elementi che possono rappresentare una minaccia; - *Valutazione*: consiste nell'analisi dettagliata di ciascuna situazione rilevata durante l'identificazione, comprende anche l'assegnazione di un grado di probabilità di occorrenza e impatto per comprendere meglio il potenziale effetto sul progetto. Questo processo aiuta a classificare i rischi sulla base della loro gravità e della loro probabilità di manifestarsi; - *Prevenzione*: consiste nell'adozione di misure o strategie pro-attive per ridurre o mitigare l'incidenza e l'impatto dei rischi individuati. Questo comprende l'implementazione di azioni preventive e la messa in atto di piani di contingenza per affrontare efficacemente eventuali situazioni avverse. I rischi sono stati suddivisi a seconda della loro sfera di impatto: - Rischi Tecnologici; - Rischi di Comunicazione; - Rischi di Pianificazione. == Rischi Tecnologici === RT1 - Conoscenza tecnologica limitata La mancanza di familiarità o esperienza con le tecnologie specifiche impiegate nel progetto, può potenzialmente influenzare lo sviluppo e la qualità del software. - *Identificazione*: in principio è stata condotta un'analisi delle competenze tecniche di ciascun membro internamente al team, evidenziando le aree di conoscenza e le lacune individuali; successivamente è stata effettuata una breve consultazione con la Proponente con l'obiettivo di fornirle un'idea del livello attuale di competenze tecniche del team; - *Valutazione*: pericolosità: alta; occorrenza: alta; - *Prevenzione*: - Formazione da parte della Proponente: la Proponente organizza incontri periodici di formazione focalizzati sulle tecnologie specifiche utilizzate nel progetto, offrendo così al team la possibilità di colmare le lacune e approfondire le conoscenze; - #glossary("Workshop") interni: il team organizza #glossary[workshop] interni guidati dai membri più esperti su determinate tecnologie, consentendo loro di condividere conoscenze e esperienze con gli altri membri del team e favorendo l'apprendimento reciproco; - Lavoro in coppia: durante le fasi in cui lo sviluppo di codice richiede un contributo più rilevante, il team adotterà un approccio di lavoro in coppia. Questa pratica consentirà ai membri del team di condividere conoscenze e competenze, aiutandosi reciprocamente a superare le lacune individuali nelle conoscenze tecnologiche. === RT2 - Difficoltà nell'adozione degli strumenti di gestione del progetto Il team potrebbe incontrare sfide nell'apprendere l'utilizzo e nell'integrazione dei nuovi strumenti di gestione del progetto, causando ritardi nell'effettiva implementazione di un #glossary("way of working") efficiente. - *Identificazione*: la difficoltà nell'adozione degli strumenti può manifestarsi quando i membri del team incontrano dubbi o incertezze riguardo alle procedure da seguire o all'utilizzo degli strumenti stessi; - *Valutazione*: pericolosità: media; occorrenza: bassa; - *Prevenzione*: - _Norme di Progetto_: tutti i dettagli del #glossary[way of working] vengono concordati durante i meeting interni e normati all'interno delle _Norme di Progetto_. In caso di dubbi o incertezze, il riferimento a queste norme o la richiesta di chiarimenti all'Amministratore del progetto rappresentano un'importante risorsa per la risoluzione tempestiva di problemi legati agli strumenti e alle procedure; - Inclusione di dubbi nell'#glossary[ordine del giorno]: l'inclusione dei dubbi e delle incertezze nelle proposte dell'#glossary[ordine del giorno] del meeting interno successivo consente al team di affrontare in modo strutturato e tempestivo le difficoltà riscontrate, garantendo un ambiente in cui tali problemi possano essere risolti in modo collaborativo e efficiente. === RT3 - Produzione di codice poco comprensibile Il team, data l'inesperienza dei suoi componenti, potrebbe produrre codice difficile da comprendere o contorto. Questo, unito ad un'eventuale carenza di relativa #glossary[documentazione], potrebbe influenzare negativamente i tempi di sviluppo. - *Identificazione*: un segnale evidente della manifestazione di questo rischio è la crescita delle discussioni relative all'interpretazione del codice tra i componenti del team; - *Valutazione*: pericolosità: media; occorrenza: media; - *Prevenzione*: - Code reviews: effettuare revisioni regolari del codice; - Continuo refactoring: integrare all'interno del processo di sviluppo frequenti attività di refactoring mirate alla semplificazione del codice, in modo tale da aumentarne la comprensibilità; - #glossary[Documentazione] adeguata: incoraggiare la produzione di una #glossary[documentazione] approfondita per il codice; - Convenzioni di codifica: seguire le stesse linee guida porta il team a standardizzare il modo in cui il codice viene scritto, di conseguenza ne aumenta la chiarezza e la manutenibilità. == Rischi di Comunicazione === RC1 - Mancata organizzazione della comunicazione interna La mancata organizzazione della comunicazione interna si riferisce a situazioni in cui non esiste una struttura definita o linee guida chiare per la trasmissione efficace delle informazioni all'interno del team. Questa mancanza di direzione può portare a fraintendimenti, confusione o ritardi nella comunicazione. - *Identificazione*: questo rischio si manifesta quando non esiste una struttura chiara per la comunicazione all'interno del team, può essere riconosciuto attraverso il sovrapporsi di messaggi, discussioni disordinate o mancanza di canali dedicati; - *Valutazione*: pericolosità: bassa; occorrenza: bassa; - *Prevenzione*: - Pianificazione della comunicazione: stabilire canali di comunicazione specifici per diversi tipi di messaggi (ad esempio discussioni generali, questioni urgenti, cambiamenti dello stato delle issue nell'#glossary[ITS], proposte per l'#glossary[ordine del giorno] e altro); - #glossary[Ordine del giorno]: definire un #glossary[ordine del giorno] chiaro per i meeting interni settimanali, con tempi stabiliti per ciascun argomento; - #glossary[Stand-up meeting] giornalieri (anche da remoto): riunioni brevi e quotidiane favoriscono una migliore comprensione dello stato del progetto, consentendo a ciascun membro del team di aggiornare gli altri sui progressi, sulle sfide incontrate e sui prossimi passi. Questa pratica aiuta a identificare i problemi in modo tempestivo, a fornire supporto reciproco e a mantenere il team allineato con gli obiettivi comuni; - Meeting di emergenza: incontri non pianificati con i quali uno o più componenti possono invocare una discussione a livello di team per risolvere questioni urgenti legate a modifiche critiche da apportare alla #glossary[documentazione] o ad una porzione di codice. Dato il poco preavviso, in occasione di questi incontri il #glossary[quorum] viene abbassato da 4 a 3 persone su 6, in modo che i componenti interessati possano esporre e motivare le modifiche che intendono apportare e procedere a lavorare sul documento in questione senza dover necessariamente attendere l'incontro interno di fine #glossary[sprint]. === RC2 - Esasperazione di conflitti interni Questi rischi emergono quando diversi punti di vista, preferenze o approcci all'interno del team conducono a tensioni, disaccordi o scontri tra i membri. Questi conflitti possono manifestarsi in varie forme, come contrasti di opinione riguardo alle metodologie di lavoro, differenze nell'interpretazione dei requisiti del progetto o incomprensioni personali. - *Identificazione*: i conflitti interni possono essere riconosciuti attraverso segnali come un clima di tensione durante le discussioni, resistenze persistenti ad adottare soluzioni comuni, ritardi o difficoltà nella presa di decisioni; - *Valutazione*: pericolosità: media; occorrenza: bassa; - *Prevenzione*: - Politica di gestione dei disaccordi: consiste nell'offrire spazio ai membri in disaccordo per esporre le loro diverse prospettive in modo chiaro e rispettoso durante un meeting interno. Successivamente, il gruppo procede ad una votazione democratica per trovare una soluzione che ottenga il consenso della maggioranza dei partecipanti; - Mediatore interno: il Responsabile ha il ruolo di facilitare la risoluzione dei conflitti ascoltando entrambe le parti coinvolte, mediando la discussione in modo imparziale e cercando una soluzione che soddisfi le esigenze di entrambe le parti o che sia accettabile per la maggioranza del team. === RC3 - Frequenza limitata nella comunicazione con la Proponente Si tratta della ridotta frequenza o della mancanza di contatti regolari e tempestivi con la Proponente, limitando così la disponibilità di informazioni cruciali o l'accesso a chiarimenti durante lo svolgimento del progetto. - *Identificazione*: Si rileva quando non ci sono comunicazioni regolari o risposte tempestive dalle parti interessate della Proponente in risposta a domande o richieste di chiarimenti; - *Valutazione*: pericolosità: media; occorrenza: bassa; - *Prevenzione*: - Aggiornamenti regolari: mantenere la Proponente informata sugli sviluppi in modo regolare (almeno una volta alla settimana) e chiedere feedback quando necessario; - Invio anticipato di domande: invio di email prima di ogni meeting esterno con la Proponente, presentando in anticipo le domande o i punti da discutere durante il meeting. Questo offre alla Proponente il tempo di prepararsi adeguatamente e fornire risposte dettagliate durante il meeting; - Consegna anticipata di materiale: quando si tratta di #glossary[sprint retrospective] o di qualsiasi revisione congiunta, fornire la #glossary[documentazione] o il codice prodotto nel rispettivo #glossary[sprint] il prima possibile, in modo che la Proponente abbia tempo sufficiente per esaminarlo in modo approfondito prima del meeting. Ciò permette una discussione più efficace e informativa durante il meeting stesso. === RC4 - Mancanza di fiducia I diversi livelli di competenze e una comunicazione poco trasparente possono portare allo sviluppo di un clima di sfiducia reciproca tra i membri del team: ciò potrebbe compromettere il successo del progetto. - *Identificazione*: la mancanza di fiducia può essere rilevata in presenza di segnali specifici come la reticenza nella collaborazione o nell'assunzione di responsabilità condivise. In aggiunta, alcuni membri potrebbero dimostrarsi poco attivi nelle discussioni di gruppo o nelle attività cooperative; - *Valutazione*: pericolosità: media; occorrenza: bassa; - *Prevenzione*: - Promuovere incontri periodici: i membri del team hanno la possibilità di esprimere dubbi e preoccupazioni, avere una discussione aperta su aspetti rilevanti del progetto e ricevere feedback sul lavoro fatto. In questo contesto va precisato che la costruzione del feedback assume un ruolo fondamentale, in quanto deve essere formulato in maniera tale da risultare costruttivo e presentato come un opportunità di miglioramento, anziché solamente come critica; - Promuovere la comprensione reciproca: il team si deve sforzare nel comprendere le condizioni e i punti di vista degli altri componenti per creare un clima di progetto positivo, indirizzato verso il miglioramento. === RC5 - Context switch Con l'espressione #glossary("context switch") ci si riferisce al cambiamento dei ruoli all'interno del team. Questo passaggio da un ruolo ad un altro comporta la necessità di adattarsi rapidamente alle nuove responsabilità e di comprendere appieno ciò che è stato svolto dal membro del team che ha ricoperto un determinato ruolo per ultimo. - *Identificazione*: difficoltà nella comprensione del lavoro svolto fino al quel momento; - *Valutazione*: pericolosità: bassa; occorrenza: alta; - *Prevenzione*: - La persona che ha precedentemente occupato quel ruolo specifico offre supporto al membro del team che ha assunto ora quella posizione, facilitandone la transizione; - Assistere l'Amministratore nella creazione delle attività per il prossimo #glossary[sprint]\; - Dedicare il primo giorno unicamente allo studio di quanto fatto precedentemente, in modo da riuscire a sincronizzarsi con il contesto del ruolo. == Rischi di Pianificazione === RP1 - Comprensione erronea dei requisiti La comprensione erronea dei requisiti indica il potenziale malinteso o fraintendimento dei requisiti del progetto, che potrebbe portare a interpretazioni errate o divergenti da parte del team riguardo alle funzionalità o agli obiettivi del prodotto. - *Identificazione*: questo rischio può manifestarsi quando ci sono ambiguità nei requisiti documentati o quando i membri del team interpretano in modo differente i requisiti. È evidente quando emergono domande costanti riguardo ai requisiti durante le discussioni o quando si presentano discrepanze nelle interpretazioni durante le attività di progettazione; - *Valutazione*: pericolosità: alta; occorrenza: media; - *Prevenzione*: - _Analisi dei Requisiti_: creazione di un documento chiaro e dettagliato contenente casi d'uso, requisiti funzionali e non funzionali, in modo da offrire una visione esaustiva e condivisa dei requisiti del progetto; - Sessioni di analisi e confronto dei requisiti con la Proponente: organizzazione di incontri regolari con la Proponente, durante i quali verranno presentati i requisiti identificati, discusse le interpretazioni e validate le esigenze. Queste sessioni permetteranno di raffinare e chiarire i requisiti iniziali, riducendo il rischio di interpretazioni erronee e garantendo una comprensione accurata delle necessità del cliente; - Adozione del #glossary[framework Scrum]: l'implementazione del #glossary[framework Scrum] fornisce continui momenti di verifica e adattamento durante lo sviluppo del progetto. Tale approccio offre l'opportunità di identificare tempestivamente eventuali fraintendimenti o ambiguità nei requisiti, permettendo al team di chiarirli e correggerli nel minor tempo possibile. === RP2 - Disallineamento delle componenti architetturali Questo rischio riguarda la possibilità di progettare componenti all'interno dell'#glossary[architettura] del #glossary[sistema] che potrebbero risultare incompatibili o in disaccordo una volta integrate o combinate. Ciò può generare conflitti nell'interoperabilità delle parti e compromettere la coesione del #glossary[sistema] nel suo insieme. - *Identificazione*: questo rischio è individuabile durante le fasi di progettazione, quando si evidenziano incongruenze tra le interfacce delle varie componenti o quando emergono problemi di compatibilità durante l'integrazione preliminare di parti del #glossary[sistema]\; - *Valutazione*: pericolosità: media; occorrenza: media; - *Prevenzione*: - Metodologia di progettazione modulare: adottare un approccio modulare durante la progettazione architetturale, suddividendo il #glossary[sistema] in componenti chiare e ben definite. Questo aiuta a identificare in anticipo eventuali discrepanze tra le parti e favorisce l'interoperabilità; - Revisioni incrociate: effettuare revisioni incrociate della progettazione tra membri del team per identificare potenziali disallineamenti o incongruenze nelle interfacce delle varie componenti. Questa pratica consente di individuare e risolvere precocemente i conflitti; - Test di integrazione preliminari: condurre test preliminari di integrazione delle componenti principali agli inizi della progettazione. Questi test aiutano a valutare la compatibilità e l'interoperabilità delle varie parti, riducendo così il rischio di disallineamento nell'#glossary[architettura] finale. === RP3 - Variazioni nei tempi e costi del progetto Questo rischio si riferisce alla possibilità di variazioni significative rispetto alle tempistiche e ai costi pianificati inizialmente per lo sviluppo del progetto. - *Identificazione*: è individuabile attraverso l'osservazione di cambiamenti significativi nelle tempistiche di completamento delle attività rispetto alla pianificazione originale, così come variazioni notevoli nei costi di realizzazione; - *Valutazione*: pericolosità: alta; occorrenza: media; - *Prevenzione*: - Pianificazione flessibile: adottare una pianificazione flessibile che preveda margini di tempo e costi per eventuali imprevisti o variazioni; - Rendicontazione di ore produttive: si utilizza uno #glossary[spreadsheet] dedicato nel quale ciascun membro del team registra quotidianamente le ore produttive utilizzate, specificando le attività svolte e il ruolo assunto. Questo approccio consente di trarre conclusioni riguardo allo stato delle ore totali impiegate e al budget iniziale disponibile, permettendo una migliore gestione delle risorse nel progetto; - Monitoraggio costante: si mantiene un monitoraggio costante del progresso del progetto, permettendo l'aggiornamento della pianificazione in caso di variazioni significative. In particolare, all'interno dell'#glossary[ITS] si effettua un costante aggiornamento delle date di inizio e fine per ogni issue, riflettendo con precisione le tempistiche effettive. Inoltre, si utilizza regolarmente la vista Gantt all'interno della Kanban Board del progetto in GitHub per visualizzare la pianificazione temporale e individuare potenziali variazioni o sovrapposizioni nelle attività pianificate. === RP4 - Impegni universitari Questo rischio riguarda la potenziale difficoltà dei membri del team, nel dedicare il tempo richiesto al progetto a causa degli impegni universitari, con particolare riferimento alla sessione di esami invernale. - *Identificazione*: - Questo rischio è individuabile attraverso l'osservazione di un rallentamento delle attività di progetto; - Nella fase di pianificazione viene identificato il periodo in cui è prevista la fase di preparazione per gli esami. - *Valutazione*: pericolosità: alta; occorrenza: media; - *Prevenzione*: nei periodi più intensi, si procederà a ridurre le ore di lavoro dedicate al progetto, consentendo così ai membri del team di concentrarsi sugli studi. == Tabella riassuntiva I rischi individuati vengono riportati in tabella, assieme alla loro pericolosità e occorrenza: #table( columns: (60%, 20%, 20%), align: (left, center, center), [*Rischio*], [*Pericolosità*], [*Occorrenza*], [*RT1* - Conoscenza tecnologica limitata], [Alta], [Alta], [*RT2* - Difficoltà nell'adozione degli strumenti di gestione del progetto], [Media], [Bassa], [*RT3* - Produzione di codice poco comprensibile], [Media], [Media], [*RC1* - Mancata organizzazione della comunicazione interna], [Bassa], [Bassa], [*RC2* - Esasperazione di conflitti interni], [Media], [Bassa], [*RC3* - Frequenza limitata nella comunicazione con la Proponente], [Media], [Bassa], [*RC4* - Mancanza di fiducia], [Media], [Bassa], [*RC5* - Context Switch],[Bassa],[Alta], [*RP1* - Comprensione erronea dei requisiti], [Alta], [Media], [*RP2* - Disallineamento delle componenti architetturali], [Media], [Media], [*RP3* - Variazioni nei tempi e costi del progetto], [Alta], [Media], [*RP4* - Impegni universitari], [Alta], [Media] )
https://github.com/The-Notebookinator/notebookinator
https://raw.githubusercontent.com/The-Notebookinator/notebookinator/main/.github/CONTRIBUTING.md
markdown
The Unlicense
<!-- omit in toc --> # Contributing to the Notebookinator First off, thanks for taking the time to contribute! ❤️ All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: > > - Star the project > - Refer this project in your project's readme > - Mention the project to other competitors <!-- omit in toc --> ## Table of Contents - [I Have a Question](#i-have-a-question) - [I Want To Contribute](#i-want-to-contribute) - [Reporting Bugs](#reporting-bugs) - [Suggesting Enhancements](#suggesting-enhancements) - [Your First Code Contribution](#your-first-code-contribution) - [Improving The Documentation](#improving-the-documentation) - [Style Guides](#style-guides) - [Typst Code](#typst-code) - [Commit Messages](#commit-messages) - [Branches](#branches) ## I Have a Question > If you want to ask a question, we assume that you have read the available [Documentation](https://the-notebookinator.github.io/notebookinator/). Before you ask a question, it is best to search for existing [Issues](https://github.com/BattleCh1cken/notebookinator.git/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. If you then still feel the need to ask a question and need clarification, we recommend the following: - Open an [Issue](https://github.com/BattleCh1cken/notebookinator.git/issues/new). - Provide as much context as you can about what you're running into. - Provide project and platform versions (typst, other packages, etc), depending on what seems relevant. We will then take care of the issue as soon as possible. ## I Want To Contribute > ### Legal Notice <!-- omit in toc --> > > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project licence. ### Reporting Bugs <!-- omit in toc --> #### Before Submitting a Bug Report A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. - Make sure that you are using the latest version. - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](../docs.pdf). If you are looking for support, you might want to check [this section](#i-have-a-question)). - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/BattleCh1cken/notebookinator.git/issues?q=label%3Abug). - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. - Collect information about the bug: - Stack trace (Traceback) - OS, Platform and Version (Windows, Linux, MacOS, x86, ARM) - Typst version - Notebookinator version - Versions of any other relevant libraries - Relevant code snippets - Can you reliably reproduce the issue? And can you also reproduce it with older versions? <!-- omit in toc --> #### How Do I Submit a Good Bug Report? > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <<EMAIL>>. We use GitHub issues to track bugs and errors. If you run into an issue with the project: - Open an [Issue](https://github.com/BattleCh1cken/notebookinator.git/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behaviour you would expect and the actual behaviour. - Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. Once it's filed: - The project team will label the issue accordingly. - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs reproduction`. Bugs with the `needs reproduction` tag will not be addressed until they are reproduced. - If the team is able to reproduce the issue, it will be marked `bug`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). <!-- You might want to create an issue template for bugs and errors that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. --> ### Suggesting Enhancements This section guides you through submitting an enhancement suggestion for the Notebookinator, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. <!-- omit in toc --> #### Before Submitting an Enhancement - Make sure that you are using the latest version. - Read the [documentation](../docs.pdf) carefully and find out if the functionality is already covered, maybe by an individual configuration. - Perform a [search](https://github.com/BattleCh1cken/notebookinator.git/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. <!-- omit in toc --> #### How Do I Submit a Good Enhancement Suggestion? Enhancement suggestions are tracked as [GitHub issues](https://github.com/BattleCh1cken/notebookinator.git/issues). - Use a **clear and descriptive title** for the issue to identify the suggestion. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behaviour** and **explain which behaviour you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on MacOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. - **Explain why this enhancement would be useful** to most of the Notebookinator's users. You may also want to point out the other projects that solved it better and which could serve as inspiration. <!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. --> ### Your First Code Contribution > Using a development environment different from the one recommended below is fine, but you will have to adjust the steps yourself. We recommend using [Visual Studio Code](https://code.visualstudio.com/) as your IDE. It is free, open-source, and cross-platform. We also recommend the following extensions: - [Typst LSP](https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp) - [Typst Preview](https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview) - [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) to check for spelling mistakes Of course, you'll also need to install [Typst](https://github.com/typst/typst#installation). In order to contribute to the Notebookinator, you will need to [fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the repository and clone it to your local machine. Once you've cloned your repository, you can make your changes. When you're ready to test your changes, create a file called `test.typ` in the root of the project, and import `lib.typ`. View the output with Typst Preview, or render it yourself with `typst compile test.typ` You can then [commit](#commit-messages) your changes to your fork. Once you are done, you can [create a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) to the master branch. You can use the [Pull Request Template](PULL_REQUEST_TEMPLATE.md) to structure your pull request. ### Improving The Documentation We use a combination of [mdBook](https://github.com/rust-lang/mdBook) and [Tidy](https://github.com/Mc-Zen/tidy/tree/main) to generate our documentation. All of the documentation can be found inside of the [`docs/`](../docs) directory. - The guides located in [`docs/src/`](../docs/src) - The comments directly in the code - The [README](../README.md) - The [contributing guide](./CONTRIBUTING.md)(this file) You can preview your changes locally with the mdbook cli. The first thing you'll need to do is install all of the dependences. ```bash cargo install --git https://github.com/typst/typst --locked typst-cli cargo install mdbook cargo install mdbook-admonish cargo install --git https://github.com/fenjalien/mdbook-typst-doc.git ``` Once everything has installed, render the documentation with these commands: ```bash typst compile docs/src/reference.typ --root ./ cd docs mdbook serve ``` You can then view your notebook by visiting <localhost:8000>. Once you've made your changes, submit your changes as a pull request, as described above. ## Style Guides ### Typst Code Currently we do not have an established coding style. In the future we'll use the [Typstfmt](https://github.com/astrale-sharp/typstfmt) formatter to enforce our style, but it is not robust enough to meet our needs as of now. ### Commit Messages Commit messages should be short and descriptive. This project follows the [Gitmoji](https://gitmoji.dev/about) commit style. Use the unicode version of the emojis wherever possible. This means you should write 🔥 instead of :fire:. ### Branches Branches must have labels depending on what the branch changes to the project. - Fix: improves a pre-existing feature - Feature: adds a new feature - Theme: adds a new theme A complete branch name would be **theme/your-theme-name** or **feature/theme-cover**. ## Attribution This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!
https://github.com/Nerixyz/icu-typ
https://raw.githubusercontent.com/Nerixyz/icu-typ/main/docs/docs/fmt-time.md
markdown
MIT License
# `fmt-time` ```typst-code let fmt-time( dt, locale: "en", length: "short" ) ``` Formats a time in some [`locale`](#locale). ## Arguments ### `dt` The time to format. This can be a [`datetime`][datetime] or a dictionary with `hour`, `minute`, `second`. example{ ```typst +preview #fmt-time(datetime( hour: 13, minute: 5, second: 0, )) \ #fmt-time(( // (1)! hour: 14, minute: 53, second: 0, ), locale: "be") ``` 1. Time passed as a dictionary }example ### `locale` The locale to use when formatting the time. A [Unicode Locale Identifier]. example{ ```typst +preview #let f(locale) = fmt-time( (hour: 13, minute: 5, second: 23), locale: locale, length: "medium", ) // (1)! - #f("it") - #f("ar") - #f("en-u-hc-h12") - #f("en-u-hc-h24") - #f("ne") - #f("ms") - #f("de") ``` 1. Wrapper to set the length }example ### `length` The length of the formatted time (`#!typst-code "medium"`, `#!typst-code "short"` (default)). example{ ```typst +preview #let time = ( hour: 13, minute: 5, second: 23 ) - #fmt-time(time, length: "medium") - #fmt-time(time, length: "medium", locale: "tg") - #fmt-time(time, length: "short") - #fmt-time(time, length: "short", locale: "gd") ``` }example [datetime]: https://typst.app/docs/reference/foundations/datetime/ [Unicode Locale Identifier]: https://unicode.org/reports/tr35/tr35.html#Unicode_locale_identifier
https://github.com/ilsubyeega/circuits-dalaby
https://raw.githubusercontent.com/ilsubyeega/circuits-dalaby/master/Type%201/final.typ
typst
2024-04-11 2326031 #include "1/mod.typ" #include "2/mod.typ"
https://github.com/hrbrmstr/2023-10-20-wpe-quarto-typst
https://raw.githubusercontent.com/hrbrmstr/2023-10-20-wpe-quarto-typst/main/blank-test/_extensions/blank/typst-template.typ
typst
#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 }
https://github.com/rdboyes/resume
https://raw.githubusercontent.com/rdboyes/resume/main/modules_en/professional.typ
typst
// Imports #import "@preview/brilliant-cv:2.0.2": cvSection, cvEntry #let metadata = toml("../metadata.toml") #let cvSection = cvSection.with(metadata: metadata) #let cvEntry = cvEntry.with(metadata: metadata) #cvSection("Professional Experience") #cvEntry( title: [Director of Analytics], society: [Presage Group, Inc.], logo: image("../src/logos/presage.jpeg"), date: [2021 - Present], location: [Burlington, ON], description: list( [Lead a team of data scientists and analysts to solve problems and answer questions for clients in the airline industry], [Collaborate with executive leadership to implement best practices for data governance, quality, and security], ) ) #cvEntry( title: [Data Scientist], society: [Sunnybrook Health Sciences Centre], logo: image("../src/logos/sunnybrook.png"), date: [2020 - 2021], location: [Toronto, ON], description: list( [Worked with a team of physicians and analysts to developed a prediction model for cancer outcomes using large health databases.] ), ) #cvEntry( title: [Data Scientist], society: [UManitoba & Royal Canadian Dental Corps], logo: image("../src/logos/rcdc.png"), date: [2018 - 2020], location: [Saint-Jean-sur-Richelieu, QC], description: list([Developed a prediction model for dental readiness in the Canadian Armed Forces.]), ) #cvEntry( title: [Adjunct Professor], society: [Queen's University], logo: image("../src/logos/QueensLogo_colour.png"), date: [2015 - 2019], location: [Kingston, ON], description: list([Taught seven semesters of graduate-level statistics and quantitative analysis courses for the School of Policy Studies.]), )
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/opticalsize_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test script-script in a fraction. $ 1/(x^A) $ #[#set text(size:18pt); $1/(x^A)$] vs. #[#set text(size:14pt); $x^A$]
https://github.com/msakuta/typst-test
https://raw.githubusercontent.com/msakuta/typst-test/master/euler-lagrange.typ
typst
#set page( numbering: "1", ) #set heading(numbering: "1.") #set math.equation(numbering: "(1)") #show link: underline #align(center, text(17pt)[ *Euler-Lagrange Equation* ]) #outline() = Euler-lagrange equation Euler-Lagrange equation is defined as below. $ (diff cal(L)) / (diff q_i) - d / (d t) (diff cal(L)) / (diff dot(q_i)) = 0 $ <euler> where $L$ is Lagrangean, $q_i$ generalized coordinate, $dot(q)_i$ generalized velocity (generalized coordinate derived w.r.t time). Lagrangean is defined as $ L = T - V $ where $T$ is kinetic energy, $V$ potential energy. When you are thrown at this equations you would understand nothing and will have hard time to remember, but this is really powerful tool to analyze mechanics and derive Newtonian equation of motion especially when it's not in inertial frame of reference. You would get use to it as you examine useful examples and picture the intuition. == Derivation Consider an particle's coordinate $x$ changes over time. This coordinate can be expressed as a function of time $x(t)$. Suppose this particle have coordinate $x_0$ at $t = t_0$ and $x_1$ at $t = t_1$. Let's consider a function of the coordinate and velocity $f(x, dot(x))$. The integral of this function between $x(t_0) = x_0$ and $x(t_1)=x_1$ is called the action. If we write it down, it will be $ A = integral_(t_0)^(t_1) f(x(t), dot(x)(t)) dif t $ === Principle of least Action We will apply something called the principle of least action here. The principle of least action tells us that physical phenomena follow the laws that minimize the thing called the action. As it is the principle, no one can answer why it is true, but it's derived law from experience and observation over thousands of years worth. For example, if you toss up a ball, it will follow parabolic trajectory, and the light will track the path with shortest travel time (Fermat's principle). These are examples of laws derived from the principle of least action. There are other countless examples in electromagnetism, quantum mechanics and relativity. Also, we assume the action to be continuous function. The objective from now on is to derive differential equations from fiddling with the action, which yields equation of motion. For this purpose, we don't like the action to be discontinuous function of x or non differentiable. In reality, most of physical phenomena can be approximated as continuous functions, so we rarely put the assumption explicitly. From these assumptions, we can say that searching the minimum is the same as searching the stationary point. To be precise, the maxima, the saddle points or the extrema can be stationary points, but it seems that the action associated with Lagrange function has only one stationary point at the minimum. I can't prove that, if you ask me. A little special thing about the stationary point is that what we want to “station” against is not variables but the function. We want to fiddle the function shape of $f(x, dot(x))$ to make the $A$ minimum. The variational principle expresses this by putting $delta$ in front of the function. That is, the condition of stationary point is $ delta A = integral_(t_0)^(t_1) delta f(x, dot(x)) dif t = 0 $ Then, what is $delta f(x, dot(x))$ exactly? In order to think about this, let's discretize $f$ first. That is, consider $x$ to be discrete values $x_i$ rather than continuous variable. If we write the interval of $t$ in this discretization as $epsilon$, we can express $f$ as $ f(x_i, (x_i - x_(i - 1)) / epsilon). $ Now, what happens to $f$ when we change the value of $i$th value $x_i$? First, let's write down $f$'s partial derivative at $i$th sample $f_i$ w.r.t. $x_i$, $ diff / (diff x_i) &= diff / (diff x_i) f (x_i, (x_i - x_(i - 1)) / epsilon) \ &= (diff f_i) / (diff x_i) + (diff v_i) / (diff x_i) (diff f_i) / (diff v_i) \ &= (diff f_i) / (diff x_i) + 1 / epsilon (diff f_i) / (diff v_i) $ where I defined $v_i equiv (x_i - x_(i-1)) / epsilon$ for brevity. We also need to consider the contribution from $f_i + 1$ to calculate total effect on $(diff f) / (diff x_i)$. $ diff / (diff x_i) f_(i+1) &= diff / (diff x_i) f(x_(i+1), (x_(i+1) - x_i) / epsilon) \ &= (diff v_(i + 1)) / (diff x_i) (diff f_(i + 1)) / (diff v_(i + 1)) \ &= - 1 / epsilon (diff f_(i + 1)) / (diff v_(i + 1)) $ Therefore, the net change is $ (diff f_i) / (diff x_i) + 1 / epsilon (diff f_i) / (diff v_i) - 1 / epsilon (diff f_(i + 1)) / (diff v_(i + 1)). $ Now, $(f_(i + 1) - f_i) / epsilon$ is nothing but derivative in the limit of $epsilon -> 0$. Also, $v_i$ becomes the derivative of position w.r.t. time, that is, velocity. Taking the limit yields $ (diff f_i) / (diff x_i) - d / (d t) (diff f_i) / (diff dot(x)_i) = 0. $ At the limit of continuous function, the subscript $i$ disappears and the variable t becomes continuous variable instead, which yields the Euler-Lagrange @euler. == Rotating coordinates Suppose $x,y$ plane is in inertial frame of reference. Let's consider a frame of reference, $X,Y$, that has common origin and rotates with angular velocity of $omega$. The conversion of coordinates can be written down as $ x &= X cos(omega t) + Y sin(omega t) \ y &= X sin(omega t) − Y cos(omega t). $ <rotating> Let's examine how a free particle moves in this frame of reference. The particle will, of course, move in linear motion, but rotating frame of reference does not satisfy Newton's law of motion. You could transform the coordinate systems from Cartesian coordinates, but it's going be really tedious. Euler-Lagrange equation is said to be able to derive the law of motion far more easily, but if you actually try it, it's not so easy. Anyway, a free particle's Lagrangean is, if we assign zero to the potential term, $ cal(L) = m / 2 (dot(x)^2 + dot(y)^2). $ Now, if we assign @rotating and do grindy calculation, $ cal(L) = m / 2 (dot(X)^2 + dot(Y)^2) + (omega^2 m) / 2 (X^2 + Y^2) + (omega m) / 2 (X dot(Y) - Y dot(X)). $ The first term on the right hand side can be interpreted as kinetic energy from linear motion. The second term can be interpreted as centrifugal force. If you assign $r = X^2 + Y^2$ and derive with $r$, it should be clear that it becomes force towards radially outward. The last term depends on both position and velocity. The force exerted from this term is called Coriolis force. Let's derive Euler-Lagrange equation along $X$ component. $ (diff cal(L)) / (diff X) - d / (d t) (diff cal(L)) / (diff dot(X)) = omega^2 m X + (omega m) / 2 dot(Y) - m dot.double(X) + (omega m) / 2 dot(Y) = 0 \ therefore m dot.double(X) = omega^2 m X + omega m dot(Y) $ If we compare it with $m a = F$, the first term on the right hand side is centrifugal force, but the second term is proportional to the velocity perpendicular to the $X$ axis. If you derive the equation similarly for $Y$, you will also get a term proportional to $dot(X)$. This means Coriolis force is a force perpendicular to velocity vector. It will not affect the absolute value of velocity vector, which means the kinetic energy will not change due to this force, but the direction will. It is worth noting that analogous to Lorentz force in electromagnetism where a charged particle moves in a magnetic field. == Polar coordinates What happens in polar coordinates? Polar coordinates frame of reference itself won't change over time, but the coordinates of a moving particle can. The coordinates are designated by $r, theta$. The conversion rule is simply $ x &= r cos(theta) \ y &= r sin(theta). $ Let's derive free particle's Lagrangean by assigning zero to potential similar to the previous section. $ cal(L) &= m / 2 (dot(x)^2 + dot(y)^2) \ &= m / 2 (dot(r)^2 + r^2 dot(theta)^2) $ Now, from the Euler-Lagrangean equation along $r$ axis, $ (diff cal(L)) / (diff r) - d / (d t) (diff cal(L)) / (diff dot(r)) &= m r dot(theta)^2 - d / (d t) m dot(r) \ &= m r dot(theta)^2 - m dot.double(r) = 0 \ therefore m r dot(theta)^2 &= m dot.double(r). $ If we compare this equation to $F = m a$, we can say that the left hand side is a force proportional to $θ^2$, which is centrifugal force. Also, from Euler-Lagrange equation along $theta$, $ (diff cal(L)) / (diff theta) - d / (d t) (diff cal(L)) / (diff dot(theta)) = - m r^2 dot(theta) = 0. $ This is law of angular momentum conservation. = Symmetry and conservation laws The law of angular momentum conservation that we derived above is an ad-hoc solution and we would be lost if we introduce more general coordinates. So we consider making the argument general by a set of generalized coordinates. First, from the variational principle, we can write that $ delta f(arrow(q)) = sum_i (diff f) / (diff q_i) delta q_i $ where $f(arrow(q))$ is a function depending all of $q_i (i=1,2,…,n)$. This is the same expression as the total differentiation. Now, we will define a thing called symmetry. The symmetry is to add a small derivation to the coordinates (either shifting frame of reference or moving all particles) in a way that won't change Lagrangean. For example, translation of origin and rotation of coordinates are classified as symmetry. We can write a variation on a generalized coordinate $delta q_i$ with a set of functions $f_i(arrow(q))$ as $ delta q_i = f_i (arrow(q)) delta $ <variation> where $delta$ that is not in front of a variable indicates small value itself. The equation means the variation can be approximated within $delta$. Lagrangean is a function of generalized coordinates $q_i$ and generalized velocities $dot(q)_i$, so it variation can be written as $ delta cal(L)(arrow(q), arrow(dot(q))) = sum_i ((diff cal(L)) / (diff q_i) delta q_i + (diff cal(L)) / (diff dot(q)_i) delta dot(q)_i). $ <general> Now, we have derived that if Lagrangean satisfies Euler-Lagrange equation, i.e. satisfies laws of motion, we can say @euler. For brevity, we introduce a symbol $ (diff cal(L)) / (diff dot(q)_i) equiv p_i. $ <Lqdotp> which is synonymous to momentum in classical mechanics, but it can represent more abstract quantity in quantum mechanics. With this we can rewrite Euler-Lagrange equation as $ (diff cal(L)) / (diff q_i) = dot(p)_i. $ <Lqpdot> We can use this to rewrite @general as $ delta cal(L)(arrow(q), arrow(dot(q))) = sum_i (dot(p)_i delta q_i + p_i delta dot(q)_i) $ With the law of derivative of product, we can also write $ delta cal(L)(arrow(q), arrow(dot(q))) = d / (d t) sum_i p_i delta q_i. $ Now, let's say $delta q_i$ is a variation that is generated from symmetry. Then, Lagrangean should not change, so we can write with @variation $ d / (d t) sum_i p_i delta q_i &= d / (d t) sum_i p_i f_i (arrow(q)) delta \ &= 0. $ By factoring out $delta$, we can write $ d / (d t) sum_i p_i f_i (arrow(q)) = 0 $ Then, the quantity inside derivative w.r.t. time, $ Q equiv sum_i p_i f_i (arrow(q)) $ is the value to be conserved. If you compute this in actual coordinates, it becomes the law of momentum conservation or angular momentum conservation. This is an application of #link("https://en.wikipedia.org/wiki/Noether%27s_theorem")[Noether's theorem]. = Time translational symmetry and energy conservation In the previous section, we have derived momentum conservation law from the symmetry of translation and rotation. Now we will derive energy conservation law from time translational symmetry. Time translational symmetry means there is no explicit dependence of Lagrangean to time variable. In other words, Lagrangean is a function of only $q_i, dot(q)_i$. We can also express this as $cal(L)(arrow(q), arrow(dot(q)))$. Now, let's write derivative of Lagrangean w.r.t. time. $ (d cal(L)(arrow(q), arrow(dot(q)))) / (d t) = sum_i { (diff cal(L)) / (diff q_i) dot(q)_i + (diff cal(L)) / (diff dot(q)_i) dot.double(q)_i }. $ Here we can use @Lqdotp and @Lqpdot to reduce it to $ (d cal(L)) / (d t) = sum_i (p_i dot(q) + dot(p)_i dot.double(q)_i). $ Now we use the law of differentiation on product again. This kind of tricks occur over and over again. We don't have much variety on that. $ (d cal(L)) / (d t) = sum_i d / (d t) p_i dot(q)_i $ Now, we got a equation with both side is derivative w.r.t. time. So we can rewrite as $ d / (d t) { cal(L) - sum_i p_i dot(q)_i } = 0. $ Here, the contents being derived by time $ cal(H) equiv sum_i p_i dot(q)_i - cal(L) $ is called Hamiltonian. It seems that the sign of the Hamiltonian is defined in this way by historical reasons. It means Hamiltonian is conserved when there is time translational symmetry. Let's write down Hamiltonian in Cartesian coordinates. The momentum becomes $p_i = m_i dot(x)_i$, so we can write $ cal(H) &= sum_i p_i dot(q)_i - cal(L) \ &= sum_i [m_i dot(x)_i^2 - { m / 2 dot(x)_i - V(x_i)}] \ &= sum_i { (m dot(x)_i^2) / 2 + V(x_i) }. $ This is sum of kinetic energy and potential energy, which is total energy. In general, in a classical system, Hamiltonian becomes total energy. In quantum mechanics, we cannot write down Hamiltonian this easily as the sum of kinetic and potential energy, nevertheless conserved quantity. Now what will happen if there is no time translational symmetry. We can repeat the argument from (8) through (9) with the condition that $cal(L)$ has explicit time dependence $cal(L)(arrow(q), arrow(dot(q)), t)$, which yields $ (d cal(L)) / (d t) &= sum_i d / (d t) p_i dot(q)_i + (diff cal(L)) / (diff t) \ (d cal(H)) / (d t) &= - (diff cal(L)) / (diff t). $ Why we get a negative sign in this equation is the matter of definition. No matter how its sign is defined, the fact that Hamiltonian is conserved won't change. == Hamilton's equations Let's obtain total differentiation of Hamiltonian. $ d cal(H) = sum_i [ dot(q)_i d p_i + p_i d dot(q) - (diff cal(L)) / (diff dot(q)_i) d dot(q)_i - (diff cal(L)) / (diff q_i) d q_i] $ Now, we can use $(diff cal(L)) / (diff dot(q)_i) = p_i$, $(diff cal(L)) / (diff p_i) = dot(q)_i$ to simplify it to $ d cal(H) = sum_i (dot(q)_i d p_i - dot(p)_i d q_i) $ We can apply partial derivative to each of $p_i$ and $q_i$ to the Hamiltonian to obtain $ (diff cal(H)) / (diff p_i) &= dot(q)_i \ (diff cal(H)) / (diff q_i) &= - dot(p)_i $ These are Hamilton's equations. = References + #link("https://www.youtube.com/watch?v=3apIZCpmdls")[<NAME>, Classical Mechanics | Lecture 3] + #link("https://www.youtube.com/watch?v=ojEwHlyty4Q")[<NAME>, Classical Mechanics | Lecture 4] + #link("https://www.youtube.com/watch?v=lW9GJ0aiaNc")[<NAME>, Classical Mechanics | Lecture 5] + #link("https://en.wikipedia.org/wiki/Noether%27s_theorem")[Wikipedia's Noether's theorem article]
https://github.com/Mc-Zen/quill
https://raw.githubusercontent.com/Mc-Zen/quill/main/src/length-helpers.typ
typst
MIT License
#let get-length(len, container-length) = { if type(len) == length { return len } if type(len) == ratio { return len * container-length} if type(len) == relative { return len.length + len.ratio * container-length} }
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/enum-01.typ
typst
Other
0. Before first! 1. First. 2. Indented + Second
https://github.com/QQKdeGit/bupt-typst
https://raw.githubusercontent.com/QQKdeGit/bupt-typst/master/README.md
markdown
MIT License
# 北京邮电大学本科学士学位论文模板 北邮苦 Word 和 LaTeX 久矣,于是就出现了用 [Typst](https://github.com/typst/typst) 编写的毕业论文模板。 欢迎提出任何 Issue 和 PR 帮助完善这个模板。 ## 在线编辑 进入 [Typst 官网](https://typst.app/) ,并将本模板的文件导入进去,但是你还需要导入一些**在线编辑器暂不支持**的字体(比如 `楷体` ),最终你的目录看起来会像是这个样子: ``` - images - bupt.png - main.typ - template.typ - FZKTK.ttf ``` 然后只要修改 `main.typ` 就可以了。 ## 本地编译 进入 Typst 的 GitHub 仓库,下载 [release](https://github.com/typst/typst/releases) ,解压出 `typst.exe` 放入根目录。 更多本地编译的使用信息见 [Typst](https://github.com/typst/typst) 仓库的 README.md 。 非常推荐你使用在线编辑来书写 Typst 文档,本模板采用的字体几乎都是官方自带的字体。 如果进行本地编译的话,你需要在本仓库的 [release](https://github.com/QQKdeGit/bupt-typst/releases) 中下载所需的字体文件,并执行如下命令: ```shell typst compile --font-path path/to/fonts main.typ ``` ## 已知问题 - [ ] 段首自动空两格失效,需要手动输入 `#h(2em)` ## 注意事项 由于 Typst 仍不太完善,如果设置章节自动换页的话,某些地方会出现神奇的空页。 因此,我保留了一部分章节的**本味**,所以你需要在章节标题的前一行输入 `#pagebreak()` 手动换页。 同时随着 Typst 的不断更新,一些语法会发生改变,有时候我并没有及时跟上它的更新,这有可能会导致 bug 出现。 ## FAQ **为什么模板缺失了封面、诚信声明等其他内容?** 所有缺失的内容在 release 中可以找到。考虑到一些格式不太适合和支持 Typst ,我并没有直接在本模板中复刻它。因此本模板负责的内容为论文的正文内容部分,而你需要下载那些缺失内容的文件,编辑 word 文件,导出 pdf ,最后与本模板进行 pdf 拼接(推荐使用 Adobe Acrobat 来完成上述操作)。或许在未来随着 Typst 的逐渐完善,这些缺失内容有机会可以直接在本模板中得到复刻。 缺失内容的装订顺序:封面 → 诚信声明,关于论文使用授权的说明(一页) → 任务书 → 成绩评定表 → 论文正文 → 开题报告 → 中期进展情况检查表 → 教师指导毕业设计(论文)记录表 → 提前毕设审批表(如有) → 论文题目变更申请表(如有) → 变更指导教师申请表(如有) 其中的论文正文顺序:中文摘要(含关键词) → 外文摘要(含关键词) → 目录 → 正文 → 参考文献 → 致谢 → 附录 → 外文资料 → 外文译文 **需要注意,此处提供的缺失内容的 word 文件是在北邮官方提供的文件的基础上优化而来(对齐表格,调整内容等),与原版有不同之处。**
https://github.com/htlwienwest/da-vorlage-typst
https://raw.githubusercontent.com/htlwienwest/da-vorlage-typst/main/lib/settings.typ
typst
MIT License
// ------ global settings -------- // these values were read from word reference template #let HEADER_HEIGHT = 3.78cm #let HEADER_INNER_MARGIN = 1.3cm #let FOOTER_HEIGHT = 2cm #let FOOTER_INNER_UPPER_MARGIN = 2cm - 1.26cm // margins... binding side (inner side) has 1cm more space #let PAGE_MARGIN_INSIDE = 3cm #let PAGE_MARGIN_OUTSIDE = 2cm // Fonts #let FONT_PRIMARY = "Arial" #let FONT_ACCENT = "Segoe UI"
https://github.com/rxt1077/it610
https://raw.githubusercontent.com/rxt1077/it610/master/markup/templates/slides.typ
typst
//#import "@preview/polylux:0.3.1": * #import "/polylux/polylux.typ": * // NJIT theme based on University theme // // Modified by <NAME> // Originally contributed by <NAME> - https://github.com/drupol #let njit-red = rgb("#D22630") #let njit-blue = rgb("#071D49") // https://github.com/typst/typst/discussions/4260 #let resize-text(body) = layout(size => { let font_size = text.size let (height,) = measure( block(width: size.width, text(size: font_size)[#body]), ) let max_height = size.height; while height > max_height { font_size -= 0.2pt height = measure( block(width: size.width, text(size: font_size)[#body]), ).height } block( height: height, width: 100%, text(size: font_size)[#body] ) }) // display and image with licensing info #let licensed-image( file: none, license: none, title: none, url: none, author: none, author-url: none, width: 100%, ) = { let license-text = "" license = upper(license) if license == "FAIRUSE" { license-text = [#link(url)[#title] is used under fair use] } else if license == "PUBLIC" { license-text = [#link(url)[#title] is in the public domain] } else if license == "UXWING" { license-text = [#link(url)[#title] is licensed under #link("https://uxwing.com/license/")[the uxwing license]] } else if license == "CC0" { license-text = [#link(url)[#title] is in the public domain under #link("https://creativecommons.org/publicdomain/zero/1.0/")[CC0]] } else if license.starts-with("CC") { let license_parts = license.split() let options = license_parts.at(1) let version = license_parts.at(2) if version.contains(".") != true { version = version + ".0" } license-text = [#link(url)["#title"] by #link(author-url)[#author] is licensed under #link("https://creativecommons.org/licenses/" + lower(options) + "/" + version + "/")[CC #options #version]] } else { panic("Unknown license: " + license) } block(breakable: false, width: width)[ #set align(center) #set text(size: 8pt) #block(below: 5pt)[#image(file)] #license-text ] } // ugly hack to convert callout number to a unicode character #let num2unicode(num) = { set text(black, size: 18pt, weight: "bold") if num == "<0>" [\u{24FF}] else if num == "<1>" [\u{2776}] else if num == "<2>" [\u{2777}] else if num == "<3>" [\u{2778}] else if num == "<4>" [\u{2779}] else if num == "<5>" [\u{2780}] else if num == "<6>" [\u{2781}] else if num == "<7>" [\u{2782}] else if num == "<8>" [\u{2783}] else if num == "<9>" [\u{2784}] } // code blocks in grey boxes with AsciiDoctor style callouts #let code(body, title: none, callouts: none) = { set text(size: 15pt) show regex("<[0123456789]>"): it => { num2unicode(it.text) } if title != none { // why can't I center this? set text(njit-red) block(below: 5pt, title) } box( fill: rgb("#DCDCDC"), inset: 8pt, radius: 4pt, body ) if callouts != none { for (num, desc) in callouts [ / #num2unicode(num): #desc ] } } #let uni-colors = state("uni-colors", (:)) #let uni-short-title = state("uni-short-title", none) #let uni-short-author = state("uni-short-author", none) #let uni-short-date = state("uni-short-date", none) #let uni-progress-bar = state("uni-progress-bar", true) #let university-theme( aspect-ratio: "16-9", short-title: none, short-author: "<NAME>", short-date: none, color-a: njit-blue, color-b: njit-red, color-c: rgb("#FBFEF9"), progress-bar: true, body ) = { set page( paper: "presentation-" + aspect-ratio, margin: 0em, header: none, footer: none, ) set text(size: 25pt) show footnote.entry: set text(size: .6em) show link: it => [ #set text(blue) #underline(it) ] show raw.where(block: false): box.with( fill: rgb("#DCDCDC"), inset: (x: 3pt, y: 0pt), outset: (y: 6pt), radius: 2pt, ) show raw.where(block: true): box.with( fill: rgb("#DCDCDC"), inset: 10pt, radius: 4pt, ) uni-progress-bar.update(progress-bar) uni-colors.update((a: color-a, b: color-b, c: color-c)) uni-short-title.update(short-title) uni-short-author.update(short-author) uni-short-date.update(short-date) body } #let title-slide( title: [], subtitle: none, authors: "<NAME>", institution-name: "New Jersey Institute of Technology", date: none, logo: pad(right: 1em, top: 1em, image("njit_logo.svg")), ) = { let authors = if type(authors) == "array" { authors } else { (authors,) } let content = context { let colors = uni-colors.get() if logo != none { align(right, logo) } align(center + horizon, { block( inset: 0em, breakable: false, { text(size: 2em, fill: colors.a, strong(title)) if subtitle != none { parbreak() text(size: 1.2em, fill: colors.a, subtitle) } } ) set text(size: .8em) grid( columns: (1fr,) * calc.min(authors.len(), 3), column-gutter: 1em, row-gutter: 1em, ..authors.map(author => text(fill: black, author)) ) if institution-name != none { parbreak() text(size: .9em, institution-name) } parbreak() image("cc-by-nc.svg", height: 1em) if date != none { parbreak() text(size: .8em, date) } }) } logic.polylux-slide(content) } #let slide( title: none, header: none, footer: none, new-section: none, body ) = { let body = pad(x: 2em, y: .5em, body) let progress-barline = context { if uni-progress-bar.get() { let cell = block.with( width: 100%, height: 100%, above: 0pt, below: 0pt, breakable: false ) let colors = uni-colors.get() utils.polylux-progress( ratio => { grid( rows: 2pt, columns: (ratio * 100%, 1fr), cell(fill: colors.a), cell(fill: colors.b) ) }) } else { [] } } let header-text = { if header != none { header } else if title != none { if new-section != none { utils.register-section(new-section) } context { let colors = uni-colors.get() block(fill: colors.c, inset: (x: .5em), grid( columns: (60%, 40%), align(top + left, heading(level: 2, text(fill: colors.a, title))), align(top + right, text(fill: colors.a.lighten(65%), utils.current-section)) )) } } else { [] } } let header = { set align(top) grid(rows: (auto, auto), row-gutter: 3mm, progress-barline, header-text) } let footer = { set text(size: 10pt) set align(center + bottom) let cell(fill: none, it) = rect( width: 100%, height: 100%, inset: 1mm, outset: 0mm, fill: fill, stroke: none, align(horizon, text(fill: white, it)) ) if footer != none { footer } else { context { let colors = uni-colors.get() show: block.with(width: 100%, height: auto, fill: colors.b) grid( columns: (25%, 1fr, 15%, 10%), rows: (1.5em, auto), cell(fill: colors.a, [#uni-short-author.get() #link("https://creativecommons.org/licenses/by-nc/4.0")[CC BY-NC 4.0]]), cell(uni-short-title.get()), cell(uni-short-date.get()), cell(logic.logical-slide.display() + [~/~] + utils.last-slide-number) ) } } } set page( margin: ( top: 2em, bottom: 1em, x: 0em ), header: header, footer: footer, footer-descent: 0em, header-ascent: .6em, ) logic.polylux-slide(body) } #let focus-slide(background-color: rgb("#071D49"), background-img: none, body) = { let background-color = if background-img == none and background-color == none { rgb("#0C6291") } else { background-color } set page(fill: background-color, margin: 1em) if background-color != none set page( background: { set image(fit: "stretch", width: 100%, height: 100%) background-img }, margin: 1em, ) if background-img != none set text(fill: white, size: 2em) logic.polylux-slide(align(horizon, body)) } #let matrix-slide(columns: none, rows: none, ..bodies) = { let bodies = bodies.pos() let columns = if type(columns) == "integer" { (1fr,) * columns } else if columns == none { (1fr,) * bodies.len() } else { columns } let num-cols = columns.len() let rows = if type(rows) == "integer" { (1fr,) * rows } else if rows == none { let quotient = calc.quo(bodies.len(), num-cols) let correction = if calc.rem(bodies.len(), num-cols) == 0 { 0 } else { 1 } (1fr,) * (quotient + correction) } else { rows } let num-rows = rows.len() if num-rows * num-cols < bodies.len() { panic("number of rows (" + str(num-rows) + ") * number of columns (" + str(num-cols) + ") must at least be number of content arguments (" + str(bodies.len()) + ")") } let cart-idx(i) = (calc.quo(i, num-cols), calc.rem(i, num-cols)) let color-body(idx-body) = { let (idx, body) = idx-body let (row, col) = cart-idx(idx) let color = if calc.even(row + col) { white } else { silver } set align(center + horizon) rect(inset: .5em, width: 100%, height: 100%, fill: color, body) } let content = grid( columns: columns, rows: rows, gutter: 0pt, ..bodies.enumerate().map(color-body) ) logic.polylux-slide(content) } // display side-by-side slides alternating the image on the left/right // also resizes text to fit in a single page #let alternate-counter = counter("alternate-counter") #let alternate(title: none, image: none, text: none) = { slide(title: title)[ #let text = resize-text(text) #alternate-counter.step() #context [ #let value = alternate-counter.get().first() #let image-on-left = calc.odd(value) #grid(columns: (1fr, 1fr), gutter: 20pt)[ #v(1fr) #if image-on-left { image } else { text } #v(1fr) ][ #v(1fr) #if image-on-left { text } else { image } #v(1fr) ] ] ] }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/valkyrie/0.1.0/src/base-type.typ
typst
Apache License 2.0
#import "context.typ": context /// Asserts the presence of the magic number on the given object. /// /// - arg (any): /// - scope (scope): Array of strings containing information for error generation. /// -> none #let assert-base-type(arg, scope: ("arguments",)) = { assert("valkyrie-type" in arg, message: "Invalid valkyrie type in " + scope.join(".") ) } /// Asserts the presence of the magic number on an array of object. /// /// - arg (any): /// - scope (scope): Array of strings containing information for error generation. /// -> none #let assert-base-type-array(arg, scope: ("arguments",)) = { for (name, value) in arg.enumerate(){ assert-base-type(value, scope: (..scope, str(name))) } } /// Asserts the presence of the magic number in a dictionary of object. /// /// - arg (any): /// - scope (scope): Array of strings containing information for error generation. /// -> none #let assert-base-type-dictionary(arg, scope: ("arguments",)) = { for (name, value) in arg{ assert-base-type(value, scope: (..scope, name)) } } /// Asserts the presence of the magic number in an argument of object. /// /// - arg (any): /// - scope (scope): Array of strings containing information for error generation. /// -> none #let assert-base-type-arguments(arg, scope: ("arguments",)) = { for (name, value) in arg.named(){ assert-base-type(value, scope: (..scope, name)) } for (pos, value) in arg.pos().enumerate(){ assert-base-type(value, scope: (..scope, "[" + pos + "]")) } } /// Schema generator. Provides default values for when defining custom types. #let base-type() = { return ( valkyrie-type: true, assert-type: (self, it, scope:(), ctx: context(), types: ()) => { if ( type(it) not in types){ (self.fail-validation)(self, it, scope: scope, ctx: ctx, message: "Expected " + types.join(", ", last: " or ") + ". Got " + type(it)) return false } return true }, validate: (self, it, scope: (), ctx: context()) => it, fail-validation: (self, it, scope: (), ctx: context(), message: "") => { let display = "Schema validation failed on " + scope.join(".") if ( message.len() > 0){ display += ": " + message} ctx.outcome = display if ( not ctx.soft-error ) { assert(false, message: display) } } ) }
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-36.typ
typst
Other
// Test the `range` function. #test(range(4), (0, 1, 2, 3)) #test(range(1, 4), (1, 2, 3)) #test(range(-4, 2), (-4, -3, -2, -1, 0, 1)) #test(range(10, 5), ()) #test(range(10, step: 3), (0, 3, 6, 9)) #test(range(1, 4, step: 1), (1, 2, 3)) #test(range(1, 8, step: 2), (1, 3, 5, 7)) #test(range(5, 2, step: -1), (5, 4, 3)) #test(range(10, 0, step: -3), (10, 7, 4, 1))
https://github.com/randyttruong/496notes
https://raw.githubusercontent.com/randyttruong/496notes/master/preamble.typ
typst
#let var = math.italic #let bl = [#h(0.35cm)] #let sc = smallcaps #let qt(x) = [ #v(0.5cm) #align(center)[#text(style: "italic")[#x]] #v(0.5cm) ] #let uC = counter("unit") #let rmkProps = ( fill: rgb(255, 225, 225), outline: rgb(200, 100,100), color: rgb(125,0,0), ) #let dfnProps = ( fill: rgb(225, 255, 255), outline: rgb(100, 200,200), color: rgb(0,125,125), c: counter("dfn") ) #let thmProps = ( fill: rgb(225, 255, 225), outline: rgb(100, 200, 100), color: rgb(0, 150, 0), c: counter("thm") ) #let lemProps = ( fill : rgb(255, 255, 225), outline : rgb(200, 200, 100), color : rgb(150, 150, 0), c: counter("lem") ) #let ntProps = ( fill: rgb(225, 225, 225), outline: rgb(150, 150, 150), color: rgb(50, 50, 50), ) #let clmProps = ( fill: rgb("#EDCCFC"), outline: rgb("#7C11AA"), color: rgb("#530077"), ) #let intProps = ( fill: rgb("#EDCCFC"), outline: rgb("#7C11AA"), color: rgb("#530077"), ) #let corProps = ( fill: rgb(255,239,224), outline: rgb(255,162,81), color: rgb(244,114,0), c: counter("cor") ) #let algDfnProps= ( fill: rgb("#C9DEBE"), outline: rgb("#4A5246"), color: rgb("#4A5246"), c: counter("alg"), ) #let pbProps = ( fill: rgb(255, 212, 223), outline: rgb(224, 52, 98) , color: rgb(163, 38, 71), c: counter("pb"), ) #let proof_outline = stroke(thickness: 1pt, paint: rgb(255,100,100)) #let pb(key, body) = { rect( fill: pbProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: pbProps.at("outline"), text(pbProps.at("color"))[ #pbProps.c.step() #[*Problem Statement #pbProps.c.display()*] #[*(#key).*] #align(left, [#body])], ) } #let todo() = { rect( fill: corProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: corProps.at("outline"), text(corProps.at("color"))[ #corProps.c.step() #align(center)[#text(36pt)[TODO]]], ) } #let algDfn(key, body) = { rect( fill: algDfnProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: algDfnProps.at("outline"), text(algDfnProps.at("color"))[ #algDfnProps.c.step() #[*Algorithm Intuition #algDfnProps.c.display()*] #[*(#key).*] #align(left, [#body])], ) } #let dfn(key, body) = { rect( fill: dfnProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: dfnProps.at("outline"), text(dfnProps.at("color"))[ #dfnProps.c.step() #[*Definition #dfnProps.c.display()*] #[*(#key).*] #align(left, [#body])], ) } #let clm(body) = { rect( fill: clmProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: clmProps.at("outline"), text(clmProps.at("color"))[ #[*Claim.*] #align(left, [#body])], ) } #let int(body) = { rect( fill: intProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: intProps.at("outline"), text(intProps.at("color"))[ #[*Intuition.*] #align(left, [#body])], ) } #let rmk(key, body) = { rect( fill: rmkProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: rmkProps.at("outline"), text(rmkProps.at("color"))[ #[*Remark*] #[*(#key).*] #align(left, [#body])], ) } #let thm(key, body) = { set text(black) rect( fill: thmProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: thmProps.at("outline"), text(thmProps.at("color"))[#[*Theorem*] #[*(#key).*] #align(left, [#body])], ) } #let lem(key, body) = { set text(black) rect( fill: lemProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: lemProps.at("outline"), text(lemProps.at("color"))[#[*Lemma*] #[*(#key).*] #align(left, [#body])], ) } #let cor(key, body) = { set text(black) rect( fill: corProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: corProps.at("outline"), text(corProps.at("color"))[#[*Corollary*] #[*(#key).*] #align(center, [#body])], ) } #let nt(body) = { set text(black) rect( fill: ntProps.at("fill"), inset: 12pt, radius: 4pt, width: 100%, stroke: ntProps.at("outline"), text(ntProps.at("color"))[#[*Note.*] #align(left, [#body])], ) } #let proof(key, body) = { set text(black) [#[_*#key.*_] \ #body] [$qed$] } #let ex(key, body) = { [#[_*Example (#key).*_] \ #align(left, [#body])] } #let titlePage(title, name, term) = { align(center+horizon, text(32pt)[ #title ]) align(center+horizon, text(16pt)[ #name ]) align(center+horizon, text(12pt)[ #term ]) } #let unit(title, pic) = { pagebreak() align(center, line(length: 75%)) uC.step() align(center, text(size:32pt, fill: gradient.linear(..color.map.magma))[Unit #context uC.display()\: \ #title]) align(center, line(length: 75%)) align(center + horizon, pic) pagebreak() } #let cC = counter("chapter") #let chap(title) = { cC.step() align(center, text(size:24pt, fill: gradient.linear(..color.map.plasma))[Chapter #context cC.display()\: \ #title]) v(0.5cm) } #let qsProps = ( hFill: rgb(176, 185, 255), hBody: rgb(60, 63, 115), pFill: rgb(230, 233, 255), ) #let qs(key, body) = { set text(black) stack(rect( fill: rgb(39, 87, 161), inset: 6pt, width: 100%, stroke: rgb(39, 87, 161), radius: ( top-left:5pt, top-right:5pt, ) )[#text(white, size: 9pt)[#smallcaps(key)]], rect( fill: white, inset: 15pt, radius: ( bottom-left: 5pt, bottom-right: 5pt, ), stroke: rgb(39, 87, 161), width: 100%, [#text(size: 9pt)[#emph(body)]], )) }
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/031.%20bubble.html.typ
typst
bubble.html What the Bubble Got Right September 2004(This essay is derived from an invited talk at ICFP 2004.)I had a front row seat for the Internet Bubble, because I worked at Yahoo during 1998 and 1999. One day, when the stock was trading around $200, I sat down and calculated what I thought the price should be. The answer I got was $12. I went to the next cubicle and told my friend Trevor. "Twelve!" he said. He tried to sound indignant, but he didn't quite manage it. He knew as well as I did that our valuation was crazy.Yahoo was a special case. It was not just our price to earnings ratio that was bogus. Half our earnings were too. Not in the Enron way, of course. The finance guys seemed scrupulous about reporting earnings. What made our earnings bogus was that Yahoo was, in effect, the center of a Ponzi scheme. Investors looked at Yahoo's earnings and said to themselves, here is proof that Internet companies can make money. So they invested in new startups that promised to be the next Yahoo. And as soon as these startups got the money, what did they do with it? Buy millions of dollars worth of advertising on Yahoo to promote their brand. Result: a capital investment in a startup this quarter shows up as Yahoo earnings next quarter—stimulating another round of investments in startups.As in a Ponzi scheme, what seemed to be the returns of this system were simply the latest round of investments in it. What made it not a Ponzi scheme was that it was unintentional. At least, I think it was. The venture capital business is pretty incestuous, and there were presumably people in a position, if not to create this situation, to realize what was happening and to milk it.A year later the game was up. Starting in January 2000, Yahoo's stock price began to crash, ultimately losing 95% of its value.Notice, though, that even with all the fat trimmed off its market cap, Yahoo was still worth a lot. Even at the morning-after valuations of March and April 2001, the people at Yahoo had managed to create a company worth about $8 billion in just six years.The fact is, despite all the nonsense we heard during the Bubble about the "new economy," there was a core of truth. You need that to get a really big bubble: you need to have something solid at the center, so that even smart people are sucked in. (<NAME> and <NAME> both lost money in the South Sea Bubble of 1720.)Now the pendulum has swung the other way. Now anything that became fashionable during the Bubble is ipso facto unfashionable. But that's a mistake—an even bigger mistake than believing what everyone was saying in 1999. Over the long term, what the Bubble got right will be more important than what it got wrong.1. Retail VCAfter the excesses of the Bubble, it's now considered dubious to take companies public before they have earnings. But there is nothing intrinsically wrong with that idea. Taking a company public at an early stage is simply retail VC: instead of going to venture capital firms for the last round of funding, you go to the public markets.By the end of the Bubble, companies going public with no earnings were being derided as "concept stocks," as if it were inherently stupid to invest in them. But investing in concepts isn't stupid; it's what VCs do, and the best of them are far from stupid.The stock of a company that doesn't yet have earnings is worth something. It may take a while for the market to learn how to value such companies, just as it had to learn to value common stocks in the early 20th century. But markets are good at solving that kind of problem. I wouldn't be surprised if the market ultimately did a better job than VCs do now.Going public early will not be the right plan for every company. And it can of course be disruptive—by distracting the management, or by making the early employees suddenly rich. But just as the market will learn how to value startups, startups will learn how to minimize the damage of going public.2. The InternetThe Internet genuinely is a big deal. That was one reason even smart people were fooled by the Bubble. Obviously it was going to have a huge effect. Enough of an effect to triple the value of Nasdaq companies in two years? No, as it turned out. But it was hard to say for certain at the time. [1]The same thing happened during the Mississippi and South Sea Bubbles. What drove them was the invention of organized public finance (the South Sea Company, despite its name, was really a competitor of the Bank of England). And that did turn out to be a big deal, in the long run.Recognizing an important trend turns out to be easier than figuring out how to profit from it. The mistake investors always seem to make is to take the trend too literally. Since the Internet was the big new thing, investors supposed that the more Internettish the company, the better. Hence such parodies as Pets.Com.In fact most of the money to be made from big trends is made indirectly. It was not the railroads themselves that made the most money during the railroad boom, but the companies on either side, like Carnegie's steelworks, which made the rails, and Standard Oil, which used railroads to get oil to the East Coast, where it could be shipped to Europe.I think the Internet will have great effects, and that what we've seen so far is nothing compared to what's coming. But most of the winners will only indirectly be Internet companies; for every Google there will be ten JetBlues.3. ChoicesWhy will the Internet have great effects? The general argument is that new forms of communication always do. They happen rarely (till industrial times there were just speech, writing, and printing), but when they do, they always cause a big splash.The specific argument, or one of them, is the Internet gives us more choices. In the "old" economy, the high cost of presenting information to people meant they had only a narrow range of options to choose from. The tiny, expensive pipeline to consumers was tellingly named "the channel." Control the channel and you could feed them what you wanted, on your terms. And it was not just big corporations that depended on this principle. So, in their way, did labor unions, the traditional news media, and the art and literary establishments. Winning depended not on doing good work, but on gaining control of some bottleneck.There are signs that this is changing. Google has over 82 million unique users a month and annual revenues of about three billion dollars. [2] And yet have you ever seen a Google ad? Something is going on here.Admittedly, Google is an extreme case. It's very easy for people to switch to a new search engine. It costs little effort and no money to try a new one, and it's easy to see if the results are better. And so Google doesn't have to advertise. In a business like theirs, being the best is enough.The exciting thing about the Internet is that it's shifting everything in that direction. The hard part, if you want to win by making the best stuff, is the beginning. Eventually everyone will learn by word of mouth that you're the best, but how do you survive to that point? And it is in this crucial stage that the Internet has the most effect. First, the Internet lets anyone find you at almost zero cost. Second, it dramatically speeds up the rate at which reputation spreads by word of mouth. Together these mean that in many fields the rule will be: Build it, and they will come. Make something great and put it online. That is a big change from the recipe for winning in the past century.4. YouthThe aspect of the Internet Bubble that the press seemed most taken with was the youth of some of the startup founders. This too is a trend that will last. There is a huge standard deviation among 26 year olds. Some are fit only for entry level jobs, but others are ready to rule the world if they can find someone to handle the paperwork for them.A 26 year old may not be very good at managing people or dealing with the SEC. Those require experience. But those are also commodities, which can be handed off to some lieutenant. The most important quality in a CEO is his vision for the company's future. What will they build next? And in that department, there are 26 year olds who can compete with anyone.In 1970 a company president meant someone in his fifties, at least. If he had technologists working for him, they were treated like a racing stable: prized, but not powerful. But as technology has grown more important, the power of nerds has grown to reflect it. Now it's not enough for a CEO to have someone smart he can ask about technical matters. Increasingly, he has to be that person himself.As always, business has clung to old forms. VCs still seem to want to install a legitimate-looking talking head as the CEO. But increasingly the founders of the company are the real powers, and the grey-headed man installed by the VCs more like a music group's manager than a general.5. InformalityIn New York, the Bubble had dramatic consequences: suits went out of fashion. They made one seem old. So in 1998 powerful New York types were suddenly wearing open-necked shirts and khakis and oval wire-rimmed glasses, just like guys in Santa Clara.The pendulum has swung back a bit, driven in part by a panicked reaction by the clothing industry. But I'm betting on the open-necked shirts. And this is not as frivolous a question as it might seem. Clothes are important, as all nerds can sense, though they may not realize it consciously.If you're a nerd, you can understand how important clothes are by asking yourself how you'd feel about a company that made you wear a suit and tie to work. The idea sounds horrible, doesn't it? In fact, horrible far out of proportion to the mere discomfort of wearing such clothes. A company that made programmers wear suits would have something deeply wrong with it.And what would be wrong would be that how one presented oneself counted more than the quality of one's ideas. That's the problem with formality. Dressing up is not so much bad in itself. The problem is the receptor it binds to: dressing up is inevitably a substitute for good ideas. It is no coincidence that technically inept business types are known as "suits."Nerds don't just happen to dress informally. They do it too consistently. Consciously or not, they dress informally as a prophylactic measure against stupidity.6. NerdsClothing is only the most visible battleground in the war against formality. Nerds tend to eschew formality of any sort. They're not impressed by one's job title, for example, or any of the other appurtenances of authority.Indeed, that's practically the definition of a nerd. I found myself talking recently to someone from Hollywood who was planning a show about nerds. I thought it would be useful if I explained what a nerd was. What I came up with was: someone who doesn't expend any effort on marketing himself.A nerd, in other words, is someone who concentrates on substance. So what's the connection between nerds and technology? Roughly that you can't fool mother nature. In technical matters, you have to get the right answers. If your software miscalculates the path of a space probe, you can't finesse your way out of trouble by saying that your code is patriotic, or avant-garde, or any of the other dodges people use in nontechnical fields.And as technology becomes increasingly important in the economy, nerd culture is rising with it. Nerds are already a lot cooler than they were when I was a kid. When I was in college in the mid-1980s, "nerd" was still an insult. People who majored in computer science generally tried to conceal it. Now women ask me where they can meet nerds. (The answer that springs to mind is "Usenix," but that would be like drinking from a firehose.)I have no illusions about why nerd culture is becoming more accepted. It's not because people are realizing that substance is more important than marketing. It's because the nerds are getting rich. But that is not going to change.7. OptionsWhat makes the nerds rich, usually, is stock options. Now there are moves afoot to make it harder for companies to grant options. To the extent there's some genuine accounting abuse going on, by all means correct it. But don't kill the golden goose. Equity is the fuel that drives technical innovation.Options are a good idea because (a) they're fair, and (b) they work. Someone who goes to work for a company is (one hopes) adding to its value, and it's only fair to give them a share of it. And as a purely practical measure, people work a lot harder when they have options. I've seen that first hand.The fact that a few crooks during the Bubble robbed their companies by granting themselves options doesn't mean options are a bad idea. During the railroad boom, some executives enriched themselves by selling watered stock—by issuing more shares than they said were outstanding. But that doesn't make common stock a bad idea. Crooks just use whatever means are available.If there is a problem with options, it's that they reward slightly the wrong thing. Not surprisingly, people do what you pay them to. If you pay them by the hour, they'll work a lot of hours. If you pay them by the volume of work done, they'll get a lot of work done (but only as you defined work). And if you pay them to raise the stock price, which is what options amount to, they'll raise the stock price.But that's not quite what you want. What you want is to increase the actual value of the company, not its market cap. Over time the two inevitably meet, but not always as quickly as options vest. Which means options tempt employees, if only unconsciously, to "pump and dump"—to do things that will make the company seem valuable. I found that when I was at Yahoo, I couldn't help thinking, "how will this sound to investors?" when I should have been thinking "is this a good idea?"So maybe the standard option deal needs to be tweaked slightly. Maybe options should be replaced with something tied more directly to earnings. It's still early days.8. StartupsWhat made the options valuable, for the most part, is that they were options on the stock of startups. Startups were not of course a creation of the Bubble, but they were more visible during the Bubble than ever before.One thing most people did learn about for the first time during the Bubble was the startup created with the intention of selling it. Originally a startup meant a small company that hoped to grow into a big one. But increasingly startups are evolving into a vehicle for developing technology on spec.As I wrote in Hackers & Painters, employees seem to be most productive when they're paid in proportion to the wealth they generate. And the advantage of a startup—indeed, almost its raison d'etre—is that it offers something otherwise impossible to obtain: a way of measuring that.In many businesses, it just makes more sense for companies to get technology by buying startups rather than developing it in house. You pay more, but there is less risk, and risk is what big companies don't want. It makes the guys developing the technology more accountable, because they only get paid if they build the winner. And you end up with better technology, created faster, because things are made in the innovative atmosphere of startups instead of the bureaucratic atmosphere of big companies.Our startup, Viaweb, was built to be sold. We were open with investors about that from the start. And we were careful to create something that could slot easily into a larger company. That is the pattern for the future.9. CaliforniaThe Bubble was a California phenomenon. When I showed up in Silicon Valley in 1998, I felt like an immigrant from Eastern Europe arriving in America in 1900. Everyone was so cheerful and healthy and rich. It seemed a new and improved world.The press, ever eager to exaggerate small trends, now gives one the impression that Silicon Valley is a ghost town. Not at all. When I drive down 101 from the airport, I still feel a buzz of energy, as if there were a giant transformer nearby. Real estate is still more expensive than just about anywhere else in the country. The people still look healthy, and the weather is still fabulous. The future is there. (I say "there" because I moved back to the East Coast after Yahoo. I still wonder if this was a smart idea.)What makes the Bay Area superior is the attitude of the people. I notice that when I come home to Boston. The first thing I see when I walk out of the airline terminal is the fat, grumpy guy in charge of the taxi line. I brace myself for rudeness: remember, you're back on the East Coast now.The atmosphere varies from city to city, and fragile organisms like startups are exceedingly sensitive to such variation. If it hadn't already been hijacked as a new euphemism for liberal, the word to describe the atmosphere in the Bay Area would be "progressive." People there are trying to build the future. Boston has MIT and Harvard, but it also has a lot of truculent, unionized employees like the police who recently held the Democratic National Convention for ransom, and a lot of people trying to be <NAME>. Two sides of an obsolete coin.Silicon Valley may not be the next Paris or London, but it is at least the next Chicago. For the next fifty years, that's where new wealth will come from.10. ProductivityDuring the Bubble, optimistic analysts used to justify high price to earnings ratios by saying that technology was going to increase productivity dramatically. They were wrong about the specific companies, but not so wrong about the underlying principle. I think one of the big trends we'll see in the coming century is a huge increase in productivity.Or more precisely, a huge increase in variation in productivity. Technology is a lever. It doesn't add; it multiplies. If the present range of productivity is 0 to 100, introducing a multiple of 10 increases the range from 0 to 1000.One upshot of which is that the companies of the future may be surprisingly small. I sometimes daydream about how big you could grow a company (in revenues) without ever having more than ten people. What would happen if you outsourced everything except product development? If you tried this experiment, I think you'd be surprised at how far you could get. As <NAME> pointed out, small groups are intrinsically more productive, because the internal friction in a group grows as the square of its size.Till quite recently, running a major company meant managing an army of workers. Our standards about how many employees a company should have are still influenced by old patterns. Startups are perforce small, because they can't afford to hire a lot of people. But I think it's a big mistake for companies to loosen their belts as revenues increase. The question is not whether you can afford the extra salaries. Can you afford the loss in productivity that comes from making the company bigger?The prospect of technological leverage will of course raise the specter of unemployment. I'm surprised people still worry about this. After centuries of supposedly job-killing innovations, the number of jobs is within ten percent of the number of people who want them. This can't be a coincidence. There must be some kind of balancing mechanism.What's NewWhen one looks over these trends, is there any overall theme? There does seem to be: that in the coming century, good ideas will count for more. That 26 year olds with good ideas will increasingly have an edge over 50 year olds with powerful connections. That doing good work will matter more than dressing up—or advertising, which is the same thing for companies. That people will be rewarded a bit more in proportion to the value of what they create.If so, this is good news indeed. Good ideas always tend to win eventually. The problem is, it can take a very long time. It took decades for relativity to be accepted, and the greater part of a century to establish that central planning didn't work. So even a small increase in the rate at which good ideas win would be a momentous change—big enough, probably, to justify a name like the "new economy."Notes[1] Actually it's hard to say now. As <NAME> points out, if the value of a stock is its future earnings, you can't tell if it was overvalued till you see what the earnings turn out to be. While certain famous Internet stocks were almost certainly overvalued in 1999, it is still hard to say for sure whether, e.g., the Nasdaq index was.Siegel, <NAME>. "What Is an Asset Price Bubble? An Operational Definition." European Financial Management, 9:1, 2003.[2] The number of users comes from a 6/03 Nielsen study quoted on Google's site. (You'd think they'd have something more recent.) The revenue estimate is based on revenues of $1.35 billion for the first half of 2004, as reported in their IPO filing.Thanks to <NAME>, <NAME>, <NAME>, <NAME>, and <NAME> for reading drafts of this.The Long TailRussian TranslationJapanese Translation
https://github.com/mitsuyukiLab/grad_thesis_typst
https://raw.githubusercontent.com/mitsuyukiLab/grad_thesis_typst/main/contents/conclusion.typ
typst
= 結論 <conclusion> == 本研究の結論 <conclusion_in_this_study> 本研究の貢献は次の2つである。 - your contribution 1 - your contribution 2 == 今後の展望 <future_work> 俺たちの冒険はこれからだ!!
https://github.com/soul667/typst
https://raw.githubusercontent.com/soul667/typst/main/PPT/MATLAB/touying/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/complex.md
markdown
--- sidebar_position: 2 --- # 复杂动画 得益于 [Polylux](https://polylux.dev/book/dynamic/syntax.html) 提供的语法,我们同样能够在 Touying 中使用 `only`、`uncover` 和 `alternatives`。 ## 回调风格的函数 为了避免上文提到的 `styled` 与 `layout` 限制,Touying 利用回调函数巧妙实现了总是能生效的 `only`、`uncover` 和 `alternatives`,具体来说,您要这样引入这三个函数: ```typst #slide(repeat: 3, self => [ #let (uncover, only, alternatives) = utils.methods(self) In subslide #self.subslide, test #uncover("2-")[uncover] function, and test #only("2-")[only] function, #pause and paused text. ]) ``` ![image](https://github.com/touying-typ/touying/assets/34951714/e9a6b8c5-daf0-4cf2-8d39-1a768ce1dfea) 注意到了吗?我们不再是传入一个内容块,而是传入了一个参数为 `self` 的回调函数,随后我们通过 ```typst #let (uncover, only, alternatives) = utils.methods(self) ``` 从 `self` 中取出了 `only`、`uncover` 和 `alternatives` 这三个函数,并在后续调用它们。 这里还有一些有趣的事实,例如 int 类型的 `self.subslide` 指示了当前 subslide 索引,而实际上 `only`、`uncover` 和 `alternatives` 函数也正是依赖 `self.subslide` 实现的获取当前 subslide 索引。 :::warning[警告] 我们手动指定了参数 `repeat: 3`,这代表着显示 3 张 subslides,我们需要手动指定是因为 Touying 无法探知 `only`、`uncover` 和 `alternatives` 需要显示多少张 subslides。 ::: ## only `only` 函数表示只在选定的 subslides 中「出现」,如果不出现,则会完全消失,也不会占据任何空间。也即 `#only(index, body)` 要么为 `body` 要么为 `none`。 其中 index 可以是 int 类型,也可以是 `"2-"` 或 `"2-3"` 这样的 str 类型,更多用法可以参考 [Polylux](https://polylux.dev/book/dynamic/complex.html)。 ## uncover `uncover` 函数表示只在选定的 subslides 中「显示」,否则会被 `cover` 函数遮挡,但仍会占据原有。也即 `#uncover(index, body)` 要么为 `body` 要么为 `cover(body)`。 其中 index 可以是 int 类型,也可以是 `"2-"` 或 `"2-3"` 这样的 str 类型,更多用法可以参考 [Polylux](https://polylux.dev/book/dynamic/complex.html)。 您应该也注意到了,事实上 `#pause` 也使用了 `cover` 函数,只是提供了更便利的写法,实际上它们的效果基本上是一致的。 ## alternatives `alternatives` 函数表示在不同的 subslides 中展示一系列不同的内容,例如 ```typst #slide(repeat: 3, self => [ #let (uncover, only, alternatives) = utils.methods(self) #alternatives[Ann][Bob][Christopher] likes #alternatives[chocolate][strawberry][vanilla] ice cream. ]) ``` ![image](https://github.com/touying-typ/touying/assets/34951714/392707ea-0bcd-426b-b232-5bc63b9a13a3) 如你所见,`alternatives` 能够自动撑开到最合适的宽度和高度,这是 `only` 和 `uncover` 所没有的能力。事实上 `alternatives` 还有着其他参数,例如 `start: 2`、`repeat-last: true` 和 `position: center + horizon` 等,更多用法可以参考 [Polylux](https://polylux.dev/book/dynamic/alternatives.html)。
https://github.com/vmysak/modern-cv-typst
https://raw.githubusercontent.com/vmysak/modern-cv-typst/main/src/my-cv.typ
typst
Apache License 2.0
#import "./definitions/cv-page-frame.typ": cvPageFrame #import "./definitions/cv-page-styles.typ": cvStyle #import "./definitions/cv-page-items.typ": cvItem #import "./my-config.typ": * #show: cvStyle.page.with(cvPageFrame.footer) #show: cvStyle.textStyles.with() // Custom Header - Example 3 /* = #userInfo.fullName #box(inset: (top: contacts-padding))[#for c in cvPageFrame.contacts { [#c] [#" "] } ] */ #show: cvPageFrame.modernHeader //#show: cvPageFrame.photoHeader #show: cvStyle.modernHeading.with() #show: cvStyle.modernBlock.with() = Summary #show: cvItem.textBlock.with(( [#lorem(15)], [In general I have 10 years' experience in software development.], [#lorem(30)]// <=== comma is not important, multiple elements )) = Note #show: cvItem.textBlock.with(( [ #text[If one element inside 'textBlock' - then trailing comma after is important - otherwise typst will not recognize array, compilation will fail. #linebreak() () or ([]) - typst dictionary #linebreak() ([],) - typst array ] ], // <=== comma is important )) = Education #show: cvItem.keyValueBlock.with(( size: size50x50, align-to: right, data: ( [=== Computer Sciences], [MIT<bold-desat>], [Bachelor<bold-desat>], [], [Institute of Technology], [2000 – 2005], ), )) = Professional Skills #show: cvItem.keyValueBlock.with(( size: size30x70, data: ( [=== Programming Languages], [Java 17, JavaScript], [=== Backend], [Spring, SpringBoot, NodeJS, JavaEE, Postgres, Mongo], [=== Frontend], [React, Angular], [=== Microservices], [Docker, k8s, istio, AMQP, ELK, API Gateway, Service Tracing/Monitoring], [=== CI/Build], [Git, Maven, Gradle, Yarn, Jenkins], [=== OS], [Linux, Fedora, CentOS, Debian], ), )) #show: cvItem.keyValueBlock.with(( size: size30x70, data: ( [=== Spoken Languages], [], [==== English<desat>], [Native], [==== German<desat>], [Advanced], ), )) = Experience #show: cvItem.experienceBlock.with(( position: [Team Lead], name: [Neobank | Startup], company: [Company | Remote], dates: [2024 - 2021], description: ( [#lorem(70)], [Detailed achievements<bold-desat> - established development practices, CICD - transformed client high-level vision into platform components - leading cross-functional (~20 people) teams - development and devops teams mentoring - code reviews, knowledge sessions ], [Technology Stack<accent>: Java, Spring Boot, Rabbit, NodeJS, Angular, k8s, istio, docker, AWS, Aurora], ), )) #linebreak() #linebreak() linebreak and pagebreak here for better<bold> visual<bold-desat> experience<accent> ever<desat> #pagebreak() #show: cvItem.experienceBlock.with(( position: [Senior Java Developer], name: [Neobank | Startup], company: [Company | Remote], dates: [2021 - 2018], description: ( [#lorem(20)], [Detailed achievements<bold-desat> - New microservices development - Architecture support ], [Technology Stack<accent>: Java, Spring Boot], ), )) #show: cvItem.experienceBlock.with(( position: [Developer], name: [Neobank | Startup], company: [Company | Remote], dates: [2018 - 2010], description: ( [#lorem(50)], [Detailed achievements<bold-desat> - New microservices development - Architecture support ], [Technology Stack<accent>: Java, Spring Boot], ), ))
https://github.com/dark-flames/resume
https://raw.githubusercontent.com/dark-flames/resume/main/data.typ
typst
MIT License
#import "data/award.typ": award #import "data/basic.typ": name, links #import "data/edu.typ": edu #import "data/work.typ": work #import "data/research.typ": research #import "data/open_source.typ": openSource #import "data/project.typ": project #import "data/skill.typ": skill #import "data/pub.typ": pub #import "data/interest.typ": interest
https://github.com/mgoulao/IST-MSc-Thesis-Typst-Template
https://raw.githubusercontent.com/mgoulao/IST-MSc-Thesis-Typst-Template/main/section_2.typ
typst
= Related Work #lorem(200)
https://github.com/dyc3/senior-design
https://raw.githubusercontent.com/dyc3/senior-design/main/main.typ
typst
#import "@preview/in-dexter:0.0.5": * #set document( title: "OpenTogetherTube Load Balancer", author: ("<NAME>", "<NAME>"), ) #set heading(numbering: "1.") #set page( "us-letter", numbering: "1", margin: 1in, binding: left, ) #show link: underline #show ref: underline // hack: https://github.com/typst/typst/issues/2497 #show figure.where(kind: table): set block(breakable: true) #show figure.where(kind: "usecase"): set block(breakable: true) // render file names for images in the document #show figure.where(kind: image): it => { let regex_image_calls = regex("image\\(([^)]+)\\)") let image_reprs = repr(it.body).matches(regex_image_calls).map(m => m.at("text")) assert(image_reprs.len() > 0) let regex_in_quotes = regex("\"([^\"]+)\"") let file_paths = image_reprs.map((im) => im.find(regex_in_quotes).trim(regex("(figures|svg|[./\"])"))) show figure.caption: it => { it "\n" set text(size: 8pt, fill: luma(100)) metadata("!glossary:disable") for file_path in file_paths { raw("file: [ " + file_path + " ]") + "\n" } metadata("!glossary:enable") } it } #import "lib/glossary.typ": glossary, glossaryWords, glossaryShow #show glossaryWords("glossary.yaml"): word => glossaryShow("glossary.yaml", word) // Index-Entry hiding : this rule makes the index entries in the document invisible. #show figure.where(kind: "jkrb_index"): it => {} #metadata("!glossary:disable") #set align(center) #text(size: 24pt)[Load Balancer for OpenTogetherTube Horizontal Scaling] by <NAME>, <NAME>, <NAME>, <NAME> #text(size: 8pt)[With additional contributions from: <NAME>, <NAME>, <NAME>] Document rendered on #datetime.today().display() #image("expo/icons/ott-logo.svg", width: 100pt) #set align(left) #pagebreak() #outline(indent: auto) #pagebreak() #outline(title: "List of Figures", target: figure.where(kind: image)) #pagebreak() #outline(title: "List of Tables", target: figure.where(kind: table)) #pagebreak() #metadata("!glossary:enable") #include "changelog.typ" #pagebreak() #include "introduction.typ" #pagebreak() #include "team-declaration.typ" #pagebreak() #include "motivation.typ" #pagebreak() #include "dev-plan/dev-plan.typ" #pagebreak() #include "weekly-reports.typ" #pagebreak() #include "user-interviews.typ" #pagebreak() #include "user-personas.typ" #pagebreak() #include "use-cases.typ" #pagebreak() #include "user-stories.typ" #pagebreak() #include "constraints-justification.typ" #pagebreak() #include "balancer-requirements.typ" #pagebreak() #include "solution-overview.typ" #pagebreak() #include "balancer-design.typ" #pagebreak() #include "service-discovery.typ" #pagebreak() #include "join-process.typ" #pagebreak() #include "protocol.typ" #pagebreak() #include "api-proxy.typ" #pagebreak() #include "room-states.typ" #pagebreak() #include "elicitation-validation.typ" #pagebreak() #include "harness-requirements.typ" #pagebreak() #include "harness-design.typ" #pagebreak() #include "harness-tests.typ" #pagebreak() #include "visualization-requirements.typ" #pagebreak() #include "visualization-design.typ" #pagebreak() #include "testing.typ" #pagebreak() #metadata("!glossary:disable") #glossary("glossary.yaml") #pagebreak() #include "index.typ" #pagebreak() #bibliography("bibfile.bib")
https://github.com/ukcw/typst-cv-template
https://raw.githubusercontent.com/ukcw/typst-cv-template/main/cv.typ
typst
MIT License
#set text( font: "New Computer Modern", size: 9pt, ) #set page("us-letter") #set par(justify: true) #let chiline() = {v(-3pt); line(length: 100%); v(-5pt)} #let experience(header, location, subheader, date_string, bullets) = { [*#subheader* #h(1fr) #location \ #emph(header) #h(1fr) #date_string] for item in bullets { [ - #item] } } #let project(header, secondary_header, date_string, bullets) = { [*#header* #if secondary_header != "" [| #emph(secondary_header)] #h(1fr) #date_string] for item in bullets { [ - #item] } } #[ #set align(center) = <NAME> <EMAIL> | #link("https://linkedin.com/in/ulysses-kee")[#underline(offset: 3pt)[linkedin.com/in/ulysses-kee]] | #link("https://github.com/ukcw")[#underline(offset: 3pt)[github.com/ukcw]] | #link("https://ukcw.io")[#underline(offset: 3pt)[ukcw.io]] *Work Authorization: Singapore Citizen* ] == EDUCATION #chiline() *#lorem(2)* #h(1fr) #lorem(2) \ #lorem(4) #h(1fr) Jan. 2048 – Jan. 2048 \ *Thesis*: #link("https://ukcw.io/")[#underline(offset: 3pt)[#lorem(8)]] *#lorem(2)* #h(1fr) #lorem(2) \ #lorem(4) #h(1fr) Jan. 2048 -- Jan. 2048 \ *Relevant Courses*: _#lorem(2)_, _#lorem(2)_, _#lorem(2)_, _#lorem(2)_, _#lorem(2)_ == EXPERIENCE #chiline() #let experience_bullets_1 = ([#lorem(17)], [#lorem(17)], [#lorem(17)]) #experience([#lorem(2)],[#lorem(2)],[#lorem(2)],"Jan 2048 - Jan 2048", experience_bullets_1) #let experience_bullets_2 = ([#lorem(17)], [#lorem(17)], [#lorem(17)]) #experience([#lorem(2)],[#lorem(2)],[#lorem(2)],"Jan 2048 - Jan 2048", experience_bullets_2) #let experience_bullets_3 = ([#lorem(17)], [#lorem(17)], [#lorem(17)]) #experience([#lorem(2)],[#lorem(2)],[#lorem(2)],"Jan 2048 - Jan 2048", experience_bullets_3) == PROJECTS #chiline() #let project_bullets_1 = ([#lorem(17)],) #project([#lorem(2)], [#lorem(2), #lorem(2), #lorem(2)], "Jan. 2048", project_bullets_1) #let project_bullets_2 = ([#lorem(17)],) #project([#lorem(2)], [#lorem(2), #lorem(2), #lorem(2)], "Jan. 2048", project_bullets_2) #let project_bullets_3 = ([#lorem(17)],) #project([#lorem(2)], [#lorem(2), #lorem(2), #lorem(2)], "Jan. 2048", project_bullets_3) == TECHNICAL SKILLS #chiline() *Languages*: Python, JavaScript/TypeScript, Java, Rust, SQL, HTML/CSS \ *Frameworks*: React, Node.js, Express, MongoDB, GraphQL, Docker, LaTeX, Hadoop, Spark, Airflow, Flink, Kafka
https://github.com/Error-418-SWE/Documenti
https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/1%20-%20Candidatura/Verbali/Esterni/26-10-23/26-10-23.typ
typst
ERROR\_418 \ Verbale 26/10/23 #figure( align(center)[#table( columns: 2, align: (col, row) => (left,left,).at(col), inset: 6pt, [Mail:], [<EMAIL>], [Redattori:], [<NAME>, <NAME>], [Verificatori:], [<NAME>, <NAME>, <NAME>], [Amministratori:], [<NAME>, <NAME>], [Destinatari:], [<NAME>, <NAME>], )] ) #figure( align(center)[#table( columns: 2, align: (col, row) => (center,center,).at(col), inset: 6pt, [Inizio Meeting: 18:00 Fine Meeting: 18:20 Durata:20min], [], [Presenze:], [], )] ) #block[ #figure( align(center)[#table( columns: 5, align: (col, row) => (center,center,center,center,center,).at(col), inset: 6pt, [Nome], [Durata Presenza], [], [Nome], [Durata Presenza], [Antonio], [20min], [], [Alessio], [20min], [Riccardo], [20min], [], [Giovanni], [20min], [Rosario], [/], [], [Silvio], [20min], [Mattia], [20min], [], [SanMarco Informatica], [20min], )] ) ] = Domande riguardanti il capitolato con SanMarco Informatica <domande-riguardanti-il-capitolato-con-sanmarco-informatica> Dopo esserci presentati abbiamo chiesto maggiorni informazioni all’azienda SanMarco Informatica riguardo a dubbi che avevamo sul capitolato C5: Warehouse management 3D. Abbiamo chiarito che: - quando si parla di notifiche di trasferimento si intende chiamate REST API - i bin sono aree generiche dove mettere i materiali \(nel pavimento, sui mezzi,sugli scaffali,...) - uno scaffale può avere bin di diverse dimensioni. Gli scaffali sono divisi in ripiani e i ripiani in bin. In uno stesso scaffale possono coesistere bin di dimensioni diverse \(su ripiani diversi). I bin hanno dimensioni costanti. - controllare se una merce è compatibile con un bin \(per posizione o per merci limitrofe) è una feature interessante ma non richiesta dal capitolato - dobbiamo gestire un database relazionale il quale dovrà essere precaricato nel programma, il quale non ha memoria quindi non modifica il database e se la pagina viene ricaricata, il programma riparte dallo stato di partenza - le tecnologie consigliate per la gestione del database sono: PostgreSQL, MariaDB e SQL Server - poter creare, modificare e spostare scaffali manualmente è una feature utile ma non è richiesto che lo stato del magazzino venga salvato in memoria quindi si tratta di funzionalità supplementari = Altri argomenti affrontati <altri-argomenti-affrontati> - abbiamo concordato con l’azienda la frequenza dei meeting: almeno una volta al mese ma se si ritiene utile si possono richiedere altri incontri. L’azienda si è inoltre resa disponibile per la ricezione di qualsiasi email ritenessimo necessaria - In fine ci è stato chiesto il motivo che ci ha spinto a sceglere il loro capitolato e, in maniera unanime, abbiamo concordato che lavorare con il 3D è molto stimolante e interessante anche a livello lavorativo per la sua ampia l’utilità
https://github.com/kimushun1101/How-to-use-typst-for-paper-jp
https://raw.githubusercontent.com/kimushun1101/How-to-use-typst-for-paper-jp/main/README.md
markdown
MIT License
# How-to-use-typst-for-paper-jp Typst の特徴と使い方,論文を書くときに使えるコード例をまとめた資料 PDF はこちらからご覧になれます. https://kimushun1101.github.io/How-to-use-typst-for-paper-jp/How-to-use-typst-for-paper-jp.pdf --- [制御工学勉強会](https://control-engineering-seminar.notion.site/5c6643a330184bea9a9f72e2ce87f6ff) 第11回 (2024-08-03) で発表 アーカイブ動画は YouTube で限定公開されています. 制御工学勉強会のリンク先の Discord から参加してアクセスしてください. 発表タイトル:Typst で日本語論文を書く
https://github.com/ymgyt/techbook
https://raw.githubusercontent.com/ymgyt/techbook/master/cloud/aws/cdk/construct.md
markdown
# Construct * represents "cloud component" * 再利用の単位 * CloudFormationをどの程度抽象化しているかでL1とL2に分かれる * CDK v2から、`constructs` moduleに分離された(v1ではcore) * Layerの概念をもつ * L1.CfnResource * Cloudformationに対応する * L2. intent-based API * default値を設定してくれている * `bucket.addLifeCycleRule()`とかでbucketの設定できるイメージ ## Constructの定義 * 自分でも定義できる * instanceのpropertyを追加したい場合は、classのfieldを定義する ```typescript export class NotifyingBucket extends Construct { public readonly topic: sns.Topic; constructor(scope: Construct, id: string, props: NotifyingBucketProps) { super(scope, id); const bucket = new s3.Bucket(this, 'bucket'); this.topic = new sns.Topic(this, 'topic'); bucket.addObjectCreatedNotification(new s3notify.SnsDestination(this.topic), { prefix: props.prefix }); } } const queue = new sqs.Queue(this, 'NewImagesQueue'); const images = new NotifyingBucket(this, '/images'); images.topic.addSubscription(new sns_sub.SqsSubscription(queue)); ``` ## Import * cdk以外で作成されたResourceをcdk内に取り込む * Stack作成時のpropsに`Environemnt`(Aws account, region)を渡しておく必要がある ```typescript // Construct a resource (bucket) just by its name (must be same account) s3.Bucket.fromBucketName(this, 'MyBucket', 'my-bucket-name'); // Construct a resource (bucket) by its full ARN (can be cross account) s3.Bucket.fromBucketArn(this, 'MyBucket', 'arn:aws:s3:::my-bucket-name'); // Construct a resource by giving attribute(s) (complex resources) ec2.Vpc.fromVpcAttributes(this, 'MyVpc', { vpcId: 'vpc-12345<KEY>', }); // Provide aws account for import const app = new cdk.App(); new MyStack(app, 'MyStack', { env: { account: awsAccount, region: "ap-northeast-1" } }) ``` ## Removal Policy * Resource削除時の挙動の制御 * RETAIN * stackが削除されても残りつづけ手動の削除が必要 ```typescript import * as cdk from 'aws-cdk-lib'; import { Construct } from 'constructs'; import * as s3 from 'aws-cdk-lib/aws-s3'; export class CdkTestStack extends cdk.Stack { constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); const bucket = new s3.Bucket(this, 'Bucket', { removalPolicy: cdk.RemovalPolicy.DESTROY, autoDeleteObjects: true }); } } ``` ## Tag ```typescript import { App, Stack, Tags } from 'aws-cdk-lib'; const app = new App(); const theBestStack = new Stack(app, 'MarketingSystem'); // Add a tag to all constructs in the stack Tags.of(theBestStack).add('StackType', 'TheBest'); // Remove the tag from all resources except subnet resources Tags.of(theBestStack).remove('StackType', { excludeResourceTypes: ['AWS::EC2::Subnet'] }); ``` ## L1を利用 L2のmethodやpropertyでは設定できない項目があったりする。 その場合、L2からL1に変換を行い、直接CloudFormationの項目を設定できる ```typescript // Get the CloudFormation resource const cfnBucket = bucket.node.defaultChild as s3.CfnBucket; // Change its properties cfnBucket.analyticsConfiguration = [ { id: 'Config', // ... } ]; ``` * `construct.node.defaultChild as CfnXXX`のように行える * `s3.Bucket.fromCfnBucket()`のようにL1 -> L2の流れもある * [escape hatch](https://docs.aws.amazon.com/ja_jp/cdk/v2/guide/cfn_layer.html)
https://github.com/mrtz-j/typst-thesis-template
https://raw.githubusercontent.com/mrtz-j/typst-thesis-template/main/template/utils/subfigure.typ
typst
MIT License
#import "../chapters/global.typ": subpar, in-appendix #let subfigure = { subpar.grid.with( numbering: n => if in-appendix.get() { numbering("A.1", counter(heading).get().first(), n) } else { numbering("1.1", counter(heading).get().first(), n) }, numbering-sub-ref: (m, n) => if in-appendix.get() { numbering("A.1a", counter(heading).get().first(), m, n) } else { numbering("1.1a", counter(heading).get().first(), m, n) }, ) }
https://github.com/dmtr-m/typst-bot
https://raw.githubusercontent.com/dmtr-m/typst-bot/main/README.md
markdown
MIT License
# typst-bot Typst bot for Telegam Messenger. This bot generates images from code written in typst markdown language. Works both in inline mode and in private messages. ### Features + Generate images from typst in inline mode ```@typst_bot mat(1, 0; 0, 1)```. + Get your most recent request to the inline mode. \ Write ```\last_query``` to the bot in private messages. + You can write your typst code as a private message to the bot. ### Bot: https://t.me/typst_bot
https://github.com/typst-doc-cn/tutorial
https://raw.githubusercontent.com/typst-doc-cn/tutorial/main/src/basic/reference-date.typ
typst
Apache License 2.0
#import "mod.typ": * #show: book.ref-page.with(title: [参考:时间类型]) #let table-lnk(name, ref, it, scope: (:), res: none, ..args) = ( align(center + horizon, link("todo", name)), it, align(horizon, { set heading(bookmarked: false, outlined: false) eval(it.text, mode: "markup", scope: scope) }), ) == 日期 日期表示时间长河中的一个具体的时间戳。#ref-bookmark[`datetime`] #code(```typ 一个值 #datetime(year: 2023, month: 4, day: 19).display() 偷偷混入了我们内容之中。 ```) == 时间间隔 时间间隔表示两个时间戳之间的时间差。#ref-bookmark[`duration`] #code(```typ 一个值 #duration(days: 3, hours: 10).seconds()s 偷偷混入了我们内容之中。 ```) == typst-pdf时间戳 ```typ set document(date: auto) ```
https://github.com/FurryAcetylCoA/sgu-thesis-typst
https://raw.githubusercontent.com/FurryAcetylCoA/sgu-thesis-typst/main/thesis.typ
typst
MIT License
#import "nju-thesis/template.typ": documentclass, tablex, fig, tlt, indent #import "nju-thesis/utils/style.typ": 字号, 字体 // 双面模式,会加入空白页,便于打印 #let twoside = false // #let twoside = true #let ( doc, preface, mainmatter, mainmatter-end, appendix, fonts-display-page, cover, abstract, abstract-en, outline-page, list-of-figures, list-of-tables, notation, acknowledgement, bib ) = documentclass( // anonymous: true, // 盲审模式 twoside: twoside, // 双面模式,会加入空白页,便于打印 // 可自定义字体,先英文字体后中文字体,应传入「宋体」、「黑体」、「楷体」、「仿宋」、「等宽」 //fonts: (楷体: ("Times New Roman", "LXGW WenKai GB"), // 仿宋: ("Times New Roman", "Zhuque Fangsong (technical preview)")), info: ( title: ("基于ChatGPT的狗屁通生成器"), title-en: "My Title in English", grade: "20XX", student-id: "12356252222", author: "张三", author-en: "<NAME>", department: "某学院", department-en: "School of Chemistry and Chemical Engineering", major: "某专业", major-en: "Chemistry", supervisor: ("李四", "教授"), supervisor-en: "Professor My Supervisor", begin-date: datetime(year: 2049,month: 8, day:8), end-date: datetime(year: 2049,month: 12, day:12) ), ) // 文稿设置 #show: doc // 字体展示测试页 //#fonts-display-page() // 封面页 #cover() // 前言 #show: preface // 中文摘要 #abstract( keywords: ("我", "就是", "测试用", "关键词") )[ 中文摘要 ] #pagebreak() // 英文摘要 #abstract-en( keywords: ("Dummy", "Keywords", "Here", "It Is") )[ English abstract ] // 目录 #outline-page() // 插图目录 //#list-of-figures() // 表格目录 //#list-of-tables() // 正文 #show: mainmatter = 基本功能 == 脚注 我们可以添加一个脚注。#footnote[脚注内容] == 列表 === 无序列表 - 无序列表项一 - 无序列表项二 - 无序子列表项一 - 无序子列表项二 - 无序子列表项三 === 有序列表 + 有序列表项一 + 有序列表项二 + 有序子列表项一 + 有序子列表项二 + 有序子列表项三 == 图表 引用@tbl:timing-tlt1,引用@tbl:timing-tlt,以及@fig:nju-logo。引用图表时,表格、图片和代码分别需要加上 `tbl:`、`fig:` 和 `lst:` 前缀才能正常显示编号。以及这里使用 `fig` 函数替代原生 `figure` 函数以支持将 `tablex` 作为表格来识别。 #align(center, (stack(dir: ltr)[ #fig( tlt( columns: 2, [药品], [规格], [浓氨水], [分析纯AR], [盐酸], [分析纯AR], [钛酸四丁酯], [≥99.0%] ), caption: [三线表1], ) <timing-tlt1> ][ #h(50pt) ][ #fig( tlt( columns: 4, map-cells: cell => { if cell.y > 0 and cell.x > 0 { cell.content = { let text-color = if int(cell.content.text) < 5 { red.lighten(30%) } else { green } set text(text-color) strong(cell.content) } } cell }, [t], [1], [2], [3], [y], [3], [4], [9], [3], [3], [17], [0], ), caption: [三线表 - 着色], ) <timing-tlt> ])) == 插图 插图必须精心制作,线条均匀,图面整洁。插图位于正文中引用该插图字段的后面。每幅插图应有图序和图题,图序和图题应放在图位下方居中处 #fig( image("images/chatu.png", width: 60%), caption: [二氧化钛光催化原理图], ) <nju-logo> == 数学公式 可以像 Markdown 一样写行内公式 $x + y$,以及带编号的行间公式: $ phi.alt := (1 + sqrt(5)) / 2 $ <ratio> 引用数学公式需要加上 `eqt:` 前缀,则由@eqt:ratio,我们有: $ F_n = floor(1 / sqrt(5) phi.alt^n) $ #indent 图表和公式后的段落要用 `#indent` 手动缩进。同时,我们也可以通过 `<->` 标签来标识该行间公式不需要编号 $ y = integral_1^2 x^2 dif x $ <-> 而后续数学公式仍然能正常编号。 $ F_n = floor(1 / sqrt(5) phi.alt^n) $ == 参考文献 可以像这样引用参考文献:@wang2010guide。某期刊文章@某期刊文章 == 代码块 代码块支持语法高亮。引用 @lst:code #fig( ```py def add(x, y): return x + y ```, caption:[高深莫测的编程语言]) <code> = 正文 == 正文子标题 === 正文子子标题 正文内容 // 手动分页 #if (twoside) { pagebreak() + " " } // 参考文献 #bib(path:("bibs/ex01.bib", "bibs/ymlex.yml")) // 手动分页 #if (twoside) { pagebreak() + " " } // 附录 #show: appendix == 附录子标题 === 附录子子标题 附录内容,这里也可以加入图片,例如@fig:appendix-img。 #fig( image("nju-thesis/assets/vi/nju-emblem.svg", width: 20%), caption: [图片测试], ) <appendix-img> // 手动分页 #if (twoside) { pagebreak() + " " } // 致谢 #acknowledgement[ 感谢 NJU-LUG,提供 NJUThesis Typst 模板。 ] // 正文结束标志,不可缺少 #mainmatter-end()
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/heading_00.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Different number of equals signs. = Level 1 == Level 2 === Level 3 // After three, it stops shrinking. =========== Level 11
https://github.com/AngleSideAngle/AngleSideAngle
https://raw.githubusercontent.com/AngleSideAngle/AngleSideAngle/main/cv.typ
typst
#set page("us-letter") #show heading: set text(font: "Linux Biolinum") #show link: underline #set text( size: 11pt, ) // Feel free to change the margin below to best fit your own CV #set page( margin: (x: 0.9cm, y: 1.3cm), // margin: (x: 0.4in, y: 0.2in) ) #set par(justify: true) #let linebreak() = {v(-3pt); line(length: 100%); v(-5pt)} = <NAME> #link("mailto:<EMAIL>")[<EMAIL>] | #link("https://anglesideangle.github.io/")[anglesideangle.github.io] | #link("https://github.com/AngleSideAngle")[github.com/anglesideangle] | #link("https://www.linkedin.com/in/asa-paparo/")[linkedin.com/in/asa-paparo] == Education #linebreak() *Massachusetts Institute of Technology* #h(1fr) Cambridge, MA \ Candidate for Bachelor's Degree in Computer Science #h(1fr) 8/2024 -- Present \ - Programmer on the MIT Motorsports FSAE team // - Conducting research on system integration for UAVs with the MIT Marine Autonomy Lab *The Bronx High School of Science* #h(1fr) Bronx, NY \ Advanced Regents Diploma #h(1fr) 8/2020 -- 6/2024 \ - 4.0 GPA - Completed courses in linear algebra, multivariable calculus, mechanics, and electricity & magnetism - Student Director of IT for the journalism and yearbook programs == Experience #linebreak() *MIT Marine Autonomy Lab* #h(1fr) Cambridge, MA \ Undergraduate Researcher #h(1fr) 9/2024 -- Present \ - Develop open source interfaces and device drivers for GPS, doppler velocity log, and acoustic modem sensors - Integrate sensor components with MOOS-IvP framework to support lab research *<NAME> Laboratory* #h(1fr) Cambridge, MA \ Autonomous Systems Intern #h(1fr) 6/2024 -- 8/2024 \ - Developed software for control and simulation of a fully autonomous rover with ROS2 and Gazebo - Collaborated with engineering team of 7 interns to budget, plan, and implement solution to design challenge *Beaver Works Summer Institute* #h(1fr) Cambridge, MA \ Autonomous RACECAR Competitor #h(1fr) 7/2023 -- 7/2023 \ // - Led and supported 3 person team to honorable mention in the Grand Prix // - Rewrote part of the course’s core library to improve efficiency for all competing and future teams - Implemented real time autonomous control of small vehicle with ackermann steering - Researched particle filtering based SLAM and autonomous navigation using LIDAR and IMU sensors *SciBorgs Robotics Team* #h(1fr) Bronx, NY \ Head of Software #h(1fr) 5/2023 -- 6/2024 \ - Led software team of 10+ people in development and integration of robot software - Taught new members programming, version control, software development practices, calculus, and control theory // - Maintained robotics codebases with a team using Java and Git // - Contributed to upstream development of critical libraries utilized by teams, including WPILib // - Employed and learned control theory, path following, and localization to achieve autonomy in competition #{v(-3pt)} Programmer #h(1fr) 11/2021 -- 6/2024 \ // - Maintained robotics codebases with a team using Java and Git - Contributed to upstream development of critical libraries utilized by teams, including WPILib - Employed control theory, path following, and localization to achieve autonomy in competition // *Bronx Science Journalism/Yearbook* #h(1fr) Bronx, NY \ // Student Director of IT #h(1fr) 9/2022 -- 6/2024 \ // - Maintained a production LAMP server utilizing bash, Ubuntu, Systemd, Apache, PHP, and Podman // - Published articles for the school newspaper and yearbook *NYC FIRST* #h(1fr) NY \ Volunteer #h(1fr) 11/2022 -- 12/2023 \ - Taught foundational programming and robotics knowledge to middle school and high school students - Mentored the students to engage in a STEM design process - Volunteered at local competitions, including as a referee == Awards #linebreak() *Dean's List Finalist* --- FIRST Robotics #h(1fr) 4/2023 \ *Disruptive Engineering Award* --- Beaver Works Summer Institute #h(1fr) 7/2023 == Skills #linebreak() #let typst = { text(font: "Linux Libertine", weight: "semibold", fill: eastern)[typst] } #let latex = { set text(font: "New Computer Modern") box(width: 2.55em, { [L] place(top, dx: 0.3em, text(size: 0.7em)[A]) place(top, dx: 0.7em)[T] place(top, dx: 1.26em, dy: 0.22em)[E] place(top, dx: 1.8em)[X] }) } *Programming*: C++, Rust, Python, Java, Bash, C\#, JS, TS, PHP \ *Robotics*: ROS2, Gazebo, Nav2, MOOS-IvP, OpenCV, AprilTags \ *Tools*: Fedora, Ubuntu, Systemd, Helix, #typst, #latex, Apache, Podman, Docker, Git, GitHub
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1CC0.typ
typst
Apache License 2.0
#let data = ( ("SUNDANESE PUNCTUATION BINDU SURYA", "Po", 0), ("SUNDANESE PUNCTUATION BINDU PANGLONG", "Po", 0), ("SUNDANESE PUNCTUATION BINDU PURNAMA", "Po", 0), ("SUNDANESE PUNCTUATION BINDU CAKRA", "Po", 0), ("SUNDANESE PUNCTUATION BINDU LEU SATANGA", "Po", 0), ("SUNDANESE PUNCTUATION BINDU KA SATANGA", "Po", 0), ("SUNDANESE PUNCTUATION BINDU DA SATANGA", "Po", 0), ("SUNDANESE PUNCTUATION BINDU BA SATANGA", "Po", 0), )
https://github.com/yhtq/Notes
https://raw.githubusercontent.com/yhtq/Notes/main/数理逻辑/作业/ml-1_2-hw.typ
typst
#import "../../template.typ": proof, note, corollary, lemma, theorem, definition, example, remark #import "../../template.typ": * #import "../main.typ": not1, True, False, infer #import "../main.typ": * #import "@preview/prooftrees:0.1.0": axi, uni, tree #show: note.with( title: "作业12", author: "YHTQ", date: datetime.today().display(), logo: none, withOutlined : false, withTitle : false, withHeadingNumbering: false ) #let p = $p$ #let q = $q$ #let r = $r$ #let T = True #let F = False #let U = TODO #let tree(A, B) = $#A\; therefore#B$ = 2 == 2.1 === (a) $ p <-> q = (p -> q) and (q -> p) = (not1 p or q) and (not1 q or p) $ 这已经是合取范式,其析取范式为: $ (not1 p or q) and (not1 q or p) = (not1 p and not1 q) or (not1 p and p) or (q and not1 q) or (q and p) $ === (b) $ not1 ((p -> not1 q) -> r) = not1 ((not1 p or not1 q) -> r) = not1 (not1 (not1 p or not1 q) or r) = not1 ((p and q) or r)\ = ((not1 p) or (not1 q)) and (not1 r) $ 这已经是合取范式,其析取范式为: $ ((not1 p) or (not1 q)) and (not1 r) = (not1 p and not1 r) or (not1 q and not1 r) $ == 2.2 === (a) $ (not1 p and not1 q) -> (not1 r and s) = not1 (not1 p and not1 q) or (not1 r and s) = (p or q) or (not1 r and s) \ = (p or q) or (not1 not1 (not1 r and s) )= (p or q) or (not1 (r or not1 s)) $ === (b) 注意到: $ calA <-> calB = (calA -> calB) and (calB -> calA) \ = (not1 calA or calB) and (not1 calB or calA) = (not1 (calA and not1 calB)) and (not1 (calB and not1 calA)) \ $ 做替换得: $ (p <-> (not1 q)) <-> r = (not1 (p and not1 (not1 q))) and (not1 ((not1 q) and not1 p)) <-> r \ = (not1 ((not1 (p and not1 (not1 q))) and (not1 ((not1 q) and not1 p)) and not1 r)) \ and (not1 (r and not1 (not1 (p and not1 (not1 q))) and (not1 ((not1 q) and not1 p))))\ = (not1 ((not1 (p and q)) and (not1 ((not1 q) and not1 p)) and not1 r)) and (not1 (r and p and q) and (not1 ((not1 q) and not1 p))) $ === (c) 注意到: $ calA and calB = not1 (not1 calA or not1 calB) = not1 (calA infer not1 calB)\ calA or calB = (not1 calA) infer calB $ 因此: $ (p and q) or (r and s) = (not1 (p infer not1 q)) or (not1 (r infer not1 s))\ = (not1 (not1 (p infer not1 q))) infer (not1 (r infer not1 s))\ = (p infer not1 q) infer (not1 (r infer not1 s)) $ == 2.3 #lemmaLinear[][ 设 $calA$ 是由 $p_1, p_2, ..., p_n;q$ 变元和连接符集 $S$ 构成的命题形式,且其真值函数 $f$ 与 $q$ 的真假值无关,则存在 $calB$ 是由 $p_1, p_2, ..., p_n$ 变元和连接符集 $S$ 构成的命题形式,使得 $calA$ 与 $calB$ 等值 ] #proof[ 考虑 $subst(calA, q, p_1)$,不难验证它与 $calA$ 等值且不含变元 $q$ ] 上面引理说明了增加变元个数不会增加更多可表达的真值函数,因此下设命题形式只含两个变元 #lemmaLinear[][ 设 $calA$ 是任意由 $p, q$ 变元与 ${not1, <->}$ 构成的命题形式,则 $calA$ 的真值表中必有偶数个 #T(对称的,偶数个 #F) ] #proof[ 对 $calA$ 做结构化归纳法: - $calA = p, q$ 结论显然 - $calA = not1 calB$,由归纳假设 $calB$ 的真值表中有偶数个 #F, #T,从而 $calA$ 的真值表中有偶数个 #T, #F - $calA = calB <-> calC$,设: #let bti = "bool_to_int" $ bti : {T, F} &-> ZZ quo 2ZZ\ bti(T) &= 1\ bti(F) &= 0 $ 并简记 $calA, calB, calC$ 的真值函数为 $calA, calB, calC$ ,则待证命题表达为: $ sum_((i, j) in {T, F}^2) bti(calA(i, j)) = 0 $ 由归纳假设: $ sum_((i, j) in {T, F}^2) bti(calB(i, j)) = 0\ sum_((i, j) in {T, F}^2) bti(calC(i, j)) = 0 $ 同时不难验证: $ forall p in {T, F}^2, bti((calB <-> calC) (p)) = bti(calB(p)) - bti(calC(p)) + 1 $ 因此: $ & sum_((i, j) in {T, F}^2) bti(calA(i, j)) \ &= sum_((i, j) in {T, F}^2) bti((calB <-> calC) (p))\ &= sum_((i, j) in {T, F}^2) bti(calB(p)) - bti(calC(p)) + 1\ &= sum_((i, j) in {T, F}^2) bti(calB(p)) - sum_((i, j) in {T, F}^2) bti(calC(p)) \ &= 0 - 0 \ &= 0 \ $ 命题得证 ] 显然,上面的引理蕴含了不存在这样的 $calA$ 与 $p and q$ 等值,因此 ${not1, <->}$ 不是完备集 == 2.4 === (a) 设: - $p = "函数" f "连续"$ - $q = "函数" g "可微"$ 则推理形式为: #tree( [$not1 p -> not1 q, q$], [$q$] ) 这是有效的,既然: #tree( [$not1 p -> not1 q, q$], [$q -> p, q$] ) #tree( [$q -> p, q$], [$p$] ) 都是有效形式 === (b) 设: - $p =$ $U$ 是 $V$ 的子集 - $q =$ $U$ 是闭的 - $r = $ $U$ 包含零向量 - $s = $ $U$ 是 $V$ 的子空间 则推理形式为: #tree( [$s -> (p and q and r), p and (q -> r)$], [$q -> s$] ) 这不是有效的,因为可取 $s = F, p, q, r = T$,条件均真但结论为假 = 2.5 #let calLn = $calA_1,calA_2, ..., calA_n$ #let calLn1 = $calA_1,calA_2, ..., calA_(n-1)$ 对于任意一组使得 #calLn 全为真的真值指派, 由于: $ #tree(calLn, calA ) $ 是有效的,因此在此指派下 #calA 也为真 对于任意一组使得 #calLn1 全为真的真值指派: - 若 $calA_n$ 为真,则符合上面的条件,自然 $calA$ 也为真,$calA_n -> calA$ 为真 - 否则,$calA_n$ 为假,$calA_n -> calA$ 自然为真 这就表明 #tree(calLn1, $calA$) 是有效的
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/design_concept/content/poc/poc.typ
typst
#import "../../../style.typ": * #part("Proof of Concept") This part describes the development of the proof of concept application as described in the goals defined in @goals. #include_section("design_concept/content/poc/scope.typ") #include_section("design_concept/content/poc/options.typ") #include_section("design_concept/content/poc/architecture.typ") #include_section("design_concept/content/poc/translation_component.typ") #include_section("design_concept/content/poc/ui.typ") #include_section("design_concept/content/poc/type_inference.typ")
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/polytonoi/0.1.0/README.md
markdown
Apache License 2.0
# Polytonoi | Πολλοί Τόνοι A typst package for rendering text into polytonic Greek using a hopefully-intuitive transliteration scheme. ## Usage First, be sure you include the package at the top of your typst file: ```typ @import "preview/[email protected]: * ``` The package currently exposes one function, ``#ptgk(<string>)``, which will convert ``<string>`` into polytonic Greek text in the same location where the function appears in the typst document. For example: ``#ptgk("polu/s")`` would render: πολύς **NOTE:** Quotation marks within the function call (see above example) are **mandatory**, and the code will not work without them. Where possible, Greek letters have been linked with their closest Roman equivalent (e.g. a --> α, b --> β). Where not possible, I've tried to stick to common convention, such as what is used by the Perseus Project for their transliteration. A couple letters (ξ and ψ) are made up of two letters (``ks`` and ``ps`` respectively), which the ``#ptgk()`` function handles as special cases. See below for the full transliteration scheme. #### Additional Usage Notes 1. Any character that isn't specifically accounted for (including white space, most punctuation, numbers, etc.) is rendered as-is. 2. Smooth breathing marks are automatically added to a vowel that begins a word, unless that first vowel is followed by another. In this case, you'll need to manually add it to the second vowel. ### Text Formatting As of now, the text is processed as a string, which means that any formatting markup (such as ``_`` or ``*``) is **not** included in how the text is rendered, and is instead passed through and will display literally. To apply any kind of formatting to the Greek text, the markup or commands must be put outside the text passed to the function. Compare the following two examples to see how this works: ``#ptgk("_Arxh\_")`` would display as \_Ἀρχὴ\_ whereas ``_#ptgk("Arxh\")_`` would display as _Ἀρχὴ_ ## Transliteration Scheme | Roman letter | Greek result | Notes | |--------------|--------------|-------| | a | α | | | b | β | | | g | γ | | | d | δ | | | e | ε | | | z | ζ | | | h | η | | | q | θ | | | i | ι | | | k | κ | | | l | λ | | | m | μ | | | n | ν | | | ks | ξ | | | o | ο | | | p | π | | | r | ρ | | | s | σ/ς | Renders as final sigma automatically | | t | τ | | | u | υ | | | v | φ | | | x | χ | | | ps | ψ | | | w | ω | | Upper-case letters are handled the same way, just with an upper-case letter as input. The upper-case versions of the two "combined" letters (Ξ and Ψ) can be entered either as "KS"/"PS" or "Ks"/"Ps". ### Accents & Breathing Marks As mentioned above, this package will automatically put a smooth breathing mark on a vowel that begins a word, unless that vowel is followed immediately by a second vowel. In that instance, you'll have to manually put the smooth breathing mark in its correct place. (This is to avoid having to code for edge cases, such as where a word starts with three vowels in a row.) By the same token, rough breathing must always be entered manually. | Input | Greek | Notes | Example | |-------|-------|-------|---------| | ( | rough breathing | Put before the vowel | ``(a`` --> ἁ | | ) | smooth breathing | Put before the vowel | ``)a`` --> ἀ | | \ | Grave / varia | Put after the vowel | ``a\`` --> ὰ | | / | Acute / oxia / tonos | Put after the vowel | ``a/`` --> ά | | = | Tilde / perispomeni | Put after the vowel | ``a=`` --> ᾶ | | \| | Iota subscript | Put after the vowel | ``a\|`` --> ᾳ | | : | Diaresis | Put after the vowel | ``i:`` --> ϊ | Multiple diacriticals can be added to a vowel, e.g. ``(h|`` --> ᾑ ### Punctuation Most Roman punctuation characters are left unchanged. The exceptions are ``;`` (semicolon) and ``?`` (question mark), which are rendered as a high dot (·) and the Greek question mark (;) respectively. ## Feedback Feedback is welcome, and please don't hesitate to open an issue if something doesn't work. I've tried to account for edge cases, but I certainly can't guarantee that I've found everything.
https://github.com/mrknorman/evolving_attention_thesis
https://raw.githubusercontent.com/mrknorman/evolving_attention_thesis/main/preface.typ
typst
#set page(numbering: "i", number-align: center) #counter(page).update(1) #set heading(numbering: "I.a") = Summary This thesis investigates the application of machine learning to gravitational-wave data analysis. Primarily, it focuses on artificial neural networks, but it also presents work to optimize the design and application of these networks with genetic algorithms, another machine learning method. This method of hyperparameter optimisation was utilised to design models for a low-latency burst search pipeline, MLy. Along with the use of genetic algorithms for hyperparameter optimisation, work is also performed to test the performance of attention-based networks on two gravitational wave data analysis tasks, compact binary coalescence detection, and the estimation of the parameters of overlapping pairs of compact binary coalescences. @gravitational-waves-sec introduces gravitational wave science, in order to contextualize the data analysis problems examined throughout. @machine-learning-sec examines the underlying principles of artificial neural networks and presents a simple example which demonstrates the effectiveness of artificial neural networks as a data analysis method. @application-sec then explores the intersection between the two introduced fields. It presents the methodology used for training dataset generation throughout the thesis and introduces the custom software developed in order to enable rapid dataset generation and iteration. This section also contains a review of previous work that has been done to use artificial neural networks for gravitation wave data analysis, as well as a series of experiments to demonstrate the ineffectiveness of unspecialized artificial neural networks for the task. This section concludes with recreations of some important results from the literature which act as a comparative baseline for the rest of the thesis. @dragonn-sec presents Dragonn, a genetic algorithm that can act as a general optimisation method for neural networks in gravitational wave data science. Dragonn can optimize the network architecture, the training dataset, and the training procedure simultaneously, and easily allows for the inclusion of new hyperparameters. @skywarp-sec presents experiments to test the effectiveness of attention-based networks for gravitational-wave analysis, more specifically, compact binary coalescence detection. It demonstrates a marginal improvement over recreated convolutional neural networks from the literature presented in @application-sec. Finally, @crosswave-sec expands the exploration of attention-based models to investigate cross-attention between multiple gravitational-wave detector outputs. We use this novel approach to examine the problem of parameter estimation on overlapping signals. We find that a standard convolutional neural network adapted from the literature is sufficient to distinguish between single gravitational wave signals and pairs of overlapping signals. The larger cross-attention architecture demonstrates the ability to extract parameters from multiple signals simultaneously, providing results that, in the future, may be used to aid more developed parameter estimation techniques. #pagebreak() // Table of contents. #show outline: set heading(numbering: "I.a") #outline(depth: 3, indent: true) #pagebreak() #let figureList(fig_type) = { locate(loc => { let elems = query(figure, loc) let notTypeCount = 0 for fig in elems { let figLoc = query(fig.label, loc).first().location() let chapterCount = counter(heading).at(figLoc).first() let figureCount = counter(figure).at(figLoc).first() if figureCount == 1 { notTypeCount = 0 counter(figure).update(0) } if fig.supplement.text == fig_type { let figureTypeCount = figureCount - notTypeCount let supp = fig.supplement let body = fig.caption.body let label = link(fig.label, strong( supp + " " + str(chapterCount) + "." + str(figureTypeCount) )) label + " | " + body + "\n" } else { notTypeCount += 1 } } }) } = List of Figures #figureList("Figure") #pagebreak() = List of Tables #figureList("Table") #pagebreak() = List of Listings #figureList("Listing") #pagebreak() // Collaborative Work = Collaborative Work A small amount of the work presented in this thesis was performed in collaboration with others. Here is a list of the sections that contain collaborative work: - Several of the figures presented in @gravitational-waves-sec were produced by <NAME> using her impressive knowledge of Mathematica. Specifically, these were: @flat, @gravitaional-potentials, and @waves which is also the image on the half-cover page. This was done as a favour to me and is greatly appreciated. All other figures, aside from @noise_diagram, were created by the author for this thesis. - Although the work done to train the MLy models using the genetic-algorithm-based hyperparameter optimisation method presented in this thesis was not strictly collaborative, it is described in @deployment-in-mly as a use case of the method and software that was developed. Work to optimise and train these models was performed solely by <NAME>, with whom I have collaborated in the past on development work for the MLy pipeline, but not for any of the work presented in this thesis other than what is mentioned in @deployment-in-mly. - The work presented in @crosswave-sec was collaborative. The problem was presented, and the training and testing datasets were generated by <NAME>. I performed all the work to create and train the models, although some guidance on the nature of the problem and the importance of different aspects was provided by Phil. Our collaboration extended only to the first of the models presented, Overlapnet, after which Phil left the project. The parameter estimation model, CrossWave, was a continuation of the concept, and the same training and validation datasets generated by Phil were used, however, there was no further input from Phil in the training of CrossWave. All data analysis was performed independently, although again, the importance of certain aspects of the problem had previously been highlighted by Phil. #pagebreak() // Acknowledgments = Acknowledgments A great number of people, fortuitous events, and cups of coffee were required to create the conditions necessary for the production of this thesis. It would be a hopeless task to try and name them all (although perhaps I could train a neural network to do it). Nonetheless, I will attempt to highlight and express my overwhelming gratitude toward the most crucial contributors. Firstly, I would like to thank my supervisor <NAME>. He has helped improve my skills as a scientist in innumerable ways and managed to direct me toward my goal whilst still providing me with the freedom to explore my ideas. I imagine achieving this balance must be one of the most difficult parts of being a Ph.D. supervisor, but he has excelled at the task. Of course, I need to cover the basics, although thankfully in my case it is not only down to a sense of obligation. I have the most supportive family anyone could ever wish for. I am fortunate enough that they have never shown a single moment of doubt or uttered a single question as to whether this was a thing I could do and whether was a thing I should do. They have always been there, in the background, to support me and let me know that even if things didn't work out it would be okay in the end. I give special thanks to my father, Mark, who has always shown an interest in my work and even attempted to read this thesis, my mother Caroline, who sends me an advent calendar every year, and my siblings, Vanessa, Chris, and Adam. Speaking of support, I would be remiss not to mention my source of funding, AIMLAC (it's a terrible acronym that I won't do the dignity of expanding), and the wonderful people who run it. I have made many hopefully enduring connections through the myriad of conferences and events they have put on for us, both academically and socially. Through AIMLAC, I have met many people whom I now consider friends, including Tom, Hattie, <NAME>, Maciek, Sophie, Robbie, and Tonichia. Perhaps the largest contribution to the ideas behind this thesis, and the intersection between gravitational waves and machine learning research at Cardiff, comes from Vasileios Skliris. He was Patrick's student prior to me and paved much of the path that this work follows. Despite having to deal with me and my constant stream of new ideas, he continues to push for real applications of machine learning methods with his development of the MLy pipeline. Next, we come to those who have supported me beyond an academic sense, but whose roles have been of equal importance. Without them, the thought of four years of Ph.D. work is almost incomprehensible (although maybe I could have got it done in two if I didn't have anyone in the office that I could distract). There are a great many people who fit into this category and I will certainly forget some of them (the thesis is long enough as it is). Firstly, Phil, Zoltan, and Sander, you kept me sane with many opportunities for terrible coffees, shots of gin, and rants about AI destroying the world. I already miss you all. I'd also be remiss not to mention all those who came before me, including Ali, Johnathan, and Virginia, who are hopefully enjoying the sunshine in California; and all those who will remain here after I'm gone (I swear I'm perfectly healthy), including Abhinav, Debatri, Jordan, <NAME>, and of course Sama, who promised to read my thesis when it's done (I'm sorry it's so long. Good luck). I hope that she will continue to work on our joint unstarted project, Crocodile. I will also mention friends I have somehow managed to retain from the world outside gravitational waves, all of whom are very dear to me: Harvey, Luke, Patrick, and Elliot. With special thanks to Elliot, who has been my agony aunt through many situations. Oh, and I should probably thank some astronomers too, including Jacob, who helped develop the best game that can be played on the surface of a table; Andy, who continues the noble tradition of gin shots; and a myriad of others who are too numerous to mention. Lastly, (I put these three in a separate paragraph because I think it'll be funny if they think I've missed them) thank you to Meryl, Terri, and Eva. Thank you for encouraging me to write an acknowledgments section, for supplying me with a good proportion of my current wardrobe, and for your unsuccessful attempts to help me get over my fear of sauce. You've made this last year a lot less stressful than it could have been.
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/meta/footnote-refs.typ
typst
Apache License 2.0
// Test references to footnotes. --- A footnote #footnote[Hi]<fn> \ A reference to it @fn --- // Multiple footnotes are refs First #footnote[A]<fn1> \ Second #footnote[B]<fn2> \ First ref @fn1 \ Third #footnote[C] \ Fourth #footnote[D]<fn4> \ Fourth ref @fn4 \ Second ref @fn2 \ Second ref again @fn2 --- // Forward reference Usage @fn \ Definition #footnote[Hi]<fn> --- // Footnote ref in footnote #footnote[Reference to next @fn] #footnote[Reference to myself @fn]<fn> #footnote[Reference to previous @fn] --- // Styling #show footnote: text.with(fill: red) Real #footnote[...]<fn> \ Ref @fn --- // Footnote call with label #footnote(<fn>) #footnote[Hi]<fn> #ref(<fn>) #footnote(<fn>)
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/main.typ
typst
//#include "misal/advent.typ" // #include "_general/sluzebnik.typ" // #include "_general/oktoich.typ" // #include "_general/minea.typ" // #include "_general/akatistnik.typ" // #include "_general/casoslov.typ" // #include "_general/molebenik.typ" // #include "test.typ" // #include "tmp.typ" // #include "CU-SK/sobas.typ" // #include "CU/oktoich/1_generated/0_all/Hlas1.typ" // #include "CU/oktoich/1_generated/0_all/Hlas2.typ" // #include "CU/oktoich/1_generated/0_all/Hlas3.typ" // #include "CU/oktoich/1_generated/0_all/Hlas4.typ" // #include "CU/oktoich/1_generated/0_all/Hlas5.typ" // #include "CU/oktoich/1_generated/0_all/Hlas6.typ" // #include "CU/oktoich/1_generated/0_all/Hlas7.typ" // #include "CU/oktoich/1_generated/0_all/Hlas8.typ" // #include "CU/postna_triod/1_generated/0_all/Tyzden1.typ" // #include "CU/minea/1_generated/00_all/0_vseobecna.typ" #include "CU/minea/1_generated/00_all/1_minea.typ" // #include "X_typik/typik.typ" // #include "CU/H1.typ" // #include "CU/Pascha.typ"
https://github.com/schmidma/typst-workshop
https://raw.githubusercontent.com/schmidma/typst-workshop/main/examples/01-basics.typ
typst
Creative Commons Zero v1.0 Universal
When you begin typing words into a document, those words are automatically arranged into a visually coherent form known as typeset text.
https://github.com/Lancern/resume-template
https://raw.githubusercontent.com/Lancern/resume-template/master/github-pl-colors.typ
typst
Creative Commons Zero v1.0 Universal
// This list is generated from https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml #let github-pl-colors = ( "1c enterprise": rgb("#814CCC"), "4d": rgb("#004289"), "abap": rgb("#E8274B"), "abap cds": rgb("#555e25"), "ags script": rgb("#B9D9FF"), "aidl": rgb("#34EB6B"), "al": rgb("#3AA2B5"), "ampl": rgb("#E6EFBB"), "antlr": rgb("#9DC3FF"), "apl": rgb("#5A8164"), "asp.net": rgb("#9400ff"), "ats": rgb("#1ac620"), "actionscript": rgb("#882B0F"), "ada": rgb("#02f88c"), "agda": rgb("#315665"), "alloy": rgb("#64C800"), "alpine abuild": rgb("#0D597F"), "angelscript": rgb("#C7D7DC"), "apex": rgb("#1797c0"), "apollo guidance computer": rgb("#0B3D91"), "applescript": rgb("#101F1F"), "arc": rgb("#aa2afe"), "aspectj": rgb("#a957b0"), "assembly": rgb("#6E4C13"), "asymptote": rgb("#ff0000"), "augeas": rgb("#9CC134"), "autohotkey": rgb("#6594b9"), "autoit": rgb("#1C3552"), "awk": rgb("#c30e9b"), "basic": rgb("#ff0000"), "ballerina": rgb("#FF5000"), "batchfile": rgb("#C1F12E"), "beef": rgb("#a52f4e"), "berry": rgb("#15A13C"), "bicep": rgb("#519aba"), "bison": rgb("#6A463F"), "bitbake": rgb("#00bce4"), "blitzbasic": rgb("#00FFAE"), "blitzmax": rgb("#cd6400"), "bluespec": rgb("#12223c"), "boo": rgb("#d4bec1"), "boogie": rgb("#c80fa0"), "brainfuck": rgb("#2F2530"), "brighterscript": rgb("#66AABB"), "brightscript": rgb("#662D91"), "c": rgb("#555555"), "c#": rgb("#178600"), "c++": rgb("#f34b7d"), "cap cds": rgb("#0092d1"), "clips": rgb("#00A300"), "cmake": rgb("#DA3434"), "cue": rgb("#5886E1"), "cweb": rgb("#00007a"), "cadence": rgb("#00ef8b"), "cairo": rgb("#ff4a48"), "cameligo": rgb("#3be133"), "cap'n proto": rgb("#c42727"), "ceylon": rgb("#dfa535"), "chapel": rgb("#8dc63f"), "chuck": rgb("#3f8000"), "circom": rgb("#707575"), "cirru": rgb("#ccccff"), "clarion": rgb("#db901e"), "clarity": rgb("#5546ff"), "classic asp": rgb("#6a40fd"), "clean": rgb("#3F85AF"), "click": rgb("#E4E6F3"), "clojure": rgb("#db5855"), "codeql": rgb("#140f46"), "coffeescript": rgb("#244776"), "coldfusion": rgb("#ed2cd6"), "coldfusion cfc": rgb("#ed2cd6"), "common lisp": rgb("#3fb68b"), "common workflow language": rgb("#B5314C"), "component pascal": rgb("#B0CE4E"), "coq": rgb("#d0b68c"), "crystal": rgb("#000100"), "csound": rgb("#1a1a1a"), "csound document": rgb("#1a1a1a"), "csound score": rgb("#1a1a1a"), "cuda": rgb("#3A4E3A"), "curry": rgb("#531242"), "cypher": rgb("#34c0eb"), "cython": rgb("#fedf5b"), "d": rgb("#ba595e"), "dm": rgb("#447265"), "dafny": rgb("#FFEC25"), "dart": rgb("#00B4AB"), "dataweave": rgb("#003a52"), "denizenscript": rgb("#FBEE96"), "dhall": rgb("#dfafff"), "dockerfile": rgb("#384d54"), "dogescript": rgb("#cca760"), "dylan": rgb("#6c616e"), "e": rgb("#ccce35"), "ecl": rgb("#8a1267"), "eclipse": rgb("#001d9d"), "eq": rgb("#a78649"), "earthly": rgb("#2af0ff"), "eiffel": rgb("#4d6977"), "elixir": rgb("#6e4a7e"), "elm": rgb("#60B5CC"), "elvish": rgb("#55BB55"), "elvish transcript": rgb("#55BB55"), "emacs lisp": rgb("#c065db"), "emberscript": rgb("#FFF4F3"), "erlang": rgb("#B83998"), "euphoria": rgb("#FF790B"), "f#": rgb("#b845fc"), "f*": rgb("#572e30"), "flux": rgb("#88ccff"), "factor": rgb("#636746"), "fancy": rgb("#7b9db4"), "fantom": rgb("#14253c"), "faust": rgb("#c37240"), "fennel": rgb("#fff3d7"), "filebench wml": rgb("#F6B900"), "fluent": rgb("#ffcc33"), "forth": rgb("#341708"), "fortran": rgb("#4d41b1"), "fortran free form": rgb("#4d41b1"), "freebasic": rgb("#141AC9"), "freemarker": rgb("#0050b2"), "frege": rgb("#00cafe"), "futhark": rgb("#5f021f"), "g-code": rgb("#D08CF2"), "gaml": rgb("#FFC766"), "gams": rgb("#f49a22"), "gap": rgb("#0000cc"), "gcc machine description": rgb("#FFCFAB"), "gdscript": rgb("#355570"), "glsl": rgb("#5686a5"), "gsc": rgb("#FF6800"), "game maker language": rgb("#71b417"), "genero": rgb("#63408e"), "genie": rgb("#fb855d"), "genshi": rgb("#951531"), "gentoo ebuild": rgb("#9400ff"), "gentoo eclass": rgb("#9400ff"), "gherkin": rgb("#5B2063"), "gleam": rgb("#ffaff3"), "glyph": rgb("#c1ac7f"), "gnuplot": rgb("#f0a9f0"), "go": rgb("#00ADD8"), "golo": rgb("#88562A"), "gosu": rgb("#82937f"), "grace": rgb("#615f8b"), "grammatical framework": rgb("#ff0000"), "groovy": rgb("#4298b8"), "groovy server pages": rgb("#4298b8"), "hcl": rgb("#844FBA"), "hlsl": rgb("#aace60"), "hack": rgb("#878787"), "harbour": rgb("#0e60e3"), "haskell": rgb("#5e5086"), "haxe": rgb("#df7900"), "hiveql": rgb("#dce200"), "holyc": rgb("#ffefaf"), "hy": rgb("#7790B2"), "idl": rgb("#a3522f"), "igor pro": rgb("#0000cc"), "idris": rgb("#b30000"), "imagej macro": rgb("#99AAFF"), "imba": rgb("#16cec6"), "inno setup": rgb("#264b99"), "io": rgb("#a9188d"), "ioke": rgb("#078193"), "isabelle": rgb("#FEFE00"), "isabelle root": rgb("#FEFE00"), "j": rgb("#9EEDFF"), "jcl": rgb("#d90e09"), "jflex": rgb("#DBCA00"), "jsoniq": rgb("#40d47e"), "janet": rgb("#0886a5"), "jasmin": rgb("#d03600"), "java": rgb("#b07219"), "java server pages": rgb("#2A6277"), "javascript": rgb("#f1e05a"), "javascript+erb": rgb("#f1e05a"), "jetbrains mps": rgb("#21D789"), "jison": rgb("#56b3cb"), "jison lex": rgb("#56b3cb"), "jolie": rgb("#843179"), "jsonnet": rgb("#0064bd"), "julia": rgb("#a270ba"), "just": rgb("#384d54"), "krl": rgb("#28430A"), "kaitai struct": rgb("#773b37"), "kakounescript": rgb("#6f8042"), "kerboscript": rgb("#41adf0"), "kotlin": rgb("#A97BFF"), "lfe": rgb("#4C3023"), "llvm": rgb("#185619"), "lolcode": rgb("#cc9900"), "lsl": rgb("#3d9970"), "labview": rgb("#fede06"), "lasso": rgb("#999999"), "lex": rgb("#DBCA00"), "ligolang": rgb("#0e74ff"), "lilypond": rgb("#9ccc7c"), "literate agda": rgb("#315665"), "literate coffeescript": rgb("#244776"), "literate haskell": rgb("#5e5086"), "livescript": rgb("#499886"), "logtalk": rgb("#295b9a"), "lookml": rgb("#652B81"), "lua": rgb("#000080"), "matlab": rgb("#e16737"), "maxscript": rgb("#00a6a6"), "mlir": rgb("#5EC8DB"), "mql4": rgb("#62A8D6"), "mql5": rgb("#4A76B8"), "macaulay2": rgb("#d8ffff"), "makefile": rgb("#427819"), "mako": rgb("#7e858d"), "mathematica": rgb("#dd1100"), "max": rgb("#c4a79c"), "mercury": rgb("#ff2b2b"), "meson": rgb("#007800"), "metal": rgb("#8f14e9"), "mint": rgb("#02b046"), "mirah": rgb("#c7a938"), "modelica": rgb("#de1d31"), "modula-2": rgb("#10253f"), "modula-3": rgb("#223388"), "monkey c": rgb("#8D6747"), "moonscript": rgb("#ff4585"), "motoko": rgb("#fbb03b"), "motorola 68k assembly": rgb("#005daa"), "move": rgb("#4a137a"), "ncl": rgb("#28431f"), "nwscript": rgb("#111522"), "nasal": rgb("#1d2c4e"), "nearley": rgb("#990000"), "nemerle": rgb("#3d3c6e"), "netlinx": rgb("#0aa0ff"), "netlinx+erb": rgb("#747faa"), "netlogo": rgb("#ff6375"), "newlisp": rgb("#87AED7"), "nextflow": rgb("#3ac486"), "nim": rgb("#ffc200"), "nit": rgb("#009917"), "nix": rgb("#7e7eff"), "nu": rgb("#c9df40"), "numpy": rgb("#9C8AF9"), "nushell": rgb("#4E9906"), "ocaml": rgb("#ef7a08"), "objectscript": rgb("#424893"), "objective-c": rgb("#438eff"), "objective-c++": rgb("#6866fb"), "objective-j": rgb("#ff0c5a"), "odin": rgb("#60AFFE"), "omgrofl": rgb("#cabbff"), "opal": rgb("#f7ede0"), "open policy agent": rgb("#7d9199"), "opencl": rgb("#ed2e2d"), "openedge abl": rgb("#5ce600"), "openqasm": rgb("#AA70FF"), "openscad": rgb("#e5cd45"), "oxygene": rgb("#cdd0e3"), "oz": rgb("#fab738"), "p4": rgb("#7055b5"), "pddl": rgb("#0d00ff"), "peg.js": rgb("#234d6b"), "php": rgb("#4F5D95"), "plsql": rgb("#dad8d8"), "plpgsql": rgb("#336790"), "pov-ray sdl": rgb("#6bac65"), "pact": rgb("#F7A8B8"), "pan": rgb("#cc0000"), "papyrus": rgb("#6600cc"), "parrot": rgb("#f3ca0a"), "pascal": rgb("#E3F171"), "pawn": rgb("#dbb284"), "pep8": rgb("#C76F5B"), "perl": rgb("#0298c3"), "picolisp": rgb("#6067af"), "piglatin": rgb("#fcd7de"), "pike": rgb("#005390"), "pogoscript": rgb("#d80074"), "polar": rgb("#ae81ff"), "portugol": rgb("#f8bd00"), "powerbuilder": rgb("#8f0f8d"), "powershell": rgb("#012456"), "processing": rgb("#0096D8"), "procfile": rgb("#3B2F63"), "prolog": rgb("#74283c"), "promela": rgb("#de0000"), "propeller spin": rgb("#7fa2a7"), "puppet": rgb("#302B6D"), "purebasic": rgb("#5a6986"), "purescript": rgb("#1D222D"), "pyret": rgb("#ee1e10"), "python": rgb("#3572A5"), "python console": rgb("#3572A5"), "q#": rgb("#fed659"), "qml": rgb("#44a51c"), "qt script": rgb("#00b841"), "quake": rgb("#882233"), "r": rgb("#198CE7"), "rexx": rgb("#d90e09"), "rpgle": rgb("#2BDE21"), "racket": rgb("#3c5caa"), "ragel": rgb("#9d5200"), "raku": rgb("#0000fb"), "rascal": rgb("#fffaa0"), "rescript": rgb("#ed5051"), "reason": rgb("#ff5847"), "reasonligo": rgb("#ff5847"), "rebol": rgb("#358a5b"), "red": rgb("#f50000"), "ren'py": rgb("#ff7f7f"), "ring": rgb("#2D54CB"), "robotframework": rgb("#00c0b5"), "rouge": rgb("#cc0088"), "routeros script": rgb("#DE3941"), "ruby": rgb("#701516"), "rust": rgb("#dea584"), "sas": rgb("#B34936"), "sqf": rgb("#3F3F3F"), "sqlpl": rgb("#e38c00"), "saltstack": rgb("#646464"), "scala": rgb("#c22d40"), "scenic": rgb("#fdc700"), "scheme": rgb("#1e4aec"), "scilab": rgb("#ca0f21"), "self": rgb("#0579aa"), "shaderlab": rgb("#222c37"), "shell": rgb("#89e051"), "shen": rgb("#120F14"), "singularity": rgb("#64E6AD"), "slash": rgb("#007eff"), "slice": rgb("#003fa2"), "smpl": rgb("#c94949"), "smalltalk": rgb("#596706"), "smarty": rgb("#f0c040"), "smithy": rgb("#c44536"), "snakemake": rgb("#419179"), "solidity": rgb("#AA6746"), "sourcepawn": rgb("#f69e1d"), "squirrel": rgb("#800000"), "stan": rgb("#b2011d"), "standard ml": rgb("#dc566d"), "starlark": rgb("#76d275"), "stata": rgb("#1a5f91"), "supercollider": rgb("#46390b"), "sway": rgb("#dea584"), "swift": rgb("#F05138"), "systemverilog": rgb("#DAE1C2"), "ti program": rgb("#A0AA87"), "tl-verilog": rgb("#C40023"), "tla": rgb("#4b0079"), "tsql": rgb("#e38c00"), "tsx": rgb("#3178c6"), "txl": rgb("#0178b8"), "talon": rgb("#333333"), "tcl": rgb("#e4cc98"), "terra": rgb("#00004c"), "thrift": rgb("#D12127"), "turing": rgb("#cf142b"), "typescript": rgb("#3178c6"), "unified parallel c": rgb("#4e3617"), "uno": rgb("#9933cc"), "unrealscript": rgb("#a54c4d"), "urweb": rgb("#ccccee"), "v": rgb("#4f87c4"), "vba": rgb("#867db1"), "vbscript": rgb("#15dcdc"), "vcl": rgb("#148AA8"), "vhdl": rgb("#adb2cb"), "vala": rgb("#a56de2"), "verilog": rgb("#b2b7f8"), "vim script": rgb("#199f4b"), "visual basic .net": rgb("#945db7"), "visual basic 6.0": rgb("#2c6353"), "volt": rgb("#1F1F1F"), "vyper": rgb("#2980b9"), "wdl": rgb("#42f1f4"), "wgsl": rgb("#1a5e9a"), "webassembly": rgb("#04133b"), "whiley": rgb("#d5c397"), "witcher script": rgb("#ff0000"), "wollok": rgb("#a23738"), "wren": rgb("#383838"), "x10": rgb("#4B6BEF"), "xc": rgb("#99DA07"), "xquery": rgb("#5232e7"), "xslt": rgb("#EB8CEB"), "xojo": rgb("#81bd41"), "xonsh": rgb("#285EEF"), "xtend": rgb("#24255d"), "yara": rgb("#220000"), "yacc": rgb("#4B6C4B"), "yul": rgb("#794932"), "zap": rgb("#0d665e"), "zil": rgb("#dc75e5"), "zenscript": rgb("#00BCD1"), "zephir": rgb("#118f9e"), "zig": rgb("#ec915c"), "zimpl": rgb("#d67711"), "ec": rgb("#913960"), "fish": rgb("#4aae47"), "hoon": rgb("#00b171"), "jq": rgb("#c7254e"), "mirc script": rgb("#3d57c3"), "mcfunction": rgb("#E22837"), "mupad": rgb("#244963"), "nesc": rgb("#94B0C7"), "ooc": rgb("#b0b77e"), "q": rgb("#0040cd"), "sed": rgb("#64b970"), "wisp": rgb("#7582D1"), "xbase": rgb("#403a40"), )
https://github.com/ClazyChen/Table-Tennis-Rankings
https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2004/MS-10.typ
typst
#set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (1 - 32)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [1], [<NAME>], [KOR], [2722], [2], [WANG Liqin], [CHN], [2687], [3], [WANG Hao], [CHN], [2625], [4], [CHEN Qi], [CHN], [2566], [5], [<NAME>], [CHN], [2540], [6], [CHUANG Chih-Yuan], [TPE], [2438], [7], [<NAME>], [ROU], [2423], [8], [<NAME>], [BLR], [2411], [9], [WALDNER Jan-Ove], [SWE], [2399], [10], [K<NAME>], [CHN], [2398], [11], [<NAME>], [GER], [2388], [12], [CHIANG Peng-Lung], [TPE], [2328], [13], [<NAME> Yan], [HKG], [2311], [14], [HAO Shuai], [CHN], [2305], [15], [JOO Saehyuk], [KOR], [2304], [16], [<NAME>], [AUT], [2297], [17], [KO Lai Chak], [HKG], [2288], [18], [LIU Guozheng], [CHN], [2282], [19], [CHEUNG Yuk], [HKG], [2273], [20], [KREANGA Kalinikos], [GRE], [2232], [21], [BLASZCZYK Lucjan], [POL], [2220], [22], [<NAME>], [CZE], [2204], [23], [<NAME>], [SWE], [2190], [24], [<NAME>], [AUT], [2189], [25], [<NAME>], [GER], [2180], [26], [<NAME>], [SLO], [2176], [27], [<NAME>], [NED], [2175], [28], [<NAME>], [KOR], [2167], [29], [<NAME>], [SWE], [2150], [30], [QIU Yike], [CHN], [2147], [31], [#text(gray, "KIM Taeksoo")], [KOR], [2145], [32], [<NAME>], [BEL], [2144], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (33 - 64)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [33], [<NAME>], [HKG], [2143], [34], [KARLSSON Peter], [SWE], [2138], [35], [<NAME>], [GER], [2132], [36], [<NAME>], [BEL], [2126], [37], [<NAME>], [ESP], [2122], [38], [TUGWELL Finn], [DEN], [2122], [39], [<NAME>], [FRA], [2115], [40], [<NAME>], [CRO], [2111], [41], [MAZE Michael], [DEN], [2106], [42], [<NAME>], [KOR], [2093], [43], [<NAME>], [GER], [2085], [44], [ERLANDSEN Geir], [NOR], [2085], [45], [<NAME>], [RUS], [2083], [46], [<NAME>], [GER], [2081], [47], [<NAME>], [CHN], [2056], [48], [<NAME>], [SRB], [2046], [49], [<NAME>], [SWE], [2043], [50], [SMIRNOV Alexey], [RUS], [2043], [51], [<NAME>], [JPN], [2042], [52], [YANG Min], [ITA], [2029], [53], [#text(gray, "<NAME>")], [CHN], [2021], [54], [<NAME>], [AUT], [2015], [55], [<NAME>], [FRA], [2011], [56], [<NAME>], [NOR], [2010], [57], [<NAME>], [SVK], [2009], [58], [HIELSCHER Lars], [GER], [2005], [59], [<NAME>], [CZE], [2002], [60], [<NAME>], [CHN], [1986], [61], [<NAME>], [GER], [1984], [62], [<NAME>], [ITA], [1976], [63], [<NAME>], [KOR], [1975], [64], [LENGEROV Kostadin], [AUT], [1964], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (65 - 96)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [65], [<NAME>], [ARG], [1949], [66], [GORAK Daniel], [POL], [1945], [67], [<NAME>], [CZE], [1944], [68], [<NAME>], [GER], [1941], [69], [<NAME>], [ROU], [1936], [70], [<NAME>], [SWE], [1934], [71], [<NAME>], [HUN], [1930], [72], [<NAME>], [NED], [1929], [73], [<NAME>], [SWE], [1928], [74], [<NAME>], [DEN], [1925], [75], [<NAME>], [BLR], [1923], [76], [PAVELKA Tomas], [CZE], [1919], [77], [KRZESZEWSKI Tomasz], [POL], [1916], [78], [#text(gray, "<NAME>")], [FRA], [1915], [79], [<NAME>], [CHN], [1911], [80], [SHMYREV Maxim], [RUS], [1909], [81], [PHUNG Armand], [FRA], [1908], [82], [<NAME>], [CAN], [1907], [83], [<NAME>], [CRO], [1906], [84], [YO<NAME>], [KOR], [1904], [85], [<NAME>], [POL], [1904], [86], [FAZEKAS Peter], [HUN], [1902], [87], [#text(gray, "<NAME>")], [ROU], [1900], [88], [<NAME>], [RUS], [1900], [89], [<NAME>], [SVK], [1897], [90], [OLEJNIK Martin], [CZE], [1896], [91], [<NAME>], [NGR], [1894], [92], [#text(gray, "<NAME>")], [FRA], [1892], [93], [<NAME>], [IND], [1891], [94], [<NAME>], [BUL], [1887], [95], [<NAME>], [FRA], [1883], [96], [<NAME>], [BRA], [1880], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (97 - 128)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [97], [ZHUANG David], [USA], [1880], [98], [#text(gray, "<NAME>")], [JPN], [1877], [99], [BENTSEN Allan], [DEN], [1872], [100], [TANG Peng], [HKG], [1870], [101], [MOLDOVAN Istvan], [NOR], [1867], [102], [KUSINSKI Marcin], [POL], [1866], [103], [TSIOKAS Ntaniel], [GRE], [1866], [104], [<NAME>], [ISL], [1865], [105], [<NAME>], [FRA], [1860], [106], [<NAME>], [ESP], [1857], [107], [<NAME>], [SRB], [1855], [108], [<NAME>], [SVK], [1855], [109], [VYBORNY Richard], [CZE], [1854], [110], [TASAKI Toshio], [JPN], [1854], [111], [<NAME>], [KOR], [1853], [112], [<NAME>], [GER], [1849], [113], [KOSOWSKI Jakub], [POL], [1847], [114], [<NAME>], [HUN], [1841], [115], [KISHIKAWA Seiya], [JPN], [1838], [116], [#text(gray, "YAN Sen")], [CHN], [1836], [117], [TAVUKCUOGLU Irfan], [TUR], [1836], [118], [HENZELL William], [AUS], [1835], [119], [<NAME>], [KOR], [1834], [120], [LUPULESKU Ilija], [USA], [1829], [121], [#text(gray, "BABOOR Chetan")], [IND], [1829], [122], [PIACENTINI Valentino], [ITA], [1828], [123], [<NAME>], [CRO], [1826], [124], [<NAME>], [SWE], [1824], [125], [<NAME>], [FRA], [1823], [126], [<NAME>], [FRA], [1818], [127], [<NAME>], [BRA], [1812], [128], [<NAME>], [SVK], [1810], ) )
https://github.com/profetia/me
https://raw.githubusercontent.com/profetia/me/main/src/bin/resume.typ
typst
#import "../lib.typ": option, option_ext #set page( margin: (x: 0.9cm, y: 1.3cm), ) #set par(justify: true) #let lang = "en" #option.option("lang", lang) #let zh(content) = [ #set text(font: "Microsoft YaHei") #option_ext.zh(content) ] #let en = option_ext.en #let present = [ #en[present] #zh[至今] ] #show link: underline #show heading.where(level: 1): it => [ #set align(center) // #set text(size: 28pt) #set text(size: 24pt) #it.body ] #show heading.where(level: 2): it => [ #v(0.2em) // #set text(size: 14pt) #set block(above: 0.5em, below: 0.5em) #it.body #v(-3pt) #[ #set text(style: "normal", weight: "regular") #line(length: 100%) ] ] #show heading.where(level: 3): it => [ #it.body ] #let normal(it) = [ #set text(style: "normal", weight: "regular") #it ] #let contact(..its) = { let values = its.pos().join(" | ") [ #set align(center) // #set text(size: 12pt) #set block(above: 0.5em, below: 0.5em) #block[ #align(horizon)[ #values ] ] ] } = #en[<NAME>] #zh[杨林树] #en[#v(-0.5em)] #contact( [<EMAIL>], [#link("https://github.com/profetia")[github.com/profetia]] ) #en[#v(0.8em)] == #en[Education] #zh[教育经历] #en[=== ShanghaiTech University] #zh[=== 上海科技大学] #h(1fr) 2021/09 -- #present \ #en[Bachelor of Engineering in Computer Science and Technology ] #zh[计算机科学与技术工程学士] #h(1fr) GPA 3.72/4.0 (15%), #en[TOFEL] #zh[托福] 112 - #en[Relevant Courses: Computer Architecture, Software Engineering, Computer Networks, Operating System, \ #h(83pt) Parallel Computing, Database Systems, Deep Learning, Computer Aided Verification] #zh[相关课程:计算机体系结构,软件工程,计算机网络,操作系统,并行计算,数据库,计算机辅助验证] #zh[#v(3pt)] == #en[Publications] #zh[发表论文] - *Understanding Hybrid Scheduling in Asymmetric Processors* #h(1fr) *HPCA'2025* \ _<NAME>, *<NAME>*, <NAME>_ #h(1fr) *Under Review* \ - *pyUPPAAL: A Python Package for Risk Analysis of CPS* *[#link("https://dl.acm.org/doi/abs/10.1145/3576841.3589611")[paper]] | [#link("https://github.com/Jack0Chan/PyUPPAAL")[code]]* #h(1fr) *ICCPS'2023* \ _<NAME>, *<NAME>*, <NAME>, <NAME>, <NAME>_ #h(1fr) *Published* \ #zh[#v(3pt)] == #en[Research Experience] #zh[科研经历] === #en[Max Planck Institute for Informatics, Network and Cloud System Group] #zh[马克思普朗克信息研究所,网络与云系统组] #h(1fr) 2024/09 -- 2024/11 \ #en[Research Intern, Advised by *Prof. <NAME>*] #zh[在夏艺婷教授指导下的科研] #h(1fr) #en[Data Center Network, Optical Network, Programmable Switch] #zh[数据中心网络,光网络,可编程交换机] \ - #en[Built a realistic evaluation platform for traffic-aware schedulers in DCN with Intel Tofino programmable switches, enabling reliable comparisons between scheduling algorithms such as c-Through and Mordia.] #zh[使用 Intel Tofino 可编程交换机构建了一个真实的端到端评估平台,用于数据中心网络中的流量感知调度算法。] #v(-4pt) === #en[ShanghaiTech University, Wireless and Mobile System Lab] #zh[上海科技大学,无线与移动系统实验室] #h(1fr) 2023/12 -- 2024/08 \ #en[Research Intern, Advised by *Prof. <NAME>*] #zh[在杨智策教授指导下的科研] #h(1fr) #en[Wireless Networking System, Network Physical System] #zh[无线网络系统,网络物理系统,操作系统内核] \ // - #en[Migrated the Precision Time Protocol (PTP) to Bluetooth Low Energy (BLE) on embedded systems by emulating hardware PTP clock with hardware counters.] // #zh[在嵌入式系统上利用硬件计数器模拟硬件PTP时钟,将精确时间协议(PTP)迁移到蓝牙低功耗(BLE)上。] - #en[Identified a bottleneck scenario with eBPF-intensive workloads demonstrating the effectiveness of the proposed ITD-guided scheduler and providing a comprehensive benchmark on virtualization related workloads.] #zh[发现了一个 eBPF 密集型工作负载的瓶颈场景,证明了提出的 ITD 引导调度器的有效性,并对虚拟化相关工作负载进行了全面的性能评估。] - #en[Evaluated the robustness of existing attack methods on newer models of LIDAR, proving their ineffectiveness and built an adversarial device effectively replicating a malfunction of a widely-used commodity LIDAR model.] #zh[评估了现有攻击方法对新型激光雷达的鲁棒性,证明了它们的无效性,并构建了一个复现一种广泛使用的激光雷达模型故障的对抗设备。] #v(-4pt) === #en[ShanghaiTech University, Human-Cyber-Physical System Lab] #zh[上海科技大学,人-机-物三元融合实验室] #h(1fr) 2022/07 -- 2023/06 \ #en[Research Intern, Advised by *Prof. <NAME>*] #zh[在江智浩教授指导下的科研] #h(1fr) #en[Formal Methods, Model Checking, Cyber-Physical System] #zh[形式化方法,模型验证,网络物理系统] \ - #en[Built a Python toolkit to work with UPPAAL with implementation of common use cases and algorithms in CPS.] #zh[构建了一个 Python 工具链,用于与 UPPAAL 验证求解器配合使用,实现了网络物理系统中的常见用例和算法。] - #en[Implemented and optimized a novel model-checking based cardiac diagnoser to achieve real-time analysis and diagnosis on cardiac electrical signals.] #zh[实现并优化了一种基于抽象细化模型验证方法的错误诊断算法,并应用于对心脏电信号的实时分析和诊断。] // - #en[Deployed a Kubernetes cluster to manage applications of HCPS Lab, providing TLS certificate automation, persistent volumes and load balancers.] // #zh[部署了一个 Kubernetes 集群,用于管理实验室的应用,提供自动化 TLS 证书、持久卷和负载均衡器。] #zh[#v(3pt)] == #en[Work Experience] #zh[工作经历] === #en[Keen Security Lab, Tencent] #zh[腾讯科恩安全实验室] #h(1fr) 2024/04 -- 2024/07 \ #en[System R&D Intern, Tactic Intelligence Team] #zh[情报系统研发实习] #h(1fr) #en[Malware Analysis, Linux, eBPF] #zh[恶意代码分析,Linux,eBPF] #en[ - Recreated the Linux sandbox for malware analysis by upgrading the kernel and utilizing new kernel features. - Extended dynamic analysis capabilities of the Linux sandbox using customized probing tools in eBPF and kernel modules. - Streamlined the gRPC endpoint for the malware database and rewrote the log parser with PEG. ] #zh[ - 翻新了被废弃的 Linux 沙箱以支持新的内核版本,并通过内核模块和 eBPF 扩展了沙箱的动态内存分析能力。 - 重构了恶意代码数据库的 gRPC 终端,并使用 PEG 重写了日志解析器。 ] // === #en[Deemos Technologies Inc.] #zh[影眸科技有限公司] // #h(1fr) 2023/01 -- 2023/07 \ // #en[Software Engineer Intern] #zh[软件开发实习] #h(1fr) // Shanghai, China // \ // - #en[Developed a full stack application to commercialize ChatAvatar, a text to 3D generation model developed by the company.] // #zh[开发了一个全栈应用,用于商业化公司开发的 ChatAvatar 文本到 3D 生成模型。] // - #en[Designed and implemented a Blender tool to reshape and adjust cloth mesh according to human model.] // #zh[设计并实现了一个 Blender 插件,用于根据人体模型调整衣物模型的大小和形状。] #zh[#v(3pt)] == #en[Projects] #zh[项目经历] === Rathernet: #normal[ #en[An acoustic userspace network stack written in Rust] #zh[基于声波传输的用户空间网络协议栈] ] *[#link("https://github.com/profetia/rathernet")[code]]* #h(1fr) #en[Rust, Wireless Network, Network Protocol] #zh[Rust,无线网络,网络协议] \ - #en[Implemented all five layers in the OSI model from bottom to up with acoustic wave as the carrier.] #zh[使用声波作为传输介质,从 OSI 模型的底层到应用层实现了一个完整的网络协议栈。] // - #en[Utilized existing Rust asynchronous infrastructures and avoided manual control of scheduling and synchronization.] // #zh[利用现有的 Rust 异步基础设施,避免了手动控制调度和同步。] - #en[Created a customized network address translation, achieving bidirectional interaction with the Internet.] #zh[实现了一个定制的网络地址转换,与互联网的双向交互,并轻松集成到操作系统,支持常见的传输和应用层协议。] // #en[- Integrated into the operating system effortlessly, supporting common transportation and application protocols.] // #zh[- 轻松集成到操作系统中,支持常见的传输和应用层协议。] #v(-0.5em) === Pintos: #normal[ #en[An education oriented operating system from Stanford ] #zh[x86 平台的多线程操作系统] ] *[#link("https://github.com/profetia/pintos")[code]]* #h(1fr) #en[C, Scheduling, Virtual Memory, File System] #zh[C 语言,线程调度,虚拟内存,文件系统] \ - #en[Completed core functionalities of an operating system: kernel threads, user programs, virtual memory and file system.] #zh[完成了操作系统的核心组件:内核线程、用户程序、虚拟内存、mmap 和文件系统。] // #v(-0.5em) // === BusTub: // #normal[ // #en[A relational database management system from CMU ] // #zh[关系型数据库管理系统] // ] // #h(1fr) // #en[Modern C++, Concurrency Control, Query Execution] // #zh[现代 C++,并发控制,查询优化] // \ // - #en[Implemented core components of a DBMS: storage management, indexing, query execution and concurrency control.] // #zh[实现了数据库管理系统的核心功能,包括存储管理、索引、查询执行和并发控制。] #v(-0.5em) === LBM: #normal[ #en[A numerical simulation of Computational Fluid Dynamics] #zh[基于玻尔兹曼方法的多线程流体动力模拟] ] *[#link("https://github.com/winlere/lbm")[code]]* #h(1fr) #en[HPC, Profiling, OpenMP, Micro Architecture] #zh[高性能计算,性能分析,OpenMP,微架构] \ - #en[Optimized the simulation with OpenMP parallelization, SIMD vectorization, memory alignment, cache blocking and software pipelining, achieving 20x speed up.] #zh[通过 OpenMP 并行化、SIMD 矢量化、内存对齐、缓存阻塞和软件流水线等技术优化,实现了 20 倍的速度提升。] #zh[#v(3pt)] == #en[Miscellaneous] #zh[杂项] // #zh[熟悉操作系统和计算机体系结构,擅长计算机网络和高性能计算。] - #en[Skills] #zh[技能]: Python, C, C++, Rust, Go, Typescript, Pytorch, MPI, OpenMP, CUDA, Docker, Linux Kernel, eBPF, Dafny - #en[Awards] #zh[奖项]: - #en[Rank 9/29 (3/29 for my part), ISC'24 Student Cluster Competition] #zh[ISC'24 国际超算竞赛第 9 名(个人负责部分第 3 名)] #h(1fr) 2024/04 // - #en[Outstanding Teaching Assistant, ShanghaiTech University] // #zh[上海科技大学优秀助教] // #h(1fr) 2023/06 // - #en[Silver Award, ICPC China Silk Road National Invitational 2023] // #zh[ICPC 中国丝绸之路邀请赛银奖] // #h(1fr) 2023/05 - #en[Merit Student (Rank 3%-7%), ShanghaiTech University] #zh[2022 年上海科技大学三好学生(3%-7%)] #h(1fr) 2022/10 - #en[Level 6, the 2019 Certified Software Professional Senior Track (formerly NOIP)] #zh[2019 年全国青少年信息学奥林匹克联赛提高组 6 级] #h(1fr) 2019/12
https://github.com/0x1B05/algorithm-journey
https://raw.githubusercontent.com/0x1B05/algorithm-journey/main/practice/note/content/KMP.typ
typst
#import "../template.typ": * #pagebreak() = KMP 1. 理解`next`数组:不包含当前字符,前面字符串,前缀和后缀最大匹配长度(不包含整体,于是`next[0]=-1`,`next[1]=0`) 2. 假设已经有了`next`数组,匹配过程如何得到加速的(两个核心) 3. 理解匹配主流程之后,详解`next`数组如何快速生成(一个核心) 4. 复杂度证明 == #link("https://leetcode.cn/problems/find-the-index-of-the-first-occurrence-in-a-string/")[KMP问题引入] 长为 n 的字符串`str1`和和长为 m 的字符串`str2`,`str1`是否包含`str2`,如果包含则返回`str2`在`str1`中起始位置。 分析: 1. 暴力枚举,遍历`str1`的每个字符的位置,依次比对两个字符相应位置的字符,如果`str2`字符串的指针走到了最后,则表示当前匹配成功,返回当前 str1 的起始位置.O(n\*m) 2. KMP 算法.O(n+m) === 暴力枚举 #code(caption: [KMP - 暴力枚举])[ ```java class Solution { // 暴力解法 public int strStr(String haystack, String needle) { // 首先进行边界条件判断 if(haystack == null || needle == null || haystack.length() < needle.length()){ return -1; } if("".equals(needle)) return 0; char[] charH = haystack.toCharArray(); char[] charN = needle.toCharArray(); for(int i = 0; i + charN.length - 1 < charH.length; i++){ int ch = i; int cn = 0; while(cn < charN.length && charH[ch] == charN[cn]){ ch++; cn++; } if(cn == charN.length){ return i; } } return -1; } } ``` ] === `next`数组理解举例 #example("Example")[ `str`:`aabaabsaabaaa` ``` a a b a a b s a a b a a a 0 1 2 3 4 5 6 7 8 9 10 11 12 -1 0 1 0 1 2 3 0 1 2 3 4 5 ``` - `next[2]`: - prefix: `aa` -> 1 - `next[3]`: - prefix: `aab` -> 0 - `next[4]`: - prefix: `a ab a` -> 1 - `next[5]`: - prefix: `aa b aa` -> 2 - `next[6]`: - prefix: `aab aab` -> 3 ... ] #example("Example")[ 也可以错开`str`:`aaaaat` - `next[5]`: - prefix: `aaaaa` -> 4 ] === 匹配过程加速举例 ``` 0 1 2 3 4 5 6 7 8 9 10 11 12 13 s1: a a b a a b c a a b a a b a next: -1 0 1 0 1 2 3 0 1 2 3 4 5 6 s2: a a b a a b c a a b a a b t next: -1 0 1 0 1 2 3 0 1 2 3 4 5 6 ``` 从0开头匹配到13发现不对, 接着s1匹配的位置不动,s2的位置来到6,6和13匹配。 ``` 0 1 2 3 4 5 6 7 8 9 10 11 12 13 s1: a a b a a b c a a b a a b a next: -1 0 1 0 1 2 3 0 1 2 3 4 5 6 0 1 2 3 4 5 6 s2: a a b a a b c next: -1 0 1 0 1 2 3 ``` 疑问? 1. 那1, 2, 3...6开头匹配就放弃? - 由于`next`数组的存在必然无法匹配出`s2` 2. 7开头匹配为什么不是`s2[0]`和`s1[7]`开始匹配? 怎么直接跳到`s2[6]`和`s1[13]`? - `next`数组的含义来确定的 疑问2显然 ``` |i| .... |j| s1: | |..7..|a| |0| .... |k| s2: |..7..| |..7..|b| ``` 疑问1 ``` |i| |?| ... |p| |j| s1: | |..7..|a| |0| .... |k| s2: |..7..| |..7..|b| ``` 假设`?`(`i<?<p`)开头能配出`s2`, 那么`? -> j-1`就可以配出s2前面等长的一段。而`?- -> j-1`又和对应位置的s2里的字符相等,那么`next`就要增加了(最大匹配长度决定),矛盾! 整体: ``` 0 1 2 3 4 5 6 7 8 9 10 11 12 13 s1: a a b a a b c a a b a a b ? s2: a a b a a b c a a b a a b t next: -1 0 1 0 1 2 3 0 1 2 3 4 5 6 ``` 从0开头匹配到13发现不对, 接着s1匹配的位置不动,s2的位置来到6,6和13匹配。 ``` 0 1 2 3 4 5 6 7 8 9 10 11 12 13 s1: a a b a a b c a a b a a b ? 0 1 2 3 4 5 6 s2: a a b a a b c next: -1 0 1 0 1 2 3 ``` 又不对 ``` 0 1 2 3 4 5 6 7 8 9 10 11 12 13 s1: a a b a a b c a a b a a b ? 0 1 2 3 s2: a a b a next: -1 0 1 0 ``` 再不对就跳到`-1`了 ``` s1: 14... s2: 0... ``` === `next`数组如何快速生成 `next[0]=-1`,`next[1]=0` ==== 不用跳 ``` 0 1 2 3 4 5 6 | 7 | 8 9 10 11 12 13 14| 15| 16 s2: a b a t a b a | s | a b a t a b a | s | ? next:... 7 ``` `next[16]`? `next[15] = 7`, `s2[7]==s2[15]`=>`next[16]=8` 为啥不能更大? 假设`next[16]=10` => `s2[0..9]`与`s2[6..15]`相等. 于是`next[15]=9`,矛盾! ==== 跳多次 ===== 跳一次: ``` 0 1 2 3 4 5 6 | 7 | 8 9 10 11 12 13 14| 15| 16 s2: a b a t a b a | s | a b a t a b a | s | ? next: ... 3 ... 7 ``` - `s2[7]!=s2[15]` => `next[7] = 3` - `s[3]==s[15]` => `next[16] = 4` ===== 跳两次: ``` 0 1 2 3 4 5 6 | 7 | 8 9 10 11 12 13 14| 15| 16 s2: a b a t a b a | s | a b a t a b a | b | ? next: 1 ... 3 ... 7 ``` - `s2[7]!=s2[15]` => `next[7] = 3` - `s[3]!=s[15]` => `next[3] = 1` - `s[1]==s[15]` => `next[16] = 2` ===== 跳三次: ``` 0 1 2 3 4 5 6 | 7 | 8 9 10 11 12 13 14| 15| 16 s2: a b a t a b a | s | a b a t a b a | a | ? next: 0 1 ... 3 ... 7 ``` - `s2[7]!=s2[15]` => `next[7] = 3` - `s[3]!=s[15]` => `next[3] = 1` - `s[1]!=s[15]` => `next[1] = 0` - `s[0]==s[15]` => `next[16] = 1` ===== 跳到头: ``` 0 1 2 3 4 5 6 | 7 | 8 9 10 11 12 13 14| 15| 16 s2: a b a t a b a | s | a b a t a b a | f | ? next: 0 1 ... 3 ... 7 ``` - `s2[7]!=s2[15]` => `next[7] = 3` - `s[3]!=s[15]` => `next[3] = 1` - `s[1]!=s[15]` => `next[1] = 0` - `s[0]!=s[15]` => `next[0] = -1` => `next[16] = 0` ==== 凭啥? ``` | 0 -- 9 | 10 | 11 -- 20 | 21 | 22 | s2: | .. | x | .. | y | ? | next: | .. | | .. | 10 | ? | ``` - 如果`x==y`那么就`next[22] = next[22-1]+1` - 如果`x!=y`, 为啥要继续基于`x`的`next`数组的值往前跳呢? - `next[22]`已经无法到达`10`了,于是希望在`0-9`保留一个尽量长的前缀,`11-20`保留一个尽量长的后缀。 - 而`s2[0...9]`与`s2[11...20]`是完全一样的,于是`11-20`尽量长的后缀与`0-9`尽量长的后缀是一样的,那就是基于`x`的`next`数组的值。 === 代码实现: #code(caption: [kmp])[ ```java // KMP算法 public static int kmp(char[] s1, char[] s2) { // s1中当前比对的位置是x // s2中当前比对的位置是y int n = s1.length, m = s2.length, x = 0, y = 0; // O(m) int[] next = nextArray(s2, m); // O(n) while (x < n && y < m) { if (s1[x] == s2[y]) { x++; y++; } else if (y == 0) { x++; } else { y = next[y]; } } return y == m ? x - y : -1; } // 得到next数组 public static int[] nextArray(char[] s, int m) { if (m == 1) { return new int[] { -1 }; } int[] next = new int[m]; next[0] = -1; next[1] = 0; // i表示当前要求next值的位置 // cn表示当前要和前一个字符比对的下标 int i = 2, cn = 0; while (i < m) { if (s[i - 1] == s[cn]) { next[i++] = ++cn; } else if (cn > 0) { cn = next[cn]; } else { next[i++] = 0; } } return next; } ``` ] === 时间复杂度 ==== `nextArray`: O(m) - i: 规模m => O(m) - i-cn: 最大值max(i)-min(cn)=m => O(m) #three-line-table[ |branch |i(m) |i-cn(m)| | - | - | - | | `s[i - 1] == s[cn]` | ↑ | 不变 | | `cn>0` | 不变 | ↑ | | else | ↑ | ↑ | ] 复杂度: 分支1的次数+分支2的次数+分支3的次数. `i + (i-cn)`也就O(2m),而这两个量在每个分支都只有变多的时候,没有不变/变少的时候,因此必然<=2m,因此复杂度O(m). #tip("Tip")[ 为什么这么捏造这两个量? - 因为既有i增加,又有cn减少,在这情况下,两者相减(有时候也相除)有单调性。 ] #tip("Tip")[ 可以均摊,得到一个位置的next值是O(1) ] ==== 主流程 - x: 最大规模n => O(n) - x-y: 最大规模max(x)-min(y)=n-0 => O(n) #three-line-table[ |branch |x(n) |x-y(m)| | - | - | - | | `s1[x] == s2[y]` | ↑ | 不变 | | `y==0` | ↑ | ↑ | | else | 不变 | ↑ | ] 同理O(n) == 题目 === #link("https://leetcode.cn/problems/subtree-of-another-tree/")[题目1: 另一棵树的子树] 给你两棵二叉树 `root` 和 `subRoot` 。检验 `root` 中是否包含和 `subRoot` 具有相同结构和节点值的子树。如果存在,返回 `true` ;否则,返回 `false` 。 二叉树 `tree` 的一棵子树包括 `tree` 的某个节点和这个节点的所有后代节点。`tree` 也可以看做它自身的一棵子树。 #example("Example")[ - 输入:`root = [3,4,5,1,2]`, `subRoot = [4,1,2]` - 输出:`true` ] #tip("Tip")[ - `root` 树上的节点数量范围是 `[1, 2000]` - `subRoot` 树上的节点数量范围是 `[1, 1000]` - `-10^4 <= root.val <= 10^4` - `-10^4 <= subRoot.val <= 10^4` ]
https://github.com/lxl66566/my-college-files
https://raw.githubusercontent.com/lxl66566/my-college-files/main/信息科学与工程学院/算法导论/哈希表.typ
typst
The Unlicense
#import "../template.typ": * #show: project.with( title: "3", authors: ( "absolutex", ) ) = 哈希表 == 哈希表的一个应用,是Python的数据结构:字典。大家可以阅读一下构建Python字典的设计需求:http://svn.python.org/projects/python/trunk/Objects/dictnotes.txt (这不是必须的)。其中,提到了字典的一个应用场景: ``` Membership Testing Dictionaries of any size. Created once and then rarely changes. Single write to each key. Many calls to __contains__() or has_key(). Similar access patterns occur with replacement dictionaries such as with the % formatting operator. ``` 请问下述那个描述符合这个场景? A创建后多次插入,之后几乎是查找操作 *B创建后多次插入,之后全是查找操作* C插入/删除与查找操作出现的次数几乎一样多 D轮流进行插入/删除与查找操作 == 仍然是上题题干。考虑要创建一个哈希表来实现字典。请问如何考量这个哈希表表长的设计? A 初始选定一个较小的哈希表长度,后续以2倍进行扩增 B 初始选定一个较小的哈希表长度,后续以4倍进行扩增 *C 初始选定一个较大的哈希表长度,后续以2倍进行扩增* D 初始选定一个较大的哈希表长度,后续以4倍进行扩增 == 课本11.1-1 假设一动态集合S用一个长度为m的直接寻址表T来表示。请给出一个查找S中最大元素的过程。你所给的过程在最坏情况下的运行时间是多少? 只需要从 T 末尾开始查找,找到的第一个不为 NIL 的元素即为最大元素。 最坏情况下,需要遍历整个直接寻址表T,因此时间复杂度为 O(m). == 课本11.2-3 Marley教授做了这样一个假设,即如果将链模式改动一下,使得每个链表都能保持已排好序的顺序,散列的性能就可以有较大的提高。Marley教授的改动对成功查找、不成功查找、插入和删除操作的运行时间有何影响? 假设这个排序是递增的。 1. 成功查找操作:时间可能增大也可能减小。在同一条链表中查找小元素需要遍历的更少,大元素需要遍历的更多。 2. 不成功查找操作:找到比待查值大的数就可以提前终止搜索过程,会加快。 3. 插入操作:插入操作的时间增加。由于链表保持有序,插入一个新元素需要在链表中遍历,找到正确的位置并进行插入。而原先无需遍历。 4. 删除操作:与成功查找相同,时间可能增大也可能减小。 链表不能二分,如果这里用内存连续的数据结构可以大幅提升查找性能。 == 课本11.3-4 考虑一个大小为m=1000的散列表和一个对应的散列函数$h(k)= floor(m (k A mod 1))$,其中$A=(sqrt(5)—1)/2$,试计算关键字61、62、63、64和65被映射到的位置。 ```py from math import floor, sqrt A = (sqrt(5) - 1) / 2 for i in range(61, 66): hi = floor(1000 * ((i * A) % 1)) print(i, hi) # 61 700 # 62 318 # 63 936 # 64 554 # 65 172 ``` == 课本11.4-1 考虑用开放寻址法将关键字10、22、31、4、15、28、17、88、59插人到一长度为$m=11$ 的散列表中,辅助散列函数为$h'(k)=k$。试说明分别用线性探查、二次探查$(c_1=1,c_2=3)$和双重散列$(h_1(k)=k, h_2(k)=1+(k mod(m-1)))$将这些关键字插人散列表的过程。 ```py i = [10, 22, 31, 4, 15, 28, 17, 88, 59] m = 11 print(list(map(lambda x: x % m, i))) # [10, 0, 9, 4, 4, 6, 6, 0, 4] ``` === 线性探查 将重复数字后延。最终这些数的插入位置是:$[10, 0, 9, 4, 5, 6, 7, 1, 8]$ === 二次探查 在 $(c_1=1, c_2=3)$ 条件下,可以算出偏移量: ```py m = 11 c_1 = 1 c_2 = 3 for i in range(1, 7): print(i, (c_1 * i + c_2 * i * i) % m) # 1 4 # 2 3 # 3 8 # 4 8 # 5 3 # 6 4 ``` 在第5位的 4 偏移到 $4+4=8$,第7位的6偏移到 $6+4=10$ 再偏移到$(10+3) mod 11=2$,第8位的0偏移到 $0+4=4$ 再偏移到$4+3=7$,第9位的4偏移到 $4+4=8$ 再偏移到$(8+3)mod 11=0$再偏移到$0+8=8$再偏移到$(8+8)mod 11=5$,最终位置应该是 $[10, 0, 9, 4, 8, 6, 2, 7, 5]$ === 双重散列 $(h_1(k)=k, h_2(k)=1+(k mod(m-1)))$,直接上代码 ```py from functools import lru_cache origin = [10, 22, 31, 4, 15, 28, 17, 88, 59] m = 11 ans = [-1] * m @lru_cache def h2(k): return 1 + (k % (m - 1)) @lru_cache def h(k, i): return (k + i * h2(k)) % m for k in origin: times = 0 while ans[h(k, times)] != -1: times += 1 ans[h(k, times)] = k print(ans) # [22, -1, 59, 17, 4, 15, 28, 88, -1, 31, 10] ``` == 考虑到英文字符串包含了27个字符(26个字母+空格符),构造一种简单的除法哈希函数:$h(k)=k mod m$,其中m为哈希表大小,k为一个字符串所有字母数值的和(这里字符的值可采用ASCII码)。请问这种哈希方法是否足够好? 不够好。假设 m 远大于 ASCII码范围,那么对于较短的字符串,其所有字母数值的和不够大,会聚集在hash表的前段。并且对于字符串的交换,不会改变映射的位置,导致碰撞较高。 == 对于哈希表,我们希望它的性能足够好(插入和查找速度接近O(1)),同时我们也需要保证其正确性(即每个key都能被正确地插入哈希表中)。因此我们为哈希表提供两个操作:冲突处理与动态调整。其中动态调整是指根据插入的情况,动态扩大哈希表的大小。请问如下论述哪些是正确的: === (a)我们仅需要动态调整即可保证哈希表的正确性与性能; F === (b)动态调整保证了正确性,但是不保证性能; F === (c)冲突处理保证了性能,不保证正确性 F === (d)两种都是必须的,从而保证哈希表的正确性与性能 T 动态调整保证了性能,冲突处理保证了正确性 == 动态调整:假设原哈希表大小为m,包含了n个元素。此时要扩大到$m'$,请问至少需要多少的操作?(提示:用O渐进符号表示,注意用链接法和用开放寻址法解决冲突情况是不同的,要分别讨论) 对于动态调整来说,涉及到哈希表的扩容操作。在哈希表的扩容过程中,主要需要考虑两种不同的冲突解决方法:链接法和开放寻址法。 1. 链接法 每个插入操作的时间复杂度是O(1),因为只需要在对应槽位的链表中插入元素。总操作次数$O(n)$ 2. 开放寻址法 每个插入操作可能需要多次探查,直到找到一个可用的槽位。如果扩容后的表大小为$m'$,则每个插入操作最坏情况下可能需要O(m')的操作次数。因此,扩容的总操作次数为$O(n m')$。 == 课本11-2 假设有一个含n个槽的散列表,向表中插入n个关键字,并用链接法来解决冲突问题。每个关键字被等可能地散列到每个槽中。所有关键字被插人后,设M是各槽中所含关键字数的最大值。读者的任务是证明M的期望值$E[M]$的一个上界为$O((lg n)/(lg lg n))$。其中a, b, c为要求作答,d、e为附加题(难)。 === a.证明:正好有k个关键字被散列到某一特定槽中的概率$Q_k$为 $ Q_k=(1/n)^k (1-1/n)^(n-k) mat(n;k) $ 这里使用二项式定理: $ (x + y)^n = sum_(k = 0)^n binom(n, k) x^(n - k) y^k $ 令 $x = 1 - 1 / n$ 和 $y = 1 / n$,然后将其代入二项式定理: $ (1 - 1 / n + 1 / n)^n = sum_(k = 0)^n binom(n, k) (1 - 1 / n)^(n - k) (1 / n)^k $ 化简得: $ 1 = sum_(k = 0)^n binom(n, k) (1 - 1 / n)^(n - k) (1 / n)^k $ 因为每个关键字等可能地散列到每个槽中,所以我们关心的是其中的一项: $ Q_k = binom(n, k) (1 - 1 / n)^(n - k) (1 / n)^k $ 这就是要证明的概率公式。 === b.设P:为M=k的概率,即包含最多关键字的槽中有k个关键字的概率。证明:$P_k<=n Q_k$。 $ P_k = sum_(j = k)^n Q_j $ $ P_k = sum_(j = k)^n binom(n, j) (1 - 1 / n)^(n - j) (1 / n)^j $ $ P_k = sum_(j = k)^n frac(n !, j ! (n - j) !) (1 - 1 / n)^(n - j) (1 / n)^j $ $ P_k = sum_(j = k)^n frac(n (n - 1) (n - 2) dots.h (j + 1), (n - j) (n - j - 1) dots.h 1) (1 - 1 / n)^(n - j) (1 / n)^j $ $ P_k = sum_(j = k)^n frac(n (n - 1) (n - 2) dots.h (j + 1), (n - j) (n - j - 1) dots.h 1) (1 - 1 / n)^(n - j) 1 / n^j $ $ P_k = sum_(j = k)^n frac(n !, (n - j) ! j !) (1 - 1 / n)^(n - j) 1 / n^j $ $ P_k = sum_(j = k)^n binom(n, j) (1 - 1 / n)^(n - j) 1 / n^j $ $ P_k = sum_(j = k)^n Q_j $ 由于 $Q_j$ 是非负的,所以 $P_k lt.eq n Q_k$。 === c.应用斯特林近似公式 $n! = sqrt(2pi n)(n/e)^n (1+Theta(1/n))$来证明:$Q_k<=e^k/k^k$。 首先,将斯特林近似公式代入 $Q_k$ 的表达式: $ Q_k = binom(n, k) (1 - 1 / n)^(n - k) (1 / n)^k $ $ Q_k = frac(n !, k ! (n - k) !) (1 - 1 / n)^(n - k) (1 / n)^k $ $ Q_k = frac(sqrt(2 pi n) (n / e)^n (1 + Theta (1 / n)), k ! (n - k) !) (1 - 1 / n)^(n - k) (1 / n)^k $ 然后,简化 $Q_k$ 的表达式: $ Q_k = frac(sqrt(2 pi n), sqrt(2 pi k) sqrt(2 pi (n - k))) dot.op frac((n / e)^n, (k / e)^k dot.op ((n - k) / e)^(n - k)) dot.op (1 + Theta (1 / n)) dot.op (1 - 1 / n)^(n - k) dot.op (1 / n)^k $ $ Q_k = frac(sqrt(2 pi n), sqrt(2 pi k) sqrt(2 pi (n - k))) dot.op frac((n / e)^n, (k / e)^k dot.op ((n - k) / e)^(n - k)) dot.op sqrt(e / n) dot.op (1 + Theta (1 / n)) $ $ Q_k = 1 / sqrt(2 pi k (n - k)) dot.op (n / e)^(n - k) / (k / e)^k dot.op (1 + Theta (1 / n)) $ $ Q_k = 1 / sqrt(2 pi k (n - k)) dot.op n^(n - k) / k^k dot.op (1 + Theta (1 / n)) $ == 子序列匹配问题(本题必做a、b、e,选做c、d)。假设有序列$T[1..n]$,代表一个序列T有n bits(n位)。我们考虑一个序列P[1..m],m < n,是否为T的子序列,即是否存在i = j-m+1,使得T[i..j] = P[1..m]。我们假设,对于操作O(lg n)比特的序列,可以在固定时间c里完成,但对于操作这个数量级以上的比特位时,其操作时长不能看作固定时间。 === (a) 假设存在哈希函数h(x),对于所有长度为m bits的序列,均可在O(m)时间内完成操作,且对于序列$x!=y$,均有$h(x)!=h(y)$。证明,在O(mn)时间里,可以验证P是否是T的子序列。(必做,易) 使用滚动hash。由于 $x!=y$,均有$h(x)!=h(y)$,因此无需考虑哈希冲突。 首先,需要选择一个合适的哈希函数h\(x),并定义一个滚动哈希函数r\(x)。设序列$X = x_1 x_2 . . . x_k$的哈希值为$h (X)$,则$r (x_(i + 1) x_(i + 2) . . . x_(i + k))$的计算可以利用$r (x_i . . . x_(i + k - 1))$的结果,即: $ r (x_(i + 1) x_(i + 2) . . . x_(i + k)) = (r (x_i . . . x_(i + k - 1)) - x_i dot.op b^(k - 1)) dot.op b + x_(i + k) $ 其中,b是基数,一般选择一个合适的素数。 现在,使用滚动哈希来在O\(mn)时间内验证P是否为T的子序列。 1. 计算P和T的初始哈希值,分别记为$h_P$和$h_T$。这可以在O\(m)时间内完成。 2. 在T上进行滚动哈希的过程。从左到右依次考虑T的每个长度为m的子序列,计算其哈希值。 3. 比较当前子序列的哈希值和P的哈希值$h_P$是否相等。如果相等,则说明找到了一个匹配。 4. 如果不相等,将哈希值向右滚动一位,计算下一个子序列的哈希值。 5. 重复步骤3和步骤4,直到遍历完整个序列T。 这样的滚动哈希算法可以在O\(mn)时间内完成,因为每个滚动哈希的计算只需要O\(1)时间。因此,整个过程的时间复杂度为O\(mn)。 === (b) 考虑一个哈希函数,p是$[2,c n^4]$里的一个质数,$h_p=x mod p$。对于一个i,$1<=i<=n-m+1$,令$x = T[i..(i+m-1)]$。证明,可以找到一个合适的c,使得$x!=p$则必有$h_p(x)!=h_p(P)$。这里要用到两个定理:(1)对于正整数x,其最多有lg x个质数因子;(2)在[2, x]里,质数的个数为$frac(x, lg (x))$。(必做,中) 首先,注意到 $h_p$ 的取值范围是 \[0, p-1\]。根据题目条件,p 是 \[2, cn^4\] 范围内的质数,而 n 表示序列 T 的长度。 考虑哈希函数 $h_p = x #h(0em) mod med p$。令 $x = T [i ..(i + m - 1)]$,可以找到一个合适的 c,使得 $x eq.not p$ 则必有 $h_p (x) eq.not h_p (P)$。 考虑哈希函数 $h_p$,对于任意的 x,$h_p (x)$ 的取值范围是 \[0, p-1\]。 如果 $x eq.not p$,则 $h_p (x) eq.not 0$。 由于 $h_p (x)$ 的取值范围是 \[0, p-1\],如果 $x eq.not p$,那么至少有$p - 1$ 个不同的可能的哈希值。因此,我们可以选择一个足够大的 c,使得$p - 1 > c (n - m + 1)$。 这样,对于任意 i,$1 <= i <= n-m+1$,取$x = T [i . . (i + m - 1)]$,如果 $x eq.not p$,则至少有$c (n - m + 1) + 1$ 个不同的哈希值,而这个数量大于 T中所有可能子序列的数量($n - m + 1$ 个)。因此,至少存在一个哈希值不会与$h_p (P)$ 相等。 所以,通过选择足够大的 c,可以确保 $x eq.not p$ 则必有 $h_p (x) eq.not h_p (P)$。 === (c)对于b中的$h_p$哈希函数,请问计算时间是多少?(注意,这里不是固定时间c)(选做,难) === (d)对于$1<=i<=n-m$,给出一种算法,在已知$h_p (A[i..(i+m-1)])$的情况下,可在固定时间c里,计算出$h_p (A[(i+1)..(i+m)])$。(选做,难) === (e)根据(a)-(d)方法和结论,给出一种算法,使得在O(n)时间里,能够知道P是否为T的子序列。(必做,中) 1. 计算哈希值: 对于 P 和 T 中的前 m 个元素,计算它们的哈希值。 2. 验证: 在 T 中逐步滚动计算每个长度为 m 的子序列的哈希值,并与 P 的哈希值比较。如果存在任何一个子序列的哈希值与 P 的哈希值相等,则 P 是 T 的子序列。 整个算法的时间复杂度为 O(n)。这是因为计算哈希值和验证哈希值的过程都是O(1) 操作,总共有 n-m+1 个子序列需要验证。 从本题可以看出,哈希函数应用广泛,在多个场景均可构建高性能算法。可把本题算法与动态规划里提到的子序列算法进行比较。
https://github.com/Error-418-SWE/Documenti
https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/1%20-%20Candidatura/Verbali/Interni/29-10-23/29-10-23.typ
typst
ERROR\_418 \ Verbale 29/10/23 #figure( align(center)[#table( columns: 2, align: (col, row) => (left,left,).at(col), inset: 6pt, [Mail:], [<EMAIL>], [Redattori:], [<NAME>, <NAME>], [Verificatori:], [<NAME>, <NAME>, <NAME>], [Amministratori:], [<NAME>, <NAME>], [Destinatari:], [<NAME>, <NAME>], )] ) #figure( align(center)[#table( columns: 2, align: (col, row) => (center,center,).at(col), inset: 6pt, [Inizio Meeting: 15:00 Fine Meeting: 16:30 Durata: 1:30h], [], [Presenze:], [], )] ) #block[ #figure( align(center)[#table( columns: 5, align: (col, row) => (center,center,center,center,center,).at(col), inset: 6pt, [Nome], [Durata Presenza], [], [], [], [Antonio], [1:30h], [], [], [], [Alessio], [1:30h], [], [], [], [Rosario], [1:30h], [], [], [], [Giovanni], [1:30h], [], [], [], )] ) ] Ordine del giorno: - panoramica dei comandi base di git; - panoramica delle funzioni di collaborazione di GitHub; - discussione sulle strategie di branching da adottare. = git e Github <git-e-github> Si è effettuata una panoramica sui comandi git di base come init, add, push, pull, status, branch, checkout e sulle funzioni di pull request di GitHub. = Strategie di branching <strategie-di-branching> Si sono confrontante due strategie di branching: - #strong[main-feature];: un ramo mainline e feature branch atomici e indipendenti; - #strong[main-dev-feature];: un ramo mainline, un ramo di sviluppo e feature branch atomici e indipendenti. Dalla discussione è emerso che la strategia 1 è da preferirsi per progetti rilasciati in modalità rolling, senza versionamento. Tuttavia, poiché il dominio d’applicazione del capitolato è on-premise, appare più adatto un approccio con versionamento \(strategia 2). Inoltre, il proponente potrebbe avere la necessità di fornire versioni del software diverse. Per concludere, lo stack tecnologico che sarà verosimilmente adottato avrà numerose dipendenze verso librerie esterne, che dovranno essere congelate prima del rilascio. \ Per questi motivi, si è scelto di approcciare lo sviluppo seguendo la strategia 2. Non si tratta comunque di una scelta vincolante perché sarà sempre possibile commutare la strategia. \ Si sottolinea comunque l’enorme importanza di progettare feature piccole, ben delineate e atomiche.
https://github.com/FlandiaYingman/note-me
https://raw.githubusercontent.com/FlandiaYingman/note-me/main/note-me.typ
typst
MIT License
#import "stick-together.typ": stick-together // From: https://github.com/typst/typst/issues/1939#issuecomment-1680154871 #let colorize(svg, color) = { let blk = black.to-hex(); if svg.contains(blk) { svg.replace(blk, color.to-hex()) } else { svg.replace("<svg ", "<svg fill=\""+color.to-hex()+"\" ") } } // Returns a new SVG image loaded from the specified path, filled with the specified color. #let color-svg-path( path, color, ..args, ) = { let data = colorize(read(path), color) return image.decode(data, ..args) } // Returns a new SVG image loaded from the specified string (SVG content), filled with the specified color. #let color-svg-string( svg, color, ..args, ) = { let data = colorize(svg, color) return image.decode(data, ..args) } #let admonition( icon-path: none, icon-string: none, icon: none, title: "Admonition", color: color.black, foreground-color: auto, background-color: none, children ) = block( width: 100%, inset: (left: 1.25em, right: .5em, top: .5em, bottom: .5em), stroke: (left: 1.75pt + color), fill: background-color, [ #stick-together( stack( dir: ltr, spacing: 1em, align(horizon, { assert( icon-path != none or icon-string != none or icon != none, message: "Either `icon-path`, `icon-string` or `icon` must be specified in the argument." ) if (icon-path != none) { color-svg-path(icon-path, color, width: 1em, height: 1em) } if (icon-string != none) { color-svg-string(icon-string, color, width: 1em, height: 1em) } if (icon != none) { icon } }), align(horizon, text(weight: "bold", fill: color, title)) ), { if (foreground-color == auto) { text(children) } else { text(fill: foreground-color, children) } }, threshold: 3.175em, ) ], ) #let note(children) = admonition( icon-path: "icons/info.svg", title: "Note", color: rgb(9, 105, 218), children ) #let tip(children) = admonition( icon-path: "icons/light-bulb.svg", title: "Tip", color: rgb(31, 136, 61), children ) #let important(children) = admonition( icon-path: "icons/report.svg", title: "Important", color: rgb(130, 80, 223), children ) #let warning(children) = admonition( icon-path: "icons/alert.svg", title: "Warning", color: rgb(154, 103, 0), children ) #let caution(children) = admonition( icon-path: "icons/stop.svg", title: "Caution", color: rgb(209, 36, 47), children )
https://github.com/jneug/schule-typst
https://raw.githubusercontent.com/jneug/schule-typst/main/src/core/base.typ
typst
MIT License
// TODO: i18n verbessern #import "../util/args.typ" #import "../util/typst.typ" #import "../util/marks.typ" #import "../util/util.typ" #import "document.typ" #import "layout.typ" #import "../theme.typ" // Basisvorlage für alle Dokumentvorlagen #let base-template( title-block: layout.base-title, // _tpl: (:), // ..document-args, // body, ) = { let doc = document.create( ..document-args, options: args.if-has(_tpl, "options", () => (:)), aliases: args.if-has(_tpl, "aliases", () => (:)), ) // TODO: allow users to change headers / footers? // TODO: Move some of page-init to theme? let page-init( header: layout.base-header, header-left: (_, body) => body, header-center: (_, body) => body, header-right: (_, body) => body, footer: layout.base-footer, footer-left: (_, body) => body, footer-center: (_, body) => body, footer-right: (_, body) => body, // additional page args ..page-args, // body, ) = { set text( font: args.extract-args(document-args, font: theme.fonts.default).font, ..args.extract-args( document-args, _prefix: "font", size: 12pt, weight: 300, fallback: true, lang: "de", region: "DE", hyphenate: auto, ), ) show heading: set text( font: theme.fonts.headings, fill: theme.primary, ) show link: set text(fill: theme.secondary) set table(stroke: theme.table.stroke) set page( ..args.extract-args( document-args, paper: "a4", flipped: false, margin: ( y: 2cm, x: 1.69cm, left: if document-args.named().at("binding", default: false) { 2.41cm } else { 1.69cm }, ), ), ..page-args.named(), header: { // TODO: add conditional stepping? // TODO: Remove counters from doc // doc._counters.content-pages.step() header( doc, header-left(doc, layout.header-left(doc)), header-center(doc, layout.header-center(doc)), header-right(doc, layout.header-right(doc)), ) }, footer: footer( doc, footer-left(doc, layout.footer-left(doc)), footer-center(doc, layout.footer-center(doc)), footer-right(doc, layout.footer-right(doc)), ), ) set par( leading: 1.2em, ..args.extract-args( document-args, _prefix: "par", justify: true, ), ) // Lists set enum(numbering: "1)") // Configure code blocks show raw: set text(font: theme.fonts.code) show raw.where(block: false): set text(fill: theme.primary) // set raw(theme: "./BW.tmTheme") show figure.caption: set text(.88em) show: util.decimal-fix show: theme.init body } // Set PDF metadata // TODO: currently does not work? set typst.document( title: "my title",// doc.title, author: doc.author.map(a => a.name), date: doc.date, ) return ( doc, page-init, { if doc._debug { page(paper: "a3", flipped: true, columns: 3)[ == Document #doc == Exercises #import "../exercise/exercise.typ" as ex #context ex.get-exercises(final: true) ] } document.save(doc) document.save-meta(doc) marks.place-meta(<content-start>) marks.env-open("content") if title-block != none { title-block(doc) } body marks.env-close("content") marks.place-meta(<content-end>) }, ) } #let appendix(body, title: [Anhang], ..page-args) = { set page(..page-args.named()) pagebreak(weak: true) marks.env-open("appendix") // state("schule.appendix").update(true) set heading(numbering: (..n) => { let n = n.pos() let _ = n.remove(0) if n.len() > 0 { numbering("A.1", ..n) } }) heading(level: 1, title) body marks.env-close("appendix") }
https://github.com/ymgyt/techbook
https://raw.githubusercontent.com/ymgyt/techbook/master/programmings/js/typescript/specification/object.md
markdown
# object ## optional property ```typescript let x: { width?: number }; x = {}; x = { width: undefined}; // nullはassignできない // x = { width: null }; ``` ## excess property checking * 変数の型より多くのfiledをもつ値をassignできるかという問題 * object literalではだめ * それ以外では許可される ```typescript const xy: { x: number; y: number } = { x: 1, y: 2 }; let onlyX: { x: number }; onlyX = xy; // OK ``` ## index signature ```typescript let obj: { [K: string]: number; }; obj = {a: 1, b: 2}; obj.c = 3; ``` * `K`のところに使えるのはstring,number,symbolのみ * `noUncheckedIndexedAccess`を有効にすると、propertyの型が、undefinedとのunionになる ```typescript const obj: { [K: string]: number } = { a: 1 }; const b: number | undefined = obj.b; // undefined ``` * Recordでも表現できる ```typescript let obj1: { [K: string]: number }; let obj2: Record<string, number>; ``` ## optional chain ```typescript const book = undefined; const authorEmail = book?.author?.email; // 関数呼び出しにも使える const increment = undefined; const result = increment?.(1); // Null合体演算子と組み合わせる const title = book?.title ?? "default title"; ``` * `?.`に先行するvariableやpropertyがnullやundefinedのときはその先が評価されずundefinedが返る * 得られる値の型は最後のpropertyの型とundefinedのunion ## destructuring assignment * Rust同様のleft handに型かいて、assignできる ```typescript const { name, no, genre }: Wild = safari(); // 別名をつける const { name: fooName, no, genre }: Wild = safari(); ``` ## object loop ```typescript const foo = { a: 1, b: 2, c: 3 }; for (const [key, value] of Object.entries(foo)) { console.log(key, value); // a 1 // b 2 // c 3 の順で出力される } ``` * prototypeのpropertyを無視してくれる ### keyのみ ```typescript const foo = { a: 1, b: 2, c: 3 }; for (const key of Object.keys(foo)) { console.log(key); // a // b // c の順で出力される } ```
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/pagebreak-weak_02.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // After only ignorables, but regular break // Should result in three pages. First #pagebreak() #counter(page).update(1) #metadata("Some") #pagebreak() Third
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/block-width-box.typ
typst
Apache License 2.0
// Test box in 100% width block. --- #block(width: 100%, fill: red, box("a box")) #block(width: 100%, fill: red, [#box("a box") #box()])
https://github.com/magic3007/cv-typst
https://raw.githubusercontent.com/magic3007/cv-typst/master/doc/honor_awards.typ
typst
- IEEE/ACM MLCAD 2023 FPGA Macro Placement Contest, Second Place #h(1fr) Sept 2023 - The 43rd ACM-ICPC Asia Regional Competition, Gold Award #h(1fr) Oct 2018 - Outstanding Undergraduate Graduate (top 1% province-wide) #h(1fr) May 2021 // - Outstanding Undergraduate Graduate in Peking University #h(1fr) May 2021 - Ubiquant Scholarship, #emph[Peking University] #h(1fr) Sept 2023 - Xiaomi Scholarship, #emph[Peking University]#h(1fr) Dec 2020 - Huawei Scholarship, #emph[Peking University] #h(1fr) Dec 2019 - Honors for Merit Student, #emph[Peking University] #h(1fr) Dec 2019, Dec 2020, Sept 2023 - Industry Contribution Award, #emph[Department of Design Automation and Computer System] #h(1fr) April 2023 - Honors for Outstanding Academic Performance, #emph[Peking University] #h(1fr) Dec 2018 // == Awards // #chiline() // - IEEE/ACM MLCAD 2023 FPGA Macro Placement Contest, Second Place #h(1fr) Sept 2023 // // - EDA Elite Challenge, Second Prize #h(1fr) Dec 2021 // // - Beijing Challenge Cup Competition, Second Prize #h(1fr) May 2021 // - The 43rd ACM-ICPC Asia Regional Competition, Gold Award #h(1fr) Oct 2018
https://github.com/jamesrswift/chemicoms-paper
https://raw.githubusercontent.com/jamesrswift/chemicoms-paper/main/src/elements.typ
typst
#import "elements/header-block.typ": *; #import "elements/header-journal.typ": *; #import "elements/precis.typ": precis; #import "elements/footer.typ": footer; #import "elements/float.typ": float;
https://github.com/Enter-tainer/delimitizer
https://raw.githubusercontent.com/Enter-tainer/delimitizer/main/impl.typ
typst
MIT License
#let base-size = 1.2em #let sizes = (base-size, base-size * 1.5, base-size * 2, base-size * 2.5) #let scaled-delimiter(delimiter, size) = math.lr(delimiter, size: size) #let big(delimiter) = scaled-delimiter(delimiter, sizes.at(0)) #let Big(delimiter) = scaled-delimiter(delimiter, sizes.at(1)) #let bigg(delimiter) = scaled-delimiter(delimiter, sizes.at(2)) #let Bigg(delimiter) = scaled-delimiter(delimiter, sizes.at(3)) #let paired-delimiter(left, right) = (content, size: auto) => { if size == auto { $lr(#left#content#right)$ } else if size == none { $lr(#left#content#right, size: #1em)$ } else if size == big { $lr(#left#content#right, size: sizes.at(#0))$ } else if size == bigg { $lr(#left#content#right, size: sizes.at(#1))$ } else if size == Big { $lr(#left#content#right, size: sizes.at(#2))$ } else if size == Bigg { $lr(#left#content#right, size: sizes.at(#3))$ } else { $lr(#left#content#right, size: size)$ } }
https://github.com/p-will/thesis_typst_template
https://raw.githubusercontent.com/p-will/thesis_typst_template/main/MA.typ
typst
#let header_heading(loc) = { //get all headings let headings = query(heading.where(level:1),loc) //look for first level 1 heading on page let first_heading = headings.find(h => h.location().page() == loc.page()) //look for last level 1 heading before this one let last_heading = query(heading.where(level:1).before(loc),loc) if not first_heading == none { return first_heading.body } else{ //weird behavior on outline -> empty last heading if(loc.page() == 3){ return last_heading.first().body} else{ last_heading.last().body } } } #counter(page).update(0) #set page( paper: "a4", margin: ( top: 3cm, bottom: 3cm, left: 4cm, right: 2cm ), numbering: "1", number-align: right, header: locate(loc => { let i = counter(page).at(loc).first() if i == 0 { return } else{ set align(left) set text(size: 10pt) let heading = header_heading(loc) place( top + left, heading, dy: 80%, ) place( top + right, image("images/HTWD_Logo.png",width:20%), dy: 50% ) line(start: (0pt,0pt), length: 100%) } }, ), footer: locate(loc => { let i = counter(page).at(loc).first() if i == 0 { return } else{ line( start: (0pt,0pt), length: 100%) set align(left) set text(10pt) set align(right) set text(12pt) counter(page).display(loc.page-numbering()) } }) ) #set text( font: "Times New Roman", size: 12pt, ) #show par: p => [ #set par(leading: 1.5em) #text(p) #v(1em) ] #show outline.entry: o => [ #strong(o.body) #box(height: 1%,width: 1fr, repeat(".")) #strong(o.page) ] #show heading: h => [ #set block(below: 1em) #h ] #set heading(numbering: "1.") #show heading.where(level: 1): set text(size:16pt,weight:"bold") #show heading.where(level: 2): set text(size:14pt,weight:"bold") #show heading.where(level: 3): set text(size:12pt,weight:"bold") #show heading.where(level: 4): set text(size:12pt,weight:"thin", style: "italic") #show heading.where(level: 5): set text(size:12pt,weight:"bold") #set cite( style: "chicago-author-date" ) #set bibliography( ) #let ccite(k) = { upper(cite(label(k))) } #align(center)[ Hochschule für Technik und Wirtschaft Dresden #v(20pt) Fakultät XXXX #v(35pt) #image("images/HTWD_Logo.png",width:50%) #v(35pt) #text(size: 30pt,weight:"bold")[Masterarbeit] #v(20pt) im Studiengang XXXX #v(40pt) Thema: XXXX #v(30pt) eingereicht von: XXXX #v(30pt) eingereicht am: XXXX #v(30pt) Betreuer: XXXXX ] #pagebreak() #set page(numbering: "I") #heading(level: 1, numbering: none, outlined: false)[ Inhaltsverzeichnis ] #outline(title: "", indent: auto) #pagebreak() #heading(level: 1, numbering: none, outlined: false)[ Abbildungsverzeichnis ] #outline(title: "", target: {figure.where(kind: image)}) #pagebreak() #set page(numbering: "1") #counter(page).update(1) = Einleitung #figure( image("images/HTWD_Logo.png"), caption: "test", supplement: "Abbildung" ) #pagebreak() Lorem Ipsum #ccite("harry") #ccite("harry2") #pagebreak() = Quellenverzeichnis #bibliography("bib/sources.yml", title: none, full: false, style: "chicago-author-date",) #pagebreak() = Anhang Lorem Ipsum
https://github.com/elteammate/typst-compiler
https://raw.githubusercontent.com/elteammate/typst-compiler/main/src/utils.typ
typst
#let mk_enum(debug: false, name: none, ..options) = { let result = (:) for i, v in options.pos() { if debug { if name == none { result.insert(v, v) } else { result.insert(v, name + "." + v) } } else { result.insert(v, i) } } result } #let unique(arr) = { let dict = (:) for x in arr { dict.insert(repr(x), x) } dict.values() } #let map2(f, arr) = { let result = () for i, x in arr { result.push(f(i, x)) } result } #let arr2dict(arr) = { let result = (:) for x in arr { result.insert(x.at(0), x.at(1)) } result } #let dict2arr(dict) = { let result = () for k, v in dict { result.push((k, v)) } result } #let dict_map(keys, f) = { let result = (:) for k in keys { result.insert(k, f(k)) } return result }
https://github.com/piepert/philodidaktik-hro-phf-ifp
https://raw.githubusercontent.com/piepert/philodidaktik-hro-phf-ifp/main/src/parts/ephid/unterrichtsplanung/strukturen.typ
typst
Other
#import "/src/template.typ": * == #ix("Unterrichtsstrukturen", "Unterrichtsstruktur")
https://github.com/ARKye03/MathSummary
https://raw.githubusercontent.com/ARKye03/MathSummary/main/src/main.typ
typst
#set page() #align(center, text(17pt)[ *Calculus Cheat Sheet* ]) #columns( 2, )[ = Integrals $\u{222B}d x = x + c$ $\u{222B}k d x = k x + c$ $\u{222B}x^n d x = x^(n+1)/(n+1) + c$, $n != -1$ $\u{222B}1/x d x = ln|x| + c$ $\u{222B}e^x d x = e^x + c$ $\u{222B}a^x d x = a^x/ln(a) + c$ $\u{222B}cos(x) d x = sin(x) + c$ $\u{222B}sin(x) d x = -cos(x) + c$ $\u{222B}sec^2(x) d x = tan(x) + c$ $\u{222B}csc^2(x) d x = -cot(x) + c$ $\u{222B}sec(x)tan(x) d x = sec(x) + c$ $\u{222B}csc(x)cot(x) d x = -csc(x) + c$ $\u{222B}1/(1+x^2) d x = arctan(x) + c$ $\u{222B}-1/(1+x^2) d x = $ arccot$(x) + c$ $\u{222B}1/sqrt(1-x^2) d x = arcsin(x) + c$ $\u{222B}-1/sqrt(1-x^2) d x = arccos(x) + c$ = Integrals of Things $\u{222B}f(x) d x \u{00B1} \u{222B}g(x) d x = \u{222B}(f(x) \u{00B1} g(x)) d x$ $\u{222B}k f(x) d x = k \u{222B}f(x) d x$ $\u{222B}f(x) d x = -\u{222B}f(-x) d x$ $\u{222B}u d v = u v - \u{222B}v d u$ #colbreak(weak: true) = Composite Integrals $\u{222B} u^n d u d x = u^(n+1)/(n+1) + c$, $n != -1$ $\u{222B} (d u)/u d x = ln|u| + c$ $\u{222B} e^u d u d x = e^u + c$ $\u{222B} a^u d u d x = a^u/ln(a) + c$ $\u{222B} cos(u) d u d x = sin(u) + c$ $\u{222B} sin(u) d u d x = -cos(u) + c$ $\u{222B} sec^2(u) d u d x = tan(u) + c$ $\u{222B} csc^2(u) d u d x = -cot(u) + c$ $\u{222B} 1 + tan^2(u) d u d x = tan(u) + c$ $\u{222B} 1/(1+ u^2) d u d x = arctan(u) + c$ $\u{222B} 1/sqrt(1-u^2) d u d x = arcsin(u) + c$ $\u{222B} -1/sqrt(1-u^2) d u d x = arccos(u) + c$ ] #set page(columns: 2) = Derivatives Any constant: $k = 0$ $x^n = n x^{n-1}$ $e^x = e^x$ $e^(k x) = k e^(k x)$ $ln(x) = 1/x$ $sin(x) = cos(x)$ $cos(x) = -sin(x)$ $tan(x) = sec^2(x)$ $cot(x) = -csc^2(x)$ $sec(x) = sec(x)tan(x)$ $csc(x) = -csc(x)cot(x)$ $arctan(x) = 1/(1+x^2)$ arccot$(x) = -1/(1+x^2)$ $arcsin(x) = 1/sqrt(1-x^2)$ $arccos(x) = -1/sqrt(1-x^2)$ #colbreak(weak: true) = Derivatives of Things $(f(x) \u{00B1} g(x))' = f'(x) \u{00B1} g'(x)$ $(f(x) * g(x))' = f'(x) * g(x) + f(x) * g'(x)$ $(f(x)/g(x))' = (f'(x) * g(x) - f(x) * g'(x))/g(x)^2$ $(1/f(x))' = (-f'(x))/f(x)^2$ $(f(g(x)))' = f'(g(x)) * g'(x)$ #set page(columns: 2, margin: (right: 10pt)) = Trig Identities + $sin^2(x) + cos^2(x) = 1$ - $sin^2(x) = 1 - cos^2(x)$ - $cos^2(x) = 1 - sin^2(x)$ + $tan(x) * cot(x) = 1$ + $tan(x) = sin(x)/cos(x)$ - $tan(x) = 1/cot(x)$ + $cot(x) = cos(x)/sin(x)$ - $cot(x) = 1/tan(x)$ + $1 + tan^2(x) = 1/(cos^2(x))$ - $1 + cot^2(x) = 1/(sin^2(x))$ + $sec(x) = 1/cos(x)$ - $csc(x) = 1/sin(x)$ + $sec(x) * tan(x) = sin(x)/cos(x) = tan(x)$ - $csc(x) * cot(x) = cos(x)/sin(x) = cot(x)$ = Sum and Difference Identities + $sin(x \u{00B1} y) = sin(x) * cos(y) \u{00B1} cos(x) * sin(y)$ + $cos(x \u{00B1} y) = cos(x) * cos(y) \u{2213} sin(x) * sin(y)$ + $tan(x \u{00B1} y) = (tan(x) \u{00B1} tan(y))/(1 \u{2213} tan(x)tan(y))$ + $cot(x \u{00B1} y) = (cot(x)cot(y) \u{2213} 1)/(cot(x) \u{00B1} cot(y))$ #colbreak() = Double Angle Identities + $sin(2x) = 2sin(x)cos(x)$ + $cos(2x) = cos^2(x) - sin^2(x)$ - $cos(2x) = -1 + 2cos^2(x)$ - $cos(2x) = 1 - 2sin^2(x)$ + $tan(2x) = 2tan(x)/(1 - tan^2(x))$ + $cot(2x) = (cot^2(x) - 1)/(2cot(x))$ = Negative Angle Identities $sin(-x) = -sin(x)$ $cos(-x) = cos(x)$ $tan(-x) = -tan(x)$ $cot(-x) = -cot(x)$ = Half Angle Identities + $sin(x/2) = \u{00B1} sqrt((1 - cos(x))/2)$ + $cos(x/2) = \u{00B1} sqrt((1 + cos(x))/2)$ + $tan(x/2) = sin(x)/(1 + cos(x)) = (1 - cos(x))/sin(x)$ #set page(columns: 1)
https://github.com/curvenote/pubmatter
https://raw.githubusercontent.com/curvenote/pubmatter/main/README.md
markdown
MIT License
# pubmatter _Beautiful scientific documents with structured metadata for publishers_ [![Documentation](https://img.shields.io/badge/typst-docs-orange.svg)](https://github.com/curvenote/pubmatter/blob/main/docs.pdf) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/curvenote/pubmatter/blob/main/LICENSE) Pubmatter is a typst library for parsing, normalizing and showing scientific publication frontmatter. Utilities for loading, normalizing and working with authors, affiliations, abstracts, keywords and other frontmatter information common in scientific publications. Our goal is to introduce standardized ways of working with this content to expose metadata to scientific publishers who are interested in using typst in a standardized way. The specification for this `pubmatter` is based on [MyST Markdown](https://mystmd.org) and [Quarto](https://quarto.org), and can load their YAML files directly. ## Examples Pubmatter was used to create these documents, for loading the authors in a standardized way and creating the common elements (authors, affiliations, ORCIDs, DOIs, Open Access Links, copyright statements, etc.) ![](https://github.com/curvenote/pubmatter/blob/main/images/lapreprint.png?raw=true) ![](https://github.com/curvenote/pubmatter/blob/main/images/scipy.png?raw=true) ![](https://github.com/curvenote/pubmatter/blob/main/images/agrogeo.png?raw=true) ## Documentation The full documentation can be found in [docs.pdf](https://github.com/curvenote/pubmatter/blob/main/docs.pdf). To use `pubmatter` import it: ```typst #import "@preview/pubmatter:0.1.0" ``` The docs also use `pubmatter`, in a simplified way, you can see the [docs.typ](https://github.com/curvenote/pubmatter/blob/main/docs.typ) to see a simple example of using various components to create a new document. Here is a preview of the docs: [![](https://github.com/curvenote/pubmatter/blob/main/images/pubmatter.png?raw=true)](https://github.com/curvenote/pubmatter/blob/main/docs.pdf) ### Loading Frontmatter The frontmatter can contain all information for an article, including title, authors, affiliations, abstracts and keywords. These are then normalized into a standardized format that can be used with a number of `show` functions like `show-authors`. For example, we might have a YAML file that looks like this: ```yaml author: <NAME> date: 2024/01/26 ``` You can load that file with `yaml`, and pass it to the `load` function: ```typst #let fm = pubmatter.load(yaml("pubmatter.yml")) ``` This will give you a normalized data-structure that can be used with the `show` functions for showing various parts of a document. You can also use a `dictionary` directly: ```typst #let fm = pubmatter.load(( author: ( ( name: "<NAME>", email: "<EMAIL>", orcid: "0000-0002-7859-8394", affiliations: "Curvenote Inc.", ), ), date: datetime(year: 2024, month: 01, day: 26), doi: "10.1190/tle35080703.1", )) #pubmatter.show-author-block(fm) ``` ![](https://github.com/curvenote/pubmatter/blob/main/images/author-block.png?raw=true) ### Theming The theme including color and font choice can be set using the `THEME` state. For example, this document has the following theme set: ```typst #let theme = (color: red.darken(20%), font: "Noto Sans") #state("THEME").update(theme) #set page(header: pubmatter.show-page-header(theme: theme, fm), footer: pubmatter.show-page-footer(fm)) ``` Note that for the `header` the theme must be passed in directly. This will hopefully become easier in the future, however, there is a current bug that removes the page header/footer if you set this above the `set page`. See [https://github.com/typst/typst/issues/2987](#2987). The `font` option only corresponds to the frontmatter content (abstracts, title, header/footer etc.) allowing the body of your document to have a different font choice. ### Normalized Frontmatter Object The frontmatter object has the following normalized structure: ```yaml title: content subtitle: content short-title: string # alias: running-title, running-head # Authors Array # simple string provided for author is turned into ((name: string),) authors: # alias: author - name: string url: string # alias: website, homepage email: string phone: string fax: string orcid: string # alias: ORCID note: string corresponding: boolean # default: `true` when email set equal-contributor: boolean # alias: equalContributor, equal_contributor deceased: boolean roles: string[] # must be a contributor role affiliations: # alias: affiliation - id: string index: number # Affiliations Array affiliations: # alias: affiliation - string # simple string is turned into (name: string) - id: string index: number name: string institution: string # use either name or institution # Other publication metadata open-access: boolean license: # Can be set with a SPDX ID for creative commons id: string url: string name: string doi: string # must be only the ID, not the full URL date: datetime # validates from 'YYYY-MM-DD' if a string citation: content # Abstracts Array # content is turned into ((title: "Abstract", content: string),) abstracts: # alias: abstract - title: content content: content ``` Note that you will usually write the affiliations directly in line, in the following example, we can see that the output is a normalized affiliation object that is linked by the `id` of the affiliation (just the name if it is a string!). ```typst #let fm = pubmatter.load(( authors: ( ( name: "<NAME>", affiliations: "Curvenote Inc.", ), ( name: "<NAME>", affiliations: ("Executable Books", "Curvenote Inc."), ), ), )) #raw(lang:"yaml", yaml.encode(fm)) ``` ![](https://github.com/curvenote/pubmatter/blob/main/images/normalized.png?raw=true) ### Full List of Functions - `load()` - Load a raw frontmatter object - `doi-link()` - Create a DOI link - `email-link()` - Create a mailto link with an email icon - `github-link()` - Create a link to a GitHub profile with the GitHub icon - `open-access-link()` - Create a link to Wikipedia with an OpenAccess icon - `orcid-link()` - Create a ORCID link with an ORCID logo - `show-abstract-block()` - Show abstract-block including all abstracts and keywords - `show-abstracts()` - Show all abstracts (e.g. abstract, plain language summary) - `show-affiliations()` - Show affiliations - `show-author-block()` - Show author block, including author, icon links (e.g. ORCID, email, etc.) and affiliations - `show-authors()` - Show authors - `show-citation()` - Create a short citation in APA format, e.g. Cockett _et al._, 2023 - `show-copyright()` - Show copyright statement based on license - `show-keywords()` - Show keywords as a list - `show-license-badge()` - Show the license badges - `show-page-footer()` - Show the venue, date and page numbers - `show-page-header()` - Show an open-access badge and the DOI and then the running-title and citation - `show-spaced-content()` - `show-title()` - Show title and subtitle - `show-title-block()` - Show title, authors and affiliations ## Contributing To help with standardization of metadata or improve the show-functions please contribute to this package: \ https://github.com/curvenote/pubmatter
https://github.com/Totti95U/ExerciseBattale2023
https://raw.githubusercontent.com/Totti95U/ExerciseBattale2023/main/src/main.typ
typst
The Unlicense
#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: "魔方陣の線形代数", authors: ( "32842327" ), ) // We generated the example code below so you can see how // your document will look. Go ahead and replace it with // your own content! 通常, 魔方陣とは $n times n$ のマス目に $1$ から $n^2$ までの整数を1つずつ過不足なく配置し, 縦・横・斜めのいずれの列についても, その列の数字の合計が同じものを指します. しかしここではもう少し広く, 実数を使用したものも考えることにします. 同じ数字を複数使ってもかまいません. 問題を通して, 魔方陣の線形代数的な特徴を見ていきましょう! #definition[魔方陣][ 実正方行列であって, 各行, 各列, 対角, 反対角成分の和が等しいものを *魔方陣* と呼ぶ. ここで$n$次正方行列 $A = (a_(i j))$ の反対角成分とは $(a_(n 1), a_((n-1) 2), dots, a_(1n))$ である. 魔方陣 $A$ の各行, 各列成分の和を $sigma(A)$ で表す. ] #exercise("やさしい")[ (1) あなたにとって, 魔方陣であることが自明だと思える行列の例を1つ考えよ (2) $1$ から $9$ までの整数を1つずつ過不足なく使用して $3 times 3$ の魔方陣を作成せよ ] <exer1> #definition[$n$次魔方陣, $"MS"(n)$][ 魔方陣 $A$ が $n$ 次正方行列のとき $A$ を *$n$ 次魔方陣* と呼ぶ. また, $ "MS"(n) = {A in "Mat"_bb(R)(n) | A "は魔方陣"} $ と定める. ここで $"Mat"_bb(R)(n)$ は $n$ 次実正方行列全体である. ] #exercise("やさしい")[ 正整数 $n$ に対し $"MS"(n)$ は $"Mat"_bb(R)(n)$ の $bb(R)$-線形部分空間であることを示せ ] <exer2> #exercise("まあまあ")[ 正整数 $n$ に対し $"MS"(n)$ の $bb(R)$-線形空間としての次元 $dim "MS"(n)$ を求めよ ] <exer3> #exercise("やさしい")[ 魔方陣 $A$ に対し $sigma(A)$ は $A$ の固有値であることを示せ ] <exer4> #exercise("やばい")[ 魔方陣 $A$ の全ての成分が非負の場合, $sigma(A)$ は $A$ の固有値の中で絶対値が最大であることを示せ ] <exer5> = 備考 == その1 各問題は独立しているので, 例えば問題3が解けなくても問題4, 問題5は解くことが出来ます. == その2 問題5の背景には私の専門でたびたび使う思い入れのある定理が隠れています (ヒント参照). == その3 3次以下の魔方陣は対角化可能です (WolframAlpha 調べ). 4次以上の魔方陣では対角化不可能なものが存在します. 例えば $ mat( space.en 1, -1, space.en 1, -1; -1, space.en 1, -1, space.en 1; -1, space.en 1, -1, space.en 1; space.en 1, -1, space.en 1, -1 ) $ の Jordan 標準形 は $ mat( 0, 0, 0, 0; 0, 0, 0, 0; 0, 0, 0, 1; 0, 0, 0, 0; ) $ であり, 対角化不可能なことが分かります. 次のページから *ヒント* です. #pagebreak() = ヒント == 問題1 (1) 小さい魔方陣について考えるといいかもしれません (2) 中央には $5$ が入ります == 問題2 部分空間であることを示すには, 零元を含み, 和とスカラー倍で閉じていることを示せば十分です == 問題3 魔方陣において, 数字がいくつ埋まれば残りに入れるべき数字が自動的に決まるかを考えてみましょう == 問題4 数 $lambda$ が正方行列 $A$ の固有値であるとは, ある $0$ でないベクトル $x$ が存在して $A x = lambda x$ を満たすことを指します == 問題5 *1つ目:* ベクトル $v = (v_1, dots, v_n)^top$ に対し $norm(v) = display(max_(1 lt.eq i lt.eq n)) abs(v_i)$ と置きます. このとき任意の実ベクトル $v$ に対し $norm(A v) lt.eq sigma(A) norm(v)$ を示しましょう *2つ目:* Perron-Frobenius の定理について調べてみましょう *3つ目:* #link("https://math.uchicago.edu/~may/VIGRE/VIGRE2007/REUPapers/FINALAPP/Khim.pdf")[これ]を読みましょう
https://github.com/gyarab/2023-4e-ruzicka-jako_pavouk
https://raw.githubusercontent.com/gyarab/2023-4e-ruzicka-jako_pavouk/main/src-docs/kapitoly/do-budoucna.typ
typst
= Další vývoj aplikace == Statistika mezi uživateli Aby se uživatelé necítili na stránce sami, plánuji přidat různé statistiky, díky kterým by se mohli *porovnat s ostatními*, co se týče rychlosti, přesnosti nebo i prostým procentem dokončených lekcí. Představuji si hlášky typu: _"Jsi lepší než 62% uživatelů!"_ nebo _"Ještě 12 CPM a budeš mezi stovkou nejrychlejších!"_. U testu psaní by se zase hodil žebříček třeba 100 nejrychlejších pavouků. == Systém pro školy Napadají mě dva způsoby jak aplikaci udělat *profitabilní*. Jednou možností je za pár let, až bude aplikace více známá, udělat po vzoru konkurence kurz placený. Druhá, podle mého názoru lepší varianta, by byla přidat *systém pro učitele*, pomocí kterého by mohli například vytvářet třídy, přidávat žáky, sledovat jejich pokroky a zadávat domácí úkoly. Tato funkcionalita pro školy by byla placená, ať už ve formě roční licence, jednorázové platby, nebo menší částky za každého studenta. == Věty pro lekce Trénování na celých větách je zatím možné pouze pro uživatele, kteří si již celou klávesnici osvojili. Důvod je jednoduchý. Nemám k dispozici žádný soubor vět, obsahující pouze *omezený výběr písmen*. Zkoušel jsem využít sílu, v současné době velmi populárních, LLMs (large language model), ale bohužel moc neporozuměly mému požadavku. Myslím, že tyto modely úplně nerozumí vztahu mezi písmeny a slovy (@dotaz[dotaz]). Zatím jediným způsobem, jak získat takový soubor, je napsat si věty sám. #figure(caption: [(březen 2024) #h(1pt) @gemini @chatgpt], supplement: "Dotaz", gap: 1em)[ ``` Napiš mi 10 vět obsahující pouze písmenka f,j,g,h,d,k,s,l,a,ů, q,ú,w,p,e,o,r,i,t,u,z. Odpověď Google Gemini: 1. Fialový drak s hnědýma očima klidně seděl na louce. 2. Hasič s houbou uhasí hořící dům. 3. Krásná princezna s úsměvem tančila na plese. Odpověď ChatGPT: 1. Jak úžasné je, že žluté květy rostou v dáli. 2. Vůně jasmínu zdobí chodbu hotelu. 3. Klidně si odpočiň pod stromem. ``` ]<dotaz>
https://github.com/DieracDelta/presentations
https://raw.githubusercontent.com/DieracDelta/presentations/master/polylux/book/src/dynamic/one-by-one-start.typ
typst
#import "../../../polylux.typ": * #set page(paper: "presentation-16-9") #set text(size: 50pt) #polylux-slide[ #one-by-one(start: 3)[This ][came ][pretty late.] ]
https://github.com/Gekkio/gb-ctr
https://raw.githubusercontent.com/Gekkio/gb-ctr/main/chapter/peripherals/dma.typ
typst
Creative Commons Attribution Share Alike 4.0 International
#import "../../common.typ": * == DMA (Direct Memory Access) === Object Attribute Memory (OAM) DMA OAM DMA is a high-throughput mechanism for copying data to the OAM area (a.k.a. Object Attribute Memory, a.k.a. sprite memory). It can copy one byte per machine cycle without involving the CPU at all, which is much faster than the fastest possible `memcpy` routine that can be written with the SM83 instruction set. However, a transfer cannot be cancelled and the transfer length cannot be controlled, so the DMA transfer always updates the entire OAM area (= 160 bytes) even if you actually want to just update the first couple of bytes. The Game Boy CPU chip contains a DMA controller that coordinates transfers between a *source area* and the *OAM area* independently of the CPU. While a transfer is in progress, it takes control of the source bus and the OAM area, so some precaution is needed with memory accesses (including instruction fetches) to avoid OAM DMA bus conflicts. OAM DMA uses a different address decoding scheme than normal memory accesses, so the source bus is always either the external bus or the video RAM bus, and the contents normally visible to the CPU in the #hex-range("FE00", "FFFF") address range cannot be used as a source for OAM DMA transfers. The upper 8 bits of the OAM DMA source address are stored in the DMA register, while the lower 8 bits used by both the source and target address are stored in the DMA controller and are not accessible directly. A transfer always begins with #hex("00") in the lower bits and copies exactly 160 bytes, so the lower bits are never in the #hex-range("A0", "FF") range. Writing to the DMA register updates the upper bits of the DMA source address and also triggers an OAM DMA transfer request, although the DMA transfer does not begin immediately. #reg-figure( caption: [#hex("FF46") - DMA - OAM DMA control register] )[ #reg-table( [R/W-x], [R/W-x], [R/W-x], [R/W-x], [R/W-x], [R/W-x], [R/W-x], [R/W-x], table.cell(colspan: 8)[DMA\<7:0\>], [bit 7], [6], [5], [4], [3], [2], [1], [bit 0] ) #set align(left) #grid( columns: (auto, 1fr), gutter: 1em, [*bit 7-0*], [ *DMA\<7:0\>*: OAM DMA source address\ Specifies the top 8 bits of the OAM DMA source address. Writing to this register requests an OAM DMA transfer, but it's just a request and the actual DMA transfer starts with a delay. Reading this register returns the value that was previously written to the register. The stored value is not cleared on reset, so the initial value before the first write is unknown and should not be relied on. ], ) ] #warning[ Avoid writing #hex-range("E0", "FF") to the DMA register, because some poorly designed flash carts can trigger bus conflicts or other dangerous behaviour. ] ==== OAM DMA address decoding The OAM DMA controller uses a simplified address decoding scheme, which leads to some addresses being unusable as source addresses. Unlike normal memory accesses, OAM DMA transfers interpret all accesses in the #hex-range("A000", "FFFF") range as external RAM transfers. For example, if the OAM DMA wants to read #hex("FF00"), it will output #hex("FF00") on the external address bus and will assert the external RAM chip select signal. The P1 register which is normally at #hex("FF00") is not involved at all, because OAM DMA address decoding only uses the external bus and the video RAM bus. Instead, the resulting behaviour depends on several factors, including the connected cartridge. Some flash carts are not prepared for this unexpected scenario, and a bus conflict or worse behaviour can happen. #figure( table( columns: 3, align: left + horizon, [DMA register value], [Used bus], [Asserted chip select signal], hex-range("00", "7F"), [external bus], [external ROM (A15)], hex-range("80", "9F"), [video RAM bus], [video RAM (MCS)], hex-range("A0", "FF"), [external bus], [external RAM (CS)], ), caption: "OAM DMA address decoding scheme" ) ==== OAM DMA transfer timing TODO ==== OAM DMA bus conflicts TODO
https://github.com/vitto4/ttuile
https://raw.githubusercontent.com/vitto4/ttuile/main/DOC.EN.md
markdown
MIT License
# 📚 Documentation ### `ttuile` Entry point of the package. Should be called at the beginning of your document, as described in [README.md > Usage](https://github.com/vitto4/ttuile/blob/main/README.md#-usage). You'll also find a table listing the arguments there. ### `annexe` "Annexe" is the french word for "appendix". Function used to create an `annexe` object, for future use with function `afficher-annexes` (see [afficher-annexe](#afficher-annexes)). | Argument | Default value | Type | Description | |:--------:|:-------------:|:----:|:------------| | `titre` | `none` | `content?` | Title of your appendix. | | `reference` | `none` | `label` | Label that you'll be using in the body to refer to this appendix. | A single positional argument is accepted, being the appendix's body. **Example :** ```typ #let Appendix-1 = annexe( titre: [Title of the appendix], reference: <label-to-use>, )[ Body of the appendix, just write as usual. ] ``` The `reference` (label) can then be used in the body of the report : `@label-to-use`. **Note :** - Because the titles of the appendices are really just custom-styled level 1 headings, it is, as of now, not possible to make and use a `= Level 1 heading` inside an appendix. Level 2 and lower work just fine though. ### `afficher-annexes` This translates to "display-appendices" and accepts an array of `dictionary` generated by `annexe` (see [annexe](#annexe)). It will take care of actually displaying the appendices. | Argument | Default value | Type | Description | |:--------:|:-------------:|:----:|:------------| | `annexes` | `none` | `array<dictionary>` | An array of dictionaries generated with the function `annexe`. | | `table` | `true` | `bool` | If set to `true`, a table of appendices will be displayed. | | `saut-page-apres-table` | `false` | `bool` | Translates to "page-break-after-table". | **Example :** ```typ #afficher-annexes( annexes: (Appendix-1, Appendix-2,), table: true, saut-page-apres-table: false, ) ``` ### `equation-anonyme` Means "anonymous-equation". Simple shortcut for ```typ math.equation( block: true, numbering: none, ... ) ``` Use it when you don't want your equation to be labelled. **Example :** ```typ #equation-anonyme( $ "An equation" $ ) ``` ### `figure-emboitee` French for "boxed-figure". Makes sure the caption's width doesn't exceed that of the figure. ```typ figure-emboitee( figure( image("img.png"), caption: [A figure.] ) reference: <label-to-use>, ) ```
https://github.com/AliothCancer/AppuntiUniversity
https://raw.githubusercontent.com/AliothCancer/AppuntiUniversity/main/capitoli_fisica/trasformazioni.typ
typst
#import "../transf_graph.typ": trasformazioni_graph = Trasformazione Politropica <trasformazione-politropica> Con una trasf. politropica si può descrivere una qualsiasi trasformazione termodinamica. $ p = p_1 (v_1/v)^(n) $ #trasformazioni_graph(mode:"a4") #h(1em) === Equazione di stato $ p dot.op V^n = upright("costante") $ Dove: - $p$: la pressione - $V$: il volume - $n$: l’indice politropico, *pari a k se* trasf. adiabatica e quasistatica(cioè isoen tropica) == Casi Particolari <casi-particolari> - Per $n = 0$ $arrow.r$ #strong[Isobara]: $p = upright("costante")$ - Per $n = plus.minus oo$ $arrow.r$ #strong[Isocora]: $V = upright("costante")$ - Per $n = 1$ $arrow.r$ #strong[Isoterma]: $T = upright("costante")$ - Per $n = k$ $arrow.r$ #strong[Adiabatica]: $k = C_p / C_v$ == Lavoro massico durante una Trasformazione Politropica <lavoro-durante-una-trasformazione-politropica> Calcolando: $ w = integral _(v_1) ^(v_2) p dif v = p_1 v_1^n integral _(v_1) ^(v_2) v^(-n) dif v $ Si distinguono due casi: - #strong[Caso Generale] ($n eq.not 1$): $ L_v = frac(p_1 dot.op V_1, n - 1) lr((lr((V_1 / V_2))^(n - 1) - 1)) $ - #strong[Caso Isotermico] ($n = 1$): $ L_v = - p_1 dot.op V_1 ln V_2 / V_1 $ == Calore massico scambiato Il lavoro per un'espansione è da considerare come un contributo negativo all'energia interna ma se è un'espansione allora $Delta v = v_2 - v_1 > 0$ e si avrebbe un termine positivo di lavoro quindi si aggiusta mettendo un meno. $ Delta u = q - w #h(.7cm)\ \ \ \ => $ #align(center, block($q = Delta u + w$, fill: rgb(34, 245, 55, 90), height: 1.2em, width: 5cm, radius: 4pt)) $ Delta u = c_v dot (T_2 - T_1) \ w = integral _(v_1)^(v_2) p dif v \ $ //##### $ => \ q = c_v dot (T_2 - T_1) + integral _(v_1)^(v_2) p dif v $ *Due casi per il lavoro:* - $n != 1$: $ q = c_v dot (T_2 - T_1) + frac(p_1 dot.op V_1, n - 1) lr((lr((V_1 / V_2))^(n - 1) - 1)) $ - $n = 1$: $ q = c_v dot (T_2 - T_1) - p_1 dot.op V_1 ln V_2 / V_1 $ == Calori specifici gas perfetti *N.B.*\ *NO vapore*\ *SÌ* aria umida ma solo per la parte di *aria secca*. $ R^* = R / ("Mm") $ - R : Costante dei gas perfetti = 8314 $J/("kmol" K) $ - Mm : Massa Molare del gas $["kg"/"kmol"]$ pari alla somma delle masse atomiche degli atomi che compongono la singola molecola.\ Esempio: N2 = N + N = 14 + 14 = 28 kg/kmol Calcolare calori specifici con l'indice *n* della politropica. === A volume costante $ c_v = 1 / (n-1) dot R^* $ === A pressione costante $ c_p = n / (n-1) dot R^* $ == Trasformazione Isoentropica *Se* la trasformazione *è adiabatica* *e* anche *quasistatica* (deve essere specificato nella traccia dell'exe) *Allora* *n=k*. Dove: $ k = c_p / c_v $ La quasistaticità è necessaria perchè se la trasformazione non è reversibile (presenza di forze non conservative che dissipano calore) si genera entropia. *Forze non conservative -> dissipazione calore \ -> generazione entropia.*
https://github.com/goshakowska/Typstdiff
https://raw.githubusercontent.com/goshakowska/Typstdiff/main/assets/example1/compared_new.typ
typst
#show underline : it => {highlight(fill: gray, text(red, it))} #show strike : it => {highlight(fill: yellow, text(blue, it))} ZMIANY NA HEADERZE = Introduction #strike[niezmieniony];#underline[zmeniony] ZMIANY NA PARAGRAFIE \ In#strike[ ];#strike[this] #strike[report,];#underline[eport,] we will explore the various #strike[factors];#underline[that] #strike[that];#underline[influence] #strike[influence];#underline[fluid];#strike[ ];#underline[ ];#strike[#emph[fluid dynamics];];#underline[dynamics] in glaciers #strong[and #strike[hZMIANA];#underline[how];] they contribute to the formation and behaviour of these natural structures. ZMIANY NA LISTACH + The climate - Temperature - #strike[Precipitation] + The #strike[topograpZMIANA];#underline[topography] + The geology + #underline[Nowy] ZMIANY NA MATEMATYCE #strike[$ Q = rho A v + C $];#underline[$ Q = rho A v + A $] ZMIANY NA FIGURACH ZE ZDJĘCIEM #figure([#strike[#box(image("doggo.jpeg", width: 20%))];#underline[#box(image("doggo.jpeg", width: 30%))] ], caption: [ #emph[Dog] form an important #strike[partZMIANA];#underline[part] of the earth’s climate system.#underline[ ];#underline[DODANE] ] ) ZMIANY NA FUNKCJACH This is Typst‘s documentation. It #strike[explains];#underline[CHANGED] Typst. This #strike[report];#underline[rep] is embedded in the #block[ #strike[#box(image("doggo.jpeg", height: 0.7em))];#underline[#box(image("doggo.jpeg", height: 0.9em))] ArtosFlow ] project. #block[ #strike[#box(image("doggo.jpeg", height: 0.7em))];#underline[#box(image("doggo.jpeg", height: 0.9em))] ArtosFlow ] is a project of the Artos#underline[ ];#underline[DODANE] Institute. ZMIANY NA LINKACH \ #strike[#link("https://typst.app/");];#underline[#link("https://another.app/docs");] Number: #strike[3];#underline[6] let name = \[#strong[#underline[Typst];#underline[ ];#strike[Typst!];#underline[NEW!];];\] ZMIANY NA TEKŚCIE abc \ #strong[#strike[my];#strike[ ];#strike[text];#underline[changed];] \ already low #strike[ABC];#underline[CHANGED] \ #strong[MY TEXT] \ ALREADY HIGH
https://github.com/rodrigo72/typst-LNCS-template
https://raw.githubusercontent.com/rodrigo72/typst-LNCS-template/main/README.md
markdown
# Typst LNCS Template A simple Typst LNCS (Lecture Notes in Computer Science) template. ![pdf-example](example.jpg)
https://github.com/MrToWy/hsh-thesis
https://raw.githubusercontent.com/MrToWy/hsh-thesis/main/README.md
markdown
MIT License
# The `modern-hsh-thesis` Package <div align="center">Version 1.0.0</div> A template for writing a bachelors or masters thesis at the Hochschule Hannover, Faculty 4. ## Getting Started ### WebApp Choose the template in the typst web app and follow the instructions there. ### Terminal ```bash typst init @preview/modern-hsh-thesis:1.0.0 ``` ### Import ```typ #import "@preview/modern-hsh-thesis:1.0.0": * #show: project.with( title: "Beispiel-Titel", subtitle: "Bachelorarbeit im Studiengang Mediendesigninformatik", author: "<NAME>", author_email: "<EMAIL>", matrikelnummer: 1234567, prof: [ Prof. Dr. <NAME>\ Abteilung Informatik, Fakultät IV\ Hochschule Hannover\ #link("mailto:<EMAIL>") ], second_prof: [ Prof. Dr. <NAME>\ Abteilung Informatik, Fakultät IV\ Hochschule Hannover\ #link("mailto:<EMAIL>") ], date: "01. August 2024", glossaryColumns: 1, bibliography: bibliography(("sources.bib", "sources.yaml"), style: "institute-of-electrical-and-electronics-engineers", title: "Literaturverzeichnis") ) ``` ### Additional functions `customFunctions.typ` contains additional functions that can be used in the template. `#smallLine`: A small line that can be used to separate sections. `#task`: A card that can be used to create a list of tracks (see example in 1-einleitung.typ). `#track` or `##narrowTrack`: A track that can be displayed inside a task (see example in 1-einleitung.typ). `#useCase`: Display a Use Case (see example in 1-einleitung.typ). `#attributedQuote`: Display a quote with an attribution. `#diagramFigure`, `#codeFigure`, `#imageFigure`, `#treeFigure`: Wrap an image/code/diagram/tree-list in a figure with a caption. `#imageFigureNoPad`: Display a figure without padding. `#getCurrentHeadingHydra`, `#getCurrentHeading`: Get the heading of the current page. ### Development Environment 1. Install Typst https://github.com/typst-community/typst-install 2. Clone the repository 3. CD into the repository 4. Run `git pull && just install && just install-preview` to install/update the template 5. Run `typst init @local/modern-hsh-thesis:1.0.0 && typst compile modern-hsh-thesis/main.typ` to compile the template ## Additional Documentation Take a look at this complete Bachelor's thesis example using the `modern-hsh-thesis` template: [Bachelor's Thesis Example](https://github.com/MrToWy/Bachelorarbeit)
https://github.com/typst-tud/tud-slides
https://raw.githubusercontent.com/typst-tud/tud-slides/main/README.md
markdown
Apache License 2.0
# tud-slides This is a [Typst](https://typst.app/) template for slides and presentations in the corporate design of the [Technische Universität Dresden](https://tu-dresden.de/). Please be aware that this template is unofficial and may not fully adhere to the CD specifications. Any corrections, modifications, or enhancements are welcome. This template builds on [Touying](https://github.com/touying-typ/touying). Further information on its features and how to use them can be found in the [Touying tutorial](https://touying-typ.github.io/touying/docs/intro). ## Installation and Usage ### 1. get the template - clone this repository with git ```bash git clone https://github.com/typst-tud/tud-slides.git ``` - or download as a ZIP-file: https://github.com/typst-tud/tud-slides/archive/refs/heads/main.zip ### 2. import Touying and this template into your document ```typst #import "@preview/touying:0.4.2": * #import "tud-slides.typ" #let s = tud-slides.register(aspect-ratio: "16-9", debug: true) #let s = (s.methods.info)( self: s, title: [Your Title], subtitle: [Your Subtitle], author: [Firstname Lastname], date: datetime.today(), institution: [Institution], location: [Location], ) #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #let (slide, title-slide) = utils.slides(s) #show: slides = Title == First Topic #slide[ Hello, Touying! #lorem(40) ] ``` ## Acknowledgments - [Corporate Design Manual (login required)](https://tu-dresden.de/intern/services-und-hilfe/ressourcen/dateien/kommunizieren_und_publizieren/corporate-design/cd-elemente/CD_Manual_Stand-2022-02.pdf) - [tud-cd bundle for LaTeX](https://github.com/tud-cd/tud-cd)
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/fh-joanneum-iit-thesis/1.1.0/README.md
markdown
Apache License 2.0
# Typst Thesis Template Template for Your Bachelor's or Master's Thesis at [FH JOANNEUM, IIT](http://www.fh-joanneum.at/iit). ### TL;DR Using the typst universe preview package/template ``` typst init @preview/fh-joanneum-iit-thesis ```
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/102.%20identity.html.typ
typst
identity.html Keep Your Identity Small February 2009I finally realized today why politics and religion yield such uniquely useless discussions.As a rule, any mention of religion on an online forum degenerates into a religious argument. Why? Why does this happen with religion and not with Javascript or baking or other topics people talk about on forums?What's different about religion is that people don't feel they need to have any particular expertise to have opinions about it. All they need is strongly held beliefs, and anyone can have those. No thread about Javascript will grow as fast as one about religion, because people feel they have to be over some threshold of expertise to post comments about that. But on religion everyone's an expert.Then it struck me: this is the problem with politics too. Politics, like religion, is a topic where there's no threshold of expertise for expressing an opinion. All you need is strong convictions.Do religion and politics have something in common that explains this similarity? One possible explanation is that they deal with questions that have no definite answers, so there's no back pressure on people's opinions. Since no one can be proven wrong, every opinion is equally valid, and sensing this, everyone lets fly with theirs.But this isn't true. There are certainly some political questions that have definite answers, like how much a new government policy will cost. But the more precise political questions suffer the same fate as the vaguer ones.I think what religion and politics have in common is that they become part of people's identity, and people can never have a fruitful argument about something that's part of their identity. By definition they're partisan.Which topics engage people's identity depends on the people, not the topic. For example, a discussion about a battle that included citizens of one or more of the countries involved would probably degenerate into a political argument. But a discussion today about a battle that took place in the Bronze Age probably wouldn't. No one would know what side to be on. So it's not politics that's the source of the trouble, but identity. When people say a discussion has degenerated into a religious war, what they really mean is that it has started to be driven mostly by people's identities. [1]Because the point at which this happens depends on the people rather than the topic, it's a mistake to conclude that because a question tends to provoke religious wars, it must have no answer. For example, the question of the relative merits of programming languages often degenerates into a religious war, because so many programmers identify as X programmers or Y programmers. This sometimes leads people to conclude the question must be unanswerable—that all languages are equally good. Obviously that's false: anything else people make can be well or badly designed; why should this be uniquely impossible for programming languages? And indeed, you can have a fruitful discussion about the relative merits of programming languages, so long as you exclude people who respond from identity.More generally, you can have a fruitful discussion about a topic only if it doesn't engage the identities of any of the participants. What makes politics and religion such minefields is that they engage so many people's identities. But you could in principle have a useful conversation about them with some people. And there are other topics that might seem harmless, like the relative merits of Ford and Chevy pickup trucks, that you couldn't safely talk about with others.The most intriguing thing about this theory, if it's right, is that it explains not merely which kinds of discussions to avoid, but how to have better ideas. If people can't think clearly about anything that has become part of their identity, then all other things being equal, the best plan is to let as few things into your identity as possible. [2]Most people reading this will already be fairly tolerant. But there is a step beyond thinking of yourself as x but tolerating y: not even to consider yourself an x. The more labels you have for yourself, the dumber they make you.Notes[1] When that happens, it tends to happen fast, like a core going critical. The threshold for participating goes down to zero, which brings in more people. And they tend to say incendiary things, which draw more and angrier counterarguments.[2] There may be some things it's a net win to include in your identity. For example, being a scientist. But arguably that is more of a placeholder than an actual label—like putting NMI on a form that asks for your middle initial—because it doesn't commit you to believing anything in particular. A scientist isn't committed to believing in natural selection in the same way a biblical literalist is committed to rejecting it. All he's committed to is following the evidence wherever it leads.Considering yourself a scientist is equivalent to putting a sign in a cupboard saying "this cupboard must be kept empty." Yes, strictly speaking, you're putting something in the cupboard, but not in the ordinary sense.Thanks to <NAME>, <NAME>, <NAME>, and Robert Morris for reading drafts of this.Russian TranslationPortuguese TranslationRomanian Translation
https://github.com/Xe/automuse
https://raw.githubusercontent.com/Xe/automuse/main/paper/automuse_2/main.typ
typst
zlib License
#import "template.typ": conf, quote #show: doc => conf( title: [ Optmizing Automuse with GPT-4 Turbo-128k ], authors: ( ( name: "<NAME>", affiliation: "xn--g28h", email: "<EMAIL>", ), ( name: "<NAME>", affiliation: "xn--g28h", email: "<EMAIL>", ), ( name: "<NAME>", affiliation: "xn--g28h", email: "<EMAIL>", ), ( name: "<NAME>", affiliation: "xn--g28h", email: "<EMAIL>", ), ( name: "<NAME>", affiliation: "xn--g28h", email: "<EMAIL>", ), ( name: "<NAME>", affiliation: "xn--g28h", email: "<EMAIL>", ), ), abstract: [ Further improvements to the Automuse system described in Automuse#cite(<Ratio2023>) are described. The use of GPT-4 Turbo 128k#cite(<openaiModelsDeveloper>) allows for unique opportunities in increasing output quality and quantity. Further adaptations to modernize scenarios and plots are also described. ], doc, ) = Introduction Modern advancements to large language model technology have allowed for creating new and interesting applications. One such application is the Automuse#cite(<Ratio2023>) system. This system used TypeScript and GPT-3.5#cite(<ye2023comprehensive>) to generate scenarios and prose for "pulp novels", or low-quality fiction churned out on cheap paper to meet mass needs for entertainment. This paper describes the improvements made to the system by using GPT-4 Turbo 128k#cite(<openaiModelsDeveloper>) and modernizing the scenarios and plots used. The results of these improvements are also discussed. The goal of Automuse continues to be the generation of low-quality fiction for entertainment. The system is designed to be used by a human operator to generate the scenario, characters, prose, and cover image of the novel in question. The operator is then responsible for editing the output into a finished product. The system is not designed to be used without massive human intervention by a skilled operator. Automuse is distributed as a GitHub repository at #link("https://github.com/Xe/automuse"). Automuse wraps the following tools: - Plotto#cite(<cook_1928>), a system to automatically generate the plot of a novel with little human effort. - The ChatGPT#cite(<chatgpt>) API to generate summaries, character biographic information, prose, and cover images. - The GPT-4 Turbo 128k#cite(<openaiModelsDeveloper>) model to generate the scenarios and prose. - Pandoc to take generated prose and stitch it together into an eBook. == Motivation The authors were motivated to create this paper by the existence of the GPT-4 Turbo 128k model. This model allows for 128,000 tokens of context, which is enough to store an entire novel's worth of text as defined by the National November Writing Month rules#cite(<NaNoWriMoRules>). This allows for the possibility of generating an entire novel with a single context window, which is a significant improvement over the previous system having to manage multiple context windows and haphazardly stitch them together. The use of Plotto continues to be a core part of the value proposition of Automuse. The authors were motivated to modernize the scenarios and plots used by the system to be more in line with modern sensibilities. The authors were also motivated to improve the quality of the generated prose and cover images with the use of modern models and their generational improvements. == Results Two publications have been generated with Automuse version 2, but only one of them is considered a "novel". Debt of Stars#cite(<yasomi2023debt>) was the first publication and only came out to 47079 words, about 3000 short of the goal. The second publication, Virtual Virtue#cite(<yasomi2023virtue>), finally came out over the bar at 55252 words. Both stories were generated with different scenarios and plots, but both were generated with the same GPT-4 Turbo 128k model. The use of a single context window for the entire novel did work at the beginning, but you can see it causing deterioration of model output as novels progress. This is likely due to the model being unable to keep track of the entire context window and the context window being too large to be useful. This is a problem that will need to be addressed in future versions of Automuse, likely after future development in coherent context windows has occurred. To mitigate this, the authors changed Automuse to create a new context window for every book chapter. This allows for the model to remain coherent for the majority of output in a chapter, at the cost of theoretical information loss between chapters. This is a tradeoff that the authors are willing to make for the time being. = Methodology The overall flow for generating a novel remains unchanged from Automuse version 1, mirroring the normal "inside-out" process to write a novel: - Automuse creates a scenario and plot using Plotto. - The algorithm selects a "catch" (additional plot element) from a fixed list. - Automuse expands this into a plot summary and list of chapters with the ChatGPT API. - Automuse creates character summaries with the ChatGPT API. - Automuse generates chapter summaries with the ChatGPT API. - Automuse generates prose with the GPT-4 Turbo 128k model via an iterative "typewriter" process. - Automuse generates a cover image with the Dall-E 3#cite(<openaiDALLECreating>) API. - The operator stitches the generated prose and images together with Pandoc. The main difference between Automuse version 1 and Automuse version 2 is the use of GPT-4 Turbo 128k instead of GPT-3.5 4k. This allows for putting more context into the model, which allows for more coherent output. == Scenario and Plot The biggest advantage to GPT-4 models is the increased quality in written content. Here is an example of a plot summary written by GPT-4: #quote[In an era where the sanctity of the internet has evolved into the paramount religion, "Virtual Virtue" tells the tale of Haley’s unconventional quest to confirm the authenticity of aer partner Braylon’s love. Amidst a technologically advanced society that worships connectivity and digital presence, Haley, whose relationship with Braylon has culminated in a prolonged engagement, resolves to disguise aerself and engage with him as a stranger. Troubled by the pervasive artificiality that the internet-first culture has brought into interpersonal relationships, Haley crafts a perilous situation—a test of courage—to challenge Braylon’s devotion. This leads Haley on an intricate journey, not only to possibly save Braylon from the very trap that ae had set but also to untangle a complicated web of digital deceit, risking aer own integrity in the process. The story unfolds, revealing the struggle between genuine human connection and the facades maintained in a world dominated by online personas.] This is a significant improvement in quantity and quality over the previous version of Automuse, which would have generated something like this: #quote[After a disastrous turn of events, software engineer, Mia, finds herself stranded on a deserted island with no communication to the outside world. Mia uses her knowledge of peer to peer networks to create a makeshift communication system with other stranded individuals around the world, all connected by the same network. Together, they navigate survival and search for a way back to civilization while facing challenges posed by the island.] The authors did not change the prompts between both versions of Automuse, so the difference in output is entirely due to the model change. == Characters Automuse version 1 did not spend a lot of effort in character descriptions, which led to the characters being very flat and uninteresting. Automuse version 2 uses the following method to generate character descriptions: - The Plotto summary creates a list of characters and their roles. - Automuse adds in randomly generated gender and sex characteristics to each character. - Automuse generates a character summary with the ChatGPT API. - Automuse writes these summaries to markdown files on disk for later processing. These character summaries are fed into the system prompt of prose generation runs. This allows for the model to have more context about the characters and their motivations, which leads to more interesting prose. == Prose The authors found that the following prompt keywords worked best for generating prose: #quote[You will be given a description of a scene and you will write the prose for the scene. You will output the prose for the scene. \[...\] Include realistic dialogue. Be creative and descriptive. Use a lot of detail. Write something that has an outstanding plotline, engaging characters and unexpected climaxes.] When combined with the plot summary, character summaries, and chapter summaries, this leads to each "user" message being the individual scene summary with each "assistant" message being the generated prose. This allows for the model to have more context room to generate prose instead of having to over-verbosely be told what to do at every step. This allowed the authors to save on tokens being processed, which allowed for more prose to be generated for the same cost. This allows for generated prose like this: #quote[With a breath that seemed to carry the weight of worlds, Haley pressed 'Send.' The message vanished into the nexus, a digital missive crossing the stream of zeroes and ones to arrive at Braylon's doorstep.] Instead of prose like this: #quote[When they finally had a solid plan, Mia took charge. She donned her backpack, pulling out a rusty old radio, some wire, and a series of small batteries. They would need to make contact with other stranded individuals around the world, all connected by the same network. And with their knowledge and expertise, they could do it.] == Cover Images Previously, the cover images for Automuse version 1 novels required manual human intervention to create. This was a time-consuming process that required a lot of manual work. Automuse version 2 uses the Dall-E 3 API to generate cover images. This allows for images like the following to be generated: #figure( image("./debt-of-stars-cover.png", width: 80%), caption: "The cover image for Debt of Stars by <NAME>.", ) = Known Issues Automuse version 2 is a generational improvement over Automuse version 1, but it is not without its flaws. The authors have identified the following issues with the system: - Automuse uses Plotto as a source of plot generation. Plotto was created in 1928 and reflects many stereotypes of its time. Careful filtering of Plotto summaries is required to avoid repeating harmful cultural and social biases. - Automuse uses the GPT-4 Turbo 128k model, which is a proprietary model. This means that the authors cannot share the model weights with the public. This is a problem that will need to be addressed in future versions of Automuse. - Automuse uses a private dependency to "fix" Plotto's issues with inherent racism. This version of Plotto cannot be made public due to fears that the authors will be attacked by source code hosting providers for hosting "hate speech" or "racist content" via the unknown racist entries in the Plotto source code that have not been filtered out yet. - Using one context window for writing an entire novel presented unique problems with internal coherency. Automuse version 2 was adapted to use a new context window for every chapter, which allows for more coherent output at the cost of information loss between chapters. This will need to be addressed in future versions of Automuse. == Potential Societal Impacts According to <NAME>'s documentary about the predatory ghostwriting industry named Contrepreneurs: The Mikkensen Twins#cite(<Olson2022>), the average pay rate for a ghostwriter for The Urban Writers can get as low as USD\$0.005 per word. Given that Automuse version 2 spends about USD\$25.00 to write about 50,000 words (USD\$0.0002 per word) using GPT-4 Turbo 128k, this makes Automuse a significant cost reduction in the process for creating pulp novels. It is twenty-five times as cheap as hiring a horribly underpaid ghostwriter who has to endure horrors that no human should be exposed to. This is a setback from Automuse version 1's cost of USD\$0.20 to write 50,000 words, but the much higher quality of GPT-4 Turbo 128k's output more than makes up for the increase in cost. The authors believe that this is a net positive for society. The quality of Automuse novels still is unable to compare to the output of a highly skilled human writer. Due to the fundamental nature of these networks, they cannot truly create new output, but they can create unexpected combinations of things that have already existed. This is a fundamental limitation of the technology that will need to be addressed in future versions of Automuse, if not in large language models themselves. The authors of this paper do not believe that Automuse version 2 can displace human authors from their jobs. A version of Automuse could be used to help human authors generate and test ideas, but the authors do not believe that Automuse can replace human authors entirely with any amount of improvements. The authors would like to note that the conditions that writers for The Urban Writers work in are so terrible that displacing their labor may net them long term benefits provided they can survive the short term loss of their main source of employment vanishing. These displaced workers would still need to pay money to eat food and purchase lodging, meaning that a mass-adoption of Automuse could have massive downsides for this class of workers. The authors would like to note that the authors of this paper are not lawyers and cannot provide legal advice. = Future Work As future models get released and improved upon, the authors would like to continue to improve Automuse. The authors would like to continue to improve the quality of the generated prose and cover images. The authors would also like to continue to improve the quality of the generated plots and scenarios. The authors would like to improve the relevance of the stories that Automuse tells as well as making them more reflective of the inherent diversity in humanity. The authors would also like to base future versions of Automuse on open source large language models. This would allow Automuse novels to cover topics that are inherent to human existence (such as sexual relations) but are otherwise not allowed with hosted models like GPT-4 Turbo 128k. This would also allow for the authors to share model weights for Automuse as well as fine-tune different models for the different tasks in this system. The authors would like to optimize the costs of Automuse to the point that they can set up a "book club" for people to read and review changes to Automuse generated prose. This would allow for the quality of Automuse prose to be incrementally improved over time by human interaction and reviews, which would allow for the authors to better prioritize finetuning runs. = Acknowledgements The authors would like to thank the following people and organizations for their support and assistance in the development of this project: - The OpenAI team for their work on GPT-4 Turbo 128k#cite(<openaiModelsDeveloper>) and for sponsoring the server time used to run inference. - <NAME>. for continued inspiration and support. - Patrons of the Xe Iaso blog for their continued patience and support. #bibliography("citations.bib", style: "ieee")
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/scripting/if.typ
typst
// Test if-else expressions. --- if-markup --- // Test condition evaluation. #if 1 < 2 [ One. ] #if true == false [ {Bad}, but we {dont-care}! ] --- if-condition-complex --- // Braced condition. #if {true} [ One. ] // Content block in condition. #if [] != none [ Two. ] // Multi-line condition with parens. #if ( 1 + 1 == 1 ) [ Nope. ] else { "Three." } // Multiline. #if false [ Bad. ] else { let point = "." "Four" + point } // Content block can be argument or body depending on whitespace. #{ if content == type[b] [Fi] else [Nope] if content == type [Nope] else [ve.] } #let i = 3 #if i < 2 [ Five. ] else if i < 4 [ Six. ] else [ Seven. ] --- if-else-if-else --- // Test else if. #let nth(n) = { str(n) if n == 1 { "st" } else if n == 2 { "nd" } else if n == 3 { "rd" } else { "th" } } #test(nth(1), "1st") #test(nth(2), "2nd") #test(nth(3), "3rd") #test(nth(4), "4th") #test(nth(5), "5th") --- if-expression --- // Value of if expressions. #{ let x = 1 let y = 2 let z // Returns if branch. z = if x < y { "ok" } test(z, "ok") // Returns else branch. z = if x > y { "bad" } else { "ok" } test(z, "ok") // Missing else evaluates to none. z = if x > y { "bad" } test(z, none) } --- if-condition-string-invalid --- // Condition must be boolean. // If it isn't, neither branch is evaluated. // Error: 5-14 expected boolean, found string #if "a" + "b" { nope } else { nope } --- if-condition-invalid-and-wrong-type --- // Make sure that we don't complain twice. // Error: 5-12 cannot add integer and string #if 1 + "2" {} --- if-incomplete --- // Error: 4 expected expression #if // Error: 5 expected expression #{if} // Error: 6 expected block #if x // Error: 2-6 unexpected keyword `else` #else {} // Should output `x`. // Error: 4 expected expression #if x {} // Should output `something`. // Error: 6 expected block #if x something // Should output `A thing.` // Error: 19 expected block A#if false {} else thing #if a []else [b] #if a [] else [b] #if a {} else [b]
https://github.com/lvignoli/typst-pandoc
https://raw.githubusercontent.com/lvignoli/typst-pandoc/main/test_files/writer_test_file.md
markdown
MIT License
--- title: Writer test file author: <NAME> date: 2022-02-09 --- # Title Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ## Subtitle This is a _test_ file. It is **important** that it renders well, not ~~bad~~. A line with a line break (check the double space ending in the markdown source). It # should #escapes special $ #\` $characters` correctly*, right?_*. Look at the math now: for $a$, $b$ and $c$ are real numbers with $a\neq 0$, the quadratic formula is $$ x_\pm = \frac{-b\pm\sqrt{b^2-4ac}}{2a}. $$ Of course, this latex math syntax is not compilable in Typst, so for now we ouput a dummy symbol. ## Recipe - Olive - Garlic - Feta 1. Cut the garlic and make 2. Cut the feta in cube 3. I have no idea what to do now Banana : A fruit. Apple : Another fruit. : It's more juicy than banana. Some nested lists - 1 - 1.1 - 1.2 - 2 - 2.1 - 2.1.1 - 2.1.2 - 2.2 - 3 ## Stuff Click [here](https://example.com). It points to `example.com`. Here is some `Go` code: ```go func main() { fmt.Println("Hello World!") } ``` and now some `rust` code as well 🦀 ```rust fn main() { println!("Hello World!"); } ``` Now some famous quotes: > Life is what happens when you're busy making other plans. — <NAME> > Whoever is happy will make others happy too. — <NAME> Another citation but multiline in the markdown source > Nous avons certains souvenirs qui sont comme la peinture hollandaise de notre mémoire, tableaux de genre où les personnages sont souvent de condition médiocre, pris à un moment bien simple de leur existence, sans événements solennels, parfois sans événements du tout, dans un cadre nullement extraordinaire et sans grandeur. > Le naturel des caractères et l'innocence de la scène en font l'agrément, l'éloignement met entre elle et nous une lumière douce qui la baigne de beauté. > > — _Le plaisir des jours_ (1896), <NAME> --- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
https://github.com/jneug/schule-typst
https://raw.githubusercontent.com/jneug/schule-typst/main/docs/examples/ab.typ
typst
MIT License
#import "../../src/schule.typ": ab #import ab: * #show: arbeitsblatt.with( /* @typstyle:off */ titel: "Arbeitsblatt", reihe: "Entwicklung eines Typst-Pakets", datum: datetime.today(), nummer: "1", fach: "Typst", kurs: "101", autor: ( name: "<NAME>", kuerzel: "Ngb", ), version: "2024-06-25", ) #infobox[ = Was ist Typst #lorem(100) ] #aufgabe(titel: "Grundgerüst erstellen", icon: (icon.partner, icon.computer))[ #lorem(50) ]
https://github.com/boladouro/ME
https://raw.githubusercontent.com/boladouro/ME/main/1/pro%20prof/relatorio/main.typ
typst
#import "template.typ": * #import "functions.typ": ifrac #include "capa.typ" #import "@preview/algo:0.3.3": algo, i, d, comment, code //https://github.com/typst/packages/tree/main/packages/preview/algo/0.3.3 #import "@preview/tablex:0.0.5": gridx, tablex, rowspanx, colspanx, vlinex, hlinex // #counter(page).update(1) #show: project #counter(page).update(1) = 1) A distribuição triangular é uma distribuição de probabilidades contínua com uma forma de triângulo. É definida por 3 propriedades: o vértice inferior esquerdo $a$, o vértice inferior direito $b$, e o vértice superior $c$. A sua função de distribuição de probabilidade (FDP) pode ser definida por @fdp. $ Delta(x | a, b, c) := cases( (2(x-a))/((b-a)(c-a)) &"se" a <= x <= c, (2(b-x))/((b-a)(b-c)) &"se" c <= x <= b, 0 &"em qualquer outro caso" ) $ <fdp> // #figure( // image("images/triang_dist.png", width: 50%), // caption: [Distribuição triangular #footnote[_Wikimedia Commons_. #link("https://w.wiki/7gM$")]] // ) O método da aceitação-rejeição é um método de Monte Carlo com o objetivo de gerar números pseudo-aleatórios (NPAs) de uma distribuição não-uniforme. Consiste num processo iterativo que pretende aceitar ou rejeitar NPAs $bold(X)$ geradas a partir do domínio ${x: f(x) != 0}$ de uma distribuição objetivo $f(x)$ de acordo com a probabilidade $P [X = x]$. Para isto, o processo irá gerar pontos da área de uma distribuição $C dot g(x)$ e verificar se esses também pertencem à área de $f(x)$. Ou seja, se @condicao se observar então $x$ é "aceite" como um NPA gerado da distribuição de $f(x)$. // o processo irá gerar NPAs de uma outra distribuição $g(x)$ (cuja geração não seja dispendiosa) e compará-la perante NPAs de uma distribuição uniforme entre 0 e 1 $u(0, 1)$. $ C dot g(x) dot u(0,1) < f(x), C in {lambda: lambda g(x) >= f(x)} $ <condicao> Para o máximo da eficiência do algoritmo, o $C$ escolhido deve ser o mais perto possível do máximo de $f(x)/g(x)$, pois o algoritmo terá maior probabilidade de gerar um número aceitável. Da mesma forma, é preferível que a forma de $g(x)$ seja uma parecida à forma de $f(x)$, sendo que a área de rejeição será menor. A distribuição $g(x)$ mais comum de escolher é a distribuição uniforme, devido à sua simplicidade, e à facilidade do cálculo do máximo de $f(x)/ g(x)$(desde que seja fácil determinar o máximo de $f(x)$). #figure(caption: "Gerador Aceitação-Rejeição", kind:"Algoritmo", supplement: "Algoritmo",placement: none, algo( title: "Gerador Aceitação-Rejeição", parameters: ("f(x)","g(x)", "C", "u([a, b])", "D{f(x)}"), indent-guides: 1pt + gray, indent-size:12pt, row-gutter: 8pt, )[ *ciclo*#i\ $u <- u([0,1])$\ $x <- u(D{f(x)})$\ *se* $u <= f(x)/(C g(x))$ *produza* $u$\ *se não* continuar o ciclo ]) O nosso objetivo foi gerar $10000$ NPAs proveninetes de $Delta(x)$ usando o método da aceitação-rejeição. Decidimos usar como $g(x)$ a distribuição uniforme (com domínio de $[a, b]$), pois o máximo de $Delta(x)$ será o parâmetro $c$, levando a que $C = f(c)/g(c)$. Na @resultados1 encontram-se os resultados das várias gerações executadas. Para demonstrar a precisão dos resultados, decidimos usar vários parâmetros diferentes e comparar com estatísticas teóricas, elas sendo a média, mediana, variância, e forma da distribuição. Decidimos também mostrar uma simulação da geração e dos pontos aceites e rejeitados (canto superior direito da @resultados1). #figure(caption: "Distribuições geradas", gap: 1pt, kind:image)[ #grid( rows: (auto), columns: (auto, auto), gutter: auto, block()[ #set text(size: 7pt) ```md Estatísticas teóricas e observadas |desc | mean| median| variance| |:----------------------------------|------:|------:|--------:| |Teórico (a = 0, b = 100, c = 50) | 50.000| 50.000| 416.667| |Observado (a = 0, b = 100, c = 50) | 49.798| 49.897| 417.380| |Teórico (a = 0, b = 10, c = 5) | 5.000| 5.000| 4.167| |Observado (a = 0, b = 10, c = 5) | 4.980| 4.990| 4.174| |Teórico (a = 1, b = 2, c = 1.2) | 1.400| 0.850| 0.047| |Observado (a = 1, b = 2, c = 1.2) | 1.398| 1.364| 0.047| |Teórico (a = 0, b = 20, c = 20) | 13.333| 15.000| 22.222| |Observado (a = 0, b = 20, c = 20) | 13.320| 14.148| 22.419| ``` ], image("images/mygrid_plot.svg", width: 90%), ) ] <resultados1> Podemos obervar que as formas estão bastante semelhantes ao teórico, e as estatísticas amostrais analisadas são extremamente semelhantes às teóricas, provando assim a eficácia do gerador e a confiância que podemos ter nele. Os resultados completos encontram-se em anexo. = 2) O nosso objetivo neste problema foi avaliar e comparar o comportamento de dois estimadores para a assimetria: um usando quantis para o cálculo ($s_1$), e outro sendo o Coeficiente de Groeneveld e Meeden ($s_2$). Para isso, usámos um gerador da distribuição _t-student_, para gerar 3 conjuntos de 100 amostras, cada conjunto com diferentes dimensões de amostras; e calculamos métricas de erros entre o valor teórico (para $nu > 3$, a assimetira da distribuição será $0$)#footnote[Nós escolhemos como propriedade da distribuição _t-student_ usar graus de liberdade $nu = 10$, para facilitar a comparação dos estimadores e para a distribuição não se aproximar tanto a uma normal.], e os valores estimados. As métricas usadas foram o erro-padrão (EP) (desvio padrão de uma estimativa) e o erro quadrático médio (EQM). O processo pode-se encontrar em anexo e na @resultados2 encontram-se os resultados obtidos. #figure(caption: "Resultados dos estimadores",gridx( rows: (auto), columns: (auto, auto), gutter: auto, align:horizon, gridx( columns: 5, rows: 5, header-rows: 2, align:(x, y) => { if (x == 0){return right}; //header if (y in (0, 1)) {return center};//row-names return right }, /* --- header --- */ [],colspanx(2)[EP $arrow.b$], colspanx(2)[EQM $arrow.b$], hline_header(start:1, end:3), hline_header(start:3, end:5), [],[$s_1$],[$s_2$],[$s_1$], [$s_2$], hline(start:1), /* -------------- */ [$100 times 20$], vline(start:2), [0.287],[*0.202*],[0.082],[*0.040*], [$100 times 100$], [0.134],[*0.088*],[0.018],[*0.008*], [$100 times 1000$],[0.041],[*0.031*],[0.002],[*0.001*], ), image("images/box_jitter_ex2.svg", height: 230pt) )) <resultados2> Pudemos obervar que a dispersão das assimetrias estimadas, e consequentemente a distância inter-quartil é bastante inferior usando $s_2$ em vez de $s_1$. Pudemos notar também que os valores das métricas de erro são menores usando $s_2$. Para além disso, verificamos que quanto maior a dimensão das amostras, mais precisa fica a nossa mediana da assimetria teórica da distribuição. Com isto, podemos concluir que: - Quanto maior a dimensão das amostras, maior a precisão e exatidão dos estimadores; - O estimador $s_2$ tem maior precisão e exatidão na estimação da assimetria na distribuição _t-student_.#footnote[Pelo menos quando $nu = 10$.]
https://github.com/Mc-Zen/zero
https://raw.githubusercontent.com/Mc-Zen/zero/main/docs/zero-docs.typ
typst
MIT License
#import "/src/zero.typ": * #import "@preview/cetz:0.2.2" // #align(center, text(2em, weight: "bold")[Zero]) #align(center, text(2em, weight: "bold")[$Z dot e^(r o)$]) // #align(center, image("logo.svg", height: 5em)) _Advanced scientific number formatting._ = Introduction Proper formatting of numbers requires some love for detail to guarantee a readable and clear output. This package provides tools to ensure consistent formatting and follow established practice. Key features are - *standardized* formatting, - digit *grouping*, e.g., $299 thin 792thin 458$ instead of $299792458$, - *plug-and-play* number *alignment in tables* - quick scientific notation, e.g., "2e4" #sym.arrow #num[2e4], - symmetric and asymmetric *uncertainties*, - rounding, - some specials for package authors, - and localization?. A number in scientific notation consists of three parts of which the latter two are optional. The first part is the _mantissa_ that may consist of an _integer_ and a _fractional_ part. In many fields, values are not known exactly and the corresponding _uncertainty_ is then given after the mantissa. Lastly, to facilitate reading very large or small numbers, the mantissa may be multiplied with a _power_ of 10 (or another base). The anatomy of a formatted number is shown in the following figure. #import "figures/anatomy.typ": anatomy #figure(anatomy) For generating formatted numbers, *Zero* provides the `num` type along with the types `mantissa`, `uncertainty`, and `power` that allow for fine-grained customization with `show` and `set` rules. #pad(x: 5%, outline(title: none, depth: 1)) = Quick Demo #{ set raw(lang: "typ") let examples = ( "#num[1.2e4]", "#num[-5e-4]", "#num[9.81+-.01]", "#num[9.81+0.02-.01]", "#num[9.81+-.01e2]", "#num[9.81+0.02-.01e2]", "#num(\"9.81+0.02-.01e2\", )", ) let compiled-examples = examples.map(eval.with(scope: (num: num), mode: "markup")) figure(table( stroke: none, table.vline(x: 2, stroke: .5pt), align: (left, center) * 2, columns: 4, ..array.zip(examples.map(raw), compiled-examples).flatten() )) } = Features == Digit grouping Digit grouping is important for keeping large figures readable. It is customary to separate thousands with a thin space, a dot, comma or an apostrophe (however, we discourage using a dot or a comma to avoid confusion since both are used for decimal separators in many countries). The separator can be configured via the `group-sep` option. #import "figures/grouping.typ": grouping #figure(grouping) By default, both the integer and the fractional part are split into groups of three, starting at the decimal separator. The size of the groups can be configured with `group-size`. Four-digit numbers are often not grouped at all since they can still be read easily. The option `group-threshold` controls the _least_ number of digits for digit grouping to kick in. Digit grouping can be turned off altogether with `group-digits: false`. == Specifying uncertainties There are two main ways of specifying uncertainties: - Applying an uncertainty to the last significant digits using parentheses, e.g., `2.3(4)`, - Denoting an absolute uncertainty, e.g., `2.3+-0.4` #sym.arrow #num[2.3+-0.4]. Zero supports both and can convert between these two, so that you can pick the displayed style independantly from the input style. How do uncertainties interplay with exponents? The uncertainty needs to come first and the exponent applies to both the mantissa and the uncertainty, e.g., `num("1.23+-.04e2")` becomes #figure(num("1.23+-.04e2")) Note that the mantissa is now put in parentheses to disambiguate the application of the power. In some cases, the uncertainty is asymmetric which can be expressed via `num("1.23+0.02-0.01")` #figure(num("1.23+0.02-0.01")) = Table alignment In scientific publication, presenting large amounts of numbers in a readable fashion is a high discipline. A good starting point is to align numbers in a table at the decimal separator. With _Zero_, this can be accomplished by using the `ztable`. This is a wrapper for the built-in `table` which features an additional argument `format` which takes an array of `none` or `auto` values to turn on number alignment for specific columns. ```typ #ztable( columns: 3, align: center, format: (none, auto, auto), $n$, $α$, $β$, [1], [3.45], [-11.1], .. ) ``` Non-number entries (e.g., in the header) are automatically recognized in some cases and will not be aligned. In ambiguous cases, adding a leading or trailing space tells _Zero_ not to align this cell, for example `[Angle ]` instead of `[Angle]`. #figure(ztable( columns: 3, align: center, format: (none, auto, auto), $n$, $α$, $β$, [1], [3.45], [-11.1], [2], [4.568], [-0.1], [3], [12.2], [-.02], [...], [24.1], [-1.1], [10], [234], [-0.00234], )) The numbers are not only aligned at the decimal point but also at the uncertainty and exponent part. #figure(ztable( columns: 3, align: center, format: (none, auto, auto), $n$, $α$, $β$, [1], [3.45e2], [-11.1+-3], [2], [4.568e1], [-0.1+-1e4], [3], [12.2e4], [-.02+-.02], [...], [24.1e6], [-1.1+-5], [10], [234e200], [-0.00234+-.3e3], )) = Zero for packages
https://github.com/rikhuijzer/phd-thesis
https://raw.githubusercontent.com/rikhuijzer/phd-thesis/main/chapters/summary.typ
typst
The Unlicense
#import "../style.typ": citefig #import "../functions.typ": chapter, textcite, parencite, note, avoid_indent #pagebreak() = Summary #avoid_indent() #lorem(10)
https://github.com/Quentindeve/tp_b2_symfony
https://raw.githubusercontent.com/Quentindeve/tp_b2_symfony/master/documents/cours_twig.typ
typst
#set document(title: "TP B2 - Contrôleurs et Twig", author: "<NAME>") #set page(paper: "presentation-4-3", header: [ #figure( image("images/sio.png", width: 10%) ) ]) #set text(size: 24pt, font: "Cascadia", weight: "medium") #set heading(numbering: "1.a >") #show heading: it => [ #set align(center) #set text(24pt, weight: "bold") #block(smallcaps(it.body)) ] #show raw: it => block( fill: rgb("#fafafa"), inset: 8pt, radius: 5pt, text(fill: rgb("#a2aabc"), it, weight: "bold", font: "Cascadia Code", size: 14pt), ) #set align(center) #set text() = Symfony - Contrôleurs et Templating #set text(size: 15pt) #set align(left) #pagebreak() = Qu'est-ce que les contrôleurs Symfony est un framework se basant sur le modèle MVC: - Les *Entity* sont le modèle, la représentation des données de l'application. - Les *Controller* sont la liaison entre les *Entity* et les vues. Mais les *vues* dans tout ça ? Elles sont définies dans le dossier *templates*. Et elles sont écrites en *Twig*. #pagebreak() = Qu'est-ce que Twig ? *Twig* est un langage de *templating*. Le *templating* est une méthode de génération de documents à partir d'un modèle précis. Si ça parait flou ne vous inquiétez pas, nous verrons comment ça se concrétise juste après. Le plus gros intérêt d'un système de templating comme Twig, c'est que vous pouvez dire adieu à tout le PHP dans vos vues ! Ainsi, le code suivant en PHP: ```php <body> <table> <?php $tab = [["name" => "Foo"], ["name" => "Bar"]]; foreach ($tab as $val) { ?> <tr><td> <?php echo $val["name"]; ?> </td></tr> <?php } ?> </table> </body> ``` Se transformera en ```twig <body> <table> {% for val in tab %} <td> <tr>{{ val.name }} </tr> </td> {% endfor %} </table> </body> ``` Exit donc le PHP et ses ouvertures de script juste pour une accolade ! #pagebreak() = Comment ça se concrétise dans le code ? Twig servant à créer des vues, il est intrinsèquement lié au concept de contrôleur. On va donc pas pouvoir y couper. == Création d'un contrôleur Allez dans le dossier avec un terminal, et rentrez la commande suivante: ```sh symfony console make:controller ListUsersController ``` La commande va créer *deux fichiers*: - *Controller/ListUsersController.php*: Notre fameux contrôleur - *templates/list_users/index.html.twig*: La *vue* associée au contrôleur Par défaut chaque contrôleur est associé à une vue. Dans certains cas cette vue ne sert pas, mais ce sont des utilisations plus avancées. Ici, on ne verra qu'un usage basique des contrôleurs Symfony, à savoir s'en servir pour *rendre* une vue. #pagebreak() == Voyons le résultat En étant dans le dossier du projet, exécutez dans votre terminal ```sh symfony server:start -d ``` Ouvrez ensuite votre navigateur préféré et essayez d'accéder à *http:\/\/localhost:8000/list/users*. Vous devriez tomber sur: #figure( image("images/image_controller.png", width: 100%), caption: [ Notre magnifique contrôleur. ] ) #pagebreak() = Décortiquons le contrôleur ```php <?php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; // 1 use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; class ListUsersController extends AbstractController // 2 { #[Route('/list/users', name: 'app_list_users')] // 3 public function index(): Response // 4 { return \$this->render('list_users/index.html.twig', [ // 5 'controller_name' => 'ListUsersController', // 6 ]); } } ``` Ca en fait beaucoup d'un coup, n'est-ce pas ? On va voir ça ! #pagebreak() ```php use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; // 1 ``` - 1: Les *use* servent à *importer* un symbole. Ce symbole peut être aussi bien une variable qu'une fonction ou encore une *classe*. Avec Symfony, ce sera le plus souvent une *classe*. #pagebreak() ```php class ListUsersController extends AbstractController // 2 ``` - 2: Symfony, comme beaucoup de frameworks MVC, utilise la programmation *Orientée Objet*. Un contrôleur est une simple classe fille d'*AbstractController*. #pagebreak() ``` #[Route('/list/users', name: 'app_list_users')] // 3 ``` - 3: Cette ligne définit la *route* sur laquelle écoute notre contrôleur. Elle indique aussi à Symfony que c'est la fonction juste en-dessous qu'il faut appeller pour obtenir la *réponse* du contrôleur, aka ce que notre navigateur web recevra *en réponse*. Ici, l'URL à rentrer pour appeller ce contrôleur depuis notre navigateur sera donc localhost\/*list/users*. Changeons-le pour *listusers*. Pour cela, la ligne 11 doit devenir: ```php #[Route('/listusers', name: 'app_list_users')] ``` Ainsi, pour accéder à notre page, il suffira désormais de rentrer localhost\/*listusers*. #pagebreak() ```php public function index(): Response // 4 ``` - 4: La déclaration de la fonction. Ici, Symfony la nomme par défaut *index*, mais ça pourrait aussi bien être *shrek_5*. Ca fonctionnerait tout autant. Vous pouvez d'ailleurs essayer. Le tout est d'avoir l'attribut *\#\[Route\]* au-dessus de la déclaration de fonction. #pagebreak() ```php return \$this->render('list_users/index.html.twig', ...) // 5 ``` - 5: Dernière ligne mais pas des moindre, elle demande à Symfony de faire le *rendu* de la *vue*, avec les données associées. Cette demande s'effectue via l'appel de la méthode *render*, possible via ```php $this->render(...) ``` Symfony va donc chercher le fichier *list_users/index.html.twig* puis, à la suite d'un processus fastidieux de *parsing* puis d'*instanciation de template* dont on a pas à se soucier, va renvoyer du HTML tout propre, que le client pourra voir en toute transparence.Ici, à la fonction est aussi passée le tableau associatif suivant: ```php ['controller_name' => 'ListUsersController'] ``` #pagebreak() ```php 'controller_name' => 'ListUsersController' // 6 ``` - 6: Cette ligne n'est pas des moindres, elle indique à Symfony de *substituer* au nom de variable *controller_name* la valeur *ListUsersController*. Vous pouvez d'ailleurs remplacer le texte 'ListUsersController' par ce que vous souhaitez et recharger la page pour observer un changement immédiat dans la page que vous recevrez. Vous pouvez aussi remplacer la clé, 'controller_name' par ce que vous voulez et recharger pour observer tout aussi rapidement que Symfony vous indiquera tout en politesse que vous avez foiré. Il vous fournira d'ailleurs un message d'erreur très détaillé. Quelle bonne poire ce Symfony ! #figure( image("images/symfony_error.png", width: 100%), caption: [ This is fine. ] ) *En résumé:* - Symfony fait un usage intensif de *classes*. Nous travaillons donc en *Programmation Orientée Objet*. - L'attribut *#[Route]* sert à définir un nouveau chemin dans notre site, dont la ressource renvoyée sera la valeur de retour de la fonction juste en-dessous, qui sera du type *Response*. - *Instancier* un template Twig se fait donc via la méthode *render* accessible directement via le contrôleur. On peut aussi lui passer toutes les valeurs dont il a besoin pour instancier notre template. - Symfony, dans son extrême bonté, nous fournira des messages d'erreur *très détaillés* en cas d'étourderie. #pagebreak() == Rendons visite au fichier Twig En ouvrant le fichier *templates/list_users/index.html.twig*, on se rend compte de l'ampleur du bordel: #set text(size: 14pt) ```twig {% extends 'base.html.twig' %} {% block title %}Hello ListUsersController!{% endblock %} {% block body %} <style> .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; } .example-wrapper code { background: #F5F5F5; padding: 2px 6px; } </style> <div class="example-wrapper"> <h1>Hello {{ controller_name }}! ✅</h1> This friendly message is coming from: <ul> <li>Your controller at <code><a href="{{ '/home/quentin/b2_symfony/src/Controller/ListUsersController.php'|file_link(0) }}">src/Controller/ListUsersController.php</a></code></li> <li>Your template at <code><a href="{{ '/home/quentin/b2_symfony/templates/list_users/index.html.twig'|file_link(0) }}">templates/list_users/index.html.twig</a></code></li> </ul> </div> {% endblock %} ``` #pagebreak() #set text(size: 18pt) Avant que vos cerveaux se liquéfient on va supprimer ce dont on se fout, puis on va annoter le reste comme précédemment: ```twig {% extends 'base.html.twig' %} <!--- 1 --> {% block title %} <!--- 2 --> Hello ListUsersController! {% endblock %} <!--- 3 --> {% block body %} <!--- 4 --> ... <h1>Hello {{ controller_name }}! <!--- 5 --> </h1> ... {% endblock %} <!--- 5 --> ``` #pagebreak() *Ne t'inquiète pas ça va bien spasser* Ici j'ai tronqué tout ce dont on se fout et j'ai mis des ... ici car c'est soit des choses que vous connaissez (ou êtes censés déjà connaitre), soit des choses inutiles pour le moment. Bref: #pagebreak() ```twig {% extends 'base.html.twig' %} <!--- 1 --> ``` - 1: Un template peut lui-même être une *extension* d'un autre template. Je ne vais pas trop pousser dans les détails ici mais vous pouvez, en modifiant le fichier *templates/base.html.twig*, définir une *base* pour toutes vos pages sans avoir à copier-coller. Exit le copier-coller du header, footer et autres pages CSS. De quoi ravir nos crack-addicts à Tailwind :^). #pagebreak() ```twig {% block title %} <!--- 2 --> ``` - 2: Indique ce que Symfony doit mettre en titre de la page. Le bloc *title* est défini dans *base.html.twig* sous la forme suivante: ```twig <title> {% block title %} Welcome! {% endblock %} </title> ``` Ainsi, la valeur par défaut sera *Welcome!* mais vous pouvez l'écraser dans votre propre template, comme l'a fait Symfony pour nous ! #pagebreak() ```twig {% endblock %} <!--- 3 --> ``` - 3: Marque la fin du bloc ouvert *au plus tôt*. Les blocs Twig suivent la même logique que les balises HTML au niveau de l'ordre de fermeture. #pagebreak() ```twig {% block body %} <!--- 4 --> ``` - 4: Exactement comme pour *title*, mais avec le body. Tout ce qu'on met dans le bloc sera inséré entre deux balises *body*. #pagebreak() ```twig <h1>Hello {{ controller_name }}! <!--- 5 --> </h1> ``` - 5: Le plus intéressant ! Comme je l'ai précisé (beaucoup) plus haut, dans l'appel à la fonction *\$this->render(...)*, nous pouvons passer des noms de variables sous forme de tableau associatif. Ici, {{ controller_name }} signifie *cherche la clé _controller_name_ et remplace-moi par sa valeur*. Ainsi, avec le tableau associatif suivant: ```php ['controller_name' => 'ListUsersController'] ``` {{ controller_name }} sera remplacé par *ListUsersController*, ce qui explique mieux ce que l'on a reçu auparavant ! #figure( image("images/image_controller.png", width: 100%), caption: [ Flashback. ] ) Comme toutes les blagues, les templates Twig les plus courts sont les meilleurs. C'est ici la fin de notre template. *En résumé:* - Tout template peut *hériter* d'un autre, ce qui permet d'éviter *beaucoup* de répétition de code (exemple du *header*, *footer*, *link du css* et autres...). - Le système de *bloc* permet d'éditer le contenu par défaut du template dont on hérite. - Twig dispose aussi d'un système de variables. Toute variable utilisée dans le template doit être accompagnée d'une assignation au niveau du contrôleur associé. Sinon, c'est l'engueulade assurée. #figure( image("images/symfony_error.png", width: 100%), caption: [ Tout est lié :o ] ) #pagebreak() = Sources - #link("https://twig.symfony.com/doc")[Twig - Documentation] - #link("https://symfony.com/doc/current/templates.html")[Symfony - Creating and Using Templates]
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/folding_range/let-tuple.typ
typst
Apache License 2.0
#let f(a) = ( let g(x) = 1, let h(x) = 2, )
https://github.com/rlpundit/typst
https://raw.githubusercontent.com/rlpundit/typst/main/Typst/fr-Rapport/chaps/chpt2.typ
typst
MIT License
/* ------------------------------- NE PAS MODIFIER ------------------------------ */ #import "../common/metadata.typ": title, chap2 #set page(header: smallcaps(title) + h(1fr) + emph(chap2) + line(length: 100%)) #text(white)[= #chap2 <chp:chap2>]#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) == Conclusion #lorem(32)
https://github.com/suiranruofeng/notebook
https://raw.githubusercontent.com/suiranruofeng/notebook/main/GW/Basic.typ
typst
= 快速傅里叶变换 def:运用计算机计算离散傅里叶变换(DFT)的快速计算方法
https://github.com/tgeorg-ethz/Tanzquotient-Playlist-Printer
https://raw.githubusercontent.com/tgeorg-ethz/Tanzquotient-Playlist-Printer/main/src/main.typ
typst
MIT License
#import "@preview/tablex:0.0.8": tablex, hlinex, vlinex #import "@preview/tiaoma:0.2.0" #let csv_file = "scripts/open-dancing-playlist.csv" // Update if necessary #let playlist_url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" // Replace with link to actual playlist #set page( footer: context [ #set align(center) #counter(page).display( "1 of 1", both: true, ) ], ) #set page(margin: ( top: 160pt )) #set page(header: locate(loc => { if counter(page).at(loc).first() <= 1 [ #set align(right) #stack( dir: ltr, spacing: 8pt, text( [ Tanzquotient Zürich (TQ)\ VSETH Commission\ Universitätstrasse 6\ 8092 Zürich\ <EMAIL>\ www.tanzquotient.org ] ), image( "assets/tanzquotient_logo.png", height: 90pt ) ) ] else [ #block( inset: (top: -30pt), tablex( columns: (1fr, 1fr), align: (left + horizon, right + horizon), auto-lines: false, stack( dir: ttb, image( "assets/vseth_logo_bunt.svg", height: 40pt ), ), stack( dir: ltr, spacing: 8pt, text( [ *Tanzquotient Zürich (TQ)*\ VSETH Commission ] ), image( "assets/tanzquotient_logo.png", height: 30pt ), ), ) ) ] })) = Open Dancing DATE-HERE == Playlist by AUTHOR-HERE // Set text size a bit smaller to fit everything #set text( size: 9pt, ) #let mycounter = counter("mycounter") #let results = csv( row-type: dictionary, csv_file ) #show table.cell.where(y: 0): strong #table( fill: (x, y) => if x != 0 { if y == 0 { rgb("d9d9d9") } else if calc.even(y) { rgb("f3f3f3") } }, inset: 7pt, stroke: (x, y) => if x == 0 { none } else { 1pt }, columns: ( auto, // auto, // Comment in for Playlist index auto, auto, auto, auto, ), [Time], // [Nr.], // Comment in for Playlist index [Duration], [Title], [Artist], [Dance#footnote[The dances mentioned here are just a suggestion. Feel free to add your own style!]], ..results.map( v => ( [#v.at("Start Time")], // [#v.at("index")], // Comment in for Playlist index [#v.at("Duration (min:sec)")], [#v.at("Track Name")], [#v.at("Artists")], [#v.at("Suggested Dance")], ) ).flatten(), ) // QR Code #stack( dir: ltr, spacing: 8pt, tiaoma.barcode( playlist_url, "QRCode", options: ( scale: 1.5, ), ), text( [ #text( size: 20pt, [*Playlist*] ) \ \ #text( size: 13pt, // Slightly larger link text fill: blue, [ #underline[ #link(playlist_url) ] ] ) ] ), )
https://github.com/warab1moch1/MathmaticalFinance
https://raw.githubusercontent.com/warab1moch1/MathmaticalFinance/main/20240629.typ
typst
#import "manual_template.typ": * #import "theorems.typ": * #show: thmrules // Define theorem environments #let theorem = thmbox( "theorem", "Theorem", fill: rgb("#e8e8f8") ) #let lemma = thmbox( "theorem", // Lemmas use the same counter as Theorems "Lemma", fill: rgb("#efe6ff") ) #let corollary = thmbox( "corollary", "Corollary", base: "theorem", // Corollaries are 'attached' to Theorems fill: rgb("#f8e8e8") ) #let definition = thmbox( "definition", // Definitions use their own counter "Definition", fill: rgb("#e8f8e8") ) #let exercise = thmbox( "exercise", "Exercise", stroke: rgb("#ffaaaa") + 1pt, base: none, // Unattached: count globally ).with(numbering: "I") // Use Roman numerals // Examples and remarks are not numbered #let example = thmplain("example", "Example").with(numbering: none) #let remark = thmplain( "remark", "Remark", inset: 0em ).with(numbering: none) // Proofs are attached to theorems, although they are not numbered #let proof = thmproof( "proof", "Proof", base: "theorem", ) #let solution = thmplain( "solution", "Solution", base: "exercise", inset: 0em, ).with(numbering: none) #let project(title: "", authors: (), url: "", body) = { set page(paper: "a4", numbering: "1", number-align: center) set document(author: authors, title: title) set text(font: "Linux Libertine", lang: "en") set heading(numbering: "1.1.") set par(justify: true) set list(marker: ([•], [--])) show heading: it => pad(bottom: 0.5em, it) show raw.where(block: true): it => pad(left: 4em, it) show link: it => underline(text(fill: blue, it)) align(center)[ #block(text(weight: 700, 1.75em, title)) ] pad( top: 0.5em, bottom: 2em, x: 2em, grid( columns: (1fr,) * calc.min(3, authors.len()), gutter: 1em, ..authors.map(author => align(center)[ #author \ #link(url) ]), ), ) outline(indent: true) v(2em) body } #show: project.with( title: "No.8", authors: ( "warab1moch1", ), url: "https://github.com/warab1moch1" ) = 伊藤の補題 No.7 で導入した確率積分により、次を得たことを思い出す。 #lemma[ #h(1mm)伊藤の補題 $ d f(X^1, dots.c , X^n) = sum_i (diff f) / (diff x_i) (X^1, dots.c , X^n) d X^i + 1 / 2 sum_i sum_j (diff f) / (diff x_i diff x_j) (X^1, dots.c , X^n) d X^i d X^j $ 上の微分形は、積分形を天下り的に表現したものである。即ち、 $ f(X_t^1, dots.c , X_t^n) &= f(X_0^1, dots.c , X_0^n)\ &quad + sum_i integral_0^t (diff f) / (diff x_i) (X_s^1, dots.c , X_s^n) d X_s^i\ &quad + 1 / 2 sum_i sum_j integral_0^t (diff f) / (diff x_i diff x_j) (X_s^1, dots.c , X_s^n) d angle.l X^i X^j angle.r $ が真の姿であることに注意する。 ] これより、伊藤の補題(公式)を実際に使用してみる。典型的な例としては、 1. $f(x) = x^n$ のとき $ f^prime (x) &= n x^(n-1)\ f^(prime prime)(x) &= n (n-1) x^(n-2) $ であるから、1変数の時を考えて $ d f(X_t) = f^prime (X_t) d X_t + 1/2 f^(prime prime) (X_t) d X_t d X_t $ $ d (X_t^n) = n X_t^(n-1) d X_t + n (n-1) X_t^(n-2) d X_t d X_t $ #example[\ $ f(x) = x^2$ で $X=W$ のとき(即ち $X$ は Brownian Motion) $ d(W_t^2) &= 2 W_t d W_t + 1/2 dot.op 2 dot.op 1 d W_t d W_t\ &= 2 W_t d W_t + 1 d t $ $ therefore d (W_t^2 - t) = 2 W_t d W_t $ これを積分して、 $ (W_t^2 - t) = (W_0^2 - 0) + integral_0^t 2 W_s d W_s $ $ therefore W_t^2 - t = 2 integral_0^t W_s d W_s $ ここで、左辺がマルチンゲールであることを以前確認したが、確かに右辺が確率積分となっていることから整合的である。 また、そのマルチンゲール性から2次変分の形がわかる。 ] 2. $f(x) = e^x$ のとき $ f^prime (x) = f^(prime prime) (x) = e^x #h(3mm) (= f (x)) $ であるから、 $ d (e^(X_t)) &= e^(X_t) d X_t + 1/2 e^X_t d X_t d X_t\ &= e^(X_t) (d X_t + 1/2 d X_t d X_t) $ 3. $f(x) = log x$ のとき $ f^prime (x) = 1 / x $ $ f^(prime prime) (x) = - 1 / x^2 $ であるから、 $ d(log X_t) = (d X_t) / X_t - (d X_t d X_t) / (2 X_t^2) $ 4. $f(x, y) = x y $ のとき $ f_x (x, y) = y quad f_y (x, y) = x $ $ f_(x x) (x, y) = 0 quad f_(y y) (x, y) = 0 $ $ f_(x y) (x, y) = 1 $ であるから、 $ d(X_t Y_t) &= Y_t d X_t + X_t d Y_t\ &quad + 1/2 (0 dot.op d X_t d X_t + 1 d X_t d Y_t + 1 d Y_t d X_t + 0 dot.op d Y_t d Y_t)\ &= Y_t d X_t + X_t d Y_t + d X_t + d Y_t $ 5. $f(x) = 1/x$ のとき $ f^prime (x) = - 1/ x^2 $ $ f^(prime prime) = 2/ x^3 $ であるから、 $ d(1/X_t) = - (d X_t) / X_t^2 + (d X_t d X_t) / X_t^3 $ = SDE : Stochastic Differencial Equation いま、次のような確率微分方程式 ( SDE ) の解を考える。 $ d X_t = mu (t, X_t) d t + sigma (t, X_t) d W_t quad #text()[( on $PP$ #h(1mm))] $ 即ち、 $(Omega, cal(F), PP, (cal(F)_t))$ : フィルトレーション付き確率空間 ( Filtrated Probability Space ) 、\ $W$ : $cal(F)_t$ - BM の下で#footnote[ このような設定からもわかるように、本当は $d W_t^PP$ と記述するべきである。 ] $ X_t - X_0 = integral_0^t mu (s, X_s) d s + integral_0^t sigma (s, X_s) d W_s $ が成立する $X$ を考える。 このとき、解には#v(1mm) -- (弱い)解 : $cal(F)_t$ - 適合な解#v(1mm) -- (強い)解 : $cal(F)_t^W$ - 適合な解、即ち $W$ が生成する $cal(F)$ に適合な解#v(1mm) の2種類が存在しており、 以下の Lipschitz 条件を満たすと強い解が一意的に存在することが知られている。#v(1mm) -- $(t, x)$ に関して $mu, sigma$ : 連続、かつ#v(0.5mm) $quad exists K : forall t, x, y quad &abs(mu(t, x) - mu(t, y)) <= K abs(x - y)\ &abs(sigma(t, x) - sigma(t, y)) <= K abs(x - y) $ == Black-Scholes 型 $ (d X_t) / X_t = mu_t d t + sigma_t d t $ であって、$X_0 in.small RR$ かつ $mu_t, sigma_t$ : 決定的、とする。 いま、$d(log X_t)$ を考えると $ d(log X_t) &= (d X_t) / X_t - (d X_t d X_t) / (2 X_t^2)\ &= (mu_t X_t d t + sigma_t X_t d W_t) / X_t - 1/2 (mu_t X_t d t + sigma_t X_t d W_t)^2 / X_t^2\ &= mu_t d t + sigma_t d W_t - 1/2 (mu_t d t + sigma_t d W_t)^2\ &= mu_t d t + sigma_t d W_t - 1/2 (sigma_t^2 d W_t d W_t)\ &= (mu_t - 1/2 sigma_t^2) d t + sigma_t d W_t $ であるから、 $ log X_t - log X_0 = integral_0^t (mu_s - 1/2 sigma_s^2) d s + integral_0^t sigma_s d W_s $ これより、 $ X_t &= e^(log X_0)#h(0.5mm) e^(integral_0^t (mu_s - 1/2 sigma_s^2) d s + integral_0^t sigma_s d W_s)\ &= X_0 #h(0.5mm)e^(integral_0^t (mu_s - 1/2 sigma_s^2) d s + integral_0^t sigma_s d W_s) $ 今後、株価のモデリングに使用することを踏まえ、この $X$(幾何ブラウン運動)の性質を簡単に評価する。 -- 平均 $ EE[X_t] &= X_0 EE[exp(underbracket(integral_0^t (mu_s - 1/2 sigma_s^2) d s, "定数") + integral_0^t underbracket(sigma_s, "決定的な関数") d W_s)]\ &quad #text(0.8em)[($because$ 伊藤の等長性から、第二項$tilde.op cal(N)(0, integral_0^t sigma_s^2 d s)$)]\ &= X_0 exp(integral_0^t (mu_s - 1/2 sigma_s^2) d s + 1/2 integral_0^t sigma_s^2 d s) quad #text(0.8em)[($because$ $EE[e^(cal(N)(mu, sigma^2))]=e^(mu + 1/2 sigma^2)$)]\ &= X_0 exp(integral_0^t mu_s d s) $ -- 分散 $ V[X_t] &= EE[X_t^2] - {EE[X]}^2\ &= EE[X_0^2 exp(underline(2 integral_0^t (mu_s - 1/2 sigma_s^2) d s + 2 integral_0^t sigma_s d W_s))]- X_0^2 exp(2integral_0^t mu_s d s)\ &quad #text(0.8em)[($because$ 上と同様に考え、下線部は正規分布)]\ &= X_0^2 exp(2 integral_0^t (mu_s - 1/2 sigma_s^2) d s + 1/2 dot.op 4 integral_0^t sigma_s^2 d s) - X_0^2 exp(2 integral_0^t mu_s d s)\ &= X_0^2 exp(2 integral_0^t mu_s d s){exp(integral_0^t sigma_s^2 d s) - 1} $ とわかる。 特に、パラメータが時間変動しない場合 $ X_t = X_0 e^((mu - sigma^2/2)t + sigma W_t) $ $ EE[X_t] = X_0 e^(mu t) $ $ V[X_t] = X_0 e^(2 mu t )(e^(sigma^2 t) - 1) $ となる。 == Ornstein-Uhlenbeck 型 $ d X_t = kappa_t (mu_t - X_t) d t + sigma_t d t $ であって、$X_0 in.small RR$ かつ $kappa_t, mu_t, sigma_t$ : 決定的、とする。 形態からわかるように、$kappa$ は平均回帰速度 ( mean reversion speed ) である。 いま、この形の $X_t$ を解くために次のような変形を考える。 まず、 $ Y_t = integral_0^t kappa_s d s $ とする。このとき、 $ d Y_t = kappa_t d t $ であるから、 $ d(e^(Y_t)) &= e^(Y_t) (d Y_t + 1/2 d Y_t d Y_t)\ &= e^(Y_t) (kappa_t d t + 0)\ &= e^(integral_0^t kappa_s d s) kappa_t d t $ これより、 $ d(e^(integral_0^t kappa_s d s) X_t) &= e^(integral_0^t kappa_s d s) kappa_t d t X_t + e^(integral_0^t kappa_s d s) d X_t + e^(integral_0^t kappa_s d s) kappa_t d t d X_t\ &= e^(integral_0^t kappa_s d s) {kappa_t d t X_t + kappa_t (mu_t - X_t) d t + sigma_t d W_t + 0}\ &= e^(integral_0^t kappa_s d s) (kappa_t mu_t d t + sigma_t d W_t) $ を得る。これを積分して、 $ e^(integral_0^t kappa_s d s) - 1 dot.op X_0 = integral_0^t kappa_s mu_s e^(integral_0^s kappa_u d u) d s + integral_0^t sigma_s e^(integral_0^s kappa_u d u) d W_s $ 整理して、 $ X_t = X_0 e^(-integral_0^t kappa_s d s) + integral_0^t kappa_s mu_s e^(-integral_s^t kappa_u d u) + integral_0^t sigma_s e^(-integral_s^t kappa_u d u) d W_s $ ここで、第二項までは定数、第三項はやはり正規分布となっていることに注意する。 == 1次元線形 SDE
https://github.com/dogeystamp/typst-templates
https://raw.githubusercontent.com/dogeystamp/typst-templates/master/legacy/chem.typ
typst
The Unlicense
// chemistry notes #import "../main.typ": gen_preamble, doc_template, lref // chemical state indicators (use these as subscripts) #let aq = [$("aq")$] #let liq = [$("l")$] #let gaz = [$("g")$] #let sol = [$("s")$] #let chem = (block: false, body) => { math.equation(block: block, math.upright(body)) } #let template( title: none, authors: none, suffix: none, prefix: none, body ) = { doc_template(title: title, { gen_preamble(title: title, authors: authors, suffix: suffix, prefix: prefix) body }) }
https://github.com/peteole/relai_poster_template
https://raw.githubusercontent.com/peteole/relai_poster_template/main/relai_poster_template.typ
typst
#import "@preview/cades:0.3.0": qr-code #let sponsored_by() = { grid( columns: (55mm,40mm,55mm), rows: (25mm), align( left, text(size: 9.4pt, "relAI is supported by the DAAD programme Konrad Zuse Schools of Excellence in Artificial Intelligence, sponsored by the Federal Ministry of Education and Research."), ), image("resources/bmbf.png", height: 2.5cm), image("resources/zuse_schools.png", height: 2.5cm), ) } #let qr_reference(url:"", label:"") = { let url_text = if label.len() > 0 { label } else { url } grid( columns: (30mm), align: center, gutter: 5mm, qr-code(url, width: 25mm), link(url, text(url_text, size: 9pt)), ) } #let X_PAGE_MARGIN = 59.4mm #let universities() = { grid( columns: (auto,auto), gutter: (10mm), rows: (25mm), image("resources/lmu-cropped.svg", height: 2.5cm), image("resources/tum-cropped.svg", height: 2.5cm), ) } #let poster( doc, title, flipped: false, // true for landscape, false for portrait n_columns: 3, authors: ( ("name": "<NAME>", "affiliation": "Musteruni", "email": "<EMAIL>"), ("name": "<NAME>", "affiliation": "Musteruni", "email": "<EMAIL>"), ("name": "<NAME>", "affiliation": "Musteruni", "email": "<EMAIL>"), ), references: ( ("url": "https://zuseschoolrelai.de", "label": "zuseschoolrelai.de"), ), font_size: 30pt, ) = { set text( font: ("Maven Pro", "Arial"), fallback: true, size: font_size, ) show heading.where( level: 1, ): it => block(width: 100%)[ #set text(font_size*5/3, weight: "regular") #it ] set page( paper: "a1", flipped: flipped, header: [ #grid( columns: (310mm,auto), rows: (150mm), align: (top + left,horizon + center), image("resources/relai_logo.png", height: 100%), [ #v(5mm) #title #grid( columns: range(authors.len()).map(i => 1fr), rows: (auto), gutter: 10mm, align: horizon + center, ..authors.map(author => [ #set text(top-edge: 0em, bottom-edge: 0em) #text(author.name, size: 20pt)\ #text(author.affiliation, size: 15pt)\ #text(author.email, size: 15pt) ]), ) ], ) ], footer: pad( left: X_PAGE_MARGIN, box( width: 100%, grid( columns: (1fr,auto,1fr), align: (left,center,right), universities(), grid( columns: references.len(), gutter: 5mm, ..references.map(r => qr_reference(url:r.url, label:r.label)) ), sponsored_by(), )), ), margin: (left: 0cm, top: 166.66mm, right: X_PAGE_MARGIN), ) pad(left: X_PAGE_MARGIN, columns(n_columns, gutter: 30mm, doc)) }
https://github.com/hugo-b-r/insa-template-typst
https://raw.githubusercontent.com/hugo-b-r/insa-template-typst/master/templates/long-report.typ
typst
#import "@preview/datify:0.1.2": day-name, month-name, custom-date-format #let project(title: "", authors: (), date: datetime.today(), body) = { // Set the document's basic properties. set document(author: authors, title: title) set page( paper: "a4", header: context { if counter(page).get().first() > 1 [ #set text(10pt) #grid( columns: (1fr, 1fr), align(left, image("../assets/insa_logo.png", width: 50%) ), align(right, [ #let subheading = query( selector(heading.where(level: 1)).before(here()) ) #if subheading.len() != 0 { subheading.last().body } ]), ) #pad(bottom: 2pt, box(width: 100%, height: 1pt, fill: black)) ] }, header-ascent: 10%, number-align: center, numbering: "1", margin: ( top: 2.5cm, bottom: 2cm, left: 2cm, right: 2cm, ), ) set text(lang: "fr", font: "Times New Roman") // Title row. align(center + horizon)[ #block(text(weight: 900, 21pt, title)) #emph(custom-date-format(date, "Day DD MMMM YYYY", "fr")) // Author information. #pad( top: 0.25cm, bottom: 0.5em, x: 2em, grid( columns: (1fr,) * calc.min(3, authors.len()), gutter: 1em, ..authors.map(author => align(center, author)), ), ) ] // Main body. set par(justify: true) set heading(numbering: "I.1.a)") pagebreak() set text(11pt) body }
https://github.com/7sDream/fonts-and-layout-zhCN
https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/02-concepts/dimension/height.typ
typst
Other
#import "/template/template.typ": web-page-template #import "/template/components.typ": note #import "/lib/glossary.typ": tr #show: web-page-template // ### Heights === 高度 // But first, let's think a little bit about the different measurements of height used in a glyph. Again, we're going to be assuming that we are designing for a horizontal writing system. 但现在让我们先看看#tr[glyph]中不同的高度值。我们仍然假设是在为水平方向的#tr[writing system]设计字体。 // The first height to think about is the *baseline*. We have mentioned this already, as the imaginary line on which the glyphs are assembled. In a sense, it's not really a height - in terms of a co-ordinate grid, this is the origin; the y co-ordinate is zero. This doesn't necessarily mean that the "black part" of the glyph starts at the baseline. Some glyphs, such as this plus sign, have the black parts floating above the baseline: 首先我们来看*#tr[baseline]*。这个概念我们之前提到过,它是一条用于整齐排列#tr[glyph]的虚拟的线。以坐标系的语境来看,它并没有高度,而是作为原点(X轴)存在,它的Y轴坐标为零。但这并不意味着#tr[glyph]的“黑色部分”需要从#tr[baseline]处开始。对于某些字形,比如加号(@figure:dim-5),它的黑色部分就是浮在#tr[baseline]之上的。 #figure(caption: [ 加号#tr[glyph]并不从#tr[baseline]开始。 ], placement: none)[#include "dim-5.typ"] <figure:dim-5> // In this case, the baseline is coordinate zero; the glyph begins 104 units above the baseline. But the plus sign needs to be placed above the baseline, and having a baseline as the origin tells us how far above it needs to be placed. 在本例中,基线作为坐标轴零点,#tr[glyph]从其上方 104 个单位处开始绘制。 // Within a font, you will often have various heights which need to "line up" to make the font look consistent. For example, in the Latin script, all capital letters are more or less lined up at the same height (modulo some optical correction) - this is called the "cap height". All of the ascenders and descenders will fall at the same position, as will the tops of the lower-case letters (this last height is called the "x-height"). As we have seen, these notional lines can be positioned anywhere in the em-square you like, as your design calls for it; and different designs, even within the same script, will have them at differing heights: we saw in our example above that Trajan has a very high x-height relative to its cap height, and a taller cap height in absolute terms than Noto Serif. The different design heights for a font are called their *vertical metrics*. Here are some vertical metrics for a typical Latin typeface, all given in font units: 除了基线之外,为了让整个版面观感更加一致,字体中还有其他几条需要对齐的线。例如,在拉丁字母中,所有大写字母的高度或多或少都是对齐的(在进行了一些视错觉矫正之后),这个高度被称为“#tr[cap height]”。所有的#tr[ascender]、#tr[decender]也都会分别落在相同的高度,而没有#tr[ascender]和#tr[decender]的小写字母们也有一个统一的高度,叫做“#tr[x-height]”。这些参考线可以按照你的设计需要,放置在#tr[em square]中的任何高度上。换句话说,即使是同一种#tr[script],在不同的设计中它们也可以具有不同的高度值。本书前文中就有一个这样的例子,Trajan字体的#tr[cap height]就比Noto Serif字体要高一些,而且它的#tr[x-height]相对于#tr[cap height]的占比也要更高一些。这些设计中的不同的高度叫做字体的“垂直#tr[metrics]”。@figure:latin-heights 是典型的拉丁文字体中会存在的垂直#tr[metrics],均使用单位长度描述。 #figure( caption: [字体中的垂直#tr[metrics]], placement: none, )[#include "latin-heights.typ"] <figure:latin-heights> // For some scripts, though, these concepts won't make any sense - Chinese, Japanese and Korean fonts, for instance, just have an em square. In other cases, glyphs aren't arranged according to their baselines in the way that Latin expects; particularly Indic scripts like Devanagari, arrange glyphs along other lines, the so-called "headline": 然而对于某些#tr[scripts]来说,这些概念一点意义也没有。比如中日韩文的字体就只有#tr[em square]。其他一些#tr[scripts]的#tr[glyph]可能根本不会像拉丁字母那样沿着#tr[baseline]整齐排列,特别是印度语系的#tr[scripts]。比如天城文会沿着“#tr[headline]”排列: #figure( caption: [天城文文本示例#footnote[译注:此例文为“#tr[typography]”的印地语。图中变音符号线原文为matra line,半音符号线原文为rakar line。]], placement: none )[#include "devanagari.typ"] <figure:devanagari> // For the purposes of font technology, this headline doesn't really exist. OpenType is based on the Latin model of arranging glyphs along the baseline, and so even in a script with a headline, the font needs to be designed with the baseline in mind, and you still have to declare nominal x-heights, ascender heights, descender heights and so on when you design the vertical metrics of your glyph. The Latin pull of digital typography is, unfortunately, really strong. 在数字字体技术的视角下,这个#tr[headline]并不存在。OpenType 是基于拉丁字母模型的,#tr[glyph]只能沿着#tr[baseline]排列。字体设计者必须按照#tr[baseline]的思维来思考,并且也需要为#tr[glyph]声明这些名义上的#tr[x-height]、#tr[ascender]高度、#tr[decender]高度等垂直#tr[metrics]值。非常不幸,拉丁模型对数字#tr[typography]技术的影响太大了。
https://github.com/thornoar/lambda-calculus-course
https://raw.githubusercontent.com/thornoar/lambda-calculus-course/master/main-lectures/exam-questions.typ
typst
#import "template.lib.typ": * #show: formatting #set page(background: image("pictures/troubles-faded.jpg", width: 100%, height: 100%, fit: "stretch")) #head([ Программа курса ]) + Определение множества л-выражений. Сокращённая нотация. Свободные и связанные переменные. Совместимость отношения с операциями. ал-конгруэнтность. + Корректные л-выражения. Если $M$ корректно, то $BV(M) union.sq FV(M) = TV(M)$. Всякое л-выражение ал-конгруэнтно корректному. Правило переменных. + Определение оператора подстановки. Оператор подстановки уважает ал-конгруэнтность. Лемма о подстановке. + Определение бэ-конверсии. Теорема о неподвижной точке. Оператор подстановки уважает конверсию. + Определение комбинатора. Стандартные комбинаторы. Комбинатор фиксированной точки. Терминология л-теории (равенства, замкнутость, согласованность, противоречивость, несовместимость). $#I$ несовместимо с $#K$. + Определение редукции (отношения $(->)$, $(->>)$, $(=)$ с вариантами (б-), (эт-), (бэ-)). Редексы. Нормальные формы. Редукционный путь. Нормальная форма ни к чему не редуцируется. Определение редукционного графа. Свойство Чёрча-Россера. + Теорема о минимальном элементе. $CR(rel) ==> CR(Trans(rel))$. + Оператор подстановки уважает "рефлексивную б-редукцию" $arr$ (лемма 1.6.2.). + $arr$ удовлетворяет свойству Чёрча-Россера. + $->_beta$ --- это транзитивное замыкание $arr$. Теорема Чёрча-Россера для $->>_beta$. Следствия. + Диаграммы бинарных отношений. Коммутирующие отношения. Лемма Хиндли-Росена. + Если для $rel1$, $rel2$ выполняется определённая диаграмма, то $Preord(rel1)$ и $Preord(rel2)$ коммутируют. + $->>_eta$ удовлетворяет свойству Чёрча-Россера. + $->>_beta$ и $->>_eta$ коммутируют. + Оператор подстановки уважает отношение $Refl(->_eta)$. Теорема Чёрча-Россера для $->>_(beta eta)$. Следствия. + Внешние/внутренние редексы/нормальные формы. Разбиение редукции на внешнюю и внутреннюю. + Стандартный редукционный путь. Для любой редукции $M ->> N$ существует стандартная редукция $M ->>_s N$. + Нормализующая редукционная стратегия. Определение крайней левой стратегии $F_l$. $F_l$ --- нормализующая. + Комбинаторы $#T$ и $#F$. Упорядоченные пары. Конечные кортежи (+проекции). Обобщённая теорема о неподвижной точке. + Числа Барендрегта (л-числа). Определение класса рекурсивных функций (суперпозиция, примитивная рекурсия, минимизация). л-представимость. + Все рекурсивные функции л-представимы. + Все л-представимые функции рекурсивны (эскиз доказательства). Кодирование, функция комбинации, функция нумерации. + Числа Чёрча. Функции перехода от чисел Барендрегта к числам Чёрча и обратно. Функция $phi : NN_0^p -> NN_0$ рекурсивна $<==>$ $phi$ л-представима с помощью чисел Чёрча. + л-выражения $#Ap$, $#Am$ и $#Ae$ л-представляют сложение, умножение и возведение в степень на числах Чёрча. + Числовые системы. Критерий адекватности числовой системы. + Рекурсивно сепарабельные и рекурсивные множества. Множества, замкнутые относительно конверсии. + Теорема Скотта-Карри о неразрешимости. Следствия.
https://github.com/darioglasl/Arbeiten-Vorlage-Typst
https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/main.typ
typst
// ---------------------------------------------------------------------------- // "THE BEER-WARE LICENSE" (Revision 42): // <<EMAIL>> wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. <NAME> // ---------------------------------------------------------------------------- #import "template.typ": * #show: project.with( title: "SA / BA Vorlage", bibliographyFilePath: "bibliography.yml", logoIndustrialPartner: "Images/Logos/placeholder-image-square.jpg", ostLogo: "Images/Logos/OST_Logo_DE_RGB_Schutz.svg", subtitle: "Die Typst Vorlage zu deiner Arbeit", university: "OST - Ostschweizer Fachhochschule", arbeit: "Studienarbeit", semester: "Herbstsemester 2023/24", authors: ( (name: "<NAME>", email: "<EMAIL>"), (name: "<NAME>", email: "<EMAIL>"), ), supervisors:( (name: "Prof. Dr. <NAME>", email: "<EMAIL>"), ), industrialPartners:( (name: "<NAME>", email: "<EMAIL>", company: "Duck Incl."), ), abstract: [#include "abstract.typ"], managementSummary: [#include "management_summary.typ"], date: datetime.today().display("[day].[month].[year]"), ) #counter(page).update(1) = Einleitung <headingIntroduction> #include "01_Einleitung/00_index.typ" #pagebreak() = Analyse <headingAnalysis> #include "02_Analyse/00_index.typ" #pagebreak() = Konzept <headingConcept> #include "03_Konzept/00_index.typ" #pagebreak() = Ausführung <headingExecution> #include "04_Ausfuehrung/00_index.typ" #pagebreak() = Qualitätssicherung <headingQualityAssurance> #include "05_Qualitätssicherung/00_index.typ" #pagebreak() = Ergebnisdiskussion mit Ausblick <headingResults> #include "06_Ergebnisse/00_index.typ"
https://github.com/xrarch/books
https://raw.githubusercontent.com/xrarch/books/main/xrcomputerbook/chapinter.typ
typst
#import "@preview/tablex:0.0.6": tablex, cellx, colspanx, rowspanx = Interrupt Architecture == Introduction Interrupts on the XR/computer platform are mediated between the devices and the processors by the Local Symmetric Interrupt Controller (LSIC), of which there is one for each processor in the system. The XR/17032 microprocessor contains only one IRQ line, which causes a trap to the operating system for interrupt handling when it is asserted. As there is no direct way to determine which device caused the interrupt, an external interrupt controller is required. == LSIC The LSIC has 64 interrupt inputs. They are assigned as follows on the XR/computer platform: #tablex( columns: (1fr, 6fr), cellx([ #set text(fill: white) #set align(center) *0x02* ], fill: rgb(0,0,0,255)), [Interval Timer], cellx([ #set text(fill: white) #set align(center) *0x03* ], fill: rgb(0,0,0,255)), [Disk Controller], cellx([ #set text(fill: white) #set align(center) *0x04* ], fill: rgb(0,0,0,255)), [Serial Port A], cellx([ #set text(fill: white) #set align(center) *0x05* ], fill: rgb(0,0,0,255)), [Serial Port B], cellx([ #set text(fill: white) #set align(center) *0x28-0x2E* ], fill: rgb(0,0,0,255)), [Expansion Boards], cellx([ #set text(fill: white) #set align(center) *0x30-0x33* ], fill: rgb(0,0,0,255)), [Amtsu Devices], ) Each LSIC has several 32-bit registers which control its behavior. The zeroth LSIC is located at 0xF8030000 in the physical address space, and successive LSICs are arranged at offsets of 32 bytes. In effect, there is an "array" of LSICs which is indexed by the corresponding processor's number (which can be found in the *WHAMI* control register on that processor, and is in the range of [0-3] on XR/computer systems). The LSIC registers' behavior on write and read is enumerated below: #box([ #tablex( columns: (1fr, 1fr, 6fr), cellx([ #set text(fill: white) #set align(center) *Name* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *Offset* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *Function on Write* ], fill: rgb(0,0,0,255)), [DISA0], [+0x00], [Set the disable bits for IRQ0-31.], [DISA1], [+0x04], [Set the disable bits for IRQ32-63.], [PEND0], [+0x08], [Atomically OR the written value into the pending bits for IRQ0-31. However, if the written value is zero, these pending bits are cleared.], [PEND1], [+0x0C], [Atomically OR the written value into the pending bits for IRQ32-63. However, if the written value is zero, these pending bits are cleared.], [COMPL], [+0x10], [Atomically clear the pending bit for the IRQ whose number is written into the register.], [IPL], [+0x14], [Set the current interrupt priority level. Must be of the range [0-63].], ) ]) #box([ #tablex( columns: (1fr, 1fr, 6fr), cellx([ #set text(fill: white) #set align(center) *Name* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *Offset* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *Return on Read* ], fill: rgb(0,0,0,255)), [DISA0], [+0x00], [The disable bits for IRQ0-31.], [DISA1], [+0x04], [The disable bits for IRQ32-63.], [PEND0], [+0x08], [The pending bits for IRQ0-31.], [PEND1], [+0x0C], [The pending bits for IRQ32-63.], [CLAIM], [+0x10], [The current lowest-numbered, unmasked, pending IRQ.], [IPL], [+0x14], [The current interrupt priority level.], ) ]) The state of the IRQ line is a function of the pending bits, as masked off by the disable bits. Therefore it is given by the following function: ``` IrqPending := (PEND0 & ~DISA0) != 0 OR (PEND1 & ~DISA1) != 0 ``` With the additional restriction that any interrupt with a number greater than or equal to the value of the *IPL* register is also masked off. Note that writing a value into the *PEND0* or *PEND1* register of another processor's LSIC can be used to trigger an inter-processor interrupt (IPI) of an arbitrary number, which is useful for tasks such as TB and Dcache shootdown. == Interrupts When a device raises an interrupt, it is latched into the corresponding *PEND* register of every LSIC in the system simultaneously. This means that the LSIC interrupts are level-triggered and must be explicitly dismissed by a write of the interrupt number to the *COMPL* register by all processors that took the interrupt. Note that the input of the device into the LSIC may be either edge-triggered or level-triggered. If it is level-triggered, then clearing the pending bit in the LSIC may have no effect as it will simply be latched again instantaneously if the device is still asserting its interrupt line. In this case, the device must therefore be serviced first in some device-specific manner in order to convince it to drop its interrupt line. == Interrupt Routing By "default", all LSICs receive all interrupts. If it is desired that particular interrupts are only serviced by particular processors in the system, then the disable bits for all processors' LSICs should be set such that none will take the interrupt except those which are desired. In this way, arbitrary interrupt routing can be accomplished.
https://github.com/mst2k/HSOS-PTP-Typst-Template
https://raw.githubusercontent.com/mst2k/HSOS-PTP-Typst-Template/main/README.md
markdown
# HSOS PTP Typst Template 🚀 Dieses Repository enthält ein [Typst](https://typst.app/) Template für Praxistransferprojekte (PTPe) an der Hochschule Osnabrück. Das Template dient als Grundlage für die Erstellung von PTP-Dokumenten. Die zentrale Datei [main.typ](main.typ) bildet das Herzstück des Templates, aus dem das finale PTP-Dokument generiert wird. Eine Beispiel-PDF, die aus diesem Template erzeugt wurde, ist in der Datei [main.pdf](main.pdf) zu finden. Für detailliertere Einblicke und praktische Anwendungsbeispiele empfiehlt es sich, direkt in das Template hineinzuschauen. ✅ Working on Typst 0.10.0
https://github.com/jomaway/typst-teacher-templates
https://raw.githubusercontent.com/jomaway/typst-teacher-templates/main/ttt-utils/lib/grading.typ
typst
MIT License
#import "assignments.typ": get-questions, _question_counter /// Fetch the total points which can be reached from the questions metadata /// ! needs context. /// /// -> integer #let total-points() = get-questions().map(q => q.points).sum(default: 0) /// Sums up all question points, grouped by assignments. /// ! needs context. /// /// -> array #let get_points() = { let a_count = _question_counter.final().first() let list = () for i in range(a_count) { let filter = q => (q.points != none and q.num.first() == i+1) list.push( get-questions(filter: filter).map(q => q.points ).sum(default: 0) ) } return list } /// Generate a grading scale with upper and lower point limits. /// /// - step (integer): smallest unit of a point. 0.5 for half points and 1 for full points. /// - max (integer): total points which can be reached. /// ..args (float, integer, string, content): excepts conditional arguments with a lower bound followed by the grade. See @@ihk-scale as example. /// -> array #let gen-scale(step: 1, max: none, ..args) = { assert(args.named().len() == 0) assert(step in (0.5,1), message: "only steps of [0.5] or [1] is supported.") let args = args.pos() assert(calc.odd(args.len())) range(0, args.len(), step: 2).map((i) => ( grade: args.at(i), lower-limit: if i > 0 { calc.round(args.at(i - 1)) } else { 0 }, upper-limit: if i < args.len() - 1 { calc.round(args.at(i + 1)) - step } else { max }, )) } /// validates if the given array is a valid grading scale #let validate-scale(scale) = { if type(scale) == array { let error = false for entry in scale { if type(entry) == dictionary { if entry.keys().sorted() != ("grade", "lower-limit", "upper-limit") { error = true } } else { error = true } } return not error } return false } /// Generate the german IHK grading scale for a total amount of points. /// /// - total (integer): total points which can be reached /// - step (float, integer): smallest unit of a point. 0.5 for half points and 1 for full points. /// - offset (integer): amount of points which the grade scale is shiffted down. /// -> array #let ihk-scale(total, step: 1, offset: 0) = gen-scale( max: total, step: step, 6, 0.3 * total - offset, 5, 0.5 * total - offset, 4, 0.67 * total - offset, 3, 0.81 * total - offset, 2, 0.91 * total - offset, 1, ) /// Fetch a grade for a certain amount of points /// /// - points (integer, float): the points a student reached. /// - scale (array): The array returned from the @@gen-scale function. /// -> (any) The grade if found, or none if not found. Type of grade depending on the value inside the scale dictionary.at("grade") #let points-to-grade(points, scale) = { if validate-scale(scale) { let result = scale.find(g => g.lower-limit <= points and g.upper-limit >= points) if result != none { result.grade } } } /// calculates the grade average for an given grade distribution /// currently the grades need to be int-values, like in germany. /// /// - dist (dictionary): The grade distribution as dict. e.x. ("1":0,"2":0,"3":0,"4":0,"5":0,"6":0) /// - digits: (integer): Number of digits which the result is rounded to. Default: 2 /// -> (float): The rounded grade average. #let grade-average(dist, digits: 2) = { assert.eq(type(dist), dictionary, message: "Expected dist to be of type dictionary, found " + type(dist)) let sum = dist.pairs().fold(0, (sum,(k,v)) => { sum = sum + int(k) * v sum }) if dist.values().sum() != 0 { calc.round(sum / dist.values().sum(), digits: digits) } else { 0 } }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-102E0.typ
typst
Apache License 2.0
#let data = ( ("COPTIC EPACT THOUSANDS MARK", "Mn", 220), ("COPTIC EPACT DIGIT ONE", "No", 0), ("COPTIC EPACT DIGIT TWO", "No", 0), ("COPTIC EPACT DIGIT THREE", "No", 0), ("COPTIC EPACT DIGIT FOUR", "No", 0), ("COPTIC EPACT DIGIT FIVE", "No", 0), ("COPTIC EPACT DIGIT SIX", "No", 0), ("COPTIC EPACT DIGIT SEVEN", "No", 0), ("COPTIC EPACT DIGIT EIGHT", "No", 0), ("COPTIC EPACT DIGIT NINE", "No", 0), ("COPTIC EPACT NUMBER TEN", "No", 0), ("COPTIC EPACT NUMBER TWENTY", "No", 0), ("COPTIC EPACT NUMBER THIRTY", "No", 0), ("COPTIC EPACT NUMBER FORTY", "No", 0), ("COPTIC EPACT NUMBER FIFTY", "No", 0), ("COPTIC EPACT NUMBER SIXTY", "No", 0), ("COPTIC EPACT NUMBER SEVENTY", "No", 0), ("COPTIC EPACT NUMBER EIGHTY", "No", 0), ("COPTIC EPACT NUMBER NINETY", "No", 0), ("COPTIC EPACT NUMBER ONE HUNDRED", "No", 0), ("COPTIC EPACT NUMBER TWO HUNDRED", "No", 0), ("COPTIC EPACT NUMBER THREE HUNDRED", "No", 0), ("COPTIC EPACT NUMBER FOUR HUNDRED", "No", 0), ("COPTIC EPACT NUMBER FIVE HUNDRED", "No", 0), ("COPTIC EPACT NUMBER SIX HUNDRED", "No", 0), ("COPTIC EPACT NUMBER SEVEN HUNDRED", "No", 0), ("COPTIC EPACT NUMBER EIGHT HUNDRED", "No", 0), ("COPTIC EPACT NUMBER NINE HUNDRED", "No", 0), )