[ { "repo": "https://github.com/iceghost/resume", "file": "https://raw.githubusercontent.com/iceghost/resume/main/5-projects/4-monoticity.typ", "language": "typst", "license": "", "content": "=== Monotonicity Table Maker\n\n#place(right + top)[Sep 2020]\n\n/ Links: #link(\"https://iceghost.github.io/ve-bbt\")[Demo]\n #sym.dot.c #link(\"https://github.com/iceghost/ve-bbt\")[Source].\n\nThis tool parses simple monotonicity table construction language and\ngenerates MathJax/LaTeX code. This saves a lot of time spent making those\ntables by hand.\n\n_Result_: My underclassmen and friends used and liked it.\n\nThis project was my first _usable_ software product. I learned functional\nprogramming and its principles, such as pure functions and side effects. This\nproject helped me improve my programming skills and mindset.\n" }, { "repo": "https://github.com/lkndl/typst-bioinfo-thesis", "file": "https://raw.githubusercontent.com/lkndl/typst-bioinfo-thesis/main/README.md", "language": "markdown", "license": "", "content": "# typst-bioinfo-thesis\nThis is a [typst](https://typst.app/) thesis template with front matter for TUM+LMU [bioinformatics](https://www.cit.tum.de/cit/studium/studiengaenge/master-bioinformatik/abschlussarbeit/#c2494) and TUM [informatics](https://www.cit.tum.de/cit/studium/studierende/abschlussarbeit-abschluss/informatik/#c4295). Therefore, it generally supports English and German as main document languages. It comes with ready-to-use outlines, configurable page numbers adapting to front and back matter, as well as flexible headers that can imitate `scrbook`. I also implemented `sidecap` and a basic `wrapfig` equivalent. \n\nAlthough totally workable, this template is somewhat under development - just as Typst is. If you find a bug, please feel free to open an issue!\n\nTo get started, edit `main.typ` or make a new minimal `thesis.typ`:\n```rs\n#import \"modules/template.typ\": *\n\n#show: doc.with(\n title: [all beginnings are hard], \n name: [silly old me])\n\n= introduction\n...\n```\n\n---\n\nThe TUM informatics and bioinformatics cover pages:\n![tum cover pages](images/screen_00.png)\n\nTable of contents with numbering up to level 2 headings, well-aligned fill characters and roman page numbers for the appendix: \n\n![a dummy table of contents](images/screen_01.png)\n\n![overkill header and wrap figure](images/screen_03.png \"an overkill left-hand page header and a wrapfig\")\n\n\n![example header and caption](images/screen_02.png \"right-hand page header with section info\")\n\n\nDefining a figure title for the list-of-figures is now less hacky:\n```rs\n#figure(\n image(\"/images/dingos.jpg\", width: 100%),\n caption: flex-caption(\n [Another example full-width image], \n [. Consumers are generally unaware that ...]),\n) \n``````\n\n![list of figures](images/screen_04.png)" }, { "repo": "https://github.com/smorad/um_cisc_7026", "file": "https://raw.githubusercontent.com/smorad/um_cisc_7026/main/lecture_3_neural_networks.typ", "language": "typst", "license": "", "content": "#import \"@preview/polylux:0.3.1\": *\n#import themes.university: *\n#import \"@preview/cetz:0.2.2\": canvas, draw, plot\n#import \"common.typ\": *\n\n\n// TODO: Missing x^2 term when we show polynomial+multivariate example (not 2^3, should be 3^2 + 1)\n\n#set math.vec(delim: \"[\")\n#set math.mat(delim: \"[\")\n\n#let la = $angle.l$\n#let ra = $angle.r$\n#let redm(x) = {\n text(fill: color.red, $#x$)\n}\n\n\n// TODO: Deeper neural networks are more efficient\n// FUTURE TODO: Label design matrix as X bar instead of X_D in linear regression lectures\n// FUTURE TODO: Should not waste m/n in linear regression, use c for count and d_x, d_y\n// TODO: Fix nn image indices\n// TODO: Implement XOR is transposed\n// TODO: is xor network actually wide?\n// TODO: Handle subscripts for input dim rather than sample\n// TODO: Emphasize importance of very deep/wide nn\n\n#let argmin_plot = canvas(length: 1cm, {\n plot.plot(size: (8, 4),\n x-tick-step: 1,\n y-tick-step: 2,\n {\n plot.add(\n domain: (-2, 2), \n x => calc.pow(1 + x, 2),\n label: $ (x + 1)^2 $\n )\n })\n})\n\n#show: university-theme.with(\n aspect-ratio: \"16-9\",\n short-title: \"CISC 7026: Introduction to Deep Learning\",\n short-author: \"\",\n short-date: \"Lecture 1: Introduction\"\n)\n\n#title-slide(\n title: [Neural Networks],\n subtitle: \"CISC 7026: Introduction to Deep Learning\",\n institution-name: \"University of Macau\",\n //logo: image(\"logo.jpg\", width: 25%)\n)\n\n#slide(title: [Notation Change])[\n *Notation change:* Previously $x_i, y_i$ referred to data $i$ #pause\n\n Moving forward, I will differentiate between *data* indices $x_[i]$ and other indices $x_i$ #pause\n\n $ bold(X)_D = vec(bold(x)_[1], dots.v, bold(x)_[n]) = mat(x_([1], 1), x_([1], 2), dots; dots.v, dots.v, dots.v; x_([n], 1), x_([n], 2), dots) $ #pause\n\n\n $ bold(x) = vec(x_1, x_2, dots.v), quad bold(X) = mat(x_(1,1), dots, x_(1, n); dots.v, dots.down, dots.v; x_(m, 1), dots, x_(m, n)) $ \n]\n\n#let agenda(index: none) = {\n let ag = (\n [Review],\n [Multivariate linear regression],\n [Limitations of linear regression],\n [History of neural networks],\n [Biological neurons],\n [Artificial neurons],\n [Wide neural networks],\n [Deep neural networks],\n [Practical considerations]\n )\n for i in range(ag.len()){\n if index == i {\n enum.item(i + 1)[#text(weight: \"bold\", ag.at(i))]\n } else {\n enum.item(i + 1)[#ag.at(i)]\n }\n }\n}\n\n#slide(title: [Agenda])[#agenda(index: none)]\n\n#slide(title: [Agenda])[#agenda(index: 0)]\n\n#slide(title: [Review])[\n Since you are very educated, we focused on how education affects life expectancy #pause\n\n Studies show a causal effect of education on health #pause\n - _The causal effects of education on health outcomes in the UK Biobank._ Davies et al. _Nature Human Behaviour_. #pause\n - By staying in school, you are likely to live longer #pause\n - Being rich also helps, but education alone has a *causal* relationship with life expectancy\n]\n\n#slide(title: [Review])[\n *Task:* Given your education, predict your life expectancy #pause\n\n $X in bb(R)_+:$ Years in school #pause\n \n $Y in bb(R)_+:$ Age of death #pause\n\n $Theta in bb(R)^2:$ Parameters #pause \n\n $ f: X times Theta |-> Y $ #pause\n\n\n *Approach:* Learn the parameters $theta$ such that \n\n $ f(x, theta) = y; quad x in X, y in Y $\n]\n\n#slide(title: [Review])[\n Started with a linear function $f$ #pause\n\n #align(center, grid(\n columns: 2,\n align: center,\n column-gutter: 2em,\n $ f(x, bold(theta)) = f(x, vec(theta_1, theta_0)) = theta_1 x + theta_0 $,\n cimage(\"figures/lecture_2/example_regression_graph.png\", height: 50%)\n )) #pause\n \n Then, we derived the square error function #pause\n\n $ \"error\"(f(x, bold(theta)), y) = (f(x, bold(theta)) - y)^2 $\n]\n\n#slide(title: [Review])[\n We wrote the loss function for a single datapoint $x_[i], y_[i]$ using the square error\n\n $ cal(L)(x_[i], y_[i], bold(theta)) = \"error\"(f(x_[i], bold(theta)), y_[i]) = (f(x_[i], bold(theta)) - y_[i])^2 $ #pause\n\n But we wanted to learn a model over *all* the data, not a single datapoint #pause\n\n We wanted to make *new* predictions, to *generalize* #pause\n\n $ bold(x) = mat(x_[1], x_[2], dots, x_[n])^top, bold(y) = mat(y_[1], y_[2], dots, y_[n])^top $ #pause\n\n $ \n cal(L)(bold(x), bold(y), bold(theta)) = sum_(i=1)^n \"error\"(f(x_[i], bold(theta)), y_[i]) = sum_(i=1)^n (f(x_[i], bold(theta)) - y_[i])^2 \n $\n]\n\n#slide(title: [Review])[\n Our objective was to find the parameters that minimized the loss function over the dataset #pause\n\n We introduced the $argmin$ operator #pause\n\n #side-by-side[ $f(x) = (x + 1)^2$][#argmin_plot] #pause\n\n $ argmin_x f(x) = -1 $\n]\n\n#slide(title: [Review])[\n With the $argmin$ operator, we formally wrote our optimization objective #pause\n\n $ \n #text(fill: color.red)[$argmin_bold(theta)$] cal(L)(bold(x), bold(y), bold(theta)) &= #text(fill: color.red)[$argmin_bold(theta)$] sum_(i=1)^n \"error\"(f(x_[i], bold(theta)), y_[i]) \\ &= #text(fill: color.red)[$argmin_bold(theta)$] sum_(i=1)^n (f(x_[i], bold(theta)) - y_[i])^2 \n $ \n]\n\n#slide(title: [Review])[\n We defined the design matrix $bold(X)_D$ #pause\n\n $ bold(X)_D = mat(bold(x), bold(1)) = mat(x_[1], 1; x_[2], 1; dots.v, dots.v; x_[n], 1) $ #pause\n\n We use the design matrix to find an *analytical* solution to the optimization objective #pause\n \n$ bold(theta) = (bold(X)_D^top bold(X)_D )^(-1) bold(X)_D^top bold(y) $ \n]\n\n#slide(title: [Review])[\n With this analytical solution, we were able to learn a linear model #pause\n\n #cimage(\"figures/lecture_2/linear_regression.png\", height: 60%)\n]\n\n#slide(title: [Review])[\n Then, we used a trick to extend linear regression to nonlinear models #pause\n\n $ bold(X)_D = mat(x_[1], 1; x_[2], 1; dots.v, dots.v; x_[n], 1) => bold(X)_D = mat(log(1 + x_[1]), 1; log(1 + x_[2]), 1; dots.v, dots.v; log(1 + x_[n]), 1) $\n]\n\n#slide(title: [Review])[\n We extended to polynomials, which are *universal function approximators* #pause\n\n $ bold(X)_D = mat(x_[1], 1; x_[2], 1; dots.v, dots.v; x_[n], 1) => bold(X)_D = mat(\n x_[1]^m, x_[1]^(m-1), dots, x_[1], 1; \n x_[2]^m, x_[2]^(m-1), dots, x_[2], 1; \n dots.v, dots.v, dots.down; \n x_[n]^m, x_[n]^(m-1), dots, x_[n], 1\n ) $ #pause\n\n $ f: X times Theta |-> bb(R) $ #pause\n\n $ Theta in bb(R)^2 => Theta in bb(R)^(m+1) $ \n]\n\n#slide(title: [Review])[\n Finally, we discussed overfitting #pause\n\n $ f(x, bold(theta)) = theta_m x^m + theta_(m - 1) x^(m - 1), dots, theta_1 x^1 + theta_0 $ #pause\n\n #grid(\n columns: 3,\n row-gutter: 1em,\n image(\"figures/lecture_2/polynomial_regression_n2.png\"),\n image(\"figures/lecture_2/polynomial_regression_n3.png\"),\n image(\"figures/lecture_2/polynomial_regression_n5.png\"),\n $ m = 2 $,\n $ m = 3 $,\n $ m = 5 $\n )\n]\n\n#slide(title: [Review])[\n We care about *generalization* in machine learning #pause\n\n So we should always split our dataset into a training dataset and a testing dataset #pause\n\n #cimage(\"figures/lecture_2/train_test_regression.png\", height: 60%)\n]\n\n// 16:00 fast\n#slide[#agenda(index: 0)]\n#slide[#agenda(index: 1)]\n\n#slide[\n Last time, we assumed a single-input system #pause\n\n Years of education: $X in bb(R)$ #pause\n\n But sometimes we want to consider multiple input dimensions #pause\n\n Years of education, BMI, GDP: $X in bb(R)^3$ #pause\n\n We can solve these problems using linear regression too\n]\n\n#slide[\n For multivariate problems, we will define the input dimension as $d_x$ #pause\n\n $ bold(x) in X; quad X in bb(R)^(d_x) $ #pause\n\n We will write the vectors as\n\n $ bold(x)_[i] = vec(\n x_([i], 1),\n x_([i], 2),\n dots.v,\n x_([i], d_x)\n ) $ #pause\n\n $x_([i], 1)$ refers to the first dimension of training data $i$\n]\n\n#slide[\n The design matrix for a *multivariate* linear system is\n\n $ bold(X)_D = mat(\n x_([1], d_x), x_([1], d_x - 1), dots, x_([1], 1), 1; \n x_([2], d_x), x_([2], d_x - 1), dots, x_([2], 1), 1; \n dots.v, dots.v, dots.down, dots.v; \n x_([n], d_x), x_([n], d_x - 1), dots, x_([n], 1), 1\n ) $ #pause\n\n Remember $x_([n], d_x)$ refers to dimension $d_x$ of training data $n$ #pause\n\n The solution is the same as before\n\n $ bold(theta) = (bold(X)_D^top bold(X)_D )^(-1) bold(X)_D^top bold(y) $ \n]\n\n// 22:00 fast\n\n#slide(title: [Agenda])[\n #agenda(index: 1)\n]\n#slide(title: [Agenda])[\n #agenda(index: 2)\n]\n\n#slide(title: [Limitations of Linear Regression])[\n Linear models are useful for certain problems #pause\n + Analytical solution #pause\n + Low data requirement #pause\n\n Issues arise with other problems #pause\n + Poor scalability #pause\n + Polynomials do not generalize well\n]\n\n#slide(title: [Limitations of Linear Regression])[\n Issues arise with other problems\n + *Poor scalability* \n + Polynomials do not generalize well\n]\n\n#slide(title: [Limitations of Linear Regression])[\n So far, we have seen: #pause\n\n #side-by-side[\n One-dimensional polynomial functions\n $ bold(X)_D = mat(\n x_[1]^m, x_[1]^(m-1), dots, x_[1], 1; \n x_[2]^m, x_[2]^(m-1), dots, x_[2], 1; \n dots.v, dots.v, dots.down; \n x_[n]^m, x_[n]^(m-1), dots, x_[n], 1\n ) $ #pause][\n Multi-dimensional linear functions\n $ bold(X)_D = mat(\n x_([1], d_x), x_([1], d_x - 1), dots, 1; \n x_([2], d_x), x_([2], d_x - 1), dots, 1; \n dots.v, dots.v, dots.down, dots.v; \n x_([n], d_x), x_([n], d_x - 1), dots, 1\n ) $ #pause\n ]\n\n Combine them to create multi-dimensional polynomial functions #pause\n]\n\n#slide(title: [Limitations of Linear Regression])[\n Let us do an example #pause\n\n #side-by-side[*Task:* predict how many #text(fill: color.red)[#sym.suit.heart] a photo gets on social media][#cimage(\"figures/lecture_1/dog.png\", height: 30%)] #pause\n\n $ f: X times Theta |-> Y; quad X: \"Image\", quad Y: \"Number of \" #redm[$#sym.suit.heart$] $ #pause\n\n $ X in bb(Z)_+^(256 times 256) = bb(Z)_+^(65536); quad Y in bb(Z)_+ $ #pause\n\n Highly nonlinear task, use a polynomial with order $m=20$ \n]\n\n#slide(title: [Limitations of Linear Regression])[\n $ bold(X)_D = mat(bold(x)_(D, [1]), dots, bold(x)_(D, [n]))^top $ #pause\n\n $ &bold(x)_(D, [i]) = \\ &mat(\n underbrace(x_([i], d_x)^m x_([i], d_x - 1)^m dots x_([i], 1)^m, (d_x => 1, x^m)),\n underbrace(x_([i], d_x)^m x_([i], d_x - 1)^m dots x_([i], 2)^m, (d_x => 2, x^m)),\n dots,\n underbrace(x_([i], d_x)^(m-1) x_([i], d_x - 1)^(m-1) dots x_([i], 1)^m, (d_x => 1, x^(m-1))),\n dots,\n )\n $\n\n\n *Question:* How many columns in this matrix? #pause\n\n *Hint:* $d_x = 2, m = 3$: $x^3 + y^3 + x^2 y + y^2 x + x y + x + y + 1$ #pause\n\n *Answer:* $(d_x)^m = 65536^20 + 1 approx 10^96$\n]\n\n#slide(title: [Limitations of Linear Regression])[\n How big is $10^96$? #pause\n\n *Question:* How many atoms are there in the universe? #pause\n\n *Answer:* $10^82$ #pause\n\n There is not enough matter in the universe to represent one row #pause\n\n #side-by-side[We cannot predict how many #text(fill: color.red)[#sym.suit.heart] the picture will get][#cimage(\"figures/lecture_1/dog.png\", height: 30%)] #pause\n\n Polynomial regression does not scale to large inputs\n]\n\n#slide(title: [Limitations of Linear Regression])[\n Issues arise with other problems\n + *Poor scalability* \n + Polynomials do not generalize well\n]\n\n#slide(title: [Limitations of Linear Regression])[\n Issues arise with other problems\n + Poor scalability\n + *Polynomials do not generalize well*\n]\n\n#slide(title: [Limitations of Linear Regression])[\n What happens to polynomials outside of the support (dataset)? #pause\n\n Take the limit of polynomials to see their behavior #pause\n\n #side-by-side[$ lim_(x -> oo) theta_m x^m + theta_(m-1) x^(m-1) + dots $][Equation of a polynomial] #pause\n\n #side-by-side[$ lim_(x -> oo) x^m (theta_m + theta_(m-1) / x + dots) $][Factor out $x^m$] #pause\n\n #side-by-side[$ lim_(x -> oo) x^m dot lim_(x-> oo) (theta_m + theta_(m-1) / x + dots) $][Split the limit (limit of products)] \n]\n\n#slide(title: [Limitations of Linear Regression])[\n #side-by-side[$ lim_(x -> oo) x^m dot lim_(x-> oo) (theta_m + theta_(m-1) / x + dots) $][Split the limit (limit of products)]\n \n #side-by-side[$ (lim_(x -> oo) x^m) dot (theta_m + 0 + dots) $][Evaluate right limit] #pause\n\n #side-by-side[$ theta_m lim_(x -> oo) x^m $][Rewrite] #pause\n\n #side-by-side[$ theta_m lim_(x -> oo) x^m = oo $][If $theta_m > 0$] #pause\n\n #side-by-side[$ theta_m lim_(x -> oo) x^m = -oo $][If $theta_m < 0$]\n]\n\n#slide(title: [Limitations of Linear Regression])[\n Polynomials quickly tend towards $-oo, oo$ outside of the support #pause\n\n $ f(x) = x^3-2x^2-x+2 $ #pause\n\n #cimage(\"figures/lecture_3/polynomial_generalize.png\", height: 50%) #pause\n\n Remember, to predict new data we want our functions to generalize\n]\n\n#slide(title: [Limitations of Linear Regression])[\n Linear regression has issues #pause\n + Poor scalability #pause\n + Polynomials do not generalize well\n]\n\n// 38:00 fast\n\n#slide(title: [Limitations of Linear Regression])[\n We can use neural networks as an alternative to linear regression #pause\n\n Neural network benefits: #pause\n + Scale to large inputs #pause\n + Slightly better generalization #pause\n\n Drawbacks: #pause\n + No analytical solution #pause\n + High data requirement \n\n\n\n //#cimage(\"figures/lecture_1/timeline.svg\", height: 50%) \n]\n// 40:00 fast\n#slide(title: [Agenda])[#agenda(index: 2)]\n#slide(title: [Agenda])[#agenda(index: 3)]\n\n\n#slide(title: [History of Neural Networks])[\n In 1939-1945, there was a World War #pause\n\n Militaries invested funding for research, and invented the computer #pause\n\n #cimage(\"figures/lecture_3/turing.jpg\", height: 70%)\n]\n\n#slide(title: [History of Neural Networks])[\n #side-by-side[Meanwhile, a neuroscientist and mathematician (McCullough and Pitts) were trying to understand the human brain][#cimage(\"figures/lecture_3/mccullough-pitts.png\", height: 70%)] #pause\n\n They designed the theory for the first neural network\n]\n\n#slide(title: [History of Neural Networks])[\n Rosenblatt implemented this neural network theory on a computer a few years later #pause\n #side-by-side[\n At the time, computers were very slow and expensive\n][#cimage(\"figures/lecture_3/original_nn.jpg\", height: 70%)] \n]\n\n#slide(title: [History of Neural Networks])[\n Through advances in theory and hardware, neural networks became slightly better #pause\n\n #cimage(\"figures/lecture_1/timeline.svg\", height: 40%) #pause\n\n Around 2012, these improvements culminated in neural networks that perform like humans\n]\n\n\n#slide(title: [History of Neural Networks])[\n So what is a neural network? #pause\n\n It is a function, inspired by how the brain works #pause\n\n $ f: X times Theta |-> Y $ \n\n]\n\n#slide(title: [History of Neural Networks])[\n Brains and neural networks rely on *neurons* #pause\n\n *Brain:* Biological neurons $->$ Biological neural network #pause\n\n *Computer:* Artificial neurons $->$ Artificial neural network #pause\n\n First, let us review biological neurons #pause\n\n *Note:* I am not a neuroscientist! I may make simplifications or errors with biology\n]\n\n#slide(title: [Agenda])[#agenda(index: 3)]\n#slide(title: [Agenda])[#agenda(index: 4)]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n A simplified neuron consists of many parts \n]\n\n// 47:00 fast\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n Neurons send messages based on messages received from other neurons\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n Incoming electrical signals travel along dendrites\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n Electrical charges collect in the Soma (cell body)\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n The axon outputs an electrical signal to other neurons\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n The axon terminals will connect to dendrites of other neurons through a synapse\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/synapse.png\", height: 60%)\n The synapse converts electrical signal, to chemical signal, back to electrical signal #pause\n\n Synaptic weight determines how well a signal crosses the gap\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n For our purposes, we can model the axon terminals, dendrites, and synapses to be one thing\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n The neuron takes many inputs, and produces a single output\n]\n\n#slide(title: [Biological Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\") \n The neuron will only output a signal down the axon (\"fire\") at certain times\n]\n\n#slide(title: [Biological Neurons])[\n How does a neuron decide to send an impulse (\"fire\")? #pause\n\n #side-by-side[Incoming impulses (via dendrites) change the electric potential of the neuron][ #cimage(\"figures/lecture_3/bio_neuron_activation.png\", height: 50%)] #pause\n\n In a parallel circuit, we can sum voltages together #pause\n\n Many active dendrites will add together and trigger an impulse\n \n]\n\n#slide(title: [Biological Neurons])[\n #side-by-side[Pain triggers initial nerve impulse, starts a chain reaction into the brain][#cimage(\"figures/lecture_3/nervous-system.jpg\")]\n]\n\n#slide(title: [Biological Neurons])[\n #side-by-side[When the signal reaches the brain, we will think][#cimage(\"figures/lecture_3/nervous-system.jpg\")]\n]\n\n#slide(title: [Biological Neurons])[\n #side-by-side[After thinking, we will take action][#cimage(\"figures/lecture_3/nervous-system.jpg\")]\n]\n\n// 57:00\n\n#slide(title: [Agenda])[#agenda(index: 4)]\n#slide(title: [Agenda])[#agenda(index: 5)]\n\n#slide(title: [Artificial Neurons])[\n #cimage(\"figures/lecture_3/neuron_anatomy.jpg\", height: 50%) #pause\n\n *Question:* How could we write a neuron as a function? $quad f: \"___\" |-> \"___\"$ #pause\n\n *Answer*:\n\n $ f: underbrace(bb(R)^(d_x), \"Dendrite voltages\") times underbrace(bb(R)^(d_x), \"Synaptic weight\") |-> underbrace(bb(R), \"Axon voltage\") $\n]\n\n#slide(title: [Artificial Neurons])[\n Let us implement an artifical neuron as a function #pause\n\n #side-by-side[#cimage(\"figures/lecture_3/neuron_anatomy.jpg\")][\n #only((2,3))[\n Neuron has a structure of dendrites with synaptic weights\n\n ]\n #only(3)[\n $ f(\n #redm[$vec(theta_1, theta_2, dots.v, theta_(d_x))$])\n $\n\n $ f(#redm[$bold(theta)$]) $\n\n ]\n #only((4,5))[\n Each incoming dendrite has some voltage potential\n ]\n\n #only(5)[\n $ f(#redm[$vec(x_(1), dots.v, x_(d_x))$], vec(theta_(1), dots.v, theta_(d_x)) ) $ \n \n $ f(#redm[$bold(x)$], bold(theta)) $\n ]\n\n #only((6, 7))[\n Voltage potentials sum together to give us the voltage in the cell body\n\n ]\n\n #only(7)[\n $ f(vec(x_(1), dots.v, x_(d_x)), vec(theta_(1), dots.v, theta_(d_x)) ) = #redm[$sum_(j=1)^(d_x) theta_j x_(j)$] $\n\n $ f(bold(x), bold(theta)) = #redm[$bold(theta)^top bold(x)$] $\n ]\n\n #only((8, 9, 10))[\n The axon fires only if the voltage is over a threshold\n ]\n #only((9, 10))[\n \n $ sigma(x)= H(x) = #image(\"figures/lecture_3/heaviside.png\", height: 30%) $\n ]\n #only(10)[\n $ f(vec(x_(1), dots.v, x_(n)), vec(theta_(1), dots.v, theta_(n)) ) = #redm[$sigma$] (sum_(j=1)^(d_x) theta_j x_(j) ) $\n ]\n ]\n]\n// 1:05\n\n#slide(title: [Artificial Neurons])[\n #side-by-side[Maybe we want to vary the activation threshold][#cimage(\"figures/lecture_3/bio_neuron_activation.png\", height: 30%)][#image(\"figures/lecture_3/heaviside.png\", height: 30%)] #pause\n\n $ f(vec(#redm[$1$], x_(1), dots.v, x_(d_x)), vec(#redm[$theta_0$], theta_(1), dots.v, theta_(d_x)) ) = sigma(#redm[$theta_0$] + sum_(j=1)^(d_x) theta_j x_j) = sigma(sum_(#redm[$j=0$])^(d_x) theta_j x_j) $ #pause\n\n $ overline(bold(x)) = vec(1, bold(x)), quad f(bold(x), bold(theta)) = sigma(bold(theta)^top overline(bold(x))) $\n]\n\n#slide(title: [Artificial Neurons])[\n $ f(bold(x), bold(theta)) = sigma(bold(theta)^top overline(bold(x))) $ #pause\n\n This is the artificial neuron! #pause\n\n Let us write out the full equation for a neuron #pause\n \n $ f(bold(x), bold(theta)) = sigma( theta_0 1 + theta_1 x_1 + dots + theta_(d_x) x_(d_x) ) $ #pause\n\n *Question:* Does this look familiar to anyone? #pause\n\n *Answer:* Inside $sigma$ is the multivariate linear model!\n\n $ f(bold(x), bold(theta)) = theta_(d_x) x_(d_x) + theta_(d_x - 1) x_(d_x - 1) + dots + theta_0 1 $\n]\n\n#slide(title: [Artificial Neurons])[\n We model a neuron using a linear model and activation function #pause\n #side-by-side(gutter: 4em)[#cimage(\"figures/lecture_3/neuron_anatomy.jpg\", height: 40%)\n ][ \n #cimage(\"figures/lecture_3/neuron.svg\", height: 40%)]\n\n $ f(bold(x), bold(theta)) = sigma(bold(theta)^top overline(bold(x))) $ \n]\n\n#slide(title: [Artificial Neurons])[\n $ f(bold(x), bold(theta)) = sigma(bold(theta)^top overline(bold(x))) $ #pause\n\n Sometimes, we will write $bold(theta)$ as a bias and weight $b, bold(w)$ #pause\n\n $ bold(theta) = vec(b, bold(w)); quad vec(theta_0, theta_1, dots.v, theta_(d_x)) = vec(b_\" \", w_1, dots.v, w_(d_x)) $ #pause\n\n $ f(bold(x), vec(b, bold(w))) = b + bold(w)^top bold(x) $ \n]\n\n// 1:15\n#focus-slide[Relax]\n\n#slide(title: [Artificial Neurons])[\n #side-by-side[#cimage(\"figures/lecture_3/neuron.svg\") #pause][\n #align(left)[\n \n In machine learning, we represent functions #pause\n \n What kinds of functions can our neuron represent? #pause\n\n Let us consider some *boolean* functions #pause\n\n Let us start with a logical AND function\n ]\n ]\n]\n\n#slide(title: [Artificial Neurons])[\n #side-by-side[#cimage(\"figures/lecture_3/neuron.png\")][\n #align(left)[\n \n *Review:* Activation function (Heaviside step function) #pause\n\n #cimage(\"figures/lecture_3/heaviside.png\", height: 50%)\n\n $\n sigma(x) = H(x) = cases(\n 1 \"if\" x > 0,\n 0 \"if\" x <= 0\n )\n $\n\n ]\n ]\n]\n\n#slide(title: [Artificial Neurons])[\n Implement AND using an artificial neuron #pause\n \n $ f(mat(x_1, x_2)^top, mat(theta_0, theta_1, theta_2)^top) = sigma(theta_0 1 + theta_1 x_1 + theta_2 x_2) $ #pause\n \n $ bold(theta) = mat(theta_0, theta_1, theta_2)^top = mat(-1, 1, 1)^top $ #pause\n \n #align(center, table(\n columns: 5,\n inset: 0.4em,\n $x_1$, $x_2$, $y$, $f(x_1, x_2, bold(theta))$, $hat(y)$,\n $0$, $0$, $0$, $sigma(-1 dot 1 + 1 dot 0 + 1 dot 0) = sigma(-1)$, $0$,\n $0$, $1$, $0$, $sigma(-1 dot 1 + 1 dot 0 + 1 dot 1) = sigma(0)$, $0$,\n $1$, $0$, $0$, $sigma(-1 dot 1 + 1 dot 1 + 1 dot 0) = sigma(0)$, $0$,\n $1$, $1$, $1$, $sigma(-1 dot 1 + 1 dot 1 + 1 dot 1) = sigma(1)$, $1$\n ))\n]\n\n#slide(title: [Artificial Neurons])[\n Implement OR using an artificial neuron #pause\n \n $ f(mat(x_1, x_2)^top, mat(theta_0, theta_1, theta_2)^top) = sigma(theta_0 1 + theta_1 x_1 + theta_2 x_2) $ #pause\n \n $ bold(theta) = mat(theta_0, theta_1, theta_2)^top = mat(0, 1, 1)^top $ #pause\n \n #align(center, table(\n columns: 5,\n inset: 0.4em,\n $x_1$, $x_2$, $y$, $f(x_1, x_2, bold(theta))$, $hat(y)$,\n $0$, $0$, $0$, $sigma(1 dot 0 + 1 dot 0 + 1 dot 0) = sigma(0)$, $0$,\n $0$, $1$, $0$, $sigma(1 dot 0 + 1 dot 1 + 1 dot 0) = sigma(1)$, $1$,\n $1$, $0$, $1$, $sigma(1 dot 0 + 1 dot 0 + 1 dot 1) = sigma(1)$, $1$,\n $1$, $1$, $1$, $sigma(1 dot 0 + 1 dot 1 + 1 dot 1) = sigma(2)$, $1$\n ))\n]\n\n\n// Approx 1:30\n\n#slide(title: [Artificial Neurons])[\n Implement XOR using an artificial neuron #pause\n \n $ f(mat(x_1, x_2)^top, mat(theta_0, theta_1, theta_2)^top) = sigma(theta_0 1 + theta_1 x_2 + theta_2 x_2) $ #pause\n \n $ bold(theta) = mat(theta_0, theta_1, theta_2)^top = mat(?, ?, ?)^top $ #pause\n \n #align(center, table(\n columns: 5,\n inset: 0.4em,\n $x_1$, $x_2$, $y$, $f(x_1, x_2, bold(theta))$, $hat(y)$,\n $0$, $0$, $0$, [This is IMPOSSIBLE!], $$,\n $0$, $1$, $1$, $$, $$,\n $1$, $0$, $1$, $$, $$,\n $1$, $1$, $0$, $$, $$\n ))\n]\n\n#slide(title: [Artificial Neurons])[\n Why can't we represent XOR using a neuron? #pause\n \n $ f(mat(x_1, x_2)^top, mat(theta_0, theta_1, theta_2)^top) = sigma(1 theta_0 + x_1 theta_1 + x_2 theta_2) $ #pause\n\n We can only represent $sigma(\"linear function\")$ #pause\n\n XOR is not a linear combination of $x_1, x_2$! #pause\n\n We want to represent any function, not just linear functions #pause\n\n Let us think back to biology, maybe it has an answer\n]\n\n#slide(title: [Artificial Neurons])[\n *Brain:* Biological neurons $->$ Biological neural network #pause\n\n *Computer:* Artificial neurons $->$ Artificial neural network\n]\n\n#slide(title: [Artificial Neurons])[\n Connect artificial neurons into a network\n\n #grid(\n columns: 2,\n align: center,\n column-gutter: 2em,\n cimage(\"figures/lecture_3/neuron.svg\", width: 80%), cimage(\"figures/lecture_3/deep_network.png\", height: 75%),\n [Neuron], [Neural Network] \n )\n]\n\n#slide(title: [Artificial Neurons])[\n #side-by-side[\n #cimage(\"figures/lecture_3/deep_network.png\", width: 100%)\n ][\n Adding neurons in *parallel* creates a *wide* neural network #pause\n \n Adding neurons in *series* creates a *deep* neural network #pause\n\n Today's powerful neural networks are both *wide* and *deep*\n ]\n]\n\n#slide(title: [Agenda])[#agenda(index: 5)]\n#slide(title: [Agenda])[#agenda(index: 6)]\n\n#slide(title: [Wide Neural Networks])[\n How do we express a *wide* neural network mathematically? #pause\n\n A single neuron:\n\n $ f: bb(R)^(d_x) times Theta |-> bb(R) $ \n \n $ Theta in bb(R)^(d_x + 1) $ #pause\n\n $d_y$ neurons (wide):\n\n $ f: bb(R)^(d_x) times Theta |-> bb(R)^(d_y) $ \n \n $ Theta in bb(R)^((d_x + 1) times d_y) $\n]\n\n#slide(title: [Wide Neural Networks])[\n For a single neuron:\n \n $ f(vec(x_1, dots.v, x_(d_x)), vec(theta_0, theta_1, dots.v, theta_(d_x)) ) = sigma(sum_(i=0)^(d_x) theta_i overline(x)_i) $ #pause\n\n $ f(bold(x), bold(theta)) = sigma(b + bold(w)^top bold(x)) $\n]\n\n#slide[\n // Must be m by n (m rows, n cols)\n #text(size: 24pt)[\n For a wide network:\n $ f(vec(x_1, x_2, dots.v, x_(d_x)), mat(theta_(0,1), theta_(0,2), dots, theta_(0,d_y); theta_(1,1), theta_(1,2), dots, theta_(1, d_y); dots.v, dots.v, dots.down, dots.v; theta_(d_x, 1), theta_(d_x, 2), dots, theta_(d_x, d_y)) ) = vec(\n sigma(sum_(i=0)^(d_x) theta_(i,1) overline(x)_i ),\n sigma(sum_(i=0)^(d_x) theta_(i,2) overline(x)_i ),\n dots.v,\n sigma(sum_(i=0)^(d_x) theta_(i,d_y) overline(x)_i ),\n )\n $ \n\n\n $ f(bold(x), bold(theta)) = \n sigma(bold(theta)^top overline(bold(x))); quad bold(theta)^top in bb(R)^( d_y times (d_x + 1) ) \n $ #pause\n $\n f(bold(x), vec(bold(b), bold(W))) = sigma( bold(b) + bold(W)^top bold(x) ); quad bold(b) in bb(R)^(d_y), bold(W) in bb(R)^( d_x times d_y ) \n $\n ]\n]\n\n#slide[#agenda(index: 6)]\n#slide[#agenda(index: 7)]\n\n#slide(title: [Deep Neural Networks])[\n How do we express a *deep* neural network mathematically? #pause\n\n A wide network and deep network have a similar function signature:\n\n $ f: bb(R)^(d_x) times Theta |-> bb(R)^(d_y) $ #pause\n\n But the parameters change!\n\n Wide: $Theta in bb(R)^((d_x + 1) times d_y)$ #pause \n\n Deep: $Theta in bb(R)^((d_x + 1) times d_h) times bb(R)^((d_h + 1) times d_h) times dots times bb(R)^((d_h + 1) times d_y)$ #pause\n\n $ bold(theta) = mat(bold(theta)_1, bold(theta)_2, dots, bold(theta)_ell)^top = mat(bold(phi), bold(psi), dots, bold(xi))^top $ \n]\n\n#slide(title: [Deep Neural Networks])[\n A wide network:\n\n $ f(bold(x), bold(theta)) = sigma(bold(theta)^top overline(bold(x))) $ #pause\n\n A deep network has many internal functions\n\n $ f_1(bold(x), bold(phi)) = sigma(bold(phi)^top overline(bold(x))) quad\n\n f_2(bold(x), bold(psi)) = sigma(bold(psi)^top overline(bold(x))) quad\n\n dots quad\n\n f_(ell)(bold(x), bold(xi)) = sigma(bold(xi)^top overline(bold(x))) $ #pause\n\n\n $ f(bold(x), bold(theta)) = f_(ell) (dots f_2(f_1(bold(x), bold(phi)), bold(psi)) dots bold(xi) ) $\n]\n\n#slide(title: [Deep Neural Networks])[\n Written another way\n\n $ bold(z)_1 = f_1(bold(x), bold(phi)) = sigma(bold(phi)^top overline(bold(x))) $ #pause\n $ bold(z)_2 = f_2(bold(z_1), bold(psi)) = sigma(bold(psi)^top overline(bold(z))_1) $ #pause\n $ dots.v $ #pause\n $ bold(y) = f_(ell)(bold(x), bold(xi)) = sigma(bold(xi)^top overline(bold(z))_(ell - 1)) $\n\n We call each function a *layer* #pause\n\n A deep neural network is made of many layers\n]\n\n/*\n#slide[\n Implement XOR using a deep neural network #pause\n \n $ f(x_1, x_2, bold(theta)) = sigma( & theta_(3, 0) \\\n + & theta_(3, 1) quad dot quad sigma(theta_(1,0) + x_1 theta_(1,1) + x_2 theta_(1,2)) \\ \n + & theta_(3, 2) quad dot quad sigma(theta_(2,0) + x_1 theta_(2,1) + x_2 theta_(2,2))) $ #pause\n \n $ bold(theta) = mat(\n theta_(1,0), theta_(1,1), theta_(1,2);\n theta_(2,0), theta_(2,1), theta_(2,2);\n theta_(3,0), theta_(3,1), theta_(3,2)\n ) = mat(\n -0.5, 1, 1; \n -1.5, 1, 1;\n -0.5, 1, -2\n ) $ #pause\n]\n*/\n\n/*\n#slide(title: [Deep Neural Networks])[\n What functions can we represent using a deep neural network? #pause\n\n Consider a one-dimensional arbitrary function $g(x) = y$ #pause\n\n We can approximate $g$ using our neural network $f$ #pause\n\n $ f(x_1, x_2, bold(theta)) = sigma( & theta_(3, 0) \\\n + & theta_(3, 1) quad dot quad sigma(theta_(1,0) + x_1 theta_(1,1) + x_2 theta_(1,2)) \\ \n + & theta_(3, 2) quad dot quad sigma(theta_(2,0) + x_1 theta_(2,1) + x_2 theta_(2,2))) $\n]\n*/\n\n#slide(title: [Deep Neural Networks])[\n What functions can we represent using a deep neural network? #pause\n\n *Proof Sketch:* Approximate a continuous function $g: bb(R) |-> bb(R)$ using a linear combination of Heaviside functions #pause\n\n #only(2)[#cimage(\"figures/lecture_3/function_noapproximation.svg\", height: 50%)]\n\n #only((3,4))[#cimage(\"figures/lecture_3/function_approximation.svg\", height: 50%)]\n\n #only(4)[$exists (bold(theta) in bb(R)^(1 times d_h), bold(phi) in bb(R)^((d_h + 1) times d_1)) \"such that\" lim_(d_h |-> oo) [ bold(phi)^top sigma(overline(bold(theta)^top overline(x)))]$\n ] \n]\n\n#slide(title: [Deep Neural Networks])[\n A deep neural network is a *universal function approximator* #pause\n\n It can approximate *any* continuous function $g(x)$ to precision $epsilon$ #pause\n\n $ | g(bold(x)) - f(bold(x), bold(theta)) | < epsilon $ #pause\n\n Making the network deeper or wider decreases $epsilon$ #pause\n\n #align(center)[#underline[Very powerful finding! The basis of deep learning.]] #pause\n\n #side-by-side[*Task:* predict how many #text(fill: color.red)[#sym.suit.heart] a photo gets on social media][#cimage(\"figures/lecture_1/dog.png\", height: 30%)] \n]\n\n\n#slide(title: [Agenda])[#agenda(index: 7)]\n#slide(title: [Agenda])[#agenda(index: 8)]\n\n\n#slide(title: [Practical Considerations])[\n We call wide neural networks *perceptrons* #pause\n\n We call deep neural networks *multi-layer perceptrons* (MLP) #pause\n\n #cimage(\"figures/lecture_3/timeline.svg\", width: 85%)\n]\n\n#slide(title: [Practical Considerations])[\n *All* the models we examine in this course will use MLPs #pause\n - Recurrent neural networks #pause\n - Graph neural networks #pause\n - Transformers #pause\n - Chatbots #pause\n\n It is very important to understand MLPs! #pause\n\n I will explain them again very simply \n]\n\n#slide(title: [Practical Considerations])[\n A *layer* is a linear operation and an activation function\n\n $ f(bold(x), vec(bold(b), bold(W))) = sigma(bold(b) + bold(W)^top bold(x)) $\n\n #side-by-side[Many layers makes a deep neural network][\n #text(size: 22pt)[\n $ bold(z)_1 &= f(bold(x), vec(bold(b)_1, bold(W)_1)) \\\n bold(z)_2 &= f(bold(z)_1, vec(bold(b)_2, bold(W)_2)) \\ quad bold(y) &= f(bold(z)_2, vec(bold(b)_2, bold(W)_2)) $\n ]\n ]\n]\n\n\n#slide(title: [Practical Considerations])[\n Let us create a wide neural network in colab! https://colab.research.google.com/drive/1bLtf3QY-yROIif_EoQSU1WS7svd0q8j7?usp=sharing\n]\n\n#slide(title: [Practical Considerations])[\n #side-by-side(align: left + top)[\n Linear regression: #pause\n\n $+$ Analytical solution #pause\n\n $+$ Low data requirement #pause\n\n $-$ Poor scalability #pause\n\n $-$ Poor polynomials generalization #pause\n ][\n Neural networks: #pause\n\n $-$ No analytical solution #pause\n\n $-$ High data requirement #pause\n\n $+$ Scale to large inputs #pause\n\n $+$ Slightly better generalization #pause\n ]\n\n Next time, we will find out how to train our neural network #pause\n\n Unlike linear regression, finding $theta$ is much more difficult for neural networks\n]\n\n#slide[#agenda(index: none)]\n\n#slide(title: [Conclusion])[\n There might be a quiz next time #pause\n\n Always bring paper and a pen #pause\n\n You should be able to write a neural network layer mathematically #pause\n\n You should also know the shapes of $bold(theta), bold(x), overline(bold(x)), bold(y)$\n]\n\n\n\n/*\n#slide[\n\n #text(size: 21pt)[\n ```python\n import torch\n from torch import nn\n\n class MyNetwork(nn.Module):\n def __init__(self):\n super().__init__() # Required by pytorch\n self.input_layer = nn.Linear(5, 3) # 3 neurons, 5 inputs each \n self.output_layer = nn.Linear(3, 1) # 1 neuron with 3 inputs\n \n def forward(self, x):\n z = torch.heaviside(self.input_layer(x))\n y = self.output_layer(z)\n return y\n ```\n ]\n]\n\n#slide[\n #text(size: 21pt)[\n ```python\n import jax, equinox\n from jax import numpy as jnp\n from equinox import nn\n\n class MyNetwork(equinox.Module):\n input_layer: nn.Linear # Required by equinox\n output_layer: nn.Linear\n\n def __init__(self):\n self.input_layer = nn.Linear(5, 3, key=jax.random.PRNGKey(0))\n self.output_layer = nn.Linear(3, 1, key=jax.random.PRNGKey(1))\n\n def __call__(self, x):\n z = jnp.heaviside(self.input_layer(x))\n y = self.output_layer(z)\n return y \n ```\n ]\n]\n\n\n#slide[\n #side-by-side[#cimage(\"figures/neuron.png\", width: 80%)][#cimage(\"figures/heaviside.png\", height: 50%)] #pause\n *Question:* What kind of functions can we represent with our neuron? #pause\n\n *Hint:* The neuron is linear regression with an activation function\n]\n\n#slide[\n #side-by-side[#cimage(\"figures/neuron.png\", width: 80%)][#cimage(\"figures/heaviside.png\", height: 50%)] #pause\n *Answer:* Linear functions with cutoff\n]\n\n\n#slide[\n #side-by-side[#cimage(\"figures/neuron.png\") #pause][\n The output of the neuron depends on the activation function $sigma$\n ]\n]\n\n#slide[\n #side-by-side[#cimage(\"figures/neuron.png\") #pause][\n *Question:* What functions can a single neuron represent?\n *Hint:* Think back to linear regression #pause\n\n *Answer:*\n ]\n]\n\n#slide[\n #side-by-side[#cimage(\"figures/neuron.png\") #pause][\n Many biological neurons (brain) $->$ many artificial neurons (deep neural network)\n ]\n \n]\n*/\n" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/visualize/shape-aspect-06.typ", "language": "typst", "license": "Other", "content": "// Size cannot be relative because we wouldn't know\n// relative to which axis.\n// Error: 15-18 expected length or auto, found ratio\n#square(size: 50%)\n" }, { "repo": "https://github.com/TypstApp-team/typst", "file": "https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/text/smartquotes.typ", "language": "typst", "license": "Apache License 2.0", "content": "// Test setting custom smartquotes\n\n---\n// Use language quotes for missing keys, allow partial reset\n#set smartquote(quotes: \"\u00ab\u00bb\")\n\"Double and 'Single' Quotes\"\n\n#set smartquote(quotes: (double: auto, single: \"\u00ab\u00bb\"))\n\"Double and 'Single' Quotes\"\n\n---\n// Allow 2 graphemes\n#set smartquote(quotes: \"a\\u{0301}a\\u{0301}\")\n\"Double and 'Single' Quotes\"\n\n#set smartquote(quotes: (single: \"a\\u{0301}a\\u{0301}\"))\n\"Double and 'Single' Quotes\"\n\n---\n// Error: 25-28 expected 2 characters, found 1 character\n#set smartquote(quotes: \"'\")\n\n---\n// Error: 25-35 expected 2 quotes, found 4 quotes\n#set smartquote(quotes: (\"'\",) * 4)\n\n---\n// Error: 25-45 expected 2 quotes, found 4 quotes\n#set smartquote(quotes: (single: (\"'\",) * 4))\n" }, { "repo": "https://github.com/RY997/Thesis", "file": "https://raw.githubusercontent.com/RY997/Thesis/main/thesis_typ/abstract_en.typ", "language": "typst", "license": "MIT License", "content": "#let abstract_en() = {\n set page(\n margin: (left: 30mm, right: 30mm, top: 40mm, bottom: 40mm),\n numbering: none,\n number-align: center,\n )\n\n let body-font = \"New Computer Modern\"\n let sans-font = \"New Computer Modern Sans\"\n\n set text(\n font: body-font, \n size: 12pt, \n lang: \"en\"\n )\n\n set par(\n leading: 1em,\n justify: true\n )\n\n \n // --- Abstract (DE) ---\n v(1fr)\n align(center, text(font: body-font, 1em, weight: \"semibold\", \"Abstract\"))\n \n text[\n In response to the challenges posed by larger class sizes in computer science education, Artemis, an open-source learning platform, adopts interactive learning principles to enhance scalability and adaptability. However, the platform faces shortcomings in catering to the diverse skill levels and learning needs of students. This motivates the exploration of adaptive programming exercise generation, aiming to offer tailored challenges for individual learners. Adaptive exercises have the potential to both challenge advanced students and support beginners effectively, fostering intellectual growth and confidence. Leveraging advancements in Artificial Intelligence (AI), particularly Large Language Models (LLMs), this thesis introduces a novel approach to create adaptive programming exercises. The objectives include the development of a chatbot named Iris for intelligent exercise planning, enabling LLMs for dynamic exercise change plan execution, and seamlessly integrating exercise changes into the Artemis platform. This innovative methodology promises to revolutionize computer science education by providing personalized learning experiences and promoting continuous growth among students.\n ]\n \n v(1fr)\n}" }, { "repo": "https://github.com/Mc-Zen/quill", "file": "https://raw.githubusercontent.com/Mc-Zen/quill/main/examples/fault-tolerant-toffoli2.typ", "language": "typst", "license": "MIT License", "content": " #import \"../src/quill.typ\": *\n\n #let group = gategroup.with(stroke: (dash: \"dotted\", thickness: .5pt))\n\n #quantum-circuit(\n fill-wires: false,\n group(3, 3, padding: (left: 1.5em)), lstick($|0\u232a$), $H$, ctrl(2), ctrl(3), 3,\n group(2, 1),ctrl(1), 1, group(3, 1), ctrl(2), $X$, 1, rstick($|x\u232a$), [\\ ],\n lstick($|0\u232a$), $H$, ctrl(0), 1, ctrl(3), 2, $Z$, $X$, 2, group(2, 1),\n ctrl(1), rstick($|y\u232a$), [\\ ],\n lstick($|0\u232a$), 1, targ(), 2, targ(), 1, mqgate($Z$, target: -1, wire-count: 2), 1, \n targ(fill: auto), 1, targ(fill: auto), rstick($|z plus.circle x y\u232a$), [\\ ],\n lstick($|x\u232a$), 2, targ(), 6, meter(target: -3), setwire(2), ctrl(-1, wire-count: 2), [\\ ],\n lstick($|y\u232a$), 3, targ(), 3, meter(target: -3), setwire(2), ctrl(-2, wire-count: 2), [\\ ],\n lstick($|z\u232a$), 4, ctrl(-3), $H$, meter(target: -3)\n )" }, { "repo": "https://github.com/T1mVo/shadowed", "file": "https://raw.githubusercontent.com/T1mVo/shadowed/main/examples/lorem.typ", "language": "typst", "license": "MIT License", "content": "#import \"../src/lib.typ\": shadowed\n\n#set page(margin: 15pt, height: auto)\n#set par(justify: true)\n\n#shadowed(radius: 4pt, inset: 12pt)[\n #lorem(50)\n]\n" }, { "repo": "https://github.com/sinchang/typst-react", "file": "https://raw.githubusercontent.com/sinchang/typst-react/master/resume.typ", "language": "typst", "license": "", "content": "// https://github.com/skyzh/typst-cv-template/blob/master/cv.typ\n#show heading: set text(font: \"Linux Biolinum\")\n\n#show link: underline\n#set page(\n margin: (x: 0.9cm, y: 1.3cm),\n)\n#set par(justify: true)\n\n#let chiline() = {v(-3pt); line(length: 100%); v(-5pt)}\n\n= \n\n |\n#link(\"https://github.com/example\")[github.com/example] | #link(\"https://example.com\")[example.com]\n\n== Education\n#chiline()\n\n*#lorem(2)* #h(1fr) 2333/23 -- 2333/23 \\\n#lorem(5) #h(1fr) #lorem(2) \\\n- #lorem(10)\n\n*#lorem(2)* #h(1fr) 2333/23 -- 2333/23 \\\n#lorem(5) #h(1fr) #lorem(2) \\\n- #lorem(10)\n\n== Work Experience\n#chiline()\n\n*#lorem(2)* #h(1fr) 2333/23 -- 2333/23 \\\n#lorem(5) #h(1fr) #lorem(2) \\\n- #lorem(20)\n- #lorem(30)\n- #lorem(40)\n\n*#lorem(2)* #h(1fr) 2333/23 -- 2333/23 \\\n#lorem(5) #h(1fr) #lorem(2) \\\n- #lorem(20)\n- #lorem(30)\n- #lorem(40)\n\n== Projects\n#chiline()\n\n*#lorem(2)* #h(1fr) 2333/23 -- 2333/23 \\\n#lorem(5) #h(1fr) #lorem(2) \\\n- #lorem(20)\n- #lorem(30)\n- #lorem(40)\n\n*#lorem(2)* #h(1fr) 2333/23 -- 2333/23 \\\n#lorem(5) #h(1fr) #lorem(2) \\\n- #lorem(20)\n- #lorem(30)\n- #lorem(40)" }, { "repo": "https://github.com/jamesrswift/dining-table", "file": "https://raw.githubusercontent.com/jamesrswift/dining-table/main/tests/topdown/header-none/test.typ", "language": "typst", "license": "The Unlicense", "content": "#import \"../ledger.typ\": *\n#set text(size: 11pt)\n#set page(height: 3.5cm, margin: 1em)\n#dining-table.make(columns: example, \n header: none,\n data: data, \n notes: dining-table.note.display-list\n)\n\n#dining-table.make(columns: example, \n data: data, \n notes: dining-table.note.display-list\n)" }, { "repo": "https://github.com/jneug/schule-typst", "file": "https://raw.githubusercontent.com/jneug/schule-typst/main/src/wp.typ", "language": "typst", "license": "MIT License", "content": "#import \"_imports.typ\": *\n\n#let wochenplan(\n ..args,\n body,\n) = {\n let (doc, page-init, tpl) = base-template(\n type: \"WP\",\n type-long: \"Wochenplan\",\n\n title-block: doc => {\n heading(level: 1, outlined: false, bookmarked: false, doc.title)\n grid(\n columns: (auto, 1fr),\n align: center + horizon,\n column-gutter: 5pt,\n image(width: 1.5cm, \"assets/calendar.svg\"),\n container(radius: 4pt, fill: theme.muted, stroke: 0pt)[\n #set align(center)\n #set text(1.2em, white)\n #show heading: set text(white)\n\n *#doc.from.display(\"[day].[month].[year]\") bis #doc.to.display(\"[day].[month].[year]\")*\n ],\n )\n },\n\n _tpl: (\n options: (\n from: t.date(\n pre-transform: t.coerce.date,\n default: datetime.today(),\n ),\n to: t.date(\n optional: true,\n pre-transform: (self, it) => {\n if it != none {\n return t.coerce.date(self, it)\n } else {\n let _today = datetime.today()\n return datetime(\n year: _today.year(),\n month: _today.month(),\n day: _today.day(),\n )\n }\n },\n ),\n ),\n aliases: (\n von: \"from\",\n bis: \"to\",\n ),\n ),\n\n ..args,\n body,\n )\n\n {\n show: page-init\n tpl\n }\n}\n\n#let gruppe(titel, beschreibung, body) = container(\n radius: 6pt,\n fill: theme.bg.muted,\n stroke: 1.5pt + luma(120),\n title-style: (boxed-style: (:)),\n title: text(weight: \"bold\", hyphenate: false, size: .88em, titel),\n)[#small(beschreibung)#container(fill: white, radius: 3pt, stroke: 1pt + luma(120), body)]\n" }, { "repo": "https://github.com/01mf02/jq-lang-spec", "file": "https://raw.githubusercontent.com/01mf02/jq-lang-spec/main/tour.typ", "language": "typst", "license": "", "content": "#import \"common.typ\": example\n\n= Tour of jq \n\nThis goal of this section is to convey an intuition about how jq functions.\nThe official documentation of jq is its user manual @jq-manual.\n\njq programs are called _filters_.\nFor now, let us consider a filter to be a function from a value to\na (lazy, possibly infinite) stream of values.\nFurthermore, in this section, let us assume a value to be either\na boolean, an integer, or an array of values.\n(We introduce the full set of JSON values in @json.)\n\nThe identity filter \"`.`\" returns a stream containing the input.#footnote[\n The filters in this section can be executed on most UNIX shells by\n `echo $INPUT | jq $FILTER`, where\n `$INPUT` is the input value in JSON format and\n `$FILTER` is the jq program to be executed.\n Often, it is convenient to quote the filter; for example,\n to run the filter \"`.`\" with the input value `0`,\n we can run `echo 0 | jq '.'`.\n In case where the input value does not matter,\n we can also use `jq -n $FILTER`,\n which runs the filter with the input value `null`.\n We use jq 1.7.\n]\n\nArithmetic operations, such as\naddition, subtraction, multiplication, division, and remainder,\nare available in jq.\nFor example, \"`. + 1`\" returns a stream containing the successor of the input.\nHere, \"`1`\" is a filter that returns the value `1` for any input.\n\nConcatenation is an important operator in jq:\nThe filter \"`f, g`\" concatenates the outputs of the filters `f` and `g`.\nFor example, the filter \"`., .`\" returns a stream containing the input value twice.\n\nComposition is one of the most important operators in jq:\nThe filter \"`f | g`\" maps the filter `g` over all outputs of the filter `f`.\nFor example, \"`(1, 2, 3) | (. + 1)`\" returns `2, 3, 4`.\n\nArrays are created from a stream produced by `f` using the filter \"`[f]`\".\nFor example, the filter \"`[1, 2, 3]`\"\nconcatenates the output of the filters \"`1`\", \"`2`\", and \"`3`\" and puts it into an array,\nyielding the value `[1, 2, 3]`.\nThe inverse filter \"`.[]`\" returns a stream containing the values of an array\nif the input is an array.\nFor example, running \"`.[]`\" on the array `[1, 2, 3]` yields\nthe stream `1, 2, 3` consisting of three values.\nWe can combine the two shown filters to map over arrays;\nfor example, when given the input `[1, 2, 3]`,\nthe filter \"`[.[] | (. + 1)]`\" returns a single value `[2, 3, 4]`.\nThe values of an array at indices produced by `f` are returned by \"`.[f]`\".\nFor example, given the input `[1, 2, 3]`, the filter \"`.[0, 2, 0]`\"\nreturns the stream `1, 3, 1`.\n\nCase distinctions can be performed with the filter \"`if f then g else h end`\".\nFor every value `v` produced by `f`, this filter\nreturns the output of `g` if `v` is true and the output of `h` otherwise.\nFor example, given the input `1`,\nthe filter \"`if (. < 1, . == 1, . >= 1) then . else [] end`\" returns `[], 1, 1`.\n\nWe can define filters by using the syntax \"`def f(x1; ...; xn): g;`\",\nwhich defines an filter `f` taking `n` arguments by `g`,\nwhere `g` can refer to `x1` to `xn`.\nFor example, jq provides the filter \"`recurse(f)`\" to calculate fix points,\nwhich could be defined by \"`def recurse(f): ., (f | recurse(f));`\".\nUsing this, we can define a filter to calculate the factorial function, for example.\n\n#example(\"Factorial\")[\n Let us define a filter `fac` that should return $n!$ for any input number $n$.\n We will define `fac` using the fix point of a filter `update`.\n The input and output of `update` shall be an array `[n, acc]`,\n satisfying the invariant that the final output is `acc` times the factorial of `n`.\n The initial value passed to `update` is the array \"`[., 1]`\".\n We can retrieve `n` from the array with \"`.[0]`\" and `acc` with \"`.[1]`\".\n We can now define `update` as \"`if .[0] > 1 then [.[0] - 1, .[0] * .[1]] else empty end`\",\n where \"`empty`\" is a filter that returns an empty stream.\n Given the input value `4`, the filter \"`[., 1] | recurse(update)`\" returns\n `[4, 1], [3, 4], [2, 12], [1, 24]`.\n We are, however, only interested in the accumulator contained in the last value.\n So we can write \"`[., 1] | last(recurse(update)) | .[1]`\", where\n \"`last(f)`\" is a filter that outputs the last output of `f`.\n This then yields a single value `24` as result.\n] \n\nComposition can also be used to bind values to _variables_.\nThe filter \"`f as $x | g`\" performs the following:\nGiven an input value `i`,\nfor every output `o` of the filter `f` applied to `i`,\nthe filter binds the variable `$x` to the value `o`, making it accessible to `g`, and\nyields the output of `g` applied to the original input value `i`.\nFor example, the filter \"`(0, 2) as $x | ((1, 2) as $y | ($x + $y))`\"\nyields the stream `1, 2, 3, 4`.\nNote that in this particular case, we could also write this as \"`(0, 2) + (1, 2)`\",\nbecause arithmetic operators such as \"`f + g`\" take as inputs\nthe Cartesian product of the output of `f` and `g`.\n#footnote[\n #set raw(lang: \"haskell\")\n Haskell users might appreciate the similarity of the two filters\n to their Haskell analoga\n \"`[0, 2] >>= (\\x -> [1, 2] >>= (\\y -> return (x+y)))`\" and\n \"`(+) <$> [0, 2] <*> [1, 2]`\", which both return\n `[1, 2, 3, 4]`.\n]\nHowever, there are cases where variables are indispensable.\n\n#example(\"Variables Are Necessary\")[\n jq defines a filter \"`in(xs)`\" that expands to \"`. as $x | xs | has($x)`\".\n Given an input value `i`, \"`in(xs)`\" binds it to `$x`, then returns\n for every value produced by `xs` whether its domain contains `$x` (and thus `i`).\n Here, the domain of an array is the set of its indices.\n For example, for the input\n `1`, the filter\n \"`in([5], [42, 3], [])`\" yields the stream\n `false, true, false`,\n because only `[42, 3]` has a length greater than 1 and thus a domain that contains `1`.\n The point of this example is that\n we wish to pass `xs` as input to `has`, but at the same point,\n we also want to pass the input given to `in` as an argument to `has`.\n Without variables, we could not do both.\n]\n\nFolding over streams can be done using `reduce` and `foreach`:\nThe filter \"`reduce xs as $x (init; f)`\" keeps\na state that is initialised with the output of `init`.\nFor every element `$x` yielded by the filter `xs`,\n`reduce` feeds the current state to the filter `f`, which may reference `$x`,\nthen sets the state to the output of `f`.\nWhen all elements of `xs` have been yielded, `reduce` returns the current state.\nFor example, the filter \"`reduce .[] as $x (0; . + $x)`\"\ncalculates the sum over all elements of an array.\nSimilarly, \"`reduce .[] as $x (0; . + 1)`\" calculates the length of an array.\nThese two filters are called \"`add`\" and \"`length`\" in jq, and\nthey allow to calculate the average of an array by \"`add / length`\".\nThe filter \"`foreach xs as $x (init; f)`\" is similar to `reduce`,\nbut also yields all intermediate states, not only the last state.\nFor example, \"`foreach .[] as $x (0; . + $x)`\"\nyields the cumulative sum over all array elements.\n\nUpdating values can be done with the operator \"`|=`\",\nwhich has a similar function as lens setters in languages such as Haskell\n#cite(label(\"DBLP:conf/icfp/FosterPP08\"))\n#cite(label(\"DBLP:conf/popl/FosterGMPS05\"))\n#cite(label(\"DBLP:journals/programming/PickeringGW17\")):\nIntuitively, the filter \"`p |= f`\" considers any value `v` returned by `p` and\nreplaces it by the output of `f` applied to `v`.\nWe call a filter on the left-hand side of \"`|=`\" a _path expression_.\nFor example, when given the input `[1, 2, 3]`,\nthe filter \"`.[] |= (. + 1)`\" yields `[2, 3, 4]`, and\nthe filter \"`.[1] |= (. + 1)`\" yields `[1, 3, 3]`.\nWe can also nest these filters;\nfor example, when given the input `[[1, 2], [3, 4]]`,\nthe filter \"`(.[] | .[]) |= (. + 1)`\" yields `[[2, 3], [4, 5]]`.\nHowever, not every filter is a path expression; for example,\nthe filter \"`1`\" is not a path expression because\n\"`1`\" does not point to any part of the input value\nbut creates a new value.\n\nIdentities such as\n\"`.[] |= f`\" being equivalent to \"`[.[] | f]`\" when the input value is an array, or\n\"`. |= f`\" being equivalent to `f`,\nwould allow defining the behaviour of updates.\nHowever, these identities do not hold in jq due the way it\nhandles filters `f` that return multiple values.\nIn particular, when we pass `0` to the filter \"`. |= (1, 2)`\",\nthe output is `1`, not `(1, 2)` as we might have expected.\nSimilarly, when we pass `[1, 2]` to the filter \"`.[] |= (., .)`\",\nthe output is `[1, 2]`, not `[1, 1, 2, 2]` as expected.\nThis behaviour of jq is cumbersome to define and to reason about.\nThis motivates in part the definition of more simple and elegant semantics\nthat behave like jq in most typical use cases\nbut eliminate corner cases like the ones shown.\nWe will show such semantics in @updates.\n" }, { "repo": "https://github.com/rangerjo/tutor", "file": "https://raw.githubusercontent.com/rangerjo/tutor/main/imgs/example.typ", "language": "typst", "license": "MIT License", "content": "#set page(\n width: auto,\n height: auto,\n margin: (x: 0cm),\n)\n#table(\n columns: 2,\n stroke: none,\n align: center,\n [ Question Mode ], [ Solution Mode ], \n [#rect(stroke: 2pt+blue,\n image(\"../example/build/example_question_mode.svg\", width: 12cm)\n)],\n [#rect(stroke: 2pt+green, \n image(\"../example/build/example_solution_mode.svg\", width: 12cm)\n)]\n)\n" }, { "repo": "https://github.com/lf-/typst-algorithmic", "file": "https://raw.githubusercontent.com/lf-/typst-algorithmic/main/algorithmic.typ", "language": "typst", "license": "", "content": "// SPDX-FileCopyrightText: 2023 \n//\n// SPDX-License-Identifier: MIT\n\n/*\n * Generated AST:\n * (change_indent: int, body: ((ast | content)[] | content | ast)\n */\n\n#let ast_to_content_list(indent, ast) = {\n if type(ast) == \"array\" {\n ast.map(d => ast_to_content_list(indent, d))\n } else if type(ast) == \"content\" {\n (pad(left: indent * 0.5em, ast),)\n } else if type(ast) == \"dictionary\" {\n let new_indent = ast.at(\"change_indent\", default: 0) + indent\n ast_to_content_list(new_indent, ast.body)\n }\n}\n\n#let algorithm(..bits) = {\n let content = bits.pos().map(b => ast_to_content_list(0, b)).flatten()\n let table_bits = ()\n let lineno = 1\n\n while lineno <= content.len() {\n table_bits.push([#lineno:])\n table_bits.push(content.at(lineno - 1))\n lineno = lineno + 1\n }\n table(\n columns: (18pt, 100%),\n // line spacing\n inset: 0.3em,\n stroke: none,\n ..table_bits\n )\n}\n\n#let iflike_block(kw1: \"\", kw2: \"\", cond: \"\", ..body) = (\n (strong(kw1) + \" \" + cond + \" \" + strong(kw2)),\n // XXX: .pos annoys me here\n (change_indent: 4, body: body.pos())\n)\n\n#let function_like(name, kw: \"function\", args: (), ..body) = (\n iflike_block(kw1: kw, cond: (smallcaps(name) + \"(\" + args.join(\", \") + \")\"), ..body)\n)\n\n#let listify(v) = {\n if type(v) == \"list\" {\n v\n } else {\n (v,)\n }\n}\n\n#let Function = function_like.with(kw: \"function\")\n#let Procedure = function_like.with(kw: \"procedure\")\n\n#let State(block) = ((body: block),)\n\n/// Inline call\n#let CallI(name, args) = smallcaps(name) + \"(\" + listify(args).join(\", \") + \")\"\n#let Call(..args) = (CallI(..args),)\n#let FnI(f, args) = strong(f) + \" (\" + listify(args).join(\", \") + \")\"\n#let Fn(..args) = (FnI(..args),)\n#let Ic(c) = sym.triangle.stroked.r + \" \" + c\n#let Cmt(c) = (Ic(c),)\n// It kind of sucks that Else is a separate block but it's fine\n#let If = iflike_block.with(kw1: \"if\", kw2: \"then\")\n#let While = iflike_block.with(kw1: \"while\", kw2: \"do\")\n#let For = iflike_block.with(kw1: \"for\", kw2: \"do\")\n#let Assign(var, val) = (var + \" \" + $<-$ + \" \" + val,)\n\n#let Else = iflike_block.with(kw1: \"else\")\n#let ElsIf = iflike_block.with(kw1: \"else if\", kw2: \"then\")\n#let ElseIf = ElsIf\n#let Return(arg) = (strong(\"return\") + \" \" + arg,)\n" }, { "repo": "https://github.com/dismint/docmint", "file": "https://raw.githubusercontent.com/dismint/docmint/main/networks/pset1.typ", "language": "typst", "license": "", "content": "#import \"template.typ\": *\n#show: template.with(\n title: \"14.15 Problem Set #1\",\n subtitle: \"\",\n pset: true\n)\n\n= Problem 1\nLet us the follow the convention for this problem that the first (top) row and (left) column specify the first node, and increase as they go down / right.\n\nSince it is not explicitly stated, I will also make the assumption that there are no self-edges. This will be important in some calculations. \n\n== (a)\nWe can consider each row as conveying information about the neighbors of that specific node. Then, to find the degree of the $n$th node, it simply suffices to add all the values in the $n$th row of the adjacency matrix. Thus we can accomplish this with matrix multiplication as follows:\n\n$ bold(d) = boxed(bold(g) times bold(1)) $\n\nIn the above equation we are multiplying a $n times n$ matrix by a $n times 1$ vector, giving us the desired $n times 1$ dimensions for the vector $bold(d)$\n\n== (b) \nTo get the total number of edges, we can take the sum of the degrees of each node, then divide by two to account for the fact that edges get double counted from both sides. Recall that the assumption has been made that there are no self-edges.\n\n$ m = boxed(1/2 sum_(i,j) bold(g)_(i,j)) $\n\nAlternatively we could have also notated this as $1^T dot (g times 1)$, or more simply $1^T dot bold(d)$\n\n== (c)\nConsider two rows in the $bold(g)$ matrix - by taking the dot product of binary vectors, we essentially determine how many positions both contain $1$, meaning that they have a shared edge. Thus to find the number of shared edges between two nodes $i, j$, simply take the dot product $bold(g)_i dot bold(g)_j$. Thus leads to our final formulation:\n\n$ bold(N)_(i,j) = bold(g)_i dot bold(g)_j $\n\nThis of course, is the exact same thing as simply squaring the $bold(g)$ matrix.\n\n$ bold(N) = boxed(bold(g) times bold(g)) $\n\nNote that this has the consequence that the value of $bold(N)$ for a node and itself is its degree.\n\n== (d)\nExpanding off our answer from above, let us think about what happens when we further multiply by $bold(g)$, *cubing* the adjacency matrix.\n\nConsider multiplying $bold(N)_i dot bold(g)_j$. For the $z$th element of each, we are essentially asking how many paths there are from $i$ to $z$ passing through some $x != i, z$ and then $z$ to $j$. What we really care about is the case where we loop back around and make a triangle, thus $j=i$. We should only care about the diagonal values of the resulting matrix as this is where that information lies.\n\nGetting the answer by taking the trace would be an overestimate for a few reasons. Consider all the ways to count the triangle involving $a, b, c$\n\n#enum(\n enum.item(1)[\n Fixing the starting point, we can run into both\\\n $a arrow.r b arrow.r c arrow.r a$\\\n $a arrow.r c arrow.r b arrow.r a$\\\n This accounts for a doubling in the total number of counted triangles.\n ],\n enum.item(2)[\n The cycle can start from any of the three nodes, leading to a tripling in the total number of counted triangles.\n ]\n)\n\nTherefore we conclude that we must take a sixth of this final number to get the accurate number of triangles.\n\n$ \\#\"Triangles\" = boxed(1 / 6 \"Tr\"(bold(g)^3)) $\n\n= Problem 2\n\n== (a)\n#define(\n title: \"Betweenness Centrality\"\n)[\n Recall that we define Betweenness Centrality (*BC*) for a node as the fraction of shortest paths between two arbitrary nodes that pass through this node, averaged over all pairs.\n\n $ bold(\"BC\")_k = sum_((i, j) : i != j, k != i, j) (P_k(i, j) \\/ P(i, j)) / ((n-1)(n-2)) $\n]\n\nSince we are working with a tree, there are several nice simplifications that can be made.\n\nAs the graph is a tree, there is only one path between any two given nodes. Therefore $P(i, j)$ can be fixed to $1$\n\n$ bold(\"BC\")_k = sum_((i, j) : i != j, k != i, j) P_k(i, j) / ((n-1)(n-2)) $\n\nWith the new equation, we can now rephrase *BC* as \"What fraction of paths contain $k$?\". Alternatively this can also be phrased as $1 -$ \"Fraction of paths that *don't* contain $k$\". Let us work with this second definition, as that seems to be the rough form our desired answer takes.\n\nFor the disjoint regions, it is true that exactly one path existed in the original tree, so the path between one node in each region must have passed through $k$ previously. Conversely, it is also true that within the connected regions, $k$ did not impact the path between any two nodes since there already exists a path as the region is connected, and with exactly one path in a tree between two nodes, there cannot be an additional path passing through $k$. Therefore, it is sufficient to count the sum of pairs of nodes we can make with the restriction that both must be from the same region.\n\nFor the $m$th region, we can count the number of pairs of elements with $n_m (n_m-1)$, and we must take the total sum, leading us to:\n\n$ sum_(m=1)^d n_m (n_m-1) $\n\nHowever remember that we are taking the fraction of all paths so we end up with:\n\n$ sum_(m=1)^d (n_m (n_m-1)) / ((n-1)(n-2)) $\n\nAnd we finally remember that this is the inverse of the original desired quantity (the number of paths *including* $k$), so we must take the difference to $1$, resulting in the final form which matches the requested formula:\n\n$ bold(\"BC\")_k = boxed(1 - sum_(m=1)^d (n_m (n_m-1)) / ((n-1)(n-2))) $\n\n== (b)\nIn a line graph, removing a node will always split the graph into at most $2$ pieces, depending on whether it is either the first / last node or one in the middle.\n\nLet us assume that this graph contains at least two nodes and $i$ is zero-indexed. Then, the sizes of the two disjoins regions will be $i$ and $n-1-i$. Therefore the above formula can be simplified accounting for this new guarantee.\n\n\n$ bold(\"BC\")_i = boxed(1 - (i(i-1) + (n-1-i)(n-2-i)) / ((n-1)(n-2))) $\n\nThis expression can cancel the $(n-2)$ term out according to Wolfram Alpha, but I will leave the above as a sufficiently concise solution. Of course it only applies when we choose a node in the middle, as otherwise the terms can become negative. Thus if we pick the end, we instead have the simplified formula.\n\n$ bold(\"BC\")_i = 1 - ((n-1)(n-2)) / ((n-1)(n-2)) $\n\nThus, the centrality of an edge node is actually $0$, which makes sense as no shortest path in a line graph would ever pass through an edge except paths starting or ending from that edge (which are excluded from the calculation).\n\n= Problem 3\n\n== (a)\nWe want to take the sum across each degree multiplied by its chance of happening:\n\n$ sum_i d_i dot \"Chance to get\" d_i $\n\nLet us define this chance as the probability of picking an edge that connects to a node with degree $d_i$, divided by two since we need to pick the correct side of the edge. This works out nicely, even for cases where both ends of the edge are $d_i$ as the edge will get counted twice to make up for the incorrect fractional chance of picking it. \n\nThe chance we pick an edge that connects to a node with degree $d_i$ is tricker to derive:\n\n+ $P(d_i) dot N$ is the number of nodes with degree $d_i$\n+ $P(d_i) dot N dot d$ is the number of edges which have a $d_i$ degree endpoint.\n+ $(P(d_i) dot N dot d_i) \\/ M$ is the fraction of edges which have a $d_i$ degree endpoint.\n+ $(P(d_i) dot N dot d_i) \\/ (2 dot M)$ includes the likelihood of picking the correct end of the edge.\n\nTherefore we now have the formula:\n\n$ sum_i (d_i^2 dot P(d_i) dot N) / (2 dot M) $\n\nWe still need to get rid of the $M, N$ terms. To do this, observe that:\n\n$ M = 1 / 2 sum_i P(d_i) dot d_i dot N $\n\nTherefore we can make the following substitution in our equation:\n\n$ M / N = (sum_i P(d_i) dot d_i dot N) / 2 $\n\nAnd our equation now simplifies to:\n\n$ sum_i (d_i^2 dot P(d_i) dot N dot 2) / (sum_i (P(d_i) dot d_i dot N) dot 2) = boxed(sum_i (P(d_i) dot d_i^2) / (sum_i P(d_i) dot d_i)) $\n\n== (b)\nThe expected value in *(a)* was hard to calculate since a higher degree means there is an inherent higher chance to be picked, even more so than $P(d_i)$ would seem to indicate. Let us show that $E[D] >= E[X]$\n\nWe start with the fact that variance is always non-negative and work from there. Recall that $E[X] = sum_i P(d_i) dot d_i$\n\n$ 0 <= \"Var\"[X] = sigma_X^2 = sum_i P(d_i)(d - E[X])^2 = sum_i P(d_i)(d^2+E[X]^2-2 dot d dot E[X]) $\n\nThen notice the last step can be simplified as follows:\n\n$\n&= sum_i P(d_i) dot d^2 + sum_i P(d_i) dot E[X]^2 - sum_i P(d_i) dot 2 dot d dot E[X]\\\n&= sum_i P(d_i) dot d^2 + E[X]^2 - 2 dot E[X]^2\\\n&= sum_i P(d_i) dot d^2 - E[X]^2\n$\n\nAfter which we take the last couple steps to complete the proof:\n\n$\n0 &<= sum_i P(d_i) dot d^2 - E[X]^2\\\nE[X]^2 &<= sum_i P(d_i) dot d^2\\\nE[X] &<= sum_i (P(d_i) dot d^2) / (E[X])\\\nE[X] &<= E[D]\n$\n\nThus we arrive at our desired conclusion, with the last step being made the same as the result of *(a)*\n\n== (c)\nWe can simplify and show that:\n\n$ sum_i d_i <= sum_i delta_i $\n\nThe left side can be reformatted since the sum of degrees is equal to two times the number of edges. The right side can be reformatted following a very similar style of logic, except this time instead of counting the edge twice back and forth, we need to count the ratio of degrees both ways.\n\n$ sum_((i, j):i < j) 2 <= sum_((i, j):i < j) (d_i / d_j + d_j / d_i) $\n\nNow all we need to do is to show $2 <= (d_i / d_j + d_j / d_i)$. Remember that since these are degrees, all numbers are positive. Let us start from a clearly true inequality and work onward.\n\n$\n(d_i - d_j)^2 &>= 0\\\nd_i^2 - 2 dot d_i dot d_j + d_j^2 &>= 0\\\nd_i^2 + d_j^2 &>= 2 dot d_i dot d_j\\\nd_i / d_j + d_j / d_i &>= 2\n$\n\nThus we have shown that the inequality is satisfied for this problem. It turns out the last part of this proof actually works even if the numbers aren't always positive after graphing it on Desmos.\n\n== (d)\nLet us see how the idea of the friendship paradox is strengthened by the previous two parts.\n\n*(b)* tells us that the expected degree of picking a random node is less than the expected value of picking an edge then picking a node. This speaks to the inherent bias there is in having more friends. You can only view your friends, and those friends are viewed through the connection (edge). As can be clearly seen in this part, there is a much heavier bias on being picked when you have a higher degree. This part can perhaps be summarized with the sentiment that the friendship paradox doesn't mean you have less friends than the average person, rather that you have less friends than *your* friends.\n\n*(c)* tells us that the average degree of nodes in a graph is less than the average degree of its neighbors. This reinforces the fact that on average _your friends have more friends than you do_. Of course, this doesn't say anything about the magnitude of the difference, but nonetheless it is mathematically sound that there is a feeling of having less friends than your friends.\n" }, { "repo": "https://github.com/loqusion/typix", "file": "https://raw.githubusercontent.com/loqusion/typix/main/docs/recipes/declaring-a-shell-environment.md", "language": "markdown", "license": "MIT License", "content": "# Declaring a shell environment\n\nYou can automatically pull your project's dependencies into your shell by\ndeclaring a [shell environment][nix-dev-declarative-shell] and then activating\nit with [`nix develop`][nix-ref-develop] or [`direnv`][direnv].\n\nHere's an example in a flake using Typix's\n[`devShell`](../api/derivations/dev-shell.md):\n\n```nix\n{\n outputs = { typix }: let\n system = \"x86_64-linux\";\n typixLib = typix.lib.${system};\n\n watch-script = typixLib.watchTypstProject {/* ... */};\n in {\n # packages, apps, etc. omitted\n\n devShells.${system}.default = typixLib.devShell {\n fontPaths = [/* ... */];\n virtualPaths = [/* ... */];\n packages = [\n watch-script\n ];\n };\n };\n}\n```\n\nWhat this example does:\n\n- Fonts added to [`fontPaths`](../api/derivations/dev-shell.md#fontpaths) will\n be made available to `typst` commands via the `TYPST_FONT_PATHS` environment\n variable.\n- Files in [`virtualPaths`](../api/derivations/dev-shell.md#virtualpaths) will be\n recursively symlinked to the current directory (only overwriting existing\n files when\n [`forceVirtualPaths`](../api/derivations/dev-shell.md#forcevirtualpaths) is\n `true`).\n- For convenience, the\n [`typst-watch`](../api/derivations/watch-typst-project.md#scriptname) script\n is added, which will run\n [`watchTypstProject`](../api/derivations/watch-typst-project.md).\n\n[direnv]: https://direnv.net/\n[nix-dev-declarative-shell]: https://nix.dev/tutorials/first-steps/declarative-shell\n[nix-ref-develop]: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop\n" }, { "repo": "https://github.com/linsyking/messenger-manual", "file": "https://raw.githubusercontent.com/linsyking/messenger-manual/main/appendix.typ", "language": "typst", "license": "", "content": "#pagebreak()\n= Appendix\n\n== SOM Calls \n\n`SOMMsg`s are top-level APIs (like system calls in OS) that can directly interact with the core. Users can send `SOMMsg` in any general model.\n\n=== `SOMChangeScene`\n\n*Definition.* `SOMChangeScene ( Maybe scenemsg ) String ( Maybe (Transition userdata) )`\n*Definition.* `SOMChangeScene ( Maybe scenemsg ) String`\n\nThis message is used to change to another scene. Users need to provide the scene init data, the scene name, and the transition.\nThis message is used to change to another scene. Users need to provide the scene init data, the scene name.\n\n=== `SOMPlayAudio`\n\n*Definition.* `SOMPlayAudio Int String AudioOption`\n\nThis message is used to play an audio. It has three parameters: channel ID, audio name, and audio option. The channel ID is where this audio will be played. There might be multiple audios playing on the same channel. Audio name is what users define in the keys of `allAudio`.\n\n`AudioOption` is defined in `Messenger.Audio.Base.elm`:\n\n```elm\ntype AudioOption\n = ALoop\n | AOnce\n```\n\n`ALoop` means the audio will be played repeatedly. `AOnce` means the audio will be\nplayed only once.\n\n==== Example\n\nSuppose we have two audio files `assets/bg.ogg` and `assets/se.ogg`.\n\nFirst we need to import them to our projects, so edit `Lib/Resources.elm`:\n\n```elm\nallAudio : Dict.Dict String String\nallAudio =\n Dict.fromList\n [ ( \"bg\", \"assets/bg.ogg\" )\n , ( \"se\", \"assets/se.ogg\" )\n ]\n```\n\nThis is very similar to `allTexture`.\n\nAfter that, we decide to use 0 as the background music channel and 1 as the sound effect channel.\n\nThen, when we want to play the background music `bg`, emit:\n\n```elm\nSOMPlayAudio 0 \"bg\" ALoop\n```\n\nAnd when we want to play the sound effect `se`, emit:\n\n```elm\nSOMPlayAudio 1 \"se\" AOnce\n```\n\n*Hint.* Users can use `newAudioChannel` to generate a unique channel ID.\n\n=== `SOMStopAudio`\n\n*Definition.* `SOMStopAudio Int`\n\nThis message is used to stop a channel. The parameter is the channel ID. If there are multiple audios playing on a channel, all of them will be stopped.\n\n=== `SOMAlert`\n\n*Definition.* `SOMAlert String`\n\nThis message is used to show an alert. The parameter is the content of the alert.\n\n=== `SOMPrompt`\n\n*Definition.* `SOMPrompt String String`\n\nThis message is used to show a #link(\"https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt\")[prompt]. Users can use this to get text input from the user. The first parameter is the name of the prompt, and the second parameter is the title of the prompt.\n\nWhen the user clicks the OK button, user code will receive a `Prompt String String` message. The first parameter is the name of the prompt, and the second parameter is the user\u2019s input.\n\n=== `SOMSetVolume`\n\n*Definition.* `SOMSetVolume Float`\n\nThis message is to change the volume. It should be a value in $[0, 1]$. Users could use a larger value but it will sound noisy.\n\n=== `SOMSaveGlobalData`\n\n*Definition.* `SOMSaveGlobalData`\n\nSave global data (including user data) to local storage.\n\nSee @localstorage.\n\n== Game Configurations\n\nUsers may want to change the settings in `MainConfig.elm` to match their demand. This section explains what each options in that configuration file means.\n\n- `initScene`. The first scene users will see when start the game\n- `initSceneMsg`. The message to start the first scene\n- `virtualSize`. The virtual drawing size. Users may use whatever they like but think carefully about the ratio (Support 4:3 or 16:9? screens)\n- `debug`. A debug flag. If turned on, users can press `F1` to change to a scene quickly and press `F2` to change volume during anytime in the game\n- `background`. The background users see. Default is a transparent background\n- `timeInterval`. The update strategy. See @tick\n- `initGlobalData` and `saveGlobalData`. See @localstorage\n\n== Messenger CLI Commands \n\nYou can also use `messenger --help` to view help.\n\n=== Scene\n\nCreate a scene.\n\nUsage: `messenger scene [OPTIONS] NAME`\n\nArguments:\n\n- `name`. The name of the scene\n- `--raw`. Use raw scene without layers\n- `--proto`, `-p`. Create a sceneproto\n- `--init`, `-i`. Create a `Init.elm` file\n\n=== Init\n\nInitialize a Messenger project.\n\nUsage: `messenger init [OPTIONS] NAME`\n\nArguments:\n\n- `name`. The name of project\n- `--template-repo`, `-t`. Use customized repository for cloning templates.\n- `--template-tag`, `-b`. The tag or branch of the repository to clone.\n\n=== Layer\n\nCreate a layer.\n\nUsage: `messenger layer [OPTIONS] NAME LAYER`\n\nArguments:\n\n- `name`. The name of the scene\n- `layer`. The name of the layer\n- `--with-component`, `-c`. Use components in this layer\n- `--cdir`, `-cd`. Directory of components in the scene\n- `--proto`, `-p`. Create layer in sceneproto\n- `--init`, `-i`. Create a `Init.elm` file\n\n=== Level\n\nCreate a level.\n\nUsage: `messenger level [OPTIONS] SCENEPROTO NAME`\n\nArguments:\n\n- `sceneproto`. The name of the sceneproto\n- `name`. The name of the level\n\n=== Component\n\nCreate a component.\n\nUsage: `messenger component [OPTIONS] SCENE NAME`\n\nArguments:\n\n- `scene`. The name of the scene\n- `name`. The name of the component\n- `--cdir`, `-cd`. Directory to store components\n- `--proto`, `-p`. Create component in sceneproto\n- `--init`, `-i`. Create a `Init.elm` file\n\n== Roadmap\n\nThis sections contains some ideas we'd like to implement in future versions of Messenger. We welcome users to post feature request in our Messenger repository's issue.\n\n=== Multi-pass Updater\n\nSome components may want to do some operations after all other components have finished. This is the _second-pass_ updater. We plan to extend this idea further to support _multi-pass_ updater. Components may update _any_ number of passes in one event update.\n\n=== Advanced Component View\n\nUsers might want to have `List (Renderable, Int)` instead of `(Renderable, Int)` (In fact, this is what Reweave does). A use-case is that a component may have some part behind the player and some other part in front of the player.\n\n=== Unified custom element\n\nUnify `elm-canvas` and audio system.\n\n=== Asset Manager\n\nDesign a better asset manager that helps manage all the assets, including audios, images, and other data.\n\n=== On-demand Asset Loading\n\nUsers can load or pre-load assets when they want to, not at the beginning of the game.\n\n== Acknowledgement\n\nWe express great gratitude to the FOCS Messenger team. Members are #link(\"\")[linsyking], #link(\"\")[YUcxovo], #link(\"\")[matmleave]. We also express sincere gratitude to all students using Messenger." }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/superb-pci/0.1.0/README.md", "language": "markdown", "license": "Apache License 2.0", "content": "# superb-pci\n\nTemplate for [Peer Community In](https://peercommunityin.org/) (PCI) submission and [Peer Community Journal](https://peercommunityjournal.org/) (PCJ) post-recommendation upload.\n\nThe template is as close as possible to the LaTeX one.\n\n## Usage\n\nTo use this template in Typst, simply import it at the top of your document.\n```\n#import \"@preview/superb-pci:0.1.0\": *\n```\n\nAlternatively, you can start using this template from the command line with \n```\ntypst init @preview/superb-pci:0.1.0 my-superb-manuscript-dir\n```\nor directly in the web app by clicking \"Start from template\".\n\nPlease see the main Readme about Typst packages [https://github.com/typst/packages](https://github.com/typst/packages).\n\n## Configuration\n\nThis template exports the `pci` function with the following named arguments:\n\n- `title`: the paper title\n- `authors`: array of author dictionaries. Each author must have the `name` field, and can have the optional fields `orcid`, and `affiliations`.\n- `affiliations`: array of affiliation dictionaries, each with the keys `id` and `name`. All correspondence between authors and affiliations is done manually.\n- `abstract`: abstract of the paper as content\n- `doi`: DOI of the paper displayed on the front page\n- `keywords`: array of keywords displayed on the front page\n- `correspondence`: corresponding address displayed on the front page\n- `numbered_sections`: boolean, whether sections should be numbered\n- `pcj`: boolean, provides a way to remove the front page and headers/footers for upload to the Peer Community Journal. `[default: false]`\n\nThe template will initialize your folder with a sample call to the `pci` function in a show rule and dummy content as an example.\nIf you want to change an existing project to use this template, you can add a show rule like this at the top of your file:\n\n```typst\n#import \"@preview/superb-pci:0.1.0\": *\n\n#show: pci.with(\n title: [Sample for the template, with quite a very long title],\n abstract: lorem(200),\n authors: (\n (\n name: \"\",\n orcid: \"0000-0000-0000-0001\",\n affiliations: \"#,1\"\n ),\n (\n name: \"\",\n orcid: \"0000-0000-0000-0001\",\n affiliations: \"#,2\",\n ),\n (\n name: \"\",\n affiliations: \"2\",\n ),\n (\n name: \"\",\n orcid: \"0000-0000-0000-0001\",\n affiliations: \"1,3\"\n ),\n ),\n affiliations: (\n (id: \"1\", name: \"Rue sans aplomb, Paris, France\"),\n (id: \"2\", name: \"Center for spiced radium experiments, United Kingdom\"),\n (id: \"3\", name: \"Bruce's Bar and Grill, London (near Susan's)\"),\n (id: \"#\", name: \"Equal contributions\"),\n ),\n doi: \"https://doi.org/10.5802/fake.doi\",\n keywords: (\"Scientific writing\", \"Typst\", \"PCI\", \"Example\"),\n correspondence: \"\",\n numbered_sections: false,\n pcj: false,\n)\n\n// Your content goes here\n```\n\nYou might also need to use the `table_note` function from the template.\n\n## To do\n\nSome things that are not straightforward in Typst yet that need to be added in the futures:\n\n- [ ] line numbers\n- [ ] switch equation numbers to the left\n" }, { "repo": "https://github.com/Dr00gy/Typst-thesis-template-for-VSB", "file": "https://raw.githubusercontent.com/Dr00gy/Typst-thesis-template-for-VSB/main/thesis_template/pages.typ", "language": "typst", "license": "", "content": "#let titlePage(\n thesisTitle,\n thesisDescription,\n fullName,\n supervisor,\n type: \"bachelor\", // bachelor, bachelor-practice, master or phd\n year: datetime.today().year(),\n) = {\n // Overwrite some global rules\n set par(\n first-line-indent: 0cm,\n justify: false,\n )\n move(\n dx: -8mm,\n context(\n image(\n if text.lang == \"en\" {\"logos/FEI EN.svg\"} else {\"logos/FEI CZ.svg\"},\n height: 3cm,\n )\n )\n )\n \n heading(outlined: false, level: 2)[#thesisTitle]\n\n v(1.5em)\n\n set text(spacing: .3em)\n\n text(size: 14pt)[#thesisDescription]\n\n v(2em)\n\n text(size: 20pt)[#fullName]\n\n align(bottom)[\n #set text(size: 14pt)\n #context([\n #if type == \"bachelor\" {\n if text.lang == \"en\" [Bachelor thesis] else [Bakal\u00e1\u0159sk\u00e1 pr\u00e1ce]\n } else if type == \"bachelor-practice\" {\n if text.lang == \"en\" [Bachelor professional practice] else [Bakal\u00e1\u0159sk\u00e1 praxe]\n } else if type == \"master\" {\n if text.lang == \"en\" [Master thesis] else [Diplomov\u00e1 pr\u00e1ce]\n } else if type == \"phd\" {\n if text.lang == \"en\" [PhD thesis] else [Diserta\u010dn\u00ed pr\u00e1ce]\n }\n\n #if text.lang == \"en\" [Supervisor:] else [Vedouc\u00ed pr\u00e1ce:]\n ])\n #supervisor\n\n\n Ostrava, #year\n ]\n}\n\n\n\n// Pages before Contents\n#let abstracts(\n czechAbstract, englishAbstract,\n czechKeywords, englishKeywords,\n slovakAbstract: none, slovakKeywords: none,\n quote: none,\n acknowledgment: none,\n abstractSpacing: 2.5cm,\n ) = {\n //show heading: set block(spacing: 1em)\n // Abstract\n grid(\n rows: (auto, auto, auto),\n row-gutter: abstractSpacing,\n {\n text({\n heading(outlined: false, level: 2)[Abstrakt]\n czechAbstract\n\n heading(outlined: false, level: 2)[Kl\u00ed\u010dov\u00e1 slova]\n czechKeywords.join(\", \")\n }, lang: \"cs\")\n },\n {\n text({\n heading(outlined: false, level: 2)[Abstract]\n englishAbstract\n\n heading(outlined: false, level: 2)[Keywords]\n englishKeywords.join(\", \")\n }, lang: \"en\")\n },\n if slovakAbstract != none and slovakKeywords != none {\n text({\n heading(outlined: false, level: 2)[Abstrakt]\n slovakAbstract\n\n heading(outlined: false, level: 2)[K\u013e\u00fa\u010dov\u00e9 slov\u00e1]\n slovakKeywords.join(\", \")\n }, lang: \"sk\")\n },\n )\n\n // Acknowledgement\n if acknowledgment != none {\n pagebreak()\n if quote != none {\n quote\n }\n\n align(bottom)[\n #heading(outlined: false, level: 2)[\n #context(if text.lang == \"en\" [Acknowledgment] else [Pod\u011bkov\u00e1n\u00ed])\n ]\n #acknowledgment\n ]\n }\n}\n" }, { "repo": "https://github.com/Enter-tainer/mino", "file": "https://raw.githubusercontent.com/Enter-tainer/mino/master/typst-package/mino.typ", "language": "typst", "license": "MIT License", "content": "#import \"@preview/jogs:0.2.3\": compile-js, call-js-function\n\n\n#let mj-src = read(\"./mino.js\")\n#let mj-bytecode = compile-js(mj-src)\n\n#let get-text(src) = {\n if type(src) == str {\n src\n } else if type(src) == content {\n src.text\n }\n}\n\n#let decode-fumen(fumen) = call-js-function(mj-bytecode, \"mino\", fumen)\n" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/break-continue-03.typ", "language": "typst", "license": "Other", "content": "// Test joining with continue.\n\n#let x = for i in range(5) {\n \"a\"\n if calc.rem(i, 3) == 0 {\n \"_\"\n continue\n }\n str(i)\n}\n\n#test(x, \"a_a1a2a_a4\")\n\n" }, { "repo": "https://github.com/drupol/master-thesis", "file": "https://raw.githubusercontent.com/drupol/master-thesis/main/src/thesis/theme/common/titlepage.typ", "language": "typst", "license": "Other", "content": "#import \"metadata.typ\": *\n\n#let titlepage(\n title: \"\",\n subtitle: \"\",\n university: \"\",\n faculty: \"\",\n degree: \"\",\n program: \"\",\n supervisor: \"\",\n advisors: (),\n author: \"\",\n authorOrcId: \"\",\n doi: none,\n startDate: none,\n submissionDate: none,\n rev: none,\n shortRev: none,\n builddate: none,\n) = {\n set page(\n margin: (top: 1cm, left: 1cm, right: 1cm, bottom: 1cm),\n numbering: none,\n number-align: center,\n header: {\n place(top + left)[\n #pad(top: 10pt)[\n #set text(size: 4em)\n #include \"../UMONS-fs-logo.typ\"\n ]\n ]\n place(top + right)[\n #pad(top: 10pt)[\n #set text(size: 4em)\n #include \"../UMONS-logo.typ\"\n ]\n ]\n },\n footer: align(\n center,\n text(font: sans-font)[\n #faculty #sym.diamond.filled.small\n #university #sym.diamond.filled.small\n 20, Place du Parc #sym.diamond.filled.small\n B-7000 Mons\n ],\n ),\n )\n\n set text(\n font: body-font,\n size: 12pt,\n lang: \"en\",\n )\n\n place(center + horizon, dy: 3em)[\n #align(center, text(font: sans-font, 2em, weight: 700, title))\n\n #if subtitle != none {\n align(center, text(font: sans-font, 1em, weight: 700, subtitle))\n }\n\n #align(center, text(font: sans-font, 1.3em, weight: 100, view))\n\n #grid(\n columns: 3,\n gutter: 1em,\n align: (right, left, left),\n strong(\"Author\"),\n \":\",\n {\n link(\"https://orcid.org/\" + authorOrcId)[#author#box(\n image(\n \"../../../../resources/images/ORCIDiD_iconvector.svg\",\n width: 10pt,\n ),\n )]\n },\n strong(\"Supervisor\"),\n \":\",\n supervisor,\n ..if advisors != none {\n (strong(\"Advisors\"), \":\", advisors.join(\", \"))\n },\n ..if startDate != none {\n (strong(\"Academic year\"), \":\", startDate)\n },\n ..if submissionDate != none {\n (strong(\"Submission date\"), \":\", submissionDate)\n },\n ..if builddate != \"\" {\n (strong(\"Build date\"), \":\", builddate)\n },\n ..if doi != none {\n (\n strong(\"DOI\"),\n \":\",\n link(\n \"https://doi.org/\" + doi,\n doi,\n ),\n )\n },\n ..if shortRev != \"\" {\n (\n strong(\"Revision\"),\n \":\",\n link(\n \"https://codeberg.org/p1ld7a/master-thesis/commit/\" + rev,\n shortRev,\n ),\n )\n },\n )\n ]\n}\n" }, { "repo": "https://github.com/WooSeongChoi/perl-5-study", "file": "https://raw.githubusercontent.com/WooSeongChoi/perl-5-study/main/main.typ", "language": "typst", "license": "", "content": "#import \"@preview/ilm:1.2.1\": *\n\n#show: ilm.with(\n title: [Perl 5 \ubc30\uc6b0\uae30],\n author: \"Learning Perl\",\n figure-index: (enabled: true),\n table-index: (enabled: true),\n listing-index: (enabled: true)\n)\n\n#set text(\n font: \"NanumGothic\",\n size: 10pt\n)\n\n#include \"./chapters/chapter01/introduction.typ\"\n\n\n" }, { "repo": "https://github.com/Ttajika/class", "file": "https://raw.githubusercontent.com/Ttajika/class/main/microecon/quiz_bank.typ", "language": "typst", "license": "", "content": "#import \"functions.typ\": *\n\n#set text(font: \"\")\n#show strong: set text(font: \"\") \n\n//see https://typst.app/docs/reference/foundations/calc\n\n#let Q2-price1 = 120\n#let Q2-price2 = 100\n#let Q2-dem1 = 3020\n#let Q2-dem2 = 5240\n\n#let cat_list =(\"Term1\",)\n\n\n\nQuiz_create\u3067\u554f\u984c\u306e\u30ea\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff0e Quiz = Quiz_create\u3068\u3059\u308b\u3068Quiz\u304c\u554f\u984c\u306e\u30ea\u30b9\u30c8\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570\n\n- quiz\u95a2\u6570\u3067\uff0c\u5f62\u5f0f\u306b\u5408\u3063\u305f\u554f\u984c\u3092\u4f5c\u6210\u3059\u308b. \u4ee5\u4e0b\u305d\u306e\u5404\u7a2e\u5f15\u6570\u306e\u8aac\u660e\n\n- \u6700\u521d\u306e\u5f15\u6570\u306fid: \u3053\u308c\u304c\u30e9\u30d9\u30eb\u306b\u3082\u306a\u308b\u306e\u3067\uff0c\u554f\u984c\u3092\u5f15\u7528\u3059\u308b\u3068\u304d\u306f @Q2 \u306e\u3088\u3046\u306b\u3067\u304d\u308b\uff0e\u56de\u7b54\u306e\u30e9\u30d9\u30eb\u306fA\u3092\u3064\u3051\u3066 @Q2A\n - \u306a\u306e\u3067\u5225\u306eid\u306bA\u3092\u3064\u3051\u305f\u3082\u306e\u3092id\u306b\u3059\u308b\u3068\u30e9\u30d9\u30eb\u304c\u91cd\u8907\u3057\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u306e\u3067\u6ce8\u610f\uff0e\n\n- question: \u554f\u984c\u6587. []\u3000\u306e\u4e2d\u306b\u5165\u529b\u3059\u308b\n\n- answer: \u89e3\u7b54. [] \u306e\u4e2d\u306b\u5165\u529b\u3059\u308b\n\n- commentary: \u89e3\u8aac. [] \u306e\u4e2d\u306b\u5165\u529b\u3059\u308b\n\n- point: \u914d\u70b9\uff0e \u6574\u6570\u3092\u5165\u529b\u3059\u308b. \u5408\u8a08\u70b9\u3092\u8a08\u7b97\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u306f\u672a\u5b9f\u88c5\uff0e\n\n#let Quiz = Quiz_create(\n quiz(\"Q1\", question:[\n \u3042\u308b\u4f1a\u793e\u304c\u904b\u55b6\u3059\u308b\u30c6\u30fc\u30de\u30d1\u30fc\u30af\u304c\u3042\u308b\uff0e\u65e5\u3005\u306e\u55b6\u696d\u306b\u5fc5\u8981\u306a\u8cbb\u7528\u306f30\u5104\u5186\uff0c\u3053\u308c\u307e\u3067\u306b\u304b\u304b\u3063\u305f\u5efa\u8a2d\u8cbb\u306f3200\u5104\u5186\u3067\u3042\u308b\uff0e\u3042\u308b\u65e5\uff0c\u3053\u306e\u30c6\u30fc\u30de\u30d1\u30fc\u30af\u306e\u6240\u6709\u6a29\u3092320\u5104\u5186\u3067\u8cb7\u3044\u305f\u3044\u3068\u3044\u3046\u4eba\u304c\u73fe\u308c\u305f\u304c\u305d\u306e\u4f1a\u793e\u306f\u305d\u306e\u7533\u3057\u51fa\u3092\u65ad\u3063\u305f\uff0e\u307e\u305f\uff0c\u30c6\u30fc\u30de\u30d1\u30fc\u30af\u3092\u6f70\u3057\u3066\u30c7\u30d1\u30fc\u30c8\u3092\u7acb\u3066\u308c\u3070\u5efa\u8a2d\u8cbb\u3084\u904b\u55b6\u8cbb\u306a\u3069\u3092\u5dee\u3057\u5f15\u3044\u3066\u3082350\u5104\u5186\u306e\u5229\u76ca\u304c\u4e0a\u304c\u308b\u3068\u3044\u3046\uff0e\u3057\u304b\u3057\u3053\u306e\u4f1a\u793e\u306f\u30c6\u30fc\u30de\u30d1\u30fc\u30af\u306e\u904b\u55b6\u3092\u7d9a\u3051\u3066\u3044\u308b\uff0e\u307e\u305f\uff0c\u3053\u306e\u4f1a\u793e\u306f1000\u5104\u5186\u3067\u306a\u3089\u3053\u306e\u30c6\u30fc\u30de\u30d1\u30fc\u30af\u306e\u6240\u6709\u6a29\u3092\u58f2\u308b\u304b\u3068\u8a00\u3046\u554f\u3044\u306b\u305d\u3046\u3060\u3068\u7b54\u3048\u3066\u3044\u308b\uff0e\u3053\u306e\u4f1a\u793e\u304c\u5229\u76ca\u8ffd\u6c42\u3059\u308b\u3082\u306e\u3060\u3068\u3059\u308b\u3068\u304d\uff0c\u30c6\u30fc\u30de\u30d1\u30fc\u30af\u306e\u53ce\u5165\u306f\u6700\u5927\u3044\u304f\u3089 *\u4ee5\u4e0b* \u3067\u3042\u308b\u3068\u8003\u3048\u3089\u308c\u308b\u304b\u7b54\u3048\u306a\u3055\u3044\uff0e\u305f\u3060\u3057\uff0c\u554f\u984c\u6587\u4ee5\u5916\u306e\u4e8b\u60c5\u306f\u7121\u8996\u3057\u3066\u826f\u3044\uff0e\n ], answer:[\n \n ], point:10, show-answer:true, category:\"Term1\"),\n \n quiz(\"Q2\", question:[\n \u3042\u308b\u8ca1\u306b\u3064\u3044\u3066\uff0c\u4fa1\u683c\u304c#Q2-price1\\\u5186\u304b\u3089#Q2-price2\\\u5186\u306b\u5909\u5316\u3057\u305f\u3068\u3053\u308d\uff0c\u9700\u8981\u91cf\u304c#Q2-dem1\\\u304b\u3089#Q2-dem2\\\u306b\u5909\u5316\u3057\u305f\uff0e\u3053\u306e\u3068\u304d\u306e\u9700\u8981\u306e\u4fa1\u683c\u5f3e\u529b\u6027\u3092\u6c42\u3081\u306a\u3055\u3044\uff0e\n ], answer:[\n $#calc.abs((Q2-price2 - Q2-price1))/#calc.abs((Q2-dem2 - Q2-dem1))$\n ], point:12, category:\"Term1\"),\n \n quiz(\"Q3\", question:[\u9700\u8981\u95a2\u6570\u304c$D(p)=5-p/2$\uff0c\u7dcf\u8cbb\u7528\u95a2\u6570\u304c$C(q)=5q$\u3067\u3042\u308b\u3068\u304d\uff0c\u72ec\u5360\u4f01\u696d\u306e\u5229\u6f64\u3092\u6700\u5927\u306b\u3059\u308b\u4fa1\u683c\u3092\u6c42\u3081\u306a\u3055\u3044\uff0e], \n answer:[\u96e3\u3057\u304f\u306a\u3044], commentary:[], point:12, category:\"Term1\"),\n quiz(\"Q4\", question:[\u5375\u306e\u5e02\u5834\u3092\u8003\u3048\u308b\uff0e\u9ce5\u30a4\u30f3\u30d5\u30eb\u30a8\u30f3\u30b6\u306b\u3088\u3063\u3066\u5375\u306e\u751f\u7523\u8cbb\u7528\u304c\u4e0a\u6607\u3057\u305f\uff0e\u3053\u306e\u3068\u304d\uff0c\u5e02\u5834\u5747\u8861\u306b\u304a\u3051\u308b\u4fa1\u683c\u3068\u53d6\u5f15\u91cf\u304c\u3069\u306e\u3088\u3046\u306b\u5909\u5316\u3059\u308b\u3068\u8003\u3048\u3089\u308c\u308b\u304b\uff0c\u56f3\u3092\u7528\u3044\u3066\u7b54\u3048\u306a\u3055\u3044], answer:[\u96e3\u3057\u304f\u306a\u3044], commentary:[], point:12, category:\"Term1\"),\n quiz(\"Q5\", question:[\u8c4a\u4f5c\u8ca7\u4e4f\u304c\u767a\u751f\u3057\u3046\u308b\u7406\u7531\u3092\u56f3\u3092\u7528\u3044\u3066\u6587\u7ae0\u3067\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e\n], answer:[\u96e3\u3057\u304f\u306a\u3044], commentary:[], point:12, category:\"Term1\"),\n quiz(\"Q6\", question:[\n \u3042\u308b\u5e74\u306e\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8\u306eCD\u306e\u4fa1\u683c\u3068\u53d6\u5f15\u91cf\u304c\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u305f\n\n- 1\u67081\u65e5: \u4fa1\u683c1000, \u53d6\u5f15\u91cf1000\n- 1\u670830\u65e5: \u4fa1\u683c800, \u53d6\u5f15\u91cf1700\n\n\n\u307e\u305f\uff0c1\u670815\u65e5\u306b\u306f\u305d\u306e\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8\u304c\u8457\u540d\u306a\u8cde\u3092\u53d7\u8cde\u3057\uff0c\u4eba\u6c17\u304c\u9ad8\u307e\u3063\u305f\uff0e\n\n\u4ee5\u4e0a\u306e\u4e8b\u67c4\u304b\u3089\u308f\u304b\u308b\u3053\u3068\u3068\u3057\u3066\u6700\u3082\u9069\u5f53\u306a\u3082\u306e\u3092\u4ee5\u4e0b\u306e\u4e2d\u304b\u3089\u4e00\u3064\u9078\u3073\uff0c\u305d\u306e\u7406\u7531\u3092\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e\n+ CD\u306e\u9700\u8981\u66f2\u7dda\u306f\u53f3\u4e0b\u304c\u308a\u3067\u3042\u308b.\n+ CD\u306e\u9700\u8981\u66f2\u7dda\u306f\u53f3\u4e0a\u304c\u308a\u3067\u3042\u308b.\n+ CD\u306e\u4f9b\u7d66\u66f2\u7dda\u306f\u53f3\u4e0b\u304c\u308a\u3067\u3042\u308b.\n+ CD\u306e\u4f9b\u7d66\u66f2\u7dda\u306f\u53f3\u4e0a\u304c\u308a\u3067\u3042\u308b.\n\n\n\u305f\u3060\u3057\uff0c\u9700\u8981\u3068\u4f9b\u7d66\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u4ee5\u4e0b\u306e\uff14\u3064\u3067\u3042\u308b\u3068\u3059\u308b\uff0e\n\n#image(\"img/patterns2.svg\")\n], answer:[\u96e3\u3057\u304f\u306a\u3044], commentary:[], point:12, category:\"Term1\"),\n quiz(\"Q7\", question:[\u30c8\u30a5\u30a4\u30fc\u30c9\u30a5\u30eb\u30c7\u30a3\u30fc\u3068\u30c8\u30a5\u30a4\u30fc\u30c9\u30a5\u30eb\u30c0\u30e0\u306f\u53cc\u5b50\u3067\u898b\u5206\u3051\u304c\u3064\u304b\u306a\u3044\u304c\uff0c\u597d\u307f\u304c\u9055\u3046\uff0e\n\n - \u30c8\u30a5\u30a4\u30fc\u30c9\u30a5\u30eb\u30c7\u30a3\u30fc\u306f\u30b1\u30fc\u30ad\u306b600\u5186\uff0c\u30b3\u30fc\u30d2\u30fc\u306b100\u5186\u306e\u652f\u6255\u610f\u601d\u984d\uff0c\n - \u30c8\u30a5\u30a4\u30fc\u30c9\u30a5\u30eb\u30c0\u30e0\u306f\u30b1\u30fc\u30ad\u306b700\u5186\uff0c\u30b3\u30fc\u30d2\u30fc\u306b500\u5186\u306e\u652f\u6255\u610f\u601d\u984d\u3092\u6301\u3063\u3066\u3044\u308b\uff0e\n \u3053\u306e\u3068\u304d\uff0c\u5f7c\u3089\u306e\u652f\u6255\u3046\u91d1\u984d\u306e\u5408\u8a08\u304c\u6700\u5927\u306b\u306a\u308b\u3088\u3046\u306a\u30e1\u30cb\u30e5\u30fc\u3092\u8003\u3048\u306a\u3055\u3044\uff0e\n], answer:[\u96e3\u3057\u304f\u306a\u3044], commentary:[], point:12, category:\"Term1\"),\nquiz(\"Q8\",question:[\n\u3042\u308b\u6642\u70b9\u306b\u304a\u3051\u308b\u9700\u8981\u66f2\u7dda\u304c\u4e0b\u56f3\u306e\u70b9\u7dda\u3067\u8868\u3055\u308c\u308b\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u3042\u308b\u30b7\u30e7\u30c3\u30af\u304c\u8d77\u304d\uff0c\u3069\u3093\u306a\u4fa1\u683c\u306b\u3064\u3044\u3066\u3082\u9700\u8981\u91cf\u304c\u5897\u52a0\u3057\u305f\u3068\u3044\u3046\uff0e\u3053\u306e\u3068\u304d\uff0c\u30b7\u30e7\u30c3\u30af\u5f8c\u306e\u9700\u8981\u66f2\u7dda\u3068\u3057\u3066\u6700\u3082\u9069\u5f53\u306a\u3082\u306e\u3092\u6b21\u306e\u56f3\u304b\u3089\u9078\u3073\u306a\u3055\u3044\uff0e\u305f\u3060\u3057\u30b7\u30e7\u30c3\u30af\u5f8c\u306e\u9700\u8981\u66f2\u7dda\u306f\u5b9f\u7dda\u3067\u63cf\u3044\u3066\u3044\u308b\uff0e\n\n#image(\"img/Q8_img.png\")\n \n],answer:[],point:3, category:\"Term1\"),\n\nquiz(\"Q9\",question:[A\u6c0f\u306fX\u793e\u306b\u5165\u793e\u3059\u308b\u30682000\u4e07\u5186\uff0cY\u793e\u306b\u5165\u793e\u3059\u308b\u30681500\u4e07\u5186\uff0cZ\u793e\u306b\u5165\u793e\u3059\u308b\u30683000\u4e07\u5186\u306e\u53ce\u5165\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3059\u308b\uff0e\u5f7c\u306f\u3053\u306e\u3046\u3061X\u793e\u3068Y\u793e\u306b\u306f\u5165\u793e\u3067\u304d\u308b\u304cZ\u793e\u306b\u306f\u5165\u793e\u3067\u304d\u306a\u3044\uff0e\u307e\u305f\u540c\u6642\u306b\u4e8c\u793e\u4ee5\u4e0a\u306b\u306f\u5c31\u8077\u3067\u304d\u306a\u3044\u3082\u306e\u3068\u3059\u308b. \u5f7c\u306f\u4eca\u307e\u3067\u6559\u80b2\u8cbb\u7528\u306b\uff17\u5104\u5186\u3092\u8cbb\u3084\u3057\u3066\u304d\u305f\uff0e\u4e00\u65b9\u3067A\u6c0f\u306f\u73fe\u5728\u5c31\u8077\u3057\u3066\u3044\u306a\u3044\uff0e\u5c31\u8077\u305b\u305a\u306b\u30cb\u30fc\u30c8\u3067\u3044\u308b\u3053\u3068\u306e\u52b9\u7528\u306f0\u3067\u3042\u308b\uff0e\u3053\u306e\u3053\u3068\u304b\u3089\u5c31\u8077\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u5fc3\u7406\u7684\u306a\u8cbb\u7528\u304c\u304b\u304b\u308b\u3088\u3046\u3067\u3042\u308b\uff0e\u3053\u306e\u5fc3\u7406\u7684\u306a\u8cbb\u7528\u306f\u3044\u304f\u3089\u4ee5\u4e0a\u3067\u3042\u308b\u3068\u8003\u3048\u3089\u308c\u308b\u304b\u7b54\u3048\u306a\u3055\u3044\uff0e\u305f\u3060\u3057\u3053\u306e\u554f\u984c\u6587\u306b\u51fa\u3066\u304d\u3066\u3044\u306a\u3044\u8981\u7d20\u306f\u7121\u8996\u3057\u3066\u826f\u3044\u3082\u306e\u3068\u3059\u308b\uff0e], category:\"Term1\"),\nquiz(\"Q10\",question:[\u5f93\u91cf\u7a0e\u304c$t$\u3060\u3051\u8ab2\u3055\u308c\u308b\u8ca1\u3092\u8003\u3048\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u8ab2\u7a0e\u306e\u6b7b\u8377\u91cd\u640d\u5931\u306e\u5927\u304d\u3055\u3092\u56f3\u793a\u3057\u306a\u3055\u3044\uff0e\n],category:\"Term1\"),\nquiz(\"Q11\",question:[\u9d8f\u5375\u306e\u4fa1\u683c\u3068\u53d6\u5f15\u91cf\u304c\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u305f\n\n- 1\u67081\u65e5: \u4fa1\u683c100, \u53d6\u5f15\u91cf140\n- 3\u67081\u65e5: \u4fa1\u683c120, \u53d6\u5f15\u91cf100\n- 5\u67081\u65e5: \u4fa1\u683c200, \u53d6\u5f15\u91cf80\n\n\u307e\u305f\uff0c1\u670815\u65e5\u306f\u9ce5\u30a4\u30f3\u30d5\u30eb\u30a8\u30f3\u30b6\u306b\u3088\u308a\u5927\u91cf\u306e\u9d8f\u306e\u6bba\u51e6\u5206\u304c\u884c\u308f\u308c\uff0c3\u670815\u65e5\u306b\u306f\u9d8f\u306e\u990c\u4ee3\u306e\u4fa1\u683c\u304c\u4e0a\u6607\u3057\u305f\u3068\u3044\u3046\uff0e\n\n\u4ee5\u4e0a\u306e\u4e8b\u67c4\u304b\u3089\u308f\u304b\u308b\u3053\u3068\u3068\u3057\u3066\u6700\u3082\u9069\u5f53\u306a\u3082\u306e\u3092\u4ee5\u4e0b\u306e\u4e2d\u304b\u3089\u4e00\u3064\u9078\u3073\uff0c\u305d\u306e\u7406\u7531\u3092\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e\n+ \u9d8f\u5375\u306e\u9700\u8981\u66f2\u7dda\u306f\u53f3\u4e0b\u304c\u308a\u3067\u3042\u308b.\n+ \u9d8f\u5375\u306e\u9700\u8981\u66f2\u7dda\u306f\u53f3\u4e0a\u304c\u308a\u3067\u3042\u308b.\n+ \u9d8f\u5375\u306e\u4f9b\u7d66\u66f2\u7dda\u306f\u53f3\u4e0b\u304c\u308a\u3067\u3042\u308b.\n+ \u9d8f\u5375\u306e\u4f9b\u7d66\u66f2\u7dda\u306f\u53f3\u4e0a\u304c\u308a\u3067\u3042\u308b.\n\n\n\u305f\u3060\u3057\uff0c\u9700\u8981\u3068\u4f9b\u7d66\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u4ee5\u4e0b\u306e\uff14\u3064\u3067\u3042\u308b\u3068\u3059\u308b\uff0e\n\n#image(\"img/patterns.png\")],category:\"Term1\"),\n\nquiz(\"Q12\",question:[\u3042\u308b\u822a\u7a7a\u4f1a\u793e\u304c\u822a\u7a7a\u6a5f\u306e\u904b\u884c\u306e\u305f\u3081\uff0c\u71c3\u6599\u3092\uff11\uff10\u5104\u5186\u5206\u8cfc\u5165\u3057\u305f\uff0e\u3057\u304b\u3057\uff0c\u305d\u306e\u76f4\u5f8c\uff0cCOVID2019\u306e\u6d41\u884c\u306b\u3088\u308a\uff0c\u3057\u3070\u3089\u304f\u306e\u9593\uff0c\u71c3\u6599\u304c\u4f7f\u7528\u3055\u308c\u308b\u898b\u8fbc\u307f\u304c\u306a\u304f\u306a\u3063\u305f\uff0e\u307e\u305f\uff0c\u5168\u4e16\u754c\u7684\u306b\u71c3\u6599\u306e\u9700\u8981\u304c\u4f4e\u4e0b\u3057\u305f\u305f\u3081\uff0c\u3053\u306e\u71c3\u6599\u3092\u8ee2\u58f2\u3059\u308b\u3053\u3068\u306f\u4e8c\u5e74\u9593\uff0c\u4e0d\u53ef\u80fd\u3068\u306a\u3063\u305f\uff0e\u4e00\u65b9\uff0c\u3053\u306e\u71c3\u6599\u3092\u7528\u3044\u305f\u305d\u306e\u4ed6\u306e\u4e8b\u696d\u306f\u53ef\u80fd\u3067\u3042\u308b\uff0e\u305d\u306e\u4ed6\u4e8b\u696d\u306f\u8907\u6570\u7a2e\u985e\u3042\u308a\uff0c\u4e8b\u696d\u306b\u3088\u3063\u3066\u3053\u306e\u71c3\u6599\u3092\u4f7f\u3046\u91cf\u306f\u7570\u306a\u308b\uff0e\u3053\u306e\u3068\u304d\u306e\u71c3\u6599\u3092\u8cfc\u5165\u3057\u305f\u8cbb\u7528\u306f\u56fa\u5b9a\u8cbb\u7528\u3068\u8a00\u3048\u308b\u304b\uff0c\u307e\u305f\u57cb\u6ca1\u8cbb\u7528\u3068\u8a00\u3048\u308b\u304b\uff0c\u7b54\u3048\u306a\u3055\u3044\uff0e],category:\"Term1\"),\n\nquiz(\"Q13\",question:[\u7b2c\uff11\u8ca1\u3068\u7b2c\uff12\u8ca1\u3057\u304b\u8cfc\u5165\u3057\u306a\u3044\u6d88\u8cbb\u8005\u3092\u8003\u3048\u308b\uff0e2024\u5e74\u6642\u70b9\u3067\u306f\uff0c\u7b2c\uff11\u8ca1\u306b\u5168\u3066\u306e\u6240\u5f97\u3092\u4f7f\u3063\u305f\u5834\u5408\uff0c\u7b2c\uff11\u8ca1\u3092\u4e09\u5341\u5358\u4f4d\u8cfc\u5165\u53ef\u80fd\u3067\u3042\u3063\u305f\uff0e\u307e\u305f\uff0c2024\u5e74\u6642\u70b9\u3067\u306f\u6d88\u8cbb\u8005\u306f\u7b2c\uff12\u8ca1\u3092\u4e09\u5358\u4f4d\u8cfc\u5165\u3057\u3066\u3044\u308b\uff0e2025\u5e74\u6642\u70b9\u3067\u306f\u7b2c\uff11\u8ca1\u306e\u4fa1\u683c\u304c\u5897\u52a0\u3057\u305f\u4e00\u65b9\uff0c\u6240\u5f97\u3082\u5897\u52a0\u3057\u305f\uff0e\u7d50\u679c\u3068\u3057\u3066\uff0c2025\u5e74\u306b\u306f\u7b2c\uff11\u8ca1\u306b\u5168\u3066\u306e\u6240\u5f97\u3092\u4f7f\u3063\u305f\u7d50\u679c\uff0c\u7b2c\uff11\u8ca1\u3092\u4e09\u5341\u5358\u4f4d\u8cfc\u5165\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3042\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u3053\u306e\u6d88\u8cbb\u8005\u306e\u52b9\u7528\u306f2024\u5e74\u304b\u308925\u5e74\u306b\u304b\u3051\u3066\u5897\u52a0\u3059\u308b\u304b\uff0c\u56f3\u3092\u7528\u3044\u3066\u7406\u7531\u3092\u542b\u3081\u3066\u7b54\u3048\u306a\u3055\u3044\uff0e\u305f\u3060\u3057\uff0c2024\u5e74\u306e\u610f\u601d\u6c7a\u5b9a\u30682025\u5e74\u306e\u610f\u601d\u6c7a\u5b9a\u306f\u72ec\u7acb\u3067\u3042\u308b\u3068\u3057\uff0c\u307e\u305f\u6d88\u8cbb\u8005\u306e\u7121\u5dee\u5225\u66f2\u7dda\u306f\u5168\u304f\u5909\u308f\u3089\u306a\u3044\u3082\u306e\u3068\u3059\u308b\uff0e],category:\"Term2\"),\n\nquiz(\"Q14\", question:[\u8ca1\u304c\u4e8c\u7a2e\u985e\u3057\u304b\u306a\u3044\u3068\u3059\u308b\uff0e\u4e00\u3064\u306e\u8ca1\u304c\u4e0a\u7d1a\u8ca1\u3067\u3042\u308b\u5834\u5408\uff0c\u3082\u3046\u4e00\u3064\u306e\u8ca1\u306f\u4e0b\u7d1a\u8ca1\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q15\", question:[\u8ca1\u304c\u4e8c\u7a2e\u985e\u3057\u304b\u306a\u3044\u3068\u3059\u308b\uff0e\u4e00\u3064\u306e\u8ca1\u304c\u4e0b\u7d1a\u8ca1\u3067\u3042\u308b\u5834\u5408\uff0c\u3082\u3046\u4e00\u3064\u306e\u8ca1\u306f\u4e0a\u7d1a\u8ca1\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q16\", question:[\u6d88\u8cbb\u30d7\u30e9\u30f3$w$\u3068$w'$\u304c\u7121\u5dee\u5225\u3067\u3042\u308b\u3068\u306f\u3069\u3046\u8a00\u3046\u3053\u3068\u304b\uff0c\u52b9\u7528\u95a2\u6570$u$\u3092\u7528\u3044\u3066\u7b54\u3048\u306a\u3055\u3044\uff0e\n], category:\"Term2\"),\nquiz(\"Q17\", question:[\u52b9\u7528\u3092\u6700\u5927\u5316\u3059\u308b\u6d88\u8cbb\u30d7\u30e9\u30f3\u306b\u304a\u3044\u3066\uff0c\u7121\u5dee\u5225\u66f2\u7dda\u3068\u4e88\u7b97\u5236\u7d04\u7dda\u304c\u63a5\u3059\u308b\u7406\u7531\u3092\u56f3\u3092\u7528\u3044\u3066\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term2\"),\nquiz(\"Q18\", question:[\u6b21\u306e\u30de\u30a6\u30b9\u3092\u7528\u3044\u305f\u67b6\u7a7a\u306e\u5b9f\u9a13\u3092\u8003\u3048\u308b\uff0e\u30de\u30a6\u30b9\u306e\u30b1\u30fc\u30b8\u306b\u306f\u30ec\u30d0\u30fc\u304c\u4e8c\u3064\u3042\u308a\uff0c\u305d\u306e\u30ec\u30d0\u30fc\u3092\u62bc\u3059\u3068\u4e00\u5b9a\u306e\u91cf\u306e\u30a8\u30b5\u304c\u51fa\u308b\uff0e\u305d\u308c\u305e\u308c\u306e\u30ec\u30d0\u30fc\u3092A\u3068B\u3068\u547c\u3076\uff0e\u30ec\u30d0\u30fcA\u30921\u56de\u62bc\u3059\u3068\u901a\u5e38\u306e\u30a8\u30b5\u304c1\u7c92\u3067\u3066\u304f\u308b\u304c\uff0c\u30ec\u30d0\u30fcB\u3092\u62bc\u3059\u3068\u30ad\u30cb\u30fc\u30cd\u5165\u308a\u306e\u30a8\u30b5\u304c3\u7c92\u3067\u308b\uff0e \u30ec\u30d0\u30fc\u3092\u62bc\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u56de\u6570\u306fA\u3068B\u306e\u5408\u8a08\u3067100\u56de\u3068\u6c7a\u307e\u3063\u3066\u3044\u308b\uff0e\n+ \u30de\u30a6\u30b9\u304c\u3069\u3061\u3089\u306e\u30ec\u30d0\u30fc\u3092\u62bc\u3059\u304b\u3068\u3044\u3046\u554f\u984c\u306f\uff0c\u6d88\u8cbb\u8005\u7406\u8ad6\u306b\u304a\u3051\u308b\u52b9\u7528\u6700\u5927\u5316\u554f\u984c\u3068\u89e3\u91c8\u3067\u304d\u308b\uff0e\u30ec\u30d0\u30fc\u3092\u62bc\u3057\u305f\u6642\u306b\u51fa\u3066\u304f\u308b\u30a8\u30b5\u306e\u7c92\u306e\u500b\u6570\u3068\u30ec\u30d0\u30fc\u3092\u62bc\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u56de\u6570\u306f\u305d\u308c\u305e\u308c\u6d88\u8cbb\u8005\u306e\u52b9\u7528\u6700\u5927\u5316\u554f\u984c\u306e\u4f55\u306b\u5bfe\u5fdc\u3059\u308b\u304b\u3092\u7406\u7531\u3092\u542b\u3081\u3066\u7b54\u3048\u306a\u3055\u3044\uff0e\n+ \u30ec\u30d0\u30fc\u3092\u62bc\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u56de\u6570\u304c100\u56de\u304b\u3089120\u56de\u306b\u5897\u3048\u305f\uff0e\u3053\u306e\u3068\u304d\uff0c\u30de\u30a6\u30b9\u304c\u30ec\u30d0\u30fcA\u3092\u62bc\u3059\u56de\u6570\u306f\u5897\u52a0\u3057\uff0c\u30ec\u30d0\u30fcB\u3092\u62bc\u3059\u56de\u6570\u306f\u6e1b\u5c11\u3057\u305f\uff0e\u3053\u306e\u884c\u52d5\u306e\u5909\u5316\u3092\u7121\u5dee\u5225\u66f2\u7dda\u3068\u4e88\u7b97\u5236\u7d04\u7dda\u3092\u7528\u3044\u3066\u56f3\u793a\u3057\u306a\u3055\u3044\uff0e\n+ \uff12\u306e\u7d50\u679c\u304b\u3089\u901a\u5e38\u306e\u30a8\u30b5\u3068\u30ad\u30cb\u30fc\u30cd\u5165\u308a\u306e\u30a8\u30b5\u306b\u3064\u3044\u3066\u8a00\u3048\u308b\u3053\u3068\u306e\u3046\u3061\u6700\u3082\u9069\u5f53\u306a\u3082\u306e\u3092\u6b21\u306e\u4e2d\u304b\u3089\u9078\u3073\uff0c\u305d\u306e\u7406\u7531\u3092\u7b54\u3048\u306a\u3055\u3044.\n #set enum(numbering: \"a.\") \n + \u901a\u5e38\u306e\u30a8\u30b5\u306f\u30ad\u30cb\u30fc\u30cd\u5165\u308a\u306e\u30a8\u30b5\u306e\u7c97\u88dc\u5b8c\u8ca1\u3067\u3042\u308b\uff0e\n + \u901a\u5e38\u306e\u30a8\u30b5\u306f\u30ad\u30cb\u30fc\u30cd\u5165\u308a\u306e\u30a8\u30b5\u306e\u7c97\u4ee3\u66ff\u6750\u3067\u3042\u308b\uff0e\n + \u901a\u5e38\u306e\u30a8\u30b5\u306f\u6b63\u5e38\u8ca1\uff08\u4e0a\u7d1a\u8ca1\uff09\u3067\u30ad\u30cb\u30fc\u30cd\u5165\u308a\u306e\u30a8\u30b5\u306f\u52a3\u7b49\u8ca1\uff08\u4e0b\u7d1a\u8ca1\uff09\u3067\u3042\u308b\uff0e\n + \u901a\u5e38\u306e\u30a8\u30b5\u306f\u52a3\u7b49\u8ca1\uff08\u4e0b\u7d1a\u8ca1\uff09\u3067\u30ad\u30cb\u30fc\u30cd\u5165\u308a\u306e\u30a8\u30b5\u306f\u6b63\u5e38\u8ca1\uff08\u4e0a\u7d1a\u8ca1\uff09\u3067\u3042\u308b\uff0e], category:\"Term2\"),\nquiz(\"Q19\", question:[\u7121\u5dee\u5225\u66f2\u7dda\u304c\u539f\u70b9\u306b\u5411\u304b\u3063\u3066\u51f8\u3067\u3042\u308b\u3068\u3059\u308b\uff0e\u3044\u307e\uff0c\u30de\u30b0\u30ed\u3068\u30a8\u30d3\u306e\u5bff\u53f8\u3092\u4f55\u8cab\u3065\u3064\u98df\u3079\u308b\u304b\u3068\u8a00\u3046\u554f\u984c\u3092\u8003\u3048\u308b\uff0e\u300c\u30de\u30b0\u30ed1\u8cab\u3068\u30a8\u30d33\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u3068\u300c\u30de\u30b0\u30ed3\u8cab\u3068\u30a8\u30d31\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u304c\u7121\u5dee\u5225\u3067\u3042\u308b\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u300c\u30de\u30b0\u30ed2\u8cab\uff0c\u30a8\u30d3\uff12\u8cab\u3068\u8a00\u3046\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u306b\u3064\u3044\u3066\u8a00\u3048\u308b\u3053\u3068\u306b\u3064\u3044\u3066\u6700\u3082\u9069\u5f53\u306a\u3082\u306e\u306f\u6b21\u306e\u3046\u3061\u3069\u308c\u304b\uff1f\n#set enum(numbering: \"a.\") \n+ \u300c\u30de\u30b0\u30ed2\u8cab\uff0c\u30a8\u30d3\uff12\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u306f\u300c\u30de\u30b0\u30ed1\u8cab\u3068\u30a8\u30d33\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u3068\u300c\u30de\u30b0\u30ed3\u8cab\u3068\u30a8\u30d31\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u306e\u3069\u3061\u3089\u3088\u308a\u3082\u597d\u307e\u3057\u3044\n+ \u300c\u30de\u30b0\u30ed2\u8cab\uff0c\u30a8\u30d3\uff12\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u306f\u300c\u30de\u30b0\u30ed1\u8cab\u3068\u30a8\u30d33\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u3068\u300c\u30de\u30b0\u30ed3\u8cab\u3068\u30a8\u30d31\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u306e\u3069\u3061\u3089\u3088\u308a\u3082\u597d\u307e\u3057\u304f\u306a\u3044\n+ \u300c\u30de\u30b0\u30ed2\u8cab\uff0c\u30a8\u30d3\uff12\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u306f\u300c\u30de\u30b0\u30ed1\u8cab\u3068\u30a8\u30d33\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u3088\u308a\u597d\u307e\u3057\u3044\u304c\uff0c\u300c\u30de\u30b0\u30ed3\u8cab\u3068\u30a8\u30d31\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u3088\u308a\u597d\u307e\u3057\u304f\u306a\u3044\n+ \u300c\u30de\u30b0\u30ed2\u8cab\uff0c\u30a8\u30d3\uff12\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u306f\u300c\u30de\u30b0\u30ed1\u8cab\u3068\u30a8\u30d33\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u3088\u308a\u597d\u307e\u3057\u304f\u306a\u3044\u304c\uff0c\u300c\u30de\u30b0\u30ed3\u8cab\u3068\u30a8\u30d31\u8cab\u306e\u6d88\u8cbb\u30d7\u30e9\u30f3\u300d\u3088\u308a\u597d\u307e\u3057\u3044\n+ \u4e0a\u8a18\u306e\u3046\u3061\u3044\u305a\u308c\u3082\u3044\u3048\u306a\u3044\uff0e], category:\"Term2\"),\nquiz(\"Q20\", question:[\u7c97\u88dc\u5b8c\u8ca1\u3068\u7c97\u4ee3\u66ff\u8ca1\u306e\u9055\u3044\u3092\u4f8b\u3092\u6319\u3052\u3066\u8ff0\u3079\u306a\u3055\u3044\uff0e], category:\"Term2\"),\nquiz(\"Q21\", question:[\u4ee3\u66ff\u8ca1\u3068\u7c97\u4ee3\u66ff\u8ca1\u306e\u9055\u3044\u3092\u4f8b\u3092\u6319\u3052\u3066\u8ff0\u3079\u306a\u3055\u3044\uff0e], category:\"Term2\"),\nquiz(\"Q22\", question:[\uff12\u7a2e\u985e\u3057\u304b\u8ca1\u304c\u306a\u3044\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u4e00\u65b9\u304c\u5fc5\u9700\u8ca1\u3067\u3042\u308c\u3070\u3082\u3046\u4e00\u65b9\u306f\u8d05\u6ca2\u8ca1\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u5e38\u306b\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q23\", question:[\u4e8c\u65e5\u9593\u3057\u304b\u751f\u304d\u306a\u3044\u4eba\u306e\u8caf\u84c4\u554f\u984c\u3092\u8003\u3048\u308b\uff0e\uff11\u65e5\u76ee\u306e\u6d88\u8cbb\u30682\u65e5\u76ee\u306e\u6d88\u8cbb\u304c\u7c97\u4ee3\u66ff\u8ca1\u3067\u304b\u3064\u4e21\u65b9\u3068\u3082\u4e0a\u7d1a\u8ca1\u3067\u3042\u308b\u3068\u304d\uff0c\u5229\u5b50\u7387\u306e\u5897\u52a0\u306f\u8caf\u84c4\u3092\u5897\u52a0\u3055\u305b\u308b\u304b\u3069\u3046\u304b\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term2\"),\nquiz(\"Q24\", question:[\u6d88\u8cbb\u3068\u4f59\u6687\u306e\u9078\u629e\u554f\u984c\u3092\u8003\u3048\u308b\uff0e\u4f59\u6687\u304c\u4e0b\u7d1a\u8ca1\u3067\u3042\u308b\u3068\u304d\uff0c\u6642\u7d66\u306e\u5897\u52a0\u306f\u4f59\u6687\u3092\u5897\u3084\u3059\u304b\u3069\u3046\u304b\uff0c\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term2\"),\nquiz(\"Q25\", question:[\u3042\u308b\u4fa1\u683c\u3068\u6240\u5f97\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u4e0b\u7d1a\u8ca1\u306b\u306a\u3063\u3066\u3044\u308b\u8ca1\u304c\u3042\u308b\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u52b9\u7528\u95a2\u6570\u3092\u3046\u307e\u304f\u4f5c\u308c\u3070\u3069\u3093\u306a\u4fa1\u683c\u3068\u6240\u5f97\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3082\u4e0b\u7d1a\u8ca1\u306b\u306a\u308b\u3088\u3046\u306b\u3067\u304d\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q26\", question:[\u30ae\u30c3\u30d5\u30a7\u30f3\u8ca1\u306f\u4e0b\u7d1a\u8ca1\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q27\", question:[\u8ca11\u3068\u8ca12\u304c\u4ee3\u66ff\u8ca1\u3067\u3082\u7c97\u88dc\u5b8c\u8ca1\u306b\u306a\u308b\u53ef\u80fd\u6027\u306f\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q28\", question:[\u8ca11\u3068\u8ca12\u304c\u4ee3\u66ff\u8ca1\u3067\u3042\u308b\u304c\u7c97\u88dc\u5b8c\u8ca1\u3067\u3042\u308b\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\u3069\u3061\u3089\u304b\u306e\u8ca1\u306f\u4e0b\u7d1a\u8ca1\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q29\", question:[\u8ca1\u304c\uff12\u7a2e\u985e\u3057\u304b\u306a\u3044\u3068\u3059\u308b\uff0e\u8ca11\u304c\u30ae\u30c3\u30d5\u30a7\u30f3\u8ca1\u3067\u3042\u308c\u3070\uff0c\u8ca1\uff12\u306f\u8ca1\uff11\u306e\u7c97\u88dc\u5b8c\u8ca1\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\"),\nquiz(\"Q30\", question:[#kuranenv[\u4ee5\u4e0b\u306e\u6587\u7ae0\u306e\u7a7a\u6b04\u30a2\u301c\u30ab\u3092\u57cb\u3081\u306a\u3055\u3044\uff0e\n\n\u7dcf\u8cbb\u7528\u95a2\u6570\u3092$C(q)= 7 q^3-5 q^2+ 3q+16$\u3068\u3059\u308b\uff0e\n\u3053\u306e\u3068\u304d\uff0c\u53ef\u5909\u8cbb\u7528\uff08\u5909\u52d5\u8cbb\u7528\uff09\u306f #kuran() \u3067\u3042\u308b\uff0e\n\u4fa1\u683c\u304c\uff0c$ #kuran() (q_1)^2- #kuran() q_1+ #kuran()$ \u3092\u4e0b\u56de\u308c\u3070\uff0c\u64cd\u696d\u3092\u505c\u6b62\u3057\u305f\u65b9\u304c\u826f\u3044\uff0e\u307e\u305f\uff0c\u4fa1\u683c\u304c $ #kuran(n:2) (q_2)^2- #kuran(n:3) q_2+ #kuran(n:4)$ \u3092\u4e0b\u56de\u308b\u3068\u5229\u6f64\u304c\u30de\u30a4\u30ca\u30b9\u306b\u306a\u308b\uff0e\n\n\u305f\u3060\u3057\uff0c$q_1$\u306f\u65b9\u7a0b\u5f0f\uff0c#kuran() \u306e\u89e3\u306e\u3046\u3061\u6b63\u306e\u3082\u306e\u3067\u3042\u308a\uff0c$q_2$\u306f\u65b9\u7a0b\u5f0f\uff0c#kuran() \u306e\u89e3\u306e\u3046\u3061\uff0c\u5b9f\u6570\u306e\u3082\u306e\u3067\u3042\u308b\uff0e]], category:\"Term3\"),\n\nquiz(\"Q31\", question:[$y$\u3060\u3051\u306e\u8ca1\u3092\u751f\u7523\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u751f\u7523\u8981\u7d20\u306e\u6295\u5165\u7d44\uff08\u751f\u7523\u30d7\u30e9\u30f3\uff09\u306b\u3064\u3044\u3066\uff0c\u8cbb\u7528\u3092\u6700\u5c0f\u306b\u3059\u308b\u70b9\u306b\u304a\u3044\u3066\u7b49\u7523\u51fa\u91cf\u66f2\u7dda\uff08\u7b49\u91cf\u66f2\u7dda\uff09\u3068\u7b49\u8cbb\u7528\u7dda\u304c\u63a5\u3059\u308b\u7406\u7531\u3092\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term3\"),\n\nquiz(\"Q32\", question:[#kuranenv[\u4ee5\u4e0b\u306e\u6587\u7ae0\u306e\u7a7a\u6b04\u30a2\u3068\u30a4\u3092\u57cb\u3081\u306a\u3055\u3044\uff0e\u305f\u3060\u3057\u3069\u3061\u3089\u306b\u3082\u6570\u5b57\u304c\u5165\u308b\uff0e\n\n\u7dcf\u8cbb\u7528\u95a2\u6570\u3092$C(q)= 2 q^3-4 q^2+ 7q+16$\u3068\u3059\u308b\uff0e\n\u3053\u306e\u3068\u304d\uff0c\u56fa\u5b9a\u8cbb\u7528\u306f #kuran() \u3067\u3042\u308b\uff0e\n\u307e\u305f\uff0c\u4fa1\u683c\u304c\uff0c$#kuran() $ \u3092\u4e0b\u56de\u308c\u3070\uff0c\u64cd\u696d\u3092\u505c\u6b62\u3057\u305f\u65b9\u304c\u826f\u3044\uff0e\n]], category:\"Term3\"),\n\nquiz(\"Q33\", question:[\u540c\u3058\u751f\u7523\u91cf\u3092\u751f\u7523\u3059\u308b\u3068\u304d\uff0c\u9577\u671f\u306e\u8cbb\u7528\u306f\u5fc5\u305a\u77ed\u671f\u306e\u8cbb\u7528\u3092\u4e0b\u56de\u308b\u304b\u540c\u3058\u304b\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term3\"),\n\nquiz(\"Q34\", question:[\u751f\u7523\u95a2\u6570\u304c\u898f\u6a21\u306b\u95a2\u3057\u3066\u53ce\u7a6b\u9013\u5897\u3067\u3042\u308c\u3070\uff0c\u4fa1\u683c\u53d7\u5bb9\u8005\u306e\u4f01\u696d\u306b\u3068\u3063\u3066\u306f\u751f\u7523\u8981\u7d20\u3092\u7121\u9650\u306b\u6295\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3042\u308c\u3070\u305d\u3046\u3059\u308b\u306e\u304c\u826f\u3044\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term3\"),\n\nquiz(\"Q35\", question:[\u751f\u7523\u95a2\u6570\u304c\u898f\u6a21\u306b\u95a2\u3057\u3066\u53ce\u7a6b\u9013\u6e1b\u3067\u3042\u308c\u3070\uff0c\u4fa1\u683c\u53d7\u5bb9\u8005\u306e\u4f01\u696d\u306b\u3068\u3063\u3066\u306f\u751f\u7523\u8981\u7d20\u30920\u306b\u3059\u308b\u306e\u304c\u826f\u3044\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term3\"),\n\nquiz(\"Q36\", question:[\u3042\u308b\u4fa1\u683c\u3068\u751f\u7523\u8981\u7d20\u4fa1\u683c\u306b\u304a\u3044\u3066\u5229\u6f64\u304c\u6b63\u3067\u3042\u308b\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u751f\u7523\u95a2\u6570\u304c\u898f\u6a21\u306b\u95a2\u3057\u3066\u53ce\u7a6b\u9013\u5897\u3067\u3042\u308c\u3070\uff0c\u4fa1\u683c\u53d7\u5bb9\u8005\u306e\u4f01\u696d\u306b\u3068\u3063\u3066\u306f\u751f\u7523\u8981\u7d20\u3092\u7121\u9650\u306b\u6295\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3042\u308c\u3070\u305d\u3046\u3059\u308b\u306e\u304c\u826f\u3044\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term3\"),\n\nquiz(\"Q37\", question:[\u4f01\u696d\u306e\u5229\u6f64\u6700\u5927\u5316\u554f\u984c\u3067\u306f\u9650\u754c\u751f\u7523\u7269\u3068\u5b9f\u8cea\u8981\u7d20\u4fa1\u683c\u304c\u7b49\u3057\u304f\u306a\u308b\u304c\uff0c\u6d88\u8cbb\u8005\u306e\u52b9\u7528\u6700\u5927\u5316\u554f\u984c\u3067\u306f\u9650\u754c\u52b9\u7528\u3068\u4fa1\u683c\u304c\u7b49\u3057\u304f\u306a\u308b\u3068\u306f\u9650\u3089\u306a\u3044\uff0e\u3053\u306e\u9055\u3044\u304c\u751f\u3058\u308b\u7406\u7531\u306f\u4f55\u304b\uff1f], category:\"Term3\"),\n\nquiz(\"Q38\", question:[#kuranenv[\u3044\u307e\uff0c\u7d4c\u6e08\u306e\u69cb\u6210\u54e1\u304c\u30a2\u30c0\u30e0\uff0c\u30a4\u30f4\uff0c\u30eb\u30c4\u306e\u4e09\u4eba\u3060\u3068\u3059\u308b\uff0e\u53ef\u80fd\u306a\u9078\u629e\u80a2\u306fx, y, z, w, v\u306e\uff15\u3064\u3067\u3042\u308b\u3068\u3057\u3088\u3046\uff0e\u5404\u9078\u629e\u80a2\u304b\u3089\u5f97\u3089\u308c\u308b\u5404\u69cb\u6210\u54e1\u306e\u52b9\u7528\u306f\u6b21\u306e\u8868\u306e\u901a\u308a\u3067\u3042\u308b\u3068\u3059\u308b\uff0e\n#align(center)[\n#table(columns:(4em,auto,auto,auto,auto,auto),\n [\u540d\u524d],[x],[y],[z],[w],[v],\n [\u30a2\u30c0\u30e0],[2],[2],[1],[8],[1],\n [\u30a4\u30f4],[3],[8],[6],[9],[3],\n [\u30eb\u30c4],[4],[4],[20],[1],[4] \n)\n]\n + \u529f\u5229\u4e3b\u7fa9\u578b\u793e\u4f1a\u539a\u751f\u3092\u6700\u5927\u306b\u3059\u308b\u9078\u629e\u80a2\u3092\u5168\u3066\u9078\u3073\u306a\u3055\u3044\uff0e\n + \u30ca\u30c3\u30b7\u30e5\u578b\u793e\u4f1a\u539a\u751f\u3092\u6700\u5927\u306b\u3059\u308b\u9078\u629e\u80a2\u3092\u5168\u3066\u9078\u3073\u306a\u3055\u3044\uff0e\n + \u30de\u30ad\u30b7\u30df\u30f3\u578b\u793e\u4f1a\u539a\u751f\u3092\u6700\u5927\u306b\u3059\u308b\u9078\u629e\u80a2\u3092\u5168\u3066\u9078\u3073\u306a\u3055\u3044\uff0e\n + \u30d1\u30ec\u30fc\u30c8\u52b9\u7387\u7684\u306a\u9078\u629e\u80a2\u3092\u5168\u3066\u9078\u3073\u306a\u3055\u3044\uff0e]], category:\"Term4\"),\nquiz(\"Q39\", question:[\u7b2c\u4e00\u539a\u751f\u5b9a\u7406\uff08\u539a\u751f\u7d4c\u6e08\u5b66\u306e\u7b2c\u4e00\u57fa\u672c\u5b9a\u7406\uff09\u306e\u4e3b\u5f35\u3092\uff11\u884c\u3067\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e\n], category:\"Term4\"),\nquiz(\"Q40\", question:[\u30a8\u30c3\u30b8\u30ef\u30fc\u30b9\u30dc\u30c3\u30af\u30b9\u4e2d\u306e\u914d\u5206\u306b\u3064\u3044\u3066\uff0c\u30d1\u30ec\u30fc\u30c8\u52b9\u7387\u7684\u306a\u914d\u5206\u3068\u305d\u3046\u3067\u306a\u3044\u914d\u5206\u3092\u56f3\u793a\u3057\uff0c\u305d\u308c\u3089\u304c\u306a\u305c\u305d\u3046\u8a00\u3048\u308b\u304b\u3092\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e\n], category:\"Term4\"),\nquiz(\"Q41\", question:[\u8ca1\u304c\uff12\u7a2e\u985e\u3057\u304b\u306a\u3044\u3068\u3059\u308b\uff0e\u8ca1$x$\u306e\u9700\u8981\u95a2\u6570\u304c\uff0c$d_x (p_x,p_y)=20-4p_x+p_y$, \u8ca1$y$\u306e\u9700\u8981\u95a2\u6570\u304c$d_y (p_x,p_y)=12+p_x-4p_y$\u3068\u3057\uff0c\u8ca1$x$\u306e\u4f9b\u7d66\u91cf\u304c$5$, \u8ca1$y$\u306e\u4f9b\u7d66\u91cf\u304c$3$\u3060\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\uff0c\u5e02\u5834\u5747\u8861\u306e\u8ca1$x$\u3068$y$\u306e\u4fa1\u683c\u3092\u6c42\u3081\u306a\u3055\u3044\uff0e], category:\"Term4\"),\n\nquiz(\"Q42\", question:[\u7b2c\u4e00\u539a\u751f\u5b9a\u7406\u304c\u6210\u308a\u7acb\u3064\u7406\u7531\u3092\u30a8\u30c3\u30b8\u30ef\u30fc\u30b9\u30dc\u30c3\u30af\u30b9\u3092\u7528\u3044\u3066\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term4\"),\n\nquiz(\"Q43\", question:[\u7b2c\u4e8c\u539a\u751f\u5b9a\u7406\uff08\u539a\u751f\u7d4c\u6e08\u5b66\u306e\u7b2c\u4e00\u57fa\u672c\u5b9a\u7406\uff09\u306e\u4e3b\u5f35\u3092\uff11\u884c\u3067\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term4\"),\n\nquiz(\"Q44\", question:[\u7b2c\u4e8c\u539a\u751f\u5b9a\u7406\u304c\u6210\u308a\u7acb\u3064\u7406\u7531\u3092\u30a8\u30c3\u30b8\u30ef\u30fc\u30b9\u30dc\u30c3\u30af\u30b9\u3092\u7528\u3044\u3066\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e\n], category:\"Term4\"),\n\nquiz(\"Q45\", question:[\u7d14\u7c8b\u4ea4\u63db\u7d4c\u6e08\u306b\u304a\u3051\u308b\u30ef\u30eb\u30e9\u30b9\u5747\u8861\u3068\u306f\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u304b\uff0c\u6d88\u8cbb\u8005\u304c\u4e8c\u4eba\uff0c\u8ca1\u306e\u6570\u304c\u4e8c\u4eba\u306e\u30b1\u30fc\u30b9\u3067\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term4\"),\n\n\nquiz(\"Q46\", question:[\u56fa\u5b9a\u8cbb\u7528\u304c\u8ca0\u306e\u3068\u304d\uff0c\u640d\u76ca\u5206\u5c90\u70b9\u3068\u64cd\u696d\u505c\u6b62\u70b9\u306e\u95a2\u4fc2\u306f\u3069\u306e\u3088\u3046\u306b\u306a\u308b\u304b\uff1f], category:\"Term3\"),\n\nquiz(\"Q47\", question:[\u3042\u308b\u8ca1\u306e\u9700\u8981\u66f2\u7dda\u304c\u9700\u8981\u6cd5\u5247\u3092\u6e80\u305f\u3059\u3068\u3059\u308b\uff0e\u305d\u306e\u8ca1\u306e\u4fa1\u683c\u304c120\u5186\u304b\u3089100\u5186\u306b\u4fa1\u683c\u304c\u5909\u5316\u3057\u305f\u3068\u304d\uff0c\u9700\u8981\u91cf\u306f4000\u304b\u30894800\u306b\u5909\u5316\u3057\u305f. \u3053\u306e\u8ca1\u306e\u4fa1\u683c\u304c120\u5186\u304b\u3089130\u5186\u306b\u5909\u5316\u3059\u308b\u3068\u304d\uff0c\u9700\u8981\u91cf\u306e\u5897\u52a0\u91cf\u3068\u3057\u3066\u6700\u3082\u9069\u5f53\u306a\u3082\u306e\u306f\u4ee5\u4e0b\u306e\u3044\u305a\u308c\u304b?\n+ $800$\n+ $400$\n+ $130$\n+ $-800$\n], category:\"Term1\"),\n\nquiz(\"Q48\", question:[\u77ed\u671f\u306e\u4f01\u696d\u306e\u6c7a\u5b9a\u3092\u8003\u3048\u308b\uff0e\u4ee5\u4e0b\u306e\u3046\u3061\uff0c\u640d\u76ca\u5206\u5c90\u70b9\u306e\u4fa1\u683c\u3068\u64cd\u696d\u505c\u6b62\u70b9\u306e\u4e21\u65b9\u3092\u5909\u5316\u3055\u305b\u308b\u306e\u306f\u3069\u308c\u304b\uff1f\u305f\u3060\u3057\uff0c\u7dcf\u8cbb\u7528\u95a2\u6570\u306f\u5909\u308f\u3089\u306a\u3044\u3082\u306e\u3068\u3059\u308b\uff0e\n+ \u88dc\u52a9\u91d1\u3092\u751f\u7523\u91cf\u306b\u304b\u304b\u308f\u3089\u305a\u4e00\u5b9a\u91d1\u984d\u3092\u4e0e\u3048\u308b\uff0e\n+ \u8d64\u5b57\u304c\u767a\u751f\u3057\u305f\u3068\u304d\uff0c\u305d\u306e30%\u3092\u88dc\u586b\u3059\u308b\u88dc\u52a9\u91d1\u3092\u4e0e\u3048\u308b\uff0e\n+ \u64cd\u696d\u3092\u505c\u6b62\u3059\u308b\u3053\u3068\uff08\u3064\u307e\u308a\u751f\u7523\u91cf\u30920\u306b\u3059\u308b\u3053\u3068\uff09\u306b\u5bfe\u3057\u3066\uff0c\u56fa\u5b9a\u8cbb\u7528\u306e30%\u306e\u88dc\u52a9\u91d1\u3092\u4e0e\u3048\u308b\uff0e\n+ \u751f\u7523\u91cf\u304c0\u3067\u306a\u3044\u9650\u308a\uff0c\u56fa\u5b9a\u8cbb\u7528\u306e30%\u306e\u88dc\u52a9\u91d1\u3092\u4e0e\u3048\u308b\uff0e\n], category:\"Term3\"),\n\nquiz(\"Q49\", question:[\u898f\u6a21\u306b\u95a2\u3057\u3066\u53ce\u7a6b\u4e00\u5b9a\u3067\u3042\u308b\u3068\u304d\uff0c\u5229\u6f64\u3092\u6700\u5927\u306b\u3059\u308b\u8981\u7d20\u6295\u5165\u91cf\u306e\u7d44\u307f\u5408\u308f\u305b\u306f\u4e00\u822c\u306b\u8907\u6570\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f\u305d\u306e\u7406\u7531\u3092\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e\u305f\u3060\u3057\uff0c\u8981\u7d20\u6295\u5165\u91cf\u306f\u6b63\u3067\u3042\u308b\u3068\u8003\u3048\u308b\uff0e], category:\"Term3\"),\n\nquiz(\"Q50\", question:[\u6d88\u8cbb\u3068\u4f59\u6687\u306e\u9078\u629e\u554f\u984c\u3092\u8003\u3048\u308b\uff0e\u6d88\u8cbb\u3068\u4f59\u6687\u304c\u4ee3\u66ff\u95a2\u4fc2\u306b\u3042\u308b\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\u4f59\u6687\u304c\u6642\u7d66\u306e\u5897\u52a0\u306b\u4f34\u3063\u3066\u5897\u3048\u308b\u306e\u3067\u3042\u308c\u3070\u4f59\u6687\u306f\u4e0a\u7d1a\u8ca1\u3067\u3042\u308b\u304b\uff1f\u8aac\u660e\u3057\u306a\u3055\u3044\uff0e], category:\"Term2\"),\n\nquiz(\"Q51\", question:[\u4ee5\u4e0b\u306e\u3042\u308b\u5b66\u751f\u306e\u610f\u898b\u3092\u805e\u3044\u3066\uff0c\u305d\u306e\u7591\u554f\u3092\u89e3\u6d88\u3057\u306a\u3055\u3044\uff0e\n\n\u300c\u6d88\u8cbb\u3068\u4f59\u6687\u306e\u9078\u629e\u554f\u984c\u3092\u8003\u3048\u308b\u3068\u304d\u6642\u7d66\u306f\u5b9f\u8cea\u4f59\u6687\u306e\u4fa1\u683c\u3068\u8003\u3048\u3089\u308c\u307e\u3059\uff0e\u6642\u7d66\u304c\u5897\u3048\u308b\u3068\u4f59\u6687\u304c\u5897\u3048\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u4fa1\u683c\u304c\u5897\u3048\u308b\u3068\u9700\u8981\u304c\u5897\u3048\u308b\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u4f59\u6687\u306f\u30ae\u30c3\u30d5\u30a7\u30f3\u8ca1\u3063\u307d\u3044\u3067\u3059\u306d\uff0e\u3067\u3082\u3053\u306e\u3068\u304d\u4f59\u6687\u306f\u4e0a\u7d1a\u8ca1\u3067\u3059\u3088\u306d\uff0e\u3057\u304b\u3057\u30ae\u30c3\u30d5\u30a7\u30f3\u8ca1\u306f\u4e0b\u7d1a\u8ca1\u3068\u304a\u3063\u3057\u3083\u3044\u307e\u3057\u305f\uff0e\u77db\u76fe\u3057\u307e\u305b\u3093\u304b\uff1f\u300d\n], category:\"Term2\"),\n\nquiz(\"Q52\", question:[\u7b2c\u4e00\u539a\u751f\u5b9a\u7406\u3088\u308a\uff0c\u5e02\u5834\u5747\u8861\u306e\u914d\u5206\u304c\u30d1\u30ec\u30fc\u30c8\u52b9\u7387\u7684\u3067\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u306f\uff0c\u5e02\u5834\u5747\u8861\u4ee5\u5916\u306e\u914d\u5206\u3092\u6301\u3063\u3066\u304d\u305f\u3068\u304d\uff0c\u3053\u308c\u3092\u5e02\u5834\u5747\u8861\u306e\u914d\u5206\u306b\u5909\u3048\u308c\u3070\u5168\u54e1\u304c\u5f97\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term4\"),\n\nquiz(\"Q53\", question:[\u7b2c\u4e8c\u539a\u751f\u5b9a\u7406\u3088\u308a\uff0c\u5e02\u5834\u5747\u8861\u4ee5\u5916\u306e\u914d\u5206\u3092\u6301\u3063\u3066\u304d\u305f\u3068\u304d\uff0c\u5168\u54e1\u304c\u5f97\u3092\u3059\u308b\u3088\u3046\u306a\u5225\u306e\u914d\u5206\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u3066\uff0c\u305d\u308c\u306f\u5e02\u5834\u5747\u8861\u306e\u914d\u5206\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term4\"),\n\nquiz(\"Q54\", question:[\u7b2c\u4e8c\u539a\u751f\u5b9a\u7406\u3088\u308a\uff0c\u5e02\u5834\u5747\u8861\u4ee5\u5916\u306e\u914d\u5206\u3092\u6301\u3063\u3066\u304d\u305f\u3068\u304d\uff0c\u5168\u54e1\u304c\u5f97\u3092\u3059\u308b\u3088\u3046\u306a\u5225\u306e\u914d\u5206\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term4\"),\nquiz(\"Q55\", question:[\u8ca1\u304c\u4e8c\u7a2e\u985e\u3057\u304b\u306a\u3044\u3068\u3059\u308b\uff0e\u8ca1\uff11\u3068\u8ca1\uff12\u304c\u4ee3\u66ff\u7684\u3067\uff0c\u8ca1\uff12\u304c\u4e0b\u7d1a\u8ca1\u3068\u3059\u308b\uff0e\u3053\u306e\u3068\u304d\u8ca1\uff12\u306f\u8ca1\uff11\u306e\u7c97\u88dc\u5b8c\u8ca1\u3067\u3042\u308b\uff0e\u3053\u308c\u306f\u6b63\u3057\u3044\u304b\uff1f], category:\"Term2\")\n\n)\n\n\n\n\n\n\n\n\n\n\n#tests_gen(Quiz, style:\"both\")\n\n\n" }, { "repo": "https://github.com/mintyfrankie/brilliant-CV", "file": "https://raw.githubusercontent.com/mintyfrankie/brilliant-CV/main/template/modules_en/skills.typ", "language": "typst", "license": "Apache License 2.0", "content": "// Imports\n#import \"@preview/brilliant-cv:2.0.3\": cvSection, cvSkill, hBar\n#let metadata = toml(\"../metadata.toml\")\n#let cvSection = cvSection.with(metadata: metadata)\n\n\n#cvSection(\"Skills\")\n\n#cvSkill(\n type: [Languages],\n info: [English #hBar() French #hBar() Chinese],\n)\n\n#cvSkill(\n type: [Tech Stack],\n info: [Tableau #hBar() Python (Pandas/Numpy) #hBar() PostgreSQL],\n)\n\n#cvSkill(\n type: [Personal Interests],\n info: [Swimming #hBar() Cooking #hBar() Reading],\n)\n" }, { "repo": "https://github.com/tibs245/template-typst-CV", "file": "https://raw.githubusercontent.com/tibs245/template-typst-CV/main/README.md", "language": "markdown", "license": "", "content": "# Mon CV en Typst\n\n[Exemple of result in release V1](https://github.com/tibs245/template-typst-CV/releases/download/v1/CV-Thibault.Barske-blue.pdf)\n\n> If you click on release V1 you can see differents colors generations examples\n\n## Pourquoi faire mon CV en Typst ?\n\n1. Mon dossier de comp\u00e9tences sous word \u00e0 mal vieilli\n - Template cass\u00e9\n - Probl\u00e8me de polices\n - Changement de template compliqu\u00e9\n - Transfert de donn\u00e9es fastidieux\n2. La r\u00e9utilisation : J'ai la possibilit\u00e9 de g\u00e9n\u00e9rer ce CV a partir de fichiers\n YML qui peuvent alimenter des pages web et autres\n3. Je peux modifier mes templates facilement\n - Pour m'adapter a une entreprise ou l'image que je souhaites renvoyer\n4. Versionning via Git\n5. Si vous faites des templates de CV plus \u00e9labor\u00e9 apr\u00e8s je pourrai m'en\n reservir facilement \ud83d\ude04\n\n## Quick Start\n\n- Copy / Paste \"author_example.yml\" in \"author.yml\" with your own data\n- Replace skills with ours in `main.typ`\n- You can change your color with `primaryColor` in template\n- Delete all missions and add yours\n- Edit template with yours preferences \u263a\ufe0f\n\n## To improve\n\n- Organize icons by category\n- Add yaml for all skill and use store to add in main.typ _(Better to improve\n collaboration)_\n- Add `skillsToImprove` logics\n - Add automatics summary for relevant mission\n - Add annotation for all missions relevant\n - I need to think it again\n" }, { "repo": "https://github.com/RY997/Thesis", "file": "https://raw.githubusercontent.com/RY997/Thesis/main/thesis_typ/appendix.typ", "language": "typst", "license": "MIT License", "content": "*User 1*\n\n- What do you think of the overall Iris exercise adaptation feature? Can it be useful for the real work of editor or is it a redundant feature and not very helpful?\n - I find the Iris exercise adaptation feature quite useful, particularly for editing programming exercises. It offers a convenient way to customize exercises to different skill levels, making content more effective. This feature is far from redundant; it enhances the relevance and challenge of exercises, which is essential for both students and tutors/instructors.\n- What needs to be improved? Which aspect is good?\n - Iris sometimes struggled to interpret my prompts accurately, which could be improved. While its response time could be faster, I find it less critical. However, Iris's ability to adapt exercises remains as a strong point.\n- What kind of tasks will you prefer to do by yourself instead of using Iris?\n - For tasks like making minor manual code adjustments, such as removing or replacing snippets within functions, I'd prefer to handle them myself rather than using Iris.\n- What kind of tasks will you prefer to let Iris do it?\n - I'd let Iris handle tasks such as generating additional test cases, elaborating problem statements with clear explanations, and adding comments to the code for better understanding.\n\n\n*User 2*\n\nSo what IRIS is good at is all the small stuff, like generating the algorithm for sorting etc and generating a nice theme and good explanantions for methods or tasks. What it does bad is that it fails with the consistent changes to all the files. I would maybe do it so that you could have more steps in between to check what IRIS is doing (good or bad) and also be able to specify better that it only has to change one part (e.g. a function)\nIn general i would say: Change the editor before IRIS and try to copy what copilot in VSCode does\n\n*User 3*\n\nThe first request I made to Iris (to change from Binary to Jump Search) was handled well. However, it seems that it didn't understand the subsequent task at all. If it performs as it did with the first request, I would use it for significant changes, such as themes, and types of exercises changes, and would handle minor issues myself. But if it behaves as it did with all other requests I made, except the first one, then I wouldn't use it at all.\n\nOverall, it seems that the understanding of my requests didn't work out as expected. It appeared that the second change to an exercise was consistently unsuccessful.\n\n*User 4*\n\nIris is good at adapting exercise to meet specific and actionable requirements, making her the ideal choice for this scenario. However, for minor adjustments, I prefer handling them by myself.\n\n*User 5*\n\nThe response time of Iris is somewhat slow, and I'm unable to resize Iris from the right side; only the left side can be adjusted, which is a bit inconvenient." }, { "repo": "https://github.com/chilingg/kaiji", "file": "https://raw.githubusercontent.com/chilingg/kaiji/main/template/main.typ", "language": "typst", "license": "Other", "content": "#let font_size_list = (16pt, 12pt, 9pt, 7pt);\n\n#let font_cfg = (\n font: \"Source Han Serif\",\n weight: \"light\",\n tracking: 0.1em,\n lang: \"zh\"\n)\n\n#let sans_font_cfg = (\n font: \"Source Han Sans\",\n weight: \"medium\"\n)\n\n#let thin_line = 0.6pt\n#let normal_line = 1pt\n\n#let parenthese_numbers = (\"\u2474\",\"\u2475\",\"\u2476\",\"\u2477\",\"\u2478\",\"\u2479\",\"\u247a\",\"\u247b\",\"\u247c\",\"\u247d\",\"\u247e\",\"\u247f\",\"\u2480\",\"\u2481\",\"\u2482\",\"\u2483\",\"\u2484\",\"\u2485\",\"\u2486\",\"\u2487\")\n\n#let base_style(body) = [\n #set page(margin: (x: 6em))\n #set text(..font_cfg, size: font_size_list.at(2), tracking: 0.1em)\n #set par(justify: true, leading: 0.8em)\n\n #set list(indent: 0em, marker: none)\n #set enum(indent: 0em)\n \n #set line(stroke: thin_line)\n\n #set rect(stroke: thin_line)\n\n #show figure.where(\n kind: image,\n ): it => box()[\n #let n = counter(figure.where(kind: image)).at(it.location()).at(0)\n #text(..sans_font_cfg, tracking: 0em)[\u2b1c#(n + 500) #it.caption.body]\n #it.body\n ]\n \n #let chapter_title_interval = 32pt\n\n #show heading.where(level: 1): it => {\n if it.outlined {\n return block(above: chapter_title_interval, below: chapter_title_interval)[\n #set text(..sans_font_cfg, size: font_size_list.at(0), weight: \"medium\", tracking: 0em)\n #counter(heading).display()\n #it.body\n ]\n } else {\n let trancking = if it.has(\"label\") and it.label == {\n 2em\n } else {\n 0em\n }\n return text(size: font_size_list.at(0), weight: \"medium\", tracking: trancking)[#it.body]\n }\n }\n\n #show heading.where(level: 2): it => {\n if it.outlined {\n return block(above: chapter_title_interval, below: chapter_title_interval)[\n #set text(..sans_font_cfg, size: font_size_list.at(1), weight: \"medium\", tracking: 0em)\n #counter(heading).display()\n #it.body\n ]\n } else {\n let trancking = if it.has(\"label\") and it.label == {\n 2em\n } else {\n 0em\n }\n return text(size: font_size_list.at(1), weight: \"medium\", tracking: trancking)[#it.body]\n }\n }\n\n #show heading.where(level: 3): it => [\n #set text(..sans_font_cfg, size: font_size_list.at(2))\n #it.body\n ]\n\n #show : it => [\n #set text(..sans_font_cfg)\n #it\n ] \n\n #show
: it => {\n align(center)[#it]\n }\n\n #body\n]\n\n#let main_body(body) = [\n #set page(\n numbering: \"1\",\n footer: locate(loc => {\n let place = if calc.odd(counter(page).at(loc).first()){\n right\n } else {\n left\n }\n return align(place)[#counter(page).display()]\n })\n )\n\n #set heading(\n outlined: true,\n numbering: (..nums) => \"61\" + nums\n .pos()\n .map(str)\n .join(\"-\"),\n )\n \n #base_style(body)\n]\n" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/pad_01.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n// Pad can grow.\n#pad(left: 10pt, right: 10pt)[PL #h(1fr) PR]\n" }, { "repo": "https://github.com/MultisampledNight/flow", "file": "https://raw.githubusercontent.com/MultisampledNight/flow/main/src/callout.typ", "language": "typst", "license": "MIT License", "content": "#import \"gfx.typ\"\n#import \"palette.typ\": *\n\n#let _callout(body, accent: fg, marker: none) = {\n let body = if marker == none {\n body\n } else {\n let icon = gfx.markers.at(marker).icon\n grid(\n columns: (1.5em, auto),\n gutter: 0.5em,\n align: (right + horizon, left),\n icon(invert: false),\n body,\n )\n }\n\n block(\n stroke: (left: accent),\n inset: (\n left: if marker == none { 0.5em } else { 0em },\n y: 0.5em,\n ),\n body,\n )\n}\n\n#let question = _callout.with(\n accent: status.unknown,\n marker: \"?\",\n)\n#let remark = _callout.with(\n accent: status.remark,\n marker: \"i\",\n)\n#let hint = _callout.with(\n accent: status.hint,\n marker: \"o\",\n)\n#let caution = _callout.with(\n accent: status.urgent,\n marker: \"!\",\n)\n" }, { "repo": "https://github.com/polarkac/MTG-Stories", "file": "https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/024_Shadows%20over%20Innistrad.typ", "language": "typst", "license": "", "content": "#import \"@local/mtgset:0.1.0\": conf\n#show: doc => conf(\"Shadows over Innistrad\", doc)\n\n#include \"./024 - Shadows over Innistrad/001_Under the Silver Moon.typ\"\n#include \"./024 - Shadows over Innistrad/002_A Gaze Blank and Pitiless.typ\"\n#include \"./024 - Shadows over Innistrad/003_Unwelcome.typ\"\n#include \"./024 - Shadows over Innistrad/004_Sacrifice.typ\"\n#include \"./024 - Shadows over Innistrad/005_The Mystery of Markov Manor.typ\"\n#include \"./024 - Shadows over Innistrad/006_The Drownyard Temple.typ\"\n#include \"./024 - Shadows over Innistrad/007_Promises Old and New.typ\"\n#include \"./024 - Shadows over Innistrad/008_Liliana's Indignation.typ\"\n#include \"./024 - Shadows over Innistrad/009_Games.typ\"\n#include \"./024 - Shadows over Innistrad/010_The Lunarch Inquisition.typ\"\n#include \"./024 - Shadows over Innistrad/011_Stories and Endings.typ\"\n#include \"./024 - Shadows over Innistrad/012_I Am Avacyn.typ\"\n" }, { "repo": "https://github.com/lucannez64/Notes", "file": "https://raw.githubusercontent.com/lucannez64/Notes/master/Physique_Mecanique_1.typ", "language": "typst", "license": "", "content": "#import \"@preview/bubble:0.1.0\": *\n#import \"@preview/fletcher:0.4.3\" as fletcher: diagram, node, edge\n#import \"@preview/cetz:0.2.2\": canvas, draw, tree\n#import \"@preview/cheq:0.1.0\": checklist\n#import \"@preview/typpuccino:0.1.0\": macchiato\n#import \"@preview/wordometer:0.1.1\": *\n#import \"@preview/tablem:0.1.0\": tablem\n\n#show: bubble.with(\n title: \"Physique Mecanique 1\",\n subtitle: \"18/09/2024\",\n author: \"\",\n affiliation: \"EPFL\",\n year: \"2024/2025\",\n class: \"G\u00e9nie M\u00e9canique\",\n logo: image(\"JOJO_magazine_Spring_2022_cover-min-modified.png\"),\n)\n\n#set page(footer: context [\n #set text(8pt)\n #set align(center)\n #text(\"page \"+ counter(page).display())\n ]\n)\n\n#set heading(numbering: \"1.1\")\n#show: checklist.with(fill: luma(95%), stroke: blue, radius: .2em)\n\n= Rappels\n\nLa r\u00e9sistance \u00e0 la mise en mouvement d\u00e9pend de la g\u00e9om\u00e9trie.\n$mat(p, F; L_0, M_0)$\n$L_0 = m vec(v) and d$\n\n= Action-R\u00e9action\n\n$ arrow(F)^(i arrow j) = - arrow(F)^(j arrow i) $\n$ m_1dot(arrow(v))_1 = arrow(F)_1^(\"ext\") + arrow(F)^(2 arrow 1) + arrow(F)^(3 arrow 1) $\n$ m_2dot(arrow(v))_2 = arrow(F)_2^(\"ext\") + arrow(F)^(1 arrow 2) + arrow(F)^(3 arrow 2) $\n$ m_3dot(arrow(v))_3 = arrow(F)_3^(\"ext\") + arrow(F)^(2 arrow 3) + arrow(F)^(1 arrow 3) $\n\n= Moment de force\n\n$ arrow(M)_0 colon.eq sum_alpha arrow(O P)_alpha and arrow(F)_alpha $\n\n= Moment cin\u00e9tique\n\n$ arrow(L_0) colon.eq sum_alpha arrow(O P)_alpha and m arrow(v)_alpha $\n\n= Loi de Newton en rotation\n\n$ d/(d t) (arrow(L)_0) = arrow(M)_0 $\n$ = sum dot(arrow( O P)) and m arrow(v) + sum arrow(O P) and m dot(arrow(v)) $\n$ = sum arrow(v) and m arrow(v) + sum arrow(O P) and arrow(F) $\n\n= D\u00e9riv\u00e9e du produit scalaire\n\n$ d/(d t) (arrow(a) dot arrow(b) ) = dot(arrow(a)) dot arrow(b) + arrow(a) dot dot(arrow(b))) $\n\n= D\u00e9riv\u00e9e du produit vectoriel\n\n$ d/(d t) (arrow(a) and arrow(b) ) = dot(arrow(a)) and arrow(b) + arrow(a) and dot(arrow(b))) $\n\n= Exercice le singe et la balle\n\n$ dot(v_x) = 0 $\n$ dot(v_z) = -g $\n\n$ dot(x) = C_1 $\n$ dot(z) = -g t + C_2 $\n\n$ x = C_1 t + E $\n$ z = -g/2 t\u00b2 + C_2 t + E_2 $\n\n$ C_1 = v_(x 0) = v_0 cos(theta) $\n$ C_2 = v_(z 0) = v_0 sin(theta) $\n\n$ E = x_0 $\n$ E_2 = z_0 $\n\n\n" }, { "repo": "https://github.com/valentinvogt/npde-summary", "file": "https://raw.githubusercontent.com/valentinvogt/npde-summary/main/src/chapters/01.typ", "language": "typst", "license": "", "content": "#import \"../setup.typ\": *\n#show: thmrules\n\n= Second-Order Scalar Elliptic Boundary Value Problems\n\n#counter(heading).step(level: 2)\n== Quadratic Minimization Problems\n\n#v(0.2cm)\n\nIn the following, let $V$ be a vector space over $bb(R)$.\\\n#mybox(\n \"Linear forms\",\n)[\n $ell : V arrow.r bb(R)$ is a #emph[linear form / linear functional] $arrow.l.r.double.long$\n #neq(\n $ ell (alpha u + beta v) = alpha ell (u) + beta ell (v) wide forall u , v in V , forall alpha , beta in RR $,\n )\n]\n#v(-1cm)\n\n#let bs = colMath(\"s\", rgb(\"2900d3\"))\n#let bt = colMath(\"t\", rgb(\"2900d3\"))\n#mybox(\n \"Bilinear forms\",\n)[\n $a : V times V arrow.r bb(R)$ is a #emph[bilinear form] $arrow.l.r.double.long$\n #neq(\n $ a \\( &bs u_1 + u_2 , bt v_1 + v_2 \\)\\\n & = bs bt dot.op a (u_1 , v_1) + bs a (u_1 , v_2) + bt a (u_2 , v_1) + a (u_2 , v_2) forall u_1 , u_2 , v_1 , v_2 in V , forall bs , bt in bb(R) $,\n )\n]\n#v(-1cm)\n#mybox(\n \"Positive definiteness\",\n)[\n A bilinear form $a : V times V arrow.r bb(R)$ is #emph[positive definite] if\n $ u in V \\\\ { bold(0) } arrow.l.r.double.long a (u , u) > 0 $\n It is #emph[positive semi-definite] if\n $ a (u , u) & gt.eq 0 quad forall u in V $\n]\n#v(-1.1cm)\n\n#mybox(\n \"Quadratic Functional\",\n)[\n A #emph[quadratic functional] $J : V arrow.r bb(R)$ is defined by\n #neq($ J (u) := 1 / 2 a (u , u) - ell (u) + c, quad u in V $)\n where $a : V times V arrow.r bb(R)$ a symmetric bilinear form, $ell : V arrow.r bb(R)$ a\n linear form and $c in bb(R)$.\n]\n#v(-1cm)\n\n#mybox(\n \"Continuity of linear form\",\n)[\n A linear form $ell : V arrow.r bb(R)$ is #emph[continuous / bounded] on $V$, if\n #neq(\n $ exists C > 0 quad lr(|ell (v)|) lt.eq C norm(v) quad forall v in V, $,\n ) \n where $norm(dot)$ is a norm on $V$.\n]\n\n== Sobolev Spaces\n\n\nWhen we solve a minimization problem, we first need to define the space of\nfunctions in which we look for the solution. For example, in Physics, we\ngenerally want the solution to be continuous. E.g, a function describing the\nshape of an elastic string should not have jumps.\n\nIt turns out that the correct space to describe our minimization problems is the #strong[Sobolev space];.\nFor functions $u$ in a Sobolev space, the bilinear form $a$ in the quadratic\nfunctional is well defined (i.e., $a(u,u)\n\nNote that here, we use the bilinear form to define the norm\n$norm(u)_a = sqrt(a (u , u))$. The main point is that we can see the bilinear\nform of the quadratic minimization problem as the norm of some Sobolev space.\nThe above theorem guarantees that a solution exists in this space if the linear\nform is bounded.\n\nFor checking boundedness we can often use Cauchy--Schwarz\n(@eq:cauchy-schwarz-integrals) and Poincar\u00e9--Friedrichs\n(@thm:poincare-friedrichs).\n\n#pagebreak(weak: true)\n== Linear Variational Problem\n\n\n#definition(\n number: \"1.4.1.6\", \"Linear Variational Problem\",\n)[\n Let $V$ be a vector (function) space, $mhat(V) subset V$ an affine space, and $V_0 subset V$ the\n associated subspace. The equation\n #neq(\n $ #text(\"Find\") u in mhat(V) med #text(\"such that\") a (u , v) = ell (v) quad forall v in V_0 $,\n ) \n is called a (generalized) #emph[linear variational problem];, if\n\n - $a : V times V_0 arrow.r bb(R)$ is a bilinear form\n\n - $ell : V_0 arrow.r bb(R)$ is a linear form\n]\n\n@thm:existence-minimizer-hilbert tells us that the minimization problem has a\nsolution, but knowing that a solution exists is of course not enough: We want to\nfind it, but an infinite-dimensional minimization problem is hard to solve. To\nmake it easier, we reformulate the problems in a linear variational form\n@eq:linear-variational-problem, which is quite close to something we can solve\nnumerically. To do this transformation, we use the following equivalence:\n\n#theorem(\n number: \"1.4.1.8\", \"Equivalence of quadratic\n minimization and linear variational problem\",\n)[\n For a (generalized) quadratic functional $J (v) = 1 / 2 a (v , v) - ell (v) + c$ on\n a vector space $V$ and with a symmetric positive definite bilinear form $a : V times V arrow.r bb(R)$ the\n following is equivalent:\n\n - The quadratic minimization problem for $J (v)$ has the unique minimizer $u_(\\*) in mhat(V)$ over\n the affine subspace $mhat(V) = g + V_0 , g in V$.\n - The linear variational problem $ u in mhat(V) quad a (u , v) = ell (v) &quad forall v in V_0 $ has\n the unique solution $u_(\\*) in mhat(V).$\n]\n\nNote that the trial space $mhat(V)$, from which we pick a solution, and the test\nspace $V_0$ can be different. For an example of different trial and test spaces,\nsee @sub:boundary-conditions.\n\n#pagebreak(weak: true)\n== Boundary Value Problems\n\n\n#lemma(\n number: \"1.5.2.1\", \"General product rule\", ..unimportant,\n)[\n For all $bold(j) in (C^1 (overline(Omega)))^d , v in C^1 (overline(Omega))$ holds\n #neq(\n $ div (bold(j) v) = v div bold(j) + bold(j) dot.op grad v quad upright(\"in\") Omega $,\n )\n] \n\n#lemma(\n number: \"1.5.2.4\", \"Gauss' Theorem\",\n)[\n Let $bold(n) : partial Omega arrow.r bb(R)^d$ denote the exterior unit normal\n vector field on $partial Omega$ and $dif S$ denote integration over a surface. We\n have\n #neq(\n $ integral_Omega div bold(j (x)) dif bx = integral_(partial Omega) bold(j (x) dot.op n (x)) dif S (bx) quad forall bold(j) in (C_(upright(p w))^1 (overline(Omega)))^d $,\n )\n] \n\n#lemma(\n number: \"1.5.2.7\", \"Green's first formula\",\n)[\n For all vector fields $bold(j) in (C^1_\"pw\" (overline(Omega)))^d$ and functions $v in C^1_\"pw\" (overline(Omega))$ holds\n #neq(\n $ integral_Omega bold(j) dot.op grad v dif bx = - integral_Omega div bold(j) thin v dif bx + integral_(partial Omega) bold(j dot.op n) thin v dif S $,\n )\n] \n\n#lemma(\n number: \"1.5.3.4\", \"Fundamental lemma of the calculus of variations\",\n)[\n If $f in L^2 (Omega)$ satisfies\n #neq(\n $ integral_Omega f (bx) v (bx) dif bx = 0 quad forall v in C_0^oo (Omega), $,\n )\n then $f equiv 0$.\n] \n\nWe have seen that minimizing a quadratic functional is equivalent to solving a\nlinear variational problem @eq:linear-variational-problem. The variational\nproblem is called the #strong[weak form];. We can transform it (with extra\nsmoothness requirements) into the problem's #strong[strong form];, an elliptic\nBVP (PDE with boundary conditions).\n#tip-box(\n \"Weak to strong\",\n)[\n + Use @thm:greens-formula to get rid of derivatives on $v$ (e.g. turn $grad u dot grad v$ into $-div(grad u) +...$\n + Use properties of the test space (usually that $v=0$ on $partial Omega$) to get\n rid of boundary terms\n + Use @thm:fund-lemma to remove the integrals and test functions\n]\n\n#pagebreak(weak: true)\n#counter(heading).step(level: 2)\n== Boundary Conditions\n\n\nFor 2nd-order elliptic BVPs we need boundary conditions to get a unique\nsolution. To be more precise, we need #strong[exactly one] of the following\nboundary conditions on every part of $partial Omega$.\n\n#mybox(\"Main boundary conditions for 2nd-order elliptic BVPs\")[\n - #strong[Dirichlet]: $u$ is fixed to be\n $g : partial Omega arrow.r bb(R)$\n $ u = g quad upright(\"on\") thin partial Omega $\n\n - #strong[Neumann]: the flux $bold(j) = - kappa (bx) grad u$\n through $partial Omega$ is fixed with\n $h : partial Omega arrow.r bb(R)$\n $ bold(j dot.op n) = - h quad upright(\"on\") thin partial Omega $\n\n - #strong[Radiation]: flux depends on $u$ with an increasing function\n $Psi : bb(R) arrow.r bb(R)$\n $ bold(j dot.op n) = Psi (u) quad upright(\"on\") thin partial Omega $\n]\n\nIn the weak form, Dirichlet conditions have to be imposed directly on the\n*trial* space. The test space needs to be set to 0 wherever Dirichlet conditions\nare given (\"_Don't test where the solution is known_\"). For example, trial and\ntest spaces for a standard Dirichlet problem are\n$ V &= Set(u in C^1(Omega)&, && u=g \"on\" partial Omega) \\\nV_0 &= Set(v in C^1(Omega)&, && v=0 \"on\" partial Omega) $\n\nDirichlet BCs are called #strong[essential boundary conditions];.\n\nNeumann conditions, which are only enforced through some term in the variational\nequation, are called #strong[natural boundary conditions];.\n\nThere are some constraints on the boundary data:\n#subtle-box[\n - #strong[Admissible Dirichlet Data];: Dirichlet boundary values need to be\n continuous.\n\n - #strong[Admissible Neumann Data];: $h$ needs to be in $L^2 (Omega)$\n (can be discontinuous)\n]\n\nThe following theorem is frequently needed when dealing with integrals over the\nboundary:\n#theorem(\n number: \"1.9.0.19\", title: \"Theorem\", \"Multiplicative trace inequality\",\n)[\n #neq(\n $ exists C = C (Omega) > 0 : norm(u)_(L^2(partial Omega)) lt.eq C norm(u)_(L^2(Omega)) dot.op norm(u)_(H^1(Omega)) quad forall u in H^1 (Omega) $,\n )\n] \n\n#pagebreak(weak: true)\n== Second-Order Elliptic Variational Problems\n\n\nWe have seen how we can get from a minimization problem via a variational\nproblem to a BVP. Now we want to move in the opposite direction: from a PDE with\nboundary conditions to a variational problem.\n#tip-box(\n \"Strong to weak\",\n)[\n + Test the PDE with (multiply by $v$) and integrate over $Omega$\n + Use @thm:greens-formula to \"shift\" one derivative from $u$ to $v$ (e.g., from $-div(grad u)$ to $grad u dot grad v + ...$)\n + Use Neumann BC on boundary terms ($grad u dot n = h$)\n + Pick Sobolev trial/test spaces $V,V_0$ such that\n\n - $a(u,u)$ is finite for $u in V,V_0$\n - boundary conditions are satisfied ($u=g$ in $V$ $=>$ $v=0$ in $V_0$)\n\n To fulfill the first condition, we can define the \"base\" space for both trial\n and test as $Set(v, a(v,v) 0 : norm(u)_0 lt.eq C \"diam\" #h(-0.1pt) (Omega) thin norm(grad u)_0 quad forall u in H_(\\*)^1 (Omega) $,\n )\n] \nThis theorem tells us that (under some conditions), the $L^2$ norm of functions\nfrom this space is bounded by the $H^1$-seminorm.\n" }, { "repo": "https://github.com/The-Notebookinator/notebookinator", "file": "https://raw.githubusercontent.com/The-Notebookinator/notebookinator/main/themes/radial/components/decision-matrix.typ", "language": "typst", "license": "The Unlicense", "content": "#import \"../colors.typ\": *\n#import \"/utils.typ\"\n\n#let decision-matrix = utils.make-decision-matrix((properties, data) => {\n set align(center)\n\n let winning-row\n for (index, choice) in data.values().enumerate() {\n if choice.total.highest {\n winning-row = index + 2\n }\n }\n\n table(\n stroke: none,\n columns: properties.len() + 2,\n fill: (_, row) => {\n if row == winning-row { green }\n else if calc.odd(row) { surface-3 }\n else if calc.even(row) { surface-1 }\n },\n\n // Top line\n table.hline(stroke: (cap: \"round\", thickness: 2pt)),\n // Blank column to account for names of choices\n [],\n // Print out all the properties\n ..for property in properties {\n ([ *#property.name* ],)\n },\n // Last box in the row\n [*Total*],\n // Print out the data for each choice\n\n ..for (index, choice) in data {\n (\n [#index],\n ..for property in properties {\n let value = choice.at(property.name)\n ([#value.weighted],)\n },\n [#choice.total.weighted]\n )\n },\n\n //..for result in data {\n // Override the fill if the choice has the highest score\n //let cell = if choice.values.total.highest { cellx.with(fill: green) } else { cellx }\n //(cell[*#choice.name*], ..for value in choice.values {\n //(cell[#value.at(1).value],)\n //})\n //},\n // Bottom line\n table.hline(stroke: (cap: \"round\", thickness: 2pt)),\n )\n})\n" }, { "repo": "https://github.com/xdoardo/co-thesis", "file": "https://raw.githubusercontent.com/xdoardo/co-thesis/master/thesis/chapters/imp/analysis/dia.typ", "language": "typst", "license": "", "content": "#import \"/includes.typ\":*\n#import \"@preview/prooftrees:0.1.0\"\n\n#let bisim = \"\u224b\"\n#let conv(c, v) = { $#c arrow.b.double #v$ }\n#let div(c) = { $#c arrow.t.double$ }\n#let fails(c) = { $#c arrow.zigzag$ }\n\n#linebreak()\n=== Definite initialization analysis\nThe first transformation we describe is *definite initialization analysis*. In\ngeneral, the objective of this analysis is to ensure that no variable is ever\nused before being initialized, which is exactly the only kind of failure we\nchose to model.\n\n==== Variables and indicator functions\nThis analysis deals with variables. Before delving into its details, we show\nfirst a function to compute the set of variables used in arithmetic and boolean\nexpressions. The objective is to come up with a _set_ of identifiers that appear\nin the expression: we chose to represent sets in Agda using characteristic\nfunctions, which we simply define as parametric functions from a parametric set\nto the set of booleans, that is ```hs CharacteristicFunction = A -> Bool```;\nlater, we will instantiate this type for identifiers, giving the resulting type\nthe name of ```hs VarsSet```. First, we give a (parametric) notion of members\nequivalence (that is, a function ```hs _==_ : A -> A -> Bool```); then, we the\nusual operations on sets (insertion, union, and intersection) and the usual\ndefinition of inclusion for characteristic functions.\n\n#mycode(label: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Data/CharacteristicFunction.agda#L13\")[\n//typstfmt::off\n```hs\nmodule Data.CharacteristicFunction {a} (A : Set a) (_==_ : A -> A -> Bool) where\n-- ...\nCharacteristicFunction : Set a\nCharacteristicFunction = A -> Bool \n-- ...\n\n\u2205 : CharacteristicFunction\n\u2205 = \u03bb _ -> false\n\n_\u21a6_ : (v : A) -> (s : CharacteristicFunction) -> CharacteristicFunction\n(v \u21a6 s) x = (v == x) \u2228 (s x)\n\n_\u222a_ : (s\u2081 s\u2082 : CharacteristicFunction) -> CharacteristicFunction\n(s\u2081 \u222a s\u2082) x = (s\u2081 x) \u2228 (s\u2082 x)\n\n_\u2229_ : (s\u2081 s\u2082 : CharacteristicFunction) -> CharacteristicFunction\n(s\u2081 \u2229 s\u2082) x = (s\u2081 x) \u2227 (s\u2082 x)\n\n_\u2286_ : (s\u2081 s\u2082 : CharacteristicFunction) -> Set a\ns\u2081 \u2286 s\u2082 = \u2200 x -> (x-in-s\u2081 : s\u2081 x \u2261 true) -> s\u2082 x \u2261 true\n```\n//typstfmt::on\n]\n\n#theorem(\n name: \"Equivalence of characteristic functions\",\n label: \n)[\n\n (using the *Axiom of extensionality*)\n#mycode(proof: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Data/CharacteristicFunction.agda#L48\")[\n//typstfmt::off\n```hs\ncf-ext : \u2200 {s\u2081 s\u2082 : CharacteristicFunction} \n (a-ex : \u2200 x -> s\u2081 x \u2261 s\u2082 x) -> s\u2081 \u2261 s\u2082\n```\n//typstfmt::on\n]] \n\n#theorem(name: \"Neutral element of union\", \nlabel: )[\n#mycode(\"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Data/CharacteristicFunction.agda#L58\")[\n//typstfmt::off\n```hs\n\u222a-\u2205 : \u2200 {s : CharacteristicFunction} -> (s \u222a \u2205) \u2261 s\n```\n//typstfmt::on\n]] \n\n#theorem(name: \"Update inclusion\")[\n#mycode(\"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Data/CharacteristicFunction.agda#L61\")[\n//typstfmt::off\n```hs\n\u21a6=>\u2286 : \u2200 {id} {s : CharacteristicFunction} -> s \u2286 (id \u21a6 s)\n```\n//typstfmt::on\n]]\n#theorem(name: \"Transitivity of inclusion\", label: )[\n#mycode(\"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Data/CharacteristicFunction.agda#L87\")[\n//typstfmt::off\n```hs\n\u2286-trans : \u2200 {s\u2081 s\u2082 s\u2083 : CharacteristicFunction} -> (s\u2081\u2286s\u2082 : s\u2081 \u2286 s\u2082)\n -> (s\u2082\u2286s\u2083 : s\u2082 \u2286 s\u2083) -> s\u2081 \u2286 s\u2083\n```\n//typstfmt::on\n]] \n\nWe will also need a way to get a ```hs VarsSet``` from a ```hs Store```, which\nis shown in @code-store-domain.\n#mycode(label: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Syntax/Vars.agda#L35\")[\n//typsfmt::off\n```hs\ndom : Store -> VarsSet\ndom s x with (s x)\n... | just _ = true\n... | nothing = false\n```\n//typstfmt::on\n]\n\n==== Realization\nFollowing @concrete-semantics, the first formal tool we need is a way to\ncompute the set of variables mentioned in expressions, shown in\n@code-avars and @code-bvars. We also need a function to compute the set of variables that\nare definitely initialized in commands, which is shown in @code-cvars.\n#grid(\ncolumns: 2,\n//align: center + horizon,\n//auto-vlines: false,\n//auto-hlines: false,\ngutter: 5pt, \nmycode(label: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Syntax/Vars.agda#L16\")[\n//typstfmt::off\n```hs\navars : (a : AExp) -> VarsSet\navars (const n) = \u2205\navars (var id) = id \u21a6 \u2205\navars (plus a\u2081 a\u2082) = \n (avars a\u2081) \u222a (avars a\u2082)\n```\n//typstfmt::on\n],\nmycode(label: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Syntax/Vars.agda#L21\")[\n//typstfmt::off\n```hs\nbvars : (b : BExp) -> VarsSet\nbvars (const b) = \u2205\nbvars (le a\u2081 a\u2082) =\n (avars a\u2081) \u222a (avars a\u2082)\nbvars (not b) = bvars b\nbvars (and b b\u2081) =\n (bvars b) \u222a (bvars b\u2081)\n```\n//typstfmt::on\n])\n#mycode(label: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Syntax/Vars.agda#L27\")[\n//typstfmt::off\n```hs\ncvars : (c : Command) -> VarsSet\ncvars skip = \u2205\ncvars (assign id a) = id \u21a6 \u2205\ncvars (seq c c\u2081) = (cvars c) \u222a (cvars c\u2081)\ncvars (ifelse b c\u1d57 c\u1da0) = (cvars c\u1d57) \u2229 (cvars c\u1da0)\ncvars (while b c) = \u2205\n```\n//typstfmt::on\n]\n\nIt is worth to reflect upon the definition of @code-cvars. This \ncode computes the set of _initialized_ variables in a command `c`; as\ndone in @concrete-semantics, we construct this set of initialized variables in\nthe most conservative way possible: of course, `skip` does not have any initialized\nvariable and `assign id a` adds `id` to the set of initialized variables. \n\nHowever, when considering composite commands, we must consider that, except for\n`seq c c\u2081`, not every branch of execution is taken; this means that we cannot\nknow statically whether `ifelse b c\u1d57 c\u1da0` will lead to the execution to the\nexecution of `c\u1d57` or `c\u1da0`, we thus take the intersection of their initialized\nvariables, that is we compute the set of variables that will be surely\ninitialized wheter one or the other executes. The same reasoning applies to\n`while b c`: we cannot possibly know whether or not `c` will ever execute, thus\nwe consider no new variables initialized.\n\nAt this point it should be clear that as `cvars c` computes the set of\ninitialized variables in a conservative fashion, it is not necessarily true\nthat the actual execution of the command will not add additional variables:\nhowever, knowing that if the evaluation of a command in a store $sigma$\nconverges to a value $sigma'$, that is $#conv([$c$, $sigma$], $sigma'$)$ then by\n@lemma-ceval-store-tilde[Lemma] $\"dom\" sigma subset.eq \"dom\" sigma'$;\nthis allows us to show the following lemma.\n\n#lemma(label: )[\n Let $c$ be a command and $sigma$ and $sigma'$ be two stores. Then\n #align(center, \n $#conv($\"ceval\" c space sigma$, $sigma'$) -> (\"dom\" sigma_1 union\n (\"cvars\" c)) space subset.eq (\"dom\" sigma')$)\n\n#mycode(proof: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Semantics/BigStep/Functional/Properties.agda#L133\")[\n//typstfmt::off\n```hs\nceval\u21d3=>sc\u2286s' : \u2200 (c : Command) (s s' : Store) (h\u21d3 : (ceval c s) \u21d3 s')\n -> (dom s \u222a (cvars c)) \u2286 (dom s')\n```\n//typstfmt::on \n]] \n\n\nWe now give inference rules that inductively build the relation that embodies\nthe logic of the definite initialization analysis, shown in @imp-dia-rel. In\nAgda, we define a datatype representing the relation of type\n//typstfmt::off\n```hs Dia : VarsSet -> Command -> VarsSet -> Set```,\n//typstfmt::on\nwhich is shown in @code-dia. @lemma-ceval-sc-subeq[Lemma]\nwill allow us to show that there is a relation between the `VarsSet` in the\n`Dia` relation and the actual stores that are used in the execution of a\ncommand.\n\n#figure(\n tablex(\n columns: 2,\n align: center + horizon,\n auto-vlines: false,\n auto-hlines: false,\n prooftrees.tree(prooftrees.axi[], prooftrees.uni[Dia v skip v]),\n prooftrees.tree(\n prooftrees.axi[avars $a$ $subset.eq$ $v$],\n prooftrees.uni[Dia $v$ (assign $id$ $a$) ($id \u21a6 v$)],\n ),\n prooftrees.tree(\n prooftrees.axi(pad(bottom: 4pt, [Dia $v_1$ $c_1$ $v_2$])),\n prooftrees.axi(pad(bottom: 4pt, [Dia $v_2$ $c_2$ $v_3$])),\n prooftrees.nary(2)[Dia $v_1$ (seq $c_1$ $c_2$) $v_3$],\n ),\n prooftrees.tree(\n prooftrees.axi(pad(bottom: 2pt, [bvars $b$ $subset.eq$ $v$])),\n prooftrees.axi(pad(bottom: 2pt, [Dia $v$ $c^t$ $v^t$])),\n prooftrees.axi(pad(bottom: 2pt, [Dia $v$ $c^f$ $v^f$])),\n prooftrees.nary(\n 3,\n )[#pad(top: 2pt, [Dia $v$ (if $b$ then $c^t$ else $c^f$) ($v^t sect v^f$)])],\n ),\n colspanx(2)[\n #prooftrees.tree(\n prooftrees.axi(pad(bottom: 3pt, [bvars $b$ $subset.eq$ $v$])),\n prooftrees.axi(pad(bottom: 3pt, [Dia $v$ $c$ $v_1$])),\n prooftrees.nary(2)[Dia $v$ (while $b$ $c$) $v$],\n )\n ],\n ),\n caption: \"Inference rules for the definite initialization analysis\",\n supplement: \"Table\",\n)\n#mycode(label: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Analysis/DefiniteInitialization.agda#L22\")[\n//typstfmt::off\n```hs\ndata Dia : VarsSet -> Command -> VarsSet -> Set where\n skip : \u2200 (v : VarsSet) -> Dia v (skip) v\n assign : \u2200 a v id (a\u2286v : (avars a) \u2286 v) -> Dia v (assign id a) (id \u21a6 v)\n seq : \u2200 v\u2081 v\u2082 v\u2083 c\u2081 c\u2082 -> (relc\u2081 : Dia v\u2081 c\u2081 v\u2082) ->\n (relc\u2082 : Dia v\u2082 c\u2082 v\u2083) -> Dia v\u2081 (seq c\u2081 c\u2082) v\u2083\n if : \u2200 b v v\u1d57 v\u1da0 c\u1d57 c\u1da0 (b\u2286v : (bvars b) \u2286 v) -> (relc\u1da0 : Dia v c\u1da0 v\u1da0) ->\n (relc\u1d57 : Dia v c\u1d57 v\u1d57) -> Dia v (ifelse b c\u1d57 c\u1da0) (v\u1d57 \u2229 v\u1da0)\n while : \u2200 b v v\u2081 c -> (b\u2286s : (bvars b) \u2286 v) ->\n (relc : Dia v c v\u2081) -> Dia v (while b c) v\n```\n//typstfmt::on\n]\n\nWhat we want to show now is that if ```hs Dia``` holds, then the evaluation of\na command $c$ does not result in an error: while\n@thm-adia-safe and @thm-bdia-safe show\nthat if the variables in an arithmetic expression or a boolean expression are\ncontained in a store the result of their evaluation cannot be a failure (i.e.\nthey result in \"just\" something, as it cannot diverge),\n@thm-dia-safe shows that if ```hs Dia``` holds, then the\nevaluation of a program failing is absurd: therefore, by\n@post-exec, the program either diverges or converges to some\nvalue.\n\n#theorem( name: \"Safety of arithmetic expressions\", label: )[\n#mycode(proof: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Analysis/DefiniteInitialization.agda#L47\")[\n//typstfmt::off\n```hs \nadia-safe : \u2200 (a : AExp) (s : Store) (dia : avars a \u2286 dom s)\n -> (\u2203 \u03bb v -> aeval a s \u2261 just v)\n```\n//typstfmt::on\n]] \n\n#theorem(name: \"Safety of boolean expressions\", label: )[\n #mycode(proof: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Analysis/DefiniteInitialization.agda#L60\")[\n//typstfmt::off\n```hs\nbdia-safe : \u2200 (b : BExp) (s : Store) (dia : bvars b \u2286 dom s)\n -> (\u2203 \u03bb v -> beval b s \u2261 just v)\n```\n//typstfmt::on\n]] \n\n#theorem(\n name: \"Safety of definite initialization for commands\",\n label: \n)[\n#mycode(proof: , \"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Analysis/DefiniteInitialization.agda#L117\")[\n//typstfmt::off\n```hs\ndia-safe : \u2200 (c : Command) (s : Store) (v v' : VarsSet) (dia : Dia v c v')\n (v\u2286s : v \u2286 dom s) -> (h-err : (ceval c s) \u21af) -> \u22a5\n```\n//typstfmt::on\n]] \n\nWe now show an idea of the proof (the full proof, in Agda, is in\n@proof-dia-safe), examining the two base cases `c \u2261 skip` and `c \u2261 assign id a`\nand the coinductive case `c \u2261 while b c'`. The proof for the base cases is, in\nwords, based on the idea that the evaluation cannot possibly go wrong: note\nthat by the hypotheses, we have that `(ceval c s) \u21af`, which we can express in\nmath as $ceval space c space sigma bisim now nothing$.\n\n\n#show figure.where(kind: \"boxenv\"): set block(breakable: true)\n#proof[\n 1. Let $c$ be the command `skip`. Then, for any store $sigma$, by the\n definition of `ceval` in @code-ceval and by the inference rule $arrow.b.double$skip in\n @imp-commands-semantics, the evaluation of $c$ in the store $sigma$ must be \n #align(center, $ceval \"skip\" sigma eq.triple now (just sigma)$)\n\n Given the hypothesis that #fails([c, $sigma$]), we now have that it must be\n $now nothing bisim now (just sigma )$, which is false for any $sigma$, making the hypothesis\n #fails([c, $sigma$]) impossible.\n 2. Let $c$ be the command `assign id a`, for some identifier $id$ and\n arithmetic expression $a$. By the hypothesis, we have that it must be $\"Dia\"\n v space (assign id a) space v'$ for some $v$ and $v'$, which entails that\n the variables that appear in $a$, which we named $\"avars\" a$, are all\n initialized in $v$, that is $\"avars\" a subset.eq v$; this and the\n hypothesis that $v subset.eq \"dom\" sigma$ imply by @thm-cf-trans\n that $\"avars\" a subset.eq \"dom\" sigma$.\n\n By @thm-adia-safe, with the assumption that $\"avars\" a subset.eq \"dom\" sigma$, \n it must be $aeval a sigma eq.triple just n$ for some $n : ZZ$. Again, by the \n definition of `ceval` in @code-ceval and by the inference rule $arrow.b.double$assign \n in @imp-commands-semantics, the evaluation of $c$ in the store $sigma$ must be \n\n #align(center, $ceval (assign id a) space sigma eq.triple now (just (\"update\"\n id n space sigma))$)\n\n and, as before, by the hypothesis that $c$ fails it must thus be that $now\n nothing bisim now (just (\"update\" id n space sigma))$, which is impossible for any $sigma$, \n making the hypotesis #fails([c]) impossible.\n\n 3. Let $c$ be the command `while b c'` for some boolean expression $b$ and\n some command $c'$. By @thm-bdia-safe, with the assumption that $\"bvars\" b\n subset.eq \"dom\" sigma$, it must be $\"beval\" b space sigma eq.triple \"just\" v$ for some\n $v : BB$. \n\n #linebreak()\n If $v eq.triple \"false\"$, then by the definition of `ceval` in\n @code-ceval and by the inference rule $arrow.b.double$while-false in\n @imp-commands-semantics, the evaluation of $c$ in the store $sigma$ must be \n\n #align(center, $ceval (\"while\" b space c') space sigma eq.triple now (\"just\" sigma)$)\n\n making the hypothesis that the evaluation of $c$ fails impossible. \n\n #linebreak()\n If, instead, $v eq.triple \"true\"$, we must evaluate $c'$ in $sigma$. \n The case $c' eq.triple now nothing$ is impossible by the inductive hypothesis.\n\n #linebreak()\n If $c' eq.triple now (just sigma')$ for some $sigma'$, then, by recursion, it must be\n #align(center, [```hs dia-sound (while b c) s' v v dia (\u2286-trans v\u2286s (ceval\u21d3=>\u2286 c s s' (\u2261=>\u224b eq-ceval-c))) w\u21af```])\n\n #linebreak()\n Finally, if $c' eq.triple \"later\" x$ for some $x$, then we can prove inductively that \n#mycode(\"https://github.com/ecmma/co-thesis/blob/master/agda/lujon/Imp/Analysis/DefiniteInitialization.agda#L165\", proof: )[\n//typstfmt::off\n```hs\ndia-sound-while-later : \u2200 {x : Thunk (Delay (Maybe Store)) \u221e} {b c} {v} \n (l\u21af\u22a5 : (later x)\u21af -> \u22a5) (dia : Dia v (while b c) v) \n (l\u21d3s=>\u2286 : \u2200 {s : Store} -> ((later x) \u21d3 s) -> v \u2286 dom s)\n (w\u21af : (bind (later x) (\u03bb s -> later (ceval-while c b s))) \u21af) -> \u22a5\n```\n//typstfmt::on\n] ]\n\nThe proof works by unwinding, inductively, the assumption that #fails([c]): if\nit fails, then $ceval space c space sigma$ must eventually converge to $\"now\" space \"nothing\"$.\nThe proof thus works by showing base cases and, in the case of $\"seq\" space c_1 space c_2$\nand $\"while\" space b space c' space eq.triple space \"if\" space b space \"then\" space (\"seq\" space c' space (\"while\" space b space c')) space \"else\" space \"skip\"$, \nshowing that by inductive hypotesis $c_1$ or $c'$ cannot possibly fail; then,\nthe assumption becomes that it is the second command ($c_2$ or $\"while\" space b space c'$)\nthat fails, which we can inductively show absurd.\n\n#show figure.where(kind: \"boxenv\"): set block(breakable: false)\n" }, { "repo": "https://github.com/DieracDelta/presentations", "file": "https://raw.githubusercontent.com/DieracDelta/presentations/master/polylux/book/src/utils/side-by-side.typ", "language": "typst", "license": "", "content": "#import \"../../../polylux.typ\": *\n#set page(paper: \"presentation-16-9\")\n#set text(size: 40pt)\n\n#polylux-slide[\n#side-by-side[\n #lorem(7)\n][\n #lorem(10)\n][\n #lorem(5)\n]\n]\n" }, { "repo": "https://github.com/MattiaOldani/Informatica-Teorica", "file": "https://raw.githubusercontent.com/MattiaOldani/Informatica-Teorica/master/capitoli/calcolabilit\u00e0/12_riconoscibilit\u00e0_automatica_insiemi.typ", "language": "typst", "license": "", "content": "#import \"../alias.typ\": *\n\n#import \"@preview/lemmify:0.1.5\": *\n\n#let (\n theorem, lemma, corollary,\n remark, proposition, example,\n proof, rules: thm-rules\n) = default-theorems(\"thm-group\", lang: \"it\")\n\n#show: thm-rules\n\n#show thm-selector(\"thm-group\", subgroup: \"theorem\"): it => block(\n it,\n stroke: red + 1pt,\n inset: 1em,\n breakable: true\n)\n\n#show thm-selector(\"thm-group\", subgroup: \"proof\"): it => block(\n it,\n stroke: green + 1pt,\n inset: 1em,\n breakable: true\n)\n\n\n= Riconoscibilit\u00e0 automatica di insiemi\n\nProviamo a dare una _gradazione_ sul livello di risoluzione dei problemi. Vogliamo capire se un dato problema:\n- pu\u00f2 essere risolto;\n- non pu\u00f2 essere risolto completamente (meglio di niente);\n- non pu\u00f2 essere risolto.\n\nCostruiamo un programma che classifichi gli elementi di un insieme, quindi ci dica se un certo numero naturale appartiene o meno all'insieme.\n\nUn insieme $A subset.eq NN$ \u00e8 *riconoscibile automaticamente* se esiste un programma $P_A$ che classifica correttamente *ogni* elemento di $NN$ come appartenente o meno ad $A$, ovvero\n\n$ x in NN arrow.long.squiggly P_A (x) = cases(1 & \"se\" x in A, 0 quad & \"se\" x in.not A) quad . $\n\nIl programma $P_A$ deve essere:\n- *corretto*: classifica correttamente gli elementi che riceve in input;\n- *completo*: classifica tutti gli elementi di $NN$, nessuno escluso.\n\n_Tutti gli insiemi sono automaticamente riconoscibili? Quali insiemi sono automaticamente riconoscibili? Quali invece non lo sono?_\n\nSiamo certi che non tutti gli insiemi siano automaticamente riconoscibili, infatti grazie al concetto di _cardinalit\u00e0_ sappiamo che:\n- i sottoinsiemi di $NN$ sono densi come $RR$;\n- io non ho $RR$ programmi quindi sicuramente c'\u00e8 qualche insieme che non lo \u00e8.\n\n== Insiemi ricorsivi\n\nUn insieme $A subset.eq NN$ \u00e8 un *insieme ricorsivo* se esiste un programma $P_A$ che si arresta su ogni input classificando correttamente gli elementi di $NN$ in base alla loro appartenenza o meno ad $A$.\n\nEquivalentemente, ricordando che la funzione caratteristica di $A subset.eq NN$ \u00e8 la funzione $ chi_A : NN arrow.long {0,1} $ tale che $ chi_A (x) = cases(1 \"se\" x in A, 0 \"se\" x in.not A) quad , $ diciamo che l'insieme $A$ \u00e8 ricorsivo se e solo se $ chi_A in cal(T) . $\n\nChe $chi_A$ sia totale \u00e8 banale, perch\u00e9 tutte le funzioni caratteristiche devono essere definite su tutto $NN$. Il problema risiede nella calcolabilit\u00e0 di queste funzioni.\n\nLe due definizioni date sono equivalenti:\n- il programma $P_A$ implementa $chi_A$, quindi $chi_A in cal(T)$ perch\u00e9 esiste un programma che la calcola;\n- $chi_A in cal(T)$ quindi esiste un programma $P_A$ che la implementa e che soddisfa la definizione data sopra.\n\n=== Ricorsivo vs Decidibile\n\nSpesso, si dice che _un insieme ricorsivo \u00e8 un insieme decidibile_, ma \u00e8 solo abuso di notazione. Questo \u00e8 dovuto al fatto che ad ogni insieme $A subset.eq NN$ possiamo associare il suo *problema di riconoscimento*, cos\u00ec definito:\n\n- Nome: $\"RIC\"_A$.\n- Istanza: $x in NN$.\n- Domanda: $x in A$?\n\nLa sua funzione soluzione $ Phi_(\"RIC\"_A) : NN arrow.long {0,1} $ \u00e8 tale che $ Phi_(\"RIC\"_A) (x) = cases(1 & \"se\" x in A, 0 quad & \"se\" x in.not A) quad . $\n\nNotiamo che la semantica del problema \u00e8 proprio la funzione caratteristica, quindi $Phi_(\"RIC\"_A) = chi_A$. Se $A$ \u00e8 ricorsivo, allora la sua funzione caratteristica \u00e8 ricorsiva totale, ma lo sar\u00e0 anche la funzione soluzione $Phi$ e, di conseguenza, $\"RIC\"_A$ \u00e8 decidibile.\n\n=== Decidibile vs Ricorsivo\n\nSimmetricamente, sempre con abuso di notazione, si dice che _un problema di decisione \u00e8 un problema ricorsivo_. Questo perch\u00e9 ad ogni problema di decisione $Pi$ possiamo associare $A_Pi$ *insieme delle sue istanze a risposta positiva*.\n\nDato il problema\n- Nome: $Pi$.\n- Istanza: $x in D$.\n- Domanda: $p(x)$?\ndefiniamo $ A_Pi = {x in D bar.v Phi_Pi (x) = 1} \"con\" Phi_Pi (x) = 1 equiv p(x) $ insieme delle istanze a risposta positiva di $Pi$. Notiamo che, se $Pi$ \u00e8 decidibile allora $Phi_Pi in cal(T)$, quindi esiste un programma che calcola questa funzione. La funzione in questione \u00e8 quella che riconosce automaticamente l'insieme $A_Pi$, quindi $A_Pi$ \u00e8 ricorsivo.\n\n== Insiemi non ricorsivi\n\nPer trovare degli insiemi non ricorsivi cerco nei problemi di decisione non decidibili. L'unico problema di decisione non decidibile che abbiamo visto \u00e8 il *problema dell'arresto ristretto* $arresto(ristretto)$.\n\n- Nome: $arresto(ristretto)$.\n- Istanza: $x in NN$.\n- Domanda: $phi_(ristretto) (x) = phi_x (x) arrow.b$?\n\nDefiniamo l'insieme delle istanze a risposta positiva di $arresto(ristretto)$ $ A = {x in NN bar.v phi_x (x) arrow.b}. $ Questo non pu\u00f2 essere ricorsivo: se lo fosse, avrei un programma ricorsivo totale che mi classifica correttamente se $x$ appartiene o meno ad $A$, ma abbiamo dimostrato che il problema dell'arresto ristretto non \u00e8 decidibile, quindi $A$ non \u00e8 ricorsivo.\n\n== Relazioni ricorsive\n\n$R subset.eq NN times NN$ \u00e8 una *relazione ricorsiva* se e solo se l'insieme $R$ \u00e8 ricorsivo, ovvero:\n- la sua funzione caratteristica $chi_R$ \u00e8 tale che $chi_R in cal(T)$, oppure\n- esiste un programma $P_R$ che, presi in ingresso $x,y in NN$ restituisce $1$ se $(x R y)$, $0$ altrimenti.\n\nUn'importante relazione ricorsiva \u00e8 la relazione $ R_P = {(x,y) in NN^2 bar.v P \"su input\" x \"termina in\" y \"passi\"} . $\n\n\u00c8 molto simile al problema dell'arresto, ma non chiedo se $P$ termina in generale, chiedo se termina in $y$ passi. Questa relazione \u00e8 ricorsiva e per dimostrarlo costruiamo un programma che classifica $R_P$ usando:\n- $U$ interprete universale;\n- *clock* per contare i passi di interpretazione;\n- *check del clock* per controllare l'arrivo alla quota $y$.\n\nDefiniamo quindi il programma $ overset(U,tilde) = U + \"clock\" + \"check clock\" $ tale che $ overset(U,tilde) equiv & \"input\"(x,y) \\ & U(P,x) + \"clock\" \\ & \"ad ogni passo di\" U(P,x): \\ & quad \"if clock\" > y: \\ & quad quad \"output\"(0) \\ & quad \"clock\"++; \\ & \"output\"(\"clock\" == y) quad . $\n\nNel sistema RAM, ad esempio, per capire se l'output \u00e8 stato generato o meno osservo se il PC, contenuto nel registro $L$, \u00e8 uguale a 0.\n\nRiprendiamo il problema dell'arresto ristretto: _come possiamo esprimere $A = {x in NN bar.v phi_x (x) arrow.b}$ attraverso la relazione ricorsiva $R_ristretto$?_\n\nPossiamo definire l'insieme $ B = {x in NN bar.v exists y in NN bar.v (x R_ristretto y)}. $\n\nNotiamo come $A = B$:\n- $A subset.eq B$: se $x in A$ il programma codificato con $x$ su input $x$ termina in un certo numero di passi. Chiamiamo $y$ il numero di passi. $ristretto(x)$ termina in $y$ passi, ma allora $x R_ristretto y$ e quindi $x in B$;\n- $B subset.eq A$: se $x in B$ esiste $y$ tale che $x R_ristretto y$, quindi $ristretto(x)$ termina in $y$ passi, ma allora il programma $ristretto = x$ su input $x$ termina, quindi $x in A$.\n\n== Insiemi ricorsivamente numerabili\n\nUn insieme $A subset.eq NN$ \u00e8 *ricorsivamente numerabile* se \u00e8 *automaticamente listabile*: esiste una _routine_ $F$ che, su input $i in NN$, d\u00e0 in output $F(i)$ come l'$i$-esimo elemento di $A$.\n\nIl programma che lista gli elementi di $A$ \u00e8: $ P equiv & i := 0; \\ & \"while\" (1 > 0) space { \\ & quad \"output\"(F(i)) \\ & quad i := i + 1; \\ & } $\n\nPer alcuni insiemi non \u00e8 possibile riconoscere tutti gli elementi che gli appartengono, ma pu\u00f2 essere che si conosca un modo per elencarli. Alcuni insiemi invece non hanno nemmeno questa propriet\u00e0.\n\nSe il meglio che posso fare per avere l'insieme A \u00e8 listarlo con P, _come posso scrivere un algoritmo che \"tenta di riconoscere\" A?_ Questo algoritmo deve listare tutti gli elementi senza un clock di timeout: se inserissi un clock avrei un insieme ricorsivo per la relazione $R_P$ mostrata in precedenza.\n\nVediamo il programma di *massimo riconoscimento*: $ P equiv & \"input\"(x) \\ & i := 0; \\ & \"while\" (F(i) eq.not x) \\ & quad i := i + 1; \\ & \"output\"(1) quad . $\n\nCome viene riconosciuto l'insieme $A$? $ x in NN arrow.long.squiggly P(x) = cases(1 & \"se\" x in A, \"LOOP\" quad & \"se\" x in.not A) quad . $\n\nVista la natura di questa funzione, gli insiemi ricorsivamente numerabili sono anche detti *insiemi parzialmente decidibili/riconoscibili* o *semidecidibili*.\n\nSe avessi indicazioni sulla monotonia della routine $F$ allora avrei sicuramente un insieme ricorsivo. In questo caso non assumiamo niente quindi rimaniamo negli insiemi ricorsivamente numerabili.\n\n=== Definizione formale\n\nL'insieme $A subset.eq NN$ \u00e8 *ricorsivamente numerabile* se e solo se:\n- $A = emptyset.rev$ oppure\n- $A = immagine(f)$, con $f : NN arrow.long NN in cal(T)$, ovvero $A = {f(0), f(1), f(2), dots}$.\n\nVisto che $f$ \u00e8 ricorsiva totale esiste un/a programma/routine $F$ che la implementa e che usiamo per il parziale riconoscimento di $A$: questo programma, se $x in A$, prima o poi mi restituisce 1, altrimenti entra in loop.\n\n\u00c8 come avere un _libro con infinite pagine_, su ognuna delle quali compare un elemento di $A$. Il programma di riconoscimento $P$, grazie alla routine $F$, non fa altro che sfogliare le pagine $i$ di questo libro alla ricerca di $x$:\n- se $x in A$ prima o poi $x$ compare nelle pagine del libro come $F(i)$;\n- se $x in.not A$ sfoglio il libro all'infinito, non sapendo quando fermarmi.\n\n=== Caratterizzazioni\n\n#theorem(numbering: none)[\n Le seguenti definizioni sono equivalenti:\n + $A$ \u00e8 ricorsivamente numerabile, con $A = immagine(f)$ e $f in cal(T)$ funzione ricorsiva totale;\n + $A = dominio(f)$, con $f in cal(P)$ funzione ricorsiva parziale;\n + esiste una relazione $R subset.eq NN^2$ ricorsiva tale che $A = {x in NN bar.v exists y in NN bar.v (x,y) in R}$.\n]\n\n#proof[\n \\ Per dimostrare questi teoremi dimostriamo che $1 arrow.long.double 2 arrow.long.double 3 arrow.long.double 1$, creando un'implicazione ciclica.\n\n #block(\n fill: rgb(\"#9FFFFF\"),\n inset: 8pt,\n radius: 4pt,\n \n [$1 arrow.long.double 2$] \n )\n \n Sappiamo che $A = immagine(f)$, con $f in cal(T)$, \u00e8 ricorsivamente numerabile, quindi esistono la sua routine di calcolo $f$ e il suo algoritmo di parziale riconoscimento $P$, definiti in precedenza. Vista la definizione di $P$, abbiamo che $ phi_P (x) = cases(1 \"se\" x in A, bot \"se\" x in.not A) quad , $ ma allora $A = dominio(phi_P)$: il dominio \u00e8 l'insieme dei valori dove la funzione \u00e8 definita, in questo caso proprio l'insieme $A$. Inoltre, $phi_P in cal(P)$ perch\u00e9 ho mostrato che esiste un programma $P$ che la calcola.\n\n #block(\n fill: rgb(\"#9FFFFF\"),\n inset: 8pt,\n radius: 4pt,\n \n [$2 arrow.long.double 3$]\n )\n\n Sappiamo che $A = dominio(f)$, con $f in cal(P)$, quindi esiste un programma $P$ tale che $phi_P = f$. Considero allora la relazione $ R_P = {(x,y) in NN^2 bar.v P \"su input\" x \"termina in\" y \"passi\"}, $ che abbiamo dimostrato prima essere ricorsiva. Definiamo $ B = {x in NN bar.v exists y bar.v (x,y) in R_P}. $ Dimostriamo che A = B. Infatti:\n - $A subset.eq B$: se $x in A$ allora su input $x$ il programma $P$ termina in un certo numero di passi $y$, visto che $x$ \u00e8 nel \"dominio\" di tale programma. Vale allora $(x,y) in R_P$ e quindi $x in B$;\n - $B subset.eq A$: se $x in B$ allora per un certo $y$ ho $(x,y) in R_P$, quindi $P$ su input $x$ termina in $y$ passi, ma visto che $phi_P (x) arrow.b$ allora $x$ sta nel dominio di $f = phi_P$, quindi $x in A$.\n\n #block(\n fill: rgb(\"#9FFFFF\"),\n inset: 8pt,\n radius: 4pt,\n \n [$3 arrow.long.double 1$]\n )\n\n Sappiamo che $A = {x in NN bar.v exists y bar.v (x,y) in R}$, con $R$ relazione ricorsiva.\n\n Assumiamo che $A eq.not emptyset.rev$ e scegliamo $a in A$, sfruttando l'assioma della scelta. Definiamo ora la funzione $t : NN arrow.long NN$ come $ t(n) = cases(cantorsin(n) quad & \"se\" (cantorsin(n), cantordes(n)) in R, a & \"altrimenti\") quad . $\n\n Visto che $R$ \u00e8 una relazione ricorsiva esiste un programma $P_R$ che categorizza ogni numero naturale, ma allora la funzione $t$ \u00e8 ricorsiva totale. Infatti, possiamo scrivere il programma $ P equiv & \"input\"(n) \\ & x := cantorsin(n); \\ & y := cantordes(n); \\ & \"if\" (P_R (x,y) == 1) \\ & quad \"output\"(x) \\ & \"else\" \\ & quad \"output\"(a) $ che implementa la funzione $t$, quindi $phi_P = t$.\n\n Dimostriamo che $A = immagine(t)$. Infatti:\n - $A subset.eq immagine(t)$: se $x in A$ allora $(x,y) in R$, ma allora $t(cantor(x,y)) = x$, quindi $x in immagine(t)$;\n - $immagine(t) subset.eq A$: se $x in immagine(t)$ allora:\n - se $x = a$ per l'assioma della scelta $a in A$ quindi $x in A$;\n - se $x = cantorsin(n)$, con $n = cantor(x,y)$ per qualche $y$ tale che $(x,y) in R$, allora $x in A$ per definizione di $A$.\n]\n\nGrazie a questo teorema abbiamo tre caratterizzazioni per gli insiemi ricorsivamente numerabili e possiamo sfruttare la formulazione che ci \u00e8 pi\u00f9 comoda.\n\nNell'esperienza del Prof. , \u00e8 molto utile e comodo il punto 2. In ordine:\n+ scrivo un programma $P$ che restituisce $1$ su input $x in NN$, altrimenti va in loop se $x in.not A$: $ P(x) = cases(1 quad & \"se\" x in A, bot & \"se\" x in.not A) quad ; $\n+ la semantica di $P$ \u00e8 quindi tale che: $ phi_P (x) = cases(1 \"se\" x in A, bot \"se\" x in.not A) quad ; $\n+ la funzione calcolata \u00e8 tale che $ phi_P in cal(P), $ visto che il programma che la calcola \u00e8 proprio $P$, mentre l'insieme $A$ \u00e8 tale che $ A = dominio(phi_P); $\n+ $A$ \u00e8 ricorsivamente numerabile per il punto 2.\n\n== Insiemi ricorsivamente numerabili ma non ricorsivi\n\nUn esempio di insieme che non \u00e8 ricorsivo, ma \u00e8 ricorsivamente numerabile, \u00e8 identificato dal problema dell'*arresto ristretto*.\n\nInfatti, l'insieme $ A = {x in NN bar.v phi_x (x) arrow.b} $ non \u00e8 ricorsivo, altrimenti il problema dell'arresto ristretto sarebbe decidibile.\n\nTuttavia, questo insieme \u00e8 *ricorsivamente numerabile*: infatti, il programma $ P equiv & \"input\"(x) \\ & U(x,x); \\ & \"output\"(1) $ decide parzialmente $A$. Come possiamo vedere, se $x in A$ allora $phi_x (x) arrow.b$, ovvero l'interprete universale $U$ termina, e il programma $P$ restituisce $1$, altrimenti non termina. \n\nDi conseguenza $ phi_P (x) = cases(1 & \"se\" phi_U (x,x) = phi_x (x) arrow.b, bot quad & \"altrimenti\") quad . $\n\nDato che $A = dominio(phi_P in cal(P))$ posso applicare la seconda caratterizzazione data nella lezione precedente per dimostrare che l'insieme $A$ \u00e8 un insieme ricorsivamente numerabile.\n\nAlternativamente, possiamo dire che $ A = {x in NN bar.v phi_x (x) arrow.b} = {x in NN bar.v exists y in NN bar.v (x,y) in R_ristretto}, $ con $ R_ristretto = {(x,y) bar.v ristretto \"su input\" x \"termina entro\" y \"passi\"} $ relazione ricorsiva. Qui possiamo sfruttare la terza caratterizzazione degli insiemi ricorsivamente numerabili.\n\nCome sono messi i due insiemi?\n\n#theorem(numbering: none)[\n Se $A subset.eq NN$ \u00e8 ricorsivo allora \u00e8 ricorsivamente numerabile.\n]\n\n#proof[\n \\ Se $A$ \u00e8 ricorsivo esiste un programma $P$ che \u00e8 in grado di riconoscerlo, ovvero un programma che restituisce $1$ se $x in A$, altrimenti restituisce $0$.\n\n Il programma $P$ \u00e8 del tipo $ P equiv & \"input\"(x) \\ & \"if\"(P_A(x) == 1) \\ & quad quad \"output\"(1) \\ & \"else\" \\ & quad quad \"while\"(1>0); quad . $\n\n La semantica di questo programma \u00e8 $ phi_(P_A) (x) = cases(1 & \"se\" x in A, bot quad & \"se\" x in.not A) quad , $ ma allora $A$ \u00e8 il dominio di una funzione ricorsiva parziale, quindi $A$ \u00e8 ricorsivamente numerabile per la seconda caratterizzazione.\n]\n\nPoco fa abbiamo mostrato come $A = {x in NN bar.v phi_x (x) arrow.b}$ sia un insieme ricorsivamente numerabile ma non ricorsivo, ma allora vale $ \"Ricorsivi\" subset \"Ricorsivamente numerabili\" . $\n\n#figure(\n image(\"assets/ricorsivi-rnumerabili-1.svg\", width: 50%)\n)\n\n_Esistono insiemi che non sono ricorsivamente numerabili?_\n\n== Chiusura degli insiemi ricorsivi\n\nCerchiamo di sfruttare l'operazione di complemento di insiemi sui ricorsivamente numerabili per vedere di che natura \u00e8 l'insieme $ A^C = {x in NN bar.v phi_x (x) arrow.t} . $\n\n#theorem(numbering: none)[\n La classe degli insiemi ricorsivi \u00e8 un'Algebra di Boole, ovvero \u00e8 chiusa per complemento, intersezione e unione.\n]\n\n#proof[\n \\ Siano $A,B$ due insiemi ricorsivi. Allora esistono dei programmi $P_A, P_B$ che li riconoscono o, equivalentemente, esistono $chi_A, chi_B in cal(T)$.\n\n \u00c8 facile dimostrare che le operazioni di unione, intersezione e complemento sono facilmente implementabili da programmi che terminano sempre. Di conseguenza, $ A union B, A sect B, A^C $ sono ricorsive.\n\n Vediamo questi tre programmi:\n - *complemento* $ P_(A^C) equiv & \"input\"(x) \\ & \"output\"(1 overset(-, .) P_A (x)) . $\n - *intersezione* $ P_(A sect B) equiv & \"input\"(x) \\ & \"output\"(min(P_A (x), P_B (x))) . $\n - *unione* $ P_(A union B) equiv & \"input\"(x) \\ & \"output\"(max(P_A (x), P_B (x))) . $\n\n Allo stesso modo possiamo trovare le funzioni caratteristiche delle tre operazioni:\n - $chi_(A^C) (x) = 1 overset(-, .) chi_A (x)$;\n - $chi_(A sect B) = chi_A (x) dot chi_B (x)$;\n - $chi_(A union B) = 1 overset(-, .) (1 overset(-, .) chi_A (x))(1 overset(-, .) chi_B (x))$.\n \n Tutte queste funzioni sono ricorsive totali, quindi anche le funzioni $A^C, A sect B, A union B$ sono ricorsive totali.\n]\n\nOra, per\u00f2, vediamo un risultato molto importante riguardante nello specifico il complemento dell'insieme dell'arresto $A^C$ che abbiamo definito prima.\n\n#theorem(numbering: none)[\n $A^C$ non \u00e8 ricorsivo.\n]\n\n#proof[\n \\ Se $A^C$ fosse ricorsivo, per la propriet\u00e0 di chiusura dimostrata nel teorema precedente, avremmo $ (A^C)^C = A $ ricorsivo, il che \u00e8 assurdo.\n]\n\nRicapitolando abbiamo:\n- $A = {x : phi_x (x) arrow.b}$ ricorsivamente numerabile, ma non ricorsivo;\n- $A^C = {x : phi_x (x) arrow.t}$ non ricorsivo.\n\n_L'insieme $A^C$ Potrebbe essere ricorsivamente numerabile?_\n\n#theorem(numbering: none)[\n Se $A$ \u00e8 ricorsivamente numerabile e $A^C$ \u00e8 ricorsivamente numerabile allora $A$ \u00e8 ricorsivo.\n]\n\n#proof[\\\n \\ *INFORMALE*\n\n Essendo $A$ e $A^C$ ricorsivamente numerabili, esistono due libri con infinite pagine su ognuna delle quali compare un elemento di $A$ (_primo libro_) e un elemento di $A^C$ (_secondo libro_).\n\n Per decidere l'appartenenza di $x$ ad $A$, possiamo utilizzare il seguente procedimento:\n + $\"input\"(x)$;\n + apriamo i due libri alla prima pagina;\n - se $x$ compare nel libro di $A$, stampa $1$,\n - se $x$ compare nel libro di $A^C$, stampa $0$,\n - se $x$ non compare su nessuna delle due pagine, voltiamo la pagina di ogni libro e ricominciamo.\n \n Questo algoritmo termina sempre dato che $x$ o sta in $A$ o sta in $A^C$, quindi prima o poi verr\u00e0 trovato su uno dei due libri.\n\n Ma allora questo algoritmo riconosce $A$, quindi $A$ \u00e8 ricorsivo.\n\n *FORMALE*\n\n Essendo $A$ e $A^C$ ricorsivamente numerabili, esistono $f,g in cal(T)$ tali che $A = immagine(f) and A^C = immagine(g)$. Sia $f$ implementata dal programma $F$ e $g$ dal programma $G$. Il seguente programma riconosce $A$: $ P equiv & \"input\"(x) \\ & i:= 0; \\ & \"while\"(\"true\") \\ & quad quad \"if\" (F(i)=x) \"output\"(1); \\ & quad quad \"if\" (G(i)=x) \"output\"(0); \\ & quad quad i := i + 1; $\n\n Questo algoritmo termina per ogni input, in quanto $x in A$ o $x in A^C$. Possiamo concludere che l'insieme $A$ \u00e8 ricorsivo.\n]\n\nConcludiamo immediatamente che $A^C$ *non* pu\u00f2 essere ricorsivamente numerabile.\n\nIn generale, questo teorema ci fornisce uno strumento molto interessante per studiare le caratteristiche della riconoscibilit\u00e0 di un insieme $A$:\n- se $A$ non \u00e8 ricorsivo, potrebbe essere ricorsivamente numerabile;\n- se non riesco a mostrarlo, provo a studiare $A^C$;\n- se $A^C$ \u00e8 ricorsivamente numerabile, allora per il teorema possiamo concludere che $A$ non \u00e8 ricorsivamente numerabile.\n\n#v(12pt)\n\n#figure(\n image(\"assets/ricorsivi-rnumerabili-2.svg\", width: 50%)\n)\n\n#v(12pt)\n\n== Chiusura degli insiemi ricorsivamente numerabili\n\n#theorem(numbering: none)[\n La classe degli insiemi ricorsivamente numerabili \u00e8 chiusa per unione e intersezione, ma non per complemento.\n]\n\n#proof[\n \\ Per complemento, abbiamo mostrato che $A = {x : phi_x (x) arrow.b}$ \u00e8 ricorsivamente numerabile, mentre $A^C = {x : phi_x (x) arrow.t}$ non lo \u00e8.\n\n Siano $A,B$ insiemi ricorsivamente numerabili. Esistono, perci\u00f2, $f, g in cal(T) bar.v A = immagine(f) and B = immagine(g)$. Sia $f$ implementata da $F$ e $g$ implementata da $G$. Siano \n \n #grid(\n columns: (50%, 50%),\n \n align(center)[\n $ P_i equiv & \"input\"(x); \\ & i := 0; \\ & \"while\"(F(i) eq.not x) \\ & quad i++; \\ & i := 0; \\ & \"while\"(G(i) eq.not x) \\ & quad i++; \\ & \"output\"(1); $\n ],\n \n align(center)[\n $ P_u equiv & \"input\"(x); \\ & i := 0; \\ & \"while\"(\"true\") \\ & quad \"if\" (F(i) = x) \\ & quad quad \"output\"(1); \\ & quad \"if\" (G(i) = x) \\ & quad quad \"output\"(1); \\ & quad i++; $\n ]\n )\n\n i due programmi che calcolano rispettivamente $A sect B$ e $A union B$. Le loro semantiche sono\n \n #grid(\n columns: (50%, 50%),\n\n align(center)[\n $ phi_(P_i) = cases(1 & \"se\" x in A sect B, bot quad & \"altrimenti\") $\n ],\n\n align(center)[\n $ phi_(P_u) = cases(1 & \"se\" x in A union B, bot quad & \"altrimenti\") $\n ]\n )\n da cui ricaviamo che\n\n #grid(\n columns: (50%, 50%),\n\n align(center)[\n $ A sect B = dominio(phi_P' in cal(P)) $\n ],\n\n align(center)[\n $ A union B = dominio(phi_P'' in cal(P)) $\n ]\n )\n \n I due insiemi sono quindi ricorsivamente numerabili per la seconda caratterizzazione.\n]\n\n== Teorema di Rice\n\nIl *teorema di Rice* \u00e8 un potente strumento per mostrare che gli insiemi appartenenti a una certa classe non sono ricorsivi.\n\nSia ${phi_i}$ un SPA. Un insieme (_di programmi_) $I subset.eq NN$ \u00e8 un *insieme che rispetta le funzioni* se e solo se $ (a in I and phi_a = phi_b) arrow.long.double b in I . $\n\nIn sostanza, $I$ rispetta le funzioni se e solo se, data una funzione calcolata da un programma in $I$, allora $I$ contiene tutti i programmi che calcolano quella funzione. Questi insiemi sono detti anche *chiusi per semantica*.\n\nPer esempio, l'insieme $I = {x in NN bar.v phi_x (3) = 5}$ rispetta le funzioni. Infatti, $ underbracket(a in I, phi_a (3) = 5) and underbracket(phi_a = phi_b, phi_b (3) = 5) arrow.double b in I . $\n\n#theorem(\n name: \"Teorema di Rice\",\n numbering: none\n)[\n Sia $I subset.eq NN$ un insieme che rispetta le funzioni. Allora $I$ \u00e8 ricorsivo solo se $I = emptyset.rev$ oppure $I = NN$.\n]\n\nQuesto teorema ci dice che gli insiemi che rispettano le funzioni non sono mai ricorsivi, tolti i casi banali $emptyset.rev$ e $NN$.\n\n#proof[\n Sia $I$ insieme che rispetta le funzioni con $I eq.not emptyset.rev$ e $I eq.not NN$. Assumiamo per assurdo che $I$ sia ricorsivo. \n \n Dato che $I eq.not emptyset.rev$, esiste almeno un elemento $a in I$. Inoltre, dato che $I eq.not NN$, esiste almeno un elemento $overline(a) in.not I$.\n\n Definiamo la funzione $t : NN arrow.long NN$ come: $ t(n) = cases(overline(a) quad & \"se\" n in I, a & \"se\" n in.not I) . $\n\n Sappiamo che $t in cal(T)$ dato che \u00e8 calcolabile dal programma $ P equiv & \"input\"(x); \\ & \"if\"(P_I (n) = 1) \\ & quad \"output\"(overline(a)); \\ & \"else\" \\ & quad \"output\"(a) $\n \n Visto che $t in cal(T)$, il _teorema di ricorsione_ assicura che in un SPA ${phi_i}$ esiste $d in NN$ tale che $ phi_d = phi_t(d) . $\n\n Per tale $d$ ci sono solo due possibilit\u00e0 rispetto a $I$:\n - se $d in I$, visto che $I$ rispetta le funzioni e $phi_d = phi_t(d)$ allora $t(d) in I$. Ma $t(d in I) = overline(a) in.not I$, quindi ho un assurdo;\n - se $d in.not I$ allora $t(d) = a in I$ ma $I$ rispetta le funzioni, quindi sapendo che $phi_d = phi_t(d)$ deve essere che $d in I$, quindi ho un assurdo.\n\n Assumere $I$ ricorsivo ha portato ad un assurdo, quindi $I$ non \u00e8 ricorsivo.\n]\n\n=== Applicazione\n\nIl teorema di Rice suggerisce un approccio per stabilire se un insieme $A subset.eq NN$ non \u00e8 ricorsivo:\n+ mostrare che $A$ rispetta le funzioni;\n+ mostrare che $A eq.not emptyset.rev$ e $A eq.not NN$;\n+ $A$ non \u00e8 ricorsivo per Rice.\n\n=== Limiti alla verifica automatica del software\n\nDefiniamo:\n- *specifiche*: descrizione di un problema e richiesta per i programmi che devono risolverlo automaticamente. Un programma \u00e8 _corretto_ se risponde alle specifiche;\n- *problema*: _posso scrivere un programma $V$ che testa automaticamente se un programma sia corretto o meno?_\n\nIl programma che vogliamo scrivere ha semantica $ phi_V (P) = cases(1 & \"se\" P \"\u00e8 corretto\", 0 quad & \"se\" P \"\u00e8 errato\") quad . $\n\nDefiniamo $ \"PC\" = {P bar.v P \"\u00e8 corretto\"} . $ Osserviamo che esso rispetta le funzioni: infatti, $ underbracket(P in \"PC\", P \"corretto\") and underbracket(phi_P = phi_Q, Q \"corretto\") arrow.long.double Q in \"PC\" $\n\nMa allora PC non \u00e8 ricorsivo. Dato ci\u00f2, la correttezza dei programmi non pu\u00f2 essere testata automaticamente. Esistono, per\u00f2, dei casi limite in cui \u00e8 possibile costruire dei test automatici:\n- specifiche del tipo _\"nessun programma \u00e8 corretto\"_ generano $\"PC\" = emptyset.rev$;\n- specifiche del tipo _\"tutti i programmi sono corretti\"_ generano $\"PC\" = NN$.\n\nEntrambi gli insiemi PC sono ovviamente ricorsivi e quindi possono essere testati automaticamente.\n\nQuesto risultato mostra che non \u00e8 possibile verificare automaticamente le *propriet\u00e0 semantiche* dei programmi (_a meno di propriet\u00e0 banali_).\n" }, { "repo": "https://github.com/ckunte/m-one", "file": "https://raw.githubusercontent.com/ckunte/m-one/master/inc/cosfunc.typ", "language": "typst", "license": "", "content": "= Cosine interaction\n\nWhile reviewing the changes introduced in the new ISO 19902:2020 standard@iso19902_2020, this one jumped at me:\n\n#quote()[\n tubular member strength formulae for combined axial and bending loading now of cosine interaction form instead of previously adopted linear interaction; \n]\n\nIn ISO 19902:2020, the combined unity check for axial (tension | compression) + bending takes the following general expression:\n\n$ U_m = 1 - cos(pi / 2 (gamma_(R,t|c) sigma_(t|c)) / f_(t|y c)) + (gamma_(R,b) sqrt(sigma^2_(b,y)) + sigma^2_(b,z)) / f_b $\n\nThis form of unity check has existed since 1993 in API RP-2A LRFD@api_rp2a_lrfd, 1st edition, and whose introduction into ISO 19902:2020 is briefly described in $section$A13.3.2 and $section$A13.3.3. This form makes its presence felt throughout _$section$13 Strength of tubular members_.#footnote[This form, i.e., 1 - cos(x) occurs in as many as eleven equations, viz., Eq. 13.3-1, 13.3-2, 13.3-4, 13.3-8, 13.3-18, 13.3-19, 13.3-21, 13.3-23, 13.4-7, 13.4-13, and 13.4-19 in ISO 19902:2020. Curiously, this is not applied to dented tubes in \u00a713.7.3, whose combined UC expression(s) remains like before.]\n\nPreviously, _Um_ in ISO 19902:2007 was expressed as:\n\n$ U_m = gamma_(R,t|c) sigma_(t|c) / f_(t|y c) + gamma_(R,b) sqrt(sigma^2_(b,y) + sigma^2_(b,z)) / f_b $\n\nThe reduction of _Um_ in the first equation is notable, see Figure below. For example, if the axial unity check value (x) is, say, 0.2, then its contribution is reduced to $0.05 (= 1 - cos(pi / 2 x)$. Remember `cos()` is in radians.\n\n#figure(\n image(\"/img/tuc_under_cosint.svg\", width: 100%),\n caption: [\n Axial utilisation versus axial component under cosine interaction in the combined utilisation expression\n ]\n) \n\n#let cosint = read(\"/src/cosint.py\")\n#{linebreak();raw(cosint, lang: \"python\")}\n\n$ - * - $" }, { "repo": "https://github.com/ThatOneCalculator/riesketcher", "file": "https://raw.githubusercontent.com/ThatOneCalculator/riesketcher/main/riesketcher.typ", "language": "typst", "license": "MIT License", "content": "#import \"@preview/cetz:0.2.2\"\n\n/// Draw a Riemann sum of a function, and optionally plot the function.\n///\n/// - fn (function): The function to draw a Riemann sum of.\n/// - domain (array): Tuple of the domain of fn. If a tuple value is auto, that\n/// value is set to start/end.\n/// - start (number): Where to start drawing bars.\n/// - end (number): Where to end drawing bars.\n/// - n (number): Number of bars\n/// - y-scale (number): Y scale of bars.\n/// - method (string): Where points are derrived from. Can be \"left\", \"mid\"/\"midpoint\", or \"right\".\n/// - transparency (number): Transparency fill of bars.\n/// - dot-radius (number): Radius of dots.\n/// - plot (boolean): Whether to add plot of the function.\n/// - plot-grid (boolean): Show grid on plot.\n/// - plot-x-tick-step (number): X tick step of plot.\n/// - plot-y-tick-step (number): Y tick step of plot.\n/// - positive-color (color): Color of positive bars.\n/// - negative-color (color): Color of negative bars.\n/// - plot-line-color (color): Color of plotted line.\n#let riesketcher(\n fn,\n start: 0,\n end: 10,\n domain: (auto, auto),\n n: 10,\n y-scale: 1,\n method: \"left\",\n transparency: 40%,\n dot-radius: 0.15,\n plot: true,\n plot-grid: false,\n plot-x-tick-step: auto,\n plot-y-tick-step: auto,\n positive-color: color.green,\n negative-color: color.red,\n plot-line-color: color.blue,\n size: (5, 5),\n) = {\n // Adjust the function domain if set to auto\n if domain.at(0) == auto { domain.at(0) = start }\n if domain.at(1) == auto { domain.at(1) = end }\n\n let horizontal-hand-offset = 0%\n if method == \"right\" {\n horizontal-hand-offset = 100%\n }\n else if method == \"mid\" or method == \"midpoint\" {\n horizontal-hand-offset = 50%\n }\n\n let col-trans(color, opacity) = {\n let space = color.space()\n space(..color.components(alpha: false), opacity)\n }\n\n let delta = end - start\n let bar-width = (end - start) / n\n let bar-position = if method == \"left\" {\n \"start\"\n } else if method == \"right\" {\n \"end\"\n } else {\n \"center\"\n }\n\n let bar-y = range(0, n).map(x => {\n let x = start + bar-width * (x + horizontal-hand-offset / 100%)\n (x, fn(x))\n })\n\n let positive-bar-style = (\n fill: col-trans(positive-color.lighten(70%).darken(8%), transparency),\n stroke: col-trans(positive-color.darken(30%), 90%) + 1.1pt\n )\n let negative-bar-style = (\n : ..positive-bar-style,\n fill: col-trans(negative-color.lighten(70%).darken(8%), transparency),\n stroke: col-trans(negative-color.darken(30%), 90%) + 1.1pt\n )\n let positive-dot-style = (\n stroke: black,\n fill: positive-color\n )\n let negative-dot-style = (\n : ..positive-dot-style,\n fill: negative-color,\n )\n\n cetz.plot.plot(\n size: size,\n x-grid: plot-grid,\n y-grid: plot-grid,\n axis-style: if plot { \"school-book\" } else { none },\n x-tick-step: plot-x-tick-step,\n y-tick-step: plot-y-tick-step,\n {\n for (x, y) in bar-y {\n cetz.plot.add-bar(((x, y),),\n bar-width: bar-width,\n bar-position: bar-position,\n style: if y >= 0 { positive-bar-style } else { negative-bar-style })\n }\n\n if plot {\n cetz.plot.add(\n domain: domain,\n x => fn(x),\n style: (stroke: plot-line-color + 1.5pt))\n }\n\n for (x, y) in bar-y {\n cetz.plot.add(((x, y),),\n mark: \"o\",\n style: (stroke: none),\n mark-size: dot-radius,\n mark-style:if y >= 0 { positive-dot-style } else { negative-dot-style })\n }\n })\n}\n" }, { "repo": "https://github.com/polarkac/MTG-Stories", "file": "https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/029%20-%20Aether%20Revolt/008_Puppets.typ", "language": "typst", "license": "", "content": "#import \"@local/mtgstory:0.2.0\": conf\n#show: doc => conf(\n \"Puppets\",\n set_name: \"\",\n story_date: datetime(day: 25, month: 01, year: 2017),\n author: \"\",\n doc\n)\n\n#emph[With the rest of the Gatewatch embroiled in the Inventors' revolution, Liliana has taken on the grim task of addressing what she sees as the ] real#emph[ problem on Kaladesh: the Planeswalker Tezzeret.]\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nLong ago and worlds away, a young had slipped through the trees of a dark forest while a battle raged around her. The croaking of ravens and the screams of the dying had accompanied her into the woods, and the course of her life had altered. The streets of Ghirapur were about as different from the Caligo Forest of Dominaria as the Liliana of today was from that naive, hopeful, desperate girl.\n\n#figure(image(\"008_Puppets/01.jpg\", width: 100%), caption: [Liliana, Heretical Healer | Art by Karla Ortiz], supplement: none, numbering: none)\n\nBut war was war. Buzzing thopters took the place of ravens here (for which she was deeply grateful), while screams mingled with the explosive sounds of aether cannons and quicksmithed incendiaries.\n\nHer mission then had been life: finding a cure for the mysterious affliction that had laid her brother on death's doorstep. Today her mission was death\u2014her mission and her constant companion. The death of Tezzeret. Nothing else mattered\u2014not the struggles of Kaladesh's renegades, not the interference of her Planeswalker allies, not the Consulate's attempts to restore order.\n\nTezzeret had to die.\n\nOf #emph[course] he had to die, and it was absurd that Gideon was queasy about it. Hells, right up until this whole business on Kaladesh had started, she had thought he was dead already. Killing him now was just tidying up a loose end left over from an unfortunate affair on Ravnica four years ago.\n\nLiliana had been working for the dragon then, turning Jace against Tezzeret in an attempt to wrest away control of an interplanar consortium. Jace had wrecked Tezzeret's mind and left him for dead on some remote plane. A loose end\u2014Tezzeret would come after her, would come after Jace, would no doubt make everything more complicated.\n\nShe sighed, looking around at the chaos wrought by Ghirapur's angry renegades. Everything was already complicated enough, and she had plenty of unresolved issues. Tezzeret and and the Chain Veil. Bolas and her demonic pacts. The damned Raven Man. Even the events of the Caligo Forest had left certain questions unanswered. One tangled mess after another, each with its own loose ends. She paused and looked at the body of a hapless renegade, lying limp and broken in the wreckage of a small copter. She waved a hand in its direction, and a new zombie struggled to its feet.\n\n#figure(image(\"008_Puppets/02.jpg\", width: 100%), caption: [Cemetery Recruitment | Art by ], supplement: none, numbering: none)\n\nShe felt a little better.\n\nIf Tezzeret had been a loose end when she first found him here, now he was a clear danger not just to this plane, but as far as his ambitions extended. If Rashmi had any idea what she was talking about\u2014and she was smart, so she probably did\u2014then Tezzeret was building something like an old-fashioned planar portal, the sort of thing that had caused so much chaos in Dominaria's ancient history. As far as she had known, such things were impossible now, now that the Multiverse had...changed.\n\nBut judging from the vortex of energy that was now swirling around the Aether Spire, Liliana guessed that Tezzeret had activated that portal. That could not be good.\n\nGideon talked a good show about fighting interplanar threats, but Tezzeret was right in their reach and somehow Gideon didn't want to kill him. Instead, he and Jace and the others were hip-deep in this war, this rebellion. \"None of our damned business,\" she muttered. Not that she really cared about the stated mission of the Gatewatch, but the revolt had become a huge distraction from what was really important.\n\n\"Me,\" Liliana said to herself with a sardonic smile.\n\nShe told the zombie to follow her, smiling at the thought of Gideon's disapproval. But she would need a bodyguard if she was going to get to Tezzeret.\n\n#emph[And I ] am#emph[ going to get to Tezzeret] , she thought.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nFortunately Liliana didn't have much farther to go because her new friend drew a lot of attention. It was the best kind of attention, though: people gasping and recoiling in horror, pointing at her in shock and dismay, and staying the hell out of her way.\n\n#emph[You'd think they'd never seen a necromancer before.]\n\nBut she knew it couldn't last; sooner or later, some Consulate soldiers would decide that she and her zombie were a threat to their precious order and put themselves between her and the Aether Spire. So she covered the remaining distance as quickly as she could manage, until at last she reached a barricade across the street and a dozen or so Consulate soldiers blocking her way. An unnatural wind, no doubt stirred up by the swirling energy vortex above, drowned out the sound of the dwarf captain's challenge, but her meaning was clear: Stop. Turn back.\n\n#figure(image(\"008_Puppets/03.jpg\", width: 100%), caption: [Bastion Enforcer | Art by ], supplement: none, numbering: none)\n\nWith the slightest nod of her head, Liliana directed the zombie to a position in front her, to keep the soldiers busy until she could deal with them.\n\n\"#emph[Deal with them?] \" She could almost hear Jace's voice questioning her\u2014in fact, for a moment she thought it was his voice in her mind. A single spell could drain the life from the soldiers and add their walking corpses to her retinue, and she had no doubt she could do it. Mana surged in her like bile, fueled by her hatred of Tezzeret, ready for the battle to come. Killing these soldiers would be easy\u2014but, strangely, that had not been her plan. #emph[Perhaps Jace and] \u2014she shuddered a little\u2014#emph[and General Meat-Shield are rubbing off on me.]\n\nSpears stood up a little straighter and aether weapons lit with their blue glow as she continued her approach. Then a keen-eyed soldier saw the nature of her escort and shouted a delightful expletive, audible even over the rushing wind.\n\n\"That's your cue,\" she muttered, willing the zombie ahead as she strode toward the soldiers. Purplish-black energy crackled around her hands and sparked like static in her skirt.\n\nThen her magic surged out in front of her like a wave of death, sweeping over the soldiers. She was careful: just enough mana to suck the breath from their lungs until their vision went black and their knees buckled, just enough to keep them out of the way while she and her escort entered the spire, and not enough to turn them into withered husks. She almost wished Jace were there to witness her care and restraint.\n\nThe zombie cleared the barricade, and Liliana entered the Aether Spire.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nRestraint was not entirely practical. It robbed her of the chance to build a whole retinue of zombie bodyguards. More important, it left people behind her, who could block her retreat once Tezzeret was dead. How easy it would be, she thought as a ghostly black hand coiled itself around the neck of another sentry, to tighten just a little, to twist, to send one more soul into the yawning Void. Jace and Sir Side-of-Beef would never know. So easy.\n\nBut she sighed, let her own hand fall to her side, and watched the sentry slump to the ground, clutching his throat and gasping for breath, unable to lift a finger to stop her. She patted his helmet as she walked past him.\n\nAnd then she was inside. It was a vault of a room, dominated by the huge ring of Tezzeret's planar portal. More accurately, the portal was a ring within a ring, set within a vaguely ring-like structure made of whorls and glowing pipes and what looked like purely decorative filigree. Tezzeret stood just beneath the inner rings, his back to her, manipulating some piece of machinery. Beyond, a shattered glass wall left the room open to the gusting winds, with an orange sunset staining the sky.\n\n#figure(image(\"008_Puppets/04.jpg\", width: 100%), caption: [Planar Bridge | Art by Chase Stone], supplement: none, numbering: none)\n\nShe thrust both hands forward, the tattoos of her demonic contract glowing almost as brightly as the aether in the portal. The time for restraint was past. A roiling storm of smoky blackness surged across the room toward Tezzeret, coalescing into a spectral claw that would tear his soul from his flesh and end him.\n\nBut at the last second, a hulk of sharp-edged metal detached itself from the heaps of junk around the edges of the room and interposed itself between Tezzeret and the death that hurtled toward him. Liliana's spell tore into it, but not through it, and it seemed none the worse for wear as it coalesced into a vaguely humanoid figure.\n\nOnly then did Tezzeret turn around, his flesh-and-bone hand finishing up some kind of adjustment to his etherium arm. He seemed unfazed by her arrival and even her attack.\n\n\"Vess,\" he said. His voice echoed in the enormous room. \"Did #emph[he] send you? What, to check up on me?\"\n\n#figure(image(\"008_Puppets/05.jpg\", width: 100%), caption: [Art by Daarken], supplement: none, numbering: none)\n\nLiliana blinked. This was hardly the vicious counterattack she had expected\u2014and prepared for. \"Who?\"\n\nTezzeret shrugged. He tugged the sleeve of his robe down to cover most of his etherium arm again, hiding a strange glow that seemed to echo the eddying light of his portal. Only then did he grace her with his full attention. He arched an eyebrow.\n\n\"No,\" she said. \"You saw in the arena. I'm here with them.\"\n\n\"Of course you are. Baan's little mistake. What did he call them? The Gatewatch?\" He chuckled. \"Did they come to see my magnificent gate?\" A broad gesture with his metal hand encompassed the ring behind and around him.\n\nLiliana sauntered to her left, putting some distance between herself and the junk-heap of a construct that had saved him and was now lumbering in her direction. \"I thought it was Rashmi's gate.\"\n\nTezzeret's face twisted in rage. \"That idiot? She had no idea what she discovered.\"\n\nLiliana smiled. His temper was his weakness, and pricking his ego seemed to be the surest way to make him lose control. \"I wouldn't be so sure,\" she said.\n\n\"What, you think she glimpsed the Blind Eternities? You think she understood how her invention could be used to bridge worlds? She would have been sending vases across Ghirapur forever if I hadn't guided her tiny little mind.\" He was closing the gap between them now, as if to keep Liliana away from his precious creation.\n\nPurple light coursed through the channels etched in Liliana's skin. \"You should know better than to underestimate a woman like her.\" Emphasizing that point, while his guard was down, she hurled a focused blast at him, like dark lightning. He threw up his metal hand, blocking the attack and scattering its energy. She needed to get closer.\n\n\"Fair enough,\" he growled. The metallic hulk shambled closer, raising two fist-like masses over what passed for its head. Tezzeret continued talking as if nothing had happened. \"And what about your new friends? Do they have any idea who they've gotten themselves tangled up with?\"\n\nA cascade of metal crashed to the floor, battering her zombie bodyguard but leaving Liliana unscathed. The zombie lurched at the walking scrap heap as Tezzeret advanced.\n\n\"Of course not,\" Liliana said. For all their hesitation, their displays of mistrust, the other members of the Gatewatch had welcomed her into the fold. In fact, the one person who might have known better\u2014Jace\u2014had encouraged them to trust her.\n\n\"You have them all wrapped around your finger, don't you?\" Tezzeret said.\n\nLiliana just smiled, pointed a single glowing finger, and shot another enervating bolt of energy at him.\n\nHe waved his metal hand, and a stream of sharp metal shards coursed through the air and intercepted her attack. \"Even Beleren?\" he said. \"I find it hard to believe that he's forgotten what you did to him.\"\n\nLiliana scowled. \"Jace and I...\" She trailed off, and decided to finish her sentence by snatching at the edges of Tezzeret's soul and sucking his vitality away.\n\nBlue light shimmered in the air between them, and her magic vanished into tiny azure sparks. \"Or has he forgotten?\" Tezzeret said. \"His memory seems so fragile.\"\n\n\"He certainly hasn't forgotten what #emph[you] did to him.\" Two crackling blasts, in rapid succession, punctuated her words. One was intercepted by Tezzeret's living scrap heap, tearing itself free of the zombie, and he caught the other one on his metal hand\u2014with some apparent effort.\n\n\"It's too bad he didn't come with you.\" Tezzeret spread his arms wide, and two streams of metallic shards like the one that had torn into her zombie rose up behind him, snakelike. \"We could have had quite a reunion.\"\n\n#figure(image(\"008_Puppets/06.jpg\", width: 100%), caption: [Battle at the Bridge | Art by ], supplement: none, numbering: none)\n\nHe had left himself open. A spectral black hand appeared from nowhere and clutched at his chest, sending him staggering back and gasping for breath as the metal shards cascaded down to the ground. But she had sacrificed power for speed, and he didn't fall.\n\nHis breathing was heavy and his voice rasped. \"Are you certain Beleren isn't the one manipulating you?\" he said. \"Sending you to fight his battles and exact his revenge?\"\n\n\"No one sent me.\" #emph[I took it upon myself to do the work none of them would do,] she thought. #emph[My choice. Right?]\n\n\"Are you sure?\" Tezzeret said, as if he saw the hesitation in her mind. \"Maybe he's playing you, worming his way into your thoughts.\"\n\nLiliana's zombie was doing a pretty good job of dismantling the junk hulk, but she needed it to be harrying Tezzeret instead. \"Oh, please,\" she said. \"Jace likes to think he's a mastermind, but when he looks at me he turns into a schoolboy.\" But her words didn't come out sounding quite as convincing as she had intended.\n\n\"I think he's #emph[softened] you, Vess. The necromancer I knew four years ago would have marched in here at the head of a zombie army. And she might have lived to tell about it.\" Tezzeret pointed his real hand at a pile of construction materials, and something stirred to life.\n\n#figure(image(\"008_Puppets/07.jpg\", width: 100%), caption: [Tezzeret's Touch | Art by Chris Rallis], supplement: none, numbering: none)\n\nThe effort of will his spell required showed on his face, and she jumped at the opening. She felt blood well up in the lines carved into her flesh as she drew on just the smallest bit of the Chain Veil's power. \"You don't know what you're talking about,\" she snarled, as a pulse of dark energy radiated out from her like a ripple. The ripple bounced off Tezzeret and turned back toward her, tearing his life from his body as it came. She reached for it, calling that scrap of vitality, of soul, toward her waiting arms. Tezzeret clutched at his throat and fell to his knees\u2014where her zombie fell on him, biting and clawing.\n\nShe twisted her fingers in the air, claiming a better hold on the magic that had caught hold of his life, reeling it in like a wriggling fish on a line. Oh, she was #emph[enjoying] this!\n\nShe heard a loud buzz just before a hawk-sized thopter clipped her face, sending her sprawling on her back and opening a gash in her forehead. She heard Tezzeret gulping the air and looked up in time to see him throw the zombie off him and stagger to his feet, his eyes burning with rage. Two thopters took up positions hovering over his shoulders.\n\n\"Why are we fighting, Vess?\" He took several labored breaths while she got to her feet. \"Has your love for Beleren made you think you're some kind of hero?\"\n\nShe gritted her teeth, biting back her own fury. \"I assure you, my relationship with Jace has nothing to do with romance or sentiment.\" Her breath was coming faster as well, but the energy she had siphoned from Tezzeret surged through her. \"And what kind of #emph[hero] uses magic like mine?\" Her zombie lunged at him again.\n\nTezzeret's huge metal claw sliced across the zombie's rotting flesh in a wide arc, trailing foulness and offal. \"So he really didn't send you?\"\n\n\"Jace? Of course\u2014\"\n\n\"Not Beleren.\"\n\nThey stood facing each other in a moment of stillness.\n\n\"Oh,\" Liliana breathed. \"Oh. You're here for Bolas.\"\n\nA contemptuous sneer twisted his face. \"Tell me you didn't #emph[just] figure that out.\"\n\n#emph[It all makes sense now. ] Some part of her had suspected, but she hadn't wanted to believe it. But it explained why he was alive, why his mind seemed whole. #emph[And it's all so much worse now,] she thought as she ducked Tezzeret's swooping thopters.\n\n\"So #emph[he's] got #emph[you] wrapped around his finger,\" she said. #emph[Like he does everyone.]\n\nTezzeret snarled. \"I'm working to pay off a debt. Thanks to your boyfriend.\" Jace had been just a pawn in their game, but the injury he'd done to Tezzeret was not the kind that's easily forgiven.\n\n\"And then what?\"\n\nTezzeret shrugged, but Liliana saw a familiar cockiness in his eyes.\n\nShe laughed. \"You have grand plans to turn the tables on him? On ? I'm pretty sure even you are not that stupid.\"\n\n\"Even if I had such plans, I certainly wouldn't tell you. It's only a matter of time before Bolas lays your mind bare and reads it like a book.\"\n\nThat was not a pleasant thought. She answered it with a barrage of necrotizing energy\u2014enough to rot the flesh from his bones, drink his soul dry, and leave him a crumpled husk on the ground, if she had been able to get through his defenses. But another stream of metallic shards, like a swarm of bees, caught some blasts. His counterspells negated others, and one blast went wild when a thopter drove itself into her gut, knocking the wind out of her. Even so, Tezzeret was forced to his knees, choking and gasping, and what was left of the zombie managed to pin him to the floor.\n\n#figure(image(\"008_Puppets/08.jpg\", width: 100%), caption: [Metallic Rebuke | Art by\u00a0], supplement: none, numbering: none)\n\nBlood flowed freely over her skin, not from any injury he had inflicted on her, but from the exertion of her spellcasting, the toll exacted by the Chain Veil. She wobbled\u2014ever so slightly\u2014as she walked to stand over him where he lay.\n\nShe rested one heel of her boot on his throat, just above his collarbone. \"So, what?\" she demanded. \"All this is for him? What's he going to do with it?\"\n\nTezzeret, breath ragged, stared up at her with fury and fear raging across his pale face.\n\n\"A transplanar shipping company?\" she asked. \"A new take on the Infinite Consortium?\" She knew better, of course: Bolas's plans had never been that small. She'd known that even on Ravnica, when she helped him pursue them.\n\nTezzeret managed a chuckle. \"Maybe you should ask him.\"\n\nLiliana's mouth quirked into a smile. \"But I have you right here.\"\n\n\"You know he never confides more than he needs to. He'd never tell me the full extent of his plans.\"\n\n\"Well, then you can tell me where to find him.\"\n\n\"So #emph[you] can turn the tables on him? Maybe you are as stupid as I thought.\"\n\n\"Who said anything about fighting him?\" Liliana said. \"Tell me where he is.\"\n\n\"I'm not sure he'd appreciate me divulging that.\"\n\nLiliana put a little more of her weight onto her heel, squeezing a hoarse cough from his\n\nthroat. \"I'm quite sure I #emph[don't] appreciate your reticence.\"\n\nTezzeret gagged, clearly unable to speak. She lightened up the pressure just enough to let him breathe. \"Spit it out, Tezz.\"\n\n\"You should know. You've been there before.\"\n\nShe frowned, thinking of all the planes she'd visited. \"Which one?\"\n\nTezzeret tried to cough, but couldn't get any air out. He tried in vain to make sounds. \"R\u2014 Ra\u2014\"\n\nWith an impatient sigh, she lifted her foot, looking for a different soft spot on his metallic body where she could grind in her heel.\n\n\"Razaketh,\" he gasped.\n\nEvery inch of her body was suddenly alive with a thrill of fear. Two demons remained who held power over her, thanks to the contract engraved on her skin. Kothophed and Griselbrand had fallen relatively easily, thanks to the Chain Veil. But the Chain Veil's power came with a cost, attested by the blood that still dripped from her skin and splattered on Tezzeret's face and chest. Razaketh was stronger than either of them.\n\nShe had planned to bring Jace and the rest of his precious Gatewatch to confront Razaketh eventually. But she had hoped to understand them better\u2014to learn what they were capable of, to make sure she knew exactly what strings to pull and what buttons to press to get them to do what she wanted them to do\u2014before she brought them to...\n\n\"Amonkhet,\" she said aloud. \"He's on Amonkhet.\"\n\nTezzeret swallowed hard and with evident pain. #emph[Good.]\n\n\"This is the end, Tezzeret.\" She spread her hands above him, summoning the mana for the spell that would drain whatever life he had left in him.\n\n\"Is that what this is?\"\n\nHe was looking past her. She ducked, expecting another swooping thopter. Indeed, something was flying toward her\u2014something much larger than Tezzeret's birdlike thopters, hurtling toward the spire from outside the shattered glass wall.\n\nThe renegades' so-called hope. So the Gatewatch had done their job after all, getting the airship past the Consulate's blockade, close enough to launch the aether disruptor. Surprising, but pleasing.\n\n\"I think it's about to be,\" she said. She moved behind what looked like a sturdy wall, leaving Tezzeret in her zombie's grasp.\n\nBut something was wrong: she caught a glimpse as she ducked behind the wall, of flaming red hair at the tip of the oversized thopter. #emph[Chandra? What the hell] \u2014\n\n\"We'll see,\" Tezzeret said, and then\u2014\n\nThen there was fire.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nChandra's fist was a birthing star, searing hot against Gideon's chest despite the glowing golden light that shielded his body from the heat. Holding her tightly against him, he could feel every muscle in her body trembling with the effort to create and control the flame.\n\n\"Almost there,\" he said. The brilliant golden glow spread across the rest of his body\u2014the magical force that had protected him from countless injuries. Would it be enough?\n\nShe gave the slightest nod and the heat grew even more intense.\n\n#figure(image(\"008_Puppets/09.jpg\", width: 100%), caption: [Art by ], supplement: none, numbering: none)\n\n\"Chandra,\" he said.\n\nShe didn't respond\u2014maybe she hadn't heard, maybe she was too focused on the burning sun clutched in her palm.\n\n\"I'm glad you're here,\" he said. \"I'm glad you left Regatha. The Gatewatch\u2014the whole thing. I'm\u2014\"\n\n\"Gids,\" she said through clenched teeth. \"I'm...I'm gonna let go.\"\n\nHe pulled her closer. Impact was a heartbeat away. The golden light enfolded them both now\u2014it was working!\u2014but the heat...\n\n\"I've got you,\" he said. \"You're safe.\"\n\n\"I know,\" she said. Her other hand touched his arm, and that was enough.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nBrilliant white light, an eruption of searing hot air, crumbling stone, and clouds of dust. Falling. Screams. Pain\u2014too damned much pain.\n\nWhen her vision cleared, Liliana found herself half-buried in the rubble of the workshop, shattered stone and fractured metal all around, the wall she had sheltered behind now mostly crumbled away. A huge column of smoke boiled up from where Tezzeret's gate had stood. No zombie moved in response to her mental call, so she set about extricating herself. She was smeared with blood and a bit woozy, thanks to the Chain Veil if not her small injuries.\n\nWith every stone she lifted and set aside, she breathed a creative new curse. She hadn't killed Tezzeret when she had the chance, and if she had survived this explosion then he probably had as well. He would escape, back to Bolas\u2014or he'd find her now and kill her, while she was...not at full strength.\n\n#emph[And stupid Chandra has gone and killed herself] , she thought. #emph[That was not the plan.] \"What a waste,\" she said to herself. \"Can't they do anything right without me?\"\n\nFreed from the rubble, she clambered toward the wreckage of Tezzeret's portal. If he was alive, or Chandra, or any shred of hope, she would find it there. As she went, she occasionally stopped to shove a piece or rubble or hunk of metal aside, clearing her path and distantly hoping she might find someone.\n\n\"I'd be perfectly content to find a corpse to help me move this junk.\"\n\n#emph[Someone who obeys me without question] , she thought. #emph[Someone completely under my control. It's so much easier that way.]\n\nTezzeret's words rang in her mind: \"You have them all wrapped around your finger, don't you?\" #emph[That's the plan,] she thought. #emph[But nothing is going according to plan.]\n\nThe whole point of coming to Kaladesh had been to assess Chandra's usefulness. #emph[She's not very useful if she's dead\u2014well, she's of very limited use.]\n\nIf she was going to kill the rest of her demons without killing herself, if she was ever to be free, she needed more than zombies. She needed powerful people, and she'd found them. But it was all so complicated.\n\nShe heard coughing. And in the midst of the dust and smoke swirling above the wreckage of the portal, she caught a glimpse of flame-red hair and brass goggles. Alive.\n\nLiliana picked up her pace, turned her ankle once and ignored the jolt of pain, and finally reached Chandra.\n\n\"Chandra!\" she scolded. \"What in all the Nine Hells was\u2014\"\n\nChandra helped Gideon to his feet beside her. Towering over her, he picked a twisted hunk of filigree from her hair. They both looked like\u2014well, like a building had fallen on them, and Liliana suspected she didn't look much better.\n\n\"Beef...side...guy,\" Liliana stammered.\n\nChandra was avoiding Gideon's eyes, and she smiled when she saw Liliana. Gideon followed her gaze.\n\n\"Liliana!\" he said. He stepped forward and lifted his hand, then clearly thought better of it before bringing that meaty weight down on her shoulder. He awkwardly scratched his sideburn. \"Did you...uh, did you find him?\"\n\nLiliana scowled. \"He's either buried in this rubble or run home to his master.\"\n\nIn silence, the three Planeswalkers gazed around the wreckage for a long moment.\n\n\"Where's Jace?\" Liliana said at last. \"We #emph[really] need to talk.\"\n\n#figure(image(\"008_Puppets/10.jpg\", width: 100%), caption: [Dark Intimations | Art by Chase Stone], supplement: none, numbering: none)\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/riesketcher/0.1.0/riesketcher.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"@preview/cetz:0.1.2\"\n\n/// Draw a Riemann sum of a function, and optionally plot the function.\n///\n/// - fn (function): The function to draw a Riemann sum of.\n/// - start (number): Where to start drawing bars.\n/// - end (number): Where to end drawing bars.\n/// - n (number): Number of bars (please make $Delta x =1$).\n/// - y-scale (number): Y scale of bars.\n/// - x-offset (number): X offset of bars.\n/// - y-offset (number): Y offset of bars.\n/// - hand (string): Where points are derrived from. Can be \"left\", \"mid\"/\"midpoint\", or \"right\".\n/// - transparency (number): Transparency fill of bars.\n/// - dot-radius (number): Radius of dots.\n/// - plot (boolean): Whether to add plot of the function.\n/// - plot-grid (boolean): Show grid on plot.\n/// - plot-x-tick-step (number): X tick step of plot.\n/// - plot-y-tick-step (number): Y tick step of plot.\n/// - positive-color (color): Color of positive bars.\n/// - negative-color (color): Color of negative bars.\n/// - plot-line-color (color): Color of plotted line.\n#let riesketcher(\n fn,\n start: 0,\n end: 10,\n n: 10,\n y-scale: 1,\n x-offset: 0,\n y-offset: 0,\n hand: \"left\",\n transparency: 40%,\n dot-radius: 0.055,\n plot: true,\n plot-grid: false,\n plot-x-tick-step: auto,\n plot-y-tick-step: auto,\n positive-color: color.green,\n negative-color: color.red,\n plot-line-color: color.blue,\n) = {\n\n let hand-offset = 0\n let mark-horizontal = \"-left\"\n if hand == \"right\" {\n hand-offset = 1\n mark-horizontal = \"-right\"\n } \n else if hand == \"mid\" or hand == \"midpoint\" {\n hand-offset = 0.5\n mark-horizontal = \"\"\n }\n\n let col-trans(color, opacity) = {\n let space = color.space()\n space(..color.components(alpha: false), opacity)\n }\n\n if plot {\n cetz.plot.plot(\n size: (end + x-offset, end),\n x-grid: plot-grid,\n y-grid: plot-grid,\n axis-style: \"school-book\",\n x-tick-step: plot-x-tick-step,\n y-tick-step: plot-y-tick-step,\n {\n cetz.plot.add(\n domain: (start - x-offset, end),\n x => fn(x),\n style: (\n stroke: plot-line-color + 1.5pt,\n ),\n )\n })\n }\n\n // Doesn't work if Delta n != 1\n // Should be `for i in range(start, end, step: (end - start)/n).map(...`\n // https://github.com/typst/typst/issues/2908\n for i in range(start, end).map(x => x * n/(end - start)) {\n let height = fn(i + hand-offset)\n let bar-color = positive-color\n let mark-vertical = \"top\"\n if fn(i) <= 0 {\n bar-color = negative-color\n mark-vertical = \"bottom\"\n }\n cetz.draw.fill(col-trans(\n bar-color.lighten(70%).darken(8%),\n transparency\n ))\n cetz.draw.rect(\n (i + x-offset, y-offset),\n (i + x-offset + 1, (height/y-scale) + y-offset),\n stroke: col-trans(bar-color.darken(30%), 90%) + 1.1pt,\n name: \"r\"\n )\n cetz.draw.circle(\n \"r.\" + mark-vertical + mark-horizontal,\n radius: dot-radius,\n fill: bar-color\n )\n }\n}\n" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/visualize/shape-rect_01.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n#set page(width: 150pt)\n\n// Fit to text.\n#rect(fill: conifer)[Textbox]\n\n// Empty with fixed width and height.\n#block(rect(\n height: 15pt,\n fill: rgb(\"46b3c2\"),\n stroke: 2pt + rgb(\"234994\"),\n))\n\n// Fixed width, text height.\n#rect(width: 2cm, fill: rgb(\"9650d6\"))[Fixed and padded]\n\n// Page width, fixed height.\n#rect(height: 1cm, width: 100%, fill: rgb(\"734ced\"))[Topleft]\n\n// These are inline with text.\n{#box(rect(width: 0.5in, height: 7pt, fill: rgb(\"d6cd67\")))\n #box(rect(width: 0.5in, height: 7pt, fill: rgb(\"edd466\")))\n #box(rect(width: 0.5in, height: 7pt, fill: rgb(\"e3be62\")))}\n\n// Rounded corners.\n#stack(\n dir: ltr,\n spacing: 1fr,\n rect(width: 2cm, radius: 30%),\n rect(width: 1cm, radius: (left: 10pt, right: 5pt)),\n rect(width: 1.25cm, radius: (\n top-left: 2pt,\n top-right: 5pt,\n bottom-right: 8pt,\n bottom-left: 11pt\n )),\n)\n\n// Different strokes.\n#set rect(stroke: (right: red))\n#rect(width: 100%, fill: lime, stroke: (x: 5pt, y: 1pt))\n" }, { "repo": "https://github.com/hillbillybones/job-search", "file": "https://raw.githubusercontent.com/hillbillybones/job-search/main/README.md", "language": "markdown", "license": "", "content": "# Job Search\n\nThis repository was created to manage the CV generation process using [Typst](https://github.com/typst/typst) and YAML.\n\n## Files\n\n- `cv.pdf`: The compiled CV in PDF format.\n- `cv.typ`: The Typst source file.\n- `cv.yaml`: The YAML file containing the CV data.\n\n## Instructions\n\n### Install Typst Compiler\n\nTo compile the Typst source file, you need to install the Typst compiler. Follow the instructions [here](https://github.com/typst/typst?tab=readme-ov-file#installation) to install the Typst compiler.\n\n### Compile the CV\n\nOnce you have installed the Typst compiler, you can compile the CV by running the following command:\n\n```typst compile cv.typ```\n\nThis will generate the `cv.pdf` file.\n" }, { "repo": "https://github.com/SkiFire13/master-thesis", "file": "https://raw.githubusercontent.com/SkiFire13/master-thesis/master/template.typ", "language": "typst", "license": "", "content": "#import \"config/printed.typ\": pagebreak-to-right, pagebreak-to-left, left-right-margins, printed\n\n#import \"preface/titlepage.typ\": titlepage\n#import \"preface/copyright.typ\": copyright\n#import \"preface/acknowledgements.typ\": acknowledgements\n#import \"preface/summary.typ\": summary\n#import \"preface/toc.typ\": toc\n\n#let template(\n affiliation: (\n university: \"University of Padua\",\n department: [Department of Mathematics \"Tullio Levi-Civita\"],\n degree: \"Master Degree in Computer Science\",\n ),\n title: \"Titolo della tesi\",\n subtitle: \"Tesi di laurea\",\n supervisor: \"Prof. \",\n candidate: (\n name: \"\",\n id: 1234256\n ),\n academic-year: \"AAAA-AAAA\",\n\n keywords: (),\n\n lang: \"it\",\n date: datetime.today(),\n\n body\n) = {\n set document(\n title: title,\n author: candidate.name,\n keywords: keywords,\n date: date,\n )\n\n set page(\n margin: (top: 1in + 22pt + 18pt + 12pt, x: 3.5cm, bottom: 3.5cm),\n header-ascent: 12pt + 18pt\n )\n set text(lang: lang)\n set text(font: \"New Computer Modern\", size: 11pt)\n set par(justify: true)\n\n {\n set heading(numbering: none)\n\n set page(numbering: \"i\")\n titlepage(\n affiliation,\n title,\n supervisor,\n candidate,\n academic-year\n )\n pagebreak-to-right(weak: true)\n copyright(candidate.name, title, date)\n pagebreak-to-right(weak: true)\n acknowledgements()\n pagebreak-to-right(weak: true)\n summary()\n pagebreak-to-right(weak: true)\n toc()\n pagebreak-to-right(weak: true)\n }\n\n {\n let header = context {\n set text(size: 13pt)\n\n let next_chapters = query(selector(heading.where(level: 1)).after(here()))\n\n if next_chapters.len() > 0 and next_chapters.at(0).location().page() == here().page() {\n align(right)[#counter(page).get().at(0)]\n } else {\n let chapter = query(selector(heading.where(level: 1)).before(here())).last()\n if calc.rem(here().page(), 2) == 0 {\n grid(\n align: (left, right),\n columns: (auto, 1fr),\n [#counter(page).get().at(0)],\n [#numbering(\"1\", counter(heading).get().at(0)). #smallcaps(chapter.body)],\n )\n } else {\n let subsection = query(selector(heading).before(here())).last()\n\n grid(\n align: (left, right),\n columns: (1fr, auto),\n [#numbering(\"1.1\", ..counter(heading).get()). #smallcaps(subsection.body)],\n [#counter(page).get().at(0)],\n )\n }\n }\n }\n\n set page(numbering: \"1\", header: if printed { header }, footer: if printed { [] } else { none })\n counter(page).update(1)\n \n set heading(numbering: \"1.1.1\")\n show heading.where(level: 1): it => {\n pagebreak-to-right(weak: true)\n smallcaps(text(size: 24pt, it))\n v(1.5em)\n }\n show heading.where(level: 2): it => {\n text(size: 18pt, it)\n v(0.5em)\n }\n\n set list(indent: 0.5em)\n \n show math.equation: it => {\n show \".\": math.class(\"punctuation\", \".\")\n it\n }\n\n body\n }\n}\n" }, { "repo": "https://github.com/TypstApp-team/typst", "file": "https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/math/class.typ", "language": "typst", "license": "Apache License 2.0", "content": "// Test math classes.\n\n---\n// Test characters.\n$ a class(\"normal\", +) b \\\n a class(\"binary\", .) b \\\n lr(class(\"opening\", \\/) a/b class(\"closing\", \\\\)) \\\n { x class(\"fence\", \\;) x > 0} \\\n a class(\"large\", \\/) b \\\n a class(\"punctuation\", :) b \\\n a class(\"relation\", ~) b \\\n a + class(\"unary\", times) b \\\n class(\"vary\", :) a class(\"vary\", :) b $\n\n---\n// Test custom content.\n#let dotsq = square(\n size: 0.7em,\n stroke: 0.5pt,\n align(center+horizon, circle(radius: 0.15em, fill: black))\n)\n\n$ a dotsq b \\\n a class(\"normal\", dotsq) b \\\n a class(\"vary\", dotsq) b \\\n a + class(\"vary\", dotsq) b \\\n a class(\"punctuation\", dotsq) b $\n\n---\n// Test nested.\n#let normal = math.class.with(\"normal\")\n#let pluseq = $class(\"binary\", normal(+) normal(=))$\n$ a pluseq 5 $\n\n---\n// Test exceptions.\n$ sqrt(3)\\/2 quad d_0.d_1d_2 dots $" }, { "repo": "https://github.com/RiccardoTonioloDev/Bachelor-Thesis", "file": "https://raw.githubusercontent.com/RiccardoTonioloDev/Bachelor-Thesis/main/chapters/conclusioni.typ", "language": "typst", "license": "Other", "content": "#pagebreak(to: \"odd\")\n= Conclusioni \n== Raggiungimento obbiettivi\nSi riassumono in seguito gli obbiettivi raggiunti durante il tirocinio:\n- Il modello PyDNet V1 \u00e8 stato verificato nei risultati enunciati dal proprio _paper_ @PyDNetV1;\n- \u00c8 stata migrata l'intera _codebase_ di PyDNet V1 e il modello di PyDNet V2 dal framework @Tensorflow al framework @PyTorch con successo:\n - Sono stati ottenuti gli stessi risultati nell'allenamento a 50 epoche sul _dataset_ KITTI;\n - Sono stati ottenuti gli stessi risultati nell'allenamento a 200 epoche sul _dataset_ KITTI;\n - Sono stati ottenuti gli stessi risultati nell'allenamento a 50 epoche sul _dataset_ CityScapes, con successivo @finetune di 50 epoche sul _dataset_ KITTI;\n - \u00c8 stata di conseguenza acquisita conoscenza e abilit\u00e0 nell'uso della libreria @PyTorch e del linguaggio Python, specificatamente per la creazione di modelli di _machine learning_ e per la creazione di ambienti d'allenamento;\n - \u00c8 stata acquisita abilit\u00e0 nell'uso di _cluster_ di calcolo per l'allenamento dei modelli;\n- \u00c8 stata acquisita conoscenza relativamente a meccanismi di attenzione quali la _self attention_ e i _convolutional block attention module_, e ne \u00e8 stata fatta successivamente l'implementazione in codice;\n- \u00c8 stata acquisita conoscenza nell'implementazione di moduli convoluzionali efficienti, specialmente lo _XiConv_ presentato in @xinet;\n- \u00c8 stata condotta dell'attivit\u00e0 di ricerca e sviluppo con l'obbiettivo di implementare valide alternative ai modelli PyDNet nel contesto @embedded:\n - \u00c8 stato studiato come il cambiamento di vari iperparametri pu\u00f2 portare a cambiamenti nelle prestazioni del modello;\n - Sono stati eseguiti un totale di tredici esperimenti, per tredici modelli diversi;\n - Tra i tredici modelli \u00e8 stato trovato un modello particolarmente interessante ($beta$CBAM I), che con il 37% di parametri in meno rispetto a PyDNet V1, riesce ad essere migliore rispetto a quest'ultimo, nelle metriche di valutazione proposte in @eigen, di un minimo di $tilde 1%$ e di un massimo del $tilde 15%$.\n\n#block([\n== Considerazioni\nIn questa tesi, sono stati esplorati e sviluppati diversi modelli di rete neurale per la predizione della profondit\u00e0 da immagini monoculari, con l'obiettivo di migliorare la precisione e l'efficienza di tali predizioni. Le principali conclusioni raggiunte sono le seguenti:\n+ *Migrazione di PyDNet*: La migrazione del modello PyDNet da @Tensorflow a @PyTorch ha dimostrato non solo la fattibilit\u00e0 di tale processo, ma ha anche permesso una pi\u00f9 facile integrazione con modelli e blocchi pi\u00f9 moderni;\n],breakable: false,width: 100%)\n+ *Esplorazione di XiNet*: L'introduzione di XiNet, un modello con un'architettura pi\u00f9 efficiente, ha portato a miglioramenti significativi nella stima della profondit\u00e0. Inoltre XiNet ha dimostrato di essere un modello pi\u00f9 leggero e performante, quindi adatto per applicazioni su dispositivi con risorse computazionali limitate;\n+ *Esplorazione dei Moduli di Attenzione (_CBAM_ e _self attention_)*: l'integrazione di moduli di attenzione come il _Convolutional Block Attention Module_ (_CBAM_) e i meccanismi di _self attention_ si \u00e8 verificata essere una scelta vincente al fine di migliorare le performance del modello. Si \u00e8 tuttavia notato come l'utilizzo della seconda non sia ideale per contesti di tipo _embedded_, mentre l'ultilizzo della prima deve essere fatto con criterio per ottenere buoni risultati;\n+ *Ricerca e sviluppo di PyXiNet*: Le varianti sperimentali PyXiNet, che combinano le architetture di PyDNet e XiNet con moduli di attenzione, hanno dimostrato progressivi miglioramenti. In particolare PyXiNet $beta$CBAM I ha evidenziato come l'uso combinato di queste tecnologie possa portare a predizioni molto pi\u00f9 accurate, con un piccolo compromesso sul tempo di inferenza e sul numero di parametri.\nI risultati appena discussi fanno quindi capire che l'uso di tecniche di _deep learning_ per la stima delle profondit\u00e0 da immagini monoculari si \u00e8 rivelato essere molto promettente, anche in ambienti con un potenziale di risorse molto limitato come il contesto _embedded_.\n" }, { "repo": "https://github.com/mangkoran/share.typ", "file": "https://raw.githubusercontent.com/mangkoran/share.typ/master/README.md", "language": "markdown", "license": "MIT License", "content": "

\n share.typ\n

\n\n

\n \n \"MIT\n \n

\n\nA template to create awesome short writings to share in social media thanks to\n[Typst](https://github.com/typst/typst) simple yet powerful syntax.\n\n## Demo\n\n
\n \"Example\n
\n\n## Usage\n\n`share.typ` is intended to be used by importing `share.typ` file from a \"content\" file\n([`example.typ`](example.typ) as example). This content file is used to call the functions which\napply document style & show post components and load post data from a YAML file\n([`example.yml`](example.yml) as example). Inside the content file you can modify several style\nvariables and even override existing function implementations to your heart's content.\n\n### With [Typst CLI](https://github.com/typst/typst) (Recommended)\n\nThe recommended usage with Typst CLI is by adding this `share.typ` repository as a [git\nsubmodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules). This way, upstream changes can be\npulled easily.\n\n```\n/\n\u251c\u2500\u2500 share.typ/ // git submodule \n| \u2514\u2500\u2500 share.typ\n\u251c\u2500\u2500 post/ // post YAML directory\n| \u251c\u2500\u2500 01-post-one.yml\n| \u251c\u2500\u2500 02-post-two.yml\n| \u2514\u2500\u2500 ...\n\u2514\u2500\u2500 .typ // #import \"share.typ/share.typ\": *\n```\n\n1. Add [mangkoran/share.typ](https://github.com/mangkoran/share.typ) as git submodule into your\n repo.\n```\ngit submodule add https://github.com/mangkoran/share.typ\n```\n2. Copy and rename `example.typ` and `example.yml` to your repo root directory. For post YAML file\n you can create a new directory (`post` or else) for better organization. Don't forget to update\n the YAML import to reflect this. Use these files as template/starting point for your post.\n3. Compile content file. Typst compiles to PDF by default. To compile Typst to PNG, use the\n following command.\n```bash\ntypst compile .typ .png\n\n# or you can use `watch` command to auto recompile on change \n# (a bit buggy tho especially with vi/vim/nvim)\ntypst watch .typ .png\n```\n\n### With [typst.app](https://typst.app)\n\n1. Upload the [`share.typ`](share.typ), [`example.typ`](example.typ) and\n [`example.yml`](example.yml) files to your Typst project. You may rename `example.typ` and\n `example.yml`. For post YAML file you can create a new directory (`post` or else) for better\n organization. Don't forget to update the YAML import to reflect this.\n2. Use `example.typ` and `example.yml` (or whatever the names after you rename it) as\n template/starting point for your post.\n" }, { "repo": "https://github.com/xubaiw/typst-rote", "file": "https://raw.githubusercontent.com/xubaiw/typst-rote/main/rote.typ", "language": "typst", "license": "", "content": "#let measure-em(c) = {\n let (width,) = measure(c)\n int(width.pt() / 1em.to-absolute().pt())\n}\n\n#let cloze(it) = context {\n show underline: u => {\n [\\u{ff3f}] * measure-em(u.body)\n }\n it\n}\n\n#let mnemonic(it) = context {\n show terms.item: it => {\n strong(it.term)\n linebreak()\n [\\u{ff3f}] * measure-em(it.description)\n linebreak()\n }\n it\n}\n\n" }, { "repo": "https://github.com/Myriad-Dreamin/tinymist", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist/README.md", "language": "markdown", "license": "Apache License 2.0", "content": "\n# tinymist\n\nThis crate provides a CLI that starts services for [Typst](https://typst.app/) [ta\u026apst]. It provides:\n+ `tinymist lsp`: A language server following the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).\n+ `tinymist preview`: A preview server for Typst.\n\n## Usage\n\nSee [Features: Command Line Interface](https://myriad-dreamin.github.io/tinymist/feature/cli.html).\n\n## Documentation\n\nSee [Crate Docs](https://myriad-dreamin.github.io/tinymist/rs/tinymist/index.html).\n\nAlso see [Developer Guide: Tinymist LSP](https://myriad-dreamin.github.io/tinymist/module/lsp.html).\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/Myriad-Dreamin/tinymist/blob/main/CONTRIBUTING.md).\n" }, { "repo": "https://github.com/dashuai009/dashuai009.github.io", "file": "https://raw.githubusercontent.com/dashuai009/dashuai009.github.io/main/src/content/blog/027.typ", "language": "typst", "license": "", "content": "#let date = datetime(\n year: 2022,\n month: 6,\n day: 9,\n)\n#metadata((\n title: \"rust\u51cf\u5c11\u7f16\u8bd1\u8b66\u544a\",\n subtitle: [rust],\n author: \"dashuai009\",\n description: \"\u9879\u76ee\u524d\u671f\u5f00\u53d1\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7RUSTFLAGS\u51cf\u5c11rust\u7f16\u8bd1\u65f6\u7ed9\u51fa\u7684\u8b66\u544a\u3002\u540e\u671f\u53bb\u6389\u8fd9\u4e9b\u9009\u9879\u5373\u53ef\u3002\",\n pubDate: date.display(),\n))\n\n#import \"../__template/style.typ\": conf\n#show: conf\n\n\n== rust\u7f16\u8bd1\u4fe1\u606f\n\n#link(\"https://doc.rust-lang.org/reference/attributes/diagnostics.html\")[diagnostics attributes]\n\n#link(\"https://doc.rust-lang.org/rustc/lints/levels.html\")[lints levels]\n\nrust\u5206\u4e3a\u56db\u79cdlint\u4fe1\u606f\uff1a\n- #strong[allow( C )] overrides the check for C so that violations will go unreported,\n- #strong[warn( C )] warns about violations of C but continues compilation.\n- #strong[deny( C )] signals an error after encountering a violation of C,\n- #strong[forbid( C )] is the same as deny( C ), but also forbids changing the lint level afterwards\n\n\u9ed8\u8ba4\u60c5\u51b5\u4e0brust\u7f16\u8bd1\u4f1a\u7ed9\u51fa#strong[\u5927\u91cf\u8b66\u544a\u4fe1\u606f];\uff0c\u6bd4\u5982\u53d8\u91cf\u547d\u540d\u4e0d\u89c4\u8303\u3001\u672a\u4f7f\u7528\u7684\u53d8\u91cf\u7b49\u7b49\u3002\u6bd4\u8f83\u70e6\u4eba\uff0c\u6709\u5f88\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u51cf\u5c11\u8fd9\u4e9b\u4fe1\u606f\u3002\n\n== \u67e5\u770b\u6240\u6709lint\n<\u67e5\u770b\u6240\u6709lint>\n`rustc -W help`\n\n== \u901a\u8fc7lint check\u5c5e\u6027\u51cf\u5c11\u7f16\u8bd1\u8b66\u544a\n<\u901a\u8fc7lint-check\u5c5e\u6027\u51cf\u5c11\u7f16\u8bd1\u8b66\u544a>\n\uff08lint check attribute \u8fd9\u4e0d\u77e5\u9053\u548b\u7ffb\u8bd1\u4e86\n\n\u5c06\u524d\u8fb9\u63d0\u5230\u7684C\u66ff\u6362\u6210`rustc -W help`\u770b\u5230\u7684\u4e1c\u897f\u3002\u6bd4\u5982\u7ed9\u51fd\u6570\u6dfb\u52a0`#[allow(missing_docs)]`\u53ef\u4ee5\u5141\u8bb8\u4e0d\u5199\u76f8\u5173\u6587\u6863\u3002\n\n== \u8bbe\u7f6eRUSTFLAGS\n<\u8bbe\u7f6erustflags>\n\u6267\u884crustc\u4e4b\u524d\u53ef\u4ee5\u5728export\u4e00\u4e9b\u73af\u5883\u53d8\u91cf\u3002\n\n`export RUSTFLAGS=\"$RUSTFLAGS -A unused\"; rustc balbalbaba`\n\n\u5728intellij\u7cfb\u5217\u7684IDE\u4e2d\uff0c\u53ef\u7ed9\u8fd0\u884c/\u8c03\u8bd5\u914d\u7f6e\u4e2d\u81ea\u52a8\u6dfb\u52a0\u8fd9\u4e9b\u73af\u5883\u53d8\u91cf\u3002\n\u4e0d\u8fc7\uff0c\u914d\u7f6e\u91cc#strong[\u4e0d\u9700\u8981\u6dfb\u52a0\u5f15\u53f7\u201d];\uff0c\u4ed6\u4f1a\u81ea\u52a8\u52a0\u4e0a\u3002\n\n#figure(\n image(\"027/clion.png\"),\n caption: [\n \u793a\u610f\u56fe\n ],\n)\n\n\u4e0a\u8fb9\u8fd9\u4e2a\u811a\u672c\u914d\u7f6e\u76f8\u5f53\u4e8e\u8fd9\u6761\u547d\u4ee4\uff1a\n`export RUSTFLAGS=\"$RUSTFLAGS -A dead_code -A unused -A non_snake_case -A non_upper_case_globals -A non_camel_case_types\"; wasm-pack build`\n\n\u8fd9\u91cc\u6211\u7528\u5230\u4e86\u4ee5\u4e0b\u51e0\u4e2a\n\n- -A dead\\_code\n- -A unused \u5141\u8bb8\u672a\u4f7f\u7528\uff08\u53d8\u91cf\u3001\u51fd\u6570\u7b49\uff0c\u4e00\u4e2alint group\uff09\n- -A non\\_snake\\_case \u5141\u8bb8\u8fd9\u4e09\u79cd\u4e0d\u63a8\u8350\u7684\u547d\u540d\u65b9\u5f0f\n- -A non\\_upper\\_case\\_globals\n- -A non\\_camel\\_case\\_types\n\n\u5168\u7ed9\u4ed6allow\u3002#strike[\u7f8e\u6ecb\u6ecb\uff0c\u7f16\u8bd1\u7ed3\u679c\u6e05\u51c0\u4e86]" }, { "repo": "https://github.com/ilsubyeega/circuits-dalaby", "file": "https://raw.githubusercontent.com/ilsubyeega/circuits-dalaby/master/Type%201/1/25.typ", "language": "typst", "license": "", "content": "#set enum(numbering: \"(a)\")\n#import \"@preview/cetz:0.2.2\": *\n#import \"../common.typ\": answer\n1.25 \ub2e4\uc74c \ud68c\ub85c\uc5d0\uc11c \uc8fc\uc5b4\uc9c4 \uc2dc\uac04 \ub3d9\uc548 \uc804\ub958\uac00 \ud750\ub974\ub294 \uc18c\uc790\ub4e4\ub9cc \ud3ec\ud568\ud558\ub294 \ud68c\ub85c\ub3c4\ub97c \uadf8\ub824\ub77c.\n\n+ $t < 0$\n+ $0 < t < 2 s$\n+ $t > 2 s$\n#answer[\n + $t < 0$\n #image(\"../assets/t_first.png\", width: 200pt)\n + $0 < t < 2$\n #image(\"../assets/t_mid.png\", width: 200pt)\n + $t > 2$\n #image(\"../assets/t_large.png\", width: 200pt)\n]" }, { "repo": "https://github.com/nicolasfara/presentation-2024-acsos-multi-tier-field-based-applications", "file": "https://raw.githubusercontent.com/nicolasfara/presentation-2024-acsos-multi-tier-field-based-applications/master/presentation-2024-acsos-multi-tier-field-based-applications.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"@preview/polylux:0.3.1\": *\n#import \"@preview/fontawesome:0.1.0\": *\n#import \"@preview/ctheorems:1.1.2\": *\n\n#show: thmrules\n\n#import themes.metropolis: *\n\n#show: metropolis-theme.with(\n aspect-ratio: \"16-9\",\n // footer: [Optional Footnote]\n)\n\n#set text(font: \"Fira Sans\", weight: 350, size: 20pt)\n#set enum(numbering: \"(i)\")\n#show math.equation: set text(font: \"New Computer Modern Math\")\n#set strong(delta: 200)\n#set par(justify: true)\n#set list(spacing: 1.9em)\n\n#set quote(block: true)\n#show quote: set align(left)\n#show quote: set pad(x: 2em, y: -0.8em)\n\n#set raw(tab-size: 4)\n#show raw: set text(size: 0.75em)\n#show raw.where(block: true): block.with(\n fill: luma(240),\n inset: (x: 1em, y: 1em),\n radius: 0.7em,\n width: 100%,\n)\n\n#show bibliography: set text(size: 0.75em)\n#show footnote.entry: it => {\n block(inset: (x: 2em, y: 0.1em))[#text(size: 0.75em)[#it.note.body]]\n}\n\n#let fcite(clabel) = {\n footnote(cite(form: \"full\", label(clabel)))\n}\n\n#let mail(email) = {\n text(size: 1.3em)[#raw(email)]\n}\n\n#let authors = block(inset: 0.1em)[\n #table(inset: 0.5em, stroke: none, columns: (auto, 4fr), align: (left, left),\n [#alert[*N*]], [#mail(\"\")],\n [], [#mail(\"\")],\n [], [#mail(\"\")],\n )\n #place(right, dy:-1em)[\n #figure(image(\"images/disi.svg\", width:40%))\n ]\n]\n\n// #set heading(numbering: \"1\")\n#show: thmrules.with(qed-symbol: \" \")\n#let theorem = thmbox(\"theorem\", \"Theorem\", fill: rgb(\"#EDA7200F\"))\n#let proof = thmproof(\"proof\", \"Proof\")\n\n#title-slide(\n title: [\n Flexible Self-organisation for the Cloud-Edge Continuum: \\\n a Macro-programming Approach\n ],\n // subtitle: \"Subtitle\",\n author: authors,\n // date: datetime.today().display(\"[day] [month repr:long] [year]\"),\n)\n\n#new-section-slide(\"Background\")\n\n#slide(title: \"Collective Self-organising Applications\")[\n A single program $mono(\"P\")$ describes the *collective self-org* behavior of the system, using:\n #side-by-side(columns: (2fr, auto))[\n - *macroprogramming* abstractions\n - *spatial* and *temporal* operators\n - *proximity-based* interaction (neighbours)\n - resilient *coordination* mechanisms\n ][\n #align(right)[\n #figure(image(\"images/scr-result.png\", height: 44%))\n ]\n // #figure(image(\"images/channel-sim.png\", width: 42%))\n ]\n #quote[Shift from a #underline[device-centric] to a #alert[collective-centric] view of the system.]\n\n #align(center)[#underline[_Aggregate computing_] #fcite(\"DBLP:journals/computer/BealPV15\") as a way to define such applications.]\n]\n\n#slide(title: \"Self-org Computational Model\")[\n #alert[Behaviour]: _repeated_ execution with #underline[async rounds] \\\n #alert[Interaction]: _repeated_ *neighbours* #underline[messages exchange] \\\n #alert[Alignment]: each device execution is *aligned* with the others (program _AST_ alignment)\n\n #line(length: 100%, stroke: 0.05em + rgb(\"#23373b\"))\n\n #only(1)[\n 1. Receiving #alert[messages] from neighbours\n #figure(image(\"images/ac-messages-perception.svg\", width: 74%))\n ]\n #only(2)[\n 2. Computation of the #alert[macro-program] against the received messages\n #figure(image(\"images/ac-computation.svg\", width: 74%))\n ]\n #only(3)[\n 3. Sending to neighbours the #alert[computed messages]\n #figure(image(\"images/ac-messages-propagation.svg\", width: 74%))\n ]\n #only(4)[\n 4. Sleep until next #alert[round]...\n #figure(image(\"images/ac.svg\", width: 74%))\n ]\n]\n\n// Slide sul gradiente\n\n#slide(title: [Distributed gradient])[\n #side-by-side(columns: (1fr, 1fr))[\n ```scala\n def gradient(source: Boolean): Int = \n rep(PositiveInfinity): distance =>\n mux(source)(0)(1 + minHood(nbr(distance)))\n ```\n\n This function computes the distance from a #alert[source]\n device to all the other devices in the network.\n\n More complex *collective* components are built leveraging the #alert[gradient] function.\n ][\n #only(1)[\n #figure(image(\"images/gradient-1.svg\"))\n ]\n #only(2)[\n #figure(image(\"images/gradient-1b.svg\"))\n ]\n #only(3)[\n #figure(image(\"images/gradient-2.svg\"))\n ]\n #only(4)[\n #figure(image(\"images/gradient-2b.svg\"))\n ]\n #only(5)[\n #figure(image(\"images/gradient-3.svg\"))\n ]\n #only(6)[\n #figure(image(\"images/gradient-4.svg\"))\n ]\n #only(7)[\n #figure(image(\"images/gradient-4b.svg\"))\n ]\n #only(8)[\n #figure(image(\"images/gradient-5.svg\"))\n ]\n #only(9)[\n #figure(image(\"images/gradient-5b.svg\"))\n ]\n #only(10)[\n #figure(image(\"images/gradient-6.svg\"))\n ]\n ]\n]\n\n#slide(title: [Distributed gradient])[\n #side-by-side(columns: (1fr, 1fr))[\n ```scala\n def gradient(source: Boolean): Int = \n rep(PositiveInfinity): distance =>\n mux(source)(0)(1 + minHood(nbr(distance)))\n ```\n\n This function computes the distance from a #alert[source]\n device to all the other devices in the network.\n\n More complex *collective* components are built leveraging the #alert[gradient] function.\n ][\n #only(1)[\n #figure(image(\"images/gradient-6b.svg\"))\n ]\n #only(2)[\n #figure(image(\"images/gradient-7.svg\"))\n ]\n #only(3)[\n #figure(image(\"images/gradient-7b.svg\"))\n ]\n #only(4)[\n #figure(image(\"images/gradient-8.svg\"))\n ]\n #only(5)[\n #figure(image(\"images/gradient-8b.svg\"))\n ]\n ]\n]\n\n#slide(title: \"Aggregate Programming\")[\n\n #side-by-side(columns: (2fr, auto))[\n == Field Composition\n ```scala\n def channel(source: Boolean, destination: Boolean): Boolean {\n val toSource = gradient(source) // Field[Double]\n val toDestination = gradient(destination) // Field[Double]\n val distance = distanceTo(source, destination)\n (toSource + toDestination - distance) <= 10\n }\n ```\n\n Functions take *fields* as #alert[input] and return *field* as #alert[output].\n ][\n #figure(image(\"images/channel.svg\", height: 50%))\n ]\n\n //#v(0.5em)\n\n #side-by-side(columns: (auto, auto), gutter: 2em)[\n _Aggregate Computing_ provide us #alert[formal guarantees] on functional composition: reference for *deployment validation*.\n ][\n The entire (_macro_-)program is executed by #alert[all the devices] in the network, \\\n assuming that each device *should* execute #alert[all] the functions.\n ]\n]\n\n#slide(title: \"Edge-Cloud Continuum\")[\n #side-by-side(gutter: 2em, columns: (2fr, auto))[\n #quote[Aggregation of #alert[computational resources] along the data path from the *edge* to the *cloud* #fcite(\"DBLP:journals/access/MoreschiniPLNHT22\")]\n\n #v(1em)\n\n We must deal with different #alert[capabilities] and #alert[constraints]:\n - #alert[edge devices]:\n - used for #underline[sensing/acting] over the (physical) environment\n - but they are typically *resources-constrained*\n - #alert[cloud instances]:\n - offer #underline[scalability] and #underline[computational power]\n - but introduce *latency/privacy* issues\n ][\n #figure(image(\"images/edge-cloud-continuum.svg\", height: 80%))\n ]\n\n // #align(center)[\n // The #alert[opportunistic] use of the _continuum_ offers new possibilities, \\\n // but requires fexible #alert[deployment] strategies.\n // ]\n]\n\n#new-section-slide(\"Motivation\")\n\n#slide(title: \"Motivation\")[\n *Collective* programs are deployed on #alert[each physical device] of the application.\n #side-by-side(columns: (2fr, auto), gutter: 1.5em)[\n Two main #underline[limitations]:\n 1. *resource-constrained* devices cannot satisfy all the components' requirements\n 2. available *infrastructure* is not exploited to its full potential (performance vs cost)\n\n Previous work #fcite(\"FARABEGOLI2024\") tried to partition the _self-org/macroprogramming_ execution model but did not consider the *modularity* at the macro-program level.\n ][\n #figure(image(\"images/ac-monolithic-motivation.svg\", height: 68%))\n ]\n]\n\n#slide(title: \"Different Service Requirements\")[\n #figure((image(\"images/macro-program-requirements.svg\", width: 70%)))\n #v(1em)\n #align(center)[Each component *may* require multiple requirements to be executed.]\n]\n\n#new-section-slide(\"Macro-components\") // Qui, se troviamo un nome per l'approccio, lo mettiamo\n\n#slide(title: \"Macro-programming Model\")[\n #side-by-side(columns: (2.5fr, 1fr), gutter: 1.5em)[\n / Macro-program: _direct acyclic graph_ (DAG) of #alert[components] // --- $mono(\"MP\")\\(overline(mono(\"C\")), overline(mono(\"B\"))\\)$\n / Component: atomic functional macro-program taking a list of #alert[inputs] and producing an #alert[output] // --- $mono(\"C\")$\n / Port: property of each _component_ through which the #alert[values] are received and produced (inputs and output of a function) // --- $mono(\"p\")$\n / Binding: indicates that the #alert[output port] of a component is connected to the #alert[input port] of other components // --- $italic(\"component\")\\(mono(\"p\"), mono(\"C\"), overline(mono(\"p\")))$\n ][\n #figure(image(\"images/partitioned-macro-program.svg\", width: 105%))\n ]\n]\n\n#slide(title: \"Macro-programming Model: Local vs Collective Components\")[\n #side-by-side(columns: (2fr, auto), gutter: 1.5em)[\n / Local component: just a transformation of #alert[local inputs] to #alert[local outputs].\n / Collective component: requires the interaction with _instances_ of the #alert[same component] in *neighbours*.\n ][\n #figure(image(\"images/collective-local-components.svg\", height: 80%))\n ] \n]\n\n#slide(title: \"System model\")[\n / Application devices: devices executing the macro-program $mono(\"MP\")$.\n / Infrastructural devices: devices supporting the execution of some parts of the $mono(\"MP\")$.\n\n #figure(image(\"images/system-model.svg\", width: 55%))\n]\n\n#slide(title: \"Application and deployment model\")[\n #side-by-side(columns: (2fr, auto), gutter: 1.5em)[\n // The macro-program $#math.mono(\"MP\")$ is executed by a $#math.bold(\"D\")$ set of #alert[application devices].\n\n // Typically the $#math.mono(\"C\")^j_i$ component is executed on the $#math.delta _j$ device (called #alert[owner]).\n\n // There may be conditions *preventing the execution* of the $#math.mono(\"C\")^j_i$ component on the owner device (e.g., _lack sensor/actuators_, _computational capabilities_, ...).\n\n Not all the components *can be executed* by the #alert[application device] (e.g., _lack sensor/actuators_, _computational capabilities_, _non-functional requirements_, ...).\n\n In such cases, the _component_ is offloaded to an *infrastructural device* (#alert[surrogate]).\n ][\n #figure(image(\"images/offloading-surrogate.svg\", height: 75%))\n ]\n\n #align(center)[\n The offloading can be *iterative* determining a #alert[forward chain] involving multiple devices.\n ]\n]\n\n#slide(title: \"Execution model: asyncronous round\")[\n - Each #underline[component] is #alert[independently executable].\n - Its behaviour is organised in #alert[rounds].\n - #underline[Outputs] of rounds at each component generate #alert[message] to be shipped.\n\n #figure(image(\"images/message-propagation.svg\", height: 52%))\n\n _Execution model_ *formalised* via #alert[operational semantics].\n // The #alert[main goals] of this execution model are (#underline[formalised in the paper]):\n // - #alert[deployment independent] macro-program specification\n // - #alert[self-stabilising] #fcite(\"DBLP:journals/tomacs/ViroliABDP18\") property is preserved w.r.t. the \"monolithic\" deployment\n\n]\n\n#slide(title: \"Deployment independence of self-stabilising computations\")[\n #only(1)[\n #theorem(number: \"1\", [Self-stabilisation #fcite(\"DBLP:journals/tomacs/ViroliABDP18\")])[\n Given a $mono(\"MP\")$ defining the components $mono(C)_1, #math.dots, mono(C)_n$ and a #underline[correct deployment], then, if:\n\n + all components implement #alert[self-stabilising] computation, and\n + sensor state is #alert[uniform] across all the #underline[forward chains]\n\n then the result behaviour observed at the #underline[global output ports] is #alert[self-stabilising], and it is independently from the #alert[deployment] (same result of the *monolithic*).\n ]\n ]\n #only(2)[\n #proof(\"(base on operational semantics)\")[\n - No forwarding $#math.arrow$ same as #underline[monolithic] $#math.arrow$ #alert[true] as per#super(\"4\")\n - If only #underline[1] component $#math.arrow$ #alert[true] by #underline[hypotesis] (self-stabilising components)\n - If #underline[multiple] components, #alert[true] as per #underline[functional composition]#fcite(\"DBLP:journals/tomacs/ViroliABDP18\") of components\n - If #underline[forward chain] > 1, and each device fairily #alert[fires], it is guaranteed that the message travels from #underline[source] to #underline[destination] and back $#math.arrow$ #alert[true] since the input messages are eventually the same\n ]\n ]\n]\n\n#slide(title: \"Rescue scenario: partitioned macro-program\")[\n #figure(image(\"images/rescue-scenario.svg\"))\n]\n\n#slide(title: \"Rescue scenario: deployment example\")[\n #figure(image(\"images/rescue-scenario-deployment.svg\"))\n]\n\n#new-section-slide(\"Evaluation\")\n\n// #slide(title: \"Evaluation goals\")[\n// The evaluation aims at:\n// 1. Validating the provided implementation toolchain and the proposed approach to test and #alert[simulate heterogeneous deployments]\n// 2. Validating the ability of the system to converge to a stable state #alert[equal] to the one obtained in a monolithic deployment\n// 3. Showcase the benefits of the proposal w.r.t. #alert[non-functional aspects] like low energy consumption\n// ]\n\n#slide(title: \"Experimental setup\")[\n We setup #underline[three] incremental complex self-organising behaviours:\n\n 1. *Gradient*: computation of the distances from a source to all the other devices // #fcite(\"DBLP:journals/computer/BealPV15\")\n 2. *SCR*: an implementation of the #alert[_self-organising coordination regions_] #fcite(\"DBLP:journals/fgcs/PianiniCVN21\") pattern for splitting the network into sub-regions for handling problems in sub-spaces\n 3. *Rescue scenario*: a city event scenario where people participate in the event and when an emergency occurs, a rescue team intervenes to help the people\n\n // ==== Objective\n\n Empirically prove #alert[functional equivalence] w.r.t. the *monolithic deployment*, and #alert[non-functional benefits] of the approach.\n]\n\n#slide(title: \"Results: gradient convergence\")[\n #figure(image(\"images/gradient_convergence.svg\", width: 80%))\n #figure(image(\"images/gradient_convergence_error.svg\", width: 80%))\n \n #align(center)[\n When $t = 900$ the network stabilises, and the output converges to #alert[the same result].\n ]\n]\n\n#slide(title: \"Results: SCR convergence\")[\n #figure(image(\"images/scr_convergence.svg\", width: 80%))\n #figure(image(\"images/scr_convergence_error.svg\", width: 80%))\n\n #align(center)[\n When $t = 900$ the network stabilises, and the output converges to #alert[the same result].\n ]\n]\n\n#slide(title: \"Results: rescue scenario\")[\n #figure(image(\"images/power_consumption.svg\"))\n\n #align(center)[\n The #alert[modularisation] of the macro-program allows to #alert[reduce] the #alert[energy consumption] of the devices, but more messages are exchanged.\n ]\n]\n\n#new-section-slide(\"Conclusions\")\n\n#slide(title: \"Conclusions and Future Work\")[\n We addressed the problem of #underline[multi-component] macro-program #alert[execution] and #alert[deployment] in the *ECC*, improving operational flexibility.\n\n We proved both #underline[formally] and #underline[empirically] that the proposed approach preserves the same #alert[functional] behaviour of the monolithic counterpart, showing #alert[non-functional] benefits.\n\n // *Future work*:\n\n #figure(image(\"images/future-works.svg\"))\n\n // - Introduce #alert[capabilities] to constrain the components' execution\n // - Support #alert[dynamic] deployments and #alert[reconfiguration] (also with *AI* techniques)\n // - Integrates the approach with tools like #alert[kubernetes] to achieve *real deployments*\n // - Exploit the *FaaS* paradigm for components offloading and execution\n]\n\n#focus-slide(\"Thank you!\")\n\n#slide[\n #bibliography(\"bibliography.bib\")\n]\n\n#slide(title: \"System model: physical system\")[\n / Physical system: network of #alert[physical devices] $#math.delta #math.in upright(bold(\"D\"))_italic(P)$, exchanging messages according to #alert[physical neighbourhood] relation $cal(N)_P$.\n\n #figure(image(\"images/physical-system.svg\", width: 73%))\n]\n\n#slide(title: \"System model: macro-program and application devices\")[\n / Application logic: it is captured by a #alert[macro-program] $mono(\"MP\")$.\n / Application devices: subset of the physical devices $upright(bold(\"D\"))$ that execute the $mono(\"MP\")$.\n\n #only(1)[#figure(image(\"images/application-devices.svg\", width: 73%))]\n #only(2)[\n #figure(image(\"images/application-devices-neighbourhood.svg\", width: 73%))\n\n #align(center)[The neighbouring relation of #alert[application devices] is a a #underline[subset] of $cal(N)_P$.]\n ]\n]\n\n#slide(title: \"System model: infrastructural devices\")[\n / Infrastructural devices: subset of the _physical devices_ $upright(bold(\"D\"))_I #math.subset.eq upright(bold(\"D\"))_P$ that #alert[can support execution] of some computation on behalf of some _application device_.\n\n #only(1)[#figure(image(\"images/infrastructural-devices.svg\", width: 73%))]\n #only(2)[\n #figure(image(\"images/infrastructural-devices-hybrid.svg\", width: 73%))\n\n #align(center)[A _physical deivce_ can be both an #alert[application device] and an #alert[infrastructural device].]\n ]\n]\n\n#slide(title: \"System model: sensors and actuators\")[\n / Sensors and actuators: a device is assumed to have #alert[sensors] and #alert[actuators] to interact with the local environment.\n\n #figure(image(\"images/sensors-actuators.svg\", width: 73%))\n]\n" }, { "repo": "https://github.com/lelimacon/typst-minimal-cv", "file": "https://raw.githubusercontent.com/lelimacon/typst-minimal-cv/main/template/main.typ", "language": "typst", "license": "MIT No Attribution", "content": "#import \"../package.typ\": *\n\n\n#let secondary-theme = (\n accent-color: red,\n body-color: red,\n)\n\n\n// To learn about theming, see https://github.com/lelimacon/typst-minimal-cv\n#show: cv.with(\n theme: (\n //font: \"Roboto\",\n //accent-color: purple,\n //main-accent-color: red,\n //main-body-color: green,\n ),\n title: \"\",\n subtitle: \"Developer, Developer, Developer\",\n aside: {\n\n section(\n theme: secondary-theme,\n \"Contact\",\n {\n entry(\n \"Home\",\n \"Hong Kong, China\",\n none,\n )\n entry(\n \"Phone\",\n link(\"https://wa.me/85212345678\", \"+852 1234 5678\"),\n none,\n )\n entry(\n \"Email\",\n link(\"mailto:\", \"\"),\n none,\n )\n entry(\n \"LinkedIn\",\n link(\"https://www.linkedin.com/in/john-doe\", \"in/john-doe\"),\n none,\n )\n },\n )\n\n section(\n \"Technology Stack\",\n {\n entry(\n \"Web\",\n \"ASP.NET + Blazor\",\n [\n #progress-bar(100%)\n ],\n )\n entry(\n none,\n \"Express + React\",\n [\n #progress-bar(50%)\n ],\n )\n entry(\n \"Desktop\",\n \"WPF\",\n [\n #progress-bar(75%)\n ],\n )\n entry(\n \"Native\",\n \"Xamarin, Flutter\",\n [\n #progress-bar(50%)\n ],\n )\n entry(\n \"DBMS\",\n \"MS SQL, PostgreSQL, MongoDB\",\n [\n #progress-bar(75%)\n ],\n )\n entry(\n \"Ops\",\n \"Scripting\",\n [PowerShell, VBS/VBA, Python],\n )\n entry(\n none,\n \"Hosting, CI/CD\",\n [Terraform, Azure, DigitalOcean,\\ GitHub Actions],\n )\n entry(\n \"Other\",\n \"Gaming\",\n [Unity, Godot],\n )\n entry(\n none,\n \"Graphics\",\n [Illustrator, Blender],\n )\n },\n )\n\n section(\n \"Languages\",\n {\n entry(\n right: [_Mother Ship_],\n \"Fluent\",\n \"\ud83c\uddfa\ud83c\uddf8 English\",\n none,\n )\n entry(\n right: [_Ich bin ein Berliner_],\n \"Proficient\",\n \"\ud83c\udde9\ud83c\uddea German\",\n none,\n )\n entry(\n right: \"\u606d\u559c\u767c\u8ca1\",\n none,\n \"\ud83c\udde8\ud83c\uddf3 Mandarin\",\n none,\n )\n entry(\n right: \"\u3044\u305f\u3060\u304d\u307e\u3059\",\n \"Basic\",\n \"\ud83c\uddef\ud83c\uddf5 Japanese\",\n none,\n )\n },\n )\n\n section(\n \"Extracurricular Activities\",\n {\n entry(\n \"Culture\",\n none,\n [Traveling, photography,\\ cinephile, theater],\n )\n entry(\n \"Sport\",\n none,\n [Hiking, bodybuilding, chess],\n )\n },\n )\n\n }\n)\n\n\n#section(\n \"Professional Experience\",\n {\n entry(\n right: [*\\@Microsoft* \u2013 Cyberport, HK \ud83c\udded\ud83c\uddf0],\n \"2020 - now\",\n \"Software Engineer\",\n [\n #par(lorem(24))\n #list(\n lorem(20),\n lorem(7),\n lorem(16),\n lorem(16),\n )\n ],\n )\n entry(\n theme: secondary-theme,\n right: [*\\@Supersoft* -- Seattle, US \ud83c\uddfa\ud83c\uddf8],\n \"2018 - now\",\n \"Co-Founder, CTO\",\n [\n #par(lorem(28))\n #par(lorem(16))\n ],\n )\n entry(\n right: [*\\@Microsoft* -- Berlin, DE \ud83c\udde9\ud83c\uddea],\n \"2016 - 2020\",\n \"Software Engineer\",\n [\n #par(lorem(12))\n #list(\n lorem(20),\n lorem(16),\n lorem(7),\n )\n ],\n )\n entry(\n right: [*\\@Microsoft* -- Redmond, US \ud83c\uddfa\ud83c\uddf8],\n \"2015 - 2016\",\n \"CS Intern\",\n [\n #par(lorem(12))\n ],\n )\n entry(\n right: [*\\@MIT* -- Cambridge, US \ud83c\uddfa\ud83c\uddf8],\n \"2013, 2 yrs\",\n \"Teaching Assistant\",\n [ #lorem(24) ],\n )\n },\n)\n\n#section(\n \"Educational Background\",\n {\n entry(\n theme: secondary-theme,\n right: [*\\@SNU \uc11c\uc6b8\ub300\ud559\uad50* -- Seoul, KR \ud83c\uddf0\ud83c\uddf7],\n \"2012, 6 mths\",\n \"Univ. Exchange\",\n [ #lorem(16) ],\n )\n entry(\n right: [*\\@MIT* -- Cambridge, US \ud83c\uddfa\ud83c\uddf8],\n \"2010 - 2015\",\n \"Master of Engineering\",\n [ #lorem(24) ],\n )\n },\n)\n" }, { "repo": "https://github.com/Coekjan/touying-buaa", "file": "https://raw.githubusercontent.com/Coekjan/touying-buaa/master/template/main.typ", "language": "typst", "license": "MIT License", "content": "#import \"@preview/touying:0.5.2\": *\n#import \"@preview/touying-buaa:0.2.0\": *\n\n// Specify `lang` and `font` for the theme if needed.\n#show: buaa-theme.with(\n // lang: \"zh\",\n // font: (\"Linux Libertine\", \"Source Han Sans SC\", \"Source Han Sans\"),\n config-info(\n title: [Touying for BUAA: Customize Your Slide Title Here],\n subtitle: [Customize Your Slide Subtitle Here],\n author: [Authors],\n date: datetime.today(),\n institution: [Beihang University],\n ),\n)\n\n#title-slide()\n\n#outline-slide()\n\n= The section I\n\n== Slide I / i\n\nSlide content.\n\n== Slide I / ii\n\nSlide content.\n\n= The section II\n\n== Slide II / i\n\nSlide content.\n\n== Slide II / ii\n\nSlide content.\n" }, { "repo": "https://github.com/luiswirth/bsc-thesis", "file": "https://raw.githubusercontent.com/luiswirth/bsc-thesis/main/src/setup.typ", "language": "typst", "license": "", "content": "#import \"@preview/cetz:0.2.1\"\n\n#import \"math.typ\": *\n#import \"layout.typ\": *\n\n#let monospaced(content) = text(font: \"Fira Code\", content)\n\n#let weblink(url, content) = monospaced(link(url, content))\n\n#let general-style(doc) = {\n show: math-template\n\n set page(paper: \"a4\")\n set text(size: 10pt)\n set text(font: \"New Computer Modern Sans\")\n\n //set page(margin: 1cm)\n //set par(justify: true)\n\n //set page(fill: black)\n //set text(white)\n set page(fill: rgb(\"444352\"))\n set text(fill: rgb(\"fdfdfd\"))\n\n \n doc\n}\n\n#let preface-style(doc) = {\n set page(numbering: \"I\")\n\n set heading(numbering: none)\n\n show heading: it => {\n if it.level == 1 {\n //pagebreak(weak: true)\n v(70pt)\n text(size: 25pt)[#it.body]\n v(40pt)\n } else {\n let size = 20pt - 4pt * (it.level - 1)\n set text(size, weight: \"bold\")\n v(size, weak: true)\n counter(heading).display()\n h(size, weak: true)\n it.body\n v(size, weak: true)\n }\n }\n\n doc\n}\n\n#let body-style(doc) = {\n set page(numbering: \"1\")\n counter(page).update(1)\n\n set heading(numbering: \"1.1.1\")\n\n show heading: it => {\n if it.level == 1 {\n pagebreak(weak: true)\n v(60pt)\n text(size: 18pt)[Chapter #counter(heading).display()]\n v(0pt)\n text(size: 25pt)[#it.body]\n v(30pt)\n } else {\n let size = 20pt - 4pt * (it.level - 1)\n set text(size, weight: \"bold\")\n v(size, weak: true)\n counter(heading).display()\n h(size, weak: true)\n it.body\n v(size, weak: true)\n }\n }\n\n doc\n}\n\n#let appendix-style(doc) = {\n set page(numbering: \"1\")\n\n set heading(numbering: \"A.1.1\")\n counter(heading).update(0)\n\n show heading: it => {\n if it.level == 1 {\n pagebreak(weak: true)\n v(60pt)\n text(size: 18pt)[Appendix #counter(heading).display()]\n v(0pt)\n text(size: 25pt)[#it.body]\n v(30pt)\n } else {\n let size = 20pt - 4pt * (it.level - 1)\n set text(size, weight: \"bold\")\n v(size, weak: true)\n counter(heading).display()\n h(size, weak: true)\n it.body\n v(size, weak: true)\n }\n }\n\n doc\n}\n\n#let postface-style(doc) = {\n set page(numbering: \"i\")\n counter(page).update(1)\n\n set heading(numbering: none)\n\n show heading: it => {\n if it.level == 1 {\n pagebreak(weak: true)\n text(size: 25pt)[#it.body]\n v(50pt, weak: true)\n } else {\n let size = 20pt - 4pt * (it.level - 1)\n set text(size, weight: \"bold\")\n v(size, weak: true)\n counter(heading).display()\n h(size, weak: true)\n it.body\n v(size, weak: true)\n }\n }\n\n doc\n}\n" }, { "repo": "https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024", "file": "https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/brainstorm-launcher.typ", "language": "typst", "license": "Creative Commons Attribution Share Alike 4.0 International", "content": "#import \"/packages.typ\": notebookinator\n#import notebookinator: *\n#import themes.radial.components: *\n\n#show: create-body-entry.with(\n title: \"Identify: Moving Triballs\",\n type: \"identify\",\n date: datetime(year: 2023, month: 9, day: 5),\n author: \"\",\n witness: \"\",\n)\n\nAfter discussing for a bit we realized that the only mechanism that would be\nable to meet our goal of being able to get the triballs across the field in\nunder 5s is some kind of shooting mechanism.\n\n= Options\n\n#grid(columns: (1fr, 1fr), gutter: 20pt, [\n == Puncher\n\n #pro-con(pros: [\n - Powerful (can reliably shoot under goal)\n - Easy to tune\n ], cons: [\n - Take up a lot of horizontal space\n ])\n\n], image(\"/assets/launchers/puncher.svg\", width: 90%), [\n\n == Catapult\n\n #pro-con(pros: [\n - We have experience building them\n - Powerful enough to shoot under goal\n - Easy to tune\n ], cons: [\n - Takes up a lot of space\n ])\n], image(\"/assets/launchers/catapult.svg\", width: 90%), [\n\n == Flywheel\n\n #pro-con(pros: [\n - Very accurate speed control\n ], cons: [\n - Easily burn out if not given enough power\n - Difficult to correctly tune\n ])\n], image(\"/assets/launchers/flywheel.svg\", width: 90%))\n" }, { "repo": "https://github.com/johannesbrandenburger/typst-build-server", "file": "https://raw.githubusercontent.com/johannesbrandenburger/typst-build-server/main/README.md", "language": "markdown", "license": "", "content": "# Typst Build Server\n\nThis project is a server that compiles a Typst project into a PDF. It accepts a ZIP file containing the Typst source files, extracts and compiles the project, and returns the compiled PDF.\n\n## Features\n\n- Accepts ZIP files with Typst projects.\n- Compiles the specified Typst file into a PDF.\n- Allows configuration of entry files, output names, and project root directories.\n- Secures the build process with an API key.\n\n## Endpoint: **POST /build**\n\nThis endpoint accepts a ZIP file containing the Typst project, extracts it, compiles the project, and returns the compiled PDF. The request must include an API key and specify the entry and output file names.\n\n#### Request Parameters (URL or Form Data):\n\n- `key` (required): A query parameter that must match the secret key (`TYPST_SECRET`) stored in environment variables. This is used for authentication.\n- `entryfile` (optional): The name of the entry Typst file within the ZIP. Defaults to `main.typ`. Must end with `.typ`.\n- `outputfile` (optional): The name of the compiled PDF file. Defaults to `main.pdf`. Must end with `.pdf`.\n- `root` (optional): Gets passed to Typst as the root directory for the project `typst compile ... --root `.\n\n#### Request Body:\n\n- The request body must contain the ZIP file under the `upload` field.\n- The ZIP file must be a valid Typst project archive with the correct entry file specified.\n\n#### Responses:\n\n- **200 OK**: Returns the compiled PDF as a response with `application/pdf` content type.\n- **400 Bad Request**: Returned if the request contains invalid parameters (e.g., wrong file type or filename).\n- **401 Unauthorized**: Returned if the `key` parameter does not match the secret.\n\n---\n\n## Demo Request\n\nHere is an example of how to make a request to the `/build` endpoint using `curl`:\n\n```bash\n# ZIP your Typst project\nzip -r example-project.zip example-project\n\n# Request to compile a Typst project\ncurl -X POST http://localhost:3000/build \\\n -H \"Content-Type: multipart/form-data\" \\\n -F \"upload=@example-project.zip\" \\\n -F \"entryfile=main.typ\" \\\n -F \"outputfile=compiled.pdf\" \\\n -F \"key=your_secret_key\" \\\n --output compiled.pdf\n```\n\nIn this example:\n\n- `example-project.zip` is the ZIP file containing your Typst project.\n- `main.typ` is the entry file for the project.\n- `compiled.pdf` is the name of the generated PDF.\n- `your_secret_key` is the secret key for authentication.\n\n## Environment Variables\n\n- `TYPST_SECRET`: The secret key used to authenticate requests to the server.\n\n---\n\n## Requirements (see below for Docker setup)\n\n- **Typst**: Ensure that Typst is installed on the system, as it's required for compiling the projects.\n- **Bun**: The project uses Bun.js for file handling and running shell commands.\n\n---\n\n## Setup\n\n1. Clone the repository.\n2. Install the dependencies using Bun:\n ```bash\n bun install\n ```\n3. Set up the environment variable `TYPST_SECRET` for authentication.\n4. Start the server:\n ```bash\n bun run dev\n # or\n bun run start\n ```\n5. The server will be accessible at `http://localhost:3000`.\n\n\n---\n\n## Docker\n\nYou can also run the server using Docker. Here's how to build and run the Docker image:\n\n1. Build the Docker image:\n ```bash\n docker build -t typst-build-server .\n ```\n2. Run the Docker container:\n ```bash\n docker run -p 3000:3000 -e TYPST_SECRET=your_secret_key typst-build-server\n ```\n3. The server will be accessible at `http://localhost:3000`.\n" }, { "repo": "https://github.com/MyPedagogicalRessources/BUT1-R1-01-Initiation-developpement", "file": "https://raw.githubusercontent.com/MyPedagogicalRessources/BUT1-R1-01-Initiation-developpement/main/TD/TD2-Trace-dessins.typ", "language": "typst", "license": "", "content": "#let td2(isCorrection: true) = [\n\n#import \"@preview/lovelace:0.3.0\": *\n#import \"../TD_TP_Commons.typ\": *\n\n\n= R101- TD2 - Trac\u00e9 de dessins\n\n== Objectifs\n\n- Travailler l\u2019\u00e9criture d\u2019algorithmes par la m\u00e9thode d\u2019affinages successifs.\n- Travailler les structures de contr\u00f4le.\n\n== Sp\u00e9cifications du traceur\n\nSoit un traceur d\u00e9fini par :\n- une surface de travail,\n- cinq compteurs not\u00e9s c1, c2, c3, c4 et c5,\n- un stylet,\n- une position centrale not\u00e9e o (ou origine),\n- une orientation (ou points cardinaux),\n- et une unit\u00e9 de longueur (u).\n\nLes 6 actions \u00e9l\u00e9mentaires du traceur afin de manipuler le stylet sont :\n\n#table(\n columns: (auto, auto),\n inset: 10pt,\n align: horizon,\n table.header(\n [*Nom de l'action*], [*Description*],\n ),\n [_leverStylet_], [Cette action rompt le contact entre le stylet et la surface de travail ; si le stylet est d\u00e9j\u00e0 lev\u00e9, l'op\u00e9ration est sans effet sur le dessin.],\n [_baisserStylet_], [Cette action \u00e9tablit le contact entre le stylet et la surface de travail ; si le stylet est d\u00e9j\u00e0 baiss\u00e9, l'op\u00e9ration est sans effet sur le dessin.],\n [_centrerStylet_], [Cette action d\u00e9place le stylet \u00e0 la position centrale, sans modification de sa hauteur ; si le stylet est d\u00e9j\u00e0 au centre, l'op\u00e9ration est sans effet sur le dessin.],\n [_deplacerStylet_], [Cette action permet de d\u00e9placer le stylet d'une unit\u00e9 dans la direction cardinale courante sans modification de sa hauteur.],\n [_pivoterDroite_], [Cette action modifie la direction cardinale courante de 90\u00b0 dans le sens des aiguilles d'une montre.],\n [_pivoterGauche_], [Cette action modifie la direction cardinale courante de 90\u00b0 dans le sens inverse des aiguilles d'une montre.],\n [_orienterNord_], [Cette action modifie la direction cardinale courante pour la faire pointer vers le nord.],\n)\n\nConcernant la manipulation d\u2019un compteur nomm\u00e9 X, le traceur est capable de :\n\n#table(\n columns: (auto, auto),\n inset: 10pt,\n align: horizon,\n table.header(\n [*Nom de l'action*], [*Description*],\n ),\n [_initialiser$C_x$_], [Cette action initialise le compteur $C_x$ \u00e0 0.],\n [_ajouterUn$C_x$_], [Cette action incr\u00e9mente le compteur $C_x$ de 1 ($C_x$ devient \u00e9gal \u00e0 $C_x + 1$.)],\n [_comparerValeurs$C_x$Et$V$_], [Cette action compare la valeur du compteur $C_x$ \u00e0 une valeur $V$ donn\u00e9e.],\n)\n\nVoici quelques exemples pour manipuler les compteurs :\n\n\n- _initialiser$C_1$_ \u2192 Le compteur C1 est initialis\u00e9 vec la valeur 0 ;\n- _comparerValeurs$C_1$Et$4$_ \u2192 La valeur du compteur $C_1$ st compar\u00e9e avec 4. Le r\u00e9sultat peut \u00eatre vrai ou faux.\n- _comparerValeurs$C_1$Et$C_2$_ \u2192 La valeur du compteur $C_1$ st compar\u00e9e avec la valeur du compteur $C_2$. Le r\u00e9sultat peut \u00eatre vrai ou faux.\n\n== Exercice 1\n\nNous proposons maintenant d\u2019utiliser le traceur afin de tracer une croix centr\u00e9e \u00e0 l'origine de la surface de travail. Chaque branche de cette croix aura une longueur de 30 unit\u00e9s.\n\n#figure(\n image(\"figures/TD2/TD3_Fig1.png\", width: 35mm)\n)\n\n+ Ecrire un algorithme en langage naturel permettant de tracer une telle croix en tenant compte des \u00e9tats initial et final suivants :\n\n - *Etat initial (pr\u00e9-condition):*\n\n On admettra que la direction initiale de trac\u00e9 est inconnue.\n\n - *Etat final (post-condition):*\n\n Le stylet devra \u00eatre situ\u00e9 \u00e0 l\u2019origine, en position lev\u00e9e\n\n#correction(displayCorrection: isCorrection)[\n\nM\u00eame si l'\u00e9criture directe du programme est triviale, il est pr\u00e9f\u00e9rable d'\u00e9crire au pr\u00e9alable un algorithme. On peut imaginer pour le 1er niveau d'affinage :\n\n#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 1 : Trac\u00e9 croix v1])[\n+ orienter le stylet vers le Nord ;\n+ aller au centre, stylet lev\u00e9 ;\n+ tracer la branche Nord ;\n+ revenir au centre, stylet lev\u00e9 ;\n+ tracer la branche Est ;\n+ revenir au centre, stylet lev\u00e9 ;\n+ tracer la branche Sud ;\n+ revenir au centre, stylet lev\u00e9 ;\n+ tracer la branche Ouest ;\n+ revenir au centre, stylet lev\u00e9 ;\n]\n\nCet algorithme met en \u00e9vidence quatre fois la s\u00e9quence des deux actions :\n- tracer une branche (alternativement Nord, Est, Sud et Ouest),\n- revenir au centre, stylet lev\u00e9.\nOn peut donc \u00e9crire une r\u00e9p\u00e9tition et remplacer les actions de trac\u00e9 des 4\nbranches par une seule action g\u00e9n\u00e9rique tracer une branche. Il vient alors :\n\n#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 2 : Trac\u00e9 croix v2])[\n+ orienter le stylet vers le Nord ;\n+ aller au centre, stylet lev\u00e9 ;\n+ *tant que* il reste une branche \u00e0 tracer *faire*\n + tracer une branche de la croix;\n + passer \u00e0 la branche suivante ;\n+ fin *tant que* ;\n]\n\nAu 2\u00e8me niveau d'affinage, l'action complexe tracer une branche s'exprime aussi par une r\u00e9p\u00e9tition :\n\n#pseudocode-list(booktabs:true)[\n+ #comment[tracer une branche de la croix]\n+ baisser le stylet ;\n+ *tant que* il reste une unit\u00e9 \u00e0 tracer *faire*\n + tracer une unit\u00e9 ;\n+ fin *tant que* ;\n+ lever le stylet ;\n]\n\n\nOn affine l\u2019action complexe passer \u00e0 la branche suivante par l\u2019\u00e9criture :\n\n#pseudocode-list(booktabs:true)[\n+ #comment[passer \u00e0 la branche suivante]\n+ revenir au centre, stylet lev\u00e9 ;\n+ pivoter \u00e0 droite ;\n]\n\nOn en d\u00e9duit l'algorithme d\u00e9taill\u00e9 de trac\u00e9 de la croix :\n\n#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 3 : Trac\u00e9 croix v3])[\n+ orienter le stylet vers le Nord ;\n+ aller au centre, stylet lev\u00e9 ;\n+ *tant que* il reste une branche \u00e0 tracer *faire*\n + #comment[tracer une branche de la croix]\n + baisser le stylet ;\n + *tant que* il reste une unit\u00e9 \u00e0 tracer *faire*\n + deplacer le stylet ;\n + fin *tant que* ;\n + lever le stylet ;\n + #comment[passer \u00e0 la branche suivante]\n + revenir au centre, stylet lev\u00e9 ;\n + pivoter \u00e0 droite ;\n+ fin *tant que* ;\n]\n]\n\n2. Traduire cet algorithme avec les actions \u00e9l\u00e9mentaires du traceur.\n\n#correction(displayCorrection: isCorrection)[\n\n#pseudocode-list(booktabs:true, title: smallcaps[Programme de trac\u00e9 de la croix])[\n+ orienterNord;\n+ centrerStylet;\n+ initialiserC1 ;\n+ *tant que not* ComparerValeursC1Et4 *faire*\n + #comment[tracer une branche de la croix]\n + baisserStylet;\n + initialiserC2 ;\n + *tant que not* ComparerValeursC2Et30 *faire*\n + deplacerStylet;\n + ajouterUnC2 ;\n + fin *tant que* ;\n +leverStylet;\n + #comment[passer \u00e0 la branche suivante]\n + centrerStylet;\n + pivoterDroite;\n + ajouterUnC1 ;\n+ fin *tant que* ;\n]\n\n]\n\n]" }, { "repo": "https://github.com/MobtgZhang/sues-thesis-typst", "file": "https://raw.githubusercontent.com/MobtgZhang/sues-thesis-typst/main/paper/chapters/abstract-cn.typ", "language": "typst", "license": "MIT License", "content": "#let \u4e2d\u6587\u5173\u952e\u8bcd = (\"\u8bba\u6587\", \"typst\", \"\u6a21\u677f\")\n\n\u672c\u6a21\u677f\u662f\u4e3a\u4e0a\u6d77\u5de5\u7a0b\u6280\u672f\u5927\u5b66\u7855\u58eb\u7814\u7a76\u751f\u548c\u5b66\u58eb\u672c\u79d1\u751f\u6bd5\u4e1a\u6d89\u53ca\u8bba\u6587\u7f16\u5199\u7684Typst\u6a21\u677f\uff0c\u65e8\u5728\u4f7f\u7528\u6700\u65b0\u7684\u9ad8\u7ea7Typst\u6392\u7248\u5de5\u5177\u7f16\u5199\u6587\u6863\uff0c\u4e13\u6ce8\u4e8e\u8bba\u6587\u5185\u5bb9\u7684\u5199\u4f5c\uff0c\u800c\u4e0d\u662f\u82b1\u8d39\u8fc7\u591a\u65f6\u95f4\u548c\u7cbe\u529b\u5728\u683c\u5f0f\u7684\u5b9a\u5236\u548c\u8c03\u6574\u4e0a\u9762\u3002\n\u672c\u624b\u518c\u662f\u5bf9\u5e94\u6a21\u677f\u7684\u53c2\u8003\u6587\u6863\uff0c\u5176\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e9b\u73af\u5883\u548c\u547d\u4ee4\u53ef\u4ee5\u8ba9\u6a21\u677f\u7684\u4f7f\u7528\u66f4\u52a0\u65b9\u4fbf\uff0c\u540c\u65f6\u9700\u8981\u6ce8\u610f\uff0c\u4f7f\u7528\u8005\u9700\u8981\u6709\u4e00\u5b9a\u7684Typst\u7f16\u7a0b\u57fa\u7840\u548c\u4f7f\u7528\u7ecf\u9a8c\uff0c\u81f3\u5c11\u5b66\u4f1a\u4f7f\u7528Typst\u5e38\u89c1\u5305\u7684\u4e00\u4e9b\u529f\u80fd\uff0c\u4f8b\u5982\u8c03\u8282\u5b57\u4f53\u95f4\u8ddd\u6216\u8005\u4fee\u6539\u5b57\u4f53\u5927\u5c0f\u7b49\u7b49\u3002\n\n\u4e0a\u6d77\u5de5\u7a0b\u6280\u672f\u5927\u5b66\u7855\u58eb/\u5b66\u58eb\u6bd5\u4e1a\u8bba\u6587LaTeX\u6a21\u677f\u66f4\u65b0\u5730\u5740\u53c2\u89c1#link(\"https://github.com/mobtgzhang/sues-thesis-typst\",\"Github\")\u3002\n" }, { "repo": "https://github.com/sitandr/typst-examples-book", "file": "https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/basics/index.md", "language": "markdown", "license": "MIT License", "content": "# Typst Basics\nThis is a chapter that consistently introduces you to the most things you need to know when writing with Typst.\n\nIt show much more things than official tutorial, so maybe it will be interesting to read for some of the experienced users too.\n\nSome examples are taken from [Official Tutorial](https://typst.app/docs/tutorial/) and [Official Reference](https://typst.app/docs/reference/).\nMost are created and edited specially for this book.\n\n> _Important:_ in most cases there will be used \"clipped\" examples of your rendered documents (no margins, smaller width and so on). \n>\n> To set up the spacing as you want, see [Official Page Setup Guide](https://typst.app/docs/guides/page-setup-guide/).\n\n" }, { "repo": "https://github.com/frectonz/the-pg-book", "file": "https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/125.%20top.html.typ", "language": "typst", "license": "", "content": "top.html\nThe Top Idea in Your Mind \n\n\n\nWant to start a startup? Get funded by\nY Combinator.\n\n\n\n\nJuly 2010I realized recently that what one thinks about in the shower in the\nmorning is more important than I'd thought. I knew it was a good\ntime to have ideas. Now I'd go further: now I'd say it's hard to\ndo a really good job on anything you don't think about in the shower.Everyone who's worked on difficult problems is probably familiar\nwith the phenomenon of working hard to figure something out, failing,\nand then suddenly seeing the answer a bit later while doing something\nelse. There's a kind of thinking you do without trying to. I'm\nincreasingly convinced this type of thinking is not merely helpful\nin solving hard problems, but necessary. The tricky part is, you\ncan only control it indirectly.\n[1]I think most people have one top idea in their mind at any given\ntime. That's the idea their thoughts will drift toward when they're\nallowed to drift freely. And this idea will thus tend to get all\nthe benefit of that type of thinking, while others are starved of\nit. Which means it's a disaster to let the wrong idea become the\ntop one in your mind.What made this clear to me was having an idea I didn't want as the\ntop one in my mind for two long stretches.I'd noticed startups got way less done when they started raising\nmoney, but it was not till we ourselves raised money that I understood\nwhy. The problem is not the actual time it takes to meet with\ninvestors. The problem is that once you start raising money, raising\nmoney becomes the top idea in your mind. That becomes what you\nthink about when you take a shower in the morning. And that means\nother questions aren't.I'd hated raising money when I was running Viaweb, but I'd forgotten\nwhy I hated it so much. When we raised money for Y Combinator, I\nremembered. Money matters are particularly likely to become the\ntop idea in your mind. The reason is that they have to be. It's\nhard to get money. It's not the sort of thing that happens by\ndefault. It's not going to happen unless you let it become the\nthing you think about in the shower. And then you'll make little\nprogress on anything else you'd rather be working on.\n[2](I hear similar complaints from friends who are professors. Professors\nnowadays seem to have become professional fundraisers who do a\nlittle research on the side. It may be time to fix that.)The reason this struck me so forcibly is that for most of the\npreceding 10 years I'd been able to think about what I wanted. So\nthe contrast when I couldn't was sharp. But I don't think this\nproblem is unique to me, because just about every startup I've seen\ngrinds to a halt when they start raising money \ufffd or talking\nto acquirers.You can't directly control where your thoughts drift. If you're\ncontrolling them, they're not drifting. But you can control them\nindirectly, by controlling what situations you let yourself get\ninto. That has been the lesson for me: be careful what you let\nbecome critical to you. Try to get yourself into situations where\nthe most urgent problems are ones you want to think about.You don't have complete control, of course. An emergency could\npush other thoughts out of your head. But barring emergencies you\nhave a good deal of indirect control over what becomes the top idea\nin your mind.I've found there are two types of thoughts especially worth\navoiding \ufffd thoughts like the Nile Perch in the way they push\nout more interesting ideas. One I've already mentioned: thoughts\nabout money. Getting money is almost by definition an attention\nsink.\nThe other is disputes. These too are engaging in the\nwrong way: they have the same velcro-like shape as genuinely\ninteresting ideas, but without the substance. So avoid disputes\nif you want to get real work done.\n[3]Even Newton fell into this trap. After publishing his theory of\ncolors in 1672 he found himself distracted by disputes for years,\nfinally concluding that the only solution was to stop publishing:\n\n I see I have made myself a slave to Philosophy, but if I get free\n of Mr Linus's business I will resolutely bid adew to it eternally,\n excepting what I do for my privat satisfaction or leave to come\n out after me. For I see a man must either resolve to put out\n nothing new or become a slave to defend it.\n[4]\n\nLinus and his students at Liege were among the more tenacious\ncritics. Newton's biographer Westfall seems to feel he was\noverreacting:\n\n Recall that at the time he wrote, Newton's \"slavery\" consisted\n of five replies to Liege, totalling fourteen printed pages, over\n the course of a year.\n\nI'm more sympathetic to Newton. The problem was not the 14 pages,\nbut the pain of having this stupid controversy constantly reintroduced\nas the top idea in a mind that wanted so eagerly to think about\nother things.Turning the other cheek turns out to have selfish advantages.\nSomeone who does you an injury hurts you twice: first by the injury\nitself, and second by taking up your time afterward thinking about\nit. If you learn to ignore injuries you can at least avoid the\nsecond half. I've found I can to some extent avoid thinking about\nnasty things people have done to me by telling myself: this doesn't\ndeserve space in my head. I'm always delighted to find I've forgotten\nthe details of disputes, because that means I hadn't been thinking\nabout them. My wife thinks I'm more forgiving than she is, but my\nmotives are purely selfish.I suspect a lot of people aren't sure what's the top idea in their\nmind at any given time. I'm often mistaken about it. I tend to\nthink it's the idea I'd want to be the top one, rather than the one\nthat is. But it's easy to figure this out: just take a shower.\nWhat topic do your thoughts keep returning to? If it's not what\nyou want to be thinking about, you may want to change something.Notes[1]\nNo doubt there are already names for this type of thinking, but\nI call it \"ambient thought.\"[2]\nThis was made particularly clear in our case, because neither\nof the funds we raised was difficult, and yet in both cases the\nprocess dragged on for months. Moving large amounts of money around\nis never something people treat casually. The attention required\nincreases with the amount\u2014maybe not linearly, but definitely\nmonotonically.[3]\nCorollary: Avoid becoming an administrator, or your job will\nconsist of dealing with money and disputes.[4]\nLetter to Oldenburg, quoted in Westfall, Richard, Life of\nIs, p. 107.Thanks to , , ,\nand for reading drafts of this.\n" }, { "repo": "https://github.com/rzmk/various-dsat-math-notes", "file": "https://raw.githubusercontent.com/rzmk/various-dsat-math-notes/main/notes.typ", "language": "typst", "license": "", "content": "// == Preamble ==\n#import \"@preview/ctheorems:1.1.0\": *\n#show: thmrules\n#import \"@preview/gentle-clues:0.4.0\": abstract, question, info, example, error, warning, success, idea, memo, quote\n\n#set page(margin: 1in, paper: \"us-letter\")\n#set text(font: \"Open Sans\")\n#show raw: set text(font: \"New Computer Modern Mono\")\n#show heading: set block(above: 1.4em, below: 1em)\n#show link: underline\n#set page(\n header: [\n #h(1fr)\n #counter(page).display(\n \"1/1\",\n both: true,\n )\n ],\n footer: [\n #link(\"https://www.mueezkhan.com\")[] #h(0.4cm) #link(\"https://www.github.com/rzmk/various-dsat-math-notes\")[_Various Digital SAT Math Notes_] #h(0.4cm)\n #h(1fr)\n v0.1.0 Released: 2023-11-22\n ]\n)\n\n// ctheorems setup\n#let theorem = thmbox(\"theorem\", \"Theorem\", fill: rgb(\"#eeffee\"))\n#let corollary = thmplain(\n \"corollary\",\n \"Corollary\",\n base: \"theorem\",\n titlefmt: strong\n)\n#let definition = thmbox(\"definition\", \"Definition\", inset: (x: 1.2em, top: 1em))\n\n#let example = thmplain(\"example\", \"Example\").with(numbering: none)\n#let proof = thmplain(\n \"proof\",\n \"Proof\",\n base: \"theorem\",\n bodyfmt: body => [#body #h(1fr) $square$]\n).with(numbering: none)\n\n// == Document ==\n\n= Various Digital SAT Math Notes\n\nVarious notes based on various resources (refer to #link(label(\"bibliography\"))[bibliography]). Authored by #link(\"https://www.mueezkhan.com\")[].\n\n#info(title: \"What is the Digital SAT?\")[\n - An exam taken on a laptop or tablet, using #link(\"https://bluebook.app.collegeboard.org/\")[Bluebook]\n - About 2 hours long\n - Allows the use of a calculator on the entire math section\n You may learn more about the Digital SAT from College Board and Khan Academy.\n]\n\n#idea(title: \"Tip!\")[Two methods you may prep for the Digital SAT are:\n- Taking *full-length practice tests* (for example using College Board's #link(\"https://bluebook.app.collegeboard.org/\")[Bluebook app])\n- *Practicing skills* (for example by using #link(\"https://www.khanacademy.org/test-prep/v2-sat-math\")[Khan Academy] to read articles, watch videos, and do exercises)\nI also suggest watching *online videos* of instructors going through practice problems. You can pause videos and try to solve the problem yourself before continuing the video to learn the instructor's solution. This way you can get instant feedback on your work, and you'll be able to learn from the instructor's explanation.\n]\n\n#warning(title: \"Important Message!\")[\n This document is intended as a *supplemental resource* for individuals preparing for the SAT. *The notes are not intended to be a comprehensive guide to the SAT nor as a sole resource used for preparing for the SAT.*\n \n The notes are not endorsed by the College Board, Khan Academy, and any other organization mentioned in this document. Nor do I endorse any of the resources/organizations mentioned in this document.\n\n If there are any errors, please open an #link(\"https://github.com/rzmk/various-dsat-math-notes/issues\")[issue] or #link(\"https://github.com/rzmk/various-dsat-math-notes/pulls\")[pull request] on #link(\"https://github.com/rzmk/various-dsat-math-notes\")[GitHub].\n]\n\n#success(title: \"One More Thing!\")[\n Believe in yourself! \ud83d\ude4c\n]\n\n#pagebreak()\n#outline(title: \"Table of Contents\")\n\n#pagebreak()\n\n== \"Essential SAT Math Formulas\"\n\nThis section is primarily based on an SAT Math YouTube video by Scalar Learning @sl-math-full-review.\n\n#table(\n columns: (auto, auto, auto),\n inset: 10pt,\n align: horizon,\n [*Name & Description*], [*Formula*], [*Example*],\n [*Slope of a Line*: Finds the slope $m$ of a line passing through the points $(x_1, y_1)$ and $(x_2, y_2)$], [$ m = frac((y_1 - y_2), (x_1 - x_2)) $], [\n Find the slope of the line that passes through the points $(7, 2)$ and $(5, 1)$.\n\n $ m = frac((2 - 1), (7 - 5)) = frac(1, 2) $\n ],\n [*Slope-Intercept Form*: Finds the equation of a line in the form $y = m x + b$ given the slope $m$ and $y$-intercept $b$], [$ y = m x + b $], [\n Find the slope $m$ and $y$-intercept $b$ of the line $2x + 7y = 49$.\n\n $ 2x + 7y = 49 $\n\n $ 7y = -2x + 49 $\n\n $ y = -frac(2, 7) x + 7 $\n\n $ m = -frac(2, 7) $\n\n $ b = 7 $\n ],\n [*Point-Slope Form*: Finds the equation of a line in the form $y - y_1 = m (x - x_1)$ given the slope $m$ and a point $(x_1, y_1)$ on the line], [$ y - y_1 = m (x - x_1) $], [\n Find the equation of the line that passes through the point $(3, 4)$ and has a slope of $frac(1, 2)$.\n\n $ y - 4 = frac(1, 2) (x - 3) $\n\n $ y - 4 = frac(1, 2) x - frac(3, 2) $\n\n $ y = frac(1, 2) x + frac(5, 2) $\n ],\n [*Midpoint Formula*: Finds the midpoint of the line segment with endpoints $(x_1, y_1)$ and $(x_2, y_2)$], [$ ((x_1 + x_2) / 2, (y_1 + y_2) / 2) $], [\n Find the midpoint of the line segment with endpoints $(1, 2)$ and $(5, 6)$.\n\n $ ((1 + 5) / 2, (2 + 6) / 2) = (3, 4) $\n ],\n [*Distance Formula*: Finds the distance between the points $(x_1, y_1)$ and $(x_2, y_2)$], [$ sqrt((x_1 - x_2)^2 + (y_1 - y_2)^2) $], [\n Find the distance between the points $(1, 2)$ and $(5, 6)$.\n\n $ sqrt((1 - 5)^2 + (2 - 6)^2) $\n $ sqrt(16 + 16) $\n $ sqrt(32) $\n ],\n [*Length of an Arc*: Finds the length of an arc with radius $r$ and central angle $theta$], [$ frac(theta, 360) (2 pi r) $], [\n Find the length of an arc with radius $r = 5$ and central angle $theta = 60$.\n\n $ frac(60, 360) (2 pi 5) = frac(1, 6) (10 pi) = frac(5 pi, 3) $\n ],\n [*Area of a Sector*: Finds the area of a sector with radius $r$ and central angle $theta$], [$ frac(theta, 360) (pi r^2) $], [\n Find the area of a sector with radius $r = 5$ and central angle $theta = 60$.\n\n $ frac(60, 360) (pi 5^2) = frac(1, 6) (25 pi) = frac(25 pi, 6) $\n ],\n [*Quadratic Formula*: Finds the roots ($x$-intercepts) of a quadratic equation $a x^2 + b x + c = 0$], [$ x = frac(-b plus.minus sqrt(b^2 - 4a c), 2a) $], [\n Solve $x^2 + 3x - 4 = 0$.\n\n $ x = frac(-3 +- sqrt(3^2 - 4(1)(-4)), 2(1)) $\n\n $ x = frac(-3 +- sqrt(25), 2) $\n\n $ x = frac(-3 +- 5, 2) $\n\n $ x = -4, 1 $\n ],\n [*SOHCAHTOA*: Finds the sine, cosine, and tangent of an angle $theta$ in a right triangle with hypotenuse $h$, adjacent side $a$, and opposite side $o$], [$ sin(theta) = frac(o, h) $ \\ $ cos(theta) = frac(a, h) $ \\ $ tan(theta) = frac(o, a) $], [\n Find the sine, cosine, and tangent of an angle $theta$ in a right triangle with hypotenuse $h = 5$, adjacent side $a = 3$, and opposite side $o = 4$.\n\n $ sin(theta) = frac(4, 5) $\n\n $ cos(theta) = frac(3, 5) $\n\n $ tan(theta) = frac(4, 3) $\n ],\n [*Probability*: \"How likely you're gonna win\"], [$ frac(\"Number of Favorable Outcomes\", \"Total Number of Outcomes\") $], [\n Find the probability of rolling a 6 on a fair die.\n\n $ frac(1, 6) $\n ],\n [*Circle Equation*: $(h, k)$ is the center coordinate of the circle, and $r$ is the radius of the circle], [$ (x - h)^2 + (y - k)^2 = r^2 $], [\n Find the equation of a circle with center $(h, k) = (3, 4)$ and radius $r = 5$.\n\n $ (x - 3)^2 + (y - 4)^2 = 5^2 $\n\n $ (x - 3)^2 + (y - 4)^2 = 25 $\n\n \\\n\n Given the equation of a circle $x^2 + 4x + y^2 + 6y = 3$, find the center and radius.\n\n $ x^2 + 4x + y^2 + 6y = 3 $\n\n $ x^2 + 4x + 4 + y^2 + 6y + 9 \\ = 3 + 4 + 9 $\n\n $ (x + 2)^2 + (y + 3)^2 = 16 $\n\n $ (x + 2)^2 + (y + 3)^2 = 4^2 $\n\n $ (x + 2, y + 3) = (h, k) $\n\n $ (h, k) = (-2, -3) $\n\n $ r = 4 $\n ],\n [*Exponential Growth/Decay*: When you increase/decrease in value. $y$ is the final amount, $a$ is the initial amount, $r$ is the rate of growth/decay, and $t$ is the time], [$ y = a (1 + r)^t $], [\n Exponential Growth: Initial value of 200, growth rate of 13% per year, and time of 3 years.\n\n $ y = 200 (1 + 0.13)^3 $\n\n \\\n\n Exponential Decay: Initial value of 150, decay rate of 9% per year, and time of 2 years.\n\n $ y = 150 (1 - 0.09)^2 $\n ],\n [*Vertex of a Parabola*: When you have a quadratic in standard form ($y = a x^2 + b x + c$), you can get the $x$ value of the vertex. You may then plug the $x$ value back into the equation to get the $y$ value if required], [$ x = frac(-b, 2a) $], [\n Find the vertex of the parabola $y = x^2 + 4x + 3$.\n\n $ x = frac(-4, 2(1)) = -2 $\n\n $ y = (-2)^2 + 4(-2) + 3 = -1 $\n ],\n [*Vertex Form*: When you have a quadratic in vertex form ($y = a (x - h)^2 + k$), you can get the vertex $(h, k)$], [$ y = a (x - h)^2 + k $], [\n Find the vertex of the parabola $y = 2x^2 + 4x + 3$.\n\n $ y = 2(x^2 + 2x) + 3 $\n\n $ y = 2(x^2 + 2x + 1 - 1) + 3 $\n\n $ y = 2((x + 1)^2 - 1) + 3 $\n\n $ y = 2(x + 1)^2 - 2 + 3 $\n\n $ y = 2(x + 1)^2 + 1 $\n\n $ (h, k) = (-1, 1) $\n ],\n [*Pythagorean Theorem*: Finds the length of the hypotenuse $c$ of a right triangle with sides $a$ and $b$], [$ c^2 = a^2 + b^2 $], [\n Find the length of the hypotenuse $c$ of a right triangle with sides $a = 3$ and $b = 4$.\n\n $ c^2 = 3^2 + 4^2 $\n\n $ c^2 = 9 + 16 $\n\n $ c^2 = 25 $\n\n $ c = 5 $\n ],\n [*Distance = Rate $times$ Time*: Finds the distance $d$ traveled given the rate $r$ and time $t$], [$ d = r t $], [\n Find the distance $d$ traveled given the rate $r = 5$ and time $t = 3$.\n\n $ d = 5 * 3 = 15 $\n\n \\\n\n If we're going 50 miles per hour and we've traveled 250 miles, how long have we been traveling?\n\n $ d = r t $\n\n $ 250 = 50 t $\n\n $ t = frac(250, 50) = 5 $\n\n We've been traveling for 5 hours.\n ],\n [*Sine and Cosine*], [$ sin(x) = cos(90 - x) $], [\n Find $sin(30)$.\n\n $ sin(30) = cos(90 - 30) $\n\n $ sin(30) = cos(60) $\n ],\n [*Sum of Solutions of a Quadratic*: When you have a quadratic in standard form, you can get the sum of the solutions $x_1$ and $x_2$], [$ x_1 + x_2 = frac(-b, a) $], [\n Find the sum of the solutions $x_1$ and $x_2$ of the quadratic $x^2 + 4x + 3 = 0$.\n\n $ x_1 + x_2 = frac(-4, 1) = -4 $\n ],\n [*The Discriminant of a Quadratic*: The number of real solutions _for a quadratic_ ($0 = a x^2 + b x + c$) \\\n \n - If $b^2 - 4a c > 0$, there are 2 real solutions\n - If $b^2 - 4a c = 0$, there is 1 real solution\n - If $b^2 - 4a c < 0$, there are 0 real solutions\n\n ], [$ b^2 - 4a c $], [\n Find the number of real solutions for the quadratic $x^2 + 4x + 3 = 0$.\n\n $ b^2 - 4a c $\n $ = 4^2 - 4(1)(3) $\n $ 16 - 12 = 4 > 0 $\n\n There are 2 real solutions.\n ],\n [*Area of an Equilateral Triangle*: Finds the area of an equilateral triangle with side length $s$. You may also draw an altitude to form a 30-60-90 right triangle and use the Pythagorean Theorem to find the height $h$], [$ frac(s^2 sqrt(3), 4) $], [\n Find the area of an equilateral triangle with side length $s = 5$.\n\n $ frac(5^2 sqrt(3), 4) = frac(25 sqrt(3), 4) $\n ],\n [*30-60-90 Triangle*: When you have a 30-60-90 triangle with hypotenuse $h$, small leg length $a$, and the height $o$, you can find the side lengths using the following formulas], [\n $ h = 2a $\n $ a = a $\n $ o = a sqrt(3) $\n ], [\n Find the side lengths of a 30-60-90 triangle with hypotenuse $h = 10$.\n\n $ a = frac(10, 2) = 5 $\n\n $ o = 5 sqrt(3) $\n ],\n [*Common Pythagorean Triples*], [\n $ 3, 4, 5 $\n $ 5, 12, 13 $\n $ 7, 24, 25 $\n $ 8, 15, 17 $\n ], [],\n [*Perpendicular Slope*: the negative reciprocal of a slope $m = frac(a, b)$], [$ m = -frac(b, a) $], [\n Find the perpendicular slope of $m = frac(3, 4)$.\n\n $ m = -frac(4, 3) $\n ],\n [*Parallel Slope*: the same slope as $m = frac(a, b)$ \\ \\ Also if two lines are parallel with a different $y$-intercept, then they have no solution. Otherwise if they're the same equation then they have infinitely many solutions.], [$ m = frac(a, b) $], [\n Find the parallel slope of $m = frac(3, 4)$.\n\n $ m = frac(3, 4) $\n ],\n [*Sum of Angles (of any Polygon)*: Finds the sum of the interior angles of a polygon with $n$ sides], [$ \"Sum\" = (n - 2) 180 $], [\n Find the sum of the interior angles of a pentagon.\n\n $ (5 - 2) 180 = 3 * 180 = 540 $\n ]\n)\n\n#pagebreak()\n\n#bibliography(\"bibliography.yml\") #label(\"bibliography\")\n" }, { "repo": "https://github.com/0xPARC/0xparc-intro-book", "file": "https://raw.githubusercontent.com/0xPARC/0xparc-intro-book/main/src/ipa.typ", "language": "typst", "license": "", "content": "#import \"preamble.typ\":*\n\n= The inner product argument (IPA) \n\nIPA is actually a lot more general than polynomial commitment.\nSo the roadmap is as follows:\n\n- In @ipa-pitch, describe the API of the inner product argument.\n- In @ipa-induct and @ipa-base, describe the protocol.\n- In @ipa-app, show two other applications of IPA, as a side demo.\n- In @ipa-poly, show how IPA can be used as a polynomial commitment scheme.\n\nThroughout this section, $E$ is defined as in @notation,\nand there are fixed globally known generators\n$g_1, ..., g_n, h_1, ..., h_n, u in E$ which are a computational basis (@comp_basis).\n\n== Pitch: IPA allows verifying $c = sum a_i b_i$ without revealing $a_i$, $b_i$, $c$ \n\nConsider Pedersen commitments of the form\n$ a_1 g_1 + ... + a_n g_n + b_1 h_1 + ... + b_n h_n + c u in E $\nwhere $a_1, ..., a_n, b_1, ..., b_n, c in FF_p$.\n\n#definition[\n Let's say that an element\n $ v = a_1 g_1 + ... + a_n g_n + b_1 h_1 + ... + b_n h_n + c u in E $\n is *good*\n (with respect to the basis $angle.l g_1, ..., g_n, h_1, ..., h_n, u angle.r$)\n if $sum_1^n a_i b_i = c$.\n]\n\nThe Inner Product Argument (IPA) is a protocol that kind of\nresembles the older Sum-Check (described in @sumcheck) in spirit:\nPeggy and Victor will do a series of interactions\nwhich allow Peggy to prove to Victor that $v$ is good.\nAnd Peggy will be able to do this without\nhaving to reveal all of the $a_i$'s, $b_i$'s, and $c$.\n\n(I think we missed a chance to call this \"Inner Product Interactive Proof\nInductive Protocol\" or something cute like this,\nbut I'm late to the party.)\n\n== The interactive induction of IPA \n\nThe way IPA is done is by induction:\none reduces verifying a vector for $n$ is good (hence $2n+1$ length)\nby verifying a vector for $n/2$ is good (of length $n+1$).\n\nTo see how you might think of the idea on your own,\ncheck out this\n#link(\"https://notes.0xparc.org/notes/pedersen-ipa\", \"0xPARC blog post\").\n\nTo illustrate the induction, we'll first show how to get from $n=2$ to $n=1$.\nSo the given input to the protocol is\n$ v = a_1 g_1 + a_2 g_2 + b_1 h_1 + b_2 h_2 + c u $\nwhich has the basis $angle.l g_1, g_2, h_1, h_2, u angle.r$.\nThe idea is that we want to construct a new (good) vector $w$ whose basis is\n$ angle.l (g_1 + lambda^(-1) g_2), (h_1 + lambda h_2), u angle.r $\nfor a randomly chosen challenge $lambda in FF_p$.\n\nThe construction is the following vector:\n$ w(lambda) &:= (a_1 + lambda a_2) dot underbrace((g_1 + lambda^(-1) g_2), \"basis elm\")\n + (b_1 + lambda^(-1) b_2) dot underbrace((h_1 + lambda h_2), \"basis elm\")\n + (a_1 + lambda a_2)(b_1 + lambda^(-1) b_2) underbrace(u, \"basis elm\"). $\nExpanding and isolating the parts with $lambda$ and $lambda^(-1)$ gives\n$ w(lambda)\n &= (a_1 g_1 + a_2 g_2 + b_1 h_1 + b_2 h_2 + c u) \\\n &#h(1em) + lambda dot underbrace((a_2 g_1 + b_1 h_2 + a_2 b_1 u), =: w_L)\n + lambda^(-1) dot underbrace((a_1 g_2 + b_2 h_1 + a_1 b_2 u), =: w_R) \\\n &= v + lambda dot w_L + lambda^(-1) dot w_R.\n $\nNote that, importantly, $w_L$ and $w_R$ don't depend on $lambda$.\nSo this gives a way to provide a construction of a good vector $w$\nof half the length (in the new basis) given a good vector $v$.\n\nThis suggests the following protocol:\n#algorithm[Reducing IPA for $n=2$ to $n=1$][\n 1. Peggy, who knows the $a_i$'s, computes\n $ w_L := a_2 g_1 + b_1 h_2 + a_2 b_1 u in E\n #h(1em) \"and\" #h(1em)\n w_R := a_1 g_2 + b_2 h_1 + a_1 b_2 u in E, $\n and sends those values to Victor.\n (Note there is no dependence on $lambda$.)\n 2. Victor picks a random challenge $lambda in FF_q$ and sends it.\n 3. Both Peggy and Victor calculate the point\n $ w(lambda) = v + lambda dot w_L + lambda^(-1) dot w_R in E. $\n 4. Peggy and Victor run the $n=1$ case of IPA to verify whether\n $w(lambda)$ is good with respect the smaller $3$-element basis\n $ angle.l (g_1 + lambda^(-1) g_2), (h_1 + lambda h_2), u angle.r . $\n Victor accepts if and only if this IPA is accepted.\n]\nAssuming Peggy was truthful and $v$ was indeed good with respect\nto the original 5-element basis for $n=2$,\nthe resulting $w(lambda)$ is good with respect to the new basis.\nSo the interesting part is soundness:\n\n#claim[\n Suppose $v = a_1 g_1 + a_2 g_2 + b_1 h_1 + b_2 h_2 + c u$ is given.\n Assume further that Peggy can provide some $w_L, w_R in E$ such that\n $ w(lambda) := v + lambda dot w_L + lambda^(-1) dot w_R $\n lies in the span of the shorter basis,\n and is good for at least four values of $lambda$.\n\n Then all of the following statements must be true:\n - $w_L = a_2 g_1 + b_1 h_2 + a_2 b_1 u$,\n - $w_R = a_1 g_2 + b_2 h_1 + a_1 b_2 u$,\n - $c = a_1 b_1 + a_2 b_2$, i.e., $v$ is good.\n]\n\n#proof[\n At first, it might seem like a cheating prover has too many parameters\n they could play with to satisfy too few conditions.\n The trick is that $lambda$ is really like a formal variable,\n and even the requirement that $w(lambda)$ lies in the span of\n $ angle.l (g_1 + lambda^(-1) g_2), (h_1 + lambda h_2), u angle.r $\n is going to determine almost all the coefficients of $w_L$ and $w_R$.\n\n To be explicit, suppose a cheating prover tried to provide\n $ w_L &= ell_1 g_1 + ell_2 g_2 + ell_3 h_1 + ell_4 h_2 + ell_5 \\\n w_R &= r_1 g_1 + r_2 g_2 + r_3 h_1 + r_4 h_2 + r_5. $\n Then we can compute\n $ w(lambda) &= v + lambda dot w_L + lambda^(-1) dot w_R \\\n &= (a_1 + lambda ell_1 + lambda^(-1) r_1)g_1 + (a_2 + lambda ell_2 + lambda^(-1) r_2)g_2 \\\n &+ (b_1 + lambda ell_3 + lambda^(-1) r_3)h_1 + (b_2 + lambda ell_4 + lambda^(-1) r_4)h_1 \\\n &+ (c + lambda ell_5 + lambda^(-1) r_5)u. $\n In order to lie in the span we described, one needs the coefficient of $g_1$\n to be $lambda$ times the coefficient of $g_2$, that is\n $ lambda^(-1) r_1 + a_1 + lambda ell_1 = r_2 + lambda a_2 + lambda^2 ell_2. $\n Since this holds for more than three values of $lambda$,\n the two sides must actually be equal coefficient by coefficient.\n This means that $ell_1 = a_2$, $r_2 = a_1$, and $r_1 = ell_2 = 0$.\n In the same way, we get $ell_4 = b_1$, $r_3 = b_2$, and $ell_3 = r_4 = 0$.\n\n So just to lie inside the span,\n the cheating prover's hand is already forced for all the coefficients\n other than the $ell_5$ and $r_5$ in front of $u$.\n Then indeed the condition that $w(lambda)$ is good is that\n $ (a_1 + lambda a_2) (b_1 + lambda^(-1) b_2) = c + lambda ell_5 + lambda^(-1) r_5. $\n Comparing the constant coefficients we see that $c = a_1 b_1 + a_2 b_2$ as desired.\n (One also can recover $ell_5 = a_2 b_1$ and $r_5 = a_1 b_2$,\n but we never actually use this.)\n]\n\nSo we've shown completeness and soundness for our protocol reducing $n=2$ to $n=1$.\nThe general situation is basically the same with more notation.\nTo prevent drowning in notation, we write this out for $n=6$,\nwith the general case of even $n$ being analogous.\nSo suppose Peggy wishes to prove\n$v = a_1 g_1 + ... + a_6 g_6 + b_1 h_1 + ... + b_6 h_6 + c u $\nis good with respect to the length-thirteen basis\n$angle.l g_1, ..., h_6, u angle.r$.\n\n#algorithm[Reducing IPA for $n=6$ to $n=3$][\n 1. Peggy computes\n $ w_L &= (a_4 g_1 + a_5 g_2 + a_6 g_3) + (b_1 h_4 + b_2 h_5 + b_3 h_6)\n + (a_1 b_4 + a_2 b_5 + a_3 b_6) u \\\n w_R &= (a_1 g_4 + a_2 g_5 + a_3 g_6) + (b_4 h_1 + b_5 h_2 + b_6 h_3)\n + (a_4 b_1 + a_5 b_2 + a_6 b_3) u $\n and sends these to Victor.\n 2. Victor picks a random challenge $lambda in FF_q$.\n 3. Both parties compute $w(lambda) = v + lambda dot w_L + lambda^(-1) dot w_R$.\n 4. Peggy runs IPA for $n=3$ on $w(lambda)$ to convince Victor it's good\n with respect to the length-seven basis\n $ angle.l g_1 + lambda^(-1) g_4, g_2 + lambda^(-1) g_5, g_3 + lambda^(-1) g_6,\n h_1 + lambda h_4, h_2 + lambda h_5, h_3 + lambda h_6, u angle.r . $\n]\n\n== The base case \n\nIf we're in the $n = 1$ case, meaning we have a Pedersen commitment\n$ v = a g + b h + c u $\nfor $a,b,c in FF_q$, how can Peggy convince Victor that $v$ is good?\n\nWell, one easy way to do that would be to just reveal all of $a$, $b$, $c$.\nHowever, this isn't good enough in situations in which Peggy really\ncares about the zero-knowledge part.\nIs there a way to proceed without revealing anything about $a$, $b$, $c$?\n\nThe answer is yes, we just need more blinding factors.\n\n#algorithm[The $n=1$ case of IPA][\n 1. Peggy picks random blinding factors $a', b' in FF_q$.\n 2. Peggy sends the following Pedersen commitments:\n $\n w_1 &:= a' g + a' b u \\\n w_2 &:= b' h + a b ' u \\\n w_3 &:= a' b' u.\n $\n 3. Victor picks a random challenge $lambda in FF_q$.\n 4. Both parties compute\n $\n w &= v + lambda dot w_1 + lambda^(-1) dot w_2 + dot w_3 \\\n &= (a+lambda a') g + (b+lambda^(-1) b') h + (a+lambda a')(b + lambda^(-1) b') u.\n $\n 5. Victor asks Peggy to reveal all three coefficients of $w$.\n 6. Victor verifies that the third coefficient is the product of the first two.\n]\n\nThis is really the naive protocol we described except that\n$a$ and $b$ have each been offset by a blinding factors\nthat prevents Victor from learning anything about $a$ and $b$:\nhe gets $a + lambda a'$ and $b + lambda^(-1) b'$, and knows $lambda$,\nbut since $a'$ and $b'$ are randomly chosen,\nthis reveals no information about $a$ and $b$ themselves.\n\n== Two simple applications \n\nAs we mentioned before, IPA can actually do a lot more than just\npolynomial commitments.\n\n=== Application: revealing an element of a Pedersen commitment\n\nSuppose Peggy has a vector $arrow(a) = angle.l a_1, ..., a_n angle.r$\nand a Pedersen commitment $v = sum a_i g_i$ to it.\nSuppose Peggy wishes to reveal $a_1$.\nThe right way to think of this is as the dot product $arrow(a) dot arrow(b)$,\nwhere $ arrow(b) = angle.l 1, 0, ..., 0 angle.r $\nhas a $1$ in the $1$st position and $0$'s elsewhere.\nTo spell this out:\n\n#algorithm[Revealing $a_1$ in a Pedersen commitment][\n 1. Both parties compute $w = v + h_1 + a_1 u$.\n 2. Peggy runs IPA on $w$ to convince Victor that $w$ is good.\n]\n\n=== Application: showing two Pedersen commitments are to the same vector\n\nSuppose there are two Pedersen commitments\n$v = sum a_i g_i$ and $v' = sum a'_i g'_i$ in different bases;\nPeggy wants to prove that $a_i = a'_i$ for all $i$\n(i.e. the vectors $arrow(a)$ and $arrow(a')$ coincide)\nwithout revealing anything else about the two vectors.\n\nThis can also be done straightforwardly:\nshow that the dot products of $arrow(a)$ and $arrow(a)'$\nwith a random other vector $arrow(lambda)$ are equal.\n\n#algorithm[Matching Pedersen commitments][\n 1. Victor picks a random challenge vector\n $arrow(lambda) = angle.l lambda_1, ..., lambda_n angle.r in FF_q^n$.\n 2. Both parties compute its Pedersen commitment\n $w = lambda_1 h_1 + ... + lambda_n h_n$.\n 3. Peggy also privately computes the dot product\n $c := arrow(a) dot arrow(lambda) = arrow(a)' dot arrow(lambda) = a_1 lambda_1 + ... + a_n lambda_n$.\n 4. Peggy sends a Pedersen commitment $c u$ to the number $c$.\n 5. Peggy runs IPA to convince Victor both $v + w + c u$ and $v' + w + c u$ are good.\n]\n\nThis protocol provides a proof to Victor that $arrow(a)$ and $arrow(a)'$\nhave the same dot product with his random challenge vector $arrow(lambda)$,\nwithout having to actually reveal this dot product.\nSince Victor chose the random vector $arrow(lambda)$,\nthis check passes with vanishingly small probability\nof at most $1/q$ if $arrow(a) != arrow(a)'$.\n\n== Using IPA for polynomial commitments \n\nSuppose now $P(X) = sum a_i X^(i-1)$ is a given polynomial.\nThen Peggy can use IPA to commit the polynomial $P$ as follows:\n\n- Peggy publishes Pedersen commitment of the coefficients of $P$;\n that is, Peggy publishes $ g := sum a_i g_i in E. $\n- Suppose Victor wants to open the commitment at a value $z$,\n and Peggy asserts that $P(z) = y$.\n- Victor picks a random constant $lambda in FF_p$.\n- Both parties compute\n $ v := underbrace((a_1 g_1 + ... + a_n g_n), C)\n + (lambda z^0 h_1 + ... + lambda z^(n-1) h_n) + lambda y u $\n and run IPA on it.\n\n(When Peggy does a vanilla IPA protocol, she can keep all $2n+1$ coefficients secret.\nIn this context, Peggy has published the first part $g$\nand still gets to keep her coefficients $a_n$ private from Victor.\nThe other $n+1$ coefficients are globally known because\nthey're inputs to the protocol for opening the commitment at $z$.)\n\nThe introduction of the hacked constant $lambda$ might be a bit of a surprise.\nThe reason is that without it, there is an amusing loophole that Peggy can exploit.\nPeggy can pick the vector $v$, so imagine she tries to swindle Victor by reporting\n$v = a_1 g_1 + ... + a_n g_n - 10 u$ instead\nof the honest $v = a_1 g_1 + ... + a_n g_n$.\nThen, Peggy inflates all the values of $y$ she claims to Victor by $10$.\nThis would allow Peggy to cheat Victor into committing the polynomial $P$\nbut for each input $z$ giving Victor the value of $P(z) + 10$ rather than $P(z)$\n(though the cheating offset would be the same at every value she opened).\nThe offset $lambda$ prevents this attack.\n" }, { "repo": "https://github.com/wumin199/wumin199.github.io", "file": "https://raw.githubusercontent.com/wumin199/wumin199.github.io/main/source/typst/math/understand_math.typ", "language": "typst", "license": "", "content": "#set heading(numbering: \"1.\")\n\n#show link: underline\n\n#set text(\n font: \"Noto Serif CJK SC\",\n // font: \"simsun\",\n size: 12.5pt\n)\n\n#show raw.where(block: true): block.with(\n fill: luma(240),\n inset: 10pt,\n radius: 4pt,\n)\n\n#set math.equation(numbering: \"(1)\")\n\n\n= \u5e38\u89c1\u516c\u5f0f\n\n== \u4e58\u6cd5\u516c\u5f0f\n\n#figure(\n image(\"\u4e58\u6cd5\u516c\u5f0f.png\", width: 80%),\n caption: [\u4e58\u6cd5\u516c\u5f0f],\n) \n\n\n\u53c2\u8003\u8d44\u6599:\n- #link(\"https://zh.wikipedia.org/zh-tw/%E4%B9%98%E6%B3%95%E5%85%AC%E5%BC%8F\")[\n wiki: \u4e58\u6cd5\u516c\u5f0f]\n\n== \u4e09\u89d2\u51fd\u6570\n\n#figure(\n image(\"trigonometric_functions.jpg\", width: 80%),\n caption: [\u7279\u6b8a\u89d2\u4e09\u89d2\u51fd\u6570\u503c],\n) <\u7279\u6b8a\u89d2\u4e09\u89d2\u51fd\u6570\u503c>\n\n\n#figure(\n image(\"\u7279\u6b8a\u89d2\u4e09\u89d2\u51fd\u6570\u503c.png\", width: 80%),\n caption: [\u7279\u6b8a\u89d2\u4e09\u89d2\u51fd\u6570\u503c],\n) \n\n\n\n\u53c2\u8003\u8d44\u6599:\n- #link(\"https://www.geogebra.org/m/UtWkeRE5\")[GeoGebra\u7279\u6b8a\u89d2\u4e09\u89d2\u51fd\u6570\u503c]\n- #link(\"https://zh.wikipedia.org/zh-sg/%E4%B8%89%E8%A7%92%E5%87%BD%E6%95%B0\")[\n wiki: \u4e09\u89d2\u51fd\u6570]\n- #link(\"https://www.baike.com/wikiid/295765833290522275?view_id=1vh67qncay2o00\")[\u7279\u6b8a\u4e09\u89d2\u51fd\u6570\u503c]\n\n\n\n== \u6cf0\u52d2\u5c55\u5f00\n\n\n\u65e0\u7a77\u53ef\u5fae\u51fd\u6570$f(x)$\u7684\u6cf0\u52d2\u5c55\u5f00\u5f0f\u4e3a:\n\n$ \nf(x) = sum_(n=0)^oo (f^n(a)) /(n!) (x-a)^n\n$\n\n$f^(n)(a)$\u8868\u793a\u51fd\u6570$f$\u5728$a$\u5904\u7684$n$\u9636\u5bfc\u6570,\u5982\u679c$a=0$,\u4e5f\u628a\u8fd9\u4e2a\u7ea7\u6570\u53eb\u505a\u9ea6\u514b\u52b3\u6797\u7ea7\u6570.\n\n#line(length: 100%, stroke: 0.2pt )\n\n#set text(size: 14pt)\n$ \ne ^ x = sum_(n=0)^oo x ^n /(n!) \n= 1+ x + x^2/(2!) + x^3/(3!) + ... + x^n/(n!) + ... \" \"\nforall (\"\u5bf9\u6240\u6709X\u90fd\u6210\u7acb\")\n$\n\n#line(length: 100%, stroke: 0.2pt )\n\n$\nsin x = sum_(n=0)^oo (-1)^n /((2n+1)!) x^(2n+1)\n= x - x^3/(3!) + x^5/(5!) - ... \" \" forall\n$\n\n#line(length: 100%, stroke: 0.2pt )\n\n\n$\ncos x = sum_(n=0)^oo (-1)^n /((2n)!) x^(2n)\n= 1 - x^2/(2!) + x^4/(4!) - ... \" \" forall\n$\n\n#line(length: 100%, stroke: 0.2pt )\n\n\u53c2\u8003\u8d44\u6599:\n- #link(\"https://zh.wikipedia.org/zh-sg/%E6%B3%B0%E5%8B%92%E7%BA%A7%E6%95%B0\")[\n wiki: \u6cf0\u52d2\u7ea7\u6570]\n\n\n\n\n\n\n== \u5e38\u89c1\u6c42\u5bfc\u516c\u5f0f\n\n#figure(\n image(\"prime.png\", width: 80%),\n caption: [\u6c42\u5bfc\u6cd5\u5219],\n) <\u6c42\u5bfc\u6cd5\u5219>\n\n\n#line(length: 100%, stroke: 0.2pt )\n\n$ (e^x)^prime = e^x $\n\n$ (e^(f(x)))^prime = f^prime(x) e^(f(x)) $\n\n#line(length: 100%, stroke: 0.2pt )\n\n\u53c2\u8003\u8d44\u6599\uff1a\n- #link(\"https://zh.wikipedia.org/zh-sg/%E5%AF%BC%E6%95%B0%E5%88%97%E8%A1%A8\")[wiki: \u5bfc\u6570\u5217\u8868]\n\n\n\n= \u516c\u5f0f\u7406\u89e3\n\n== \u6cf0\u52d2\u5c55\u5f00\n\n=== $sin x$\n\n```py\n\n# \u9996\u5148\uff0c\u8ba1\u7b97 sin(x) \u5728 x=0 \u5904\u7684\u51fd\u6570\u503c\u548c\u5404\u9636\u5bfc\u6570\u3002\u6839\u636e\u6b63\u5f26\u51fd\u6570\u7684\u5b9a\u4e49\uff0c\u6709\uff1a\nsin(0) = 0\n\n# \u5bf9\u6b63\u5f26\u51fd\u6570\u6c42\u4e00\u9636\u5bfc\u6570\uff0c\u5f97\u5230\uff1a\n\nd/dx sin(x) = cos(x)\ncos(0) = 1\n\n# \u5bf9\u6b63\u5f26\u51fd\u6570\u6c42\u4e8c\u9636\u5bfc\u6570\uff0c\u5f97\u5230\uff1a\nd^2/dx^2 sin(x) = -sin(x)\n-sin(0) = 0\n\n# \u5bf9\u6b63\u5f26\u51fd\u6570\u6c42\u4e09\u9636\u5bfc\u6570\uff0c\u5f97\u5230\uff1a\nd^3/dx^3 sin(x) = -cos(x)\n-cos(0) = -1\n\n# \u5bf9\u6b63\u5f26\u51fd\u6570\u6c42\u56db\u9636\u5bfc\u6570\uff0c\u5f97\u5230\uff1a\nd^4/dx^4 sin(x) = sin(x)\nsin(0) = 0\n\n# \u4ee5\u6b64\u7c7b\u63a8\uff0c\u53ef\u4ee5\u5f97\u5230\uff1a\n\nd^5/dx^5 sin(x) = cos(x)\ncos(0) = 1\n\nd^6/dx^6 sin(x) = -sin(x)\n-sin(0) = 0\n\nd^7/dx^7 sin(x) = -cos(x)\n-cos(0) = -1\n\nd^8/dx^8 sin(x) = sin(x)\nsin(0) = 0\n\n# \u6839\u636e\u6cf0\u52d2\u7ea7\u6570\u5c55\u5f00\u5f0f\uff0c\u5c06\u8fd9\u4e9b\u5bfc\u6570\u5e26\u5165\u516c\u5f0f\uff1a\nsin(x) = f(0) + f'(0)x + f''(0)x^2/2! + f'''(0)x^3/3! + ...\n\n\n```\n\n=== $e^x$\n\n\n```py\ne^x\u7684\u5bfc\u6570\u8fd8\u662fe^x\ne^0 = 1\n...\n\n\u5e26\u5165\u5230\u6cf0\u52d2\u516c\u5f0f\u4e2d\u5f97\uff1a\n\ne^x = 1 + x + x^2/2! + x^3/3! + x^4/4! + x^5/5! + x^6/6! + ...\n\n```\n\n\n== \u590d\u6570\u57df\u5185\u6307\u6570\u51fd\u6570\n\n\n#set text(size: 14pt)\n\n$ z = a + i b \" \u590d\u6570\u7684\u76f4\u89d2\u5750\u6807\u8868\u793a\" $\n\n$ z = r e^(i theta) \" \u6781\u5750\u6807\u8868\u793a\" $\n\n$ r e^(i x) = r cos x + r * i *sin x $\n\n#figure(\n image(\"\u590d\u6307\u6570\u51fd\u6570.png\", width: 80%),\n caption: [\u590d\u6307\u6570\u51fd\u6570],\n) <\u590d\u6307\u6570\u51fd\u6570>\n\n\n\n\n\n\u5f53 $r=1, theta = pi$\u65f6\uff0c\u8fd9\u5c31\u662f\u6b27\u62c9\u516c\u5f0f\uff1a\n\n$ e^(i pi) + 1 =0 $\n\n\u5e38\u89c1\u7684\u503c\u5982\u4e0b\uff1a\n\n$ e^((2 i pi) /3) = cos ((2 pi )/3) + i * sin((2 pi)/3) = -1/2 + i sqrt(3) /2 $ \n\n\u5b83\u7684\u610f\u601d\u662f\u5728\u590d\u5e73\u9762\u4e0a\u4ee51\u4e3a\u8d77\u70b9\uff0c\u6cbf\u7740\u5355\u4f4d\u5706\u9006\u65f6\u9488\u65cb\u8f6c120\u5ea6\u5230\u8fbe\u7684\u70b9\u3002\n\n\n\u6839\u636e @\u590d\u6307\u6570\u51fd\u6570 \u7684\u6307\u6570\u8fd0\u7b97\u53ef\u5f97\uff1a\n\n$ (e^((2 i pi) /3))^3 = e^(2 i pi) = 1 $ <120\u590d\u6839>\n\n\u53ef\u4ee5\u7406\u89e3\u4e3a\u8d70\u4e863\u4e2a120\u00b0\n\n\u6839\u636e @\u590d\u6307\u6570\u51fd\u6570 \u7684\u6307\u6570\u8fd0\u7b97\u53ef\u5f97\uff1a\n\n$ (e^((2 i pi) /3))^2 = e^((4 i pi)/3 ) $ \n\n\u53ef\u4ee5\u7406\u89e3\u4e3a\u8d70\u4e862\u4e2a120\u00b0\n\n\n== \u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\n\n\u4e00\u5143\u4e8c\u6b21\u65b9\u7a0b\u67090,1,2\u4e2a\u5b9e\u6839\n\n\u4e00\u51433\u6b21\u65b9\u7a0b\uff0c\u6700\u591a\u67093\u4e2a\u5b9e\u6839\uff0c\u81f3\u5c11\u67091\u4e2a\u5b9e\u6839\n\n\n$\na x^3 + b x^2 + c x + d = 0, a eq.not 0 $ <\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b>\n\n\u4ee4\uff1a\n$ x = t - b/(3a) $ <\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\u6c42x>\n$ p = (3 a c - b^2)/(3a^2) $\n$ q = (2b^3 - 9 a b c + 27 a^2 d)/(27a^3) $\n\n\u53ef\u5316\u7b80\u7684 @\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b \u4e3a\uff1a\n$ t^3 + p t = q = 0 $ \n\n\n\n\u6709\u5f88\u591a\u65b9\u6cd5\u53ef\u4ee5\u6c42\u89e3 @quadratic_equation\n\n=== \u5361\u5c14\u8fbe\u8bfa(Cardano)\u516c\u5f0f\n\n\n\n$ u = root(3, (-q/2 + sqrt(q^2/4 + p^3/27))) $\n\n$ v = root(3, (-q/2 - sqrt(q^2/4 + p^3/27))) $\n\n\u7b80\u5199\u4ee5\u4e0b\uff1a\n\n$ Delta = sqrt(q^2/4 + p^3/27) $\n\n$ u = root(3, (-q/2 + sqrt(Delta))) $\n\n$ u = root(3, (-q/2 - sqrt(Delta))) $\n\n$ w = e^((2 i pi) /3) = cos ((2 pi )/3) + i * sin((2 pi)/3) = -1/2 + i sqrt(3) /2 $\n\n$ (e^((2 i pi) /3))^2 = e^((4 i pi)/3 ) = cos ((4 pi )/3) + i * sin((4 pi)/3) = -1/2 - i sqrt(3) /2 $ \n\n\u5219\uff1a\n\n$ t_1 = u + v $\n\n$ t_2 = w u + w ^2 v = -(u + v)/2 + i sqrt(3)/2 (u - v) $\n\n$ t_3 = w^2 u + w v = -(u + v)/2 - i sqrt(3)/2 (u - v) $\n\n\u5176\u4e2d\u7684 $0$, $w$, $w^2$ \u53ef\u4ee5\u6839\u636e @120\u590d\u6839\uff0c\u7406\u89e3\u4e3a\u590d\u5e73\u9762\u5185\u5706\u534a\u5f84\u4e3a1\u7684\u4e09\u4e2a\u70b9\n\n\u7136\u540e\u6839\u636e @\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\u6c42x \u53ef\u5f97 $x$\n\n=== \u5224\u522b\u5f0f(Discriminant)\n\n\n#figure(\n image(\"\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\u5224\u522b\u5f0f.png\", width: 100%),\n caption: [\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\u5224\u522b\u5f0f],\n) <\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\u5224\u522b\u5f0f>\n\n\n\u53c2\u8003\u8d44\u6599:\n- #link(\"https://zhuanlan.zhihu.com/p/137077558\")[\n \u77e5\u4e4e: \u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\u7684\u6c42\u6839\u516c\u5f0f]\n- #link(\"https://zh.wikipedia.org/zh-sg/%E4%B8%89%E6%AC%A1%E6%96%B9%E7%A8%8B#%E5%8D%A1%E5%B0%94%E8%BE%BE%E8%AF%BA%E6%B3%95\")[wiki: \u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\uff0c\u542b\u63a8\u5bfc\u548c\u4f8b\u5b50]\n- #link(\"https://zhuanlan.zhihu.com/p/413976771\")[\u4ece\u4e00\u5143\u4e8c\u6b21\u65b9\u7a0b\u5230\u7fa4\u8bba(4)\uff1a\u5361\u5c14\u8fbe\u8bfa\u516c\u5f0f]" }, { "repo": "https://github.com/storopoli/cryptography-workshop", "file": "https://raw.githubusercontent.com/storopoli/cryptography-workshop/main/slides.typ", "language": "typst", "license": "Creative Commons Zero v1.0 Universal", "content": "#import \"@preview/slydst:0.1.0\": *\n\n#show: slides.with(\n title: \"Cryptography Workshop\",\n subtitle: none,\n date: none,\n authors: (\"\", ),\n layout: \"medium\",\n ratio: 4/3,\n title-color: orange,\n)\n\n#set text(size: 16pt)\n#show link: set text(blue)\n#let p = 1279\n#let q = 71\n\n/*\nLevel-one headings corresponds to new sections.\nLevel-two headings corresponds to new slides.\nBlank space can be filled with vertical spaces like #v(1fr).\n*/\n\n== License\n\n#align(horizon + center)[#image(\"images/cc-zero.svg\", width: 80%)]\n\n== Outline\n\n#outline()\n\n= One-way Functions\n\n#align(horizon + center)[#image(\"images/omelet.jpg\", width: 50%)]\n\n== Factoring Numbers\n\n#align(horizon)[\n #text(size: 22pt)[\n Factor this number into two prime numbers:\n\n $ #{p * q } $\n ]\n]\n\n== Euclid GCD (300 BCE)\n\n#link(\"https://en.wikipedia.org/wiki/Euclidean_algorithm\")[Euclidean Algorithm]\n\n#align(horizon + center)[#image(\"images/euclid.jpg\", width: 30%)]\n\n#text(size: 12pt)[\n For 100+ digit numbers we have #link(\"https://en.wikipedia.org/wiki/General_number_field_sieve\")[General Number Field Sieve].\n]\n\n== Easy to check\n\n#align(horizon)[\n #text(size: 22pt)[\n - p: #p\n - q: #q\n\n $ p dot q = #{p * q } $\n ]\n]\n\n= Hash Functions\n\n#definition(title: \"Hash Functions\")[\n A hash function is any function that can be used to map data of arbitrary\n size to fixed-size values.\n]\n\n#definition(title: \"Cryptographic Hash Functions\")[\n A hash function that has statistical properties desirable for a\n cryptographic application:\n\n - One way function\n - Deterministic\n - Collision resistance\n]\n\n== SHA-2 and Its Functions\n\n#definition(title: \"SHA-2\")[\n SHA-2 (Secure Hash Algorithm 2) is a set of cryptographic hash functions\n designed by the United States National Security Agency (NSA) and first\n published in 2001.\n\n - `SHA-224`\n - `SHA-256`\n - `SHA-384`\n - `SHA-512`\n]\n\n== `SHA-256`\n\nOur very special one:\n\n- 64 rounds\n- `AND`\n- `XOR`\n- `OR`\n- `ROT`\n- `ADD` $mod 2^(32)$\n\nAll of these stuff is non-linear and very difficult to keep track,\ni.e. no way for you to \"autodiff\" this.\n\n= Public-key Cryptography\n\n#text(size: 14pt)[\n #definition(title: \"Public-key cryptography\")[\n Cryptography system that uses pair of keys: private and public.\n Going from private to public is a one-way function.\n ]\n\n Same idea as the prime number factoring problem:\n\n - $S_k$: random integer\n - $g$: \"generator\" number\n - $p$: big fucking prime (4096 bits)\n - $P_k$: $g^(S_k) mod p$\n - Good luck finding $S_k$ from knowing only $P_k$\n - But easy to verify that $P_k = g^(S_k) mod p$\n]\n\n= DSA\n\n#text(size: 12pt)[\n #algorithm(title: \"DSA Signing\")[\n + Choose two prime numbers $p, q$ such that $p - 1 mod q = 0$ (e.g. 1279 and 71) \n + Choose your private key $S_k$ as a random integer $\u2208 [1, q-1]$\n + Choose a generator $g$\n + Compute your public key $P_k$: $g^(S_k)$\n + Choose your nonce $k$: as a random integer $\u2208 [1, q-1]$\n + Compute your \"public nonce\" $K$: $(g^k mod p) mod q$ (also known as $r$)\n + Get your message ($m$) through a cryptopraphic hash function $H$: $H(m)$\n + Compute your signature $s$: $(k^(-1) (H(m) + S_k K)) mod q$\n + Send to your buddy $(p, q, g)$, $P_k$, and $(K, s)$\n ]\n]\n\n#text(size: 12pt)[\n #algorithm(title: \"DSA Verification\")[\n + Compute $w = s^(-1) mod q$\n + Compute $u_1 = H(m) dot w mod q$\n + Compute $u_2 = K dot w mod q$\n + Compute $K^* = (g^(u_1) P^(u_2)_k mod p) mod q$\n + Assert $K = K^*$\n ]\n]\n\n== Why this works?\n\n#align(horizon)[\n #text(size: 14pt)[\n #theorem(title: \"DSA\")[\n - $s = k^(-1) dot (H + S_k K) mod q$ #text(blue)[($mod p$ and $H(m)$ implicit)]\n - $k = s^(-1) dot (H + S_k K) mod q$ #text(blue)[(move $s$ to $k$)]\n - $k = H dot s^(-1) + S_k K dot s^(-1) mod q$ #text(blue)[(distribute $s^(-1)$)]\n - $k = H dot w + S_k K dot w mod q$ #text(blue)[($w = s^(-1)$)]\n - $g^k = g^(H dot w + S_k K dot w mod q)$ #text(blue)[(put $g$ in both sides)]\n - $g^k = g^(H dot w mod q) dot g^(S_k K dot w mod q)$ #text(blue)[(product of the exponents)]\n - $g^k = g^(H dot w mod q) dot P^(K dot w mod q)_k$ #text(blue)[($P_k = g^(S_k)$)]\n - $g^k = g^(u_1) dot P^(u_2)_k$ #text(blue)[(replace $u_1$ and $u_2$)]\n - $K = K^*$ #text(blue)[(replace $K$ and $K^*$)]\n ]\n ]\n]\n\n= Schnorr\n\n#text(size: 12pt)[\n #algorithm(title: \"Schnorr Signing\")[\n + Choose a prime number $p$\n + Choose your private key $S_k$ as a random integer $\u2208 [1, p-1]$\n + Choose a generator $g$\n + Compute your public key $P_k$: $g^(S_k)$\n + Choose your nonce $k$: as a random integer $\u2208 [1, p-1]$\n + Compute your \"public nonce\" $K$: $g^k mod p$ (also known as $r$)\n + Get your message ($m$) through a cryptographic hash function $H$ concatenating with $K$: $e = H(K || m)$\n + Compute your signature $s$: $k - S_k e$\n + Send to your buddy $(p, g)$, $P_k$, and $(K, s)$\n ]\n]\n\n#v(2em)\n\n#text(size: 12pt)[\n #algorithm(title: \"Schorr Verification\")[\n + Compute $e = H(K || m)$\n + Compute $K^* = g^s P_k^e$\n + Compute $e^* = H(K^* || m)$\n + Assert $e = e^*$\n ]\n]\n\n== Why this works?\n\n#align(horizon)[\n #theorem(title: \"Schnorr\")[\n - $K^* = g^s P_k^e$ #text(blue)[($mod p$ implicit)]\n - $K^* = g^(k - S_k e) g^(S_k e)$ #text(blue)[($s = k - S_k e$ and $P_k = g^(S_k)$)]\n - $K^* = g^k$ #text(blue)[(cancel $S_k e$ in the exponent of $g$)]\n - $K^* = K$ #text(blue)[($K = g^k$)]\n - Hence $H(K^* || m) = H(K || m)$\n ]\n]\n\n= Why we don't reuse nonces?\n\n#v(2em)\n\n#text(size: 20pt)[\n #align(horizon + center)[\n *Because we can recover $S_k$*:\n ]\n]\n\n== Recovering $S_K$ in DSA\n\n#align(horizon)[\n $ s' - s = (k'^(-1) (H(m_1) + S_k K')) - (k^(-1) (H(m_2) + S_k K)) $\n\n If $k' = k$ (nonce reuse) then you can isolate $k$:\n\n $ s' - s = k^(-1) (H(m_1) - H(m_2)) $\n\n Remember: you know $s', s, H(m_1), H(m_2), K', K$.\n\n And then derive $S_k$:\n\n $ S_k = K^(-1) (k s - H(m)) $\n]\n\n== Recovering $S_k$ in Schnorr\n\n#align(horizon)[\n $ s' - s = (k' - k) - S_k (e' - e) $\n\n If $k' = k$ (nonce reuse) then you can easily isolate $S_k$ with simple algebra.\n\n Remember: you know $s', s, e, e'$ and $k' - k = 0$.\n]\n\n= Why we can combine Schnorr $s$ and not DSA?\n\n#text(size: 10pt)[\n Revisit the signature step in each one:\n\n - DSA: $s = k^(-1) (H(m) + S_k K)$\n - Schnorr: $s = k - S_k H(K || m)$\n\n Modular addition, i.e. anything with $+, dot, -$, is linear:\n\n $ P'_k + P_k = g^(S'_k) + g^(S_k) = g^(S_k' + S_k) $\n\n and $s' + s$ in Schnorr is signed from $S_k' + S_k$ (assuming $m' = m$).\n\n Modular inverse, i.e. anything with $x^(-1)$, is _not_ linear\n and $s' + s$ in DSA is _not_ signed from $S_k' + S_k$ (assuming $m' = m$).\n That is:\n\n $ x^(-1) + y^(-1) != (x + y)^(-1) $\n]\n\n== Don't believe it?\n\n#v(2em)\n\n$ x^(-1) + y^(-1) != (x + y)^(-1) $\n\n#align(horizon)[\n ```python\n >>> p = 71; x = 13; y = 17;\n >>> pow(x, -1, p) + pow(y, -1, p) == pow(x + y, -1, p)\n False\n ```\n]\n" }, { "repo": "https://github.com/polarkac/MTG-Stories", "file": "https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/048%20-%20Dominaria%20United/005_Episode%204%3A%20A%20Brutal%20Blow.typ", "language": "typst", "license": "", "content": "#import \"@local/mtgstory:0.2.0\": conf\n#show: doc => conf(\n \"Episode 4: A Brutal Blow\",\n set_name: \"Dominaria United\",\n story_date: datetime(day: 15, month: 08, year: 2022),\n author: \"\",\n doc\n)\n\nBeing on the #emph[Weatherlight] 's deck made Karn nostalgic. Even though a different crew scrambled along its rigging, laughed as they worked on the deck, and tinkered with its shining mechanisms, the scents and sounds felt comfortably eternal. Golden light scattered among the white clouds below and glistened on the beeswaxed decks. Blue skies stretched until the horizon. The sea breeze chilled his metal body. Only hours before, the four of them\u2014Teferi, Jaya, Jodah, and \u2014had been pulled from the upper floor of Argive's watchtower one by one, dangling from a rope ladder like insects above the vast city below.\n\n\"Shanna is waiting,\" Jodah said. \"We must set the #emph[Weatherlight] 's course.\"\n\nKarn nodded, and Jaya fell into step beside them, her white hair streaming out behind her like a pennant. They entered the stateroom. Shanna stood near an oval table, her arms crossed over her burnished leather breastplate. Arvad, his already white skin sickly with his vampire's pallor, hung back in the shadows behind her. Teferi lay on a nearby cot, his eyes closed. Raff had pulled up a three-legged stool beside him. He'd splayed his hands over Teferi's gut wound and his magic's silvery sheen wafted from his palms like heat waves. Slimefoot joined them, mushroom-like pups cavorting around its base. Tiana squeezed her wings in tight to her body to fit through the door.\n\nShanna put out a fruit bowl Karn had thought to be ornamental and sat down. \"I might be the captain, Karn, but you're setting the course. Tell me where the #emph[Weatherlight] flies.\"\n\n\"We must force the Phyrexians into open warfare,\" Karn said, \"before they gain in strength and convert more populations. We will do this by baiting them with the three things the Phyrexians want more than anything else: the sylex, the Mana Rig, and~ me.\"\n\nJodah looked to Karn, worry brightening his eyes. \"It's a risky plan. Defeat would mean losing Dominaria's most precious artifacts\u2014and you, Karn. I don't like the idea of you in such danger.\"\n\n\"I like some risk,\" Jaya said. \"If we draw them out, if we win, we kill the Phyrexians at the root. They're like ivy: you have to pull it early. Once it's established, it'll spread.\"\n\n\"If the events at Argivia have taught us anything,\" Karn said, \"it is that our forces are stronger together than apart. Phyrexian tactics rely on dividing us, on the secret work the sleeper agents can perform in the shadows. If we are separate, we are vulnerable. Together, less so.\"\n\n\"Still,\" Jodah said, \"our allies are stretched across all Dominaria. With Argivia fallen, the most powerful armed force on this continent is no longer ours\u2014it is theirs. We have to recruit all the allies we can to make our stand.\"\n\n\"So we split up,\" Jaya said. \"We recruit allies and bring them to the Mana Rig.\"\n\nThe crew from the #emph[Weatherlight ] had been quiet during this discussion, but now Raff sighed. The magic faded from his fingers. He looked up at Karn. \"My sister will fight for you.\"\n\n\"I'll seek out Danitha,\" Jaya decided.\n\n\"Yavimaya's been attacked as well,\" Jodah said. \"The elves will help us. I can go to them, to recruit them to fight at our side.\"\n\n\"I will go to the Mana Rig directly,\" Karn said, \"to speak to Jhoira. I am the only one who has read and can remember the key I found to the sylex. I need to record that information for others to examine.\"\n\nTeferi roused from his stupor. \"I'll go with you, Karn. I need time to recover, and I can also recruit our Shivan allies while the Mana Rig and the sylex occupy you.\"\n\n\"You do not have good luck,\" Karn said, regarding Teferi's wounds.\n\n\"I think I have excellent luck,\" Teferi said. \"I survived, didn't I?\"\n\n\"If we split up,\" Jaya said, her hair gusting around her face, \"how will we tell if any of us have been compromised? Stenn didn't even know he was one of them.\"\n\n\"The scryer has difficulty focusing on Phyrexians,\" Karn said. \"If I cannot view you, I will assume you have been compromised.\"\n\n\"It's a good thing you don't sleep,\" Jaya said.\n\nShanna looked to her crew, who had been listening patiently. \"It's decided. Let's set sail.\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nThe Red Iron Mountains were so beautiful that planning a war here seemed irreverent. Not that Jaya was the devout type, but those harsh jagged peaks with shale cascading down the ravines, white in the light, and the alpine blooms drooping from the meadows in sprays of purple and gold, and that massive androgynous statue of some hero whose story had been lost to time~\n\nWell, maybe she was growing old, but Jaya could see herself relaxing outside a small cabin in a cedarwood tub in one of those shadowed valleys where war machines lay rotting, forgotten beneath emerald mosses and upright sword ferns, inert as boulders. Maybe with some chilled peppermint tea in hand. Now that would be a relaxing way to pass a decade or two.\n\nShe snorted at herself. #emph[Not like you're ever going to retire! ]\n\n\"Jaya!\" Ajani strode from the trees' deep shadows, his white fur glinting in the light and his cloak rippling behind him. \"Danitha told me you arrived. I have been seeking deer to feed the camp. There is good hunting here.\"\n\n#figure(image(\"005_Episode 4: A Brutal Blow/01.jpg\", width: 100%), caption: [Art by: ], supplement: none, numbering: none)\n\n\"Any luck?\" Jaya asked.\n\nAjani offered her a fierce grin that revealed his teeth. \"Always. The Llanowar millenaries remember the Phyrexian invasion well, and they've already sent scouts to join us. Some of the best archers in Dominaria.\"\n\nWhen he'd leapt after , Jaya had worried. \"It looks like you didn't recover Aron?\"\n\nAjani turned his gaze to Danitha's camp, established on the edge of a cloudy green glacier lake. Her Benalish knights had set up white canvas tents. In addition to House Capashen's proud tower with seven windows, House Tarmula's flag flew, a seven-pointed star upon it. A stewpot scented the air with smell of cooking onions.\n\n\"They outdistanced me, and by the time I circled around, you had left. So I started tracking them and encountered Danitha.\"\n\n strode through the camp toward Jaya and Ajani. Her light-brown skin glowed with health and her hair, shaved along the sides, had been drawn back into a tight plume. Her armor gleamed silver with ribbons of gold crossed across her chest like Gerrard's sash, embedded with stained glass that gleamed in red, scarlet, and yellow petals.\n\n\"I tracked the Phyrexians to a base south of here, concealed in some caves,\" Ajani said.\n\n\"My father must be there.\" Danitha turned to Jaya. \", daughter of , heir to the House Capashen. And you are?\"\n\nWell, well~ it had been some time since Jaya hadn't been recognized.\n\n\"J,\" Ajani cleared his throat, \"fights alongside Jodah the Eternal.\"\n\nJaya snorted. Jodah collected nicknames like some little boys collected marbles. \"I'm here to invite you to bring reinforcements to Shiv.\"\n\n\"Any friend to Ajani is welcome here,\" Danitha said. \"But unfortunately, I can't commit my troops to fight at Shiv until I've rescued my father.\"\n\n\"The delay\u2014\"\n\n\"Is worth it, and if you would like to assist me, I would appreciate your help,\" Danitha said. \"If my father is alive, you'll have House Capashen's gratitude and knights to call upon. And if he's not~ well, you'll have House Capashen's new leader in your debt.\"\n\nJaya stretched her fingers, pulling flame from the air. The heat radiated across her skin. \"Well, one sure way to get someone out of a cave is smoke.\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nIf there was any place on Dominaria where Jodah felt young, it was in the ruins of Kroog, in Yavimaya. The ancient domed building, its vaulting roof open to the sky, its golden stone draped with trailing pothos, seemed to hold the sunset's colors like a dragon-hoarded treasure. Exposed when a massive treefolk uprooted and migrated into the sea, it still smelled like earth.\n\n\"Jodah?\"\n\nHe did not recognize the voice. A cerulean butterfly lit upon his shoulder. He moved to brush it away, then hesitated.\n\nAn elf stared at him, her light skin dappled with gold around her bright, intelligent eyes. Even though Jodah could not have said why, she seemed young. She wore a warrior's leather armor; scarlet, ochre, and orange, yet unlike the armor he'd seen on other Yavimayan elves, she'd integrated repurposed Thran technology.\n\n#figure(image(\"005_Episode 4: A Brutal Blow/02.jpg\", width: 100%), caption: [Art by: ], supplement: none, numbering: none)\n\n\"You're Jodah the Eternal?\" she said. \"The Archmage Jodah?\"\n\nJodah coughed. For some reason, with the elf staring at him, he felt particularly self-conscious about the butterfly lazily beating its dinner plate-size wings near his face.\n\n\" told me all about you. Some people say there were many different Jodahs who took your name as a title, but I always thought there was only one.\"\n\n\"I'm here to negotiate with Meria,\" Jodah said, \"to recruit troops to fight for the New Coalition at Shiv.\"\n\n\"You must be four thousand years old!\" She looked him up and down like she'd look at an archaeological artifact. The butterfly flitted away. Jodah cleared his throat. He felt sized up, a sensation he did not appreciate.\n\nThen the elf sighed. \"I wish I could help you, Jodah. Since I was a child, I've dreamed of fighting alongside you, of leading my people to your aid~ of saving Dominaria together. But I'm sorry. I must think of my people.\"\n\nJodah smiled. So this was Meria. Only centuries of practice at diplomacy permitted him to conceal his shock. Seldom did elves follow someone with youth's freshness stamped upon their features\u2014one reason he'd thought it best that he perform these negotiations himself. But then, seldom did elves seek shelter in old ruins, buildings of stone and metal. Dominaria was changing. \"The Phyrexians are invading, Meria. It isn't a question of whether you fight. It's a question of when, of how\u2014and the answers to both these questions, whether we will stand together, will determine if we achieve victory.\"\n\nMeria dipped her head in solemn acknowledgement. \"You are wise, Jodah the Eternal. I am honored to meet you. Truly, I am. But neither your words nor your name will sway me. I see no reason for my warriors to abandon their homes for your cause. Yes, if the Phyrexians shadowed our canopy, we would fight\u2014on our home ground, with the advantage. But travel to Shiv? No, I think not.\"\n\n\"The Phyrexians can create sleeper agents,\" Jodah said. \"They can infiltrate\u2014\"\n\n\"We know,\" Meria said. \"But when Yavimaya allows my people to return, Multani will sort the good from the bad.\"\n\n\"Would you rather that the fight come here?\" Jodah said. \"Better to snuff the Phyrexian threat now than let Yavimaya burn.\"\n\nMeria's eyes glinted. She wasn't angry. She wasn't scared. She wasn't even implacable. She was amused, and this befuddled Jodah most of all. He wasn't used to being laughed at by someone a fraction of his age.\n\n\"Very compelling arguments.\" Meria smiled and patted him on the shoulder. But Jodah could tell, as she turned away, that she'd made up her mind.\n\nJodah had failed. Meria would not lead her people to Shiv.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nJaya hunched behind a stone outcropping that overlooked the entire valley. Not the most comfortable position, but she couldn't complain about the view. At the end of a narrowing ravine, the cave's large triangular mouth gaped. Two Phyrexians guarded the opening, centipede-like monstrosities with butchered human bodies in their cores. Their multiple limbs glinted in the sunlight, restive.\n\nFrom her vantage, Jaya could see what the Phyrexian monstrosities could not.\n\nAjani led half a dozen Llanowar scouts to remove the guards from the perimeter, clearing out the creatures that lurked in the shadowy woodlands. He'd been successful\u2014so far. No dying creature had shouted an alert.\n\nDanitha led the bulk of her force. Her knights lay in wait near the cave's mouth, concealing themselves in gullies, behind bushes and trees, in the mossy nooks behind granite boulders. Danitha held up her hand, signaling: #emph[Jaya, it's time.]\n\nJaya distilled her focus until it was keen as a blade inside her. She narrowed her eyes at the cave. The air itself combusted, exploding into flame. The pine needle turf smoldered, sending thick clouds of smoke toward the sky.\n\nThe Phyrexian guards launched into action, swarming through the underbrush. Danitha pointed at three knights, who charged, cleaving the nearest monstrosity with their broadswords. It fell into bloody hunks, each of which grew dozens of tiny legs. Danitha raised her hand again, and she sent another splinter force to drive the Phyrexian pieces toward Jaya's position.\n\nOnce they were near enough, Jaya sent out plumes of fire after each segment. This time, when the knights stabbed the cooking Phyrexian chunks, they stayed dead.\n\n\"Good riddance,\" Jaya muttered.\n\nAt the cave's entrance, heavy smoke coiled into the air. More Phyrexians poured from the cave\u2014well over two dozen humanoid abominations.\n\n\"Nine Hells,\" Jaya muttered. The knights had revealed themselves too early. Their inexperience showed: they fought as if their opponents were ordinary soldiers, rather than interplanar horrors.\n\nA vortex of flame shielding her, Jaya stalked down the hillside. As she blasted Phyrexians, she glimpsed brief horrors behind her gouts of fire: a compleated woman, iron coils escaping from her heart, stripping a Benalish knight of his armor like a child removing the limbs from an insect; a compleated child, plunging her wires beneath another knight's armor, bursting him apart from the inside. Danitha fought back-to-back with her second-in-command, her face grim.\n\nThe Benalish were being overwhelmed.\n\nAjani led his Llanowar scouts into the fray, cleaving the Phyrexian monstrosities with his double-headed axe. The Phyrexian advance halted, stymied.\n\n#figure(image(\"005_Episode 4: A Brutal Blow/03.jpg\", width: 100%), caption: [Art by: ], supplement: none, numbering: none)\n\nJaya thought, for one hopeful moment, that the leonin had turned the battle in their favor, until a new Phyrexian emerged from the cave, more monstrosities at his heels. He was human-form, broad and muscular, with pale armor merging into his torso. Metal spikes curved through his pale blond hair like horns and his orange-irised eyes wept black oil across his ice-white cheeks. He held up his double set of arms, which merged at the biceps, in ironic welcome. \"And here I was hoping some of my old crew might be in the rescue party. Shame\u2014I was so looking forward to catching up.\"\n\nJaya, despite the fire in her hands, chilled down to her guts. #emph[Ertai.] She'd heard of him, sure\u2014one of the original crew of the #emph[Weatherlight. ] He'd been dead for centuries\u2014and still had death's pallor, though some force reanimated his twitching features. His eyes possessed a terrible intelligence.\n\n\"It's such a pleasure to be back,\" he said. \"And I have learned so, so much in my time away. Would you like to see?\"\n\nAnd stepped from the cave's mouth.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nKarn brought out his sketch of the clay tablet he'd found in the Caves of Koilos, then lost in Oyster Bay. He traced the arcing symbols. Though he could remember what he had found perfectly, he could not make sense of it.\n\n\"Karn?\" Teferi peeked into Jhoira's workshop, which Karn, in her absence, had co-opted. \"I've spoken with Darigaaz, but the dragons are still deliberating.\"\n\n\"And the Ghitu?\"\n\n\"The Ghitu will not commit until the dragons do. It's council politics.\"\n\n\"The viashino?\"\n\n\"Same story.\" Teferi inclined his head. \"Only the goblins have come forward.\"\n\n\"The goblins? That is a surprise,\" Karn admitted.\n\n\"They wanted to be first,\" Teferi said. \"They're confident the dragons, the Ghitu, and the viashino will come to fight when the Phyrexians attack, but the goblins wanted to be able to say that #emph[they ] 'joined first' so they'll be able to use that as leverage in future relations.\" Teferi lay down on Jhoira's cot. He closed his eyes in exhaustion. Although magic had healed him, he was still recovering.\n\nA screech broke the workshop's quiet\u2014so loud that Jhoira's thinner beakers shattered. Teferi bolted upright, now alert. A second later an impact rattled down, shaking dust onto the delicate apparatuses, ruining experiments. The sulfurous stench wafting through the door made Teferi cough, though Karn's senses told him its concentration wasn't high enough to harm human life.\n\n\"What\u2014\" Teferi began.\n\nKarn pressed his finger to his mouth to request quiet. He was listening. The #emph[Weatherlight] . Karn left the workshop. Though weary, Teferi followed.\n\nIn Shiv's skies\u2014so hot they were not blue but a seared white\u2014the #emph[Weatherlight ] wheeled through the sky, draped in the rotting detritus it had been using as camouflage from the Phyrexians hunting them. It seemed they hadn't been able to elude one, though, which circled them like a predator. Unfurled, the Phyrexian dominated the sky. Its thin bat-like wings had clawed metal tines with too many joints, and its body was a mass of fibers. The#emph[ Weatherlight ] fought it, firing harpoons into the beast, but the barbs fell through the loose mesh of fibers, useless. Magic blinked across the sky, but even Karn could see that this creature effortlessly outmatched the #emph[Weatherlight] .\n\nBut then a small shadow in Shiv's white sky grew closer, spreading two massive wings: a dragon. Even Karn had to appreciate a full-grown dragon: no mightier being existed on Dominaria, the apex of both violence and wisdom. The shadow brightened, glinting as the sun struck its scales. Darigaaz had come to their aid. He turned down, diving, and gained speed, until he struck the monstrosity.\n\nThe Phyrexian exploded at the impact, parted into a writhing mass. Still airborne, its fragmented body draped between its wings. The monstrosity attempted to draw itself together. Slick iron fibers wove and interlocked.\n\nBut Darigaaz had already pivoted midair. He exhaled a flame so white-hot over the Phyrexian monstrosity that it did not burn: it vaporized. Molten metal droplets rained onto the Mana Rig's deck, followed by Darigaaz himself. People scattered, retreating to a respectful distance.\n\n\"Planeswalker Teferi.\" Darigaaz bowed his head. \"I accept your proposal to fight here at Shiv. I will defend our skies\u2014no doubt, my brethren will join me. As will those from the other nations who have seats on the Shivan council.\"\n\nTeferi strode toward the dragon. He bowed. \"We accept the allegiance of the dragons of Shiv. Respectfully, of course.\"\n\nDarigaaz bowed his head, solemn. He flung himself into the sky, his takeoff an economy of power, and spiraled upward into the blue.\n\nIn the silence, Jhoira slid down a rope from the #emph[Weatherlight] 's deck onto the Mana Rig. Her owl swooped down and landed on her shoulder, its metal body gleaming in the sun. \"That's a hard act to follow.\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\n stepped out from the cave. The surgical lines on his face still had raw edges, but they did not weep blood: instead, black oil glistened near the sutures. The lines did look~ artful, Jaya had to admit, as if Ertai had carefully considered each arcing cut over Aron's cheekbones, then deliberately contrasted it with the jagged line across his forehead. But otherwise, Aron seemed devastatingly human. His expression was anguished\u2014unlike the other Phyrexians, he seemed self-aware. He was still , and he knew what had been done to him, what it meant. His lips formed the words: #emph[please, don't look at me. ] But he did not, could not, voice them.\n\n\"Father.\" Danitha's gasp was hoarse\u2014yet so pained. Jaya wished she could provide some iota of comfort.\n\n\"What have you done?\" Ajani demanded.\n\n\"Sheoldred has taught me that beauty lies in change,\" Ertai said. \"It's a hard lesson, when applied to oneself. But when applied to others, the beauty of change becomes more apparent, its aesthetics a revolution. Watch.\"\n\nAron's face opened along the surgical incision lines, unfurling to reveal that his skull had been replaced with steel, his eye with a crystal lens, and that his brain lay protected beneath glass. Unlike other Phyrexian monstrosities, Aron's changes had a clockwork intricacy, each delicate mechanism ticking and whirring. It reminded Jaya of a star map.\n\n\"My father is not your plaything.\" Danitha's voice sounded flat with shock, but her eyes burned with rage. Her hands on her broadsword, she stalked toward Ertai and Aron. Her father watched her with pained hope\u2014for what, Jaya did not know.\n\nNo Phyrexians moved to intercept her.\n\nErtai watched with fascination. \"Aron? Do your duty.\"\n\nAron lurched forward. He raised his hands, jerkily, and drew his sword. He lunged at Danitha. She parried, looking startled. His movements seemed bizarre, twitchy and unwieldy, like he was resisting himself. Or resisting Ertai's command? He swiped down again, and this time Danitha caught his blow on her broadsword. She forced him back, throwing him off. His intact eye wept glistening oil as he marched toward her again.\n\n\"Danitha,\" said Aron, his voice strange and distorted. \"Do your duty.\" His words were a distorted echo of Ertai's.\n\nDevastation crossed Danitha's face so quickly that Jaya, at this distance, almost missed it. But then Danitha's lips firmed. Her gaze turned both steely and pitying. \"Yes, Father.\"\n\nThis time, when he brought his blade down on her, Danitha side-stepped. She raised her broadsword and swept it down in a graceful arc, separating his head from his shoulders.\n\nErtai watched all this with dispassion. \"No respect for art. But I suppose I can always sew that back on.\"\n\nHe waved one three-fingered hand.\n\nThe mountains shook. Stone broke, and rubble tumbled down. Sharp shale spun past Jaya, cutting her cheek. She gasped and clutched at her injury. A Phyrexian monstrosity broke free from the mountain in front of them, shattering it into rubble. The roar of rock sliding from its body brought tears to Jaya's eyes. The monstrosity reared into the sky, so large that it blotted out the sun. Its plated body rose, brimming with complex mechanisms and weaponry, perched upon immense, deceptively thin legs. Its head was a battering ram, and its tail ended in a stinger, dripping with oily venom.\n\n\"Dim-Bulb's stupid horns~ that's #emph[huge] ,\" Jaya whispered. A Phyrexian dreadnought. It had to be the largest one she'd ever seen. \"How are we supposed to fight #emph[that] ?\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nMeria paused, her head cocked. Birds arrowed through the sky overhead, screaming. She watched them, a frown marring her forehead between her brows. Hoots boomed throughout the forest as monkeys shouted the alarm, and Jodah even heard the coughing roar of some great forest cat.\n\nMeria turned to face him. \"Something is coming.\"\n\nShe spun and ran out from the building. Jodah fell into pace beside her. In the distance, tree branches rocked\u2014then shattered, exploding upward in a burst of greenery as a dragon engine reared into Yavimaya's vacant blue skies.\n\nJodah had never seen a mechanism so vast. Its bronze skull glistened in the hot tropical light, blotting out the sun. Its razor-edged back sloped away into the rainforest, longer than the ridge of a hill, and it waded through the trees\u2014toward Jodah, Meria, and the elves.\n\nThe dragon engine's serrated mouth gaped open in a voiceless roar. Its thrum was so deep Jodah couldn't hear it: he could only feel it, like a blow to his heart. The vibrations traveled through the landscape, shattering branches. Parrots dropped from the trees, stunned. Small marsupials fell, eyes and noses bleeding. Jodah touched his face, pressing his index finger to the hot trickle that tickled his lips. He, too, bled. Yavimaya elves emerged from their buildings, scrambling to arm themselves. Riders led their kavu from the treetop stables. One male elf stumbled from his cottage holding an infant bleeding from its nose. He stared at Meria with beseeching eyes.\n\nThe dragon engine tore through the rainforest, uprooting a tree.\n\nMeria gasped. \"It's destroying Magnigoths. Those trees have stood for centuries!\"\n\nJodah began to catalyze his spells. He could feel the power rising within him, so brilliant that it poured from his skin, that it lifted him from the ground, that it cradled him. To hold all this magic at the ready~ It was as integral to his being as his veins. He prepared himself.\n\nAll around him, Yavimaya elves evacuated their homes, dragging children and bundled belongings away from the fight. Jodah caught teary but brief farewells as warriors told their offspring to be quiet and brave and then embraced their partners before parting ways.\n\nWarriors astride kavu clung to every tree branch, their bows, spears, and blades held at the ready. Spellcasters stood in phalanxes upon the mossy turf, brighter than blossoms in their finery, their fingers interlocked, their lips already moving with chants to conceal the retreating civilians. Meria gave Jodah an anguished look and led him to the forefront of her warriors.\n\nWith one sweep, the dragon engine cleared the ground between itself and the Yavimayan village. Ancient trees crashed to the ground, splintering, the leaf-shaped houses upon their boughs crushed. Soil clouded the air, then settled, revealing a raw ditch between the Yavimaya and the dragon engine. The dragon engine had not only uprooted ancient trees so that their roots framed the battlefield, exposing dirt\u2014it had also revealed artifacts from the Thran city deep beneath the Ruins of Kroog. Ground water seeped through the rich loam, pooling around the golden objects. Meria gasped.\n\n\"I recognize that,\" she breathed. \"From my studies. Oh, that\u2014Jodah, that is our hope.\"\n\nJodah couldn't determine which object Meria meant in the jumble, but that she had picked out one artifact from this distance was remarkable. Little wonder that the Yavimayans followed her.\n\nThe dragon engine craned its head as if to look at their armed forces. Within its skull, its driver sat like a jewel, illuminated with a pale blue light. Even from this distance Jodah could make out her features, see the red light of her replaced eye. She matched Karn's descriptions: Rona. Her teeth were barred in a fierce smile.\n\nIn an echo of Rona's own body language, the dragon engine opened, exposing its barbed jaws. Within its mechanized armor plates, the remains of small, rotting forest creatures hung suspended between oily ligaments. Rona had butchered them to restore the dragon engine's bulk.\n\nJodah's stomach turned.\n\n\"Archers!\" Meria cried.\n\nThe Yavimayans loosed their arrows, but they were useless against the dragon engine's plates. Jodah could feel the machine building its energy\u2014and at this proximity another roar would wipe them out.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nErtai laughed softly. He lifted his arms. The upper set had only three stubby fingers on each hand, which he beckoned with. The dreadnought swung its tail around and crushed Phyrexians and Benalish knights alike as it spewed venom. The viscous fluid arced out, so acidic it melted trees and boiled the alpine creek. The blow echoed throughout the mountain range, triggering distant rockfalls and avalanches.\n\nDespite the cacophony of tumbling rock, Jaya could still hear Ertai's delighted laughter. He waved his arms, and the Phyrexians launched themselves into the devastated Benalish forces. Ajani fought at Jaya's back, hacking away at the creatures that skittered toward her. Danitha retreated to aid her troops. She shouted orders that caused the Benalish knights to reform around the Llanowar archers, circling up now that they were surrounded.\n\n\"Fire,\" she called, and the Llanowar elves released their bowstrings. Their arrows rebounded off the dreadnought's legs, not even denting its armor.\n\nThe dreadnought stretched and straddled the battlefield. It arched its spine. If it released more acid, they'd surely be doomed~\n\n\"Stop!\" Ertai called. His Phyrexians scuttled back, retreating into the rocks like so many crabs. The larger ex-human creatures ran toward the dreadnought's legs and clung there. Some knights paused. \"Call off your fighters, Danitha.\"\n\n\"Or~?\" Danitha asked.\n\nErtai smiled. He pointed at the dreadnought with one upper hand and the melted slag from its acid spray with the other. He raised his eyebrows. The bristles along his head seemed to lift with pleasure.\n\n\"Or,\" he said.\n\nDanitha lifted one hand. Her knights stopped fighting. Jaya let her flames die, overexertion washing through her. Ajani settled back, his double-handed axe weighed between his palms with more than some reluctance, teeth bared. He met Jaya's gaze, and she gave him an exhausted shrug. She didn't have a plan.\n\n\"Jaya. Ajani. If you don't give yourselves up to me,\" Ertai said, \"I will tell the dreadnought to eradicate these people. All of them.\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nJodah lifted his hands, raising his energy to form a protective barrier. The shield rippled from its brightest point, a white sheen that colored the air itself. He couldn't mitigate the effects of the dragon's booming roar, but he could soften them\u2014even if his spell, however powerful, would only hold up beneath one blast.\n\n\"There. I need to reach that.\" Meria pointed at an uncovered Thran artifact that lay in the dirt between her troops and the dragon engine. She touched Jodah on the arm and looked up at him hopefully. \"Can you leave that shield there to protect my people while you come with me? Out on the battlefield, I mean.\"\n\nJodah nodded. What was the nature of this artifact, that Meria pinned her people's lives on it? \"Yes, I can do that.\"\n\nMeria raised her voice in a cry, which Jodah assumed meant \"hold,\" because he saw the archers shift from offensive to defensive postures, eyes wary. She nodded in satisfaction, then returned her attention to Jodah. \"Ready?\"\n\nJodah stretched out his fingers and pressed them into the air. The spell shimmered in response, then stabilized. Meria smiled at him, her face sharpened with intelligence and eagerness. She tapped her spear on the ground, and an intricate Thran tracery illuminated its length. Metal spurs shot out from one end of the spear, and a translucent webbing unfurled between them. Her spear appeared to also function as a powered Thran glider.\n\nMeria threw one arm around him. \"Hold on tight!\"\n\nJodah stiffened\u2014but too late. The glider jerked them both from their feet. He found himself unceremoniously clinging to Meria as the glider drove them both through the air. They zipped through his magical barrier. It offered some resistance, flexing, but permitted them passage. Hot magic buzzed along their skin, shocking in its power. The glider took a sharp turn, then dived toward the earth. They splashed down into a crater quickly filling with brackish water\u2014right at the dragon engine's feet.\n\n\"Cover me,\" Meria said.\n\n\"Is that why I'm here?\" Jodah said, dryly. But he readied his spells. He could still feel the shield they'd left behind to protect the Yavimayan warriors draining him. This did not stop him from summoning his reserves. \"I'll do my best.\"\n\n\"Good.\" Meria, heedless of the filth, dropped to her knees and started searching the muddy waters. \"It's here somewhere. I know I saw it~\"\n\nThe dragon engine roared. Jodah flung up a radiant white bubble, protecting them. The sonic force beat against both of Jodah's shields. He summoned more arcane force to meet and negate the concussive energy; the dragon engine's roar heightened, then died. Jodah's shields faded with it, and exhausted, he fell to his knees. His entire body felt pummeled, like he'd stretched himself physically behind those shields to hold them. He didn't have it in him to do it again.\n\nThe dragon engine craned its head toward them. Jodah had the nasty suspicion Rona intended to target both him and Meria more directly with her next blow. \"Hurry!\"\n\n\"Aha!\" Meria fished a silver globe covered in delicate golden Thran traceries from the muck. \"Found it! I knew I'd seen one of these.\"\n\nMeria's eyesight had to be exquisite for her to pinpoint #emph[and ] recognize a Thran artifact amongst the roots, dirt, and debris after the dragon engine's attack. \"What is it?\"\n\nMeria twisted the globe, realigning the symbols into new configurations. It lit up. Brightness raced along the globe's equator at a quicker and quicker pace. Jodah could recognize a countdown anywhere. Meria cocked her head. \"How fast do you think you can get us out of here?\"\n\nJodah grit his teeth and readied a portal. The effort winded him even though he'd set the portal to transport them only a short distance. But he had already expended much of his strength in this battle. It felt like he peeled open that doorway-in-the-air with his fingernails.\n\nMeria dove through, and Jodah leaped after her. He spun, held out his hand, and clenched it into a fist. The portal collapsed\u2014just in time. The Thran artifact flashed, a bright red light that saturated the landscape as if in warning, and then instead of a boom there was\u2014\n\nSilence.\n\nBetween the Yavimayan elves and the dragon engine, a thin film seemed to have formed. But it wasn't a film, not really. On the one side\u2014the side on which Jodah stood\u2014the air was thick with cloudy pollen, dust the dragon engine had kicked up, and humidity. He'd never realized that air had a color: not until he'd looked from an area #emph[with] air to an area #emph[without] it.\n\nThe Thran weapon had created a spherical vacuum. The dragon engine stood in the center of it, and it roared\u2014and roared\u2014in absolute silence.\n\nBut even from here Jodah could see how the dragon engine failed: the organic pieces inside it died. The mangled remains of the woodland creatures, confronted with vacuum, froze. Inside the dragon engine, tendons snapped, organs turned to slimy ice or burst, and muscle fibers solidified. The dragon's wires, writhing beneath its armor, seemed to have become more brittle. More than a few snapped off. The lights faded from the dragon engine, dimming inside its skull.\n\n\"I don't think the artifact is a weapon, really.\" Meria perched one hand on her hip. \"I think the Thran used it to conduct scientific experiments in a vacuum. That's what I would do.\"\n\nNo, Jodah thought. This was a weapon. Perhaps even a Damping Sphere, though he'd never seen one do that before.\n\nThe dragon engine staggered toward the field's edge, then collapsed through the barrier. It fell so that half its body was in woodland and the other half remained in the vacuum. Rona, a distant mark in the dragon engine's head, opened a hatch and staggered out from her cavity. She half-slid, half-climbed from the dragon engine's head down its sloping body. The speed with which she made her descent awed Jodah\u2014but then he supposed he'd be desperate, too. She paused at the edge of the woodlands, hands on her knees while she, apparently, breathed.\n\nMeria made a small gesture with one hand. Spear-bearing kavu riders peeled away, shooting around the periphery toward Rona. She shot one glance behind her, then fled. Meria watched the chase, solemn. Her gaze shifted to the fallen Magnigoths. \"Hundreds of years of life\u2014lost in an instant.\"\n\nJodah inclined his head. \"That's war.\"\n\n\"They will find us, won't they?\" Meria said. \"Wherever my people go.\"\n\nJodah nodded. Meria's eyes shone with both anger and grief.\n\n\"Then there's only one path for us. And it doesn't lie in Yavimaya.\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\n\"Why am I worried that you won't let them go, even if I do hand myself over?\" Jaya said to Ertai. She straightened her shoulders. She didn't intend to give herself up, but she didn't have another plan, either. Maybe, if she got close enough, she could summon a molten lance to spear him through the heart or superheat the air around Ertai's head~ something, anything that could get them out of this\u2014\n\nA sweet breeze cleared the battlefield's stink. It brought with it the clean scent of leather and oil. The horizon began to brighten\u2014the #emph[western] horizon\u2014with the sheen of gold. The air gained a peculiar, unearthly quality to it, as if its particles hummed with ancient tension.\n\nAn immense but sleek golden ship tore through the mountains' rubble, rocks kicking up in the wake behind it. The shimmering vessel swooped in a circle around the Phyrexian dreadnought. Hundreds of Keldon warriors leapt from the ship, landing on the dreadnought's wide scaley back, and they drove their blades and cleated boots into the creature's hide to secure themselves.\n\n#figure(image(\"005_Episode 4: A Brutal Blow/04.jpg\", width: 100%), caption: [Art by: ], supplement: none, numbering: none)\n\nThe #emph[Golden Argosy] ! Jaya had thought it had been lost to legend. Radha had mentioned that she'd found an artifact during the negotiations in Oyster Bay, but Jaya had never guessed Radha had rediscovered that ancient ship.\n\nRadha herself led her warriors onto the Phyrexian dreadnought's battering-ram head. The Phyrexian monstrosities still on the ground seemed to realize that the dreadnought was vulnerable to this assault. Rather than sheltering against the dreadnought's legs, they too started to scale it to attack the Keldons.\n\n\"Archers, cover us. Knights, after me.\" Danitha charged the dreadnought. \"For Dominaria!\"\n\nThe knights roared and followed, plowing into the Phyrexians that sought to defend the dreadnought. The dreadnought, beneath the Keldon onslaught, released a moan that shook the entire landscape.\n\nAjani bellowed, \"Archers, to me! Fire on the Phyrexians climbing the dreadnought!\"\n\nJaya raised her hands. Her flame brightened with her renewed spirits, and she blasted the skittering creatures that had pivoted to attack the archers. Ajani pressed close to her, defending her from any Phyrexian that headed her way.\n\nRadha had pierced the dreadnought's eye, leaving a gash large enough for Radha to stand within the socket. Aqueous humor spurted, followed by the thicker clear goop of vitreous gel. Radha hacked through the muscular iris. The dreadnought shrieked in agony, tossing its head to throw her off. Its lower jaw gaped. It dripped blood, black fluid, and pinkish organic matter from its mouth.\n\nErtai bellowed, \"Sheoldred will hear of this!\"\n\n\"I hope she does!\" Jaya called.\n\nThe creature crumpled, one joint at a time relaxing into death. The Keldons on its back let out a cheer and then flattened themselves, bracing to ride out its fall. The Benalish knights who'd been fighting underneath the dreadnought scattered. Jaya and Ajani both stared up at the nearing bulk of the dreadnought's underbelly, how it blotted the sky. Jaya scrambled out from underneath the dreadnought, squeaking past its final crash into the earth. The sound resounded in the mountains. Then, after that, the roar of avalanches and tumbling stone, until that, too, trickled into silence.\n\n#figure(image(\"005_Episode 4: A Brutal Blow/05.jpg\", width: 100%), caption: [Art by: ], supplement: none, numbering: none)\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nKarn looked up as Jhoira entered her workshop.\n\n\"Hiding out here isn't the cleverest way to avoid me,\" Jhoira said.\n\nKarn faced her. \"I'm not hiding.\"\n\n\"You never answered my letters.\" Jhoira didn't sound hurt\u2014more rueful.\n\n\"You wished to speak about Venser,\" Karn said. \"I did not.\"\n\n\"But you do now?\"\n\nKarn dipped his head. \"It was self-centered of me to be so consumed by the personal ramifications of Venser's sacrifice. He was also your friend.\"\n\nJhoira tilted her head. \"Yes, I'm sorry, too. I was grieving. You were withdrawing because you were, too. Nothing selfish about that.\"\n\n\"Just different reactions to the same stimulus,\" Karn mused.\n\n\"Ah, I missed you.\" Jhoira laughed and embraced him. Her mechanical owl, disturbed, flitted away from her shoulder and landed in the workshop's beams overhead.\n\nKarn doubted she obtained the comfort she sought: his body had a similar heat to a human's, but he could not offer her the same softness of flesh. He enjoyed her proximity anyway. His friends were so small and so mysterious. He could divine the inner workings of quartz, but still he would never perfectly understand Jhoira.\n\nJhoira patted Karn's arm and then released him. She dug some glittering metal parts from her pocket, Thran by the look of the golden tracery on them. \"These will help me install a self-destruct mechanism on the Mana Rig. It's too powerful to ever allow in Phyrexian hands~ Karn, it has been too long. We should not have let life come between us.\"\n\n\"Or unlife,\" Karn said.\n\nJhoira laughed. \"I always forget that you have a sense of humor.\"\n\nHis communicator to the #emph[Weatherlight] chimed on his neck. Karn, though startled that anyone would use it when not communicating with the #emph[Weatherlight,] grasped it to activate it. \"I am listening.\"\n\nJodah's voice came through, clear as if he stood in the room alongside them. \"I am headed toward Shiv with the Yavimayan elves. Meria was able to recruit several neighboring groups. Since we're traveling by treefolk, it will take some time to reach you. Karn, there's something you need to know.\"\n\n\"Yes?\" Karn asked.\n\nJodah hesitated. \"There is a spy in the New Coalition.\"\n" }, { "repo": "https://github.com/polarkac/MTG-Stories", "file": "https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/034%20-%20Dominaria/008_Return%20to%20Dominaria%3A%20Episode%208.typ", "language": "typst", "license": "", "content": "#import \"@local/mtgstory:0.2.0\": conf\n#show: doc => conf(\n \"Return to Dominaria: Episode 8\",\n set_name: \"Dominaria\",\n story_date: datetime(day: 02, month: 05, year: 2018),\n author: \"\",\n doc\n)\n\nChandra walked across the planes to Regatha. She stepped through a storm of fire into existence again on the rocky ground below the broad stone steps of Keral Keep. The sun was setting over the mountains, the smoke from the nearest volcano turning the sky a brilliant red streaked with orange. The heat of the day sank into her bones, a comfort after the dank cold of the Dominarian swamp. She took a deep breath of warm air tinged with a crackling energy like the aftermath of a lightning strike and felt all her tense muscles relax.\n\n#figure(image(\"008_Return to Dominaria: Episode 8/01.jpg\", width: 100%), caption: [Mountain | Art by ], supplement: none, numbering: none)\n\nShe sighed and scrubbed at her face. #emph[I know it didn't look like it, Gideon,] #emph[but I have a plan] . She wasn't running away.\n\nNissa hadn't run away either. #emph[You didn't have to leave like that, leave me] , Chandra thought, her chest tightening at the memory of Nissa's furious expression. Nissa hadn't even given Chandra the chance to come with her. She knew how much danger Zendikar could be in from , how much Nissa wanted to be there to help repair the damage. #emph[But she acted like she never wanted to see me again] , Chandra thought, and knew she sounded like an angry, jealous child. Well, that was part of the problem, wasn't it? #emph[You're not strong enough for this and you need to fix that] , she told herself.\n\nFrom inside the monastery, voices echoed in an evening chant. She had arrived at just the right time; the monks would finish the ceremony and then sit down to dinner. It was a perfect opportunity.\n\nShe climbed the stairs silently, slipped inside the shadowy hall, and took the first corridor. She reached an open court and had to duck down behind a stone bench as two robed figures hurried past. Novices, distracted by their studies and running late, something Chandra had had to deal with during her brief time as abbot. She waited until the sound of their steps faded then quickly crossed the court.\n\nIt wasn't like anything would happen if they found her, Chandra just didn't want to argue about her plans. And they would see she was upset, know something had happened, she would have to explain\u00a0.\u00a0.\u00a0.\u00a0 She didn't want to think about what had happened on Amonkhet, much less explain it.\n\nShe needed more firepower, better focus and accuracy, to do real damage to . To get it, she had to be more in touch with her true self, or at least that was what they taught at Keral Keep. It was just that Chandra had never had any luck trying to do that. But for once she had stumbled on the perfect opportunity. Just after Nissa disappeared, Chandra had noticed fresh traces of a powerful pyromancer's aether trail on Dominaria.\n\nPossibly Jaya Ballard's aether trail.\n\nThe fire mage Planeswalker hadn't been seen for longer than Chandra had been alive, and everyone at Keral Keep thought she was dead. But Jaya might be on Dominaria now, and if anyone could teach Chandra the trick to quickly getting in touch with herself and increasing her power, it had to be her.\n\nOnce past the court she was in the lesser-used area of the keep and it was easy to hurry along empty passages to the stairway leading down. She reached the dark hall at the bottom and released a small ball of fire from her open hand. It moved up to hover near the vaulted ceiling, lighting the chamber.\n\nThis was where the monastery kept its sacred relics, but there was only one thing here Chandra was interested in. She crossed the room to the plinth where Jaya's goggles sat. The light gold metal was just a little discolored, but the leather strap and buckle showed obvious wear. #emph[She'll want these back] , Chandra thought, #emph[and they'll prove I come from Keral Keep] . The gift would get Jaya to listen to her long enough for Chandra to explain how important the fight against was. And it wasn't stealing when you were giving something back to the person who had originally owned it.\n\n#figure(image(\"008_Return to Dominaria: Episode 8/02.jpg\", width: 100%), caption: [Pyromancer's Goggles | Art by ], supplement: none, numbering: none)\n\nAs she reached for the goggles, a voice behind her said, \"Chandra, what are you doing?\"\n\nChandra snatched the goggles, clasping them to her chest as she spun around. It was , staring at her from the doorway.\n\nChandra yelped, \"It's not what it looks like!\" Of all the people who could have caught Chandra in the act, Luti was the absolute worst. She didn't have an official rank in the monastery, but she was old and had been living here off and on for forever and everyone respected her and she was always trying to get Chandra to learn things Chandra didn't have time for.\n\nLuti came toward her, her expression more bemused than anything else. \"I have no idea what it looks like,\" she said. \"What are you doing here? Why do you want those?\"\n\n\"I found ,\" Chandra told her.\n\nLuti froze for an instant, eyes wide. The shadows from Chandra's fire light etched even deeper lines around her mouth and eyes, darkened her long silver-gray hair. \"You\u00a0.\u00a0.\u00a0.\"\n\n\"I think she's on Dominaria! We went there after Amonkhet\u2014it was terrible, Bolas nearly killed us all, and we failed\u00a0.\u00a0.\u00a0.\" Chandra lifted the goggles. \"But if I can find Jaya, I'm going to give her these, ask her to teach me the secrets and tricks I need to know! I have to do this, Luti, I need more power to fight . Otherwise we're going to lose, he's going to kill me and all my friends, and then\u2014\" She waved a hand and the fireball floating overhead danced wildly, mirroring her agitation. \"There won't be anybody left to stop him.\"\n\nLuti let out her breath. \"Chandra, you don't need Jaya. You should be concentrating on helping your friends, if they're in so much danger.\"\n\n\"You don't know what I need!\" Chandra burst out. All the frustration and fear of the hopeless battle against Bolas, of Gideon taking Liliana's side, of Nissa's abrupt departure, it all boiled up at once. \"You weren't there! Stop giving me advice I don't need and don't want!\"\n\nLuti gestured in exasperation. \"Chandra\u2014\"\n\nBut Chandra had already turned, ghostly fire flaring up around her as she stepped out of the plane. This time, she knew exactly what she needed to do.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nChandra followed the fading traces of what she hoped was Jaya's aether trail and stepped back into Dominaria. Cool air washed over her. She stood in an alley, surrounded by heavy stone buildings with crenellations and shuttered windows. She walked out of the shade into a sunny plaza, where people dressed in rough leather and muted colors hurried past. The sun warmed the stone cobbles underfoot, and it only felt cool because she had just been in Keral Keep's oven-like warmth. This place was Argivia, the capital city of New Argive, some distance west of Benalia and Aerona.\n\nAll the passersby seemed nervous, and lots of people were hauling baskets of food, bags, barrels, and ceramic jars, taking it all farther into the city. Everyone seemed to be talking in loud, worried voices. Chandra ducked out of the way of a herd of goats and bumped into a woman carrying a basket. The woman stumbled and the basket tipped, spilling apples onto the cobblestones.\n\n\"Oh, I'm sorry!\" Chandra flung herself down and scrambled to pick them up.\n\n\"It's all right.\" The woman knelt down to scoop the fruit back into the basket. She laughed a little breathlessly. \"If it's the worst thing that happens today, we'll both be lucky, hey?\"\n\nFortunately, the crowd wasn't panicked and parted around Chandra and the woman like they were rocks in a stream. \"What's all this about?\" Chandra asked. The city was clearly preparing for something, but it was orderly and almost practiced, like everyone was used to it.\n\n\"You haven't heard?\" The woman dumped the last of the apples into the basket, and Chandra helped her lift it as they both stood.\n\n\"I'm traveling, I just got here,\" Chandra said. As an explanation, it wasn't the best, but fortunately the woman was in too much of a hurry to question her further.\n\nShe said, \"Oh, it's the kobolds of the Kher Ridges again, and that horrible god-dragon of theirs, Prossh. They're going to attack the city, but 's got a troop of soldiers and a powerful pyromancer to settle them. Hopefully this time it'll be permanent.\"\n\n#figure(image(\"008_Return to Dominaria: Episode 8/03.jpg\", width: 100%), caption: [Prossh, Skyraider of Kher | Art by wood], supplement: none, numbering: none)\n\n\"A powerful pyromancer?\" That sounded promising. \"Do you know who it is?\"\n\n\"No, never heard a name.\" The woman settled the basket on her hip. \"If you're meaning to move on, you should leave soon. They're going to lock down the gates until the troop gets back.\"\n\nIf the steward wasn't coming back until he finished off the Kobold threat, there was no telling how long that would take. Chandra had to go now. \"Thank you!\" she said, and plunged away through the crowd.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nThe city gates were still open and quite a few travelers and traders were leaving, not wanting to risk getting stuck in the city. Some enterprising peddlers had set up shop there, and Chandra was able to buy travel supplies and a map before she started out. All the other horses and wagons and foot traffic were taking the northern road; Chandra was the only one going south toward the ridges.\n\nAs she walked she could see signs that a large mounted force had recently passed this way. Hopefully she could catch up to the steward's party before the battle. If Jaya was really there, Chandra could volunteer to help, which would make an even better introduction than just charging up to Jaya and handing her the goggles. #emph[This is a great plan] , Chandra told herself. #emph[And it's getting better all the time!]\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nA few days later, Chandra was starting to doubt a little. It was late afternoon and she had left the farm country near the city as the road gradually climbed into forested hills. Now she was walking through heavy forest, the road much rougher than it had been nearer the city. At least the weather had been good enough that she hadn't needed her tent, but she was worried about what would happen if she ran out of food.\n\nShe still saw signs of the Argivian troop's passage, and had stumbled over a couple of their old campsites, but they were obviously moving much faster than she was. She had the growing feeling she had probably already missed the battle. She told herself it didn't matter; as long as she found Jaya, everything would go according to plan.\n\nShe was trudging along, trying to dig the last piece of fruit out of her pack, when she spotted something lying beside the road. At first she thought it was more debris from the Argivians, a discarded or forgotten bedroll lying on the tree roots at the edge of the road. But a few steps closer she saw the outstretched arm and realized it was a dead body.\n\nChandra stopped, startled. All around her, the birdsong was silent. The road curved here to follow the shoulder of a hill, and she couldn't see too far ahead. She ran up to the body. It was a man, wearing the light armor of a scout and a tabard with the symbol of the Steward of Argive that she had seen in the city. From the ax wounds in his neck and shoulder, he was definitely dead, but when she touched his arm his flesh was only just cool. #emph[This didn't happen very long ago] , she thought. Maybe she hadn't missed the battle after all. Though it was weird that she couldn't hear\u2014\n\nA crash sounded in the forest, not far away. \"Here we go,\" Chandra muttered to herself.\n\nChandra stepped off the road onto the thick loam between the trees. Heading in the direction of the crash, she found a second dead body, another Argivian scout, this one killed by crossbow bolts to the back. She kept moving, following the sounds of scraping and pounding. She reached the top of a rise and caught movement out of the corner of her eye. She stopped and squinted, trying to pinpoint it. Then she saw the movement again. \"Hah, there you are,\" she whispered to herself.\n\nSomeone or something had just pushed the trunk of a fallen tree across the road where it curved around at the top of the hill. #emph[Now that looks like an ambush] , she thought.\n\nThere wasn't a lot of brush between the towering trees, but she still couldn't see who was up there moving around. She finally found a vantage point by climbing up among the trees at the top of a low hill. From there, she saw the kobolds.\n\n#figure(image(\"008_Return to Dominaria: Episode 8/04.jpg\", width: 100%), caption: [Kobolds of Kher Keep Token | Art by te], supplement: none, numbering: none)\n\nAt least a dozen worked on each side of the road, short gaunt figures dressed in a variety of metal and leather armor and helmets, heavily armed with axes, spears, and swords. They were building a barricade across the road, probably meant to halt the Argivian troop and give the kobolds a chance to attack. The one Chandra guessed was the leader stood on a boulder, waving a sword and exhorting the others, \"We will kill the Argivians for the glory of Prossh!\"\n\n\"Prossh loves us,\" the others responded as they dragged another fallen tree across the road. \"We honor Prossh.\"\n\nAs the kobold leader continued to rant about Prossh's greatness, Chandra snorted. Since Prossh was a dragon, she was pretty sure he didn't care about the kobolds at all, except for how tasty they were. But the kobolds must have surprised the scouts\u2014they knew the steward's force was headed back this way and would be here any moment. It was all really annoying. If not for the kobolds, Chandra might be meeting Jaya right now.\n\nThen two more kobolds rushed down through the trees from the south. They ran up to the leader and spoke, but it was too quiet for Chandra to hear. The leader turned and jumped off the boulder, hissing and gesturing at the others. \"The Argivians draw near! Be ready!\"\n\nAs the kobolds on the road ran for hiding places, Chandra eased away from the clearing. She was going to break up this ambush.\n\nShe scrambled backward and sat up to turn around. And found herself looking down at two kobolds, carefully creeping up the hill behind her. One yelled, \"Kill her for Prossh!\" They both lifted heavy axes and charged.\n\n#emph[Well, damn it] , Chandra thought. There went any chance of being stealthy and clever enough to impress Jaya, who was hopefully nearby. She would have to do this the loud fiery way.\n\nChandra sent a fireball into the first kobold's chest and he tumbled back down the hill, screeching. The second one lunged at just the wrong moment and her fireball hit his ax instead of his body. He flailed backward as his ax handle turned to ash. Chandra took the opportunity to jump up and kick him in the face. He somersaulted down the hill to join his friend.\n\nMuttering to herself, \"Don't burn down the forest,\" she bolted through the trees, headed toward the section of road where the kobolds had laid their ambush. The steward's party would be arriving any moment.\n\nCrossbow bolts landed in the ground near her feet. She spun and spotted three kobolds, running at her from the trees. She incinerated the rest of the bolts in mid-air and the crossbows for good measure, then charged out onto the road just above the point where the kobolds' tree trunks blocked it.\n\nChandra drew on her power and held out her hands toward the makeshift barrier. One clean blast down the middle, she told herself, focused and controlled. And she thought wryly, #emph[Just like always tells you and you never listen.]\n\n#figure(image(\"008_Return to Dominaria: Episode 8/05.jpg\", width: 100%), caption: [Chandra, Bold Pyromancer | Art by ], supplement: none, numbering: none)\n\nShe sent the burst of fire streaking toward the logs. It hit dead center and slammed through all three trunks. Through smoke and burning fragments, Chandra got a glimpse of the road past the barricade, but she couldn't spot anyone approaching. She needed to make the opening bigger, to make sure the Argivians wouldn't be trapped. She sent another burst of fire, but then a lot of screaming kobolds charged her.\n\nShe drove the first charge back with a stream of fire, fighting the urge to just blast them all. The last thing she wanted to do was set fire to the forest, endangering the nearby Argivians and whatever else lived here. But her temper raged as the kobolds charged again. A crossbow bolt tore through her shirt sleeve, narrowly missing her. The carefully targeted stream of fire turned into a wild blast that fried the half dozen kobolds in its path.\n\nFortunately she had been facing north, away from the troop of Argivians who charged through the shattered barricade behind her at that same moment.\n\nThe kobolds tried to regroup to fight the Argivians, but it quickly turned into a rout. Chandra stood at the side of the road and spent a few minutes telling herself that she had been completely in control and had meant to send that wild blast and knew it was in the right direction. Then she gave up and just hoped that Jaya hadn't seen it.\n\nScanning the mounted Argivians, Chandra didn't see anyone who looked like she might be Jaya. She must be farther back in the troop, riding with the steward, maybe.\n\nFinally the few surviving kobolds fled and Chandra headed up toward the remains of the barricade, where the Argivian supply wagons were waiting. Some soldiers had started to haul the remains of the barricade away, while others shoveled dirt over the still-smoldering debris.\n\nA young woman hurried up to her and said, \" would like to thank you.\"\n\n\"Oh, right.\" Chandra followed her, her heart pounding a little with the thought of finally meeting Jaya.\n\nBut when the soldier led her to where the steward stood beside his horse, there was no one who looked like Jaya. Chandra managed to contain herself and accept Baird's formal thanks without looking too impatient, but at the first opportunity she said, \"I was looking for the pyromancer who's supposed to be traveling with you. Is her name ?\"\n\n#figure(image(\"008_Return to Dominaria: Episode 8/06.jpg\", width: 100%), caption: [Baird, Steward of Argive | Art by oi], supplement: none, numbering: none)\n\nBaird said, \"Yes, that is her, but she left our force in the ridges.\"\n\n\"Left?\" Chandra could hardly react. It was a relief that she had been right all along, and Jaya really had been here. And it was horribly disappointing that she wasn't here now. #emph[Please, don't let her have planeswalked away already] , she thought.\n\nBaird explained, \"She said she had come to Argivia looking for a friend of hers, and when she heard the dragon we were going to fight was on the way, she offered me her services.\"\n\nThat was a relief. Chandra asked, \"So she's going farther south?\"\n\nBaird pointed up the road. \"To the Yavimaya forest, I believe. It's just off the coast on the far side of the Kher Ridges.\"\n\nThat was on Chandra's map. This road connected with the trails over the ridges and ran through to the coast across from the island of Yavimaya. \"Thank you!\" Chandra told him. \"I should go. I want to try to catch up with her as soon as I can.\"\n\nBaird nodded to her and gestured toward the supply wagons. \"If you mean to follow her, please accept some food and supplies from us. It's the least we can do in return for your help.\"\n\nChandra started toward the wagons, then thought of one last question. \"Oh, Steward? Who is the friend Jaya is looking for?\"\n\n\"I'm not certain.\" Baird shook his head. \"She said it was someone who had been gone a long time.\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nChandra traveled for five days, out of the forest and past the end of the road, up into the rocky slopes and scrub brush of the ridges. She was careful with her food, though the Argivian supply master had told her she should have enough to reach the coast, and she refilled her waterskin whenever the road crossed a stream. The walk gave her plenty of time to think about what she was going to say to Jaya, rehearsing it over and over. It also gave her plenty of time to worry about Gideon and the others, and to miss Nissa. But she was sure she was doing the right thing.\n\nGoing up what her map assured her was the last ridge, the trail became harder to see, and Chandra found herself climbing more than walking. Finally, she reached the top and stopped, breathing hard. The sea spread out below from a beach at the bottom of the ridge, the water serene under blue sky and white clouds. Directly across from her, maybe only a mile or two away, was another coast, so thickly covered with trees that the shore looked like a nearly solid wall of intense green. This had to be Yavimaya.\n\n#figure(image(\"008_Return to Dominaria: Episode 8/07.jpg\", width: 100%), caption: [Forest | Art by Ro], supplement: none, numbering: none)\n\nMist floated around shapes that might be small mountains or hills, but from her high vantage point on the ridge she couldn't see any sign that anyone lived there. No indication of paths or roads along its shore, no mark of civilization at all. Frustrated, she said aloud, \"How am I going to find\u2014\"\n\nSuddenly a whole section of huge trees on an inland hillside rippled and trembled, then waved back and forth as if a sudden wind shook them like children's toys. Carried on the breeze, Chandra distantly heard metallic banging and clanging, and something roaring faintly.\n\n\"I guess that answers that question.\" Chandra started down the ridge, moving as fast as she could. Whatever was going on over there, it was a good place to start looking for Jaya.\n\nBelow, in a cove at the bottom of the ridge, she found a small fishing village. An obliging though confused fisherman ferried her across the strait, and Chandra waded ashore to start her trek into Yavimaya.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nChandra had thought the forest near the coast was thick, but the inland trees were huge, with heavy spiraling roots arching up above the ground. The leafy canopies turned the sunlight into green shadow, but there were colorful flowers everywhere. Fortunately, the ferny plants on the forest floor were low and easy to sprint through. Chandra drew closer to the noise until she reached the edge of a low, possibly unnatural valley. It was nearly round and the bottom was filled with a big, newly dug crater, surrounded by piles of disturbed earth. And the people who had done the digging were still there.\n\nAt first Chandra thought she was looking at muscular giants in armor, but then she muttered to herself, \"Oh, right, I get it.\" She'd been traveling alone for too long, because these were obviously automatons.\n\nThey were each around twenty feet high, with scoops for hands and big blocky heads. As she watched, they stopped digging and climbed out of the crater to face the shadows of the forest.\n\nChandra hesitated, but they couldn't be after her; they were facing the wrong way. Then she saw the forest on the far side of the crater was moving.\n\nThe leaves and branches tossed like a harsh wind had passed through them. Creatures that looked like animate trees walked out of the shadows into the valley. #emph[No, wait, those ] are#emph[ animate trees] , Chandra thought, impressed.\n\n#figure(image(\"008_Return to Dominaria: Episode 8/08.jpg\", width: 100%), caption: [Verdant Force | Art by ], supplement: none, numbering: none)\n\nThey dragged themselves along, clots of dirt falling from their root bundles. Some were big, with trunks divided almost like legs, but others were smaller and crept out of the underbrush, moving their lower branches in a way that was far too giant-spider-like for Chandra's comfort.\n\nShe wasn't sure what was about to happen\u2014if it was a battle, a standoff, or a meeting. Then suddenly a tree surged forward so fast Chandra yelped involuntarily. It leapt on the nearest automaton and ripped it apart.\n\nChandra gasped in astonishment as metal parts flew into the air and rained down on the dirt. The other automatons rushed to attack and the enraged trees lunged forward to grapple with them. She ran toward the battle instinctively, but at the bottom of the hill she slid to a halt. She had no idea which side to take.\n\nShe didn't want to end up accidentally fighting against Jaya's friends\u2014that would be a huge disaster. Then a tree broke off from the battle and charged her, branches stabbing at her wildly. Reacting instinctively, Chandra flung a firebolt. It hit the tree dead-on and its branches caught fire. But even in flames it still came at her, bark and branches disintegrating, as if desperate to kill her. She hit it with another burst of fire just as a smaller, human-sized automaton reached her side. In a deep voice, it said, \"Take care. They will attack any movement.\"\n\nMore trees rolled over the hill like giant angry tumbleweeds, headed toward the automatons. Three veered off toward Chandra, accelerating as they got closer. Chandra demanded, \"What are these things?\"\n\nThe automaton braced to meet the charge. \"They're animated trees, created and sent by Multani.\"\n\n#emph[Not people, then] , Chandra thought. She drew on her power and blasted the rapidly approaching trees, aiming for the trunks. If they weren't people, she wasn't going to restrain herself.\n\nThen the automaton lunged past her. Chandra whipped around and saw a tree had crept up and was just about to slam its branches down on them. The automaton punched it in the trunk, over and over again, and splintered the heavy wood into fragments.\n\n#figure(image(\"008_Return to Dominaria: Episode 8/09.jpg\", width: 100%), caption: [Fiery Intervention | Art by Adam Paquette], supplement: none, numbering: none)\n\nMore trees slammed into the line of larger automatons and Chandra sprinted forward to get behind them. Two trees turned away from the automatons to rush her and Chandra blasted them out of her way. She reached a spot of higher ground where she had a better angle and sent a stream of fire down the whole row of trees. They didn't seem to realize they were on fire, and blindly shoved past each other to get to the automatons, spreading the blaze.\n\nChandra blasted the last few stragglers and moved back down to level ground. Finally, she and the surviving automatons stood surrounded by piles of punched-apart trees and smoldering wood. Chandra rubbed soot off her face and dusted her gloves. She looked around and spotted the smaller automaton who had saved her. He was shoving a fallen tree away from the edge of the excavation. She jogged over to him.\n\nHe straightened up and looked down at her. At that point, Chandra realized this couldn't be an automaton. His head and face were far more human-like than the others, more mobile. He said, \"Thank you for your help.\"\n\n\"You're welcome. Thanks for getting that one that snuck up on me.\" She thought it might take a little time to get used to his metal features. She could tell he was making expressions, they were just hard for her to read. \"You said somebody named Multani sent them after you?\" It belatedly occurred to Chandra that Multani might be the friend Jaya had come to meet, in which case Chandra had really screwed up her plan.\n\nThe metal person said, \"Multani is an elemental, and has been in a semiconscious state, recovering from terrible injuries. Animating these trees and sending them to attack us is an instinctive defensive action.\"\n\nThat was a relief. Jaya probably hadn't come to meet somebody who was mostly unconscious. \"I'm Chandra. I've been looking for , and the steward of Argive told me she was going to Yavimaya to look for a friend who was gone for a long time. You don't know who that is, do you?\"\n\nThe metal person tilted his head, and it was hard to tell but Chandra thought his expression might be ironic. He said, \"I'm Karn. And I am someone who has been gone for a long time.\"\n\n\"Is Jaya here\u2014\" Chandra started to say, then someone behind her said, \"Well, fancy meeting me here.\"\n\nChandra spun around. stood there, wearing a leather and metal jerkin over her red robes. #emph[What's she doing on Dominaria?] was Chandra's first baffled thought. Then, #emph[Hold it, ] how#emph[ is she on Dominaria? She's not a Planeswalker. I didn't think she was a Planeswalker] . \"You can't be\u2014How did\u2014?\"\n\n lifted a brow, and pointed to Jaya's goggles hanging from Chandra's belt. She said, \"I believe those are mine.\"\n\n#figure(image(\"008_Return to Dominaria: Episode 8/10.jpg\", width: 100%), caption: [Jaya Ballard | Art by uve], supplement: none, numbering: none)\n" }, { "repo": "https://github.com/lucannez64/Notes", "file": "https://raw.githubusercontent.com/lucannez64/Notes/master/Buy_List.typ", "language": "typst", "license": "", "content": "#import \"template.typ\": *\n\n// Take a look at the file `template.typ` in the file panel\n// to customize this template and discover how it works.\n#show: project.with(\n title: \"Buy List\",\n authors: (\n \"\",\n ),\n date: \"27 D\u00e9cembre, 2023\",\n)\n\n#set heading(numbering: \"1.1.\")\n\n- #link(\"https://www.amazon.fr/gp/product/B07PPY9N62/ref=ewc_pr_img_1?smid=AXZ3JQ1GVFPIF&th=1\")[USB C cable]\n- HDD/SDD backup\n #link(\"https://www.amazon.fr/Seagate-St2000dmz08-Barracuda-Disque-Interne-Argent/dp/B07H2RR55Q/ref=sr_1_2_sspa?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&keywords=hdd%2B1to&sr=8-2-spons&ufe=app_do%3Aamzn1.fos.49fccda8-a887-4188-817b-b9a64bb30e43&sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&th=1\")[HDD]\n- Keyboard\n- #link(\"https://www.amazon.fr/TP-Link-Adaptateur-UB500-imprimantes-smartphone/dp/B098K3H92Z/ref=sr_1_9?keywords=wifi+bluetooth+usb&sr=8-9\")[Bluetooth dongle]\n- #link(\"https://www.amazon.fr/Shure-Circum-Auriculaire-Monitoring-Enregistrement-Fr%C3%A9quencielle/dp/B09MV338KK/ref=sr_1_1?geniuslink=true&keywords=shure%2Bsrh440a%2Bover%2Bear%2Bwired%2Bheadphones%2Bfor%2Bmonitoring%2Brecording%2Bprofessional%2Bstudio%2Bgrade%2Benhanced%2Bfrequency%2Bresponse%2Bwork%2Bwith%2Ball%2Baudio%2Bdevices%2Badjustable%2Bcollapsible%2Bdesign%2B2022%2Bversion&sr=8-1&ufe=app_do%3Aamzn1.fos.49fccda8-a887-4188-817b-b9a64bb30e43&th=1\")[Headset]\n- #link(\"https://www.amazon.fr/dp/B09MHRYY5C/ref=emc_b_5_t\")[Mic]\n" }, { "repo": "https://github.com/k0tran/typst", "file": "https://raw.githubusercontent.com/k0tran/typst/sisyphus/vendor/hayagriva/README.md", "language": "markdown", "license": "", "content": "# Hayagriva\n\n[![Build status](https://github.com/typst/hayagriva/workflows/Continuous%20integration/badge.svg)](https://github.com/typst/hayagriva/actions)\n[![Current crates.io release](https://img.shields.io/crates/v/hayagriva)](https://crates.io/crates/hayagriva)\n[![Documentation](https://img.shields.io/badge/docs.rs-hayagriva-66c2a5?labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,xl)](https://docs.rs/hayagriva/)\n\nRusty bibliography management.\n\nHayagriva is a tool that can help you or your apps deal with literature and\nother media. Its features include:\n\n- Data structures for literature collections\n- Reading and writing said collections from YAML files\n- Formatting literature into reference list entries and in-text citations as\n defined by popular style guides\n- Interoperability with BibTeX\n- Querying your literature items by type and available metadata\n\nHayagriva can be used both as a library and as a Command Line Interface (CLI).\nSkip to the [section \"Usage\"](#usage) for more information about usage in your\napplication or to the [section \"Installation\"](#installation) to learn about how\nto install and use Hayagriva on your terminal.\n\n## Supported styles\n\nHayagriva supports all styles provided in the\n[official Citation Style Language repository](https://github.com/citation-style-language/styles),\ncurrently over 2,600.\n\n# Usage\n\n```rust\nuse hayagriva::io::from_yaml_str;\n\nlet yaml = r#\"\ncrazy-rich:\n type: Book\n title: Crazy Rich Asians\n author: \n date: 2014\n publisher: Anchor Books\n location: New York, NY, US\n\"#;\n\n// Parse a bibliography\nlet bib = from_yaml_str(yaml).unwrap();\nassert_eq!(bib.get(\"crazy-rich\").unwrap().date().unwrap().year, 2014);\n\n// Format the reference\nuse std::fs;\nuse hayagriva::{\n BibliographyDriver, BibliographyRequest, BufWriteFormat,\n CitationItem, CitationRequest,\n};\nuse hayagriva::citationberg::{LocaleFile, IndependentStyle};\n\nlet en_locale = fs::read_to_string(\"tests/data/locales-en-US.xml\").unwrap();\nlet locales = [LocaleFile::from_xml(&en_locale).unwrap().into()];\n\nlet style = fs::read_to_string(\"tests/data/art-history.csl\").unwrap();\nlet style = IndependentStyle::from_xml(&style).unwrap();\n\nlet mut driver = BibliographyDriver::new();\n\nfor entry in bib.iter() {\n let items = vec![CitationItem::with_entry(entry)];\n driver.citation(CitationRequest::from_items(items, &style, &locales));\n}\n\nlet result = driver.finish(BibliographyRequest {\n style: &style,\n locale: None,\n locale_files: &locales,\n});\n\nfor cite in result.citations {\n println!(\"{}\", cite.citation.to_string())\n}\n```\n\nTo format entries, you need to wrap them in a `CitationRequest`. Each of these\ncan reference multiple entries in their respective `CitationItem`s.\nUse these with a `BibliographyDriver` to obtain formatted citations and bibliographies.\n\nYou can either supply your own CSL files or choose from about 100 bundled\ncitation styles using the `archive` feature.\n\nIf the default features are enabled, Hayagriva supports BibTeX and BibLaTeX\nbibliographies. You can use `io::from_biblatex_str` to parse such\nbibliographies.\n\nShould you need more manual control, the library's native `Entry` struct also\noffers an implementation of the `From<&biblatex::Entry>`-Trait. You will need to\ndepend on the [biblatex](https://docs.rs/biblatex/latest/biblatex/) crate to\nobtain its `Entry`. Therefore, you could also use your BibLaTeX content like\nthis:\n\n```rust\nuse hayagriva::Entry;\nlet converted: Entry = your_biblatex_entry.into();\n```\n\nIf you do not need BibLaTeX compatibility, you can use Hayagriva without the\ndefault features by writing this in your `Cargo.toml`:\n\n```toml\n[dependencies]\nhayagriva = { version = \"0.2\", default-features = false }\n```\n\n### Selectors\n\nHayagriva uses a custom selector language that enables you to filter\nbibliographies by type of media. For more information about selectors, refer to\nthe [selectors.md\nfile](https://github.com/typst/hayagriva/blob/main/docs/selectors.md). While you\ncan parse user-defined selectors using the function `Selector::parse`, you may\ninstead want to use the selector macro to avoid the run time cost of parsing a\nselector when working with constant selectors.\n\n```rust\nuse hayagriva::select;\nuse hayagriva::io::from_yaml_str;\n\nlet yaml = r#\"\nquantized-vortex:\n type: Article\n author: .\n title: Structure of a Quantized Vortex in Boson Systems\n date: 1961-05\n page-range: 454-477\n doi: 10.1007/BF02731494\n parent:\n issue: 3\n volume: 20\n title: Il Nuovo Cimento\n\"#;\n\nlet entries = from_yaml_str(yaml).unwrap();\nlet journal = select!((Article[\"date\"]) > (\"journal\":Periodical));\nassert!(journal.matches(entries.nth(0).unwrap()));\n```\n\nThere are two ways to check if a selector matches an entry.\nYou should use [`Selector::matches`] if you just want to know if an item\nmatches a selector and [`Selector::apply`] to continue to work with the data from\nparents of a matching entry. Keep in mind that the latter function will\nreturn `Some` even if no sub-entry was bound / if the hash map is empty.\n\n## Installation\n\nRun this in your terminal:\n```bash\ncargo install hayagriva --features cli\n```\n\nCargo will install the Hayagriva Command Line Interface for you. Now, you just\nneed a Hayagriva YAML literature file or a Bib(La)TeX file to get started. The\nHayagriva YAML file is intuitive to write and can represent a wealth of media\ntypes, [learn how to write one in its dedicated\ndocumentation.](https://github.com/typst/hayagriva/blob/main/docs/file-format.md)\n\nSuppose you have this file saved as `literature.yml` in your current working\ndirectory:\n\n```yaml\ndependence:\n type: Article\n title: The program dependence graph and its use in optimization\n author: [\"\", \".\", \".\"]\n date: 1987-07\n serial-number:\n doi: \"10.1145/24039.24041\"\n parent:\n type: Periodical\n title: ACM Transactions on Programming Languages and Systems\n volume: 9\n issue: 3\n\nfeminism:\n type: Article\n title: She swoons to conquer\n author: \n editor: \n date: 2015-09-25\n url: https://aeon.co/essays/can-you-enjoy-romance-fiction-and-be-a-feminist\n parent:\n type: Blog\n title: Aeon\n```\n\nYou can then issue the following command to get reference list entries for both\nof these articles.\n```bash\nhayagriva literature.yml reference\n```\n\nHayagriva defaults to the Author-Date style of the Chicago Manual of Style (17th\nedition). If you prefer to use another style, you can, for example, do the\nfollowing to use the style of the American Psychological Association instead:\n```bash\nhayagriva literature.yml reference --style apa\n```\n\nAvailable values for the `--style` argument can be viewed by calling\n`hayagriva help reference`.\n\nIf you now need an in-text citation to the second article in the above file, you\ncan call:\n```bash\nhayagriva literature.yml cite --key feminism\n```\n\nThe `--key` takes a comma-separated list of keys (or a single one). The\nsub-command will then only work on the specified keys. Just like the `reference`\nsub-command, the `cite` command also allows the `--style` argument. Its possible\nvalues can be viewed with `hayagriva help cite`. It will default to the _Author\nDate_ style.\n\nInstead of the `--key` argument, you can also use `--select` to provide a custom\n[Hayagriva selector.](https://github.com/typst/hayagriva/blob/main/docs/selectors.md)\nFor example, you could run the following to only reference entries that have a\nURL or DOI at the top level:\n```bash\nhayagriva literature.yml --select \"*[url] | *[doi]\" reference\n```\n\nThis expression would match both entries in our example and therefore the\ncommand would return the same result as the first reference command.\n\nHayagriva also allows you to explore which values were bound to which\nsub-entries if the selector matches. This is especially useful if you intend to\nconsume Hayagriva as a dependency in your application and need to debug an\nexpression. Consider this selector which always binds the sub-entry with the\nvolume field to `a`, regardless of if it occurred at the top level or in the\nfirst parent: `a:*[volume] | * > a:[volume]`. You can then use the command below\nto show which sub-entry the selector bound as `a` for each match:\n```bash\nhayagriva literature.yml --select \"a:*[volume] | * > a:[volume]\" --show-bound\n```\n\nThe `--show-bound` flag shows all keys matching the selector or key filter and\ndetails which sub-entries of each entry were bound by the selector. If, instead,\nyou only want to obtain a list of matching keys, use the `--keys` flag.\n\nIf you are working with BibTeX, you can use your `.bib` file with Hayagriva just\nlike you would use a `.yml` file. If you want to convert your `.bib` file to a\n`.yml` file, you can simply pass the `.bib` file to the CLI without any additional\narguments. It will then show the YAML-formatted bibliography with key and selector\nfilters applied on standard output. If you therefore want to convert your `.bib`\nfile and save the result somewhere, you can just use `>`:\n```bash\nhayagriva literature.bib > converted.yml\n```\n\n## Contributing\n\nWe are looking forward to receiving your bugs and feature requests in the Issues\ntab. We would also be very happy to accept PRs for bug fixes, minor\nrefactorings, features that were requested in the issues and greenlit by us, as\nwell as the planned features listed below:\n\n- Implementing the YAML-to-BibLaTeX conversion\n- Documentation improvements\n- CSL bugfixes\n- CSL-M Support\n\nWe wish to thank each and every prospective contributor for the effort you (plan\nto) invest in this project and for adopting it!\n\n## License\n\nHayagriva is licensed under a MIT / Apache 2.0 dual license.\n\nUsers and consumers of the library may choose which of those licenses they want\nto apply whereas contributors have to accept that their code is in compliance\nand distributed under the terms of both of these licenses.\n\nHayagriva includes CSL styles that are licensed as CC-BY-SA 3.0 Deed if the\n`archive` feature is enabled. The file `styles.cbor.rkyv` is a collection of\nthese works and falls under this license. Retrieve attribution information by\ndeserializing it using the `styles` function and reading the `StyleInfo`\nstructs.\n" }, { "repo": "https://github.com/markcda/unitech-typst", "file": "https://raw.githubusercontent.com/markcda/unitech-typst/master/00-university-template.typ", "language": "typst", "license": "MIT License", "content": "// \u0421\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0438\u0442\u0443\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u0441\u0442.\n#let mk_title_page(\n header: \"\",\n department_name: \"\",\n institute_name: \"\",\n work_type: \"\",\n discipline_name: \"\",\n theme: none,\n author: (),\n adviser: (),\n city: \"\",\n year: \"\",\n) = {\n // \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442 \u0438 \u043a\u0430\u0444\u0435\u0434\u0440\u0443.\n set align(center)\n set text(weight: \"bold\")\n image(header, width: 100%)\n linebreak()\n upper(institute_name)\n linebreak()\n linebreak()\n upper(department_name)\n // \u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b, \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u0443 \u0438 \u0442\u0435\u043c\u0443.\n set align(center + horizon)\n upper(work_type)\n linebreak()\n [\n \u043f\u043e \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u0435 \"#discipline_name\"\n ]\n if theme != none {\n linebreak()\n linebreak()\n set text(weight: \"regular\")\n theme\n }\n set align(bottom)\n set align(right)\n set text(weight: \"bold\")\n if author.sex == \"male\" [\n \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043b:\n ] else [\n \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430:\n ]\n linebreak()\n set text(weight: \"regular\")\n [#author.degree \u0433\u0440\u0443\u043f\u043f\u044b #author.group]\n linebreak()\n author.nwa\n linebreak()\n linebreak()\n set text(weight: \"bold\")\n if adviser.sex == \"male\" [\n \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043b:\n ] else [\n \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0430:\n ]\n linebreak()\n set text(weight: \"regular\")\n adviser.degree\n linebreak()\n adviser.nwa\n linebreak()\n linebreak()\n linebreak()\n set align(center)\n [#city #year \u0433.]\n}\n\n// \u0421\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b.\n#let mk_table_of_contents() = {\n {\n set align(center)\n set text(16pt, weight: \"bold\")\n [\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435]\n }\n set align(left)\n outline(\n title: [],\n indent: auto,\n )\n}\n\n// \u0421\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443.\n#let student_work(\n title: \"\",\n header: \"\",\n department_name: \"\",\n institute_name: \"\",\n work_type: \"\",\n discipline_name: \"\",\n theme: \"\",\n author: (),\n adviser: (),\n city: \"\",\n year: \"\",\n table_of_contents: false,\n links: (),\n content,\n) = {\n set document(author: author.name, title: title)\n set page(\n paper: \"a4\",\n margin: (left: 30mm, right: 15mm, top: 15mm, bottom: 15mm),\n )\n set text(font: \"Times New Roman\", size: 14pt, lang: \"ru\")\n mk_title_page(\n header: header,\n department_name: department_name,\n institute_name: institute_name,\n work_type: work_type,\n discipline_name: discipline_name,\n theme: theme,\n author: author,\n adviser: adviser,\n city: city,\n year: year,\n )\n set page(numbering: \"1\")\n if table_of_contents == true {\n mk_table_of_contents()\n }\n // \u041f\u043e\u043a\u0430\u0436\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0440\u0430\u0431\u043e\u0442\u044b.\n {\n let indent = 1.25cm\n show heading: it => {\n pagebreak()\n set align(center)\n set text(16pt, hyphenate: false)\n it\n par(text(size: 0.35em, h(0.0em)))\n }\n set par(justify: true, first-line-indent: indent)\n set list(indent: indent)\n show list: it => {\n it\n par(text(size: 0.35em, h(0.0em)))\n }\n set enum(indent: indent)\n show enum: it => {\n it\n par(text(size: 0.35em, h(0.0em)))\n }\n content\n }\n if links.len() != 0 {\n pagebreak()\n show heading: set align(center)\n set heading(numbering: none)\n [= \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438]\n linebreak()\n let src_cntr = counter(\"source_counter\")\n src_cntr.step()\n for source in links {\n src_cntr.display()\n [. ]\n if source.type == \"book\" {\n [#source.author - ]\n }\n source.title\n [. ]\n if source.type == \"web\" {\n [\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441. \u0420\u0435\u0436\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430: ]\n link(source.link)[#source.link]\n [ (\u0434\u0430\u0442\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f: ]\n source.access_date\n [).]\n } else if source.type == \"book\" {\n [\u0418\u0437\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \"]\n source.publisher\n [\", ]\n source.year\n [ \u0433.]\n }\n src_cntr.step()\n linebreak()\n }\n }\n}\n" }, { "repo": "https://github.com/Error-418-SWE/Documenti", "file": "https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/1%20-%20Candidatura/Verbali/Interni/30-10-23/30-10-23.typ", "language": "typst", "license": "", "content": "ERROR\\_418 \\\nVerbale 30/10/23\n\n#figure(\nalign(center)[#table(\n columns: 2,\n align: (col, row) => (left,left,).at(col),\n inset: 6pt,\n [Mail:],\n [],\n [Redattori:],\n [, ],\n [Verificatori:],\n [, , ],\n [Amministratori:],\n [, ],\n [Destinatari:],\n [, ],\n)]\n)\n\n#figure(\nalign(center)[#table(\n columns: 2,\n align: (col, row) => (center,center,).at(col),\n inset: 6pt,\n [Inizio Meeting: 14:30 Fine Meeting: 18:30 Durata: 4:00h],\n [],\n [Presenze:],\n [],\n)]\n)\n\n#block[\n#figure(\nalign(center)[#table(\n columns: 5,\n align: (col, row) => (center,center,center,center,center,).at(col),\n inset: 6pt,\n [Nome], [Durata Presenza], [], [Nome], [Durata Presenza],\n [Antonio],\n [4:00h],\n [],\n [Alessio],\n [4:00h],\n [Riccardo],\n [4:00h],\n [],\n [Giovanni],\n [4:00h],\n [Rosario],\n [4:00h],\n [],\n [Silvio],\n [4:00h],\n [Mattia],\n [4:00h],\n [],\n [],\n [],\n)]\n)\n\n]\nOrdine del giorno:\n\n- Analisi carico di lavoro per la stesura del Preventivo Costi;\n\n- Redazione del preventivo dei costi;\n\n- Finalizzazione redazione Lettera di presentazione;\n\n- Finalizzazione redazione Valutazione dei Capitolati;\n\n- Organizzazione gruppi di lavoro per la revisione finale dei documenti,\n quali:\n\n - Verbali interni;\n\n - Verbali esterni;\n\n - Valutazione dei Capitolati;\n\n - Lettera di presentazione.\n\n- Riorganizzazione repo.\n\nA fini organizzativi, il team, a seguito dell\u2019analisi congiunta riguardo\nil carico di lavoro e alla revisione della lettera di presentazione, si\n\u00e8 diviso in sotto gruppi per lavorare in contemporanea su documenti e\naspetti diversi. \\\nI gruppi formatisi prevedono:\n\n- Primo sotto gruppo: 3 membri -\\> revisione Valutazione capitolati;\n\n- Secondo sotto gruppo: 2 membri -\\> revisione Capitolati 17,18,21\n ottobre;\n\n- Terzo sotto gruppo: 2 membri -\\> revisione Capitolati 25,26,29\n ottobre.\n\n= Analisi carico di lavoro\n\nAl fine di redigere il preventivo dei costi, \u00e8 stata necessaria\nun\u2019accurata analisi del carico di lavoro e del monte ore necessario.\nL\u2019idea alla base dell\u2019organizzazione del lavoro \u00e8 stata la suddivisione\ndel periodo di sviluppo \\(Novembre - Marzo) in tre sotto-periodi che\naffronteranno aspetti diversi ma fondamentali del prodotto, quali:\n\n- Periodo di Analisi dei Requisiti;\n\n- Periodo per PoC e RTB;\n\n- Periodo per PB.\n\nCosti e ore sono stati stabiliti mediante la realizzazione di una\ntabella su Google Sheet in modo collaborativo con tutti i membri del\ngruppo.\n\n= Redazione documenti\n\n== Preventivo Costi\n\nA seguito dell\u2019analisi precedente e delle decisioni riguardo ore e\ncosti, si \u00e8 redatto il documento relativo al Preventivo dei Costi.\n\n== Lettera di presentazione\n\nDopo una revisione collettiva, si \u00e8 proseguito con la finalizzazione\ndella Lettera di presentazione, con l\u2019aggiunta del link alla repo github\ndei documenti \\(link al ramo main) e aggiunta del prezzo preventivato.\n\n== Valutazione Capitolati\n\nUno dei sotto gruppi formati si \u00e8 occupato della revisione,\nriorganizzazione e finalizzazione del documento relativo alla\nvalutazione complessiva dei nove capitolati. Il documento, risultando\ncorposo e denso di analisi, ha richiesto una discreta quantit\u00e0 di tempo\nper essere redatto e validato, prestando attenzione ad includere le\nrisposte ricevute da tutte e nove le aziende proponenti.\n\n== Revisione Documenti\n\nI due sotto gruppi impegnati nella revisione dei verbali hanno svolto un\ncompleto lavoro di revisione e analisi di correttezza dei verbali fino a\nquel momento redatti. Questa fase, a causa di un mancato salvataggio dei\nfile .tex di latex, ha purtroppo visto una nuova stesura completa di\nalcuni verbali anche per piccole correzioni. Le nuove versioni dei\nverbali rimangono pur sempre una fedele ritrascrizione dei verbali\noriginali, senza modificarne il contenuto, ma migliorandone la stesura,\nrimuovendo eventuali errori ortografici e non. \\\nTerminata la revisione e la redazione dei verbali, si \u00e8 susseguita\nun\u2019ulteriore revisione di conferma della documentazione rimanente, come\nla lettera di presentazione e la valutazione dei capitolati \\(documento\nterminato durante lo svolgersi di queste revisioni).\n\n== Riorganizzazione Repo\n\nTerminata la redazione dei documenti e la loro revisione il gruppo ha\npotenzialmente tutto il necessario per procedere alla candidatura. In\nquesto modo, possedendo ora i file ufficiali e revisionati che saranno\noggetto di consegna, \u00e8 stato possibile riorganizzare la repo al fine di\neliminare evetuali branch secondari e concludere le pull request, in\nmodo da riunire tutti i documenti prodotti dai vari branch creati al\nramo Develop, in attesa di unirli successivamente al ramo Main.\n" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/spread-11.typ", "language": "typst", "license": "Other", "content": "// Error: 5-11 cannot spread array into dictionary\n#(..(1, 2), a: 1)\n\n" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/ops-00.typ", "language": "typst", "license": "Other", "content": "// Test adding content.\n// Ref: true\n#([*Hello* ] + [world!])\n\n" }, { "repo": "https://github.com/RandomcodeDev/FalseKing-Design", "file": "https://raw.githubusercontent.com/RandomcodeDev/FalseKing-Design/main/engine/tools.typ", "language": "typst", "license": "", "content": "= Tools\n#table(\n columns: 3,\n [*Tool*], [*Use*], [*Custom made?*],\n [#link(\"https://xmake.io\")[xmake]], [Build system], [no],\n [#link(\"https://visualstudio.microsoft.com\")[Visual Studio 2022]], [Code editing, debugging (Windows, consoles)], [no],\n [#link(\"https://code.visualstudio.com\")[Visual Studio Code]/#link(\"https://neovim.io\")[Neovim]], [Code editing (non-Windows)], [no],\n [#link(\"https://www.sourceware.org/gdb\")[GDB]/#link(\"https://lldb.llvm.org\")[LLDB]], [Debugging (non-Windows)], [no],\n [#link(\"https://github.com/microsoft/DirectXShaderCompiler\")[DXC]], [Shader compiler], [no],\n [#link(\"https://github.com/KhronosGroup/spirv-cross\")[spirv-cross]], [Shader converter], [no]\n)\n" }, { "repo": "https://github.com/Origami404/kaoyan-shuxueyi", "file": "https://raw.githubusercontent.com/Origami404/kaoyan-shuxueyi/main/\u5fae\u79ef\u5206/04-\u4e00\u5143\u5fae\u5206\u65b9\u7a0b.typ", "language": "typst", "license": "", "content": "#import \"../template.typ\": sectionline, gray_table, colored\n#let dx = $dif x$\n#let dy = $dif y$\n#let dp = $dif p$\n#let dt = $dif t$\n#let _to_ = $quad => quad$\n#let __to__ = $quad #_to_ quad$\n\n= \u4e00\u5143\u5fae\u5206\u65b9\u7a0b\n\n== \u6742\u9c7c\u4e00\u9636\u5fae\u5206\u65b9\u7a0b (\u53ef\u5206\u79bb\u53d8\u91cf)\n\n\u5982\u679c\u53ef\u4ee5\u628a\u542b $y$ \u7684\u90e8\u5206\u90fd\u8d76\u5230 $dy$ \u524d\u9762, \u542b $x$ \u7684\u90e8\u5206\u90fd\u8d76\u5230 $dx$ \u524d\u9762, \u90a3\u4e48\u76f4\u63a5\u5de6\u53f3\u4e24\u8fb9\u79ef\u5206\u5c31\u53ef\u4ee5\u89e3\u4e86.\n\n\u6709\u65f6\u5019\u8981\u6ce8\u610f\u770b\u5f62\u5982 $y dx + x dy$ \u7684\u90e8\u5206, \u5b83\u53ef\u4ee5\u5408\u6210 $dif (x y)$, \u6709\u65f6\u5019\u8fd9\u6837\u4ee3\u6362\u4e00\u4e0b\u5c31\u53ef\u4ee5\u63a5\u7740\u89e3.\n\n== \u4e00\u9636\u9f50\u6b21\u65b9\u7a0b\n\n\u7279\u5f81\u4e3a\u65b9\u7a0b\u7684\u6bcf\u4e2a\u9879\u91cc $y$ \u548c $x$ \u7684\u603b\u9636\u6570\u662f\u4e00\u6837\u7684, \u8fd9\u610f\u5473\u7740\u53ef\u4ee5\u4e24\u8fb9\u9664\u4ee5 $x$ \u518d\u6574\u7406\u6210\u5de6\u8fb9\u8fd9\u6837:\n\n$ \ny' = phi (y / x) #__to__ dp / (phi(p) - p) = dx / x \n$\n\n\u5982\u679c\u5e0c\u671b\u505a\u5f97\u5feb, \u53ef\u4ee5\u80cc\u4e00\u4e0b\u53f3\u8fb9\u7684\u4ee3\u6362\u540e\u7ed3\u679c.\n\n== \u4e00\u9636\u7ebf\u6027\u65b9\u7a0b\n\n\u4e0d\u540c\u4e8e\u9ad8\u9636\u60c5\u51b5, \u4e00\u9636\u65b9\u7a0b\u5373\u4f7f\u4e0d\u662f\u5e38\u7cfb\u6570\u7684\u4e5f\u53ef\u4ee5\u89e3:\n\n$\ny' + p y = q #__to__ y = e^(-P) (integral e^P q \" \" dx + C)\n$\n\n\u5176\u4e2d\u5927 $P$ \u662f\u5c0f $p$ \u7684\u539f\u51fd\u6570, \u5373 $P = integral p \" \" dx$. \n\n\u5728\u5957\u516c\u5f0f\u7684\u65f6\u5019\u8981\u7279\u522b\u6ce8\u610f $p$ \u6709\u65f6\u5019\u662f\u5e26\u7740\u8d1f\u53f7\u7684, \u4e0d\u8981\u4e22\u4e86.\n\n== \u4f2f\u52aa\u5229\u65b9\u7a0b\n\n\u5982\u679c\u4e00\u9636\u65b9\u7a0b\u91cc\u7684 \"\u81ea\u7531\u9879\" \u591a\u4e86\u4e00\u4e2a $y^n$, \u90a3\u4e48\u53ef\u4ee5\u5de6\u53f3\u9664\u4ee5 $y^n$ \u518d\u505a\u4ee3\u6362 $z = y^(1 - n)$, \u7136\u540e\u5f0f\u5b50\u5c31\u53ef\u4ee5\u53d8\u6210\u4e00\u9636\u7ebf\u6027\u65b9\u7a0b:\n\n$\ny' + p y = q y^n #__to__ z' + (1 - n) p z = (1 - n) q\n$\n\n== \u53ef\u964d\u9636\u7684\u4e8c\u9636\u65b9\u7a0b\n\n\u5982\u679c\u4e8c\u9636\u65b9\u7a0b\u91cc\u6ca1\u6709 $y$, \u53ea\u6709 $y''$, $y'$, $x$, \u90a3\u4e48\u53ef\u4ee5\u505a\u4ee3\u6362 $p = y'$, \u89c6\u4e3a $p$ \u4e0e $x$ \u7684\u4e00\u9636\u65b9\u7a0b.\n\n\u5982\u679c\u4e8c\u9636\u65b9\u7a0b\u91cc\u6ca1\u6709 $x$, \u53ea\u6709 $y''$, $y'$, $y$, \u90a3\u4e48\u540c\u6837\u53ef\u4ee5\u505a\u4ee3\u6362 $p = y'$, \u4f46\u6b64\u65f6\u8981\u89c6\u4e3a $p$ \u4e0e $y$ \u7684\u4e00\u9636\u65b9\u7a0b.\n\n== \u9ad8\u9636\u7ebf\u6027\u65b9\u7a0b\n\n=== \u4efb\u610f\u7cfb\u6570\u901a\u7528\u7ed3\u8bba\n\n\u5bf9\u4e8e\u9ad8\u9636\u7ebf\u6027\u65b9\u7a0b\u800c\u8a00, \u5b83\u7684\u89e3\u7684\u7ed3\u6784\u90fd\u662f\u4e00\u6837\u7684: \u975e\u9f50\u6b21\u901a\u89e3 = \u7ebf\u6027\u7ec4\u5408\u7684\u9f50\u6b21\u901a\u89e3 + \u975e\u9f50\u6b21\u7279\u89e3:\n\n$\nsum_(i=0)^(n) p_i y^((i)) = f #__to__ y = sum_(i=0)^(n) C_i y_i + y^* \n$\n\n\u6709\u65f6\u5019\u9898\u76ee\u4f1a\u7ed9\u4e00\u4e2a\u62bd\u8c61\u7684\u9ad8\u9636\u7ebf\u6027\u65b9\u7a0b\u7136\u540e\u8003\u8fd9\u4e2a\u5173\u7cfb, \u6bd4\u5982\u4e24\u4e2a\u975e\u9f50\u6b21\u901a\u89e3\u76f8\u51cf\u80fd\u5f97\u5230\u4ec0\u4e48\u4e4b\u7c7b\u7684.\n\n=== \u5e38\u7cfb\u6570 + \u9f50\u6b21\n\n\u5e38\u7cfb\u6570\u7684\u9ad8\u9636\u7ebf\u6027\u65b9\u7a0b\u662f\u6211\u4eec\u771f\u6b63\u80fd\u89e3\u7684\u65b9\u7a0b. \u9996\u5148\u6211\u4eec\u8981\u5199\u51fa\u5b83\u7684\u7279\u5f81\u591a\u9879\u5f0f\u65b9\u7a0b: #footnote()[\u4e3a\u4ec0\u4e48? \u53ef\u4ee5\u53c2\u8003: #link(\"https://zh.wikipedia.org/zh-cn/\u7ebf\u6027\u5fae\u5206\u65b9\u7a0b\") \u4e2d\u7684 \"\u6b27\u62c9\u6ce8\u610f\u5230...\" \u90e8\u5206]\n\n$\nsum_(i=0)^(n) p_i r^i = 0\n$\n\n\u5b83\u5728 $CC$ \u4e0a\u6709 $n$ \u4e2a\u590d\u6839 $z$. \u6bcf\u4e00\u4e2a\u90fd\u5bf9\u5e94\u4e00\u4e2a\u5f62\u5982 $e^(z x)$ \u7684\u89e3. \u989d\u5916\u8003\u8651\u91cd\u6839\u5e76\u4f7f\u7528\u6b27\u62c9\u516c\u5f0f\u6362\u6389\u590d\u6307\u6570, \u53ef\u4ee5\u5f97\u5230\u4ee5\u4e0b\u7ed3\u8bba:\n\n\u5bf9\u4e8e\u4e00\u4e2a $k$ \u91cd\u5b9e\u6839 $r = r_i$, \u5b83\u8d21\u732e\u4e00\u4e2a\u542b $k$ \u4e2a\u5f85\u5b9a\u7cfb\u6570\u7684\u901a\u89e3:\n\n$\ny = ( sum_(j=0)^(k-1) C_j x^j ) e^(r_i x)\n$\n\n\u5bf9\u4e8e\u4e00\u5bf9\u5171\u8f6d\u7684 $k$ \u91cd\u590d\u6839 $r = alpha plus.minus beta i$, \u5b83\u4eec\u4e00\u8d77\u8d21\u732e\u4e00\u4e2a\u542b $2k$ \u4e2a\u5f85\u5b9a\u7cfb\u6570\u7684\u901a\u89e3:\n\n$\ny = [( sum_(j=0)^(k-1) C^(+)_j x^j ) cos beta x + ( sum_(j=0)^(k-1) C^(-)_j x^j ) sin beta x] e^(alpha x)\n$\n\n=== \u5e38\u7cfb\u6570 + \u975e\u9f50\u6b21\n\n\u5bf9\u4e8e\u7279\u6b8a\u5f62\u5f0f\u7684\u975e\u9f50\u6b21\u9879, \u6211\u4eec\u53ef\u4ee5\u7528*\u5f85\u5b9a\u7cfb\u6570\u6cd5*\u6c42\u7279\u89e3:\n\n$\nf = p(x) e^(lambda x) #_to_ y^* = x^k Q_m (x) e^(lambda x) \\\nf = [p^+(x) cos omega x + p^-(x) sin omega x] e^(lambda x) #_to_ y^* = x^k [Q_m^+ (x) cos omega x + Q_m^- (x) sin omega x] e^(lambda x)\n$\n\n\u7279\u89e3\u7531\u4e09\u4e2a\u90e8\u5206\u7ec4\u6210\n\n#set list(marker: ([\u2925], [\u203a]))\n\n- $x^k$ \u662f\u91cd\u6839\u4fee\u6b63\u9879\n - \u5982\u679c $lambda$ \u6070\u597d\u662f\u7279\u5f81\u65b9\u7a0b\u7684 $k$ \u91cd\u6839, \u90a3\u4e48\u5c31\u8981\u591a\u4e00\u9879 $x^k$; \n - \u5982\u679c $lambda$ \u4e0d\u662f\u6839, \u90a3\u4e48 $k = 0$, $x^k = 1$ \u53ef\u76f4\u63a5\u7701\u7565.\n- $Q_m (x)$ \u662f\u4e00\u4e2a\u548c $p(x)$ \u9636\u6570\u76f8\u540c\u7684\u591a\u9879\u5f0f, \u7cfb\u6570\u5f85\u5b9a, \u7b49\u5f85\u4ee3\u56de\u539f\u5fae\u5206\u65b9\u7a0b\u6c42\u89e3.\n- $e^(lambda x)$ \u662f\u7279\u89e3\u5fc5\u987b\u5177\u6709\u7684\u5f62\u5f0f\n\n== \u6b27\u62c9\u65b9\u7a0b\n\n\u5982\u679c\u4e00\u4e2a\u65b9\u7a0b\u5f88\u50cf\u5e38\u7cfb\u6570\u7ebf\u6027\u65b9\u7a0b, \u4f46\u662f\u6bcf\u4e2a\u9879\u5374\u591a\u4e86\u4e00\u4e2a $x^i$, \u90a3\u4e48\u5b83\u5c31\u662f\u6b27\u62c9\u65b9\u7a0b, \u53ef\u7528 $x = e^t$ \u4ee3\u6362:\n\n$\nsum_(i=0)^(n) a_i y^((i)) colored(x^i) = 0\n$\n\n\u4ee3\u6362\u540e\u7684\u65b9\u7a0b\u4f1a\u628a $x^i$ \u90fd\u6d88\u53bb, \u53d8\u6210\u4e00\u4e2a\u5173\u4e8e $y$ \u548c $t$ \u7684\u5e38\u7cfb\u6570\u7ebf\u6027\u65b9\u7a0b.\n\n#pagebreak()\n" }, { "repo": "https://github.com/kilpkonn/typst-thesis", "file": "https://raw.githubusercontent.com/kilpkonn/typst-thesis/main/README.md", "language": "markdown", "license": "MIT License", "content": "# Typst thesis template for TalTech\n\nSee rendered [here](https://typst.app/project/rtvks-u_zE10N8kJMXSWpc)\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz-plot/0.1.0/src/chart/barchart.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"/src/cetz.typ\": draw, styles, palette\n\n#import \"/src/plot.typ\"\n\n#let barchart-default-style = (\n axes: (tick: (length: 0), grid: (stroke: (dash: \"dotted\"))),\n bar-width: .8,\n cluster-gap: 0,\n error: (\n whisker-size: .25,\n ),\n y-inset: 1,\n)\n\n/// Draw a bar chart. A bar chart is a chart that represents data with\n/// rectangular bars that grow from left to right, proportional to the values\n/// they represent.\n///\n/// = Styling\n/// *Root*: `barchart`.\n/// #show-parameter-block(\"bar-width\", \"float\", default: .8, [\n/// Width of a single bar (basic) or a cluster of bars (clustered) in the plot.])\n/// #show-parameter-block(\"y-inset\", \"float\", default: 1, [\n/// Distance of the plot data to the plot's edges on the y-axis of the plot.])\n/// You can use any `plot` or `axes` related style keys, too.\n///\n/// The `barchart` function is a wrapper of the `plot` API. Arguments passed\n/// to `..plot-args` are passed to the `plot.plot` function.\n///\n/// - data (array): Array of data rows. A row can be of type array or\n/// dictionary, with `label-key` and `value-key` being\n/// the keys to access a rows label and value(s).\n///\n/// *Example*\n/// ```typc\n/// (([A], 1), ([B], 2), ([C], 3),)\n/// ```\n/// - label-key (int,string): Key to access the label of a data row.\n/// This key is used as argument to the\n/// rows `.at(..)` function.\n/// - value-key (int,string): Key(s) to access values of a data row.\n/// These keys are used as argument to the\n/// rows `.at(..)` function.\n/// - error-key (none,int,string): Key(s) to access error values of a data row.\n/// These keys are used as argument to the\n/// rows `.at(..)` function.\n/// - mode (string): Chart mode:\n/// / basic: Single bar per data row\n/// / clustered: Group of bars per data row\n/// / stacked: Stacked bars per data row\n/// / stacked100: Stacked bars per data row relative\n/// to the sum of the row\n/// - size (array): Chart size as width and height tuple in canvas unist;\n/// width can be set to `auto`.\n/// - bar-style (style,function): Style or function (idx => style) to use for\n/// each bar, accepts a palette function.\n/// - y-label (content,none): Y axis label\n/// - x-label (content,none): x axis label\n/// - labels (none,content): Legend labels per x value group\n/// - ..plot-args (any): Arguments to pass to `plot.plot`\n#let barchart(data,\n label-key: 0,\n value-key: 1,\n error-key: none,\n mode: \"basic\",\n size: (auto, 1),\n bar-style: palette.red,\n x-label: none,\n x-format: auto,\n y-label: none,\n labels: none,\n ..plot-args\n ) = {\n assert(type(label-key) in (int, str))\n if mode == \"basic\" {\n assert(type(value-key) in (int, str))\n } else {\n assert(type(value-key) == array)\n }\n\n if type(value-key) != array {\n value-key = (value-key,)\n }\n\n if error-key == none {\n error-key = ()\n } else if type(error-key) != array {\n error-key = (error-key,)\n }\n\n if type(size) != array {\n size = (size, auto)\n }\n if size.at(1) == auto {\n size.at(1) = (data.len() + 1)\n }\n\n let y-tic-list = data.enumerate().map(((i, t)) => {\n (data.len() - i - 1, t.at(label-key))\n })\n\n let x-format = x-format\n if x-format == auto {\n x-format = if mode == \"stacked100\" {plot.formats.decimal.with(suffix: [%])} else {auto}\n }\n\n data = data.enumerate().map(((i, d)) => {\n (data.len() - i - 1, value-key.map(k => d.at(k, default: 0)).flatten(), error-key.map(k => d.at(k, default: 0)).flatten())\n })\n\n draw.group(ctx => {\n let style = styles.resolve(ctx.style, merge: (:),\n root: \"barchart\", base: barchart-default-style)\n draw.set-style(..style)\n\n let y-inset = calc.max(style.y-inset, style.bar-width / 2)\n plot.plot(size: size,\n axis-style: \"scientific-auto\",\n x-label: x-label,\n x-grid: true,\n x-format: x-format,\n y-label: y-label,\n y-min: -y-inset,\n y-max: data.len() + y-inset - 1,\n y-tick-step: none,\n y-ticks: y-tic-list,\n plot-style: bar-style,\n ..plot-args,\n {\n plot.add-bar(data,\n x-key: 0,\n y-key: 1,\n error-key: if mode in (\"basic\", \"clustered\") { 2 },\n mode: mode,\n labels: labels,\n bar-width: -style.bar-width,\n cluster-gap: style.cluster-gap,\n axes: (\"y\", \"x\"))\n })\n })\n}\n" }, { "repo": "https://github.com/polarkac/MTG-Stories", "file": "https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/035%20-%20Core%202019/007_Chronicle%20of%20Bolas%3A%20Perspectives.typ", "language": "typst", "license": "", "content": "#import \"@local/mtgstory:0.2.0\": conf\n#show: doc => conf(\n \"Chronicle of Bolas: Perspectives\",\n set_name: \"Core 2019\",\n story_date: datetime(day: 08, month: 08, year: 2018),\n author: \"\",\n doc\n)\n\nNaiva gripped her spear, leaning on it so she would not collapse from sheer stark terror. The huge dragon filled half the sky, blocking the canyon walls. He floated there effortlessly, his expression amused at her pathetic attempt to look bold.\n\n\"Little one, you cannot defy me, much less defeat me. But with my help, you can rule this sad little world and make it your own to do with as you wish. Just tell me where Ugin is, and why these hedrons have filled the place he fell.\"\n\nHer throat was so dry the words came out in a croak. \"Why do you hate Ugin? He's your twin.\"\n\nThe great dragon recoiled, a blast of angry fire roaring over her head. Sparks rained down upon the hedrons that concealed the Spirit Dragon's skeleton, but the flames and glowing ash slid harmlessly off the hard surface.\n\n\"He's no twin of mine. That's just a story he put about, trying to grab for a share of my glory and my triumph.\"\n\nNaiva cared nothing for Ugin; she'd never met him, and she couldn't imagine any dragon could be a friend to humankind, even if people like her grandmother and Tae Jin's master called him the soul of Tarkir. Yet a seed of strength unfurled in her heart. Somehow, amazingly, this powerful dragon did not know Ugin's body lay concealed beneath the hedrons. That meant he couldn't see Baishya where she lay lost in a helpless trance. The thought of her twin dying filled her heart with such dread that it fueled a recklessly fierce determination. For once, her spear was of no use. She had to find another way.\n\n\"You are ,\" she said, trying to piece together what she'd learned from the stories and memories.\n\nHe smiled. \"Of course I am. Who else could I be?\"\n\nIf he was as the stories claimed, he would be able to get into her mind. Probably he already had. Once he picked through her thoughts, he'd realize Yasova Dragonclaw was right in front of him. Her only hope was to distract him. Hadn't Ugin said not ever to make him angry? If he killed her, then at least she couldn't betray her loved ones.\n\n#figure(image(\"007_Chronicle of Bolas: Perspectives/01.jpg\", width: 100%), caption: [, the Arisen | Art by: ], supplement: none, numbering: none)\n\n\"Yes, I have heard of you. I know all about you. You're a liar when you say you aren't twin to Ugin. You were born together and fell together. Isn't that right?\"\n\nHis roar shook the air. Rocks fell from the canyon wall, rolling and bouncing to crash against the hedron cocoon, but the hedrons held firm because they were stronger than rock.\n\n\"Of course that's not right! Who told you that?\" He loomed closer, his shadow stealing the patch of sun in which she stood. His voice dropped from thunder to a threatening whisper. \"Did Ugin tell you that?\"\n\nShe took an involuntary step back toward the hedrons to put distance between herself and his teeth. Wasn't it odd that his first reaction was not to smite her but to quibble defensively? Maybe if she kept him busy she could find a way to get out of this. \"If you and Ugin aren't twins, then what are you?\"\n\nHe inhaled with such strength that snow swirled up from where it dusted distant hedrons, spinning around her like a blizzard. His voice boomed over her as he began to talk.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nThis is the truth, not that you can appreciate it, weaned as you obviously have been on lies masquerading as truth.\n\nI fell.\n\nUgin will have told you we fell together, but that is just his way of muddying the waters, telling half lies that people mistake for truth.\n\nI fell out of the wings of the void. Falling was my first sensation: the roar of wind against my scales; a flash of lightning splitting the air; the boom of the progenitor's wing-beats.\n\nThe thunder of the progenitor's passage woke me from the dream of falling. When I awoke to conscious thought, I knew all at once with full understanding that my destiny is not to fall but to fly.\n\nI opened my wings to catch the air. Ugin may tell you that he and I were wrapped together like one creature, born together, falling together, minds waking together in bewilderment and curiosity. He may tell you that as we realized we were beings\u2014minds\u2014consciousnesses\u2014that we unfolded together. Flew together.\n\nBut that is wrong.\n\nI flew first.\n\nI breathed first.\n\nI beheld the majesty of the sun and the splendor of the heavens and understood the magnificence of my mind in those first instants. Then I recognized the curled-up creature falling helplessly beside me. Of course, my instinct was to help.\n\nUsing the tip of my wing to swat his flank, I woke him. With my encouragement, he too unfurled his wings. His wings were not so mighty as mine even then, when we were not yet full grown. In this way he discovered flight or, I should say, I taught him that flight is what we dragons are made for.\n\nFlight, and power.\n\nOf course, I immediately noticed we had siblings. The tempest churning within the progenitor's shadowy wings had passed over, leaving us behind in a green and quiet land. We were alone, just the six of us.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\n\"Six?\" Naiva asked. \"Weren't there eight of you? Didn't two fall without waking? Didn't their bodies shatter atop the mountain?\"\n\nOne of his foreclaws swatted down next to her, the impact shaking her off her feet. Her knees hit the ground hard. Pain stabbed tears into her eyes.\n\n\"Do not interrupt me again!\" he thundered.\n\nAs she braced herself to get back up her face was briefly hidden from his scrutiny, and in this moment of privacy, she allowed herself a tiny smile. How he loved the sound of his own voice! Maybe it would be possible to distract him after all, just as Grandmother all those years ago had chosen to distract Atarka with the promise of food in order to save her people.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nFalling and flying is how it started.\n\nWe flew out of joy. We flew on a journey of discovery, eager to learn more about the complicated patterns of landforms and seas. At first, we thought these were living beings like us but soon comprehended this was nothing more than the world's natural order. We flew for what lesser creatures would measure as years. That was our childhood: the heavens, the wind, the sun, and the stars, and the song they made in their glorious existence, a perfect setting for creatures as splendid as we dragons.\n\nAt last, I alone had the courage, and the hunger, to dare fold my wings and set my claws upon the ground. Of course, that momentous decision presaged all that was and is to come: my wings span the heavens, and my presence, my weight, my size, my claws, all these give me dominion over the earth and all that lives on the earth. So, I named our home Dominaria, because I claimed its song for myself.\n\nNaturally, the fractious and unstable humanoids had to be domesticated and made fit to live in peace. My exceptional success at these efforts naturally caused envy among my siblings and cousins, but their resentment and backbiting was easily dealt with by a personage of my talent and wisdom.\n\nBut all was not triumph in those days. Sadly, Ugin did not prove up to the challenge. In the early years of my struggle, he pledged to stand beside me, but in fact he hadn't the stomach for the work.\n\nWe had to clear out a nest of particularly foul humanoids who stumbled upon a wounded and already dying dragon and claimed they had killed it. A false sense of victory caused them to swagger about as if they had earned a shower of glory. Of course, they had to be eradicated. But Ugin lost his nerve. He flew out of range of their venom-soaked weapons, watching as I selflessly risked myself to avenge our sister's death. Even he would admit this is true. He made excuses, he quibbled, he whined, he kept trying to talk me out of taking control of a situation that would soon threaten all dragons on Dominaria had it been allowed to spread unchecked.\n\nEven when I thoroughly vanquished our foes, he criticized me for my methods, as if I hadn't taken the only path available to end the threat! But I listened patiently to all his wheedling complaints. A few scraps of wisdom percolated up here and there within his words, and I heeded them, too, for I wished for nothing more than to bring a harmonious existence to all sapient creatures on Dominaria. I tried to explain how it would all work out, but he was still frightened.\n\nAnd so, he fled. He vanished, there one moment and then as if with the blink of the eye and a ripple through the air~GONE.\n\nWhat a sorrow and a grieving I felt at his disappearance! What a howl of despair I raised!\n\nIt happened so fast I truly believed it was my fault. I thought I had not properly reckoned with the cunning and hate of the surviving humanoids. I berated myself for overlooking the power of their sorcerers, for it was impossible for me to believe my dear Ugin was a coward. The only explanation that made sense was that a powerful spell had obliterated him right before my astonished eyes.\n\n#figure(image(\"007_Chronicle of Bolas: Perspectives/02.jpg\", width: 100%), caption: [Doublecast | Art by: ], supplement: none, numbering: none)\n\nOf course, I rooted out all the humanoid sorcerers in the area. I persuaded them to give up their secrets. Those who refused I killed, while those who cooperated I learned from and then killed later. Since I could no longer trust them. Afterward I wisely created my own academies to train those with magic, so they could serve the greater good under my suzerainty.\n\nNaturally my siblings and cousins envied my success. I did not want any conflict with them\u2014\"live and let live\" is a good phrase, is it not?\u2014but I had no choice if I wanted to protect my people.\n\nI could speak at length about the war that the others forced upon me, but that would bore me. Suffice it to say that the wars lasted a long time, many generations as you short-lived humanoids measure time. One day, when I had finally driven that stubborn tyrant Arcades into retreat, Ugin returned. He flew right into the middle of our final battle, breaking it off.\n\nThe shock of his appearance quite undid me.\n\n\"What sorcery is this?\" I roared. \"Ugin is dead.\"\n\n\"No sorcery. Don't you know me, Nicol?\"\n\nMy hearts swelled with joy, then constricted with fury. \"This is some cursed illusion magic wielded by Arcades!\"\n\nWith a blast of fire, I meant to obliterate the mirage.\n\n\"Nicol! Stop! It's truly me.\"\n\nAt the last moment, I turned my ire aside to blow harmlessly away over the land. What if it truly was him?\n\n\"You're dead. I saw you annihilated by a vile burst of human sorcery. It was their revenge for my victory, destroying what I love most. But I avenged you, and set out to make the world worthy of your vision of peace and harmony.\"\n\n\"Is this what you call peace and harmony?\"\n\nSpoken like Ugin! He was always finding fault with everything I did. But this time I would impress him, and he would admit I was right, that I had surpassed him.\n\n\"It will be. Come see what I have accomplished. Come, Ugin.\"\n\nI acted as his guide to Dominaria, showing him all its beauty and splendor, all its power and glory, for he had always stuck close to our birth mountain and feared venturing too far away. When he tired of flying, we returned there and settled upon the birth mountain's peak, now crowned with twin horns in honor of the supremacy of dragon-kind. I surveyed the landscape from our high perch, Ugin silent beside me. I thought he was content, just as I was content to have him back beside me. But in fact, he was seething with envy, as I was soon to discover.\n\n\"Of course, you never suspected the world to be so vast a place, did you, Ugin? I have traveled everywhere, no place too small or too grand that I have not set claw upon it. No one dares call me \"least\" now.\"\n\nUgin laughed. \"Do you really believe this petty squabbling means anything in the vast reaches of the universe?\"\n\nHow it pained my hearts to hear this bit of mockery. Of course, I wanted to point out that he'd been hiding all this time in a coward's sanctuary, but I refrained and instead tried to soothe him.\n\n\"Have you returned only to insult me? I thought we were better friends than that. Now that you are returned, you can share in my triumph, just as we always did before.\"\n\n\"I don't want your leavings, Nicol. I have secrets of my own, learned at the feet of a wise woman.\"\n\n\"That old human is long vanquished by death and her prattling wisdom nothing more than dust. Her secrets were like bubbles that pop when you touch them: pretty to look at but without substance.\"\n\n\"You'll see!\" Ugin screamed angrily. He began babbling about planes and walking paths between worlds. \"I will find the way, as she promised me long ago, and then you'll be sorry. Then you'll regret thinking you are better than me.\"\n\nThe wind rumbled atop the mountain in a howl of storm. Snow fell so thickly that its blizzard obscured him from my vision.\n\n\"Ugin?\" I shouted.\n\nIn a ripple of warm wind, he was gone.\n\nFled.\n\nThe ugly landscape of his hearts was starkly revealed. Hadn't he abandoned me the first time just when I most needed him? Now he had come back merely to taunt me with the affection I held for him that he clearly did not hold for me. Obviously, he had done it because he was envious of everything I had achieved. My vast intelligence and clever strategies. My mastery of magical skills he wanted for himself and that the old woman had promised him but never delivered. My myriad grateful subjects and the promise of the world I would soon rule as benevolent overlord beloved by all, awe-struck by my majesty and power.\n\n#figure(image(\"007_Chronicle of Bolas: Perspectives/03.jpg\", width: 100%), caption: [Draconic Disciple | Art by: Yongjae Choi], supplement: none, numbering: none)\n\nHow dare he claim to be better than me? How dare he flaunt magic that he refused to share? He was nothing, no one, too weak and cowardly to fight. He was least in standing among us elder-born dragons, not really deserving of even being counted among us. Probably he had hoped to steal my glory and claim it for himself. No wonder he was angry, recognizing he hadn't the gift or strength for what I had so easily managed.\n\nAnd yet sharper than a dragon's tooth, the bite of his insults clawed their way regardless into my hearts.\n\nHe had abandoned me again. Deliberately. Mockingly. Condescendingly.\n\nI, who burned with the bright heat of a thousand suns, felt cold for the first time, cold with the grief of rejection. He had returned with the express purpose of rebuffing my overtures of friendship, of flinging my generosity back in my face.\n\nSuch a one as he could not feel pleasure in the good fortune of another but only resentment.\n\nSuch a one as he could gain no satisfaction or delight in the accomplishments and successes of another but only bitterness.\n\nSuch a one as he could find refuge only in envy.\n\nIn rage.\n\nRAGE\n\nHow dare he have what I had not!\n\nA white-hot spark kindled deep in my chest with a flash of such sunlit brightness that it blinded me. Impenetrable blackness filled my vision. Tumbling, I fell, totally disoriented, until with a gut-wrenching twist I righted myself.\n\nOnly to find myself no longer atop the birth mountain but gliding over a boundless stretch of oceanic waters as flat and still as a mirror. I was the only thing in motion, my wings shadowing the sea's surface. There was no sun in this peculiar place, only the water and many craggy islets and a constant shushing whisper of secrets just out of my reach. By a faint humming vibration deep in my bones, I suspected this was not a plane but some manner of artificial construct, built by an unknown agent that had left neither claw nor footprint to mark its authorship. Who, or what, possessed so much power? And why had it been abandoned?\n\nBubbles floated peaceably in the sky, drifting downward until they touched my scales and popped\n\nWith each pop, a sweet vista sprang open before me for a breathtaking moment before it vanished: other lands, other worlds, other planes.\n\nAh!\n\nWith my next breath, I comprehended the whole: I had become a Planeswalker.\n\nI had become the very thing Ugin had been ranting about all along, the magic he wanted for himself but could not achieve.\n\nAfter that first unexpected passage, it was easy to keep going, to move in and out through a web of connections linked by a clot of darkness to which everything else adhered. I walked from one world to another to the next and the next.\n\nWhat wonders lay beyond the meager treasures of Dominaria! A hundred worlds I visited, and then a hundred more. Yet in all that time I found no trace of any other creature who could walk between worlds. I was the first among all sapient creatures to discover the possibility of traveling between planes. No wonder eternity and infinity welcomed me, having sojourned alone for so long!\n\nEven so I began to think again of Ugin, wanting to share this glory with another, or at least to forgive him, to hear how he might at last acknowledge how far I had come.\n\nI am not a selfish creature. It seemed churlish to withhold this knowledge from Ugin, even if he could never manage to duplicate the planeswalking I had achieved, for at that time I did not yet understand how a peerless spark separates we rare Planeswalkers from the unworthy others of sapient life for whom untold worlds will lie forever out of reach.\n\nI thought of him. I believed we could be friends as we once were at the dawn of days. So I went home.\n\nOf course, a great deal of time had passed as you humanoids measure it. The Dominaria I had left was so changed, I barely recognized large swathes of it. The courses of rivers altered; islands sundered; lakes gone dry and seas risen to flood once habitable shores. There I found the wars between the elder dragons over long since. A tenuous peace had taken hold throughout much of the land. Of all the elder dragons and their children, only Chromium Rhuell, , Palladia-Mors, and that vexatious beast Vaevictis Asmadi had survived. Rhuell wandered the land in the guise of a helpful observer, all offering praise for his wisdom and beneficence, yet he was no better than those of our siblings who plundered and ruled, for he poked his snout in wherever he wished, and who among the humanoids could tell him no? Vaevictis still roamed with restless fervor, pillaging and burning as he wished, sometimes teaming up with that ill-tempered creature Palladia-Mors but more often alone.\n\nYet as I searched the wide world over, I found no trace of Ugin. At length, I made my way to Arcades's kingdom, as Ugin and I had once done when we were fledglings.\n\n#figure(image(\"007_Chronicle of Bolas: Perspectives/04.jpg\", width: 100%), caption: [Arcades, the Strategist | Art by: ], supplement: none, numbering: none)\n\nArcades welcomed me in his most tendentious elder sibling manner, wondering where I had been hiding myself all this time and proudly showing me about the empire he considered meticulously regulated and magnificently vast. But I knew better.\n\n\"Ugin? I know you and he were particularly close, born as you were. But I haven't seen him since the earliest of days when you two left to root out those dragon killers. You told us he died.\"\n\n\"That's not what I said,\" I corrected him. \"He wasn't dead at all. He was just hiding. He returned right at the climax of our last battle.\"\n\nHe regarded me with his usual patronizing superiority. \"The battle you fled from, abandoning your troops? I gathered them under my wings. They were grateful for my protection, I assure you.\"\n\n\"Did you not see him, flying between our armies?\" I demanded, utterly astonished by his obliviousness.\n\n\"You were not yourself that day, Bolas. No doubt you were seeing illusory things. You have always felt shame about Ugin's death, haven't you? Did you blame yourself for not protecting him? Or did you stand aside and allow him to be killed by some venomous sorcery? I've always wondered. I've always suspected you envied him because he was cleverer and wiser than you.\"\n\nI, envy Ugin? Ridiculous.\n\nThen I understood: Arcades was disparaging me, hoping to make me lose my temper as I would have done when I was young and volatile. But I was bigger than that. Much, much bigger. I was a Planeswalker, first and only one of my kind. To rule in Dominaria was all very well for a small-minded despot like Arcades, while I had grown as far beyond him as he was beyond pathetic, weak, short-lived humans.\n\nI surveyed the graceful architecture and fastidiously ordered streets and districts of the city where he presided from a palace built atop a cliff. And I insinuated a worm of doubt in his haughty mind: Maybe the humanoids who lived here weren't as deserving as he thought them. Maybe they didn't really respect him or follow his laws, but only pretended to. Maybe they were plotting to rise up and overthrow him, for wasn't he nothing more than a tyrant even if he fancied himself a benevolent one? Wasn't that what his subjects whispered, when they were sure he couldn't hear? If he sent out agents into every corner and crevice of the realm, they could report back to him and thus root out instigators. He could offer rewards for people turning in traitors and pay handsomely for people brave and bold enough to turn on their own kinfolk. And if that wasn't enough, then he could burn down suspect districts or even whole cities. Burn them. BURN THEM.\n\nWith a last smile, I wrapped myself in magic and departed Dominaria. The doubts I had seeded would take root, or they would wither. Either way, Arcades would not trouble me again. He would never walk the planes. He didn't have it in him. Only I did.\n\nSo, you may imagine my shock and my joy when I walked out of the blind eternities into the place I had come to call my Meditation Realm only to find Ugin there! He was floating atop the waters staring at himself as if he could imagine nothing better than to look at his own reflection.\n\n\"Ugin! How is it you are here? I am overjoyed to see you, Brother, for I feared I had lost you forever.\"\n\nBut he had no words for me. He had only animosity, driven by his anger and envy and resentment and bitterness, by the memory of mocking, condescending laughter. By the fear I would reveal the truth about things he did not want others to know, and that those others would believe me over him.\n\nHe attacked, viciously and without warning, all raw fury and malignant resentment. I had no choice but to defend myself. First above the wide waters of the Meditation Realm and then on a wild pummeling path through the planes, we struggled for days, years, generations. We battled with claw and tooth and with magic. On and on the struggle raged, for he was unrelenting, rejecting all my attempted overtures for a truce. All he wanted was to kill me for the crime of walking the planes before he did. His hearts were eaten out by jealousy for what I had not shared with him.\n\nWhat could I do? There was no placating him.\n\nIn the end, by diverse paths, we returned to the Meditation Realm. There, purely in self-defense, I killed him.\n\nWith a mighty splash, he fell into the still waters. The impact resounded like thunder. Monstrous waves rose from the displacement and swept across the craggy islets, crashing and destroying as they went. The waves ran on and on, washing far beyond the bounds of the Meditation Realm into the web of connection that links the planes themselves and maybe even into the blind eternities whose depths even dragons cannot plumb. The waves spilled out of the Meditation Realm as if Ugin's death had, like a weight dropped upon a ceramic bowl, broken cracks in the vessel itself.\n\nThe violence of the waves swept me out of the Meditation Realm. Like a cast spear, I was flung through ten or twenty or a hundred planes before I fell hard back into Dominaria, onto the island chain of Madara at a time when the memory of the Elder Dragon Wars had faded into legend. Bruised and stunned, I struggled to recover my strength, but recover it I did. Many battles lay before me, and I met them with ease.\n\nOf course, little Naiva, you must be interested in the long course of my fascinating life, and I would gladly regale you with the whole now that I have set you right about Ugin's false story. But I know you believe you are distracting me from my purpose here.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nShe could no longer see the sky, only his dazzling eyes and the brilliant curve of his horns with the egg-gem spinning mesmerically between the points.\n\nHis smile showed his teeth. In one gulp, he could eat her.\n\n\"It always discourages me,\" he said in a kindly voice, \"that people are so quick to think we dragons like the taste of human flesh when in fact it is not to our taste at all.\"\n\nHis head dropped lower. She took another step back but could move no farther, trapped against the hedrons.\n\n\"What you don't understand is that I have all the time in the worlds, while your time is running out fast. Now. Where is Ugin?\"\n\n\"Ugin is dead.\"\n\n\"So I believed when I killed him in the Meditation Realm. I departed, believing him dead. That was my mistake. Because somehow, he wasn't dead. He has plagued me ever since, most recently with a misbegotten plan to trap me on Ixalan by means of a magical artifact.\"\n\n\"Ixalan?\" She croaked out the word, anything to keep him talking.\n\n\"The name means nothing to you. It's another plane. One you will never see in your entire short, brutish, nasty life.\"\n\n#figure(image(\"007_Chronicle of Bolas: Perspectives/05.jpg\", width: 100%), caption: [Highland Lake | Art by: ], supplement: none, numbering: none)\n\nHer limbs were cold and her heart was sluggish, as if her body had decided it was better to collapse into insensibility than face the shattering power of , Ugin's greatest enemy. But she would not cringe.\n\n\"Ugin is dead.\" She forced out the words in a harsh whisper. \"His bones lie right here. Beneath the hedrons.\"\n\n\"Ah. Hmm.\" His rumble unnerved her as his gaze scanned the formation winding out of sight beyond the curve of the canyon. \"His falling body cleaved this canyon. I suppose it's possible his bones really do lie here.\"\n\n\"Can't you see the bones?\"\n\nHe slapped a foreclaw on the ground, the sound echoing off the canyon walls. \"Do not question me. It's a shame the others consider you expendable, isn't it?\"\n\n\"Expendable? They rely on me!\"\n\n\"You cannot be so naive, little one. Your grandmother tolerates you only because she finds you useful in protecting the grandchild she clearly cares about, the one who inherited the shamanic gifts. You have no magic, do you?\"\n\n\"I'm a hunter!\"\n\n\"Yes, yes, you're a hunter. Everyone is a hunter. But your sister is a shaman. There's nothing worse than discovering someone you love holds tightly to a gift they've denied you. That they refuse to share with you. That you're expected to pander to and flatter them, admire them, when really, you're the valuable one. You're the one who will feed the tribe in the years to come. You're the one who will lead the people into the high mountains in the summer and to the lowlands during the winter. You're the leader, burdened by this sister you never asked for and didn't really want. They keep holding you back because of her, making you watch over her, wait for her, not giving you the scouting and hunting responsibilities you've earned with your skill. It's just not fair. If you were free of her, then you could finally come into your own, couldn't you? You could finally become the great hunter and leader you deserve to be. And I can help you with that, Naiva.\"\n\nHis words, uttered in such a soft, persuasive tone, insinuated themselves into her heart. The old resentment sparked. All the annoyances of years past clawed their way back into the forefront of her mind, throbbing like a headache only he could soothe. But she couldn't trust him. She clung to that fading thought. \"How can you help me? Why would you help me?\"\n\n\"Because if I don't help you, then I will be forced to destroy Tarkir. Wouldn't that be a shame? Especially since you are the only one who can prevent its destruction.\"\n\n\"Why would you destroy Tarkir?\" she whispered hoarsely, horrified and shaking.\n\n\"Because he loves Tarkir. But mostly so there can be no chance of him being reborn here.\" He paused, then huffed a soft warm breeze, like magic, over her trembling body. \"Do not fret, Naiva. I don't want to annihilate this plane because I'd rather help you. Together, we will clear Tarkir of all your enemies, all the dragons and all the other tribes. You can hunt the wide world over with no one to stand in your way. I will bring about everything you have ever dreamed of because I have that power, and I will use it on your behalf. All you need do is bring me Yasova. Now.\"\n\nNow. The word reverberated in her head. It was true, after all. Baishya had always been a burden heavier than a net of dead goblins. When Grandmother died, no family group would risk taking in a young, inexperienced whisperer whose presence could get them all killed. Why should she be asked to give up everything she wanted just to protect her sister? The old ways had never belonged to Naiva. They were just obstacles in her path forward.\n\n\"She's here. Right here. Hiding.\"\n\nHis smile lit the entire world. \"Fetch her for me. Then you will receive your reward.\"\n\nThere was no future for her in clinging to the past. She'd been right when she'd told Tae Jin that the old ways were a corpse better consumed by vultures.\n\n#figure(image(\"007_Chronicle of Bolas: Perspectives/06.jpg\", width: 100%), caption: [Atarka's Command | Art by: ], supplement: none, numbering: none)\n\nYet when she thought of the young ghostfire warrior, of his courage and sacrifice, a shudder passed through her frame and ripped a gash in her certainty. What would Tae Jin say when he learned she had handed over the great Yasova Dragonclaw to ?\n\n\"Little Naiva, you mustn't believe I want to hurt Yasova. I want to help. That's all. Now go.\" His voice hardened. A pressure built in her head until she thought her skull would burst. \"#emph[Now] .\"\n\nKneeling, she pulled aside the fragment of broken hedron and crawled in. There, in the dim, stuffy confines of the space, Baishya lay as if asleep, breathing evenly. Grandmother sat cross-legged in mediation, eyes closed, left hand resting open on a thigh while her right hand grasped Baishya's bare fingers with an affectionate clasp. The gesture ate a hole of envy right through Naiva's heart. Grandmother had always preferred Baishya. She loved her more than she loved Naiva.\n\nShe would have to bodily haul Grandmother outside. But that could wait. Pulling her knife from its sheath, she pressed the blade against Baishya's vulnerable throat.\n" }, { "repo": "https://github.com/PmaFynn/cv", "file": "https://raw.githubusercontent.com/PmaFynn/cv/master/src/metadata.typ", "language": "typst", "license": "The Unlicense", "content": "/* Personal information */\n#let firstName = \"Fynn\"\n#let lastName = \"Friedrichs\"\n\n#let personalInfo = (\n location: \"Krefeld, Germany\",\n phone: \"+49 152 09207000\",\n email: \" \",\n homepage: \"work.fynnfr.org\",\n github: \"PmaFynn\",\n linked: \"linkedin.com/in/fynnfr\",\n //TODO: maybe add something here -> current location or something\n //extraInfo: \"\",\n)\n\n#let headerQuoteInternational = (\n \"\": [Senior Software Engineer looking for a full time job],\n \"en\": [Information Systems Student looking for a new challenge],\n \"fr\": [Ing\u00e9nieur logiciel exp\u00e9riment\u00e9 cherchant un emploi \u00e0 temps plein],\n)\n\n\n/* Layout settings */\n#let cvLanguage = \"en\"\n\n#let accentColor = \"burgundy\"\n\n#let profilePhoto = \"images/cvImage-modified.png\" // Leave empty if profil photo is not needed\n\n#let varEntryOrganisationFirst = false // Choose whether to put company or position in bold\n\n#let varDisplayLogo = false // Choose whether to display organisation logo\n" }, { "repo": "https://github.com/NOOBDY/formal-language", "file": "https://raw.githubusercontent.com/NOOBDY/formal-language/main/q9.typ", "language": "typst", "license": "The Unlicense", "content": "#import \"@preview/finite:0.3.0\": automaton, layout\n\n#let q9 = [\n9. Let $Sigma = {a_1,...,a_n}$ be an alphabet of $n$ symbols.\n\n + Construct an `NFA` with $2n + 1$ states accepting the set $L_n$ of strings over $Sigma$ such that, every string in $L_n$ has an odd number of $a_i$, for some $a_i in Sigma$. Equivalently, if $L^i_n$ is the set of strings over $Sigma$ with an odd number of $a_i$, then $L_n = L^1_n union...union L^n_n$.\n\n #automaton(\n (\n q: (q11:\"2\", q21:\"2\", qn1:\"2\"),\n q11: (q12:\"1\"),\n q12: (q11:\"1\"),\n q21: (q22:\"1\"),\n q22: (q21:\"1\"),\n qn1: (qn2:\"1\"),\n qn2: (qn1:\"1\"),\n d:()\n ),\n labels: (\n q: $ q $,\n q11: $ q_11 $,\n q12: $ q_12 $,\n q21: $ q_21 $,\n q22: $ q_22 $,\n qn1: $ q_(n 1) $,\n qn2: $ q_(n 2) $,\n d: $ dots.v $\n ),\n final: (\"q12\", \"q22\", \"qn2\"),\n style: (\n state: (\n stroke: 0.5pt,\n ),\n transition: (\n stroke: 0.5pt,\n curve: 0,\n label: (\n angle: 0deg\n )\n ),\n q-q11: (label: (text: $epsilon.alt$)),\n q-q21: (label: (text: $epsilon.alt$)),\n q-qn1: (label: (text: $epsilon.alt$)),\n q11-q12: (curve: 0.5, label: (text: $a_1$)),\n q12-q11: (curve: 0.5, label: (text: $a_1$)),\n q21-q22: (curve: 0.5, label: (text: $a_2$)),\n q22-q21: (curve: 0.5, label: (text: $a_2$)),\n qn1-qn2: (curve: 0.5, label: (text: $a_n$)),\n qn2-qn1: (curve: 0.5, label: (text: $a_n$)),\n d: (stroke: 0.0pt)\n ),\n layout: layout.custom.with(\n positions: (..) => (\n q: (0, -3),\n q11: (2, 0),\n q12: (4, 0),\n q21: (2, -2.5),\n q22: (4, -2.5),\n qn1: (2, -6),\n qn2: (4, -6),\n d: (3, -4.25)\n )\n )\n )\n\n + Prove that there is a `DFA` with $2^n$ states accepting the language $L_n$.\n\n See (c)\n\n + Prove that every `DFA` accepting $L_n$ has at least $2^n$ states.\n\n For every symbol $a_i in Sigma$, the `DFA` has to keep track of whether the count is odd or not. This would result in at least 2 states for each symbol, which is at least $2^n$ states in total.\n]\n" }, { "repo": "https://github.com/sjedev/typst-notetaking-template", "file": "https://raw.githubusercontent.com/sjedev/typst-notetaking-template/main/README.md", "language": "markdown", "license": "The Unlicense", "content": "# typst-notetaking-template\nSimple notetaking template for Typst\n" }, { "repo": "https://github.com/7sDream/fonts-and-layout-zhCN", "file": "https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/02-concepts/dimension/units.typ", "language": "typst", "license": "Other", "content": "#import \"/template/template.typ\": web-page-template\n#import \"/template/components.typ\": note\n\n#import \"/lib/glossary.typ\": tr\n\n#show: web-page-template\n\n// ### Units\n=== \u5355\u4f4d\n\n// First, though, how do you measure stuff in a font? When fonts were bits of metal, it was easy: you could use callipers or a micrometer to measure the sort, and get an answer in millimeters or printers points. But digital fonts, as we've seen in the previous chapter, are meant to be scalable; that is, usable at any size. With scalable fonts, there isn't such a thing as a 12pt Times Roman as distinct from a 16pt Times Roman; there isn't any *size* there at all.\n\u9996\u5148\u6709\u4e2a\u7591\u95ee\uff0c\u5728\u8fdb\u884c\u5b57\u4f53\u8bbe\u8ba1\u65f6\u6211\u4eec\u600e\u4e48\u6d4b\u91cf\u957f\u5ea6\u5462\uff1f\u5f53\u5b57\u4f53\u8fd8\u662f\u91d1\u5c5e\u7684\u65f6\u4ee3\u8fd9\u5f88\u5bb9\u6613\uff0c\u4f7f\u7528\u5361\u5c3a\u6216\u8005\u5343\u5206\u5c3a\u4e4b\u7c7b\u7684\u5de5\u5177\u5c31\u53ef\u4ee5\u91cf\u51fa#tr[sort]\u7684\u5c3a\u5bf8\uff0c\u7528\u5398\u7c73\u6216\u8005\u70b9\uff08pt\uff09\u4f5c\u4e3a\u5355\u4f4d\u6765\u8bb0\u5f55\u5373\u53ef\u3002\u4f46\u6570\u5b57\u5b57\u4f53\uff0c\u6211\u4eec\u5728\u4e0a\u4e00\u7ae0\u8ba8\u8bba\u8fc7\uff0c\u5b83\u53ef\u4ee5\u4ee5\u4efb\u610f\u5927\u5c0f\u663e\u793a\u3002\u5bf9\u4e8e\u8fd9\u4e9b\u53ef\u7f29\u653e\u7684\u5b57\u4f53\u6765\u8bf4\uff0c12pt\u548c16pt\u7684Times Roman\u5e76\u6ca1\u6709\u4ec0\u4e48\u533a\u522b\uff0c\u5b83\u4eec\u6839\u672c\u6ca1\u6709\u5927\u5c0f\u8fd9\u4e2a\u6982\u5ff5\u3002\n\n// So coordinates and size values inside digital fonts are defined in terms of an *em square*, which is itself divided into an arbitrary number of *units*, typically 1000, 1024 or 2048. If we want to display text at 12 points, we draw the *em square* at that size, and then scale up the design to match.\n\u6570\u5b57\u5b57\u4f53\u5185\u7684\u5750\u6807\u548c\u5c3a\u5bf8\u7531*#tr[em square]*\u6765\u786e\u5b9a\uff0c\u5b83\u7684\u9ad8\u5ea6\u4f1a\u88ab\u5206\u6210\u4efb\u610f\u6570\u91cf\u4e2a\u5c0f\u5355\u5143\uff0c\u4e00\u822c\u4f1a\u662f1000\uff0c1024\u6216\u80052048\u4e2a\u5355\u4f4d\u3002\u5982\u679c\u6211\u4eec\u5e0c\u671b\u663e\u793a12pt\u7684\u6587\u672c\uff0c\u5c31\u628a*#tr[em square]*\u5b9a\u4e3a\u8fd9\u4e2a\u5c3a\u5bf8\uff0c\u5177\u4f53\u7684\u5b57\u7b26\u8bbe\u8ba1\u5c31\u81ea\u7136\u5730\u7f29\u653e\u4e3a\u76f8\u5339\u914d\u7684\u5927\u5c0f\u4e86\u3002\n\n#figure(caption: [\n #tr[glyph]\u5728\u4e0d\u540c\u5b57\u53f7\u65f6\u7684\u7f29\u653e\n], include \"units-graph.typ\") \n\n// We can see a number of things from this diagram. First, we notice that the glyph outline doesn't need to be contained within the em square itself. It's just a notional rectangular box, a kind of digital type sort. (Yes, the old lining-up-boxes model of typography again.) In this case, with Bengali script, we want to make sure that the headline is always connected, so there is a slight overlap between the glyphs to make this happen, leading to the outline of the headline jutting out the left and right side of the em square.\n\u4ece@figure:units \u4e2d\u6211\u4eec\u53ef\u4ee5\u770b\u51fa\u5f88\u591a\u4fe1\u606f\u3002\u9996\u5148\uff0c#tr[glyph]#tr[outline]\u4e0d\u9700\u8981\u5145\u6ee1\u6574\u4e2a#tr[em square]\uff0c\u5b83\u53ea\u662f\u4e00\u4e2a\u7528\u4e8e\u53c2\u8003\u7684\u77e9\u5f62\u6846\u800c\u5df2\uff0c\u5c31\u50cf#tr[sort]\u5b57\u8eab\u7684\u6570\u5b57\u7248\u3002\uff08\u662f\u7684\uff0c\u53c8\u662f\u53e4\u8001\u7684\u57fa\u4e8e\u7ebf\u548c\u6846\u90a3\u4e00\u5957\u3002\uff09\u5728\u56fe\u4e2d\u7684\u5b5f\u52a0\u62c9\u6587\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u5e0c\u671b\u786e\u4fdd#tr[headline]\u603b\u662f\u8fde\u7eed\u7684\uff0c\u6240\u4ee5\u5c06#tr[glyph]\u8bbe\u8ba1\u4e3a\u6709\u8f7b\u5fae\u7684\u91cd\u53e0\uff0c\u4e5f\u5c31\u9020\u6210\u4e86\u8fd9\u4e9b#tr[headline]\u7684#tr[outline]\u4f1a\u7a81\u51fa\u4e8e#tr[em square]\u7684\u5de6\u53f3\u4e24\u4fa7\u3002\n\n// Notice also that the baseline and full height of the glyph are not determined by the em square itself; the designer decides where to put the outlines within the em square, and even how high to make the outlines. This can mean that different digital fonts which are notionally the same type size actually appear at different sizes!\n\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c#tr[baseline]\u548c#tr[glyph]\u7684\u9ad8\u5ea6\u5e76\u4e0d\u7531#tr[em square]\u51b3\u5b9a\u3002\u8bbe\u8ba1\u5e08\u4f1a\u51b3\u5b9a\u628a\u5b83\u4eec\u653e\u5728#tr[em square]\u7684\u4ec0\u4e48\u4f4d\u7f6e\uff0c\u6216\u8005\u4ec0\u4e48\u9ad8\u5ea6\u4e0a\u3002\u8fd9\u4e5f\u5c31\u610f\u5473\u7740\u5728\u4f7f\u7528\u76f8\u540c\u7684\u5b57\u53f7\u8c03\u7528\u4e0d\u540c\u7684\u5b57\u4f53\u65f6\uff0c\u5b9e\u9645\u7684\u663e\u793a\u5c3a\u5bf8\u53ef\u4ee5\u5343\u5dee\u4e07\u522b\u3002\n\n#figure(caption: [\n Noto Sans\u548cTrajan\u5b57\u4f53#footnote[\u8bd1\u6ce8\uff1a\u539f\u6587\u4f7f\u7528\u7684\u5e94\u8be5\u662fTrajan Pro 3\u7684\u56fe\u7247\uff0c\u56e0\u76f4\u63a5\u5d4c\u5165\u5b57\u4f53\u6570\u636e\u7684\u8bb8\u53ef\u8bc1\u95ee\u9898\uff0c\u6b64\u5904\u6362\u6210\u540c\u98ce\u683c\u7684Cinzel\u3002]\u4e2d\u7684\u5b57\u6bcdH\u3001x\n], placement: none, include \"notional-size.typ\") \n\n// Here the designers of Noto Sans and Trajan have placed the outlines in the em square in different ways: Trajan uses a bigger body, a higher x-height, and fills up the square more, whereas Noto Sans leaves space at the top. (Both of them leave space at the bottom for descenders.) We'll look at the differing heights used in font design a little later, but for now just remember that because the em-square is a notional size and designers can put outlines inside it however they like, a 12pt rendering of one font may be \"bigger\" than a 12pt rendering of another, even if the em square is scaled to be the same size.\n@figure:notional-size \u5c55\u793a\u4e86Noto Sans\u548cTrajan\u4e24\u4e2a\u5b57\u4f53\u5728\u628a#tr[outline]\u653e\u8fdb#tr[em square]\u65f6\u91c7\u7528\u7684\u4e0d\u540c\u65b9\u5f0f\uff1aTrajan\u62e5\u6709\u4e00\u4e2a\u66f4\u9ad8\u7684#tr[x-height]\uff0c\u5b83\u7684\u4f53\u578b\u66f4\u5927\uff0c\u5411\u4e0a\u586b\u6ee1\u4e86\u6574\u4e2a\u65b9\u6846\uff1b\u800cNoto Sans\u5219\u5728\u4e0a\u9762\u7559\u51fa\u4e86\u4e00\u4e9b\u7a7a\u95f4\uff08\u4e24\u4e2a\u5b57\u4f53\u90fd\u5728\u4e0b\u65b9\u4e3a#tr[decender]\u9884\u7559\u4e86\u7a7a\u95f4\uff09\u3002\u5b57\u4f53\u4e2d\u7684\u8fd9\u4e9b\u4e0d\u540c\u7684\u9ad8\u5ea6\u4f1a\u5728\u540e\u9762\u7684\u7ae0\u8282\u8be6\u8ff0\uff0c\u73b0\u5728\u53ea\u9700\u8981\u8bb0\u4f4f\uff0c\u56e0\u4e3a#tr[em square]\u53ea\u662f\u7528\u4e8e\u53c2\u8003\u7684\u540d\u4e49\u4e0a\u7684\u8fb9\u754c\uff0c\u67d0\u4e2a\u5b57\u4f53\u768412pt\u53ef\u80fd\u4f1a\u6bd4\u53e6\u4e00\u4e2a\u5b57\u4f53\u768412pt\u66f4\u5927\uff0c\u5373\u4f7f\u5b83\u4eec\u7684#tr[em square]\u88ab\u7f29\u653e\u5230\u4e86\u76f8\u540c\u7684\u5927\u5c0f\u3002\n\n// However, dividing this notional square up into a number of units gives us a co-ordinate system by which we can talk about where the outlines fall on the glyph. Instead of saying \"make the horizontal stem width about a tenth of the height\", we can say \"make the horizontal stem width 205 units wide\", and that'll be scalable - true for whatever size of font we're talking about.\n\u4f46\u8fd9\u4e2a\u540d\u4e49\u4e0a\u7684\u8fb9\u754c\u5728\u88ab\u5212\u5206\u6210\u5c0f\u5355\u5143\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u6709\u4e86\u4e00\u4e2a\u5750\u6807\u7cfb\u7edf\uff0c\u53ef\u4ee5\u7528\u4e8e\u6307\u5b9a#tr[outline]\u4f4d\u4e8e\u6574\u4e2a#tr[glyph]\u7684\u4ec0\u4e48\u4f4d\u7f6e\u3002\u6211\u4eec\u4e0d\u9700\u8981\u7528\u201c\u753b\u4e00\u6761\u5927\u7ea6\u662f\u6574\u4f53\u9ad8\u5ea6\u76841/10\u7684\u6c34\u5e73#tr[stem]\u201d\u8fd9\u6837\u7684\u63cf\u8ff0\uff0c\u53ea\u9700\u8981\u8bf4\u201c\u753b\u4e00\u6761205\u4e2a\u5355\u4f4d\u5bbd\u7684\u6c34\u5e73#tr[stem]\u201d\u5c31\u884c\u3002\u800c\u8fd9\u4e5f\u4fdd\u6301\u4e86\u53ef\u7f29\u653e\u7684\u7279\u6027\uff0c\u56e0\u4e3a\u5bf9\u4e8e\u4efb\u4f55\u5b57\u53f7\u6765\u8bf4\u8fd9\u4e00\u63cf\u8ff0\u90fd\u662f\u6210\u7acb\u7684\u3002\n\n// We'll use these *font units* every time we talk about the dimensions within a font.\n\u6211\u4eec\u5728\u8ba8\u8bba\u5b57\u4f53\u4e2d\u7684\u6240\u6709\u5c3a\u5bf8\u65f6\u90fd\u4f1a\u4f7f\u7528\u8fd9\u4e2a\u5355\u4f4d\u957f\u5ea6\u3002\n" }, { "repo": "https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024", "file": "https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/identify-wedges/entry.typ", "language": "typst", "license": "Creative Commons Attribution Share Alike 4.0 International", "content": "#import \"/packages.typ\": notebookinator\n#import notebookinator: *\n#import themes.radial.components: *\n\n#show: create-body-entry.with(\n title: \"Identify: Pushing Robots\",\n type: \"identify\",\n date: datetime(year: 2023, month: 9, day: 3),\n author: \"\",\n witness: \"\",\n)\n\nVRC is a very contact heavy robotics competition. We will often be trying to\npush other robots. During the Spin Up season, even with our 6 motor drivetrain,\nwe still struggled to push other robots.\n\nWe need to something that will give us an advantage while pushing robots without\nadding more motors to our drivetrain.\n\n#figure(image(\"modelone.png\", width: 80%))\n\n= Design Constraints\n\n- No active actuators\n- Must use vex materials\n- Has to fit on the robot.\n- Cannot exceed the 18\" size limit.\n\n=Design Goals\n\n- Needs to be able to push another larger robot 2 feet while driving into it.\n- Needs to be able to start folded in at the start of the match.\n" }, { "repo": "https://github.com/yhtq/Notes", "file": "https://raw.githubusercontent.com/yhtq/Notes/main/\u5e38\u5fae\u5206\u65b9\u7a0b/\u4f5c\u4e1a/2100012990 \u90ed\u5b50\u8340 \u5e38\u5fae\u5206\u65b9\u7a0b 8.typ", "language": "typst", "license": "", "content": "#import \"../../template.typ\": *\n// Take a look at the file `template.typ` in the file panel\n// to customize this template and discover how it works.\n#show: note.with(\n title: \"\u4f5c\u4e1a8\",\n author: \"YHTQ\",\n date: none,\n logo: none,\n withOutlined : false,\n withTitle : false,\n withHeadingNumbering: false\n)\n= p247\n == 1\n \u4e0d\u59a8\u5047\u8bbe $f$ \u5728 $(x_1, x_2)$ \u4e0a\u6052\u6b63\uff0c\u6709\uff1a\n $\n f'(x_1) >= 0, f'(x_2) <= 0\n $\n \u5047\u8bbe $g(x)$ \u5728 $(x_1, x_2)$ \u4e0a\u65e0\u96f6\u70b9\uff0c\u4e0d\u59a8\u8bbe\u5176\u6052\u6b63\u3002\u4ee4\uff1a\n $\n W(x) = Det(f, g;f', g') = f g' - f' g\\\n W'(x) = Det(f, g;f'', g'') = Det(f, g;-p(x)f' - q(x) f, -p(x) g' - r(x) g)\\\n =Det(f, g;-p(x)f', -p(x) g' - (r(x) - p(x)) g)\\\n = - p(x) W(x) - f g (r(x) - p(x))\n $\n \u6ce8\u610f\u5230\u4e00\u5b9a\u6709\uff1a\n $\n f g(r(x) - p(x)) > 0\n $\n \u7531\u4e00\u9636\u65b9\u7a0b\u7684\u6bd4\u8f83\u5b9a\u7406\uff0c\u6709\uff1a\n $\n B e^(-p(x)) < W(x) < A e^(-p(x))\n $\n \u5176\u4e2d $A e^(-p(x))$ \u662f\uff1a\n $\n cases(\n W'(x) = -p(x) W(x),\n W(x_1) = - g(x_1) f'(x_1)\n )\n $\n \u7684\u89e3\uff0c\u800c $B e^(-p(x))$ \u662f\uff1a\n $\n cases(\n W'(x) = -p(x) W(x),\n W(x_1) = - g(x_2) f'(x_2)\n )\n $\n \u7684\u89e3\uff0c\u7136\u800c\u4e0d\u96be\u53d1\u73b0 $- g(x_1) f'(x_1) <= 0, - g(x_2) f'(x_2) => 0$ \u5bfc\u81f4 $A <= 0, B >= 0$\uff0c\u8fd9\u662f\u8352\u8c2c\u7684\uff01\n == 2\n \u8003\u8651 $y'' + m y = 0$ \u7684\u89e3 $sin (sqrt(m) x)$ \u7531\u6bd4\u8f83\u5b9a\u7406\uff1a $k/(sqrt(m)) pi$ \u4e4b\u95f4\u4e00\u5b9a\u6709 $phi$ \u7684\u89e3\uff0c\u56e0\u6b64 $phi$ \u65e0\u9650\u632f\u52a8\\\n \u5bf9\u4e8e\u4efb\u4f55\u4e24\u4e2a\u76f8\u90bb\u96f6\u70b9 $x_1, x_2$:\n - \u53ef\u4ee5\u627e\u5230 $y'' + m y = 0$ \u7684\u89e3 $sin (sqrt(m) x - x_1)$\uff0c\u52a0\u5f3a\u7684\u6bd4\u8f83\u5b9a\u7406\u7ed9\u51fa $x_2 in (x_1, x_2 + pi/sqrt(m))$\n - \u53ef\u4ee5\u627e\u5230 $y'' + M y = 0$ \u7684\u89e3 $sin (sqrt(M) x - x_1)$\uff0c\u52a0\u5f3a\u7684\u6bd4\u8f83\u5b9a\u7406\u7ed9\u51fa $pi/sqrt(M) in (x_1, x_2)$\n \u8bc1\u6bd5\n == 3\n \u6ce8\u610f\u5230\uff1a\n $\n (z/y)' = (z' y - z y') / y^2\\\n (z' y - z y')' = z'' y - z y'' = z q(x) y - z Q(x) y = (q(x) - Q(x)) z y < 0\\\n z' y - z y'|_(x = x_0) = 0\n $\n \u8fdb\u800c $z' y - z y' < 0$\uff0c\u539f\u5f0f\u5355\u8c03\u51cf\u5c11\n == 7\n \u7531\u7ebf\u6027\u65b9\u7a0b\u7ec4\u7ed3\u8bba\uff0c\u8bbe $u$ \u662f\u6ee1\u8db3 $y(0) = a$ \u7684\u89e3\uff0c$v$ \u662f\u6ee1\u8db3 $y(0) = 0$ \u7684\u975e\u96f6\u89e3\uff0c\u5219\u6240\u6709 $y(0) = a$ \u7684\u89e3\u6070\u4e3a\uff1a\n $\n u+ C v, forall C in RR\n $\n \u8fdb\u800c\u6ee1\u8db3\u7ed9\u5b9a\u521d\u503c\u7684\u89e3\u5c31\u662f\u8981\uff1a\n $\n u(1) + C v(1) = b\n $\n \u53ea\u8981 $v(1) != 0$ \u65b9\u7a0b\u5c31\u6070\u6709\u552f\u4e00\u89e3\uff0c\u800c\u82e5 $v(1) = 0$\uff0c\u7531\u6bd4\u8f83\u5b9a\u7406 $y'' = 0$ \u7684\u89e3 $y = 1$ \u4e00\u5b9a\u5728 $[0, 1]$ \u4e0a\u6709\u96f6\u70b9\uff0c\u8fd9\u662f\u8352\u8c2c\u7684\uff01\uff08\u7c7b\u4f3c\u7684\uff0c\u8be5\u65b9\u7a0b\u7684\u89e3\u81f3\u591a\u4e00\u4e2a\u96f6\u70b9\uff09\n\n \u5bf9\u4e8e\u7b2c\u4e8c\u4e2a\u7ed3\u8bba\uff0c\u4e0d\u59a8\u8bbe $a > 0$\uff0c\u5df2\u7ecf\u8bf4\u660e\u89e3\u81f3\u591a\u4e00\u4e2a\u96f6\u70b9\uff0c\u65e0\u59a8\u8bbe $phi(x)$ \u5728 $(0, 1)$ \u4e0a\u6052\u6b63\uff0c\u56e0\u6b64 $phi''$ \u4e5f\u6052\u6b63\uff0c\u5bfc\u51fd\u6570\u5355\u8c03\u589e\u52a0\u3002\u7136\u800c\u7531 $(0, 1)$ \u95f4\u6052\u6b63\u53ef\u5f97 $y'(1) < 0$\uff08\u4e0d\u80fd\u7b49\u4e8e\u96f6\uff0c\u5426\u5219\u6574\u4e2a\u89e3\u4e3a\u96f6\uff09\uff0c\u8fdb\u800c\u51fd\u6570\u4e25\u683c\u5355\u8c03\u51cf\u5c11\u3002\n= p258\n == 1\n - \u8bbe $lambda = - m^2$\uff0c\u5219 $y'' + lambda y = 0$ \u7684\u901a\u89e3\u4e3a\uff1a\n $\n linearCombinationC(e^(m x), e^(-m x))\n $\n \u4ee3\u5165\u521d\u503c\uff1a\n $\n cases(\n C_1 + C_2 = 0,\n C_1 e^m + C_2 e^(-m) = 1\n )\n $\n \u53ea\u8981 $m != 0$ \u65b9\u7a0b\u4e00\u5b9a\u6709\u89e3\u3002\u82e5\u521d\u503c\u4e3a $(0, 0)$ \u5219\u65e0\u89e3\n - \u8bbe $lambda = m^2$\uff0c\u5219 $y'' + lambda y = 0$ \u7684\u901a\u89e3\u4e3a\uff1a\n $\n linearCombinationC(cos m x, sin m x)\n $\n \u4ee3\u5165\u521d\u503c\uff1a\n $\n cases(\n C_1 = 0,\n C_1 cos m + C_2 sin m = 1\n )\n $\n \u53ea\u8981 $m != k pi$ \u65b9\u7a0b\u4e00\u5b9a\u6709\u89e3\u3002\u82e5\u521d\u503c\u4e3a $(0, 0)$ \u5219\u9664\u975e $m = k pi$ \u65b9\u7a0b\u65e0\u89e3\n == 2\n \u8fd9\u662f\u6b27\u62c9\u65b9\u7a0b\uff0c\u4ee4 $x = e^t$\u3002\u8ba1\u7b97\uff1a\n $\n der(y, x) = der(y, t)der(t, x) = der(y, t) e^(-t)\\\n der(der(y, x), x) = der(der(y, x), t)der(t, x) = der( der(y, t) e^(-t), t) e^(-t) \\\n = ((dif^2 y)/(dif t^2) e^(-t) - der(y, t) e^(-t))e^(-t)\\\n x^2 der(der(y, x), x) = (dif^2 y)/(dif t^2) - der(y, t)\n $\n \u4ee3\u56de\u65b9\u7a0b\u5f97\uff1a\n $\n cases(\n (y'' - y') - lambda y' + lambda y = 0,\n y(0) = 0,\n y(ln 2) = 0\n\n )\n \n $\n \u65b9\u7a0b\u5316\u4e3a\uff1a\n $\n y'' -(lambda + 1)y' + lambda y = 0\n $\n - $lambda != 1$ \u65f6\u7279\u5f81\u6839\u5206\u522b\u4e3a $1, lambda$\uff0c\u901a\u89e3\u4e3a\uff1a\n $\n linearCombinationC(e^x, e^(lambda x))\n $\n \u4ee3\u5165\u521d\u503c\uff1a\n $\n cases(\n C_1 + C_2 = 0,\n 2 C_1 + 2^lambda C_2 = 0\n )\n $\n \u6709\u975e\u96f6\u89e3\u5f53\u4e14\u4ec5\u5f53 $lambda = 1$ \uff0c\u8fd9\u662f\u4e0d\u53ef\u80fd\u7684\n - $lambda = 1$ \u65f6\u901a\u89e3\u4e3a\uff1a\n $\n linearCombinationC(x e^x, e^x)\n $\n \u4ee3\u5165\u521d\u503c\uff1a\n $\n cases(\n C_2 = 0,\n 2 ln 2 C_1 + 2 C_2 = 0\n )\n $\n \u4ecd\u7136\u65e0\u975e\u96f6\u89e3\n == 4\n \u7528\u5e38\u6570\u53d8\u6613\u6cd5\uff0c\u5047\u8bbe $u_1, u_2$ \u662f\u5bf9\u5e94\u9f50\u6b21\u65b9\u7a0b\u7684\u4e24\u4e2a\u57fa\u89e3\uff0c\u8bbe\uff1a\n $\n y = linearCombinationC(u_1, u_2)\\\n y' = linearCombinationC(u'_1, u'_2) + C'_1 u_1 + C'_2 u_2\\\n $\n \u8bbe $C'_1 u_1 + C'_2 u_2 = 0$\uff0c\u7ee7\u7eed\u6c42\u5bfc\uff1a\n $\n y'' = linearCombinationC(u''_1, u''_2) + C'_1 u'_1 + C'_2 u'_2\\\n linearCombinationC(u''_1, u''_2) + C'_1 u'_1 + C'_2 u'_2 + (lambda r(x) +q(x)) linearCombinationC(u_1, u_2) = f(x)\\\n C'_1 u'_1 + C'_2 u'_2 = f(x)\n $\n \u5f97\u5230\u65b9\u7a0b\u7ec4\uff1a\n $\n cases(\n C'_1 u_1 + C'_2 u_2 = 0,\n C'_1 u'_1 + C'_2 u'_2 = f(x)\n )\n $\n \u89e3\u5f97\uff1a\n $\n C'_2 (u_1 u'_2 - u'_1 u_2) = f(x) u_1\\\n C'_2 = (f(x) u_1) / (u_1 u'_2 - u'_1 u_2)\\\n C'_1 = (f(x) u_2) / (u'_1 u_2 - u_1 u'_2)\\\n C_2 = integral_(0)^(x) (f u_1) / (u_1 u'_2 - u'_1 u_2) + A_2\\\n C_1 = integral_(0)^(x) (f u_2) / (u'_1 u_2 - u_1 u'_2) + A_1\n $\n \u4ee3\u5165\u8fb9\u503c\uff1a\n $\n cases(\n (C_1 (0) u_1 (0) + C_2 (0) u_2 (0)) cos alpha - (C_1 (0) u'_1 (0) + C_2 (0) u'_2 (0)) sin alpha = 0,\n (C_1 (1) u_1 (1) + C_2 (1) u_2 (1)) cos alpha - (C_1 (1) u'_1 (1) + C_2 (1) u'_2 (1)) sin alpha = 0\n )\n $\n \u89c2\u5bdf\u53d1\u73b0\uff0c\u8fd9\u662f\u5173\u4e8e $A_1, A_2$ \u7684\u975e\u9f50\u6b21\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u7cfb\u6570\u77e9\u9635\u4e3a\uff1a\n $\n mat(u_1 (0) cos alpha - u'_1 (0) sin alpha, u_2 (0) cos alpha - u'_2 (0) sin alpha; u_1 (1) cos alpha - u'_1 (1) sin alpha, u_2 (1) cos alpha - u'_2 (1) sin alpha)\n $\n - \u82e5\u5176\u6ee1\u79e9\uff0c\u4e0d\u96be\u53d1\u73b0\u65b9\u7a0b\u7ec4\u6709\u552f\u4e00\u89e3\n - \u5426\u5219\uff0c\u4e24\u884c\u7ebf\u6027\u76f8\u5173\uff0c\u4e0d\u96be\u5f97\u5230\u9f50\u6b21\u5fae\u5206\u65b9\u7a0b\u7684\u7279\u5f81\u51fd\u6570\uff0c\u8fdb\u800c $lambda$ \u4e00\u5b9a\u662f\u7279\u5f81\u503c\u3002\u6b64\u65f6\u4e0d\u59a8\u8bbe $u_1$ \u662f\u7279\u5f81\u51fd\u6570\uff0c\u65b9\u7a0b\u5316\u7b80\u4e3a\uff1a\n $\n cases(\n C_2 (0) u_2 (0) cos alpha - C_2 (0) u'_2 (0) sin alpha = 0,\n C_2 (1) u_2 (1) cos alpha - C_2 (1) u'_2 (1) sin alpha = 0\n )\n $\n \u65ad\u8a00 $u_2 (0) cos alpha - u'_2 (0) sin alpha != 0,u_2 (1) cos alpha - u'_2 (1) sin alpha != 0$ \uff0c\u5426\u5219 $u_1, u_2$ \u5728 $0$ \u6216 $1$ \u5904\u7ebf\u6027\u76f8\u5173\uff0c\u5bfc\u81f4\u6574\u4e2a\u89e3\u7ebf\u6027\u76f8\u5173\uff0c\u4e0e\u65e0\u5173\u5047\u8bbe\u77db\u76fe\uff01\u56e0\u6b64\u4e0a\u5f0f\u6709\u89e3\u5f53\u4e14\u4ec5\u5f53 $C_2 (0) = C_2 (1)$\n\n \u53e6\u4e00\u65b9\u9762\uff0c\u4ee4 $u_1 u'_2 - u'_1 u_2 = W(x)$\uff0c\u5219\u6709\uff1a\n $\n W'(x) = u_1 u''_2 - u''_1 u_2 = (lambda r(x) + q(x)) (u_1 u_2 - u_1 u_2) = 0\n $\n \u8868\u660e $W(x)$ \u662f\u5e38\u6570\uff0c\u5f53\u7136\u975e\u96f6\uff08\u5426\u5219 $u_1, u_2$ \u76f8\u5173\uff09\uff0c\u56e0\u6b64\uff1a\n $\n C_2 (0) = C_2 (1) <=> integral_(0)^(1) (f u_1) / (u_1 u'_2 - u'_1 u_2) = 0 <=> integral_(0)^(1) f u_1 = 0\n $\n \u8bc1\u6bd5\n= \n == \n $\n partialDer(z, x) - y / (x + 2y) partialDer(z, y) = 0\\\n (dif x)/(x + 2 y) + (dif y)/y = 0\\\n y' = - y/(x + 2 y)\\\n u = y /x \\\n y = x u\\\n y' = u + x u' = - u/(1 + 2 u)\\\n x u' + (2 u + 2 u^2)/(1 + 2 u) = 0\\\n 1/x x' + (1 + 2 u)/(2 u + 2 u^2) = 0\\\n 1/x dif x + (1 + 2 u)/(2 u + 2 u^2) dif u = 0\\\n dif ln x + dif 1/2 ln (2 u + 2 u^2) = 0\\\n ln x + 1/2 ln (2 y/x + 2 y^2/x^2) = C\\\n $\n ==\n $\n (dif x)/ (x - z) = (dif y)/ (y - z) = (dif z) / (2 z)\\\n (dif x)/ (x - z) = (dif z) / (2 z)\\\n 2 z dif x - (x - z) dif z = 0\\\n 2 dif x - (x / z - 1) dif z = 0\\\n u = x / z, x = z u, dif x = u dif z + z dif u\\\n 2 (u dif z + z dif u) - (u - 1) dif z = 0\\\n (u + 1) dif z + 2 z dif u = 0\\\n 1/z dif z + 2/(u + 1) dif u = 0\\\n ln z + 2 ln (u + 1) = C\\\n (x/z+1)^2 z = C\\\n (x - z) partialDer(u, x) = 2 (x/z + 1)(x - z)\\\n partialDer(u, z) = (x/z+1)^2 + z (-x/z^2) 2(x/z + 1)\\\n 2 z partialDer(u, z) = 2(x+z)(x/z + 1) -4 x (x/z + 1) = \n $\n $\n (dif y)/ (y - z) = (dif z) / (2 z)\\\n (y/z + 1)^2 z = C\n $\n == \n $\n (dif x)/(x y) = (dif y)/(x - 2 z) = (dif z)/(y z) \n $\n $\n (dif x)/(x) = (dif z)/(z)\\\n x/z = C_1 \n $\n $\n y' = (x - 2 z)/(x y)\\\n z' = z / x\\\n y y' + 2 z' = 1\\\n 1/2 y^2 + 2 z - x = C\\\n $\n $\n z = 1/2 x -1/4 y^2\\\n x y partialDer(z, x) = 1/2 x y\\\n (x - 2 z) partialDer(z, y) = (x - 2 z) (-1/2 y) \n $\n $\n (dif x_i)/(x_i) = (dif y)/(k y)\\\n ln x_i - 1/k ln (k y) = 0\\\n y = C x_i^k\n $\n" }, { "repo": "https://github.com/NOOBDY/formal-language", "file": "https://raw.githubusercontent.com/NOOBDY/formal-language/main/README.md", "language": "markdown", "license": "The Unlicense", "content": "# Formal Language 2024 Spring\n\n```\ntypst c main.typ\n```\n" }, { "repo": "https://github.com/Shuenhoy/modern-zju-thesis", "file": "https://raw.githubusercontent.com/Shuenhoy/modern-zju-thesis/master/pages/undergraduate-proposal-eval.typ", "language": "typst", "license": "MIT License", "content": "#import \"../utils/fonts.typ\": \u5b57\u53f7, \u5b57\u4f53\n#import \"../utils/datetime-display.typ\": datetime-display\n#import \"./template-individual.typ\": template-individual\n\n#let undergraduate-proposal-eval(\n comment,\n scores-supervisor: none,\n scores-college: none,\n) = {\n template-individual(\"\u6bd5\u4e1a\u8bba\u6587\uff08\u8bbe\u8ba1\uff09\u6587\u732e\u7efc\u8ff0\u548c\u5f00\u9898\u62a5\u544a\u8003\u6838\", outlined: true)[\n #set text(weight: \"bold\", size: \u5b57\u53f7.\u5c0f\u56db)\n \u5bfc\u5e08\u5bf9\u5f00\u9898\u62a5\u544a\u3001\u5916\u6587\u7ffb\u8bd1\u548c\u6587\u732e\u7efc\u8ff0\u7684\u8bc4\u8bed\u53ca\u6210\u7ee9\u8bc4\u5b9a\uff1a\\\n\n #comment\n\n #v(0.8fr)\n #align(right)[\n #table(\n columns: 4,\n align: center,\n [\u6210\u7ee9\u6bd4\u4f8b], [\u6587\u732e\u7efc\u8ff0#linebreak() \uff0810%\uff09], [\u5f00\u9898\u62a5\u544a#linebreak()\uff0815%\uff09], [\u5916\u6587\u7ffb\u8bd1#linebreak()\uff085%\uff09],\n [\u5206\u503c], ..(\n if scores-supervisor == none {\n ()\n } else {\n (\n [#scores-supervisor.at(0)],\n [#scores-supervisor.at(1)],\n [#scores-supervisor.at(2)],\n )\n }\n )\n )\n \u5bfc\u5e08\u7b7e\u540d#box(width: 5em, stroke: (bottom: 0.5pt))\\\n \u5e74#h(2em)\u6708#h(2em)\u65e5\n ]\n\n #v(1em)\n \u5b66\u9662\u76f2\u5ba1\u4e13\u5bb6\u5bf9\u5f00\u9898\u62a5\u544a\u3001\u5916\u6587\u7ffb\u8bd1\u548c\u6587\u732e\u7efc\u8ff0\u7684\u8bc4\u8bed\u53ca\u6210\u7ee9\u8bc4\u5b9a\uff1a\n #v(1fr)\n\n\n\n #align(right)[\n #table(\n columns: 4,\n align: center,\n [\u6210\u7ee9\u6bd4\u4f8b], [\u6587\u732e\u7efc\u8ff0#linebreak() \uff0810%\uff09], [\u5f00\u9898\u62a5\u544a#linebreak()\uff0815%\uff09], [\u5916\u6587\u7ffb\u8bd1#linebreak()\uff085%\uff09],\n [\u5206\u503c], ..(\n if scores-college == none {\n ()\n } else {\n (\n [#scores-college.at(0)],\n [#scores-college.at(1)],\n [#scores-college.at(2)],\n )\n }\n )\n\n )\n \u5f00\u9898\u62a5\u544a\u5ba1\u6838\u8d1f\u8d23\u4eba\uff08\u7b7e\u540d/\u7b7e\u7ae0\uff09#box(width: 5em, stroke: (bottom: 0.5pt))\\\n \u5e74#h(2em)\u6708#h(2em)\u65e5\n ]\n ]\n}" }, { "repo": "https://github.com/kicre/note", "file": "https://raw.githubusercontent.com/kicre/note/main/study/\u6d4b\u63a7/\u4eea\u5668\u4eea\u8868/\u62a5\u544a\u8bba\u6587.typ", "language": "typst", "license": "", "content": "// \u8bbe\u7f6e\u9875\u9762\n#set page(\n paper: \"a4\",\n margin: (\n top: 2.5cm, \n bottom: 2.0cm, \n left: 2.5cm, \n right: 2.0cm\n ),\n numbering: \"1\",\n number-align: center,\n)\n// \u8bbe\u7f6e\u6bb5\u843d\n#set par(\n first-line-indent: 2em,\n justify: true,\n leading: 20pt,\n)\n#let fake_par = {\n v(-1em)\n box()\n}\n#show heading: it => {\n it\n fake_par\n}\n\n// \u8bbe\u7f6e\u6b63\u6587\u6587\u5b57\u683c\u5f0f\n#set text(\n lang: \"zh\",\n region: \"cn\",\n font: (\"Times New Roman\", \"STsong\"),\n size: 12pt\n)\n\n//\u8bbe\u7f6e\u6807\u9898\u683c\u5f0f\n#set heading(numbering: \"1.1.1.1\")\n#show heading: it => locate(loc => {\n let levels = counter(heading).at(loc)\n let deepest = if levels != () {\n levels.last()\n } else {\n 1\n }\n\n set text(12pt)\n if it.level == 1 [\n #if deepest !=1 {\n pagebreak()\n }\n #set par(first-line-indent: 0pt)\n #let is-ack = it.body in ([Acknowledgment], [Acknowledgement])\n #set align(center)\n #set text(if is-ack { 15pt } else { 15pt },font:\"SimHei\")\n #v(36pt, weak: true)\n #if it.numbering != none and not is-ack {\n numbering(\"\u7b2c1\u7ae0.\", deepest)\n h(7pt, weak: true)\n }\n #it.body\n #v(36pt, weak: true)\n ]\n else if it.level == 2 [\n #set par(first-line-indent: 0pt)\n #set text(size:14pt,font:\"SimHei\")\n #v(24pt, weak: true)\n #if it.numbering != none {\n numbering(\"1.1.\",..levels)\n h(7pt, weak: true)\n }\n #it.body\n #v(24pt, weak: true)\n ]\n else if it.level == 3 [\n #set par(first-line-indent: 0pt)\n #set text(size:14pt,font:\"SimHei\")\n #v(15pt, weak: true)\n #if it.numbering != none {\n numbering(\"1.1.1.\",..levels)\n h(7pt, weak: true)\n }\n #it.body\n #v(15pt, weak: true)\n ]\n else [\n #set par(first-line-indent: 0pt)\n #set text(size:12pt,font:\"SimHei\")\n #v(12pt, weak: true)\n #if it.numbering != none {\n numbering(\"1.1.1.1.\",..levels)\n h(7pt, weak: true)\n }\n #it.body\n #v(12pt, weak: true) \n ]\n})\n\n#align(center, text(36pt,font: \"STXinwei\")[\n *\u672c\u79d1\u751f\u6bd5\u4e1a\u8bbe\u8ba1*\n])\n#align(center, text(28pt,font: \"STXihei\")[\n *\u667a\u80fd\u624b\u6301\u5f0f\u6fc0\u5149\u6d4b\u8ddd\u4eea*\n])\n\n#grid(\n columns: (1fr, 2fr),\n align(center)[\n \u59d3\u540d \\\n \u5b66\u53f7 \\\n \u9662\u7cfb \\\n \u4e13\u4e1a \\\n \u6307\u5bfc\u6559\u5e08 \\\n ],\n align(center)[\n \u738b\u607a \\\n 20201804070\n \u8d28\u91cf\u6280\u672f\u76d1\u7763\u5b66\u9662 \\\n \u6d4b\u63a7\u6280\u672f\u4e0e\u4eea\u5668 \\\n \u5218\u7428 \\\n ]\n)\n\n#align(center)[\n #set par(justify: false)\n = \u6458\u8981 \\\n \u672c\u8bfe\u7a0b\u8bbe\u8ba1\u9879\u76ee\u8bbe\u8ba1\u4e86\u4e00\u6b3e\u57fa\u4e8e LS-K-100\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u548c ESP32 \u7684\u9ad8\u7cbe\u5ea6\u6fc0\u5149\u6d4b\u8ddd\u4eea\u3002\u8be5\u6d4b\u8ddd\u4eea\u8bbe\u8ba1\u7528\u4e8e\u5b9e\u73b0 100 \u7c73\u8303\u56f4\u5185\u7684 \u00b12mm \u9ad8\u7cbe\u5ea6\u6d4b\u91cf\uff0c\u9002\u7528\u4e8e\u5bb6\u88c5\u6d4b\u91cf\u3001\u5de5\u4e1a\u63a7\u5236\u7b49\u9886\u57df\u3002\u62a5\u544a\u4ece\u786c\u4ef6\u9009\u578b\u3001\u539f\u7406\u56fe PCB \u8bbe\u8ba1\u3001\u8f6f\u4ef6\u7f16\u7a0b\u5230\u7ed3\u6784\u5efa\u6a21\u7b49\u65b9\u9762\uff0c\u5168\u9762\u9610\u8ff0\u4e86\u4ea7\u54c1\u5f00\u53d1\u6d41\u7a0b\uff0c\u5e76\u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684\u5f00\u53d1\u6b65\u9aa4\u548c\u5b9e\u73b0\u7ec6\u8282\u3002\u901a\u8fc7\u672c\u8bfe\u7a0b\u8bbe\u8ba1\u638c\u63e1\u786c\u4ef6\u8bbe\u8ba1\u4e0e\u8f6f\u4ef6\u7f16\u7a0b\u7684\u57fa\u7840\u77e5\u8bc6\uff0c\u63d0\u5347\u89e3\u51b3\u5b9e\u9645\u95ee\u9898\u7684\u80fd\u529b\u3002\u672a\u6765\u5de5\u4f5c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u4f18\u5316\u7cfb\u7edf\u6027\u80fd\uff0c\u5982\u63d0\u9ad8\u6d4b\u91cf\u7cbe\u5ea6\u3001\u964d\u4f4e\u529f\u8017\u3001\u589e\u52a0\u65e0\u7ebf\u901a\u4fe1\u529f\u80fd\u7b49\u3002\n \n #strong[\u5173\u952e\u8bcd:] \u6fc0\u5149\u6d4b\u8ddd\uff1bPLS-K-100\uff1bESP32\uff1b\u9ad8\u7cbe\u5ea6\u6d4b\u91cf\n]\n\n#outline(depth: 4,indent: 2em)\n\n= \u524d\u8a00\n\n\u5728\u73b0\u4ee3\u5de5\u4e1a\u548c\u65e5\u5e38\u751f\u6d3b\u4e2d\uff0c\u7cbe\u786e\u6d4b\u91cf\u6210\u4e3a\u4e86\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u548c\u8d28\u91cf\u7684\u5173\u952e\u56e0\u7d20\u3002\u6fc0\u5149\u6d4b\u8ddd\u4eea\u4f5c\u4e3a\u4e00\u79cd\u9ad8\u7cbe\u5ea6\u3001\u975e\u63a5\u89e6\u5f0f\u7684\u6d4b\u91cf\u5de5\u5177\uff0c\u5176\u5728\u5efa\u7b51\u6d4b\u91cf\u3001\u5ba4\u5185\u88c5\u4fee\u3001\u673a\u68b0\u5236\u9020\u7b49\u9886\u57df\u7684\u5e94\u7528\u65e5\u76ca\u5e7f\u6cdb\u3002\u968f\u7740\u6280\u672f\u7684\u53d1\u5c55\uff0c\u5bf9\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u6d4b\u91cf\u7cbe\u5ea6\u548c\u64cd\u4f5c\u4fbf\u6377\u6027\u63d0\u51fa\u4e86\u66f4\u9ad8\u7684\u8981\u6c42\u3002\n\n\u672c\u8bfe\u7a0b\u8bbe\u8ba1\u65e8\u5728\u5f00\u53d1\u4e00\u6b3e\u57fa\u4e8e PLS-K-100 \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u548c ESP32 \u5fae\u63a7\u5236\u5668\u7684\u9ad8\u7cbe\u5ea6\u6fc0\u5149\u6d4b\u8ddd\u4eea\u3002PLS-K-100 \u4ee5\u5176\u9ad8\u7cbe\u5ea6\u3001\u5feb\u901f\u54cd\u5e94\u548c\u6613\u4e8e\u96c6\u6210\u7684\u7279\u70b9\uff0c\u6210\u4e3a\u672c\u9879\u76ee\u7684\u6838\u5fc3\u5143\u5668\u4ef6\u3002\u800cESP32\u4f5c\u4e3a\u591a\u529f\u80fd\u7684\u5fae\u63a7\u5236\u5668\uff0c\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5904\u7406\u80fd\u529b\uff0c\u8fd8\u652f\u6301 Wi-Fi \u548c\u84dd\u7259\u901a\u4fe1\uff0c\u4e3a\u4ea7\u54c1\u7684\u667a\u80fd\u5316\u548c\u7f51\u7edc\u5316\u63d0\u4f9b\u4e86\u53ef\u80fd\u3002\n\n\u8bbe\u8ba1\u76ee\u6807\u662f\u5b9e\u73b0\u4e00\u6b3e\u80fd\u591f\u5728 100 \u7c73\u8303\u56f4\u5185\u63d0\u4f9b \u00b12mm \u6d4b\u91cf\u7cbe\u5ea6\u7684\u6fc0\u5149\u6d4b\u8ddd\u4eea\uff0c\u540c\u65f6\u5177\u5907\u7528\u6237\u53cb\u597d\u7684\u64cd\u4f5c\u754c\u9762\u548c\u4f4e\u529f\u8017\u8bbe\u8ba1\u3002\u672c\u9879\u76ee\u91c7\u7528\u5f00\u6e90\u786c\u4ef6\u548c\u8f6f\u4ef6\u5e73\u53f0\uff0c\u4ee5\u4fbf\u4e8e\u5feb\u901f\u5f00\u53d1\u548c\u8fed\u4ee3\uff0c\u540c\u65f6\u4e5f\u4fbf\u4e8e\u7406\u89e3\u548c\u5b66\u4e60\u6574\u4e2a\u8bbe\u8ba1\u6d41\u7a0b\u3002\n\n\u901a\u8fc7\u672c\u8bfe\u7a0b\u8bbe\u8ba1\uff0c\u6df1\u5165\u4e86\u89e3\u786c\u4ef6\u7535\u8def\u8bbe\u8ba1\u3001\u5fae\u63a7\u5236\u5668\u7f16\u7a0b\u3001\u4ee5\u53ca\u4ea7\u54c1\u539f\u578b\u5236\u4f5c\u7b49\u5173\u952e\u6280\u672f\u3002\u6b64\u5916\uff0c\u4e5f\u5c06\u5b66\u4e60\u5230\u5982\u4f55\u5c06\u7406\u8bba\u77e5\u8bc6\u5e94\u7528\u4e8e\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u89e3\u51b3\u5b9e\u9645\u95ee\u9898\uff0c\u57f9\u517b\u521b\u65b0\u601d\u7ef4\u548c\u5de5\u7a0b\u5b9e\u8df5\u80fd\u529b\u3002\u6700\u7ec8\uff0c\u672c\u9879\u76ee\u7684\u6210\u529f\u5b9e\u65bd\u5c06\u4e3a\u5b66\u751f\u63d0\u4f9b\u4e00\u4e2a\u5b8c\u6574\u7684\u7535\u5b50\u4ea7\u54c1\u5f00\u53d1\u7ecf\u9a8c\uff0c\u4e3a\u672a\u6765\u7684\u804c\u4e1a\u751f\u6daf\u6253\u4e0b\u575a\u5b9e\u7684\u57fa\u7840\u3002\n\n= \u8bbe\u8ba1\u76ee\u6807\u4e0e\u8981\u6c42\n\n\u672c\u8bfe\u7a0b\u8bbe\u8ba1\u7684\u6838\u5fc3\u76ee\u6807\u662f\u5f00\u53d1\u4e00\u6b3e\u9ad8\u7cbe\u5ea6\u6fc0\u5149\u6d4b\u8ddd\u4eea\uff0c\u4ee5\u4e0b\u4e3a\u9879\u76ee\u8bbe\u8ba1\u7684\u6280\u672f\u8981\u6c42\u548c\u6027\u80fd\u6307\u6807\uff1a\n\n+ *\u6d4b\u91cf\u8303\u56f4\uff1a* \u80fd\u591f\u5728 100 \u7c73\u8303\u56f4\u5185\u8fdb\u884c\u6d4b\u91cf\uff0c\u4ee5\u9002\u5e94\u591a\u79cd\u6d4b\u91cf\u573a\u666f\uff0c\u5305\u62ec\u5ba4\u5185\u548c\u5ba4\u5916\u73af\u5883\u3002\n+ *\u6d4b\u91cf\u7cbe\u5ea6\uff1a* \u6d4b\u91cf\u7cbe\u5ea6 \u00b12mm\uff0c\u4ee5\u786e\u4fdd\u6d4b\u91cf\u7ed3\u679c\u7684\u51c6\u786e\u6027\uff0c\u6ee1\u8db3\u9ad8\u7cbe\u5ea6\u6d4b\u91cf\u7684\u9700\u6c42\u3002\n+ *\u54cd\u5e94\u65f6\u95f4\uff1a* \u5177\u6709\u5feb\u901f\u54cd\u5e94\u80fd\u529b\uff0c\u6d4b\u91cf\u54cd\u5e94\u65f6\u95f4\u518d 1 \u79d2\u5de6\u53f3\uff0c\u4ee5\u4fbf\u4e8e\u7528\u6237\u5b9e\u65f6\u83b7\u53d6\u6d4b\u91cf\u6570\u636e\u3002\n+ *\u7535\u6e90\uff1a* \u8bbe\u5907\u91c7\u7528\u5355\u8282\u9502\u7535\u6c60\u4f9b\u7535\uff0c\u4ee5\u4fbf\u4e8e\u643a\u5e26\u548c\u4f7f\u7528\uff0c\u540c\u65f6\u8003\u8651\u5230\u7535\u6c60\u7684\u7eed\u822a\u80fd\u529b\u548c\u5145\u7535\u4fbf\u6377\u6027\u3002\n+ *\u663e\u793a\uff1a* \u914d\u5907 OLED \u5c4f\u5e55\uff0c\u7528\u4e8e\u76f4\u89c2\u663e\u793a\u6d4b\u91cf\u7ed3\u679c\u548c\u8bbe\u5907\u72b6\u6001\uff0c\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u3002\n+ *\u64cd\u4f5c\uff1a* \u8bbe\u5907\u901a\u8fc7\u5b9e\u4f53\u6309\u952e\u64cd\u4f5c\u529f\u80fd\uff0c\u5305\u62ec\u5f00\u5173\u673a\u3001\u6d4b\u91cf\u6a21\u5f0f\u5207\u6362\u3001\u5355\u4f4d\u9009\u62e9\u7b49\uff0c\u786e\u4fdd\u7528\u6237\u53ef\u4ee5\u5728\u5404\u79cd\u6761\u4ef6\u4e0b\u64cd\u4f5c\u5b9e\u73b0\u5b9e\u73b0\u9700\u6c42\u3002\n+ *\u73af\u5883\u9002\u5e94\u6027\uff1a* \u5177\u6709\u826f\u597d\u7684\u73af\u5883\u9002\u5e94\u6027\uff0c\u80fd\u591f\u5728 -30\u2103 \u81f3 +60\u2103 \u7684\u6e29\u5ea6\u8303\u56f4\u5185\u6b63\u5e38\u5de5\u4f5c\uff0c\u6ee1\u8db3\u4e0d\u540c\u6c14\u5019\u6761\u4ef6\u4e0b\u7684\u4f7f\u7528\u9700\u6c42\u3002\n+ *\u5b89\u5168\u6027\uff1a* \u7b26\u5408\u76f8\u5173\u5b89\u5168\u6807\u51c6\uff0c\u786e\u4fdd\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u5bf9\u7528\u6237\u6216\u5468\u56f4\u73af\u5883\u9020\u6210\u5371\u5bb3\u3002\n+ *\u6613\u7528\u6027\uff1a* \u8bbe\u8ba1\u5e94\u7b80\u6d01\u660e\u4e86\uff0c\u6613\u4e8e\u7528\u6237\u7406\u89e3\u548c\u64cd\u4f5c\uff0c\u540c\u65f6\u8003\u8651\u8bbe\u5907\u7684\u4fbf\u643a\u6027\u548c\u8010\u7528\u6027\u3002\n+ *\u53ef\u6269\u5c55\u6027\uff1a* \u8bbe\u8ba1\u7559\u6709\u6709\u826f\u597d\u7684\u53ef\u6269\u5c55\u6027\uff0c\u4fbf\u4e8e\u672a\u6765\u6839\u636e\u9700\u8981\u589e\u52a0\u65b0\u7684\u529f\u80fd\u6216\u8fdb\u884c\u6280\u672f\u5347\u7ea7\u3002\n\n\u901a\u8fc7\u5b9e\u73b0\u4e0a\u8ff0\u76ee\u6807\uff0c\u672c\u8bfe\u7a0b\u8bbe\u8ba1\u65e8\u5728\u63d0\u4f9b\u4e00\u4e2a\u9ad8\u6027\u80fd\u3001\u6613\u7528\u3001\u53ef\u9760\u7684\u6fc0\u5149\u6d4b\u8ddd\u4eea\u89e3\u51b3\u65b9\u6848\uff0c\u4e0d\u4ec5\u80fd\u591f\u6ee1\u8db3\u5f53\u524d\u7684\u6d4b\u91cf\u9700\u6c42\uff0c\u8fd8\u5177\u6709\u4e00\u5b9a\u7684\u524d\u77bb\u6027\u548c\u53d1\u5c55\u6f5c\u529b\u3002\n\n= \u7cfb\u7edf\u8bbe\u8ba1\n\n== \u786c\u4ef6\u8bbe\u8ba1\n\n=== \u786c\u4ef6\u8bbe\u8ba1\u6982\u8ff0\n\n\u786c\u4ef6\u8bbe\u8ba1\u662f\u5b9e\u73b0\u9ad8\u7cbe\u5ea6\u6fc0\u5149\u6d4b\u8ddd\u4eea\u529f\u80fd\u7684\u57fa\u7840\uff0c\u6d89\u53ca\u5143\u5668\u4ef6\u7684\u9009\u62e9\u3001\u7535\u8def\u8bbe\u8ba1\u3001PCB \u5e03\u5c40\u4ee5\u53ca\u5916\u58f3\u8bbe\u8ba1\u7b49\u591a\u4e2a\u65b9\u9762\u3002\u672c\u8282\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u786c\u4ef6\u8bbe\u8ba1\u7684\u5404\u4e2a\u73af\u8282\u3002\n\n=== \u6838\u5fc3\u5143\u5668\u4ef6\u9009\u62e9\n\n\u6838\u5fc3\u5143\u5668\u4ef6\u7684\u9009\u62e9\u5bf9\u6574\u4e2a\u7cfb\u7edf\u7684\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u672c\u9879\u76ee\u7684\u6838\u5fc3\u5143\u5668\u4ef6\u4e3a PLS-K-100 \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\uff0c\u7531\u5b83\u63d0\u4f9b\u9ad8\u7cbe\u5ea6\u7684\u6d4b\u91cf\u6570\u636e\u3002\n\n*PLS-K-100 \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\uff1a*\n\nPLS-K-100 \u662f\u4e00\u6b3e\u9ad8\u7cbe\u5ea6\u3001\u957f\u8ddd\u79bb\u7684\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\uff0c\u5b83\u91c7\u7528\u4e86\u5148\u8fdb\u7684\u6fc0\u5149\u6d4b\u8ddd\u6280\u672f\uff0c\u80fd\u591f\u5728 100 \u7c73\u8303\u56f4\u5185\u63d0\u4f9b \u00b12mm \u7684\u6d4b\u91cf\u7cbe\u5ea6\u3002\u8be5\u6a21\u5757\u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a\n\n- *\u9ad8\u7cbe\u5ea6*\uff1a\u6d4b\u91cf\u7cbe\u5ea6\u9ad8\u8fbe \u00b12mm\uff0c\u9002\u7528\u4e8e\u9700\u8981\u7cbe\u786e\u6d4b\u91cf\u7684\u5e94\u7528\u573a\u666f\u3002\n- *\u957f\u6d4b\u91cf\u8ddd\u79bb*\uff1a\u6700\u5927\u6d4b\u91cf\u8ddd\u79bb\u53ef\u8fbe 100 \u7c73\uff0c\u9002\u7528\u4e8e\u5ba4\u5185\u5916\u5404\u79cd\u6d4b\u91cf\u4efb\u52a1\u3002\n- *\u5feb\u901f\u54cd\u5e94*\uff1a\u6d4b\u91cf\u901f\u5ea6\u5feb\uff0c\u80fd\u591f\u5728\u77ed\u65f6\u95f4\u5185\u63d0\u4f9b\u6d4b\u91cf\u7ed3\u679c\u3002\n- *\u4e32\u53e3\u901a\u4fe1*\uff1a\u901a\u8fc7\u4e32\u53e3\u4e0e\u5fae\u63a7\u5236\u5668\u901a\u4fe1\uff0c\u4fbf\u4e8e\u6570\u636e\u4f20\u8f93\u548c\u5904\u7406\u3002\n- *\u4f4e\u529f\u8017*\uff1a\u8bbe\u8ba1\u8003\u8651\u4e86\u8282\u80fd\uff0c\u9002\u5408\u957f\u65f6\u95f4\u4f7f\u7528\u3002\n- *\u6613\u4e8e\u96c6\u6210*\uff1a\u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u65b9\u4fbf\u4e0e\u5176\u4ed6\u786c\u4ef6\u7cfb\u7edf\u96c6\u6210\u3002\n\n=== \u5fae\u63a7\u5236\u5668\u9009\u62e9\u4e0e\u7f16\u7a0b\n\n\u5fae\u63a7\u5236\u5668\u7684\u9009\u62e9\u57fa\u4e8e\u5176\u5904\u7406\u80fd\u529b\u3001\u901a\u4fe1\u63a5\u53e3\u4ee5\u53ca\u5bf9\u5916\u90e8\u5e93\u7684\u652f\u6301\u3002ESP32\u56e0\u5176\u5f3a\u5927\u7684\u5904\u7406\u80fd\u529b\u3001\u5185\u7f6eWi-Fi\u548c\u84dd\u7259\u529f\u80fd\uff0c\u4ee5\u53ca\u5bf9Arduino\u7f16\u7a0b\u73af\u5883\u7684\u826f\u597d\u652f\u6301\u800c\u88ab\u9009\u4e3a MCU\u3002\u7f16\u7a0b\u73af\u5883\u91c7\u7528 Arduino IDE\uff0c\u5229\u7528Arduino \u6846\u67b6\u4e30\u5bcc\u7684\u5e93\u548c\u793e\u533a\u652f\u6301\u7b80\u5316\u5f00\u53d1\u8fc7\u7a0b\u3002\n\n*ESP32* \u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684 MCU \u5355\u5143\uff0c\u5b83\u96c6\u6210\u4e86Wi-Fi\u3001\u84dd\u7259\u548c\u591a\u4e2a\u4e32\u53e3\u901a\u4fe1\u63a5\u53e3\uff0c\u975e\u5e38\u9002\u5408\u4e8e\u7269\u8054\u7f51(IoT) \u5e94\u7528\u3002\u4ee5\u4e0b\u662f ESP32 \u7684\u4e00\u4e9b\u5173\u952e\u7279\u6027\uff1a\n\n- *\u591a\u6838\u5904\u7406\u5668*\uff1a\u5177\u6709\u53cc\u6838\u5904\u7406\u5668\uff0c\u53ef\u4ee5\u540c\u65f6\u5904\u7406\u591a\u4e2a\u4efb\u52a1\uff0c\u63d0\u9ad8\u7cfb\u7edf\u6027\u80fd\u3002\n- *\u4e30\u5bcc\u7684\u901a\u4fe1\u63a5\u53e3*\uff1a\u652f\u6301 Wi-Fi\u3001\u84dd\u7259\u3001SPI\u3001I2C\u3001UART \u7b49\u591a\u79cd\u901a\u4fe1\u534f\u8bae\uff0c\u4fbf\u4e8e\u4e0e\u5176\u4ed6\u8bbe\u5907\u8fde\u63a5\u3002\n- *\u5927\u5bb9\u91cf\u5185\u5b58*\uff1a\u5177\u6709\u8db3\u591f\u7684 RAM \u548c ROM\uff0c\u53ef\u4ee5\u8fd0\u884c\u590d\u6742\u7684\u5e94\u7528\u7a0b\u5e8f\u4ee5\u6ee1\u8db3\u9879\u76ee\u8981\u6c42\u3002\n- *\u4f4e\u529f\u8017\u6a21\u5f0f*\uff1a\u652f\u6301\u591a\u79cd\u4f4e\u529f\u8017\u6a21\u5f0f\uff0c\u9002\u5408\u7535\u6c60\u4f9b\u7535\u7684\u4fbf\u643a\u8bbe\u5907\u3002\n- *\u5f00\u53d1\u73af\u5883\u53cb\u597d*\uff1a\u652f\u6301 Arduino \u5f00\u53d1\u6846\u67b6\uff0c\u6709\u4e30\u5bcc\u7684\u5e93\u548c\u793e\u533a\u652f\u6301\uff0c\u6613\u4e8e\u5f00\u53d1\u548c\u8c03\u8bd5\u3002\n\n\u9009\u62e9 PLS-K-100 \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u4f5c\u4e3a\u6d4b\u91cf\u6838\u5fc3\uff0c\u662f\u56e0\u4e3a\u5176\u9ad8\u7cbe\u5ea6\u548c\u957f\u8ddd\u79bb\u6d4b\u91cf\u80fd\u529b\uff0c\u800c\u9009\u62e9 ESP32 \u5fae\u63a7\u5236\u5668\u5219\u662f\u56e0\u4e3a\u5b83\u5f3a\u5927\u7684\u5904\u7406\u80fd\u529b\u548c\u4e30\u5bcc\u7684\u901a\u4fe1\u63a5\u53e3\uff0c\u80fd\u591f\u6ee1\u8db3\u7cfb\u7edf\u5bf9\u6570\u636e\u5904\u7406\u548c\u7528\u6237\u4ea4\u4e92\u7684\u9700\u6c42\u3002\u8fd9\u4e24\u4e2a\u6838\u5fc3\u5143\u5668\u4ef6\u7684\u7ed3\u5408\uff0c\u4f7f\u5f97\u6211\u4eec\u7684\u6fc0\u5149\u6d4b\u8ddd\u4eea\u80fd\u591f\u5b9e\u73b0\u9ad8\u7cbe\u5ea6\u3001\u5feb\u901f\u54cd\u5e94\u548c\u7528\u6237\u53cb\u597d\u7684\u64cd\u4f5c\u4f53\u9a8c\u3002\n\n=== \u663e\u793a\u6a21\u5757\u8bbe\u8ba1\n\n\u663e\u793a\u6a21\u5757\u91c7\u7528 OLED \u5c4f\u5e55\uff0c\u4f18\u70b9\u662f\u4f4e\u529f\u8017\u3001\u9ad8\u5bf9\u6bd4\u5ea6\u548c\u4f18\u79c0\u7684\u53ef\u7f16\u7a0b\u6027\u3002OLED \u5c4f\u5e55\u901a\u8fc7 I2C \u63a5\u53e3\u4e0e ESP32 \u901a\u4fe1\uff0c\u663e\u793a\u6d4b\u91cf\u7ed3\u679c\u548c\u7cfb\u7edf\u72b6\u6001\u3002\n\n=== \u8f93\u5165\u6a21\u5757\u8bbe\u8ba1\n\n\u8f93\u5165\u6a21\u5757\u5305\u62ec\u4e00\u7ec4\u6309\u952e\uff0c\u7528\u4e8e\u7528\u6237\u64cd\u4f5c\u3002\u6309\u952e\u8bbe\u8ba1\u8003\u8651\u4e86\u8010\u7528\u6027\u4ee5\u53ca\u4e0d\u540c\u73af\u5883\u548c\u590d\u6742\u4f7f\u7528\u573a\u666f\u4e0b\u7684\u64cd\u4f5c\u4fbf\u5229\u6027\uff0c\u786e\u4fdd\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u8fdb\u884c\u6d4b\u91cf\u3001\u5207\u6362\u6a21\u5f0f\u7b49\u64cd\u4f5c\u3002\n\n=== \u7535\u6e90\u7ba1\u7406\u8bbe\u8ba1\n\n\u7535\u6e90\u7ba1\u7406\u6a21\u5757\u5305\u62ec\u7535\u6c60\u3001\u5145\u7535\u82af\u7247\u548c\u964d\u538b\u82af\u7247\u3002\u7535\u6c60\u9009\u7528\u5355\u8282\u9502\u7535\u6c60\uff0c\u4ee5\u4fbf\u4e8e\u643a\u5e26\u548c\u66f4\u6362\u3002TP5100 \u5145\u7535\u82af\u7247\u7528\u4e8e\u7535\u6c60\u5145\u7535\uff0cLP3220 \u964d\u538b\u82af\u7247\u5219\u7528\u4e8e\u5c06\u7535\u6c60\u7535\u538b\u7a33\u5b9a\u5730\u964d\u538b\u81f3 3.3V\u3002\n\n=== \u5916\u58f3\u8bbe\u8ba1\n\n\u5916\u58f3\u8bbe\u8ba1\u6682\u65f6\u91c7\u7528\u4e9a\u514b\u529b\u677f\u4e0e\u94dc\u67f1\u87ba\u6813\u76f4\u67b6\u56fa\u5b9a\u3002\u63d0\u4f9b\u7b80\u5355\u7684\u673a\u68b0\u652f\u6491\u548c\u9694\u79bb\u529f\u80fd\uff0c\u7ed3\u6784\u7a33\u56fa\u53ef\u9760\u4e14\u6613\u4e8e\u5b89\u88c5\uff0c\u540c\u65f6\u80fd\u591f\u6ee1\u8db3\u673a\u68b0\u548c\u9694\u79bb\u7684\u8981\u6c42\uff0c\u4fdd\u62a4 PCB \u677f\u5e76\u63d0\u4f9b\u989d\u5916\u652f\u6491\u3002\n\n=== PCB\u8bbe\u8ba1\n\nPCB\u8bbe\u8ba1\u662f\u786c\u4ef6\u8bbe\u8ba1\u7684\u53e6\u4e00\u4e2a\u5173\u952e\u73af\u8282\u3002\u8bbe\u8ba1\u65f6\u9700\u8003\u8651\u5143\u5668\u4ef6\u7684\u5e03\u5c40\u3001\u8d70\u7ebf\u4ee5\u53ca\u6563\u70ed\u3002PCB\u5e03\u5c40\u5e94\u5408\u7406\uff0c\u4ee5\u4fbf\u4e8e\u710a\u63a5\u548c\u7ef4\u4fee\u3002\u8d70\u7ebf\u5e94\u5c3d\u91cf\u77ed\u4e14\u907f\u514d\u4ea4\u53c9\uff0c\u4ee5\u51cf\u5c11\u5e72\u6270\u3002PCB\u8bbe\u8ba1\u8fd8\u5e94\u8003\u8651\u6563\u70ed\u95ee\u9898\uff0c\u786e\u4fdd\u8bbe\u5907\u5728\u957f\u65f6\u95f4\u5de5\u4f5c\u4e0b\u4e0d\u4f1a\u8fc7\u70ed\u3002\n\n=== \u710a\u63a5\u4e0e\u7ec4\u88c5\n\n\u710a\u63a5\u662f\u5c06PCB\u4e0a\u7684\u5143\u5668\u4ef6\u56fa\u5b9a\u5e76\u8fde\u63a5\u8d77\u6765\u7684\u8fc7\u7a0b\u3002\u710a\u63a5\u8d28\u91cf\u76f4\u63a5\u5f71\u54cd\u5230\u8bbe\u5907\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002\u710a\u63a5\u987a\u5e8f\u548c\u65b9\u6cd5\u5bf9\u710a\u63a5\u8d28\u91cf\u81f3\u5173\u91cd\u8981\u3002\u7ec4\u88c5\u8fc7\u7a0b\u5305\u62ec\u5c06\u710a\u63a5\u597d\u7684PCB\u88c5\u5165\u5916\u58f3\uff0c\u5b89\u88c5\u663e\u793a\u5c4f\u548c\u6309\u952e\uff0c\u4ee5\u53ca\u8fde\u63a5\u7535\u6c60\u3002\n\n=== \u6d4b\u8bd5\u4e0e\u8c03\u8bd5\n\n\u786c\u4ef6\u7ec4\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u8fdb\u884c\u5168\u9762\u7684\u6d4b\u8bd5\u548c\u8c03\u8bd5\uff0c\u5305\u62ec\u7535\u6e90\u6d4b\u8bd5\u3001\u529f\u80fd\u6d4b\u8bd5\u3001\u6027\u80fd\u6d4b\u8bd5\u7b49\uff0c\u786e\u4fdd\u8bbe\u5907\u6309\u7167\u8bbe\u8ba1\u8981\u6c42\u6b63\u5e38\u5de5\u4f5c\u3002\n\n==== \u6027\u80fd\u4f18\u5316\n\n\u5728\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u53d1\u73b0\u4e00\u4e9b\u6027\u80fd\u74f6\u9888\u6216\u4e0d\u8db3\u4e4b\u5904\u3002\u9488\u5bf9\u8fd9\u4e9b\u95ee\u9898\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f18\u5316\u7535\u8def\u8bbe\u8ba1\u3001\u6539\u8fdb\u710a\u63a5\u5de5\u827a\u6216\u8c03\u6574\u8f6f\u4ef6\u7b97\u6cd5\u7b49\u65b9\u5f0f\u8fdb\u884c\u6027\u80fd\u4f18\u5316\u3002\n\n=== \u7ed3\u8bba\n\n\u786c\u4ef6\u8bbe\u8ba1\u662f\u4e00\u4e2a\u590d\u6742\u7684\u8fc7\u7a0b\uff0c\u9700\u8981\u7efc\u5408\u8003\u8651\u591a\u79cd\u56e0\u7d20\u3002\u901a\u8fc7\u7cbe\u5fc3\u7684\u8bbe\u8ba1\u548c\u4e25\u8c28\u7684\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u786e\u4fdd\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u9ad8\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002\u672c\u8282\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u786c\u4ef6\u8bbe\u8ba1\u7684\u5404\u4e2a\u73af\u8282\uff0c\u4e3a\u540e\u7eed\u7684\u8f6f\u4ef6\u8bbe\u8ba1\u548c\u7cfb\u7edf\u5b9e\u73b0\u5960\u5b9a\u4e86\u575a\u5b9e\u7684\u57fa\u7840\u3002\n\n== \u8f6f\u4ef6\u8bbe\u8ba1\n\n\u8f6f\u4ef6\u8bbe\u8ba1\u662f\u5b9e\u73b0\u6fc0\u5149\u6d4b\u8ddd\u4eea\u529f\u80fd\u7684\u5173\u952e\u90e8\u5206\uff0c\u5b83\u6d89\u53ca\u5230\u7a0b\u5e8f\u7684\u903b\u8f91\u7ed3\u6784\u3001\u7528\u6237\u754c\u9762(UI)\u8bbe\u8ba1\u4ee5\u53ca\u4e0e\u786c\u4ef6\u7684\u4ea4\u4e92\u3002\u672c\u8282\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8f6f\u4ef6\u8bbe\u8ba1\u7684\u5404\u4e2a\u65b9\u9762\u3002\n\n=== \u7f16\u7a0b\u73af\u5883\u4e0e\u8bed\u8a00\n\n\u672c\u9879\u76ee\u91c7\u7528 Arduino \u7f16\u7a0b\u73af\u5883\uff0c\u4f7f\u7528 c++ \u8bed\u8a00\u8fdb\u884c\u5f00\u53d1\u3002Arduino \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u7535\u5b50\u539f\u578b\u5e73\u53f0\uff0c\u5b83\u5305\u542b\u4e86\u786c\u4ef6\uff08\u5404\u79cd\u578b\u53f7\u7684 Arduino \u677f\uff09\u548c\u8f6f\u4ef6\uff08Arduino IDE\uff09\u3002Arduino IDE \u63d0\u4f9b\u4e86\u4e00\u4e2a\u6613\u4e8e\u4f7f\u7528\u7684\u7f16\u7a0b\u73af\u5883\uff0c\u652f\u6301 c++ \u8bed\u8a00\uff0c\u5e76\u4e14\u6709\u4e30\u5bcc\u7684\u5e93\u548c\u793e\u533a\u652f\u6301\u3002\n\n=== \u7a0b\u5e8f\u7ed3\u6784\n\n\u7a0b\u5e8f\u7684\u4e3b\u8981\u7ed3\u6784\u5305\u62ec\u521d\u59cb\u5316\u3001\u4e3b\u5faa\u73af\u3001\u6309\u952e\u626b\u63cf\u3001\u6570\u636e\u5904\u7406\u548c\u663e\u793a\u66f4\u65b0\u7b49\u90e8\u5206\u3002\u7a0b\u5e8f\u5728\u521d\u59cb\u5316\u9636\u6bb5\u8bbe\u7f6e\u786c\u4ef6\u5f15\u811a\u3001\u521d\u59cb\u5316\u663e\u793a\u5c4f\u548c\u4e32\u53e3\u901a\u4fe1\u7b49\u3002\u4e3b\u5faa\u73af\u4e2d\u4e0d\u65ad\u68c0\u6d4b\u6309\u952e\u72b6\u6001\uff0c\u6839\u636e\u6309\u952e\u8f93\u5165\u6267\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\uff0c\u5982\u6d4b\u91cf\u8ddd\u79bb\u3001\u5207\u6362\u6d4b\u91cf\u6a21\u5f0f\u3001\u8c03\u6574\u5355\u4f4d\u7b49\u3002\u6570\u636e\u5904\u7406\u90e8\u5206\u8d1f\u8d23\u89e3\u6790\u6fc0\u5149\u6d4b\u8ddd\u4eea\u8fd4\u56de\u7684\u6570\u636e\uff0c\u5e76\u8ba1\u7b97\u51fa\u8ddd\u79bb\u3002\u663e\u793a\u66f4\u65b0\u90e8\u5206\u5219\u5c06\u6d4b\u91cf\u7ed3\u679c\u548c\u7cfb\u7edf\u72b6\u6001\u663e\u793a\u5728OLED\u5c4f\u5e55\u4e0a\u3002\n\n=== \u529f\u80fd\u5b9e\u73b0\n\n\u8f6f\u4ef6\u7684\u4e3b\u8981\u529f\u80fd\u5305\u62ec\uff1a\n\n- \u5355\u6b21\u6d4b\u91cf\uff1a\u7528\u6237\u6309\u4e0b\u6d4b\u91cf\u952e\uff0c\u7cfb\u7edf\u53d1\u9001\u6d4b\u91cf\u6307\u4ee4\uff0c\u7b49\u5f85\u6fc0\u5149\u6d4b\u8ddd\u4eea\u8fd4\u56de\u6570\u636e\uff0c\u7136\u540e\u663e\u793a\u6d4b\u91cf\u7ed3\u679c\u3002\n- \u8fde\u7eed\u6d4b\u91cf\uff1a\u7528\u6237\u8fdb\u5165\u8fde\u7eed\u6d4b\u91cf\u6a21\u5f0f\uff0c\u7cfb\u7edf\u6301\u7eed\u53d1\u9001\u6d4b\u91cf\u6307\u4ee4\uff0c\u5b9e\u65f6\u66f4\u65b0\u663e\u793a\u6d4b\u91cf\u7ed3\u679c\u3002\n- \u6fc0\u5149\u5f00\u5173\uff1a\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6309\u952e\u63a7\u5236\u6fc0\u5149\u7684\u5f00\u542f\u548c\u5173\u95ed\u3002\n- \u5355\u4f4d\u5207\u6362\uff1a\u7528\u6237\u53ef\u4ee5\u5207\u6362\u6d4b\u91cf\u5355\u4f4d\uff0c\u5982\u6beb\u7c73\u3001\u5398\u7c73\u548c\u7c73\u3002\n- \u7535\u6c60\u7535\u91cf\u68c0\u6d4b\uff1a\u7cfb\u7edf\u53ef\u4ee5\u68c0\u6d4b\u7535\u6c60\u7535\u91cf\uff0c\u5e76\u5728\u5c4f\u5e55\u4e0a\u663e\u793a\u3002\n- \u8702\u9e23\u5668\u63a7\u5236\uff1a\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6309\u952e\u63a7\u5236\u8702\u9e23\u5668\u7684\u5f00\u542f\u548c\u5173\u95ed\u3002\n\n=== OLED \u663e\u793a\u9a71\u52a8\n\n\u4f7f\u7528\u4e86 U8g2 \u5e93\u6765\u9a71\u52a8 OLED \u663e\u793a\u5c4f\uff0c\u4ee5\u53ca\u53ef\u80fd\u7684\u5176\u4ed6\u7b2c\u4e09\u65b9\u5e93\u6765\u5904\u7406\u4e32\u53e3\u901a\u4fe1\u3001ADC\u8f6c\u6362\u7b49\u4efb\u52a1\u3002\u8fd9\u4e9b\u5e93\u63d0\u4f9b\u4e86\u73b0\u6210\u7684\u529f\u80fd\uff0c\u4f7f\u5f97\u5f00\u53d1\u8005\u53ef\u4ee5\u4e13\u6ce8\u4e8e\u5b9e\u73b0\u4ea7\u54c1\u7684\u6838\u5fc3\u529f\u80fd\u3002\n\n\u624b\u52a8\u5199\u5165\u53ef\u80fd\u7528\u5230\u7684\u4e2d\u6587\u5b57\u7b26\u96c6\uff0c\u5b9a\u4e49\u6587\u5b57\u663e\u793a\u50cf\u7d20\u3002\n\n```cpp\nU8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);//1.30\u5bf8oled\u5c4f\u5e55\u53c2\u6570(SH1106)\n//U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);//0.96\u5bf8oled\u5c4f\u5e55\u53c2\u6570(SSD1306)\n \n/*\u8ddd(0) \u79bb(1) \u5355(2) \u4f4d(3) \u5207(4) \u6362(5) \u9519(6) \u8bef(7)\n\u00a0 \u7801(8) \u6fc0(9) \u5149(10) \u5934(11) \u5f00(12) \u5173(13) \u6574(14) \u673a(15)\n\u00a0 \u786c(16) \u4ef6(17) \u6545(18) \u969c(19) \u65e0(20) \u6548(21) \u4fe1(22) \u53f7(23)\n\u00a0 \u4e0d(24) \u7a33(25) \u5b9a(26) \u592a(27) \u5f31(28) \u5f3a(29) \u80cc(30) \u666f(31)\n\u00a0 \u5149(32) \u65e0(33) \u6548(34) \u7684(35) \u6d4b(36) \u91cf(37) \u7ed3(38) \u679c(39)\n\u00a0 \u76ee(40) \u6807(41) \u8d85(42) \u51fa(43) \u5c04(44) \u7a0b(45) \u7535(46) \u6c60(47)\n\u00a0 \u53ef(48) \u4fe1(49) \u5ea6(50)\n*/\n\nstatic const unsigned char PROGMEM str0[] = {0x00, 0x00, 0xBE, 0x7F, 0xA2, 0x00, 0xA2, 0x00, 0xA2, 0x00, 0xBE, 0x3F, 0x88, 0x20, 0x88, 0x20, 0xBA, 0x20, 0x8A, 0x20, 0x8A, 0x3F, 0x8A, 0x00, 0xBA, 0x00, 0x87, 0x00, 0x80, 0x7F, 0x00, 0x00}; /*\"\u8ddd\",0*/\nstatic const unsigned char PROGMEM str1[] = {0x40, 0x00, 0x80, 0x00, 0xFF, 0x7F, 0x00, 0x00, 0x28, 0x0A, 0xC8, 0x09, 0x28, 0x0A, 0xF8, 0x0F, 0x80, 0x00, 0xFE, 0x3F, 0x42, 0x20, 0x22, 0x22, 0xF2, 0x27, 0x22, 0x24, 0x02, 0x28, 0x02, 0x10}; /*\"\u79bb\",1*/\n\u2026\n\u2026\nstatic const unsigned char PROGMEM str54[] = {0x00, 0x20, 0x00, 0x70, 0x00, 0xF8, 0x00, 0xA8, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xFF, 0x21, 0x01, 0x21, 0x7D, 0x01, 0x45, 0x21, 0x45, 0x21, 0x7D, 0x21, 0x01, 0x01, 0x01, 0x21, 0x01, 0x21, 0x01, 0x21, 0x01, 0x21, 0x01, 0x01, 0x01, 0x21, 0x01, 0x21, 0x01, 0x21, 0x01, 0x01, 0x01, 0x21, 0x01, 0x21, 0x01, 0x21, 0x01, 0x01, 0x01, 0x21, 0x01, 0x21, 0x01, 0x21, 0x01, 0x01, 0xFF, 0xF9}; /*\"\u540e\u57fa\u51c6\",54*/\nstatic const unsigned char PROGMEM str55[] = {0x00, 0x20, 0x00, 0x70, 0x00, 0xF8, 0x00, 0xA8, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xFF, 0xF9, 0x01, 0x01, 0x7D, 0x01, 0x45, 0x01, 0x45, 0x01, 0x7D, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0x01}; /*\"\u524d\u57fa\u51c6\",55*/\n```\n\n\u4ee5\u4e0a\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u7cfb\u5217\u7684\u5b57\u7b26\u4e32\u6570\u7ec4\uff0c\u7528\u4e8e\u5728OLED\u663e\u793a\u5c4f\u4e0a\u663e\u793a\u4e2d\u6587\u5b57\u7b26\u3002\u4f7f\u7528`PROGMEM`\u5173\u952e\u5b57\uff0c\u5c06\u5176\u5b58\u50a8\u5728\u7a0b\u5e8f\u5b58\u50a8\u5668\uff08\u800c\u975e RAM\uff09\u4e2d\uff0c\u4ee5\u8282\u7701\u5185\u5b58\u7a7a\u95f4\u548c\u63d0\u9ad8\u7a0b\u5e8f\u6548\u7387\u3002\n\n\u901a\u8fc7`str0[]`\u8fd9\u6837\u7684\u6570\u7ec4\u5b9a\u4e49\u4e86\u5b57\u7b26\uff0c\u5176\u5185\u5bb9\u662f\u4e00\u4e2a\u5305\u542b\u591a\u4e2a\u5b57\u8282\u7684\u6570\u7ec4\uff0c\u6bcf\u4e2a\u5b57\u8282\u4ee3\u8868\u5c4f\u5e55\u4e0a\u7684\u4e00\u4e2a\u50cf\u7d20\u884c\u3002\u8fd9\u4e9b\u5b57\u8282\u7684\u503c\u662f\u901a\u8fc7\u4f4d\u64cd\u4f5c\uff08\u5982`0x00`\u3001`0x7F`\u7b49\uff09\u6765\u8bbe\u7f6e\u7684\uff0c\u5176\u4e2d`0x7F`\u8868\u793a\u8be5\u884c\u7684\u6240\u6709\u50cf\u7d20\u90fd\u4eae\u8d77\uff0c\u800c`0x00`\u8868\u793a\u8be5\u884c\u7684\u6240\u6709\u50cf\u7d20\u90fd\u7184\u706d\u3002\n\n\u8fd9\u4e9b\u5b57\u7b26\u4e32\u6570\u7ec4\u53ef\u4ee5\u88ab\u7528\u6765\u5728OLED\u663e\u793a\u5c4f\u4e0a\u663e\u793a\u7528\u6237\u754c\u9762\uff0c\u4f8b\u5982\u5728\u6d4b\u91cf\u7ed3\u679c\u65c1\u8fb9\u663e\u793a\u76f8\u5173\u7684\u63d0\u793a\u4fe1\u606f\uff0c\u6216\u8005\u5728\u7cfb\u7edf\u72b6\u6001\u53d1\u751f\u53d8\u5316\u65f6\u63d0\u4f9b\u53cd\u9988\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u7528\u6237\u53ef\u4ee5\u76f4\u89c2\u5730\u4e86\u89e3\u8bbe\u5907\u7684\u5de5\u4f5c\u72b6\u6001\u548c\u6d4b\u91cf\u7ed3\u679c\u3002\n\n\u5728`u8g2`\u5e93\u7684\u51fd\u6570\u4e2d\u6307\u5b9a\u4f4d\u7f6e\u7ed8\u5236\u4f4d\u56fe\uff0c\u5728OLED\u5c4f\u5e55\u4e0a\u663e\u793a\u4e2d\u6587\u5b57\u7b26\u548c\u56fe\u6807\uff0c\u589e\u5f3a\u7528\u6237\u4f53\u9a8c\u3002\n\n=== \u6d4b\u8ddd\u6a21\u5757\u9a71\u52a8\n\n\u6839\u636e\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u89c4\u683c\u4e66\uff0c\u5b9a\u4e49\u4e0e\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u901a\u4fe1\u7684\u534f\u8bae\u3002\n\n==== \u53d1\u9001\u6307\u4ee4\u5230\u6d4b\u8ddd\u6a21\u5757\u4e32\u53e3\n\n```cpp\n//\u53d1\u9001\u5230\u6d4b\u8ddd\u6a21\u5757\u4e32\u53e3\n\nvoid measursend()\n{\n\u00a0 unsigned char S_A_M[9] = {0xAA, 0x00, 0x00, 0x20, 0x00, 0x01, 0x00, 0x00, 0x21}; //\u5355\u6b21\u81ea\u52a8\u6d4b\u91cf\n\u00a0 unsigned char C_A_M[9] = {0xAA, 0x00, 0x00, 0x20, 0x00, 0x01, 0x00, 0x04, 0x25}; //\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\n\u00a0 unsigned char O_L[9] = {0xAA, 0x00, 0x01, 0xBE, 0x00, 0x01, 0x00, 0x01, 0xC1}; //\u6253\u5f00\u6fc0\u5149\n\u00a0 unsigned char C_L[9] = {0xAA, 0x00, 0x01, 0xBE, 0x00, 0x01, 0x00, 0x00, 0xC0}; //\u5173\u95ed\u6fc0\u5149\n\u00a0 unsigned char EXIT[1] = {0x58}; //\u9000\u51fa\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\n\u00a0 switch (MEASUR_STATUS)\n\u00a0 {\n\u00a0 \u00a0 case MEASUR_OFF:\n\u00a0 \u00a0 \u00a0 Serial.println(\"\u6d4b\u91cf\u5173\u95ed\"); break;\n\u00a0 \u00a0 case CLOSE_LASER:\n\u00a0 \u00a0 \u00a0 Serial2.write(C_L, 9); Serial.println(\"\u5173\u95ed\u6fc0\u5149\"); MEASUR_STATUS = MEASUR_OFF; break;\n\u00a0 \u00a0 case OPEN_LASER:\n\u00a0 \u00a0 \u00a0 Serial2.write(O_L, 9); Serial.println(\"\u6253\u5f00\u6fc0\u5149\"); \u00a0break;\n\u00a0 \u00a0 case SINGLE_AUTO_MEASUR:\n\u00a0 \u00a0 \u00a0 Serial2.write(S_A_M, 9); Serial.println(\"\u5355\u6b21\u81ea\u52a8\u6d4b\u91cf\"); \u00a0MEASUR_STATUS = MEASUR_OFF; break;\n\u00a0 \u00a0 case CONTINUOUS_AUTO_MEASUR:\n\u00a0 \u00a0 \u00a0 Serial2.write(C_A_M, 9); Serial.println(\"\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\"); break;\n\u00a0 \u00a0 case EXIT_MEASUR:\n\u00a0 \u00a0 \u00a0 Serial2.write(EXIT, 9); Serial.println(\"\u5173\u95ed\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\"); MEASUR_STATUS = MEASUR_OFF; break;\n\u00a0 \u00a0 default: Serial.println(\"\u6d4b\u91cf\u65e0\u53d1\u9001\");\n\u00a0 }\n}\n```\n\n\u5b9a\u4e49`measursend()`\u51fd\u6570\u7528\u4e8e\u53d1\u9001\u6307\u4ee4\u5230\u6fc0\u5149\u6d4b\u8ddd\u4eea\u6a21\u5757\u3002\u8fd9\u4e2a\u51fd\u6570\u6839\u636e\u5f53\u524d\u7684\u6d4b\u91cf\u72b6\u6001\uff08`MEASUR_STATUS`\uff09\u6765\u51b3\u5b9a\u53d1\u9001\u54ea\u79cd\u7c7b\u578b\u7684\u6307\u4ee4\u3002\n\n\u51fd\u6570\u9996\u5148\u5b9a\u4e49\u4e86\u56db\u4e2a\u6570\u7ec4\uff0c\u6bcf\u4e2a\u6570\u7ec4\u4ee3\u8868\u4e00\u79cd\u4e0d\u540c\u7684\u6307\u4ee4\uff1a\n\n-`S_A_M`\uff1a\u7528\u4e8e\u5355\u6b21\u81ea\u52a8\u6d4b\u91cf\u3002\n-`C_A_M`\uff1a\u7528\u4e8e\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\u3002\n-`O_L`\uff1a\u7528\u4e8e\u6253\u5f00\u6fc0\u5149\u3002\n-`C_L`\uff1a\u7528\u4e8e\u5173\u95ed\u6fc0\u5149\u3002\n-`EXIT`\uff1a\u7528\u4e8e\u9000\u51fa\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\u3002\n\n\u8fd9\u4e9b\u6570\u7ec4\u5305\u542b\u4e86\u53d1\u9001\u7ed9\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u547d\u4ee4\u5b57\u8282\u5e8f\u5217\uff0c\u8fd9\u4e9b\u5b57\u8282\u5e8f\u5217\u9075\u5faa\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u901a\u4fe1\u534f\u8bae\u3002\n\n\u7136\u540e\uff0c\u51fd\u6570\u4f7f\u7528`switch`\u8bed\u53e5\u6839\u636e`MEASUR_STATUS`\u7684\u503c\u6765\u9009\u62e9\u53d1\u9001\u54ea\u4e2a\u6570\u7ec4\u3002`MEASUR_STATUS`\u662f\u4e00\u4e2a\u679a\u4e3e\u7c7b\u578b\uff0c\u5b9a\u4e49\u4e86\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u4e0d\u540c\u64cd\u4f5c\u72b6\u6001\u3002\n\n\u5bf9\u4e8e\u6bcf\u79cd\u72b6\u6001\uff0c\u51fd\u6570\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a\n\n-`MEASUR_OFF`\uff1a\u6253\u5370\u4e00\u6761\u6d88\u606f\u5230\u4e32\u884c\u76d1\u89c6\u5668\uff0c\u8bf4\u660e\u6d4b\u91cf\u5df2\u5173\u95ed\uff0c\u4e0d\u53d1\u9001\u4efb\u4f55\u6307\u4ee4\u3002\n-`CLOSE_LASER`\uff1a\u53d1\u9001\u5173\u95ed\u6fc0\u5149\u7684\u6307\u4ee4\uff0c\u7136\u540e\u91cd\u7f6e`MEASUR_STATUS`\u4e3a`MEASUR_OFF`\u3002\n-`OPEN_LASER`\uff1a\u53d1\u9001\u6253\u5f00\u6fc0\u5149\u7684\u6307\u4ee4\u3002\n-`SINGLE_AUTO_MEASUR`\uff1a\u53d1\u9001\u5355\u6b21\u81ea\u52a8\u6d4b\u91cf\u7684\u6307\u4ee4\uff0c\u7136\u540e\u91cd\u7f6e`MEASUR_STATUS`\u4e3a`MEASUR_OFF`\u3002\n-`CONTINUOUS_AUTO_MEASUR`\uff1a\u53d1\u9001\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\u7684\u6307\u4ee4\u3002\n-`EXIT_MEASUR`\uff1a\u53d1\u9001\u9000\u51fa\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\u7684\u6307\u4ee4\uff0c\u7136\u540e\u91cd\u7f6e`MEASUR_STATUS`\u4e3a`MEASUR_OFF`\u3002\n\n\u5728\u6bcf\u79cd\u60c5\u51b5\u4e0b\uff0c\u51fd\u6570\u90fd\u4f1a\u6253\u5370\u4e00\u6761\u6d88\u606f\u5230\u4e32\u884c\u76d1\u89c6\u5668\uff0c\u8bf4\u660e\u53d1\u9001\u4e86\u54ea\u79cd\u7c7b\u578b\u7684\u6307\u4ee4\u3002\n\n==== \u5c06\u6d4b\u8ddd\u6a21\u5757\u8fd4\u56de\u7ed3\u679c\u4fdd\u5b58\n\n```cpp\nenum\n{\n\u00a0 MEASUR_OFF,\n\u00a0 CLOSE_LASER,\n\u00a0 OPEN_LASER,\n\u00a0 SINGLE_AUTO_MEASUR,\n\u00a0 CONTINUOUS_AUTO_MEASUR,\n\u00a0 EXIT_MEASUR,\n} MEASUR_STATUS;\n```\n\n`MEASUR_STATUS`\u4f5c\u4e3a\u4e00\u4e2a\u679a\u4e3e\u7c7b\u578b\uff08`enum`\uff09\uff0c\u5b9a\u4e49\u4e86\u6fc0\u5149\u6d4b\u8ddd\u4eea\u6d4b\u91cf\u72b6\u6001\u7684\u4e0d\u540c\u53ef\u80fd\u503c\u3002\u679a\u4e3e\u7c7b\u578b\u662f\u4e00\u79cd\u7528\u6237\u5b9a\u4e49\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5b83\u5141\u8bb8\u5c06\u6574\u6570\u503c\u4e0e\u7279\u5b9a\u7684\u540d\u5b57\u5173\u8054\u8d77\u6765\uff0c\u4f7f\u5f97\u4ee3\u7801\u66f4\u52a0\u6e05\u6670\u548c\u6613\u4e8e\u7406\u89e3\u3002\n\n\u8fd9\u4e2a\u679a\u4e3e\u5b9a\u4e49\u4e86\u4ee5\u4e0b\u72b6\u6001\uff1a\n\n+`MEASUR_OFF`\uff1a\u8868\u793a\u6d4b\u91cf\u529f\u80fd\u5173\u95ed\uff0c\u6fc0\u5149\u6d4b\u8ddd\u4eea\u4e0d\u8fdb\u884c\u4efb\u4f55\u6d4b\u91cf\u64cd\u4f5c\u3002\n+`CLOSE_LASER`\uff1a\u8868\u793a\u5173\u95ed\u6fc0\u5149\uff0c\u5373\u5173\u95ed\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u6fc0\u5149\u53d1\u5c04\u5668\u3002\n+`OPEN_LASER`\uff1a\u8868\u793a\u6253\u5f00\u6fc0\u5149\uff0c\u5373\u542f\u52a8\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u6fc0\u5149\u53d1\u5c04\u5668\u3002\n+`SINGLE_AUTO_MEASUR`\uff1a\u8868\u793a\u8fdb\u884c\u5355\u6b21\u81ea\u52a8\u6d4b\u91cf\uff0c\u5373\u7528\u6237\u53d1\u8d77\u4e00\u6b21\u6d4b\u91cf\u8bf7\u6c42\uff0c\u8bbe\u5907\u81ea\u52a8\u8fdb\u884c\u6d4b\u91cf\u5e76\u8fd4\u56de\u7ed3\u679c\u3002\n+`CONTINUOUS_AUTO_MEASUR`\uff1a\u8868\u793a\u8fdb\u5165\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\u6a21\u5f0f\uff0c\u8bbe\u5907\u4f1a\u6301\u7eed\u8fdb\u884c\u6d4b\u91cf\u5e76\u5b9e\u65f6\u8fd4\u56de\u7ed3\u679c\u3002\n+`EXIT_MEASUR`\uff1a\u8868\u793a\u9000\u51fa\u8fde\u7eed\u81ea\u52a8\u6d4b\u91cf\u6a21\u5f0f\uff0c\u8bbe\u5907\u505c\u6b62\u8fde\u7eed\u6d4b\u91cf\u3002\n\n\u4f7f\u7528\u679a\u4e3e\u7c7b\u578b\u4f7f\u5f97\u4ee3\u7801\u66f4\u52a0\u76f4\u89c2\uff0c\u4fbf\u4e8e\u7ef4\u62a4\u548c\u8c03\u8bd5\u3002\u5f53\u9700\u8981\u66f4\u6539\u67d0\u4e2a\u72b6\u6001\u7684\u503c\u4e4b\u65f6\uff0c\u53ea\u9700\u5728\u679a\u4e3e\u5b9a\u4e49\u4e2d\u8fdb\u884c\u4fee\u6539\uff0c\u800c\u4e0d\u9700\u8981\u5728\u4ee3\u7801\u7684\u5176\u4ed6\u90e8\u5206\u8fdb\u884c\u67e5\u627e\u548c\u66ff\u6362\u3002\u6b64\u5916\uff0c\u679a\u4e3e\u7c7b\u578b\u4e3a\u72b6\u6001\u503c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u660e\u786e\u7684\u8303\u56f4\uff0c\u9632\u6b62\u4e86\u610f\u5916\u5730\u4f7f\u7528\u975e\u6cd5\u7684\u503c\uff0c\u4e5f\u6709\u52a9\u4e8e\u51cf\u5c11\u9519\u8bef\u3002\n\n=== \u8702\u9e23\u5668\n\n\u5728\u6309\u7167\u987a\u5e8f\u6267\u884c\u6cd5\u65f6\uff0c\u8ba9\u8702\u9e23\u5668 IO \u53d8\u9ad8\uff0c\u5ef6\u8fdf 200ms\uff0c\u7136\u540e\u53d8\u4f4e\uff0c\u5bfc\u81f4 CPU \u90fd\u88ab\u8702\u9e23\u5668\u65f6\u95f4\u5360\u7528\u3002\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u4f7f\u7528 millis \u51fd\u6570\u68c0\u6d4b\u6309\u952e\u65f6\u95f4\uff0c\u6309\u952e\u65f6\u95f4\u5927\u4e8e 200ms \uff0c\u542f\u52a8\u8702\u9e23\u5668\u3002\n\n```cpp\n//\u8702\u9e23\u5668\u5f00\n\nvoid buzzeron200ms()\n{\n\u00a0 if (BUZZER_STATUS == BUZZER_ON)\n\u00a0 {\n\u00a0 \u00a0 digitalWrite(Buzzer, HIGH);\n\u00a0 \u00a0 buzzerstarttime = millis();//\u8702\u9e23\u5668\u5f00\u59cb\u8ba1\u65f6\n\u00a0 }\n\u00a0 if (BUZZER_STATUS == BUZZER_OFF)\n\u00a0 {\n\u00a0 \u00a0 digitalWrite(Buzzer, LOW);\n\u00a0 }\n}\n//\u8702\u9e23\u5668\u590d\u4f4d\nvoid buzzerreset()\n{\n\u00a0 buzzerendtime = millis();\n\u00a0 if (buzzerendtime < (buzzerstarttime + Time_200ms_setting))//\u8702\u9e23\u5668\u7ed3\u675f\u8ba1\u65f6<\u6309\u4e0b\u8ba1\u65f6+200ms\n\u00a0 {\n\u00a0 \u00a0 digitalWrite(Buzzer, LOW);//\u5173\u95ed\u8702\u9e23\u5668\n\u00a0 }\n}\n```\n\n=== \u5355\u4f4d\u8f6c\u6362\n\n\u5b9a\u4e49`unitmanage()`\u51fd\u6570\u5b9e\u73b0\u4e86\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u5355\u4f4d\u8f6c\u6362\u529f\u80fd\u3002\u8fd9\u4e2a\u529f\u80fd\u5141\u8bb8\u7528\u6237\u901a\u8fc7\u6309\u4e0b\u4e00\u4e2a\u7279\u5b9a\u7684\u6309\u952e\uff08`UnitButton`\u5b9a\u4e49\u7684\u4e32\u53e3\u6240\u8fde\u6309\u952e\uff09\u6765\u5728\u6beb\u7c73\uff08mm\uff09\u3001\u5398\u7c73\uff08cm\uff09\u548c\u7c73\uff08m\uff09\u4e4b\u95f4\u5207\u6362\u6d4b\u91cf\u5355\u4f4d\u3002\n\n```cpp\n//\u5355\u4f4d\u5207\u6362\nvoid unitmanage()\n{\n\u00a0 if (UnitKeyState == 1 && Unitkeyflag == 0)\n\u00a0 {\n\u00a0 \u00a0 delay(10);\n\u00a0 \u00a0 if (UnitKeyState == 1 && UNIT_STATUS == UNIT_MM)//MM CM M\u5207\u6362\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 UNIT_STATUS = UNIT_CM;\n\u00a0 \u00a0 }\n\u00a0 \u00a0 else if (UnitKeyState == 1 && UNIT_STATUS == UNIT_CM)\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 UNIT_STATUS = UNIT_M;\n\u00a0 \u00a0 }\n\u00a0 \u00a0 else if (UnitKeyState == 1 && UNIT_STATUS == UNIT_M)\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 UNIT_STATUS = UNIT_MM;\n\u00a0 \u00a0 }\n\u00a0 \u00a0 Unitkeyflag = 1;\n\u00a0 \u00a0 buzzeron200ms();\n\u00a0 }\n\u00a0 else if (UnitKeyState == 0)\n\u00a0 {\n\u00a0 \u00a0 delay(10);\n\u00a0 \u00a0 if (UnitKeyState == 0)\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 Unitkeyflag = 0;\n\u00a0 \u00a0 }\n\u00a0 }\n}\n```\n\n\n\u51fd\u6570\u9996\u5148\u68c0\u67e5`UnitKeyState`\u662f\u5426\u4e3a1\uff0c\u8fd9\u8868\u793a\u5355\u4f4d\u8f6c\u6362\u6309\u94ae\u88ab\u6309\u4e0b\u3002\u540c\u65f6\uff0c\u5b83\u8fd8\u68c0\u67e5`Unitkeyflag`\u662f\u5426\u4e3a0\uff0c\u4ee5\u786e\u4fdd\u8fd9\u4e2a\u64cd\u4f5c\u4e0d\u662f\u91cd\u590d\u7684\u3002\u5982\u679c\u8fd9\u4e24\u4e2a\u6761\u4ef6\u90fd\u6ee1\u8db3\uff0c\u90a3\u4e48\u7a0b\u5e8f\u4f1a\u8fdb\u5165\u4e00\u4e2a`if-else`\u7ed3\u6784\uff0c\u6839\u636e\u5f53\u524d\u7684`UNIT_STATUS`\u503c\u6765\u51b3\u5b9a\u65b0\u7684\u5355\u4f4d\u3002\n\n- \u5982\u679c\u5f53\u524d\u5355\u4f4d\u662f\u6beb\u7c73\uff08`UNIT_STATUS == UNIT_MM`\uff09\uff0c\u5219\u65b0\u7684\u5355\u4f4d\u8bbe\u7f6e\u4e3a\u5398\u7c73\uff08`UNIT_STATUS = UNIT_CM`\uff09\u3002\n- \u5982\u679c\u5f53\u524d\u5355\u4f4d\u662f\u5398\u7c73\uff08`UNIT_STATUS == UNIT_CM`\uff09\uff0c\u5219\u65b0\u7684\u5355\u4f4d\u8bbe\u7f6e\u4e3a\u7c73\uff08`UNIT_STATUS = UNIT_M`\uff09\u3002\n- \u5982\u679c\u5f53\u524d\u5355\u4f4d\u662f\u7c73\uff08`UNIT_STATUS == UNIT_M`\uff09\uff0c\u5219\u65b0\u7684\u5355\u4f4d\u8bbe\u7f6e\u4e3a\u6beb\u7c73\uff08`UNIT_STATUS = UNIT_MM`\uff09\u3002\n\n\u6bcf\u6b21\u5355\u4f4d\u6539\u53d8\u540e\uff0c`Unitkeyflag`\u88ab\u8bbe\u7f6e\u4e3a1\uff0c\u8fd9\u8868\u793a\u5355\u4f4d\u5df2\u7ecf\u6539\u53d8\uff0c\u76f4\u5230\u4e0b\u4e00\u6b21\u6309\u952e\u64cd\u4f5c\u3002\u5982\u679c\u5728\u5355\u4f4d\u6539\u53d8\u540e`UnitKeyState`\u53d8\u4e3a0\uff0c`Unitkeyflag`\u4e5f\u4f1a\u88ab\u91cd\u7f6e\u4e3a0\uff0c\u4ee5\u51c6\u5907\u4e0b\u4e00\u6b21\u7684\u5355\u4f4d\u5207\u6362\u64cd\u4f5c\u3002\n\n\u51fd\u6570\u8c03\u7528`buzzeron200ms()`\u6765\u6fc0\u6d3b\u8702\u9e23\u5668200\u6beb\u79d2\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u64cd\u4f5c\u53cd\u9988\uff0c\u53d1\u51fa\u58f0\u97f3\uff0c\u8ba9\u7528\u6237\u77e5\u9053\u5355\u4f4d\u5df2\u7ecf\u6210\u529f\u5207\u6362\u3002\n\n=== \u57fa\u51c6\u5207\u6362\n\n```cpp\n//\u57fa\u51c6\u5f00\u5173\nvoid basemanage()\n{\n\u00a0 if (BaseKeyState == 1 && Basekeyflag == 0)\n\u00a0 {\n\u00a0 \u00a0 delay(10);\n\u00a0 \u00a0 if (BaseKeyState == 1 && BASE_STATUS == BASE_FRONT)//\u57fa\u51c6\u5207\u6362\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 BASE_STATUS = BASE_BACK;\n\u00a0 \u00a0 }\n\u00a0 \u00a0 else if (BaseKeyState == 1 && BASE_STATUS == BASE_BACK)\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 BASE_STATUS = BASE_FRONT;\n\u00a0 \u00a0 }\n\u00a0 \u00a0 Basekeyflag = 1;\n\u00a0 \u00a0 buzzeron200ms();\n\u00a0 }\n\u00a0 else if (BaseKeyState == 0)\n\u00a0 {\n\u00a0 \u00a0 delay(10);\n\u00a0 \u00a0 if (BaseKeyState == 0)\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 Basekeyflag = 0;\n\u00a0 \u00a0 }\n\u00a0 }\n}\n```\n\n`basemanage()`\u51fd\u6570\u7528\u4e8e\u5904\u7406\u57fa\u51c6\u5207\u6362\u7684\u6309\u952e\u64cd\u4f5c\uff0c\u57fa\u51c6\u5207\u6362\u6309\u94ae\u7684\u72b6\u6001\uff0c\u5e76\u6839\u636e\u5f53\u524d\u7684\u57fa\u51c6\u72b6\u6001\u6765\u5207\u6362\u57fa\u51c6\u4f4d\u7f6e\u3002\n\n\u51fd\u6570\u9996\u5148\u68c0\u67e5`BaseKeyState`\u662f\u5426\u4e3a1\uff0c\u8fd9\u8868\u793a\u57fa\u51c6\u5207\u6362\u6309\u94ae\u88ab\u6309\u4e0b\u3002\u540c\u65f6\uff0c\u5b83\u8fd8\u68c0\u67e5`Basekeyflag`\u662f\u5426\u4e3a0\uff0c\u4ee5\u786e\u4fdd\u8fd9\u4e2a\u64cd\u4f5c\u4e0d\u662f\u91cd\u590d\u7684\u3002\u5982\u679c\u8fd9\u4e24\u4e2a\u6761\u4ef6\u90fd\u6ee1\u8db3\uff0c\u90a3\u4e48\u7a0b\u5e8f\u4f1a\u8fdb\u5165\u4e00\u4e2a`if-else`\u7ed3\u6784\uff0c\u6839\u636e\u5f53\u524d\u7684`BASE_STATUS`\u503c\u6765\u51b3\u5b9a\u65b0\u7684\u57fa\u51c6\u72b6\u6001\u3002\n\n- \u5982\u679c\u5f53\u524d\u57fa\u51c6\u72b6\u6001\u662f`BASE_FRONT`\uff08\u57fa\u51c6\u5728\u524d\uff09\uff0c\u5219\u65b0\u7684\u57fa\u51c6\u72b6\u6001\u8bbe\u7f6e\u4e3a`BASE_BACK`\uff08\u57fa\u51c6\u5728\u540e\uff09\u3002\n- \u5982\u679c\u5f53\u524d\u57fa\u51c6\u72b6\u6001\u662f`BASE_BACK`\uff08\u57fa\u51c6\u5728\u540e\uff09\uff0c\u5219\u65b0\u7684\u57fa\u51c6\u72b6\u6001\u8bbe\u7f6e\u4e3a`BASE_FRONT`\uff08\u57fa\u51c6\u5728\u524d\uff09\u3002\n\n\u6bcf\u6b21\u57fa\u51c6\u72b6\u6001\u6539\u53d8\u540e\uff0c`Basekeyflag`\u88ab\u8bbe\u7f6e\u4e3a1\uff0c\u8fd9\u8868\u793a\u57fa\u51c6\u5df2\u7ecf\u6539\u53d8\uff0c\u76f4\u5230\u4e0b\u4e00\u6b21\u6309\u952e\u64cd\u4f5c\u3002\u5982\u679c\u5728\u57fa\u51c6\u72b6\u6001\u6539\u53d8\u540e`BaseKeyState`\u53d8\u4e3a0\uff0c`Basekeyflag`\u4e5f\u4f1a\u88ab\u91cd\u7f6e\u4e3a0\uff0c\u4ee5\u51c6\u5907\u4e0b\u4e00\u6b21\u7684\u57fa\u51c6\u5207\u6362\u64cd\u4f5c\u3002\n\n=== \u9519\u8bef\u5904\u7406\n\n\u5f53\u7a0b\u5e8f\u6267\u884c\u9519\u8bef\u65f6\uff0c\u63d0\u793a\u9519\u8bef\u7801\uff0c\u5e2e\u52a9\u7528\u6237\u5728\u4f7f\u7528\u65f6\u6392\u9664\u9519\u8bef\u3002\n\n```cpp\n{\n\u00a0 \u00a0 \u00a0 \u00a0 Serial.println(\"\u9519\u8bef\u7801\u6821\u9a8c\u548c\u76f8\u7b49\uff0c\u9519\u8bef\u7801\u6709\u6548\");\n\u00a0 \u00a0 \u00a0 \u00a0 switch (Distance_raw[7])\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x00: Serial.println(\"\u9519\u8bef\u780100:\u65e0\u9519\u8bef\"); errorcode = 1; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x01: Serial.println(\"\u9519\u8bef\u780101:\u8f93\u5165\u529f\u7387\u8fc7\u4f4e\uff0c\u529f\u7387\u7535\u538b\u5e94>= 2.2V\"); errorcode = 2; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x02: Serial.println(\"\u9519\u8bef\u780102:\u5185\u5728\u9519\u8bef\uff0c\u6ca1\u5173\u7cfb\"); errorcode = 3; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x03: Serial.println(\"\u9519\u8bef\u780103:\u6a21\u5757\u6e29\u5ea6\u8fc7\u4f4e(< -20\u2103)\"); errorcode = 4; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x04: Serial.println(\"\u9519\u8bef\u780104:\u6a21\u5757\u6e29\u5ea6\u8fc7\u9ad8(> + 40\u2103)\"); errorcode = 5; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x05: Serial.println(\"\u9519\u8bef\u780105:\u76ee\u6807\u8d85\u51fa\u5c04\u7a0b\"); errorcode = 6; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x06: Serial.println(\"\u9519\u8bef\u780106:\u65e0\u6548\u7684\u6d4b\u91cf\u7ed3\u679c\"); errorcode = 7; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x07: Serial.println(\"\u9519\u8bef\u780107:\u80cc\u666f\u5149\u592a\u5f3a\"); errorcode = 8; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x08: Serial.println(\"\u9519\u8bef\u780108:\u6fc0\u5149\u4fe1\u53f7\u592a\u5f31\"); errorcode = 9; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x09: Serial.println(\"\u9519\u8bef\u780109:\u6fc0\u5149\u4fe1\u53f7\u592a\u5f3a\"); errorcode = 10; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x0A: Serial.println(\"\u9519\u8bef\u78010A:\u786c\u4ef6\u6545\u969c1\"); errorcode = 11; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x0B: Serial.println(\"\u9519\u8bef\u78010B:\u786c\u4ef6\u6545\u969c2\"); errorcode = 12; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x0C: Serial.println(\"\u9519\u8bef\u78010C:\u786c\u4ef6\u6545\u969c3\"); errorcode = 13; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x0D: Serial.println(\"\u9519\u8bef\u78010D:\u786c\u4ef6\u6545\u969c4\"); errorcode = 14; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x0E: Serial.println(\"\u9519\u8bef\u78010E:\u786c\u4ef6\u6545\u969c5\"); errorcode = 15; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x0F: Serial.println(\"\u9519\u8bef\u78010F:\u6fc0\u5149\u4fe1\u53f7\u4e0d\u7a33\u5b9a\"); errorcode = 16; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x10: Serial.println(\"\u9519\u8bef\u780110:\u786c\u4ef6\u6545\u969c6\"); errorcode = 17; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x11: Serial.println(\"\u9519\u8bef\u780111:\u786c\u4ef6\u6545\u969c7\"); errorcode = 18; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 case 0x81: Serial.println(\"\u9519\u8bef\u780181:\u65e0\u6548\"); errorcode = 19; break;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 default: Serial.println(\"\u9519\u8bef\u7801\u672a\u77e5\");\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 }\n```\n\n\u7531\u4e8e\u9879\u76ee\u65f6\u95f4\u9650\u5236\uff0c\u9519\u8bef\u7801\u9a8c\u8bc1\u4e0e\u8f93\u51fa\u90e8\u5206\u672a\u5b8c\u6210\uff0c\u7559\u5f85\u540e\u7eed\u5b8c\u5584\u3002\n\n=== \u7ed3\u8bba\n\n\u8f6f\u4ef6\u8bbe\u8ba1\u662f\u5b9e\u73b0\u6fc0\u5149\u6d4b\u8ddd\u4eea\u529f\u80fd\u7684\u5173\u952e\u90e8\u5206\u3002\u901a\u8fc7\u5408\u7406\u7684\u7a0b\u5e8f\u7ed3\u6784\u3001\u76f4\u89c2\u7684\u7528\u6237\u754c\u9762\u548c\u5b8c\u5584\u7684\u529f\u80fd\u5b9e\u73b0\uff0c\u53ef\u4ee5\u786e\u4fdd\u4ea7\u54c1\u5177\u6709\u826f\u597d\u7684\u7528\u6237\u4f53\u9a8c\u548c\u7a33\u5b9a\u7684\u6027\u80fd\u3002\u540c\u65f6\uff0c\u901a\u8fc7\u6027\u80fd\u4f18\u5316\u548c\u9519\u8bef\u5904\u7406\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u53ef\u9760\u6027\u548c\u5065\u58ee\u6027\u3002\n\n= \u7cfb\u7edf\u5b9e\u73b0\n\n== \u786c\u4ef6\u642d\u5efa\u4e0e\u6d4b\u8bd5\n\n- \u4f7f\u7528\u675c\u90a6\u7ebf\u548c\u9762\u5305\u677f\u642d\u5efa\u521d\u6b65\u786c\u4ef6\u5e73\u53f0\uff0c\u8fdb\u884c\u529f\u80fd\u9a8c\u8bc1\u548c\u8c03\u8bd5\uff0c\u786e\u4fdd\u7535\u8def\u8bbe\u8ba1\u7684\u6b63\u786e\u6027\u3002\n- PCB \u8bbe\u8ba1\u548c\u710a\u63a5\uff0c\u786e\u4fdd\u7535\u8def\u8fde\u63a5\u6b63\u786e\u65e0\u8bef\uff0c\u5e76\u901a\u8fc7\u710a\u63a5\u8d28\u91cf\u68c0\u67e5\u3002\n\n\u786c\u4ef6\u642d\u5efa\u662f\u5c06\u8bbe\u8ba1\u8f6c\u5316\u4e3a\u5b9e\u9645\u53ef\u5de5\u4f5c\u7684\u7cfb\u7edf\u7684\u8fc7\u7a0b\u3002\u8fd9\u4e00\u90e8\u5206\u5c06\u8be6\u7ec6\u63cf\u8ff0\u786c\u4ef6\u642d\u5efa\u7684\u6b65\u9aa4\u3001\u6d4b\u8bd5\u65b9\u6cd5\u4ee5\u53ca\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848\u3002\n\n=== \u642d\u5efa\u6b65\u9aa4\n\n+ *\u5143\u5668\u4ef6\u51c6\u5907*\uff1a\u6839\u636eBOM\u6e05\u5355\u51c6\u5907\u6240\u6709\u6240\u9700\u7684\u5143\u5668\u4ef6\uff0c\u5305\u62ecPLS-K-100 \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u3001ESP32 \u5fae\u63a7\u5236\u5668\u3001OLED\u663e\u793a\u5c4f\u3001\u6309\u952e\u3001\u7535\u6e90\u7ba1\u7406\u82af\u7247\u7b49\u3002\n+ *PCB\u710a\u63a5*\uff1a\u5c06\u5143\u5668\u4ef6\u710a\u63a5\u5230 PCB \u677f\u4e0a\u3002\u9996\u5148\u710a\u63a5\u8f83\u4e3a\u590d\u6742\u7684\u90e8\u4ef6\uff0c\u5982 QFN \u5c01\u88c5\u7684 TP5100 \u82af\u7247\uff0c\u7136\u540e\u662f\u5176\u4ed6\u8d34\u7247\u5143\u4ef6\uff0c\u6700\u540e\u710a\u63a5\u63d2\u4ef6\u5143\u4ef6\u3002\n+ *\u7535\u6e90\u7ba1\u7406*\uff1a\u786e\u4fdd\u7535\u6e90\u7ba1\u7406\u7535\u8def\u6b63\u786e\u8fde\u63a5\uff0c\u5305\u62ec\u9502\u7535\u6c60\u3001\u5145\u7535\u82af\u7247TP5100\u3001\u964d\u538b\u82af\u7247LP3220\u7b49\uff0c\u4ee5\u786e\u4fdd\u7cfb\u7edf\u7a33\u5b9a\u4f9b\u7535\u3002\n+ *\u663e\u793a\u5c4f\u8fde\u63a5*\uff1a\u5c06 OLED \u663e\u793a\u5c4f\u901a\u8fc7 I2C \u63a5\u53e3\u8fde\u63a5\u5230 ESP32 \uff0c\u786e\u4fdd\u663e\u793a\u6a21\u5757\u6b63\u786e\u5b89\u88c5\u5e76\u56fa\u5b9a\u3002\n+ *\u6309\u952e\u5b89\u88c5*\uff1a\u5b89\u88c5\u6309\u952e\uff0c\u786e\u4fdd\u6309\u952e\u4e0e PCB \u677f\u4e0a\u7684\u710a\u76d8\u6b63\u786e\u8fde\u63a5\uff0c\u5e76\u4e14\u6309\u952e\u64cd\u4f5c\u7075\u6d3b\u3002\n+ *\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u8fde\u63a5*\uff1a\u5c06 PLS-K-100 \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u901a\u8fc7\u4e32\u53e3\u8fde\u63a5\u5230ESP32\u3002\n+ *\u7ec4\u88c5\u5916\u58f3*\uff1a\u5c06\u710a\u63a5\u597d\u7684 PCB \u677f\u5b89\u88c5\u5230 3D \u6253\u5370\u7684\u5916\u58f3\u4e2d\uff0c\u786e\u4fdd\u6240\u6709\u8fde\u63a5\u7ebf\u548c\u63a5\u53e3\u90fd\u6b63\u786e\u65e0\u8bef\u3002\n+ *\u521d\u6b65\u6d4b\u8bd5*\uff1a\u5728\u7ec4\u88c5\u5b8c\u6210\u540e\uff0c\u8fdb\u884c\u521d\u6b65\u7684\u7535\u6e90\u6d4b\u8bd5\uff0c\u786e\u4fdd\u7535\u6e90\u4f9b\u5e94\u6b63\u5e38\uff0c\u65e0\u77ed\u8def\u73b0\u8c61\u3002\n\n=== \u6d4b\u8bd5\u65b9\u6cd5\n\n+ *\u7535\u6e90\u6d4b\u8bd5*\uff1a\u4f7f\u7528\u4e07\u7528\u8868\u68c0\u67e5\u7535\u6e90\u8f93\u51fa\u662f\u5426\u7b26\u5408\u9884\u671f\uff0c\u786e\u4fdd\u7535\u6e90\u7ba1\u7406\u7535\u8def\u5de5\u4f5c\u6b63\u5e38\u3002\n+ *\u4e32\u53e3\u901a\u4fe1\u6d4b\u8bd5*\uff1a\u4f7f\u7528\u4e32\u53e3\u901a\u4fe1\u5de5\u5177\u68c0\u67e5 ESP32 \u4e0e\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u4e4b\u95f4\u7684\u901a\u4fe1\u662f\u5426\u6b63\u5e38\u3002\n+ *\u6309\u952e\u529f\u80fd\u6d4b\u8bd5*\uff1a\u901a\u8fc7\u6309\u4e0b\u5404\u4e2a\u6309\u952e\uff0c\u89c2\u5bdf\u7cfb\u7edf\u7684\u53cd\u5e94\uff0c\u786e\u4fdd\u6309\u952e\u529f\u80fd\u6b63\u786e\u3002\n+ *\u663e\u793a\u5c4f\u6d4b\u8bd5*\uff1a\u68c0\u67e5 OLED \u663e\u793a\u5c4f\u662f\u5426\u80fd\u591f\u6b63\u5e38\u663e\u793a\uff0c\u5305\u62ec\u6587\u5b57\u3001\u56fe\u6807\u7b49\u3002\n+ *\u6fc0\u5149\u6d4b\u8ddd\u6d4b\u8bd5*\uff1a\u8fdb\u884c\u5b9e\u9645\u7684\u6d4b\u8ddd\u64cd\u4f5c\uff0c\u9a8c\u8bc1\u6d4b\u91cf\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u7a33\u5b9a\u6027\u3002\n+ *\u7cfb\u7edf\u529f\u80fd\u6d4b\u8bd5*\uff1a\u6d4b\u8bd5\u6240\u6709\u7cfb\u7edf\u529f\u80fd\uff0c\u5305\u62ec\u5355\u6b21\u6d4b\u91cf\u3001\u8fde\u7eed\u6d4b\u91cf\u3001\u6fc0\u5149\u5f00\u5173\u63a7\u5236\u3001\u5355\u4f4d\u5207\u6362\u7b49\u3002\n\n=== \u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848\n\n\u5728\u642d\u5efa\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u4ee5\u4e0b\u95ee\u9898\uff1a\n\n- *\u710a\u63a5\u95ee\u9898*\uff1a\u5982\u679c\u710a\u63a5\u4e0d\u826f\uff0c\u53ef\u80fd\u5bfc\u81f4\u7535\u8def\u77ed\u8def\u6216\u65ad\u8def\u3002\u89e3\u51b3\u65b9\u6848\u662f\u901a\u8fc7\u89c6\u89c9\u68c0\u67e5\u548c\u4f7f\u7528\u4e07\u7528\u8868\u8fdb\u884c\u68c0\u6d4b\uff0c\u5fc5\u8981\u65f6\u91cd\u65b0\u710a\u63a5\u3002\n- *\u8fde\u63a5\u95ee\u9898*\uff1a\u7535\u8def\u8fde\u63a5\u9519\u8bef\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\u3002\u89e3\u51b3\u65b9\u6848\u662f\u4ed4\u7ec6\u68c0\u67e5\u539f\u7406\u56fe\u548cPCB\u5e03\u5c40\uff0c\u786e\u4fdd\u6240\u6709\u8fde\u63a5\u6b63\u786e\u65e0\u8bef\u3002\n- *\u7535\u6e90\u95ee\u9898*\uff1a\u7535\u6e90\u4f9b\u5e94\u4e0d\u7a33\u5b9a\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u5de5\u4f5c\u5f02\u5e38\u3002\u89e3\u51b3\u65b9\u6848\u662f\u68c0\u67e5\u7535\u6e90\u7ba1\u7406\u7535\u8def\uff0c\u786e\u4fdd\u7535\u6c60\u548c\u5145\u7535\u7535\u8def\u5de5\u4f5c\u6b63\u5e38\u3002\n- *\u901a\u4fe1\u95ee\u9898*\uff1a\u4e32\u53e3\u901a\u4fe1\u6545\u969c\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4f20\u8f93\u9519\u8bef\u3002\u89e3\u51b3\u65b9\u6848\u662f\u68c0\u67e5\u901a\u4fe1\u7ebf\u8def\u548c\u901a\u4fe1\u534f\u8bae\u8bbe\u7f6e\u3002\n- *\u6d4b\u91cf\u7cbe\u5ea6\u95ee\u9898*\uff1a\u5982\u679c\u6d4b\u91cf\u7ed3\u679c\u4e0d\u51c6\u786e\uff0c\u53ef\u80fd\u662f\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u6216\u8f6f\u4ef6\u7b97\u6cd5\u7684\u95ee\u9898\u3002\u89e3\u51b3\u65b9\u6848\u662f\u68c0\u67e5\u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u7684\u8bbe\u7f6e\u548c\u8f6f\u4ef6\u4e2d\u7684\u6d4b\u91cf\u7b97\u6cd5\u3002\n\n=== \u7ed3\u8bba\n\n\u786c\u4ef6\u642d\u5efa\u4e0e\u6d4b\u8bd5\u662f\u786e\u4fdd\u7cfb\u7edf\u80fd\u591f\u6b63\u5e38\u5de5\u4f5c\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u901a\u8fc7\u7ec6\u81f4\u7684\u642d\u5efa\u548c\u5168\u9762\u7684\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u53d1\u73b0\u5e76\u89e3\u51b3\u6f5c\u5728\u7684\u95ee\u9898\uff0c\u786e\u4fdd\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002\n\n== \u8f6f\u4ef6\u7f16\u7a0b\u4e0e\u8c03\u8bd5\n\n- \u7f16\u5199\u63a7\u5236\u7a0b\u5e8f\uff0c\u5b9e\u73b0\u4e0e\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u901a\u4fe1\uff0c\u786e\u4fdd\u6570\u636e\u7684\u51c6\u786e\u4f20\u8f93\u3002\n- \u5b9e\u73b0\u6309\u952e\u626b\u63cf\u548c\u5904\u7406\u903b\u8f91\uff0c\u786e\u4fdd\u7528\u6237\u64cd\u4f5c\u7684\u51c6\u786e\u6027\u548c\u7cfb\u7edf\u7684\u54cd\u5e94\u901f\u5ea6\u3002\n- \u6d4b\u8bd5\u8f6f\u4ef6\u529f\u80fd\uff0c\u786e\u4fdd\u6d4b\u91cf\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\uff0c\u901a\u8fc7\u591a\u6b21\u6d4b\u8bd5\u4f18\u5316\u8f6f\u4ef6\u6027\u80fd\u3002\n\n=== \u7f16\u7a0b\u73af\u5883\u914d\u7f6e\n\n\u9996\u5148\uff0c\u9700\u8981\u914d\u7f6eArduino\u5f00\u53d1\u73af\u5883\u3002\u8fd9\u5305\u62ec\u5b89\u88c5 Arduino IDE\uff0c\u4ee5\u53ca\u53ef\u80fd\u9700\u8981\u7684\u5176\u4ed6\u63d2\u4ef6\uff0c\u5982 U8g2 \u5e93\u7684\u5b89\u88c5\uff0c\u7528\u4e8e\u9a71\u52a8 OLED \u663e\u793a\u5c4f\u3002\u786e\u4fdd\u6240\u6709\u5fc5\u8981\u7684\u5e93\u548c\u5de5\u5177\u90fd\u5df2\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\u3002\n\n=== \u7a0b\u5e8f\u6846\u67b6\u6784\u5efa\n\n\u5728 Arduino IDE \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\uff0c\u5b9a\u4e49\u6240\u9700\u7684\u5168\u5c40\u53d8\u91cf\u548c\u5e38\u91cf\uff0c\u5982 GPIO\u5f15\u811a\u5b9a\u4e49\u3001\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u4e32\u53e3\u901a\u4fe1\u53c2\u6570\u7b49\u3002\u7136\u540e\uff0c\u7f16\u5199\u521d\u59cb\u5316\u51fd\u6570\uff0c\u7528\u4e8e\u8bbe\u7f6e\u786c\u4ef6\u5f15\u811a\u548c\u521d\u59cb\u5316\u4e32\u53e3\u901a\u4fe1\u3002\n\n=== \u529f\u80fd\u6a21\u5757\u7f16\u5199\n\n\u6839\u636e\u7cfb\u7edf\u8bbe\u8ba1\uff0c\u7f16\u5199\u5404\u4e2a\u529f\u80fd\u6a21\u5757\u7684\u4ee3\u7801\u3002\u8fd9\u5305\u62ec\uff1a\n\n- *\u6309\u952e\u626b\u63cf*\uff1a\u7f16\u5199\u51fd\u6570\u6765\u68c0\u6d4b\u6309\u952e\u72b6\u6001\uff0c\u5e76\u6839\u636e\u6309\u952e\u8f93\u5165\u6267\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\u3002\n- *\u6fc0\u5149\u6d4b\u8ddd\u4eea\u901a\u4fe1*\uff1a\u7f16\u5199\u53d1\u9001\u6307\u4ee4\u548c\u63a5\u6536\u6570\u636e\u7684\u51fd\u6570\uff0c\u5904\u7406\u4e0e\u6fc0\u5149\u6d4b\u8ddd\u4eea\u7684\u901a\u4fe1\u3002\n- *\u6570\u636e\u5904\u7406*\uff1a\u7f16\u5199\u51fd\u6570\u6765\u89e3\u6790\u6fc0\u5149\u6d4b\u8ddd\u4eea\u8fd4\u56de\u7684\u6570\u636e\uff0c\u5e76\u8ba1\u7b97\u51fa\u8ddd\u79bb\u3002\n- *\u7528\u6237\u754c\u9762\u66f4\u65b0*\uff1a\u7f16\u5199\u4ee3\u7801\u6765\u66f4\u65b0 OLED \u663e\u793a\u5c4f\u4e0a\u7684\u663e\u793a\u5185\u5bb9\u3002\n- *\u7535\u6e90\u7ba1\u7406*\uff1a\u7f16\u5199\u4ee3\u7801\u6765\u76d1\u63a7\u7535\u6c60\u7535\u91cf\uff0c\u5e76\u5728\u7535\u91cf\u4f4e\u65f6\u53d1\u51fa\u8b66\u544a\u3002\n- *\u9519\u8bef\u5904\u7406*\uff1a\u5b9e\u73b0\u9519\u8bef\u68c0\u6d4b\u548c\u5904\u7406\u673a\u5236\uff0c\u786e\u4fdd\u7cfb\u7edf\u5728\u9047\u5230\u95ee\u9898\u65f6\u80fd\u591f\u7ed9\u51fa\u63d0\u793a\u3002\n\n=== \u7a0b\u5e8f\u8c03\u8bd5\n\n\u5728\u7f16\u5199\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u4e0d\u65ad\u5730\u8fdb\u884c\u8c03\u8bd5\u3002\u8fd9\u5305\u62ec\uff1a\n\n- *\u8bed\u6cd5\u68c0\u67e5*\uff1a\u786e\u4fdd\u4ee3\u7801\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u53ef\u4ee5\u901a\u8fc7 IDE \u7684\u7f16\u8bd1\u529f\u80fd\u8fdb\u884c\u68c0\u67e5\u3002\n- *\u529f\u80fd\u6d4b\u8bd5*\uff1a\u5bf9\u6bcf\u4e2a\u529f\u80fd\u6a21\u5757\u5355\u72ec\u8fdb\u884c\u6d4b\u8bd5\uff0c\u786e\u4fdd\u5b83\u4eec\u6309\u9884\u671f\u5de5\u4f5c\u3002\n- *\u6574\u4f53\u6d4b\u8bd5*\uff1a\u5c06\u6240\u6709\u529f\u80fd\u6a21\u5757\u6574\u5408\u5728\u4e00\u8d77\uff0c\u8fdb\u884c\u6574\u4f53\u6d4b\u8bd5\uff0c\u786e\u4fdd\u7cfb\u7edf\u529f\u80fd\u5b8c\u6574\u3002\n- *\u6027\u80fd\u4f18\u5316*\uff1a\u5bf9\u7a0b\u5e8f\u8fdb\u884c\u4f18\u5316\uff0c\u63d0\u9ad8\u8fd0\u884c\u6548\u7387\uff0c\u51cf\u5c11\u8d44\u6e90\u5360\u7528\u3002\n\n=== \u9519\u8bef\u5904\u7406\u4e0e\u65e5\u5fd7\u8bb0\u5f55\n\n\u5728\u7a0b\u5e8f\u4e2d\u5b9e\u73b0\u9519\u8bef\u5904\u7406\u673a\u5236\uff0c\u5f53\u53d1\u751f\u9519\u8bef\u65f6\uff0c\u80fd\u591f\u8bb0\u5f55\u9519\u8bef\u4fe1\u606f\uff0c\u5e76\u5728 OLED \u663e\u793a\u5c4f\u4e0a\u663e\u793a\u3002\u540c\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4e32\u53e3\u8f93\u51fa\u9519\u8bef\u65e5\u5fd7\uff0c\u4fbf\u4e8e\u5f00\u53d1\u8005\u5206\u6790\u95ee\u9898\u3002\n\n=== \u7a0b\u5e8f\u4f18\u5316\n\n\u5728\u786e\u4fdd\u7a0b\u5e8f\u529f\u80fd\u5b8c\u6574\u4e14\u65e0\u660e\u663e\u9519\u8bef\u540e\uff0c\u5bf9\u7a0b\u5e8f\u8fdb\u884c\u4f18\u5316\u3002\u8fd9\u53ef\u80fd\u5305\u62ec\u4ee3\u7801\u91cd\u6784\u3001\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u8ba1\u7b97\u3001\u4f18\u5316\u5185\u5b58\u4f7f\u7528\u7b49\u3002\n\n=== \u7ed3\u8bba\n\n\u8f6f\u4ef6\u7f16\u7a0b\u4e0e\u8c03\u8bd5\u662f\u786e\u4fdd\u6fc0\u5149\u6d4b\u8ddd\u4eea\u80fd\u591f\u6b63\u786e\u8fd0\u884c\u7684\u5173\u952e\u6b65\u9aa4\u3002\u901a\u8fc7\u6784\u5efa\u6e05\u6670\u7684\u7a0b\u5e8f\u6846\u67b6\u3001\u7f16\u5199\u529f\u80fd\u6a21\u5757\u3001\u8fdb\u884c\u7ec6\u81f4\u7684\u8c03\u8bd5\u548c\u4f18\u5316\uff0c\u53ef\u4ee5\u786e\u4fdd\u8f6f\u4ef6\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002\u6b64\u5916\uff0c\u826f\u597d\u7684\u9519\u8bef\u5904\u7406\u548c\u65e5\u5fd7\u8bb0\u5f55\u673a\u5236\u6709\u52a9\u4e8e\u5feb\u901f\u5b9a\u4f4d\u548c\u89e3\u51b3\u6f5c\u5728\u95ee\u9898\u3002\n\n= \u7ed3\u8bba\u4e0e\u5c55\u671b\n\n\u672c\u8bfe\u7a0b\u8bbe\u8ba1\u5b9e\u73b0\u4e86\u4e00\u6b3e\u57fa\u4e8e PLS-K-100 \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757\u548c ESP32 \u5fae\u63a7\u5236\u5668\u7684\u9ad8\u7cbe\u5ea6\u6fc0\u5149\u6d4b\u8ddd\u4eea\u3002\u901a\u8fc7\u8be6\u7ec6\u7684\u786c\u4ef6\u8bbe\u8ba1\u3001\u8f6f\u4ef6\u7f16\u7a0b\u4e0e\u8c03\u8bd5\uff0c\u4ee5\u53ca\u4e25\u683c\u7684\u6d4b\u8bd5\u6d41\u7a0b\u786e\u4fdd\u4ea7\u54c1\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002\u7cfb\u7edf\u80fd\u591f\u6ee1\u8db3 100 \u7c73\u8303\u56f4\u5185\u7684 \u00b12mm \u9ad8\u7cbe\u5ea6\u6d4b\u91cf\u9700\u6c42\uff0c\u5177\u6709\u826f\u597d\u7684\u7528\u6237\u754c\u9762\u548c\u4f4e\u529f\u8017\u8bbe\u8ba1\uff0c\u4e14\u80fd\u591f\u5728\u591a\u79cd\u73af\u5883\u4e0b\u7a33\u5b9a\u5de5\u4f5c\u3002\n\n\u9879\u76ee\u8bbe\u8ba1\u5728\u8fbe\u5230\u9884\u671f\u8bbe\u8ba1\u76ee\u6807\u7684\u57fa\u7840\u4e0a\uff0c\u4ecd\u6709\u8fdb\u4e00\u6b65\u6539\u8fdb\u548c\u6269\u5c55\u7684\u7a7a\u95f4\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u53ef\u80fd\u7684\u672a\u6765\u5de5\u4f5c\u65b9\u5411\uff1a\n\n+ *\u65e0\u7ebf\u901a\u4fe1\u529f\u80fd*\uff1a\u589e\u52a0 Wi-Fi \u6216\u84dd\u7259\u901a\u4fe1\u529f\u80fd\uff0c\u4f7f\u6d4b\u8ddd\u4eea\u80fd\u591f\u4e0e\u667a\u80fd\u624b\u673a\u6216\u5e73\u677f\u7535\u8111\u8fde\u63a5\uff0c\u5b9e\u73b0\u8fdc\u7a0b\u63a7\u5236\u548c\u6570\u636e\u4f20\u8f93\u3002\n+ *\u6570\u636e\u5904\u7406\u4e0e\u5b58\u50a8*\uff1a\u96c6\u6210\u6570\u636e\u5b58\u50a8\u529f\u80fd\uff0c\u5141\u8bb8\u7528\u6237\u8bb0\u5f55\u6d4b\u91cf\u6570\u636e\uff0c\u5e76\u5728\u9700\u8981\u65f6\u8fdb\u884c\u56de\u6eaf\u5206\u6790\u3002\n+ *\u589e\u5f3a\u73b0\u5b9e(AR)\u96c6\u6210*\uff1a\u7ed3\u5408 AR \u6280\u672f\uff0c\u901a\u8fc7\u667a\u80fd\u624b\u673a\u6216\u5e73\u677f\u7535\u8111\u7684\u6444\u50cf\u5934\uff0c\u5c06\u6d4b\u91cf\u7ed3\u679c\u5b9e\u65f6\u53e0\u52a0\u5230\u73b0\u5b9e\u73af\u5883\u4e2d\uff0c\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u3002\n+ *\u591a\u8bed\u8a00\u652f\u6301*\uff1a\u6269\u5c55\u7528\u6237\u754c\u9762\uff0c\u652f\u6301\u591a\u79cd\u8bed\u8a00\uff0c\u4ee5\u9002\u5e94\u4e0d\u540c\u5730\u533a\u7528\u6237\u7684\u9700\u6c42\u3002\n+ *\u73af\u5883\u9002\u5e94\u6027\u589e\u5f3a*\uff1a\u8fdb\u4e00\u6b65\u4f18\u5316\u8bbe\u5907\u7684\u8bbe\u8ba1\uff0c\u63d0\u9ad8\u5176\u5728\u6781\u7aef\u6e29\u5ea6\u548c\u6e7f\u5ea6\u6761\u4ef6\u4e0b\u7684\u7a33\u5b9a\u6027\u3002\n+ *\u667a\u80fd\u7b97\u6cd5\u4f18\u5316*\uff1a\u5229\u7528\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u5bf9\u6d4b\u91cf\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u63d0\u9ad8\u6d4b\u91cf\u7cbe\u5ea6\u548c\u53ef\u9760\u6027\u3002\n+ *\u5546\u4e1a\u5316\u4e0e\u5e02\u573a\u63a8\u5e7f*\uff1a\u5c06\u4ea7\u54c1\u63a8\u5411\u5e02\u573a\uff0c\u4e3a\u5efa\u7b51\u3001\u88c5\u4fee\u3001\u5de5\u4e1a\u6d4b\u91cf\u7b49\u9886\u57df\u63d0\u4f9b\u66f4\u9ad8\u6548\u3001\u4fbf\u6377\u7684\u6d4b\u91cf\u5de5\u5177\u3002\n\n\u901a\u8fc7\u8fd9\u4e9b\u6539\u8fdb\u548c\u6269\u5c55\uff0c\u6211\u4eec\u5e0c\u671b\u8fd9\u6b3e\u6fc0\u5149\u6d4b\u8ddd\u4eea\u5c06\u80fd\u591f\u66f4\u597d\u5730\u6ee1\u8db3\u5e02\u573a\u9700\u6c42\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u66f4\u52a0\u5b8c\u5584\u7684\u6d4b\u91cf\u89e3\u51b3\u65b9\u6848\u3002\n\n= \u53c2\u8003\u6587\u732e \n\n[1] \u6fc0\u5149\u6d4b\u8ddd\u6a21\u5757 PLS-K-100 \u4ea7\u54c1\u624b\u518c \n[2] ESP32 \u5f00\u53d1\u6587\u6863 \n[3] Arduino \u5f00\u53d1\u73af\u5883\u6307\u5357 \n[4] \u7535\u6e90\u7ba1\u7406\u82af\u7247TP5100\u548cLP3220\u7684\u6570\u636e\u624b\u518c\n\n== \u9644\u5f55\n\n- \u786c\u4ef6\u539f\u7406\u56fe\n- PCB\u5e03\u5c40\u56fe\n- \u8f6f\u4ef6\u6e90\u4ee3\u7801\n" }, { "repo": "https://github.com/lucifer1004/leetcode.typ", "file": "https://raw.githubusercontent.com/lucifer1004/leetcode.typ/main/solutions/s0007.typ", "language": "typst", "license": "", "content": "#import \"../helpers.typ\": *\n\n#let reverse-integer-ref(x) = {\n let ans = 0\n let sign = if x >= 0 { 0 } else { -1 }\n if x == -2147483648 {\n return 0\n }\n\n x = calc.abs(x)\n while x != 0 {\n let pop = calc.rem(x, 10)\n x = calc.floor(x / 10)\n if ans > 214748364 or (ans == 214748364 and pop - sign > 7) {\n return 0\n }\n ans = ans * 10 + pop\n }\n ans * (2 * sign + 1)\n}\n" }, { "repo": "https://github.com/soul667/typst", "file": "https://raw.githubusercontent.com/soul667/typst/main/\u4fdd\u7814/PPT(16-9)/university.typ", "language": "typst", "license": "", "content": "#import \"@preview/touying:0.4.0\": *\n#let data=yaml(\"./example.yml\")\n\n// University theme\n\n// Originally contributed by - https://github.com/drupol\n #import \"@preview/showybox:2.0.1\": showybox\n\n// #let colors_=()\n\n#let slide(\n self: none,\n title: auto,\n subtitle: auto,\n header: auto,\n footer: auto,\n now_light:auto,\n display-current-section: auto,\n ..args,\n) = {\n if title != auto {\n self.uni-title = title\n }\n if subtitle != auto {\n self.uni-subtitle = subtitle\n }\n if header != auto {\n self.uni-header = header\n }\n if footer != auto {\n self.uni-footer = footer\n }\n // if now_light != auto {\n self.uni-now_light = now_light\n // }\n if display-current-section != auto {\n self.uni-display-current-section = display-current-section\n }\n (self.methods.touying-slide)(\n ..args.named(),\n self: self,\n setting: body => {\n show: args.named().at(\"setting\", default: body => body)\n body\n },\n ..args.pos(),\n )\n}\n\n#let title-slide(self: none, ..args) = {\n self = utils.empty-page(self)\n let info = self.info + args.named()\n info.authors = {\n let authors = if \"authors\" in info { info.authors } else { info.author }\n if type(authors) == array { authors } else { (authors,) }\n }\n\n let content = {\n if info.logo != none {\n align(right, info.logo)\n }\n // place(top+left,dy:-0em,dx:2.6em,image(\"icon/SINTEF_Logo_Sentrert_RGB.jpg\",width: 3.4em))\n place(bottom+left,dy:-0em,dx:0.6em,image(\"icon/\u6821\u6807.png\",width: 12em))\n place(bottom+right,dy:-0em,dx:-0em,image(\"icon/background.png\",width:18em))\n v(2em)\n place(center + horizon, dx:0em,{\n block(\n inset: 0em,\n breakable: false,\n {\n v(-5.9em)\n text(size: 2.1em, fill: self.colors.primary, strong(info.title))\n if info.subtitle != none {\n v(-1.1em)\n parbreak()\n text(size: 1.2em, fill: self.colors.primary, strong(info.subtitle))\n }\n }\n )\n // set text(size: .9em)\n // grid(\n // columns: (1fr,) * calc.min(info.authors.len(), 3),\n // column-gutter: 1em,\n // row-gutter: 1em,\n // ..info.authors.map(author => text(fill: black, author))\n // )\n // v(1em)\n // if info.institution != none {\n // parbreak()\n // text(size: .9em, info.institution)\n // }\n // if info.date != none {\n // parbreak()\n // text(size: .8em, utils.info-date(self))\n // }\n v(1em)\n place(center,dy:1em,[\n #showybox(\n width:30%,\n frame: (\n border-color: rgb(\"#19448e\").darken(80%),\n title-color:rgb(\"#19448e\").lighten(90%),\n // body-color: rgb(\"#19448e\").lighten(80%)\n dash: \"dashed\",\n // border-color: rgb(\"#19448e\").darken(80%),\n // title-color:rgb(\"#19448e\").lighten(90%),\n // // body-color: rgb(\"#19448e\").lighten(80%)\n // dash: \"dashed\",\n ),\n title-style: (\n color: black,\n weight: \"regular\",\n align: center\n ),\n shadow: (\n offset: 3pt,\n ),\n title: [\n #text(size: 0.8em, strong(\"\u6c47\u62a5\u4eba: \"+ data.\u6807\u9898\u9875.\u59d3\u540d))\n ]\n ,[\n #align(center,\n [\n #text(size: 0.8em, strong(\"\u6c47\u62a5\u65f6\u95f4: \"+ utils.info-date(self)))\n // #h(2em)\n // #text( \"\u5b66\u6821\u4e13\u4e1a:\"+info.institution)\n\n ])\n ],\n)\n ])\n // block(\n // box[\u6c47\u62a5\u4eba:\u53e4\u7ff1\u7fd4]\n\n\n \n })\n }\n (self.methods.touying-slide)(self: self, repeat: none, content)\n}\n\n#let new-section-slide(self: none, short-title: auto, title) = {\n self = utils.empty-page(self)\n let content(self) = {\n set align(horizon)\n show: pad.with(20%)\n set text(size: 1.5em, fill: self.colors.primary, weight: \"bold\")\n states.current-section-with-numbering(self)\n v(-.5em)\n block(height: 2pt, width: 100%, spacing: 0pt, utils.call-or-display(self, self.uni-progress-bar))\n }\n (self.methods.touying-slide)(self: self, repeat: none, section: (title: title, short-title: short-title), content)\n}\n\n#let focus-slide(self: none, background-color: none, background-img: none, body) = {\n let background-color = if background-img == none and background-color == none {\n rgb(self.colors.primary)\n } else {\n background-color\n }\n self = utils.empty-page(self)\n self.page-args += (\n fill: self.colors.primary-dark,\n margin: 1em,\n ..(if background-color != none { (fill: background-color) }),\n ..(if background-img != none { (background: {\n set image(fit: \"stretch\", width: 100%, height: 100%)\n background-img\n })\n }),\n )\n set text(fill: white, weight: \"bold\", size: 2em)\n (self.methods.touying-slide)(self: self, repeat: none, align(horizon, body))\n}\n\n#let matrix-slide(self: none, columns: none, rows: none, ..bodies) = {\n self = utils.empty-page(self)\n (self.methods.touying-slide)(self: self, composer: (..bodies) => {\n let bodies = bodies.pos()\n let columns = if type(columns) == int {\n (1fr,) * columns\n } else if columns == none {\n (1fr,) * bodies.len()\n } else {\n columns\n }\n let num-cols = columns.len()\n let rows = if type(rows) == int {\n (1fr,) * rows\n } else if rows == none {\n let quotient = calc.quo(bodies.len(), num-cols)\n let correction = if calc.rem(bodies.len(), num-cols) == 0 { 0 } else { 1 }\n (1fr,) * (quotient + correction)\n } else {\n rows\n }\n let num-rows = rows.len()\n if num-rows * num-cols < bodies.len() {\n panic(\"number of rows (\" + str(num-rows) + \") * number of columns (\" + str(num-cols) + \") must at least be number of content arguments (\" + str(bodies.len()) + \")\")\n }\n let cart-idx(i) = (calc.quo(i, num-cols), calc.rem(i, num-cols))\n let color-body(idx-body) = {\n let (idx, body) = idx-body\n let (row, col) = cart-idx(idx)\n let color = if calc.even(row + col) { white } else { silver }\n set align(center + horizon)\n rect(inset: .5em, width: 100%, height: 100%, fill: color, body)\n }\n let content = grid(\n columns: columns, rows: rows,\n gutter: 0pt,\n ..bodies.enumerate().map(color-body)\n )\n content\n }, ..bodies)\n}\n\n#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {\n if title-slide {\n (self.methods.title-slide)(self: self)\n }\n (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n // nowlight:now_light,\n aspect-ratio: \"16-9\",\n progress-bar: true,\n display-current-section: true,\n footer-columns: (15%, 15%,15%,15%,15%,10%, 8%),\n footer-a: \"01\u57fa\u672c\u4fe1\u606f\",\n footer-b: \"02\u83b7\u5f97\u8363\u8a89\",\n footer-d: \"03\u7ade\u8d5b\u83b7\u5956\",\n footer-e: \"04\u9879\u76ee\u7ecf\u5386\",\n footer-f: \"05\u5176\u4ed6\u8363\u8a89\",\n footer-g: \"06\u89c4\u5212\",\n\n\n footer-c: self => {\n states.slide-counter.display() + \" / \" + states.last-slide-number\n h(1fr)\n },\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb(\"#19448e\"),\n secondary: rgb(\"#165e83\"),\n tertiary: rgb(\"#507ea4\"),\n )\n // save the variables for later use\n self.uni-enable-progress-bar = progress-bar\n self.uni-progress-bar = self => states.touying-progress(ratio => {\n grid(\n columns: (ratio * 100%, 1fr),\n rows: 2pt,\n components.cell(fill: self.colors.primary),\n components.cell(fill: self.colors.tertiary)\n )\n })\n self.uni-display-current-section = display-current-section\n self.uni-title = none\n self.uni-subtitle = none\n // self.now_light=now_light;\n self.uni-footer = (self) => {\n let cell(fill: none, it) = rect(\n width: 100%, height: 100%, inset: 1mm, outset: 0mm, fill: fill, stroke: none,\n align(horizon, text(fill: white, it))\n )\n show: block.with(width: 100%, height: auto, fill: self.colors.secondary)\n {\n // \u5212\u5206\u989c\u8272\u6570\u7ec4\n }\n let colors_=()\n // if(self)\n let num11 = states.slide-counter;\n // content to num;\n // if num11==3 {\n // now_light=1;\n // }\n // if num11==5 or num11==6 {\n // now_light=1;\n // }\n self.now_light=1\n for value in (0,1,2,3,4,5) {\n if(value==0 or value==2 or value==4){\n colors_.push(self.colors.secondary)\n }\n if(value==1 or value==3 or value==5){\n colors_.push(self.colors.primary)\n }\n\n }\n grid(\n columns: footer-columns,\n rows: (1.5em, auto),\n cell(fill: colors_.at(0), utils.call-or-display(self,footer-a)),\n\n // cell(fill: self.colors.primary, utils.call-or-display(self, footer-a)),\n cell(fill: colors_.at(1), utils.call-or-display(self, footer-b)),\n cell(fill: colors_.at(2), utils.call-or-display(self, footer-d)),\n cell(fill: colors_.at(3), utils.call-or-display(self, footer-e)),\n cell(fill: colors_.at(4), utils.call-or-display(self, footer-f)),\n cell(fill: colors_.at(5), utils.call-or-display(self, footer-g)),\n cell(fill: self.colors.secondary, utils.call-or-display(self, footer-c)),\n )\n }\n self.uni-header = self => {\n if self.uni-title != none {\n block(inset: (x: .5em), \n grid(\n columns: 1,\n gutter: .3em,\n grid(\n columns: (auto, 1fr, auto),\n align(top + left, text(fill: self.colors.primary, weight: \"bold\", size: 1.2em, self.uni-title)),\n [],\n if self.uni-display-current-section {\n align(top + right, text(fill: self.colors.primary.lighten(65%), states.current-section-with-numbering(self)))\n }\n ),\n text(fill: self.colors.primary.lighten(65%), size: .8em, self.uni-subtitle)\n )\n )\n }\n }\n // set page\n let header(self) = {\n set align(top)\n \n place(bottom+left,dx: 0em,dy: -0.4em,[\n #showybox(\n width:100%,\n frame: (\n border-color: self.colors.primary.darken(50%),\n title-color: self.colors.primary.lighten(60%),\n body-color: self.colors.primary.lighten(-0%)\n ),\n [\n #text(size: 1.1em, fill: white)[#strong([#self.uni-header])]\n ]\n // [#text(font: \"Microsoft YaHei\",fill:white)[\u505a\u6700NB]]\n)\n ])\n place(bottom+right,dy:-0.5em,dx:-0.3em,image(\"icon/school_logo.png\",width: 8em))\n // grid(\n // rows: (auto, auto),\n // row-gutter: 5mm,\n // if self.uni-enable-progress-bar {\n // utils.call-or-display(self, self.uni-progress-bar)\n // },\n // utils.call-or-display(self, self.uni-header),\n // )\n }\n let footer(self) = {\n set text(size: .7em)\n set align(center + bottom)\n utils.call-or-display(self, self.uni-footer)\n }\n\n self.page-args += (\n paper: \"presentation-\" + aspect-ratio,\n header: header,\n footer: footer,\n header-ascent: 0em,\n footer-descent: 0em,\n margin: (top: 2.5em, bottom: 1.25em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.title-slide = title-slide\n self.methods.new-section-slide = new-section-slide\n self.methods.touying-new-section-slide = new-section-slide\n self.methods.focus-slide = focus-slide\n self.methods.matrix-slide = matrix-slide\n self.methods.slides = slides\n self.methods.touying-outline = (self: none, enum-args: (:), ..args) => {\n states.touying-outline(self: self, enum-args: (tight: false,) + enum-args, ..args)\n }\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 25pt,font:(\"Times New Roman\"))\n set text(font:\"Source Han Serif\")\n show footnote.entry: set text(size: .6em)\n body\n }\n self\n}\n\n#let basic_info(left_,right_)={\nlet size_=0.8em;\ntext(size: size_, fill: rgb(\"#19448e\"), weight: \"bold\",font:(\"Times New Roman\",\"Source Han Serif\"), left_+\": \")\ntext(size: size_, font:(\"Times New Roman\",\"Source Han Serif\"),fill: black, right_)\nv(-0.5em) \n\n}\n\n#let big_small(big_,small_,big_size,small_size)={\nalign(center,[\n #text(size: big_size, fill: rgb(\"#19448e\"), weight: \"bold\", big_)\n#v(-0.7em)\n#text(size: small_size, fill: rgb(\"#19448e\"), weight: \"bold\", small_)\n])\n\n}\n\n#let big_small1(big_,small_,big_size,small_size)={\nalign(left,[\n #text(size: big_size, fill: rgb(\"#19448e\"), weight: \"bold\", big_)\n#v(-0.7em)\n#text(size: small_size, weight: \"bold\", small_)\n])\n\n}\n\n#let \u8363\u8a89\u8868_\u540d\u79f0(\u8363\u8a89\u540d\u79f0,\u8363\u8a89\u4ecb\u7ecd)={\n // box\n showybox(\n width:90%,\n frame: (\n border-color: rgb(\"#19448e\").darken(80%),\n title-color:rgb(\"#19448e\").lighten(90%),\n // body-color: rgb(\"#19448e\").lighten(80%)\n dash: \"dashed\",\n ),\n title-style: (\n color: black,\n weight: \"regular\",\n align: center,\n boxed-style: (\n anchor: (\n x: center,\n y: horizon\n ),\n radius: (top-left: 10pt, bottom-right: 10pt, rest: 0pt),\n )\n\n ),\n shadow: (\n offset: 3pt,\n ),\n title: [\n // #text(size: 0.8em, strong(\u8363\u8a89\u540d\u79f0))\n #text(size: 0.8em, fill: rgb(\"#19448e\"), weight: \"bold\", \u8363\u8a89\u540d\u79f0)\n ]\n ,[\n #align(center,\n [\n #text(size: 0.6em, strong(\u8363\u8a89\u4ecb\u7ecd))\n // #h(2em)\n // #text( \"\u5b66\u6821\u4e13\u4e1a:\"+info.institution)\n\n ])\n ],\n)\n}\n\n// \u56fe\u7247+\u4e24\u6bb5\u6587\u5b57\n#let \u7ade\u8d5b\u83b7\u5956(\u6587\u5b571,\u6587\u5b572,\u56fe\u7247,size_,percent)={\n showybox(\n width:percent,\n frame: (\n border-color: rgb(\"#19448e\").darken(80%),\n title-color:rgb(\"#19448e\").lighten(90%),\n // body-color: rgb(\"#19448e\").lighten(80%)\n dash: \"dashed\",\n // border-color: rgb(\"#19448e\").darken(80%),\n // title-color:rgb(\"#19448e\").lighten(90%),\n // // body-color: rgb(\"#19448e\").lighten(80%)\n // dash: \"dashed\",\n ),\n title-style: (\n color: black,\n weight: \"regular\",\n align: center\n ),\n shadow: (\n offset: 3pt,\n ),\n title: [\n // #text(size: 0.8em, strong(\"\u6c47\u62a5\u4eba: \"+ data.\u6807\u9898\u9875.\u59d3\u540d))\n// #text(size: 0.8em, fill: rgb(\"#19448e\"), weight: \"bold\", \"\u7b2c\u5341\u516b\u5c4a\u6311\u6218\u676f\u7279\u7b49\u5956\")\n#\u6587\u5b572\n ]\n ,[\n #align(center,\n [\n #image(\u56fe\u7247,width: size_)\n // #text(size: 0.8em, strong(\"\u6c47\u62a5\u65f6\u95f4: \"+ utils.info-date(self)))\n // #h(2em)\n // #text( \"\u5b66\u6821\u4e13\u4e1a:\"+info.institution)\n\n ])\n ],\n)\n// v(-0.5em)\n\n}\n\n#let \u4e13\u5229_\u4e24\u4e2a\u56fe\u7247(\u6587\u5b571,\u6587\u5b572,\u56fe\u72471,\u56fe\u72472,\u56fe\u7247\u95f4\u8ddd,size_,percent)={\n showybox(\n width:percent,\n frame: (\n border-color: rgb(\"#19448e\").darken(80%),\n title-color:rgb(\"#19448e\").lighten(90%),\n // body-color: rgb(\"#19448e\").lighten(80%)\n dash: \"dashed\",\n // border-color: rgb(\"#19448e\").darken(80%),\n // title-color:rgb(\"#19448e\").lighten(90%),\n // // body-color: rgb(\"#19448e\").lighten(80%)\n // dash: \"dashed\",\n ),\n title-style: (\n color: black,\n weight: \"regular\",\n align: center\n ),\n shadow: (\n offset: 3pt,\n ),\n title: [\n // #text(size: 0.8em, strong(\"\u6c47\u62a5\u4eba: \"+ data.\u6807\u9898\u9875.\u59d3\u540d))\n// #text(size: 0.8em, fill: rgb(\"#19448e\"), weight: \"bold\", \"\u7b2c\u5341\u516b\u5c4a\u6311\u6218\u676f\u7279\u7b49\u5956\")\n#\u6587\u5b572\n ]\n ,[\n#align(center, grid(\n columns: (auto,auto),\n rows: (auto),\n gutter: 3pt,\n[#image(\u56fe\u72471,width: size_)],[#image(\u56fe\u72472,width: size_)]))\n // #align(center,\n // [\n // #image(\u56fe\u72471,width: size_) #image(\u56fe\u72472,width: size_)\n\n // // #text(size: 0.8em, strong(\"\u6c47\u62a5\u65f6\u95f4: \"+ utils.info-date(self)))\n // // #h(2em)\n // // #text( \"\u5b66\u6821\u4e13\u4e1a:\"+info.institution)\n\n // ])\n ],\n)\n// v(-0.5em)\n\n}\n\n#let \u5206\u7c7b(\u6807\u9898\u6587\u5b57,list_,percent,bool)={\nlet data_=[];\nlet box_bssic(data1)=[\n #showybox(\n // height: 0.5em,\n frame: (\n border-color: rgb(\"#19448e\").darken(80%),\n title-color:rgb(\"#19448e\").lighten(90%),\n // body-color: rgb(\"#19448e\").lighten(80%)\n dash: \"dashed\",\n ),\n title-style: (\n color: black,\n weight: \"regular\",\n align: center\n ),\n shadow: (\n offset: 3pt,\n ),\n [\n // #v(-0.3em)\n // #align(center,data1)\n#align(center,[\n #text(size: 0.6em, strong(data1))\n])\n ]\n )\n #v(-0.6em)\n\n]\nfor x in list_{\n if(bool==1){\n data_+=box_bssic(x);\n }\n}\nif(bool==0) {\n data_+=box_bssic(list_);\n}\n data_+=v(0.8em);\n showybox(\n width:percent,\n frame: (\n border-color: rgb(\"#19448e\").darken(0%),\n title-color:rgb(\"#19448e\").darken(0%),\n body-color: rgb(\"#19448e\").lighten(100%),\n dash: \"dashed\",\n ),\n title-style: (\n // color: black,\n weight: \"regular\",\n align: center,\n boxed-style: (:),\n // background: \n// title-style: (),\n\n ),\n shadow: (\n offset: 3pt,\n ),\n title: [\n #text(size: 0.8em, strong(\u6807\u9898\u6587\u5b57))\n ]\n ,[\n #align(center,\n [\n #data_\n ])\n ],\n)\n// v(-0.5em)\n\n}" }, { "repo": "https://github.com/Ciolv/typst-template-bachelor-thesis", "file": "https://raw.githubusercontent.com/Ciolv/typst-template-bachelor-thesis/main/main.typ", "language": "typst", "license": "", "content": "#import \"acronyms.typ\": ac,acl,acs,acsp,acp,aclp,acronyms // allows LaTeX \"acro\" like acronym management with only basic features\n#import \"helper.typ\": page_ref\n#import \"config.typ\": conf\n#show: doc => conf(\n title: \"GIVE IT A NICE TITLE\",\n authors: (\n (\n name: \"\",\n company: \"Example Company\",\n matriculation_number: \"1234567\",\n department: \"Example Department\",\n course: \"Example course\",\n course_administrator: \"Course Administrator\",\n scientific_advisor: \"Scientific Advisor\",\n company_advisor: \"Company Advisor\",\n period: \"Editing period\",\n submission_date: \"Submission date\",\n ),\n ),\n university: \"Junivercity\",\n abstract: [#lorem(150)],\n language: \"en\",\n font: \"Manrope\",\n outlines: (\n (\"List of figures\", image),\n (\"List of tables\", image),\n (\"List of listings\", raw)\n ),\n acronym_outline_name: \"List of abbreviations\",\n thesis_type: \"Bachelor Thesis\",\n course_of_studies: \"Course of studies - WOW\",\n field_of_studies: \"Field of studies - Interesting\",\n company_logo: (path: \"Company-logo.png\", alternative_text: \"Company Logo\"),\n university_logo: (path:\"University-logo.png\", alternative_text: \"University Logo\"),\n declaration_on_honour: true,\n bibliography-file: \"references.yml\",\n bibliography-style: \"ieee\",\n doc,\n)\n\n= This is a chapter headline\n\nFor real information, see @chap:useful-guides[chapter] on page #page_ref(). \\\n\n== Let's create a section\n\n#lorem(12)\n\n=== And a subsection\n\n#lorem(80)\n\n=== Yet another subsection\n\n#lorem(10)\n\n== How about another section\n\n#lorem(10)\n\n==== Now we are going really deep\n\n#lorem(80)\n\n\n#include \"chapter.typ\"\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/valkyrie/0.1.1/src/types/dictionary.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"../base-type.typ\": base-type, assert-base-type-dictionary\n#import \"../ctx.typ\": z-ctx\n\n/// Valkyrie schema generator for dictionary types\n///\n/// - ..args (schema): Variadic named arguments, the values for which are schema types. *MUST* not\n/// contain positional arguments.\n/// -> schema\n#let dictionary(\n ..args\n) = {\n // Does not accept positional arguments\n assert(args.pos().len() == 0, message: \"Dictionary only accepts named arguments\")\n\n args = args.named()\n assert-base-type-dictionary(args)\n\n base-type() + (\n name: \"dictionary\",\n dictionary-schema: args,\n validate: (self, dict, ctx: z-ctx(), scope: (\"arguments\",) ) => {\n // assert type\n if not (self.assert-type)(self, dict, scope: scope, ctx: ctx, types: (type((:)),)) {\n return none\n }\n\n // If strict mode, ensure dictionary exactly matches schema\n if ctx.strict {\n for (key, value) in self.dictionary-schema {\n if ( key not in dict ){\n (self.fail-validation)(self, dict, ctx: ctx, scope: (..scope, key), message: \"Missing expected dictionary entry\")\n }\n }\n }\n\n // Check elements\n for (key, schema) in self.dictionary-schema{\n dict.at(key) = (schema.validate)(schema, dict.at(key), ctx: ctx, scope: (..scope, str(key)))\n }\n\n dict\n }\n )\n}\n" }, { "repo": "https://github.com/Hobr/njust_thesis_typst_template", "file": "https://raw.githubusercontent.com/Hobr/njust_thesis_typst_template/main/template/chapter/2.typ", "language": "typst", "license": "MIT License", "content": "// \u7b2c\u4e8c\u7ae0\n= \u80cc\u666f\n\n\u5b66\u6821\u5b66\u79d1\u95e8\u7c7b\u9f50\u5168\uff0c\u529e\u5b66\u7279\u8272\u9c9c\u660e\u3002\u73b0\u6709\u673a\u68b0\u5de5\u7a0b\u5b66\u9662\u3001\u5316\u5b66\u4e0e\u5316\u5de5\u5b66\u9662\u3001\u7535\u5b50\u5de5\u7a0b\u4e0e\u5149\u7535\u6280\u672f\u5b66\u9662\u3001\u8ba1\u7b97\u673a\u79d1\u5b66\u4e0e\u5de5\u7a0b\u5b66\u9662\uff08\u4eba\u5de5\u667a\u80fd\u5b66\u9662\uff09\u3001\u7ecf\u6d4e\u7ba1\u7406\u5b66\u9662\u3001\u80fd\u6e90\u4e0e\u52a8\u529b\u5de5\u7a0b\u5b66\u9662\u3001\u81ea\u52a8\u5316\u5b66\u9662\u3001\u7269\u7406\u5b66\u9662\u3001\u5916\u56fd\u8bed\u5b66\u9662\u3001\u516c\u5171\u4e8b\u52a1\u5b66\u9662\u3001\u9a6c\u514b\u601d\u4e3b\u4e49\u5b66\u9662\u3001\u6750\u6599\u79d1\u5b66\u4e0e\u5de5\u7a0b\u5b66\u9662/\u683c\u83b1\u7279\u7814\u7a76\u9662\u3001\u73af\u5883\u4e0e\u751f\u7269\u5de5\u7a0b\u5b66\u9662\u3001\u8bbe\u8ba1\u827a\u672f\u4e0e\u4f20\u5a92\u5b66\u9662\u3001\u77e5\u8bc6\u4ea7\u6743\u5b66\u9662\u3001\u7f51\u7edc\u7a7a\u95f4\u5b89\u5168\u5b66\u9662\u3001\u667a\u80fd\u5236\u9020\u5b66\u9662\u3001\u65b0\u80fd\u6e90\u5b66\u9662\u3001\u6570\u5b66\u4e0e\u7edf\u8ba1\u5b66\u9662\u3001\u5fae\u7535\u5b50\u5b66\u9662\uff08\u96c6\u6210\u7535\u8def\u5b66\u9662\uff09\u3001\u5b89\u5168\u79d1\u5b66\u4e0e\u5de5\u7a0b\u5b66\u9662\uff08\u5e94\u6025\u7ba1\u7406\u5b66\u9662\uff09\u7b4921\u4e2a\u4e13\u4e1a\u5b66\u9662\uff0c\u4ee5\u53ca\u94b1\u5b66\u68ee\u5b66\u9662\u3001\u4e2d\u6cd5\u5de5\u7a0b\u5e08\u5b66\u9662\u3001\u56fd\u9645\u6559\u80b2\u5b66\u9662\u3001\u521b\u65b0\u521b\u4e1a\u6559\u80b2\u5b66\u9662\u3001\u7ee7\u7eed\u6559\u80b2\u5b66\u9662\uff0c\u5e76\u4e0e\u5408\u4f5c\u65b9\u8054\u5408\u521b\u529e\u4e86\u5357\u4eac\u7406\u5de5\u5927\u5b66\u7d2b\u91d1\u5b66\u9662\u548c\u5357\u4eac\u7406\u5de5\u5927\u5b66\u6cf0\u5dde\u79d1\u6280\u5b66\u96622\u4e2a\u72ec\u7acb\u5b66\u9662\u3002\u5b66\u6821\u5728\u957f\u671f\u53d1\u5c55\u8fc7\u7a0b\u4e2d\u5f62\u6210\u4e86\u5175\u5668\u4e0e\u88c5\u5907\u3001\u4fe1\u606f\u4e0e\u63a7\u5236\u3001\u5316\u5de5\u4e0e\u6750\u6599\u4e09\u5927\u4f18\u52bf\u5b66\u79d1\u7fa4\uff0c\u5de5\u7a0b\u5b66\u3001\u6750\u6599\u79d1\u5b66\u3001\u5316\u5b66\u3001\u8ba1\u7b97\u673a\u79d1\u5b66\u3001\u73af\u5883\u4e0e\u751f\u6001\u5b66\u3001\u7269\u7406\u5b66\u3001\u6570\u5b66\u3001\u4e00\u822c\u793e\u4f1a\u79d1\u5b66\u3001\u751f\u7269\u4e0e\u751f\u7269\u5316\u5b66\u3001\u5730\u7403\u79d1\u5b6610\u4e2a\u5b66\u79d1\u8fdb\u5165ESI\u56fd\u9645\u5b66\u79d1\u9886\u57df\u5168\u7403\u6392\u540d\u524d1%\uff0c\u5176\u4e2d\uff0c\u5de5\u7a0b\u5b66\u3001\u6750\u6599\u79d1\u5b66\u3001\u5316\u5b66\u8fdb\u5165\u524d1\u2030\u3002\u73b0\u6709\u56fd\u5bb6\u91cd\u70b9\u5b66\u79d19\u4e2a\uff0c\u6c5f\u82cf\u7701\u4f18\u52bf\u5b66\u79d110\u4e2a\uff0c\u6c5f\u82cf\u7701\u91cd\u70b9\u5b66\u79d112\u4e2a\uff0c\u5de5\u4fe1\u90e8\u91cd\u70b9\u5b66\u79d17\u4e2a\uff0c\u56fd\u9632\u7279\u8272\u5b66\u79d110\u4e2a\uff1b\u56fd\u5bb6\u7ea7\u4e00\u6d41\u672c\u79d1\u4e13\u4e1a\u5efa\u8bbe\u70b938\u4e2a\uff0c\u6559\u80b2\u90e8\u5353\u8d8a\u5de5\u7a0b\u5e08\u6559\u80b2\u57f9\u517b\u8ba1\u5212\u8bd5\u70b9\u4e13\u4e1a13\u4e2a\uff1b\u56fd\u5bb6\u7ea7\u4e00\u6d41\u672c\u79d1\u8bfe\u7a0b46\u95e8\uff0c\u6559\u80b2\u90e8\u8bfe\u7a0b\u601d\u653f\u793a\u8303\u8bfe\u7a0b3\u95e8\uff1b\u535a\u58eb\u540e\u6d41\u52a8\u7ad919\u4e2a\uff1b\u4e00\u7ea7\u5b66\u79d1\u535a\u58eb\u5b66\u4f4d\u6388\u6743\u70b920\u4e2a\uff0c\u4e00\u7ea7\u5b66\u79d1\u7855\u58eb\u5b66\u4f4d\u6388\u6743\u70b935\u4e2a\uff1b\u5177\u6709\u535a\u58eb\u4e13\u4e1a\u5b66\u4f4d\u6388\u6743\u7c7b\u522b3\u4e2a\uff0c\u7855\u58eb\u4e13\u4e1a\u5b66\u4f4d\u6388\u6743\u7c7b\u522b19\u4e2a\uff1b\u5177\u6709\u9ad8\u7ea7\u7ba1\u7406\u4eba\u5458\u5de5\u5546\u7ba1\u7406\u7855\u58eb\uff08EMBA\uff09\u6388\u4e88\u6743\uff1b\u5177\u6709\u5728\u804c\u4eba\u5458\u4ee5\u540c\u7b49\u5b66\u529b\u7533\u8bf7\u535a\u58eb\u3001\u7855\u58eb\u5b66\u4f4d\u7684\u6388\u4e88\u6743\u4ee5\u53ca\u5916\u56fd\u7559\u5b66\u751f\u548c\u6e2f\u6fb3\u53f0\u5b66\u751f\u7684\u62db\u751f\u6743\u3002\u5b66\u6821\u73b0\u6709\u5404\u7c7b\u5168\u65e5\u5236\u5728\u6821\u751f30000\u4f59\u540d\uff0c\u7559\u5b66\u751f1000\u4f59\u540d\u3002\n\n\u5b66\u6821\u5e08\u8d44\u529b\u91cf\u96c4\u539a\uff0c\u9886\u519b\u4eba\u624d\u96c6\u805a\u3002\u5177\u6709\u6559\u6388\u4efb\u804c\u8d44\u683c\u8bc4\u5ba1\u6743\u548c\u535a\u58eb\u751f\u6307\u5bfc\u6559\u5e08\u8d44\u683c\u5ba1\u6279\u6743\u3002\u73b0\u6709\u6559\u804c\u5de53600\u4f59\u4eba\uff0c\u4e13\u4efb\u6559\u5e082400\u4f59\u4eba\uff0c\u5176\u4e2d\u5177\u6709\u9ad8\u7ea7\u804c\u79f01600\u4f59\u4eba\u3002\u9ad8\u5c42\u6b21\u4eba\u624d700\u4f59\u4eba\uff0c\u5305\u62ec\uff1a\u4e24\u9662\u9662\u58eb27\u4eba\uff0c\u5916\u56fd\u9662\u58eb4\u4eba\uff0c\u56fd\u5bb6\u7ea7\u9886\u519b\u4eba\u624d67\u4eba\uff0c\u56fd\u5bb6\u7ea7\u9752\u5e74\u4eba\u624d126\u4eba\uff0c\u201c\u56fd\u5bb6\u7ea7\u6559\u5b66\u540d\u5e08\u5956\u201d3\u4eba\uff0c\u56fd\u5bb6\u7ea7\u201c\u4e07\u4eba\u8ba1\u5212\u201d\u6559\u5b66\u540d\u5e085\u4eba\uff0c\u9996\u5c4a\u5168\u56fd\u6559\u6750\u5efa\u8bbe\u5956\u5148\u8fdb\u4e2a\u4eba1\u4eba\uff0c\u201c\u5168\u56fd\u521b\u65b0\u4e89\u5148\u5956\u201d\u83b7\u5f97\u80057\u4eba\uff0c\u201c\u56fd\u5bb6\u767e\u5343\u4e07\u4eba\u624d\u5de5\u7a0b\u201d\u4eba\u900914\u4eba\uff0c\u56fd\u5bb6\u7ea7\u3001\u7701\u90e8\u7ea7\u6709\u7a81\u51fa\u8d21\u732e\u4e2d\u9752\u5e74\u4e13\u5bb626\u4eba\u7b49\u3002\u62e5\u6709\u5168\u56fd\u9ad8\u6821\u9ec4\u5927\u5e74\u5f0f\u6559\u5e08\u56e2\u961f3\u4e2a\u3001\u56fd\u5bb6\u7ea7\u6559\u5b66\u56e2\u961f5\u4e2a\u3001\u6559\u80b2\u90e8\u521b\u65b0\u56e2\u961f5\u4e2a\u3001\u6559\u80b2\u90e8\u865a\u62df\u6559\u7814\u5ba4\u5efa\u8bbe\u8bd5\u70b92\u4e2a\u3001\u5de5\u4fe1\u90e8\u7814\u7a76\u578b\u6559\u5b66\u521b\u65b0\u56e2\u961f3\u4e2a\u3001\u56fd\u9632\u79d1\u6280\u521b\u65b0\u56e2\u961f11\u4e2a\u3001\u6c5f\u82cf\u7701\u521b\u65b0\u56e2\u961f39\u4e2a\u3002\u5b66\u6821\u5148\u540e\u5165\u9009\u6c5f\u82cf\u7701\u9ad8\u5c42\u6b21\u4eba\u624d\u521b\u65b0\u521b\u4e1a\u57fa\u5730\u3001\u56fd\u5bb6\u521b\u65b0\u4eba\u624d\u57f9\u517b\u793a\u8303\u57fa\u5730\u548c\u9996\u6279\u6c5f\u82cf\u7701\u8bfe\u7a0b\u601d\u653f\u793a\u8303\u9ad8\u6821\u3002\n\n== \u65b9\u5f0f\n\n\u5b66\u6821\u4eba\u624d\u57f9\u517b\u6c34\u5e73\u7a81\u51fa\uff0c\u80b2\u4eba\u6210\u679c\u4e30\u7855\u3002\u59cb\u7ec8\u575a\u6301\u4eba\u624d\u57f9\u517b\u7684\u4e2d\u5fc3\u5730\u4f4d\uff0c\u56f4\u7ed5\u201c\u5de5\u7a0b\u7cbe\u82f1\u3001\u793e\u4f1a\u4e2d\u575a\u201d\u7684\u4eba\u624d\u57f9\u517b\u5b9a\u4f4d\uff0c\u7acb\u8db3\u4fe1\u606f\u5316\u793e\u4f1a\u5bf9\u4eba\u624d\u7684\u77e5\u8bc6\u3001\u80fd\u529b\u3001\u7d20\u8d28\u7b49\u65b0\u8981\u6c42\uff0c\u57f9\u517b\u5fb7\u624d\u517c\u5907\u3001\u6c42\u771f\u52a1\u5b9e\u3001\u5177\u6709\u5bb6\u56fd\u60c5\u6000\u548c\u56fd\u9645\u7ade\u4e89\u529b\u3001\u80fd\u5f15\u9886\u672a\u6765\u7684\u521b\u65b0\u578b\u7cbe\u82f1\u4eba\u624d\u3002\u529e\u5b6670\u4f59\u5e74\u4ee5\u6765\uff0c\u7d2f\u8ba1\u4e3a\u56fd\u5bb6\u57f9\u517b\u8f93\u9001\u4e8619\u4e07\u4f59\u540d\u5404\u7c7b\u9ad8\u7ea7\u4e13\u95e8\u4eba\u624d\uff0c\u5176\u4e2d16\u4eba\u5f53\u9009\u4e24\u9662\u9662\u58eb\u3002\u201c\u5341\u4e09\u4e94\u201d\u4ee5\u6765\uff0c\u83b7\u5f97\u56fd\u5bb6\u7ea7\u6559\u5b66\u6210\u679c\u59568\u9879\uff0c\u4e2d\u56fd\u5b66\u4f4d\u4e0e\u7814\u7a76\u751f\u6559\u80b2\u5b66\u4f1a\u7814\u7a76\u751f\u6559\u80b2\u6210\u679c\u5956\u4e00\u7b49\u59561\u9879\uff0c\u7701\u90e8\u7ea7\u6559\u5b66\u6210\u679c\u595633\u9879\u3002\u5b66\u6821\u521b\u65b0\u521b\u4e1a\u6559\u80b2\u5de5\u4f5c\u6210\u6548\u663e\u8457\uff0c\u83b7\u6279\u56fd\u5bb6\u53cc\u521b\u793a\u8303\u57fa\u5730\u3001\u9996\u6279\u201c\u56fd\u5bb6\u7ea7\u521b\u65b0\u521b\u4e1a\u5b66\u9662\u201d\uff0c\u662f\u9996\u6279\u201c\u5168\u56fd\u521b\u65b0\u521b\u4e1a\u5178\u578b\u7ecf\u9a8c\u9ad8\u6821\u201d\u201c\u5168\u56fd\u6df1\u5316\u521b\u65b0\u521b\u4e1a\u6559\u80b2\u6539\u9769\u793a\u8303\u9ad8\u6821\u201d\uff0c\u540c\u65f6\u4e5f\u662f\u201c\u4e2d\u7f8e\u9752\u5e74\u521b\u5ba2\u4ea4\u6d41\u4e2d\u5fc3\u201d\u548c\u201c\u5168\u56fd\u9ad8\u6821\u5b9e\u8df5\u80b2\u4eba\u521b\u65b0\u521b\u4e1a\u57fa\u5730\u201d\u843d\u6237\u9ad8\u6821\uff1b\u5728\u5404\u7c7b\u91cd\u5927\u8d5b\u4e8b\u4e2d\u5c61\u83b7\u4f73\u7ee9\uff0c\u5176\u4e2d\uff0c\u5728\u7b2c\u5341\u56db\u5c4a\u201c\u6311\u6218\u676f\u201d\u5168\u56fd\u5927\u5b66\u751f\u8bfe\u5916\u5b66\u672f\u79d1\u6280\u4f5c\u54c1\u7ade\u8d5b\u4e2d\uff0c\u5b66\u6821\u4ee5\u603b\u5206\u7b2c\u4e00\u7684\u6210\u7ee9\u6367\u5f97\u201c\u6311\u6218\u676f\u201d\uff1b\u5728\u7b2c\u516b\u5c4a\u4e2d\u56fd\u56fd\u9645\u201c\u4e92\u8054\u7f51+\u201d\u5927\u5b66\u751f\u521b\u65b0\u521b\u4e1a\u5927\u8d5b\u4e2d\u65a9\u83b7\u603b\u51a0\u519b\uff0c\u6210\u4e3a\u5168\u56fd\u540c\u65f6\u83b7\u5f97\u201c\u6311\u6218\u676f\u201d\u548c\u201c\u4e92\u8054\u7f51+\u201d\u603b\u51a0\u519b\u7684\u4e09\u6240\u9ad8\u6821\u4e4b\u4e00\u3002\n\n\u5b66\u6821\u79d1\u6280\u4f18\u52bf\u7a81\u51fa\uff0c\u6807\u5fd7\u6027\u6210\u679c\u4e0d\u65ad\u6d8c\u73b0\u3002\u4e3b\u52a8\u5bf9\u63a5\u670d\u52a1\u56fd\u5bb6\u91cd\u5927\u6218\u7565\uff0c\u6301\u7eed\u63a8\u8fdb\u9646\u6d77\u7a7a\u5929\u4fe1\u878d\u5408\u53d1\u5c55\uff0c\u4e3a\u56fd\u9632\u81ea\u4e3b\u521b\u65b0\u548c\u7ecf\u6d4e\u793e\u4f1a\u53d1\u5c55\u63d0\u4f9b\u5f3a\u6709\u529b\u652f\u6491\u3002\u73b0\u6709\u56fd\u5bb6\u7ea7\u91cd\u70b9\u5b9e\u9a8c\u5ba43\u4e2a\uff0c\u524d\u6cbf\u79d1\u5b66\u4e2d\u5fc31\u4e2a\uff0c\u56fd\u5bb6\u7ea7\u6280\u672f\u521b\u65b0\u4e2d\u5fc31\u4e2a\uff0c\u56fd\u5bb6\u7ea7\u5de5\u7a0b\u6280\u672f\u7814\u7a76\u4e2d\u5fc31\u4e2a\uff0c\u56fd\u5bb6\u5730\u65b9\u8054\u5408\u5de5\u7a0b\u5b9e\u9a8c\u5ba41\u4e2a\uff0c\u7701\u90e8\u5171\u5efa\u534f\u540c\u521b\u65b0\u4e2d\u5fc31\u4e2a\uff0c\u56fd\u5bb6\u6807\u51c6\u521b\u65b0\u57fa\u57301\u4e2a\uff0c\u56fd\u5bb6\u7ea7\u6280\u672f\u7814\u7a76\u63a8\u5e7f\u4e2d\u5fc31\u4e2a\uff0c\u56fd\u5bb6\u7ea7\u6280\u672f\u7814\u7a76\u5f00\u53d1\u4e2d\u5fc31\u4e2a\uff0c\u56fd\u5bb6\u7ea7\u68c0\u6d4b\u4e2d\u5fc32\u4e2a\uff0c\u7701\u90e8\u7ea7\u79d1\u7814\u5e73\u53f0\uff08\u54f2\u793e\u57fa\u5730\uff0975\u4e2a\uff0c\u5efa\u6709\u56fd\u5bb6\u5927\u5b66\u79d1\u6280\u56ed\uff0c\u5e76\u4ee5\u6b64\u4e3a\u4f9d\u6258\u627f\u62c5\u4e86\u4e00\u5927\u6279\u56fd\u5bb6\u91cd\u5927\u79d1\u7814\u4efb\u52a1\uff0c\u4ea7\u51fa\u4e86\u4e00\u6279\u91cd\u5927\u539f\u521b\u6027\u6210\u679c\u3002\u53d1\u660e\u4e86\u4e16\u754c\u9886\u5148\u7684\u5168\u7b49\u5f0f\u6a21\u5757\u88c5\u836f\u6280\u672f\uff0c\u4f5c\u4e3a\u603b\u5e08\u5355\u4f4d\u7814\u5236\u7684\u67d0\u578b\u8f66\u8f7d\u70ae\u6b66\u5668\u7cfb\u7edf\u4eae\u76f8\u56fd\u5e8670\u5468\u5e74\u9605\u5175\u5f0f\u5e76\u5217\u88c5\u90e8\u961f\uff1b\u9996\u521b\u590d\u6742\u88c5\u5907\u7cfb\u7edf\u52a8\u529b\u5b66\u5feb\u901f\u8ba1\u7b97\u65b9\u6cd5\uff0c\u5efa\u7acb\u591a\u4f53\u7cfb\u7edf\u53d1\u5c04\u52a8\u529b\u5b66\u7406\u8bba\u4e0e\u6280\u672f\u4f53\u7cfb\uff1b\u5408\u6210\u4e86\u5168\u7403\u9996\u4e2a\u6c2e\u4e94\u9634\u79bb\u5b50\u76d0\uff0c\u6210\u679c\u5728\u300aScience\u300b\u300aNature\u300b\u53d1\u8868\uff0c\u5f15\u9886\u56fd\u9645\u65b0\u578b\u9ad8\u80fd\u542b\u80fd\u6750\u6599\u53d1\u5c55\uff1b\u53d1\u660e\u9ad8\u6e29PST\u949b\u94dd\u5355\u6676\uff0c\u653b\u514b\u949b\u94dd\u5408\u91d1\u5ba4\u6e29\u8106\u6027\u5927\u548c\u670d\u5f79\u6e29\u5ea6\u4f4e\u4e24\u5927\u56fd\u9645\u6027\u96be\u9898\uff0c\u63a8\u52a8\u6211\u56fd\u822a\u7a7a\u53d1\u52a8\u673a\u6838\u5fc3\u6280\u672f\u53d1\u5c55\uff1b\u7814\u5236\u51fa\u56fd\u5185\u9996\u4e2a\u56fa\u6001\u56fe\u50cf\u589e\u5f3a\u5668\u4ef6\u548c\u7ea2\u5916\u56fe\u50cf\u4fe1\u53f7\u5904\u7406\u4e13\u7528\u82af\u7247\u3002\u201c\u5341\u4e09\u4e94\u201d\u4ee5\u6765\uff0c\u83b7\u5f97\u7701\u90e8\u7ea7\u53ca\u4ee5\u4e0a\u79d1\u6280\u5956\u52b1271\u9879\uff0c\u5176\u4e2d\u56fd\u5bb6\u79d1\u5b66\u6280\u672f\u595617\u9879\uff0c\u5b9e\u73b0\u56fd\u5bb6\u79d1\u5b66\u6280\u672f\u5956\u4e94\u5927\u5956\u79cd\u5168\u8986\u76d6\u3002\u5b66\u6821\u5927\u529b\u63a8\u8fdb\u4ea7\u5b66\u7814\u5408\u4f5c\uff0c\u63a8\u52a8\u91cd\u5927\u79d1\u6280\u6210\u679c\u7684\u8f6c\u5316\u5e94\u7528\uff0c\u88ab\u8ba4\u5b9a\u4e3a\u9996\u6279\u9ad8\u7b49\u5b66\u6821\u79d1\u6280\u6210\u679c\u8f6c\u5316\u548c\u6280\u672f\u8f6c\u79fb\u57fa\u5730\u3001\u9996\u6279\u56fd\u5bb6\u77e5\u8bc6\u4ea7\u6743\u793a\u8303\u9ad8\u6821\uff0c\u5728\u9ad8\u7aef\u88c5\u5907\u3001\u65b0\u4e00\u4ee3\u4fe1\u606f\u6280\u672f\u3001\u65b0\u6750\u6599\u7b49\u65b0\u5174\u4ea7\u4e1a\u9886\u57df\u521b\u9020\u4e86\u663e\u8457\u7684\u7ecf\u6d4e\u6548\u76ca\u548c\u793e\u4f1a\u6548\u76ca\u3002\n\n== \u6d4b\u8bd5\n\n#lorem(300)\n" }, { "repo": "https://github.com/Kasci/LiturgicalBooks", "file": "https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/styleCasoslov.typ", "language": "typst", "license": "", "content": "#import \"/style.typ\": *\n#import \"texts.typ\": *\n#import \"textsTmp.typ\": *\n\n#let si = [\n #lettrine(\"Sl\u00e1va:\") #lettrine(\"I n\u00fd\u0148i:\")\n]\n\n#let ektenia(num) = [\n ==== Ekt\u00e9nia \n \n #lettrine(\"H\u00f3spodi, pom\u00edluj.\") #primText[(#(num)x)]\n\n #si\n]\n\n#let verse(verse) = [\n #let c = counter(\"verse\")\n #c.update(10)\n\n #let tbl = {\n verse.map(k => (\n primText[#c.display(\"1:\"); #c.update(c => c - 1)]\n ,[#k]\n )\n )\n }\n #tbl.push((primText[S:I:], si))\n #table(\n columns: (15pt, auto),\n stroke: none,\n align: (x, y) => (right, left).at(x),\n ..tbl.flatten()\n )\n]\n\n#let prokimenyVecierne = [\n \n === Pondelok - Nede\u013ea ve\u010der, 8. hlas \n \n #lettrine(\"S\u00e9 n\u00fd\u0148i blahoslov\u00edte H\u00f3spoda vs\u00ed rab\u00fd H\u00f3spodni.\")\n \n #vers[Stoj\u00e1\u0161\u010diji v chr\u00e1mi H\u00f3spodni, vo dv\u00f3rich B\u00f3hu n\u00e1\u0161eho.]\n \n === Utorok - Pondelok ve\u010der, 4. hlas \n \n #lettrine(\"H\u00f3spo\u010f usl\u00fd\u0161it mj\u00e1, vnehd\u00e1 vozzv\u00e1ti m\u00ed k nem\u00fa:\")\n \n #vers[Vnehd\u00e1 prizv\u00e1ti m\u00ed, usl\u00fd\u0161a mj\u00e1 B\u00f3h pr\u00e1vdy mojej\u00e1.]\n \n === Streda - Utorok ve\u010der, 1. hlas \n \n #lettrine(\"M\u00edlos\u0165 tvoj\u00e1, H\u00f3spodi, po\u017een\u00e9t mj\u00e1, vo svj\u00e1 dn\u00ed \u017eivot\u00e1 mojeh\u00f3.\")\n \n #vers[H\u00f3spo\u010f pas\u00e9t mj\u00e1, i ni\u010dt\u00f3\u017ee mj\u00e1 li\u0161\u00edt, na m\u00eds\u0165i zl\u00e1\u010d\u0148i t\u00e1mo vsel\u00ed mj\u00e1.]\n \n === \u0160tvrtok - Streda ve\u010der, 5. hlas \n \n #lettrine(\"B\u00f3\u017ee, vo \u00edmja tvoj\u00e9 spas\u00ed mj\u00e1, i s\u00ed\u013ei tvoj\u00e9j sud\u00ed m\u00ed.\")\n \n #vers[B\u00f3\u017ee usl\u00fd\u0161i mol\u00edtvu moj\u00fa, vnu\u0161\u00ed hlah\u00f3ly \u00fast moj\u00edch.]\n \n === Piatok - \u0160tvrtok ve\u010der, 6. hlas \n \n #lettrine(\"P\u00f3mo\u0161\u010d moj\u00e1 ot H\u00f3spoda, sotv\u00f3r\u0161aho n\u00e9bo i z\u00e9m\u013eu.\")\n \n #vers[Vozved\u00f3ch \u00f3\u010di moj\u00ed v h\u00f3ry, ot\u0148\u00fadu\u017ee prij\u00eddet p\u00f3mo\u0161\u010d moj\u00e1.]\n \n === Sobota - Piatok ve\u010der, 7. hlas \n \n #lettrine(\"B\u00f3\u017ee z\u00e1stupnik m\u00f3j jes\u00ed t\u00fd, i m\u00edlos\u0165 tvoj\u00e1 predvar\u00edt mj\u00e1.\")\n \n #vers[Izm\u00ed mj\u00e1 ot vr\u00e1h moj\u00edch B\u00f3\u017ee, i ot vost\u00e1ju\u0161\u010dich na mj\u00e1, izb\u00e1vi mj\u00e1.]\n\n]\n\n#let slohy(slohy) = [\n #let c = counter(\"verse\")\n #c.update(1)\n\n #let tbl = {\n slohy.map(k => (\n [],primText[\\[#c.display(\"1.\") sloha\\]],\n primText[#c.display(\"i:\"); #c.step()]\n ,[#k]\n )\n )\n }\n #tbl.push((\n [],primText[\\[#c.display(\"1.\") sloha\\]],\n primText[S:I:], si,\n [],primText(\"[Bohor\u00f3di\u010den]\")\n ))\n #table(\n columns: (15pt, auto),\n stroke: none,\n align: (x, y) => (right, left).at(x),\n ..tbl.flatten()\n )\n]" }, { "repo": "https://github.com/LDemetrios/Typst4k", "file": "https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/scripting/module.typ", "language": "typst", "license": "", "content": "// SKIP\n// A file to import in import / include tests.\n#import \"modules/chap2.typ\"\n\n#let a\n#let b = 1\n#let c = 2\n#let d = 3\n#let value = [hi]\n#let item(a, b) = a + b\n#let push(a) = a + 1\n#let fn = rect.with(fill: conifer, inset: 5pt)\n\nSome _includable_ text.\n" }, { "repo": "https://github.com/loicreynier/sandbox", "file": "https://raw.githubusercontent.com/loicreynier/sandbox/main/typst-demo/template.typ", "language": "typst", "license": "The Unlicense", "content": "#let conf(title: none, authors: (), abstract: [], doc) = {\n set document(title: title, author: authors.first().name)\n\n set page(paper: \"a4\", numbering: \"1/1\")\n\n set text(font: \"New Computer Modern\", size: 11pt)\n\n set align(center)\n text(17pt)[*#title*]\n\n set math.equation(numbering: \"(1)\", supplement: [Eq.])\n\n show heading: hname => [\n #set align(center)\n #set text(12pt, weight: \"bold\")\n #block(smallcaps(hname.body))\n ]\n\n let count = authors.len()\n let ncols = calc.min(count, 3)\n grid(columns: (1fr,) * ncols, row-gutter: 24pt, ..authors.map(author => [\n #author.name \\\n #author.affiliation \\\n #link(\"mailto:\" + author.email)\n ]))\n\n par(justify: true)[\n *#smallcaps(\"Abstract\")* \\\n #abstract\n ]\n\n set par(justify: true)\n set align(left)\n // columns(2, doc)\n doc\n}\n" }, { "repo": "https://github.com/j10ccc/algorithm-analysis-homework-template-typst", "file": "https://raw.githubusercontent.com/j10ccc/algorithm-analysis-homework-template-typst/main/layout/divider.typ", "language": "typst", "license": "", "content": "#let divider = [\n #v(10pt)\n #line(length: 100%, stroke: .5pt)\n #v(10pt)\n]\n" }, { "repo": "https://github.com/ofurtumi/formleg", "file": "https://raw.githubusercontent.com/ofurtumi/formleg/main/h01/h1.typ", "language": "typst", "license": "", "content": "#set heading(numbering: \"1.\")\n#import \"@preview/cetz:0.1.0\"\n\n= Proof by induction\nLets prove that:\n\n$ (1+2+...+n)^2 > 1^2+2^2+...+n^2 \"for\" n >= 2 $\n\nLet's rewrite both of the sums of $n$ numbers: \n- sum of $n$ numbers: $1+2+...+n=((n(n+1))/2)^2$ \n- square sum of $n$ numbers: $1^2+2^2+...+n^2=(n(n+1)(2n+1))/6$\n\nNow we can try to prove that $((n(n+1))/2)^2 > (n(n+1)(2n+1))/6$ and simplify it further\n\n== Base case: $n=2$\n\n$ ((2(2+1))/2)^2 = 3^2 = 9 > (2(2+1)(4+1))/6 = (30\\/6)/6 = 5 $\n\n\n== Inductive step:\nThe prove holds for the base case. \nNow we can assume that the prove holds for $k$ and try to prove it for $k+1$.\n\n$ \n(((k+1)(k+2))/2)^2 &> ((k+1)(k+2)(2(k+1)+1))/6 \\ \n((k^2+3k+2)/2)^2 &> (2k^3+9k^2+13k+6)/6 \\\n(k^4 +6k^3 + 13k^2+12k+4)/4 &> (2k^3+9k^2+13k+6)/6\n$\n\nSince we know that $k >= 2$ we can say that $k^4 >= 4k^3$ and $k^2 >= 2k$ and $12k >= 13$ and $4 >= 6$.\n\n= Triple $0$ state machine\n#image(\"../imgs/h1-2.png\")\nHere we have a simle state machine tha only allows through itself binary strings that include a substring of _\"000\"_.\n\n#pagebreak()\n\n= Is $B$ a regular language\n#grid(columns: (3fr, 1fr), gutter: 16pt, [\nSuppose that $A$ is a regular language with alphabet $Sigma$. Let $B$ denote the language where we have omitted strings with an even length\n$ B={w in A: |w| = 2k + 1 \"for some\" k = 1,2,...} $\nWe can show that *$B$ is regular* by creating a state machine for the language. We can only go between $S_0$ and $S_1$, and we can only end in $S_1$ if we have an odd number of letters in the input word.\n],[\n#align(center + horizon,\n cetz.canvas({\n import cetz.draw: *\n circle((0, 0), name: \"s0\", radius: 0.5)\n circle((2, 0), name: \"s1\", radius: 0.5)\n circle(\"s1.center\", name: \"s11\", radius: 0.4)\n content(\"s0.center\", [$S_0$])\n content(\"s1.center\", [$S_1$])\n line(\"s0.right\", \"s1.left\", name: \"line\", mark: (end: \">\", start: \">\"))\n content((1, 0.25), [$Sigma$])\n })\n)]\n)\n\n= Calculating checksum\n== Proofing that $w^R in A \"for all\" w in A$\n\nWe know that \n$ c = a_0 xor a_1 xor ... xor a_n $ \nand $w^R$, being the reverse of $w$, should correspond to \n$ c^R = a_n xor a_(n-1) xor ... xor a_0 $ \n\nBecause of the commutitive properties of XOR we know that $a_0 xor a_1 = a_1 xor a_0$ and since $c^R$ is just $c$ reversed we can safely say that $c = c^R$ and therefore we proof that $w^R in A \"for all\" w in A$\n" }, { "repo": "https://github.com/Quaternijkon/notebook", "file": "https://raw.githubusercontent.com/Quaternijkon/notebook/main/content/\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5/.chapter-\u6570\u636e\u7ed3\u6784/\u5b57\u7b26\u4e32/\u6700\u957f\u56de\u6587\u5b50\u4e32.typ", "language": "typst", "license": "", "content": "#import \"../../../../lib.typ\":*\n\n=== #Title(\n title: [\u6700\u957f\u56de\u6587\u5b50\u4e32],\n reflink: \"https://leetcode.cn/problems/longest-palindromic-substring/description/\",\n level: 2,\n)<\u6700\u957f\u56de\u6587\u5b50\u4e32>\n\n#note(\n title: [\n\u6700\u957f\u56de\u6587\u5b50\u4e32\n ],\n\n description: [\n\u7ed9\u4f60\u4e00\u4e2a\u5b57\u7b26\u4e32s\uff0c\u627e\u5230s\u4e2d\u6700\u957f\u7684\u56de\u6587\u5b50\u4e32\u3002\n ],\n\n examples: ([\n\u8f93\u5165\uff1as = \"babad\"\n\n\u8f93\u51fa\uff1a\"bab\"\n\n\u89e3\u91ca\uff1a\"aba\" \u540c\u6837\u662f\u7b26\u5408\u9898\u610f\u7684\u7b54\u6848\u3002 \n ],[\n\u8f93\u5165\uff1as = \"cbbd\"\n\n\u8f93\u51fa\uff1a\"bb\" \n ]\n ),\n\n tips: [\n1 <= s.length <= 1000\n\ns \u4ec5\u7531\u6570\u5b57\u548c\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\n ],\n\n solutions: (\n ( name:[\u52a8\u6001\u89c4\u5212],\n text:[\n\u5bf9\u4e8e\u4e00\u4e2a\u5b50\u4e32\u800c\u8a00\uff0c\u5982\u679c\u5b83\u662f\u56de\u6587\u4e32\uff0c\u5e76\u4e14\u957f\u5ea6\u5927\u4e8e 2\uff0c\u90a3\u4e48\u5c06\u5b83\u9996\u5c3e\u7684\u4e24\u4e2a\u5b57\u6bcd\u53bb\u9664\u4e4b\u540e\uff0c\u5b83\u4ecd\u7136\u662f\u4e2a\u56de\u6587\u4e32\u3002\u4f8b\u5982\u5bf9\u4e8e\u5b57\u7b26\u4e32 \u201cababa\u201d\uff0c\u5982\u679c\u6211\u4eec\u5df2\u7ecf\u77e5\u9053 \u201cbab\u201d \u662f\u56de\u6587\u4e32\uff0c\u90a3\u4e48 \u201cababa\u201d \u4e00\u5b9a\u662f\u56de\u6587\u4e32\uff0c\u8fd9\u662f\u56e0\u4e3a\u5b83\u7684\u9996\u5c3e\u4e24\u4e2a\u5b57\u6bcd\u90fd\u662f \u201ca\u201d\u3002\n\n\u6839\u636e\u8fd9\u6837\u7684\u601d\u8def\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7528\u52a8\u6001\u89c4\u5212\u7684\u65b9\u6cd5\u89e3\u51b3\u672c\u9898\u3002\u6211\u4eec\u7528 `P(i,j)` \u8868\u793a\u5b57\u7b26\u4e32 s \u7684\u7b2c i \u5230 j \u4e2a\u5b57\u6bcd\u7ec4\u6210\u7684\u4e32\uff08\u4e0b\u6587\u8868\u793a\u6210 `s[i:j]`\uff09\u662f\u5426\u4e3a\u56de\u6587\u4e32\uff1a\n\n$ cases(\nP(i,j)=\"true\" \" \u5982\u679c\u5b50\u4e32\u00a0\"S_i\u2026S_j\"\u662f\u56de\u6587\u4e32\",\nP(i,j)=\"false\"\" \u5176\u5b83\u60c5\u51b5\"\n) $\n \n\u8fd9\u91cc\u7684\u300c\u5176\u5b83\u60c5\u51b5\u300d\u5305\u542b\u4e24\u79cd\u53ef\u80fd\u6027\uff1a\n\n- `s[i,j]` \u672c\u8eab\u4e0d\u662f\u4e00\u4e2a\u56de\u6587\u4e32\uff1b\n- $i>j$\uff0c\u6b64\u65f6 `s[i,j]` \u672c\u8eab\u4e0d\u5408\u6cd5\u3002\n\n\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u5199\u51fa\u52a8\u6001\u89c4\u5212\u7684\u72b6\u6001\u8f6c\u79fb\u65b9\u7a0b\uff1a\n\n$ P(i,j)=P(i+1,j\u22121)\u2227(S_i==S_j) $\n\n\u4e5f\u5c31\u662f\u8bf4\uff0c\u53ea\u6709 `s[i+1:j\u22121]` \u662f\u56de\u6587\u4e32\uff0c\u5e76\u4e14 s \u7684\u7b2c i \u548c j \u4e2a\u5b57\u6bcd\u76f8\u540c\u65f6\uff0c`s[i:j]` \u624d\u4f1a\u662f\u56de\u6587\u4e32\u3002\n\n\u4e0a\u6587\u7684\u6240\u6709\u8ba8\u8bba\u662f\u5efa\u7acb\u5728\u5b50\u4e32\u957f\u5ea6\u5927\u4e8e 2 \u7684\u524d\u63d0\u4e4b\u4e0a\u7684\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u8003\u8651\u52a8\u6001\u89c4\u5212\u4e2d\u7684\u8fb9\u754c\u6761\u4ef6\uff0c\u5373\u5b50\u4e32\u7684\u957f\u5ea6\u4e3a 1 \u6216 2\u3002\u5bf9\u4e8e\u957f\u5ea6\u4e3a 1 \u7684\u5b50\u4e32\uff0c\u5b83\u663e\u7136\u662f\u4e2a\u56de\u6587\u4e32\uff1b\u5bf9\u4e8e\u957f\u5ea6\u4e3a 2 \u7684\u5b50\u4e32\uff0c\u53ea\u8981\u5b83\u7684\u4e24\u4e2a\u5b57\u6bcd\u76f8\u540c\uff0c\u5b83\u5c31\u662f\u4e00\u4e2a\u56de\u6587\u4e32\u3002\u56e0\u6b64\u6211\u4eec\u5c31\u53ef\u4ee5\u5199\u51fa\u52a8\u6001\u89c4\u5212\u7684\u8fb9\u754c\u6761\u4ef6\uff1a\n$ cases(\nP(i,i)=\"true\",\nP(i,i+1)=(S_i==S_{i+1})\n) $\n\n \n\u6839\u636e\u8fd9\u4e2a\u601d\u8def\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5b8c\u6210\u52a8\u6001\u89c4\u5212\u4e86\uff0c\u6700\u7ec8\u7684\u7b54\u6848\u5373\u4e3a\u6240\u6709 `P(i,j)=true` \u4e2d `j\u2212i+1`\uff08\u5373\u5b50\u4e32\u957f\u5ea6\uff09\u7684\u6700\u5927\u503c\u3002#YellowText[\u6ce8\u610f\uff1a\u5728\u72b6\u6001\u8f6c\u79fb\u65b9\u7a0b\u4e2d\uff0c\u6211\u4eec\u662f\u4ece\u957f\u5ea6\u8f83\u77ed\u7684\u5b57\u7b26\u4e32\u5411\u957f\u5ea6\u8f83\u957f\u7684\u5b57\u7b26\u4e32\u8fdb\u884c\u8f6c\u79fb\u7684\uff0c\u56e0\u6b64\u4e00\u5b9a\u8981\u6ce8\u610f\u52a8\u6001\u89c4\u5212\u7684\u5faa\u73af\u987a\u5e8f\u3002]\n ],code:[\n```cpp\n#include \n#include \n#include \n\nusing namespace std;\n\nclass Solution {\npublic:\n string longestPalindrome(string s) {\n int n = s.size();\n if (n < 2) {\n return s;\n }\n\n int maxLen = 1;\n int begin = 0;\n // dp[i][j] \u8868\u793a s[i..j] \u662f\u5426\u662f\u56de\u6587\u4e32\n vector> dp(n, vector(n));\n // \u521d\u59cb\u5316\uff1a\u6240\u6709\u957f\u5ea6\u4e3a 1 \u7684\u5b50\u4e32\u90fd\u662f\u56de\u6587\u4e32\n for (int i = 0; i < n; i++) {\n dp[i][i] = true;\n }\n // \u9012\u63a8\u5f00\u59cb\n // \u5148\u679a\u4e3e\u5b50\u4e32\u957f\u5ea6\n for (int L = 2; L <= n; L++) {\n // \u679a\u4e3e\u5de6\u8fb9\u754c\uff0c\u5de6\u8fb9\u754c\u7684\u4e0a\u9650\u8bbe\u7f6e\u53ef\u4ee5\u5bbd\u677e\u4e00\u4e9b\n for (int i = 0; i < n; i++) {\n // \u7531 L \u548c i \u53ef\u4ee5\u786e\u5b9a\u53f3\u8fb9\u754c\uff0c\u5373 j - i + 1 = L \u5f97\n int j = L + i - 1;\n // \u5982\u679c\u53f3\u8fb9\u754c\u8d8a\u754c\uff0c\u5c31\u53ef\u4ee5\u9000\u51fa\u5f53\u524d\u5faa\u73af\n if (j >= n) {\n break;\n }\n\n if (s[i] != s[j]) {\n dp[i][j] = false;\n } else {\n if (j - i < 3) {\n dp[i][j] = true;\n } else {\n dp[i][j] = dp[i + 1][j - 1];\n }\n }\n\n // \u53ea\u8981 dp[i][L] == true \u6210\u7acb\uff0c\u5c31\u8868\u793a\u5b50\u4e32 s[i..L] \u662f\u56de\u6587\uff0c\u6b64\u65f6\u8bb0\u5f55\u56de\u6587\u957f\u5ea6\u548c\u8d77\u59cb\u4f4d\u7f6e\n if (dp[i][j] && j - i + 1 > maxLen) {\n maxLen = j - i + 1;\n begin = i;\n }\n }\n }\n return s.substr(begin, maxLen);\n }\n};\n``` \n ]),\n ( name:[\u4e2d\u5fc3\u6269\u5c55\u7b97\u6cd5],\n text:[\n\u6211\u4eec\u4ed4\u7ec6\u89c2\u5bdf\u4e00\u4e0b\u65b9\u6cd5\u4e00\u4e2d\u7684\u72b6\u6001\u8f6c\u79fb\u65b9\u7a0b\uff1a\n\n$ cases(\nP(i,j)=\"true\",\nP(i,i+1)=(S_i==S_{i+1}),\nP(i,j)=P(i+1,j\u22121)\u2227(S_i==S_j)\n) $\n\n\u627e\u51fa\u5176\u4e2d\u7684\u72b6\u6001\u8f6c\u79fb\u94fe\uff1a\n\n$ P(i,j)\u2190P(i+1,j\u22121)\u2190P(i+2,j\u22122)\u2190\u22ef\u2190\"\u67d0\u4e00\u8fb9\u754c\u60c5\u51b5\" $\n\u53ef\u4ee5\u53d1\u73b0\uff0c#BlueText[\u6240\u6709\u7684\u72b6\u6001\u5728\u8f6c\u79fb\u7684\u65f6\u5019\u7684\u53ef\u80fd\u6027\u90fd\u662f\u552f\u4e00\u7684]\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u53ef\u4ee5\u4ece\u6bcf\u4e00\u79cd\u8fb9\u754c\u60c5\u51b5\u5f00\u59cb\u300c\u6269\u5c55\u300d\uff0c\u4e5f\u53ef\u4ee5\u5f97\u51fa\u6240\u6709\u7684\u72b6\u6001\u5bf9\u5e94\u7684\u7b54\u6848\u3002\n\n\u8fb9\u754c\u60c5\u51b5\u5373\u4e3a\u5b50\u4e32\u957f\u5ea6\u4e3a 1 \u6216 2 \u7684\u60c5\u51b5\u3002\u6211\u4eec\u679a\u4e3e\u6bcf\u4e00\u79cd\u8fb9\u754c\u60c5\u51b5\uff0c\u5e76\u4ece\u5bf9\u5e94\u7684\u5b50\u4e32\u5f00\u59cb\u4e0d\u65ad\u5730\u5411\u4e24\u8fb9\u6269\u5c55\u3002\u5982\u679c\u4e24\u8fb9\u7684\u5b57\u6bcd\u76f8\u540c\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7ee7\u7eed\u6269\u5c55\uff0c\u4f8b\u5982\u4ece `P(i+1,j\u22121)` \u6269\u5c55\u5230 `P(i,j)`\uff1b\u5982\u679c\u4e24\u8fb9\u7684\u5b57\u6bcd\u4e0d\u540c\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u505c\u6b62\u6269\u5c55\uff0c\u56e0\u4e3a\u5728\u8fd9\u4e4b\u540e\u7684\u5b50\u4e32\u90fd\u4e0d\u80fd\u662f\u56de\u6587\u4e32\u4e86\u3002\n\n\u806a\u660e\u7684\u8bfb\u8005\u6b64\u65f6\u5e94\u8be5\u53ef\u4ee5\u53d1\u73b0\uff0c\u300c\u8fb9\u754c\u60c5\u51b5\u300d\u5bf9\u5e94\u7684\u5b50\u4e32\u5b9e\u9645\u4e0a\u5c31\u662f\u6211\u4eec\u300c\u6269\u5c55\u300d\u51fa\u7684\u56de\u6587\u4e32\u7684\u300c\u56de\u6587\u4e2d\u5fc3\u300d\u3002\u65b9\u6cd5\u4e8c\u7684\u672c\u8d28\u5373\u4e3a\uff1a\u6211\u4eec\u679a\u4e3e\u6240\u6709\u7684\u300c\u56de\u6587\u4e2d\u5fc3\u300d\u5e76\u5c1d\u8bd5\u300c\u6269\u5c55\u300d\uff0c\u76f4\u5230\u65e0\u6cd5\u6269\u5c55\u4e3a\u6b62\uff0c\u6b64\u65f6\u7684\u56de\u6587\u4e32\u957f\u5ea6\u5373\u4e3a\u6b64\u300c\u56de\u6587\u4e2d\u5fc3\u300d\u4e0b\u7684\u6700\u957f\u56de\u6587\u4e32\u957f\u5ea6\u3002\u6211\u4eec\u5bf9\u6240\u6709\u7684\u957f\u5ea6\u6c42\u51fa\u6700\u5927\u503c\uff0c\u5373\u53ef\u5f97\u5230\u6700\u7ec8\u7684\u7b54\u6848\u3002\n ],code:[\n```cpp\nclass Solution {\npublic:\n pair expandAroundCenter(const string& s, int left, int right) {\n while (left >= 0 && right < s.size() && s[left] == s[right]) {\n --left;\n ++right;\n }\n return {left + 1, right - 1};\n }\n\n string longestPalindrome(string s) {\n int start = 0, end = 0;\n for (int i = 0; i < s.size(); ++i) {\n auto [left1, right1] = expandAroundCenter(s, i, i);\n auto [left2, right2] = expandAroundCenter(s, i, i + 1);\n if (right1 - left1 > end - start) {\n start = left1;\n end = right1;\n }\n if (right2 - left2 > end - start) {\n start = left2;\n end = right2;\n }\n }\n return s.substr(start, end - start + 1);\n }\n};\n``` \n ]),\n ( name:[Manacher \u7b97\u6cd5],\n text:[\n\u7565\n ],code:[\n```cpp\nclass Solution {\npublic:\n int expand(const string& s, int left, int right) {\n while (left >= 0 && right < s.size() && s[left] == s[right]) {\n --left;\n ++right;\n }\n return (right - left - 2) / 2;\n }\n\n string longestPalindrome(string s) {\n int start = 0, end = -1;\n string t = \"#\";\n for (char c: s) {\n t += c;\n t += '#';\n }\n t += '#';\n s = t;\n\n vector arm_len;\n int right = -1, j = -1;\n for (int i = 0; i < s.size(); ++i) {\n int cur_arm_len;\n if (right >= i) {\n int i_sym = j * 2 - i;\n int min_arm_len = min(arm_len[i_sym], right - i);\n cur_arm_len = expand(s, i - min_arm_len, i + min_arm_len);\n } else {\n cur_arm_len = expand(s, i, i);\n }\n arm_len.push_back(cur_arm_len);\n if (i + cur_arm_len > right) {\n j = i;\n right = i + cur_arm_len;\n }\n if (cur_arm_len * 2 + 1 > end - start) {\n start = i - cur_arm_len;\n end = i + cur_arm_len;\n }\n }\n\n string ans;\n for (int i = start; i <= end; ++i) {\n if (s[i] != '#') {\n ans += s[i];\n }\n }\n return ans;\n }\n};\n``` \n ])\n\n ),\n\n gain:none,\n)" }, { "repo": "https://github.com/clementjumel/resume-template", "file": "https://raw.githubusercontent.com/clementjumel/resume-template/main/template.typ", "language": "typst", "license": "", "content": "#let resume(\n author: \"\",\n description: \"\",\n phone: \"\",\n location: \"\",\n email: \"\",\n github: \"\",\n linkedin: \"\",\n image-path: \"\",\n accent-color: \"#000000\",\n body,\n) = {\n\n // Sets document metadata\n set document(author: author, title: author)\n\n // Document-wide formatting, including font and margins\n set text(\n // LaTeX style font\n font: \"New Computer Modern\",\n size: 10pt,\n lang: \"en\",\n // Disable ligatures so ATS systems do not get confused when parsing fonts.\n ligatures: false\n )\n\n // Reccomended to have 0.5in margin on all sides\n set page(\n margin: (0.5in),\n \"us-letter\",\n )\n\n\n // Link styles\n show link: underline\n\n\n // Small caps for section titles\n show heading.where(level: 2): it => [\n #pad(top: 0pt, bottom: -10pt, [#smallcaps(it.body)])\n #line(length: 100%, stroke: 1pt)\n ]\n\n // Accent Color Styling\n show heading: set text(\n fill: rgb(accent-color),\n )\n\n show link: set text(\n fill: rgb(accent-color),\n )\n\n // Name will be aligned left, bold and big\n show heading.where(level: 1): it => [\n #set align(left)\n #set text(\n weight: 700,\n size: 20pt,\n )\n #it.body\n ]\n\n let personal_data = [\n #(\n phone,\n location,\n link(\"mailto:\" + email)[#email],\n link(github)[GitHub],\n link(linkedin)[LinkedIn],\n ).join(\" | \")\n ]\n\n let personal_section = [\n = #(author) // Level 1 Heading\n #pad(\n top: 0.25em,\n align(left)[\n #(description)\\ // Add a line break after description (smaller separation than new paragraph)\n #(personal_data)\n ],\n )\n ]\n\n if image-path == \"\" [\n #personal_section\n ] else [\n #let personal_image = image(image-path)\n #grid(\n columns: (82%, 16%),\n gutter: 2%,\n align: horizon, // Center the line vertically\n personal_section,\n personal_image,\n )\n ]\n\n // Main body.\n set par(justify: true)\n\n body\n}\n\n// Generic two by two component for resume\n#let generic-two-by-two(\n top-left: \"\",\n top-right: \"\",\n bottom-left: \"\",\n bottom-right: \"\",\n) = {\n pad[\n #top-left #h(1fr) #top-right \\\n #bottom-left #h(1fr) #bottom-right\n ]\n}\n\n// Generic one by two component for resume\n#let generic-one-by-two(\n left: \"\",\n right: \"\",\n) = {\n pad[\n #left #h(1fr) #right\n ]\n}\n\n// Cannot just use normal --- ligature becuase ligatures are disabled for good reasons\n#let dates-helper(\n start-date: \"\",\n end-date: \"\",\n) = {\n start-date + \" \" + $dash.em$ + \" \" + end-date\n}\n\n// Section components below\n#let edu(\n institution: \"\",\n dates: \"\",\n degree: \"\",\n gpa: \"\",\n location: \"\",\n) = {\n generic-two-by-two(\n top-left: strong(institution),\n top-right: dates,\n bottom-left: degree,\n bottom-right: emph(location),\n )\n}\n\n#let work(\n title: \"\",\n dates: \"\",\n company: \"\",\n location: \"\",\n) = {\n generic-two-by-two(\n top-left: strong(company),\n top-right: dates,\n bottom-left: title,\n bottom-right: emph(location),\n )\n}\n\n#let project(\n role: \"\",\n name: \"\",\n url: \"\",\n dates: \"\",\n) = {\n pad[\n *#role*, #name (#link(\"https://\" + url)[#url]) #h(1fr) #dates\n ]\n}\n\n#let extracurriculars(\n activity: \"\",\n dates: \"\",\n) = {\n generic-one-by-two(\n left: strong(activity),\n right: dates,\n )\n}\n" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/outline-indent_00.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n// With heading numbering\n#set page(width: 200pt)\n#set heading(numbering: \"1.a.\")\n#outline()\n#outline(indent: false)\n#outline(indent: true)\n#outline(indent: none)\n#outline(indent: auto)\n#outline(indent: 2em)\n#outline(indent: n => ([-], [], [==], [====]).at(n))\n#outline(indent: n => \"!\" * calc.pow(2, n))\n\n= About ACME Corp.\n\n== History\n#lorem(10)\n\n== Products\n#lorem(10)\n\n=== Categories\n#lorem(10)\n\n==== General\n#lorem(10)\n" }, { "repo": "https://github.com/Error-418-SWE/Documenti", "file": "https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/2%20-%20RTB/Documentazione%20esterna/Verbali/23-11-15/23-11-15.typ", "language": "typst", "license": "", "content": "#import \"/template.typ\": *\n\n#show: project.with(\n date: \"15/11/23\",\n subTitle: \"Avvio dell'Analisi dei Requisiti\",\n docType: \"verbale\",\n authors: (\n \"\",\n ),\n externalParticipants : (\n (name: \"\", role: \"Referente aziendale\"),\n ),\n timeStart: \"10:00\",\n timeEnd: \"11:00\",\n location: \"Zoom\",\n);\n\n\n= Ordine del giorno\n- Approfondimento specifiche del capitolato;\n\n- Presentazione, supportata da una board Miro, delle domande raccolte dal gruppo sostanziate con proposte e mock up. Le domande si articolano in:\n - identificazione della tipologia di utente a cui il prodotto \u00e8 destinato;\n - prime proposte di user interface e user experience;\n - differenza di funzionalit\u00e0 tra applicativo desktop e mobile;\n - funzionalit\u00e0 desiderate;\n - API RESTful.\n\n- Conferme riguardo lo stack tecnologico individuato;\n\n- Scelta del canale di comunicazione preferenziale tra Proponente e Fornitore;\n\n- Organizzazione di un prossimo meeting e programmazione regolare degli incontri.\n\n\\\n== Approfondimento specifiche del capitolato\nLo scopo del meeting \u00e8 iniziare l'Analisi dei Requisiti, focalizzando l'attenzione sulla comprensione delle funzionalit\u00e0 richieste, la loro implementazione e il dominio tecnologico che il gruppo utilizzer\u00e0.\nLe domande raccolte dal gruppo sono state catalogate nei seguenti ambiti:\n- use case;\n- funzionalit\u00e0;\n- user interface e user experience;\n- stack tecnologico.\n\n\\\n== Presentazione delle domande raccolte dal gruppo in merito ai requisiti\n=== Utente\nL'utente tipico \u00e8 stato individuato nella figura di un amministratore e/o impiegato lato back-office, dotato dunque di massimi privilegi durante l'uso dell'applicativo.\\\nLe principali azioni che tale utente svolger\u00e0 sono:\n - interrogazione del magazzino;\n - richiesta di spostamento di un prodotto;\n - zoom e spostamento all'interno dell'ambiente 3D.\n\n=== User interface & user experience\nDurante l'incontro si \u00e8 presentata un'idea generale di possibile user interface. Sono state individuate alcune caratteristiche desiderabili, quali:\n- esporre con chiarezza le operazioni disponibili all'utente (distinzione evidente tra elementi selezionabili e non);\n- evitare eccessive animazioni o effetti _lampeggianti_;\n- evidenziare in modo chiaro gli elementi ricercati (ad esempio riducendo l'opacit\u00e0 degli altri elementi), al fine di non disorientare l'utente;\n- spostare la telecamera sull'oggetto ricercato (se singolo);\n- essenziale che la ricerca non modifichi la struttura visualizzata del magazzino.\n\n=== Differenze tra applicativo desktop e mobile\nDurante la riunione \u00e8 emerso che vi saranno delle differenze tra la versione desktop e la versione mobile. L'accesso completo alla funzionalit\u00e0 (esempio richiesta di spostamento di prodotti) sar\u00e0 fornito per la versione desktop, mentre la versione mobile presenter\u00e0 delle funzioni limitate (ad esempio solo visualizzazione e ricerca). In ogni caso, il gap funzionale tra dispositivi rimane ancora da definire nel dettaglio. L'applicativo sar\u00e0 responsive.\n\n=== Funzionalit\u00e0 desiderate\nDa una prima analisi sono emerse le principali funzionalit\u00e0 desiderate, quali:\n- creazione dell'ambiente 3D del magazzino, articolata in:\n - definizione dei parametri dimensionali del magazzino ;\n - creazione e posizionamento nello spazio degli scaffali;\n - definizione dei bin, ovvero le locazioni capaci di accogliere i prodotti;\n- caricamento dei dati da un database per la popolazione del magazzino;\n- interrogazione del magazzino mediante ricerche per ID, nome, o caratteristiche dei prodotti;\n- evidenziazione dei prodotti ricercati mediante effetti visivi (ad esempio cambio del colore) e/o spostamento della telecamera;\n- invio di notifiche mediante la chiamata a API RESTful per lo spostamento di prodotti nel magazzino.\n\nDurante l'analisi del processo di configurazione si \u00e8 chiarito che il primo passaggio di configurazione riguarda la definizione della geometria del magazzino. Per un magazzino a pianta rettangolare, la geometria pu\u00f2 essere definita con tre parametri (lunghezza, larghezza, altezza); per scenari pi\u00f9 complessi, il software deve essere in grado di definire la geometria del magazzino dai \\ contenuti in un file SVG caricato dall'utente. Successivamente, vengono caricati i dati presenti nel DB.\nIl database non impone vincoli strutturali, ma \u00e8 pensato per interfacciarsi con la struttura determinata in fase di creazione.\n\n=== API RESTful\nPer l'invio delle notifiche di richiesta di spostamento, l'applicativo si interfaccer\u00e0 con delle API RESTful. \u00c8 emerso che l'implementazione di tali API non \u00e8 di interesse del capitolato, e per tale motivazione possiamo procedere ad una simulazione del comportamento delle stesse con assunzioni riguardo i parametri e le risposte. Ad esempio per lo spostamento di un elemento da un bin ad un altro:\n- invio all'API delle coordinate di partenza (es: scaffale) e delle coordiante d'arrivo (un altro scaffale) e il prodotto interessato;\n- l'API risponde:\n - stato 200 (contatto con l'API avvenuto con successo): spostamento richiesto con successo;\n - stato 200 (contatto con l'API avvenuto con successo): spostamento non possibile;\n- risposte alle interrogazioni ottenuta in formato JSON;\n- la logica di controllo della facolt\u00e0 di spostare un prodotto \u00e8 gestita interamente dall'endpoint REST.\n\\\n== Conferme riguardo lo stack tecnologico individuato\nLo stack tecnologico individuato dal gruppo si articola in:\n- DB SQL per la gestione del database relazionale;\n- Three.js per l'implementazione della parte grafica (JavaScript o TypeScript);\n- Node.js per la comunicazione tra applicativo e database;\n- Docker per la containerizzazione del prodotto.\n\nLo stack tecnologico discusso rappresenta un punto di partenza, ma \u00e8 soggetto a modifiche. Ad ogni modo, al momento, le tecnologie individuate e proposte hanno trovato l'approvazione del Proponente.\nIn merito all'utilizzo di JavaScript o TypeScript ed eventuali framework per il lato front end (ad esempio React, Angular), il Proponente ha lasciato la massima libert\u00e0 al Gruppo. L'azienda Proponente utilizza internamente TypeScript e Angular.\n\\\n== Stabilimento delle metodologie di contatto\nIl Proponente ha confermato l'intenzione di proseguire i contatti mediante l'uso di posta elettronica.\n\\\n\n== Organizzazione di un prossimo meeting e programmazione regolare degli incontri\nL'incontro si \u00e8 concluso con la programmazione del prossimo meeting in data 23 novembre 2023, dalle ore 14:00 alle ore 15:00.\\\nIn questa prima fase di Analisi dei Requisiti, Proponente e Fornitore si sono trovati d'accordo circa la necessit\u00e0 di svolgere incontri con cadenza almeno settimanale.\n\n\\\n= Azioni da intraprendere\nA seguito del meeting sono state individuate le seguenti operazioni da svolgere:\n- raccolta e catalogazione di aspettative e bisogni;\n- produzione della documentazione quale use cases, Analisi dei Requisiti da presentare al prossimo meeting;\n- esplorazione del dominio tecnologico.\n" }, { "repo": "https://github.com/fredguth/abnt-typst", "file": "https://raw.githubusercontent.com/fredguth/abnt-typst/main/main.typ", "language": "typst", "license": "", "content": "#import(\"./templates/abnt_template.typ\"):template\n#show: template\n\n#include(\"./cap1.typ\")\n#include(\"./cap2.typ\")\n#include(\"./cap3.typ\")\n#include(\"./cap4.typ\")\n#include(\"./cap5.typ\")\n" }, { "repo": "https://github.com/jamesrswift/frackable", "file": "https://raw.githubusercontent.com/jamesrswift/frackable/main/docs/manual.typ", "language": "typst", "license": "The Unlicense", "content": "#import \"@preview/tidy:0.3.0\"\n#import \"@preview/mantys:0.1.4\": *\n#import \"/src/lib.typ\": frackable, generator\n\n#let package = toml(\"/typst.toml\").package\n#let docs = tidy.parse-module(read(\"/src/impl.typ\"), scope: (frackable: frackable, generator: generator),)\n\n#titlepage(\n package.name,\n [Frackable], // title\n [], //subtitle \n none, //description, \n package.authors,\n (package.repository,), \n package.version,\n datetime.today(), \n none, // abstract, \n package.license,\n toc: false,\n)\n\n#tidy.show-module(docs, style: tidy.styles.default)" }, { "repo": "https://github.com/astro-group-bristol/paper-management", "file": "https://raw.githubusercontent.com/astro-group-bristol/paper-management/main/presentation/tamburlaine.typ", "language": "typst", "license": "Other", "content": "#import \"@preview/polylux:0.3.1\": *\n\n#let date = datetime(year: 2024, month: 9, day: 27)\n\n// colour configurations\n#let SECONDARY_COLOR = rgb(\"#f6f0e0\").lighten(60%)\n#let PRIMARY_COLOR = rgb(\"#be2b31\")\n#let TEXT_COLOR = black.lighten(13%)\n\n#let tamburlaine-theme(aspect-ratio: \"4-3\", body) = {\n set page(\n paper: \"presentation-\" + aspect-ratio,\n fill: SECONDARY_COLOR,\n margin: 0.7em\n )\n set text(fill: TEXT_COLOR, size: 25pt, font: \"NimbusSanL\")\n body\n}\n\n#let title-slide(\n title: none,\n title_size: 80pt,\n authors: (),\n where: none,\n content\n) = {\n set page(\n fill: SECONDARY_COLOR,\n margin: (top: 0em, left: 0em, right: 0em, bottom: 0em),\n )\n set text(fill: TEXT_COLOR, weight: \"bold\")\n let pretty-title = move(dx: 0.5em, rect(outset: (top: 6pt, right: 6pt, left: 34pt, bottom: 34pt), stroke: PRIMARY_COLOR + 4pt,\n rect(outset: (top: 4pt, right: 4pt, left: 22pt, bottom: 22pt), stroke: PRIMARY_COLOR + 4pt,\n rect(outset: (top: 2pt, right: 2pt, left: 12pt, bottom: 12pt), stroke: PRIMARY_COLOR + 4pt,\n rect(outset: (top: 0pt, right: 0pt, left: 4pt, bottom: 4pt), stroke: PRIMARY_COLOR + 4pt,\n block(width: 85%, fill: PRIMARY_COLOR, inset: (top: 0em, bottom: 0.0em, left: 1em, right: 2em),\n par(leading: 10pt)[\n #text(weight: \"black\", size:title_size, fill: SECONDARY_COLOR)[#title]\n ]))))))\n\n let author = authors.join(h(1em))\n\n logic.polylux-slide[\n #v(1.5em)\n #align(center)[\n #pretty-title\n ]\n #v(1.5em)\n #rect(inset: (top: 0em, left: 1em, right: 1em), width:100%, stroke:none, fill: SECONDARY_COLOR)[\n #grid(\n columns: (50%, 1fr),\n row-gutter: 3pt,\n author,\n align(right, where),\n align(left, text(size: 20pt, weight: \"regular\")[]),\n align(right, text(size: 20pt, weight: \"regular\",\n [#date.display(\"[day] [month repr:long] [year]\") / Bristol]\n )),\n )\n #v(-1.5em)\n #content\n #v(-0.5em)\n ]\n ]\n}\n\n#let subtitle-slide(\n title_size: 80pt,\n title,\n) = {\n set page(\n fill: SECONDARY_COLOR,\n margin: (top: 0em, left: 0em, right: 0em, bottom: 0em),\n )\n set text(fill: TEXT_COLOR, weight: \"bold\")\n let pretty-title = move(dx: 0.5em, rect(outset: (top: 6pt, right: 6pt, left: 34pt, bottom: 34pt), stroke: PRIMARY_COLOR + 4pt,\n rect(outset: (top: 4pt, right: 4pt, left: 22pt, bottom: 22pt), stroke: PRIMARY_COLOR + 4pt,\n rect(outset: (top: 2pt, right: 2pt, left: 12pt, bottom: 12pt), stroke: PRIMARY_COLOR + 4pt,\n rect(outset: (top: 0pt, right: 0pt, left: 4pt, bottom: 4pt), stroke: PRIMARY_COLOR + 4pt,\n block(width: 85%, fill: PRIMARY_COLOR, inset: (top: 0em, bottom: 0.5em, left: 1em, right: 2em),\n par(leading: 10pt)[\n #text(weight: \"black\", size:title_size, fill: SECONDARY_COLOR)[#title]\n ]))))))\n\n logic.polylux-slide[\n #set align(horizon)\n #v(-3em)\n #align(center)[\n #pretty-title\n ]\n ]\n}\n\n\n#let slide(foreground: TEXT_COLOR, background: SECONDARY_COLOR, title: none, body) = {\n set page(\n fill: background,\n margin: (bottom: 1.5em)\n )\n\n let footer = locate( loc => {\n block(\n stroke: ( top: 1mm + PRIMARY_COLOR ), width: 100%, inset: ( y: .5em ),\n text(fill: foreground, .5em, {\n \"CC BY-SA 4.0 \"\n h(2em)\n \"/\"\n h(2em)\n \"Astro Dev Group\"\n h(2em)\n \"/\"\n h(2em)\n date.display(\"[day] [month repr:long] [year]\")\n h(1fr)\n logic.logical-slide.display()\n })\n )\n })\n\n set page(\n footer: footer,\n footer-descent: 0em,\n header-ascent: 1.5em,\n )\n\n let content = {\n block(outset: 0.8em, width: 100%, fill: PRIMARY_COLOR, spacing: 0.8em, par(leading: 10pt, text(fill: SECONDARY_COLOR, size: 50pt, weight: \"black\", title)))\n v(0.3em)\n body\n }\n\n logic.polylux-slide(content)\n}\n\n#let _setgrp(img, grp, display:true) = {\n let key = \"id=\\\"\" + grp + \"\\\"\"\n let pos1 = img.split(key)\n if display {\n pos1.at(1) = pos1.at(1).replace(\"display:none\", \"display:inline\", count:1)\n } else {\n pos1.at(1) = pos1.at(1).replace(\"display:inline\", \"display:none\", count:1)\n }\n pos1.join(key)\n}\n\n#let setgrp(img, ..grps, display: true) = {\n grps.pos().fold(img, (acc, grp) => {\n _setgrp(acc, grp, display: display)\n })\n}\n\n#let animsvg(img, display_callback, ..frames, handout: false) = {\n let _frame_wrapper(_img, hide: (), display: ()) = {\n setgrp((setgrp(_img, ..hide, display: false)), ..display, display: true)\n }\n if handout == true {\n let final_image = frames.pos().fold(img, (im, args) => _frame_wrapper(im, ..args))\n display_callback(1, final_image)\n } else {\n let output = ()\n let current_image = img\n for args in frames.pos().enumerate() {\n let (i, frame) = args\n current_image = _frame_wrapper(\n current_image, ..frame\n )\n let this = display_callback(i + 1, current_image)\n output.push(this)\n }\n output.join()\n }\n}\n\n#let cbox(content, ..args) = rect(radius: 3pt, outset: 5pt, ..args, content)\n" }, { "repo": "https://github.com/bigskysoftware/hypermedia-systems-book", "file": "https://raw.githubusercontent.com/bigskysoftware/hypermedia-systems-book/main/lib/definitions.typ", "language": "typst", "license": "Other", "content": "#let leading = 0.6em\n#let body-font = \"Linux Libertine\"\n#let secondary-font = \"Linux Biolinum\"\n#let display-font = \"Jaro\"\n#let mono-font = \"Berkeley Mono\"\n\n#import \"./indexing.typ\": *\n\n#let part-heading(it) = [\n #page([], header: none, footer: none)\n #pagebreak(to: \"odd\")\n #align(horizon)[\n #set par(leading: 5pt, justify: false)\n #set text(size: 32pt, font: display-font)\n #text(fill: luma(140))[\n #it.at(\"supplement\", default: none)\n #counter(heading).display(\"I\")\n ]\n #linebreak()\n #it.body\n #metadata(\"\")\n ]\n]\n\n#let chapter-heading(it) = [\n #page([], header: none, footer: none)\n #pagebreak(to: \"odd\")\n #v(3in)\n #set par(justify: false)\n #set text(size: 22pt, font: display-font)\n #block({\n if it.at(\"numbering\") != none {\n text(fill: luma(140), {\n it.supplement\n [ ]\n str(counter(heading).get().at(1))\n })\n linebreak()\n }\n it.body\n [#metadata(\"\")]\n })\n]\n\n#let asciiart(..args, source) = figure({\n set text(size: .8em)\n set par(leading: .5em)\n block(breakable: false, align(start, raw(source, block: true)))\n}, kind: image, ..args)\n\n#let blockquote = quote.with(block: true)\n\n#let sidebar(title, body) = [#block(\n spacing: 1em, block(\n width: 100%,\n inset: 1em,\n stroke: (top: 1pt, bottom: 1pt),\n fill: luma(237),\n breakable: true,\n )[\n #set text(.8em, font: secondary-font)\n #if title != [] {\n block(\n breakable: false,\n strong(title)\n )\n }\n #block(spacing: 1em, body)\n ],\n)]\n\n#let important(title, body) = [#block(\n spacing: 1em, block(\n width: 100%,\n inset: 1em,\n stroke: (\n top: (thickness: 1pt, paint: blue), bottom: (thickness: 1pt, paint: blue),\n ),\n fill: rgb(\"#def\"),\n breakable: true,\n )[\n #set text(.8em, font: secondary-font)\n #block(\n breakable: false,\n strong(title) + v(4em)\n )\n #v(-4em)\n #block(spacing: 1em, body)\n ],\n)]\n\n#let html-note(label: [HTML Notes], title, body) = [#block(\n spacing: 1em,\n block(\n width: 100%,\n inset: 1em,\n stroke: (top: 1pt, bottom: 1pt),\n fill: rgb(\"#f5f5ff\"),\n breakable: true,\n )[\n #set text(.8em, font: secondary-font)\n #show heading: set text(1em)\n\n === #label: #title\n #body\n ],\n)]\n\n#let skew(angle, vscale: 1, body) = {\n let (a, b, c, d) = (1, vscale * calc.tan(angle), 0, vscale)\n let E = (a + d) / 2\n let F = (a - d) / 2\n let G = (b + c) / 2\n let H = (c - b) / 2\n let Q = calc.sqrt(E * E + H * H)\n let R = calc.sqrt(F * F + G * G)\n let sx = Q + R\n let sy = Q - R\n let a1 = calc.atan2(F, G)\n let a2 = calc.atan2(E, H)\n let theta = (a2 - a1) / 2\n let phi = (a2 + a1) / 2\n\n set rotate(origin: bottom + center)\n set scale(origin: bottom + center)\n\n rotate(phi, scale(x: sx * 100%, y: sy * 100%, rotate(theta, body)))\n}\n" }, { "repo": "https://github.com/mgoulao/IST-MSc-Thesis-Typst-Template", "file": "https://raw.githubusercontent.com/mgoulao/IST-MSc-Thesis-Typst-Template/main/template.typ", "language": "typst", "license": "", "content": "\n#let heading_style(it) = {\n // Set chapter\n locate(loc => {\n let heading_number = counter(heading).at(loc).at(0)\n if it.level == 1{\n if heading_number != 0 {\n pagebreak()\n align(right,\n grid(rows: (140pt,auto),\n text(140pt, fill: rgb(\"#999999\"), counter(heading).display()),\n text(28pt, it.body)\n )\n )\n pagebreak()\n } else {\n pad(\n bottom: 50pt,\n text(30pt, it))\n }\n // Increase figures counter\n // counter(figure).step(level: 1)\n }\n else if it.level <= 3 {\n pad(\n top: 10pt,\n bottom: 10pt,\n text(14pt, it)\n )\n }\n else if it.level > 3 {\n // Set run-in subheadings, starting at level 4.\n parbreak()\n text(11pt, style: \"italic\", weight: \"regular\", it.body + \".\")\n } else {\n it\n }\n })\n}\n\n#let project(\n school_logo: none,\n cover_image: none,\n title: \"\",\n subtitle: \"\",\n author: \"\",\n degree: \"\",\n supervisors: (),\n committee: (),\n date: \"\",\n abstract: [],\n abstract_pt: none,\n custom_sections: (),\n body,\n) = {\n // Set the document's basic properties.\n set document(author: author, title: title)\n set page(\n margin: (left: 20mm, right: 20mm, top: 20mm, bottom: 20mm),\n )\n set text(font: \"Source Sans Pro\", lang: \"en\")\n set heading(numbering: \"1.1\")\n //set figure(numbering: \"1.1\")\n //show figure.where(kind: table): it => {\n // counter(figure.where(kind: table)).step(level: 1)\n // it\n //}\n\n show heading: heading_style\n\n // Table of content and lists style\n show outline: it => {\n show heading: set text(fill: rgb(\"#000\"))\n set text(fill: rgb(\"#666666\"), weight: 500)\n it\n }\n\n // Set a heading style for bibliography\n show bibliography: it => {\n show heading: it_heading => {\n pagebreak()\n pad(\n bottom: 50pt,\n text(30pt, it_heading.body)\n )\n }\n it\n }\n\n // Cover page\n \n // Title page.\n // The page can contain a logo if you pass one with `logo: \"logo.png\"`.\n if school_logo == none {\n school_logo = \"images/ist-logo.png\"\n }\n \n image(school_logo, height: 20mm, width: auto)\n v(8mm)\n\n // Image\n if cover_image != none and cover_image.trim().len() > 0 {\n pad(bottom: 10mm,\n image(cover_image)\n )\n } else {\n v(58mm)\n }\n \n align(center, {\n block(\n width: 80%,\n {\n // Title\n text(16pt, weight: \"bold\", [This is the Title of the Thesis and it is a very Big Title covering More than One Line])\n \n // Subtitle\n if subtitle.trim().len() > 0 {\n pad(\n top: 0.8em,\n text(14pt, subtitle)\n )\n }\n \n // Author information.\n pad(\n top: 3.2em,\n text(16pt, weight: \"bold\", author)\n )\n \n // Thesis information.\n pad(\n top: 3.2em, {\n text(12pt, [Thesis to obtain the Master of Science Degree in])\n linebreak()\n v(1.8em)\n text(16pt, weight: \"bold\", degree)\n })\n \n // Supervisor information\n if supervisors.len() > 0 {\n pad(\n top: 1.8em,\n text(12pt, {\n if supervisors.len() > 1 {\n [Supervisors: ]\n } else {\n [Supervisor: ]\n }\n supervisors.join([ \\ ])\n })\n )\n }\n \n // Committee information.\n if committee.len() > 0 {\n pad(top: 1.2em, text(14pt, weight: \"bold\", [Examination Committee]))\n pad(\n top: 1.2em,\n grid(\n rows: (auto,) * calc.min(3, committee.len()),\n gutter: 0.5em,\n ..committee.map(member => text(12pt, member.role + [: ] + member.name)),\n ),\n )\n }\n \n \n })\n })\n // Date\n align(center + bottom,\n pad(\n top: 4em,\n text(14pt, weight: \"bold\", date)\n )\n )\n pagebreak()\n // End of cover page\n\n counter(page).update(0)\n set page(\n margin: (left: 25mm, right: 25mm, top: 30mm, bottom: 30mm),\n footer: [\n #set align(center)\n #set text(12pt, weight: \"bold\")\n #counter(page).display(\n \"i\",\n )\n ],\n number-align: center,\n )\n\n // Custom sections (Ackowledgments, Declarations, etc.)\n \n\n // Abstract page.\n v(1fr)\n heading(outlined: false, numbering: none, text(0.85em)[Abstract])\n align(left)[\n #set par(justify: true)\n #abstract\n ]\n v(1.618fr)\n pagebreak()\n\n if abstract_pt != none {\n v(1fr)\n heading(outlined: false, numbering: none, text(0.85em)[Resumo])\n align(left)[\n #set par(justify: true)\n #abstract_pt\n ]\n v(1.618fr)\n pagebreak()\n }\n\n // Table of contents.\n outline(depth: 4, indent: true)\n pagebreak()\n\n // Figure listing\n outline(\n title: [List of Figures],\n target: figure.where(kind: image),\n )\n\n pagebreak()\n // Table listing\n outline(\n title: [List of Tables],\n target: figure.where(kind: table),\n )\n\n // Reset page counter and make a empty page with no number\n set page(\n footer: []\n )\n pagebreak()\n counter(page).update(0)\n\n // Main content\n set page(\n margin: (left: 25mm, right: 25mm, top: 30mm, bottom: 30mm),\n footer: [\n #set align(center)\n #set text(12pt, weight: \"bold\")\n #counter(page).display(\n \"1\",\n )\n ],\n number-align: center,\n )\n \n // Main body.\n set par(justify: true)\n\n body\n}\n\n#let appendices(body) = {\n counter(heading).update(0)\n counter(\"appendices\").update(1)\n \n set heading(\n numbering: (..nums) => {\n let vals = nums.pos()\n let value = \"ABCDEFGHIJ\".at(vals.at(0) - 1)\n if vals.len() == 1 {\n return value \n }\n else {\n return value + \".\" + nums.pos().slice(1).map(str).join(\".\")\n }\n }\n );\n [#pagebreak() #body]\n}\n\n\n\n" }, { "repo": "https://github.com/lucannez64/Notes", "file": "https://raw.githubusercontent.com/lucannez64/Notes/master/Maths_Sup.typ", "language": "typst", "license": "", "content": "#import \"template.typ\": *\n\n// Take a look at the file `template.typ` in the file panel\n// to customize this template and discover how it works.\n#show: project.with(\n title: \"Maths Sup\",\n authors: (\n \"\",\n ),\n date: \"30 Octobre, 2023\",\n)\n\n#set heading(numbering: \"1.1.\")\n\n== Ressources\n\n- #link(\"Maths_Sup_Course.pdf\")[MathsSup]\n- #link(\"coursMP2I-analyse.pdf\")[Cours MPSI/MP2I Analyse]\n- #link(\"http://alain.troesch.free.fr/\")[Cours de math\u00e9matique MPSI]\n- #link(\"http://christophebertault.fr/cours-et-exercices/\")[Christophe Bertault]\n- #link(\"https://groupe-reussite.fr/ressources/cours-en-ligne-maths-sup-maths/\")[Groupe R\u00e9ussite]\n #link(\"Maths.pdf\")[Maths]\n" }, { "repo": "https://github.com/arthurcadore/eng-telecom-workbook", "file": "https://raw.githubusercontent.com/arthurcadore/eng-telecom-workbook/main/semester-7/COM_1/homework4/homework.typ", "language": "typst", "license": "MIT License", "content": "#import \"@preview/klaro-ifsc-sj:0.1.0\": report\n#import \"@preview/codelst:2.0.1\": sourcecode\n#show heading: set block(below: 1.5em)\n#show par: set block(spacing: 1.5em)\n#set text(font: \"Arial\", size: 12pt)\n\n#show: doc => report(\n title: \"Modula\u00e7\u00e3o e Demodula\u00e7\u00e3o em Frequ\u00eancia (FM)\",\n subtitle: \"Sistemas de Comunica\u00e7\u00e3o I\",\n authors: (\"\",),\n date: \"09 de Abril de 2024\",\n doc,\n)\n\n= Introdu\u00e7\u00e3o\n\nO objetivo deste relat\u00f3rio \u00e9 apresentar o desenvolvimento de um sistema de modula\u00e7\u00e3o e demodula\u00e7\u00e3o em frequ\u00eancia (FM) para sinais de \u00e1udio. O sistema foi desenvolvido atrav\u00e9s de linguagem MATLAB (Octa ve), e tem como objetivo principal a compreens\u00e3o do processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o em frequ\u00eancia, bem como a an\u00e1lise dos sinais modulados e demodulados.\n\\\n\nNeste relat\u00f3rio ser\u00e1 apresentado a fundamenta\u00e7\u00e3o te\u00f3rica do processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o em frequ\u00eancia, bem como a an\u00e1lise dos sinais modulados e demodulados, os scripts MATLAB utilizados e os resultados obtidos.\n\\\n\nDesta forma, poderemos compreender o processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o FM, bem como a an\u00e1lise dos sinais modulados e demodulados, e a import\u00e2ncia deste processo para a transmiss\u00e3o de sinais de \u00e1udio em sistemas de comunica\u00e7\u00e3o.\n\n= Fundamenta\u00e7\u00e3o te\u00f3rica\n\n== Principais Conceitos\n\nOs principais conceitos te\u00f3ricos abordados neste relat\u00f3rio s\u00e3o: \n\n- Modula\u00e7\u00e3o FM: A modula\u00e7\u00e3o em frequ\u00eancia (FM) \u00e9 um processo de modula\u00e7\u00e3o em que a frequ\u00eancia da portadora \u00e9 variada de acordo com a amplitude do sinal modulante. A varia\u00e7\u00e3o da frequ\u00eancia da portadora \u00e9 proporcional \u00e0 amplitude do sinal modulante, resultando em um sinal modulado em frequ\u00eancia. A modula\u00e7\u00e3o em frequ\u00eancia \u00e9 amplamente utilizada em sistemas de comunica\u00e7\u00e3o para transmiss\u00e3o de sinais de \u00e1udio, devido \u00e0 sua alta qualidade de \u00e1udio e baixa interfer\u00eancia.\n\n- Demodula\u00e7\u00e3o FM: A demodula\u00e7\u00e3o em frequ\u00eancia \u00e9 o processo de recuperar o sinal modulante original a partir do sinal modulado em frequ\u00eancia. A demodula\u00e7\u00e3o FM \u00e9 realizada atrav\u00e9s da diferencia\u00e7\u00e3o do sinal modulado, que resulta em um sinal que cont\u00e9m a informa\u00e7\u00e3o de frequ\u00eancia do sinal modulante original. O sinal demodulado \u00e9 ent\u00e3o filtrado para remover as frequ\u00eancias indesejadas e obter o sinal de \u00e1udio original.\n\n- Sinal Portador: O sinal portador \u00e9 um sinal (tipicamente de alta frequ\u00eancia) que \u00e9 modulado pela informa\u00e7\u00e3o do sinal modulante. O sinal portador \u00e9 a base para a transmiss\u00e3o do sinal modulado em frequ\u00eancia e \u00e9 recuperado na demodula\u00e7\u00e3o para obter o sinal de \u00e1udio original.\n\n- Sinal Modulante: O sinal modulante \u00e9 o sinal de \u00e1udio que \u00e9 modulado em frequ\u00eancia para transmiss\u00e3o em sistemas de comunica\u00e7\u00e3o. O sinal modulante \u00e9 a informa\u00e7\u00e3o que \u00e9 transmitida atrav\u00e9s da varia\u00e7\u00e3o da frequ\u00eancia da portadora.\n\n== Resumo dos Itens abordados (Material de Refer\u00eancia)\n\nAl\u00e9m dos conceitos base apresentados acima, o material de refer\u00eancia tamb\u00e9m aborda os seguintes t\u00f3picos, que s\u00e3o importantes para o entendimento do processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o em frequ\u00eancia (itens 9.1, 9.2, 9.3 e 9.4). \n\n=== The history of the FM Standard \n\nObjetivo: Apresentar a modula\u00e7\u00e3o em frequ\u00eancia (FM) e sua import\u00e2ncia para a transmiss\u00e3o de sinais de \u00e1udio em sistemas de comunica\u00e7\u00e3o.\n\\\n\nNesta sess\u00e3o do livro, o autor apresenta a hist\u00f3ria da modula\u00e7\u00e3o em frequ\u00eancia (FM) e sua import\u00e2ncia para a transmiss\u00e3o de sinais de \u00e1udio em sistemas de comunica\u00e7\u00e3o. O nacimento da modula\u00e7\u00e3o em frequ\u00eancia ocorreu em 1933 com o americano , que desenvolveu e demonstrou a r\u00e1dio FM como uma solu\u00e7\u00e3o para o \"problema do ru\u00eddo est\u00e1tico\". \n\\\n\nEm 1912, descobriu que, se as ondas eletromagn\u00e9ticas emitidas pelos receptores de r\u00e1dio (de v\u00e1lvula de vidro) fossem alimentadas de volta atrav\u00e9s do hardware (circuito de RF), a intensidade do sinal aumentava, e assim, ondas de r\u00e1dio eram geradas.\n\\\n\nDe acordo com o livro, ele chamou esse processo de feedback positivo de regenera\u00e7\u00e3o, e \u00e9 considerado uma das descobertas mais importantes na hist\u00f3ria do r\u00e1dio, pois significava que receptores de r\u00e1dio tamb\u00e9m poderiam ser usados como transmissores.\n\n=== The mathematics of FM & the Modulation Index \n\nObjetivo: Apresentar a matem\u00e1tica da modula\u00e7\u00e3o em frequ\u00eancia (FM) e o \u00edndices de modula\u00e7\u00e3o FM.\n\nNesta sess\u00e3o, o autor explica sobre a constru\u00e7\u00e3o de um modulador FM anal\u00f3gico atrav\u00e9s de um VCO (Voltage Controller Oscillator). O VCO gera um sinal senoidal cuja fase (e, portanto, efetivamente a frequ\u00eancia) muda em resposta a varia\u00e7\u00f5es de amplitude de um sinal de controle de entrada. \n\\\n\nQuando o sinal modulante \u00e9 inserido no VCO, ele \u00e9 multiplicado por uma constante (k_f) que representa a rela\u00e7\u00e3o de varia\u00e7\u00e3o de tens\u00e3o proporcional a varia\u00e7\u00e3o de frequ\u00eancia. \n\\ \nAssim, conforme o sinal modulante varia (supondo uma senoide por exemplo), o sinal modulado tem sua frequ\u00eancia variada na mesma propor\u00e7\u00e3o que a varia\u00e7\u00e3o de tens\u00e3o ao longo do tempo. \n\\\nA fase do senoide \u00e9 determinada pelo valor instant\u00e2neo de tens\u00e3o do sinal modulante, e a frequ\u00eancia do sinal modulado \u00e9 determinada pela taxa de varia\u00e7\u00e3o da fase do sinal modulante.\n\n=== FM Signal Bandwidth\n\nObjetivo: Apresentar a largura de banda do sinal FM e as diferen\u00e7as entre NFM (Narrowband FM) e WFM (Wideband FM).\n\nNesta sess\u00e3o, o autor apresenta a largura de banda do sinal FM e as diferen\u00e7as entre NFM (Narrowband FM) e WFM (Wideband FM). A largura de banda do sinal FM \u00e9 determinada pela taxa de varia\u00e7\u00e3o da frequ\u00eancia do sinal modulante. \n\\\n\nA modula\u00e7\u00e3o em frequ\u00eancia \u00e9 considerada um processo de Banda Estreita ou Banda Larga, e o valor do \u00edndice de modula\u00e7\u00e3o determina isso. Se o \u00edndice de modula\u00e7\u00e3o de um sinal FM for << 1, \u00e9 considerado FM de Banda Estreita (NFM), enquanto se for >> 1, \u00e9 FM de Banda Larga (WFM).\n\n==== NFM (Narrowband FM): \n\nA modula\u00e7\u00e3o em frequ\u00eancia de banda estreita (NFM) \u00e9 caracterizada por um \u00edndice de modula\u00e7\u00e3o << 1, resultando em um desvio de frequ\u00eancia m\u00e1ximo limitado, geralmente em torno de 5kHz. Neste cen\u00e1rio, as aproxima\u00e7\u00f5es podem ser feitas para simplificar os c\u00e1lculos, j\u00e1 que a contribui\u00e7\u00e3o da frequ\u00eancia instant\u00e2nea \u00e9 negligenci\u00e1vel. A equa\u00e7\u00e3o de modula\u00e7\u00e3o FM pode ser expandida usando identidades trigonom\u00e9tricas apropriadas. A NFM \u00e9 comumente usada em aplica\u00e7\u00f5es como comunica\u00e7\u00f5es de r\u00e1dio bidirecionais e sistemas de r\u00e1dio de curto alcance, onde a largura de banda \u00e9 limitada e a fidelidade do sinal \u00e9 essencial.\n\n==== WFM (Wideband FM):\n\nA modula\u00e7\u00e3o em frequ\u00eancia de banda larga (WFM) \u00e9 o padr\u00e3o usado por esta\u00e7\u00f5es de r\u00e1dio comerciais, caracterizado por um \u00edndice de modula\u00e7\u00e3o >> 1. Neste caso, o desvio de frequ\u00eancia m\u00e1ximo permitido \u00e9 maior, frequentemente em torno de 75kHz. A WFM oferece uma qualidade de \u00e1udio superior \u00e0 NFM, mas requer uma largura de banda maior. Durante o processo de modula\u00e7\u00e3o, s\u00e3o criadas um n\u00famero infinito de bandas laterais ao redor da frequ\u00eancia da portadora, o que exige uma limita\u00e7\u00e3o da largura de banda para evitar interfer\u00eancias entre canais. As esta\u00e7\u00f5es de r\u00e1dio FM geralmente s\u00e3o separadas por 0,2MHz nos receptores anal\u00f3gicos devido a essa limita\u00e7\u00e3o de largura de banda.\n\n=== FM Demodulation Using Differentiation \n\nObjetivo: Apresentar a demodula\u00e7\u00e3o em frequ\u00eancia utilizando a diferencia\u00e7\u00e3o do sinal modulado.\n\\\n\nNesta se\u00e7\u00e3o, o autor descreve o processo de demodula\u00e7\u00e3o do sinal FM modulado atrav\u00e9s de diferencia\u00e7\u00e3o do sinal recebido. Para o sinal transmitido (e recebido perfeitamente), um novo sinal diferenciado denotado como (onde o tra\u00e7o denota a derivada) \u00e9 gerado pelo receptor. \n\\\n\nNeste m\u00e9todo, o sinal ter\u00e1 a apar\u00eancia de um sinal AM-DSB-TC no dom\u00ednio do tempo, pois possui uma envolt\u00f3ria de informa\u00e7\u00e3o (embora, ao contr\u00e1rio de uma envolt\u00f3ria AM padr\u00e3o, a frequ\u00eancia do componente da portadora ainda muda). De acordo com o autor, as flutua\u00e7\u00f5es nesta envolt\u00f3ria s\u00e3o diretamente proporcionais \u00e0 frequ\u00eancia instant\u00e2nea do sinal modulado, que deve ser diretamente proporcional \u00e0 amplitude do sinal de informa\u00e7\u00e3o original.\n\\\n\nSe considerarmos que o termo senoidal de alta frequ\u00eancia pode ser removido por um detector de envolt\u00f3ria (utilizado nos scripts matlab descritos neste documento, veja o c\u00f3digo abaixo), fica claro que a amplitude da envolt\u00f3ria \u00e9 diretamente proporcional \u00e0 amplitude do sinal de informa\u00e7\u00e3o. Embora tenha um deslocamento DC (e ganho de resultante da constante de modula\u00e7\u00e3o FM), o sinal de \u00e1udio original pode ser recuperado com precis\u00e3o.s\n\n#sourcecode[```matlab\n% Calculating the FM demodulation for the modulated signal\ndemodulated_signal = diff(modulated_signal) * fs / k0;\ndemodulated_signal = [demodulated_signal, 0]; % Sinal demodulado\n\n% calculating the FFT of the random signal;\ndemodulated_f = fft(demodulated_signal)/length(demodulated_signal);\ndemodulated_f = fftshift(demodulated_f);\n\n% Calculating the signal wrap. \ndemodulated_wrap = abs(hilbert(demodulated_signal));\n```]\n\n\n= An\u00e1lise dos resultados\n\n== Sinal de \u00e1udio Aleat\u00f3rio: \n\nInicialmente, foi feita a importa\u00e7\u00e3o de um sinal de \u00e1udio para ser utilizado como modulante da portadora em frequ\u00eancia, para transmiss\u00e3o em FM. \n\nA figura abaixo mostra o plot do sinal no dom\u00ednio do tempo, bem como seu respectivo plot do sinal no dom\u00ednio da frequ\u00eancia.\n\n#figure(\n figure(\n image(\"./pictures/timeDomain.png\"),\n numbering: none,\n caption: [Sinal de entrada no dom\u00ednio do tempo]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nUma vez com o sinal de entrada definido, a modula\u00e7\u00e3o em frequ\u00eancia foi realizada atrav\u00e9s da integra\u00e7\u00e3o do argumento de fase da portadora a partir do sinal da modulante, conforme o script abaixo: \n\n#sourcecode[```matlab\n% Creating the FM modulated signal: \nphase_argument = 2*pi*k_f*cumsum(modulating_signal)*(Ts);\nmodulated_signal = A_carrier * cos(2*pi*f_carrier*t + phase_argument);\n```]\n\nOnde na figura acima os par\u00e2metros s\u00e3o: \n\n- `modulating_signal` \u00e9 o sinal de \u00e1udio importado. \n- `k_f` \u00e9 a sensibilidade do modulador para varia\u00e7\u00e3o de frequ\u00eancia. \n- `Ts` \u00e9 o per\u00edodo de amostragem do sinal.\n- `A_carrier` \u00e9 a amplitude da portadora\n- `f_carrier` \u00e9 a frequ\u00eancia da portadora. \n- `t` \u00e9 o vetor de tempo do sinal modulado (utilizado para realizar a modula\u00e7\u00e3o em FM).\n- `phase_argument` \u00e9 o argumento de fase da portadora do sinal, gerado a partir da integra\u00e7\u00e3o do sinal modulante.\n- `modulated_signal` \u00e9 o sinal modulado em FM.\n\nUma vez com o sinal modulado em FM, podemos compreender o formato do sinal modulado no dom\u00ednio do tempo e da frequ\u00eancia, conforme a figura abaixo:\n\n#figure(\n figure(\n image(\"./pictures/FrequencyDomain.png\"),\n numbering: none,\n caption: [Sinal modulado em FM no dom\u00ednio do tempo e da frequ\u00eancia]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nUma vez com o sinal modulado, e multiplexado, podemos transmiti-lo pelo meio f\u00edsico sem que haja interfer\u00eancia entre cada portadora (idealmente). O sinal no meio f\u00edsico \u00e9 ilustrado abaixo em azul. \n\\\n\n#figure(\n figure(\n image(\"./pictures/Modulated.png\"),\n numbering: none,\n caption: [Sinal modulado e \"transmitido\" no meio f\u00edsico]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nNa recep\u00e7\u00e3o do sinal, precisamos realizar sua demodula\u00e7\u00e3o para ter novamente o sinal de \u00e1udio original. Para isso, utilizamos um demodulador FM, que \u00e9 basicamente um circuito que realiza a deriva\u00e7\u00e3o do sinal modulado, conforme o script abaixo:\n\n#sourcecode[```matlab\n% Calculating the FM demodulation for the modulated signal\ndemodulated_signal = diff(modulated_signal) * fs / k0;\ndemodulated_signal = [demodulated_signal, 0]; % Sinal demodulado\n\n% calculating the FFT of the random signal;\ndemodulated_f = fft(demodulated_signal)/length(demodulated_signal);\ndemodulated_f = fftshift(demodulated_f);\n\n% Calculating the signal wrap. \ndemodulated_wrap = abs(hilbert(demodulated_signal));\n```]\n\nCom o sinal demodulado, utilizamos um filtro passa-baixas para eliminar as frequ\u00eancias indesejadas, e obter o sinal de \u00e1udio original.\n\nPara isso, foi utilizado um filtro FIR de ordem relativamente alta (neste caso 100), com frequ\u00eancia de corte de 20kHz. A frequ\u00eancia neste script foi fixada em 20kHz, pois trata-se de um sinal de \u00e1udio, e portanto, n\u00e3o h\u00e1 informa\u00e7\u00e3o relevante acima desta frequ\u00eancia para ser capturada. \n\nPara verificar se de fato o filtro est\u00e1 atuando corretamente, abaixo est\u00e1 um plot da resposta em frequ\u00eancia do filtro FIR:\n\n#figure(\n figure(\n image(\"./pictures/filter.png\"),\n numbering: none,\n caption: [Resposta em frequ\u00eancia do filtro FIR]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nCom o sinal demodulado e filtrado, podemos realizar seu plot no dominio do tempo e tamb\u00e9m realizar a FFT do sinal para observar as componentes de frequ\u00eancia do sinal demodulado.\n\n#figure(\n figure(\n image(\"./pictures/Demodulated.png\"),\n numbering: none,\n caption: [Sinal demodulado no dom\u00ednio do tempo]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nComo podemos observar, o sinal demodulado \u00e9 muito semelhante ao sinal de \u00e1udio original, com pequenas distor\u00e7\u00f5es devido ao processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o em frequ\u00eancia.\n\nO sinal tamb\u00e9m foi plotado no dominio do tempo e da frequ\u00eancia, para verificar se o sinal demodulado est\u00e1 correto.\n\n#figure(\n figure(\n image(\"./pictures/DemodulatedF.png\"),\n numbering: none,\n caption: [Sinal demodulado no dom\u00ednio da frequ\u00eancia]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\n== Sinal Senoidal Modulante\n\nDevido as varia\u00e7\u00f5es no processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o apresentadas anteriormente, foi feita a an\u00e1lise de um sinal puramente senoidal como modulante em FM, para verificar se o processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o em frequ\u00eancia est\u00e1 correto. \n\nInicialmente, foi feita a defini\u00e7\u00e3o dos par\u00e2metros do sinal modulante e em seguida o plot do mesmo no dominio do tempo e tamb\u00e9m da frequ\u00eancia: \n\n#figure(\n figure(\n image(\"./pictures/timeDomain-Sin.png\"),\n numbering: none,\n caption: [Sinal senoidal modulante no dom\u00ednio do tempo e da frequ\u00eancia]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nEm seguida, com o sinal modulante definido, foi feita a modula\u00e7\u00e3o em frequ\u00eancia do sinal senoidal, note que para esse processo de modula\u00e7\u00e3o, o sinal modulante \u00e9 uma senoide pura, e portanto, o sinal modulado em FM possui uma varia\u00e7\u00e3o suave e peri\u00f3dica de frequ\u00eancia ao longo do tempo. \n\\\n\nSendo assim possivel analisar o sinal modulado no dominio do tempo e da frequ\u00eancia, conforme a figura abaixo:\n\n#figure(\n figure(\n image(\"./pictures/FrequencyDomain-Sin.png\"),\n numbering: none,\n caption: [Sinal modulado em FM no dom\u00ednio do tempo e da frequ\u00eancia]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nCom o sinal modulado em FM definido, podemos transmiti-lo pelo meio f\u00edsico, e realizar a demodula\u00e7\u00e3o do sinal para obter o sinal senoidal original.\n\nNa recep\u00e7\u00e3o, foi feita a demodula\u00e7\u00e3o do sinal modulado, e em seguida a filtragem do sinal demodulado para obter o sinal senoidal original, a figura abaixo mostra o sinal demodulado no dominio do tempo:\n\n#figure(\n figure(\n image(\"./pictures/Demodulated-Sin.png\"),\n numbering: none,\n caption: [Sinal demodulado no dom\u00ednio do tempo]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\nNovamente, para verificar se o sinal demodulado est\u00e1 correto, foi feita a an\u00e1lise do sinal demodulado no dominio da frequ\u00eancia, conforme a figura abaixo:\n\n#figure(\n figure(\n image(\"./pictures/DemodulatedF-Sin.png\"),\n numbering: none,\n caption: [Sinal demodulado no dom\u00ednio da frequ\u00eancia]\n ),\n caption: figure.caption([Elaborada pelo Autor], position: top)\n)\n\n= Scripts e C\u00f3digos Utilizados:\n\n== Defini\u00e7\u00f5es Iniciais\n\nO script abaixo define as vari\u00e1veis iniciais do sistema, como a amplitude dos sinais, a frequ\u00eancia do sinal modulante, a frequ\u00eancia da portadora, a sensibilidade do modulador para varia\u00e7\u00e3o de frequ\u00eancia, e o per\u00edodo de amostragem do sinal.\n\n#sourcecode[```matlab\nclose all; clear all; clc;\npkg load signal;\n\n% Altera o tamanho da fonte nos plots para 15\nset(0, 'DefaultAxesFontSize', 20);\n\n% Defining the signals amplitude.\nA_modulating = 1;\nA_carrier = 1;\n\n% Defining the signals frequency\nf_modulating_max = 20000;\nf_carrier = 80000;\n\n% modulator sensibility for frequency variation (Hz/volts)\nk_f = 2000000;\nk0 = 2*pi*k_f;\n\n% Delta variable, correponding to max frequency variation.\nd_f = k_f*A_modulating;\n\n% Beta variable, correspondig to percentage of frequency variation about the frequency of the modulating.\nb = d_f/f_modulating_max;\n\n% Defining the period and frequency of sampling:\nfs = 50*f_carrier;\nTs = 1/fs;\nT = 1/f_modulating_max;\n\n% Defining the sinal period.\nt_inicial = 0;\nt_final = 2;\n\n% \"t\" vector, correspondig to the time period of analysis, on time domain.\nt = [t_inicial:Ts:t_final];\n```]\n\n== Sinal modulante e Modulado FM\n\nO script abaixo importa um sinal de \u00e1udio para ser utilizado como modulante da portadora em frequ\u00eancia, e em seguida realiza a modula\u00e7\u00e3o em frequ\u00eancia do sinal modulante.\n\n#sourcecode[```matlab\t\n\n% Import the audioSignal to use as modulating FM signal: \n[modulating_signal, Hs] = audioread('randomSignal.wav');\nmodulating_signal = transpose(modulating_signal);\n\n% Calculate the number of zeros to be added\nnum_zeros = length(t) - length(modulating_signal);\n\n% Add the zeros to the end of the modulating_signal vector\nmodulating_signal = [modulating_signal, zeros(1, num_zeros)];\n\n% Transpose the modulated signal if necessary\nmodulated_signal = transpose(modulating_signal);\n\n% Creating the FM modulated signal:\nphase_argument = 2*pi*k_f*cumsum(modulating_signal)*(Ts);\nmodulated_signal = A_carrier * cos(2*pi*f_carrier*t + phase_argument);\n\n% Plot signals on time domain:\nfigure(1)\nsubplot(311)\nplot(t, (modulating_signal),'b', 'LineWidth', 2)\nxlim([0.00054 0.00067])\nxlabel('Time (s)')\nylabel('Amplitude')\ntitle('Random Sound Signal (Time Domain)')\n\nsubplot(312)\nplot(t, abs(modulating_signal),'r', 'LineWidth', 2)\nxlim([0.00054 0.00067])\nxlabel('Time (s)')\nylabel('Amplitude')\ntitle('Random Sound Signal - Absolute (Time Domain)')\n\nsubplot(313)\nplot(t, modulated_signal,'k', 'LineWidth', 2)\nxlim([0.00054 0.00067])\nxlabel('Time (s)')\nylabel('Amplitude')\ntitle('Modulated FM Signal (Time Domain)')\n```]\n\n== FFT dos sinais modulantes\n\nO script abaixo calcula a FFT dos sinais modulantes e modulados, e em seguida realiza o plot dos sinais no dom\u00ednio da frequ\u00eancia.\n\n#sourcecode[```matlab\n% calculating the step of the frequency vector \"f\" (frequency domain);\nf_step = 1/t_final;\n\n% creating the frequency vector \"f\" (frequency domain);\nf = [-fs/2:f_step:fs/2];\n\n% calculating the FFT of the random signal;\nmodulating_f = fft(modulating_signal)/length(modulating_signal);\nmodulating_f = fftshift(modulating_f);\n\n% calculating the FFT of the modulated signal;\nmodulated_f = fft(modulated_signal)/length(modulated_signal);\nmodulated_f = fftshift(modulated_f);\n\n% Plotting the modulated signal on frequency domain;\nfigure(2)\nsubplot(211)\nplot(f, abs(modulating_f), 'k', 'LineWidth', 2)\nxlabel('Frequency (Hz)')\nylabel('Amplitude')\ntitle('Modulating Signal (Frequency Domain)')\nxlim([-f_carrier*1.2 f_carrier*1.2])\nylim([0 A_carrier/1000])\n\nsubplot(212)\nplot(f, abs(modulated_f), 'k', 'LineWidth', 2)\nxlabel('Frequency (Hz)')\nylabel('Amplitude')\ntitle('Modulated Signal (Frequency Domain)')\nxlim([-f_carrier*1.2 f_carrier*1.2])\nylim([0 A_carrier/1000])\n```]\n\n== Demodula\u00e7\u00e3o do sinal e Filtro\n\nO script abaixo realiza a demodula\u00e7\u00e3o do sinal modulado, e em seguida realiza a filtragem do sinal demodulado para obter o sinal de \u00e1udio original.\n\n#sourcecode[```matlab\n% Calculating the FM demodulation for the modulated signal\ndemodulated_signal = diff(modulated_signal) * fs / k0;\ndemodulated_signal = [demodulated_signal, 0]; % Sinal demodulado\n\n% Ordem do filtro FIR\nfiltro_ordem = 100;\n\n% Frequ\u00eancia de corte do filtro FIR \n% Como trata-se de um sinal de \u00e1udio, a frequ\u00eancia de corte pode ser fixada em 20kHz\nfrequencia_corte = 20000;\n\n% Coeficientes do filtro FIR para cada sinal demodulado\ncoeficientes_filtro = fir1(filtro_ordem, frequencia_corte/(fs/2));\n\n% Resposta em frequ\u00eancia do filtro FIR para cada sinal demodulado\n[H_fir, f_fir] = freqz(coeficientes_filtro, 1, length(t), fs);\n \n% Plot da resposta em frequ\u00eancia do filtro:\nfigure(6)\nplot(f_fir, abs(H_fir), 'r', 'LineWidth', 3)\nxlim([0 frequencia_corte*1.1])\ntitle('Resposta em Frequ\u00eancia do Filtro FIR')\nxlabel('Frequ\u00eancia (Hz)')\nylabel('Magnitude')\n```]\n\n== Filtragem e plotagem dos sinais resultantes\n\nO script abaixo realiza a filtragem do sinal demodulado, e em seguida realiza o plot dos sinais modulados e demodulados no dom\u00ednio do tempo e da frequ\u00eancia.\n\n#sourcecode[```matlab\n% Filtragem dos sinais demodulados\ndemodulated_filtered = filter(coeficientes_filtro, 1, demodulated_signal);\n\n% calculating the FFT of the random signal;\ndemodulated_filtered_f = fft(demodulated_filtered)/length(demodulated_filtered);\ndemodulated_filtered_f = fftshift(demodulated_filtered_f);\n\n% Calculating the signal wrap. \ndemodulated_wrap = abs(hilbert(demodulated_filtered));\n\n% Plotting the modulated and demodulated signals on time domain:\nfigure(3)\nsubplot(311)\nplot(t, modulated_signal, 'k', 'LineWidth', 2)\nxlim([0.00054 0.00067])\nxlabel('Tempo (s)')\nylabel('Amplitude')\ntitle('Sinal Modulado FM (Dom\u00ednio do Tempo)')\n\nsubplot(312)\nplot(t, demodulated_signal, 'b', 'LineWidth', 2)\nxlim([0.00054 0.00067])\nxlabel('Tempo (s)')\nylabel('Amplitude')\ntitle('Sinal Demodulado FM (Dom\u00ednio do Tempo)')\n\nsubplot(313)\nplot(t, demodulated_filtered, 'r--', 'LineWidth', 2)\nxlim([0.00054 0.00067])\nxlabel('Tempo (s)')\nylabel('Amplitude')\ntitle('Sinal Demodulado FM Filtrado (Dom\u00ednio do Tempo)')\n\nfigure(4)\nsubplot(211)\nplot(f, demodulated_filtered_f, 'k', 'LineWidth', 2)\nxlabel('Frequency (Hz)')\nylabel('Amplitude')\ntitle('Demodulated Signal (Frequency Domain)')\nxlim([-f_carrier*1.2 f_carrier*1.2])\nylim([0 A_carrier/1000])\n\nsubplot(212)\nplot(f, abs(demodulated_filtered_f), 'k', 'LineWidth', 2)\nxlabel('Frequency (Hz)')\nylabel('Amplitude')\ntitle('Absolute Demodulated Signal (Frequency Domain)')\nxlim([-f_carrier*1.2 f_carrier*1.2])\nylim([0 A_carrier/1000])\n\n```]\n\n\n= Conclus\u00e3o\n\n\nA partir dos conceitos vistos e dos resultados obtidos, podemos concluir que o processo de modula\u00e7\u00e3o e demodula\u00e7\u00e3o em frequ\u00eancia \u00e9 uma tecnica eficiente para a transmiss\u00e3o de sinais de \u00e1udio em sistemas de comunica\u00e7\u00e3o, pois permite a transmiss\u00e3o de sinais de \u00e1udio com qualidade e fidelidade com baixa inter\u00eancia devido a informa\u00e7\u00e3o estar sendo carregada na varia\u00e7\u00e3o de frequ\u00eancia e n\u00e3o na amplitude do sinal. \n\nDesta forma, podemos compreender seu uso em sistemas de telecomunica\u00e7\u00e3o utilizado atualmente pelas r\u00e1dios anal\u00f3gicas regionais para transmiss\u00e3o de sinais de \u00e1udio em broadcast para toda a regi\u00e3o, visto que esse tipo de transmiss\u00e3o possui um baixo \u00edndice de ru\u00eddo e distor\u00e7\u00e3o. \n\n= Refer\u00eancias\n\nPara o desenvolvimento deste relat\u00f3rio, foi utilizado o seguinte material de refer\u00eancia:\n\n- #link(\"https://www.researchgate.net/publication/287760034_Software_Defined_Radio_using_MATLAB_Simulink_and_the_RTL-SDR\")[Software Defined Radio Using MATLAB & Simulink and the RTL-SDR, de ]" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/vonsim/0.1.0/README.md", "language": "markdown", "license": "Apache License 2.0", "content": "This package adds the ability to syntax highlighting VonSim source code in Typst.\n\n## How to use\n\nTo add global support for VonSim, just add these lines and use a raw block with `vonsim` as its language.\n\n````typst\n#import \"@preview/vonsim:0.1.0\": init-vonsim\n\n// Adds global support for VonSim\n#show: init-vonsim\n\n// Highlight VonSim code\n```vonsim\n; Welcome to VonSim!\n; This is an example program that calculates the first\n; n numbers of the Fibonacci sequence, and stores them\n; starting at memory position 1000h.\n\n n equ 10 ; Calculate the first 10 numbers\n\n org 1000h\nstart db 1\n\n org 2000h\n mov bx, offset start + 1\n mov al, 0\n mov ah, start\n\nloop: cmp bx, offset start + n\n jns finish\n mov cl, ah\n add cl, al\n mov al, ah\n mov ah, cl\n mov [bx], cl\n inc bx\n jmp loop\nfinish: hlt\n end\n```\n````\n\nAlternatively, use `init-vonsim-full` to also use the VonSim theme.\n" }, { "repo": "https://github.com/hongjr03/shiroa-page", "file": "https://raw.githubusercontent.com/hongjr03/shiroa-page/main/DSA/chapters/6\u6811\u548c\u4e8c\u53c9\u6811.typ", "language": "typst", "license": "", "content": "\n#import \"../template.typ\": *\n#import \"@preview/pinit:0.1.4\": *\n#import \"@preview/fletcher:0.5.0\" as fletcher: diagram, node, edge\n\n#import \"/book.typ\": book-page\n\n#show: book-page.with(title: \"\u6811\u548c\u4e8c\u53c9\u6811 | DSA\")\n\n= \u6811\u548c\u4e8c\u53c9\u6811\n<\u6811\u548c\u4e8c\u53c9\u6811>\n\n== \u6811\u7684\u5b9a\u4e49\u548c\u57fa\u672c\u672f\u8bed\n<\u6811\u7684\u5b9a\u4e49\u548c\u57fa\u672c\u672f\u8bed>\n\n#definition[\n *\u6811*\uff1a\u6811\u662f $n(n >= 0)$ \u4e2a\u7ed3\u70b9\u7684\u6709\u9650\u96c6\u5408\u3002\u5f53 $n = 0$ \u65f6\uff0c\u79f0\u4e3a\u7a7a\u6811\uff1b\u5f53 $n > 0$ \u65f6\uff0c\u6811\u5177\u6709\u4ee5\u4e0b\u6027\u8d28\uff1a\n - \u6709\u4e14\u4ec5\u6709\u4e00\u4e2a\u7279\u5b9a\u7684\u79f0\u4e3a\u6839\u7684\u7ed3\u70b9\n - \u5f53 $n > 1$ \u65f6\uff0c\u5176\u4f59\u7ed3\u70b9\u53ef\u5206\u4e3a $m(m > 0)$ \u4e2a\u4e92\u4e0d\u76f8\u4ea4\u7684\u6709\u9650\u96c6\u5408 $T_1, T_2, dots, T_m$\uff0c\u5176\u4e2d\u6bcf\u4e00\u4e2a\u96c6\u5408\u672c\u8eab\u53c8\u662f\u4e00\u68f5\u6811\uff0c\u79f0\u4e3a\u6839\u7684\u5b50\u6811\u3002\n]<\u6811\u7684\u5b9a\u4e49>\n\n\u5bf9\u6bd4\u7ebf\u6027\u7ed3\u6784\u548c\u6811\u5f62\u7ed3\u6784\uff1a\n#table(\n columns: (1fr, 1fr),\n rows: 2em,\n align: center + horizon,\n table.header([*\u7ebf\u6027\u7ed3\u6784*], [*\u6811\u5f62\u7ed3\u6784*]),\n [\u7b2c\u4e00\u4e2a\u6570\u636e\u5143\u7d20\uff0c\u65e0\u524d\u9a71], [\u6839\u7ed3\u70b9\uff0c\u65e0\u524d\u9a71],\n [\u6700\u540e\u4e00\u4e2a\u6570\u636e\u5143\u7d20\uff0c\u65e0\u540e\u7ee7], [\u591a\u4e2a\u53f6\u5b50\u7ed3\u70b9\uff0c\u65e0\u540e\u7ee7],\n [\u5176\u4ed6\u6570\u636e\u5143\u7d20\uff0c\u4e00\u4e2a\u524d\u9a71\u3001\u4e00\u4e2a\u540e\u7ee7], [\u5176\u4ed6\u7ed3\u70b9\uff0c\u4e00\u4e2a\u53cc\u4eb2\u3001\u591a\u4e2a\u5b69\u5b50],\n)\n\n=== \u57fa\u672c\u672f\u8bed\n\n- *\u7ed3\u70b9*\uff1a\u6570\u636e\u5143\u7d20+\u82e5\u5e72\u6307\u5411\u5b50\u6811\u7684\u5206\u652f\n- *\u7ed3\u70b9\u7684\u5ea6*\uff1a\u7ed3\u70b9\u7684*\u5b50\u6811*\u4e2a\u6570\uff08\u8fd9\u91cc\u548c\u79bb\u6563\u6570\u5b66\u4e2d\u7684\u5ea6\u6709\u6240\u4e0d\u540c\uff09\n- *\u6811\u7684\u5ea6*\uff1a\u6811\u4e2d\u7ed3\u70b9\u7684\u6700\u5927\u5ea6\n- *\u53f6\u5b50\u7ed3\u70b9*\uff1a\u5ea6\u4e3a 0 \u7684\u7ed3\u70b9\n- *\u5206\u652f\u7ed3\u70b9*\uff1a\u5ea6\u4e0d\u4e3a 0 \u7684\u7ed3\u70b9\n- \uff08\u4ece\u6839\u7ed3\u70b9\u5230\u67d0\u4e2a\u7ed3\u70b9\u7684\uff09*\u8def\u5f84*\uff1a\u7531\u4ece\u6839\u5230\u8be5\u7ed3\u70b9\u6240\u7ecf\u5206\u652f\u548c\u7ed3\u70b9\u6784\u6210\n- *\u5c42\u6b21*\uff1a\u6839\u7ed3\u70b9\u7684\u5c42\u6b21\u4e3a 1\uff0c\u5176\u4f59\u7ed3\u70b9\u7684\u5c42\u6b21\u7b49\u4e8e\u5176\u53cc\u4eb2\u7ed3\u70b9\u7684\u5c42\u6b21\u52a0 1\n- *\u6811\u7684\u6df1\u5ea6*\uff1a\u6811\u4e2d\u7ed3\u70b9\u7684\u6700\u5927\u5c42\u6b21\n- *\u68ee\u6797*\uff1a$m(m > 0)$ \u68f5\u4e92\u4e0d\u76f8\u4ea4\u7684\u6811\u7684\u96c6\u5408 #note_block[\n \u4efb\u4f55\u975e\u7a7a\u6811\u662f\u4e00\u4e2a\u4e8c\u5143\u7ec4 $\"Tree\" = (\"root\", F)$\uff0c\u5176\u4e2d $\"root\"$ \u662f\u6811\u7684\u6839\u7ed3\u70b9\uff0c$F$ \u662f\u5b50\u6811\u68ee\u6797\u3002\n ]\n- *\u6709\u5411\u6811*\uff1a\n + \u6709\u786e\u5b9a\u7684\u6839\u7ed3\u70b9\n + \u6811\u6839\u548c\u5b50\u6811\u6839\u4e4b\u95f4\u4e3a\u6709\u5411\u5173\u7cfb\n- *\u6709\u5e8f\u6811*\uff1a\u6811\u4e2d\u7ed3\u70b9\u7684\u5404\u5b50\u6811\u770b\u6210\u662f\u6709\u5e8f\u7684\uff0c\u5373\u5b50\u6811\u4e4b\u95f4\u6709\u6b21\u5e8f\u5173\u7cfb\n- *\u65e0\u5e8f\u6811*\uff1a\u5b50\u6811\u4e4b\u95f4\u65e0\u6b21\u5e8f\u5173\u7cfb\n\n== \u4e8c\u53c9\u6811\n\n#definition[\n *\u4e8c\u53c9\u6811*\uff1a\u4e8c\u53c9\u6811\u6216\u4e3a\u7a7a\u6811\uff0c\u6216\u662f\u7531\u4e00\u4e2a\u6839\u7ed3\u70b9\u52a0\u4e0a\u4e24\u68f5\u5206\u522b\u79f0\u4e3a\u5de6\u5b50\u6811\u548c\u53f3\u5b50\u6811\u7684\u3001\u4e92\u4e0d\u4ea4\u7684\u4e8c\u53c9\u6811\u7ec4\u6210\u3002\n]\n\n#note_block[\n \u5ea6\u4e3a 2 \u7684\u6811\u4e0d\u4e00\u5b9a\u662f\u4e8c\u53c9\u6811\u3002\n]\n\n#block(breakable: false)[\n #import fletcher.shapes: house, hexagon, ellipse\n\n #let blob(pos, label, tint: white, ..args) = node(\n pos,\n align(center, label),\n width: auto,\n fill: tint.lighten(60%),\n stroke: 1pt + tint.darken(20%),\n corner-radius: 5pt,\n shape: circle,\n ..args,\n )\n\n #set figure(supplement: none)\n \u4e8c\u53c9\u6811\u7684\u4e94\u79cd\u5f62\u6001\uff1a\n #grid(\n columns: (0.8fr, 0.8fr, 1fr, 1fr, 1fr),\n\n )[\n #figure($diameter$, caption: \"\u7a7a\u6811\")\n ][\n #figure(diagram(blob((0, 0), \"N\")), caption: \"\u53ea\u542b\u6839\u7ed3\u70b9\")\n ][\n #figure(diagram(blob((0, 0), \"N\"), edge(), blob((-0.5, 0.5), \"L\")), caption: \"\u53f3\u5b50\u6811\u4e3a\u7a7a\u6811\")\n ][\n #figure(diagram(blob((0, 0), \"N\"), edge(), blob((0.5, 0.5), \"R\")), caption: \"\u5de6\u5b50\u6811\u4e3a\u7a7a\u6811\")\n ][\n #figure(\n diagram(blob((0, 0), \"N\"), edge(), blob((-0.5, 0.5), \"L\"), edge((0, 0), (0.5, 0.5)), blob((0.5, 0.5), \"R\")),\n caption: \"\u5de6\u53f3\u5b50\u6811\u5747\u4e0d\u4e3a\u7a7a\",\n )\n ]\n]\n\n=== \u4e8c\u53c9\u6811\u7684\u6027\u8d28\n\n+ \u5728\u4e8c\u53c9\u6811\u7684\u7b2c $i$ \u5c42\u4e0a\u81f3\u591a\u6709 $2^(i-1)$ \u4e2a\u7ed3\u70b9\uff08$i >= 1$\uff09\u3002\n+ \u6df1\u5ea6\u4e3a $k$ \u7684\u4e8c\u53c9\u6811\u81f3\u591a\u6709 $2^k - 1$ \u4e2a\u7ed3\u70b9\uff08$k >= 1$\uff09\u3002\n+ \u5bf9\u4efb\u4f55\u4e00\u68f5\u975e\u7a7a\u4e8c\u53c9\u6811\uff0c\u82e5\u53f6\u5b50\u7ed3\u70b9\u6570\u4e3a $n_0$\uff0c\u5ea6\u4e3a 2 \u7684\u7ed3\u70b9\u6570\u4e3a $n_2$\uff0c\u5219 $n_0 = n_2 + 1$\u3002\n+ \u5177\u6709 $n$ \u4e2a\u7ed3\u70b9\u7684\u5b8c\u5168\u4e8c\u53c9\u6811\u7684\u6df1\u5ea6\u4e3a $floor(log_2n) + 1$\u3002#definition[\n *\u6ee1\u4e8c\u53c9\u6811*\uff1a\u6bcf\u5c42\u7ed3\u70b9\u90fd\u8fbe\u5230\u6700\u5927\u503c\u7684\u4e8c\u53c9\u6811\u3002\n ] #definition[\n *\u5b8c\u5168\u4e8c\u53c9\u6811*\uff1a\u6811\u4e2d\u6240\u542b\u7684 $n$ \u4e2a\u7ed3\u70b9\u548c\u6ee1\u4e8c\u53c9\u6811\u4e2d\u7f16\u53f7\u4e3a $1$ \u81f3 $n$ \u7684\u7ed3\u70b9\u4e00\u4e00\u5bf9\u5e94\u3002\n ] #note_block[\n \u5b8c\u5168\u4e8c\u53c9\u6811\u4e0d\u4e00\u5b9a\u662f\u6ee1\u4e8c\u53c9\u6811\uff0c\u4f46\u662f\u6ee1\u4e8c\u53c9\u6811\u4e00\u5b9a\u662f\u5b8c\u5168\u4e8c\u53c9\u6811\u3002\n\n \u5224\u65ad\u4e00\u68f5\u6811\u662f\u5426\u662f\u5b8c\u5168\u4e8c\u53c9\u6811\uff1a\n - \u4ece\u6839\u7ed3\u70b9\u5f00\u59cb\uff0c\u6309\u5c42\u5e8f\u7f16\u53f7\n - \u82e5\u67d0\u4e2a\u7ed3\u70b9\u6709\u53f3\u5b69\u5b50\u800c\u65e0\u5de6\u5b69\u5b50\uff0c\u5219\u4e0d\u662f\u5b8c\u5168\u4e8c\u53c9\u6811\n - \u82e5\u67d0\u4e2a\u7ed3\u70b9\u4e0d\u662f\u5de6\u53f3\u5b69\u5b50\u90fd\u6709\uff0c\u5219\u5176\u540e\u7684\u7ed3\u70b9\u90fd\u662f\u53f6\u5b50\u7ed3\u70b9\n ]\n+ \u4e00\u68f5\u6709 $n$ \u4e2a\u7ed3\u70b9\u7684\u5b8c\u5168\u4e8c\u53c9\u6811\uff0c\u6309\u5c42\u5e8f\u7f16\u53f7\uff0c\u5bf9\u4efb\u4e00\u7ed3\u70b9 $i$ \u6709\uff1a\n - \u82e5 $i = 1$\uff0c\u5219 $i$ \u662f\u6839\uff0c\u65e0\u53cc\u4eb2\uff1b\u5426\u5219\u5176\u53cc\u4eb2\u662f $floor(i/2)$\u3002\n - \u82e5 $2i > n$\uff0c\u5219 $i$ \u65e0\u5de6\u5b69\u5b50\uff1b\u5426\u5219\u5de6\u5b69\u5b50\u662f $2i$\u3002\n - \u82e5 $2i + 1 > n$\uff0c\u5219 $i$ \u65e0\u53f3\u5b69\u5b50\uff1b\u5426\u5219\u53f3\u5b69\u5b50\u662f $2i + 1$\u3002\n\n== \u4e8c\u53c9\u6811\u7684\u5b58\u50a8\u7ed3\u6784\n\n=== \u987a\u5e8f\u5b58\u50a8\u7ed3\u6784\n\n\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u7528\u6570\u7ec4\u5b58\u50a8\u4e8c\u53c9\u6811\u7684\u7ed3\u70b9\uff0c\u6309\u7167\u5b8c\u5168\u4e8c\u53c9\u6811\u7684\u7ed3\u6784\u5b58\u50a8\u3002\n\n\u6839\u8282\u70b9\u5b58\u50a8\u5728\u6570\u7ec4\u4e0b\u6807\u4e3a 0 \u7684\u4f4d\u7f6e\uff0c\u7136\u540e\u6bcf\u4e2a\u7ed3\u70b9\u7684\u5de6\u5b69\u5b50\u5b58\u50a8\u5728 $2i + 1$ \u7684\u4f4d\u7f6e\uff0c\u53f3\u5b69\u5b50\u5b58\u50a8\u5728 $2i + 2$ \u7684\u4f4d\u7f6e\uff0c$i$ \u8868\u793a\u8be5\u7ed3\u70b9\u5728\u6570\u7ec4\u4e2d\u7684\u4e0b\u6807\u3002\u540c\u6837\u7684\uff0c\u5982\u679c\u77e5\u9053\u4e00\u4e2a\u7ed3\u70b9\u7684\u4e0b\u6807\uff0c\u53ef\u4ee5\u901a\u8fc7 $floor((i-1)/2)$ \u627e\u5230\u5176\u53cc\u4eb2\u7ed3\u70b9\u3002\n\n=== \u94fe\u5f0f\u5b58\u50a8\u7ed3\u6784\n\n==== \u4e8c\u53c9\u94fe\u8868\n\n\u7ed3\u70b9\u7ed3\u6784\uff1a\n\n#table(columns: ((5em, 4em, 5em)), rows: 2em, align: center + horizon, [lchild], [data], [rchild])\n\n#figure(image(\"../assets/2024-06-25-16-13-50.png\", width: 80%), caption: \"\u4e8c\u53c9\u94fe\u8868\")\n\n==== \u4e09\u53c9\u94fe\u8868\n\n\u6bd4\u4e8c\u53c9\u94fe\u8868\u591a\u4e86\u4e00\u4e2a\u6307\u5411\u53cc\u4eb2\u7ed3\u70b9\u7684\u6307\u9488\u3002\n\n#table(columns: ((5em, 5em, 4em, 5em)), rows: 2em, align: center + horizon, [parent], [lchild], [data], [rchild])\n\n#figure(image(\"../assets/2024-06-25-16-15-02.png\", width: 80%), caption: \"\u4e09\u53c9\u94fe\u8868\")\n\n== \u4e8c\u53c9\u6811\u7684\u904d\u5386\n\n=== \u5148\u5e8f\u904d\u5386\n\n\u5148\u8bbf\u95ee\u6839\u7ed3\u70b9\uff0c\u7136\u540e\u4f9d\u6b21\u5148\u5e8f\u904d\u5386\u5de6\u5b50\u6811\u548c\u53f3\u5b50\u6811\u3002\n\n#note_block[\n \u82e5\u4e8c\u53c9\u6811\u4e3a\u7a7a\u6811\uff0c\u5219\u7a7a\u64cd\u4f5c\uff1b\u5426\u5219\uff0c\n\n + \u8bbf\u95ee\u6839\u7ed3\u70b9\uff1b\n + \u5148\u5e8f\u904d\u5386\u5de6\u5b50\u6811\uff1b\uff08\u9012\u5f52\uff09\n + \u5148\u5e8f\u904d\u5386\u53f3\u5b50\u6811\u3002\uff08\u9012\u5f52\uff09\n]\n\n\u975e\u9012\u5f52\u5b9e\u73b0\uff1a\n\n```c\nvoid PreOrder(Bitree T) {\n Stack S;\n InitStack(S);\n Bitree p = T;\n while (p || !StackEmpty(S)) {\n if (p) {\n visit(p->data);\n Push(S, p);\n p = p->Lchild;\n } else {\n Pop(S, p);\n p = p->Rchild;\n }\n }\n}\n```\n\n=== \u4e2d\u5e8f\u904d\u5386\n\n\u5148\u4e2d\u5e8f\u904d\u5386\u5de6\u5b50\u6811\uff0c\u7136\u540e\u8bbf\u95ee\u6839\u7ed3\u70b9\uff0c\u6700\u540e\u4e2d\u5e8f\u904d\u5386\u53f3\u5b50\u6811\u3002\n\n#note_block[\n \u82e5\u4e8c\u53c9\u6811\u4e3a\u7a7a\u6811\uff0c\u5219\u7a7a\u64cd\u4f5c\uff1b\u5426\u5219\uff0c\n\n + \u4e2d\u5e8f\u904d\u5386\u5de6\u5b50\u6811\uff1b\uff08\u9012\u5f52\uff09\n + \u8bbf\u95ee\u6839\u7ed3\u70b9\uff1b\n + \u4e2d\u5e8f\u904d\u5386\u53f3\u5b50\u6811\u3002\uff08\u9012\u5f52\uff09\n]\n\n\u975e\u9012\u5f52\u5b9e\u73b0\uff1a\n\n```c\nvoid InOrder(Bitree T) {\n Stack S;\n InitStack(S);\n Bitree p = T;\n while (p || !StackEmpty(S)) {\n if (p) {\n Push(S, p);\n p = p->Lchild;\n } else {\n Pop(S, p);\n visit(p->data);\n p = p->Rchild;\n }\n }\n}\n```\n\n=== \u540e\u5e8f\u904d\u5386\n\n\u5148\u540e\u5e8f\u904d\u5386\u5de6\u5b50\u6811\uff0c\u7136\u540e\u540e\u5e8f\u904d\u5386\u53f3\u5b50\u6811\uff0c\u6700\u540e\u8bbf\u95ee\u6839\u7ed3\u70b9\u3002\n\n#note_block[\n \u82e5\u4e8c\u53c9\u6811\u4e3a\u7a7a\u6811\uff0c\u5219\u7a7a\u64cd\u4f5c\uff1b\u5426\u5219\uff0c\n\n + \u540e\u5e8f\u904d\u5386\u5de6\u5b50\u6811\uff1b\uff08\u9012\u5f52\uff09\n + \u540e\u5e8f\u904d\u5386\u53f3\u5b50\u6811\uff1b\uff08\u9012\u5f52\uff09\n + \u8bbf\u95ee\u6839\u7ed3\u70b9\uff1b\n]\n\n\u975e\u9012\u5f52\u5b9e\u73b0\uff1a\n\n```c\nvoid PostOrder(Bitree T) {\n Stack S;\n InitStack(S);\n Bitree p = T;\n Bitree r = NULL;\n while (p || !StackEmpty(S)) {\n if (p) {\n Push(S, p);\n p = p->Lchild;\n } else {\n GetTop(S, p);\n if (p->Rchild && p->Rchild != r) {\n p = p->Rchild;\n } else {\n Pop(S, p);\n visit(p->data);\n r = p;\n p = NULL;\n }\n }\n }\n}\n```\n\n== \u7ebf\u7d22\u4e8c\u53c9\u6811\n\n\u7ed3\u70b9\u7ed3\u6784\uff1a\n\n#table(columns: (\n (5em, 4em, 5em, 4em, 5em)\n ), rows: 2em, align: center + horizon, [lchild], [ltag], [data], [rtag], [rchild])\n\nltag \u548c rtag \u7528\u6765\u6807\u8bb0\u662f\u5426\u4e3a\u7ebf\u7d22\uff0c\u5373\u6307\u5411\u524d\u9a71\u548c\u540e\u7ee7\u7684\u6307\u9488\u3002\u5982\u679c\u4e3a 0\uff0c\u5219\u8868\u793a\u6307\u5411\u5b69\u5b50\u7ed3\u70b9\uff1b\u5982\u679c\u4e3a 1\uff0c\u5219\u8868\u793a\u6307\u5411\u524d\u9a71\u6216\u540e\u7ee7\u3002\n\n#image(\"../assets/Threaded_tree.svg\", width: 37%)\n\n== \u6811\u548c\u68ee\u6797\n\n=== \u5b69\u5b50\u5144\u5f1f\u8868\u793a\u6cd5\n\n#definition[\n *\u5b69\u5b50\u5144\u5f1f\u8868\u793a\u6cd5*\uff1a\u4ee5\u4e8c\u53c9\u94fe\u8868\u4f5c\u4e3a\u6811\u7684\u5b58\u50a8\u7ed3\u6784\uff0c\u79f0\u4e3a\u5b69\u5b50\u5144\u5f1f\u8868\u793a\u6cd5\u3002\n]\n\n\u7ed3\u70b9\u7ed3\u6784\uff1a\n\n#table(columns: ((5em, 5em, 5em)), rows: 2em, align: center + horizon, [firstchild], [data], [nextsibling])\n\n#image(\"../assets/2024-06-25-16-37-45.png\")\n\n=== \u6811\u7684\u904d\u5386\n\n==== \u5148\u6839\u904d\u5386\n\n\u82e5\u6811\u4e0d\u7a7a\uff0c\u5219\u5148\u8bbf\u95ee\u6839\u7ed3\u70b9\uff0c\u7136\u540e\u4f9d\u6b21\u5148\u6839\u904d\u5386\u5404\u68f5\u5b50\u6811\u3002\n\n==== \u540e\u6839\u904d\u5386\n\n\u82e5\u6811\u4e0d\u7a7a\uff0c\u5219\u4f9d\u6b21\u540e\u6839\u904d\u5386\u5404\u68f5\u5b50\u6811\uff0c\u7136\u540e\u8bbf\u95ee\u6839\u7ed3\u70b9\u3002\n\n==== \u6309\u5c42\u6b21\u904d\u5386\n\n\u82e5\u6811\u4e0d\u7a7a\uff0c\u5219\u4ece\u6811\u7684\u7b2c\u4e00\u5c42\uff08\u6839\u7ed3\u70b9\uff09\u5f00\u59cb\uff0c\u4ece\u4e0a\u800c\u4e0b\u3001\u4ece\u5de6\u81f3\u53f3\u4f9d\u6b21\u8bbf\u95ee\u5404\u7ed3\u70b9\u3002\n\n==== \u5e94\u7528\n\n*\u6c42\u6811\u6df1*\uff1a\n\n```C\nint TreeDepth(CSTree T) {\n if (!T) return 0;\n else {\n h1 = TreeDepth(T->firstchild);\n h2 = TreeDepth(T->nextsibling);\n return (max(h1 + 1, h2));\n }\n}// TreeDepth\n```\n\n*\u8f93\u51fa\u6240\u6709\u6839\u5230\u53f6\u5b50\u7ed3\u70b9\u7684\u8def\u5f84*\uff1a\n\n```C\nvoid AllPath(Bitree T, Stack &S) {\n /// \u8f93\u51fa\u4e8c\u53c9\u6811\u4e0a\u4ece\u6839\u5230\u6240\u6709\u53f6\u5b50\u7ed3\u70b9\u7684\u8def\u5f84\n if (T) {\n Push(S, T->data);\n if (!T->Lchild && !T->Rchild) PrintStack(S);\n else {\n AllPath(T->Lchild, S);\n AllPath(T->Rchild, S);\n }\n Pop(S);\n }// if(T)\n} // AllPath\n```\n\n*\u8f93\u51fa\u68ee\u6797\u4e2d\u6240\u6709\u6839\u5230\u53f6\u5b50\u7ed3\u70b9\u7684\u8def\u5f84*\uff1a\n\n```C\nvoid OutPath(Bitree T, Stack &S) {\n // \u8f93\u51fa\u68ee\u6797\u4e2d\u6240\u6709\u4ece\u6839\u5230\u53f6\u7684\u8def\u5f84\n while (!T) {\n Push(S, T->data);\n if (!T->firstchild) Printstack(s);\n else\n OutPath(T->firstchild, s);\n Pop(S);\n T = T->nextsibling;\n }// while\n} // OutPath\n```\n\n=== \u68ee\u6797\u7684\u904d\u5386\n\n\u6811\u7684\u904d\u5386\u548c\u4e8c\u53c9\u6811\u7684\u904d\u5386\u5b58\u5728\u5bf9\u5e94\u5173\u7cfb\uff1a\n\n#table(\n columns: (1fr, 1fr, 1fr),\n rows: 2em,\n align: center + horizon,\n table.header([*\u6811*], [*\u68ee\u6797*], [*\u4e8c\u53c9\u6811*]),\n [\u5148\u6839\u904d\u5386], [\u5148\u5e8f\u904d\u5386], [\u5148\u5e8f\u904d\u5386],\n [\u540e\u6839\u904d\u5386], [\u4e2d\u5e8f\u904d\u5386], [\u4e2d\u5e8f\u904d\u5386],\n)\n\n==== \u5148\u5e8f\u904d\u5386\u68ee\u6797\n\n\u82e5\u68ee\u6797\u4e0d\u7a7a\uff0c\u5219\u53ef\u6309\u4e0b\u8ff0\u89c4\u5219\u904d\u5386\u4e4b\uff1a\n\n+ \u8bbf\u95ee\u68ee\u6797\u4e2d\u7b2c\u4e00\u68f5\u6811\u7684\u6839\u7ed3\u70b9\uff1b\n+ \u5148\u5e8f\u904d\u5386\u68ee\u6797\u4e2d\u7b2c\u4e00\u68f5\u6811\u7684\u5b50\u6811\u68ee\u6797\uff1b\n+ \u5148\u5e8f\u904d\u5386\u68ee\u6797\u4e2d\uff08\u9664\u7b2c\u4e00\u68f5\u6811\u4e4b\u5916\uff09\u5176\u4f59\u6811\u6784\u6210\u7684\u68ee\u6797\u3002\n\n\u5373\u4f9d\u6b21\u4ece\u5de6\u81f3\u53f3\u5bf9\u68ee\u6797\u4e2d\u7684\u6bcf\u4e00\u68f5\u6811\u8fdb\u884c\u5148\u6839\u904d\u5386\u3002\n\n==== \u4e2d\u5e8f\u904d\u5386\u68ee\u6797\n\n\u82e5\u68ee\u6797\u4e0d\u7a7a\uff0c\u5219\u53ef\u6309\u4e0b\u8ff0\u89c4\u5219\u904d\u5386\u4e4b\uff1a\n\n+ \u4e2d\u5e8f\u904d\u5386\u68ee\u6797\u4e2d\u7b2c\u4e00\u68f5\u6811\u7684\u5b50\u6811\u68ee\u6797\uff1b\n+ \u8bbf\u95ee\u68ee\u6797\u4e2d\u7b2c\u4e00\u68f5\u6811\u7684\u6839\u7ed3\u70b9\uff1b\n+ \u4e2d\u5e8f\u904d\u5386\u68ee\u6797\u4e2d\uff08\u9664\u7b2c\u4e00\u68f5\u6811\u4e4b\u5916\uff09\u5176\u4f59\u6811\u6784\u6210\u7684\u68ee\u6797\u3002\n\n\u5373\u4f9d\u6b21\u4ece\u5de6\u81f3\u53f3\u5bf9\u68ee\u6797\u4e2d\u7684\u6bcf\u4e00\u68f5\u6811\u8fdb\u884c*\u540e\u6839\u904d\u5386*\u3002\n\n== \u54c8\u592b\u66fc\u6811\n\n#definition[\n *\u5e26\u6743\u8def\u5f84\u957f\u5ea6*\uff08*WPL*\uff09\uff1a\u8bbe $T$ \u662f\u4e00\u68f5\u6709 $n$ \u4e2a\u53f6\u5b50\u7ed3\u70b9\u7684\u4e8c\u53c9\u6811\uff0c\u6bcf\u4e2a\u53f6\u5b50\u7ed3\u70b9 $w_i$ \u7684\u6743\u503c\u4e3a $w_i$\uff0c\u4ece\u6839\u7ed3\u70b9\u5230\u6bcf\u4e2a\u53f6\u5b50\u7ed3\u70b9 $w_i$ \u7684\u8def\u5f84\u957f\u5ea6\u4e3a $l_i$\uff0c\u5219 $T$ \u7684\u5e26\u6743\u8def\u5f84\u957f\u5ea6\u4e3a $\n \"WPL\"(T) = sum_(i=1)^(n) w_i times l_i\n $\n]\n\n#definition[\n *\u54c8\u592b\u66fc\u6811*\uff1a\u5e26\u6743\u8def\u5f84\u957f\u5ea6\u6700\u77ed\u7684\u4e8c\u53c9\u6811\u79f0\u4e3a\u54c8\u592b\u66fc\u6811\u3002\u53c8\u79f0*\u6700\u4f18\u4e8c\u53c9\u6811*\u3002\n]\n\n#note_block[\u6839\u8282\u70b9\u8def\u5f84\u957f\u5ea6\u4e3a 0\uff0c\u5de6\u5b50\u6811\u8def\u5f84\u957f\u5ea6\u52a0 1\uff0c\u53f3\u5b50\u6811\u8def\u5f84\u957f\u5ea6\u52a0 1\u3002]\n\n*\u6784\u5efa*\u54c8\u592b\u66fc\u6811\u7684\u7b97\u6cd5\uff1a\n\n1. \u4ece $n$ \u4e2a\u6743\u503c $w_1, w_2, dots, w_n$ \u7684\u53f6\u5b50\u7ed3\u70b9\u51fa\u53d1\uff0c\u6784\u9020 $n$ \u68f5\u53ea\u6709\u4e00\u4e2a\u7ed3\u70b9\u7684\u4e8c\u53c9\u6811\u3002\n2. \u5728 $n$ \u68f5\u6811\u4e2d\u9009\u53d6\u4e24\u68f5\u6839\u7ed3\u70b9\u7684\u6743\u503c\u6700\u5c0f\u7684\u6811\u4f5c\u4e3a\u5de6\u53f3\u5b50\u6811\u6784\u9020\u4e00\u68f5\u65b0\u7684\u4e8c\u53c9\u6811\uff0c\u4e14\u65b0\u7684\u4e8c\u53c9\u6811\u7684\u6839\u7ed3\u70b9\u7684\u6743\u503c\u4e3a\u5176\u5de6\u53f3\u5b50\u6811\u6839\u7ed3\u70b9\u7684\u6743\u503c\u4e4b\u548c\u3002#note_block[\n \u4f7f\u7528\u6700\u5c0f\u5806\u53ef\u4ee5\u5feb\u901f\u627e\u5230\u6700\u5c0f\u7684\u4e24\u4e2a\u6811\u3002\n ]\n\n3. \u4ece $n$ \u68f5\u6811\u4e2d\u5220\u9664\u9009\u53d6\u7684\u4e24\u68f5\u6811\uff0c\u5e76\u5c06\u65b0\u6784\u9020\u7684\u4e8c\u53c9\u6811\u52a0\u5165\u5230\u68ee\u6797\u4e2d\u3002\n4. \u91cd\u590d 2 \u548c 3\uff0c\u76f4\u5230\u68ee\u6797\u4e2d\u53ea\u6709\u4e00\u68f5\u6811\u4e3a\u6b62\u3002\n\n\u800c\u54c8\u592b\u66fc\u7f16\u7801\u5c31\u662f\u6839\u636e\u54c8\u592b\u66fc\u6811\u7684\u8def\u5f84\u6765\u7f16\u7801\uff0c\u8def\u5f84\u5de6\u8fb9\u4e3a 0\uff0c\u53f3\u8fb9\u4e3a 1\u3002\n\n" }, { "repo": "https://github.com/DawnEver/ieee-conference-typst-template", "file": "https://raw.githubusercontent.com/DawnEver/ieee-conference-typst-template/main/README.md", "language": "markdown", "license": "MIT License", "content": "# IEEE Conference [Typst](https://typst.app) Template\nI am preparing for IEEE cofference these days. Frustrated with Latex, I choose Typst to rewrite my paper.\n\nIn fact, typst app provides built-in IEEE paper template and [ieee-typst-template](https://github.com/bsp0109/ieee-typst-template) gives a modified edition for author's requiements, but they are not enough.\n\nBased on Word and Latex templates and format guidelines, I diy my Typst template.\n\n\n## What is Typst\nTypst is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use.\n\n- [Typst Github](https://github.com/typst/typst)\n- [Typst Homepage](https://typst.app)\n\n## Features\n- IEEE copyright on the first page.\n- Top captions for tables.\n- ...\n\n## Preview\nSee the [main.pdf](main.pdf).\n![demo.png](demo.png)\n\n## Usage:\nYou can try it online ([Click Me](https://typst.app/project/rgsg7a58qn3fKa7jPhbl2U)) or run locally.I strongly recommand writing with VSCode. \n\n![vscode_preview](vscode_preview.png)\n\n## Contribute\nWelcome to PRs.\n" }, { "repo": "https://github.com/SamK/typst-fonts-showcase", "file": "https://raw.githubusercontent.com/SamK/typst-fonts-showcase/master/template.typ", "language": "typst", "license": "", "content": "// vim: tabstop=2 softtabstop=2 shiftwidth=2\n\n#let template(title, pangram) = {\n\n set page(numbering: \"1/1\")\n set text(fallback: false)\n\n let list-fonts() = {\n let fonts = ()\n let lines = read(\"fonts.txt\").split(\"\\n\")\n for this-line in lines {\n let clean-line = this-line.trim()\n if clean-line != \"\" {\n fonts.push(clean-line)\n }\n }\n fonts\n }\n\n let font-box(font_name) = {\n heading(numbering: \"1. \")[\n #text(font: font_name, font_name)\n #text(size: .8em, weight: \"regular\", [(#font_name)])\n ]\n set text(font: font_name)\n pangram\n }\n\n align(center, text(17pt, title))\n\n\n let all-fonts = list-fonts()\n\n [This document shows all the #all-fonts.len() fonts Typst found on your system.]\n\n outline()\n\n for this-font in all-fonts {\n font-box(this-font)\n }\n}\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/km/0.1.0/lib.typ", "language": "typst", "license": "Apache License 2.0", "content": "#let binary-digits(x, digit: 0) = {\n let digits = range(digit).map(_ => 0)\n\n while (x != 0) {\n digits.insert(digit, calc.rem-euclid(x, 2))\n x = calc.div-euclid(x, 2)\n }\n\n return digits.rev().slice(0, digit).rev()\n}\n\n#let gray-code(x) = x.bit-xor(x.bit-rshift(1))\n\n#let karnaugh(labels, minterms, implicants: (),\n show-zero: false, mode: \"code\") = {\n let (X, Y) = range(2).map(i =>\n if (type(labels.at(i)) == str) {\n // Label extracted from character(s)\n labels.at(i).clusters().map(x => eval(x, mode: \"math\"))\n } else { labels.at(i) }\n )\n\n // Dimensions: 2^len\n let row = calc.pow(2, X.len())\n let column = calc.pow(2, Y.len())\n let cell = (\n width: 2.4em,\n height: 2.4em,\n )\n\n let gray-codes(till, digit) = range(till).map(i => gray-code(i)).map(code =>\n block(width: cell.width, height: cell.height, inset: cell.height / 9,\n for digit in binary-digits(code, digit: digit) {\n math.equation[#digit]\n }\n )\n )\n\n return table(\n rows: row + 1,\n columns: column + 1,\n inset: 0em,\n stroke: (x, y) =>\n if (x == 0 or y == 0) { none } else { 1pt },\n align: (x, y) => {\n if (x == 0 and y != 0) { horizon + right }\n else if (x != 0 and y == 0) { center + bottom }\n else { horizon + center }\n },\n // Top-left label block\n block(width: cell.width, height: cell.height, {\n line(end: (100%, 100%))\n\n let label = (\n x: box(for x in Y { x }),\n y: box(for y in X { y }),\n )\n\n context place(horizon + center,\n dx: measure(label.x).width / 2, dy: -0.5em, label.x)\n context place(horizon + center,\n dx: -measure(label.y).width / 2, dy: 0.5em, label.y)\n }),\n // Horizontal gray code labels\n ..if mode == \"code\" { gray-codes(column, Y.len()) },\n table.cell(x: 1, y: 1,\n rowspan: row, colspan: column,\n block(clip: true, {\n table(\n rows: row,\n columns: column,\n inset: 0em,\n align: horizon + center,\n stroke: 2pt / 3,\n ..range(row).map(i =>\n range(column).map(j =>\n block(width: cell.width, height: cell.height, {\n let term = minterms.at(i).at(j)\n\n if type(term) == int {\n if term == 0 {\n if show-zero { $0$ }\n } else if term == 1 { $1$ }\n else { math.ast.small }\n } else { term }\n })\n )\n ).flatten()\n )\n\n while (implicants.len() > 0) {\n let implicant = implicants.pop()\n let (x, y, width, ..) = implicant\n let height = if implicant.len() == 3 { width } else { implicant.at(3) }\n\n place(\n top + left,\n dx: y * cell.width,\n dy: x * cell.height,\n rect(\n fill: rgb(\"#0003\"),\n stroke: 2pt / 3,\n width: cell.width * width,\n height: cell.height * height,\n outset: -cell.height / 9)\n )\n\n // No need to expand out-of-range rectanges from the expanded rectange\n if (implicant.len() == 5 and not implicant.at(4)) { continue }\n\n // Draw extra out-of-range rectange(s)\n if x + height > row {\n implicants.push((row - x - height, y, width, height, false))\n if y + width > column {\n implicants.push((row - x - height, column - y - width, width, height, false))\n }\n }\n if y + width > column {\n implicants.push((x, column - y - width, width, height, false))\n }\n }\n })\n ),\n ..if mode == \"code\" { gray-codes(row, X.len()) },\n )\n}\n" }, { "repo": "https://github.com/jamesrswift/ionio-illustrate", "file": "https://raw.githubusercontent.com/jamesrswift/ionio-illustrate/main/dist/0.1.0/src/lib.typ", "language": "typst", "license": "MIT License", "content": "#import \"@preview/cetz:0.1.2\"\n\n/// Returns an object representing mass spectrum content.\n#let mass-spectrum(\n data,\n args: (:)\n) = {\n\n let prototype = (\n \n// --------------------------------------------\n// Public member data\n// --------------------------------------------\n \n data: data,\n keys: (\n mz: 0,\n intensity: 1\n ),\n size: (auto, 1),\n range: (40, 400),\n style: (:),\n labels: (\n x: [Mass-Charge Ratio],\n y: [Relative Intensity (%)]\n ),\n linestyle: (this, idx)=>{},\n\n// --------------------------------------------\n// \"Private\" member data\n// --------------------------------------------\n \n axes: (\n x: none,\n y: none\n ),\n plot-extras: (this)=>{},\n\n// --------------------------------------------\n// Methods\n// --------------------------------------------\n \n display: (this) => {\n cetz.canvas({\n import cetz.draw: *\n let (x,y) = (this.setup-axes)(this) \n cetz.draw.group(ctz=>{\n (this.setup-plot)(this, x, y)\n cetz.axes.axis-viewport(this.size, x, y,{\n (this.plot-extras)(this)\n if this.data.len() > 0 { \n for (i, row) in data.enumerate() {\n let x = float(row.at(this.keys.mz))\n let y = float(row.at(this.keys.intensity))\n (this.display-single-peak)(this, x, x, y)\n }\n }\n })\n })\n })\n },\n\n display-single-peak: (this, idx, mz, intensity) => {\n if (mz > this.range.at(0) and mz < this.range.at(1) ){\n cetz.draw.line(\n (mz, 0),\n (rel: (0,intensity)),\n ..(this.linestyle)(this, idx)\n )\n }\n },\n\n setup-plot: (this, x, y) => {\n cetz.axes.scientific(\n size: this.size,\n left: y,\n right: none,\n bottom: x,\n top: none,\n frame: true,\n label: (offset: 0.3),\n tick: (length:-0.1)\n )\n },\n\n setup-axes: (this) => {\n this.axes.x = cetz.axes.axis(\n min: this.range.at(0), \n max: this.range.at(1),\n label: this.labels.x,\n )\n this.axes.y = cetz.axes.axis(\n min: 0, \n max: 110,\n label: this.labels.y,\n ticks: (step: 20, minor-step: none)\n )\n return this.axes\n },\n\n get-intensity-at-mz: (this, mz) => {\n return float(\n (this.data).filter(\n it=>float(it.at(this.keys.mz, default:0))==mz\n ).at(0).at(this.keys.intensity)\n )\n },\n\n callout-above: (this, mz, content: none, y-offset: 1.3em) => {\n if ( content == none ) { content = mz}\n return cetz.draw.content(\n anchor: \"bottom\",\n (mz, (this.get-intensity-at-mz)(this, mz)), box(inset: 0.3em, [#content])\n )\n },\n\n calipers: ( this,\n start, end, // mass-charge ratios\n height: none,\n content: none,\n stroke: gray + 0.7pt // Style\n ) => {\n if (content == none){ content = [-#calc.abs(start - end)] }\n\n // Determine height\n let start_height = (this.get-intensity-at-mz)(this, start)\n let end_height = (this.get-intensity-at-mz)(this, end)\n if ( height == none ) { height = calc.max(start_height, end_height) + 5 }\n\n let draw-arrow(x, y) = cetz.draw.line(\n (x - 0.5, y + 2),(x + 0.5, y + 2),\n stroke: stroke\n )\n\n // Draw\n return {\n // Start : horizontal arrow\n draw-arrow(start, start_height)\n draw-arrow(end, end_height)\n \n cetz.draw.merge-path({\n cetz.draw.line( (start, start_height + 2), (start, height) )\n cetz.draw.line((start, height), (end, height))\n cetz.draw.line((end, height),(end, end_height + 2))\n }, stroke: stroke)\n\n // Content\n cetz.draw.content(\n ( (start + end) / 2, height),\n anchor: \"bottom\",\n box(inset: 0.3em, content)\n )\n }\n },\n\n title: (this, content, anchor: \"top-left\", ..args) => {\n return cetz.draw.content(\n anchor: anchor,\n (this.range.at(0), 110),\n box(inset: 0.5em, content),\n ..args\n )\n }\n\n )\n\n // Overrides\n for (key, value) in args.pairs() {\n prototype.insert(key, value)\n }\n\n // Asserts\n assert(type(prototype.keys.mz) in (int, str))\n assert(type(prototype.keys.intensity) in (int, str))\n\n return prototype\n}\n\n#let MolecularIon(charge:none) = [M#super()[#charge+]]" }, { "repo": "https://github.com/GYPpro/Java-coures-report", "file": "https://raw.githubusercontent.com/GYPpro/Java-coures-report/main/.VSCodeCounter/2023-12-15_05-15-05/details.md", "language": "markdown", "license": "", "content": "# Details\n\nDate : 2023-12-15 05:15:05\n\nDirectory d:\\\\Desktop\\\\Document\\\\Coding\\\\JAVA\\\\Rep\\\\Java-coures-report\n\nTotal : 52 files, 7709 codes, 180 comments, 1740 blanks, all 9629 lines\n\n[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)\n\n## Files\n| filename | language | code | comment | blank | total |\n| :--- | :--- | ---: | ---: | ---: | ---: |\n| [README.md](/README.md) | Markdown | 1 | 0 | 2 | 3 |\n| [README.typ](/README.typ) | Typst | 179 | 2 | 39 | 220 |\n| [Report/0.typ](/Report/0.typ) | Typst | 48 | 4 | 9 | 61 |\n| [Report/1.typ](/Report/1.typ) | Typst | 84 | 2 | 23 | 109 |\n| [Report/10.typ](/Report/10.typ) | Typst | 550 | 4 | 155 | 709 |\n| [Report/11.typ](/Report/11.typ) | Typst | 1,068 | 17 | 150 | 1,235 |\n| [Report/2.typ](/Report/2.typ) | Typst | 116 | 2 | 23 | 141 |\n| [Report/3.typ](/Report/3.typ) | Typst | 306 | 2 | 49 | 357 |\n| [Report/4.typ](/Report/4.typ) | Typst | 172 | 5 | 38 | 215 |\n| [Report/5.typ](/Report/5.typ) | Typst | 133 | 2 | 39 | 174 |\n| [Report/6.typ](/Report/6.typ) | Typst | 736 | 2 | 123 | 861 |\n| [Report/7.typ](/Report/7.typ) | Typst | 210 | 13 | 45 | 268 |\n| [Report/8.typ](/Report/8.typ) | Typst | 209 | 5 | 49 | 263 |\n| [Report/9.typ](/Report/9.typ) | Typst | 384 | 3 | 82 | 469 |\n| [Report/Java\u8bed\u8a00 \u5b9e\u9a8c\u62a5\u544a\u6a21\u677f 2023-10-8-20231214155905.typ](/Report/Java%E8%AF%AD%E8%A8%80%20%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A%E6%A8%A1%E6%9D%BF%202023-10-8-20231214155905.typ) | Typst | 497 | 1 | 263 | 761 |\n| [Report/\u6700\u5c0f\u8d39\u7528\u6700\u5927\u6d41\u95ee\u9898-20231215032417.typ](/Report/%E6%9C%80%E5%B0%8F%E8%B4%B9%E7%94%A8%E6%9C%80%E5%A4%A7%E6%B5%81%E9%97%AE%E9%A2%98-20231215032417.typ) | Typst | 323 | 1 | 205 | 529 |\n| [rubbish/myIO.java](/rubbish/myIO.java) | Java | 76 | 0 | 17 | 93 |\n| [sis10/Test.java](/sis10/Test.java) | Java | 18 | 0 | 5 | 23 |\n| [sis10/myLinearEntire.java](/sis10/myLinearEntire.java) | Java | 41 | 0 | 18 | 59 |\n| [sis10/myLinearLib.java](/sis10/myLinearLib.java) | Java | 197 | 34 | 13 | 244 |\n| [sis10/myLinearSpace.java](/sis10/myLinearSpace.java) | Java | 111 | 4 | 18 | 133 |\n| [sis10/myMatrix.java](/sis10/myMatrix.java) | Java | 267 | 4 | 24 | 295 |\n| [sis10/myPolynomial.java](/sis10/myPolynomial.java) | Java | 131 | 4 | 21 | 156 |\n| [sis10/myRealNum.java](/sis10/myRealNum.java) | Java | 58 | 3 | 15 | 76 |\n| [sis1/basicIO.java](/sis1/basicIO.java) | Java | 26 | 0 | 3 | 29 |\n| [sis2/Test.java](/sis2/Test.java) | Java | 54 | 0 | 2 | 56 |\n| [sis2/UIDmanager.java](/sis2/UIDmanager.java) | Java | 138 | 0 | 19 | 157 |\n| [sis3/Test.java](/sis3/Test.java) | Java | 26 | 5 | 5 | 36 |\n| [sis3/TrieTree.java](/sis3/TrieTree.java) | Java | 37 | 0 | 6 | 43 |\n| [sis4/regularExp.java](/sis4/regularExp.java) | Java | 34 | 0 | 4 | 38 |\n| [sis5/SchoolLib.java](/sis5/SchoolLib.java) | Java | 186 | 31 | 15 | 232 |\n| [sis5/Student.java](/sis5/Student.java) | Java | 114 | 0 | 24 | 138 |\n| [sis5/Test.java](/sis5/Test.java) | Java | 18 | 0 | 3 | 21 |\n| [sis5/course.java](/sis5/course.java) | Java | 76 | 0 | 17 | 93 |\n| [sis5/score.java](/sis5/score.java) | Java | 107 | 0 | 22 | 129 |\n| [sis6/segTree.h](/sis6/segTree.h) | C++ | 102 | 12 | 10 | 124 |\n| [sis7/Test.java](/sis7/Test.java) | Java | 24 | 5 | 5 | 34 |\n| [sis7/segTree.java](/sis7/segTree.java) | Java | 100 | 3 | 14 | 117 |\n| [sis8/maxFlow.java](/sis8/maxFlow.java) | Java | 96 | 0 | 13 | 109 |\n| [sis8/minCost.java](/sis8/minCost.java) | Java | 139 | 0 | 19 | 158 |\n| [sis8/solution.java](/sis8/solution.java) | Java | 26 | 1 | 3 | 30 |\n| [sis9/Bed.java](/sis9/Bed.java) | Java | 13 | 0 | 4 | 17 |\n| [sis9/City.java](/sis9/City.java) | Java | 21 | 0 | 7 | 28 |\n| [sis9/Constants.java](/sis9/Constants.java) | Java | 10 | 0 | 4 | 14 |\n| [sis9/Hospital.java](/sis9/Hospital.java) | Java | 49 | 0 | 19 | 68 |\n| [sis9/Main.java](/sis9/Main.java) | Java | 32 | 0 | 6 | 38 |\n| [sis9/MoveTarget.java](/sis9/MoveTarget.java) | Java | 28 | 0 | 9 | 37 |\n| [sis9/MyPanel.java](/sis9/MyPanel.java) | Java | 78 | 2 | 15 | 95 |\n| [sis9/Person.java](/sis9/Person.java) | Java | 145 | 0 | 36 | 181 |\n| [sis9/PersonPool.java](/sis9/PersonPool.java) | Java | 38 | 0 | 9 | 47 |\n| [sis9/Point.java](/sis9/Point.java) | Java | 21 | 0 | 7 | 28 |\n| [test.java](/test.java) | Java | 56 | 7 | 15 | 78 |\n\n[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)" }, { "repo": "https://github.com/protohaven/printed_materials", "file": "https://raw.githubusercontent.com/protohaven/printed_materials/main/meta-environments/env-protohaven_policy.typ", "language": "typst", "license": "", "content": "\n// Core colors and fonts for the design identity\n\n#let accent_color = rgb(\"#6EC7E2\")\n#let warning_color = rgb(\"#900000\")\n#let light_grey = rgb(65%,65%,65%)\n#let mid_grey = rgb(50%,50%,50%)\n#let dark_grey = rgb(38%,38%,38%)\n\n#let sans_font = (\"Noto Sans\")\n#let serif_font = (\"Noto Serif\")\n#let mono_font = (\"Fira Mono\")\n\n/*\n * Renders `content` with the module's text styling. This is useful for content\n * that is outside of the `template` container but which should be visually consistent.\n */\n#let apply-text-styles(content) = {\n set text(\n font: sans_font\n )\n set par(\n leading: 0.8em,\n )\n show heading.where(level: 1): it => [\n // #pagebreak(weak: true)\n #set text(size: 20pt, font: sans_font, number-type: \"lining\", weight: \"bold\",)\n #block(it.body) \n ]\n show heading.where(level: 2): it => text(\n size: 17pt,\n font: sans_font,\n number-type: \"lining\",\n weight: \"semibold\",\n {\n v(0.6em)\n it.body\n }\n )\n show heading.where(level: 3): it => text(\n size: 14pt,\n font: sans_font,\n number-type: \"lining\",\n weight: \"semibold\",\n it.body\n )\n show heading.where(level: 4): it => text(\n size: 12pt,\n font: sans_font,\n number-type: \"lining\",\n weight: \"semibold\",\n it.body\n )\n\n show link: l => text(\n font: mono_font,\n size:10pt,\n box(width:6.7in)[#l.body]\n )\n\n show figure: it => align(center)[\n #set text(size: 9pt, font: sans_font)\n #it.body\n /*#it.supplement*/ #it.caption\n ]\n\n content\n}\n\n\n#let policy_document(\n title: \"Policy Document\",\n authors: (\"Someone\",\"\"),\n date: datetime.today(),\n draft: false,\n wrapper: apply-text-styles,\n doc,\n) = {\n\n set page(\n background: if draft {rotate(-44deg,\n {text(160pt, fill: rgb(\"EEEEEE\"), [*DRAFT*]) \n linebreak()\n text(60pt, fill: rgb(\"EEEEEE\"), date.display())}\n )})\n \n set document(title: title, \n author: authors,\n keywords: (\"protohaven\", \"policy\"),\n date: date,\n )\n\n show outline.entry.where(\n level: 1\n ): it => {\n v(12pt, weak: true)\n strong(it)\n }\n\n // Title page\n\n set text(\n font: sans_font,\n )\n\n align(center, image(\"../images/Protohaven-Logo-Horizontal-Color-959069212.png\"))\n \n \n v(1in)\n \n stack(dir: ttb,\n // text(weight: \"bold\", size: 18pt, mid_grey, smallcaps(\"Policy Document\")),\n // v(1.2em),\n text(weight: \"bold\", size: 36pt, [#title]),\n v(3em), \n text(weight: \"bold\", size: 14pt, [Adoption Date: #date.display(\"[month repr:long] [day padding:none], [year]\")]),\n v(15em), \n outline(depth: 2)\n )\n \n \n v(1fr)\n \n \n \n rect(width: 100%, inset: 2em, align(center, \"License Information\"))\n \n pagebreak()\n\n // The rest of the content\n\n set page(\n margin: (top: 1in, left: 1in, bottom: 1in, right: 1in),\n numbering: \"1\",\n footer: [\n #set text(9pt, style: \"italic\")\n #h(1fr)\n Protohaven Policy Document \u2014 #title \u2014\n #counter(page).display(\n \"1 of 1\",\n both: true,\n )\n ], \n )\n \n counter(page).update(1)\n \n wrapper(doc)\n}" }, { "repo": "https://github.com/Shedward/dnd-charbook", "file": "https://raw.githubusercontent.com/Shedward/dnd-charbook/main/dnd/game/game.typ", "language": "typst", "license": "", "content": "#import \"spells.typ\": *\n#import \"character.typ\": *\n#import \"abilities.typ\": *\n#import \"proficiencies.typ\": *\n#import \"biography.typ\": *\n" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/raw-03.typ", "language": "typst", "license": "Other", "content": "// Lots of backticks inside.\n````\n```backticks```\n````\n\n" }, { "repo": "https://github.com/Coekjan/parallel-programming-learning", "file": "https://raw.githubusercontent.com/Coekjan/parallel-programming-learning/master/ex-3/report.typ", "language": "typst", "license": "", "content": "#import \"../template.typ\": *\n#import \"@preview/cetz:0.2.2\" as cetz\n#import \"@preview/codelst:2.0.1\" as codelst\n\n#show: project.with(\n title: \"\u5e76\u884c\u7a0b\u5e8f\u8bbe\u8ba1\u7b2c 3 \u6b21\u4f5c\u4e1a\uff08MPI \u7f16\u7a0b\uff09\",\n authors: (\n (name: \"\u53f6\u712f\u4ec1\", email: \"\", affiliation: \"ACT, SCSE\"),\n ),\n)\n\n#let data = toml(\"data.toml\")\n#let lineref = codelst.lineref.with(supplement: \"\u4ee3\u7801\u884c\")\n#let sourcecode = codelst.sourcecode.with(\n label-regex: regex(\"//!\\s*(line:[\\w-]+)$\"),\n highlight-labels: true,\n highlight-color: lime.lighten(50%),\n)\n\n#let batch-of(s) = {\n let nodes = s.split(\"x\").at(0)\n let proc-per-node = s.split(\"x\").at(1)\n (int(nodes), int(proc-per-node))\n}\n#let data-time(raw-data) = raw-data.pairs().map(data => {\n let (batch, time) = data\n let (nodes, proc-per-node) = batch-of(batch)\n ((nodes, proc-per-node), time.sum() / time.len())\n})\n#let data-speedup(raw-data) = data-time(raw-data).map(data => {\n let pivot = data-time(raw-data).at(0).at(1)\n let (batch, time) = data\n (batch, pivot / time)\n})\n#let data-table(raw-data) = table(\n columns: (auto, 1fr, 1fr, 0.7fr, 0.7fr, 0.7fr),\n align: horizon + center,\n table.header(table.cell(rowspan: 2)[*\u8fdb\u7a0b\u6570\u91cf*], table.cell(colspan: 2)[*\u5206\u5e03\u60c5\u51b5*], table.cell(rowspan: 2, colspan: 3)[*\u8fd0\u884c\u65f6\u95f4\uff08\u5355\u4f4d\uff1a\u79d2\uff09*], [*\u7ed3\u70b9\u6570*], [*\u8fdb\u7a0b\u6570/\u7ed3\u70b9\u6570*]),\n ..raw-data.pairs().enumerate().map(pair => {\n let (index, pair) = pair\n let (batch, data) = pair\n let nodes = batch.split(\"x\").at(0)\n let proc-per-node = batch.split(\"x\").at(1)\n\n let num-proc = int(nodes) * int(proc-per-node)\n\n if index == raw-data.keys().enumerate().find(pair => {\n let (i, batch) = pair\n let (nodes, proc-per-node) = batch-of(batch)\n nodes * proc-per-node == num-proc\n }).at(0) {\n (\n table.cell(rowspan: raw-data.keys().filter(batch => {\n let (nodes, proc-per-node) = batch-of(batch)\n nodes * proc-per-node == num-proc\n }).len(), str(num-proc)),\n nodes,\n proc-per-node,\n data.map(str)\n )\n } else {\n (nodes, proc-per-node, data.map(str))\n }\n }).flatten()\n)\n#let data-chart(raw-data, width, height, time-max, speedup-max) = cetz.canvas({\n let color(index) = {\n let data = data-time(raw-data).at(index)\n let (batch, _) = data\n let (nodes, proc-per-node) = batch\n let procs = calc.log(nodes * proc-per-node, base: 2)\n (\n fill: (red, orange, yellow, blue, green, purple, lime).at(int(procs)),\n )\n }\n\n cetz.chart.columnchart(\n size: (width, height),\n data-time(raw-data).map(pair => {\n let (batch, time) = pair\n let (nodes, proc-per-node) = batch\n (rotate(-30deg)[\n #set text(size: 0.8em)\n #nodes#sym.times#proc-per-node\n ], time)\n }),\n y-max: time-max,\n x-label: [_\u7ed3\u70b9\u6570\u91cf #sym.times \u6bcf\u7ed3\u70b9\u7684\u8fdb\u7a0b\u6570\u91cf_],\n y-label: [_\u5e73\u5747\u8fd0\u884c\u65f6\u95f4\uff08\u5355\u4f4d\uff1a\u79d2\uff09_],\n bar-style: color,\n )\n cetz.plot.plot(\n size: (width, height),\n axis-style: \"scientific-auto\",\n plot-style: (fill: black),\n x-tick-step: none,\n x-min: 0,\n x-max: data-time(raw-data).len() + 1,\n y2-min: 1,\n y2-max: speedup-max,\n x-label: none,\n y2-label: [_\u52a0\u901f\u6bd4_],\n y2-unit: sym.times,\n cetz.plot.add(\n axes: (\"x\", \"y2\"),\n data-speedup(raw-data).enumerate().map(pair => {\n let (i, pair) = pair\n let (_, speedup) = pair\n (i + 1, speedup)\n }),\n ),\n )\n})\n\n= \u5b9e\u9a8c\uff1a\u77e9\u9635\u4e58\u6cd5\n\n== \u5b9e\u9a8c\u5185\u5bb9\u4e0e\u65b9\u6cd5\n\n\u4f7f\u7528 MPI \u7f16\u7a0b\u5b9e\u73b0\u77e9\u9635\u4e58\u6cd5\u7684\u5e76\u884c\u52a0\u901f\uff0c\u5e76\u5728\u4e0d\u540c\u8fdb\u7a0b\u6570\u91cf\u3001\u4e0d\u540c\u7ed3\u70b9\u6570\u91cf\u4e0b\u8fdb\u884c\u5b9e\u9a8c\uff0c\u8bb0\u5f55\u8fd0\u884c\u65f6\u95f4\u5e76\u8fdb\u884c\u5206\u6790\u3002\n- \u77e9\u9635\u5927\u5c0f\uff1a8192 #sym.times 8192\n- \u77e9\u9635\u5206\u5757\u7b97\u6cd5\uff1a\u7ed9\u5b9a\u77e9\u9635 $A$ \u4e0e $B$\uff0c\u8ba1\u7b97\u5176\u4e58\u79ef $A B = C$\uff0c\u901a\u8fc7\u5c06 $A$ \u6309\u884c\u5206\u5757\u6765\u8ba1\u7b97\uff0c\u5982 @equation:block-matrix \u6240\u793a\u3002\n $\n A B = mat(A_1; A_2; dots.v; A_n) B = mat(A_1 B; A_2 B; dots.v; A_n B) = C\n $ \n- \u8fdb\u7a0b\u6570\u91cf\uff1a1 \\~ 64\n- \u7ed3\u70b9\u6570\u91cf\uff1a1 \\~ 64\n\n\u7a0b\u5e8f\u6784\u9020\u8fc7\u7a0b\u4e2d\u6709\u5982\u4e0b\u8981\u70b9\uff1a\n+ \u8ba1\u7b97 $A B$ \u65f6\uff0c\u5c06 $A$ \u6309\u884c\u5206\u5757\u800c\u4e0d\u662f\u5c06 $B$ \u6309\u5217\u5206\u5757\uff0c\u4f7f\u5f97 MPI \u5206\u53d1\u6570\u636e\uff08\u5730\u5740\u8fde\u7eed\uff09\u65f6\u66f4\u52a0\u65b9\u4fbf\u3002\n+ \u5982 @code:script-code \u6240\u793a\uff0c\u5229\u7528\u811a\u672c ```bash matmul.slurm.run``` \u6307\u5b9a\u7ed3\u70b9\u6570\u91cf\u4e0e\u6bcf\u4e2a\u7ed3\u70b9\u7684\u8fdb\u7a0b\u6570\u91cf\uff0c\u52a8\u6001\u751f\u6210 Slurm \u4f5c\u4e1a\u811a\u672c\uff0c\u8fd0\u884c\u65f6\u6307\u5b9a\u5f62\u5982 `SLURM_BATCH=AxB` \u7684\u73af\u5883\u53d8\u91cf\uff0c\u53ef\u6307\u5b9a MPI \u7a0b\u5e8f\u8fd0\u884c\u4e8e `A` \u4e2a\u7ed3\u70b9\u3001\u6bcf\u4e2a\u7ed3\u70b9 `B` \u4e2a\u8fdb\u7a0b\u4e0a\u3002\u4f8b\u5982 ```sh SLURM_BATCH=4x4 ./matmul.slurm.run ``` \u6307\u5b9a MPI \u7a0b\u5e8f\u8fd0\u884c\u4e8e 4 \u4e2a\u7ed3\u70b9\u3001\u6bcf\u4e2a\u7ed3\u70b9 4 \u4e2a\u8fdb\u7a0b\uff0c\u5171 16 \u4e2a\u8fdb\u7a0b\u4e0a\u3002\n+ \u4e3a\u8bb0\u5f55\u6392\u5e8f\u65f6\u95f4\uff0c\u4f7f\u7528 POSIX \u7684 ```c gettimeofday()``` \u51fd\u6570\uff1b\n+ \u4e3a\u7b80\u8981\u5730\u8bb0\u5f55\u77e9\u9635\u4e58\u6cd5\u7ed3\u679c\uff08\u53cc\u7cbe\u5ea6\u6d6e\u70b9\u9635\u5217\uff09\uff0c\u4f7f\u7528 OpenSSL \u7684 SHA1 \u7b97\u6cd5\u8ba1\u7b97\u5176\u6307\u7eb9\u3002\n\n\u4ee3\u7801\u5982 @code:matmul-code \u6240\u793a\uff0c\u5176\u4e2d\uff1a\n- #lineref()\u3001#lineref()\u3001#lineref() \u4f7f\u7528 MPI \u8fdb\u884c\u4e86\u521d\u59cb\u5316\u3001\u83b7\u53d6\u8fdb\u7a0b\u7f16\u53f7\u3001\u83b7\u53d6\u8fdb\u7a0b\u6570\u91cf\u7b49\u64cd\u4f5c\uff1b\n- #lineref() \u5c06 $B$ \u77e9\u9635\u5e7f\u64ad\u5230\u6240\u6709\u8fdb\u7a0b\uff1b\n- #lineref()\u3001#lineref()\u3001#lineref() \u5c06 $A$ \u77e9\u9635\u5206\u5757\u5206\u53d1\u5230\u6240\u6709\u8fdb\u7a0b\uff1b\n- #lineref()\u3001#lineref()\u3001#lineref() \u5c06 $C$ \u77e9\u9635\u6536\u96c6\u5230\u8fdb\u7a0b 0\uff1b\n- #lineref() \u7ed3\u675f MPI\u3002\n\n#figure(\n sourcecode(\n raw(read(\"matmul/matmul.c\"), lang: \"c\"),\n ),\n caption: \"\u5e76\u884c\u77e9\u9635\u4e58\u6cd5 MPI \u5b9e\u73b0\u4ee3\u7801\",\n) \n\n== \u5b9e\u9a8c\u8fc7\u7a0b\n\n\u5728\u5982 @chapter:platform-info \u6240\u8ff0\u7684\u5b9e\u9a8c\u5e73\u53f0\u4e0a\u8fdb\u884c\u5b9e\u9a8c\uff0c\u5206\u522b\u4f7f\u7528 1 \\~ 64 \u4e2a\u8fdb\u7a0b\uff08\u5206\u5e03\u5728 1 \\~ 64 \u4e2a\u7ed3\u70b9\u4e0a\uff09\u8fdb\u884c\u77e9\u9635\u4e58\u6cd5\uff0c\u8bb0\u5f55\u8fd0\u884c\u65f6\u95f4\uff0c\u6d4b\u5b9a 3 \u6b21\u53d6\u5e73\u5747\u503c\uff0c\u539f\u59cb\u6570\u636e\u5982 @table:matmul-raw-data \u6240\u793a\u3002\n\n== \u5b9e\u9a8c\u7ed3\u679c\u4e0e\u5206\u6790\n\n#let matmul-speedup-max = data-speedup(data.matmul).sorted(key: speedup => speedup.at(1)).last()\n\n\u77e9\u9635\u4e58\u6cd5\u5b9e\u9a8c\u6d4b\u5b9a\u7684\u8fd0\u884c\u65f6\u95f4\u5982 @figure:matmul-chart \u4e2d\u7684\u6761\u67f1\u6240\u793a\uff08\u76f8\u540c\u989c\u8272\u8868\u793a\u76f8\u540c\u7684\u603b\u8fdb\u7a0b\u6570\uff09\uff0c\u5e76\u884c\u52a0\u901f\u6bd4\u5982 @figure:matmul-chart \u4e2d\u7684\u6298\u7ebf\u6240\u793a\uff0c\u5176\u4e2d\u6700\u5927\u52a0\u901f\u6bd4\u5728\u7ed3\u70b9\u6570\u4e3a #matmul-speedup-max.at(0).at(0)\u3001\u6bcf\u7ed3\u70b9\u7684\u8fdb\u7a0b\u6570\u4e3a #matmul-speedup-max.at(0).at(1) \u65f6\uff08\u603b\u8fdb\u7a0b\u6570\u4e3a #{matmul-speedup-max.at(0).at(0) * matmul-speedup-max.at(0).at(1)}\uff09\u8fbe\u5230\uff0c\u6700\u5927\u52a0\u901f\u6bd4\u4e3a #matmul-speedup-max.at(1)\u3002\n\n#figure(\n data-chart(data.matmul, 12, 8, 600, 60),\n caption: \"\u77e9\u9635\u4e58\u6cd5\u8fd0\u884c\u65f6\u95f4\",\n) \n\n\u53ef\u89c1\u968f\u7740\u8fdb\u7a0b\u6570\u91cf\u589e\u52a0\uff0c\u8fd0\u884c\u65f6\u95f4\u9010\u6e10\u51cf\u5c11\u3002\u5177\u4f53\u6765\u8bf4\uff1a\n+ \u968f\u7740\u603b\u8fdb\u7a0b\u6570\u91cf\uff0c\u8fd0\u884c\u65f6\u95f4\u9010\u6e10\u51cf\u5c11\uff0c\u52a0\u901f\u6bd4\u5448\u73b0\u4e9a\u7ebf\u6027\u89c4\u5f8b\u3002\u52a0\u901f\u6bd4\u672a\u5448\u73b0\u5b8c\u5168\u7ebf\u6027\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u5e76\u884c\u672c\u8eab\u5b58\u5728\u901a\u4fe1\u5f00\u9500\u3002\n+ \u603b\u8fdb\u7a0b\u6570\u76f8\u540c\u65f6\uff0c\u8fdb\u7a0b\u5728\u96c6\u7fa4\u4e2d\u7684\u5206\u5e03\u60c5\u51b5\uff08\u7ed3\u70b9\u6570\u91cf\uff09\u5bf9\u8fd0\u884c\u65f6\u95f4\u6709\u4e00\u5b9a\u5f71\u54cd\uff0c\u4f8b\u5982\uff1a\n - \u5f53\u603b\u8fdb\u7a0b\u6570\u4e3a 16 \u65f6\uff0c\u5c06 16 \u4e2a\u8fdb\u7a0b\u5206\u6563\u5728 16 \u4e2a\u7ed3\u70b9\u4e0a\u7684\u8fd0\u884c\u65f6\u95f4\u8f83\u957f\uff1b\u5f53\u603b\u8fdb\u7a0b\u6570\u4e3a 64 \u65f6\uff0c\u5c06 64 \u4e2a\u8fdb\u7a0b\u5206\u6563\u5728 32 \u4e2a\u7ed3\u70b9\uff08\u6bcf\u7ed3\u70b9 2 \u4e2a\u8fdb\u7a0b\uff09\u4e0a\u7684\u8fd0\u884c\u65f6\u95f4\u8f83\u957f\u3002\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u8fdb\u7a0b\u5728\u4e0d\u540c\u7ed3\u70b9\u95f4\u901a\u4fe1\u65f6\uff0c\u7f51\u7edc\u5ef6\u8fdf\u8f83\u5927\u3002\n - \u5f53\u603b\u8fdb\u7a0b\u6570\u4e3a 64 \u65f6\uff0c\u5c06 64 \u4e2a\u8fdb\u7a0b\u5206\u6563\u5728 64 \u4e2a\u7ed3\u70b9\u4e0a\u7684\u8fd0\u884c\u65f6\u95f4\u8f83\u77ed\u3002\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u96c6\u7fa4\u4e2d\u67d0\u79cd\u62d3\u6251\u7ed3\u6784\u4f7f\u5f97\u6240\u5206\u914d\u7684 64 \u4e2a\u7ed3\u70b9\u4e92\u8054\u901a\u4fe1\u6548\u7387\u8f83\u9ad8\u3002\n\n\u77e9\u9635\u4e58\u6cd5\u5b9e\u9a8c\u4e2d\u7684\u539f\u59cb\u6570\u636e\u5982 @table:matmul-raw-data \u6240\u793a\u3002\n\n#figure(\n data-table(data.matmul),\n caption: \"\u77e9\u9635\u4e58\u6cd5\u5b9e\u9a8c\u539f\u59cb\u6570\u636e\",\n) \n\n= \u9644\u6ce8\n\n== \u7f16\u8bd1\u4e0e\u8fd0\u884c\n\n\u4ee3\u7801\u4f9d\u8d56 MPI\u3001OpenSSL \u5e93\uff0c\u82e5\u672a\u5b89\u88c5\u8fd9\u4e9b\u5e93\uff0c\u9700\u624b\u52a8\u5b89\u88c5\u3002\u5728\u51c6\u5907\u597d\u4f9d\u8d56\u540e\uff0c\u53ef\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u7f16\u8bd1\u4e0e\u8fd0\u884c\uff1a\n- \u7f16\u8bd1\uff1a```sh make```\uff1b\n- \u8fd0\u884c\uff1a```sh make run ```\uff1b\n - \u53ef\u901a\u8fc7\u73af\u5883\u53d8\u91cf ```SLURM_BATCH``` \u6307\u5b9a\u7ed3\u70b9\u6570\u91cf\u4e0e\u6bcf\u4e2a\u7ed3\u70b9\u7684\u8fdb\u7a0b\u6570\u91cf\uff0c\u4f8b\u5982 ```sh SLURM_BATCH=4x4 make run``` \u6307\u5b9a MPI \u7a0b\u5e8f\u8fd0\u884c\u4e8e 4 \u4e2a\u7ed3\u70b9\u3001\u6bcf\u4e2a\u7ed3\u70b9 4 \u4e2a\u8fdb\u7a0b\uff0c\u5171 16 \u4e2a\u8fdb\u7a0b\u4e0a\u3002\n - \u8fd0\u884c\u7ed3\u675f\u540e\u82e5\u63d0\u793a\u9519\u8bef\uff08\u68c0\u6d4b\u5230\u6307\u7eb9\u9519\u8bef\uff09\uff0c\u5219\u8bf4\u660e\u8fd0\u884c\u7ed3\u679c\u4e0d\u6b63\u786e\uff0c\u8be5\u68c0\u6d4b\u673a\u5236\u7684\u5927\u81f4\u903b\u8f91\u7531 @code:makefile-fingerprint \u4e2d\u7684 Makefile \u4ee3\u7801\u7ed9\u51fa\uff1b\n #figure(\n sourcecode(\n ```make\n # The fingerprint of the result\n FINGERPRINT := 00 11 22 33 44 55 66 77 88 99 99 88 77 66 55 44 33 22 11 00\n\n # Run the program `app` and check the fingerprint\n .PHONY: run\n run:\n exec 3>&1; stdbuf -o0 ./app | tee >(cat - >&3) | grep -q $(FINGERPRINT)\n ```\n ),\n caption: \"Makefile \u4e2d\u7684\u6307\u7eb9\u68c0\u6d4b\u4ee3\u7801\"\n ) \n- \u6e05\u7406\uff1a```sh make clean```\u3002\n - \u5c06\u7f16\u8bd1\u4ea7\u7269\u3001Slurm \u811a\u672c\u4ea7\u751f\u7684\u8f93\u51fa\u6587\u4ef6\u5168\u90e8\u6e05\u9664\u3002\n\n\u5176\u4e2d ```sh make run``` \u5b9e\u9645\u8c03\u7528\u4e86 ```sh matmul.slurm.run``` \u811a\u672c\uff0c\u5982 @code:script-code \u6240\u793a\u3002\n\n#figure(\n sourcecode(\n raw(read(\"matmul/matmul.slurm.run\"), lang: \"bash\"),\n ),\n caption: \"\u77e9\u9635\u4e58\u6cd5\u8fd0\u884c\u811a\u672c\",\n) \n\n== \u5b9e\u9a8c\u5e73\u53f0\u4fe1\u606f \n\n\u672c\u5b9e\u9a8c\u6240\u5904\u5e73\u53f0\u4e3a\u5317\u822a\u6821\u7ea7\u8ba1\u7b97\u5e73\u53f0\uff0c\u7cfb\u7edf\u914d\u7f6e 260 \u4e2a CPU \u8ba1\u7b97\u8282\u70b9\uff0c\u6bcf\u4e2a\u8282\u70b9\u914d\u7f6e 2 \u9897 Intel Golden 6240 \u7cfb\u5217\u5904\u7406\u5668\uff08\u5171 36 \u7269\u7406\u6838\uff09\u3001384 GB \u5185\u5b58\u3002\u6240\u6709\u8282\u70b9\u901a\u8fc7 100Gb/s EDR Infiniband \u4e92\u8054\u7ec4\u6210\u8ba1\u7b97\u548c\u5b58\u50a8\u7f51\u7edc\u3002\u7cfb\u7edf\u4f7f\u7528 Slurm \u4f5c\u4e3a\u4f5c\u4e1a\u8c03\u5ea6\u7cfb\u7edf\u3002\n" }, { "repo": "https://github.com/ivaquero/typst-fasvg", "file": "https://raw.githubusercontent.com/ivaquero/typst-fasvg/main/README.md", "language": "markdown", "license": "MIT License", "content": "# Typst-FASVG\n\n![code size](https://img.shields.io/github/languages/code-size/ivaquero/typst-fasvg.svg)\n![repo size](https://img.shields.io/github/repo-size/ivaquero/typst-fasvg.svg)\n\nOffline [FontAwesome](https://fontawesome.com/) Binding for [Typst](https://typst.app/docs/).\n\n## Usage\n\n1. Download the fasvg latest desktop version from [FontAwesome Official Site](https://github.com/FortAwesome/Font-Awesome/releases), unzip it into your workspace folder, and rename it as `fasvg`.\n2. Download the `fasvg.typ` file, and place it into your workspace folder as well.\n3. Import it into your Typst file, and use it with `fa()` function like the following example\n\n```typst\n#import \"fasvg\": *\n\n#fa(\"brand-amazon-pay\")\n```\n\nYou can also customize the icon like this\n\n```typst\n#import \"fasvg\": *\n\n#fa(\n \"brand-amazon-pay\",\n baseline: 0.25em,\n height: 1.0em,\n width: 1.5em)\n```\n\nCheckup [manual](https://github.com/ivaquero/typst-fasvg/blob/main/manual.pdf) for more details.\n\n![demo](demo.png)\n\n## Changelog\n\n### v0.1.0 (2023-08-28)\n\n- update fasvg to v6.5.1\n\n### v0.0.4 (2023-08-28)\n\n- change naming pattern\n\n### v0.0.3 (2023-08-16)\n\n- update fasvg to v6.4.2\n- change naming pattern\n\n### v0.0.2 (2023-07-28)\n\n- update structures\n- enable customization\n\n### v0.0.1 (2023-07-27)\n\n- initial release\n- add fasvg v6.4.0\n" }, { "repo": "https://github.com/Enter-tainer/typstyle", "file": "https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/typstfmt/82-non-converge-list.typ", "language": "typst", "license": "Apache License 2.0", "content": "#let f(t) = t\nWe have next things:\n- thing 1;\n- thing 2;\n- thing 3.\n\n#f[Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri.]\n" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/block-01.typ", "language": "typst", "license": "Other", "content": "// Nothing evaluates to none.\n#test({}, none)\n\n// Let evaluates to none.\n#test({ let v = 0 }, none)\n\n// Evaluates to single expression.\n#test({ \"hello\" }, \"hello\")\n\n// Evaluates to string.\n#test({ let x = \"m\"; x + \"y\" }, \"my\")\n\n// Evaluated to int.\n#test({\n let x = 1\n let y = 2\n x + y\n}, 3)\n\n// String is joined with trailing none, evaluates to string.\n#test({\n type(\"\")\n none\n}, \"string\")\n\n" }, { "repo": "https://github.com/pku-typst/meppp", "file": "https://raw.githubusercontent.com/pku-typst/meppp/main/lib.typ", "language": "typst", "license": "MIT License", "content": "#import (\"table.typ\"): meppp-tl-table\n#import (\"template.typ\"): meppp-lab-report\n#let pku-logo(..args) = image(\"pkulogo.png\", ..args)\n\n#let subfigure(\n body,\n caption: none,\n numbering: \"(a)\",\n inside: true,\n dx: 10pt,\n dy: 10pt,\n boxargs: (fill: white, inset: 5pt),\n alignment: top + left,\n) = {\n let lsa = counter(\"last-subfigure-at\")\n let sc = counter(\"subfigure-counter\")\n context if lsa.get() != counter(figure).get() {\n sc.update((1,))\n lsa.update(counter(figure).get())\n } else {\n sc.step()\n }\n let number = context sc.display(numbering)\n body\n if (inside) {\n place(alignment, box([#number #caption], ..boxargs), dx: dx, dy: dy)\n } else {\n linebreak()\n align(center, [#number #caption])\n }\n}" }, { "repo": "https://github.com/dssgabriel/master-thesis", "file": "https://raw.githubusercontent.com/dssgabriel/master-thesis/main/src/chapters/5-bibliography.typ", "language": "typst", "license": "Apache License 2.0", "content": "#show bibliography: set heading(numbering: \"1.\")\n#bibliography(\"../references.bib\", style: \"ieee\")\n" }, { "repo": "https://github.com/MatheSchool/typst-g-exam", "file": "https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/src/g-exam.typ", "language": "typst", "license": "MIT License", "content": "#import \"@preview/oxifmt:0.2.0\": strfmt\n#import \"./global.typ\" : *\n#import \"./auxiliary.typ\": *\n#import \"./g-question.typ\": *\n#import \"./g-option.typ\": *\n#import \"./g-solution.typ\": *\n#import \"./g-clarification.typ\": *\n#import \"./g-sugar.typ\": *\n\n/// Template for creating an exam.\n/// \n/// - author: Infomation of author of exam.\n/// - name (string, content): Name of author of exam.\n/// - email (string): E-mail of author of exam.\n/// - watermark (string): Watermark with information about the author of the document.\n/// - school: Information of school.\n/// - name (string, content): Name of the school or institution generating the exam.\n/// - logo (none, content, bytes): Logo of the school or institution generating the exam.\n/// - exam-info: Information of exam.\n/// - academic-period (none, content, str): Academic period.\n/// - academic-level (none, content, str): Academic level.\n/// - academic-subject (none, content, str): Academic subname.\n/// - number (none, content, str): Number of exam.\n/// - content (none, content, str): Content of exam.\n/// - model (none, content, str): Model of exam.\n/// - date (none, auto, datetime): Date of generate document.\n/// - keywords (string): Keywords of document.\n/// - language (en, es, de, fr, pt, it, nl): Language of document. English, Spanish, German, French, Portuguese and Italian are defined.\n/// - clarifications (string, content, array): Clarifications of exam. It will appear in a box on the first page.\n/// - question-text-parameters: Parameter of text in question and subquestion. For example, it allows us to change the text size of the questions.\n/// - show-student-data (none, true, false, \"first-page\", \"all-pages\", \"odd-pages\"): Show a box for the student to enter their details. It can appear on the first page, all pages or on all odd-numbered pages.\n/// - show-grade-table: (bool): Show the grade table.\n/// - decimal-separator: (\".\", \",\"): Indicate the decimal separation character.\n/// - question-points-position: (none, left, right): Position of question points.\n/// - show-solution: (true, false, \"space\", \"spacex2\", \"spacex3\"): Show the solutions.\n/// - show-draft: (true, false): It shows a draft label in the background.\n#let g-exam(\n author: (\n name: \"\",\n email: none,\n watermark: none\n ),\n school: (\n name: none,\n logo: none,\n ),\n exam-info: (\n academic-period: none,\n academic-level: none,\n academic-subject: none,\n number: none,\n content: none,\n model: none\n ),\n language: \"en\",\n localization: (\n grade-table-queston: none,\n grade-table-total: none,\n grade-table-points: none,\n grade-table-grade: none,\n point: none,\n points: none,\n page: none,\n page-counter-display: none,\n family-name: none,\n given-name: none,\n group: none,\n date: none,\n draft-label: none,\n ),\n date: auto,\n keywords: none,\n clarifications: none,\n question-text-parameters: none,\n show-student-data: \"first-page\",\n // show-student-data: (\n // given-name: true,\n // family-name: true,\n // group: true,\n // date: true\n // ),\n show-grade-table: true,\n decimal-separator: \".\",\n question-points-position: left,\n show-solution: true,\n show-draft: false,\n body,\n) = {\n if type(show-student-data) != \"dictionary\" and type(show-student-data) != \"array\" {\n assert(show-student-data in (none, true, false, \"first-page\", \"all-pages\", \"odd-pages\"),\n message: \"Invalid show studen data\")\n }\n\n assert(question-points-position in (none, left, right),\n message: \"Invalid question point position\")\n\n assert(decimal-separator in (\".\", \",\"),\n message: \"Invalid decimal separator\")\n\n assert(show-solution in (true, false),\n message: \"Invalid show solution value\")\n\n assert(show-draft in (true, false),\n message: \"Invalid show draft value\")\n\n assert(date == none or date == auto or type(date) == \"datetime\", \n message: \"Date must be nono, auto or datetime.\"\n )\n\n set document(\n title: __document-name(exam-info: exam-info).trim(\" \"),\n author: author.name, \n date: date\n )\n\n let margin-right = 2.5cm\n if (question-points-position == right) {\n margin-right = 3cm\n }\n\n set page(\n margin: (top: 5cm, right:margin-right),\n numbering: \"1 / 1\",\n number-align: right,\n header-ascent: 20%,\n\n header: {\n context{\n let __page-number = counter(page).at(here()).first()\n\n __show-header(\n page-number: __page-number,\n school: school, \n exam-info: exam-info, \n show-student-data: show-student-data)\n }\n },\n\n background: {\n __show-draft(draft-show: show-draft, draft-label:[draft])\n },\n\n footer: {\n context {\n line(length: 100%, stroke: 1pt + gray) \n align(right)[\n #counter(page).display(__g-localization.final().page-counter-display, both: true,\n )\n ]\n // grid(\n // columns: (1fr, 1fr, 1fr),\n // if type(school) == \"dictionary\" {\n // align(left, school.at(\"name\", default : none))\n // },\n // align(center)[#exam-info.academic-period],\n // align(right)[\n // P\u00e1gina \n // #counter(page).display({\n // \"1 de 1\"},\n // both: true,\n // )\n // ]\n // )\n\n __show-watermark(author: author, school: school, exam-info: exam-info, question-points-position:question-points-position)\n }\n }\n ) \n\n __read-localization(language: language, localization: localization)\n __g-question-points-position-state.update(u => question-points-position)\n __g-question-text-parameters-state.update(question-text-parameters)\n\n set text(lang:language)\n\n if show-grade-table == true {\n context {\n __g-grade-table-header(\n decimal-separator: decimal-separator,\n )\n }\n v(10pt)\n }\n\n __g-show-solution.update(show-solution)\n\n __g-decimal-separator.update(decimal-separator)\n\n set par(justify: true) \n\n if clarifications != none {\n __g-show_clarifications(clarifications: clarifications)\n }\n\n show: __sugar\n\n body\n \n [#hide[]]\n [#hide[]]\n}\n" }, { "repo": "https://github.com/DaAlbrecht/thesis-TEKO", "file": "https://raw.githubusercontent.com/DaAlbrecht/thesis-TEKO/main/content/Task_analysis.typ", "language": "typst", "license": "", "content": "#import \"@preview/tablex:0.0.5\": tablex, cellx\n#let appendix = figure.with(kind: \"appendix\", numbering: \"A\", supplement: [Appendix])\n\nHere, we'll cover the initial context resulting from the assignment available @a_assignment \n\n== Task description\n\nMultiple customers of Integon rely upon RabbitMQ as their designated messaging\nbroker. Different systems write messages into a queue, the messages then need to be\nprocessed by other systems. If for some reason a specific message should be\nprocessed again, the owner of the processing system cannot retry\nprocessing the message because the messages are not persistent, once consumed the message is gone. Said owner has to contact the owner of the sending\nsystem and ask for a retransmission of the message. This is a time-consuming and\ncostly process. The goal of this thesis is to develop a microservice that allows\nqueueing messages again, without needing to contact the owner of the sending system.\nThe queuing should be possible via an API call.\n\n=== Out of scope\n\nThe goal is to also embed the microservice into already existing observability\nsystems to enable requeuing of messages via UI. This is beyond the scope of this\nthesis and will be implemented in a follow-up project.\n\n== Initial situation\n\nThe microservice needs to be developed from scratch. There is no existing\narchitecture or codebase to build upon.\n\n" }, { "repo": "https://github.com/Besthope-Official/backend", "file": "https://raw.githubusercontent.com/Besthope-Official/backend/master/24autumn/git-tutorial.typ", "language": "typst", "license": "", "content": "#import \"@preview/cuti:0.2.1\": show-cn-fakebold\n#import \"@preview/cetz:0.2.2\"\n#show: show-cn-fakebold\n\n#let title = [\u7248\u672c\u63a7\u5236\u7cfb\u7edf Git]\n#let header = [\u540e\u7aef\u90e8\u5f00\u53d1\u6587\u6863]\n#set text(font: (\"Source Han Serif SC\"))\n#set page(\n header: [#set text(12pt); #align(right + horizon, header)],\n background: image(\"images/backend_logo_opacity_0.25.png\", fit: \"cover\", width: 30%),\n numbering: \"1\",\n number-align: right,\n)\n#show link: underline\n\n// CONTENTS\n\n#align(center, text(20pt)[\n *#title*\n])\n\n== \u7248\u672c\u63a7\u5236\u7cfb\u7edf\n\n*\u7248\u672c\u63a7\u5236\u7cfb\u7edf* (Version Control Systems, VCSs) \u662f\u4e00\u7c7b\u7528\u4e8e\u8ffd\u8e2a\u6e90\u4ee3\u7801\uff08\u6216\u5176\u4ed6\u6587\u4ef6\u3001\u6587\u4ef6\u5939\uff09\u6539\u52a8\u7684\u5de5\u5177\u3002\u987e\u540d\u601d\u4e49\uff0c\u8fd9\u4e9b\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u7ba1\u7406\u4ee3\u7801\u7684\u4fee\u6539\u5386\u53f2\uff1b\u4e0d\u4ec5\u5982\u6b64\uff0c\u5b83\u8fd8\u53ef\u4ee5\u65b9\u4fbf\u56e2\u961f\u534f\u4f5c\u7f16\u7801\u3002\n\n\u4f8b\u5982\uff0c\u5728\u5b9e\u9645\u9879\u76ee\u5f00\u53d1\u4e2d\u7684\u4e00\u4e9b\u573a\u666f\uff1a\n\n- \u9700\u8981\u67e5\u770b\u5f53\u524d\u7248\u672c\u548c\u4e0a\u4e00\u7248\u672c\u4e4b\u95f4\u7684*\u5dee\u5f02*\n - \u66f4\u7ec6\u8282\u7684\uff1a\u8fd9\u4e2a\u6587\u4ef6\u7684\u8fd9\u4e00\u884c\u662f\u4ec0\u4e48\u65f6\u5019\u88ab\u7f16\u8f91\u7684\uff1f\u662f\u8c01\u4f5c\u51fa\u7684\u4fee\u6539\uff1f\u4fee\u6539\u539f\u56e0\u662f\u4ec0\u4e48\uff1f\n- \u5f53\u524d\u7248\u672c\u4e0a\u7ebf\u51fa\u73b0\u4e25\u91cd bug\uff0c\u9700\u8981*\u56de\u9000*\u5230\u4e0a\u4e00\u7248\u672c\n - \u8fd8\u9700\u8981\u77e5\u9053\uff1a\u5728\u54ea\u4e00\u4e2a\u7248\u672c\u5feb\u7167\u5bfc\u81f4\u4e86\u5355\u5143\u6d4b\u8bd5\u5931\u8d25\uff1f\n\n\u7248\u672c\u63a7\u5236\u662f\u9879\u76ee\u7ba1\u7406\u7684\u4e00\u5927\u5173\u952e\u3002\u5b9e\u8df5\u4e2d\uff0c\u6211\u4eec\u4f1a\u4f7f\u7528\u6700\u5e38\u7528\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177 *Git* \u6765\u7ba1\u7406\u4ee3\u7801\uff1a\u5b83\u662f\u4e00\u4e2a*\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf*\uff0c\u5ba2\u6237\u7aef\u5e76\u4e0d\u53ea\u63d0\u53d6\u6700\u65b0\u7248\u672c\u7684\u6587\u4ef6\u5feb\u7167\uff0c\u800c\u662f\u628a\u4ee3\u7801\u4ed3\u5e93\u5b8c\u6574\u5730*\u514b\u9686*\u4e0b\u6765\uff0c\u5305\u62ec\u5b8c\u6574\u7684\u5386\u53f2\u8bb0\u5f55\u3002\n\n#figure(image(\"images/dvcs.png\", width: 50%), caption: \"\u5206\u5e03\u5f0fVCS\u7684\u4e00\u4e2a\u4f18\u52bf\u662f\uff0c\u5c31\u7b97\u4e2d\u5fc3\u670d\u52a1\u5668\u53d1\u751f\u6545\u969c\uff0c\u4e8b\u540e\u90fd\u53ef\u4ee5\u7528\u4efb\u4f55\u4e00\u4e2a\u955c\u50cf\u51fa\u6765\u7684\u672c\u5730\u4ed3\u5e93\u6062\u590d\u6570\u636e\u5e93\u5386\u53f2\u3002\")\n\n\u4f60\u53ef\u4ee5\u6307\u5b9a\u548c\u4e0d\u540c\u7684\u8fdc\u7aef\u4ed3\u5e93\u4ea4\u4e92\uff0c\u5728\u540c\u4e00\u4e2a\u9879\u76ee\u4e2d\uff0c\u5206\u522b\u548c\u4e0d\u540c\u7684\u4eba\u76f8\u4e92\u534f\u4f5c\u3002Git \u7684*\u5206\u652f*\u529f\u80fd\u975e\u5e38\u5f3a\u5927\uff0c\u5b83\u652f\u6301\u975e\u7ebf\u6027\u7684\u5f00\u53d1\u6d41\u7a0b\uff0c\u5e76\u4e14\u80fd\u591f\u6709\u6548\u5730\u7ba1\u7406\u50cf Linux \u5185\u6838\u8fd9\u6837\u5e9e\u5927\u7684\u9879\u76ee\u3002\n\n#figure(image(\"images/git-branch.svg\", width: 50%))\n\n\u603b\u800c\u8a00\u4e4b\uff0c\u5047\u82e5\u4f60\u5c06\u6765\u7684\u5de5\u4f5c\u548c\u8ba1\u7b97\u673a\u6cbe\u8fb9\uff0cGit \u7edd\u5bf9\u662f\u4f60\u79bb\u4e0d\u5f00\u7684\u5f00\u53d1\u5de5\u5177\u3002\n\n== Git \u7684\u5b9e\u73b0\n\nGit \u7684\u540e\u7aef\u5b9e\u73b0\u76f8\u5f53\u4f18\u96c5\uff0c\u867d\u7136\u5728\u7406\u89e3\u4e0a\u786e\u5b9e\u5b58\u5728\u4e00\u5b9a\u7684\u590d\u6742\u5ea6\u3002\u6211\u4eec\u4f1a\u7b80\u5355\u8bb2\u89e3\u5b83\u7684\u539f\u7406\uff0c\u4ee5\u4fbf\u5927\u5bb6\u80fd\u591f\u771f\u6b63\u4e86\u89e3 Git \u7684\u76f8\u5173\u6982\u5ff5\u3002\u5982\u679c\u4f60\u5bf9\u8fd9\u90e8\u5206\u4e0d\u611f\u5174\u8da3\uff0c\u53ef\u4ee5\u8f6c\u81f3\u4e0b\u4e00\u5c0f\u8282\u3002\n\n=== \u600e\u6837\u8bb0\u5f55\u7248\u672c\u5dee\u5f02: \u8bb0\u5f55\u5feb\u7167\n\n#let graph(data, direction: \"right\", grow, node-color: gray, show-mark: true) = {\n cetz.canvas(length: 1cm, {\n import cetz.draw: *\n set-style(content: (padding: .2),\n fill: node-color.lighten(70%),\n stroke: node-color.lighten(70%)\n )\n\n cetz.tree.tree(\n data,\n direction: direction,\n spread: 2.5,\n grow: grow,\n draw-node: (node, ..) => {\n circle((), radius: .55, stroke: none)\n content((), node.content)\n },\n draw-edge: (from, to, ..) => {\n let (a, b) = (from + \".center\", to + \".center\")\n if show-mark {\n line((a, .6, b), (b, .6, a), mark: (end: \">\"))\n } else {\n line((a, .6, b), (b, .6, a))\n }\n },\n name: \"tree\"\n )\n})\n}\n\n#let versions = ([ver 1], ([ver 2], ([ver 3], [ver 4])))\n#let A-delta = ([A],([$Delta_1$],([$Delta_2$],([$Delta_3$],))))\n#let B-delta = ([B], ([$Delta_1$],))\n#let A-git = ([A], ([$A_1$], ([$A_2$], [$A_3$])))\n#let B-git = ([B], ([B], ([B], [$B_1$])))\n\n#figure(\n grid(align: center, column-gutter: auto, \n [#graph(versions, 2.5, node-color: red, show-mark: false) #graph(A-delta, 2.5) #graph(B-delta, 7.5)]\n ), \ncaption: [\u57fa\u4e8e*\u5dee\u5f02* (delta-based) \u7684\u7248\u672c\u63a7\u5236])\n\nGit \u4e0d\u5b58\u50a8\u6bcf\u4e2a\u6587\u4ef6\u4e0e\u521d\u59cb\u7248\u672c\u7684\u5dee\u5f02\uff0c\u5047\u8bbe\u4f60\u7684\u6539\u52a8\u662f\u6dfb\u52a0\u4e86\u4e00\u884c\u6587\u672c\uff0c\u5b83\u5e76\u4e0d\u4f1a\u8bb0\u5f55\u8fd9\u884c\u65b0\u589e\u7684\u6587\u672c\u2014\u2014\u5b83\u53ea\u5b58\u50a8\u6587\u4ef6\u7684*\u5feb\u7167*\uff0c\u6bcf\u5f53\u4f60\u63d0\u4ea4\u66f4\u65b0\u6216\u4fdd\u5b58\u9879\u76ee\u72b6\u6001\u65f6\uff0c\u5b83\u57fa\u672c\u4e0a\u5c31\u4f1a\u5bf9\u5f53\u65f6\u7684*\u5168\u90e8\u6587\u4ef6*\u521b\u5efa\u4e00\u4e2a\u5feb\u7167\uff08\u526f\u672c\uff09\u5e76\u4fdd\u5b58\u8fd9\u4e2a\u5feb\u7167\u7684*\u7d22\u5f15*\u3002\n\n#figure(\n grid(align: center, column-gutter: auto, \n [#graph(versions, 2.5, node-color: red) #graph(A-git, 2.5) #graph(B-git, 2.5)]\n ), \ncaption: \"\u5b58\u50a8\u968f\u65f6\u95f4\u6539\u53d8\u7684\u5feb\u7167\")\n\n#let snapshot = (\n ([ver 1], \n [A], [B], ([ver 2],\n ([$A_1$]), [ver 3])\n )\n)\n#let demo = cetz.canvas(length: 1cm, {\n import cetz.draw: *\n let node-color = gray\n set-style(content: (padding: .2),\n fill: node-color.lighten(70%),\n stroke: node-color.lighten(70%)\n )\n\n cetz.tree.tree(\n snapshot,\n direction: \"down\",\n spread: 2.5,\n grow: 2.0,\n draw-node: (node, ..) => {\n circle((), radius: .55, stroke: none)\n content((), node.content)\n },\n draw-edge: (from, to, ..) => {\n let (a, b) = (from + \".center\", to + \".center\")\n line((a, .6, b), (b, .6, a), mark: (end: \">\"))\n },\n name: \"tree\"\n )\n let (a, b) = (\"tree.0-2\", \"tree.0-1\")\n line(stroke: (paint: node-color.lighten(70%), dash: \"dashed\"), (a, .6, b), (b, .6, a), mark: (end: \">\"))\n})\n\n\u7ed9\u6bcf\u4e2a\u7248\u672c\u505a\u5feb\u7167\u663e\u7136\u5f88\u8017\u7a7a\u95f4\uff01\u5bf9\u6b64\uff0cGit \u7684\u4f18\u5316\u662f\uff1a\u5982\u679c\u6587\u4ef6\u6ca1\u6709\u4fee\u6539\uff0c\u5c31\u4e0d\u518d\u91cd\u65b0\u5b58\u50a8\u8be5\u6587\u4ef6\uff0c\u800c\u662f\u53ea\u4fdd\u7559\u4e00\u4e2a*\u6307\u9488\uff08\u94fe\u63a5\uff09*\uff0c\u6307\u5411\u4e4b\u524d\u5b58\u50a8\u7684\u6587\u4ef6\u3002\n\n#figure(demo, caption: \"\u7531\u5feb\u7167\u6784\u6210\u7684\u5386\u53f2\u8bb0\u5f55\uff0c\u867d\u7136\u7248\u672c 2 \u6307\u5411 B\uff0c\u56fe\u4e2d\u51fa\u73b0\u4e86\u73af\u7684\u5f62\u72b6\uff0c\u4f46B\u6ca1\u6709\u5176\u5b83\u51fa\u8fb9\uff0c\u4e0d\u4f1a\u51fa\u73b0\u5faa\u73af\uff0c\u4e5f\u56e0\u6b64\u4e0d\u6784\u6210\u73af\")\n\n\u4ece\u6570\u636e\u7ed3\u6784\u7684\u89d2\u5ea6\u6765\u770b\u8fd9\u79cd\u8bbe\u8ba1\uff0c\u5386\u53f2\u8bb0\u5f55\u5c31\u6210\u4e86\u4e00\u4e2a\u7531\u5feb\u7167\u7ec4\u6210\u7684\u6709\u5411\u65e0\u73af\u56fe\u3002\u4e00\u6b21\u5feb\u7167\u5c31\u662f\u4e00\u68f5*\u6811*\uff0c\u5305\u542b\u4e86\u5168\u90e8\u7684\u6587\u4ef6\uff0c\u6bcf\u4e00\u6b21\u5feb\u7167\u66f4\u65b0\u7684*\u63d0\u4ea4*(commit)\u5305\u542b\u4e86\u4e0a\u9762\u7684\u6811\uff0c\u9644\u5e26\u4e86\u63d0\u4ea4\u4fe1\u606f\u3001\u4f5c\u8005\u3001\u65f6\u95f4\u6233\u7b49\u5143\u6570\u636e\u3002\n\n=== \u600e\u6837\u5b58\u50a8\u6587\u4ef6: \u4e00\u5207\u90fd\u662f\u5bf9\u8c61\n\n\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u6211\u4eec\u62bd\u8c61\u51fa*\u6587\u4ef6*\u7684\u6982\u5ff5\uff1a\u6211\u4eec\u901a\u8fc7\u6587\u4ef6\u8def\u5f84\u6765\u5b9a\u4f4d\u6587\u4ef6\u5143\u6570\u636e\u6240\u5728\u7684\u78c1\u76d8\u4f4d\u7f6e\uff0c\u518d\u6839\u636e\u6587\u4ef6\u7684\u5143\u4fe1\u606f\u5b9a\u4f4d\u6587\u4ef6\u5728\u786c\u76d8\u4e0a\u7684\u5177\u4f53\u4f4d\u7f6e\uff0c\u6700\u7ec8\u8bbf\u95ee\u5230\u6587\u4ef6\u7684\u5185\u5bb9\u3002\n\n\u800c Git \u6709\u7740\u72ec\u5c5e\u4e8e\u5b83\u7684\u6587\u4ef6*\u5185\u5bb9\u5bfb\u5740*\u7cfb\u7edf\u3002\u5b83\u5e76\u4e0d\u57fa\u4e8e\u6587\u4ef6\u8def\u5f84\u5bfb\u5740\uff0c\u8def\u5f84\u4e0d\u518d\u4f5c\u4e3a\u83b7\u53d6\u6587\u4ef6\u5185\u5bb9\u7684\u952e\uff0c\u800c\u6587\u4ef6*\u5185\u5bb9\u672c\u8eab\u5c31\u662f\u8fd9\u4e2a\u952e*\u3002\n\nGit \u5c06\u9879\u76ee\u6240\u6709\u53d7\u63a7\u6587\u4ef6\u5185\u5bb9\u3001\u6587\u4ef6\u7684\u72b6\u6001\u901a\u8fc7SHA1\u7b97\u6cd5\u8fdb\u884c*\u54c8\u5e0c\u5316*\u3001\u538b\u7f29\u540e\u4f5c\u4e3a Blob \u5bf9\u8c61\u5b58\u50a8\u5728 `.git\\objects` \u5185\u3002Git \u6570\u636e\u5e93\u4e2d\u4fdd\u5b58\u7684\u4fe1\u606f\u90fd\u662f\u4ee5\u6587\u4ef6\u5185\u5bb9\u7684\u54c8\u5e0c\u503c\u6765\u7d22\u5f15\uff0c\u6240\u6709\u7684\u6570\u636e\u5728\u5b58\u50a8\u524d\u90fd\u8ba1\u7b97\u6821\u9a8c\u548c\uff0c\u7136\u540e\u4ee5\u6821\u9a8c\u548c\u6765\u5f15\u7528\u3002\n\n\u6211\u4eec\u7528\u4e00\u4e2a\u5c0f\u4f8b\u5b50\u6765\u4f53\u73b0\u54c8\u5e0c\u5316\u7684\u8fc7\u7a0b\uff1a\n\n```py\n>>> import hashlib\n>>> data = 'hello git'\n>>> content = f'blob {len(data)}\\x00{data}'\n'blob 9\\x00hello git'\n>>> hashlib.sha1(content.encode()).hexdigest()\n'f09e9c379f5fe8f4ce718641c356df87906d87a6'\n$ echo -n \"hello git\" | git hash-object --stdin\nf09e9c379f5fe8f4ce718641c356df87906d87a6\n```\n\n\u5bf9\u6587\u4ef6\u540d\u3001\u76ee\u5f55\u7b49\u4fe1\u606f\u7684\u4fdd\u7559\u4f9d\u8d56\u4e8e\u5148\u524d\u63d0\u5230\u7684*\u6811*\u3002\u5047\u5982\u4f60\u7684\u6700\u65b0\u63d0\u4ea4\u4e2d\u66f4\u6539\u4e86\u4e00\u4e2a\u6587\u4ef6\u7684\u6587\u4ef6\u540d\uff0c\u800c\u6ca1\u6709\u6539\u53d8\u5b83\u7684\u5185\u5bb9\uff0cGit \u4e0d\u4f1a\u6dfb\u52a0\u65b0\u7684 Blob \u5bf9\u8c61\uff0c\u800c\u53ea\u4f1a\u66f4\u6539\u6811\u5bf9\u8c61\u4e2d\u6307\u5411\u8fd9\u4e2a Blob \u5bf9\u8c61\u7684\u540d\u79f0\u3002\n\n\u6811\u3001\u63d0\u4ea4\uff08\u4ee5\u53ca\u6807\u8bb0\uff09\u8fd9\u4e9b\u5143\u6570\u636e\u4e5f\u662f Git \u5bf9\u8c61\uff0c\u540c\u6837\u4f1a\u7ecf\u8fc7\u54c8\u5e0c\u5316\u540c\u6587\u4ef6\u4e00\u8d77\u5b58\u5165 `objects` \u76ee\u5f55\u4e0b\u3002\u6b63\u56e0\u4e3a\u5b83\u4eec\u5171\u540c\u7ee7\u627f\u201c\u5bf9\u8c61\u201d\u7684\u7edf\u4e00\u63a5\u53e3\uff0c\u5173\u8054\u8fd9\u4e9b\u6982\u5ff5\u53ea\u9700\u8981\u63d0\u4f9b\u54c8\u5e0c\u7d22\u5f15\u3002\n\n#figure(image(\"images/data-model-3.png\", width: 85%), caption: [Git \u5bf9\u8c61\u6a21\u578b\u793a\u4f8b\uff0c\u7b2c\u4e09\u6b21\u63d0\u4ea4\u7684\u5feb\u7167\u6dfb\u52a0\u4e86 `bak/test.txt`\uff0c\u5185\u5bb9\u548c\u6587\u4ef6\u540d\u548c\u521d\u6b21\u63d0\u4ea4\u4e00\u6837\u3002Git \u4e0d\u4f1a\u6dfb\u52a0\u65b0\u7684 Blob \u5bf9\u8c61\uff0c\u53ea\u9700\u4ee4\u5176\u5f15\u7528\u7b2c\u4e00\u6b21\u63d0\u4ea4\u7684\u6811\u5bf9\u8c61\u5373\u53ef\u3002])\n\n\u7b80\u6d01\u800c\u53c8\u9ad8\u6548\u7684\u8bbe\u8ba1\u3002\n\n=== \u600e\u6837\u8bbe\u7f6e\u5206\u652f: \u5f15\u7528\n\n\u73b0\u5728\uff0c\u6240\u6709\u7684\u5feb\u7167\u90fd\u53ef\u4ee5\u901a\u8fc7\u5b83\u4eec\u7684 SHA-1 \u54c8\u5e0c\u503c\u6765\u5f15\u7528\uff0c\u4e0d\u8fc7\u6211\u4eec\u5e76\u4e0d\u9700\u8981\u8bb0\u4f4f\u8fd9\u4e00\u4e32\u4e32 40 \u4f4d\u7684\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u3002Git \u652f\u6301\u77ed\u54c8\u5e0c\uff0c\u4e5f\u652f\u6301\u5bf9\u54c8\u5e0c\u503c\u505a*\u522b\u540d*(alias)\uff0c*\u6807\u8bb0*(tag)\u5feb\u7167\u53f7\uff1a\n\n```bash\n$ git tag -a v0.1.0 4892c7dc -m 'version 0.1.0 released'\n```\n\n\u4e4b\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u7528 `v0.1.0` \u66f4\u4fbf\u4e8e\u4eba\u7c7b\u8bb0\u5fc6\u7684\u7f16\u53f7\u6765\u5f15\u7528\u8fd9\u4e2a\u5feb\u7167\u53f7\u4e86\u3002\n\nGit \u5185\u90e8\u7ef4\u62a4*\u5f15\u7528*(reference)\u4f7f\u5f97\u67d0\u4e00\u9879\u522b\u540d\u53ef\u4ee5\u6307\u5411\u6700\u65b0\u7684\u63d0\u4ea4\uff0c\u5f53\u524d\u6240\u5728\u4f4d\u7f6e\u4f1a\u7528\u4e00\u4e2a\u7279\u6b8a\u7684 `HEAD` \u7d22\u5f15\u6807\u8bb0\u3002\n\n#figure(image(\"images/head-to-master.png\", width: 65%), caption: [\u4f8b\u5982\uff0c`master` \u5f15\u7528\u901a\u5e38\u4f1a\u6307\u5411\u4e3b\u5206\u652f\u7684\u6700\u65b0\u4e00\u6b21\u63d0\u4ea4\uff0c\u6b64\u65f6 `HEAD` \u5f15\u7528\u6307\u5411 `master`\u3002])\n\n\u521b\u5efa*\u5206\u652f*\u5176\u5b9e\u5c31\u662f\u65b0\u5efa\u4e00\u4e2a\u5f15\u7528\uff0c\u5206\u652f\u5207\u6362\u53ea\u9700\u8981\u6539\u53d8 `HEAD` \u6587\u4ef6\u5185\u5206\u652f\u7684\u6307\u5411\uff0c\u800c\u5206\u652f\u5408\u5e76\uff08merge\uff09\u5219\u662f\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4\u5bf9\u8c61\uff0c\u5176\u7236\u8282\u70b9\u6307\u5411\u4e24\u4e2a\u5206\u652f\u7684\u6700\u65b0\u63d0\u4ea4\uff0c\u7136\u540e\u5408\u5e76\u4e8c\u8005\u7684\u6587\u4ef6\u3002\n\n#figure(image(\"images/basic-merging-2.png\"), caption: \"\u5206\u652f\u5f00\u53d1\u7684\u4e00\u4e2a\u573a\u666f\u3002\u4e3a\u4e86\u89e3\u51b3\u51fa\u73b0\u7684 bug\uff0c\u4f60\u5728\u4e3b\u5206\u652f\u4e4b\u4e0a\u65b0\u5efa\u4e86\u4e00\u6761 iss53 \u5206\u652f\uff0c\u5728\u4fee\u6b63\u4e86\u95ee\u9898#53\u540e\uff0c\u4f60\u5728\u4e3b\u5206\u652f\u5c06\u5176\u5408\u5e76\u3002\")\n\n=== \u603b\u7ed3\n\nTL;DR: Git \u4ee5*\u5feb\u7167*\u7684\u5f62\u5f0f\u8bb0\u5f55\u7248\u672c\u5dee\u5f02\uff0c\u5c06\u8981\u5b58\u50a8\u4e8e\u4ed3\u5e93\u7684\u6570\u636e\u62bd\u8c61\u4e3a*\u5bf9\u8c61*\uff0c\u5177\u4f53\u6765\u8bf4\uff1aBlob \u4fdd\u5b58\u4e86\u6587\u4ef6\u5185\u5bb9\uff0c*\u6811*\u4fdd\u5b58\u4e86\u76ee\u5f55\u7ed3\u6784\u548c\u6587\u4ef6\u540d\uff0c*\u63d0\u4ea4*\u4fdd\u5b58\u4e86\u4e00\u6b21\u5feb\u7167\u7684\u63d0\u4ea4\u4fe1\u606f\u3001\u4f5c\u8005\u3001\u65f6\u95f4\u6233\u7b49\u5143\u6570\u636e\u3002\u5bf9\u8c61\u6839\u636e\u5176\u5185\u5bb9\u7684*\u54c8\u5e0c\u503c*\u8fdb\u884c\u7d22\u5f15\u3001\u5173\u8054\u3002\u540c\u65f6\uff0cGit \u5185\u90e8\u7ef4\u62a4*\u5f15\u7528*\uff0c\u5141\u8bb8\u7528\u4e00\u4e2a\u66f4\u7528\u6237\u53cb\u597d\u7684\u522b\u540d\u6765\u6307\u5411\u6700\u65b0\u7684\u63d0\u4ea4\u8bb0\u5f55\uff0c\u4f7f\u5f97\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u5f3a\u5927\u7684*\u5206\u652f*\u64cd\u4f5c\u3002\u5728\u8fd9\u79cd\u7b80\u6d01\u7684\u8bbe\u8ba1\u4e4b\u4e0b\uff0cGit \u7684\u64cd\u4f5c\u5c31\u662f\u5bf9\u4e00\u4e9b\u201c\u5bf9\u8c61\u201d\u548c\u201c\u5f15\u7528\u201d\u7684*\u56fe\u64cd\u4f5c*\u3002\n\n== \u4f7f\u7528 Git\n\n=== \u5b89\u88c5\u4e0e\u914d\u7f6e\n\n\u5f53\u524d Git \u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u4e3a 2.47.0\u3002\u7528 `git --version` \u67e5\u770b\u4f60\u7684\u7cfb\u7edf\u4e0a\u662f\u5426\u5b89\u88c5\u4e86 Git\u3002\n\n- \u5bf9\u4e8eWindows \u7528\u6237\uff0c#link(\"https://gitforwindows.org/\")[\u4e0b\u8f7d\u5730\u5740]\u3002\u5982\u679c\u65e0\u6cd5\u4e0b\u8f7d\uff0c\u5c1d\u8bd5\u79d1\u5b66\u4e0a\u7f51\u6216#link(\"https://mirrors.tuna.tsinghua.edu.cn/github-release/git-for-windows/git/\")[\u6e05\u534e\u955c\u50cf]\u3001#link(\"https://registry.npmmirror.com/binary.html?path=git-for-windows/\")[\u963f\u91cc\u955c\u50cf]\uff1a\n- \u5bf9\u4e8e MacOS \u7528\u6237\uff0cGit \u901a\u5e38\u662f\u7cfb\u7edf\u81ea\u5e26\u7684\u5de5\u5177\uff1b\u5982\u679c\u6ca1\u6709\u53ef\u4ee5\u5c1d\u8bd5\u4e0b\u9762\u8fd9\u4e2a\u56fe\u5f62\u5316\u7684 Git #link(\"http://sourceforge.net/projects/git-osx-installer/\")[\u5b89\u88c5\u5de5\u5177]\uff0c\u6216\u8005\u5c1d\u8bd5 `homebrew` \u5b89\u88c5\uff08\u5b66\u4e60\u4e0b\u88c5\u4e00\u4e2a\u5305\u7ba1\u7406\u5de5\u5177\uff09\u3002\n- \u5bf9\u4e8e Linux \u7528\u6237\uff0c\u6839\u636e\u4f60\u7cfb\u7edf\u7684\u53d1\u884c\u7248\u5b89\u88c5\u5305\u7ba1\u7406\u5668\u5b89\u88c5 Git\u3002\n - \u4f8b\u5982 Ubuntu/Debian\uff1a`sudo apt-get install git`\n\n\u6211\u4eec\u5bf9 Windows \u5b89\u88c5\u5305\u989d\u5916\u505a\u4e00\u4e9b\u8bf4\u660e\uff1a\u901a\u5e38\u6765\u8bf4\u6309\u7167\u9ed8\u8ba4\u8bbe\u7f6e\u5b89\u88c5 Git \u5373\u53ef\uff0c\u4f46\u9700\u8981\u7a0d\u5fae\u6ce8\u610f\u4e00\u4e9b\u4e2a\u6027\u5316\u7684\u8bbe\u7f6e\uff08\u5982\u6362\u884c\u7b26\u3001\u7f16\u8f91\u5668\uff09\u3002\u6211\u4eec\u5efa\u8bae\u4f60\u53c2\u8003\u8fd9\u7bc7#link(\"https://blog.csdn.net/mukes/article/details/115693833\")[\u6587\u7ae0]\u6765\u8f85\u52a9\u4f60\u51b3\u7b56\u3002\n\n\u5b89\u88c5\u4e86 Git \u4e4b\u540e\uff0c\u5728 shell \u91cc\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u914d\u7f6e\u4f60\u7684\u7528\u6237\u540d\u548c\u90ae\u7bb1\u3002\u53c2\u8003\u8fd9\u7bc7#link(\"https://git-scm.com/book/zh/v2/%e8%b5%b7%e6%ad%a5-%e5%88%9d%e6%ac%a1%e8%bf%90%e8%a1%8c-Git-%e5%89%8d%e7%9a%84%e9%85%8d%e7%bd%ae\")[\u6587\u7ae0]:\n\n```bash\ngit config --global user.name \ngit config --global user.email \n```\n\n=== Git \u63a5\u53e3\n\n\u5728\u5b66\u4e60 Git \u63a5\u53e3\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6765\u4e86\u89e3\u4e00\u4e0b Git \u6587\u4ef6\u7684\u72b6\u6001\uff1a\n\n- *\u672a\u8ddf\u8e2a*(Untracked)\uff1aGit \u5c1a\u672a\u8ddf\u8e2a\u7684\u6587\u4ef6\uff0c\u5373\u8fd8\u6ca1\u6709\u7eb3\u5165\u7248\u672c\u7ba1\u7406\u7684\u6587\u4ef6\u3002\n- *\u5df2\u4fee\u6539*(Modified)\uff1a\u4fee\u6539\u4e86\u6587\u4ef6\uff0c\u4f46\u8fd8\u6ca1\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u4e2d\u3002\n- *\u5df2\u6682\u5b58*(Staged/Added)\uff1a\u5bf9\u4e00\u4e2a\u5df2\u4fee\u6539\u6587\u4ef6\u7684\u5f53\u524d\u7248\u672c\u505a\u4e86\u6807\u8bb0\uff0c\u4f7f\u4e4b\u5305\u542b\u5728\u4e0b\u6b21\u63d0\u4ea4\u7684\u5feb\u7167\u4e2d\u3002\n- *\u5df2\u63d0\u4ea4*(Committed)\uff1a\u6570\u636e\u5df2\u7ecf\u5b89\u5168\u5730\u4fdd\u5b58\u5728\u672c\u5730\u6570\u636e\u5e93\u4e2d\u3002\n\n\u8fd9\u4f1a\u8ba9\u6211\u4eec\u7684 Git \u9879\u76ee\u62e5\u6709\u4e09\u4e2a\u9636\u6bb5\uff1a\u5de5\u4f5c\u533a\u3001\u6682\u5b58\u533a\u4ee5\u53ca Git \u76ee\u5f55\u3002\n\n#figure(image(\"images/areas.png\", width: 75%), caption: [\u5728\u4e00\u6b21\u63d0\u4ea4\u4e2d\uff0c\u9009\u4e2d\u63d0\u4ea4\u7684\u6587\u4ef6\u4f1a\u4ece\u5de5\u4f5c\u533a\u8bb0\u5f55\u5230\u6682\u5b58\u533a\u3001\u6700\u540e\u7ecf\u54c8\u5e0c\u5bf9\u8c61\u5316\u5b58\u653e\u5230 `.git` \u76ee\u5f55\u4e0b])\n\n\u521b\u5efa\u4e00\u6b21 `commit` \u7684\u6d41\u7a0b\u5982\u4e0b\uff1a\n\n- \u5728\u5de5\u4f5c\u533a\u4e2d\u4fee\u6539\u6587\u4ef6\u3002\n- \u5c06\u4f60\u60f3\u8981\u4e0b\u6b21\u63d0\u4ea4\u7684\u66f4\u6539\u9009\u62e9\u6027\u5730\u6682\u5b58\uff0c\u8fd9\u6837\u53ea\u4f1a\u5c06\u66f4\u6539\u7684\u90e8\u5206\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u3002(`git add`)\n- \u63d0\u4ea4\u66f4\u65b0\uff0c\u627e\u5230\u6682\u5b58\u533a\u7684\u6587\u4ef6\uff0c\u5c06\u5feb\u7167\u6c38\u4e45\u6027\u5b58\u50a8\u5230 Git \u76ee\u5f55\u3002(`git commit`)\n\n\u4e3a\u4ec0\u4e48\u8981\u5f15\u5165\u6682\u5b58\u533a\u8fd9\u4e2a\u770b\u4f3c\u591a\u4f59\u7684\u6b65\u9aa4\uff1f\u60f3\u8c61\u4e00\u4e0b\uff0c\u5f53\u4f60\u5f00\u53d1\u4e86\u4e24\u4e2a\u72ec\u7acb\u7684\u7279\u6027\uff0c\u5e0c\u671b\u521b\u5efa\u4e24\u4e2a\u72ec\u7acb\u7684\u63d0\u4ea4\uff0c\u8fd9\u65f6\u5019\u5c31\u53ef\u4ee5\u6709\u9009\u62e9\u5730\u8fdb\u884c\u63d0\u4ea4\u3002\n\n\u53e6\u5916\u4e00\u4e9b\u5e38\u7528\u7684\u547d\u4ee4\u884c\u64cd\u4f5c\uff1a\n\n- `git clone `: \u514b\u9686\u8fdc\u7a0b\u4ed3\u5e93\u5230\u672c\u5730\u3002\u6709\u4e9b\u8001\u5e08\u4e5f\u559c\u6b22\u7528 Git \u8fdc\u7a0b\u4ed3\u5e93\u6765\u53d1\u5e03\u4ee3\u7801\u4f5c\u4e1a\u3002\n- `git status`: \u67e5\u770b\u5f53\u524d\u4ed3\u5e93\u7684\u72b6\u6001\u3002\n- `git push`: \u5c06\u672c\u5730\u4ed3\u5e93\u7684\u66f4\u65b0\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff08\u524d\u63d0\u662f\u4f60\u5df2\u7ecf\u5173\u8054\u597d\u4e86\u8fdc\u7a0b\u4ed3\u5e93\uff09\u3002\u5f53\u4f60\u7684 IDE \u56e0\u51fa\u73b0\u7f51\u7edc\u539f\u56e0\u65e0\u6cd5\u63a8\u9001\u65f6\u53ef\u4ee5\u5c1d\u8bd5\u5728\u547d\u4ee4\u884c\u4e2d\u63a8\u9001\u3002\n- `git commit --amend`: \u7f16\u8f91\u5386\u53f2\u63d0\u4ea4\u7684 commit \u4fe1\u606f\u3002\n- `git stash`: \u6682\u65f6\u79fb\u9664\u5de5\u4f5c\u76ee\u5f55\u4e0b\u7684\u4fee\u6539\u5185\u5bb9\u3002\u8fd9\u5728\u5207\u6362\u5206\u652f\u7684\u65f6\u5019\u5f88\u6709\u7528\u3002\n\n\u6211\u4eec\u63a8\u8350\u5927\u5bb6\u9605\u8bfb\u5947\u70b9\u5148\u524d\u7f16\u5199\u7684#link(\"https://singularity-backend.gitbook.io/backend-online-doc/week1/vcs-git/interfaces\")[\u5728\u7ebf\u6587\u6863]\u6765\u5b66\u4e60\u66f4\u591a\u7684\u63a5\u53e3\u77e5\u8bc6\u3002\n\n=== IDE \u91cc\u4f7f\u7528\u56fe\u5f62\u754c\u9762\n\n\u5b66\u4e60 Git \u64cd\u4f5c\u7684\u6700\u597d\u662f\u901a\u8fc7\u547d\u4ee4\u884c\uff0c\u8fd9\u4e5f\u662f\u5b66\u4e60\u547d\u4ee4\u884c\u7684\u597d\u673a\u4f1a\u3002\n\n\u4f46\u6211\u4eec\u540c\u65f6\u63a8\u8350\u4f60\u53bb\u4e86\u89e3 IDE \u91cc\u96c6\u6210\u7684 Git \u4f7f\u7528\uff1a\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\uff0cCLI \u5e76\u4e0d\u5e38\u7528\u3002\uff08\u9664\u4e86\u67d0\u4e9b\u7279\u5b9a GUI \u4e0d\u7ba1\u7528\u7684\u573a\u666f\uff09\n\n#figure(image(\"images/ide.png\", width: 65%), caption: [VSCode \u91cc\u7684\u6e90\u4ee3\u7801\u7ba1\u7406\u754c\u9762\uff0c\u5728\u63d0\u4f9b Git \u7684\u56fe\u5f62\u5316\u754c\u9762\u64cd\u4f5c\u4ee5\u5916\uff0c\u4e5f\u63d0\u4f9b\u4e86\u5bf9\u5206\u652f\u7684\u826f\u597d\u53ef\u89c6\u5316])\n\n#pagebreak()\n\n== Git \u7684\u5de5\u4f5c\u6d41\n\n\u7531\u4e8e Git \u7684\u4f7f\u7528\u975e\u5e38\u7075\u6d3b\uff0c\u5728\u5b9e\u8df5\u5f53\u4e2d\u884d\u751f\u4e86\u5f88\u591a\u79cd\u4e0d\u540c\u7684\u5de5\u4f5c\u6d41\u7a0b\uff0c\u4e0d\u540c\u7684\u9879\u76ee\u3001\u4e0d\u540c\u7684\u56e2\u961f\u4f1a\u6709\u4e0d\u540c\u7684\u534f\u4f5c\u65b9\u5f0f\u3002\u4e0b\u9762\u5c06\u4ecb\u7ecd\u4e00\u79cd\u5728\u5404\u79cd\u5927\u5c0f\u9879\u76ee\u4e2d\u7ecf\u8fc7\u603b\u7ed3\u51fa\u6765\u7684\u5de5\u4f5c\u6d41\u3002\n\n\u5947\u70b9\u7684\u5f00\u53d1\u56e2\u961f\u53c2\u8003\u7684\u4e5f\u662f\u8fd9\u4e00\u5957\u6d41\u7a0b\u3002\n\n=== \u8fdc\u7a0b Git \u4ed3\u5e93\n\n\u6211\u4eec\u63d0\u5230\uff0cGit \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u8fd9\u610f\u5473\u7740\u6bcf\u4e2a\u5f00\u53d1\u8005\u90fd\u6709\u4e00\u4efd\u5b8c\u6574\u7684\u4ed3\u5e93\uff0c\u79f0\u4e3a*\u672c\u5730\u4ed3\u5e93*\u3002\u5b9e\u73b0\u540c\u6b65\u7684\u65b9\u5f0f\u662f\u62e5\u6709\u4e00\u4e2a\u53ef\u9760\u7684\u4e2d\u5fc3*\u8fdc\u7a0b\u4ed3\u5e93*\uff0c\u4e00\u4e2a Git \u670d\u52a1\u5668\u3002\n\n\u4e00\u4e9b\u5e38\u7528\u7684 Git \u670d\u52a1\u5668\u6709\uff1a\n\n- GitHub\uff1a\u4e00\u4e2a\u57fa\u4e8eGit\u7684\u4ee3\u7801\u6258\u7ba1\u670d\u52a1\u5e73\u53f0\uff0c\u540c\u65f6\u4e5f\u662f\u91cd\u8981\u7684\u5f00\u6e90\u793e\u533a\u3002\n- GitLab\uff1a\u7c7b\u4f3cGithub\uff0c\u4f46\u4e3b\u8981\u9762\u5411\u4f01\u4e1a\u3001\u7ec4\u7ec7\u7b49\u5185\u90e8\u4f7f\u7528\u3002\u4e5f\u53ef\u4ee5\u7528\u5b98\u65b9\u63d0\u4f9b\u7684\u955c\u50cf\u90e8\u7f72\u3002\n- Gitee\uff1a\u5177\u6709\u4e2d\u56fd\u7279\u8272\u7684\u4ee3\u7801\u6258\u7ba1\u5e73\u53f0\n\n\u5947\u70b9\u7684\u4e24\u4e2a\u5f00\u53d1\u90e8\u95e8\u76ee\u524d\u4f7f\u7528 Github \u4f5c\u4e3a #link(\"https://github.com/SingularityLab-SWUFE\")[Git \u8fdc\u7a0b\u4ed3\u5e93]\u3002\n\n=== \u5206\u5e03\u5f0f\u5f00\u53d1\n\n==== \u6e90\u4ed3\u5e93\n\n\u5728\u9879\u76ee\u7684\u5f00\u59cb\uff0c\u9879\u76ee\u7684\u53d1\u8d77\u8005\u6784\u5efa\u8d77\u4e00\u4e2a\u9879\u76ee\u7684\u6700\u539f\u59cb\u7684\u4ed3\u5e93\uff0c\u79f0\u4e3a*\u6e90\u4ed3\u5e93*\u3002\u5b83\u7684\u76ee\u7684\u662f\uff1a\n\n- \u6c47\u603b\u53c2\u4e0e\u8be5\u9879\u76ee\u7684\u5404\u4e2a\u5f00\u53d1\u8005\u7684\u4ee3\u7801\n- \u5b58\u653e\u8d8b\u4e8e\u7a33\u5b9a\u548c\u53ef\u53d1\u5e03\u7684\u4ee3\u7801\n\n==== \u5f00\u53d1\u8005\u4ed3\u5e93\n\n\u6e90\u4ed3\u5e93\u5efa\u7acb\u4ee5\u540e\uff0c\u6bcf\u4e2a\u5f00\u53d1\u8005\u9700\u8981\u505a\u7684\u4e8b\u60c5\u5c31\u662f\u628a\u6e90\u4ed3\u5e93\u7684\u201c\u590d\u5236\u201d\uff0c\u5728\u5176\u57fa\u7840\u4e4b\u4e0a `fork`(\u5206\u53c9)\u5f00\u53d1\uff0c\u4f5c\u4e3a\u81ea\u5df1\u65e5\u5e38\u5f00\u53d1\u7684\u4ed3\u5e93\u3002\n\n\u6bcf\u4e2a\u5f00\u53d1\u8005\u6240 `fork` \u7684\u4ed3\u5e93\u662f\u5b8c\u5168\u72ec\u7acb\u7684\uff0c\u4e92\u4e0d\u5e72\u6270\u3002\u800c\u5728\u5f00\u53d1\u5de5\u4f5c\u5b8c\u6210\u4ee5\u540e\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5411\u6e90\u4ed3\u5e93\u53d1\u9001 `Pull Request`(\u63a8\u9001\u8bf7\u6c42)\uff0c\u8bf7\u6c42\u7ba1\u7406\u5458\u628a\u81ea\u5df1\u7684\u4ee3\u7801\u5408\u5e76\u5230\u6e90\u4ed3\u5e93\u4e2d\u3002\n\n#figure(image(\"images/pr.png\", width: 75%), caption: [\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee #link(\"https://github.com/Qexo/Qexo\")[Qexo] \u7684 PR\uff0c\u8bb0\u5f97\u5728 PR \u91cc\u63cf\u8ff0\u6e05\u695a\u81ea\u5df1\u7684\u8d21\u732e])\n\n==== \u96c6\u6210\u4ee3\u7801\n\n\u5f53\u7136\uff0c\u591a\u6761 PR \u53ef\u80fd\u5b58\u5728\u4ee3\u7801\u51b2\u7a81\uff01\u9879\u76ee\u7ba1\u7406\u8005\u9996\u5148\u9700\u8981\u5bf9\u4ee3\u7801\u8fdb\u884c*\u4ee3\u7801\u5ba1\u9605* (code review) \u89e3\u51b3\u51b2\u7a81\u4ee5\u5916\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u68c0\u9a8c\u96c6\u6210\u540e\u4ee3\u7801\u7684\u6b63\u786e\u6027\u3002*\u81ea\u52a8\u5316\u6784\u5efa\u5de5\u5177*\u4f1a\u6839\u636e\u6d41\u7a0b\u81ea\u52a8\u7f16\u8bd1\u6784\u5efa\u5b89\u88c5\u5e94\u7528\uff0c\u5e76\u6267\u884c*\u5355\u5143\u6d4b\u8bd5\u6846\u67b6*\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u6765\u6821\u9a8c\u63d0\u4ea4\u7684\u4fee\u6539\u3002\n\n\u4e00\u4e2a\u6210\u719f\u7684\u9879\u76ee\u901a\u5e38\u5305\u542b\u5b8c\u5907\u7684*\u6301\u7eed\u96c6\u6210\u548c\u6301\u7eed\u4ea4\u4ed8* (CI/CD)\u3002\u5b83\u901a\u8fc7\u81ea\u52a8\u5316\u6d41\u7a0b\u548c\u5de5\u5177\u81ea\u52a8\u5e2e\u52a9\u9879\u76ee\u7ba1\u7406\u8005\u6784\u5efa\u5e94\u7528\u3001\u6d4b\u8bd5\u5e94\u7528\u3001\u90e8\u7f72\u5e94\u7528\u3002\n\n\u4f8b\u5982\uff0cGithub Action \u901a\u8fc7 YAML \u6587\u4ef6\u7684\u914d\u7f6e\u5b9a\u4e49\u5de5\u4f5c\u6d41\u7a0b\u4ee5\u6784\u5efa\u6267\u884c CI/CD \u6d41\u6c34\u7ebf\uff0c\u5e76\u53ef\u4ee5\u89e6\u53d1\u4e0d\u540c\u4e8b\u4ef6\u65f6\uff08\u5982 `push`\u3001`Pull Request`\uff09\u81ea\u52a8\u6267\u884c\u8fd9\u4e9b\u5de5\u4f5c\u6d41\u7a0b\u3002\n\n\u5f53\u4f60\u7684 PR \u901a\u8fc7\u4e86 CI/CD \u7684\u6d4b\u8bd5\uff0c\u4ee5\u53ca\u76f8\u5173\u7684 code review\uff0c\u9879\u76ee\u7ba1\u7406\u8005\u5c31\u53ef\u4ee5\u91c7\u7528\u5982 squash-merge \u7684\u65b9\u5f0f\u5c06\u4f60\u7684\u4ee3\u7801\u5408\u5e76\u5230\u4e3b\u5206\u652f\u3002\n\n=== \u5206\u652f\u7ba1\u7406\n\n\u79f0\u5206\u652f\u7ba1\u7406\u662f Git \u7684\u7075\u9b42\u4e5f\u4e0d\u4e3a\u8fc7\u3002\u4e0a\u9762\u6211\u4eec\u63d0\u5230\u4e86 Git \u5206\u5e03\u5f0f\u5f00\u53d1\u7684\u57fa\u672c\u6d41\u7a0b\uff0c\u4e3a\u4e86\u66f4\u597d\u5730\u5229\u7528 CI/CD \u5de5\u4f5c\u6d41\uff0c\u9879\u76ee\u56e2\u961f\u901a\u5e38\u5bf9\u5206\u652f\u7684\u547d\u540d\u548c\u6743\u9650\u7684\u7ba1\u7406\u6709\u7740\u4e00\u5b9a\u7684\u89c4\u5b9a\uff0c\u4e0b\u9762\u5c31\u4ecb\u7ecd\u4e00\u79cd\u6bd4\u8f83\u666e\u904d\u9002\u7528\u7684\u5206\u652f\u6a21\u578b\uff0c\u5728\u8fd9\u79cd\u6a21\u578b\u4e2d\uff0c\u5206\u652f\u6709\u4e24\u7c7b\uff0c\u4e94\u79cd\uff1a\n\n==== \u6c38\u4e45\u6027\u5206\u652f\n\n- `main`: \u4e3b\u5206\u652f\uff0c\u5b83\u7528\u4e8e\u5b58\u653e\u7ecf\u8fc7\u6d4b\u8bd5\uff0c\u5df2\u7ecf\u5b8c\u5168\u7a33\u5b9a\u7684\u4ee3\u7801\uff1b\u5728\u9879\u76ee\u5f00\u53d1\u4ee5\u540e\u7684\u4efb\u4f55\u65f6\u523b\u5f53\u4e2d\uff0c\u4e3b\u5206\u652f\u5b58\u653e\u7684\u4ee3\u7801\u5e94\u8be5\u662f\u53ef\u4f5c\u4e3a\u4ea7\u54c1\u4f9b\u7528\u6237\u4f7f\u7528\u7684\u4ee3\u7801\u3002\n- `develop`: \u5f00\u53d1\u5206\u652f\uff0c\u5b83\u7528\u4e8e\u5f00\u53d1\u8005\u5b58\u653e\u57fa\u672c\u7a33\u5b9a\u4ee3\u7801\u3002\n\n#figure(image(\"images/main-dev.png\", width: 50%), caption: [\u6240\u6709\u5f00\u53d1\u8005\u5f00\u53d1\u597d\u7684\u529f\u80fd\u4f1a\u5728\u6e90\u4ed3\u5e93\u7684 `develop` \u5206\u652f\u4e2d\u8fdb\u884c\u6c47\u603b\uff0c\u7ecf\u6d4b\u8bd5\u7a33\u5b9a\u540e\u6700\u540e\u5408\u5e76\u5230 `main` \u5206\u652f\u3002\u8fd9\u5c31\u662f\u4e00\u4e2a\u4ea7\u54c1\u4e0d\u65ad\u5b8c\u5584\u548c\u53d1\u5e03\u8fc7\u7a0b\u3002])\n\n*\u63d0\u793a*\uff1a\u5206\u652f\u4fdd\u62a4\u5f88\u91cd\u8981\uff0c\u4e0d\u8981\u4e3a\u4e86\u56fe\u4e00\u65f6\u7701\u4e8b\u4e0d\u5efa\u7acb\u5f00\u53d1\u5206\u652f\u6216\u968f\u610f\u5408\u5e76\u81f3\u4e3b\u5206\u652f\uff01\n\n==== \u4e34\u65f6\u6027\u5206\u652f\n\n\u4e34\u65f6\u6027\u5206\u652f\u7c7b\u4f3c\u4e8e\u5f00\u53d1\u5206\u652f\u7684\u4e00\u4e2a\u7f13\u51b2\u533a\u3002\u5728\u5f00\u53d1\u5b8c\u6bd5\u3001\u5408\u5e76\u540e\uff0c\u8fd9\u4e9b\u4e34\u65f6\u6027\u5206\u652f\u4f1a\u5f97\u5230\u5220\u9664\u3002\u901a\u5e38\u6765\u8bf4\uff0c\u5404\u4e2a\u5f00\u53d1\u8005\u4f1a\u5728 `develop` \u5206\u652f\u4e0a\u7ee7\u7eed\u5206\u53c9\u51fa\u7279\u6027\u5206\u652f `feature-*`\uff0c\u4f8b\u5982 `feature-OAuth` \u8868\u793a\u5b9e\u73b0 OAuth \u767b\u5f55\u529f\u80fd\u7684\u7279\u6027\u5206\u652f\u3002\n\n\u53e6\u5916\u4e24\u4e2a\u4e34\u65f6\u5206\u652f\u5728\u66f4\u5927\u89c4\u6a21\u7684\u56e2\u961f\u5f00\u53d1\u4e2d\u4f1a\u8fd0\u7528\u5230\uff1a\n\n- `release`: \u9884\u53d1\u5e03\u5206\u652f\uff0c\u5f53\u4ea7\u54c1\u5373\u5c06\u53d1\u5e03\u7684\u65f6\u5019\uff0c\u8981\u8fdb\u884c\u6700\u540e\u7684\u8c03\u6574\u548c\u6d4b\u8bd5\uff0c\u5c31\u53ef\u4ee5\u5f00\u51fa\u9884\u53d1\u5e03\u5206\u652f\n- `hotfix`: \u4fee\u590d bug \u5206\u652f\uff0c\u5728\u4ea7\u54c1\u4e0a\u7ebf\u4e4b\u540e\u53d1\u5e03\u70ed\u8865\u4e01\u8fdb\u884c\u7d27\u6025\u7684 bug \u4fee\u590d\u5de5\u4f5c\uff0c\u901a\u5e38\u6765\u8bf4\u7ecf\u8fc7\u6d4b\u8bd5\u540e\u4f1a\u5408\u5e76\u56de `main` \u5206\u652f\u3002\n\n#figure(image(\"images/git-model@2x.png\", width: 85%), caption: [\u6bd4\u8f83\u6807\u51c6\u7684\u5927\u578b\u9879\u76ee\u7684 Git \u5206\u652f\u6a21\u578b\u3002\u5728\u8fd9\u79cd\u89c4\u8303\u4e0b\uff0c\u5386\u53f2\u8bb0\u5f55\u770b\u8d77\u6765\u5f88\u590d\u6742\u4f46\u662f\u76f8\u5f53\u6e05\u695a\u3002])\n\n=== \u63d0\u4ea4\u6d88\u606f\u89c4\u8303\n\n\u5bf9\u5206\u652f\u89c4\u8303\u540e\uff0c\u6211\u4eec\u8fd8\u4f1a\u5bf9\u63d0\u4ea4\u6d88\u606f\u8fdb\u884c\u89c4\u8303\uff0c\u4e3b\u8981\u7684\u539f\u56e0\u662f\uff1a\n\n- \u5229\u7528\u5de5\u5177\u6765\u81ea\u52a8\u5316\u751f\u6210 CHANGELOG\uff0c\u4f8b\u5982 `cz-conventional-changelog` \u5de5\u5177\n- \u7edf\u4e00\u63d0\u4ea4\u6d88\u606f\u683c\u5f0f\uff0c\u4e0d\u5fc5\u7ea0\u7ed3\u5230\u5e95\u8be5\u600e\u4e48\u5199\u63d0\u4ea4\u6d88\u606f\n- \u65b9\u4fbf\u9879\u76ee\u66f4\u597d\u8bbe\u8ba1 CI/CD \u6d41\u7a0b\n\n#figure(image(\"images/changelog.png\", width: 65%), caption: [\u4e00\u4e2a\u597d\u7684\u5f00\u6e90\u8f6f\u4ef6\u90fd\u4f1a\u5728\u6bcf\u4e2a\u7248\u672c\u53f7\u5bf9\u63d0\u4ea4\u6216\u8005 PR \u8bb0\u5f55\u6539\u52a8\u65e5\u8bb0\uff0c\u4f8b\u5982 VSCode])\n\n\u6211\u4eec\u7684\u53c2\u8003\u662f #link(\"https://www.conventionalcommits.org/zh-hans/v1.0.0/\")[\u7ea6\u5b9a\u5f0f\u63d0\u4ea4\u89c4\u8303]\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5982\u679c\u91c7\u7528 eslint \u683c\u5f0f\u7684\u683c\u5f0f\u89c4\u8303\uff1a\n\n- \u6bcf\u4e2a\u63d0\u4ea4\u90fd*\u5fc5\u987b*\u4f7f\u7528\u7c7b\u578b\u5b57\u6bb5\u524d\u7f00\uff0c\u5982 `fix`, \u540c\u65f6\u52a0\u4e0a\u4ee5\u53ca\u5fc5\u8981\u7684\u5192\u53f7\uff08\u82f1\u6587\u534a\u89d2\uff09\u548c\u7a7a\u683c.\n- \u5f53\u4e00\u4e2a\u63d0\u4ea4\u4e3a\u5e94\u7528\u6216\u7c7b\u5e93\u5b9e\u73b0\u4e86\u65b0\u529f\u80fd\u65f6\uff0c\u4f7f\u7528 `feat` \u7c7b\u578b\uff1b\u4e3a\u5e94\u7528\u4fee\u590d\u4e86 bug \u65f6\uff0c\u4f7f\u7528 `fix` \u7c7b\u578b\u3002\n- \u7c7b\u578b\u5b57\u6bb5*\u53ef\u4ee5*\u6307\u5b9a\u8303\u56f4\uff0c\u4f8b\u5982 `fix(api)` \u6307\u660e\u662f\u5bf9\u63a5\u53e3\u4ee3\u7801\u7684\u4fee\u590d\u3002\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u4e0d\u5e26.\n- \u6bcf\u4e2a\u63d0\u4ea4*\u5fc5\u987b*\u8981\u6709\u5bf9\u63d0\u4ea4\u7684\u63cf\u8ff0\uff0c\u5bf9\u4ee3\u7801\u53d8\u66f4\u7684\u7b80\u77ed\u603b\u7ed3\u3002\u53ef\u4ee5\u4f7f\u7528\u4e2d\u6587\u3002\n- \u5728\u7c7b\u578b\u540e\u6dfb\u52a0\u611f\u53f9\u53f7\uff0c\u8868\u660e\u8fd9\u662f\u4e00\u4e2a*\u7834\u574f\u6027\u53d8\u66f4*(Breaking Change)\u3002\u5373\uff0c\u5bf9\u73b0\u6709\u529f\u80fd\u6216\u63a5\u53e3\u8fdb\u884c\u7684\u4fee\u6539\u3002\u5982\u679c\u4f60\u6539\u4e86\u63a5\u53e3\u7684\u67d0\u4e00\u4e2a\u5b57\u6bb5\uff0c\u5bfc\u81f4\u65e0\u6cd5\u517c\u5bb9\u65e7\u7248\u672c\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u52a0\u4e0a\u611f\u53f9\u53f7\u3002\n\n\u66f4\u591a\u89c4\u5219\u89c1\u4e0a\u65b9\u7ed9\u51fa\u7684\u6587\u6863\u3002\u4ee5\u4e0a\u51e0\u6761\u4f5c\u4e3a\u6211\u4eec\u7684\u5f00\u53d1\u89c4\u8303\u5c31\u591f\u7528\u4e86\u3002\n\n==== \u793a\u4f8b\n\n- `feat!: send an email to the customer when a product is shipped`\n- `docs: correct spelling of CHANGELOG`\n- `feat(lang): add polish language`\n- `feat:` \u767b\u5f55\u76f8\u5173\u63a5\u53e3\n\n\u63a8\u8350\u5927\u5bb6\u53bb\u9605\u8bfb\u6b63\u5f0f\u4e00\u4e9b\u7684\u5f00\u6e90\u9879\u76ee\u6765\u4e86\u89e3\u63d0\u4ea4\u89c4\u8303\u3002\u4f8b\u5982\uff0c\u6709\u7684\u9879\u76ee\u4f1a\u8981\u6c42\u5728 PR \u91cc\u6307\u51fa\u76f8\u5173\u7684 issue \u7f16\u53f7\uff0c\u7b49\u7b49\u3002\n\n==== \u76f8\u5173\u5de5\u5177\n\n\u4f60\u53ef\u4ee5\u5728\u7ec8\u7aef\u91cc\u4f7f\u7528 #link(\"https://cz-git.qbb.sh/zh/\")[commitizen]\uff0c#link(\"https://commitlint.js.org/\")[commitlint] \u8fd9\u4e9b\u5de5\u5177\u7701\u53bb\u624b\u6572\u524d\u7f00\u7684\u9ebb\u70e6\u3002\n\n#pagebreak()\n\n== \u53c2\u8003\u8d44\u6599\n\n\u8fd9\u7bc7\u6587\u6863\u4e3b\u8981\u53c2\u8003\u7684\u662f #link(\"https://git-scm.com/book/zh/v2\")[Pro Git]\u3002\u8bb8\u591a\u914d\u56fe\u4ee5\u53ca\u5185\u5bb9\u90fd\u6765\u81ea\u8fd9\u672c\u4e66\uff0c\u5f3a\u70c8\u63a8\u8350\u81ea\u5df1\u4eb2\u81ea\u8bfb\u4e00\u904d\u524d\u4e94\u7ae0\uff01\n\n#link(\"https://singularity-backend.gitbook.io/backend-online-doc/week1/vcs-git\")[\u5947\u70b9\u5de5\u4f5c\u5ba4\u6691\u671f\u8bad\u7ec3\u8425\u540e\u7aef\u6587\u6863]\uff1a\u8fd9\u662f\u5947\u70b9\u5728 23 \u5e74\u6691\u5047\u5f00\u5c55\u7684\u6691\u671f\u8bad\u7ec3\u8425\uff0c\u8fd9\u7bc7\u6587\u6863\u4e5f\u662f\u5728\u7ebf\u6587\u6863\u7684\u4e00\u6b21\u91cd\u7f6e\u7ffb\u65b0\u2014\u2014\u4e3b\u8981\u662f\u5bf9\u539f\u7406\u90e8\u5206\u8fdb\u884c\u4e86\u91cd\u5199\uff08\u56e0\u4e3a\u521d\u7248\u786e\u5b9e\u6709\u4e9b\u4e0d\u90a3\u4e48\u5bb9\u6613\u7406\u89e3\uff09\u3002\u5982\u679c\u4f60\u5bf9\u5176\u5b83\u90e8\u5206\u611f\u5174\u8da3\uff0c\u6b22\u8fce\u9605\u8bfb\u6587\u6863\uff01\n\n#link(\"https://missing-semester-cn.github.io/2020/version-control/\")[MIT CS\u6559\u80b2\u7f3a\u5931\u7684\u4e00\u8bfe: \u7248\u672c\u63a7\u5236(Git)]: \u6574\u4e2a Missing-semester \u8bfe\u7a0b\u90fd\u63a8\u8350\u5927\u5bb6\u5b66\u4e60, \u975e\u5e38\u597d\u7684\u4e00\u95e8\u8bfe, \u5b66\u4e60\u5230\u5f88\u591a\u597d\u7528\u7684\u5de5\u5177, \u9664\u4e86\u62d3\u5bbd\u89c6\u91ce\u66f4\u80fd\u5e2e\u52a9\u4f60\u5728\u672a\u6765\u7684\u804c\u4e1a\u751f\u6daf\u4e2d\u8282\u7701\u65f6\u95f4.\n\n#link(\"https://learngitbranching.js.org/\")[Learn Git Branching] \u901a\u8fc7\u57fa\u4e8e\u6d4f\u89c8\u5668\u7684\u6e38\u620f\u6765\u5b66\u4e60 Git.\n\n#link(\"https://nvie.com/posts/a-successful-git-branching-model/\")[A successful Git branching model]\uff1a\u6709\u5173\u5206\u652f\u5de5\u4f5c\u6d41\u7684\u6587\u7ae0\uff0c\u6587\u7ae0\u7684\u56fe 13 \u6765\u81ea\u4e8e\u6b64\u3002\n" }, { "repo": "https://github.com/Myriad-Dreamin/tinymist", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/signature/import.typ", "language": "typst", "license": "Apache License 2.0", "content": "// path: base.typ\n#let f(u, v) = u + v;\n-----\n#import \"base.typ\": *\n#(/* ident after */ f);\n" }, { "repo": "https://github.com/ohmycloud/computer-science-notes", "file": "https://raw.githubusercontent.com/ohmycloud/computer-science-notes/main/Misc/machine_learning_item.typ", "language": "typst", "license": "", "content": "= \u672f\u8bed\n\n\u4ea4\u53c9\u9a8c\u8bc1\u6298\u53e0: cross-validation folds\n\n\u81ea\u5df1\u5b9e\u73b0\u4ea4\u53c9\u9a8c\u8bc1:\n\n```python\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.base import clone\n\nskfolds = StratifiedKFold(n_splits=3) # add shuffle=True if the dataset is\n # not already shuffled\n\nfor train_index, test_index in skfolds.split(X_train, y_train_5):\n clone_clf = clone(sgd_clf)\n X_train_folds = X_train[train_index]\n y_train_folds = y_train_5[train_index]\n X_test_fold = X_train[test_index]\n y_test_fold = y_train_5[test_index]\n\n clone_clf.fit(X_train_folds, y_train_folds)\n y_pred = clone_clf.predict(X_test_fold)\n n_correct = sum(y_pred == y_test_fold)\n print(n_correct / len(y_pred))\n```\n\nStratifiedFold \u7c7b\u6267\u884c\u5206\u5c42\u62bd\u6837\u3002\u6bcf\u6b21\u8fed\u4ee3\u90fd\u521b\u5efa\u4e00\u4e2a\u5206\u7c7b\u5668\u7684\u514b\u9686, \u5728\u8bad\u7ec3\u6298\u53e0\u4e0a\u8bad\u7ec3\u514b\u9686, \u5728\u6d4b\u8bd5\u6298\u53e0\u4e0a\u505a\u9884\u6d4b\u3002\n\u7136\u540e\u5b83\u8ba1\u7b97\u6b63\u786e\u9884\u6d4b\u7684\u6570\u91cf\u5e76\u8f93\u51fa\u6b63\u786e\u9884\u6d4b\u7684\u6bd4\u7387\u3002\n\n\u4e8c\u5143\u5206\u7c7b\u5668: binary classifier\n\u53ea\u80fd\u533a\u5206\u4e24\u4e2a\u7c7b\u522b, \u8981\u4e48\u662f\u67d0\u4e2a\u7c7b\u522b\uff0c\u8981\u4e48\u4e0d\u662f\u3002\n\n\u968f\u673a\u68af\u5ea6\u4e0b\u964d: stochastic gradient descent(SGD \u6216 stochastic GD)\n\n\u8bad\u7ec3\u96c6: training set\n\u6d4b\u8bd5\u96c6: test set\n\n\u503e\u659c\u6570\u636e\u96c6: skewed datasets\n\u6bd4\u5982, \u67d0\u4e9b\u7c7b\u578b\u7684\u56fe\u7247\u6bd4\u5176\u5b83\u7c7b\u578b\u7684\u56fe\u7247\u51fa\u73b0\u5f97\u9891\u7387\u66f4\u9ad8\u3002\n\n\u6df7\u6dc6\u77e9\u9635: confusion matrix(CM)\n\u7528\u4e8e\u8bc4\u4f30\u5206\u7c7b\u5668\u6027\u80fd\u7684\u4e00\u79cd\u66f4\u597d\u7684\u65b9\u5f0f\u3002\n\u6df7\u6dc6\u77e9\u9635\u7684\u4e00\u822c\u601d\u60f3\u662f\u5bf9\u4e8e\u6240\u6709 A/B \u5bf9\u513f\uff0c\u8ba1\u7b97 A \u7c7b\u5b9e\u4f8b\u88ab\u5206\u7c7b\u4e3a B \u7c7b\u7684\u6b21\u6570\u3002\n\u4f8b\u5982\uff0c\u8981\u77e5\u9053\u5206\u7c7b\u5668\u6df7\u6dc6\u56fe\u50cf 8 \u548c \u56fe\u50cf 0 \u7684\u6b21\u6570\uff0c\u4f60\u53ef\u4ee5\u67e5\u770b\u6df7\u6dc6\u77e9\u9635\u7684\u7b2c8\u884c\u7b2c0\u5217\u3002\n\n\u8981\u8ba1\u7b97\u6df7\u6dc6\u77e9\u9635\uff0c\u4f60\u9996\u5148\u8981\u6709\u4e00\u7ec4\u9884\u6d4b\u503c\uff0c\u8fd9\u7ec4\u9884\u6d4b\u503c\u4f1a\u548c\u5b9e\u9645\u76ee\u6807\u8fdb\u884c\u6bd4\u8f83\u3002\n\n\u4f60\u53ef\u4ee5\u5bf9\u6d4b\u8bd5\u96c6\u8fdb\u884c\u9884\u6d4b\uff0c\u4f46\u662f\u73b0\u5728\u6700\u597d\u4e0d\u8981\u78b0\u6d4b\u8bd5\u96c6(\u5728\u8bad\u7ec3\u96c6\u4e0a\u8bad\u7ec3\u5b8c\u5206\u7c7b\u5668\u4e4b\u540e, \u518d\u4f7f\u7528\u6d4b\u8bd5\u96c6\u68c0\u6d4b\u8bad\u7ec3\u7684\u6548\u679c)\u3002\n\u76f8\u53cd\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 *cross_val_predict()* \u51fd\u6570\uff1a\n\n```python\nfrom sklearn.model_selection import cross_val_predict\n\ny_train_pred = cross_val_predict(sgd_clf, X_train, y_train_5, cv=3)\n```\n\n\u73b0\u5728\u53ef\u4ee5\u4f7f\u7528confusion_matrix()\u51fd\u6570\u83b7\u5f97\u6df7\u6dc6\u77e9\u9635\u4e86\u3002\u53ea\u9700\u5c06\u76ee\u6807\u7c7b(y_train_5)\u548c\u9884\u6d4b\u7c7b\u4f20\u9012\u7ed9\u5b83\n(y_train_pred):\n\n\u5c31\u50cf *cross_val_score()* \u51fd\u6570\u4e00\u6837\uff0c*cross_val_predict()* \u6267\u884c _k_-fold \u4ea4\u53c9\u9a8c\u8bc1\uff0c\u4f46\u5b83\u4e0d\u662f\u8fd4\u56de\u8bc4\u4f30\u5206\u6570\uff0c\u800c\u662f\u8fd4\u56de\u5bf9\u6bcf\u4e2a\u6d4b\u8bd5\u6298\u53e0(test fold)\u6240\u505a\u7684\u9884\u6d4b\u3002\n\u8fd9\u610f\u5473\u7740\u5bf9\u4e8e\u8bad\u7ec3\u96c6(training set)\u4e2d\u7684\u6bcf\u4e2a\u5b9e\u4f8b, \u4f60\u5f97\u5230\u4e00\u4e2a\u201c\u5e72\u51c0\u7684\u201d\u9884\u6d4b(\u8fd9\u91cc\u7684\u201c\u5e72\u51c0\u201d\u662f\u6307\u201c\u6837\u672c\u5916\u201d\uff1a\u6a21\u578b\u5bf9\u8bad\u7ec3\u671f\u95f4\u4ece\u672a\u89c1\u8fc7\u7684\u6570\u636e\u8fdb\u884c\u9884\u6d4b)\u3002\n\n\u73b0\u5728\u53ef\u4ee5\u4f7f\u7528 *confusion_matrix()* \u51fd\u6570\u83b7\u5f97\u6df7\u6dc6\u77e9\u9635\u4e86\u3002\u53ea\u9700\u8981\u628a\u76ee\u6807\u7c7b(y_train_5) \u548c\u9884\u6d4b\u7c7b(y_train_pred)\u4f20\u9012\u7ed9\u5b83\uff1a\n\n```python\nfrom sklearn.metrics import confusion_matrix\n\ncm = confusion_matrix(y_train_5, y_train_pred)\n\n# array([[53892, 687],\n# [ 1891, 3530]])\n```\n\n\u6df7\u6dc6\u77e9\u9635\u4e2d\u7684\u6bcf\u4e00\u884c\u4ee3\u8868\u4e00\u4e2a\u5b9e\u9645\u7684\u7c7b\uff0c\u800c\u6bcf\u4e00\u5217\u4ee3\u8868\u4e00\u4e2a\u9884\u6d4b\u7684\u7c7b\u3002\u8be5\u77e9\u9635\u7684\u7b2c\u4e00\u884c\u8003\u8651\u975e5\u7684\u56fe\u50cf(\u9634\u6027\u7c7b)\uff0c\u5176\u4e2d53892\u4e2a\u56fe\u50cf\u88ab\u6b63\u786e\u5206\u7c7b\u4e3a\u975e5(\u79f0\u4e3a\u771f\u9634\u6027)\uff0c\u800c\u5176\u4f59687\u4e2a\u56fe\u50cf\u88ab\u9519\u8bef\u5206\u7c7b\u4e3a5(\u5047\u9633\u6027\uff0c\u4e5f\u79f0\u4e3aI\u7c7b\u9519\u8bef)\u3002\u7b2c\u4e8c\u884c\u8003\u86515s\u7684\u56fe\u50cf(\u6b63\u7c7b):\n1891\u4f8b\u88ab\u9519\u8bef\u5730\u5f52\u7c7b\u4e3a\u975e5(\u5047\u9634\u6027\uff0c\u4e5f\u79f0\u4e3aII\u578b\u9519\u8bef)\uff0c\u800c\u5176\u4f593530\u4f8b\u88ab\u6b63\u786e\u5f52\u7c7b\u4e3a5(\u771f\u9633\u6027)\u3002\n\n\u4e00\u4e2a\u5b8c\u7f8e\u7684\u5206\u7c7b\u5668\u53ea\u4f1a\u6709\u771f\u6b63\u548c\u771f\u8d1f\uff0c\u6240\u4ee5\u5b83\u7684\u6df7\u6dc6\u77e9\u9635\u53ea\u4f1a\u5728\u4e3b\u5bf9\u89d2\u7ebf\u4e0a(\u4ece\u5de6\u4e0a\u5230\u53f3\u4e0b)\u6709\u975e\u96f6\u503c\uff1a\n\n```python\ny_train_perfect_predictions = y_train_5 # pretend we reached perfection\nconfusion_matrix(y_train_5, y_train_perfect_predictions)\n```\n\n\u5206\u7c7b\u5668\u7684\u7cbe\u786e\u5ea6:(the accuracy of the positive predictions)\n\n$\"precision\" = \"TP\" /(\"TP\" + \"FP\")$\n\nTP \u4e3a\u771f\u9633\u6027\u6570\uff0cFP \u4e3a\u5047\u9633\u6027\u6570\u3002\n\n\u8981\u60f3\u83b7\u5f97\u5b8c\u7f8e\u7684\u7cbe\u5ea6\uff0c\u4e00\u4e2a\u7b80\u5355\u7684\u65b9\u6cd5\u5c31\u662f\u521b\u5efa\u4e00\u4e2a\u5206\u7c7b\u5668\uff0c\u9664\u4e86\u5bf9\u5b83\u6700\u6709\u4fe1\u5fc3\u7684\u5b9e\u4f8b\u8fdb\u884c\u4e00\u6b21\u6b63\u5411\u9884\u6d4b\u5916\uff0c\u5b83\u603b\u662f\u8fdb\u884c\u8d1f\u5411\u9884\u6d4b\u3002\u5982\u679c\u8fd9\u4e00\u4e2a\u9884\u6d4b\u662f\u6b63\u786e\u7684\uff0c\u90a3\u4e48\u5206\u7c7b\u5668\u7684\u7cbe\u5ea6\u5c31\u662f 100%\uff08\u7cbe\u5ea6 = 1/1 = 100%\uff09\u3002\u663e\u7136\uff0c\u8fd9\u6837\u7684\u5206\u7c7b\u5668\u7528\u5904\u4e0d\u5927\uff0c\u56e0\u4e3a\u5b83\u4f1a\u5ffd\u7565\u9664\u4e86\u4e00\u4e2a\u6b63\u5411\u5b9e\u4f8b\u4e4b\u5916\u7684\u6240\u6709\u5b9e\u4f8b\u3002\u56e0\u6b64\uff0c\u7cbe\u5ea6\u901a\u5e38\u4e0e\u53e6\u4e00\u4e2a\u540d\u4e3a\u53ec\u56de\u7387(recall)\u7684\u6307\u6807\u4e00\u8d77\u4f7f\u7528\uff0c\u53ec\u56de\u7387\u4e5f\u79f0\u4e3a\u7075\u654f\u5ea6\u6216\u771f\u9633\u6027\u7387\uff08TPR\uff09\uff1a\u8fd9\u662f\u5206\u7c7b\u5668\u6b63\u786e\u68c0\u6d4b\u5230\u7684\u9633\u6027\u5b9e\u4f8b\u7684\u6bd4\u7387\uff1a\n\n$ \"recall\" = \"TP\" / (\"TP\" + \"FN\")$\n\n\u5f53\u7136\uff0cFN \u662f\u5047\u9634\u6027\u7684\u6570\u91cf\u3002\n\n\u7cbe\u5ea6\u548c\u53ec\u56de\u7387\n\n```python\nfrom sklearn.metrics import precision_score, recall_score\nprecision_score(y_train_5, y_train_pred)\nrecall_score(y_train_5, y_train_pred)\n```\n\n$F_1$ score\n\n$ F_1 = 2 / (1/\"precision\" + 1/\"recall\" ) \n = 2 \u00d7 (\"precision\" \u00d7 \"recall\") / (\"precision\" + \"recall\") \n = \"TP\" / (\"TP\" + (\"FN\" + \"FP\") / 2 )\n$\n\n\u8981\u8ba1\u7b97 $F_1$ \u7684\u503c\uff0c\u53ea\u9700\u8981\u8c03\u7528 *f1_score()* \u51fd\u6570\uff1a\n\n```python\nfrom sklearn.metrics import f1_score\nf1_score(y_train_5, y_train_pred)\n```\n" }, { "repo": "https://github.com/frectonz/the-pg-book", "file": "https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/167.%20aord.html.typ", "language": "typst", "license": "", "content": "aord.html\nDefault Alive or Default Dead?\n\nOctober 2015When I talk to a startup that's been operating for more than 8 or\n9 months, the first thing I want to know is almost always the same.\nAssuming their expenses remain constant and their revenue growth\nis what it has been over the last several months, do they make it to\nprofitability on the money they have left? Or to put it more\ndramatically, by default do they live or die?The startling thing is how often the founders themselves don't know.\nHalf the founders I talk to don't know whether they're default alive\nor default dead.If you're among that number, has made a handy\ncalculator you can use to find out.The reason I want to know first whether a startup is default alive\nor default dead is that the rest of the conversation depends on the\nanswer. If the company is default alive, we can talk about ambitious\nnew things they could do. If it's default dead, we probably need\nto talk about how to save it. We know the current trajectory ends\nbadly. How can they get off that trajectory?Why do so few founders know whether they're default alive or default\ndead? Mainly, I think, because they're not used to asking that.\nIt's not a question that makes sense to ask early on, any more than\nit makes sense to ask a 3 year old how he plans to support\nhimself. But as the company grows older, the question switches from\nmeaningless to critical. That kind of switch often takes people\nby surprise.I propose the following solution: instead of starting to ask too\nlate whether you're default alive or default dead, start asking too\nearly. It's hard to say precisely when the question switches\npolarity. But it's probably not that dangerous to start worrying\ntoo early that you're default dead, whereas it's very dangerous to\nstart worrying too late.The reason is a phenomenon I wrote about earlier: the\nfatal pinch.\nThe fatal pinch is default dead + slow growth + not enough\ntime to fix it. And the way founders end up in it is by not realizing\nthat's where they're headed.There is another reason founders don't ask themselves whether they're\ndefault alive or default dead: they assume it will be easy to raise\nmore money. But that assumption is often false, and worse still, the\nmore you depend on it, the falser it becomes.Maybe it will help to separate facts from hopes. Instead of thinking\nof the future with vague optimism, explicitly separate the components.\nSay \"We're default dead, but we're counting on investors to save\nus.\" Maybe as you say that, it will set off the same alarms in your\nhead that it does in mine. And if you set off the alarms sufficiently\nearly, you may be able to avoid the fatal pinch.It would be safe to be default dead if you could count on investors\nsaving you. As a rule their interest is a function of\ngrowth. If you have steep revenue growth, say over 5x a year, you\ncan start to count on investors being interested even if you're not\nprofitable.\n[1]\nBut investors are so fickle that you can never\ndo more than start to count on them. Sometimes something about your\nbusiness will spook investors even if your growth is great. So no\nmatter how good your growth is, you can never safely treat fundraising\nas more than a plan A. You should always have a plan B as well: you\nshould know (as in write down) precisely what you'll need to do to\nsurvive if you can't raise more money, and precisely when you'll \nhave to switch to plan B if plan A isn't working.In any case, growing fast versus operating cheaply is far from the\nsharp dichotomy many founders assume it to be. In practice there\nis surprisingly little connection between how much a startup spends\nand how fast it grows. When a startup grows fast, it's usually\nbecause the product hits a nerve, in the sense of hitting some big\nneed straight on. When a startup spends a lot, it's usually because\nthe product is expensive to develop or sell, or simply because\nthey're wasteful.If you're paying attention, you'll be asking at this point not just\nhow to avoid the fatal pinch, but how to avoid being default dead.\nThat one is easy: don't hire too fast. Hiring too fast is by far\nthe biggest killer of startups that raise money.\n[2]Founders tell themselves they need to hire in order to grow. But\nmost err on the side of overestimating this need rather than\nunderestimating it. Why? Partly because there's so much work to\ndo. Naive founders think that if they can just hire enough\npeople, it will all get done. Partly because successful startups have\nlots of employees, so it seems like that's what one does in order\nto be successful. In fact the large staffs of successful startups\nare probably more the effect of growth than the cause. And\npartly because when founders have slow growth they don't want to\nface what is usually the real reason: the product is not appealing\nenough.Plus founders who've just raised money are often encouraged to\noverhire by the VCs who funded them. Kill-or-cure strategies are\noptimal for VCs because they're protected by the portfolio effect.\nVCs want to blow you up, in one sense of the phrase or the other.\nBut as a founder your incentives are different. You want above all\nto survive.\n[3]Here's a common way startups die. They make something moderately\nappealing and have decent initial growth. They raise their first\nround fairly easily, because the founders seem smart and the idea\nsounds plausible. But because the product is only moderately\nappealing, growth is ok but not great. The founders convince\nthemselves that hiring a bunch of people is the way to boost growth.\nTheir investors agree. But (because the product is only moderately\nappealing) the growth never comes. Now they're rapidly running out\nof runway. They hope further investment will save them. But because\nthey have high expenses and slow growth, they're now unappealing\nto investors. They're unable to raise more, and the company dies.What the company should have done is address the fundamental problem:\nthat the product is only moderately appealing. Hiring people is\nrarely the way to fix that. More often than not it makes it harder.\nAt this early stage, the product needs to evolve more than to be\n\"built out,\" and that's usually easier with fewer people.\n[4]Asking whether you're default alive or default dead may save you\nfrom this. Maybe the alarm bells it sets off will counteract the\nforces that push you to overhire. Instead you'll be compelled to\nseek growth in other ways. For example, by doing\nthings that don't scale, or by redesigning the product in the\nway only founders can.\nAnd for many if not most startups, these paths to growth will be\nthe ones that actually work.Airbnb waited 4 months after raising money at the end of Y\u00a0Combinator\nbefore they hired their first employee. In the meantime the founders\nwere terribly overworked. But they were overworked evolving Airbnb\ninto the astonishingly successful organism it is now.Notes[1]\nSteep usage growth will also interest investors. Revenue\nwill ultimately be a constant multiple of usage, so x% usage growth\npredicts x% revenue growth. But in practice investors discount\nmerely predicted revenue, so if you're measuring usage you need a\nhigher growth rate to impress investors.[2]\nStartups that don't raise money are saved from hiring too\nfast because they can't afford to. But that doesn't mean you should\navoid raising money in order to avoid this problem, any more than\nthat total abstinence is the only way to avoid becoming an alcoholic.[3]\nI would not be surprised if VCs' tendency to push founders\nto overhire is not even in their own interest. They don't know how\nmany of the companies that get killed by overspending might have\ndone well if they'd survived. My guess is a significant number.[4]\nAfter reading a draft, wrote:\"I think you should make the hiring point more strongly. I think\nit's roughly correct to say that YC's most successful companies\nhave never been the fastest to hire, and one of the marks of a great\nfounder is being able to resist this urge.\"uchheit adds:\"A related problem that I see a lot is premature scaling\u2014founders\ntake a small business that isn't really working (bad unit economics,\ntypically) and then scale it up because they want impressive growth\nnumbers. This is similar to over-hiring in that it makes the business\nmuch harder to fix once it's big, plus they are bleeding cash really\nfast.\"\nThanks to , , , ,\nand for reading drafts of this.\n" }, { "repo": "https://github.com/Kasci/LiturgicalBooks", "file": "https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/README.md", "language": "markdown", "license": "", "content": "# Liturgical Books\r\n\r\nRespository for my implementation of liturgical books for Orthodox and Byzantine Catholic church\r\n\r\nI decided to open this repo as public, for anyone to use.\r\n\r\nCSL texts are here temporarily, they are compiled from texts from OSBM monks, that they published long time ago on their former web page. They are here just as test data and will be replaced later by original transcription. Do not use without their permision.\r\n\r\nGR texts are compiled from [https://glt.goarch.org/](GOA).\r\n\r\nCU texts are compiled from [https://www.ponomar.net/](Ponomar).\r\n\r\nSK texts are mostly from various sources, especially from [https://casoslov.sk/](Casoslov.sk). They also serve as test texts and will be replaced by original translation. Do not use without their permision.\r\n\r\nOther texts are here just as test data, and will be removed or replaced in later versions.\r\n\r\n## Prerequisites\r\n\r\nThis repository uses [https://typst.app/docs](Typst) to generate PDFs from source code.\r\n\r\n## Command\r\n\r\nTo generate pdf use command\r\n```\r\ntypst _general/NAME.typ\r\n```\r\n\r\nTo update sources use command\r\n````\r\ngit submodule update --remote\r\n````\r\n\r\n## Plans and TODO\r\n\r\n- Find a way how to use second and third glory/now and how to render it properly\r\n- Finalize general minea - add matins and liturgy/typica\r\n- Add also lower feasts into minea\r\n- Add lenten and flowely triodion\r\n- Add different sources - Lviv, etc.\r\n\r\n## Changelog\r\n\r\n### v. 0.5 \r\n\r\n- CU, CSL and GR text are moved to separate repository, to allow it's independent reuse\r\n- Vespers for general minea are added\r\n- Started to add minea for great feasts\r\n\r\n### v. 0.4\r\n\r\n- Finished conversion of CLS oktoich to JSON\r\n- Work in progres of JSON oktoich\r\n\r\n### v. 0.3\r\n\r\n- Finished CU and CSL oktoich\r\n- Started CU common minea\r\n- Started GR version\r\n\r\n### v. 0.2\r\n\r\n- Added voice 1 and 2 in Church Slavonic and Slovak transcription of Church Slavonic \r\n- TODO: there are some differences in Lviv and Moscow oktoich, that need to be somehow resolved\r\n\r\n### v. 0.1\r\n\r\n- Initial commit to transfer from typst.app to separate place, as it reached maximal ammount of files." }, { "repo": "https://github.com/Gekkio/gb-ctr", "file": "https://raw.githubusercontent.com/Gekkio/gb-ctr/main/appendix/external-bus.typ", "language": "typst", "license": "Creative Commons Attribution Share Alike 4.0 International", "content": "#import \"../common.typ\": *\n#import \"../timing.typ\"\n\n== Game Boy external bus\n\n=== Bus timings\n\n#let bus-diagram = (addr: array, rd: array, wr: array, a15: array, cs: array, data: array, sampling-edge: false) => {\n import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z\n text(13pt,\n diagram(\n grid: true,\n (label: \"CLK 4 MiHz\", wave: (\n l(1),\n ..range(9).map(_ => c(1)).flatten()\n )),\n (label: \"PHI 1 MiHz\", wave: (l(1), c(4), c(4), c(1),)),\n (label: \"A0-A14\", wave: addr),\n (label: \"RD\", wave: rd),\n (label: \"WR\", wave: wr),\n (label: \"A15\", wave: a15),\n (label: \"CS\", wave: cs),\n (label: \"Data\", wave: data),\n fg: () => {\n import cetz.draw\n draw.set-style(stroke: (paint: rgb(\"#00000080\"), thickness: 0.01em))\n draw.line((1.0, -0.5), (1.0, 15.5))\n draw.line((9.0, -0.5), (9.0, 15.5))\n if sampling-edge {\n draw.line((7, -0.5), (7, 15.5), stroke: (paint: rgb(\"#80800080\"), thickness: 0.8pt))\n }\n }\n )\n )\n}\n\n#figure(\n {\n import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z\n bus-diagram(\n addr: (u(10),),\n rd: (e(1), l(9),),\n wr: (h(10),),\n a15: (e(1), h(8), e(1),),\n cs: (e(1), h(8), e(1),),\n data: (x(1), z(9),),\n )\n },\n caption: \"External bus idle machine cycle\"\n)\n\n#v(1cm)\n\n#figure(\n {\n import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z\n [\n #columns(2, [\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(2), d(7, \"addr\"), u(1),),\n rd: (e(1), l(9),),\n wr: (h(10),),\n a15: (e(1), h(2), l(6), e(1),),\n cs: (e(1), h(8), e(1),),\n data: (x(1), z(2), d(6, \"data\"), z(1)),\n sampling-edge: true\n )\n #align(right, [\n a) #hex-range(\"0000\", \"7FFF\") #footnote[\n Does not apply to #hex-range(\"0000\", \"00FF\") accesses while the boot ROM is enabled. Boot ROM accesses do not affect the external bus, so it is in the idle state.\n ] \n ])\n ]\n )\n #colbreak()\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(2), d(7, \"addr\"), u(1),),\n rd: (e(1), l(9),),\n wr: (h(10),),\n a15: (e(1), h(8), e(1),),\n cs: (e(1), h(2), l(6), e(1),),\n data: (x(1), z(2), d(6, \"data\"), z(1)),\n sampling-edge: true,\n )\n #align(right, [\n b) #hex-range(\"A000\", \"FDFF\")\n ])\n ]\n )\n ])\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(2), d(7, \"addr\"), u(1),),\n rd: (e(1), l(9),),\n wr: (h(10),),\n a15: (e(1), h(8), e(1),),\n cs: (e(1), h(8), e(1),),\n data: (x(1), z(9),),\n )\n #align(right, [\n c) #hex-range(\"FE00\", \"FFFF\")\n ])\n #v(1cm)\n ]\n )\n ]\n },\n caption: \"External bus CPU read machine cycles\"\n)\n#figure(\n {\n import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z\n [\n #columns(2, [\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(2), d(7, \"addr\"), u(1),),\n rd: (e(1), l(1), h(7), l(1),),\n wr: (h(5), l(3), h(2),),\n a15: (e(1), h(2), l(6), e(1),),\n cs: (e(1), h(8), e(1),),\n data: (x(1), z(4), d(4, \"data\"), z(1)),\n )\n #align(right, [\n a) #hex-range(\"0000\", \"7FFF\") #footnote()\n ])\n ]\n )\n #colbreak()\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(2), d(7, \"addr\"), u(1),),\n rd: (e(1), l(1), h(7), l(1),),\n wr: (h(5), l(3), h(2),),\n a15: (e(1), h(8), e(1),),\n cs: (e(1), h(2), l(6), e(1),),\n data: (x(1), z(4), d(4, \"data\"), z(1)),\n )\n #align(right, [\n b) #hex-range(\"A000\", \"FDFF\")\n ])\n ]\n )\n ])\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(2), d(7, \"addr\"), u(1),),\n rd: (e(1), l(9),),\n wr: (h(10),),\n a15: (e(1), h(8), e(1),),\n cs: (e(1), h(8), e(1),),\n data: (x(1), z(9),),\n )\n #align(right, [\n c) #hex-range(\"FE00\", \"FFFF\")\n ])\n #v(1cm)\n ]\n )\n ]\n },\n caption: \"External bus CPU write machine cycles\"\n)\n\n#figure(\n {\n import timing: diagram, clock as c, data as d, either as e, high as h, low as l, unknown as u, undefined as x, high_impedance as z\n [\n #columns(2, [\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(1), d(8, \"addr\"), u(1),),\n rd: (e(1), l(9),),\n wr: (h(10),),\n a15: (e(1), l(8), e(1),),\n cs: (e(1), h(8), e(1),),\n data: (x(1), d(8, \"data\"), z(1)),\n )\n #align(right, [\n a) #hex-range(\"0000\", \"7FFF\") #footnote()\n ])\n ]\n )\n #colbreak()\n #block(\n breakable: false,\n [\n #bus-diagram(\n addr: (u(1), d(8, \"addr\"), u(1),),\n rd: (e(1), l(9),),\n wr: (h(10),),\n a15: (e(1), h(8), e(1),),\n cs: (e(1), l(8), e(1),),\n data: (x(1), d(8, \"data\"), z(1)),\n )\n #align(right, [\n b) #hex-range(\"A000\", \"FFFF\")\n ])\n ]\n )\n ])\n #v(1cm)\n ]\n },\n caption: \"External bus timings for OAM DMA read machine cycles\"\n)\n" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/underover_02.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n// Test brackets.\n$ underbracket([1, 2/3], \"relevant stuff\")\n arrow.l.r.double.long\n overbracket([4/5,6], \"irrelevant stuff\") $\n" }, { "repo": "https://github.com/jgm/typst-symbols", "file": "https://raw.githubusercontent.com/jgm/typst-symbols/main/README.md", "language": "markdown", "license": "MIT License", "content": "# typst-symbols\n\nThis package provides definitions of the symbols used in typst\n(). (Currently version 0.12.0 is targeted.)\n\nIt exports lists of triples, which can be converted into maps or\nother more appropriate forms, depending on the use case. Each\ntriple contains the symbol name (Text), a Boolean that is True\nif the symbol is an accent, and the resolved symbol (Text).\n\nThe symbols can be updated by scraping the typst website:\n`make update` will do the work.\n" }, { "repo": "https://github.com/emanuel-kopp/uzh-mnf-phd", "file": "https://raw.githubusercontent.com/emanuel-kopp/uzh-mnf-phd/main/src/lib.typ", "language": "typst", "license": "", "content": "#let main_doc(\n title: \"\",\n author: \"\",\n heimatort: \"\",\n examinators: (\"\"),\n date: \"\",\n land: \"\",\n PI_is_head: true,\n body,\n) = {\n // Set the document's basic properties.\n set document(author: author, title: title)\n set text(font: \"New Computer Modern\", lang: \"de\", size: 11pt)\n set align(center)\n set page(margin: (left: 2cm, right: 2cm, bottom: 2cm, top: 2cm))\n\n text(size: 14pt, weight: \"bold\")[#title]\n\n v(3pt)\n line(length: 171mm, stroke: 0.3pt)\n\n v(24pt)\n text(weight: \"bold\")[Dissertation]\n linebreak()\n v(2fr)\n text(weight: \"bold\")[zur]\n v(2fr)\n text(weight: \"bold\")[Erlangung der naturwissenschaftlichen Doktorw\u00fcrde]\n v(2fr)\n text(weight: \"bold\")[(Dr. sc. nat.)]\n v(2fr)\n text(weight: \"bold\")[vorgelegt der]\n v(2fr)\n text(weight: \"bold\")[Mathematisch-naturwissenschaftlichen Fakult\u00e4t]\n v(2fr)\n text(weight: \"bold\")[der]\n v(2fr)\n text(weight: \"bold\")[Universit\u00e4t Z\u00fcrich]\n v(2fr)\n text(weight: \"bold\")[von]\n v(2fr)\n text(weight: 1)[#author]\n v(11pt)\n if land == \"Schweiz\" [#text(weight: \"bold\")[von]] else { text(weight: \"bold\")[aus] }\n v(2fr)\n if land == \"Schweiz\" { text(weight: 1)[#heimatort] } else { text(weight: 1)[#land] }\n v(4fr)\n\n text(weight: \"bold\")[Promotionskommission]\n v(3pt)\n grid(\n align: left,\n columns: 3,\n [],\n let (a, b, .., c) = examinators,\n for ex in examinators {\n if PI_is_head == true [\n #if ex == a { text(weight: 1)[#ex (Vorsitz und Leitung der Dissertation)] } else { text(weight: 1)[#ex] }\n ]\n if PI_is_head == false [\n #if ex == a { text(weight: 1)[#ex (Vorsitz)] } else if ex == b { text(weight: 1)[#ex (Leitung der Dissertation)] } else { text(weight: 1)[#ex] }\n ]\n v(0.1em)\n },\n [],\n )\n v(6fr)\n text(weight: \"bold\")[Z\u00fcrich, #date]\n v(2fr)\n pagebreak()\n\n // Defining headings\n show heading.where(level: 1): it => {\n pagebreak()\n set text(weight: \"bold\", size: 16pt)\n it.body\n v(1em)\n }\n\n // Main body\n set text(font: \"New Computer Modern\", lang: \"en\", size: 11pt)\n set par(justify: true)\n set align(left)\n set page(numbering: \"1\", number-align: center)\n set par(leading: 1.5em)\n body\n}\n\n#let chapter(\n title: none,\n authors: (),\n affiliations: (),\n header: none,\n abstract: [],\n chapter,\n) = {\n set align(left)\n\n // Write title\n text(size: 14pt, weight: \"bold\", title)\n v(1em)\n\n let count = authors.len()\n let ncols = calc.min(count, 3)\n\n for aut in authors {\n if aut.name == authors.last().name { text()[#aut.name#super[#aut.affiliation]] } else { text()[#aut.name#super[#aut.affiliation], ] }\n }\n\n v(1em)\n\n for aff in affiliations {\n text()[#aff.num: #aff.name]\n linebreak()\n }\n\n v(2em)\n\n set align(center)\n par(justify: true)[\n *Abstract* \\\n #abstract\n ]\n\n show heading.where(level: 2): it => {\n v(1em)\n it.body\n v(1em)\n }\n\n show heading.where(level: 3): it => {\n v(1em)\n it.body\n v(1em)\n }\n\n set align(left)\n\n v(2em)\n\n // Write header\n set page(header: align(right)[\n #text(size: 10pt, style: \"italic\")[#header]\n ])\n\n chapter\n}" }, { "repo": "https://github.com/Jollywatt/typst-fletcher", "file": "https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/docs/readme-examples/state-machine.typ", "language": "typst", "license": "MIT License", "content": "#set text(10pt)\n#diagram(\n\tnode-stroke: .1em/*<*/ + fg/*>*/,\n\tedge-stroke: fg, // hide\n\tcrossing-fill: bg , // hide\n\tnode-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n\tspacing: 4em,\n\tedge((-1,0), \"r\", \"-|>\", `open(path)`, label-pos: 0, label-side: center),\n\tnode((0,0), `reading`, radius: 2em),\n\tedge(`read()`, \"-|>\"),\n\tnode((1,0), `eof`, radius: 2em),\n\tedge(`close()`, \"-|>\"),\n\tnode((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n\tedge((0,0), (0,0), `read()`, \"--|>\", bend: 130deg),\n\tedge((0,0), (2,0), `close()`, \"-|>\", bend: -40deg),\n)" }, { "repo": "https://github.com/alberto-lazari/cns-report", "file": "https://raw.githubusercontent.com/alberto-lazari/cns-report/main/previous-architecture.typ", "language": "typst", "license": "", "content": "= Overview of previous work \nThestarting point of our project is _QRFuzz_ by @QRFuzz, which is made of the following components:\n- *PC Monitor*: A phisical monitor in which the generated QRs are displayed.\n- *Smartphone*: A phisical smartphone in which the app under test is run.\n- *Appium server*: An Appium Server is an open-source automation server that facilitates the automated testing of mobile applications across different platforms, including iOS, Android, and Windows.\n It acts as a bridge between test code and the mobile device or emulator, allowing to interact with the application under test programmatically.\n- *QR Code Fuzzer*: The main element of the system that is responsible for coordinating and initiating actions for both the QR Code Generator and the Appium Server, along with managing the entire testing process. The fuzzing operation itself involves a series of steps repeated for each QR code under examination. These steps include navigating to the designated scanning page within the application, scanning the QR code, verifying if the app's normal behavior has been disrupted, and logging the results of the iteration as potential indications of a vulnerability.\n\n- *QR Code Generator*: The QR Code Generator is another crucial component of QRFuzz. Its primary function is to dynamically produce QR codes using a predefined dictionary and display them on the screen. This generator is capable of creating both standard, general-purpose QR codes and custom codes based on an application-specific template.\n\n#v(2em)\n\n== Workflow\n\nThe workflow of the system (@old_workflow) can be summarized by the following steps:\n1. The QR code displayed on the monitor is scanned by the smartphone.\n2. The smartphone sends a scan responce to the QR Code Fuzzer through the Appium server\n3. The QR Code Fuzzer notifies a QR change request to the QR Code Generator by updating a shared JSON file.\n4. The QR Code Generator generates a new QR and displays it on the monitor.\n5. The QR Code Generator notifies the update to the QR Code Fuzzer by changing the JSON file.\n6. The QR Code Fuzzer sends a scan request to the smartphone via Appium server.\n\n#figure(\n image(\"images/qr-fuzz-old-architecture.png\"),\n caption: [Old architecture]\n) " }, { "repo": "https://github.com/isaacholt100/isaacholt", "file": "https://raw.githubusercontent.com/isaacholt100/isaacholt/main/public/maths-notes/4-cambridge%3A-part-III/additive-combinatorics/additive-combinatorics.typ", "language": "typst", "license": "MIT License", "content": "#import \"../../template.typ\": *\n#show: doc => template(doc, hidden: (), slides: false)\n\n= Combinatorial methods\n\n#definition[\n Let $G$ be an abelian group and $A, B subset.eq G$. The *sumset* of $A$ and $B$ is $\n A + B := {a + b: a in A, b in B}.\n $ The *difference set* of $A$ and $B$ is $\n A - B := {a - b: a in A, b in B}.\n $\n]\n#proposition[\n $max{|A|, |B|} <= |A + B| <= |A| dot |B|$.\n]\n#proof[\n Trivial.\n]\n#example[\n Let $A = [n] = {1, ..., n}$. Then $A + A = {2, ..., 2n}$ so $|A + A| = 2|A| - 1$.\n]\n#lemma[\n Let $A subset.eq ZZ$ be finite. Then $|A + A| >= 2|A| - 1$ with equality iff $A$ is an arithmetic progression.\n]\n#proofhints[\n Consider two sequences in $A + A$ which are strictly increasing and of the same length.\n]\n#proof[\n - Let $A = {a_1, ..., a_n}$ with $a_i < a_(i + 1)$. Then $a_1 + a_1 < a_1 + a_2 < dots.c < a_1 + a_n < a_2 + a_n < dots.c < a_n + a_n$.\n - Note this is not the only choice of increasing sequence that works, in particular, so does $a_1 + a_1 < a_1 + a_2 < a_2 + a_2 < a_2 + a_3 < a_2 + a_4 < dots.c < a_2 + a_n < a_3 + a_n < dots.c < a_n + a_n$.\n - So when equality holds, all these sequences must be the same. In particular, $a_2 + a_i = a_1 + a_(i + 1)$ for all $i$.\n]\n#lemma[\n If $A, B subset.eq ZZ$, then $|A + B| >= |A| + |B| - 1$ with equality iff $A$ and $B$ are arithmetic progressions with the same common difference.\n]\n#proofhints[\n Similar to above, consider $4$ sequences in $A + B$ which are strictly increasing and of the same length.\n]\n#example[\n Let $A, B subset.eq ZZ\\/p$ for $p$ prime. If $|A| + |B| >= p + 1$, then $A + B = ZZ\\/p$.\n]\n#proofhints[\n Consider $A sect (g - B)$ for $g in ZZ\\/p$.\n]\n#proof[\n - $g in A + B$ iff $A sect (g - B) != emptyset$ where ($g - B = {g} - B$).\n - Let $g in ZZ\\/p$, then use inclusion-exclusion on $|A sect (g - B)|$ to conclude result.\n]\n#theorem(name: \"Cauchy-Davenport\")[\n Let $p$ be prime, $A, B subset.eq ZZ\\/p$ be non-empty. Then $\n |A + B| >= min{p, |A| + |B| - 1}.\n $\n]\n#proofhints[\n - Assume $|A| + |B| < p + 1$, and WLOG that $1 <= |A| <= |B|$ and $0 in A$ (by translation).\n - Induct on $|A|$.\n - Let $a in A$, find $B'$ such that $0 in B'$, $a in.not B'$ and $|B'| = |B|$ (use fact that $p$ is prime).\n - Apply induction with $A sect B'$ and $A union B'$, while reasoning that $(A sect B') + (A union B') subset.eq A + B'$.\n]\n#proof[\n - Assume $|A| + |B| < p + 1$, and WLOG that $1 <= |A| <= |B|$ and $0 in A$ (by translation).\n - Use induction on $|A|$. $|A| = 1$ is trivial.\n - Let $|A| >= 2$ and let $0 != a in A$. Then since $p$ is prime, ${a, 2a, ..., p a} = ZZ\\/p$.\n - There exists $m >= 0$ such that $m a in B$ but $(m + 1)a in.not B$ (why?). Let $B' = B - m a$, so $0 in B'$, $a in.not B'$ and $|B'| = |B|$.\n - $1 <= |A sect B'| < |A|$ (why?) so the inductive hypothesis applies to $A sect B'$ and $A union B'$.\n - Since $(A sect B') + (A union B') subset.eq A + B'$ (why?), we have $|A + B| = |A + B'| >= |(A sect B') + (A union B')| >= |A sect B'| + |A union B'| - 1 = |A| + |B| - 1$.\n]\n#example[\n Cauchy-Davenport does not hold general abelian groups (e.g. $ZZ\\/n$ for $n$ composite): for example, let $A = B = {0, 2, 4} subset.eq ZZ\\/6$, then $A + B = {0, 2, 4}$ so $|A + B| = 3 < min{6, |A| + |B| - 1}$.\n]\n#example[\n Fix a small prime $p$ and let $V subset.eq FF_p^n$ be a subspace. Then $V + V = V$, so $|V + V| = |V|$. In fact, if $A subset.eq FF_p^n$ satisfies $|A + A| = |A|$, then $A$ is an affine subspace (a coset of a subspace).\n]\n#proof[\n If $0 in A$, then $A subset.eq A + A$, so $A = A + A$. General result follows by considering translation of $A$.\n]\n#example[\n Let $A subset.eq FF_p^n$ satisfy $|A + A| <= 3/2 |A|$. Then there exists a subspace $V subset.eq FF_p^n$ such that $|V| <= 3/2 |A|$ and $A$ is contained in a coset of $V$.\n]\n#proof[\n Exercise (sheet 1).\n]\n#definition[\n Let $A, B subset.eq G$ be finite subsets of an abelian group $G$. The *Ruzsa distance* between $A$ and $B$ is $\n d(A, B) := log (|A - B|)/(sqrt(|A| dot |B|)).\n $\n]\n#lemma(name: \"Ruzsa Triangle Inequality\")[\n Let $A, B, C subset.eq G$ be finite. Then $\n d(A, C) <= d(A, B) + d(B, C).\n $\n]\n#proofhints[\n Consider a certain map from $B times (A - C)$ to $(A - B) times (B - C)$.\n]\n#proof[\n - Note that $|B| |A - C| <= |A - B| |B - C|$. Indeed, writing each $d in A - C$ as $d = a_d - c_d$ with $a_d in A$, $c_d in C$, the map $phi: B times (A - C) -> (A - B) times (B - C)$, $phi(b, d) = (a_d - b, b - c_d)$ is injective (why?).\n - Triangle inequality now follows from definition of Ruzsa distance.\n]\n#definition[\n The *doubling constant* of finite $A subset.eq G$ is $sigma(A) := |A + A|\\/|A|$.\n]\n#definition[\n The *difference constant* of finite $A subset.eq G$ is $delta(A) := |A - A|\\/|A|$.\n]\n#remark[\n The Ruzsa triangle inequality shows that $\n log delta(A) = d(A, A) <= d(A, -A) + d(-A, A) = 2 log sigma(A).\n $ So $delta(A) <= sigma(A)^2$, i.e. $|A - A| <= |A + A|^2\\/|A|$.\n]\n#notation[\n Let $A subset.eq G$, $ell, m in NN_0$. Then $\n ell A + m A := underbrace(A + dots.c + A, ell \"times\") underbrace(- A - dots.c - A, m \"times\")\n $ This is referred to as the *iterated sum and difference set*.\n]\n#theorem(name: \"Plunnecke's Inequality\")[\n Let $A, B subset.eq G$ be finite and $|A + B| <= K|A|$ for some $K >= 1$. Then $forall ell, m in NN_0$, $\n |ell B - m B| <= K^(ell + m) abs(A).\n $\n]\n#proofhints[\n - Let $A' subset.eq A$ minimise $abs(A' + B)\\/abs(A')$ with value $K'$.\n - Show that for every finite $C subset.eq G$, $abs(A' + B + C) <= K' abs(A + C)$ by induction on $abs(C)$ (note two sets need to be written as disjoint unions here).\n - Show that $forall m in NN_0, abs(A' + m B) <= (K')^m abs(A')$ by induction.\n - Use Ruzsa triangle inequality to conclude result.\n]\n#proof[\n - Choose $emptyset != A' subset.eq A$ which minimises $|A' + B|\\/|A'|$. Let the minimum value by $K'$.\n - Then $|A' + B| = K' abs(A')$, $K' <= K$ and $forall A'' subset.eq A$, $|A'' + B| >= K' abs(A'')$.\n - Claim: for every finite $C subset.eq G$, $|A' + B + C| <= K' abs(A' + C)$:\n - Use induction on $abs(C)$. $abs(C) = 1$ is true by definition of $K'$.\n - Let claim be true for $C$, consider $C' = C union {x}$ for $x in.not C$.\n - $A' + B + C' = (A' + B + C) union ((A' + B + x) - (D + B + x))$, where $D = {a in A': a + B + x subset.eq A' + B + C}$.\n - By definition of $K'$, $abs(D + B) >= K' abs(D)$. Hence, $\n |A' + B + C| & <= |A' + B + C| + abs(A' + B + x) - abs(D + B + x) \\\n & <= K' abs(A' + C) + K' abs(A') - K' abs(D) \\\n & = K' (abs(A' + C) + abs(A') - |D|).\n $\n - Applying this argument a second time, write $A' + C' = (A' + C) union ((A' + x) - (E + x))$, where $E = {a in A': a + x in A' + C} subset.eq D$.\n - Finally, $\n abs(A' + C') & = abs(A' + C) + abs(A' + x) - abs(E + x) \\\n & >= |A' + C| + |A'| - |D|.\n $\n - We first show that $forall m in NN_0$, $abs(A' + m B) <= (K')^m abs(A')$ by induction:\n - $m = 0$ is trivial, $m = 1$ is true by assumption.\n - Suppose $m - 1 >= 1$ is true. By the claim with $C = (m - 1) B$, we have $ abs(A' + m B) = |A' + B + (m - 1)B| <= K' abs(A' + (m - 1)B) <= (K')^m abs(A'). $\n - As in the proof of Ruzsa's triangle inequality, $forall ell, m in NN_0$, $ |A'| |ell B - m B| <= |A' + ell B| |A' + m B| <= (K')^ell abs(A') (K')^m abs(A') = (K')^(ell + m) abs(A')^2. $\n]\n#theorem(name: \"Freiman-Ruzsa\")[\n Let $A subset.eq FF_p^n$ and $abs(A + A) <= K abs(A)$. Then $A$ is contained in a subspace $H subset.eq FF_p^n$ with $abs(H) <= K^2 p^(K^4) abs(A)$.\n]\n#proofhints[\n - Let $X subset.eq 2A - A$ be of maximal size such that all $x + A$, $x in X$, are disjoint.\n - Use Plunnecke's inequality to obtain an upper bound on $abs(X) abs(A)$.\n - Show that $forall ell >= 2$, $ell A - A subset.eq (ell - 1)X + A - A$ by induction.\n - Let $H$ be subgroup generated by $A$. By writing $H$ as an infinite union, show that $H subset.eq Y + A - A$, where $Y$ is subgroup generated by $X$.\n - Find an upper bound for $abs(Y)$, conclude using Plunnecke inequality.\n]\n#proof[\n - Choose maximal $X subset.eq 2A - A$ such that the translates $x + A$ with $x in X$ are disjoint.\n - Such an $X$ cannot be too large: $forall x in X$, $x + A subset.eq 3A - A$, so by Plunnecke's inequality, since $abs(3A - A) <= K^4 abs(A)$, $\n abs(X) abs(A) = abs(union.big_(x in X) (x + A)) <= abs(3A - A) <= K^4 abs(A).\n $ Hence $abs(X) <= K^4$.\n - We next show that $2A - A subset.eq X + A - A$. Indeed, if, $y in 2A - A$ and $y in.not X$, then by maximality of $X$, then $(y + A) sect (x + A) != emptyset$ for some $x in X$. If $y in X$, then $y in X + A - A$.\n - It follows from above, by induction, that $forall ell >= 2$, $ell A - A subset.eq (ell - 1)X + A - A$: $ell A - A = A + (ell - 1)A - A subset.eq (ell - 2)X + 2A - A subset.eq (ell - 2)X + X + A - A = (ell - 1)X + A - A$.\n - Now, let $H subset.eq FF_p^n$ be the subgroup generated by $A$: $\n H = union.big_(ell >= 1) (ell A - A) subset.eq Y + A - A\n $ where $Y subset.eq FF_p^n$ is the subgroup generated by $X$.\n - Every element of $Y$ can be written as a sum of $abs(X)$ elements of $X$ with coefficients in ${0, ..., p - 1}$. Hence, $abs(Y) <= p^abs(X) <= p^(K^4)$.\n - Hence $abs(H) <= abs(Y) abs(A - A) <= p^(K^4) K^2 abs(A)$ by Plunnecke/Ruzsa triangle inequality.\n]\n#example[\n Let $A = V union R$, where $V subset.eq FF_p^n$ is a subspace with $dim(V) = d = n\\/K$ satisfying $K << d << n - K$, and $R$ consists of $K - 1$ linearly independent vectors not in $V$. Then $abs(A) = abs(V union R) = abs(V) + abs(R) = p^(n\\/K) + K - 1 approx p^(n\\/K) = abs(V)$.\n\n Now $abs(A + A) = abs((V union R) + (V union R)) = abs(V union (V + R) union 2R) approx K abs(V) approx K abs(A)$ (since $V union (V + R)$ gives $K$ cosets of $V$). But any subspace $H subset.eq FF_p^n$ containing $A$ must have size at least $p^(n\\/K + (K - 1)) approx abs(V) p^K$. Hence, the exponential dependence on $K$ in Freiman-Ruzsa is necessary.\n]\n#theorem(name: \"Polynomial Freiman-Ruzsa Theorem\")[\n Let $A subset.eq FF_p^n$ be such that $abs(A + A) <= K abs(A)$. Then there exists a subspace $H subset.eq FF_p^n$ of size at most $C_1 (K) abs(A)$ such that for some $x in FF_p^n$, $\n abs(A sect (x + H)) >= abs(A)/(C_2 (K)),\n $ where $C_1 (K)$ and $C_2 (K)$ are polynomial in $K$.\n]\n#proof[\n Very difficult (took Green, Gowers and Tao to prove it).\n]\n#definition[\n Given $A, B subset.eq G$ for an abelian group $G$, the *additive energy* between $A$ and $B$ is $\n E(A, B) := abs({(a, a', b, b') in A times A times B times B: a + b = a' + b'}).\n $ *Additive quadruples* $(a, a', b, b')$ are those such that $a + b = a' + b'$. Write $E(A)$ for $E(A, A)$.\n]\n#example[\n Let $V subset.eq FF_p^n$ be a subspace. Then $E(V) = abs(V)^3$. On the other hand, if $A subset.eq ZZ\\/p$ is chosen at random from $ZZ\\/p$ (where each $a in ZZ\\/p$ is included with probability $alpha > 0$), with high probability, $E(A) = alpha^4 p^3 = alpha abs(A)^3$.\n]\n#definition[\n For $A, B subset.eq G$, the *representation function* is $r_(A + B) (x) := abs({(a, b) in A times B: a + b = x}) = abs(A sect (x - B))$.\n]\n#lemma[\n Let $emptyset != A, B subset.eq G$ for an abelian group $G$. Then $\n E(A, B) >= (abs(A)^2 abs(B)^2)/abs(A + B).\n $\n]\n#proof[\n - Observe that $\n E(A, B) & = abs({(a, a', b, b') in A^2 times B^2: a + b = a' + b'}) \\\n & = abs(union.big_(x in G) {(a, a', b, b') in A^2 times B^2: a + b = x \"and\" a' + b' = x}) \\\n & = union.big_(x in G) abs({(a, a', b, b') in A^2 times B^2: a + b = x \"and\" a' + b' = x}) \\\n & = sum_(x in G) r_(A + B) (x)^2\n $\n]\n\n\n= Fourier-analytic techniques\n\n\n\n\n= Probabilistic tools\n\n\n\n\n= Further topics\n\n" }, { "repo": "https://github.com/Shuenhoy/modern-zju-thesis", "file": "https://raw.githubusercontent.com/Shuenhoy/modern-zju-thesis/master/documentclass/graduate-general.typ", "language": "typst", "license": "MIT License", "content": "#import \"../pages/graduate-cover.typ\": graduate-cover\n#import \"../pages/graduate-title-zh.typ\": graduate-title-zh\n#import \"../pages/graduate-title-en.typ\": graduate-title-en\n#import \"../pages/graduate-decl.typ\": graduate-decl\n#import \"../pages/template-individual.typ\": template-individual\n#import \"../pages/outline.typ\": main-outline, figure-outline, table-outline\n\n#import \"../utils/fonts.typ\": *\n#import \"../utils/header.typ\": header, footer\n#import \"../utils/fakebold.typ\": show-cn-fakebold\n#import \"../utils/indent-first-par.typ\": indent-first-par\n#import \"../utils/supplement.typ\": show-set-supplement\n#import \"../utils/twoside.typ\": show-twoside-pagebreak, twoside-numbering-footer, twoside-pagebreak\n#import \"../utils/near-chapter.typ\": near-chapter\n#import \"../utils/bilingual-bibliography.typ\": show-bilingual-bibliography\n#import \"../utils/structure.typ\": frontmatter, mainmatter\n#import \"../utils/appendix.typ\": appendix\n\n\n#import \"../dependency/i-figured.typ\"\n\n#let show-outline-indent(s) = {\n\n show outline.entry: it => {\n\n if it.level == 1 {\n text(weight: \"bold\", it)\n } else {\n h(1em * (it.level - 1)) + it\n }\n }\n s\n}\n\n#let graduate-general-default-info = (\n title: (\"\u6bd5\u4e1a\u8bba\u6587/\u8bbe\u8ba1\u9898\u76ee\", \"\"),\n title-en: (\"Graduation Project/Design Title\", \"\"),\n grade: \"20XX\",\n student-id: \"1234567890\",\n clc: \"O643.12\",\n unitcode: \"10335\",\n reviewer: (\"\u9690\u540d\", \"\u9690\u540d\", \"\u9690\u540d\", \"\u9690\u540d\", \"\u9690\u540d\"),\n committe: (\"\u4e3b\u5e2d\", \"\u59d4\u5458\", \"\u59d4\u5458\", \"\u59d4\u5458\", \"\u59d4\u5458\", \"\u59d4\u5458\"),\n reviewer-en: (\"Anonymous\", \"Anonymous\", \"Anonymous\", \"Anonymous\", \"Anonymous\"),\n committe-en: (\"Chair\", \"Committeeman\", \"Committeeman\", \"Committeeman\", \"Committeeman\", \"Committeeman\"),\n secret-level: \"\u65e0\",\n author: \"\u5f20\u4e09\",\n department: \"\u67d0\u5b66\u9662\",\n major: \"\u67d0\u4e13\u4e1a\",\n degree: \"\u7855\u58eb\",\n field: \"\u67d0\u65b9\u5411\",\n supervisor: \"\u674e\u56db\",\n submit-date: datetime.today(),\n defense-date: (\"\u4e8c\u4e00\u4e5d\u4e09\u5e74\u516d\u6708\", \"September 2193\"),\n)\n\n#let graduate-general-set-style(\n doc,\n degree: \"\u7855\u58eb\",\n twoside: false,\n) = {\n // Page geometry\n set page(\n paper: \"a4\",\n margin: (\n x: 2.5cm,\n bottom: 2.54cm + 12pt + 30pt,\n top: 2.54cm + 12pt + 4mm,\n ),\n )\n show: show-twoside-pagebreak.with(twoside: twoside)\n\n\n // Header and footer\n set page(\n header-ascent: 4mm,\n footer-descent: 35pt,\n header: header(\n left: [\u6d59\u6c5f\u5927\u5b66#(degree)\u5b66\u4f4d\u8bba\u6587],\n right: near-chapter,\n ),\n footer: twoside-numbering-footer,\n )\n\n // Paragraph and text\n set par(leading: 1.3em, first-line-indent: 2em, justify: true)\n show: indent-first-par\n set text(font: \u5b57\u4f53.\u4eff\u5b8b, size: \u5b57\u53f7.\u5c0f\u56db, lang: \"zh\")\n show: show-cn-fakebold\n set underline(offset: 0.2em)\n\n\n // Headings\n show heading: i-figured.reset-counters\n\n set heading(numbering: \"1.1\")\n show heading.where(level: 1): set text(size: \u5b57\u53f7.\u5c0f\u4e09)\n show heading.where(level: 1): x => {\n twoside-pagebreak\n v(12pt)\n x\n v(6pt)\n }\n show heading.where(level: 2): set text(size: \u5b57\u53f7.\u56db\u53f7)\n show heading.where(level: 3): set text(size: \u5b57\u53f7.\u5c0f\u56db)\n show heading.where(level: 4): set text(size: \u5b57\u53f7.\u5c0f\u56db)\n show heading: set block(above: 1.5em, below: 1.5em)\n\n\n // Reference\n show: show-set-supplement\n show figure: i-figured.show-figure\n show math.equation.where(block: true): i-figured.show-equation\n show figure.where(kind: table): set figure.caption(position: top)\n\n show: show-bilingual-bibliography\n doc\n}\n\n\n#let graduate-general(info: (:), twoside: false) = {\n let info = graduate-general-default-info + info\n (\n pages: (\n cover: graduate-cover(info: info),\n title-zh: graduate-title-zh(info: info),\n title-en: graduate-title-en(info: info),\n decl: graduate-decl(),\n outline: show-outline-indent(main-outline(outlined: true, titlelevel: 1)),\n figure-outline: figure-outline(outlined: true, titlelevel: 1),\n table-outline: table-outline(outlined: true, titlelevel: 1),\n individual: template-individual.with(outlined: true, titlelevel: 1, bodytext-settings: (size: \u5b57\u53f7.\u5c0f\u56db)),\n ),\n style: doc => {\n set document(title: info.title.join())\n graduate-general-set-style(doc, degree: info.degree, twoside: twoside)\n },\n )\n}\n" }, { "repo": "https://github.com/typst-community/mantodea", "file": "https://raw.githubusercontent.com/typst-community/mantodea/main/src/_valid.typ", "language": "typst", "license": "MIT License", "content": "#import \"_pkg.typ\"\n\n#let _content = content\n#let _color = color\n#let _gradient = gradient\n#let _label = label\n#let _version = version\n\n#import _pkg.z: *\n\n#let paint = base-type.with(name: \"color/gradient\", types: (_color, _gradient,))\n\n#let auto_ = base-type.with(name: \"auto\", types: (type(auto),))\n#let label = base-type.with(name: \"label\", types: (_label,))\n#let version = base-type.with(name: \"version\", types: (_version,))\n" }, { "repo": "https://github.com/0xPARC/0xparc-intro-book", "file": "https://raw.githubusercontent.com/0xPARC/0xparc-intro-book/main/src/fhe-takeaways.typ", "language": "typst", "license": "", "content": "#import \"preamble.typ\":*\n\n#takeaway[FHE takeaways][\n1. A _fully homomorphic encryption_ protocol allows Bob to compute some function $f(x)$ for Alice in a way that Bob doesn't get to know $x$ or $f(x)$.\n2. The hard problem backing known FHE protocols is the _learning with errors (LWE)_ problem, which comes down to deciding if a system of \"approximate equations\" over $FF_q$ is consistent.\n3. The main idea of this approach to FHEs is to use \"approximate eigenvalues\" as the encrypted computation and an \"approximate eigenvector\" as the secret key.\n Intuitively, adding and multiplying two matrices with different approximate eigenvalues for the same eigenvector approximately adds and multiplies the eigenvalues, respectively.\n4. To carefully do this, we actually need to control the error blowup with the _flatten_ operation. This creates a _levelled FHE_ protocol.\n]\n" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-justify_05.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n// Test that runts are avoided when it's not too costly to do so.\n#set page(width: 124pt)\n#set par(justify: true)\n#for i in range(0, 20) {\n\t\"a b c \"\n}\n#\"d\"\n" }, { "repo": "https://github.com/sebmestrallet/typst-simple-siam", "file": "https://raw.githubusercontent.com/sebmestrallet/typst-simple-siam/main/README.md", "language": "markdown", "license": "MIT No Attribution", "content": "# The `simple-siam` Typst package\n\nA Typst template for SIAM paper submissions\n\n

\n\"page\n\"page\n\"page\n\"page\n

\n\n
\nAbout the name\n\n- `typst-simple-siam` is the name of the GitHub repo, `simple-siam` is the name of the Typst template\n- The Typst template name does not contain `typst`, because it is redundant[^typst_template_naming]\n- The Typst template name is not just `siam`, because it is not an official template, thus the name must start with a non-descriptive part[^typst_template_naming]\n\n[^typst_template_naming]: https://github.com/typst/packages?tab=readme-ov-file#submission-guidelines\n\n
\n\n## Template adaptation checklist\n\n- [x] Fill out `README.md`\n - Change the `my-package` package name, including code snippets\n - Check section contents and/or delete sections that don't apply\n- [x] Check and/or replace `LICENSE` by something that suits your needs\n- [x] Fill out `typst.toml`\n - See also the [typst/packages README](https://github.com/typst/packages/?tab=readme-ov-file#package-format)\n- [ ] Adapt Repository URLs in `CHANGELOG.md`\n - Consider only committing that file with your first release, or removing the \"Initial Release\" part in the beginning\n- [ ] Adapt or deactivate the release workflow in `.github/workflows/release.yml`\n - to deactivate it, delete that file or remove/comment out lines 2-4 (`on:` and following)\n - to use the workflow\n - [ ] check the values under `env:`, particularly `REGISTRY_REPO`\n - [ ] if you don't have one, [create a fine-grained personal access token](https://github.com/settings/tokens?type=beta) with [only Contents permission](https://stackoverflow.com/a/75116350/371191) for the `REGISTRY_REPO`\n - [ ] on this repo, create a secret `REGISTRY_TOKEN` (at `https://github.com/[user]/[repo]/settings/secrets/actions`) that contains the so created token\n\n if configured correctly, whenever you create a tag `v...`, your package will be pushed onto a branch on the `REGISTRY_REPO`, from which you can then create a pull request against [typst/packages](https://github.com/typst/packages/)\n- [x] remove/replace the example test case\n- [x] (add your actual code, docs and tests)\n- [ ] remove this section from the README\n\n## Getting Started\n\n> [!IMPORTANT]\n> This template is not published yet, you cannot access it from `@preview/`, but you can download [`src/lib.typ`](src/lib.typ) and use it in your project.\n\n\nFrom the CLI:\n```bash\ntypst init @preview/simple-siam\n```\n\nFrom the Typst web app:\n```typ\n#import \"@preview/simple-siam:0.1.0\": conf\n\n#show: doc => conf(\n title: [A Typst template for SIAM paper submissions],\n authors: [],\n abstract: [See #link(\"https://github.com/sebmestrallet/typst-simple-siam\")],\n doc,\n)\n\n= First section\n\n#lorem(50)\n```\n\n## Theorems & algorithms\n\nBased on third-party Typst packages, this template allows to insert formatted theorem/proof/definition/lemma environments, as well as algorithms:\n\n```typ\n#import \"lib.typ\": conf, theorem, definition, lemma, thmrules, proof, pseudocode-list, algorithm\n#show: thmrules\n\n#show: doc => conf(\n title: [A Typst template for SIAM paper submissions],\n authors: [],\n abstract: [See #link(\"https://github.com/sebmestrallet/typst-simple-siam\")],\n doc,\n)\n\n= A theorem\n\n#theorem[\n Here the theorem formulation\n]\n\n= An algorithm\n\n#algorithm(\n pseudocode-list(\n numbered-title: #smallcaps[(My Algorithm)],\n stroke: none,\n booktabs: false,\n indentation: 2em\n )[\n - *Require:* Some input $a$\n - *Require:* Some input $b$\n + Here the algorithm definition\n ]\n)\n```\n\n## Files\n\n- [`src/lib.typ`](src/lib.typ): provide the `conf(title,authors,abstract,doc)` function to format a paper\n- [`src/main.typ`](src/main.typ): use `conf()` to reproduce the outputs of `ltexpprt_anonymous-submission.tex` & `ltexpprt_accepted-submission.tex` from the official template\n- [`src/bib.yml`](src/bib.yml): \ttranscoding of `ltexpprt_references.bib` from the official template to the [Hayagriva](https://github.com/typst/hayagriva/blob/main/docs/file-format.md) format\n- [`src/siam.csl`](src/siam.csl): [Citation Style Language](https://citationstyles.org/) for the bibliography, based on the [IEEE](https://github.com/citation-style-language/styles/blob/master/ieee.csl) one (modified `` to have small caps)\n\n## Dependencies\n\n- [`ctheorems`](https://typst.app/universe/package/ctheorems) ([sahasatvik/typst-theorems](https://github.com/sahasatvik/typst-theorems)) for numbered theorem environments, by [](https://github.com/sahasatvik), [](https://github.com/rmolinari), [](https://github.com/MJHutchinson) and [DVDTSB](https://github.com/DVDTSB) [[MIT](https://github.com/sahasatvik/typst-theorems/blob/main/LICENSE)]\n- [`lovelace`](https://typst.app/universe/package/lovelace) ([andreasKroepelin/lovelace](https://github.com/andreasKroepelin/lovelace)) for pseudocode, by [](https://github.com/andreasKroepelin) and contributors [[MIT](https://github.com/andreasKroepelin/lovelace/blob/main/LICENSE)]\n\nThey are imported with `#import \"@preview/{name}:{version}` in [`src/lib.typ`](src/lib.typ).\n\n## Ressources\n\nTeX sources of the official template:\n- The [SIAM two-column template](https://internationalmeshingroundtable.com/assets/files/imr33/templates.zip) referenced for the [SIAM International Meshing Roundtable Workshop 2025](https://internationalmeshingroundtable.com/imr33/call-for-papers/#formatting-requirements)\n- The [SIAM Macros](https://epubs.siam.org/journal-authors#macros) on the SIAM website\n- The [2019 SIAM style manual](https://epubs.siam.org/pb-assets/files/SIAM_STYLE_GUIDE_2019.pdf) on the SIAM website\n\nHow to create and publish a Typst template package:\n- The motivation and recommended interface for templates in the [official tutorial](https://typst.app/docs/tutorial/making-a-template/)\n- The in-depth format requirements in the [typst/packages](https://github.com/typst/packages) README\n- Do as the [templates directly maintained by the Typst team](https://github.com/typst/templates)\n- Use the [typst-package-template](https://github.com/typst-community/typst-package-template) GitHub template from [@typst-community](https://github.com/typst-community)\n\n## Differences with the official TeX template\n\nSee [open issues with the `compliance` label](https://github.com/sebmestrallet/typst-simple-siam/issues?q=sort%3Aupdated-desc+is%3Aopen+label%3Acompliance)\n\n## License\n\n[MIT-0](LICENSE)" }, { "repo": "https://github.com/LeptusHe/LeptusHe.github.io", "file": "https://raw.githubusercontent.com/LeptusHe/LeptusHe.github.io/main/source/_posts/fourier-transform/fourier-transform-01-fourier-series.typ", "language": "typst", "license": "", "content": "#import \"../typst-inc/blog-inc.typc\": * \n\n#show: blog_setting.with(\n title: \"\u5085\u91cc\u53f6\u53d8\u636201 - \u5085\u91cc\u53f6\u7ea7\u6570\",\n author: (\"\"),\n paper: \"jis-b0\",\n preview: false\n)\n\n#metadata(\"\u5085\u91cc\u53f6\u53d8\u6362\") \n#metadata(\"\u6570\u5b66\") \n#metadata(\"2024-08-05\") \n\n#show: shorthands.with(\n ($<|$, math.angle.l),\n ($|>$, math.angle.r)\n)\n\n#set math.equation(numbering: \"(1)\")\n\n\n= \u5085\u91cc\u53f6\u6b63\u4ea4\u51fd\u6570\u96c6\n\n\u5085\u91cc\u53f6\u51fd\u6570\u96c6$cal(Phi)$\u662f\u6b63\u4ea4\u51fd\u6570\u96c6\uff0c\u5176\u4e2d\u4efb\u610f\u4e24\u4e2a\u51fd\u6570\u7684\u5185\u79ef\u90fd\u4e3a0\u3002$cal(Phi)$\u7684\u5b9a\u4e49\u5982@eq-fourier-function \u6240\u793a\u3002\n\n$\ncal(Phi) = {1, sin(w t), cos(w t), sin (2 w t), cos(2 w t), dots.c, sin(n w t), cos (n w t)}\n$ \n\n\u5085\u91cc\u53f6\u57fa\u51fd\u6570\u4e4b\u95f4\u5185\u79ef\u7684\u5b9a\u4e49\u5982@eq-inner-fourier-basis-func \u6240\u793a\u3002\n\n$\n<|f, g|> = integral_(-T/2)^(T/2) f(x) dot.c g(x) dif x\n$ \n\n#proof[\n\n#im[\u5f53\u6b63\u6574\u6570$n$\u4e0e$m$\u6ee1\u8db3]\uff1a$n, m > 0$\u65f6\uff0c\n\n$\n<|sin(n w t), sin(m w t)|> &= Integral(-T/2, T/2, sin(n w t) dot.c sin(m w t), dif: t) \\\n&= cIntegral(1/2 (cos(n - m) w t - cos((n + m) w t))) \\\n$\n\u5206\u60c5\u51b5\u8ba8\u8bba\uff0c\u5f53$m != n$\u65f6\uff0c\u6839\u636e @def-integral-of-cos-func \u53ef\u5f97\uff1a\n\n$\n<|sin(n w t), sin(m w t)|> &= 1 /2 dot.c (Integral(-T/2, T/2, cos(n - m) w t, dif: t) - Integral(-T/2, T/2, cos(n+m) w t, dif:t) ) \\\n&= 1 / 2 dot.c (0 + 0) \\\n&= 0\n$\n\n\u5f53$m = n$\u65f6\uff0c\u53ef\u5f97\uff1a\n\n$\n<|sin(n w t), sin(m w t)|> &= 1 /2 dot.c (Integral(-T/2, T/2, cos(n - m) w t, dif: t) - Integral(-T/2, T/2, cos(n+m) w t, dif:t) ) \\\n&= 1/ 2 dot.c (cIntegral(1) - cIntegral( cos(2 n w t) )) \\\n&= 1 / 2 dot.c T \\\n&= T / 2 \n$\n\n\u540c\u7406\u53ef\u5f97\uff1a\n\n$\n<|cos(n w t), cos(m w t)|> =\ncases(\n 0\\, quad \"if \" n != m,\n T/2\\, quad \"if \" n = m\n)\n$\n\n$\n<|sin(n w t), cos(m w t)|> &= Integral(-T/2, T/2, 1/2 dot.c (sin(n + m) w t + sin(n - m) w t ), dif: t) \\\n$\n\n\u5f53$n != m$\u65f6\uff0c\u7531 @def-integral-of-sin-func \u53ef\u5f97\uff1a\n\n$\n<|sin(n w t), cos(m w t)|> = 0\n$\n\n\u5f53$n = m$\u65f6\uff0c\u53ef\u5f97\uff1a\n\n$\n<|sin(n w t), cos(m w t)|> &= Integral(-T/2, T/2, 1/2 dot.c (sin(n + m) w t + sin(n - m) w t ), dif: t) \\\n&= cIntegral(1 / 2 sin(2 n w t)) \\\n&= 0\n$\n\n]\n\n= \u5085\u91cc\u53f6\u7ea7\u6570\n\n\u4efb\u610f\u4e00\u4e2a#im[\u5468\u671f\u4e3a$T$\u7684\u51fd\u6570]\u90fd\u53ef\u4ee5\u5c55\u5f00\u4e3a\u4e0d\u540c\u9891\u7387\u7684\u7684\u6b63\u5f26\u4e0e\u4f59\u5f26\u51fd\u6570\u7684\u7ebf\u6027\u7ec4\u5408\uff0c\u5373\uff1a\n\n$\nf(x) = sum_(n=0)^infinity (a_n sin n omega x + b_n cos n omega x)\n$ \n\n\u5bf9\u4e8e@eq-fourier-series\uff0c\u6211\u4eec\u9700\u8981\u6c42\u89e3\u7cfb\u6570$a_n$\u4e0e$b_n$\u3002\u6839\u636e#im[\u5085\u91cc\u53f6\u6b63\u4ea4\u51fd\u6570\u7cfb\u7684\u6027\u8d28]\u53ef\u77e5\uff1a\n\n\u5f53$n > 0$\u65f6\uff0c\u6c42\u89e3\u7cfb\u6570$a_n$\u65f6\uff0c\u53ef\u4ee5\u5229\u7528\u516c\u5f0f\uff1a\n\n$\n<| f(x), sin(n omega x)|> &= Integral(-T/2, T/2, f(x) dot.c sin n omega x) \\\n&= cIntegral(sin n omega x dot.c (sum_(n = 0)^infinity (a_n sin n omega x + b_n cos n omega x)) ) \\\n&= sum_(n=0)^infinity (a_n dot.c cIntegral(sin n omega x dot.c sin n omega x) + b_n cIntegral(sin n omega x dot.c cos n omega x) ) \\\n&= a_n cIntegral(sin n omega x dot.c sin n omega x) \\\n&= a_n dot.c T / 2\n$\n\n\u56e0\u6b64\uff0c\u53ef\u4ee5\u5f97\u5230\n\n$\na_n = 2 / T dot.c <| f(x), sin n omega x |> = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c sin n omega x dif x\n$\n\n\u540c\u7406\uff0c\u5bf9\u4e8e\u7cfb\u6570$b_n$\uff0c\u53ef\u4ee5\u5f97\u5230\uff1a\n\n$\nb_n = 2 / T dot.c <| f(x), cos n omega x |> = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c cos n omega x dif x\n$\n\n\u5bf9\u4e8e$n = 0$\u7684\u7279\u6b8a\u60c5\u51b5\uff0c\u7531\u4e8e\u7531\u4e8e\u5f53$n = 0$\u65f6\uff0c\n$\ncases(\n sin n w t = 0,\n cos n w t = 1\n)\n$\n\n\u56e0\u6b64@eq-fourier-series \u4e2d\u7684\u9879$a_0 dot.c sin (0 dot.c omega x)$\u6ca1\u6709\u610f\u4e49\uff0c\u7cfb\u6570$a_0$\u53ef\u4ee5\u4e3a\u4efb\u610f\u503c\u3002\n\u5bf9\u4e8e\u9879$b_0 dot.c cos(0 dot.c omega x)$\u800c\u8a00\uff0c\u5176\u503c\u4e3a$1$\uff0c\u5219\u7cfb\u6570$b_0$\u53ef\u4ee5\u6c42\u89e3\u3002\u5bf9\u4e8e\u7cfb\u6570$b_0$\uff0c\u53ef\u4ee5\u6c42\u5f97\uff1a\n\n$\n<| f(x), 1 |> &= Integral(-T/2, T/2, f(x) dot.c 1) \\\n&= cIntegral((sum_(i=0)^infinity (a_n sin n omega x + b_n cos n omega x)) dot.c 1) \\\n&= sum_(i=0)^(infinity) (a_n dot.c cIntegral(sin n omega x) + b_n dot.c cIntegral(cos n omega x)) quad (1\"\u4e0e\" sin n omega x, cos n omega x text(\"\u7684\u51fd\u6570\u6b63\u4ea4\u6027)\") \\\n&= b_0 dot.c cIntegral(cos (0 dot.c omega x)) \\\n&= b_0 dot.c T\n$\n\n\u56e0\u6b64\u53ef\u5f97\uff1a\n\n$\nb_0 = 1/T dot.c <| f(x), 1 |> = 1 / T dot.c integral_(-T/2)^(T/2) f(x) dif x\n$\n\n#im[\u4e3a\u4e86\u540e\u7eed\u65b9\u4fbf\u8ba8\u8bba\uff0c\u4ee5\u53ca\u7edf\u4e00\u5f62\u5f0f\u7cfb\u6570\u7684\u8868\u8ff0\u5f62\u5f0f]\u3002@eq-fourier-series \u4e2d\u5f53$n = 0$\u65f6\u7684\u7279\u6b8a\u5e38\u6570\u9879$a_0 sin 0 + b_0 cos 0 = b_0$\u53ef\u4ee5\u4f7f\u7528\u5355\u4e2a\u5e38\u6570\u9879\u6765\u8868\u793a\uff0c\u5373\u4ee4\uff1a\n\n$\nc_0 / 2 = a_0 sin 0 + b_0 cos 0 = b_0\n$\n\n\u56e0\u6b64\uff0c@eq-fourier-series \u53ef\u4ee5\u8868\u8ff0\u4e3a\uff1a\n\n$\nf(x) = c_0 / 2 + sum_(i=1)^infinity (a_n dot.c sin n omega x + b_n dot.c cos n omega x)\n$ \n\n\u5176\u4e2d\u7684\u7cfb\u6570\u53ef\u4ee5\u4f7f\u7528#im[\u7edf\u4e00\u7684\u5f62\u5f0f]\u6765\u8868\u793a\u4e3a\uff1a\n\n$\ncases(\n c_0 = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dif x,\n a_n = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c sin n omega x dif x,\n b_n = 2 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c cos n omega x dif x,\n)\n$ \n\n\n= \u590d\u6570\u5085\u91cc\u53f6\u7ea7\u6570\n\n== \u590d\u6570\u5085\u91cc\u53f6\u7ea7\u6570\u63a8\u5bfc\n\n\u5085\u91cc\u53f6\u7ea7\u6570\u4e2d\u7684\u6bcf\u9879$a_n sin n omega x + b_n cos n omega x$\u90fd\u540c\u65f6\u542b\u6709\u4e24\u4e2a\u57fa\u51fd\u6570$sin n omega x$\u4e0e$cos n omega x$\u3002#im[\u4e3a\u4e86\u8868\u8fbe\u7684\u7b80\u5355\u6027\uff0c\u6211\u4eec\u9700\u8981\u5bfb\u627e\u4e00\u79cd\u65b9\u5f0f\u6765\u5c06\u6bcf\u9879\u4e2d\u7684\u4e24\u4e2a\u57fa\u51fd\u6570\u8868\u793a\u4e3a\u5355\u4e2a\u57fa\u51fd\u6570\u3002] \u5229\u7528\u6b27\u62c9\u516c\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u590d\u6570\u6765\u540c\u65f6\u8868\u793a$sin n omega x$\u4e0e$cos n omega x$\u51fd\u6570\u3002\n\n\u6b27\u62c9\u516c\u5f0f\u7684\u6570\u5b66\u8868\u8ff0\u4e3a\uff1a\n\n$\ne^(i x) = cos x + i sin x\n$\n\n\u53d8\u5f62\u53ef\u4ee5\u5f97\u5230\uff1a\n\n$\ne^(-i x) = cos x - i sin x\n$\n\n\u56e0\u6b64\uff0c$sin x$\u4e0e$cos x$\u53ef\u4ee5\u8868\u793a\u4e3a\uff1a\n\n$\ncases(\n sin x = (e^(i x) - e^(-i x)) / (2 i),\n cos x = (e^(i x) + e^(- i x)) / 2\n)\n$\n\n\u56e0\u6b64\uff0c@eq-fourier-series-general \u53ef\u4ee5\u8868\u8ff0\u4e3a\uff1a\n\n$\nf(x) &= c_0 / 2 + sum_(n=1)^infinity (a_n dot.c (e^(i n w x) - e^(-i n w x)) / (2 i) + b_n dot.c (e^(i n w x) + e^(-i n w x)) / 2) \\\n&= c_0 / 2 + sum_(n=1)^infinity (a_n dot.c (- i^2) / (2 i) (e^(i n w x) - e^(-i n w x)) + b_n / 2 dot.c (e^(i n w x) + e^(-i n w x))) \\\n&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n) / (2) (e^(i n w x) - e^(-i n w x)) + b_n / 2 dot.c (e^(i n w x) + e^(-i n w x))) \\\n&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n + b_n) / (2) dot.c e^(i n w x) + (i a_n + b_n) / 2 dot.c e^(-i n w x)) \\\n&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n + b_n) / (2) dot.c e^(i n w x)) + sum_(n=1)^infinity ((i a_n + b_n) / 2 dot.c e^(-i n w x)) \\\n&= c_0 / 2 + sum_(n=1)^infinity ((- i dot.c a_n + b_n) / (2) dot.c e^(i n w x)) + sum_(n=-infinity)^(-1) ((i a_(-n) + b_(-n)) / 2 dot.c e^(i n w x)) \\\n$ \n\n\u5f53$n = 0$\u65f6\uff0c\u5219$e^(i n omega x)$\u4e3a\uff1a\n$\ne^(i 0 w x) = cos 0 + i sin 0 = 1\n$\n\n\u56e0\u6b64@eq-complex-form-fourier-series-tmp \u53ef\u4ee5\u4f7f\u7528\u590d\u6570\u8868\u793a\u4e3a\n\n$\nf(x) = sum_(n = -infinity)^infinity d_n e^(i n omega x)\n$\n\n\u5176\u4e2d$d_n$\u4e3a\uff1a\n$\nd_n = cases(\n (-i a_n + b_n) / 2 &\\, quad n > 0,\n 1/2 c_0 &\\, quad n = 0,\n (i a_(-n) + b_(-n)) / 2 &\\, quad n < 0\n)\n$\n\n\u5c06@factors-of-fourier-series \u4ee3\u5165\uff0c\u53ef\u4ee5\u5f97\u5230\uff1a\n\n$\n1/2 c_0 &= 1 / 2 dot.c 2 / T Integral(-T/2, T/2, f(x)) \\\n&= 1 / T cIntegral(f(x) dot.c e^(-i n 0 x))\n$\n\n$\n(-i a_n + b_n) / 2 &= 1 / 2 dot.c 2 / T dot.c Integral(-T/2, T/2, f(x) (-i sin n w x + cos n w x)) \\\n&= 1 / T dot.c cIntegral(f(x) dot.c e^(-i n omega x))\n$\n\n$\n(i a_(-n) + b_(-n)) / 2 &= 1 / 2 dot.c 2 / T Integral(-T/2, T/2, f(x) (i sin (-n omega x) + cos(-n omega x))) \\\n&= 1 / T dot.c cIntegral(f(x) dot.c e^(-i n omega x))\n$\n\n\u56e0\u6b64\uff0c\u53c2\u6570$d_n$\u53ef\u4ee5\u7edf\u4e00\u8868\u8ff0\u4e3a\uff1a\n\n$\nd_n = 1 / T Integral(-T/2, T/2, f(x) e^(-i n omega x))\n$\n\n#definition(\"\u5085\u91cc\u53f6\u7ea7\u6570\u7684\u590d\u6570\u5f62\u5f0f\")[\n $\n f(x) &= sum_(n=-infinity)^(infinity) d_n e^(i n omega x) \\\n &= sum_(n=-infinity)^(infinity) (1 / T dot.c integral_(-T/2)^(T/2) f(x) dot.c e^(-i n omega x) dif x) dot.c e^(i n omega x)\n $\n]\n\n== \u590d\u6570\u5085\u91cc\u53f6\u7ea7\u6570\u7684\u6b63\u4ea4\u51fd\u6570\u7cfb\n\n\u5bf9\u4e8e\u5468\u671f\u4e3a$T$\u7684\u51fd\u6570$f(x)$\uff0c\u4ece\u590d\u6570\u57df\u89d2\u5ea6\u6765\u8bb2\uff0c\u5468\u671f\u51fd\u6570$f(x)$\u53ef\u4ee5\u8868\u793a\u4e3a\u5b9e\u53d8\u590d\u503c\u51fd\u6570\u7cfb$cal(R)$\u7684\u7ebf\u6027\u7ec4\u5408\uff0c\u5176\u4e2d\u51fd\u6570\u7cfb$cal(R)$\u4e3a\uff1a\n\n$\ncal(R) = { e^(i n omega x) | n in Z}\n$\n\n\u56e0\u6b64\uff0c\u51fd\u6570$f(x)$\u53ef\u4ee5\u8868\u793a\u4e3a\uff1a\n\n$\nf(x) = sum_(-infinity)^(infinity) d_n dot.c e^(i n omega x)\n$\n\n\u5bf9\u4e8e\u51fd\u6570\u7cfb$cal(R)$\u800c\u8a00\uff0c\u5176\u5b9a\u4e49\u7684\u5185\u79ef\u4e3aHermit\u5185\u79ef\uff0c\u5982\uff1a\n\n$\n<| f(x), g(x) |> = 1 / T integral_(-T/2)^(T/2) f(x) dot.c overline(g(x)) dif x\n$\n\n\u4e8b\u5b9e\u4e0a\uff0c\u53ef\u4ee5\u8bc1\u660e\u51fd\u6570\u7cfb$cal(R)$\u662f#im[\u89c4\u8303\u6b63\u4ea4\u7684]\uff0c\u5373\uff1a\n\n$\n<| e^(i n omega x), e^(i m omega x) |> &= 1 / (T) Integral(-T/2, T/2, e^(i n omega x) dot.c overline(e^(i m omega x))) \\\n&= 1 / (T) cIntegral(e^(i n omega x) dot.c e^(-i m omega x)) \\\n&= 1 / (T) cIntegral(e ^(i (n - m) omega x)) \n$\n\n\u5f53$n = m$\u65f6\uff0c\u6709\uff1a\n$\n<| e^(i n omega x), e^(i m omega x) |> &= 1 / (T) Integral(-T/2, T/2, 1) \\\n&= 1\n$\n\n\u5f53$n != m$\u65f6\uff0c\u6709\uff1a\n$\n<| e^(i n omega x), e^(i m omega x) |> &= 1 / T Integral(-T/2, T/2, e^(i (n - m) omega x)) \\\n&= 1 / T cIntegral(cos(n - m) omega x + i sin(n - m) omega x) \\\n&= 1 / T (cIntegral(cos(n - m) omega x) + i cIntegral(sin(n - m) omega x) ) \\\n&= 0\n$\n\n\u56e0\u6b64\uff0c\u7cfb\u6570$d_n$\u53ef\u4ee5\u901a\u8fc7hermit\u5185\u79ef\u6765\u8fdb\u884c\u6c42\u89e3\uff1a\n\n$\nd_n &= <| f(x), e^(i n omega x) |> \\\n &= 1 / T Integral(-T/2, T/2, f(x) dot.c e^(-i n omega x))\n$\n\n= \u9644\u5f55\n\n== \u4e09\u89d2\u51fd\u6570\u79ef\u5316\u548c\u5dee\u516c\u5f0f\n\n$\ne^(i x) = cos x + i sin x\n$ \n\n\u56e0\u6b64\uff0c\u53ef\u4ee5\u5f97\u5230\n\n$\ncases(\n sin x = (e^(i x) - e^(- i x)) / (2 i ),\n cos x = (e^(i x) + e^(- i x)) / 2\n)\n$ \n\n$\ncases(\n sin alpha dot.c sin beta = 1/2 (cos (alpha - beta) - cos (alpha + beta)),\n cos alpha dot.c cos beta = 1/2 (cos (alpha - beta) + cos(alpha + beta)),\n sin alpha dot.c cos beta = 1/2 (sin(alpha + beta) + sin(alpha - beta))\n)\n$\n\n#linebreak()\n\u4ee5$sin alpha dot.c sin beta$\u4e3a\u4f8b\uff0c\u4f7f\u7528@eq-euler-equation \u8fdb\u884c\u8bc1\u660e\u3002\n#proof[\n\n#let eulur_expr = (a, b, o) => $e^(#a) #o e^(#b)$\n\n\u5c06@eq-sin-cos-form-of-eulur \u5e26\u5165 $sin alpha dot.c sin beta$\u4e2d\uff0c\u5f97\u5230\uff1a\n$\n\nsin alpha dot.c sin beta &= (#eulur_expr($i alpha$, $- i alpha$, $-$)) / (2 i) dot.c (#eulur_expr($i beta$, $-i beta$, $-$)) / (2 i) \\\n&=((e^(i (alpha + beta)) - e^(i (alpha - beta)) ) - (e^(-i (alpha - beta)) - e^(-i (alpha + beta)))) / (-4) \\\n&= ((e^(i (alpha + beta)) + e^(-i (alpha + beta)) ) - (e^(i (alpha - beta)) + e^(-i (alpha - beta)))) / (-4) \\\n&= -1/4 (2 dot.c cos(alpha + beta) - 2 dot.c cos(alpha - beta)) \\\n&= 1/2 (cos(alpha - beta) - cos(alpha + beta))\n$\n\n\u8bc1\u660e\u5b8c\u6210\u3002\n]\n\n== \u4e09\u89d2\u51fd\u6570\u7684\u5185\u79ef\n\n\n#definition(\"\u4e09\u89d2\u51fd\u6570\u7684\u79ef\u5206\")[\n \u4e09\u89d2\u51fd\u6570$sin w t $\u4e0e$cos w t$\u5728\u5468\u671f$[-T/2, T/2]$\u5185\u7684\u79ef\u5206\u4e3a0\uff0c\u5373\uff1a\n\n $\n integral_(-T/2)^(T/2) sin w t dif t = 0 \\\n\n integral_(-T/2)^(T/2) cos w t dif t = 0 \\\n $\n\n \u5176\u4e2d$w = (2 pi) / T$\uff0c$T$\u4e3a\u4e09\u89d2\u51fd\u6570$sin(w t)$\u4e0e$cos (w t)$\u7684\u6700\u5c0f\u5468\u671f\u3002\n]\n\n#proof[\n $\n Integral(-T/2, T/2, sin w t, dif: t) &= lr(-1 / w cos w t |)_(-T/2)^(T/2) \\\n &= -1/w ( cos ((2 pi) / T dot.c T / 2) - cos((2 pi) / T dot.c -T / 2 )) \\\n &= -1 / w (cos pi - cos(-pi)) \\\n &= 0\n $ \n\n $\n Integral(-T/2, T/2, cos w t, dif: t) &= lr(1 / w sin w t |)_(-T/2)^(T/2) \\\n &= 1/w ( sin ((2 pi) / T dot.c T / 2) - sin((2 pi) / T dot.c -T / 2 )) \\\n &= 1 / w (sin pi - sin(-pi)) \\\n &= 0\n $ \n]\n\n\n#lemma(\"\u4e09\u89d2\u5f62\u5468\u671f\u51fd\u6570\u7684\u79ef\u5206\")[\n \u5982\u679c\u4e09\u89d2\u51fd\u6570$sin w t$\u6216$cos w t$\u7684\u6700\u5c0f\u5468\u671f\u4e3a$T$\uff0c\u5176\u9891\u7387$w = (2 pi) / T$\uff0c\u5219\u51fd\u6570$sin n w t$\u6216\u8005$cos n w t$\u7684\u5728\u5468\u671f$[-T/2, T/2]$\u4e0a\u7684\u79ef\u5206\u4e3a0\uff0c\u5373\uff1a\n\n $\n integral_(-T/2)^(T/2) sin n w t dif t = integral_(-T/2)^(T/2) cos n w t dif t = 0\n $\n]\n\n#proof[\n \u4ee5$sin n w t$\u4e3a\u4f8b\u8fdb\u884c\u8bc1\u660e\uff0c$cos n w t$\u7684\u60c5\u51b5\u7c7b\u4f3c\u3002\n\n \u4ee4$w' = n w$\uff0c\u5219\u51fd\u6570$sin n w t = sin w' t$\uff0c\u5219$T' = T / n$\uff0c\u5219\u6839\u636e @def-integral-of-sin-func \u4ee5\u53ca$sin$\u51fd\u6570\u7684\u5468\u671f\u6027\uff0c\u53ef\u5f97\uff1a\n $\n integral_(-T/2)^(T/2) sin n w t dif t &= integral_(-n T'/2)^(n T'/2) sin w' t dif t'\\\n &= sum_(k = 0)^n integral_(k T' - T'/2)^(k T' + T'/2) sin w' t dif t'\\\n &= sum_(k = 0)^n dot.c 0 \\\n &= 0\n $\n]" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/modern-cv/0.1.0/README.md", "language": "markdown", "license": "Apache License 2.0", "content": "# Modern CV\n\n[![say thanks](https://img.shields.io/badge/Say%20Thanks-\ud83d\udc4d-1EAEDB.svg)](https://github.com/DeveloperPaul123/modern-cv/stargazers)\n[![Discord](https://img.shields.io/discord/652515194572111872?logo=Discord)](https://discord.gg/CX2ybByRnt)\n![Release](https://img.shields.io/github/v/release/DeveloperPaul123/modern-cv)\n\nA port of the [Awesome-CV](https://github.com/posquit0/Awesome-CV) Latex resume template in [typst](https://github.com/typst/typst).\n\n## Requirements\n\nYou will need the `Roboto` and `Source Sans Pro` fonts installed on your system or available somewhere. If you are using the `typst` web app, no further action is necessary. You can download them from the following links:\n\n- [Roboto](https://fonts.google.com/specimen/Roboto)\n- [Source Sans Pro](https://github.com/adobe-fonts/source-sans-pro)\n\nThis template also uses FontAwesome icons via the `[fontawesome](https://typst.app/universe/package/fontawesome)` package.\n\nSee `typst fonts --help` for more information on configuring fonts for `typst` that are not installed on your system.\n\n### Usage\n\nBelow is a basic example for a simple resume:\n\n```typst\n#import \"@preview/modern-cv:0.1.0\": *\n\n#show: resume.with(\n author: (\n firstname: \"John\", \n lastname: \"Smith\",\n email: \"\", \n phone: \"(+1) 111-111-1111\",\n github: \"DeveloperPaul123\",\n linkedin: \"Example\",\n address: \"111 Example St. Example City, EX 11111\",\n positions: (\n \"Software Engineer\",\n \"Software Architect\"\n )\n ),\n date: datetime.today().display()\n)\n\n= Education\n\n#resume_entry(\n title: \"Example University\",\n location: \"B.S. in Computer Science\",\n date: \"August 2014 - May 2019\",\n description: \"Example\"\n)\n\n#resume_item[\n - #lorem(20)\n - #lorem(15)\n - #lorem(25) \n]\n```\n\n### Output\n\n| | |\n| --- | --- |\n| ![Resume](resume.png) | ![Coverletter](coverletter.png) |" }, { "repo": "https://github.com/LDemetrios/Typst4k", "file": "https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/visualize/path.typ", "language": "typst", "license": "", "content": "// Test paths.\n\n--- path ---\n#set page(height: 300pt, width: 200pt)\n#table(\n columns: (1fr, 1fr),\n rows: (1fr, 1fr, 1fr),\n align: center + horizon,\n path(\n fill: red,\n closed: true,\n ((0%, 0%), (4%, -4%)),\n ((50%, 50%), (4%, -4%)),\n ((0%, 50%), (4%, 4%)),\n ((50%, 0%), (4%, 4%)),\n ),\n path(\n fill: purple,\n stroke: 1pt,\n (0pt, 0pt),\n (30pt, 30pt),\n (0pt, 30pt),\n (30pt, 0pt),\n ),\n path(\n fill: blue,\n stroke: 1pt,\n closed: true,\n ((30%, 0%), (35%, 30%), (-20%, 0%)),\n ((30%, 60%), (-20%, 0%), (0%, 0%)),\n ((50%, 30%), (60%, -30%), (60%, 0%)),\n ),\n path(\n stroke: 5pt,\n closed: true,\n (0pt, 30pt),\n (30pt, 30pt),\n (15pt, 0pt),\n ),\n path(\n fill: red,\n fill-rule: \"non-zero\",\n closed: true,\n (25pt, 0pt),\n (10pt, 50pt),\n (50pt, 20pt),\n (0pt, 20pt),\n (40pt, 50pt),\n ),\n path(\n fill: red,\n fill-rule: \"even-odd\",\n closed: true,\n (25pt, 0pt),\n (10pt, 50pt),\n (50pt, 20pt),\n (0pt, 20pt),\n (40pt, 50pt),\n ),\n)\n\n--- path-bad-vertex ---\n// Error: 7-9 path vertex must have 1, 2, or 3 points\n#path(())\n\n--- path-bad-point-count ---\n// Error: 7-47 path vertex must have 1, 2, or 3 points\n#path(((0%, 0%), (0%, 0%), (0%, 0%), (0%, 0%)))\n\n--- path-bad-point-array ---\n// Error: 7-31 point array must contain exactly two entries\n#path(((0%, 0%), (0%, 0%, 0%)))\n\n--- issue-path-in-sized-container ---\n// Paths used to implement `LayoutMultiple` rather than `LayoutSingle` without\n// fulfilling the necessary contract of respecting region expansion.\n#block(\n fill: aqua,\n width: 20pt,\n height: 15pt,\n path(\n (0pt, 0pt),\n (10pt, 10pt),\n ),\n)\n" }, { "repo": "https://github.com/rdboyes/resume", "file": "https://raw.githubusercontent.com/rdboyes/resume/main/cv.typ", "language": "typst", "license": "", "content": "// Imports\n#import \"@preview/brilliant-cv:2.0.2\": cv\n#import \"@preview/fontawesome:0.4.0\"\n#let metadata = toml(\"./metadata.toml\")\n#let importModules(modules, lang: metadata.language) = {\n for module in modules {\n include {\n \"modules_\" + lang + \"/\" + module + \".typ\"\n }\n }\n}\n\n\n#show: cv.with(\n metadata\n)\n#importModules((\n \"professional\",\n \"education\",\n \"publications\",\n \"skills\",\n))\n" }, { "repo": "https://github.com/alex-touza/fractal-explorer", "file": "https://raw.githubusercontent.com/alex-touza/fractal-explorer/main/paper/test.typ", "language": "typst", "license": "", "content": "// unnumbered title page if needed\n// ...\n\nTitle\n\n#pagebreak()\n// front-matter\n#set page(numbering: \"I\")\n#counter(page).update(1)\n// ...\n\nAcknowledgments\n\n#pagebreak()\n#outline()\n\n// page counter anchor\n#metadata(()) \n#pagebreak()\n\n\n\n\n// main document body\n#set page(numbering: \"1\")\n#counter(page).update(1)\n\n/* HERE. Still using Roman numbers instead of Arabic. */\n= Something\n\n#lorem(4000)\n\n// back-matter\n#set page(numbering: \"I\")\n// must take page breaks into account, may need to be offset by +1 or -1\n#context counter(page).update(counter(page).at().first() + 1)\n\n= Glossary\n#lorem(50)" }, { "repo": "https://github.com/tilman151/pypst", "file": "https://raw.githubusercontent.com/tilman151/pypst/main/docs/examples/document/template.typ", "language": "typst", "license": "MIT License", "content": "#import \"@preview/charged-ieee:0.1.0\": ieee\n\n#show: ieee.with(\n title: [Using Templates with Pypst],\n abstract: [#lorem(100)],\n authors: (\n (\n name: \"Alice\",\n department: [Co-Author],\n organization: [Best University],\n email: \"\"\n ),\n (\n name: \"Bob\",\n department: [Co-Author],\n organization: [Best University],\n email: \"\"\n ),\n ),\n index-terms: (\"Scientific writing\", \"Typesetting\", \"Document creation\", \"Syntax\")\n)\n\n// include generated file\n#include(\"my-document.typ\")" }, { "repo": "https://github.com/7sDream/fonts-and-layout-zhCN", "file": "https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/02-concepts/dimension/devanagari.typ", "language": "typst", "license": "Other", "content": "#import \"/lib/draw.typ\": *\n#import \"/lib/glossary.typ\": tr\n#import \"/template/lang.typ\": devanagari\n\n#let start = (0, 0)\n#let end = (1000, 260)\n\n#let (basex, basey) = (120, 70)\n#let width = 740\n\n#let example = devanagari[\u091f\u093e\u0907\u092a\u094b\u0917\u094d #h(-0.25em)\u0930\u093e\u092b\u0940]\n\n#let graph = with-unit((ux, uy) => {\n // mesh(start, end, (100, 100), stroke: 1 * ux + gray)\n\n let lines = (\n ([\u53d8\u97f3\u7b26\u53f7\u7ebf], \"rb\", end.at(0), basex, basey + 153),\n ([#tr[headline]], \"lb\", 0, basex + width, basey + 100),\n ([#tr[baseline]], \"lb\", 0, basex + width, basey),\n ([\u534a\u97f3\u7b26\u53f7\u7ebf], \"rb\", end.at(0), basex, basey - 50),\n )\n\n for (body, anchor, xs, xe, y) in lines {\n segment((xs, y), (xe, y), stroke: 2 * ux + gray.darken(30%))\n txt(body, (xs, y), anchor: anchor, size: 25 * ux, dy: 4)\n }\n\n txt(example, (basex, basey), anchor: \"lb\", size: 170 * ux)\n})\n\n#canvas(end, start: start, width: 90%, graph)\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-A840.typ", "language": "typst", "license": "Apache License 2.0", "content": "#let data = (\n (\"PHAGS-PA LETTER KA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER KHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER GA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER NGA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER CA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER CHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER JA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER NYA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER TA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER THA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER DA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER NA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER PA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER PHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER BA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER MA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER TSA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER TSHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER DZA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER WA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER ZHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER ZA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER SMALL A\", \"Lo\", 0),\n (\"PHAGS-PA LETTER YA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER RA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER LA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER SHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER SA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER HA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER A\", \"Lo\", 0),\n (\"PHAGS-PA LETTER I\", \"Lo\", 0),\n (\"PHAGS-PA LETTER U\", \"Lo\", 0),\n (\"PHAGS-PA LETTER E\", \"Lo\", 0),\n (\"PHAGS-PA LETTER O\", \"Lo\", 0),\n (\"PHAGS-PA LETTER QA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER XA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER FA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER GGA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER EE\", \"Lo\", 0),\n (\"PHAGS-PA SUBJOINED LETTER WA\", \"Lo\", 0),\n (\"PHAGS-PA SUBJOINED LETTER YA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER TTA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER TTHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER DDA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER NNA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER ALTERNATE YA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER VOICELESS SHA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER VOICED HA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER ASPIRATED FA\", \"Lo\", 0),\n (\"PHAGS-PA SUBJOINED LETTER RA\", \"Lo\", 0),\n (\"PHAGS-PA SUPERFIXED LETTER RA\", \"Lo\", 0),\n (\"PHAGS-PA LETTER CANDRABINDU\", \"Lo\", 0),\n (\"PHAGS-PA SINGLE HEAD MARK\", \"Po\", 0),\n (\"PHAGS-PA DOUBLE HEAD MARK\", \"Po\", 0),\n (\"PHAGS-PA MARK SHAD\", \"Po\", 0),\n (\"PHAGS-PA MARK DOUBLE SHAD\", \"Po\", 0),\n)\n" }, { "repo": "https://github.com/suiranruofeng/notebook", "file": "https://raw.githubusercontent.com/suiranruofeng/notebook/main/GW/\u5f15\u529b\u4e0e\u5f15\u529b\u6ce2.typ", "language": "typst", "license": "", "content": "#align(center, text(17pt)[*General Relativity: Gravitational wave and Cosmology Notebook*])\n\n#align(center)[XuweiZhang \\ #link(\"\")]\n#set heading(numbering: \"1.\")\n\n= \u7b49\u6548\u539f\u7406\n\n== \u7b49\u6548\u539f\u7406\u7684\u8868\u8ff0\n\n\u5728\u81ea\u7531\u4e0b\u843d\u7684\u5347\u964d\u673a\u91cc\u65e0\u6cd5\u68c0\u9a8c\u7a33\u5b9a\u5747\u5300\u7684\u9759\u6001\u5916\u5f15\u529b\u573a\uff0c\u56e0\u4e3a\u5411\u4e0b\u7684\u5f15\u529b\u548c\u5411\u4e0a\u7684\u60ef\u6027\u529b\u76f8\u4e92\u62b5\u6d88\u4e86\u3002\u5bf9\u4e8e\u4e00\u822c\u7684\u8fd0\u52a8\uff0c\u6211\u4eec\u5bf9\u4e8e$N$\u4e2a\u8d28\u70b9\u7684\u7cfb\u7edf\uff0c\u5728\u5916\u529b$bold(F)(bold(x)_N-bold(x)_M)$\u548c\u5916\u5f15\u529b\u573a$bold(g)$\u7684\u4f5c\u7528\u4e0b\n\n$ m_N (d^2bold(x)_N)/(d t^2)=m_N bold(g)+sum_M bold(F)(bold(x)_N-bold(x)_M) $\n\n\u5047\u5b9a\u6211\u4eec\u4f5c\u4e00\u4e2a\u65f6\u7a7a\u5750\u6807\u53d8\u6362\n\n$ x'=x-1/2g t^2,space t'=t $\n\n\u8fd9\u6837$bold(g)$\u5c31\u88ab\u60ef\u6027\u529b\u6240\u62b5\u6d88\uff0c\u8fd0\u52a8\u65b9\u7a0b\u53d8\u4e3a\n\n$ m_N (d^2 bold(x')_N)/(d t'^2)=sum_M bold(F)(bold(x')_N-bold(x')_M) $\n\n\u8fd9\u5c31\u662f\u81ea\u7531\u4e0b\u843d\u5750\u6807\u7cfb\u3002\n\n== \u5750\u6807\u53d8\u6362\u4e0e\u8054\u7edc\n\n== \u5ea6\u89c4\u5f20\u91cf\n" }, { "repo": "https://github.com/francescoo22/LCD-exercises", "file": "https://raw.githubusercontent.com/francescoo22/LCD-exercises/main/src/M.typ", "language": "typst", "license": "", "content": "#import \"common.typ\": *\n#import \"rules.typ\": *\n\n= Exercise M\n\nDiscuss an extension of CCS with an operator of sequential composition between processes $P; Q$. Provide an operational semantics and analyze the possibility of having an encoding in CCS of the defined operator.\n\n*Solution*\n\n== $CCS_seq$\n\n$ P, Q ::= K | alpha . P | sum_(i in I) alpha . P_i | (P | Q) | P[f] | P without L | P;Q $\n\n== Operational Semantics\n\n#v(2em)\n\n*Classical rules*\n\n#grid(\n columns: (auto, auto, auto),\n column-gutter: 1fr,\n row-gutter: 2em,\n c1, c2, c3, c4, c5, c6, c7, c8\n)\n\n#v(2em)\n\n*$CCS_seq$ rules*\n\n#grid(\n columns: (auto, auto, auto),\n column-gutter: 1fr,\n row-gutter: 2em,\n r1, r2, r3, r4, r5, r6, r7, r8\n)\n\n#include \"encoding.typ\"\n\n#include \"lemmas.typ\"\n\n== Equivalence\n\n$ forall P in CCS_seq . P approx e(P) wnu $\n\nlet $ cr = {(P, Q wnu) | P, Q in CCS_seq , Q approx e(P)} $\n\nwe need to prove that $cr$ is a weak bisimulation i.e.\n\n- $forall P in CCS_seq . fi P atrans P' then e(P) wnu awtrans P'' wnu and P' cr (P'' wnu)$\n\n- $forall P in CCS_seq . fi e(P) wnu atrans P'' wnu then P awtrans P' and P' cr (P'' wnu)$\n\nThe proof is done by induction on the height of the derivation tree, so we can rewrite it as follows:\n\n- $forall P in CCS_seq . forall h in NN . fi P atrans P' \"with tree of height\" h then e(P) wnu awtrans P'' wnu and P' cr (P'' wnu)$\n\n- $forall P in CCS_seq . forall h in NN . fi e(P) wnu atrans P'' wnu \"with tree of height\" h then P awtrans P' and P' cr (P'' wnu)$\n\n=== First point\n*base case h=1*\n\nThe only way a process can make a transition with derivation tree of height 1 is $ c1 $ and in this case also $ p1 $ and $P cr (e(P) wnu)$ because $e(P) approx e(P)$\n\n*inductive case Const*\n\nif $ c8 $ \n\n$=>^\"by induction\" e(P) wnu atrans P'' wnu \"and\" P' cr (P'' wnu)$ \n\n$=> e(P) atrans P''$ so #v(1em) $ p2 $ and $P' cr (P'' wnu)$\n\n*inductive case Hide*\n\nif $ c6 $ \n\n$=>^\"by induction\" e(P) wnu awtrans P'' wnu \"and\" P' cr (P'' wnu)\\\n=>^\"relation\" P'' approx e(P')\\\n=>^\"only rule\" e(P) awtrans P''$\n\n$ p3 $\n\nI have to prove that $P' wL cr P'' wL wnu$ i.e. $P'' wL approx e(P' wL)$\n\n$ P'' wL approx^(P'' approx e(P')) e(P') wL = e(P' wL) $\n\n*inductive case Red*\n\nif $ c7 $ \n\n$=>^\"by induction\" e(P) wnu awtrans P'' wnu \"and\" P' cr (P'' wnu)\\\n=>^\"only rule\" e(P) awtrans P''$\n\nand so $ p4 $\n\nand $P''[f] approx^(P'' approx e(P')) e(P') [f] = e(P' [f]) => P'[f] cr P''[f] wnu$\n\n*Inductive case Sum*\n\nSum case is trivial because if $ p5 $ also $ p6 $ \n\nand $P_j cr (e(P_j) wnu)$.\n\n*Inductive case Par-1/Par-2/Par-3*\n\nIf $ c3 $ \n\n$=>^\"by induction\" e(P) wnu atrans P'' wnu \"and\" P' cr (P'' wnu)$\n\n$=> e(P) atrans P''$\n\nand so $ p7 $\n\n#v(1em)\n\nwe need to show that $(P'|Q) cr (P''[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup wnu$\n\nwhich is equivalent to show that $(P''[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup approx e(P'|Q)$\n\n$ P' cr P'' wnu =>^(cr \"definition\") P'' approx e(P') \\ =>^\"bisim properties\" (P''[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup approx (e(P')[nu'/nu] | e(Q)[nu'/nu] | overline(nu') . overline(nu') . nu . 0) wnup = e(P'|Q) $\n\nPar-2 and Par-3 are similar\n\n*Inductive case Seq-L*\n\nIf $ r7 $\n\n$=>^\"by induction\" e(P) wnu atrans P'' wnu \"and\" P' cr (P'' wnu)$\n\n$=> e(P) atrans P''$\n\nand so $ p8 $\n\n#v(1em)\n\nwe need to show that $(P';Q) cr (P''[nu'/nu] | overline(v') . e(Q)) wnup wnu$\n\nwhich is equivalent to show that $(P''[nu'/nu] | overline(v') . e(Q)) wnup approx e(P';Q)$\n\n$ P' cr P'' wnu =>^(cr \"definition\") P'' approx e(P') \\ =>^\"bisim properties\" (P''[nu'/nu] | overline(v') . e(Q)) wnup approx (e(P')[nu'/nu] | overline(v') . e(Q)) wnup = e(P';Q) $\n\n*Inductive case Seq-R*\n\nIf $ r8 $\n\n$P ended =>^\"lemma 0\" e(P) ->^(tau*) P_\"temp\" ntrans P' and P' ended$\n\n$Q atrans Q'=>^\"by induction\" e(Q) wnu atrans Q'' wnu \"and\" Q' cr (Q'' wnu) => e(Q) atrans Q''$\n\nand so $ p9 $\n\n#v(2em)\n$ p10 $\n#v(2em)\n$ p11 $\n#v(2em)\nNow I have to prove that $Q' cr (P' [nu'/nu] | Q'') wnup wnu$\n\nWhich is equivalent to prove that $(P' [nu'/nu] | Q'') wnup approx e(Q')$\n\n$ P' ended =>^\"End-Red\" P'[nu'/nu] ended =>^\"lemma 3\" P'[nu'/nu] approx 0 \\ => (P' [nu'/nu] | Q'') wnup approx (0 | Q'') wnup approx^(Q'' approx e(Q')) (0 | e(Q')) wnup approx^\"lemma 4\" 0 | e(Q') approx e(Q') $" }, { "repo": "https://github.com/SWATEngineering/Docs", "file": "https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/3_PB/PianoDiProgetto/sections/ConsuntivoSprint/UndicesimoSprint.typ", "language": "typst", "license": "MIT License", "content": "#import \"../../const.typ\": Re_cost, Am_cost, An_cost, Ve_cost, Pr_cost, Pt_cost\n#import \"../../functions.typ\": rendicontazioneOreAPosteriori, rendicontazioneCostiAPosteriori, glossary\n\n\n==== Undicesimo consuntivo\n\n*Inizio*: Venerd\u00ec 01/03/2024\n\n*Fine*: Gioved\u00ec 07/03/2024 \n\n#rendicontazioneOreAPosteriori(sprintNumber: \"11\")\n\n#rendicontazioneCostiAPosteriori(sprintNumber: \"11\")\n\n===== Analisi a posteriori\nLa retrospettiva ha evidenziato come il totale delle ore preventivato per questo #glossary(\"sprint\") si possa dire rispettato. La differenza tra preventivo e consuntivo \u00e8 infatti pari a tre ore, che sul totale preventivato di 60 ore lavorative costituiscono un distacco pari al 5%, pi\u00f9 che accettabile. \nSi vuole evidenziare come nel corso di questo #glossary(\"sprint\"), per la prima volta, ciascun componente del team abbia totalizzato una media di quasi 10 ore produttive. Questo \u00e8 coerente con la disponibilit\u00e0 espressa dal team dopo la prima revisione #glossary[RTB] e con la necessit\u00e0 di ogni membro di raggiungere la seconda revisione #glossary[PB] avendo impiegato almeno 80 ore produttive, il minimo per poter concludere il progetto.\nL'unica differenza significativa tra preventivo e consuntivo si pu\u00f2 ritrovare nelle ore del ruolo di Amministratore: si era infatti erroneamente sottostimata la dimensione, in termini di ore produttive, delle task assegnate agli Amministratori. \n\u00c8 stato inoltre rilevato che le ore assegnate all'attivit\u00e0 di revisione, sebbene complessivamente non dissimili da quelle consuntivate, sono state distribuite su un numero esiguo di membri. Per questo motivo, nei prossimi #glossary[sprint] sar\u00e0 bene distribuire il carico di lavoro su un numero maggiore di persone, evitando di concentrarlo solamente su alcuni individui. Infatti, designando ripetutamente gli stessi membri del team come Verificatori, si rischia di limitare la diversit\u00e0 di prospettive applicate al processo di verifica, portando ad una mancanza di identificazione di potenziali problemi o miglioramenti e, a lungo andare, ad un abbassamento della qualit\u00e0 del lavoro svolto.\n\n===== Aggiornamento della pianificazione e gestione dei rischi\nNel corso dello #glossary(\"sprint\") in oggetto si \u00e8 manifestato il rischio tecnologico RT1 o conoscenza tecnologica limitata: tale rischio si \u00e8 concretizzato nell'utilizzo dello strumento Pydantic. Tuttavia, considerando il ruolo non centrale di tale libreria nell'#glossary[architettura] del progetto, il team ha optato per la sua rimozione.\nIn questo caso le misure preventive individuate non sono state efficaci nell'eludere il rischio: il team, sottovalutando la complessit\u00e0 dello strumento, non aveva immaginato che potesse creare dei rallentamenti nello sviluppo e, di conseguenza, non ha applicato le misure preventive individuate.\n\nCome enunciato nell'analisi sopra, si \u00e8 anche manifestato il rischio di comunicazione RC6 o ripetizioni nelle assegnazioni del ruolo di Verificatore: in particolare, sarebbe bene evitare scenari in cui gli stessi componenti del team vengono incaricati di verificare la #glossary[documentazione] ripetutamente, mentre altri il codice, senza che questi si scambino mai tali responsabilit\u00e0; in futuro, dunque, il team ha intenzione di adottare una rotazione pi\u00f9 efficace del ruolo, come delineato nelle misure preventive del rischio. \n\nIl team ha inoltre rilevato l'esigenza di intensificare il dialogo con la Proponente: nonostante le misure preventive per il rischio di comunicazione RC3 (frequenza limitata nella comunicazione con la Proponente), siano chiare riguardo alla necessit\u00e0 di mantenere una frequenza di incontri, e di conseguente ricezione di feedback, perlomeno settimanale, non vi \u00e8 stato alcun tipo di comunicazione con l'azienda da all'incirca due settimane. Di conseguenza, si \u00e8 rimarcata la volont\u00e0 di organizzare un incontro al pi\u00f9 presto e, possibilmente, di reintrodurre la frequenza settimanale che ha caratterizzato il periodo antecedente l'#glossary[RTB]. \n\nInfine, nonostante non si sia propriamente manifestato il rischio di pianificazione RP3 o \"Variazioni nei tempi e costi del progetto\", la decisione del team di non effettuare la terza revisione #glossary[CA] (rintracciabile nel verbale interno del 04/03) ha comunque avuto un impatto sulla pianificazione: infatti, se nel preventivo a finire redatto in occasione dell' #glossary[RTB] erano state dedicate alcune risorse allo svolgimento della #glossary[CA], ora queste sono utilizzabili in preparazione alla #glossary[PB]. Perci\u00f2 non solo viene aggiornata la pianificazione all'interno del _Piano di Progetto_ aumentando le ore produttive a disposizione per determinati ruoli (Responsabile, Amministratore, Programmatore e Verificatore), ma il team ha anche intenzione di aumentare ulteriormente il ritmo di lavoro per sfruttare efficacemente le risorse aggiuntive a disposizione. \n\n" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/visualize/shape-ellipse-00.typ", "language": "typst", "license": "Other", "content": "// Default ellipse.\n#ellipse()\n\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/stonewall/0.1.0/example/example.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"../stonewall.typ\": flags\n\n#set page(width: 200pt, height: auto, margin: 0pt)\n#set text(fill: black, size: 12pt)\n#set text(top-edge: \"bounds\", bottom-edge: \"bounds\")\n\n\n#stack(\n spacing: 3pt,\n ..flags.map(((name, preset)) => block(\n width: 100%,\n height: 20pt,\n fill: gradient.linear(..preset),\n align(center + horizon, smallcaps(name)),\n ))\n)" }, { "repo": "https://github.com/MattiaOldani/Informatica-Teorica", "file": "https://raw.githubusercontent.com/MattiaOldani/Informatica-Teorica/master/capitoli/calcolabilit\u00e0/04_cardinalit\u00e0.typ", "language": "typst", "license": "", "content": "#import \"../alias.typ\": *\n\n#import \"@preview/lemmify:0.1.5\": *\n\n#let (\n theorem, lemma, corollary,\n remark, proposition, example,\n proof, rules: thm-rules\n) = default-theorems(\"thm-group\", lang: \"it\")\n\n#show: thm-rules\n\n#show thm-selector(\"thm-group\", subgroup: \"theorem\"): it => block(\n it,\n stroke: red + 1pt,\n inset: 1em,\n breakable: true\n)\n\n#show thm-selector(\"thm-group\", subgroup: \"proof\"): it => block(\n it,\n stroke: green + 1pt,\n inset: 1em,\n breakable: true\n)\n\n\n= Cardinalit\u00e0\n\n== Isomorfismi\n\nDue insiemi $A$ e $B$ sono *isomorfi* (_equinumerosi_) se esiste una biiezione tra essi. Formalmente scriviamo: $ A tilde B. $\n\nDetto $cal(U)$ l'insieme di tutti gli insiemi, la relazione $tilde$ \u00e8 sottoinsieme di $cal(U)^2$.\n\nDimostriamo che $tilde$ \u00e8 una relazione di equivalenza:\n- *riflessivit\u00e0*: $A tilde A$, usiamo come biiezione la funzione identit\u00e0 $i_A$;\n- *simmetria*: $A tilde B arrow.long.double B tilde A$, usiamo come biiezione la funzione inversa;\n- *transitivit\u00e0*: $A tilde B and B tilde C arrow.long.double A tilde C$, usiamo come biiezione la composizione della funzione usata per $A tilde B$ con la funzione usata per $B tilde C$.\n\nDato che $tilde$ \u00e8 una relazione di equivalenza, ci permette di partizionare l'insieme $cal(U)$. La partizione che ne risulta \u00e8 formata da classi di equivalenza che contengono insiemi isomorfi, ossia con la stessa cardinalit\u00e0.\n\nPossiamo, quindi, definire la *cardinalit\u00e0* come l'insieme quoziente di $cal(U)$ rispetto alla relazione $tilde$.\n\nQuesto approccio permette di confrontare tra loro la cardinalit\u00e0 di insiemi infiniti, dato che basta trovare una funzione biettiva tra i due insiemi per poter affermare che siano isomorfi.\n\n== Cardinalit\u00e0 finita\n\nLa prima classe di cardinalit\u00e0 che vediamo \u00e8 quella delle *cardinalit\u00e0 finite*. \n\nDefiniamo la seguente famiglia di insiemi: $ J_n = cases(emptyset & text(\" se \") n = 0, {1,...,n} & text(\" se \") n > 0) quad . $\n\nDiremo che un insieme $A$ ha cardinalit\u00e0 finita se e solo se $A tilde J_n$ per qualche $n in NN$. In tal caso possiamo scrivere $|A| = n$.\n\nLa classe di equivalenza $[J_n]_tilde$ identifica tutti gli insiemi di $cal(U)$ contenenti $n$ elementi.\n\n== Cardinalit\u00e0 infinita\n\nL'altra classe di cardinalit\u00e0 \u00e8 quella delle *cardinalit\u00e0 infinite*, ovvero gli insiemi non in relazione con $J_n$. Questi insiemi sono divisibili in:\n- insiemi *numerabili*;\n- insiemi *non numerabili*.\n\nAnalizziamo le due tipologie separatamente.\n\n=== Insiemi numerabili\n\nUn insieme $A$ \u00e8 numerabile se e solo se $A tilde NN$, ovvero $A in [NN]_tilde$.\n\nGli insiemi numerabili vengono detti anche \"*listabili*\", in quanto \u00e8 possibile elencare _tutti_ gli elementi dell'insieme $A$ tramite una regola, la funzione $f$ biettiva tra $NN$ e $A$. Grazie alla funzione $f$, \u00e8 possibile elencare gli elementi di $A$ formando l'insieme: $ A = {f(0), space f(1), space dots}. $ Questo insieme \u00e8 esaustivo, dato che elenca ogni elemento dell'insieme $A$ senza perderne nessuno.\n\nTra gli insiemi numerabili pi\u00f9 famosi troviamo:\n- numeri pari $PP$ e numeri dispari $DD$;\n- numeri interi $ZZ$, generati con la biiezione $f(n) = (-1)^n (frac(n + (n mod 2), 2))$;\n- numeri razionali $QQ$.\n\nGli insiemi numerabili hanno cardinalit\u00e0 $aleph_0$ (si legge _\"aleph zero\"_).\n\n=== Insiemi non numerabili\n\nGli *insiemi non numerabili* sono insiemi a cardinalit\u00e0 infinita ma che non sono listabili come gli insiemi numerabili: sono \"pi\u00f9 fitti\" di $NN$. Questo significa che ogni lista generata mancherebbe di qualche elemento e, quindi, non sarebbe esaustiva di tutti gli elementi dell'insieme.\n\nIl pi\u00f9 famoso insieme non numerabile \u00e8 l'insieme dei numeri reali $RR$.\n\n#theorem(numbering: none)[\n L'insieme $RR$ non \u00e8 numerabile ($RR tilde.not NN$).\n]\n\n#proof[\n \\ Suddividiamo la dimostrazione in tre punti:\n + dimostriamo che $RR tilde (0,1)$;\n + dimostriamo che $NN tilde.not (0,1)$;\n + dimostriamo che $RR tilde.not NN$.\n\n [1] Partiamo con il dimostrare che $RR tilde (0,1)$: serve trovare una biiezione tra $RR$ e $(0,1)$. Usiamo una rappresentazione grafica, costruita in questo modo:\n - disegnare la circonferenza di raggio $1/2$ centrata in $1/2$;\n - disegnare la perpendicolare al punto da mappare che interseca la circonferenza;\n - disegnare la semiretta passante per il centro $C$ e l'intersezione precedente.\n\n L'intersezione tra l'asse reale e la retta finale \u00e8 il punto mappato.\n\n #v(-36pt)\n\n #figure(\n image(\"assets/biiezione.svg\", width: 70%)\n )\n\n #v(12pt)\n\n In realt\u00e0, questo approccio ci permette di dire che $RR$ \u00e8 isomorfo a qualsiasi segmento di lunghezza maggiore di 0.\\\n La stessa biiezione vale anche sull'intervallo chiuso $[0,1]$, utilizzando la \"compattificazione\" $overset(RR, .) = RR union {plus.minus infinity}$ e mappando $0$ su $-infinity$ e $1$ su $+infinity$.\n\n [2] Continuiamo dimostrando che $NN tilde.not (0,1)$: serve dimostrare che l'intervallo $(0,1)$ non \u00e8 listabile, quindi che ogni lista che scrivo manca di almeno un elemento e per farlo proveremo a \"costruire\" proprio questo elemento.\\ Per assurdo, sia $NN tilde (0,1)$. Allora, possiamo listare gli elementi di $(0,1)$ esaustivamente come: $ 0.& space a_(00) space a_(01) space a_(02) space dots \\ 0.& space a_(10) space a_(11) space a_(12) space dots \\ 0.& space a_(20) space a_(21) space a_(22) space dots \\ 0.& space dots quad , $ dove con $a_(i j)$ indichiamo la cifra di posto $j$ dell'$i$-esimo elemento della lista.\n\n Costruiamo il numero $c = 0.c_0 c_1 c_2 dots$ tale che $ c_i = cases(2 quad & \"se\" a_(i i) eq.not 2, 3 & \"se\" a_(i i) = 2) quad . $\n In altre parole, questo numero viene costruito \"guardando\" le cifre sulla diagonale principale.\n\n Questo numero appartiene a $(0,1)$, ma non appare nella lista scritta sopra: ogni cifra $c_i$ del numero costruito differisce per almeno una posizione (quella sulla diagonale principale) da qualunque numero nella lista. Questo \u00e8 assurdo, visto che avevamo assunto $(0,1)$ numerabile $arrow.long.double NN tilde.not (0,1)$.\n\n [3] Terminiamo dimostrando che $RR tilde.not NN$ per transitivit\u00e0.\n \n Pi\u00f9 in generale, non si riesce a listare nessun segmento di lunghezza maggiore di 0.\n]\n\nQuesto tipo di dimostrazione (in particolare il punto [2]) \u00e8 detta *dimostrazione per diagonalizzazione*.\n\nL'insieme $RR$ viene detto *insieme continuo* e tutti gli insiemi isomorfi a $RR$ si dicono a loro volta continui. I pi\u00f9 famosi insiemi continui sono:\n- $RR$: insieme dei numeri reali;\n- $CC$: insieme dei numeri complessi;\n- $TT subset II$: insieme dei numeri trascendenti.\n\nVediamo due insiemi continui che saranno importanti successivamente.\n\n=== Insieme delle parti\n\nIl primo insieme che vediamo \u00e8 l'*insieme delle parti* di $NN$, detto anche _power set_, ed \u00e8 cos\u00ec definito: $ P(NN) = 2^NN = {S bar.v S \"\u00e8 sottoinsieme di\" NN}. $\n\n#theorem(numbering: none)[\n $P(NN) tilde.not NN$.\n]\n\n#proof[\n \\ Dimostriamo questo teorema tramite diagonalizzazione.\n \n Il *vettore caratteristico* di un sottoinsieme \u00e8 un vettore che nella posizione $p_i$ ha $1$ se $i in A$, altrimenti ha $0$.\n\n Rappresentiamo il sottoinsieme $A subset.eq NN$ sfruttando il suo vettore caratteristico: $ NN&: 0 space 1 space 2 space 3 space 4 space 5 space 6 space dots \\ A&: 0 space 1 space 1 space 0 space 1 space 1 space 0 space dots quad . $\n \n Per assurdo, sia $P(NN)$ numerabile. Vista questa propriet\u00e0, possiamo listare tutti i vettori caratteristici che appartengono a $P(NN)$ come: $ b_0 &= b_(00) space b_(01) space b_(02) space dots \\ b_1 &= b_(10) space b_(11) space b_(12) space dots \\ b_2 &= b_(20) space b_(21) space b_(22) space dots quad . $\n\n Vogliamo costruire un vettore che appartenga a $P(NN)$, ma non \u00e8 presente nella lista precedente. Definiamo il seguente: $ c = overline(b_(00)) space overline(b_(11)) space overline(b_(22)) dots $ che contiene nella posizione $c_i$ il complemento di $b_(i i)$.\n\n Questo vettore appartiene a $P(NN)$ (perch\u00e9 rappresenta sicuramente un suo sottoinsieme), ma non \u00e8 presente nella lista precedente perch\u00e9 \u00e8 diverso da ogni elemento in almeno una cifra, quella sulla diagonale principale.\n\n Questo \u00e8 assurdo perch\u00e9 abbiamo assunto che $P(NN)$ fosse numerabile, quindi $P(NN) tilde.not NN$.\n]\n\nVisto questo teorema possiamo concludere che: $ P(NN) tilde [0,1] tilde overset(RR, .). $\n\n=== Insieme delle funzioni\n\nIl secondo insieme che vediamo \u00e8 l'*insieme delle funzioni* da $NN$ in $NN$ cos\u00ec definito: $ NN_bot^NN = {f: NN arrow.long NN}. $\n\n#theorem(numbering: none)[\n $NN_bot^NN tilde.not NN$.\n]\n\n#proof[\n \\ Anche in questo caso useremo la diagonalizzazione.\n \n Per assurdo, assumiamo $NN_bot^NN$ numerabile. Possiamo, quindi, listare $NN_bot^NN$ come ${f_0, f_1, f_2, dots}$.\n\n #align(center)[\n #table(\n columns: (10%, 15%, 15%, 15%, 15%, 15%, 15%),\n inset: 10pt,\n align: horizon,\n\n [], [$0$], [$1$], [$2$], [$3$], [$dots$], [$NN$],\n\n [$f_0$], [$f_0 (0)$], [$f_0 (1)$], [$f_0 (2)$], [$f_0 (3)$], [$dots$], [$dots$],\n [$f_1$], [$f_1 (0)$], [$f_1 (1)$], [$f_1 (2)$], [$f_1 (3)$], [$dots$], [$dots$],\n [$f_2$], [$f_2 (0)$], [$f_2 (1)$], [$f_2 (2)$], [$f_2 (3)$], [$dots$], [$dots$],\n [$dots$], [$dots$], [$dots$], [$dots$], [$dots$], [$dots$], [$dots$], \n )\n ]\n\n Costruiamo una funzione $phi: NN arrow.long NN_bot$ per dimostrare l'assurdo. Una prima versione potrebbe essere la funzione $phi(n) = f_n (n) + 1$, per _disallineare_ la diagonale, ma questo non va bene: se $f_n (n) = bot$ non sappiamo dare un valore a $phi(n) = bot + 1$.\n\n Definiamo quindi la funzione $ phi(n) = cases(1 & \"se\" f_n (n) = bot, f_n (n) + 1 quad & \"se\" f_n (n) arrow.b) quad . $\n\n Questa funzione \u00e8 una funzione che appartiene a $NN_bot^NN$, ma non \u00e8 presente nella lista precedente. Infatti, $forall k in NN$ otteniamo $ phi(k) = cases(1 eq.not f_k (k) = bot & \"se\" f_k (k) = bot, f_k (k) + 1 eq.not f_k (k) quad & \"se\" f_k (k) arrow.b) quad . $\n \n Questo \u00e8 assurdo, perch\u00e9 abbiamo assunto $P(NN)$ numerabile, quindi $P(NN) tilde.not NN$.\n]\n" }, { "repo": "https://github.com/metamuffin/typst", "file": "https://raw.githubusercontent.com/metamuffin/typst/main/tests/typ/math/frac.typ", "language": "typst", "license": "Apache License 2.0", "content": "// Test fractions.\n\n---\n// Test that denominator baseline matches in the common case.\n$ x = 1/2 = a/(a h) = a/a = a/(1/2) $\n\n---\n// Test parenthesis removal.\n$ (|x| + |y|)/2 < [1+2]/3 $\n\n---\n// Test large fraction.\n$ x = (-b plus.minus sqrt(b^2 - 4a c))/(2a) $\n\n---\n// Test binomial.\n$ binom(circle, square) $\n\n---\n// Error: 8-13 missing argument: lower\n$ binom(x^2) $\n\n---\n// Test associativity.\n$ 1/2/3 = (1/2)/3 = 1/(2/3) $\n\n---\n// Test precedence.\n$ a_1/b_2, 1/f(x), zeta(x)/2, \"foo\"[|x|]/2 \\\n 1.2/3.7, 2.3^3.4 \\\n \ud83c\udff3\ufe0f\u200d\ud83c\udf08[x]/2, f [x]/2, phi [x]/2, \ud83c\udff3\ufe0f\u200d\ud83c\udf08 [x]/2 \\\n +[x]/2, 1(x)/2, 2[x]/2 \\\n (a)b/2, b(a)[b]/2 $\n" }, { "repo": "https://github.com/tingerrr/hydra", "file": "https://raw.githubusercontent.com/tingerrr/hydra/main/examples/pages.typ", "language": "typst", "license": "MIT License", "content": "#import \"/src/lib.typ\": hydra\n\n#set page(paper: \"a7\", margin: (y: 4em), numbering: \"1\", header: context {\n if calc.odd(here().page()) {\n align(right, emph(hydra(1)))\n } else {\n align(left, emph(hydra(2)))\n }\n line(length: 100%)\n})\n#set heading(numbering: \"1.1\")\n#show heading.where(level: 1): it => pagebreak(weak: true) + it\n\n= Introduction\n#lorem(50)\n\n= Content\n== First Section\n#lorem(50)\n== Second Section\n#lorem(100)\n" }, { "repo": "https://github.com/darioglasl/Arbeiten-Vorlage-Typst", "file": "https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/06_Ergebnisse/03_empfehlung.typ", "language": "typst", "license": "", "content": "== Empfehlungen zur Erg\u00e4nzung von ... \n" }, { "repo": "https://github.com/takotori/PhAI-Spick", "file": "https://raw.githubusercontent.com/takotori/PhAI-Spick/main/sections/kraft.typ", "language": "typst", "license": "", "content": "#import \"../utils.typ\": *\n\n= Kraft\n#grid(\n columns: (50%, auto),\n gutter: 5pt,\n [*Kraft:*], [$arrow(F)_\"res\"=m arrow(a)$],\n [*Gewichtskraft:*], [$F_G=m g $],\n [*Federkraft:*], [$F_F=D y space.quad D &= \"Federkonst.\" \\ y &= abs(l - l_0)$],\n [*Hook\\`sches Gesetz:*], [$Delta F=D dot Delta y$],\n [*Schiefe Ebene:* #image(\"../figures/kraftSchiefeEbene.png\")], [$F_G=m g$ \\\n #v(5pt)\n *Normalkraft:* \\ \n $F_N=m g dot cos(alpha) $ \\\n #v(5pt)\n *Hangabtriebskraft*: \\\n $F_H=m g dot sin(alpha)$ \\\n #v(5pt)\n *Haftreibungskraft:* \\\n $F_\"HR\"=\u03bc dot F_N$ #v(5pt)],\n [*Zentripetalkraft / \\ Zentrifugalkraft:*], [$F_Z=(m v^2)/r = m dot omega^2 dot r$],\n\n)\n#v(4pt)\n#grid(\n columns: (45%, auto),\n gutter: 2pt,\n image(\"../figures/Kreiskraefte.png\"),\n text(size: 6pt, [Die *Zentripetalkraft* und *Zentrifugalkraft* wirken bei einer beschleunigten Kreisbewegung und haben die gleiche Formel. Es handelt sich um entgegengesetzte Kr\u00e4fte, die abh\u00e4ngig von dem Bezugssystem sind. Wird eine Kreisbewegung von au\u00dfen betrachtet, wirkt nur die Zentripetalkraft. Befindet sich der Beobachter im rotierenden System nimmt er beide Kr\u00e4fte wahr.]),\n)\n\n== Kraft Statik\nIn der Statik bewegen sich die Objekte nicht. Dort gilt also: \\\n$ sum F=0, v(t) = 0 m slash s, a(t) = 0 m slash s^2 $\n\n#align(\n center,\n image(\"../figures/kraftStatik1.png\"),\n)\n\n$ \"X) \" F_s dot cos(colblue(18^circle.small)) &-\u03bc dot F_N &-F_G dot sin(colgreen(35^circle.small))=0 $ \\\n$ \"Y) \" F_s dot sin(colblue(18^circle.small)) &+F_N &-F_G dot cos(colgreen(35^circle.small))=0 $\n\n#image(\"../figures/kraftStatik2.png\")\n\nEin Gewicht der Masse $m = 10\"kg\"$ wird entsprechend der obigen Skizze durch Seile an einer Wand befestigt. Welche Kr\u00e4fte wirken im linken und rechten Seil?\n\n*1. Methode:*\n\n$ F_L/sqrt(3^2+4^2 ) vec(-3,4)+F_R/sqrt(8^2+6^2 ) vec(8,6)+m g vec(0,-1)=0 $\n\n*2. Methode*\n\n$ F_L vec(-cos(alpha),sin(alpha))+F_R vec(cos(beta),sin(beta))+m g vec(0,-1)=0 $\n\n#grid(\n columns: (auto, auto),\n gutter: 5pt,\n align: (center +bottom, center+bottom),\n image(\"../figures/kraftStatik3.png\"),\n image(\"../figures/kraftStatik4.png\")\n)\nEine $20 \"kN\"$ schwere Luftseilbahnkabine h\u00e4ngt reibungsfrei an einem Tragseil und wird durch ein Zugseil festgehalten. \n\nWie gross sind die Zugkr\u00e4fte im Zug- und im Tragseil?\n\n($alpha = 20^circle.small$ und $beta = 20^circle.small$)\n#v(5pt)\n$ \nF_\"S1\" = F_\"S2\" = F_T \n$\n$\nF_T vec(cos(180^circle.small - 20^circle.small),sin(180^circle.small - 20^circle.small)) +F_T vec(cos(20^circle.small),sin(20^circle.small)) \\ + F_Z vec(cos(20^circle.small),sin(20^circle.small)) + vec(0,-20 \"kN\")=0 \\\n==> F_T = 9.97 dot 10^4 N, F_Z = 8.48 dot 10^3 N\n$" }, { "repo": "https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024", "file": "https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/decide-scoring/entry.typ", "language": "typst", "license": "Creative Commons Attribution Share Alike 4.0 International", "content": "#import \"/packages.typ\": notebookinator\n#import notebookinator: *\n#import themes.radial.components: *\n\n#create-body-entry(\n title: \"Decide: Scoring Triballs\",\n type: \"decide\",\n date: datetime(year: 2023, month: 9, day: 2),\n author: \"\",\n witness: \"Violet Ridge\",\n)[\n We rated each option on:\n\n - Efficiency on a scale of 1 to 10\n - Stability on a scale of 1 to 10\n - Feasibility on a scale of 1 to 10.\n\n #decision-matrix(\n properties: ((name: \"Efficiency\"), (name: \"Stability\"), (name: \"Feasibility\")),\n (\"Extentable Hook\", 7, 4, 9),\n (\"Fold Out Flaps\", 10, 9, 10),\n (\"Shot Out Net\", 5, 3, 4),\n )\n\n #admonition(\n type: \"decision\",\n )[\n We chose the fold out flaps. This option is both the most effective in cost of\n actuators and also the simplest design, leading to it being overall the best\n choice.\n ]\n\n #heading[First Prototype]\n\n #grid(\n columns: (1fr, 1fr),\n gutter: 20pt,\n [\n Our first prototype was mainly comprised of L-channel. It featured a piston to\n push the L-channel forwards, mounted on the bottom of the drivetrain.\n\n #admonition(\n type: \"warning\",\n )[\n While this design was stable and powerful, it exposed the fitting of the piston\n outwards, making it very easy to hit.\n ]\n\n We decided to discard this design after discovering that there was no other way\n to mount the piston in this position without exposing it.\n\n ],\n image(\"./first-prototype.jpg\"),\n )\n\n]\n\n#create-body-entry(\n title: \"Decide: Scoring Triballs\",\n type: \"decide\",\n date: datetime(year: 2023, month: 9, day: 2), // TODO: correct to date of final cad creation\n author: \"\",\n witness: \"Violet Ridge\",\n)[\n #heading([Final Design])\n\n Our final design used a top mounted piston and a piece of C-channel as the wing\n base. This strikes the right balance between structural integrity and lightness,\n and also doesn't expose the piston to other robots.\n\n #grid(\n columns: (1fr, 1fr),\n gutter: 20pt,\n figure(image(\"./iso.png\"), caption: \"Isometric view\"),\n figure(image(\"./top.png\"), caption: \"Top view\"),\n figure(image(\"./side.png\"), caption: \"Side view\"),\n figure(image(\"./front.png\"), caption: \"Front view\"),\n )\n\n // TODO: add part diagrams and CAD\n\n #image(\"./1.png\")\n\n #image(\"./2.png\")\n\n]\n" }, { "repo": "https://github.com/fenjalien/metro", "file": "https://raw.githubusercontent.com/fenjalien/metro/main/tests/angle/angle-separator/test.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"/src/lib.typ\": *\n#set page(width: auto, height: auto, margin: 1cm)\n\n#ang(6, 7, 6.5)\n\n#ang(6, 7, 6.5, angle-separator: \" \")" }, { "repo": "https://github.com/PauKaifler/typst-template-dhbw", "file": "https://raw.githubusercontent.com/PauKaifler/typst-template-dhbw/main/README.md", "language": "markdown", "license": "Apache License 2.0", "content": "# Typst DHBW Template\nThis template is my interpretation of the guidelines required by the DHBW Stuttgart and Ravensburg.\nI wrote it for my 2023 bachelor thesis, and it is compatible with Typst 0.11.1.\n\nWhile I am no longer a student at the DHBW, I do accept pull requests and I intend to resolve any issues that might arise in the future.\n\n## Setup\nThis template requires you to separately download the DHBW Logo.\n\nYou can download it from and save it in the same directory the `template.typ` is stored in as `dhbw-logo.svg`.\nYou may run the following command in said directory to do that:\n```sh\ncurl https://upload.wikimedia.org/wikipedia/de/1/1d/DHBW-Logo.svg -o dhbw-logo.svg\n```\n\n## Example\nYou can check out how this template can be used in the [example.typ](./example.typ) found within this repository.\nThe following is the first page of that document:\n![first page of a rendered sample document](./example.png)\n\n## License\nThis repository is dual-licensed under the [MIT](https://choosealicense.com/licenses/mit/) and [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) license.\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/codetastic/0.1.0/util.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"@preview/cetz:0.1.1\"\n#import cetz.draw: rect\n\n\n#let to-arr(code) = {\n if type(code) == \"integer\" {\n code = str(code)\n }\n if type(code) == \"string\" {\n code = code.clusters().map(int)\n }\n if type(code) != \"array\" {\n panic(\"Code needs to be provided as integer, string or array. Got \" + type(code))\n }\n return code\n}\n\n#let to-int-arr(code) = {\n return to-arr(code).map(int)\n}\n\n#let weighted-sum(nums, weights) = {\n let w-func\n if type(weights) == \"array\" {\n w-func = (i) => {\n return weights.at(calc.rem(i, weights.len()))\n }\n } else if type(weights) == \"function\" {\n w-func = weights\n }\n return nums.enumerate().fold(0, (s,v) => {\n let (i, n) = (..v)\n s + n * w-func(i)\n })\n}\n\n#let check-code(\n code, digits, generator, tester\n) = {\n if code.len() == digits - 1 {\n code.push(generator(code))\n } else if code.len() == digits {\n if not tester(code) {\n panic(\"Checksum failed for code \" + repr(code) + \". Should be \" + str(generator(code.slice(0,-1))))\n }\n } else {\n panic(\"Code has to be \" + (digits - 1) + \" digits (excluding checksum). Got \" + code.len())\n }\n return code\n}\n\n#let draw-bars(bits, width:0.264mm, height:18.28mm, bg: white, fg: black) = {\n // Draw background rect to set fixed size\n rect((0,0), (bits.len() * width, height), fill:bg, stroke:none, name:\"code-bg\")\n\n // Cluster bits to draw thick bars\n // as one rect\n bits = bits.fold((), (c, v) => {\n if v {\n if c == () or c.last() == 0 {\n c.push(1)\n } else {\n c.at(-1) += 1\n }\n } else {\n c.push(0)\n }\n c\n })\n\n // Draw bars\n let i = 0\n for bit in bits {\n if bit > 0 {\n rect(\n (i*width,0),\n (rel:(bit*width,height)),\n fill:fg, stroke:none\n )\n i += bit\n } else {\n i += 1\n }\n }\n}\n\n#let draw-rect(at, width, height, fill: white, ..style) = {\n rect(\n at,\n (rel:(width,height)),\n fill: fill, stroke:none,\n ..style\n )\n}\n\n\n/// Draw a bitfield of binary data as a 2d code matrix.\n///\n/// Bits will be drawn from the top left to the bottom right.\n/// `bits.at(0).at(0)` is located at coordinate `(0,0)` and\n/// `bits.at(-1).at(-1)` is located at the last coordinate\n/// on the bottom right.\n#let draw-matrix(\n bitfield,\n quiet-zone: 4,\n size: 3mm,\n bg: white,\n fg: black\n) = {\n let (w, h) = (bitfield.first().len(), bitfield.len())\n let (x, y) = (quiet-zone, quiet-zone)\n\n // Draw background rect to set fixed size\n rect((0,0), ((w+2*quiet-zone) * size, (h+2*quiet-zone) * -size), fill:bg, stroke:none, name:\"code-bg\")\n\n // Draw modules\n for i in range(h) {\n for j in range(w) {\n if bitfield.at(i).at(j) {\n rect(\n ((x + j) * size, (y + i) * -size),\n (rel:(size, -size)),\n fill:fg, stroke:none\n )\n }\n }\n }\n}\n" }, { "repo": "https://github.com/Myriad-Dreamin/tinymist", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/post_type_check/with_builtin.typ", "language": "typst", "license": "Apache License 2.0", "content": "#let g = rgb.with(/* position */);" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/list-attach_03.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n// Test non-attached tight list.\n#set block(spacing: 15pt)\nHello\n- A\nWorld\n\n- B\n- C\n\nMore.\n" }, { "repo": "https://github.com/andreasKroepelin/lovelace", "file": "https://raw.githubusercontent.com/andreasKroepelin/lovelace/main/examples/label-low-level.typ", "language": "typst", "license": "MIT License", "content": "#import \"../lib.typ\": *\n#set page(width: auto, height: auto, margin: 1em)\n#set text(font: \"TeX Gyre Pagella\")\n#show math.equation: set text(font: \"TeX Gyre Pagella Math\")\n\n#pseudocode(\n with-line-label()[do something],\n with-line-label()[do something important],\n [go back to @start],\n)\n\nThe relevance of the step in @important cannot be overstated.\n" }, { "repo": "https://github.com/yaoyuanArtemis/resume", "file": "https://raw.githubusercontent.com/yaoyuanArtemis/resume/main/data.typ", "language": "typst", "license": "Do What The F*ck You Want To Public License", "content": "#import \"template.typ\": *\n\n#let name = \"\"\n#let namezh = \"\u5218\u5cf0\"\n#let email = [\n #icon(\"email.svg\") \n]\n#let phone = [\n #icon(\"phone.svg\")\n (+86) 18520170194\n]\n#let home = [\n #icon(\"home.svg\")\n #link(\"https://yaoyuanartemis.github.io/\")[ yaoyuanartemis.github.io ]\n]\n#let github = [\n #icon(\"github.svg\")\n #link(\"https://github.com/yaoyuanArtemis\")[ yaoyuanArtemis ]\n]\n#let linkin = [\n #icon(\"linkedin.svg\")\n #link(\"https://www.linkedin.com/in/%E5%B3%B0-%E5%88%98-2a7a8b2b8/\")[ ]\n]\n\n#let author = (\n name: name,\n email: email,\n phone: phone,\n home: home,\n github: github,\n linkin: linkin,\n)\n#let authorzh = (\n name: namezh,\n email: email,\n phone: phone,\n home: home,\n github: github,\n linkin: linkin,\n)\n\n#let selftitle = [ Self Introduction ]\n#let selftitlezh = [ \u81ea\u6211\u603b\u7ed3 ]\n#let self = [\n I am passionate about pursuing technological advancements and have an unrelenting pursuit of knowledge, particularly in the field of computer science. Additionally, I enjoy meeting interesting people and experiencing diverse aspects of society. Whether it's the culture and phenomena in China or around the world, I am full of curiosity and eager to explore.\n]\n#let selfzh = [\n \u6211\u70ed\u8877\u4e8e\u8ffd\u6c42\u6280\u672f\u8fdb\u6b65\uff0c\u5bf9\u77e5\u8bc6\u6709\u7740\u4e0d\u61c8\u7684\u8ffd\u6c42\uff0c\u5c24\u5176\u662f\u5728\u8ba1\u7b97\u673a\u9886\u57df\u3002\u540c\u65f6\uff0c\u6211\u4e5f\u4e50\u4e8e\u5728\u793e\u4f1a\u4e2d\u7ed3\u8bc6\u6709\u8da3\u7684\u4eba\u548c\u4e8b\uff0c\u6df1\u5165\u4e86\u89e3\u793e\u4f1a\u7684\u5404\u4e2a\u65b9\u9762\u3002\u65e0\u8bba\u662f\u4e2d\u56fd\u8fd8\u662f\u4e16\u754c\u5404\u5730\u7684\u6587\u5316\u548c\u73b0\u8c61\uff0c\u6211\u90fd\u5145\u6ee1\u597d\u5947\u5e76\u6e34\u671b\u63a2\u7d22\u3002\n]\n\n#let edutitle = [ Education ]\n#let edutitlezh = [ \u6559\u80b2\u7ecf\u5386 ]\n#let edu = [\n #datedsubsection(\n align(left)[\n *Anhui University \uff08211\uff09 the gifted class of computer science* \\\n - GPA:3.30/4\n - Languages: Chinese Grade A,English IELTS 6.5\n - Programming Capabilities:CCF-CSP 180 \n - Relevant Courses:Principles of Computer Organization,Data Structures,Operating Systems,Computer Networks,Database Principles,Object-Oriented Programming,Digital Image Processing,Big Data Technology,Machine Learning,Pattern Recognition,Optimization Methods,Mathematical Modeling (Advanced Class),Artificial Intelligence,Principles of Compilers,Writing International Academic Papers (Graduate Course)\n - Honors and Awards:Second-Class Scholarship for Academic Excellence,Anhui Province Big Data Competition\n ],\n align(right)[\n Hefei, China \\\n 2017.9 - 2021.6\n ]\n )\n]\n#let eduzh = [\n #datedsubsection(\n align(left)[\n *\u5b89\u5fbd\u5927\u5b66 \uff08211\uff09 \u8ba1\u7b97\u673a\u79d1\u5b66\u4e0e\u6280\u672f\u82f1\u624d\u73ed* \\\n - GPA:3.30/4\n - \u8bed\u8a00:\u4e2d\u6587\u4e8c\u7ea7\u7532\u7b49\u3001\u82f1\u6587IELTS6.5\n - \u8ba1\u7b97\u673a\u7f16\u7a0b\uff1aCCF-CSP 180\n - \u76f8\u5173\u8bfe\u7a0b\uff1a\u8ba1\u7b97\u673a\u7ec4\u6210\u539f\u7406\uff0c\u6570\u636e\u7ed3\u6784\uff0c\u64cd\u4f5c\u7cfb\u7edf\uff0c\u8ba1\u7b97\u673a\u7f51\u7edc\uff0c\u6570\u636e\u5e93\u539f\u7406\uff0c\u9762\u5411\u5bf9\u8c61\u7a0b\u5e8f\u8bbe\u8ba1\uff0c\u6570\u5b57\u56fe\u50cf\u5904\u7406\uff0c\u5927\u6570\u636e\u6280\u672f\uff0c\u673a\u5668\u5b66\u4e60\uff0c\u6a21\u5f0f\u8bc6\u522b\uff0c\u6700\u4f18\u5316\u65b9\u6cd5\uff0c\u6570\u5b66\u5efa\u6a21(\u63d0\u9ad8\u73ed)\uff0c\u4eba\u5de5\u667a\u80fd\uff0c\u7f16\u8bd1\u539f\u7406\uff0c\u56fd\u9645\u5b66\u672f\u8bba\u6587\u64b0\u5199(\u7814\u7a76\u751f\u8bfe\u7a0b)\n - \u8363\u8a89\u5956\u9879\uff1a\u5b66\u4e60\u4f18\u79c0\u4e8c\u7b49\u5956\u5b66\u91d1\u3001\u5b89\u5fbd\u7701\u5927\u6570\u636e\u7ade\u8d5b\n ],\n align(right)[\n \u5408\u80a5.\u4e2d\u56fd \\\n 2017.9 - 2021.6\n ]\n )\n]\n\n#let techtitle = [ Technical Skills ]\n#let techtitlezh = [ \u9879\u76ee\u6280\u80fd ]\n#let tech = [\n - *Programming*: \n - Proficient in Python and C++, which were the primary languages used for university coursework.\n - Learned and used Java, MATLAB, HTML, LaTeX, and Typst.\n - Familiar with HTML5, CSS, JavaScript, and TypeScript, and frequently used in practical work.\n - Experienced with Node.js, Midway.js, and familiar with Egg.js and Nest.js for full-stack development.\n - Used Spring Boot, MyBatis, and Restful technologies for API development in a company context.\n - *Key words*: Node.js TypeScript Nest.js HTML5 CSS\n - *Tools*: \n - Proficient in using the Scrapy framework and have developed a gaming combat system using the Django framework.\n - Experienced with databases such as MySQL and SQL Server.\n - Studied \"Machine Learning\" and \"Pattern Recognition,\" and am familiar with related algorithms.\n - Configured clusters for Apache and MySQL.\n - Utilized distributed web crawlers and scraping technologies such as BeautifulSoup, Scrapy, and regular expressions (Re).\n]\n#let techzh = [\n - *\u7f16\u7a0b\u8bed\u8a00*: \n - \u8bed\u8a00 Python C++\u8f83\u4e3a\u719f\u6089,\u5927\u5b66\u5927\u8bfe\u7a0b\u4f5c\u4e1a\u4f7f\u7528\u7684\u4e3b\u529b\u8bed\u8a00,Java Matlab Html Latex Typst\u5b66\u4e60\u5e76\u4f7f\u7528\n - \u719f\u6089HTML5\u3001CSS\u3001 JavaScript\u3001TypeScript,\u5e76\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d\u7ecf\u5e38\u4f7f\u7528\n - \u4f7f\u7528\u8fc7NodeJs MidWayJS,\u4f1a\u4f7f\u7528EggJs NestJS\u7b49\u5168\u6808\u6280\u672f\u6808\n - \u4f7f\u7528SpringBoot\u3001Myabtis\u3001Restful\u7b49Java\u6280\u672f\u6808,\u5728\u516c\u53f8\u7528\u4f5c\u63a5\u53e3\u5f00\u53d1\u6280\u672f\n - *\u5de5\u5177*:\n - \u4f1a\u4f7f\u7528Scrapy\u6846\u67b6,\u4f7f\u7528\u8fc7Django\u6846\u67b6\u5f00\u53d1\u6e38\u620f\u5bf9\u6218\u7cfb\u7edf\n - \u4f1a\u4f7f\u7528 MySql\u3001SqlSever\u7b49\u6570\u636e\u5e93\n - \u5b66\u4e60\u300a\u673a\u5668\u5b66\u4e60\u300b\u3001\u300a\u6a21\u5f0f\u8bc6\u522b\u300b\uff0c\u5bf9\u673a\u5668\u5b66\u4e60\u76f8\u5173\u7b97\u6cd5\u8f83\u4e3a\u719f\u6089\n - \u914d\u7f6e\u8fc7Apache\u3001MySql\u7b49\u96c6\u7fa4\u642d\u5efa\n - \u4f7f\u7528\u5206\u5e03\u5f0f\u722c\u866b,BeautifulSoup\u3001Scrapy\u3001Re\u505a\u722c\u53d6\u6280\u672f\n]\n\n#let projecttitle = [ Project Experience ]\n#let projecttitlezh = [ \u9879\u76ee\u7ecf\u5386 ]\n#let projectexperience = [\n #datedsubsection(\n align(left)[\n *China Merchants Bank. CMB Technology (Shenzhen) Co., Ltd.* \\\n Developer\n ],\n align(right)[\n 2021.7 - 2023.9\n ]\n )\n\n - After joining the company through campus recruitment, I participated in the development of the cloud operations platform, specifically the OracleDM platform (a platform for operating Oracle databases). I primarily served as a frontend developer, using React 17, TypeScript, and Ant Design for web development and API data acquisition.\n - #lorem(8)\n\n #datedsubsection(\n align(left)[\n *Alibaba. Zhejiang Fliggy Network Technology Co., Ltd.* \\\n Frontend Developer and Operations (Ops)\n ],\n align(right)[\n 2021.7 - 2023.9\n ]\n )\n\n - Development of the Backend System \"Jellyfish\" for Risk Control\n - Included API calls for data and permission interfaces, and integration of event tracking.\n - Independently developed a policy document parsing tool.\n - Automated the parsing of airline policies from Excel, achieving a coverage of 10 airlines by February with an automation rate of 75%.\n - Supported policy document types include Word 2007, Word 2003, Excel 2007, and Excel 2003.\n - By building automatic parsing capabilities for airline policy documents, improved operational efficiency, reducing the time required to process complex policy documents from one day to within two hours.\n - Developed basic pages for the backend ticketing operations system.\n]\n#let projectexperiencezh = [\n #datedsubsection(\n align(left)[\n *\u62db\u5546\u94f6\u884c.\u62db\u94f6\u7f51\u7edc\u79d1\u6280(\u6df1\u5733)\u6709\u9650\u516c\u53f8* \\\n \u5f00\u53d1\u8005\n ],\n align(right)[\n 2021.7 - 2023.9\n ]\n )\n\n - \u6821\u62db\u5165\u804c\u540e\u53c2\u4e0e\u516c\u53f8\u7684\u4e91\u8fd0\u7ef4\u5e73\u53f0\u5f00\u53d1\uff0c\u5177\u4f53\u662f\u5e73\u53f0\u4e2d\u7684OracleDM\u5e73\u53f0\u5f00\u53d1\uff08\u884c\u5185\u5bf9Oracle\u6570\u636e\u5e93\u505a\u64cd\u4f5c\u7684\u5e73\u53f0\uff09\u4e3b\u8981\u662f\u62c5\u4efb\u524d\u7aef\u5f00\u53d1\u5de5\u7a0b\u5e08\uff0c\u4f7f\u7528React17\u3001TypeScript\u3001AntDesign\u505a\u7f51\u9875\u5f00\u53d1\u4ee5\u53ca\u63a5\u53e3\u5bf9\u63a5\n - \u4f7f\u7528SpringBoot\u6280\u672f\u505a\u63a5\u53e3\u5f00\u53d1\n\n #datedsubsection(\n align(left)[\n *\u963f\u91cc\u5df4\u5df4.\u6d59\u6c5f\u98de\u732a\u7f51\u7edc\u6280\u672f\u6709\u9650\u516c\u53f8* \\\n \u524d\u7aef\u5f00\u53d1\u5de5\u7a0b\u5e08\u4ee5\u53ca\u8fd0\u7ef4\n ],\n align(right)[\n 2023.9 - 2024.5\n ]\n )\n\n - \u5f00\u53d1\u98ce\u63a7\u4e2d\u540e\u53f0\u7cfb\u7edf\u201c\u6c34\u6bcdJellyfish\u201d\u5f00\u53d1\n - \u5305\u62ec\u6570\u636e\u63a5\u53e3\u8c03\u7528\u3001\u6743\u9650\u63a5\u53e3\u8c03\u7528\u3001\u57cb\u70b9\u63a5\u5165\n - \u72ec\u7acb\u5f00\u53d1\u653f\u7b56\u6587\u4ef6\u89e3\u6790\u5de5\u5177\n - \u9488\u5bf9\u822a\u53f8\u653f\u7b56\u89e3\u6790excel\u6295\u4ea7\uff0c\u7d2f\u8ba1\u81f32\u6708\uff0c\u822a\u53f8\u8986\u76d6\u7387\u5df2\u8fbe10\u4e2a\uff0c\u81ea\u52a8\u5316\u7387\u8fbe\u523075%\n - \u653f\u7b56\u6587\u4ef6\u7c7b\u578b\u652f\u6301word2007\u3001word2003\u3001excel2007\u3001excel2003\n - \u901a\u8fc7\u5efa\u8bbe\u822a\u53f8\u653f\u7b56\u6587\u4ef6\u81ea\u52a8\u89e3\u6790\u80fd\u529b\uff0c\u63d0\u9ad8\u8fd0\u8425\u6295\u653e\u51c6\u5907\u5de5\u4f5c\u6548\u7387\uff0c\u4f7f\u5f97\u590d\u6742\u653f\u7b56\u6587\u4ef6\u7531\u4e00\u5929\u7f29\u77ed\u81f32\u5c0f\u65f6\u5185\n \u653f\u7b56\u89e3\u6790\u5de5\u5177\u3001\u673a\u7968\u8fd0\u8425\u4e2d\u540e\u53f0\u3001\u6c34\u6bcd\u98ce\u63a7\u90fd\u662f\u524d\u7aef\u4e3b\u5bfc\u9879\u76ee\n - \u5f00\u53d1\u57fa\u672c\u7684\u673a\u7968\u8fd0\u8425\u4e2d\u540e\u53f0\u9875\u9762\n]\n\n#let activitytitle = [ Research Experience ]\n#let activitytitlezh = [ \u79d1\u7814\u7ecf\u5386 ]\n#let activityzh = [\n #datedsubsection(\n align(left)[\n *\u5c5e\u6027\u7f51\u7edc\u793e\u56e2\u68c0\u6d4b* \\\n \u672c\u79d1\u671f\u95f4\u53d1\u8868\u5b66\u672f\u8bba\u6587 A Reduced Mixed Representation Based Multi-Objective Evolutionary Algorithm for Large-Scale Overlapping Community Detection DOI: 10.1109/CEC45853.2021.9504894 \u5c5e\u4e8e\u5b89\u5fbd\u5927\u5b66\u6559\u80b2\u90e8\u8ba1\u7b97\u667a\u80fd\u4e0e\u4fe1\u606f\u5904\u7406\u91cd\u70b9\u5b9e\u9a8c\u5ba4\u6210\u679c\n ],\n align(right)[\n 2019-2021\n ]\n )\n\n // #datedsubsection(\n // align(left)[\n // *#lorem(8) *\\\n // #lorem(4)\n // ],\n // align(right)[\n // 202x - _present_\n // ]\n // )\n\n // #lorem(16)\n\n // #datedsubsection(\n // align(left)[\n // *#lorem(8)* \\\n // #lorem(4)\n // ],\n // align(right)[\n // 202x\n // ]\n // )\n\n // - #lorem(8)\n // - #lorem(8)\n]\n#let activity = [\n #datedsubsection(\n align(left)[\n *Attribute-Based Network Community Detection* \\\n Published Academic Papers During Undergraduate Studies: A Reduced Mixed Representation Based Multi-Objective Evolutionary Algorithm for Large-Scale Overlapping Community Detection DOI: 10.1109/CEC45853.2021.9504894.\n Achievement of the Key Laboratory of Computational Intelligence and Information Processing, Ministry of Education, Anhui University\n ],\n align(right)[\n 2019-2021\n ]\n )\n]\n\n#let hobbiestitle = [ Hobbies and Interests ]\n#let hobbiestitlezh = [ \u5174\u8da3\u7231\u597d ]\n#let hobbieszh = [\n - *\u6587\u5316*: \u559c\u6b22\u4e86\u89e3\u5b66\u4e60\u5730\u7406\u3001\u4e16\u754c\u53f2\u548c\u4e2d\u56fd\u53f2\u3001\u5b8f\u89c2\u7ecf\u6d4e\n - *\u8fd0\u52a8*: \u559c\u6b22\u8e22\u8db3\u7403\uff0c\u4e3b\u961f\u7687\u9a6c\uff1b\u6237\u5916\u953b\u70bc\uff0c\u6e38\u6cf3\uff0c\u6ed1\u96ea\u4e5f\u6709\u4e0d\u5b9a\u671f\u8fdb\u884c\n]\n#let hobbies = [\n - *Culture*: Enjoys Learning About Geography, World History, Chinese History, and Macroeconomics\n - *Sports*: Enjoys playing soccer (main team: Real Madrid); also regularly engages in outdoor activities such as swimming and skiing.\n]\n" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/flow-orphan_00.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n#set page(height: 100pt)\n#lorem(12)\n\n= Introduction\nThis is the start and it goes on.\n" }, { "repo": "https://github.com/TheWebDev27/Calc-II-Honors-Project", "file": "https://raw.githubusercontent.com/TheWebDev27/Calc-II-Honors-Project/main/part2.typ", "language": "typst", "license": "", "content": "#set text(\n font: \"New Computer Modern\",\n size: 10pt\n)\n\n#set par(\n leading: .75em\n)\n\n#set align(center)\n\n= The Nonstandard Approach\n\n#set align(left)\n\nOne drawback with the real analysis approach involving the epsilon-delta definition of the limit is its cumbersome notation. Proofs can quickly become cluttered with absolute values and inequalities that at times can be challenging to keep track of and connect to one another. By formalizing the idea of the infinitesimal to where basic algebraic techniques can be applied to it, a new system of analysis can be developed to study the same material that real analysis does while taking advantage of simpler and more concise notation.\n\\ \n\n#text(14pt)[\n Introduction\n]\n\nThis introduction follows section 1.4 of\n\n#set align(center)\n\n. (1976). _Foundations of Infinitesimal Calculus_, & Schmidt.\n\n#set align(left)\n\nLet us first consider two points on the parabola $f(x) = x^2$. One will be a fixed point at $(x_0, y_0)$, while the other will lie some distance away at $(x_0 + Delta x, y_0 + Delta y)$ where $Delta x$ and $Delta y$ represent the horizontal and vertical distances between the two points.\n\n#set text(9pt)\n\n#figure(\n image(\"images/parabola slope.png\", width: 60%),\n caption: [$(x_0, y_0)$ and $(x_0 + Delta x, y_0 + Delta y)$ on $f(x)=x^2$]\n)\n\n#set text(10pt)\n\nThe average slope between any two points $(x_1, y_1)$ and $(x_2, y_2)$ is the ratio of the change in $y$ to the change in $x$:\n\n#set align(center)\n\n$display((Delta y) / (Delta x)=(y_2-y_1)/(x_2-x_1)).$\n\n#set align(left)\n\nTherefore, the average slope between the two points on the parabola above is \\\n\n#set align(center)\n\n#h(125pt) $display(((y_0 + Delta y) - y_0)/((x_0 + Delta x) - x_0)).$ #h(110pt) (1)\n\n#set align(left)\n\nThe function is $f(x)=x^2$, so any $y$ value is determined by plugging in its corresponding input $x$ into it. The points then become $(x_0, x_0^2)$ and $(x_0 + Delta x, (x_0 + Delta x)^2)$. Substituting in these new $y$ coordinates into $(1)$ gives\n\n#set align(center)\n\n$display((Delta y)/(Delta x)) &= display(((x_0 + Delta x)^2 - x_0^2)/((x_0 + Delta x) - x_0))\n\\\n&= display(([x_0^2+2x_0 Delta x + (Delta x)^2] - x^2_0)/((x_0+Delta x) - x_0))\n\\\n&= display((2x_0 Delta x + (Delta x)^2)/(Delta x))\n\\\n#h(105pt) &= 2x _0 + Delta x. #h(145pt) (2)\n$\n\n#set align(left)\n\n(2) gives us the slope in terms of a fixed point's $x$-coordinate and its horizontal distance $Delta x$ from some variable point. If we want to find the slope of a line that lies *tangent* to the curve -- meaning that it intersects the curve at exactly one point -- at $(x_0, x_0^2)$, then we can treat $Delta x$ as a very small number so that the tangent line's slope is very close to (2). We #emph[cannot] set $Delta x$ equal to zero, because (2) follows from a quotient where $Delta x$ is present in the denominator of a quotient. Anyhow, treating it as a miniscule value leads to the intuitive result that the slope of some line tangent to the point $(x_0, x_0^2)$ on the parabola is essentially\n\n#set align(center)\n\n$2x_0.$\n\n#set align(left)\n\nThis loose usage of an infinitesimal -- treating a value as infinitely small to where it can be ignored -- has in fact produced decently accurate results throughout the development of calculus over the past several centuries, being used by those such as Newton, Leibniz, Euler, and others in varying forms. However, it is by no means rigorous and does not establish results with absolute certainty. Why? This is because we are left with a problem: How do we know exactly when numbers are small enough to be treated as negligible in a calculation? \n\nThis now brings us to our first formal definition: \n\n#set text(font: \"Source Serif\")\n#set align(center)\n\n#grid(\n columns: 80%,\n rows: auto,\n [\n #set align(left)\n\n An *infinitesimal* is a number $epsilon$ where\n\n #set align(center)\n\n $-a. (2012). _A Brief Introduction to Infinitesimal Calculus_, can be found at \\ https://homepage.math.uiowa.edu/~stroyan/InfsmlCalculus/Lecture1/Lect1.pdf.\n\n#set align(left)\n\nIt is due time for us to see how infinitesimal logic can be used to provide basic intuitive argumentation for a couple of ideas seen in calculus.\n\n#set text(font: \"Source Serif\")\n#set align(center)\n\n#grid(\n columns: 80%,\n rows: auto,\n [\n #set align(left)\n\n *Theorem 4 - The Extreme Value Theorem* \\\n Consider a function $f(x)$ that is continuous on a closed interval $[a, b]$. There then exist two numbers $x_(min)$ and $x_(max)$ at which $f(x)$ achieves its minimum and maximum values respectively where\n\n #set align(center)\n\n $f(x_(min)) <= f(x) <= f(x_(max))$\n\n #set align(left)\n\n for all other $x$'s.\n ]\n)\n\n#set text(font: \"New Computer Modern\")\n#set align(left)\n\n#set text(9pt)\n\n#figure(\n image(\"images/extreme value theorem.png\", width: 50%),\n caption: [Extreme value theorem visualized]\n)\n\n#set text(10pt)\n\nThe extreme value theorem asserts that if a function smoothly travels over an interval of inputs, then it must take on a minimum and a maximum value at some inputs $x_(min)$ and $x_(max)$.\n\n*Continuity* entails that the outputs of a function are close to one another if the inputs are close. In other words, a small change in the input should only ever produce a proportionately small change in the output. Mathematically speaking, a function $f(x)$ is continuous on a closed interval $[a,b]$ only when\n\n#set align(center)\n\n$a <= x_1 approx x_2 <= b arrow.r.double.long f(x_1) approx f(x_2)$\n\n#set align(left)\n\nwhere the $approx$ symbol means that two quantities are _approximately_ equal (very close to one another).\n\nWith this property fleshed out, we can now go about providing an intuitive argument for the extreme value theorem. We start by dividing up the interval $[a,b]$ into small increments like so:\n\n#set align(center)\n\n$display(a < a + (b-a)/H < a + (2(b-a))/H < dots.h.c < a + (k(b-a))/H < dots.h.c < b) $,\n\n#set align(left)\n\nwhere $b-a$ is the length of the interval, $H$ is the number of parts the interval is partitioned into, and $k$ is a positive integer between 1 and $H$. Amongst the partition points, $f(x)$ achieves some maximum \n #v(-2pt) value at one (or possibly more than one) of the partition points $x_M=display(a + (k(b-a))/H)$, so\n\n#set align(center)\n\n#v(5pt) $f(x_M) >= f(x_1)$ for any $x_1=display(a + (j(b-a))/H), j \n!= k$.\n\n#set align(left)\n\n#v(2pt)We know that any input $x$ in the interval $[a, b]$ lies within a distance of $display((b-a)/(2H))$ from one of the\n#v(-2pt) partition points. To see why, consider the closed interval [2,12] divided into 5 equal subintervals ($H = 5$) so that the partition points are\n\n#set align(center)\n\n$display(2\\, #h(10pt) 2 + (12-2)/5\\, #h(10pt) 2 + (2(12-2))/5\\, #h(10pt) 2 + (3(12-2))/5\\, #h(10pt) 2 + (4(12-2))/5\\, #h(10pt) 2 + (5(12-2))/5) \\\n= #h(5pt) 2, #h(5pt) 4, #h(5pt) 6, #h(5pt) 8, #h(5pt) 10, #h(5pt) 12.$\n\n#set align(left)\n\nSince the size of the interval is 10, and it is being partitioned into 5 subintervals, the distance between each partition point is\n\n#set align(center)\n\n$display((b-a)/H = (12 - 2)/5 = 2).$\n\n#set align(left)\n\nand \n\n#set align(center)\n\n$display((b-a)/(2H) = 1).$\n\n#set text(9pt)\n\n#figure(\n image(\"images/number line.png\", width: 70%),\n caption: [Partition points visualized]\n)\n\n#set align(left)\n#set text(10pt)\n\nIf we think of the quantity $display((b-a)/(2H))$ as half of the distance between consecutive partition points and \n#v(-2pt) imagine a one-dimensional radius of $display((b-a)/(2H))$ around each partition, then we can see that these radii \n#v(0pt)cover all of the values between the partition points. Therefore, any value of $x$ within the interval must \n#v(0pt) lie within a distance of $display((b-a)/(2H))$ from one of the partition points. \\\n\nIf we now let $H$ grow exceedingly large to the point where $display((b-a)/(2H))$ becomes infinitesimal, then the set of \n#v(-2pt) partition points will eventually \"fill up\" the rest of the interval $[a,b]$ so that any value of $x$ within the interval lies infinitely close to one of the partition points. In others words,\n\n#set align(center)\n\n$x approx x_1$ for any $x$ in $[a,b]$,\n\n#set align(left)\n\nwhich means\n\n#set align(center)\n\n$f(x_M) >= f(x_1) approx f(x)$,\n\n#set align(left)\n\nand this gives us the approximate maximum of $f(x)$. A similar argument can then be made for the approximation of the function's minimum, and this concludes the intuitive argument for the extreme value theorem, although this is by no means a formal proof.\\ \\" }, { "repo": "https://github.com/Geson-anko/vconf24_template_typst", "file": "https://raw.githubusercontent.com/Geson-anko/vconf24_template_typst/main/sample.typ", "language": "typst", "license": "", "content": "// sample.typ\n#import \"vconf2024.typ\": conf\n\n#show: doc => conf(\n title: \"\u30d0\u30fc\u30c1\u30e3\u30eb\u5b66\u4f1a2024\u8981\u65e8\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff08\u30bf\u30a4\u30c8\u30eb\u3092\u8a18\u5165\uff09\",\n authors: (\n (name: [hinoride#super[1]], contact: \"Twitter: @hiddenotna\"),\n (name: [\u306f\u3053\u3064\u304d#super[2]], contact: \"E-mail: \"),\n (name: [Lcamu#super[2]], contact: \"Twitter: @ogtonvr180426\"),\n ),\n affiliations: ([#super[1]\u30c8\u30e9\u30a4\u30dc\u30ed\u30b8\u30fc\u52c9\u5f37\u4f1a], [#super[2]\u30e9\u30fc\u30e1\u30f3\u540c\u597d\u4f1a]),\n abstract: [\n \u3053\u3053\u306b\u672c\u7814\u7a76\u306e\u5185\u5bb9\u3092\u307e\u3068\u3081\u305f\u6982\u8981\u3092\u8a18\u5165\u3059\u308b\u3053\u3068\uff0e\u8981\u65e8\u57f7\u7b46\u306b\u3042\u305f\u308a\u4e0d\u660e\u306a\u70b9\u304c\u3042\u308b\u5834\u5408\u306b\u306f\u30d0\u30fc\u30c1\u30e3\u30eb\u5b66\u4f1a\u5b9f\u884c\u59d4\u54e1\u4f1a\u306b\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\uff0e\n ],\n bibliography-file: \"bibliography.yaml\",\n doc,\n)\n\n= \u7dd2\u8a00\n\n\u672c\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306fTypst\u3092\u7528\u3044\u3066\u30d0\u30fc\u30c1\u30e3\u30eb\u5b66\u4f1a\u306e\u8981\u65e8\u539f\u7a3f\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b\uff0e\n\n= \u539f\u7a3f\u306e\u66f8\u5f0f\n\n== \u5168\u4f53\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\n\nA4\u5224\u7528\u7d19\u306ePDF\u3067\u63d0\u51fa\u3059\u308b\uff0eWord\uff0cLaTeX\u3082\u3057\u304f\u306fTypst\u30d5\u30a1\u30a4\u30eb\u3067\u306e\u4f5c\u6210\u3092\u539f\u5247\u3068\u3057\uff0c\u30ec\u30a4\u30a2\u30a6\u30c8\u306f2\u30ab\u30e9\u30e0\uff0c\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u306f\u30bf\u30a4\u30c8\u30eb18pt\u30fb\u672c\u658710pt\u3068\u3059\u308b\uff0e\u6700\u5927\u30da\u30fc\u30b8\u6570\u306f4\u30da\u30fc\u30b8\u3068\u3057\uff0c\u548c\u6587\u30d5\u30a9\u30f3\u30c8\u306f\u660e\u671d\u4f53\uff0c\u82f1\u6587\u30d5\u30a9\u30f3\u30c8\u306fTimes New Roman\uff0cCentury\u306a\u3069\u306e\u6a19\u6e96\u7684\u306a\u3082\u306e\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\uff0e\n\n- \u8868\u984c\uff1a\u4eca\u56de\u306e\u7814\u7a76\u5185\u5bb9\u304c\u7aef\u7684\u306b\u5206\u304b\u308b\u3088\u3046\u306b\u3059\u308b\uff0e\n- \u8457\u8005\u540d\u30fb\u9023\u7d61\u5148\u30fb\u6240\u5c5e\uff1a\u8457\u8005\u540d\u306b\u306f\u30cf\u30f3\u30c9\u30eb\u30cd\u30fc\u30e0\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3042\u308b\uff0e\u6700\u4f4e1\u540d\u306b\u3064\u3044\u3066\u5fc5\u305a\u3001\u5b66\u4f1a\u5f8c\u306b\u3082\u78ba\u5b9f\u306b\u9023\u7d61\u304c\u3068\u308c\u308b\u9023\u7d61\u5148\u3092\u8a18\u8f09\u3059\u308b\u3053\u3068\uff0e\u307e\u305f\u6240\u5c5e\u306f\u4efb\u610f\u306b\u8a18\u8f09\u3057\u8907\u6570\u306e\u5834\u5408\u306f1, 2\u30fb\u30fb\u30fb\u3068\u8a18\u3059\uff0e\n- \u6982\u8981\uff1a\u4eca\u56de\u306e\u7814\u7a76\u5185\u5bb9\u30921/2\u9801\u4ee5\u5185\u3067\u8a18\u8ff0\u3059\u308b\uff0e\n\n== \u5185\u5bb9\u306b\u3064\u3044\u3066\n\n\u767a\u8868\u8981\u65e8\u306f\u6b21\u306e\u4e8b\u9805\u3092\u57fa\u672c\u3068\u3057\u3066\uff0c\u7c21\u6f54\u306b\u8a18\u8f09\u3059\u308b\u3053\u3068\u304c\u671b\u307e\u3057\u3044\uff0e\n\n- \u7dd2\u8a00\uff1a\u4eca\u56de\u306e\u7814\u7a76\u306e\u3044\u304d\u3055\u3064\u3068\u7814\u7a76\u76ee\u7684\u3092\u793a\u3059\uff0e\n- \u7814\u7a76\u65b9\u6cd5\uff1a\u4ed6\u306e\u4eba\u304c\u540c\u3058\u3088\u3046\u306a\u7814\u7a76\u304c\u3067\u304d\u308b\u3088\u3046\u306a\u66f8\u304d\u65b9\u3092\u5fc3\u304c\u3051\u308b\uff0e\n- \u7d50\u679c\uff1a\u4e8b\u5b9f\u306e\u307f\u3092\u307e\u3068\u3081\u308b\uff0e\u81ea\u5206\u306e\u610f\u898b\u306f\u542b\u3081\u306a\u3044\uff0e\n- \u8003\u5bdf\uff1a\u7d50\u679c\u3067\u793a\u3057\u305f\u4e8b\u5b9f\u3092\u3082\u3068\u306b\u3001\u305d\u306e\u89e3\u91c8\u3084\u305d\u3053\u3067\u306e\u56e0\u679c\u95a2\u4fc2\u306a\u3069\u306b\u3064\u3044\u3066\u8b70\u8ad6\u3059\u308b\uff0e\n- \u7d50\u8a00\uff1a\u7814\u7a76\u306e\u307e\u3068\u3081\u3092\u8a18\u8f09\u3059\u308b\uff0e\n- \u53c2\u8003\u6587\u732e\uff1a\u672c\u6587\u4e2d\u306b\u5f15\u7528\u9806\u306b\u8a18\u8f09\u3059\u308b\uff0e\n\n== \u8868\u8a18\u65b9\u6cd5\n\n\u672c\u6587\uff0c\u5927\u898b\u51fa\u3057\uff0c\u5c0f\u898b\u51fa\u3057\u306a\u3069\u3092\u660e\u77ad\u306b\u3059\u308b\u3053\u3068\uff0e\u672c\u6587\u4e2d\u3067\u306f\u300c\u3064\u304e\u306e\u8868\u300d\u306e\u3088\u3046\u306a\u8868\u73fe\u3092\u907f\u3051\uff0c@fig:sample_figure \u3084\u88681\u306e\u3088\u3046\u306b\u66f8\u304f\uff0e\u307e\u305f\uff0c\u56f3\u8868\u306e\u30ad\u30e3\u30d7\u30b7\u30e7\u30f3\u306f\u305d\u308c\u5358\u4f53\u3067\u8aad\u3093\u3060\u969b\u306b\u56f3\u8868\u306e\u610f\u5473\u304c\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u7c21\u6f54\u306b\u8a18\u8ff0\u3059\u308b\uff0e\n\n== \u53c2\u8003\u6587\u732e\n\n\u672c\u6587\u4e2d\u306b\u5225\u306e\u8457\u8005\u306e\u6587\u732e\u3092\u5f15\u7528\u3059\u308b\u5834\u5408\u306f\uff0c\u5f15\u7528\u7b87\u6240\u306e\u6700\u5f8c\u90e8\u306b@rafferty1994 \uff0c @vconf2023\uff0c @okatani2015 \uff0c @kataoka2016 \uff0c @hinoride2023 \u306e\u3088\u3046\u306a\u7b26\u53f7\u3092\u3064\u3051\u308b\u3053\u3068\uff0e\u672c\u8981\u65e8\u6700\u5f8c\u90e8\u306b\u300c\u53c2\u8003\u6587\u732e\u300d\u306e\u9805\u76ee\u3092\u7528\u610f\u3057\uff0c\u5404\u6587\u732e\u306e\u60c5\u5831\u3092\u8a18\u8f09\u3059\u308b\u3053\u3068\uff0e\u8a18\u8f09\u306e\u969b\u306b\u306f\u4ed6\u306e\u4eba\u304c\u5404\u6587\u732e\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306a\u8868\u73fe\u65b9\u6cd5\u3068\u3059\u308b\u3053\u3068\uff0eWeb\u30b5\u30a4\u30c8\u3092\u5f15\u7528\u3059\u308b\u5834\u5408\uff0c\u30da\u30fc\u30b8\u30bf\u30a4\u30c8\u30eb\uff0cURL\uff0c\u53c2\u7167\u65e5\u3092\u8a18\u8f09\u3059\u308b\u3053\u3068\uff0e\n\n== \u5b57\u4f53\u30fb\u8a18\u53f7\u7565\u53f7\n\n\u4e0b\u8a18\u306e\u70b9\u306b\u6ce8\u610f\u3057\uff0c\u5224\u8aad\u30fb\u7406\u89e3\u3057\u3084\u3059\u3044\u539f\u7a3f\u3068\u306a\u308b\u3088\u3046\u52aa\u3081\u308b\uff0e\n\n- \u4e0a\u3064\u304d\u6587\u5b57\uff0c\u4e0b\u3064\u304d\u6587\u5b57\uff1a\u5c0f\u3055\u304f\u9593\u9055\u3044\u3084\u3059\u3044\u304b\u3089\u7279\u306b\u6ce8\u610f\u3057\uff0c\u305d\u306e\u4f4d\u7f6e\u3092\u660e\u78ba\u306b\u793a\u3059\uff0e\n- \u5b66\u540d\uff1a\u751f\u7269\u7a2e\u306e\u5b66\u540d\u306f\u30a4\u30bf\u30ea\u30c3\u30af\u4f53\u3068\u3059\u308b\uff0e\n- \u7565\u8a9e\uff1a\u7565\u8a9e\u3092\u7528\u3044\u308b\u5834\u5408\u306b\u306f\uff0c\u521d\u51fa\u6642\u306b\u6b63\u5f0f\u540d\u79f0\u3092\u8868\u8a18\uff08\u30b9\u30da\u30eb\u30a2\u30a6\u30c8\uff09\u3059\u308b\uff0e2\u56de\u76ee\u304b\u3089\u306f\u7565\u8a9e\u3067\u8868\u8a18\u3059\u308b\uff0e\n- \u91cf\u5358\u4f4d\uff1a\u56fd\u969b\u5358\u4f4d\u7cfb\uff08SI\uff09\u3092\u7528\u3044\u308b\uff0e\n- \u6570\u5f0f\uff1a\u72ec\u7acb\u3057\u305f\u5f0f\u306e\u6587\u5b57\uff08\u5909\u6570\uff09\u306f\u6307\u5b9a\u306e\u306a\u3044\u9650\u308a\u30a4\u30bf\u30ea\u30c3\u30af\u4f53\u306b\u7d44\u3080\uff0e\u5f0f\u306e\u4e00\u9023\u756a\u53f7\u3092\uff08 \uff09\u3067\u56f2\u307f\uff0c\u9801\u306e\u53f3\u7aef\u306b\u66f8\u304f\uff0e\u6587\u4e2d\u306e\u5f0f\u306f\u4e00\u884c\u306b\u53ce\u3081\u308b\uff0e\n- \u811a\u6ce8\uff1a\u672c\u6587\u4e2d\u306b\\*, a, b\u306a\u3069\u3092\u53f3\u80a9\u306b\u3064\u3051\uff0c\u305d\u306e\u30da\u30fc\u30b8\u306e\u4e0b\u306b\u6a2a\u7dda\u3092\u5f15\u304d\uff0c\u6a2a\u7dda\u306e\u4e0b\u306b\u8a18\u8ff0\u3059\u308b\uff0e\n\n== \u56f3\u8868\u306e\u4f5c\u6210\n\n\u56f3\u304a\u3088\u3073\u8868\u306e\u8aac\u660e\u306f\uff0c\u672c\u6587\u3092\u898b\u306a\u304f\u3066\u3082\u5927\u8981\u304c\u628a\u63e1\u3067\u304d\u308b\u7a0b\u5ea6\u306e\u6700\u5c0f\u9650\u306e\u3082\u306e\u3067\u3042\u308b\u3053\u3068\u304c\u671b\u307e\u3057\u3044\uff0e\u3053\u308c\u3089\u306f@fig:sample_figure \u306e\u3088\u3046\u306b\u3059\u3079\u3066\u672c\u6587\u4e2d\u304b\u3089\u53c2\u7167\u3059\u308b\uff0e\n\u56f3\u306e\u4e0b\u306b\u984c\u540d\u30fb\u8aac\u660e\u6587\u3092\u8a18\u8ff0\u3059\u308b\uff0e\u984c\u540d\u306f\u305d\u306e\u7d42\u308f\u308a\u306b\u30d4\u30ea\u30aa\u30c9\u3092\u5165\u308c\u308b\uff0e\u5199\u771f\u3082\u56f3\u3068\u3057\u3066\u6271\u3046\uff0e\u9855\u5fae\u93e1\u5199\u771f\u306a\u3069\u306e\u7e2e\u5c0f\uff0c\u62e1\u5927\u3092\u6b63\u78ba\u306b\u793a\u3059\u3079\u304d\u56f3\u3067\u306f\uff0c\u5fc5\u305a\u56f3\u4e2d\u306b\u6a19\u6e96\u5c3a\u5ea6\u3092\u793a\u3059\u7dda\u3092\u8a18\u5165\u3059\u308b\uff08\u00d71000\u7b49\u3067\u306f\u793a\u3055\u306a\u3044\uff09\uff0e\n\u8868\u306f\u8981\u65e8\u3067\u8a00\u53ca\u3059\u308b\u60c5\u5831\u306e\u307f\u3092\u8a18\u8f09\u3057\uff0c\u984c\u540d\u306f\u4e0a\u306b\uff0c\u8aac\u660e\u6587\u306f\u4e0b\u306b\u8a18\u8ff0\u3059\u308b\uff0e\u984c\u540d\u306f\u305d\u306e\u7d42\u308f\u308a\u306b\u30d4\u30ea\u30aa\u30c9\u3092\u5165\u308c\u308b\uff0e\u8868\u4e2d\u306e\u5217\u306e\u982d\u306b\u306f\u9069\u5207\u306a\u984c\u3092\u3064\u3051\uff0c\u9069\u5207\u306a\u7565\u5b57\u3092\u7528\u3044\u3066\u77ed\u304f\u3059\u308b\uff0e\u5358\u4f4d\u3092\u660e\u793a\u3059\u308b\uff0e\u5404\u884c\u30fb\u5404\u5217\u306b\u756a\u53f7\u3092\u3064\u3051\u308b\u3053\u3068\u306f\u672c\u6587\u5f15\u7528\u306b\u5fc5\u8981\u306a\u5834\u5408\u3092\u9664\u304d\u907f\u3051\u308b\uff0e\n\n#figure(\n image(\"vconf2024.png\", width: 95%),\n caption: [\u4e3b\u5f35\u3092\u88cf\u4ed8\u3051\u308b\u30c7\u30fc\u30bf\u3084\u8aac\u660e\u306e\u305f\u3081\u306e\u56f3\u3092\u914d\u7f6e\u3057\u3066\u3082\u3088\u3044\uff0e],\n) \n\n#heading(level: 1, numbering: none)[\u8b1d\u8f9e]\n\n\u30d0\u30fc\u30c1\u30e3\u30eb\u5b66\u4f1a Typst\u7248\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u4f5c\u6210\u306b\u3042\u305f\u308a\uff0c\u306f\u3053\u3064\u304d\\@re_hako_moon\u69d8\u306eLaTeX\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\uff0e\u5fc3\u3088\u308a\u6df1\u304f\u611f\u8b1d\u7533\u3057\u4e0a\u3052\u307e\u3059\uff0e" }, { "repo": "https://github.com/amanuensisfrances/LaTeX-math-expressions-in-Typst", "file": "https://raw.githubusercontent.com/amanuensisfrances/LaTeX-math-expressions-in-Typst/main/LaTeX-math-expressions-in-Typst.typ", "language": "typst", "license": "MIT License", "content": "// LaTeX MATH EXPRESSIONS IN TYPST\r\n// (based on https://mirrors.ctan.org/info/symbols/math/maths-symbols.pdf and https://mirrors.ctan.org/fonts/newcomputermodern/doc/newcm-unimath-symbols.pdf)\r\n\r\n\t// Math Alphabets\r\n#let mathrm(input) = {$serif(#input)$}\r\n#let mathsf(input) = {$sans(#input)$}\r\n#let mathtt(input) = {$mono(#input)$}\r\n#let mathup(input) = {$upright(#input)$}\r\n#let mathit(input) = {$italic(#input)$}\r\n#let mathbf(input) = {$bold(#input)$}\r\n#let mathbb(input) = {$bb(#input)$}\r\n#let mathcal(input) = {$cal(#input)$}\r\n#let mathscr(input) = {$cal(#input)$} // see https://tex.stackexchange.com/q/361688 and https://zhuanlan.zhihu.com/p/569922028\r\n#let mathfrak(input) = {$frak(#input)$}\r\n#let mathnormal(input) = {$serif(italic(#input))$}\r\n\r\n\t// Greek Letters\r\n#let varepsilon = {$epsilon.alt$} // the default \\epsilon in LaTeX\r\n#let vartheta = {$theta.alt$}\r\n#let varkappa = {$kappa.alt$}\r\n#let varpi = {$pi.alt$}\r\n#let varrho = {$rho.alt$}\r\n#let varphi = {$phi.alt$} // the default \\phi in LaTeX\r\n\r\n\t// Binary Operation Symbols\r\n#let pm = {$plus.minus$}\r\n#let mp = {$minus.plus$}\r\n#let Ast = {$ast.op$}\r\n#let star = {$star.op$}\r\n#let circ = {$compose$}\r\n#let bullet = {$\u2022$}\r\n#let cdot = {$dot.op$}\r\n#let cap = {$sect$}\r\n#let cup = {$union$}\r\n#let uplus = {$union.plus$}\r\n#let sqcap = {$sect.sq$}\r\n#let sqcup = {$union.sq$}\r\n#let vee = {$and$}\r\n#let land = {$and$}\r\n#let wedge = {$or$}\r\n#let lor = {$or$}\r\n#let setminus = {$without$}\r\n#let wr = {$wreath$}\r\n#let smalldiamond = {$diamond.stroked.small$}\r\n#let bigtriangleup = {$triangle.stroked.t$}\r\n#let bigtriangledown = {$triangle.stroked.b$}\r\n#let triangleleft = {$triangle.stroked.l$}\r\n#let triangleright = {$triangle.stroked.r$}\r\n#let smalltriangleleft = {$triangle.stroked.small.l$}\r\n#let smalltriangleright = {$triangle.stroked.small.r$}\r\n#let oplus = {$plus.circle$}\r\n#let ominus = {$minus.circle$}\r\n#let otimes = {$times.circle$}\r\n#let oslash = {$\u2298$}\r\n#let odot = {$dot.circle$}\r\n#let bigcirc = {$circle.big$}\r\n#let ddagger = {$dagger.double$}\r\n#let amalg = {$\u2a3f$}\r\n\r\n\t// Relation Symbols\r\n#let leq = {$lt.eq$}\r\n#let preceq = {$\u2aaf$}\r\n#let ll = {$lt.double$}\r\n#let subseteq = {$subset.eq$}\r\n#let sqsubseteq = {$subset.eq.sq$}\r\n#let vdash = {$\u22a2$}\r\n#let geq = {$gt.eq$}\r\n#let succeq = {$\u2ab0$}\r\n#let gg = {$gt.double$}\r\n#let supseteq = {$supset.eq$}\r\n#let sqsupseteq = {$supset.eq.sq$}\r\n#let ni = {$in.rev$}\r\n#let dashv = {$\u22a3$}\r\n#let equiv = {$ident$}\r\n#let sim = {$tilde.op$}\r\n#let simeq = {$tilde.eq$}\r\n#let asymp = {$\u224d$}\r\n#let cong = {$tilde.eqq$}\r\n#let neq = {$eq.not$}\r\n#let doteq = {$\u2250$}\r\n#let propto = {$prop$}\r\n#let mid = {$\\u{2223}$}\r\n#let bowtie = {$\u22c8$}\r\n#let smile = {$\u2323$}\r\n#let frown = {$\u2322$}\r\n\r\n\t// Punctuation Symbols\r\n#let cdotp = {$dot.c$}\r\n\r\n\t// Arrow symbols\r\n#let leftarrow = {$arrow.l$}\r\n#let Leftarrow = {$arrow.l.double$}\r\n#let rightarrow = {$arrow.r$}\r\n#let to = {$arrow.r$}\r\n#let Rightarrow = {$arrow.r.double$}\r\n#let leftrightarrow = {$arrow.l.r$}\r\n#let Leftrightarrow = {$arrow.l.r.double$}\r\n#let mapsto = {$arrow.r.bar$}\r\n#let hookleftarrow = {$arrow.l.hook$}\r\n#let leftharpoonup = {$harpoon.lt$}\r\n#let leftharpoondown = {$harpoon.lb$}\r\n#let rightleftharpoons = {$harpoons.rtlb$}\r\n#let longleftarrow = {$arrow.l.long$}\r\n#let Longleftarrow = {$arrow.l.double.long$}\r\n#let longrightarrow = {$arrow.r.long$}\r\n#let Longrightarrow = {$arrow.r.double.long$}\r\n#let implies = {$thin thin arrow.r.double.long thin thin$}\r\n#let longleftrightarrow = {$arrow.l.r.long$}\r\n#let Longleftrightarrow = {$arrow.l.r.double.long$}\r\n#let iff = {$thin thin arrow.l.r.double.long thin thin$}\r\n#let longmapsto = {$arrow.r.long.bar$}\r\n#let hookrightarrow = {$arrow.r.hook$}\r\n#let rightharpoonup = {$harpoon.rt$}\r\n#let rightharpoondown = {$harpoon.rb$}\r\n#let rightcurvedarrow = {$\u2933$}\r\n#let leadsto = {$\u2933$}\r\n#let uparrow = {$arrow.t$}\r\n#let Uparrow = {$arrow.t.double$}\r\n#let downarrow = {$arrow.b$}\r\n#let Downarrow = {$arrow.b.double$}\r\n#let updownarrow = {$arrow.t.b$}\r\n#let Updownarrow = {$arrow.t.b.double$}\r\n#let nearrow = {$arrow.tr$}\r\n#let searrow = {$arrow.br$}\r\n#let swarrow = {$arrow.bl$}\r\n#let nwarrow = {$arrow.tl$}\r\n#let longrightsquigarrow = {$arrow.r.long.squiggly$}\r\n\r\n\t// Miscellaneous Symbols\r\n#let ldots = {$dots.h$}\r\n#let aleph = {$\u05d0$}\r\n#let hbar = {$planck.reduce$}\r\n#let imath = {$\ud835\udea4$}\r\n#let jmath = {$\ud835\udea5$}\r\n#let wp = {$\u2118$}\r\n#let mho = {$ohm.inv$}\r\n#let cdots = {$dots.h.c$}\r\n#let emptyset = {$nothing$}\r\n#let surd = {$\u221a$}\r\n#let top = {$\u22a4$}\r\n#let bot = {$\u22a5$}\r\n#let neg = {$not$}\r\n#let flat = {$\u266d$}\r\n#let natural = {$\u266e$}\r\n#let sharp = {$\u266f$}\r\n#let partial = {$\u2202$}\r\n#let ddots = {$dots.down$}\r\n#let infty = {$infinity$}\r\n#let Box = {$square.stroked$}\r\n#let Diamond = {$diamond.stroked$}\r\n#let Triangle = {$triangle.stroked.t$} \r\n#let clubsuit = {$suit.club$}\r\n#let diamondsuit = {$\u2662$}\r\n#let heartsuit = {$\u2661$}\r\n#let spadesuit = {$suit.spade$}\r\n#let varclubsuit = {$\u2667$}\r\n#let vardiamondsuit = {$suit.diamond$}\r\n#let varheartsuit = {$suit.heart$}\r\n#let varspadesuit = {$\u2664$}\r\n\r\n\t// Variable-sized Symbols\r\n#let prod = {$product$}\r\n#let coprod = {$product.co$}\r\n#let int = {$integral$}\r\n#let oint = {$integral.cont$}\r\n#let Join = {$\u2a1d$}\r\n#let bigcap = {$sect.big$}\r\n#let bigcup = {$union.big$}\r\n#let bigsqcup = {$union.sq.big$}\r\n#let bigvee = {$or.big$}\r\n#let bigwedge = {$and.big$}\r\n#let bigodot = {$dot.circle.big$}\r\n#let bigotimes = {$times.circle.big$}\r\n#let bigoplus = {$plus.circle.big$}\r\n#let biguplus = {$union.plus.big$}\r\n\r\n\t// Log-like Symbols\r\n#let operatorname(input) = {$op(#input)$}\r\n// arccos is predefined\r\n#let arccot = {$operatorname(\"arccot\")$}\r\n#let arccsc = {$operatorname(\"arccsc\")$}\r\n#let arcosh = {$operatorname(\"arcosh\")$}\r\n#let arcoth = {$operatorname(\"arcoth\")$}\r\n#let arcsch = {$operatorname(\"arcsch\")$}\r\n#let arcsec = {$operatorname(\"arcsec\")$}\r\n// arcsin is predefined\r\n// arctan is predefined\r\n// arg is predefined\r\n#let arsech = {$operatorname(\"arsech\")$}\r\n#let arsinh = {$operatorname(\"arsinh\")$}\r\n#let artanh = {$operatorname(\"artanh\")$}\r\n// cos is predefined\r\n// cosh is predefined\r\n// cot is predefined\r\n// coth is predefined\r\n// ctg is predfined\r\n// csc is predefined\r\n#let csch = {$operatorname(\"csch\")$}\r\n// deg is predefined\r\n// det is predefined\r\n// dim is predefined\r\n// exp is predefined\r\n// gcd is predefined\r\n// hom is predefined\r\n// #let Im = {$operatorname(\"Im\")$} // uncomment this to redefine the imaginary part command from the default \"\u2111\" to \"Im\"\r\n// inf is predefined\r\n// ker is predefined\r\n#let lcm = {$operatorname(\"lcm\")$}\r\n// lg is predefined\r\n// lim is predefined\r\n// liminf is predefined\r\n// limsup is predefined\r\n// ln is predefined\r\n// log is predefined\r\n// max is predefined\r\n// min is predefined\r\n// mod is predefined\r\n// Pr is predefined\r\n// #let Re = {$operatorname(\"Re\")$} // uncomment this to redefine the real part command from the default \"\u211c\" to \"Re\"\r\n// sec is predefined\r\n#let sech = {$operatorname(\"sech\")$}\r\n// sin is predefined\r\n// sinh is predefined\r\n// sup is predefined\r\n// tan is predefined\r\n// tanh is predefined\r\n// tg is predefined\r\n\r\n\t// Delimiters\r\n#let lfloor = {$\u230a$}\r\n#let rfloor = {$\u230b$}\r\n#let langle = {$\u27e8$}\r\n#let rangle = {$\u27e9$}\r\n#let vert = {$|$}\r\n#let Vert = {$\u2016$}\r\n#let lceil = {$\u2308$}\r\n#let rceil = {$\u2309$}\r\n\r\n\t// Math Mode Accents\r\n#let check(input) = {$accent(#input, caron)$}\r\n#let Vec(input) = {$accent(#input, arrow)$}\r\n#let ddot(input) = {$accent(#input, dot.double)$}\r\n\r\n\t// Some other constructions\r\n#let widetilde(input) = {$accent(#input, tilde)$}\r\n#let overleftarrow(input) = {$accent(#input, arrow.l)$}\r\n#let widehat(input) = {$accent(#input, hat)$}\r\n#let overrightarrow(input) = {$accent(#input, arrow.r)$}\r\n// Typst's root(n, x) = LaTeX's \\sqrt[n]{x} \r\n// Typst's \\frac(a, b) = LaTeX's \\frac{a}{b}\r\n\r\n\t// AMS Delimiters\r\n#let ulcorner = {$\u231c$}\r\n#let urcorner = {$\u231d$}\r\n#let llcorner = {$\u231e$}\r\n#let lrcorner = {$\u231f$}\r\n\r\n\t// AMS Arrows\r\n#let dashrightarrow = {$arrow.r.dashed$}\r\n#let rightdasharrow = {$arrow.r.dashed$}\r\n#let Lleftarrow = {$arrow.l.quad$}\r\n#let leftrightharpoons = {$harpoons.ltrb$}\r\n#let upuparrows = {$arrows.tt$}\r\n#let leftrightsquigarrow = {$\u21ad$}\r\n#let rightleftarrows = {$arrows.rl$}\r\n#let downdownarrows = {$arrows.bb$}\r\n#let dashleftarrow = {$arrow.l.dashed$}\r\n#let leftdasharrow = {$arrow.l.dashed$}\r\n#let twoheadleftarrow = {$arrow.l.twohead$}\r\n#let curvearrowleft = {$arrow.ccw.half$}\r\n#let upharpoonleft = {$harpoon.tl$}\r\n#let rightrightarrows = {$arrows.rr$}\r\n#let twoheadrightarrow = {$arrow.r.twohead$}\r\n#let curvearrowright = {$arrow.cw.half$}\r\n#let upharpoonright = {$harpoon.tr$}\r\n#let leftleftarrows = {$arrows.ll$}\r\n#let leftarrowtail = {$arrow.l.tail$}\r\n#let circlearrowleft = {$arrow.ccw$}\r\n#let downharpoonleft = {$harpoon.bl$}\r\n#let rightarrowtail = {$arrow.r.tail$}\r\n#let circlearrowright = {$arrow.cw$}\r\n#let downharpoonright = {$harpoon.br$}\r\n#let leftrightarrows = {$arrows.lr$}\r\n#let looparrowleft = {$arrow.l.loop$}\r\n#let Lsh = {$\u21b0$}\r\n#let rightrightarrows = {$arrows.rr$}\r\n#let looparrowright = {$arrow.r.loop$}\r\n#let Rsh = {$\u21b1$}\r\n#let rightsquigarrow = {$arrow.r.squiggly$}\r\n\r\n\t// AMS Negated Arrows\r\n#let nleftarrow = {$arrow.l.not$}\r\n#let nleftrightarrow = {$arrow.l.r.not$}\r\n#let nrightarrow = {$arrow.r.not$}\r\n#let nLeftrightarrow = {$arrow.l.r.double.not$}\r\n#let nLeftarrow = {$arrow.l.double.not$}\r\n#let nRightarrow = {$arrow.r.double.not$}\r\n\r\n\t// AMS Greek\r\n#let digamma = {$\u03dd$}\r\n#let updigamma = {$\u03dd$}\r\n#let Digamma = {$\u03dc$}\r\n#let upDigamma = {$\u03dc$}\r\n#let varkappa = {$\u03f0$}\r\n#let upvarkappa = {$kappa.alt$}\r\n\r\n\t// AMS Hebrew\r\n#let beth = {$\u05d1$}\r\n#let daleth = {$\u05d3$}\r\n#let gimel = {$\u05d2$}\r\n\r\n\t// AMS Miscellaneous\r\n#let Square = {$square.stroked$}\r\n#let measureadangle = {$angle.arc$}\r\n#let Game = {$\u2141$}\r\n#let blacktriangle = {$triangle.filled.small.t$}\r\n#let bigstar = {$\u2605$}\r\n#let diagup = {$\u2215$}\r\n#let hslash = {$planck.reduce$}\r\n#let lozenge = {$lozenge.stroked$}\r\n#let nexists = {$exists.not$}\r\n#let Bbbk = {$\ud835\udd5c$}\r\n#let blacktriangledown = {$triangle.filled.small.b$}\r\n#let sphericalangle = {$angle.spheric$}\r\n#let diagdown = {$\u29f5$}\r\n#let vartriangle = {$triangle.stroked.small.t$}\r\n#let circledS = {$\u24c8$}\r\n#let backprime = {$\u2035$}\r\n#let blacksquare = {$square.filled$}\r\n#let triangledown = {$triangle.stroked.small.b$}\r\n#let Finv = {$\u2132$}\r\n#let varnothing = {$\u2300$}\r\n#let diameter = {$\u2300$}\r\n#let blacklozenge = {$\u29eb$}\r\n#let eth = {$\u00f0$}\r\n#let matheth = {$\u00f0$}\r\n\r\n\t// AMS Binary Operators\r\n#let dotplus = {$plus.dot$}\r\n#let barwedge = {$\u22bc$}\r\n#let boxtimes = {$times.square$}\r\n#let ltimes = {$\u22c9$}\r\n#let curlywedge = {$and.curly$}\r\n#let circledcirc = {$circle.nested$}\r\n#let smallsetminus = {$\u2216$}\r\n#let veebar = {$\u22bb$}\r\n#let boxdot = {$dot.square$}\r\n#let rtimes = {$\u22ca$}\r\n#let curlyvee = {$or.curly$}\r\n#let centerdot = {$dot.c$}\r\n#let Cap = {$sect.double$}\r\n#let doublebarwedge = {$\u2a5e$}\r\n#let boxplus = {$plus.square$}\r\n#let leftthreetimes = {$times.l$}\r\n#let circleddash = {$dash.circle$}\r\n#let intercal = {$\u22ba$}\r\n#let Cup = {$union.double$}\r\n#let boxminus = {$minus.square$}\r\n#let divideontimes = {$times.div$}\r\n#let rightthreetimes = {$times.r$}\r\n#let circledast = {$ast.circle$}\r\n\r\n\t// AMS Binary Relations\r\n#let leqq = {$lt.eqq$}\r\n#let lessapprox = {$\u2a85$}\r\n#let lessgtr = {$lt.gt$}\r\n#let risingdotseq = {$\u2253$}\r\n#let subseteqq = {$\u2ac5$}\r\n#let curlyeqprec = {$eq.prec$}\r\n#let trianglelefteq = {$\u22b4$}\r\n#let unlhd = {$\u22b4$}\r\n#let smallfrown = {$\u23dc$}\r\n#let geqslant = {$\u2a7e$}\r\n#let gtrdot = {$gt.dot$}\r\n#let gtreqqless = {$\u2a8c$}\r\n#let thicksim = {$sim$}\r\n#let sqsupset = {$supset.sq$}\r\n#let succaprox = {$succ.approx$}\r\n#let shortmid = {$thin thin thin thin \u20d3 thin$}\r\n#let varpropto = {$propto$}\r\n#let blacktriangleright = {$triangle.filled.r$}\r\n#let leqslant = {$\u2a7d$}\r\n#let approxeq = {$approx.eq$}\r\n#let lesseqgtr = {$lt.eq.gt$}\r\n#let fallingdotseq = {$\u2252$}\r\n#let Subset = {$subset.double$}\r\n#let precsim = {$prec.tilde$}\r\n#let vDash = {$\u22a8$}\r\n#let bumpeq = {$\u224f$}\r\n#let eqslantgtr = {$\u2a96$}\r\n#let ggg = {$gt.triple$}\r\n#let eqcirc = {$\u2256$}\r\n#let thickapprox = {$approx$}\r\n#let succcurlyeq = {$succ.eq$}\r\n#let vartriangleright = {$\u22b3$}\r\n#let rhd = {$\u22b3$}\r\n#let shortparallel = {$thin thin thin \u20d3 thin \u20d3$}\r\n#let blacktriangleleft = {$triangle.filled.l$}\r\n#let eqslantless = {$\u2a95$}\r\n#let lessdot = {$lt.dot$}\r\n#let lesseqqgtr = {$\u2a8b$}\r\n#let backsim = {$tilde.rev$}\r\n#let sqsubset = {$subset.sq$}\r\n#let precapprox = {$prec.approx$}\r\n#let Vvdash = {$\u22aa$}\r\n#let Bumpeq = {$\u224e$}\r\n#let gtrsim = {$gt.tilde$}\r\n#let gtrless = {$gt.lt$}\r\n#let circeq = {$\u2257$}\r\n#let supseteqq = {$\u2ac6$}\r\n#let curlysucceq = {$eq.succ$}\r\n#let trianglerighteq = {$\u22b5$} \r\n#let unrhd = {$\u22b5$}\r\n#let between = {$\u226c$}\r\n#let lesssim = {$lt.tilde$}\r\n#let lll = {$lt.triple$}\r\n#let doteqdot = {$\u2251$}\r\n#let Doteq = {$\u2251$}\r\n#let backsimeq = {$tilde.eq.rev$}\r\n#let preccurlyeq = {$prec.eq$}\r\n#let vartriangleleft = {$\u22b2$}\r\n#let lhd = {$\u22b2$}\r\n#let smallsmile = {$\u23dd$}\r\n#let geqq = {$gt.eqq$}\r\n#let gtrapprox = {$\u2a86$}\r\n#let gtreqless = {$gt.eq.lt$}\r\n#let triangleq = {$eq.delta$}\r\n#let Supset = {$supset.double$}\r\n#let succsim = {$succ.tilde$}\r\n#let Vdash = {$\u22a9$}\r\n#let pitchfork = {$\u22d4$}\r\n#let backepsilon = {$\u03f6$}\r\n#let upbackepsilon = {$\u03f6$}\r\n\r\n\t// AMS Negated Binary Relations\r\n#let nless = {$lt.not$}\r\n#let nleq = {$lt.eq.not$}\r\n#let lnapprox = {$\u2a89$}\r\n#let precnapprox = {$prec.napprox$}\r\n#let nvdash = {$\u22ac$}\r\n#let nsubseteq = {$subset.eq.not$}\r\n#let nsubseteqq = {$#h(5pt) slash #h(-7pt)\u2ac5$}\r\n#let varsubsetneqq = {$\u2acb$}\r\n#let ngeqq = {$#h(5pt) slash #h(-7pt) gt.eqq$}\r\n#let gnsim = {$gt.ntilde$}\r\n#let nsucceq = {$succ.eq.not$}\r\n#let nshortparallel = {$thin thin thin #h(0.75pt) \u0337#h(-0.75pt) \u20d3 thin \u20d3$}\r\n#let ntriangleright = {$\u22eb$}\r\n#let nvartriangleright = {$\u22eb$}\r\n#let supsetneq = {$supset.neq$}\r\n#let nleq = {$lt.eq.not$}\r\n#let lneqq = {$lt.neqq$}\r\n#let nprec = {$prec.not$}\r\n#let nsim = {$tilde.not$}\r\n#let nvDash = {$\u22ad$}\r\n#let subsetneq = {$subset.neq$}\r\n#let ngtr = {$gt.not$}\r\n#let gneq = {$\u2a88$}\r\n#let gnapprox = {$\u2a8a$}\r\n#let succnsim = {$succ.ntilde$}\r\n#let nparallel = {$parallel.not$}\r\n#let ntrianglerighteq = {$\u22ed$}\r\n#let varsupsetneq = {$supset.eq_(#h(-4pt) \u0337)$}\r\n#let nleqslant = {$#h(5pt) slash #h(-7pt) \u2a7d$}\r\n#let lvertneqq = {$lt.eqq_(#h(-8.2pt)\uff5c)$}\r\n#let npreceq = {$#h(4.75pt) slash #h(-7.25pt) \u2aaf$}\r\n#let notshortmid = {$thin thin thin thin #h(-0.25pt) \u0337 #h(0.25pt) \u20d3 thin$}\r\n#let ntriangleleft = {$\u22ea$}\r\n#let nvartriangleleft = {$\u22ea$}\r\n#let varsubsetneq = {$subset.eq_(#h(-4pt) \u0337)$}\r\n#let ngeq = {$gt.eq.not$}\r\n#let gneqq = {$gt.neqq$}\r\n#let nsucc = {$succ.not$}\r\n#let succnapprox = {$succ.napprox$}\r\n#let nvDash = {$\u22ad$}\r\n#let nsupseteq = {$supset.eq.not$}\r\n#let supsetneqq = {$\u2acc$}\r\n#let nleqq = {$#h(5pt) slash #h(-7pt) lt.eqq$}\r\n#let lnsim = {$lt.ntilde$}\r\n#let precnsim = {$prec.ntilde$}\r\n#let nmid = {$divides.not$}\r\n#let ntrianglelefteq = {$\u22ec$}\r\n#let subsetneqq = {$\u2acb$}\r\n#let ngeqslant = {$#h(5pt) slash #h(-7pt)\u2a7e$}\r\n#let gvertneqq = {$gt.eqq_(#h(-8.2pt)\uff5c)$}\r\n#let ncong = {$tilde.eqq.not$}\r\n#let nVDash = {$\u22af$}\r\n#let nsupseteqq = {$#h(5pt) slash #h(-7pt)\u2ac6$}\r\n#let varsupsetneqq = {$\u2acc$}\r\n\r\n\t// Selected stmaryrd Delimiters (that are available in the NewComputerModern Math font)\r\n#let Lbag = {$\u27c5$}\r\n#let Rbag = {$\u27c6$}\r\n#let lbag = {$\u27c5$}\r\n#let rbag = {$\u27c6$}\r\n#let llceil = {$\u2308 #h(-3.5pt) \u2308 #h(-1.125pt)$}\r\n#let lCeil = {$\u2308 #h(-3.5pt) \u2308 #h(-1.125pt)$}\r\n#let rrceil = {$#h(-1.125pt) \u2309 #h(-3.5pt) \u2309$}\r\n#let rCeil = {$#h(-1.125pt) \u2309 #h(-3.5pt) \u2309$}\r\n#let llfloor = {$\u230a #h(-3.5pt) \u230a #h(-1.125pt)$}\r\n#let lFloor = {$\u230a #h(-3.5pt) \u230a #h(-1.125pt)$}\r\n#let rrfloor = {$#h(-1.125pt) \u230b #h(-3.5pt) \u230b$}\r\n#let rFloor = {$#h(-1.125pt) \u230b #h(-3.5pt) \u230b$}\r\n#let llbracket = {$\u27e6$}\r\n#let lBrack = {$\u27e6$}\r\n#let rrbracket = {$\u27e7$}\r\n#let rBrack = {$\u27e7$}\r\n\r\n\t// Selected stmaryrd Arrows (that are available in the NewComputerModern Math font)\r\n#let Longmapsfrom = {$arrow.l.double.long.bar$}\r\n#let nnearrow = {$arrow.tr$}\r\n#let nearrow = {$arrow.tr$}\r\n#let longmapsfrom = {$arrow.l.long.bar$}\r\n#let lightning = {$\u21af$}\r\n#let downzigarrow = {$\u21af$}\r\n#let Longmapsto = {$arrow.r.double.long.bar$}\r\n#let nnwarrow = {$arrow.tl$}\r\n#let nwarrow = {$arrow.tl$}\r\n#let mapsfrom = {$arrow.l.bar$}\r\n#let llparenthesis = {$\u2987$}\r\n#let rrparenthesis = {$\u2988$}\r\n#let Mapsfrom = {$arrow.l.double.bar$}\r\n#let ssearrow = {$arrow.br$}\r\n#let searrow = {$arrow.br$}\r\n#let leftarrowtriangle = {$\u21fd$}\r\n#let Mapsto = {$arrow.r.double.bar$}\r\n#let swarrow = {$arrow.bl$}\r\n#let swarrow = {$arrow.bl$}\r\n#let rightarrowtriangle = {$\u21fe$}\r\n#let leftrightarrowtriangle = {$\u21ff$}\r\n\r\n\t// Selected stmaryrd Binary Operators (that are available in the NewComputerModern Math font)\r\n#let boxast = {$ast.sq$}\r\n#let boxcircle = {$\u29c7$}\r\n#let varogreaterthan = {$gt.circle$}\r\n#let ogreaterthan = {$gt.circle$}\r\n#let ogtr = {$gt.circle$}\r\n#let varcurlyvee = {$or.curly$}\r\n#let varobslash = {$backslash.circle$}\r\n#let obslash = {$backslash.circle$}\r\n#let varolessthan = {$lt.circle$}\r\n#let olessthan = {$lt.circle$}\r\n#let oless = {$lt.circle$}\r\n#let varotimes = {$times.circle$}\r\n#let boxbar = {$\u25eb$}\r\n#let obar = {$\u29b6$}\r\n#let varobar = {$\u233d$}\r\n#let varcurlyvee = {$and.curly$}\r\n#let varocircle = {$circle.nested$}\r\n#let ocircle = {$circle.nested$}\r\n#let varominus = {$minus.circle$}\r\n#let boxbox = {$\u29c8$}\r\n#let emptybox = {$square.stroked$}\r\n#let talloblong = {$\u2afe$}\r\n#let varoast = {$ast.circle$}\r\n#let oast = {$ast.circle$}\r\n#let varodot = {$dot.circle$}\r\n#let varoplus = {$dot.circle$}\r\n#let Yup = {$\u2144$}\r\n#let boxbslash = {$\u29c5$}\r\n#let boxslash = {$\u29c4$}\r\n#let boxdiag = {$\u29c4$}\r\n#let interleave = {$\u2af4$}\r\n#let varbigcirc = {$circle.big$}\r\n#let varoslash = {$\u2298$}\r\n\r\n\t// Selected stmaryrd Large Binary Operators (that are available in the NewComputerModern Math font)\r\n#let biginterleave = {$\u2afc$}\r\n#let bigsqcap = {$sect.sq.big$}" }, { "repo": "https://github.com/yonatanmgr/university-notes", "file": "https://raw.githubusercontent.com/yonatanmgr/university-notes/main/0366-%5BMath%5D/03661101-%5BCalculus%201A%5D/src/lectures/03661101_lecture_15.typ", "language": "typst", "license": "", "content": "#import \"/template.typ\": *\n#import \"/utils/graph.typ\": *\n#show: project.with(\n title: \"\u05d7\u05d3\u05d5\u05f4\u05d0 1\u05d0\u05f3 - \u05e9\u05d9\u05e2\u05d5\u05e8 15\",\n authors: (\"\",),\n date: \"20 \u05d1\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8, 2024\",\n)\n\n#set enum(numbering: \"(1.\u05d0)\")\n\n=== (\u05de\u05e9\u05e4\u05d8) \u05de\u05e9\u05e4\u05d8 \u05d4\u05e1\u05e0\u05d3\u05d5\u05d5\u05d9\u05e5\u05f3\n\u05e0\u05ea\u05d5\u05e0\u05d5\u05ea \u05e9\u05dc\u05d5\u05e9 \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d5\u05ea $f,g,h: I bs {x_0} -> RR$. \u05e0\u05e0\u05d9\u05d7 \u05db\u05d9 \u05de\u05ea\u05e7\u05d9\u05d9\u05dd $f(x)<=g(x)<=h(x), forall x in I bs {x_0}$, \u05d5\u05d2\u05dd $limto(x_0) f(x) = limto(x_0) h(x) = L$. \u05d0\u05d6\u05d9, $limto(x_0) g(x) = L$.\n\n==== \u05d4\u05d5\u05db\u05d7\u05d4 (\u05dc\u05e4\u05d9 \u05d4\u05d2\u05d3\u05e8\u05ea \u05e7\u05d5\u05e9\u05d9)\n\u05e0\u05d9\u05e7\u05d7 $epsilon >0$ \u05e9\u05e8\u05d9\u05e8\u05d5\u05ea\u05d9. \u05d0\u05d6 $exists delta_1 > 0: 0< abs(x-x_0) abs(f(x)-L) L-epsilon0:0 abs(h(x) -L) < epsilon => h(x) < L+epsilon$.\n\u05e0\u05d1\u05d7\u05e8 $delta = min{delta_1, delta_2}$. \\ \u05d0\u05d6 $03$, \u05e1\u05d9\u05d9\u05de\u05e0\u05d5.\n \u05d0\u05dd \u05db\u05da, \u05e0\u05d5\u05db\u05d9\u05d7 \u05db\u05d9 $liminff(2^(1/x))=1$:\n$ forall epsilon > 0 exists N >0 : forall x > N => abs(2^(1/x)-1) < epsilon ==> forall epsilon > 0 exists N in NN : abs(2^(1/N) - 1) 2^(1/N) < 1 + epsilon $\n\u05d5\u05d0\u05d6 $forall x > N$ \u05d9\u05ea\u05e7\u05d9\u05d9\u05dd $1-epsilon < 1 < 2^(1/x) < 2^(1/N) < 1+epsilon$. #QED\n\n=== (\u05dc\u05de\u05d4) $limto(0) (sin x)/x = 1$.\n\n==== \u05d4\u05d5\u05db\u05d7\u05d4\n\n\u05de\u05e1\u05e4\u05d9\u05e7 \u05dc\u05d4\u05d5\u05db\u05d9\u05d7 $limto(0^+) (sin x)/x = 1$ \u05db\u05d9 \u05d0\u05d6 $limto(0^-) (sin x)/x eq^(x=-t) limits(lim)_(t->0^+) (sin (-t))/(-t) = limits(lim)_(t->0^+) (sin t)/t =1$. \u05db\u05d1\u05e8 \u05d4\u05d5\u05db\u05d7\u05e0\u05d5 \u05db\u05d9 $forall 0 <= x < pi/2$, $sin x <= x$. \u05e0\u05d5\u05db\u05d9\u05d7 \u05db\u05e2\u05ea \u05d2\u05dd $x<=tan x, forall 0 <= x < pi/2$.\n\n// #grid(columns: 2)[\n#align(center)[\n \n #image(\"/attachments/Screenshot 2024-02-20 at 12.41.47.png\", width: 25%)\n]\n// ]\n\n\u05d5\u05d0\u05d6 \u05e9\u05d8\u05d7 \u05d4\u05de\u05e9\u05d5\u05dc\u05e9 $triangle.t O A C$ $<=$ \u05e9\u05d8\u05d7 \u05d4\u05d2\u05d6\u05e8\u05d4 $O A B$. $cancel(1/2) r x <= cancel(1/2) r abs(C A) = tan x, 0^(x->0^+) 1$, \u05d5\u05dc\u05db\u05df \u05de\u05db\u05dc\u05dc \u05d4\u05e1\u05e0\u05d3\u05d5\u05d5\u05d9\u05e5\u05f3 $(sin x)/x->1$. #QED\n\n#pagebreak()\n\n= \u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05e9\u05dc \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4\n== \u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05d1\u05e0\u05e7\u05d5\u05d3\u05d4 \u05d5\u05d1\u05e7\u05d8\u05e2\n\n- \u05ea\u05d4\u05d9 $f: I->RR$ \u05db\u05d0\u05e9\u05e8 $I=(a,b)$ \u05e7\u05d8\u05e2 \u05e4\u05ea\u05d5\u05d7. \u05e0\u05d0\u05de\u05e8 \u05db\u05d9 $f$ *\u05e8\u05e6\u05d9\u05e4\u05d4 \u05d1\u05e0\u05e7\u05d5\u05d3\u05d4 $x_0 in I$* \u05d0\u05dd \u05de\u05ea\u05e7\u05d9\u05d9\u05dd $limto(x_0) f(x)= f(x_0)$.\n- \u05e0\u05d0\u05de\u05e8 \u05db\u05d9 \u05d4\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 *\u05e8\u05e6\u05d9\u05e4\u05d4 \u05d1\u05db\u05dc \u05d4\u05e7\u05d8\u05e2 \u05d4\u05e4\u05ea\u05d5\u05d7 $I$* \u05d0\u05dd $f$ \u05e8\u05e6\u05d9\u05e4\u05d4 \u05d1\u05db\u05dc \u05e0\u05e7\u05d5\u05d3\u05d4 $x_0 in I$.\n\n=== (\u05d3\u05d5\u05d2\u05de\u05d4) \u05d4\u05d0\u05dd \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05ea \u05d3\u05d9\u05e8\u05d9\u05db\u05dc\u05d4 \u05e8\u05e6\u05d9\u05e4\u05d4? \n\u05e2\u05d1\u05d5\u05e8 \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05ea \u05d3\u05d9\u05e8\u05d9\u05db\u05dc\u05d4, \u05d0\u05e9\u05e8 \u05d4\u05d5\u05d2\u05d3\u05e8\u05d4 $D(x) = cases(1 \"if\" x in QQ, 0 \"if\" x in.not QQ)$ \u05d4\u05d5\u05db\u05d7\u05e0\u05d5 \u05db\u05d9 $exists.not limto(x_0) D(x)$ \u05d1\u05e9\u05d5\u05dd \u05e0\u05e7\u05d5\u05d3\u05d4 $x_0 in RR$. \u05dc\u05db\u05df, $D(x)$ \u05dc\u05d0 \u05e8\u05e6\u05d9\u05e4\u05d4 \u05d1\u05e9\u05d5\u05dd \u05e0\u05e7\u05d5\u05d3\u05d4 $x_0 in RR$. \u05de\u05e6\u05d3 \u05e9\u05e0\u05d9, \u05dc\u05de\u05d3\u05e0\u05d5 \u05d2\u05dd \u05d0\u05ea \u05d4\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 $f(x) = x D(x)$ \u05e9\u05d2\u05dd \u05dc\u05d4 \u05d0\u05d9\u05df \u05d2\u05d1\u05d5\u05dc \u05d1\u05db\u05dc $0!=x in RR$. \u05d0\u05d6 $limto(0) f(x) = 0 =f(0)$ \u05dc\u05db\u05df $f(x)$ \u05e8\u05e6\u05d9\u05e4\u05d4 \u05d1\u05e0\u05e7\u05d5\u05d3\u05d4 \u05de\u05de\u05e9\u05d9\u05ea \u05d9\u05d7\u05d9\u05d3\u05d4 $x_0 = 0$.\n\n== \u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05de\u05d9\u05de\u05d9\u05df \u05d5\u05de\u05e9\u05de\u05d0\u05dc \u05d5\u05e0\u05e7\u05d5\u05d3\u05d5\u05ea \u05d0\u05d9-\u05e8\u05e6\u05d9\u05e4\u05d5\u05ea\n=== (\u05d4\u05d2\u05d3\u05e8\u05d4) \u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05de\u05d9\u05de\u05d9\u05df \u05d5\u05de\u05e9\u05de\u05d0\u05dc\n- \u05ea\u05d4\u05d9 $f: [a,b) -> RR$. \u05e0\u05d0\u05de\u05e8 \u05e9-$f$ *\u05e8\u05e6\u05d9\u05e4\u05d4 \u05de\u05d9\u05de\u05d9\u05df \u05d1\u05e0\u05e7\u05d5\u05d3\u05d4 $a$* \u05d0\u05dd \u05de\u05ea\u05e7\u05d9\u05d9\u05dd $limto(a^+) f(x) = f(a)$. \n\n- \u05ea\u05d4\u05d9 $f: (c,a] -> RR$. \u05e0\u05d0\u05de\u05e8 \u05e9-$f$ *\u05e8\u05e6\u05d9\u05e4\u05d4 \u05de\u05e9\u05de\u05d0\u05dc \u05d1\u05e0\u05e7\u05d5\u05d3\u05d4 $a$* \u05d0\u05dd \u05de\u05ea\u05e7\u05d9\u05d9\u05dd $limto(a^-) f(x) = f(a)$. \n\n=== (\u05d4\u05d2\u05d3\u05e8\u05d4) \u05e6\u05de\u05e6\u05d5\u05dd \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4\n\u05e0\u05ea\u05d5\u05e0\u05d4 \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 $f: A->RR$ \u05d5-$B subset A$. \u05e0\u05e1\u05de\u05df $bv(f, B)$ \u05d0\u05ea \u05d4\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 $f$ \u05d4\u05de\u05d5\u05d2\u05d3\u05e8\u05ea \u05e8\u05e7 \u05e2\u05dc $B$.\n\n=== (\u05d8\u05e2\u05e0\u05d4) \u05ea\u05d4\u05d9 $f: (c,b) -> RR$ \u05d5\u05ea\u05d4\u05d9 $a in (c,b)$. \u05d0\u05d6\u05d9 $f$ \u05e8\u05e6\u05d9\u05e4\u05d4 \u05d1-$a$ \u05d0\u05dd\u05f4\u05dd $bv(f, (c,a])$ \u05e8\u05e6\u05d9\u05e4\u05d4 \u05de\u05e9\u05de\u05d0\u05dc \u05d1-$a$ \u05d5-$bv(f, [a,b))$ \u05e8\u05e6\u05d9\u05e4\u05d4 \u05de\u05d9\u05de\u05d9\u05df \u05d1-$a$.\n\n=== (\u05d4\u05d2\u05d3\u05e8\u05d4) \u05e0\u05e7\u05d5\u05d3\u05ea \u05d0\u05d9-\u05e8\u05e6\u05d9\u05e4\u05d5\u05ea\n\n- \u05e0\u05ea\u05d5\u05e0\u05d4 \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 $f$ \u05d4\u05de\u05d5\u05d2\u05d3\u05e8\u05ea \u05d1\u05e7\u05d8\u05e2 \u05d4\u05e4\u05ea\u05d5\u05d7 $I$ \u05e1\u05d1\u05d9\u05d1 \u05e0\u05e7\u05d5\u05d3\u05d4 $x_0$, \u05e4\u05e8\u05d8 \u05d0\u05d5\u05dc\u05d9 \u05d1\u05e0\u05e7\u05d5\u05d3\u05d4 $x_0$ \u05e2\u05e6\u05de\u05d4. \u05d0\u05d6\u05d9, \u05d4\u05e0\u05e7\u05d5\u05d3\u05d4 $x_0$ \u05e0\u05e7\u05e8\u05d0\u05ea *\u05e0\u05e7\u05d5\u05d3\u05ea \u05d0\u05d9-\u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05e1\u05dc\u05d9\u05e7\u05d4* \u05d0\u05dd $exists limto(x_0) f(x) != f(x_0)$.\n\n- *\u05e0\u05e7\u05d5\u05d3\u05ea \u05d0\u05d9-\u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05de\u05e1\u05d5\u05d2 \u05e8\u05d0\u05e9\u05d5\u05df*: \u05d0\u05dd \u05e7\u05d9\u05d9\u05de\u05d9\u05dd \u05d5\u05e9\u05d5\u05e0\u05d9\u05dd \u05d4\u05d2\u05d1\u05d5\u05dc\u05d5\u05ea \u05d4\u05d7\u05d3-\u05e6\u05d3\u05d3\u05d9\u05d9\u05dd $limto(x_0^+) f(x)$ \u05d5-$limto(x_0^+) f(x)$.\n\n- *\u05e0\u05e7\u05d5\u05d3\u05ea \u05d0\u05d9-\u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05de\u05e1\u05d5\u05d2 \u05e9\u05e0\u05d9*: \u05d0\u05dd \u05dc\u05e4\u05d7\u05d5\u05ea \u05d0\u05d7\u05d3 \u05de\u05d4\u05d2\u05d1\u05d5\u05dc\u05d5\u05ea \u05d4\u05d7\u05d3-\u05e6\u05d3\u05d3\u05d9\u05d9\u05dd $limto(x_0^+) f(x)$ \u05d5-$limto(x_0^+) f(x)$ \u05dc\u05d0 \u05e7\u05d9\u05d9\u05dd.\n\n==== \u05d3\u05d5\u05d2\u05de\u05d4: $y= f(x) = sin 1/x, x_0 = 0$\n\n#graph(w: 15, h: 2, start:0.2, end:-0.2, functions: (x=>calc.sin(1/x),), h-asymptotes: (1, -1))\n\n$ sin (1/x) = 0 ==> 1/x = pi k ==> x_k^((1)) = 1/(pi k), k=pm 1, pm 2, p, 3, dots ==> sin 1/x = 1 ==> \\ \n1/x = pi/2 + 2pi k, k=0, pm 1, pm 2, dots ==> x_k^((2)) = 1/(pi/2 + 2pi k)\n$\n\u05d4\u05d0\u05dd \u05e7\u05d9\u05d9\u05dd $limto(0) sin 1/x$? \u05dc\u05d0, \u05db\u05d9 $x_k^((1)) -->^(k->oo) 0 $ \u05d5-$x_k^((2)) -->^(k->oo) 0$. $f(x_k^((1))) = 0 --> 0$ \u05d0\u05da $f(x_k^((2))) = 1 --> 1$ \u05d5-$0!=1$.\n\n\u05d5\u05d0\u05d6, \u05dc\u05e4\u05d9 \u05d4\u05d2\u05d3\u05e8\u05ea \u05d4\u05d9\u05d9\u05e0\u05d4, $exists.not limto(0) sin 1/x$ \u05d5\u05d0\u05d6 $x_0 = 0$ \u05e0\u05e7\u05d5\u05d3\u05ea \u05d0\u05d9-\u05e8\u05e6\u05d9\u05e4\u05d5\u05ea \u05de\u05d4\u05e1\u05d5\u05d2 \u05d4\u05e9\u05e0\u05d9.\n\n==== \u05d3\u05d5\u05d2\u05de\u05d4 \u05e0\u05d5\u05e1\u05e4\u05ea: \u05d4\u05d0\u05dd \u05e7\u05d9\u05d9\u05dd $limto(0) f(x)$ \u05e2\u05d1\u05d5\u05e8 $f(x)=x sin 1/x$?\n\n\u05db\u05df, \u05db\u05d9 $x->0$ \u05d5-$sin 1/x$ \u05d7\u05e1\u05d5\u05de\u05d4 (\u05db\u05d0\u05e9\u05e8 $x->0$) \u05d5\u05d0\u05d6 $x sin 1/x -> 0$.\n\n#align(center)[\n #graph(w: 8, h: 8, start:0.1125, end:-0.1125, functions: (x=>x*calc.sin(1/x),), additionals: ( x=>x, x=>-x))\n]\n\n\n\n\n" }, { "repo": "https://github.com/herbhuang/utdallas-thesis-template-typst", "file": "https://raw.githubusercontent.com/herbhuang/utdallas-thesis-template-typst/main/content/background.typ", "language": "typst", "license": "MIT License", "content": "#import \"/utils/todo.typ\": TODO\n\n= Background\n#TODO[\n Describe each proven technology / concept shortly that is important to understand your thesis. Point out why it is interesting for your thesis. Make sure to incorporate references to important literature here.\n]\n\n== e.g. User Feedback\n#TODO[\n This section would summarize the concept User Feedback using definitions, historical overviews and pointing out the most important aspects of User Feedback.\n]\n\n== e.g. Representational State Transfer\n#TODO[\n This section would summarize the architectural style Representational State Transfer (REST) using definitions, historical overviews and pointing out the most important aspects of the architecture.\n]\n\n== e.g. Scrum\n#TODO[\n This section would summarize the agile method Scrum using definitions, historical overviews and pointing out the most important aspects of Scrum.\n]" }, { "repo": "https://github.com/Enter-tainer/zint-wasi", "file": "https://raw.githubusercontent.com/Enter-tainer/zint-wasi/master/typst-package/README.md", "language": "markdown", "license": "MIT License", "content": "# tiaoma\n\n[tiaoma(\u6761\u7801)](https://github.com/enter-tainer/zint-wasi) is a barcode generator for typst. It compiles [zint](https://github.com/zint/zint) to wasm and use it to generate barcode. It support nearly all common barcode types. For a complete list of supported barcode types, see [zint's documentation](https://zint.org.uk/):\n\n- Australia Post\n - Standard Customer\n - Reply Paid\n - Routing\n - Redirection\n- Aztec Code\n- Aztec Runes\n- Channel Code\n- Codabar\n- Codablock F\n- Code 11\n- Code 128 with automatic subset switching\n- Code 16k\n- Code 2 of 5 variants:\n - Matrix 2 of 5\n - Industrial 2 of 5\n - IATA 2 of 5\n - Datalogic 2 of 5\n - Interleaved 2 of 5\n - ITF-14\n- Deutsche Post Leitcode\n- Deutsche Post Identcode\n- Code 32 (Italian pharmacode)\n- Code 3 of 9 (Code 39)\n- Code 3 of 9 Extended (Code 39 Extended)\n- Code 49\n- Code 93\n- Code One\n- Data Matrix ECC200\n- DotCode\n- Dutch Post KIX Code\n- EAN variants:\n - EAN-13\n - EAN-8\n- Grid Matrix\n- GS1 DataBar variants:\n - GS1 DataBar\n - GS1 DataBar Stacked\n - GS1 DataBar Stacked Omnidirectional\n - GS1 DataBar Expanded\n - GS1 DataBar Expanded Stacked\n - GS1 DataBar Limited\n- Han Xin\n- Japan Post\n- Korea Post\n- LOGMARS\n- MaxiCode\n- MSI (Modified Plessey)\n- PDF417 variants:\n - PDF417 Truncated\n - PDF417\n - Micro PDF417\n- Pharmacode\n- Pharmacode Two-Track\n- Pharmazentralnummer\n- POSTNET / PLANET\n- QR Code\n- rMQR\n- Royal Mail 4-State (RM4SCC)\n- Royal Mail 4-State Mailmark\n- Telepen\n- UPC variants:\n - UPC-A\n - UPC-E\n- UPNQR\n- USPS OneCode (Intelligent Mail)\n\n## Example\n\n```typ\n#import \"@preview/tiaoma:0.2.1\"\n#set page(width: auto, height: auto)\n\n= ti\u00e1o m\u01ce\n\n#tiaoma.ean(\"1234567890128\")\n```\n\n![example](./example.svg)\n\n## Manual\n\nPlease refer to [manual](./manual.pdf) for more details.\n\n## Alternatives\n\nThere are other barcode/qrcode packages for typst such as:\n- https://github.com/jneug/typst-codetastic\n- https://github.com/Midbin/cades\n\nPackages differ in provided customization options for generated barcodes. This package is limited by zint functionality, which focuses more on coverage than customization (e.g. inserting graphics into QR codes). Patching upstream zint code is (currently) outside of the scope of this package - if it doesn't provide functionality you need, check the rest of the typst ecosystem to see if it's available elsewhere or request it [upstream](https://github.com/zint/zint) and [notify us](https://github.com/Enter-tainer/zint-wasi/issues) when it's been merged.\n\n### Pros\n\n1. Support for far greater number of barcode types (all provided by zint library)\n2. Should be faster as is uses a WASM plugin which bundles zint code which is written in C; others are written in pure typst or javascript.\n\n### Cons\n\n1. While most if not all of zint functionality is covered, it's hard to guarantee there's no overlooked functionality.\n2. This package uses typst plugin system and has a WASM backend written in Rust which makes is less welcoming for new contributors.\n" }, { "repo": "https://github.com/crd2333/crd2333.github.io", "file": "https://raw.githubusercontent.com/crd2333/crd2333.github.io/main/src/docs/AI/Reinforce%20Learning/\u7b56\u7565\u5b66\u4e60.typ", "language": "typst", "license": "", "content": "---\norder: 3\n---\n\n#import \"/src/components/TypstTemplate/lib.typ\": *\n\n#show: project.with(\n title: \"AI \u7b14\u8bb0\u4e4b\u5f3a\u5316\u5b66\u4e60\",\n lang: \"zh\",\n)\n\n#let ba = $bold(a)$\n#let bw = $bold(w)$\n\n= \u7b56\u7565\u5b66\u4e60\n== \u7b56\u7565\u68af\u5ea6\n- \u524d\u9762\u8bb2\u7684\u662f\u57fa\u4e8e\u4ef7\u503c\uff08$V$\u6216$Q$\uff09\u7684\u7b56\u7565\uff0c\u800c\u7b56\u7565\u68af\u5ea6\u662f\u5b8c\u5168\u4e0d\u540c\u7684\u4e00\u79cd\u65b9\u6cd5\n- \u56de\u987e\n - #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-09-36-52.png\")\n - #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-09-38-37.png\")\n - #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-09-41-23.png\")\n - \u4f18\u70b9\uff1a\u5177\u6709\u66f4\u597d\u7684\u6536\u655b\u6027\u8d28\uff1b\u5728\u9ad8\u7ef4\u5ea6\u6216\u8fde\u7eed\u7684\u52a8\u4f5c\u7a7a\u95f4\u4e2d\u66f4\u6709\u6548\uff1b\u80fd\u591f\u5b66\u4e60\u51fa\u968f\u673a\u7b56\u7565\n - \u7f3a\u70b9\uff1a\u901a\u5e38\u4f1a\u6536\u655b\u5230\u5c40\u90e8\u6700\u4f18\u800c\u975e\u5168\u5c40\u6700\u4f18\uff1b\u8bc4\u4f30\u4e00\u4e2a\u7b56\u7565\u901a\u5e38\u4e0d\u591f\u9ad8\u6548\u5e76\u5177\u6709\u8f83\u5927\u7684\u65b9\u5dee\n- \u56de\u5230\u73b0\u5728\uff0c\u4e3a\u4ec0\u4e48\u8981\u5f15\u5165\u57fa\u4e8e\u7b56\u7565\u7684\u5f3a\u5316\u5b66\u4e60\u65b9\u6cd5\uff1f\n - \u57fa\u4e8e\u4ef7\u503c\u7684\u5f3a\u5316\u5b66\u4e60\u65b9\u6cd5\uff1a\n + \u5b66\u4e60\u4ef7\u503c\u51fd\u6570\n + \u5229\u7528\u4ef7\u503c\u51fd\u6570\u5bfc\u51fa\u7b56\u7565\n + \u66f4\u9ad8\u7684\u6837\u672c\u8bad\u7ec3\u6548\u7387\n + \u901a\u5e38\u4ec5\u9002\u7528\u4e8e\u5177\u6709\u79bb\u6563\u52a8\u4f5c\u7684\u73af\u5883\n - \u57fa\u4e8e\u7b56\u7565\u7684\u5f3a\u5316\u5b66\u4e60\u65b9\u6cd5\uff1a\n + \u4e0d\u9700\u8981\u4ef7\u503c\u51fd\u6570\n + \u76f4\u63a5\u5b66\u4e60\u7b56\u7565\n + \u5728\u9ad8\u7ef4\u6216\u8fde\u7eed\u52a8\u4f5c\u7a7a\u95f4\u573a\u666f\u4e2d\u66f4\u52a0\u9ad8\u6548\n + \u9002\u7528\u4efb\u4f55\u52a8\u4f5c\u7c7b\u578b\u7684\u573a\u666f\n + \u5bb9\u6613\u6536\u655b\u5230\u6b21\u4f18\u89e3\n - \u57fa\u4e8e\u6f14\u5458-\u8bc4\u8bba\u5bb6\u7684\u65b9\u6cd5\u5c06\u4e8c\u8005\u4f18\u52bf\u7ed3\u5408\n\n- \u57fa\u4e8e\u7b56\u7565\u7684\u5f3a\u5316\u5b66\u4e60\u65b9\u6cd5\u65b9\u6cd5\u76f4\u63a5\u641c\u7d22\u6700\u4f18\u7b56\u7565$pi^*$\n- \u901a\u5e38\u505a\u6cd5\u662f\u53c2\u6570\u5316\u7b56\u7565 $pi_theta$\uff0c\u5e76\u5229\u7528\u65e0\u68af\u5ea6\u6216\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\u65b9\u6cd5\u5bf9\u53c2\u6570\u8fdb\u884c\u66f4\u65b0\n - \u65e0\u68af\u5ea6\u4f18\u5316\uff08\u542f\u53d1\u5f0f\u4f18\u5316\u65b9\u6cd5\uff0c\u5982\u6709\u9650\u5dee\u5206\u65b9\u6cd5\u3001\u4ea4\u53c9\u71b5\u65b9\u6cd5\u3001\u9057\u4f20\u7b97\u6cd5\u7b49\uff09\u53ef\u4ee5\u6709\u6548\u8986\u76d6\u4f4e\u7ef4\u53c2\u6570\u7a7a\u95f4\uff0c\u4f46\u57fa\u4e8e\u68af\u5ea6\u7684\u8bad\u7ec3\u4ecd\u7136\u662f\u9996\u9009\uff0c\u56e0\u4e3a\u5176\u5177\u6709\u66f4\u9ad8\u7684\u91c7\u6837\u6548\u7387\uff08\u8fd9\u91cc\u6ca1\u6709\u8be6\u7ec6\u5c55\u5f00\uff09\n - \u5bf9\u6bd4\u4e4b\u524d\u7684\u8868\u683c\u578b\u7b56\u7565\n + \u91c7\u53d6\u67d0\u4e2a\u52a8\u4f5c\u7684\u6982\u7387\u7684\u8ba1\u7b97\u65b9\u5f0f\u4e0d\u540c\uff1a\u72b6\u6001 $s$ \u4e0a\u91c7\u53d6\u52a8\u4f5c $a$ \u7684\u6982\u7387\uff0c\u4e00\u4e2a\u662f\u76f4\u63a5\u67e5\u8868\uff0c\u4e00\u4e2a\u662f\u8ba1\u7b97 $pi_theta (a|s)$\n + \u7b56\u7565\u7684\u66f4\u65b0\u65b9\u5f0f\u4e0d\u540c\uff1a\u4e00\u4e2a\u662f\u76f4\u63a5\u4fee\u6539\u8868\u683c\u5bf9\u5e94\u6761\u76ee\uff0c\u4e00\u4e2a\u662f\u66f4\u65b0\u53c2\u6570 $theta$\n + \u6700\u4f18\u7b56\u7565\u7684\u5b9a\u4e49\u4e0d\u540c\n- \u57fa\u672c\u601d\u60f3\uff1a\n - \u5229\u7528\u76ee\u6807\u51fd\u6570\u5b9a\u4e49\u7b56\u7565\u4f18\u52a3\u6027\uff1a$J(theta) = J(pi_theta)$\uff08\u76ee\u6807\u51fd\u6570\u5982\u4f55\u8bbe\u8ba1?\uff09\n - \u5bf9\u76ee\u6807\u51fd\u6570\u8fdb\u884c\u4f18\u5316\uff08\u4f18\u5316\u65b9\u5411\u5982\u4f55\u8ba1\u7b97\uff09\uff0c\u4ee5\u5bfb\u627e\u6700\u4f18\u7b56\u7565\n- \u4f18\u5316\u65b9\u5411\n - \u76ee\u6807\u51fd\u6570\u4e0d\u53ef\u5fae\u5206\u65f6\uff1a\u4f7f\u7528\u65e0\u68af\u5ea6\u7b97\u6cd5\u8fdb\u884c\u6700\u4f18\u53c2\u6570\u641c\u7d22\n - \u76ee\u6807\u51fd\u6570\u53ef\u5fae\u5206\u65f6\uff1a\u5229\u7528\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\u65b9\u6cd5\u5bfb\u627e\u6700\u4f18\u7b56\u7565 $theta_(t+1) <- theta_t + alpha nabla_theta J(theta_t)$\n- \u76ee\u6807\u51fd\u6570\n #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-09-59-33.png\")\n- \u72b6\u6001\u5206\u5e03$d(s)$\n - \u7b56\u7565\u65e0\u5173\u7684\u72b6\u6001\u5206\u5e03\n - \u5728\u8fd9\u7c7b\u60c5\u51b5\u4e0b\uff0c\u76ee\u6807\u51fd\u6570\u5173\u4e8e\u53c2\u6570\u7684\u68af\u5ea6\u901a\u5e38\u66f4\u597d\u7b97\n - \u4e00\u4e2a\u7b80\u5355\u7684\u505a\u6cd5\u662f\u53d6 $d(s)$ \u4e3a\u5747\u5300\u5206\u5e03\uff0c\u5373\u6bcf\u4e2a\u72b6\u6001\u90fd\u6709\u76f8\u540c\u7684\u6743\u91cd $1\\/|S|$\n - \u53e6\u4e00\u79cd\u505a\u6cd5\u662f\u628a\u6743\u91cd\u96c6\u4e2d\u5206\u914d\u7ed9\u4e00\u90e8\u5206\u72b6\u6001\u96c6\u5408\u3002\u4f8b\u5982\uff0c\u5728\u4e00\u4e9b\u4efb\u52a1\u4e2d\uff0c\u4e00\u4e2a\u56de\u5408\u53ea\u4ece\u72b6\u6001 $s_0$ \u5f00\u59cb\uff0c\u90a3\u4e48\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\uff1a$d(s_0)=1,d(s!=s_0)=0$\n - \u7b56\u7565\u76f8\u5173\u7684\u72b6\u6001\u5206\u5e03\n - \u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u9009\u7528\u7a33\u6001\u72b6\u6001\u5206\u5e03\n - $d(s)$ \u662f\u7a33\u6001\u72b6\u6001\u5206\u5e03\uff1a\u82e5\u5bf9\u4e00\u4e2a\u72b6\u6001\u8f6c\u79fb $s->a->s'$\uff0c\u6ee1\u8db3\uff1a#mitex(`d(s^{\\prime})=\\sum_{s\\in\\mathcal{S}}\\sum_{a\\in\\mathcal{A}}p(s^{\\prime}|s,a)\\cdot\\pi_{\\theta}(a|s)\\cdot d(s)`)\n- \u5982\u679c\u91c7\u7528\u6700\u5927\u5316\u5e73\u5747\u8f68\u8ff9\u56de\u62a5\u76ee\u6807\u51fd\u6570$ max_theta J(theta)=max_theta EE_(tau wave p_theta (tau)) [sum_t r(s_t,a_t)] $\n - $tau$ \u4e3a\u7b56\u7565 $pi_theta$ \u91c7\u6837\u800c\u6765\u7684\u8f68\u8ff9 ${s_1,a_1,r_1,dots,s_T}$\n - \u8bb0 $G(tau)=sum_t r(s_t,a_t)$\uff0c\u5e73\u5747\u8f68\u8ff9\u56de\u62a5\u76ee\u6807\u7684\u7b56\u7565\u68af\u5ea6\u4e3a\uff1a\n $ nabla_theta J(theta)=nabla_theta int p_theta (tau)G(tau) dif tau &= EE_(tau wave p_theta (tau)) [nabla_theta log p_theta (tau)G(tau)]\\ &=EE_(tau wave p_theta (tau)) [sum_(t=1)^T nabla_theta log pi_theta (a_t|s_t)G(tau)] $\n - \u5176\u4e2d\u51fa\u73b0 $log$ \u662f\u56e0\u4e3a\u4e58\u4e00\u4e2a\u9664\u4e00\u4e2a $p_theta (tau)$\uff0c\u4e8e\u662f $(nabla_theta p_theta (tau)) / (p_theta (tau))$ \u53d8\u6210 $nabla_theta log p_theta (tau)$\n - #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-10-18-35.png\")\n- \u53e6\u5916\u4e24\u79cd\u76ee\u6807\u51fd\u6570\u548c\u7b56\u7565\u68af\u5ea6\n #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-10-19-19.png\")\n- \u4f7f\u7528\u4e0d\u540c\u7684\u7b56\u7565\u68af\u5ea6\uff0c\u4ee5\u53ca\u4e0d\u540c\u7684\u8fd1\u4f3c\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u5404\u79cd\u5404\u6837\u7684\u57fa\u4e8e\u7b56\u7565\u68af\u5ea6\u7684\u5f3a\u5316\u5b66\u4e60\u7b97\u6cd5\uff0c\u5982 REINFORCE\u3001DDPG\u3001PPO\u7b49\n\n=== REINFORCE \u7b97\u6cd5\n- \u5bf9\u4e8e\u968f\u673a\u7b56\u7565$pi_theta (a,s) = P(a|s, theta)$\n - \u76f4\u89c9\u4e0a\u6211\u4eec\u5e94\u8be5\uff1a\u964d\u4f4e\u5e26\u6765\u4f4e\u4ef7\u503c/\u5956\u52b1\u7684\u52a8\u4f5c\u51fa\u73b0\u7684\u6982\u7387\uff1b\u63d0\u9ad8\u5e26\u6765\u9ad8\u4ef7\u503c/\u5956\u52b1\u7684\u52a8\u4f5c\u51fa\u73b0\u7684\u6982\u7387\n- \u4e0a\u4e00\u7ae0\u4e2d\u6211\u4eec\u63a8\u5bfc\u51fa\u4e86\u7b56\u7565\u68af\u5ea6\uff08\u6700\u5927\u5316\u5e73\u5747\u8f68\u8ff9\u56de\u62a5\u76ee\u6807\u51fd\u6570\uff09\uff0c\u5728\u5b9e\u8df5\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u8499\u7279\u5361\u6d1b\u65b9\u6cd5\u8fdb\u884c\u4f30\u8ba1 #mitex(`\\nabla_{\\theta}J(\\theta)=\\ \\frac{1}{N}\\sum_{n=1}^{N}\\sum_{t=1}^{T^{n}}R(\\tau^{n})\\nabla_{\\theta}l o g\\,\\pi_{\\theta}(a_{t}^{n}|s_{t}^{n})`)\u636e\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230 REINFORCE \u7b97\u6cd5\n#algo(caption: \"REINFORCE \u7b97\u6cd5\")[\n```typ\n\u5229\u7528\u7b56\u7565$pi_theta (a|s)$\u91c7\u6837$N$\u6761\u8f68\u8ff9${tau_i}$\n\u8ba1\u7b97\u68af\u5ea6 $nabla_theta J(theta)=1/N sum_(n=1)^N (sum_(t=1)^(T^n) R(tau^n) nabla_theta log pi_theta (a_t^n|s_t^n))$\n\u66f4\u65b0\u53c2\u6570 $theta <- theta + alpha nabla_theta J(theta)$\n```\n]\n#fig(\"/public/assets/AI/AI_RL/img-2024-07-05-15-16-33.png\", width: 80%)\n- \u601d\u8003\u5f3a\u5316\u5b66\u4e60\u4e0e\u5206\u7c7b\u95ee\u9898\u5bf9\u6bd4\n + \u90fd\u662f\u8f93\u5165\u72b6\u6001\uff0c\u8f93\u51fa\u8981\u91c7\u53d6\u7684\u884c\u4e3a\n + \u5206\u7c7b\u95ee\u9898\uff08\u76d1\u7763\u5b66\u4e60\uff09\uff1a\u5047\u8bbe\u6709\u5e26\u6807\u7b7e\u7684\u8bad\u7ec3\u6570\u636e\uff0c\u968f\u540e\u5229\u7528\u6781\u5927\u4f3c\u7136\u6cd5\u8fdb\u884c\u4f18\u5316\n + \u5f3a\u5316\u5b66\u4e60\uff1a\u6ca1\u6709\u6807\u7b7e\uff0c\u53ea\u80fd\u901a\u8fc7\u8bd5\u9519\u7684\u65b9\u5f0f\u4e0e\u73af\u5883\u4ea4\u4e92\u83b7\u53d6\u5956\u52b1\uff0c\u4ee5\u66ff\u4ee3\u76d1\u7763\u4fe1\u606f\u8fdb\u884c\u8bad\u7ec3\n- \u4e00\u4e2a\u95ee\u9898\u2014\u2014*\u8bad\u7ec3\u53ef\u80fd\u5b58\u5728\u504f\u5dee*\n #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-10-41-17.png\")\n - \u89e3\u51b3\u529e\u6cd5\uff0c\u6dfb\u52a0 *baseline*\uff1a\u5c06\u5956\u52b1\u51fd\u6570\u51cf\u53bb\u4e00\u4e2a\u57fa\u7ebf $b$\uff0c\u4f7f\u5f97 $R(tau)-b$ \u6709\u6b63\u6709\u8d1f\n - \u5982\u679c $R(tau)>b$ \u5c31\u8ba9\u91c7\u53d6\u5bf9\u5e94\u52a8\u4f5c\u7684\u6982\u7387\u63d0\u5347\uff1b\u5982\u679c $R(tau)$ \u574f\u7b56\u7565 $->$ \u4f4e\u8d28\u91cf\u7684\u6570\u636e\uff0c\u4e8e\u662f\u53ef\u80fd\u96be\u4ee5\u4ece\u7cdf\u7cd5\u7684\u7b56\u7565\u4e2d\u6062\u590d\uff0c\u8fdb\u800c\u5bfc\u81f4\u6027\u80fd\u5d29\u6e83\uff09\n- \u79bb\u7b56\u7565\u68af\u5ea6\uff1a\u6839\u636e\u91cd\u8981\u6027\u91c7\u6837\u5229\u7528\u5f02\u7b56\u7565\u6837\u672c\n - \u542c\u4e0d\u61c2\n- \u81ea\u7136\u7b56\u7565\u68af\u5ea6\n - \u542c\u4e0d\u61c2\n\n=== Actor-Critic \u7b97\u6cd5\n\n- \u4e3a\u4ec0\u4e48\u8981\u5f15\u5165 Actor-Critic\uff1f\u4e3b\u8981\u662f\u56e0\u4e3a REINFORCE \u6548\u7387\u4e0d\u9ad8\n - REINFORCE \u7b97\u6cd5\u4e2d\u7684\u7684\u8f68\u8ff9\u56de\u62a5\u671f\u671b\u91c7\u7528\u76f4\u63a5\u76f8\u52a0 $R(tau^n)=sum_(t'=t)^T r(s_t'^i,a_t'^i)$\n - \u8fd9\u6837\u505a\u65b9\u5dee\u8f83\u5927\uff0c\u4e0d\u6613\u6536\u655b\u3002\u6211\u4eec\u53ef\u4ee5\u7528\u52a8\u4f5c\u4ef7\u503c\u4f30\u8ba1 $hat(Q)^pi$ \u6765\u8fd1\u4f3c\u8f68\u8ff9\u56de\u62a5\u671f\u671b$EE_(pi_theta) sum_(t'=t)^T r(s_t'^i,a_t'^i)$\uff0c\u8fd9\u5c31\u662f\u8bc4\u8bba\u5bb6(critic)\n - \u5bf9\u5e94\u5730\uff0c\u7b56\u7565 $pi_theta$ \u79f0\u4e3a\u6267\u884c\u8005(actor)\n#algo(caption: \"Actor-Critic \u7b97\u6cd5\")[\n```typ\n\u4f7f\u7528\u5f53\u524d\u7b56\u7565 $pi_theta$ \u5728\u73af\u5883\u4e2d\u8fdb\u884c\u91c7\u6837\n\u7b56\u7565\u63d0\u5347\uff1a$theta <- theta + alpha nabla_theta J(theta) approx 1/N sum_(i=1)^N (sum_(t=1)^T nabla_theta log pi_theta (a_t^i|s_t^i) hat(Q)^pi (s_t^i,a_t^i))$\n\u62df\u5408\u5f53\u524d\u7b56\u7565\u7684\u52a8\u4f5c\u503c\u51fd\u6570\uff1a$hat(Q)^pi (s_t'^i,a_t'^i) approx sum_(t'=t)^T r(s_t'^i,a_t'^i)$\n```\n]\n#fig(\"/public/assets/AI/AI_RL/img-2024-07-05-15-17-48.png\")\n- Advantage Actor-Critc(A2C)\u7b97\u6cd5\n - \u601d\u60f3\uff1a\u901a\u8fc7\u51cf\u53bb\u4e00\u4e2a\u57fa\u7ebf\u503c\u6765\u6807\u51c6\u5316\u8bc4\u8bba\u5bb6\u7684\u6253\u5206\n - \u964d\u4f4e\u8f83\u5dee\u52a8\u4f5c\u6982\u7387\uff0c\u63d0\u9ad8\u8f83\u4f18\u52a8\u4f5c\u6982\u7387\n - \u8fdb\u4e00\u6b65\u964d\u4f4e\u65b9\u5dee\n - \u4f18\u52bf\u51fd\u6570\uff1a$A^pi (s,a)=Q^pi (s,a)-V^pi (s_t)$\uff0c\u6539\u53d8critic\uff0c\u4e8e\u662f\u539f\u672c AC \u7b97\u6cd5\u7684\u7b56\u7565\u68af\u5ea6 #mitex(`\\nabla_{\\theta}J(\\theta)\\approx\\frac{1}{N}\\sum_{i=1}^{N}\\left(\\sum_{t=1}^{T}V_{\\theta}\\,l o g\\,\\pi_{\\theta}(a_{t}^{i}|s_{t}^{i})\\bar{Q}^{\\pi}(s_{i}^{i},\\alpha_{t}^{i})\\right)`) \u53d8\u4e3a #mitex(`\\nabla_{\\theta}J(\\theta)\\approx\\frac{1}{N}\\sum_{i=1}^{N}\\left(\\sum_{t=1}^{T}\\nabla_{\\theta}\\,l o g\\,\\pi_{\\theta}(a_{t}^{i}|s_{t}^{i})\\bar{A}^{\\pi}(s_{i}^{i},\\alpha_{t}^{i})\\right)`)\n - $Q$ \u548c $V$\u9700\u8981\u7528\u4e24\u4e2a\u795e\u7ecf\u7f51\u7edc\u62df\u5408\u5417\uff1f\n - \u4e0d\u9700\u8981 $hat(Q)^pi (s_t^i,a_t^i)= R(s_t^i,a_t^i) + gamma hat(V)^pi (s_(t+1)^i)$\uff0c\u53ea\u9700\u7528\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u62df\u5408$hat(V)^pi$\n - \u72b6\u6001\u503c\u4f30\u8ba1$hat(V)^pi$\u80fd\u5426\u4e0e\u7b56\u7565 $pi_theta$ \u5171\u7528\u7f51\u7edc\uff1f\n #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-11-15-17.png\")\n - \u5982\u679c\u91c7\u7528\u76f8\u540c\u7684\u7f51\u7edc\u53bb\u8bad\u7ec3\uff0c\u8fd9\u8fb9\u7684 loss function \u6ca1\u6709\u8bb2\uff08actor \u7684 loss\uff0ccritic \u7684 loss\uff0cactor \u7684\u6b63\u5219\u5316\u9879 entropy\uff09\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee3\u7801\u6216\u8005\u770b #link(\"https://www.cnblogs.com/wangxiaocvpr/p/8110120.html\")[\u8fd9\u7bc7\u6587\u7ae0]\n - \u6279\u91cf\u66f4\u65b0\uff08\u6ca1\u542c\u61c2\uff09\n - \u95ee\u9898\uff1a\u5229\u7528\u5355\u4e2a\u6837\u672c\u8fdb\u884c\u66f4\u65b0\uff1a\u66f4\u65b0\u65b9\u5dee\u8f83\u5927\uff0c\u8bad\u7ec3\u7a33\u5b9a\u6027\u5dee\n - \u89e3\u51b3\u65b9\u6848\uff1a\u83b7\u5f97\u4e00\u4e2a\u6279\u6b21\u7684\u6570\u636e\u540e\u518d\u8fdb\u884c\u66f4\u65b0\uff0c\u5206\u4e3a\u540c\u6b65\u548c\u5f02\u6b65\u4e24\u79cd\u65b9\u6cd5\n #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-11-22-12.png\")\n - \u6279\u91cf\u66f4\u65b0\u518d\u6539\u8fdb\n #fig(\"/public/assets/AI/AI_RL/img-2024-07-05-11-22-32.png\")\n\n- Asynchronous Advantage Actor-Critc(A3C)\u7b97\u6cd5\n - \u4e0eA2C\u4e00\u6837\u4f7f\u7528\u4f18\u52bf\u51fd\u6570\n - \u5f02\u6b65\u7684Actor-Critic\u65b9\u6cd5\u80fd\u591f\u5145\u5206\u5229\u7528\u591a\u6838CPU\u8d44\u6e90\u91c7\u6837\u73af\u5883\u7684\u7ecf\u9a8c\u6570\u636e\uff0c\u5229\u7528GPU\u8d44\u6e90\u5f02\u6b65\u5730\u66f4\u65b0\u7f51\u7edc\uff0c\u8fd9\u6709\u6548\u63d0\u5347\u4e86\u5f3a\u5316\u5b66\u4e60\u7b97\u6cd5\u7684\u8bad\u7ec3\u6548\u7387\n\n== TRPO & PPO\n- TRPO\uff08Trust Region Policy Optimization\uff09\u662f\u4e00\u79cd\u57fa\u4e8e\u7b56\u7565\u68af\u5ea6\u7684\u5f3a\u5316\u5b66\u4e60\u7b97\u6cd5\uff0c\u5176\u76ee\u6807\u662f\u6700\u5927\u5316\u7b56\u7565\u7684\u671f\u671b\u56de\u62a5\n- \u7f6e\u4fe1\u57df(Trust Region)\u7684\u6982\u5ff5\u5c31\u662f\u5728 $N(theta_\"now\")$ \u7684\u90bb\u57df\u5185\uff0c$L(theta|theta_\"now\")$ \u8db3\u591f\u903c\u8fd1\u4f18\u5316\u76ee\u6807 $J(theta)$\n- \u524d\u9762\u4ecb\u7ecd\u7684\u7b56\u7565\u68af\u5ea6\u65b9\u6cd5\uff08\u5305\u62ec REINFORCE \u548c Actor-Critic\uff09\u7528\u8499\u7279\u5361\u6d1b\u8fd1\u4f3c\u68af\u5ea6 $nabla_theta J(theta)$\uff0c\u5f97\u5230\u968f\u673a\u68af\u5ea6\uff0c\u7136\u540e\u505a\u968f\u673a\u68af\u5ea6\u4e0a\u5347\u66f4\u65b0 $theta$\uff0c\u4f7f\u5f97\u76ee\u6807\u51fd\u6570 $J(theta)$ \u589e\u5927\uff1b\u800c\u8fd9\u91cc\u662f\u7528\u4e0d\u540c\u7684\u65b9\u6cd5\n- \u76ee\u6807\u51fd\u6570\u7b49\u4ef7\u5f62\u5f0f\u5199\u6210#mitex(`J(\\theta)~=~\\mathbb{E}_{S}\\left[\\mathbb{E}_{A\\cdots\\pi(\\cdot|S;\\theta_{\\mathrm{now}})}\\left[\\frac{\\pi(A\\mid S;\\,\\theta)}{\\pi(A\\mid S;\\,\\theta_{\\mathrm{now}})}~\\cdot\\,{\\cal Q}_{\\pi}(S,A)\\right]\\right]`)\n - \u5176\u4e2d $Q_pi (S, A)$ \u4f9d\u65e7\u65e0\u6cd5\u6c42\u89e3\uff0c\u56e0\u6b64\u4f7f\u7528\u8fed\u4ee3\u4e2d\u7684\u4e0a\u4e00\u6b65\u7684 $pi=pi(a_t | s_t\\; theta_\"old\")$\n- TRPO \u7b2c\u4e8c\u90e8\u7f6e\u4fe1\u57df\u7684\u9009\u62e9\n - \u8ba4\u4e3a\u8bbe\u5b9a\u7684 $Delta$\n - \u7528 KL \u6563\u5ea6\u8861\u91cf\u4e24\u4e2a\u6982\u7387\u8d28\u91cf\u51fd\u6570\u7684\u8ddd\u79bb\n- TRPO \u7b97\u6cd5\u771f\u6b63\u5b9e\u73b0\u8d77\u6765\u5e76\u4e0d\u5bb9\u6613\uff0c\u4e3b\u8981\u96be\u70b9\u5728\u4e8e\u7b2c\u4e8c\u6b65\u2014\u2014\u6700\u5927\u5316\u3002\n#hline()\n- PPO \u57fa\u4e8e TRPO \u7684\u601d\u60f3\uff0c\u4f46\u662f\u5176\u7b97\u6cd5\u5b9e\u73b0\u66f4\u52a0\u7b80\u5355\n- PPO-\u60e9\u7f5a\n - \u76f4\u63a5\u5c06\u7f6e\u4fe1\u57df\u7ea6\u675f KL \u6563\u5ea6\u4f5c\u4e3a\u635f\u5931\u51fd\u6570\u7684\u4e00\u90e8\u5206\uff0c\u8fd9\u6837\u5c31\u4e0d\u9700\u8981\u6c42\u89e3\u6700\u5927\u5316\u95ee\u9898\n- PPO-\u622a\u65ad\n - PPO \u7684\u53e6\u4e00\u79cd\u5f62\u5f0f PPO-\u622a\u65ad\uff08PPO-Clip\uff09\u66f4\u52a0\u76f4\u63a5\uff0c\u5b83\u5728\u76ee\u6807\u51fd\u6570\u4e2d\u8fdb\u884c\u9650\u5236\uff0c\u4ee5\u4fdd\u8bc1\u65b0\u7684\u53c2\u6570\u548c\u65e7\u7684\u53c2\u6570\u7684\u5dee\u8ddd\u4e0d\u4f1a\u592a\u5927\n\n== \u8fde\u7eed\u63a7\u5236\n- \u8003\u8651\u8fd9\u6837\u4e00\u4e2a\u95ee\u9898\uff1a\u6211\u4eec\u9700\u8981\u63a7\u5236\u4e00\u53ea\u673a\u68b0\u624b\u81c2\uff0c\u5b8c\u6210\u67d0\u4e9b\u4efb\u52a1\uff0c\u83b7\u53d6\u5956\u52b1\u3002\u673a\u68b0\u624b\u81c2\u6709\u4e24\u4e2a\u5173\u8282\uff0c\u5206\u522b\u53ef\u4ee5\u5728 $[0, 360] \u4e0e [0, 180]$ \u7684\u8303\u56f4\u5185\u8f6c\u52a8\u3002\u8fd9\u4e2a\u95ee\u9898\u7684\u81ea\u7531\u5ea6\u662f $d = 2$\uff0c\u52a8\u4f5c\u662f\u4e8c\u7ef4\u5411\u91cf\uff0c\u52a8\u4f5c\u7a7a\u95f4\u662f\u8fde\u7eed\u96c6\u5408 $cal(A) = [0, 360] times [0, 180]$\u3002\n- \u6b64\u524d\u6211\u4eec\u5b66\u8fc7\u7684\u5f3a\u5316\u5b66\u4e60\u65b9\u6cd5\u5168\u90e8\u90fd\u662f\u9488\u5bf9\u79bb\u6563\u52a8\u4f5c\u7a7a\u95f4\uff0c\u4e0d\u80fd\u76f4\u63a5\u89e3\u51b3\u4e0a\u8ff0\u7eed\u63a7\u5236\u95ee\u9898\u3002\u5982\u679c\u7528\u7f51\u683c\u5316\u65b9\u6cd5\uff0c\u5c06\u8fde\u7eed\u52a8\u4f5c\u7a7a\u95f4\u79bb\u6563\u5316\uff0c\u4f1a\u5bfc\u81f4\u52a8\u4f5c\u7a7a\u95f4\u8fc7\u5927\uff0c\u8bad\u7ec3\u6548\u7387\u4f4e\u4e0b\u3002\u7279\u522b\u662f\u81ea\u7531\u5ea6\u8f83\u9ad8\u7684\u95ee\u9898\uff0c\u8fd9\u79cd\u65b9\u6cd5\u51e0\u4e4e\u4e0d\u53ef\u884c\u3002\n== DPG\n- \u786e\u5b9a\u7b56\u7565\u68af\u5ea6(deterministic policy gradient)\u662f\u4e00\u79cd actor-critic \u65b9\u6cd5\n- \u786e\u5b9a\u7b56\u7565\u7f51\u7edc\n - \u5728\u4e4b\u524d\u7ae0\u8282\u91cc\uff0c\u7b56\u7565\u7f51\u7edc $pi(a|s\\; theta)$ \u662f\u4e00\u4e2a\u6982\u7387\u8d28\u91cf\u51fd\u6570\uff0c\u5b83\u8f93\u51fa\u7684\u662f\u6982\u7387\u503c\u3002\u672c\u8282\u7684\u786e\u5b9a\u7b56\u7565\u7f51\u7edc $mu(s\\; theta)$ \u7684\u8f93\u51fa\u662f $d$ \u7ef4\u7684\u5411\u91cf $ba$\uff0c\u4f5c\u4e3a\u52a8\u4f5c\u3002\u4e24\u79cd\u7b56\u7565\u7f51\u7edc\u4e00\u4e2a\u662f\u968f\u673a\u7684\uff0c\u4e00\u4e2a\u662f\u786e\u5b9a\u6027\u7684\n - \u4e2a\u4eba\u8ba4\u4e3a\u4e0d\u662f\u5f88\u672c\u8d28\uff08\uff1f\uff09\uff0c\u611f\u89c9\u5c31\u662f\u628a\u5728\u5916\u7684 argmax \u653e\u5230\u795e\u7ecf\u7f51\u7edc\u91cc\u9762\u53bb\u4e86\n- \u786e\u5b9a\u4ef7\u503c\u7f51\u7edc\n - \u4ef7\u503c\u7f51\u7edc $Q(s, ba\\; bw)$ \u4e5f\u662f\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\uff0c\u5b83\u7684\u8f93\u5165\u662f\u72b6\u6001 $s$ \u548c\u52a8\u4f5c $ba$\uff0c\u8f93\u51fa $hat(q) = q(s, ba; bw)$ \u662f\u4e2a\u5b9e\u6570\n- \u603b\u800c\u8a00\u4e4b\uff0c\u4e2a\u4eba\u8ba4\u4e3a\u8fd9\u91cc\u76f8\u5f53\u4e8e actor-critic \u7684\u53d8\u79cd\uff0c\u5e76\u4e14\u771f\u6b63\u628a\u4e24\u4e2a\u7f51\u7edc\u5206\u4e86\u5f00\u6765\uff0c\u4e24\u4e2a\u7f51\u7edc\u5206\u522b\u8bad\u7ec3\uff0c\u800c\u4e0d\u662f\u5171\u4eab\u524d\u51e0\u5c42\n- \u8bad\u7ec3\u8fc7\u7a0b\n - \u505a\u8bad\u7ec3\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u540c\u65f6\u5bf9\u4ef7\u503c\u7f51\u7edc\u548c\u7b56\u7565\u7f51\u7edc\u505a\u8bad\u7ec3\u3002\u6bcf\u6b21\u4ece\u7ecf\u9a8c\u56de\u653e\u6570\u7ec4\u4e2d\u62bd\u53d6\u4e00\u4e2a\u56db\u5143\u7ec4\uff0c\u8bb0\u4f5c $(s_j, a_j, r_j, s_(j+1))$\u3002\u628a\u4ef7\u503c\u7f51\u7edc\u548c\u7b56\u7565\u7f51\u7edc\u5f53\u524d\u53c2\u6570\u5206\u522b\u8bb0\u4f5c $w_\"now\"$ \u548c $theta_\"now\"$\n -" }, { "repo": "https://github.com/YouXam/bupt-network-resources-guide", "file": "https://raw.githubusercontent.com/YouXam/bupt-network-resources-guide/main/README.md", "language": "markdown", "license": "MIT License", "content": "# bupt-network-resources-guide\n\n\u5317\u90ae\u7f51\u7edc\u8d44\u6e90\u624b\u518c\uff0c\u5305\u542b\u4e86\u5317\u90ae\u5b66\u751f\u53ef\u80fd\u9700\u8981\u7684\u5404\u79cd\u7f51\u7edc\u8d44\u6e90\u7684\u4ecb\u7ecd\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\n\n\u76ee\u5f55\u9884\u89c8\uff1a\n\n![\u76ee\u5f55\u9884\u89c8](https://github.com/YouXam/bupt-network-resources-guide/releases/latest/download/preview.jpg)\n\n## \u4e0b\u8f7d\n\n\u4f60\u53ef\u4ee5\u4ece [\u8fd9\u91cc](https://github.com/YouXam/bupt-network-resources-guide/releases/latest/download/bupt-network-resources-guide.pdf) \u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684 PDF \u6587\u4ef6\u3002\n\n\n## \u7f16\u8bd1\n\n```bash\ntypst compile --font-path fonts main.typ bupt-network-resources-guide.pdf\n```" }, { "repo": "https://github.com/Quaternijkon/notebook", "file": "https://raw.githubusercontent.com/Quaternijkon/notebook/main/content/\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5/.chapter-\u6570\u636e\u7ed3\u6784/\u6811/\u4e8c\u53c9\u6811\u6700\u5927\u6df1\u5ea6.typ", "language": "typst", "license": "", "content": "#import \"../../../../lib.typ\":*\n\n=== #Title(\n title: [\u4e8c\u53c9\u6811\u6700\u5927\u6df1\u5ea6],\n reflink: \"https://leetcode.cn/problems/maximum-depth-of-binary-tree/description/\",\n level: 1,\n)<\u4e8c\u53c9\u6811\u6700\u5927\u6df1\u5ea6>\n\n#note(\n title: [\n\u4e8c\u53c9\u6811\u6700\u5927\u6df1\u5ea6\n ],\n\n description: [\n\u7ed9\u5b9a\u4e00\u4e2a\u4e8c\u53c9\u6811 root \uff0c\u8fd4\u56de\u5176\u6700\u5927\u6df1\u5ea6\u3002\n\n\u4e8c\u53c9\u6811\u7684 \u6700\u5927\u6df1\u5ea6 \u662f\u6307\u4ece\u6839\u8282\u70b9\u5230\u6700\u8fdc\u53f6\u5b50\u8282\u70b9\u7684\u6700\u957f\u8def\u5f84\u4e0a\u7684\u8282\u70b9\u6570\u3002\n ],\n\n examples: ([\n\u8f93\u5165\uff1aroot = [3,9,20,null,null,15,7]\n\n\u8f93\u51fa\uff1a3 \n ],[\n\u8f93\u5165\uff1aroot = [1,null,2]\n\n\u8f93\u51fa\uff1a2 \n ]\n ),\n\n tips: [\n- \u6811\u4e2d\u8282\u70b9\u7684\u6570\u91cf\u5728 $[0, 10^4]$ \u533a\u95f4\u5185\u3002\n- $-100 <= \"Node.val\" <= 100$\n ],\n\n solutions: (\n (\n name:[\u540e\u5e8f\u904d\u5386\uff08DFS\uff09: \u9012\u5f52],\n text:[\n\u6811\u7684\u540e\u5e8f\u904d\u5386 / \u6df1\u5ea6\u4f18\u5148\u641c\u7d22\u5f80\u5f80\u5229\u7528 \u9012\u5f52 \u6216 \u6808 \u5b9e\u73b0\u3002\n\n\u663e\u7136\uff0c\u6811\u7684\u6df1\u5ea6 \u7b49\u4e8e \u5de6\u5b50\u6811\u7684\u6df1\u5ea6 \u4e0e \u53f3\u5b50\u6811\u7684\u6df1\u5ea6\u4e2d\u7684 \u6700\u5927\u503c +1\u3002\n\n1. \u7ec8\u6b62\u6761\u4ef6\uff1a \u5f53 `root\u200b` \u4e3a\u7a7a\uff0c\u8bf4\u660e\u5df2\u8d8a\u8fc7\u53f6\u8282\u70b9\uff0c\u56e0\u6b64\u8fd4\u56de \u6df1\u5ea6 0 \u3002\n2. \u9012\u63a8\u5de5\u4f5c\uff1a \u672c\u8d28\u4e0a\u662f\u5bf9\u6811\u505a\u540e\u5e8f\u904d\u5386\u3002\n - \u8ba1\u7b97\u8282\u70b9 `root\u200b` \u7684 \u5de6\u5b50\u6811\u7684\u6df1\u5ea6 \uff0c\u5373\u8c03\u7528 `maxDepth(root.left)`\u3002\n - \u8ba1\u7b97\u8282\u70b9 `root\u200b` \u7684 \u53f3\u5b50\u6811\u7684\u6df1\u5ea6 \uff0c\u5373\u8c03\u7528 `maxDepth(root.right)`\u3002\n3. \u8fd4\u56de\u503c\uff1a \u8fd4\u56de \u6b64\u6811\u7684\u6df1\u5ea6 \uff0c\u5373 `max(maxDepth(root.left), maxDepth(root.right)) + 1`\u3002\n ],\n code:[\n```cpp \nclass Solution {\npublic:\n int maxDepth(TreeNode* root) {\n if (root == nullptr) return 0;\n return max(maxDepth(root->left), maxDepth(root->right)) + 1;\n }\n};\n```\n ]\n ),(\n name:[\u5c42\u5e8f\u904d\u5386\uff08BFS\uff09],\n text:[\n\u6811\u7684\u5c42\u5e8f\u904d\u5386 / \u5e7f\u5ea6\u4f18\u5148\u641c\u7d22\u5f80\u5f80\u5229\u7528 \u961f\u5217 \u5b9e\u73b0\u3002\n\n\u6bcf\u904d\u5386\u4e00\u5c42\uff0c\u5219\u8ba1\u6570\u5668 +1 \uff0c\u76f4\u5230\u904d\u5386\u5b8c\u6210\uff0c\u5219\u53ef\u5f97\u5230\u6811\u7684\u6df1\u5ea6\u3002\n\n+ \u7279\u4f8b\u5904\u7406\uff1a \u5f53 `root\u200b` \u4e3a\u7a7a\uff0c\u76f4\u63a5\u8fd4\u56de \u6df1\u5ea6 0 \u3002\n+ \u521d\u59cb\u5316\uff1a \u961f\u5217 `queue` \uff08\u52a0\u5165\u6839\u8282\u70b9 `root` \uff09\uff0c\u8ba1\u6570\u5668 `res` = 0\u3002\n+ \u5faa\u73af\u904d\u5386\uff1a \u5f53 `queue` \u4e3a\u7a7a\u65f6\u8df3\u51fa\u3002\n - \u521d\u59cb\u5316\u4e00\u4e2a\u7a7a\u5217\u8868 `tmp` \uff0c\u7528\u4e8e\u4e34\u65f6\u5b58\u50a8\u4e0b\u4e00\u5c42\u8282\u70b9\u3002\n - \u904d\u5386\u961f\u5217\uff1a \u904d\u5386 `queue` \u4e2d\u7684\u5404\u8282\u70b9 `node` \uff0c\u5e76\u5c06\u5176\u5de6\u5b50\u8282\u70b9\u548c\u53f3\u5b50\u8282\u70b9\u52a0\u5165 `tmp\u3002`\n - \u66f4\u65b0\u961f\u5217\uff1a \u6267\u884c `queue` = `tmp` \uff0c\u5c06\u4e0b\u4e00\u5c42\u8282\u70b9\u8d4b\u503c\u7ed9 `queue\u3002`\n - \u7edf\u8ba1\u5c42\u6570\uff1a \u6267\u884c `res += 1` \uff0c\u4ee3\u8868\u5c42\u6570\u52a0 1\u3002\n+ \u8fd4\u56de\u503c\uff1a \u8fd4\u56de `res` \u5373\u53ef\u3002\n ],\n code:[\n```cpp\nclass Solution {\npublic:\n int maxDepth(TreeNode* root) {\n if (root == nullptr) return 0;\n vector que;\n que.push_back(root);\n int res = 0;\n while (!que.empty()) {\n vector tmp;\n for(TreeNode* node : que) {\n if (node->left != nullptr) tmp.push_back(node->left);\n if (node->right != nullptr) tmp.push_back(node->right);\n }\n que = tmp;\n res++;\n }\n return res;\n }\n};\n``` \n ]\n )\n\n ),\n\n gain:none,\n)\n" }, { "repo": "https://github.com/malramsay64/resume", "file": "https://raw.githubusercontent.com/malramsay64/resume/main/template.typ", "language": "typst", "license": "", "content": "#import \"utils.typ\"\n#import \"@preview/fontawesome:0.4.0\" as fa\n\n/* Styles */\n\n#let accentColor = luma(80)\n\n#let headerInfoStyle(str) = {text(\n size: 10pt,\n fill: accentColor,\n str\n)}\n\n#let headerQuoteStyle(str) = {text(\n size: 10pt,\n weight: \"medium\",\n // style: \"italic\",\n fill: accentColor,\n str\n)}\n\n#let sectionTitleStyle(str, color:black) = {text(\n size: 16pt, \n weight: \"bold\", \n fill: color,\n str\n)}\n\n#let entryA1Style(str) = {text(\n size: 10pt,\n weight: \"bold\",\n str\n)}\n\n\n#let entryA2Style(str) = {text(\n weight: \"medium\",\n // fill: accentColor,\n style: \"oblique\",\n str\n)}\n\n#let entryB1Style(str) = {text(\n // size: 10pt,\n fill: accentColor,\n weight: \"medium\",\n str\n)}\n\n#let entryB2Style(str) = {text(\n size: 9pt,\n weight: \"medium\",\n fill: luma(80),\n style: \"oblique\",\n str\n)}\n\n// set rules\n#let setrules(uservars, doc) = {\n set text(\n font: uservars.bodyfont,\n weight: \"regular\",\n size: uservars.fontsize,\n )\n\n set align(left)\n\n set page(\n paper: \"a4\",\n margin: (\n left: 1.8cm,\n right: 1.8cm,\n top: 1.5cm,\n bottom: 1.8cm,\n ),\n ) \n\n set list(\n spacing: uservars.linespacing\n )\n\n set par(\n leading: uservars.linespacing,\n justify: true,\n )\n\n doc\n}\n\n// show rules\n#let showrules(uservars, doc) = {\n show heading.where(level: 1): set text(font: uservars.headingfont, size: 32pt)\n show heading.where(level: 2): title => pad(bottom: 0.2em, grid(\n columns: 2,\n gutter: 1%,\n sectionTitleStyle()[#title],\n line(\n start: (0pt, 0.95em),\n length: 100%,\n stroke: (paint: accentColor, thickness: 0.05em),\n ),\n ))\n\n doc\n}\n\n// set page layout\n#let cvinit(doc) = {\n doc = setrules(doc)\n doc = showrules(doc)\n\n doc\n}\n\n// address\n// TODO\n#let addresstext(info, uservars) = {\n if uservars.showAddress {\n block(width: 100%)[\n #info.personal.location.at(\"city\", default: \"\"), \n #info.personal.location.at(\"region\", default: \"\"), \n #info.personal.location.country #info.personal.location.at(\"postalCode\", default: \"\")\n #v(-4pt)\n ]\n } else {none}\n}\n\n#let contacttext(info, uservars) = block(width: 100%)[\n #let contact_display(icon, url, display: none) = {\n let l = if display == none {\n link(url)\n } else {\n link(url)[#display]\n }\n box([#icon #sym.zws #l])\n }\n #let profiles = (\n contact_display(fa.fa-envelope(solid: true), \"mailto:\" + info.personal.email), \n )\n #if uservars.showNumber {\n profiles.push(contact_display(fa.fa-phone(), \"tel:\" + info.personal.phone))\n }\n #if \"url\" in info.personal {\n profiles.push(contact_display(fa.fa-home(), info.personal.url, display: info.personal.url.trim(\"https://\", at: start)))\n }\n\n #if info.personal.profiles.len() > 0 {\n for profile in info.personal.profiles {\n let icon = if lower(profile.network) == \"linkedin\" {\n fa.fa-linkedin() \n } else if lower(profile.network) == \"github\" {\n fa.fa-github()\n // TODO: Extend the number of networks with icons\n } else {\n // fa.fa-circle()\n }\n profiles.push(contact_display(icon, profile.url, display: profile.username))\n }\n }\n\n #headerInfoStyle(profiles.join([ #sym.bar.v ]))\n\n #headerQuoteStyle(eval(info.personal.summary, mode: \"markup\"))\n]\n\n#let styleLabel(str) = {\n text(\n size: 20pt,\n str\n )\n}\n\n#let cvheading(info, uservars) = {\n align(center)[\n = #info.personal.name\n #if \"label\" in info.personal {\n styleLabel(info.personal.label)\n }\n #addresstext(info, uservars)\n #contacttext(info, uservars)\n ]\n}\n\n#let entryHeading(posA1: none, url: none, posA2: none, posB1: none, dateStart: none, dateEnd: none) = {\n let date = if dateStart == none {\n utils.strpdate(dateEnd)\n } else if dateEnd == none {\n utils.strpdate(dateStart)\n } else {\n let start = utils.strpdate(dateStart)\n let end = utils.strpdate(dateEnd)\n [#start #sym.dash.en #end]\n }\n // parse ISO date strings into datetime objects\n [\n // line 1: company and location\n #if url != none [\n #entryA1Style(link(url, posA1)) #h(1fr) #entryA2Style(posA2)\\\n ] else [\n #entryA1Style(posA1) #h(1fr) #entryA2Style(posA2)\\\n ]\n #entryB1Style(posB1) #h(1fr) #entryB2Style(date) \\\n ]\n}\n\n#let cvwork(info, isbreakable: true) = {\n let work = utils\n .filter_visible(info, \"work\")\n .map(utils.validate_work_instance)\n .sorted(key: i => i.positions.at(0).endDate)\n .rev()\n if work.len() > 0 [\n == Work Experience\n #for w in work {\n // create a block layout for each work entry\n for (index, p) in w.positions.enumerate() {\n block(width: 100%, breakable: isbreakable)[\n #if index == 0 {\n entryHeading(posA1: w.organization, url: w.url, posA2: w.location, posB1: p.position, dateStart: p.startDate, dateEnd: p.endDate)\n } else {\n entryHeading(posB1: p.position, dateStart: p.startDate, dateEnd: p.endDate)\n }\n // highlights or description\n #if p.summary != none [\n #eval(p.summary, mode: \"markup\")\n ]\n #for hi in p.highlights [\n - #eval(hi, mode: \"markup\")\n ]\n ]\n }\n }\n ]\n}\n\n#let cveducation(info, isbreakable: true) = {\n let education = utils\n .filter_visible(info, \"education\")\n .sorted(key: i => i.endDate)\n .rev()\n if education.len() > 0 [\n == Education\n #for edu in education {\n let edu-items = \"\"\n if edu.at(\"honors\", default: none) != none {edu-items = edu-items + \"- *Honors*: \" + edu.honors.join(\", \") + \"\\n\"}\n if edu.at(\"courses\", default: none) != none {edu-items = edu-items + \"- *Courses*: \" + edu.courses.join(\", \") + \"\\n\"}\n if edu.at(\"highlights\", default: none) != none {\n for hi in edu.highlights {\n edu-items = edu-items + \"- \" + hi + \"\\n\"\n }\n edu-items = edu-items.trim(\"\\n\")\n }\n\n // create a block layout for each education entry\n block(width: 100%, breakable: isbreakable)[\n #entryHeading(\n posA1: edu.institution, \n url: edu.url, \n posA2: edu.location, \n posB1: [#edu.studyType in #edu.area], \n dateStart: edu.startDate, \n dateEnd: edu.endDate\n )\n #eval(edu.summary, mode: \"markup\")\n #eval(edu-items, mode: \"markup\")\n ]\n }\n ]\n}\n\n#let cvaffiliations(info, isbreakable: true) = {\n if \"affiliations\" in info and info.affiliations != none [\n == Leadership & Activities\n #for org in info.affiliations {\n // create a block layout for each affiliation entry\n block(width: 100%, breakable: isbreakable)[\n #entryHeading(\n posA1: org.organization, \n url: org.url, \n posA2: org.location, \n posB1: org.position, \n dateStart: org.startDate, \n dateEnd: org.endDate\n )\n // highlights or description\n #if org.highlights != none {\n for hi in org.highlights [\n - #eval(hi, mode: \"markup\")\n ]\n }\n ]\n }\n ]\n}\n\n#let cvprojects(info, isbreakable: true) = {\n let projects = utils\n .filter_visible(info, \"projects\")\n .sorted(key: i => i.endDate)\n .rev()\n if projects.len() > 0 [\n == Projects\n #for project in projects {\n // create a block layout for each project entry\n block(width: 100%, breakable: isbreakable)[\n #entryHeading(\n posA1: project.name, \n url: project.at(\"url\", default: none), \n posB1: project.affiliation, \n dateStart: project.startDate, \n dateEnd: project.endDate\n )\n // summary or description\n #eval(project.summary, mode: \"markup\")\n #for hi in project.highlights [\n - #eval(hi, mode: \"markup\")\n ]\n // Project tools and technologies\n #if \"skills\" in project and project.skills.len() > 0 [\n // Ensure the skills look attached to the project\n #v(-0.5em)\n *Skills*: #project.skills.join(\", \")\n ]\n ]\n }\n ]\n}\n\n#let cvawards(info, isbreakable: true) = {\n let awards = utils\n .filter_visible(info, \"awards\")\n .sorted(key: i => i.date)\n .rev()\n if awards.len() > 0 [\n == Honors & Awards\n #for award in awards {\n // create a block layout for each award entry\n block(width: 100%, breakable: isbreakable)[\n #entryHeading(\n posA1: award.title, \n url: award.at(\"url\", default: none), \n posA2: award.location,\n posB1: [Issued by #text(style: \"italic\")[#award.issuer]], \n dateStart: award.date,\n )\n // summary or description\n #eval(award.summary, mode: \"markup\")\n #if award.at(\"highlights\", default: none) != none {\n for hi in award.highlights [\n - #eval(hi, mode: \"markup\")\n ]\n }\n ]\n }\n ]\n}\n\n#let cvcertificates(info, isbreakable: true) = {\n if \"certificates\" in info and info.certificates != none [\n == Licenses & Certifications\n\n #for cert in info.certificates {\n // parse ISO date strings into datetime objects\n let date = utils.strpdate(cert.date)\n // create a block layout for each certificate entry\n block(width: 100%, breakable: isbreakable)[\n // line 1: certificate name\n #if cert.at(\"url\", default: none) != none [\n *#link(cert.url)[#cert.name]* \\\n ] else [\n *#cert.name* \\\n ]\n // line 2: issuer and date\n Issued by #text(style: \"italic\")[#cert.issuer] #h(1fr) #date \\\n ]\n }\n ]\n}\n\n#let cvpresentations(info, isbreakable: true) = {\n let presentations = utils\n .filter_visible(info, \"presentations\")\n .sorted(key: i => i.date)\n .rev()\n if presentations.len() > 0 [\n == Presentations\n #for pres in presentations {\n // create a block layout for each publication entry\n block(width: 100%, breakable: isbreakable)[\n #entryHeading(\n posA1: pres.conference, \n url: pres.at(\"url\", default: none), \n posA2: pres.location, \n posB1: pres.title,\n dateEnd: pres.date\n )\n #eval(pres.summary, mode: \"markup\")\n ]\n }\n ]\n}\n\n#let cvpublications(info, isbreakable: true) = {\n let publications = utils\n .filter_visible(info, \"publications\")\n .sorted(key: i => i.releaseDate)\n .rev()\n if publications.len() > 0 [\n == Publications\n #for pub in info.publications {\n // parse ISO date strings into datetime objects\n let date = utils.strpdate(pub.releaseDate)\n // create a block layout for each publication entry\n block(width: 100%, breakable: isbreakable)[\n // line 1: publication title\n #if pub.at(\"url\", default: none) != none [\n *#link(pub.url)[#pub.name]* \\\n ] else [\n *#pub.name* \\\n ]\n // line 2: publisher and date\n Published in #text(style: \"italic\")[#pub.publisher] #h(1fr) #date \\\n ]\n }\n ]\n}\n\n#let cvskills(info, isbreakable: true) = {\n let title = ()\n if \"languages\" in info {\n title.push(\"Languages\")\n }\n if \"skills\" in info {\n title.push(\"Skills\")\n }\n if \"interests\" in info {\n title.push(\"Interests\")\n }\n \n if title.len() > 0 {block(breakable: isbreakable)[\n == #title.join(\", \")\n #if (\"languages\" in info and info.languages != none) [\n #let langs = ()\n #for lang in info.languages {\n langs.push([#lang.language (#lang.fluency)])\n }\n - *Languages*: #langs.join(\", \")\n ]\n #if (\"skills\" in info and info.skills != none) {\n grid(\n columns: 2,\n gutter: 10pt,\n ..info.skills.map(s => {\n (align(right)[*#s.category*], align(left)[#s.skills.join(\", \")])\n }).flatten()\n )\n }\n #if (\"interests\" in info and info.interests != none) [\n - *Interests*: #info.interests.join(\", \")\n ]\n ]}\n}\n\n#let cvreferences(info, isbreakable: true) = {\n if \"references\" in info and info.references != none {block[\n == References\n #for ref in info.references {\n block(width: 100%, breakable: isbreakable)[\n #if ref.at(\"url\", default: none) != none [\n - *#link(ref.url)[#ref.name]*: \"#ref.reference\"\n ] else [\n - *#ref.name*: \"#ref.reference\"\n ]\n ]\n }\n ]} else {}\n}\n\n#let endnote() = {\n}\n" }, { "repo": "https://github.com/TJ-CSCCG/tongji-slides-typst", "file": "https://raw.githubusercontent.com/TJ-CSCCG/tongji-slides-typst/main/README.md", "language": "markdown", "license": "MIT License", "content": "# tongji-slides-typst\n:page_facing_up: \u540c\u6d4e\u5927\u5b66\u5e7b\u706f\u7247\u6a21\u677f | Typst\n\n\u4e2d\u6587 | [English](README-EN.md)\n\n> [!CAUTION]\n> \u7531\u4e8e Typst \u9879\u76ee\u4ecd\u5904\u4e8e\u5bc6\u96c6\u53d1\u5c55\u9636\u6bb5\uff0c\u4e14\u5bf9\u67d0\u4e9b\u529f\u80fd\u7684\u652f\u6301\u4e0d\u5b8c\u5584\uff0c\u5e76\u4e14\u6b64\u6a21\u677f\u4e3a\u8fc7\u6e21\u6a21\u677f\u4e4b\u540e\u4f1a\u4f7f\u7528\u65b0\u7684package\u91cd\u5199\uff0c\u56e0\u6b64\u672c\u6a21\u677f\u53ef\u80fd\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\u3002\u5982\u679c\u60a8\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u9047\u5230\u4e86\u95ee\u9898\uff0c\u6b22\u8fce\u63d0\u4ea4 issue \u6216 PR\uff0c\u6211\u4eec\u4f1a\u5c3d\u529b\u89e3\u51b3\u3002\n>\n\n## \u6837\u4f8b\u5c55\u793a\n\n\u4ee5\u4e0b\u4f9d\u6b21\u5c55\u793a \u201ctitle-slide\u201d\u3001\u201c\u4f7f\u7528\u5b9e\u4f8b\u201d\u3001\u201cmatrix-slide\u201d\u3001\u201c\u81ea\u5b9a\u4e49materix-slide\u201d\u3001\u201c\u7a7a\u767dslide\u201d \u4e0e \u201cfocus-slide\u201d\u3002\n\n

\n \n \n \n \n \n \n

\n\n## \u4f7f\u7528\u65b9\u6cd5\n\n### \u672c\u5730\u7f16\u8bd1\n\n#### 1. \u5b89\u88c5 Typst\n\n\u53c2\u7167 [Typst](https://github.com/typst/typst?tab=readme-ov-file#installation) \u5b98\u65b9\u6587\u6863\u5b89\u88c5 Typst\u3002\n\n#### 2. clone \u672c\u9879\u76ee\n\n```bash\ngit clone https://github.com/TJ-CSCCG/tongji-slides-typst.git\ncd tongji-slides-typst\n```\n\u6309\u7167\u9700\u6c42\u4fee\u6539\u76f8\u5173\u6587\u4ef6\uff0c\u7136\u540e\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u7f16\u8bd1\u3002\n\n```bash\ntypst compile main.typ\ntypst2pngpdf main.typ ##\u7f16\u8bd1\u6210\u56fe\u7247pdf\u7684\u811a\u672c\uff0c\u9700\u8981\u5b89\u88c5imagemask\uff08\u4ee5\u9632pdf viewer\u592a\u8001\u65e0\u6cd5\u67e5\u770bslides\uff09\n```\n\n### \u5728\u7ebf\u7f16\u8bd1\n\n\u5728 [Typst App](https://typst.app) \u4e0a\u4f7f\u7528\u672c\u6a21\u677f\u8fdb\u884c\u5728\u7ebf\u7f16\u8bd1\u3002\n\n## \u5982\u4f55\u4e3a\u8be5\u9879\u76ee\u8d21\u732e\u4ee3\u7801\uff1f\n\n\u8fd8\u8bf7\u67e5\u770b [How to pull request](CONTRIBUTING.md/#how-to-pull-request)\u3002\n\n## \u5f00\u6e90\u534f\u8bae\n\n\u8be5\u9879\u76ee\u4f7f\u7528 [MIT License](LICENSE) \u5f00\u6e90\u534f\u8bae\u3002\n\n\n### QQ \u7fa4\n\n* TJ-CSCCG \u4ea4\u6d41\u7fa4\uff1a`1013806782`\n" }, { "repo": "https://github.com/Myriad-Dreamin/tinymist", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/hover/user.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n/// Test\n#let f() = 1;\n\n#(/* ident after */ f());\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/fletcher/0.2.0/test/test.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"@preview/cetz:0.1.2\"\n#import \"/src/exports.typ\": *\n\n\n#set page(width: 10cm, height: auto)\n#show heading.where(level: 1): it => pagebreak(weak: true) + it\n\n= Arrow heads\nCompare to symbols $#sym.arrow$, $#sym.arrow.twohead$, $#sym.arrow.hook$, $#sym.arrow.bar$\n\n#fletcher.diagram(\n\t// debug: 1,\n\tspacing: (10mm, 5mm),\n{\n\tfor i in (0, 1, 2) {\n\t\tlet x = 2*i\n\t\tlet bend = 40deg*i\n\t\t(\n\t\t\t(marks: (\"harpoon\", \"harpoon'\")),\n\t\t\t(marks: (\"head\", \"head\")),\n\t\t\t(marks: (\"tail\", \"tail\")),\n\t\t\t(marks: (\"twotail\", \"twohead\")),\n\t\t\t(marks: (\"twohead\", \"twotail\")),\n\t\t\t(marks: (\"hook\", \"head\")),\n\t\t\t(marks: (\"hook\", \"hook'\")),\n\t\t\t(marks: (\"bar\", \"bar\")),\n\t\t\t(marks: (none, none), extrude: (2.5,0,-2.5)),\n\t\t\t(marks: (\"head\", \"head\"), extrude: (1.5,-1.5)),\n\t\t\t(marks: (\"tail\", \"tail\"), extrude: (1.5,-1.5)),\n\t\t\t(marks: (\"bar\", \"head\"), extrude: (2,0,-2)),\n\t\t\t(marks: (\"twotail\", \"twohead\"), extrude: (1.5,-1.5)),\n\t\t\t(marks: (\"circle\", \"bigcircle\")),\n\t\t\t(marks: (\"circle\", \"bigcircle\"), extrude: (1.5, -1.5)),\n\t\t).enumerate().map(((i, args)) => {\n\t\t\tedge((x, -i), (x + 1, -i), ..args, bend: bend)\n\t\t}).join()\n\n\t}\n\n})\n\n= Double and triple lines\n\n#for (i, a) in (\"->\", \"=>\", \"==>\").enumerate() [\n\tFormula #fletcher.diagram(\n\t\t// node-inset: 5pt,\n\t\tlabel-sep: 1pt + i*1pt,\n\t\tnode((0, -i), $A$),\n\t\tedge((0, -i), (1, -i), text(0.6em, $f$), a),\n\t\tnode((1, -i), $B$),\n\t). \\\n]\n\n= Arrow head shorthands\n\n#import \"/src/main.typ\": parse-arrow-shorthand\n\n$\n#for i in (\n\t\"->\",\n\t\"<-\",\n\t\"<->\",\n\t\"<=>\",\n\t\"<==>\",\n\t\"|->\",\n\t\"|=>\",\n\t\">->\",\n\t\"->>\",\n\t\"hook->\",\n\t\"hook'--hook\",\n\t\"|=|\",\n\t\">>-<<\",\n\t\"harpoon-harpoon'\",\n\t\"harpoon'-<<\",\n\t\"<--hook'\",\n\t\"|..|\",\n\t\"hooks--hooks\",\n\t\"o-O\",\n\t\"o==O\",\n) {\n\t$ #block(inset: 2pt, fill: white.darken(5%), raw(i))\n\t&= #fletcher.diagram(edge((0,0), (1,0), ..parse-arrow-shorthand(i))) \\ $\n}\n$\n\n= Connectors\n\n\n#fletcher.diagram(\n\tdebug: 0,\n\tcell-size: (10mm, 10mm),\n\tnode((0,1), $X$),\n\tnode((1,1), $Y$),\n\tnode((0,0), $Z$),\n\tedge((0,1), (1,1), marks: (none, \"head\")),\n\tedge((0,0), (1,1), $f$, marks: (\"hook\", \"head\"), dash: \"dashed\"),\n\tedge((0,1), (0,0), marks: (none, \"twohead\")),\n\tedge((0,1), (0,1), marks: (none, \"head\"), bend: -120deg),\n)\n\n= Arc connectors\n\n#fletcher.diagram(\n\tcell-size: 3cm,\n{\n\tnode((0,0), \"from\")\n\tnode((1,0), \"to\")\n\tfor \u03b8 in (0deg, 20deg, -50deg) {\n\t\tedge((0,0), (1,0), $#\u03b8$, bend: \u03b8, marks: (none, \"head\"))\n\t}\n})\n\n#fletcher.diagram(\n\tdebug: 3,\n\tnode((0,0), $X$),\n\tnode((1,0), $Y$),\n\tedge((0,0), (1,0), bend: 45deg, marks: (\"head\", \"head\")),\n)\n\n#for (i, to) in ((0,1), (1,0), (calc.sqrt(1/2),-calc.sqrt(1/2))).enumerate() {\n\tfletcher.diagram(debug: 0, {\n\t\tnode((0,0), $A$)\n\t\tnode(to, $B$)\n\t\tlet N = 6\n\t\trange(N + 1).map(x => (x/N - 0.5)*2*120deg).map(\u03b8 => edge((0,0), to, bend: \u03b8, marks: (\"tail\", \"head\"))).join()\n\t})\n}\n\n= Defocus\n\n#let around = (\n\t(-1,+1), ( 0,+1), (+1,+1),\n\t(-1, 0), (+1, 0),\n\t(-1,-1), ( 0,-1), (+1,-1),\n)\n\n#grid(\n\tcolumns: 2,\n\t..(-10, -1, -.25, 0, +.25, +1, +10).map(defocus => {\n\t\t((7em, 3em), (3em, 7em)).map(((w, h)) => {\n\t\t\talign(center + horizon, fletcher.diagram(\n\t\t\t\tnode-defocus: defocus,\n\t\t\t\tnode-inset: 0pt,\n\t\t\t{\n\t\t\t\tnode((0,0), rect(width: w, height: h, inset: 0pt, align(center + horizon)[#defocus]))\n\t\t\t\tfor p in around {\n\t\t\t\t\tedge(p, (0,0))\n\t\t\t\t}\n\t\t\t}))\n\t\t})\n\t}).join()\n)\n\n= Label placement\nDefault placement above the line.\n\n#fletcher.diagram(\n\t// cell-size: (2.2cm, 2cm),\n\tspacing: 2cm,\n\tdebug: 3,\n{\n\tfor p in around {\n\t\tedge(p, (0,0), $f$)\n\t}\n})\n\n#fletcher.diagram(spacing: 1.5cm, {\n\tfor (i, a) in (left, center, right).enumerate() {\n\t\tfor (j, \u03b8) in (-30deg, 0deg, 50deg).enumerate() {\n\t\t\tedge((2*i, j), (2*i + 1, j), label: a, \"->\", label-side: a, bend: \u03b8)\n\t\t}\n\t}\n})\n\n\n= Crossing connectors\n\n#fletcher.diagram({\n\tedge((0,1), (1,0))\n\tedge((0,0), (1,1), crossing: true)\n\tedge((2,1), (3,0), \"|-|\", bend: -20deg)\n\tedge((2,0), (3,1), \"<=>\", crossing: true, bend: 20deg)\n})\n\n\n= `edge()` argument shorthands\n\n#fletcher.diagram(\n\tedge((0,0), (1,1), \"->\", \"double\", bend: 45deg),\n\tedge((1,0), (0,1), \"->>\", \"crossing\"),\n\tedge((1,1), (2,1), $f$, \"|->\"),\n\tedge((0,0), (1,0), \"-\", \"dashed\"),\n)\n\n\n= Diagram-level options\n\n#fletcher.diagram(\n\tnode-stroke: black,\n\tnode-fill: green.lighten(80%),\n\tlabel-sep: 0pt,\n\tnode((0,0), $A$),\n\tnode((1,1), $sin compose cos compose tan$, fill: none),\n\tnode((2,0), $C$),\n\tnode((3,0), $D$, shape: \"rect\"),\n\tedge((0,0), (1,1), $sigma$, \"->\", bend: -45deg),\n\tedge((2,0), (1,1), $f$, \"<-\"),\n)\n\n= CeTZ integration\n\n#import \"/src/utils.typ\": vector-polar\n#fletcher.diagram(\n\tnode((0,0), $A$, stroke: 1pt),\n\tnode((2,1), [B\u00e9zier], stroke: 1pt),\n\trender: (grid, nodes, edges, options) => {\n\t\tcetz.canvas({\n\t\t\tfletcher.draw-diagram(grid, nodes, edges, options)\n\n\t\t\tlet n1 = fletcher.find-node-at(nodes, (0,0))\n\t\t\tlet p1 = fletcher.get-node-anchor(n1, 0deg)\n\n\t\t\tlet n2 = fletcher.find-node-at(nodes, (2,1))\n\t\t\tlet p2 = fletcher.get-node-anchor(n2, -90deg)\n\n\t\t\tlet c1 = cetz.vector.add(p1, vector-polar(20pt, 0deg))\n\t\t\tlet c2 = cetz.vector.add(p2, vector-polar(70pt, -90deg))\n\n\t\t\tfletcher.draw-arrow-cap(p1, 180deg, (thickness: 1pt, paint: black), \"head\")\n\n\t\t\tcetz.draw.bezier(p1, p2, c1, c2)\n\t\t})\n\t}\n)\n\n= Node bounds\n\n#fletcher.diagram(\n\tdebug: 2,\n\tnode-outset: 5pt,\n\tnode-inset: 5pt,\n\tnode((0,0), `hello`, stroke: 1pt),\n\tnode((1,0), `there`, stroke: 1pt),\n\tedge((0,0), (1,0), \"<=>\"),\n)\n\n\n= Corner edges\n\n#let around = (\n\t(-1,+1), (+1,+1),\n\t(-1,-1), (+1,-1),\n)\n\n#for dir in (left, right) {\n\tpad(1mm, fletcher.diagram(\n\t\t// debug: 2,\n\t\tspacing: 1cm,\n\t\tnode((0,0), [#dir]),\n\t\t{\n\t\t\tfor c in around {\n\t\t\t\tnode(c, $#c$)\n\t\t\t\tedge((0,0), c, $f$, \"O=>\", corner: dir, label-pos: 0.4)\n\t\t\t}\n\t\t}\n\t))\n}\n" }, { "repo": "https://github.com/wjakethompson/wjt-quarto-ext", "file": "https://raw.githubusercontent.com/wjakethompson/wjt-quarto-ext/main/ku-letter/_extensions/ku-letter/typst-show.typ", "language": "typst", "license": "Creative Commons Zero v1.0 Universal", "content": "#show: doc => letter(\n$if(subject)$\n subject: [$subject$],\n$endif$\n$if(recipient)$\n recipient: [$recipient$],\n$endif$\n$if(sender)$\n sender: [$sender$],\n$endif$\n$if(header-logo)$\n header-logo: \"$header-logo$\",\n$endif$\n$if(footer-logo)$\n footer-logo: \"$footer-logo$\",\n$endif$\n$if(date)$\n date: [$date$],\n$endif$\n doc,\n)\n" }, { "repo": "https://github.com/goshakowska/Typstdiff", "file": "https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_complex/para/para_mix_result.typ", "language": "typst", "license": "", "content": "In this #strike[report,];#underline[changed,] we will\n#strike[explore];#underline[changed] the various factors that influence\n#emph[fluid dynamics] in#strike[ ];#strike[glaciers];#strike[\n];#strike[ha];#strike[ ];#strike[they];#strike[ ];#strike[contribute] to\nthe formation and behaviour of these natural structures.\n\n#strike[All];#strike[ ];#strike[manuscripts];#strike[\n];#strike[are];#strike[ ];#strike[to];#strike[ ];#strike[be];#strike[\n];#strike[submitted];#strike[ ];#strike[electronically];#strike[\n];#strike[to];#strike[ ];#strike[the];#strike[\n];#strike[ScholarOne];#strike[ ];#strike[Abstracts];#strike[\n];#strike[site];#strike[ ];#strike[created];#strike[\n];#strike[for];#strike[ ];#strike[each];#strike[\n];#strike[conference.];#strike[ ];#strike[The];#strike[\n];#strike[manuscript];#strike[ ];#strike[upload];#strike[\n];#strike[will];#strike[ ];#strike[be];#strike[\n];#strike[enabled];#strike[ ];#strike[several];#strike[\n];#strike[weeks];#strike[ ];#strike[after];#strike[\n];#strike[acceptance];#strike[ ];#strike[notices];#strike[\n];#strike[have];#strike[ ];#strike[been];#strike[\n];#strike[sent.];#strike[ ];#strike[Presenting];#strike[\n];#strike[authors];#strike[ ];#strike[of];#strike[\n];#strike[accepted];#strike[ ];#strike[papers];#strike[\n];#strike[will];#strike[ ];#strike[receive];#strike[\n];#strike[an];#strike[ ];#strike[email];#strike[ ];#strike[with];#strike[\n];#strike[instructions];#strike[ ];#strike[when];#strike[\n];#strike[manuscript];#strike[ ];#strike[submission];#strike[\n];#strike[opens.];#strike[ ];#strike[It];#strike[ ];#strike[is];#strike[\n];#strike[important];#strike[ ];#strike[that];#strike[\n];#strike[presenting];#strike[ ];#strike[authors];#strike[\n];#strike[keep];#strike[ ];#strike[their];#strike[\n];#strike[email];#strike[ ];#strike[addresses];#strike[\n];#strike[up-to-date];#strike[ ];#strike[so];#strike[\n];#strike[they];#strike[ ];#strike[do];#strike[ ];#strike[not];#strike[\n];#strike[miss];#underline[Something] #strike[this];#underline[new.]\n#strike[notice.];#underline[Monkey.]\n\n#underline[All];#underline[ ];#underline[changed];#underline[\n];#underline[are];#underline[ ];#underline[to];#underline[\n];#underline[be];#underline[ ];#underline[changed];#underline[\n];#strike[It];#underline[electronically] #strike[is];#underline[to]\nthe#underline[ ];#underline[site];#underline[\n];#underline[created];#underline[ ];#underline[for];#underline[\n];#underline[each];#underline[ ];#underline[conference.];#underline[\n];#underline[The];#underline[ ];#underline[manuscript];#underline[\n];#underline[upload];#underline[ ];#underline[will]\n#strike[responsibility];#underline[be] #strike[of];#underline[enabled]\n#strike[the];#underline[several] #strike[author];#underline[weeks]\n#strike[to];#underline[after] #strike[obtain];#underline[acceptance]\n#strike[any];#underline[notices] #strike[required];#underline[have]\n#strike[government];#underline[been] #strike[or];#underline[sent.]\n#strike[company];#underline[Presenting]\n#strike[reviews];#underline[authors] #strike[for];#underline[of]\n#strike[their];#underline[accepted] papers#underline[\n];#underline[will];#underline[ ];#underline[receive];#underline[\n];#underline[an];#underline[ ];#underline[email];#underline[\n];#underline[with];#underline[ ];#underline[instructions];#underline[\n];#underline[when];#underline[ ];#underline[manuscript];#underline[\n];#underline[submission] #strike[in];#underline[opens.]\n#strike[advance];#underline[It] #strike[of];#underline[is]\n#strike[publication.];#underline[important]\n#strike[Start];#underline[that] #strike[early];#underline[presenting]\n#strike[to];#underline[authors] #strike[determine];#underline[keep]\n#strike[if];#underline[their] #strike[the];#underline[email]\n#strike[reviews];#underline[addresses]\n#strike[are];#underline[up-to-date] #strike[required;];#underline[so]\n#strike[this];#underline[they] #strike[process];#underline[do]\n#strike[can];#underline[not] #strike[take];#underline[miss]\n#strike[several];#underline[this] #strike[weeks.];#underline[notice.]\n" }, { "repo": "https://github.com/The-Notebookinator/notebookinator", "file": "https://raw.githubusercontent.com/The-Notebookinator/notebookinator/main/utils/components.typ", "language": "typst", "license": "The Unlicense", "content": "#import \"/globals.typ\"\n\n/// A constructor for a table of contents component.\n///\n/// *Example Usage:*\n/// ```typ\n/// #let toc = utils.make-toc((frontmatter, body, appendix) => {\n/// for entry in body [\n/// #entry.title\n/// #box(width: 1fr, line(length: 100%, stroke: (dash: \"dotted\")))\n/// #entry.page-number\n/// ]\n/// })\n/// ```\n/// - callback (function): A function which returns the content of the toc. The function must take `frontmatter`, `body`, and `appendix` arguments.\n/// -> function\n#let make-toc(callback) = {\n let helper(type) = {\n let (state, markers) = if type == \"frontmatter\" {\n (\n globals.frontmatter-entries,\n query(\n selector(),\n ),\n )\n } else if type == \"body\" {\n (\n globals.entries,\n query(\n selector(),\n ),\n )\n } else if type == \"appendix\" {\n (\n globals.appendix-entries,\n query(\n selector(),\n ),\n )\n } else {\n panic(\"No valid entry type selected.\")\n }\n\n let result = ()\n\n for (index, entry) in state.final().enumerate() {\n let page-number = counter(page).at(\n markers.at(index).location(),\n ).at(0)\n let ctx = entry.ctx\n ctx.page-number = page-number\n result.push(ctx)\n }\n return result\n }\n\n return () => context {\n let frontmatter-entries = helper(\"frontmatter\")\n let body-entries = helper(\"body\")\n let appendix-entries = helper(\"appendix\")\n\n callback(\n frontmatter-entries,\n body-entries,\n appendix-entries,\n )\n }\n}\n\n/// Constructor for a glossary component\n///\n/// *Example Usage:*\n/// ```typ\n/// #let glossary = utils.make-glossary(glossary => {\n/// stack(\n/// spacing: 0.5em,\n/// ..for entry in glossary {\n/// (\n/// [\n/// = #entry.word\n///\n/// #entry.definition\n/// ],\n/// )\n/// },\n/// )\n/// })\n/// ```\n/// - callback (function): A function that returns the content of the glossary. The function must take a `glossary` argument.\n/// -> function\n#let make-glossary(callback) = {\n return () => context {\n let sorted-glossary = globals.glossary-entries.final().sorted(key: (\n (word: word, definition: definition),\n ) => word)\n callback(sorted-glossary)\n }\n}\n\n/// Constructor for a pro / con component\n///\n/// *Example Usage:*\n/// ```typ\n/// #let pro-con = utils.make-pro-con((pros, cons) => {\n/// table(\n/// columns: (\n/// 1fr,\n/// 1fr,\n/// ),\n/// table.cell(fill: green)[*Pros*],\n/// table.cell(fill: red)[*Cons*],\n/// pros,\n/// cons,\n/// )\n/// })\n/// ```\n///\n/// - callback (function): A function that returns the content of the pro / con table. The function must take `pros` and `cons` arguments.\n/// -> function\n#let make-pro-con(callback) = {\n return (pros: [], cons: []) => {\n callback(pros, cons)\n }\n}\n\n/// Constructor for a decision matrix\n///\n/// *Example Usage:*\n/// ```typ\n/// #let decision-matrix = utils.make-decision-matrix((properties, data) => {\n/// // ...\n/// })\n/// ```\n/// - callback (function): A function that returns the content of the matrix. The function must `properties` and `data` arguments.\n/// -> function\n#let make-decision-matrix(callback) = {\n return (properties: (), ..choices) => {\n // ensure the properties are passed in correctly\n //\n // this variable tracks whether the user\n // is using the alternate mode of passing in arguments,\n // where each property is a str instead of a dictionary\n let alternate-format = false\n for property in properties {\n if type(property) == str {\n alternate-format = true\n } else {\n assert(\n not alternate-format,\n message: \"Property should be of type 'str'\",\n )\n\n if property.at(\"weight\", default: none) == none {\n property.insert(\"weight\", 1)\n }\n\n assert.eq(type(property.name), str)\n assert(type(property.weight) == float or type(property.weight) == int)\n }\n }\n\n // ensure the choices are passed in correctly\n for choice in choices.pos() {\n for (index, rating) in choice.enumerate() {\n if index == 0 {\n assert.eq(type(rating), str)\n continue\n }\n\n assert(\n type(rating) == int or type(rating) == float,\n message: \"Values for decision matrices must be of type 'float' or 'int'\",\n )\n }\n\n assert.eq(\n choice.len() - 1,\n properties.len(),\n message: \"The number of supplied values did not match the number of properties.\",\n )\n }\n\n // the calculation should only need to parse data in one format,\n // so if the user passed in the alternate, format we'll just convert it to the standard one\n properties = if alternate-format {\n properties.map(property => (name: property, weight: 1))\n } else {\n properties\n }\n\n // now we can actually calculate the data\n let data = (:)\n\n for (index, choice) in choices.pos().enumerate() {\n let name = choice.at(0)\n\n let values = choice.slice(1)\n let unweighted-total = values.sum()\n\n let weighted-values = values.enumerate().map((\n (index, value),\n ) => value * properties.at(index).at(\n \"weight\",\n default: 1,\n ))\n let weighted-total = weighted-values.sum()\n\n let property-data = (:)\n\n for (index, property) in properties.enumerate() {\n property-data.insert(\n property.name,\n (\n unweighted: values.at(index),\n weighted: weighted-values.at(index),\n highest: false,\n ),\n )\n }\n\n property-data.insert(\n \"total\",\n (\n unweighted: unweighted-total,\n weighted: weighted-total,\n highest: false,\n ),\n )\n\n data.insert(\n name,\n property-data,\n )\n }\n\n // now that we've filled in all of the data, we can calculate which choice won\n\n // we're going to treat total like another property for the sake of calculating if it won\n properties.push((name: \"total\"))\n\n for property in properties {\n let highest = ( // Records the index of the choice which had the highest total\n index: 0,\n value: 0,\n )\n\n for (index, choice) in data {\n let property-value = choice.at(property.name).weighted\n if property-value > highest.value {\n highest.index = index\n highest.value = property-value\n }\n }\n data.at(highest.index).at(property.name).highest = true\n }\n properties.pop()\n\n\n return callback(properties, data)\n }\n}\n\n/// A constructor for an admonition component.\n///\n/// *Example Usage:*\n/// ```typ\n/// #let admonition = utils.make-admonition((type, body) => {\n/// //..\n/// }\n/// ```\n/// - callback (function): A function that returns the content for the admonition. The function must take `type` and `body` arguments.\n/// Valid types include:\n/// - `\"note\"`,\n/// - `\"example\"`,\n/// - `\"warning\"`,\n/// - `\"quote\"`,\n/// - `\"equation\"`,\n///\n/// - `\"identify\"`,\n/// - `\"brainstorm\"`,\n/// - `\"decide\"`,\n/// - `\"decision\"`, // DEPRECATED\n/// - `\"build\"`,\n/// - `\"program\"`,\n/// - `\"test\"`,\n/// - `\"management\"`,\n/// - `\"notebook\"`,\n///\n/// -> function\n#let make-admonition(callback) = {\n let valid-types = (\n \"note\",\n \"example\",\n \"warning\",\n \"quote\",\n \"equation\",\n\n \"identify\",\n \"brainstorm\",\n \"decide\",\n \"decision\",\n \"build\",\n \"program\",\n \"test\",\n \"management\",\n \"notebook\",\n )\n\n let valid-types-printable = valid-types.fold(\n \"\",\n (\n base,\n value,\n ) => {\n base + \" '\" + value + \"'\"\n },\n )\n\n return (type: none, body) => {\n if not valid-types.contains(type) {\n panic(\"Entry type '\" + str(type) + \"' is not valid. Valid types include:\" + valid-types-printable)\n }\n\n callback(\n type,\n body,\n )\n }\n}\n\n/// A constructor for a pie chart component\n///\n/// *Example Usage:*\n///\n/// ```typ\n/// #let pie-chart = utils.make-pie-chart(data => {\n/// // ...\n/// })\n/// ```\n/// - callback (function): A function that returns the content for the pie chart. The function must take a `data` argument.\n/// -> function\n#let make-pie-chart(callback) = {\n return (..data) => {\n callback(data)\n }\n}\n\n/// A constructor for a plot component\n///\n/// *Example Usage:*\n/// ```typ\n/// #let plot = utils.make-plot((title, x-label, y-label, length, data) => {\n/// // ...\n/// })\n/// ```\n///\n/// - callback (function): A function that returns the content for the plot.\n/// The function must take `title`, `x-label`, `y-label`, `length`, and `data` arguments.\n/// -> function\n#let make-plot(callback) = {\n return (title: \"\", x-label: \"\", y-label: \"\", length: auto, ..data) => {\n callback(title, x-label, y-label, length, data)\n }\n}\n\n// TODO: add method for these extra components:\n// - gantt chart\n// - tournament\n// - team\n" }, { "repo": "https://github.com/alexanderkoller/typst-blinky", "file": "https://raw.githubusercontent.com/alexanderkoller/typst-blinky/main/blinky.typ", "language": "typst", "license": "MIT License", "content": "\n#let p = plugin(\"blinky.wasm\")\n\n#let bib_re = regex(\"!!BIBENTRY!([^!]+)!!\")\n\n#let link-bib-urls(bibsrc, content) = {\n let serialized = p.get_bib_map(bytes(bibsrc))\n let bib_map = cbor.decode(serialized)\n\n show bib_re: it => {\n let (key,) = it.text.match(bib_re).captures\n let entry = bib_map.at(key, default: \"\")\n\n if entry == \"\" {\n it\n } else {\n let title = entry.fields.title\n let url = entry.fields.at(\"url\", default: \"\")\n let doi = entry.fields.at(\"doi\", default: \"\")\n\n if doi != \"\" {\n let url = \"https://doi.org/\" + doi\n link(url)[#title]\n } else if url != \"\" {\n link(url)[#title]\n } else {\n [#title]\n } \n }\n }\n\n content\n}" }, { "repo": "https://github.com/augustebaum/petri", "file": "https://raw.githubusercontent.com/augustebaum/petri/main/tests/fletcher/connect-places-with-transitions/test.typ", "language": "typst", "license": "MIT License", "content": "#import \"/src/lib.typ\": *\n#set page(width: auto, height: auto, margin: 1cm)\n\n#import \"@preview/fletcher:0.4.2\" as fletcher: edge\n\n/// % Place 1\n/// \\node[place,\n/// \tfill=teal!25,\n/// \tdraw=teal!75,\n/// \ttokens=2,\n/// \tlabel=$P_1$] (place1) at (0,0) {};\n/// \n/// % Place 2\n/// \\node[place,\n/// \tfill=teal!25,\n/// \tdraw=teal!75,\n/// \ttokens=1,\n/// \tlabel=$P_2$] (place2) at (4,0) {};\n/// \n/// % Transition\n/// \\node[transition,\n/// \tminimum height=12mm,\n/// \tminimum width=1.5mm,\n/// \tfill=black,\n/// \tlabel=$T$] (trans) at (2,0) {};\n/// \n/// % Connect P-T\n/// \\draw[-latex,thick] (place1) -- (trans);\n/// \n/// % Connect T-P\n/// \\draw[-latex,thick] (trans) -- (place2);\n\n#fletcher.diagram(\n node-stroke: 0.5pt,\n\n p((0,0), $P_1$, fill: teal.lighten(25%), stroke: teal.darken(15%), tokens: 2),\n\n edge(\"-|>\"),\n\n t((2,0), $T$, fill: black),\n\n edge(\"-|>\"),\n\n p((4,0), $P_2$, fill: teal.lighten(25%), stroke: teal.darken(15%), tokens: 1),\n)\n" }, { "repo": "https://github.com/hugoledoux/msc_geomatics_thesis_typst", "file": "https://raw.githubusercontent.com/hugoledoux/msc_geomatics_thesis_typst/main/README.md", "language": "markdown", "license": "MIT License", "content": "\n1. put your details in `settings.toml`\n2. `typst compile main.typ`\n" }, { "repo": "https://github.com/Kasci/LiturgicalBooks", "file": "https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/SK/casoslov/casy/cas3.typ", "language": "typst", "license": "", "content": "#import \"/style.typ\": *\n#import \"/SK/texts.typ\": *\n#import \"../styleCasoslov.typ\": *\n\n= Tret\u00ed \u010das\n\n#show: rest => columns(2, rest)\n\n#nacaloBezKnaza\n\n#zalm(16)\n#zalm(24)\n#zalm(50)\n\n#si\n\n#lettrine(\"Aleluja, aleluja, aleluja, sl\u00e1va tebe, Bo\u017ee.\") #note[(3x)]\n\n#lettrine(\"Pane, zmiluj sa.\") #note[(3x)]\n\n== Trop\u00e1re\n\n#note[Berieme trop\u00e1r, pr\u00edpadne trop\u00e1re pod\u013ea predpisu]\n\n#primText[I teraz: (Bohorodi\u010dn\u00edk)]\n\n#lettrine(\"Bohorodi\u010dka, ty si prav\u00fd vini\u010d, * z ktor\u00e9ho n\u00e1m vyr\u00e1stol plod \u017eivota. * K tebe sa modl\u00edme: * Modli sa k nemu, Vl\u00e1dky\u0148a, so sv\u00e4t\u00fdmi apo\u0161tolmi, * aby sa zmiloval nad na\u0161imi du\u0161ami.\")\n\n#zoznam((\n \"Nech je veleben\u00fd P\u00e1n de\u0148 \u010do de\u0148; * nesie n\u00e1s Boh, na\u0161a sp\u00e1sa. * N\u00e1\u0161 Boh je Boh sp\u00e1sy.\",\n))\n\n#trojsvatePoOtcenas\n\n== Kond\u00e1k\n\n#note[Berieme kond\u00e1k pod\u013ea predpisu]\n\n#lettrine(\"Pane, zmiluj sa.\") #primText([40x])\n\n#vKazdomCase\n\n#ektenia(3)\n\n#lettrine(\"\u010cestnej\u0161ia si ako cherub\u00edni * a neporovnate\u013ene sl\u00e1vnej\u0161ia ako seraf\u00edni, * bez poru\u0161enia si porodila Boha Slovo, * opravdiv\u00e1 Bohorodi\u010dka, veleb\u00edme \u0165a.\")\n\nPane Je\u017ei\u0161u Kriste, Bo\u017ee n\u00e1\u0161, pre modlitby na\u0161ich sv\u00e4t\u00fdch otcov zmiluj sa nad nami.\n\n#prepustenieMaleBezKnaza" }, { "repo": "https://github.com/02hyc/Group-Meeting-Typst", "file": "https://raw.githubusercontent.com/02hyc/Group-Meeting-Typst/master/sections/weekly-report.typ", "language": "typst", "license": "", "content": "#import \"../globals.typ\": *\n\n= Weekly Meeting\n\n== July 19, 2024\n=== Towards Self-Assembling Artificial Neural Networks through Neural Developmental Programs #footnote[Najarro E, Sudhakaran S, Risi S. Towards self-assembling artificial neural networks through neural developmental programs[C]]\n\n#figure(\n image(\"../images/2024.7.19_1.png\", width: 80%),\n caption: [Neural Development Program approach for growing neural network] \n)\n\n- Use the Neural Development Program(NDP) to control *the growth of new networks*\n- Two training methods: *Evolutionary-based* and *Gradient-based*\n- Execute experiments on *MNIST, XOR, CartPole, LunarLander*\n\n== July 19, 2024\n=== Towards Self-Assembling Artificial Neural Networks through Neural Developmental Programs\n#figure(\n image(\"../images/2024.7.19_2.png\"),\n caption: [Developmental growth of solving the CartPole balancing task],\n)\n\n- No indication of *robustness* or other performance advantages\n- No additional information about the *topological properties* of the network\n\n== July 19, 2024\n=== HYPERNETWORKS #footnote[, , V. Hypernetworks[J]. arXiv preprint arXiv:1609.09106, 2016.]\n- An approach of using a *hypernetwork* to generate the weights for another network, which is similar to the nature: the relationship between a *genotype* and a *phenotype*\n- Generate weights for practical architectures by taking layer embedding vectors as inputs\n- Hypernetworks are trained *end-to-end* with gradient descent together with the main network\n=== Reflection\n- The focus is not on generating networks, but on *the ability to self-explore* in a multi-task environment\n- Generative networks are a means of implementation. Are there any existing methods that can achieve self-exploration capabilities to a certain extent, such as *LLM-based agents*\n\n== July 26, 2024\n- Agents environments setup\n - New reasoning framework (modify the prompts)\n - Digital tasks (fine tune on the digital tasks)\n - Embodied tasks (usually with a vision module)\n- Learn of reinforcement learning\n\n== July 26, 2024\n=== AgentGym #footnote[, , , et al. AgentGym: Evolving Large Language Model-based Agents across Diverse Environments[J]. arXiv preprint arXiv:2406.04151, 2024.]\n#figure(\n image(\"../images/2024.7.26_3.png\"),\n caption: [Overview of the AgentGym framework],\n)\n\n== July 26, 2024\n=== OSWORLD #footnote[, , , et al. Osworld: Benchmarking multimodal agents for open-ended tasks in real computer environments[J]. arXiv preprint arXiv:2404.07972, 2024.]\n#figure(\n image(\"../images/2024.7.26_2.png\", width: 90%),\n caption:[OSWORLD: a real computer environment for multimodal agents],\n)\n\n== July 26, 2024\n=== FunSearch #footnote[, , , et al. Mathematical discoveries from program search with large language models[J]. Nature, 2024, 625(7995): 468-475.]\n#figure(\n image(\"../images/2024.7.26_1.png\"),\n caption: [Overview of FunSearch],\n)\n\n== Aug, 2, 2024\n=== Target\n- Diffusion Models as Tools for Gene Expression \u2014\u2014 Genotype\n- Use partial modules in a large model to adapt to different tasks \u2014\u2014 Phenotype\n#figure(\n image(\"../images/2024.8.02_1.png\", width: 70%),\n caption: [Overview of PGDiff Framework for Versatile Face Restoration #footnote[, , , et al. PGDiff: Guiding diffusion models for versatile face restoration via partial guidance[J]. Advances in Neural Information Processing Systems, 2024, 36.]],\n)\n\n== Aug, 2, 2024\n=== Keywords\n- Conditional Diffusion Models\n- Pruning\n- Model Selector\n- Multi-task learning\n- Neural Architecture Search\n - The representations of the architectures in the search space\n - Introduce diffusion models as a search algorithm\n\n== Aug, 23, 2024\n=== DiffusionNAG#footnote[, , , et al. DiffusionNAG: Predictor-guided Neural Architecture Generation with Diffusion Models[J]. arXiv preprint arXiv:2305.16943, 2023.]\n \n#figure(\n image(\"../images/2024.8.23_1.png\", width: 80%), \n caption: [Overview of DiffusionNAG] \n)\n\n- Treat the neural architecture as DAG and generate the neural architecture graph through a graph diffusion model\n- Controlling the generation process using property predictors, whose gradient is used to guide the architectures towards a space with desired properties\n\n== Aug 23, 2024\n=== Transformer Layers as Painters#footnote[, , , et al. Transformer Layers as Painters[J]. arXiv preprint arXiv:2407.09298, 2024.]\n- Explore the role of the layers of the Transformer architecture models\n- Experiments on BERT and Llama2\n - Do the layers share the representation space\n - Are all layers necessary\n - Are all middle layers doing the same thing\n - Does layer order matter\n - Can layers run in parallel\n#figure(\n image(\"../images/2024.8.23_2.png\", width: 80%),\n caption: [Different execution strategies]\n)\n\n== Aug 23, 2024\n=== LLM to extract structured data\n\n- Encapsulate the part of LLM\n- Implemente text conversion from PDF to Markdown#footnote[https://github.com/VikParuchuri/marker]\n\n#focus-slide[\n Question?\n]\n\n" }, { "repo": "https://github.com/typst/packages", "file": "https://raw.githubusercontent.com/typst/packages/main/packages/preview/circuiteria/0.1.0/gallery/test5.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"@preview/cetz:0.2.2\": draw\n#import \"../src/lib.typ\": *\n\n#set page(width: auto, height: auto, margin: .5cm)\n\n#circuit({\n element.multiplexer(\n x: 0, y: 0, w: .5, h: 1.5, id: \"PCMux\",\n entries: 2,\n fill: util.colors.blue,\n h-ratio: 80%\n )\n element.block(\n x: (rel: 2, to: \"PCMux.east\"),\n y: (from: \"PCMux-port-out\", to: \"in\"),\n w: 1, h: 1.5, id: \"PCBuf\",\n ports: (\n north: ((id: \"clk\", clock: true),),\n west: ((id: \"in\"),),\n east: ((id: \"out\"),)\n ),\n fill: util.colors.green\n )\n\n element.block(\n x: (rel: 2, to: \"PCBuf.east\"),\n y: (from: \"PCBuf-port-out\", to: \"A\"),\n w: 3, h: 4, id: \"IMem\",\n ports: (\n west: (\n (id: \"A\", name: \"A\"),\n ),\n east: (\n (id: \"RD\", name: \"RD\"),\n )\n ),\n ports-margins: (\n west: (0%, 50%),\n east: (0%, 50%)\n ),\n fill: util.colors.green,\n name: \"Instruction\\nMemory\"\n )\n element.block(\n x: (rel: 3, to: \"IMem.east\"),\n y: (from: \"IMem-port-RD\", to: \"A1\"),\n w: 4.5, h: 4, id: \"RegFile\",\n ports: (\n north: (\n (id: \"clk\", clock: true, small: true),\n (id: \"WE3\", name: \"WE3\"),\n (id: \"dummy1\")\n ),\n west: (\n (id: \"dummy2\"),\n (id: \"A1\", name: \"A1\"),\n (id: \"dummy3\"),\n (id: \"A2\", name: \"A2\"),\n (id: \"A3\", name: \"A3\"),\n (id: \"dummy4\"),\n (id: \"WD3\", name: \"WD3\"),\n ),\n east: (\n (id: \"RD1\", name: \"RD1\"),\n (id: \"RD2\", name: \"RD2\"),\n )\n ),\n ports-margins: (\n north: (-20%, -20%),\n east: (0%, 10%)\n ),\n fill: util.colors.green,\n name: \"Register\\nFile\"\n )\n\n element.alu(\n x: (rel: -.7, to: \"IMem.center\"),\n y: -7,\n w: 1.4, h: 2.8, id: \"PCAdd\",\n name: text(\"+\", size: 1.5em),\n name-anchor: \"name\",\n fill: util.colors.pink\n )\n element.extender(\n x: (rel: 0, to: \"RegFile.west\"),\n y: (from: \"PCAdd-port-out\", to: \"in\"),\n w: 4, h: 1.5, id: \"Ext\",\n h-ratio: 50%,\n name: \"Extend\",\n name-anchor: \"south\",\n align-out: false,\n fill: util.colors.green\n )\n\n element.multiplexer(\n x: (rel: 3, to: \"RegFile.east\"),\n y: (from: \"RegFile-port-RD2\", to: \"in0\"),\n w: .5, h: 1.5, id: \"SrcBMux\",\n fill: util.colors.blue,\n h-ratio: 80%\n )\n\n element.alu(\n x: (rel: 2, to: \"SrcBMux.east\"),\n y: (from: \"SrcBMux-port-out\", to: \"in2\"),\n w: 1.4, h: 2.8, id: \"ALU\",\n name: rotate(\"ALU\", -90deg),\n name-anchor: \"name\",\n fill: util.colors.pink\n )\n element.alu(\n x: (rel: 2, to: \"SrcBMux.east\"),\n y: (from: \"Ext-port-out\", to: \"in2\"),\n w: 1.4, h: 2.8, id: \"JumpAdd\",\n name: text(\"+\", size: 1.5em),\n name-anchor: \"name\",\n fill: util.colors.pink\n )\n\n element.block(\n x: (rel: 4, to: \"ALU.east\"),\n y: (from: \"ALU-port-out\", to: \"A\"),\n w: 3, h: 4, id: \"DMem\",\n name: \"Data\\nMemory\",\n ports: (\n north: (\n (id: \"clk\", clock: true, small: true),\n (id: \"dummy1\"),\n (id: \"WE\", name: \"WE\")\n ),\n west: (\n (id: \"A\", name: \"A\"),\n (id: \"WD\", name: \"WD\")\n ),\n east: (\n (id: \"RD\", name: \"RD\"),\n (id: \"dummy2\")\n )\n ),\n ports-margins: (\n north: (-10%, -10%),\n west: (-20%, -30%),\n east: (-10%, -20%)\n ),\n fill: util.colors.green\n )\n\n element.multiplexer(\n x: (rel: 3, to: \"DMem.east\"),\n y: (from: \"DMem-port-RD\", to: \"in1\"),\n w: .5, h: 1.5, id: \"ResMux\",\n entries: 2,\n fill: util.colors.blue,\n h-ratio: 80%\n )\n\n element.block(\n x: (rel: 0, to: \"RegFile.west\"),\n y: 3.5, w: 2.5, h: 5, id: \"Ctrl\",\n name: \"Control\\nUnit\",\n name-anchor: \"north\",\n ports: (\n west: (\n (id: \"op\", name: \"op\"),\n (id: \"funct3\", name: \"funct3\"),\n (id: \"funct7\", name: [funct7#sub(\"[5]\")]),\n (id: \"zero\", name: \"Zero\"),\n ),\n east: (\n (id: \"PCSrc\"),\n (id: \"ResSrc\"),\n (id: \"MemWrite\"),\n (id: \"ALUCtrl\"),\n (id: \"ALUSrc\"),\n (id: \"ImmSrc\"),\n (id: \"RegWrite\"),\n )\n ),\n ports-margins: (\n west: (40%, 0%)\n ),\n fill: util.colors.orange\n )\n\n // Wires\n wire.wire(\n \"wPCNext\", (\"PCMux-port-out\", \"PCBuf-port-in\"),\n name: \"PCNext\"\n )\n wire.stub(\"PCBuf-port-clk\", \"north\", name: \"clk\", length: 0.25)\n wire.wire(\n \"wPC1\", (\"PCBuf-port-out\", \"IMem-port-A\"),\n name: \"PC\"\n )\n wire.wire(\n \"wPC2\", (\"PCBuf-port-out\", \"JumpAdd-port-in1\"),\n style: \"zigzag\",\n zigzag-ratio: 1\n )\n wire.wire(\n \"wPC3\", (\"PCBuf-port-out\", \"PCAdd-port-in1\"),\n style: \"zigzag\",\n zigzag-ratio: 1\n )\n wire.intersection(\"wPC2.zig\")\n wire.intersection(\"wPC2.zag\")\n wire.stub(\"PCAdd-port-in2\", \"west\", name: \"4\", length: 1.5)\n wire.wire(\n \"wPC+4\", (\"PCAdd-port-out\", \"PCMux-port-in0\"),\n style: \"dodge\",\n dodge-sides: (\"east\", \"west\"),\n dodge-y: -7.5,\n dodge-margins: (1.2, .5),\n name: \"PC+4\",\n name-pos: \"start\"\n )\n \n let mid = (\"IMem-port-RD\", 50%, \"RegFile-port-A1\")\n wire.wire(\n \"wInstr\", (\"IMem-port-RD\", mid),\n bus: true,\n name: \"Instr\",\n name-pos: \"start\"\n )\n draw.hide({\n draw.line(name: \"bus-top\",\n mid,\n (horizontal: (), vertical: \"Ctrl-port-op\")\n )\n draw.line(name: \"bus-bot\",\n mid,\n (horizontal: (), vertical: \"Ext-port-in\")\n )\n })\n wire.wire(\n \"wInstrBus\", (\"bus-top.end\", \"bus-bot.end\"),\n bus: true\n )\n wire.wire(\n \"wOp\", (\"Ctrl-port-op\", (horizontal: mid, vertical: ())),\n bus: true,\n reverse: true,\n slice: (6, 0)\n )\n wire.wire(\n \"wF3\", (\"Ctrl-port-funct3\", (horizontal: mid, vertical: ())),\n bus: true,\n reverse: true,\n slice: (14, 12)\n )\n wire.wire(\n \"wF7\", (\"Ctrl-port-funct7\", (horizontal: mid, vertical: ())),\n bus: true,\n reverse: true,\n slice: (30,)\n )\n wire.wire(\n \"wA1\", (\"RegFile-port-A1\", (horizontal: mid, vertical: ())),\n bus: true,\n reverse: true,\n slice: (19, 15)\n )\n wire.wire(\n \"wA2\", (\"RegFile-port-A2\", (horizontal: mid, vertical: ())),\n bus: true,\n reverse: true,\n slice: (24, 20)\n )\n wire.wire(\n \"wA3\", (\"RegFile-port-A3\", (horizontal: mid, vertical: ())),\n bus: true,\n reverse: true,\n slice: (11, 7)\n )\n wire.wire(\n \"wExt\", (\"Ext-port-in\", (horizontal: mid, vertical: ())),\n bus: true,\n reverse: true,\n slice: (31, 7)\n )\n wire.intersection(\"wF3.end\")\n wire.intersection(\"wF7.end\")\n wire.intersection(\"wA1.end\")\n wire.intersection(\"wA2.end\")\n wire.intersection(\"wA3.end\")\n\n wire.stub(\"RegFile-port-clk\", \"north\", name: \"clk\", length: 0.25)\n wire.wire(\"wRD2\", (\"RegFile-port-RD2\", \"SrcBMux-port-in0\"))\n wire.wire(\n \"wWD\", (\"RegFile-port-RD2\", \"DMem-port-WD\"),\n style: \"zigzag\",\n zigzag-ratio: 1.5,\n name: \"WriteData\",\n name-pos: \"end\"\n )\n wire.intersection(\"wWD.zig\")\n\n wire.wire(\n \"wImmALU\", (\"Ext-port-out\", \"SrcBMux-port-in1\"),\n style: \"zigzag\",\n zigzag-ratio: 2.5,\n name: \"ImmExt\",\n name-pos: \"start\"\n )\n wire.wire(\n \"wImmJump\", (\"Ext-port-out\", \"JumpAdd-port-in2\")\n )\n wire.intersection(\"wImmALU.zig\")\n wire.wire(\n \"wJumpPC\", (\"JumpAdd-port-out\", \"PCMux-port-in1\"),\n style: \"dodge\",\n dodge-sides: (\"east\", \"west\"),\n dodge-y: -8,\n dodge-margins: (1, 1),\n name: \"PCTarget\",\n name-pos: \"start\"\n )\n\n wire.wire(\n \"wSrcA\", (\"RegFile-port-RD1\", \"ALU-port-in1\"),\n name: \"SrcA\",\n name-pos: \"end\"\n )\n wire.wire(\n \"wSrcB\", (\"SrcBMux-port-out\", \"ALU-port-in2\"),\n name: \"SrcB\",\n name-pos: \"end\"\n )\n\n wire.wire(\n \"wZero\", (\n (\"ALU.north-east\", 50%, \"ALU-port-out\"),\n \"Ctrl-port-zero\"\n ),\n style: \"dodge\",\n dodge-sides: (\"east\", \"west\"),\n dodge-y: 3,\n dodge-margins: (1.5, 1),\n name: \"Zero\",\n name-pos: \"start\"\n )\n wire.wire(\n \"wALURes1\", (\"ALU-port-out\", \"DMem-port-A\"),\n name: \"ALUResult\",\n name-pos: \"start\"\n )\n wire.wire(\n \"wALURes2\", (\"ALU-port-out\", \"ResMux-port-in0\"),\n style: \"dodge\",\n dodge-sides: (\"east\", \"west\"),\n dodge-y: 2,\n dodge-margins: (3, 2)\n )\n wire.intersection(\"wALURes2.start2\")\n\n wire.stub(\"DMem-port-clk\", \"north\", name: \"clk\", length: 0.25)\n wire.wire(\n \"wRD\", (\"DMem-port-RD\", \"ResMux-port-in1\"),\n name: \"ReadData\",\n name-pos: \"start\"\n )\n\n wire.wire(\n \"wRes\", (\"ResMux-port-out\", \"RegFile-port-WD3\"),\n style: \"dodge\",\n dodge-sides: (\"east\", \"west\"),\n dodge-y: -7.5,\n dodge-margins: (1, 2)\n )\n draw.content(\n \"wRes.dodge-start\",\n \"Result\",\n anchor: \"south-east\",\n padding: 5pt\n )\n\n // Other wires\n draw.group({\n draw.stroke(util.colors.blue)\n draw.line(name: \"wPCSrc\", \n \"Ctrl-port-PCSrc\",\n (horizontal: \"RegFile.east\", vertical: ()),\n (horizontal: (), vertical: (rel: (0, 0.5), to: \"Ctrl.north\")),\n (horizontal: \"PCMux.north\", vertical: ()),\n \"PCMux.north\"\n )\n draw.line(name: \"wResSrc\",\n \"Ctrl-port-ResSrc\",\n (horizontal: \"ResMux.north\", vertical: ()),\n \"ResMux.north\"\n )\n draw.line(name: \"wMemWrite\",\n \"Ctrl-port-MemWrite\",\n (horizontal: \"DMem-port-WE\", vertical: ()),\n \"DMem-port-WE\"\n )\n draw.line(name: \"wALUCtrl\",\n \"Ctrl-port-ALUCtrl\",\n (horizontal: \"ALU.north\", vertical: ()),\n \"ALU.north\"\n )\n draw.line(name: \"wALUSrc\",\n \"Ctrl-port-ALUSrc\",\n (horizontal: \"SrcBMux.north\", vertical: ()),\n \"SrcBMux.north\"\n )\n draw.line(name: \"wImmSrc\",\n \"Ctrl-port-ImmSrc\",\n (rel: (1, 0), to: (horizontal: \"RegFile.east\", vertical: ())),\n (horizontal: (), vertical: (rel: (0, -.5), to: \"RegFile.south\")),\n (horizontal: \"Ext.north\", vertical: ()),\n \"Ext.north\"\n )\n draw.line(name: \"wRegWrite\",\n \"Ctrl-port-RegWrite\",\n (rel: (.5, 0), to: (horizontal: \"RegFile.east\", vertical: ())),\n (horizontal: (), vertical: (\"Ctrl.south\", 50%, \"RegFile.north\")),\n (horizontal: \"RegFile-port-WE3\", vertical: ()),\n \"RegFile-port-WE3\"\n )\n\n let names = (\n \"PCSrc\": \"PCSrc\",\n \"ResSrc\": \"ResultSrc\",\n \"MemWrite\": \"MemWrite\",\n \"ALUCtrl\": [ALUControl#sub(\"[2:0]\")],\n \"ALUSrc\": \"ALUSrc\",\n \"ImmSrc\": [ImmSrc#sub(\"[1:0]\")],\n \"RegWrite\": \"RegWrite\"\n )\n for (port, name) in names {\n draw.content(\"Ctrl-port-\"+port, name, anchor: \"south-west\", padding: 3pt)\n }\n })\n})" }, { "repo": "https://github.com/maxluoXIII/resume", "file": "https://raw.githubusercontent.com/maxluoXIII/resume/master/resume.typ", "language": "typst", "license": "", "content": "#show heading: set text(font: \"Linux Biolinum\")\n\n#show link: underline\n\n// Uncomment the following lines to adjust the size of text\n// The recommend resume text size is from `10pt` to `12pt`\n// #set text(\n// size: 12pt,\n// )\n\n// Feel free to change the margin below to best fit your own CV\n#set page(\n margin: (x: 1.0cm, y: 1.3cm),\n)\n\n// For more customizable options, please refer to official reference: https://typst.app/docs/reference/\n\n#set par(justify: true)\n\n#let chiline() = {v(-3pt); line(length: 100%); v(-5pt)}\n\n= \n\n#link(\"mailto:\")\n| #link(\"https://github.com/maxluoXIII\")[github.com/maxluoXIII]\n| #link(\"https://maxluoxiii.github.io\")[maxluoxiii.github.io]\n\n== Work Experience\n#chiline()\n\n*#link(\"https://ibm.com\")[IBM]* #h(1fr) Aug. 2021 -- Present \\\nBackend Developer #h(1fr) Rochester, MN \\\n- Developed robust device drivers for the\n #link(\"https://www.ibm.com/products/ibm-i\")[IBM i] operating system using C++,\n for both physical (NVIDIA, Intel, etc.) and virtual (link aggregation, vNIC, etc.)\n NICs\n- Migrated device driver testing scripts to an open-source Python framework,\n expanded test coverage, and improved logging/debugging capabilities to develop\n a cohesive testing tool for device driver developers\n- Collaborated with internal and external teams to provide support for clients\n by providing analyses and fixes\n\n*#link(\"https://8i.com/\")[8i]* #h(1fr) May 2020 -- Aug. 2020 \\\nSoftware Engineering Intern #h(1fr) Chicago, IL \\\n- Developed features for an internal MPEG-DASH player to support the\n company's proprietary 3D mesh, video, and audio codec including seek, caching,\n and adaptive bitrate selection using the C++ Qt Framework\n\n*#link(\"https://www.eagleseven.com/\")[Eagle Seven]* #h(1fr) May 2019 -- Aug. 2019 \\\nSoftware Development Intern #h(1fr) Chicago, IL \\\n- Wrote software to calculate network performance metrics of high-frequency\n trade engines\n- Built a real-time dashboard using InfluxDB and Grafana to improve the automation,\n comparison, and real-time tracking capabilities of the performance testing framework\n\n== Education\n#chiline()\n\n#link(\"https://illinois.edu/\")[*University of Illinois at Urbana-Champaign*] #h(1fr) Aug. 2017 -- May 2021 \\\nBachelor of Science, Computer Science + Master of Computer Science #h(1fr) Urbana-Champaign, IL \\\n- Operating System Design; Distributed Systems; Communication Networks; Applied Parallel Programming\n- Computer Security I/II; Advanced Computer Security; Applied Cryptography; Operating System Security\n- Machine Learning; ML for Sys, Networks, & Security; Algorithms\n- Interactive Computer Graphics; UI Design; Top Down Video Game Design; Game Dev Process\n- Teaching Assistant for CS 225 (Data Structures) and CS 126 (Software Design Studio)\n - Lead discussions and code reviews to foster educational dialogue on data\n structures and best coding practices\n - Provided continuous updates to the course website to provide students with up-to-date information\n - Answered questions and debugged student solutions in office hours\n\n== Projects\n#chiline()\n\n*#link(\"https://github.com/maxluoXIII/server-manager\")[server-manager]* #h(1fr) Mar. 2023 -- Aug. 2023 \\\nCreator #h(1fr) #link(\"https://github.com/maxluoXIII/server-manager\")[GitHub] \\\n- Developed a Discord bot in Rust utilizing their HTTPS/REST API to allow members\n of a Discord server to manage multiple Minecraft servers on a host computer\n\n*#link(\"https://github.com/Mottokrosh/Sheet\")[Sheet]* #h(1fr) Sep. 2021 -- Jan. 2022 \\\nContributor #h(1fr) #link(\"https://github.com/Mottokrosh/Sheet\")[GitHub] \\\n- Identified the cause for authentication and database issues that caused an\n outage of an open-source Node application.\n- Communicated with the maintainer and developed a fix that was merged into\n the project.\n- Reviewed pull requests made by other developers and helped them merge their\n own fixes to the project.\n\n== Skills\n#chiline()\n\n- *Proficient* in C/C++, Python\n- *Intermediate* knowledge of Rust, Java, HTML/CSS, Javascript (Angular), InfluxDB,\n Grafana, Unity, Unreal Engine, WebGL, Android app development, Discord app\n development, Qt Framework, Flutter, Chinese, Japanese\n- *Basic* skills with OCaml, x86 Assembly, Verilog\n\n" }, { "repo": "https://github.com/HEIGVD-Experience/docs", "file": "https://raw.githubusercontent.com/HEIGVD-Experience/docs/main/S4/WEB/docs/TE/TE1.typ", "language": "typst", "license": "", "content": "#import \"/_settings/typst/template-te.typ\": *\n\n#show: resume.with(\n \"R\u00e9sum\u00e9 WEB - TE1\",\n \"\",\n cols: 3\n)\n\n= HTML\n== HTML structure\n- ``: The document type declaration for HTML5\n- ``: The root element of an HTML page\n- ``: Contains meta-information about the document\n- ``: The title of the document\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" href=\"styles.css\"> <!-- CSS link -->\n <title>Welcome page\n\n\n

Hello students of the Web Technologies course !

\n\n\n```\n- width=device-width : the width of the page matches the screen width\n- initial-scale=1.0 : the initial zoom level\n\n=== Open Graph Protocol\nThe Open Graph protocol enables any web pages to show some additional information when shared on social media or messaging apps.\n\n```html\n\n\n\n\n```\n\n== Lists\n=== Unordered lists\nUnordered lists are used to list items in no particular order. They are defined with the `
    ` element.\n```html\n
      \n
    • Item 1
    • \n
    • Item 2
    • \n
    \n```\n\n=== Ordered lists\nOrdered lists are used to list items in a specific order. They are defined with the `
      ` element.\n```html\n
        \n
      1. Item 1
      2. \n
      3. Item 2
      4. \n
      \n```\n\n== Hyperlink \nHyperlinks are used to link from one page to another. They are defined with the `` element.\n```html\nGoogle\n?subject=hello&body=world!\">Hello World!\n```\n\n== Media elements\n=== Images\n```html\n\"Image\n```\n=== Audio & Video\n```html\n\n\n```\n\n=== Canvas\nThe canvas element allows for dynamic, scriptable rendering of 2D and 3D shapes.\n```html\n\n```\n\n== Tables\nTables are used to display data in a tabular format. They are defined with the `` element.\n```html\n
      \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      Student IDGrade
      45
      6
      \n```\n\n== Forms\nForms are used to collect user input. They are defined with the `
      ` element.\n```html\n\n \n \n \n
      \n```\n\n== Semantic elements\n```html\n
      Header
      \n\n
      Main content
      \n
      Section
      \n
      Article
      \n\n
      Footer
      \n```\n= CSS\n== CSS Selectors\nCSS selectors are used to select the elements to which the ruleset will apply. There are several types of selectors:\n\n=== Type\nType selectors select elements based on their tag name.\n\n```css\np {\n color: red;\n}\n```\n*This rule will apply to all `

      ` elements. in the html page.*\n\n=== Id \nId selectors select elements based on their `id` attribute.\n\n```css\n#myId {\n color: red;\n}\n```\n*This rule will apply to the element with the `id=\"myId\"` attribute.*\n\n=== Class\nClass selectors select elements based on their `class` attribute.\n\n```css\n.myClass {\n color: red;\n}\n```\n*This rule will apply to all elements with the `class=\"myClass\"` attribute.*\n\n=== Universal\nThe universal selector `*` selects all elements.\n\n```css\n* {\n color: red;\n}\n```\n*This rule will apply to all elements in the html page.*\n\n=== Grouping\nGrouping selectors select multiple elements.\n\n```css\nh1, h2, h3 {\n color: red;\n}\n```\n\n=== Descendant\nDescendant selectors select elements that are descendants of another element.\n\n```css\ndiv p {\n color: red;\n}\n```\n*This rule will apply to all `

      ` elements that are descendants of a `

      ` element.*\n\n=== Child\nChild selectors select elements that are direct children of another element.\n\n```css\ndiv > p {\n color: red;\n}\n```\n*This rule will apply to all `

      ` elements that are direct children of a `

      ` element.*\n\n=== Flexbox\nFlexbox is a layout model that allows elements to align and distribute space within a container.\n\n```html\n
      \n
      Item A
      \n
      Item B
      \n
      Item C
      \n
      \n```\n```css\n.container {\n display: flex;\n flex-direction: row;\n}\n.item {\n order: 1;\n flex-grow: 1\n}\n```\n\n- Container (parent) properties : flex-direction, flex-wrap, flex-flow, justify-content, align-items, align-content\n- Item (child) properties : order, flex-grow, flex-shrink, flex-basis, flex, align-self\n\n=== Grid\nGrid is a layout model that allows elements to align and distribute space in two dimensions.\n\n```html\n
      \n
      Item A
      \n
      Item\n B
      \n
      Item C
      \n
      \n```\n```css\n.container {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n}\n.item {\n grid-column: 1 / 3;\n}\n```\n\n- Container (parent) properties : grid-template-column, grid-template-rows, grid-template-areas, grid-template, ...\n- Item (child) properties : grid-column-start, grid-column-end, grid-column, grid-row, grid-area, ...\n\n#image(\"/_src/img/docs/image copy 38.png\")\n\n== Media Queries\nMedia queries are used to apply different styles based on the device\u2019s characteristics.\n\n```css\nh1 { font-size: 50px; } /* General rule */\n\n@media (min-width: 576px) { /* Tablet dimensions */\n h1 { font-size: 60px; }\n}\n\n@media (min-width: 768px) { /* Desktop dimensions */\n h1 { font-size: 70px; }\n}\n```\n\n== CSS variables\n```css\n:root { /* Global variables */\n --main-color: #06c;\n --main-bg-color: #fff;\n}\n\n.my-element {\n color: var(--main-color, #06c);\n background-color: var(--main-bg-color, #fff);\n}\n```\nThe var() function can take fallback values in case one of the variables is not defined.\n\n= JavaScript\n\n*Interpreted*\nThe interpreter reads the source code and executes it directly.\n\n*Just-in-time (JIT) compiled*\nThe interpreter compiles the hot parts of the source code into machine-code and executes it directly.\n\n*First-class functions*\nFunctions are treated like any other value. They can be stored in variables, passed as arguments to other functions, created within functions, and returned from functions.\n\n==== Adding JavaScript directly to HTML\n```html\n\n```\n\n==== Adding JavaScript to an external file\n```html\n\n```\n- The defer attribute is used to defer the execution of the script until the page has been loaded.\n- The async attribute is used to load the script asynchronously.\n\n== Primitive types\n- *Undefined*: Unique primitive value undefined\n- *Number*: Real or integer number (e.g. 3.14, 42)\n- *Boolean*: true or false\n- *String*: Character sequence, whose literals begin and end with single or double - quotes (e.g. \"HEIG-VD\", 'hello')\n- *BigInt*: Arbitrary-precision integers, whose literals end with an n (e.g. - 9007199254740992n)\n- *Symbol*: Globally unique values usable as identifiers or keys in objects (e.g. Symbol(), Symbol(\"description\"))\n- *Null*: Unique value null\n\n== Arrays\n- Array: Ordered collection of values\nThe syntax for creating an array is:\n```javascript\nlet fruits = ['Apple', 'Banana', 'Cherry'];\n```\nElements can be accessed using bracket notation:\n```javascript\nconsole.log(fruits[0]); // Apple\nconsole.log(fruits.length); // Banana\n```\n=== Methods on arrays\n```javascript\nfruits.push(\"mango\", \"papaya\"); // Appends new items\nfruits.pop(); // Removes and returns the last item\nfruits.reverse(); // Reverses the items' order\nfruits.splice(2, 1, 'Orange'); // Replaces 1 elemnt at position 2 with 'Orange'\nfruits.splice(1, 0, 'Peach'); // Inserts 'Peach' at index 1\n```\n\n== Typeof operator\nThe typeof operator returns the type of a variable or expression.\n```javascript\nconsole.log(typeof 42); // number\nconsole.log(typeof 'hello'); // string\nconsole.log(typeof null); // object\nconsole.log(typeof [1, 2, 3]); // object\n```\n\n== Arithmetic operators\n```javascript\n1 + 1; // addition\n1 - 1; // subtraction\n1 / 1; // division\n1 * 1; // multiplication\n1 % 1; // modulo\n1 ** 1; // exponentiation\n```\n\n== String operators\n```javascript\n\"con\" + \"cat\" + \"e\" + \"nate\";\n`PI = ${Math.PI}`; // template literals (instead of: \"PI = \" + Math.PI)\n```\nIn practice we should opt for template literals over string concatenation.\n\n=== Automatic type conversion\nAutomatic type conversion is performed when comparing values of different types. It is at the root of many issues when using comparison operators.\n```javascript\n\"1\" == 1 // true (!!!)\nfalse == 0 // true\n8 * null // 0\n```\n\n=== Strict equality\nStrict equality compares two values for equality without type conversion.\n```javascript\n\"1\" === 1 // false\n\"1\" !== 1 // true\n```\n\n== Variables\n=== var\nThe var statement declares a *non-block-scoped* variable, optionally initializing it to a value. Its scope is its current execution context, i.e. either the enclosing function or, if outside any function, global. It can be re-declared.\n```javascript\nvar x = 1;\nif (true) { var x = 2; } // same variable\nconsole.log(x); // 2\n```\n=== let\nThe let statement declares a *block-scoped* local variable, optionally initializing it to a value. It can be re-assigned but not re-declared.\n```javascript\nlet x = 1;\n{ let x = 2; } // different variable (in a new scope)\nconsole.log(x); // 1\nlet x = 1000; // Error: redeclaration of let x\n```\n=== const\nThe const statement declares a *block-scoped* read-only named constant. It can be re-assigned but not re-declared.\n```javascript\nconst x = 1;\nx = 2; // TypeError: Assignment to constant variable.\n```\n\n== While and do-while loops\n```javascript\nlet num = 0;\nwhile (num < 10) {\n console.log(num);\n num += 1;\n}\nlet echo = \"\";\ndo {\n echo = prompt(\"Echo\");\n console.log(echo);\n} while (echo != \"stop\");\n```\n \n== For loop\n```javascript\nfor (let num = 0; num < 10; num++) {\n console.log(num);\n}\n```\nThe for...in statement iterates over the enumerable properties of an object.\n```javascript\nlet obj = {a: 1, b: 2, c: 3};\nfor (let prop in obj) {\n console.log(prop, obj[prop]);\n}\n```\nThe for...of statement creates a loop iterating over iterable objects.\n```javascript\nlet nums = [0, 1, 2, 3, 4, 5, 6, 7, 8 , 9];\nfor (let num of nums) {\n console.log(num);\n}\n```\n\n== Declaration notation\n```javascript\nfunction square(x) {\n return x * x;\n}\n// or\nvar square = function(x) {\n return x * x;\n}\n```\n\n== Arrow functions\n```javascript\nvar square = x => x * x\n// or\nvar square = (x) => {\n return x * x;\n}\n```\n\n== Recursion\n```javascript\nfunction factorial(n) {\n return n == 1 ? n : n * factorial(n-1); \n}\nconsole.log(factorial(5)) // 5 * 4 * 3 * 2 * 1 = 120\n```\n.. as long as it does not overflow the call stack.\n\n#colbreak()\n\n== Higher-order functions\n```javascript\nfunction greaterThan(n) {\n return m => m > n;\n}\nlet greaterThan10 = greaterThan(10);\nconsole.log(greaterThan10(11)); // true\n```\n\n= Regular expressions\nRegular expressions are patterns used to match character combinations in strings. They are created using the RegExp constructor or a literal notation.\n```javascript\nconst re1 = /ab+c/;\nconst re2 = new RegExp(/ab+c/);\n```\n\n- `Character Classes (., \\s, \\d, \u2026)` that distinguish types of chararters (resp. any, whitespace or digit)\n- `Character sets ([A-Z], [a-z], [0-9], [abc], \u2026)` that match any of the enclosed - characters (resp. uppercase letters, lowercase letters, digits, and any of a, b or c) \n- `Either operator (x|y)` that match either the left or right handside values\n- `Quantifiers (\\*, +, ?, {n}, {n,m})` that indicate the number of times an expression matches\n- `Boundaries (^, \\$)` that indicate the beginnings and endings of lines and words\n- `Groups ((), (?), (?:))` that extracts and remember (or not) information from the input\n- `Assertions (x(?=y))` that helps at defining conditional expressions\n\n```javascript\nconst emailRegex = /^[a-zA-Z]([a-zA-Z0-9._-]+)@(?:[a-zA-Z0-9]+\\.)+(?:com|org|net)$/;\n```\n\n== Flags\n```javascript\nconst re1 = /ab+c/; // no flag\nconst re2 = /ab+c/g; // global search\nconst re3 = /ab+c/i; // case-insensitive search\nconst re4 = /ab+c/m; // multi-line search\nconst re5 = /ab+c/gi // global case-insensitive search\n```\n\n== Context\n```javascript\nfunction doTwice(f) {\n f.call(this); // bind this to the current context\n f.call(this); // bind this to the current context\n}\nlet human = {\n age: 32,\n getOlder() {\n this.age++;\n }\n}\ndoTwice.call(human, human.getOlder); // bind this to human\nconsole.log(human.age); // Output will be 34\n```\n== Array methods\n- `concat()` concatenates two or more arrays and returns a new array.\n- `join()` joins all elements of an array into a string.\n- `pop()` removes the last element from an array and returns that element.\n- `push()` adds one or more elements to the end of an array and returns the new length of the array.\n- `reverse()` reverses the order of the elements of an array.\n- `shift()` removes the first element from an array and returns that element.\n- `slice()` selects a part of an array, and returns it as a new array.\n- `sort()` sorts the elements of an array.\n- `includes()` determines whether an array contains a specified element.\n- `flat()` flattens an array up to the specified depth." }, { "repo": "https://github.com/Servostar/dhbw-abb-typst-template", "file": "https://raw.githubusercontent.com/Servostar/dhbw-abb-typst-template/main/src/pages/declaration-of-authorship.typ", "language": "typst", "license": "MIT License", "content": "// .--------------------------------------------------------------------------.\n// | Declaration of Authorship |\n// '--------------------------------------------------------------------------'\n\n// Author: \n// Edited: 28.06.2024\n// License: MIT\n\n#let new_declaration_of_authorship(config) = (\n context {\n\n pagebreak(weak: true)\n\n let thesis = config.thesis\n let author = config.author\n\n if text.lang == \"de\" [\n #heading(\"Selbst\u00e4ndigkeitserkl\u00e4rung\")\n ] else if text.lang == \"en\" [\n #heading(\"Declaration of Authorship\")\n ]\n\n v(1em)\n\n if text.lang == \"de\" [\n Ich versichere hiermit, dass ich meine Pr\u00fcfung mit dem Thema\n ] else if text.lang == \"en\" [\n I hereby confirm that I have written this thesis with the subject\n ]\n\n v(1em)\n\n set align(center)\n\n text(weight: \"bold\", thesis.title)\n\n if thesis.subtitle != none {\n linebreak()\n thesis.subtitle\n }\n\n set align(left)\n\n v(1em)\n\n set par(justify: true)\n\n if text.lang == \"de\" [\n selbst\u00e4ndig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. Ich versichere zudem, dass die eingereichte elektronische Fassung mit der gedruckten Fassung \u00fcbereinstimmt.\n ] else if text.lang == \"en\" [\n independently and have not used any sources or aids other than those specified. I also confirm that the electronic version submitted is identical to the printed version.\n ]\n\n set align(horizon)\n\n grid(\n // set width of columns\n // we need two, so make both half the page width\n columns: (50%, 50%),\n row-gutter: 0.75em,\n align(left, {line(length: 6cm)}),\n align(left, {line(length: 6cm)}),\n align(left, if text.lang == \"de\" [ Ort, Datum ] else if text.lang == \"en\" [ Place, Date ] else { panic(\"no translation for language: \", text.lang) }),\n align(left, if text.lang == \"de\" [ Unterschrift ] else if text.lang == \"en\" [ Signature ] else { panic(\"no translation for language: \", text.lang) }))\n }\n)\n" }, { "repo": "https://github.com/noriHanda/undergrad_paper", "file": "https://raw.githubusercontent.com/noriHanda/undergrad_paper/main/main.typ", "language": "typst", "license": "", "content": "#import \"template.typ\": *\n\n\n#show: project.with(\n title: \"\u7b4b\u96fb\u7fa9\u624b\u4eba\u5de5\u611f\u899a\u306e\u305f\u3081\u306e\u99c6\u52d5\u90e8\u30a8\u30cd\u30eb\u30ae\u30fc\u6e2c\u5b9a\u306b\u57fa\u3065\u304f\u529b\u899a\u30bb\u30f3\u30b7\u30f3\u30b0\",\n englishTitle: \"Kinesthetic sense based on evaluation of actuator energy for artificial sense in myoelectric prosthetic hands\",\n author: \"\u534a\u7530 \u5bdb\u660e\",\n supervisor: \"\u845b\u897f \u8aa0\u4e5f \u6559\u6388\",\n affiliation: \"\u5de5\u5b66\u90e8\u60c5\u5831\u30a8\u30ec\u30af\u30c8\u30ed\u30cb\u30af\u30b9\u5b66\u79d1\u96fb\u6c17\u96fb\u5b50\u5de5\u5b66\u30b3\u30fc\u30b9\",\n lab: \"\u91cf\u5b50\u77e5\u80fd\u30c7\u30d0\u30a4\u30b9\u7814\u7a76\u5ba4\",\n grade: \"\u5b66\u90e84\u5e74\",\n year: \"\u4ee4\u548c5\",\n)\n\n#outline(indent: 2em, fill: box(width: 1fr, repeat[\u22ef]))\n\n// start page number\n#set page(numbering: \"1\", number-align: center, margin: (top: 35.01mm, left: 30mm, right: 30mm, bottom: 30mm))\n#counter(page).update(1)\n\n\n= \u5e8f\u8ad6\n\n== \u80cc\u666f\n\n\u4f55\u3089\u304b\u306e\u4e8b\u6545\u3084\u75c5\u6c17\u306b\u3088\u308a\u5f8c\u5929\u7684\u306b\u4e0a\u80a2\u3092\u7121\u304f\u3057\u3066\u3057\u307e\u3063\u305f\u4eba\u3001\u305d\u3057\u3066\u5148\u5929\u7684\u306b\u4e0a\u80a2\u304c\u306a\u3044\u4eba\u306f\u672c\u4eba\u306e\u610f\u601d\u3068\u306f\u7121\u95a2\u4fc2\u306b\u3001\u53d6\u308c\u308b\u793e\u4f1a\u53c2\u52a0\u306e\u9078\u629e\u80a2\u304c\u9650\u3089\u308c\u3066\u3057\u307e\u3046\u3002\u793e\u4f1a\u69cb\u9020\u81ea\u4f53\u3092\u305d\u306e\u3088\u3046\u306a\u4eba\u3005\u3082\u53c2\u753b\u3057\u3084\u3059\u3044\u5f62\u306b\u5909\u9769\u3059\u308b\u65b9\u6cd5\u3082\u8003\u3048\u3089\u308c\u308b\u304c\u3001\u305d\u306e\u305f\u3081\u306b\u306f\u4e0a\u80a2\u3092\u5fc5\u8981\u3068\u3057\u306a\u3044\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u3084\u696d\u52d9\u57f7\u884c\u306e\u65b9\u6cd5\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u51fa\u3066\u304f\u308b\u305f\u3081\u3001\u3044\u305a\u308c\u306b\u305b\u3088\u6280\u8853\u7684\u8ab2\u984c\u306b\u76f4\u9762\u3059\u308b\u3002\\\n\u3053\u306e\u305f\u3081\u3001\u4e0a\u80a2\u3092\u88dc\u3046\u5f62\u3067\u306e\u793e\u4f1a\u53c2\u52a0\u304c\u514b\u670d\u3059\u3079\u304d\u30cf\u30fc\u30c9\u30eb\u304c\u6700\u5c0f\u306b\u601d\u3048\u308b\u3002\u305d\u3053\u3067\u4f7f\u7528\u8005\u81ea\u8eab\u306e\u8eab\u4f53\u306e\u4e00\u90e8\u306e\u3088\u3046\u306b\u611f\u3058\u308b\u3053\u3068\u306e\u3067\u304d\u308b\u64cd\u4f5c\u611f\u306e\u7fa9\u624b\u304c\u5fc5\u8981\u306b\u306a\u3063\u3066\u304f\u308b\u306e\u306f\u660e\u3089\u304b\u3067\u3042\u308b\u3002\u305d\u3082\u305d\u3082\u7fa9\u624b\u306b\u306f\u5be9\u7f8e\u6027\u306e\u307f\u3092\u76ee\u7684\u3068\u3057\u305f\u7269\u3082\u5b58\u5728\u3059\u308b\u304c\u3001\u64cd\u4f5c\u53ef\u80fd\u306a\u4e0a\u3001\u4fb5\u8972\u6027\u304c\u306a\u3044\u305f\u3081\u7740\u8131\u304c\u5bb9\u6613\u306a\u7b4b\u96fb\u7fa9\u624b\u304c\u672c\u5206\u91ce\u306e\u3053\u308c\u304b\u3089\u306e\u6f6e\u6d41\u3092\u70ba\u3059\u3068\u8003\u3048\u3089\u308c\u308b\u3002\\\n\u4eba\u9593\u304c\u81ea\u5206\u306e\u624b\u3092\u52d5\u4f5c\u3055\u305b\u308b\u969b\u3001\u968f\u610f\u52d5\u4f5c\uff08\u610f\u8b58\u7684\u52d5\u4f5c\uff09\u3068\u4e0d\u968f\u610f\u52d5\u4f5c\uff08\u7121\u610f\u8b58\u7684\u52d5\u4f5c\uff09\u306b\u5206\u985e\u3067\u304d\u308b\u3002\u968f\u610f\u52d5\u4f5c\u3068\u306f\u3001\u4eba\u9593\u304c\u610f\u56f3\u3057\u305f\u901a\u308a\u306e\u52d5\u304d\u3092\u3059\u308b\u52d5\u4f5c\u3067\u3042\u308b\u4e00\u65b9\u3001\u4e0d\u968f\u610f\u64cd\u4f5c\u306f\u4eba\u9593\u304c\u52d5\u4f5c\u306b\u5bfe\u3057\u3066\u610f\u8b58\u7684\u306b\u306a\u3089\u305a\u3068\u3082\u78ba\u304b\u306b\u884c\u3063\u3066\u3044\u308b\u52d5\u4f5c\u3084\u5236\u5fa1\u306e\u3053\u3068\u3067\u3042\u308b\u3002\u71b1\u3044\u3082\u306e\u3084\u75db\u307f\u3092\u611f\u3058\u308b\u3068\u540c\u6642\u304b\u3080\u3057\u308d\u611f\u3058\u308b\u3088\u308a\u524d\u306b\u624b\u3092\u5f15\u3063\u8fbc\u3081\u305f\u308a\u3001\u91cd\u3044\u3082\u306e\u3092\u6301\u3064\u3068\u304d\u306b\u7121\u610f\u8b58\u306b\u529b\u3092\u52a0\u3048\u3066\u3082\u306e\u304c\u843d\u3061\u306a\u3044\u3088\u3046\u306b\u5236\u5fa1\u3057\u305f\u308a\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u3053\u308c\u306b\u5f53\u305f\u308b\u3002\n\u7b4b\u96fb\u7fa9\u624b\u306e\u76ee\u6307\u3059\u5148\u306f\u4f7f\u7528\u8005\u304c\u3042\u305f\u304b\u3082\u81ea\u5206\u306e\u624b\u3067\u3042\u3063\u305f\u304b\u306e\u3088\u3046\u306b\u64cd\u4f5c\u3092\u884c\u3048\u308b\u72b6\u614b\u3067\u3042\u308b\u3002\u3053\u306e\u305f\u3081\u3001\u305d\u306e\u5b8c\u6210\u5ea6\u306f\u554f\u984c\u306b\u306a\u308b\u304c\u3001\u7b4b\u96fb\u7fa9\u624b\u306b\u304a\u3051\u308b\u968f\u610f\u64cd\u4f5c\u6027\u80fd\u81ea\u4f53\u306f\u7814\u7a76\u5206\u91ce\u3068\u3057\u3066\u3059\u3067\u306b\u5927\u304d\u306a\u3082\u306e\u3068\u3057\u3066\u5b58\u5728\u3059\u308b @Prosthetic-Hands-Trends \u3002\u4e00\u65b9\u3067\u4e0d\u968f\u610f\u306e\u52d5\u4f5c\u306b\u95a2\u3057\u3066\u306f\u305d\u306e\u8ab2\u984c\u611f\u306e\u5171\u6709\u306e\u96e3\u3057\u3055\u304b\u3089\u8ab2\u984c\u3068\u3057\u3066\u6349\u3048\u3089\u308c\u306b\u304f\u3044\u5206\u91ce\u306b\u306a\u3063\u3066\u304f\u308b\u3002\u3057\u304b\u3057\u3001\u3053\u306e\u4e0d\u968f\u610f\u52d5\u4f5c\u7121\u304f\u3057\u3066\u4eba\u306e\u624b\u306e\u3088\u3046\u306a\u64cd\u4f5c\u611f\u306f\u5f97\u3089\u308c\u306a\u3044\u3002\n\n#figure(image(\"assets/overview_table.png\"), numbering: \"1\", caption: text(\"\u7b4b\u96fb\u7fa9\u624b\u7814\u7a76\u306e\u65b9\u91dd\u3068\u73fe\u5728\u5730\"), kind: table)\n\n== \u76ee\u7684\n\n\u4e0d\u968f\u610f\u52d5\u4f5c\u3092\u6697\u9ed9\u7684\u306b\u7fa9\u624b\u306b\u5b9f\u88c5\u3059\u308b\u306e\u3067\u306f\u81ea\u5206\u306e\u624b\u306e\u3088\u3046\u306b\u306f\u306a\u3089\u306a\u3044\u3002\u751f\u4f53\u306e\u624b\u306e\u3088\u3046\u306b\u3001\u89e6\u308b\u6e29\u5ea6\u306e\u5f62\u72b6\u3001\u89e6\u308a\u5fc3\u5730\u306a\u3069\u306f\u3082\u3061\u308d\u3093\u306e\u3053\u3068\u3001\u624b\u306b\u304b\u304b\u3063\u3066\u3044\u308b\u91cd\u91cf\u7684\u306a\u8ca0\u62c5\u3092\u3082\u5229\u7528\u8005\u306b\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u89e6\u899a\u306b\u5f53\u305f\u308b\u90e8\u5206\u3092\u76ae\u819a\u611f\u899a\u3001\u91cd\u91cf\u7684\u8ca0\u62c5\u3092\u611f\u3058\u308b\u529b\u899a\u306e\u90e8\u5206\u3092\u6df1\u90e8\u611f\u899a\u3068\u547c\u3070\u308c\u3066\u3044\u308b\u304c\u3001\u76ae\u819a\u611f\u899a\u306e\u5206\u91ce\u306b\u3064\u3044\u3066\u306f\u7fa9\u624b\u306e\u307f\u306a\u3089\u305axR\u306a\u3069\u306e\u5206\u91ce\u3067\u3082\u30cf\u30d7\u30c6\u30a3\u30af\u30b9\u3068\u547c\u3070\u308c\u308b\u3088\u3046\u306b\u3001\u4ed6\u5206\u91ce\u306b\u6e21\u308a\u7814\u7a76\u304c\u9032\u3081\u3089\u308c\u3066\u3044\u308b\u3002\u4e00\u65b9\u3067\u6df1\u90e8\u611f\u899a\u306b\u3064\u3044\u3066\u306f\u76ae\u819a\u611f\u899a\u3068\u540c\u69d8\u306b\u91cd\u8981\u3067\u3042\u308b\u306b\u3082\u95a2\u308f\u3089\u305a\u6bd4\u8f03\u7684\u7814\u7a76\u304c\u9032\u3081\u3089\u308c\u3066\u3044\u306a\u3044\u3002\u3053\u308c\u306fGoogle Scholar\u306b\u3066 \"haptics\" \u306f225,000\u4ef6\u3001 \"cutaneous sensation\" \u306f516,000\u4ef6\u30d2\u30c3\u30c8\u3059\u308b\u306e\u306b\u5bfe\u3057\u3001\u6df1\u90e8\u611f\u899a\u306b\u3042\u305f\u308b \"bathyesthesia\" \u306f86\u4ef6\u3057\u304b\u30d2\u30c3\u30c8\u3057\u306a\u3044\u3053\u3068\u304b\u3089\u3082\u660e\u3089\u304b\u3067\u3042\u308b\u3002\u306a\u304a \"deep sense\" \u3084 \"deep sensing\" \u306a\u3069\u306f\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306a\u3069\u591a\u5c90\u306b\u308f\u305f\u308b\u5206\u91ce\u3067\u306e\u4f7f\u7528\u304c\u3055\u308c\u3066\u3044\u308b\u7528\u8a9e\u3067\u3042\u308b\u305f\u3081\u9664\u5916\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u7814\u7a76\u52d5\u5411\u3092\u8e0f\u307e\u3048\u3001\u6211\u3005\u306f\u91cd\u8981\u306b\u3082\u95a2\u308f\u3089\u305a\u3042\u307e\u308a\u624b\u3092\u3064\u3051\u3089\u308c\u3066\u3044\u306a\u3044\u5206\u91ce\u3067\u3042\u308b\u529b\u899a\u306e\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u306b\u4eca\u56de\u53d6\u308a\u7d44\u3080\u3053\u3068\u3068\u3057\u305f\u3002\n\n== \u672c\u8ad6\u6587\u306e\u69cb\u6210\n\n\u672c\u8ad6\u6587\u306f\u51686\u7ae0\u304b\u3089\u69cb\u6210\u3055\u308c\u3066\u3044\u308b\u3002\\\n\u7b2c1\u7ae0\u3067\u306f\u672c\u8ad6\u6587\u306e\u76ee\u7684\u53ca\u3073\u5148\u884c\u7814\u7a76\u3092\u8e0f\u307e\u3048\u305f\u7acb\u3061\u4f4d\u7f6e\u3092\u8ad6\u3058\u305f\u3002\\\n\u7b2c2\u7ae0\u3067\u306f\u529b\u899a\u30bb\u30f3\u30b7\u30f3\u30b0\u6280\u8853\u3092\u7d39\u4ecb\u3059\u308b\u3002\\\n\u7b2c3\u7ae0\u3067\u306f\u7b4b\u96fb\u7fa9\u624b\u306e\u99c6\u52d5\u90e8\u30a8\u30cd\u30eb\u30ae\u30fc\u6e2c\u5b9a\u3092\u3059\u308b\u3053\u3068\u3067\u5982\u4f55\u306b\u529b\u899a\u30bb\u30f3\u30b7\u30f3\u30b0\u3092\u884c\u3046\u304b\u3092\u8aac\u660e\u3059\u308b\u3002\\\n\u7b2c4\u7ae0\u3067\u306f\u672c\u7814\u7a76\u7d50\u679c\u3092\u7528\u3044\u3066\u63a8\u8ad6\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306e\u306b\u306b\u7528\u3044\u308b\u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8aac\u660e\u3092\u884c\u3046\u3002\\\n\u7b2c5\u7ae0\u3067\u306f\u99c6\u52d5\u90e8\u30a8\u30cd\u30eb\u30ae\u30fc\u3068\u3044\u3046\u4fe1\u53f7\u3092\u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u7528\u3044\u3066\u89e3\u6790\u3059\u308b\u624b\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3059\u308b\u3002\\\n\u6700\u5f8c\u306b\u7b2c6\u7ae0\u3092\u672c\u8ad6\u6587\u306e\u307e\u3068\u3081\u3068\u3059\u308b\u3002\n\n#pagebreak(weak: true)\n\n= \u529b\u899a\u30bb\u30f3\u30b7\u30f3\u30b0\n\n\u529b\u899a\u3092\u6e2c\u5b9a\u3059\u308b\u305f\u3081\u306e\u6a5f\u69cb\u306f\u53e4\u304f\u304b\u3089\u7814\u7a76\u3055\u308c\u3066\u304a\u308a\u3001\u7523\u696d\u7528\u30ed\u30dc\u30c3\u30c8\u3084\u30bf\u30c3\u30c1\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u306a\u3069\u5e45\u5e83\u3044\u7528\u9014\u3067\u5229\u7528\u3055\u308c\u3066\u304d\u305f\u3002\u4ee5\u4e0b\u306b\u4e3b\u306a\u529b\u899a\u30bb\u30f3\u30b7\u30f3\u30b0\u3092\u3059\u308b\u6280\u8853\u3092\u7d39\u4ecb\u3059\u308b\u3002 @Sensors\n\n== \u65e2\u5b58\u306e\u529b\u899a\u30bb\u30f3\u30b7\u30f3\u30b0\u6280\u8853\n\n=== \u6b6a\u307f\u30b2\u30fc\u30b8\u30bb\u30f3\u30b5\n\n\u6b6a\u307f\u30b2\u30fc\u30b8\u30bb\u30f3\u30b5\u306f\u30bb\u30f3\u30b5\u30fc\u90e8\u306b\u304b\u304b\u308b\u5f15\u5f35\u529b\u30fb\u5727\u7e2e\u529b\u306b\u3088\u308a\u3001\u96fb\u6c17\u62b5\u6297\u304c\u5909\u5316\u3059\u308b\u91d1\u5c5e\u62b5\u6297\u6750\u6599\u306e\u6027\u8cea\u3092\u5229\u7528\u3057\u3066\u3001\u529b\u3084\u30c8\u30eb\u30af\u306b\u63db\u7b97\u3059\u308b\u3002\u5c0f\u578b\u3067\u7cbe\u5ea6\u304c\u9ad8\u304f\u3001\u5fdc\u7b54\u6027\u3082\u9ad8\u3044\u3053\u3068\u304b\u3089\u591a\u304f\u306e\u5834\u9762\u3067\u4f7f\u308f\u308c\u308b\u3002\n\n=== \u5727\u96fb\u30bb\u30f3\u30b5\n\n\u6c34\u6676\u3084PZT (\u30b8\u30eb\u30b3\u30f3\u9178\u30c1\u30bf\u30f3\u9178\u925b) \u306a\u3069\u306e\u5727\u96fb\u52b9\u679c\u3092\u6709\u3059\u308b\u6750\u6599\u3092\u30bb\u30f3\u30b5\u30fc\u90e8\u306b\u4f7f\u7528\u3057\u3066\u3001\u529b\u3092\u6e2c\u5b9a\u3059\u308b\u3002\u5c0f\u578b\u3067\u5fdc\u7b54\u6027\u304c\u9ad8\u304f\u3001\u30b3\u30b9\u30c8\u3082\u6bd4\u8f03\u7684\u512a\u308c\u3044\u308b\u304c\u7cbe\u5ea6\u306f\u3001\u3072\u305a\u307f\u30b2\u30fc\u30b8\u5f0f\u3084\u9759\u96fb\u5bb9\u91cf\u5f0f\u306b\u306f\u53ca\u3070\u306a\u3044\u3002\n\n=== \u9759\u96fb\u5bb9\u91cf\u30bb\u30f3\u30b5\n\n\u30bb\u30f3\u30b5\u30fc\u90e8\u3092\u91d1\u5c5e\u6750\u6599\u306e\u96fb\u6975\u304c\u5411\u304b\u3044\u5408\u308f\u305b\u306b\u914d\u7f6e\u3055\u308c\u305f\u30b3\u30f3\u30c7\u30f3\u30b5\u578b\u3068\u3057\u3001\u529b\u306b\u3088\u308a\u5c0e\u4f53\u9593\u306b\u3072\u305a\u307f\u304c\u751f\u3058\u3066\u8ddd\u96e2\u304c\u5909\u308f\u308b\u3053\u3068\u306b\u3088\u308b\u9759\u96fb\u5bb9\u91cf\u306e\u5909\u5316\u3092\u691c\u77e5\u3059\u308b\u3002\u69cb\u6210\u304c\u6bd4\u8f03\u7684\u7c21\u5358\u3067\u4f4e\u30b3\u30b9\u30c8\u3067\u751f\u7523\u3067\u304d\u308b\u4e0a\u3001\u96fb\u6975\u3092\u30d5\u30a3\u30eb\u30e0\u72b6\u306b\u3059\u308b\u3068\u3001\u5c0f\u578b\u5316\u30fb\u8584\u578b\u5316\u304c\u53ef\u80fd\u3067\u3042\u308b\u3002\u7cbe\u5ea6\u3084\u5fdc\u7b54\u6027\u3082\u512a\u308c\u3066\u3044\u308b\u3002\n\n=== \u5149\u5b66\u30bb\u30f3\u30b5\n\n\u8a08\u6e2c\u5bfe\u8c61\u7269\u306b\u4e00\u5b9a\u9593\u9694\u3067\u6a21\u69d8\u3092\u30de\u30fc\u30ad\u30f3\u30b0\u3057\u3066\u304a\u304d\u3001\u529b\u304c\u52a0\u308f\u3063\u305f\u6642\u306b\u751f\u3058\u308b\u6a21\u69d8\u306e\u5909\u5316\u3092\u3001\u30ab\u30e1\u30e9\u3084\u30ec\u30fc\u30b6\u30fc\u306a\u3069\u306e\u5149\u5b66\u30bb\u30f3\u30b5\u3067\u691c\u51fa\u3057\u3066\u3001\u529b\u306e\u5927\u304d\u3055\u3092\u8a08\u7b97\u3057\u3066\u6c42\u3081\u308b\u3002\u975e\u63a5\u89e6\u3067\u6e2c\u5b9a\u3067\u304d\u308b\u3053\u3068\u304c\u6700\u5927\u306e\u30e1\u30ea\u30c3\u30c8\u3067\u306f\u3042\u308b\u304c\u7cbe\u5ea6\u3001\u5fdc\u7b54\u6027\u3001\u5c0f\u578b\u5316\u3001\u30b3\u30b9\u30c8\u306f\u3001\u4ed6\u306e\u65b9\u5f0f\u306b\u8ecd\u914d\u304c\u4e0a\u304c\u308b\u305f\u3081\u4f7f\u308f\u308c\u308b\u5834\u9762\u306f\u9650\u3089\u308c\u308b\u3002\n\n=== \u30b5\u30fc\u30dc\u306e\u9006\u8d77\u96fb\u529b\u3068\u30b5\u30fc\u30dc\u5185\u8535\u30bb\u30f3\u30b5\u3092\u7528\u3044\u305f\u624b\u6cd5\n\n\u5148\u8ff0\u306e\u3088\u3046\u306a\u30bb\u30f3\u30b5\u3092\u7528\u3044\u306a\u3044\u624b\u6cd5\u3082\u53e4\u304f\u304b\u3089\u7814\u7a76\u3055\u308c\u3066\u3044\u308b\u3002\n\u7279\u306b\u4eca\u56de\u306e\u3088\u3046\u306b\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u3092\u5185\u8535\u3059\u308b\u5834\u5408\u304c\u975e\u5e38\u306b\u591a\u3044\u7b4b\u96fb\u7fa9\u624b\u306e\u3088\u3046\u306a\u3082\u306e\u306e\u5834\u5408\u3001\u3082\u3068\u3082\u3068\u3082\u3068\u5185\u8535\u3055\u308c\u3066\u3044\u308b\u30b5\u30fc\u30dc\u304b\u3089\u5f97\u3089\u308c\u308b\u4fe1\u53f7\u3092\u7528\u3044\u308b\u65b9\u6cd5\u3068\u3057\u3066\u9006\u8d77\u96fb\u529b\u3092\u89b3\u6e2c\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308b\u3002\u3053\u308c\u306f\u30e2\u30fc\u30bf\u306b\u5916\u529b\u3092\u4e0e\u3048\u3066\u56de\u8ee2\u3055\u305b\u305f\u969b\u306b\u30e2\u30fc\u30bf\u304c\u767a\u96fb\u6a5f\u3068\u3057\u3066\u632f\u308b\u821e\u3046\u73fe\u8c61\u3092\u7528\u3044\u308b\u624b\u6cd5\u3067\u3042\u308b\u3002\u3057\u304b\u3057\u3053\u308c\u3060\u3051\u3067\u306f\u56de\u8ee2\u65b9\u5411\u304c\u308f\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u306e\u56de\u8ee2\u89d2\u5236\u5fa1\u7528\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308b\u30a8\u30f3\u30b3\u30fc\u30c0\u3084\u30bf\u30b3\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u5916\u529b\u306e\u65b9\u5411\u3092\u5272\u308a\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3042\u308b\u3002\\\n\u4ee5\u4e0b\u306b\u305d\u306e\u6570\u7406\u7684\u8aac\u660e\u3092\u884c\u3046\u3002\n\n==== \u30bb\u30f3\u30b5\u30ec\u30b9\u30bb\u30f3\u30b7\u30f3\u30b0\u306e\u6570\u7406\u7684\u8aac\u660e\n\n\u5168\u5916\u4e71\u304b\u3089\u5916\u529b\u4ee5\u5916\u306e\u8981\u7d20\u3092\u30e2\u30c7\u30eb\u5316\u3057\u53d6\u308a\u9664\u304f\u3053\u3068\u3067\u5916\u529b\u306e\u307f\u3092\u62bd\u51fa\u53ef\u80fd\u3068\u3057\u3066\u8003\u3048\u308b\u3068\u4ee5\u4e0b\u306e\u5f0f\u3067\u8868\u73fe\u3055\u308c\u308b\u3002\\\n\n#math.equation(block:true,numbering: \"(1)\" ,$ F_\"ext\"=F_\"dis\"-(F_\"int\"+F_\"g\"+F_\"c\"+D s X^\"res\"+Delta M s ^2X^\"res\"-Delta\"K\"_t\"I\"^\"ref\"_a) $)\n\n\u305f\u3060\u3057\u3053\u3053\u3067$F_\"dis\"$\u306f\u5168\u5916\u4e71\u3001$F_\"int\"$\u306f\u30b3\u30ea\u30aa\u30ea\u529b\u30fb\u9060\u5fc3\u529b\u306a\u3069\u306e\u5185\u90e8\u5e72\u6e09\u529b\u3001$F_g$\u306f\u59ff\u52e2\u306e\u5f71\u97ff\u3067\u91cd\u529b\u52a0\u901f\u5ea6\u306b\u3088\u308a\u767a\u751f\u3059\u308b\u529b\u3001$F_c$\u306f\u30af\u30fc\u30ed\u30f3\u6469\u64e6\u529b\u3001$D s X^\"res\"$\u306f\u7c98\u6027\u6469\u64e6\u529b\u3001$M$\u306f\u30e2\u30fc\u30bf\u7a3c\u50cd\u90e8\u306e\u6163\u6027\u3067\u3042\u308a$M s^2 X^\"res\"$\u306f\u5468\u6ce2\u6570\u9818\u57df\u306b\u304a\u3051\u308b\u30e2\u30fc\u30bf\u306e\u52d5\u529b\u5b66\u3092\u8868\u3059\uff08\u3059\u306a\u308f\u3061$s, X^\"res\"$\u306f\u305d\u308c\u305e\u308c\u30e9\u30d7\u30e9\u30b9\u6f14\u7b97\u5b50\u3068\u5468\u6ce2\u6570\u9818\u57df\u3067\u306e\u89d2\u5ea6\u3092\u8868\u3059\u5909\u6570\uff09\u3002$K_t$\u306f\u30e2\u30fc\u30bf\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u78c1\u77f3\u306e\u5f37\u3055\u3084\u30b3\u30a4\u30eb\u306e\u5dfb\u7dda\u91cf\u306b\u3088\u3063\u3066\u5909\u5316\u3059\u308b\u30e2\u30fc\u30bf\u56fa\u6709\u306e\u63a8\u529b\u5b9a\u6570\u3001$I_a^\"ref\"$\u306f\u5468\u6ce2\u6570\u9818\u57df\u306b\u304a\u3051\u308b\u96fb\u6d41\u3092\u8868\u3059\u5909\u6570\u3067\u3042\u308b\u3002\\\n\u5f0f(1)\u306b\u304a\u3051\u308bC\u6469\u64e6\u529b$F_c$\u3001\u7c98\u6027\u6469\u64e6\u529b$D s X^\"res\"$\u306f\u4e8c\u7a2e\u306e\u7b49\u901f\u5ea6\u8a66\u9a13\u3001\u6163\u6027\u5909\u52d5$Delta M$\u306f\u52a0\u901f\u5ea6\u8a66\u9a13\u306b\u3088\u3063\u3066\u540c\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002@Sensorless-Sensing\n\n\n== \u65e2\u5b58\u6280\u8853\u306e\u8ab2\u984c\n\n\u529b\u899a\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u306b\u306f\u5404\u7a2e\u30bb\u30f3\u30b5\u3092\u7528\u3044\u308b\u65b9\u6cd5\u3068\u3001\u5185\u8535\u3055\u308c\u3066\u3044\u308b\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u304b\u3089\u5f97\u3089\u308c\u308b\u4fe1\u53f7\u3092\u7528\u3044\u308b\u65b9\u6cd5\u3068\u304c\u4e00\u822c\u7684\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002\u3057\u304b\u3057\u3001\u3069\u3061\u3089\u306e\u65b9\u6cd5\u3082\u7b4b\u96fb\u7fa9\u624b\u306b\u529b\u899a\u3092\u4e0e\u3048\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3068\u3057\u3066\u306f\u76f8\u5fdc\u3057\u304f\u306a\u3044\u3002\n\n=== \u529b\u899a\u30bb\u30f3\u30b5\u306e\u554f\u984c\u70b9\n\n\u524d\u7bc0\u3067\u7d39\u4ecb\u3057\u305f\u529b\u899a\u30bb\u30f3\u30b5\u3092\u7b4b\u96fb\u7fa9\u624b\u306b\u7528\u3044\u308b\u3068\u306a\u308b\u3068\u4e8c\u3064\u306e\u61f8\u5ff5\u70b9\u304c\u6d6e\u304b\u3093\u3067\u304f\u308b\u3002\u642d\u8f09\u30bb\u30f3\u30b5\u306e\u53d6\u308a\u4ed8\u3051\u4f4d\u7f6e\u3068\u30b3\u30b9\u30c8\u306e\u5897\u52a0\u3060\u3002\u524d\u7bc0\u3067\u7d39\u4ecb\u3057\u305f\u529b\u899a\u30bb\u30f3\u30b5\u306f\u3069\u308c\u3082\u5727\u529b\u304c\u76f4\u63a5\u304b\u304b\u308b\u90e8\u5206\u306b\u8a2d\u7f6e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u7269\u306b\u89e6\u308c\u305f\u969b\u306b\u611f\u3058\u308b\u611f\u89e6\u304c\u8a8d\u8b58\u5bfe\u8c61\u3067\u3042\u308c\u3070\u3053\u308c\u3067\u3082\u69cb\u308f\u306a\u3044\u304c\u3001\u4eca\u56de\u5bfe\u8c61\u3068\u3059\u308b\u306e\u306f\u7a3c\u50cd\u90e8\u306b\u304b\u304b\u308b\u529b\u899a\u3067\u3042\u308b\u305f\u3081\u529b\u899a\u30bb\u30f3\u30b5\u3082\u7a3c\u50cd\u90e8\u306b\u53d6\u308a\u4ed8\u3051\u308b\u5fc5\u8981\u304c\u51fa\u3066\u304f\u308b\u3002\u99c6\u52d5\u90e8\u306b\u3042\u308b\u7a0b\u5ea6\u30b5\u30a4\u30ba\u306e\u3042\u308b\u529b\u899a\u30bb\u30f3\u30b5\u3092\u53d6\u308a\u4ed8\u3051\u308b\u3068\u306a\u308b\u3068\u53d6\u308a\u4ed8\u3051\u4f4d\u7f6e\u3084\u53d6\u308a\u4ed8\u3051\u65b9\u306b\u304b\u306a\u308a\u306e\u5de5\u592b\u304c\u5fc5\u8981\u3068\u306a\u3063\u3066\u304f\u308b\u3053\u3068\u306f\u60f3\u50cf\u306b\u96e3\u304f\u306a\u3044\u3002\\\n\u307e\u305f\u3001\u30b3\u30b9\u30c8\u306e\u9762\u3067\u3082\u5404\u30b5\u30fc\u30dc\u95a2\u7bc0\u90e8\u5206\u306b\u529b\u899a\u30bb\u30f3\u30b5\u304c\u5fc5\u8981\u3068\u306a\u3063\u3066\u304f\u308b\u3053\u3068\u304b\u3089\u52b9\u679c\u306b\u306a\u3063\u3066\u304f\u308b\u3002\u7b4b\u96fb\u7fa9\u624b\u306f\u4e0a\u80a2\u304c\u306a\u3044\u65b9\u304c\u751f\u6d3b\u306b\u652f\u969c\u306e\u306a\u3044\u3088\u3046\u3059\u308b\u3068\u3044\u3046\u3001\u4eba\u6a29\u306e\u9762\u304b\u3089\u3082\u6700\u4f4e\u9650\u5fc5\u8981\u306a\u3082\u306e\u3068\u306a\u3063\u3066\u304f\u308b\u3082\u306e\u3067\u3042\u308b\u305f\u3081\u3001\u4f4e\u30b3\u30b9\u30c8\u306b\u6291\u3048\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3042\u308b\u3002\u305d\u306e\u305f\u3081\u306b\u306f\u5404\u95a2\u7bc0\u3054\u3068\u306b\u9ad8\u4fa1\u306a\u30bb\u30f3\u30b5\u3092\u642d\u8f09\u3059\u308b\u3053\u3068\u306f\u671b\u307e\u3057\u304f\u306a\u3044\u3002\n\n=== \u30b5\u30fc\u30dc\u306e\u9006\u8d77\u96fb\u529b\u3092\u7528\u3044\u305f\u5834\u5408\u306e\u554f\u984c\u70b9\n\n\u65e2\u5b58\u6280\u8853\u306e\u4e2d\u3067\u5b89\u4fa1\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u3068\u3057\u3066\u30b5\u30fc\u30dc\u306e\u9006\u8d77\u96fb\u529b\u3068\u30a8\u30f3\u30b3\u30fc\u30c0\u7b49\u306e\u56de\u8ee2\u65b9\u5411\u3092\u691c\u51fa\u3059\u308b\u30bb\u30f3\u30b5\u3068\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30bb\u30f3\u30b5\u30ec\u30b9\u306e\u624b\u6cd5\u304c\u3042\u308b\u3002\u524d\u7bc0\u3067\u3082\u7d39\u4ecb\u3057\u305f\u901a\u308a\u3001\u3053\u306e\u624b\u6cd5\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u9006\u8d77\u96fb\u529b\u3092\u691c\u51fa\u3059\u308b\u56de\u8def\u4ee5\u5916\u306e\u8ffd\u52a0\u90e8\u54c1\u3092\u5fc5\u8981\u3068\u305b\u305a\u5b9f\u88c5\u3067\u304d\u308b\u3002\u307e\u305f\u3001\u8ffd\u52a0\u90e8\u54c1\u304c\u5fc5\u8981\u306a\u3044\u305f\u3081\u53d6\u308a\u4ed8\u3051\u4f4d\u7f6e\u306b\u5275\u610f\u5de5\u592b\u306e\u5fc5\u8981\u6027\u304c\u306a\u3044\u3002\\\n\u3057\u304b\u3057\u6c7a\u5b9a\u7684\u306a\u5f31\u70b9\u304c\u5b58\u5728\u3059\u308b\u3002\u30e2\u30fc\u30bf\u306e\u7279\u6027\u4e0a\u3001\u9006\u8d77\u96fb\u529b\u3092\u5f97\u308b\u306b\u306f\u30b7\u30e3\u30d5\u30c8\u306e\u56de\u8ee2\u304c\u5fc5\u8981\u306a\u70b9\u3067\u3042\u308b\u3002\u5b9f\u969b\u306e\u529b\u899a\u3092\u6e2c\u5b9a\u3059\u308b\u969b\u3001\u30e2\u30fc\u30bf\u3092\u56de\u8ee2\u3055\u305b\u308b\u306b\u306f\u5f31\u3059\u304e\u308b\u529b\u304c\u4ed8\u4e0e\u3055\u308c\u308b\u5834\u5408\u3082\u591a\u304f\u5b58\u5728\u3059\u308b\u3002\u3057\u304b\u3057\u3001\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u3067\u3082\u3053\u306e\u30bb\u30f3\u30b5\u30ec\u30b9\u306e\u624b\u6cd5\u3067\u306f\u304b\u304b\u3063\u3066\u3044\u308b\u529b\u899a\u306f0\u3068\u3057\u3066\u5224\u65ad\u3055\u308c\u3066\u3057\u307e\u3046\u3002\u3053\u308c\u3067\u306f\u5b9f\u969b\u306e\u751f\u4f53\u306e\u3088\u3046\u306b\u3001\u5916\u529b\u306b\u8010\u3048\u3066\u3044\u308b\u72b6\u614b\u3067\u3082\u7b4b\u8089\u306e\u8ca0\u8377\u3092\u611f\u3058\u53d6\u308b\u3053\u3068\u3067\u5916\u529b\u306e\u5927\u304d\u3055\u3092\u5927\u51e1\u8a8d\u77e5\u3059\u308b\u3053\u3068\u306f\u53f6\u308f\u306a\u3044\u3002\n\n== \u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u3092\u7528\u3044\u308b\u65b9\u6cd5\n\n\u524d\u7bc0\u3067\u306f\u529b\u899a\u30bb\u30f3\u30b5\u306e\u642d\u8f09\u3084\u3001\u30b5\u30fc\u30dc\u306e\u9006\u8d77\u96fb\u529b\u3092\u7528\u3044\u305f\u3001\u5834\u5408\u306e\u6b20\u70b9\u3092\u7d39\u4ecb\u3057\u305f\u3002\u7b4b\u96fb\u7fa9\u624b\u306e\u529b\u899a\u3092\u6e2c\u5b9a\u3059\u308b\u305f\u3081\u306b\u306f\u3053\u308c\u3089\u306e\u65b9\u6cd5\u3067\u306f\u5b9f\u7528\u6027\u306b\u6b20\u3051\u308b\u90e8\u5206\u304c\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002\u3053\u308c\u3089\u306e\u65b9\u6cd5\u3088\u308a\u7c21\u4fbf\u304b\u3064\u9759\u6b62\u6642\u306e\u8a08\u6e2c\u3082\u53ef\u80fd\u306a\u624b\u6cd5\u304c\u671b\u307e\u3057\u3044\u308f\u3051\u3067\u3042\u308b\u304c\u3001\u3053\u3053\u3067\u6211\u3005\u306f\u4ed6\u306e\u7814\u7a76\u30c6\u30fc\u30de\u3067\u306e\u30c8\u30e9\u30d6\u30eb\u306b\u7740\u76ee\u3057\u305f\u3002\n\n#heading(\"\u904e\u8ca0\u8377\u306b\u3088\u308b\u30b5\u30fc\u30dc\u306e\u6545\u969c\", numbering: none, level: 3, outlined: false)\n\n\u540c\u3058\u7814\u7a76\u5ba4\u5185\u306e\u5225\u306e\u7814\u7a76\u30b0\u30eb\u30fc\u30d7\u3067\u30b5\u30fc\u30dc\u306e\u6545\u969c\u304c\u4f55\u5ea6\u304b\u767a\u751f\u3057\u305f\u3002\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u3067\u306f\u30ed\u30dc\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u30ed\u30dc\u30c3\u30c8\u306e\u8db3\u3092\u70ba\u3059\u30b5\u30fc\u30dc\u306b\u904e\u8ca0\u8377\u304c\u304b\u304b\u308a\u96fb\u6d41\u5236\u5fa1\u7528\u306e\u30c8\u30e9\u30f3\u30b8\u30b9\u30bf\u304c\u713c\u304d\u5207\u308c\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u539f\u56e0\u3060\u3063\u305f\u3002\u30b5\u30fc\u30dc\u306f\u4e0e\u3048\u3089\u308c\u305fPWM\u4fe1\u53f7\u306b\u5bfe\u5fdc\u3059\u308b\u56de\u8ee2\u89d2\u5ea6\uff08\u76ee\u6a19\u89d2\u5ea6\uff09\u3068\u73fe\u5728\u306e\u56de\u8ee2\u89d2\u5ea6\u3068\u306b\u305a\u308c\u304c\u3042\u308b\u5834\u5408\u306b\u76ee\u6a19\u89d2\u5ea6\u3068\u306a\u308b\u3088\u3046\u306b\u56de\u8ee2\u3059\u308b\u6027\u8cea\u304c\u3042\u308b\u3002\u76ee\u6a19\u89d2\u5ea6\u307e\u3067\u56de\u8ee2\u3059\u308b\u969b\u306b\u5916\u529b\u306b\u3088\u308a\u56de\u8ee2\u306b\u30d6\u30ec\u30fc\u30ad\u304c\u304b\u304b\u308b\u969b\u306f\u305d\u308c\u306b\u8ca0\u3051\u3058\u3068\u4f9b\u7d66\u96fb\u6d41\u3092\u5897\u3084\u3059\u3053\u3068\u3067\u52d5\u3053\u3046\u3068\u3059\u308b\u3002\u3057\u304b\u3057\u305d\u306e\u969b\u306b\u5185\u90e8\u306e\u96fb\u5b50\u56de\u8def\u306e\u8a31\u5bb9\u96fb\u6d41\u3092\u8d85\u3048\u3066\u3057\u307e\u3044\u7834\u640d\u3059\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u3002\u6211\u3005\u306f\u3053\u306e\u73fe\u8c61\u306b\u7740\u76ee\u3092\u3057\u3066\u3001\u30b5\u30fc\u30dc\u306b\u304b\u304b\u308b\u5916\u529b\u3092\u6d88\u8cbb\u96fb\u529b\u3092\u7528\u3044\u3066\u691c\u51fa\u3059\u308b\u624b\u6cd5\u3092\u8003\u6848\u3057\u305f\u3002\n\n\n#pagebreak(weak: true)\n\n= \u7b4b\u96fb\u7fa9\u624b\u306e\u99c6\u52d5\u90e8\u30a8\u30cd\u30eb\u30ae\u30fc\u6e2c\u5b9a\u306b\u3064\u3044\u3066\n\n\u7b4b\u96fb\u7fa9\u624b\u306e\u7a3c\u50cd\u90e8\u3092\u70ba\u3059\u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u3092\u6e2c\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u7fa9\u624b\u306b\u304b\u304b\u308b\u529b\u899a\u3092\u6e2c\u5b9a\u3067\u304d\u308b\u3068\u3044\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u306e\u5b9f\u8a3c\u3092\u884c\u3063\u305f\u3002\u4eca\u56de\u306f\u7c21\u5358\u306e\u305f\u3081\u306b\u7b4b\u96fb\u7fa9\u624b\u3092\u7528\u3044\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5b9f\u9a13\u7528\u306e\u30ed\u30dc\u30c3\u30c8\u30a2\u30fc\u30e0\u3092\u7528\u3044\u305f\u3002\n\n=== \u5b9f\u9a13\u5668\u5177\n\n\u4ee5\u4e0b\u306b\u4eca\u56de\u306e\u5b9f\u9a13\u3067\u4f7f\u7528\u3057\u305f\u5b9f\u9a13\u5668\u5177\u3092\u8868\u8a18\u3059\u308b\n\n- \u30ed\u30dc\u30c3\u30c8\u30a2\u30fc\u30e0\uff1a\u8fd1\u85e4\u79d1\u5b66\u682a\u5f0f\u4f1a\u793e KXR-A5\n- \u30de\u30a4\u30b3\u30f3\uff1aArduino Uno\n- \u30b7\u30e3\u30f3\u30c8\u62b5\u6297\uff1a1\u03a9\n- \u5dee\u52d5\u5897\u5e45\u56de\u8def\n - \u30aa\u30da\u30a2\u30f3\u30d7\uff1aTexas Instrument TLC-2274\n - \u62b5\u62971: 1k\u03a9\n - \u62b5\u62972: 2k\u03a9\n- \u5206\u9285\uff1a 50g, 100g\n\n== \u5b9f\u9a13\u65b9\u6cd5\n\n#figure(image(\"assets/\u5b9f\u9a13\u5668\u5177\u69cb\u6210\u56f3.png\"), kind: image, caption: text(\"\u5b9f\u9a13\u5668\u5177\u69cb\u6210\u56f3\"))\n#pagebreak()\n\n\u4e0a\u56f3\u306e\u3088\u3046\u306b\u7b4b\u96fb\u7fa9\u624b\u3092\u6a21\u3057\u305f\u30ed\u30dc\u30c3\u30c8\u30a2\u30fc\u30e0\u306e\u30b5\u30fc\u30dc\u306e3\u3064\u3092\u4f7f\u3044\u3001\u305d\u308c\u305e\u308c\u306e\u6d88\u8cbb\u96fb\u529b\u3092\u96fb\u6d41\u3092\u8a08\u6e2c\u3059\u308b\u3053\u3068\u3067\u6e2c\u5b9a\u3057\u305f\u3002\u5404\u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u306f\u3001\u30b5\u30fc\u30dc\u306e\u96fb\u6e90\u30e9\u30a4\u30f3\u306b\u76f4\u5217\u306b\u30b7\u30e3\u30f3\u30c8\u62b5\u6297\u3092\u63a5\u7d9a\u3057\u3001\u305d\u306e\u62b5\u6297\u306e\u59cb\u7aef\u3068\u7d42\u7aef\u306e\u96fb\u5727\u3092\u5dee\u52d5\u5897\u5e45\u56de\u8def\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u30de\u30a4\u30b3\u30f3\u306b\u30a2\u30ca\u30ed\u30b0\u60c5\u5831\u3068\u3057\u3066\u53d6\u308a\u5165\u308c\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u305f\u3002\\\n\u8a08\u6e2c\u306b\u7528\u3044\u305f\u30de\u30a4\u30b3\u30f3\u306f\u3001\u5404\u30b5\u30fc\u30dc\u306e\u52d5\u4f5c\u3092\u6307\u4ee4\u3059\u308b\u30de\u30a4\u30b3\u30f3\u3068\u540c\u4e00\u306e\u3082\u306e\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u30b5\u30fc\u30dc\u306e\u52d5\u4f5c\u958b\u59cb\u3068\u307b\u3068\u3093\u3069\u540c\u6642\u306b\u8a08\u6e2c\u304c\u958b\u59cb\u3055\u308c\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3057\u305f\u3002\u3053\u3053\u3067\u30b5\u30fc\u30dc\u306e\u52d5\u4f5c\u958b\u59cb\u3068\u8a08\u6e2c\u958b\u59cb\u3068\u304c\u5b8c\u5168\u306b\u540c\u6642\u3067\u306a\u3044\u306e\u306f\u3001\u4eca\u56de\u4f7f\u7528\u3057\u305f\u30de\u30a4\u30b3\u30f3\u3067\u306f\u540c\u6642\u306b\u4e00\u3064\u306e\u30b9\u30ec\u30c3\u30c9\u3057\u304b\u5b9f\u884c\u3067\u304d\u306a\u3044\u305f\u3081\u53b3\u5bc6\u306b\u306f\u6570\u30af\u30ed\u30c3\u30af\u5206\u3060\u3051\u52d5\u4f5c\u958b\u59cb\u3068\u8a08\u6e2c\u958b\u59cb\u3068\u304c\u305a\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u3067\u3042\u308b\u3002\\\n\n=== \u624b\u9806\n\n\u672c\u7814\u7a76\u306e\u5b9f\u9a13\u3067\u306f\u4e8c\u3064\u306e\u52d5\u4f5c\u30d1\u30bf\u30fc\u30f3\u306e\u30c7\u30fc\u30bf\u3092\u30ed\u30dc\u30c3\u30c8\u30a2\u30fc\u30e0\u306b\u4ed8\u52a0\u3059\u308b\u8ca0\u8377\u3092\u5909\u3048\u306a\u304c\u3089\u53d6\u5f97\u3059\u308b\u3053\u3068\u3067\u52d5\u4f5c\u30d1\u30bf\u30fc\u30f3\u3068\u91cd\u3055\u306e\u95a2\u4fc2\u6027\u3092\u8abf\u3079\u3084\u3059\u304f\u3057\u305f\u3002\u4ee5\u4e0b\u306b\u305d\u306e\u624b\u9806\u3092\u793a\u3059\u3002\n\n+ \u8ca0\u8377\u3092\u304b\u3051\u306a\u3044\u72b6\u614b\u3067\u52d5\u4f5c\uff11\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u969b\u306e\u30b7\u30e3\u30f3\u30c8\u62b5\u6297\u306b\u304b\u304b\u308b\u96fb\u5727\u3092358Hz\u30671\u79d2\u9593\u8a08\u6e2c\u3057\u305f\u3002\u3053\u308c\u30928\u56de\u7e70\u308a\u8fd4\u3057\u305f\u3002\n+ 1\u3068\u540c\u69d8\u306e\u3053\u3068\u3092\u3001\u30ed\u30dc\u30c3\u30c8\u30a2\u30fc\u30e0\u306e\u5148\u7aef\u90e8\u5206\u306b50g\u306e\u5206\u9285\u3092\u540a\u308b\u3057\u305f\u72b6\u614b\u3067\u5b9f\u884c\u3057\u305f\u3002\n+ 1\u3068\u540c\u69d8\u306e\u3053\u3068\u3092\u3001\u30ed\u30dc\u30c3\u30c8\u30a2\u30fc\u30e0\u306e\u5148\u7aef\u90e8\u5206\u306b100g\u306e\u5206\u9285\u3092\u540a\u308b\u3057\u305f\u72b6\u614b\u3067\u5b9f\u884c\u3057\u305f\u3002\n+ \u52d5\u4f5c2\u30671\u301c3\u3068\u540c\u69d8\u306e\u3053\u3068\u3092\u5b9f\u884c\u3057\u305f\u3002\n\n== \u5b9f\u9a13\u7d50\u679c\n\n\u3053\u306e\u5b9f\u9a13\u3092\u884c\u3063\u305f\u7d50\u679c\u3001\u6b21\u306e\u56f3\u306b\u793a\u3059\u3088\u3046\u306a\u6d88\u8cbb\u96fb\u529b\u306e\u6642\u7cfb\u5217\u5909\u5316\u304c\u898b\u3089\u308c\u305f\u3002\n\n#pagebreak(weak: true)\n\n#figure(image(\"assets/servo_data/motion1_1_servo2_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo2_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo2_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo3_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo3_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo3_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo5_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo5_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_1_servo5_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo2_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo2_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo2_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo3_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo3_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo3_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo5_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo5_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion1_2_servo5_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c1\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo2_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo2_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo2_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo3_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo3_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo3_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo5_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo5_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_1_servo5_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0a\u6607\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo2_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo2_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo2_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc1\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo3_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo3_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo3_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc2\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo5_0g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u83770g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo5_50g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u837750g\uff09\"))\n#figure(image(\"assets/servo_data/motion2_2_servo5_100g.png\", height: 12em), caption: text(\"\u52d5\u4f5c2\uff08\u4e0b\u964d\uff09\u306e\u969b\u306e\u30b5\u30fc\u30dc3\u306e\u6d88\u8cbb\u96fb\u529b\uff08\u8ca0\u8377100g\uff09\"))\n\n= \u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\n\n\u5b9f\u9a13\u3067\u5f97\u3089\u308c\u305f\u4e00\u5b9a\u306e\u898f\u5247\u6027\u306e\u8a8d\u3081\u3089\u308c\u308b\u7d50\u679c\u3092\u30e2\u30c7\u30eb\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u5165\u529b\u4fe1\u53f7\u304b\u3089\u51fa\u529b\u306e\u4e88\u6e2c\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002\u305d\u306e\u305f\u3081\u306e\u624b\u6cd5\u306f\u53e4\u304f\u304b\u3089\u591a\u304f\u8003\u3048\u3089\u308c\u3066\u304d\u305f\u304c\u3001\u8a08\u7b97\u6a5f\u306e\u9ad8\u6027\u80fd\u5316\u306b\u4f34\u3044\u8fd1\u5e74\u3067\u306f\u6a5f\u68b0\u5b66\u7fd2\u3092\u7528\u3044\u305f\u624b\u6cd5\u304c\u5e83\u304f\u7814\u7a76\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002\u6a5f\u68b0\u5b66\u7fd2\u3068\u5927\u304d\u304f\u62ec\u3063\u3066\u3082\u305d\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u306f\u3044\u304f\u3064\u3082\u306e\u7a2e\u985e\u304c\u3042\u308a\u3001\u305d\u308c\u305e\u308c\u306b\u5f97\u610f\u3068\u3059\u308b\u5206\u91ce\u304c\u5b58\u5728\u3059\u308b\u3002\u4f8b\u3048\u3070Convolutional Neural Network\u3092\u7528\u3044\u305f\u6a5f\u68b0\u5b66\u7fd2\u306f\u753b\u50cf\u89e3\u6790\u306b\u9069\u3057\u3066\u3044\u308b\u304c\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u9762\u3067\u63a1\u7528\u3055\u308c\u308b\u3053\u3068\u306f\u5c11\u306a\u3044\u3002\u540c\u69d8\u306bTransformer\u306f\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u306e\u5206\u91ce\u3067\u4eca\u3084\u4e3b\u6d41\u3068\u306a\u3063\u3066\u3044\u308b\u304c\u3001\u753b\u50cf\u51e6\u7406\u306b\u306f\u9069\u3055\u306a\u3044\u3002\\\n\n== \u6982\u8981\n\n\u524d\u7ae0\u3067\u306e\u7d50\u679c\u3067\u3082\u793a\u3057\u305f\u3068\u304a\u308a\u3001\u672c\u7814\u7a76\u306e\u5b66\u7fd2\u5bfe\u8c61\u306f\u6642\u7cfb\u5217\u5909\u5316\u3059\u308b\u4fe1\u53f7\u3068\u306a\u3063\u3066\u3044\u308b\u3002\u3059\u308b\u3068\u6642\u7cfb\u5217\u5909\u5316\u3059\u308b\u4fe1\u53f7\u306e\u5b66\u7fd2\u306b\u9069\u3057\u305f\u624b\u6cd5\u304c\u5fc5\u8981\u3068\u306a\u3063\u3066\u304f\u308b\u308f\u3051\u3067\u3042\u308b\u304c\u3001\u3053\u308c\u306b\u3042\u305f\u308b\u306e\u304cRecursive Neural Network (RNN)\u3092\u7528\u3044\u305f\u6a5f\u68b0\u5b66\u7fd2\u3067\u3042\u308b\u3002\u3057\u304b\u3057\u5f93\u6765\u578b\u306eRNN\u306f\u63a8\u8ad6\u30d5\u30a7\u30fc\u30ba\u3068\u5b9f\u884c\u30d5\u30a7\u30fc\u30ba\u3068\u3082\u306b\u591a\u304f\u306e\u8a08\u7b97\u91cf\u3092\u5fc5\u8981\u3068\u3057\u3001\u3055\u3089\u306b\u5b66\u7fd2\u306e\u305f\u3081\u306b\u591a\u304f\u306e\u30c7\u30fc\u30bf\u6570\u3092\u5fc5\u8981\u3068\u3059\u308b\u3053\u3068\u304c\u77e5\u3089\u308c\u3066\u3044\u308b\u3002\u5b66\u7fd2\u306f\u3068\u3082\u304b\u304f\u3001\u7b4b\u96fb\u7fa9\u624b\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u8a08\u7b97\u6a5f\u306e\u51e6\u7406\u80fd\u529b\u3067\u63a8\u8ad6\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u884c\u308f\u308c\u308b\u3053\u3068\u304c\u7406\u60f3\u7684\u3067\u3042\u308b\u305f\u3081\u3001\u5f93\u6765\u578b\u306eRNN\u306e\u3088\u3046\u306a\u591a\u304f\u306e\u8a08\u7b97\u30ea\u30bd\u30fc\u30b9\u3092\u5fc5\u8981\u3068\u3059\u308b\u3088\u3046\u306a\u30e2\u30c7\u30eb\u3092\u63a1\u7528\u3059\u308b\u3053\u3068\u306f\u56f0\u96e3\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3002@Reservoir-Computing \\\n\u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304c\u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\uff08RC\uff09\u3067\u3042\u308b\u3002RC\u306fRNN\u306e\u4e00\u7a2e\u3067\u306f\u3042\u308b\u304c\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u5c64\u306e\u91cd\u307f\u3065\u3051\u306f\u884c\u308f\u305a\u306b\u51fa\u529b\u5c64\uff08\u30ea\u30fc\u30c9\u30a2\u30a6\u30c8\uff09\u306e\u91cd\u307f\u3065\u3051\u306e\u307f\u3092\u5b66\u7fd2\u3055\u305b\u308b\u3053\u3068\u3067\u30e2\u30c7\u30eb\u306e\u6700\u9069\u5316\u3092\u884c\u3046\u3002\u3053\u306e\u624b\u6cd5\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u591a\u304f\u306e\u30c7\u30fc\u30bf\u6570\u304c\u306a\u304f\u3068\u3082\u5341\u5206\u306a\u7cbe\u5ea6\u304c\u5f97\u3089\u308c\u308b\u5b66\u7fd2\u304c\u3067\u304d\u308b\u3053\u3068\u304c\u5148\u884c\u306e\u7814\u7a76\u3067\u660e\u3089\u304b\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u6211\u3005\u306f\u4eca\u56deRC\u3092\u7528\u3044\u3066\u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u306e\u6ce2\u5f62\u3092\u5b66\u7fd2\u3055\u305b\u3001\u7cfb\u306b\u304b\u304b\u3063\u3066\u3044\u308b\u8ca0\u8377\u3092\u4e88\u6e2c\u3059\u308b\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3002\\\nRC\u3092\u7528\u3044\u3066\u5f97\u3089\u308c\u308b\u7d50\u679c\u306f\n\n== \u8a55\u4fa1\u65b9\u6cd5\n\n\u30e2\u30c7\u30eb\u306e\u8a55\u4fa1\u306b\u306fRoot Mean Squared Error (RMSE)\u3068\u3044\u3046\u6307\u6a19\u3092\u7528\u3044\u305f\u3002\n\n=== RMSE\uff08\u5e73\u65b9\u5e73\u5747\u4e8c\u4e57\u8aa4\u5dee\uff09\n\n\u30e2\u30c7\u30eb\u51fa\u529b\u3068\u76ee\u6a19\u51fa\u529b\u304c\u5171\u306b\u9023\u7d9a\u5024\u3067\u4e0e\u3048\u3089\u308c\u308b\u6642\u7cfb\u5217\u4e88\u6e2c\u30bf\u30b9\u30af\u3084\u3001\u6642\u7cfb\u5217\u751f\u6210\u30bf\u30b9\u30af\u306e\u8aa4\u5dee\u3092\u8a55\u4fa1\u3059\u308b\u6307\u6a19\u3068\u3057\u3066RMSE\u304c\u5e83\u304f\u7528\u3044\u3089\u308c\u308b\u3002\\\n\n$ \"RMSE\" = sqrt(frac(1,T) sum_(n=1)^T norm(upright(bold(d))(n)-accent(upright(bold(y)), hat)(n) )^2_2) $\n\n\u3068\u5b9a\u7fa9\u3055\u308c\u308b\u3002\u3053\u308c\u306f\u30e2\u30c7\u30eb\u51fa\u529b\u3068\u76ee\u6a19\u51fa\u529b\u306e\u9593\u306e\u4e8c\u4e57\u8aa4\u5dee\u306e\u6642\u9593\u5e73\u5747\u306e\u5e73\u65b9\u6839\u3092\u8868\u3057\u3066\u3044\u308b\u3002\u76ee\u6a19\u51fa\u529b\u30c7\u30fc\u30bf\u306e\u7279\u5fb4\u3092\u8003\u616e\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u7570\u306a\u308b\u30c7\u30fc\u30bf\u306b\u5bfe\u3059\u308bRMSE\u306e\u5024\u3092\u6bd4\u8f03\u306b\u610f\u5473\u304c\u306a\u3044\u70b9\u306f\u6ce8\u610f\u3055\u308c\u308b\u3079\u304d\u3067\u3042\u308b\u3002\u307e\u305f\u3001RMSE\u306f\u30c7\u30fc\u30bf\u3084\u4e88\u6e2c\u5024\u306b\u5e73\u5747\u304b\u3089\u5927\u304d\u304f\u5916\u308c\u305f\u7570\u5e38\u5024\u3084\u5916\u308c\u5024\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3068\u3001\u305d\u306e\u5f71\u97ff\u3092\u5927\u304d\u304f\u53d7\u3051\u3084\u3059\u3044\u3002 @Reservoir-Computing\n\n#pagebreak(weak: true)\n\n= \u6d88\u8cbb\u96fb\u529b\u304b\u3089\u8ca0\u8377\u3092\u5b66\u7fd2\n\n3\u7ae0\u3067\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066RC\u3092\u7528\u3044\u3066\u5b66\u7fd2\u3055\u305b\u308b\u3053\u3068\u3067\u30013\u3064\u306e\u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u304b\u3089\u7cfb\u306b\u304b\u304b\u308b\u8ca0\u8377\u3092\u5272\u308a\u51fa\u3059\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3002\n\u307e\u305f\u3001\u6d88\u8cbb\u96fb\u529b\u306e\u307f\u3092\u4e0e\u3048\u305f\u3068\u3053\u308d\u3067\u8ca0\u8377\u3092\u4e88\u6e2c\u3059\u308b\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3068\u3053\u308d\u3067\u6c4e\u7528\u6027\u306b\u6b20\u3051\u308b\u3068\u3044\u3046\u4e88\u6e2c\u306e\u3082\u3068\u30013\u3064\u306e\u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u307b\u304b\u306b\u7279\u5fb4\u91cf\u3068\u3057\u3066\u305d\u308c\u305e\u308c\u306e\u30b5\u30fc\u30dc\u306e\u52d5\u4f5c\u958b\u59cb\u3068\u52d5\u4f5c\u7d42\u4e86\u89d2\u5ea6\u3001\u305d\u3057\u3066\u8a2d\u5b9a\u3057\u305f\u56de\u8ee2\u901f\u5ea6\u3092\u4e0e\u3048\u308b\u3053\u3068\u3068\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u60c5\u5831\u306f\u53d6\u5f97\u306b\u500b\u5225\u306e\u30bb\u30f3\u30b5\u306a\u3069\u306e\u6a5f\u69cb\u3092\u5fc5\u8981\u3068\u305b\u305a\u30b5\u30fc\u30dc\u5236\u5fa1\u7528\u3001\u3059\u306a\u308f\u3061RC\u63a8\u8ad6\u306b\u3082\u7528\u3044\u308b\u30de\u30a4\u30b3\u30f3\u4e0a\u3067\u53d6\u5f97\u53ef\u80fd\u306a\u30c7\u30fc\u30bf\u306e\u4e2d\u304b\u3089\u9078\u3093\u3067\u3044\u308b\u70b9\u3092\u5f37\u8abf\u3059\u308b\u3002\n\n== \u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\n\nRC\u3092\u7528\u3044\u305f\u5b66\u7fd2\u3092\u3059\u308b\u305f\u3081\u306b\u306f\u307e\u305a\u30c7\u30fc\u30bf\u3092\u5b66\u7fd2\u306b\u4f7f\u7528\u3057\u3084\u3059\u3044\u5f62\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u4eca\u56de\u306f\u30b5\u30fc\u30dc3\u3064\u306e\u6d88\u8cbb\u96fb\u529b\u306e\u6642\u7cfb\u5217\u5909\u5316\u3068\u3044\u3046\u7279\u5fb4\u91cf\u306b\u52a0\u3048\u3066\u3001\u30b5\u30fc\u30dc\u305d\u308c\u305e\u308c\u306e\u521d\u671f\u89d2\u5ea6\u3001\u7d42\u4e86\u89d2\u5ea6\u3001\u305d\u3057\u3066\u8a2d\u5b9a\u901f\u5ea6\u3092\u6a2a\u4e26\u3073\u306b\u3059\u308b\u3053\u3068\u30c7\u30fc\u30bf\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u3057\u305f\u3002\u307e\u305f\u3001\u6700\u5f8c\u306b\u30e9\u30d9\u30eb\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u8ca0\u8377\u91cd\u91cf\u3092\u8a18\u8f09\u3059\u308b\u3053\u3068\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u6559\u5e2b\u30e9\u30d9\u30eb\u3068\u3057\u3066\u6271\u3044\u3084\u3059\u3044\u5f62\u306b\u3057\u305f\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u306f\u3053\u308c\u309248\u500b\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5206\u3051\u3001\u5168\u30c7\u30fc\u30bf\u6570\u309248\u500b\u3068\u3057\u3001\u305d\u306e\u3046\u306138\u500b\u3092\u8a13\u7df4\u30c7\u30fc\u30bf\u3068\u3057\u3066\u300110\u500b\u3092\u8a55\u4fa1\u7528\u30c7\u30fc\u30bf\u3068\u3057\u3066\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002\n\n#pagebreak(weak: true)\n#figure(image(\"assets/\u524d\u51e6\u7406\u30c7\u30fc\u30bf.png\"), caption: text(\"\u30ea\u30b6\u30d0\u30fc\u5b66\u7fd2\u306b\u3092\u3055\u305b\u308b\u969b\u306b\u7528\u3044\u305f\u30c7\u30fc\u30bf\u69cb\u9020\"), kind: table)\n#pagebreak(weak: true)\n\n== \u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u5404\u7a2e\u8a2d\u5b9a\n\n\u5b9f\u306fRC\u306b\u3082\u3055\u307e\u3056\u307e\u306a\u65b9\u6cd5\u304c\u63d0\u6848\u3055\u308c\u3066\u3044\u308b\u3002Echo State Network (ESN), Liquid State Machine (LSM), FORCE\u306a\u3069\u304c\u4e00\u822c\u7684\u3067\u3042\u308b\u304c\u3001\u4eca\u56de\u306f\u6700\u3082\u30b7\u30f3\u30d7\u30eb\u3067\u5b9f\u88c5\u306e\u7c21\u5358\u306aESN\u3092\u63a1\u7528\u3059\u308b\u3053\u3068\u3068\u3057\u305f\u3002ESN\u306fEcho State Property\u3092\u6e80\u305f\u3059\u30ea\u30b6\u30d0\u30fc\u5c64\u306b\u5165\u529b\u3092\u4e0e\u3048\u3001\u30ea\u30fc\u30c9\u30a2\u30a6\u30c8\u306e\u91cd\u307f\u3065\u3051\u3092\u7dda\u5f62\u56de\u5e30\u3092\u7528\u3044\u3066\u5b66\u7fd2\u3055\u305b\u308b\u70b9\u304b\u3089\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u3067\u3042\u308b\u305f\u3081RC\u3092\u4f7f\u7528\u3059\u308b\u4e0a\u3067\u5e83\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u3002@FORCE\n\n=== \u30ea\u30b6\u30d0\u30fc\u5c64\n\n\u30ea\u30b6\u30d0\u30fc\u5c64\u306b\u306f Leaky Integrator \u306b\u3088\u3063\u3066\u69cb\u6210\u3055\u308c\u305f\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u3092\u7528\u3044\u305f\u3002\u30ea\u30fc\u30af\u7387\u306f1\u3001\u30ea\u30ab\u30ec\u30f3\u30c8\u7d50\u5408\u91cd\u307f\u884c\u5217\u306e\u30b9\u30da\u30af\u30c8\u30eb\u534a\u5f84\u306f0.95\u3001\u6d3b\u6027\u5316\u95a2\u6570\u306b\u306f\u30cf\u30a4\u30d1\u30dc\u30ea\u30c3\u30af\u30bf\u30f3\u30b8\u30a7\u30f3\u30c8\u3092\u7528\u3044\u305f\u3002\u30ce\u30fc\u30c9\u6570\u306f\u7279\u5fb4\u91cf\u306e\u6570\u3088\u308a\u3082\u5341\u5206\u306b\u5927\u304d\u3044100\u306b\u8a2d\u5b9a\u3057\u305f\u3002 @Intrinsic-Plasticity\n\n// ==== \u9069\u5207\u306a\u30ce\u30fc\u30c9\u6570\u306e\u8abf\u67fb\n\n// \u30ea\u30b6\u30d0\u30fc\u5c64\u306e\u30ce\u30fc\u30c9\u6570\u306f\u5b66\u7fd2\u306e\u7cbe\u5ea6\u3068\u305d\u306e\u901f\u5ea6\u3001\u305d\u3057\u3066\u63a8\u8ad6\u30d5\u30a7\u30fc\u30ba\u3067\u306e\u901f\u5ea6\u3092\u6c7a\u5b9a\u3059\u308b\u305f\u3081\u975e\u5e38\u306b\u91cd\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3042\u308b\u3002\u672c\u7814\u7a76\u306f\u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u304b\u3089\u7cfb\u306b\u304b\u304b\u3063\u3066\u3044\u308b\u8ca0\u8377\u304c\u63a8\u8ad6\u3067\u304d\u308b\u304b\u3068\u3044\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u306e\u5b9f\u8a3c\u304c\u672c\u984c\u3067\u306f\u3042\u308b\u304c\u3001\u7b4b\u96fb\u7fa9\u624b\u3067\u4f7f\u7528\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u5341\u5206\u306b\u5c11\u306a\u3044\u30ce\u30fc\u30c9\u6570\u3067\u63a8\u8ad6\u3067\u304d\u306a\u3051\u308c\u3070\u5b9f\u884c\u30b9\u30d4\u30fc\u30c9\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3002\u305d\u3053\u3067\u6b21\u306e\u3088\u3046\u306a\u5b9f\u9a13\u3092\u884c\u3046\u3053\u3068\u3067\u4eca\u56de\u306e\u30c7\u30fc\u30bf\u306b\u9069\u5207\u306a\u30ce\u30fc\u30c9\u6570\u3092\u8abf\u67fb\u3057\u305f\u3002\n\n// ===== \u5b9f\u9a13\u65b9\u6cd5\n\n// \u30ea\u30b6\u30d0\u30fc\u5c64\u306e\u30ce\u30fc\u30c9\u6570\u30925\u304b\u3089100\u306b\u5909\u5316\u3055\u305b\u305f\u6642\u306eRMSE\u306e\u5024\u3092\u6bd4\u8f03\u3057\u305f\u3002\u305f\u3060\u3057\u300148\u500b\u306e\u30c7\u30fc\u30bf\u30928\u5bfe2\u306e\u5272\u5408\u3067\u5b66\u7fd2\u7528\u3068\u8a55\u4fa1\u7528\u306e\u30c7\u30fc\u30bf\u306b\u30e9\u30f3\u30c0\u30e0\u306b\u5206\u3051\u3066\u304b\u3089\u5b66\u7fd2\u3068\u8a55\u4fa1\u3092\u884c\u3046\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u5b9f\u884c\u3054\u3068\u306b\u7d50\u679c\u304c\u5909\u308f\u3063\u3066\u304f\u308b\u3002\u3053\u306e\u5909\u5316\u3092\u9451\u307f\u3066\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306b\u305d\u308c\u305e\u308c\u306e\u30ce\u30fc\u30c9\u6570\u30671000\u56de\u306e\u5b66\u7fd2\u3068\u8a55\u4fa1\u3092\u884c\u3044\u3001\u305d\u306eRMSE\u306e\u5e73\u5747\u3092\u3068\u3063\u305f\u3002\u3053\u306eRMSE\u306e\u5e73\u5747\u3068\u30ea\u30b6\u30d0\u30fc\u5c64\u306e\u30ce\u30fc\u30c9\u6570\u3068\u306e\u95a2\u4fc2\u304c\u6b21\u306e\u56f3\u306e\u901a\u308a\u3067\u3042\u308b\u3002\n\n\n// ===== \u5b9f\u9a13\u7d50\u679c\n\n// #figure(image(\"assets/node_vs_rmse.png\"), caption: text(\"RMSE\u306e\u5e73\u5747\u306e\u30ce\u30fc\u30c9\u6570\u3068\u306e\u4f9d\u5b58\u95a2\u4fc2\"))\n// #pagebreak(weak: true)\n\n// 48\u500b\u306e\u30c7\u30fc\u30bf\u30928\u5bfe2\u306e\u5272\u5408\u3067\u5206\u3051\u3066\u3044\u308b\u305f\u3081\u5b66\u7fd2\u7528\u306e\u30c7\u30fc\u30bf\u306f38\u500b\u3067\u3042\u308b\u3002\u3053\u306e\u56f3\u304b\u3089\u898b\u3066\u53d6\u308c\u308b\u901a\u308a\u3001\u30ce\u30fc\u30c9\u6570\u304c38\u500b\u306b\u8fd1\u3065\u304f\u306b\u3064\u308c\u3066RMSE\u304c\u6025\u6fc0\u306b\u5897\u52a0\u3057\u3066\u304a\u308a\u3001\u305d\u3053\u304b\u3089\u96e2\u308c\u308b\u306b\u3064\u308c\u3066\u6e1b\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002\u3053\u306e\u73fe\u8c61\u306fdouble descent\u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3002 @double-descent\n\n// ===== \u8003\u5bdf\n\n// \u3053\u306e\u5b9f\u9a13\u304b\u3089\u3001\u8a2d\u5b9a\u3059\u3079\u304d\u30ce\u30fc\u30c9\u6570\u306f\u5b66\u7fd2\u7528\u30c7\u30fc\u30bf\u306e\u30c7\u30fc\u30bf\u9577\u3088\u308a\u3082\u5927\u304d\u304f\u3059\u308b\u3053\u3068\u304cRC\u5b66\u7fd2\u306b\u306f\u9069\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002\n\n=== \u30ea\u30fc\u30c9\u30a2\u30a6\u30c8\u5c64\n\n\u6b21\u306b\u30ea\u30fc\u30c9\u30a2\u30a6\u30c8\u5c64\u306e\u91cd\u307f\u3065\u3051\u306e\u5b66\u7fd2\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3059\u308b\u3002\u4eca\u56de\u306fESN\u3092\u7528\u3044\u308b\u305f\u3081\u7dda\u5f62\u56de\u5e30\u3067\u306e\u91cd\u307f\u3065\u3051\u5b66\u7fd2\u3092\u884c\u3063\u305f\u306e\u3060\u304c\u3001\u5916\u308c\u5024\u306e\u5f71\u97ff\u3092\u5fc5\u8981\u4ee5\u4e0a\u306b\u5927\u304d\u304f\u3059\u308b\u3053\u3068\u3092\u907f\u3051\u308b\u305f\u3081\u306bRidge\u56de\u5e30\u3092\u7528\u3044\u305f\u3002\u6b63\u5247\u5316\u30d1\u30e9\u30e1\u30fc\u30bf\u306f $1.0 times 10^(-3)$\u306b\u8a2d\u5b9a\u3057\u305f\u3002 @Ridge\n\n== \u5b66\u7fd2\u7d50\u679c\n\n\u4ee5\u4e0b\u304c\u3053\u306e\u5b66\u7fd2\u3092\u884c\u3063\u305f\u7d50\u679c\u3067\u3042\u308b\u3002\n\n#figure(align(left, (image(\"assets/training_set_predictions_rmse_36.05610294846806.png\", width: 180%))), caption: text(\"\u63a8\u8ad6\u30e2\u30c7\u30eb\u3067\u5b66\u7fd2\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4e88\u6e2c\u3092\u3055\u305b\u305f\u7d50\u679c\"))\n#pagebreak(weak: true)\n#figure(align(left, (image(\"assets/test_set_predictions_rmse_30.560928118691546.png\", width: 180%))), caption: text(\"\u63a8\u8ad6\u30e2\u30c7\u30eb\u3067\u8a55\u4fa1\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4e88\u6e2c\u3092\u3055\u305b\u305f\u7d50\u679c\"))\n#pagebreak(weak: true)\n== \u8003\u5bdf\n\n\u5b66\u7fd2\u7528\u30c7\u30fc\u30bf\u3092\u7528\u3044\u3066\u306e\u8a55\u4fa1\u4e26\u3073\u306b\u8a55\u4fa1\u7528\u30c7\u30fc\u30bf\u3092\u7528\u3044\u3066\u306e\u63a8\u8ad6\u306eRMSE\u306f\u3069\u3061\u3089\u308230\u3092\u8d85\u3048\u308b\u3082\u306e\u3068\u306a\u3063\u305f\u3002\u307e\u305f\u3001\u4e21\u8005\u306b\u304a\u3044\u3066\u4e88\u6e2c\u5024\u3068\u5b9f\u969b\u306e\u5024\u306e\u5dee\u304c\u5927\u304d\u3044\u3053\u3068\u304c\u898b\u3066\u53d6\u308c\u308b\u3002\u3053\u308c\u306f\u5b66\u7fd2\u624b\u6cd5\u81ea\u4f53\u304c\u4e0d\u5341\u5206\u306a\u3082\u306e\u3067\u3042\u308b\u3053\u3068\u304c\u539f\u56e0\u3068\u8003\u3048\u3089\u308c\u308b\u3002\u4e00\u756a\u306e\u7279\u7b46\u3059\u3079\u304d\u70b9\u3068\u3057\u3066\u306f\u91cd\u91cf\u306a\u3057\u306e\u5b66\u7fd2\u30c7\u30fc\u30bf\u3068\u91cd\u91cf50g\u3001\u305d\u3057\u3066100g\u306e\u30c7\u30fc\u30bf\u3068\u3067\u306f\u30c7\u30fc\u30bf\u306e\u6570\u306f\u540c\u3058\u3067\u3042\u308b\u306b\u3082\u304b\u304b\u308f\u3089\u305a\u3001\u63a8\u8ad6\u306e\u7d50\u679c0g\u4ed8\u8fd1\u3092\u307b\u3068\u3093\u3069\u4e88\u6e2c\u3067\u304d\u3066\u3044\u306a\u3044\u70b9\u3067\u3042\u308b\u3002\u3053\u308c\u306f\u5b66\u7fd2\u624b\u6cd5\u306b\u8aa4\u308a\u304c\u3042\u3063\u305f\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u308b\u3068\u8003\u3048\u3089\u308c\u308b\u3002\n\n#pagebreak(weak: true)\n\n= \u307e\u3068\u3081\n\n\u7b4b\u96fb\u7fa9\u624b\u306e\u64cd\u4f5c\u6027\u5411\u4e0a\u306b\u5fc5\u8981\u3068\u306a\u3063\u3066\u304f\u308b\u529b\u899a\u306e\u691c\u77e5\u3092\u884c\u3046\u65b9\u6cd5\u3068\u3057\u3066\u3001\u7fa9\u624b\u5185\u306b\u642d\u8f09\u3055\u308c\u308b\u3053\u3068\u306e\u591a\u3044\u30b5\u30fc\u30dc\u306e\u6d88\u8cbb\u96fb\u529b\u3092\u7528\u3044\u308b\u624b\u6cd5\u306e\u59a5\u5f53\u6027\u306b\u3064\u3044\u3066\u691c\u8a0e\u3057\u305f\u3002\u7b4b\u96fb\u7fa9\u624b\u306b\u304a\u3051\u308b\u30b5\u30fc\u30dc\u3068\u3044\u3046\u306e\u306f\u751f\u4f53\u306b\u304a\u3051\u308b\u7b4b\u8089\u306e\u3088\u3046\u306b\u3001\u4f4d\u7f6e\u3092\u79fb\u52d5\u3055\u305b\u308b\u80fd\u529b\u3092\u6301\u3061\u306a\u304c\u3089\u5916\u529b\u304c\u52a0\u3048\u3089\u308c\u305f\u969b\u306b\u305d\u306e\u5927\u304d\u3055\u306b\u5bfe\u5fdc\u3059\u308b\u53cd\u5fdc\u3092\u793a\u3059\u3002\u305d\u306e\u985e\u4f3c\u6027\u306f\u65e5\u9803\u306e\u611f\u899a\u3068\u3057\u3066\u306f\u8ab0\u3057\u3082\u304c\u6c17\u3065\u304f\u4f59\u5730\u3042\u308b\u3082\u306e\u3067\u306f\u3042\u308b\u3002\u672c\u7814\u7a76\u3092\u901a\u3057\u3066\u3053\u306e\u985e\u4f3c\u6027\u3092\u793a\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u78ba\u8a8d\u306e\u305f\u3081\u306e\u5b9f\u9a13\u3092\u91cd\u306d\u305f\u304c\u3001\u6709\u610f\u306a\u985e\u4f3c\u6027\u3092\u793a\u3059\u306b\u306f\u81f3\u3089\u306a\u304b\u3063\u305f\u3002\\\n\u3057\u304b\u3057\u73fe\u6642\u70b9\u3067\u624b\u6cd5\u81ea\u4f53\u304c\u9593\u9055\u3063\u3066\u3044\u308b\u3068\u7d50\u8ad6\u3065\u3051\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3002\u30c7\u30fc\u30bf\u306e\u4e0e\u3048\u65b9\u3084\u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u5b9f\u88c5\u3084\u8a2d\u5b9a\u306e\u63a8\u6572\u3092\u91cd\u306d\u308b\u3053\u3068\u3067\u3001\u672c\u6765\u884c\u3044\u305f\u304b\u3063\u305f\u5b9f\u9a13\u306e\u7d50\u679c\u3092\u5f97\u3089\u308c\u308b\u53ef\u80fd\u6027\u306f\u5927\u3044\u306b\u6b8b\u3063\u3066\u3044\u308b\u3068\u8003\u3048\u3089\u308c\u308b\u3002\n\n#set heading(numbering: none)\n\n= \u8b1d\u8f9e\n\n\u672c\u7814\u7a76\u3092\u9032\u3081\u308b\u306b\u3042\u305f\u308a\u3001\u591a\u5927\u306a\u3054\u6307\u5c0e\u3001\u3054\u52a9\u8a00\u3092\u9802\u3044\u305f\u845b\u897f\u8aa0\u4e5f\u6559\u6388\u3092\u306f\u3058\u3081\u3068\u3059\u308b\u5de5\u5b66\u90e8\u60c5\u5831\u30a8\u30ec\u30af\u30c8\u30ed\u30cb\u30af\u30b9\u5b66\u79d1\u91cf\u5b50\u77e5\u80fd\u30c7\u30d0\u30a4\u30b9\u7814\u7a76\u5ba4\u306e\u69cb\u6210\u54e1\u306e\u7686\u69d8\u306b\u6df1\u8b1d\u306e\u610f\u3092\u8868\u3057\u307e\u3059\u3002\u5e38\u306b\u697d\u3092\u3057\u3088\u3046\u3068\u5815\u843d\u306e\u65b9\u5411\u3078\u5411\u304b\u3046\u79c1\u306b\u59a5\u5354\u3092\u8a31\u3055\u305a\u7814\u947d\u306e\u65e5\u3005\u3092\u4fc3\u3057\u3066\u4e0b\u3055\u3063\u305f\u845b\u897f\u6559\u6388\u306f\u3082\u3061\u308d\u3093\u3001\u3054\u81ea\u8eab\u304c\u4fee\u58eb\u8ad6\u6587\u7814\u7a76\u3084\u5b66\u4f1a\u767a\u8868\u3001\u5c31\u8077\u6d3b\u52d5\u7b49\u3067\u304a\u5fd9\u3057\u3044\u306b\u3082\u95a2\u308f\u3089\u305a\u9032\u3093\u3067\u7814\u7a76\u5185\u5bb9\u3084\u767a\u8868\u8cc7\u6599\u306e\u6821\u95b2\u3001\u7684\u78ba\u306a\u52a9\u8a00\u3092\u304f\u3060\u3055\u3063\u305f\u4fee\u58eb2\u5e74\u5409\u7530\u8056\u6c0f\u3001\u4fee\u58eb1\u5e74\u677e\u7530\u4e00\u5e0c\u6c0f\u306b\u6df1\u8b1d\u306e\u610f\u3092\u8868\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u65e5\u9803\u304b\u3089\u3054\u6307\u5c0e\u3001\u3054\u610f\u898b\u3092\u9802\u3044\u305f\u3001\u91cf\u5b50\u96c6\u7a4d\u30a8\u30ec\u30af\u30c8\u30ed\u30cb\u30af\u30b9\u7814\u7a76\u30bb\u30f3\u30bf\u30fc\u9577\u3067\u3042\u3089\u308c\u308b\u672c\u4e45\u9806\u4e00\u6559\u6388\u3001\u5148\u9032\u30ca\u30ce\u96fb\u5b50\u6750\u6599\u7814\u7a76\u5ba4\u306e\u77f3\u5ddd\u53f2\u592a\u90ce\u6559\u6388\u3001\u539f\u771f\u4e8c\u90ce\u51c6\u6559\u6388\u3001\u91cf\u5b50\u77e5\u80fd\u30c7\u30d0\u30a4\u30b9\u7814\u7a76\u5ba4\u306e\u4f50\u85e4\u5a01\u53cb\u51c6\u6559\u6388\u3001\u6a5f\u80fd\u901a\u4fe1\u30bb\u30f3\u30b7\u30f3\u30b0\u7814\u7a76\u5ba4\u306e\u6c60\u8fba\u5c06\u4e4b\u6559\u6388\u3001\u8d64\u6fa4\u6b63\u9053\u51c6\u6559\u6388\u3001\u96c6\u7a4d\u96fb\u5b50\u30c7\u30d0\u30a4\u30b9\u7814\u7a76\u5ba4\u306e\u51a8\u5ca1\u514b\u5e83\u51c6\u6559\u6388\u306b\u6df1\u304f\u611f\u8b1d\u81f4\u3057\u307e\u3059\u3002\n\n#heading(numbering: none, text(\"Appendix\"))\n\n\u4ee5\u4e0b\u306bRC\u3067\u5b66\u7fd2\u3092\u884c\u3063\u305f\u969b\u306b\u7528\u3044\u305f\u30b3\u30fc\u30c9\u3092\u793a\u3059\u3002\n\n```python\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport japanize_matplotlib\nfrom sklearn.model_selection import train_test_split\n\nimport model\n\nBASE_PATH: str = \"data/\"\nfile_011_name: str = \"0g_1_1.csv\"\nfile_012_name: str = \"0g_1_2.csv\"\nfile_013_name: str = \"0g_1_3.csv\"\nfile_014_name: str = \"0g_1_4.csv\"\nfile_015_name: str = \"0g_1_5.csv\"\nfile_016_name: str = \"0g_1_6.csv\"\nfile_017_name: str = \"0g_1_7.csv\"\nfile_018_name: str = \"0g_1_8.csv\"\n\nfile_021_name: str = \"0g_2_1.csv\"\nfile_022_name: str = \"0g_2_2.csv\"\nfile_023_name: str = \"0g_2_3.csv\"\nfile_024_name: str = \"0g_2_4.csv\"\nfile_025_name: str = \"0g_2_5.csv\"\nfile_026_name: str = \"0g_2_6.csv\"\nfile_027_name: str = \"0g_2_7.csv\"\nfile_028_name: str = \"0g_2_8.csv\"\n\nfile_5011_name: str = \"50g_1_1.csv\"\nfile_5012_name: str = \"50g_1_2.csv\"\nfile_5013_name: str = \"50g_1_3.csv\"\nfile_5014_name: str = \"50g_1_4.csv\"\nfile_5015_name: str = \"50g_1_5.csv\"\nfile_5016_name: str = \"50g_1_6.csv\"\nfile_5017_name: str = \"50g_1_7.csv\"\nfile_5018_name: str = \"50g_1_8.csv\"\n\nfile_5021_name: str = \"50g_2_1.csv\"\nfile_5022_name: str = \"50g_2_2.csv\"\nfile_5023_name: str = \"50g_2_3.csv\"\nfile_5024_name: str = \"50g_2_4.csv\"\nfile_5025_name: str = \"50g_2_5.csv\"\nfile_5026_name: str = \"50g_2_6.csv\"\nfile_5027_name: str = \"50g_2_7.csv\"\nfile_5028_name: str = \"50g_2_8.csv\"\n\nfile_10011_name: str = \"100g_1_1.csv\"\nfile_10012_name: str = \"100g_1_2.csv\"\nfile_10013_name: str = \"100g_1_3.csv\"\nfile_10014_name: str = \"100g_1_4.csv\"\nfile_10015_name: str = \"100g_1_5.csv\"\nfile_10016_name: str = \"100g_1_6.csv\"\nfile_10017_name: str = \"100g_1_7.csv\"\nfile_10018_name: str = \"100g_1_8.csv\"\n\nfile_10021_name: str = \"100g_2_1.csv\"\nfile_10022_name: str = \"100g_2_2.csv\"\nfile_10023_name: str = \"100g_2_3.csv\"\nfile_10024_name: str = \"100g_2_4.csv\"\nfile_10025_name: str = \"100g_2_5.csv\"\nfile_10026_name: str = \"100g_2_6.csv\"\nfile_10027_name: str = \"100g_2_7.csv\"\nfile_10028_name: str = \"100g_2_8.csv\"\n\n\ndef convert_data_frames_to_numpys(\n data_frames: list[pd.DataFrame],\n) -> np.ndarray[np.float64]:\n # \u3042\u3089\u304b\u3058\u3081\u7a7a\u306e\u30ea\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3066\u304a\u304f\n new_data = np.empty(\n (len(data_frames), data_frames[0].columns.size, data_frames[0].shape[0]),\n dtype=np.float64,\n )\n\n for i in range(len(data_frames)):\n for j in range(data_frames[i].columns.size):\n new_data[i][j] = data_frames[i][j].values\n return new_data\n\n\ndef get_merged_matrix(\n list_of_files: list[str],\n) -> tuple[np.ndarray[np.float64], np.ndarray[np.float64]]:\n data_frames = [\n pd.read_csv(BASE_PATH + file, header=None, skiprows=1) for file in list_of_files\n ]\n training_frames, testing_frames = train_test_split(data_frames, test_size=0.2)\n\n train_data_set = convert_data_frames_to_numpys(training_frames)\n test_data_set = convert_data_frames_to_numpys(testing_frames)\n return train_data_set, test_data_set\n\n\ntrain_data, test_data = get_merged_matrix(\n [\n file_011_name,\n file_012_name,\n file_013_name,\n file_014_name,\n file_015_name,\n file_016_name,\n file_017_name,\n file_018_name,\n file_021_name,\n file_022_name,\n file_023_name,\n file_024_name,\n file_025_name,\n file_026_name,\n file_027_name,\n file_028_name,\n file_5011_name,\n file_5012_name,\n file_5013_name,\n file_5014_name,\n file_5015_name,\n file_5016_name,\n file_5017_name,\n file_5018_name,\n file_5021_name,\n file_5022_name,\n file_5023_name,\n file_5024_name,\n file_5025_name,\n file_5026_name,\n file_5027_name,\n file_5028_name,\n file_10011_name,\n file_10012_name,\n file_10013_name,\n file_10014_name,\n file_10015_name,\n file_10016_name,\n file_10017_name,\n file_10018_name,\n file_10021_name,\n file_10022_name,\n file_10023_name,\n file_10024_name,\n file_10025_name,\n file_10026_name,\n file_10027_name,\n file_10028_name,\n ]\n)\n\n# Extract the load data from the training set. the last arrays of every set are the repeated load data. pick the first one of the last arrays and make it the load data\ntrain_load: np.ndarray[np.float64] = np.array(\n [train_data[i][-1][0] for i in range(len(train_data))], dtype=np.float64\n)\ntest_load: np.ndarray[np.float64] = np.array(\n [test_data[i][-1][0] for i in range(len(test_data))], dtype=np.float64\n)\n\n\n# erase the last arrays of every set to make the training data does not include load data at the end\n# and transpose the data to make it compatible with the ESN model\ntrain_data = train_data[:, :-1, :].transpose(0, 2, 1)\ntest_data = test_data[:, :-1, :].transpose(0, 2, 1)\n\n# Reshape the load data to make it compatible with the RMSE calculation that is for example, (38,) to (38,358)\ntrain_load_reshaped = np.tile(train_load, (train_data.shape[1], 1)).T.reshape(-1, 1)\ntest_load_reshaped = np.tile(test_load, (test_data.shape[1], 1)).T.reshape(-1, 1)\n\n# Initialize the ESN model\ninput_size = train_data.shape[1] # Number of data points in each sample\nreservoir_size = 100 # Size of the reservoir\noutput_size = 1 # Predicting a single value (Load)\n\nesn = model.ESN(N_u=input_size, N_y=output_size, N_x=reservoir_size)\n\n# Train the ESN model\nesn.train(\n train_data,\n train_load,\n model.Tikhonov(N_x=reservoir_size, N_y=output_size, beta=1e-3),\n)\n\n# Predict using the trained model (for demonstration, use the training data itself)\ntrain_predictions: np.ndarray[float] = esn.predict(train_data)\n\n# Evaluate the model by computing the mean squared error on the training data\ntrain_rmse: float = np.sqrt(((train_predictions - train_load_reshaped) ** 2).mean())\n\n# Predict using the trained model\ntest_predictions: np.ndarray[float] = esn.predict(test_data)\n\n# Evaluate the model by computing the mean squared error on the training data\ntest_rmse: float = np.sqrt(((test_predictions - test_load_reshaped) ** 2).mean())\n\nprint(\"Training RMSE: \", train_rmse)\n\nflattened_predictions = test_predictions.flatten()\n\nplt.figure(figsize=(12, 6))\nplt.subplot(1, 2, 1)\nplt.scatter(\n x=range(len(train_load_reshaped)), y=train_load_reshaped, label=\"\u5b9f\u969b\u306e\u8cea\u91cf\", alpha=0.6\n)\nplt.scatter(\n x=range(len(train_predictions)), y=train_predictions, label=\"\u63a8\u8ad6\u5024\", alpha=0.6\n)\nplt.title(\"\u5b66\u7fd2\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306e\u63a8\u8ad6\")\nplt.xlabel(\"\u8a66\u884c\")\nplt.ylabel(\"\u8ca0\u8377\u8cea\u91cf\u30fb\u63a8\u8ad6\u5024 (g)\")\nplt.legend()\n\nplt.tight_layout()\nplt.savefig(f'saved_graphs/training_set_predictions_rmse_{train_rmse}.png')\nplt.show()\n\nprint(\"Test RMSE: \", test_rmse)\n\nplt.figure(figsize=(12, 6))\nplt.subplot(1, 2, 1)\nplt.scatter(\n x=range(len(test_load_reshaped)), y=test_load_reshaped, label=\"\u5b9f\u969b\u306e\u8cea\u91cf\", alpha=0.6\n)\nplt.scatter(\n x=range(len(test_predictions)), y=test_predictions, label=\"\u63a8\u8ad6\u5024\", alpha=0.6\n)\nplt.title(\"\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306e\u63a8\u8ad6\")\nplt.xlabel(\"\u8a66\u884c\")\nplt.ylabel(\"\u8ca0\u8377\u8cea\u91cf\u30fb\u63a8\u8ad6\u5024 (g)\")\nplt.legend()\n\nplt.tight_layout()\nplt.savefig(f'saved_graphs/test_set_predictions_rmse_{test_rmse}.png')\nplt.show()\n\n```\n\n#pagebreak()\n\u4ee5\u4e0b\u306b\u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u30e2\u30c7\u30eb\u3092\u793a\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u308c\u306f\u7530\u4e2d\uff0c\u4e2d\u6839\uff0c\u5ee3\u702c\uff08\u8457\uff09\u300c\u30ea\u30b6\u30d0\u30fc\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u300d\uff08\u68ee\u5317\u51fa\u7248\uff09\u5185\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3092\u4e00\u90e8\u6539\u5909\u3057\u305f\u3082\u306e\u3067\u3042\u308a\u3001\u672c\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u8457\u4f5c\u6a29\u306f\u7530\u4e2d\u525b\u5e73\u5148\u751f\u306b\u5e30\u5c5e\u3059\u308b\u3053\u3068\u3092\u660e\u8a18\u3057\u3066\u304a\u304f\u3002\n\n```python\nimport numpy as np\nimport networkx as nx\n\n\n# \u6052\u7b49\u5199\u50cf\ndef identity(x):\n return x\n\n\n# \u30ea\u30b6\u30d0\u30fc\nclass Reservoir:\n # \u30ea\u30ab\u30ec\u30f3\u30c8\u7d50\u5408\u91cd\u307f\u884c\u5217W\u306e\u521d\u671f\u5316\n def __init__(self, N_x, density, rho, activation_func, leaking_rate, seed=0):\n \"\"\"\n param N_x: \u30ea\u30b6\u30d0\u30fc\u306e\u30ce\u30fc\u30c9\u6570\n param density: \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u7d50\u5408\u5bc6\u5ea6\n param rho: \u30ea\u30ab\u30ec\u30f3\u30c8\u7d50\u5408\u91cd\u307f\u884c\u5217\u306e\u30b9\u30da\u30af\u30c8\u30eb\u534a\u5f84\n param activation_func: \u30ce\u30fc\u30c9\u306e\u6d3b\u6027\u5316\u95a2\u6570\n param leaking_rate: leaky integrator\u30e2\u30c7\u30eb\u306e\u30ea\u30fc\u30af\u7387\n param seed: \u4e71\u6570\u306e\u7a2e\n \"\"\"\n self.seed = seed\n self.W = self.make_connection(N_x, density, rho)\n self.x = np.zeros(N_x) # \u30ea\u30b6\u30d0\u30fc\u72b6\u614b\u30d9\u30af\u30c8\u30eb\u306e\u521d\u671f\u5316\n self.activation_func = activation_func\n self.alpha = leaking_rate\n\n # \u30ea\u30ab\u30ec\u30f3\u30c8\u7d50\u5408\u91cd\u307f\u884c\u5217\u306e\u751f\u6210\n def make_connection(self, N_x, density, rho):\n # Erdos-Renyi\u30e9\u30f3\u30c0\u30e0\u30b0\u30e9\u30d5\n m = int(N_x * (N_x - 1) * density / 2) # \u7dcf\u7d50\u5408\u6570\n G = nx.gnm_random_graph(N_x, m, self.seed)\n\n # \u884c\u5217\u3078\u306e\u5909\u63db(\u7d50\u5408\u69cb\u9020\u306e\u307f\uff09\n connection = nx.DiGraph(G)\n W = np.array(connection)\n\n # \u975e\u30bc\u30ed\u8981\u7d20\u3092\u4e00\u69d8\u5206\u5e03\u306b\u5f93\u3046\u4e71\u6570\u3068\u3057\u3066\u751f\u6210\n rec_scale = 1.0\n np.random.seed(seed=self.seed)\n W = W * np.random.uniform(-rec_scale, rec_scale, (N_x, N_x))\n\n # \u30b9\u30da\u30af\u30c8\u30eb\u534a\u5f84\u306e\u8a08\u7b97\n eigv_list = np.linalg.eig(W)[0]\n sp_radius = np.max(np.abs(eigv_list))\n\n # \u6307\u5b9a\u306e\u30b9\u30da\u30af\u30c8\u30eb\u534a\u5f84rho\u306b\u5408\u308f\u305b\u3066\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\n W *= rho / sp_radius\n\n return W\n\n # \u30ea\u30b6\u30d0\u30fc\u72b6\u614b\u30d9\u30af\u30c8\u30eb\u306e\u66f4\u65b0\n def __call__(self, x_in: np.ndarray):\n \"\"\"\n param x_in: \u66f4\u65b0\u524d\u306e\u72b6\u614b\u30d9\u30af\u30c8\u30eb\n return: \u66f4\u65b0\u5f8c\u306e\u72b6\u614b\u30d9\u30af\u30c8\u30eb\n \"\"\"\n # self.x = self.x.reshape(-1, 1)\n self.x = (1.0 - self.alpha) * self.x + self.alpha * self.activation_func(\n np.dot(self.W, self.x)\n + x_in # self.x \u306f reservoir \u306e\u30ce\u30fc\u30c9\u6570 (N_x) \u306e\u6b21\u5143\u3092\u6301\u3064\u30d9\u30af\u30c8\u30eb\u306a\u306e\u3067\u3001np.dot(self.W, self.x) \u306f\u5fc5\u305a (N_x,) \u306e\u30d9\u30af\u30c8\u30eb\u306b\u306a\u308b\u3002\n )\n return self.x\n\n # \u30ea\u30b6\u30d0\u30fc\u72b6\u614b\u30d9\u30af\u30c8\u30eb\u306e\u521d\u671f\u5316\n def reset_reservoir_state(self):\n self.x *= 0.0\n\n\n# \u51fa\u529b\u5c64\nclass Output:\n # \u51fa\u529b\u7d50\u5408\u91cd\u307f\u884c\u5217\u306e\u521d\u671f\u5316\n def __init__(self, N_x, N_y, seed=0):\n \"\"\"\n param N_x: \u30ea\u30b6\u30d0\u30fc\u306e\u30ce\u30fc\u30c9\u6570\n param N_y: \u51fa\u529b\u6b21\u5143\n param seed: \u4e71\u6570\u306e\u7a2e\n \"\"\"\n # \u6b63\u898f\u5206\u5e03\u306b\u5f93\u3046\u4e71\u6570\n np.random.seed(seed=seed)\n self.Wout = np.random.normal(size=(N_y, N_x))\n\n # \u51fa\u529b\u7d50\u5408\u91cd\u307f\u884c\u5217\u306b\u3088\u308b\u91cd\u307f\u3065\u3051\n def __call__(self, x):\n \"\"\"\n param x: N_x\u6b21\u5143\u306e\u30d9\u30af\u30c8\u30eb\n return: N_y\u6b21\u5143\u306e\u30d9\u30af\u30c8\u30eb\n \"\"\"\n return np.dot(self.Wout, x)\n\n # \u5b66\u7fd2\u6e08\u307f\u306e\u51fa\u529b\u7d50\u5408\u91cd\u307f\u884c\u5217\u3092\u8a2d\u5b9a\n def setweight(self, Wout_opt):\n self.Wout = Wout_opt\n\n\n# \u51fa\u529b\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\nclass Feedback:\n # \u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u7d50\u5408\u91cd\u307f\u884c\u5217\u306e\u521d\u671f\u5316\n def __init__(self, N_y, N_x, fb_scale, seed=0):\n \"\"\"\n param N_y: \u51fa\u529b\u6b21\u5143\n param N_x: \u30ea\u30b6\u30d0\u30fc\u306e\u30ce\u30fc\u30c9\u6570\n param fb_scale: \u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\n param seed: \u4e71\u6570\u306e\u7a2e\n \"\"\"\n # \u4e00\u69d8\u5206\u5e03\u306b\u5f93\u3046\u4e71\u6570\n np.random.seed(seed=seed)\n self.Wfb = np.random.uniform(-fb_scale, fb_scale, (N_x, N_y))\n\n # \u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u7d50\u5408\u91cd\u307f\u884c\u5217\u306b\u3088\u308b\u91cd\u307f\u3065\u3051\n def __call__(self, y):\n \"\"\"\n param y: N_y\u6b21\u5143\u306e\u30d9\u30af\u30c8\u30eb\n return: N_x\u6b21\u5143\u306e\u30d9\u30af\u30c8\u30eb\n \"\"\"\n return np.dot(self.Wfb, y)\n\n\n# \u30ea\u30c3\u30b8\u56de\u5e30\uff08beta=0\u306e\u3068\u304d\u306f\u7dda\u5f62\u56de\u5e30\uff09\nclass Tikhonov:\n def __init__(self, N_x, N_y, beta):\n \"\"\"\n param N_x: \u30ea\u30b6\u30d0\u30fc\u306e\u30ce\u30fc\u30c9\u6570\n param N_y: \u51fa\u529b\u6b21\u5143\n param beta: \u6b63\u5247\u5316\u30d1\u30e9\u30e1\u30fc\u30bf\n \"\"\"\n self.beta = beta\n self.X_XT = np.zeros((N_x, N_x))\n self.D_XT = np.zeros((N_y, N_x))\n self.N_x = N_x\n\n # \u5b66\u7fd2\u7528\u306e\u884c\u5217\u306e\u66f4\u65b0\n def __call__(self, d, x):\n d = np.reshape(d, (-1, 1))\n x = np.reshape(x, (-1, 1))\n self.X_XT = self.X_XT + np.dot(x, x.T)\n self.D_XT = self.D_XT + np.dot(d, x.T)\n\n # Wout\u306e\u6700\u9069\u89e3\uff08\u8fd1\u4f3c\u89e3\uff09\u306e\u5c0e\u51fa\n def get_Wout_opt(self):\n X_pseudo_inv = np.linalg.inv(self.X_XT + self.beta * np.identity(self.N_x))\n Wout_opt = np.dot(self.D_XT, X_pseudo_inv)\n return Wout_opt\n\n\n# \u9010\u6b21\u6700\u5c0f\u4e8c\u4e57\uff08RLS\uff09\u6cd5\nclass RLS:\n def __init__(self, N_x, N_y, delta, lam, update):\n \"\"\"\n param N_x: \u30ea\u30b6\u30d0\u30fc\u306e\u30ce\u30fc\u30c9\u6570\n param N_y: \u51fa\u529b\u6b21\u5143\n param delta: \u884c\u5217P\u306e\u521d\u671f\u6761\u4ef6\u306e\u4fc2\u6570\uff08P=delta*I, 0 \u30ea\u30b6\u30d0\u30fc\u306e\u30ce\u30fc\u30c9\u6570(N_x) \u306e\u5834\u5408\u306e\u51e6\u7406\u3092\u8ffd\u52a0\u3059\u308b\n x_in = np.zeros(self.N_x)\n x_temp = U[n][m]\n x_in[: len(U[n][m])] = x_temp\n\n # \u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u7d50\u5408\n if self.Feedback is not None:\n x_back = self.Feedback(self.y_prev)\n x_in = x_in + x_back\n\n # \u30ce\u30a4\u30ba\n if self.noise is not None:\n x_in += self.noise\n\n # \u30ea\u30b6\u30d0\u30fc\u72b6\u614b\u30d9\u30af\u30c8\u30eb\n x = self.Reservoir(x_in)\n\n # \u5206\u985e\u554f\u984c\u306e\u5834\u5408\u306f\u7a93\u5e45\u5206\u306e\u5e73\u5747\u3092\u53d6\u5f97\n if self.classification:\n self.window = np.append(self.window, x.reshape(1, -1), axis=0)\n self.window = np.delete(self.window, 0, 0)\n x = np.average(self.window, axis=0)\n\n # \u76ee\u6a19\u5024\n d = D[n]\n d = self.inv_output_func(d)\n\n # \u5b66\u7fd2\u5668\n if n > trans_len: # \u904e\u6e21\u671f\u3092\u904e\u304e\u305f\u3089\n optimizer(d, x)\n\n # \u5b66\u7fd2\u524d\u306e\u30e2\u30c7\u30eb\u51fa\u529b\n y = self.Output(x)\n Y.append(self.output_func(y))\n self.y_prev = d\n\n # \u5b66\u7fd2\u6e08\u307f\u306e\u51fa\u529b\u7d50\u5408\u91cd\u307f\u884c\u5217\u3092\u8a2d\u5b9a\n self.Output.setweight(optimizer.get_Wout_opt())\n\n # \u30e2\u30c7\u30eb\u51fa\u529b\uff08\u5b66\u7fd2\u524d\uff09\n return np.array(Y)\n\n # \u30d0\u30c3\u30c1\u5b66\u7fd2\u5f8c\u306e\u4e88\u6e2c\n def predict(self, U):\n test_len = len(U)\n Y_pred = []\n\n # \u6642\u9593\u767a\u5c55\n for n in range(test_len):\n for m in range(len(U[1])): # \u30c7\u30fc\u30bf\u6570\u3060\u3051\u30eb\u30fc\u30d7\u3055\u305b\u308b\n # x_in = self.Input(U[n])\n # TODO: x_in \u306e\u5927\u304d\u3055 > \u30ea\u30b6\u30d0\u30fc\u306e\u30ce\u30fc\u30c9\u6570(N_x) \u306e\u5834\u5408\u306e\u51e6\u7406\u3092\u8ffd\u52a0\u3059\u308b\n x_in = np.zeros(self.N_x)\n x_temp = U[n][m]\n x_in[: len(U[n][m])] = x_temp\n\n # \u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u7d50\u5408\n if self.Feedback is not None:\n x_back = self.Feedback(self.y_prev)\n x_in += x_back\n\n # \u30ea\u30b6\u30d0\u30fc\u72b6\u614b\u30d9\u30af\u30c8\u30eb\n x = self.Reservoir(x_in)\n\n # \u5206\u985e\u554f\u984c\u306e\u5834\u5408\u306f\u7a93\u5e45\u5206\u306e\u5e73\u5747\u3092\u53d6\u5f97\n if self.classification:\n self.window = np.append(self.window, x.reshape(1, -1), axis=0)\n self.window = np.delete(self.window, 0, 0)\n x = np.average(self.window, axis=0)\n\n # \u5b66\u7fd2\u5f8c\u306e\u30e2\u30c7\u30eb\u51fa\u529b\n y_pred = self.Output(x)\n Y_pred.append(self.output_func(y_pred))\n self.y_prev = y_pred\n\n # \u30e2\u30c7\u30eb\u51fa\u529b\uff08\u5b66\u7fd2\u5f8c\uff09\n return np.array(Y_pred)\n\n```\n\n#[\n #set text(lang: \"en\")\n #bibliography(\"bibliography/bib.yaml\", title: text(bibliographyTitleJa), style: \"institute-of-electrical-and-electronics-engineers\")\n]\n" }, { "repo": "https://github.com/HPDell/typst-slides-uob", "file": "https://raw.githubusercontent.com/HPDell/typst-slides-uob/main/README.md", "language": "markdown", "license": "", "content": "# Slides with Theme University of Bristol in Typst\n\nThis is a template for creating slides with the theme of the University of Bristol in Typst.\n\n## Functions\n\n```typ\n#let slides(\n title: \"\",\n authors: (),\n date: datetime.today(),\n short-title: \"\",\n body\n)\n```\n\nThis function changes page, text and layout settings to prepare for slides.\n\n```typ\n#let slide(body, subtitle: [])\n```\n\nThis function creates a slide and can append a subtitle after its title.\nIts title is specified in the nearest former level-3 headings, i.e., headings of marker `===`.\n\n```typ\n#let empty(content)\n```\n\nThis function creates an empty slide.\n\n```typ\n#let leaflet(content, title: [])\n```\n\nThis function creates a block area with a header and body, which looks like the `\\block{}` command in Beamer.\nAs the name `block` has been taken by Typst itself, it is named to `leaflet` instead.\n\n## Syntax Maps\n\nHeadings are translated into specific parts:\n\n- The level-1 and level-2 headings are mapped to the section page and the subsection page.\n- The level-3 headings are stored as slide titles and hidden. They only show up once the `#slide` is called to create a new slide.\n\n## Example\n\n[![](example.jpg)](./example.pdf)\n\n\n" }, { "repo": "https://github.com/LDemetrios/Typst4k", "file": "https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/model/heading.typ", "language": "typst", "license": "", "content": "// Test headings.\n\n--- heading-basic ---\n// Different number of equals signs.\n\n= Level 1\n== Level 2\n=== Level 3\n\n// After three, it stops shrinking.\n=========== Level 11\n\n--- heading-syntax-at-start ---\n// Heading vs. no heading.\n\n// Parsed as headings if at start of the context.\n/**/ = Level 1\n#[== Level 2]\n#box[=== Level 3]\n\n// Not at the start of the context.\nNo = heading\n\n// Escaped.\n\\= No heading\n\n--- heading-block ---\n// Blocks can continue the heading.\n\n= #[This\nis\nmultiline.\n]\n\n= This\n is not.\n\n--- heading-show-where ---\n// Test styling.\n#show heading.where(level: 5): it => block(\n text(font: \"Roboto\", fill: eastern, it.body + [!])\n)\n\n= Heading\n===== Heading \ud83c\udf0d\n#heading(level: 5)[Heading]\n\n--- heading-offset ---\n// Test setting the starting offset.\n#set heading(numbering: \"1.1\")\n#show heading.where(level: 2): set text(blue)\n= Level 1\n\n#heading(depth: 1)[We're twins]\n#heading(level: 1)[We're twins]\n\n== Real level 2\n\n#set heading(offset: 1)\n= Fake level 2\n== Fake level 3\n\n--- heading-offset-and-level ---\n// Passing level directly still overrides all other set values\n#set heading(numbering: \"1.1\", offset: 1)\n#heading(level: 1)[Still level 1]\n\n--- heading-syntax-edge-cases ---\n// Edge cases.\n#set heading(numbering: \"1.\")\n=\nNot in heading\n=Nope\n\n--- heading-numbering-hint ---\n= Heading \n\n// Error: 1:19-1:25 cannot reference heading without numbering\n// Hint: 1:19-1:25 you can enable heading numbering with `#set heading(numbering: \"1.\")`\nCannot be used as @intro\n" }, { "repo": "https://github.com/sses7757/sustech-graduated-thesis", "file": "https://raw.githubusercontent.com/sses7757/sustech-graduated-thesis/main/test-eq.typ", "language": "typst", "license": "Apache License 2.0", "content": "#import \"sustech-graduated-thesis/utils/multi-line-equate.typ\": equate, equate-ref\n\n#set text(lang: \"en\")\n#set heading(numbering: \"1.1\")\n#show heading: it => {\n\tcounter(math.equation).update(0)\n\tit\n}\n#show math.equation: equate.with(debug: true)\n#show ref: equate-ref\n#set math.equation(numbering: \"(1.1.a)\")\n\n= Heading\n\n#context counter(math.equation).get()\n\nSimple\n$\nO(n/t) = 1\n$ <->\n#context counter(math.equation).get()\n\nSimple 2\n$\nO(n/t) = 1\n$ \n#context counter(math.equation).get()\n@eqt:simple2\n\nTest\n$\n F_n &= P(n) \\\n\t&= floor(1 / sqrt(5) phi.alt^n). #\n$ \n#context counter(math.equation).get()\n@eqt:test, @eqt:test-test2\n\nTest no label\n$\n F_n &= P(n) \\\n\t&= floor(1 / sqrt(5) phi.alt^n).\n$ <->\n#context counter(math.equation).get()\n$\n F_n &= P(n) \\\n\t&= floor(1 / sqrt(5) phi.alt^n). #\n$ <->\n#context counter(math.equation).get()\n@eqt:specific\n$\n F_n &= P(n) # \\\n\t&= floor(1 / sqrt(5) phi.alt^n). #\n$ <->\n#context counter(math.equation).get()\n@eqt:new1, @eqt:new2\n\n#pagebreak()\n= Heading\n\n#context counter(math.equation).get()\n\nSimple\n$\nO(n/t) = 1\n$ <->\n#context counter(math.equation).get()\n\nSimple 2\n$\nO(n/t) = 1\n$ <2-simple2>\n#context counter(math.equation).get()\n@eqt:2-simple2\n\nTest\n$\n F_n &= P(n) \\\n\t&= floor(1 / sqrt(5) phi.alt^n). #\n$ <2-test>\n#context counter(math.equation).get()\n@eqt:2-test, @eqt:2-test-test2\n\nTest no label\n$\n F_n &= P(n) \\\n\t&= floor(1 / sqrt(5) phi.alt^n).\n$ <->\n#context counter(math.equation).get()\n$\n F_n &= P(n) #<2-specific> \\\n\t&= floor(1 / sqrt(5) phi.alt^n).\n$ <->\n#context counter(math.equation).get()\n@eqt:2-specific\n$\n F_n &= P(n) #<2-new1> \\\n\t&= floor(1 / sqrt(5) phi.alt^n). #<2-new2>\n$ <->\n#context counter(math.equation).get()\n@eqt:2-new1, @eqt:2-new2\n" }, { "repo": "https://github.com/gongke6642/tuling", "file": "https://raw.githubusercontent.com/gongke6642/tuling/main/\u57fa\u7840/array/array.typ", "language": "typst", "license": "", "content": "#set par(\n justify: true,\n leading: 0.52em, \n)\n\n= array\n=\n\n#image(\"1.png\", width: 100%)\n#image(\"2.png\")\n#image(\"3.png\")\n#image(\"4.png\")\n#image(\"5.png\")\n#image(\"6.png\")\n#image(\"7.png\")\n#image(\"8.png\")\n#image(\"9.png\")\n#image(\"10.png\")\n#image(\"11.png\")\n#image(\"12.png\")\n#image(\"13.png\")" }, { "repo": "https://github.com/MrToWy/Bachelorarbeit", "file": "https://raw.githubusercontent.com/MrToWy/Bachelorarbeit/master/Diagrams/ER_Translation.typ", "language": "typst", "license": "", "content": "```pintora\nerDiagram\n\n TranslatedText {\n INTEGER Id\n VARCHAR Text\n}\n\n Module {\n INTEGER Id\n }\n\n ModuleTitle {\n INTEGER Id\n}\n\n ModuleSubtitle {\n INTEGER Id\n}\n\n ModuleNiveau {\n INTEGER Id\n}\n\n Language {\n INTEGER Id\n VARCHAR Name\n VARCHAR ISOCode\n}\n\n\n\nModule ||--|| ModuleTitle : \"Title(E1)\"\nModule ||--|| ModuleSubtitle : \"Subtitle(E2)\"\nModule }o--|| ModuleNiveau : \"Niveau(E3)\"\n\nModuleTitle ||--o{ TranslatedText : \"Translated_Title\"\nModuleSubtitle ||--o{ TranslatedText : \"Translated_Title\"\nModuleNiveau ||--o{ TranslatedText : \"Translated_Title\"\nTranslatedText }o--|| Language : \"Language\"\n```" }, { "repo": "https://github.com/gongke6642/tuling", "file": "https://raw.githubusercontent.com/gongke6642/tuling/main/\u8bed\u8a00/\u9020\u578b/zaoxing.typ", "language": "typst", "license": "", "content": "= \u9020\u578b\nTypst \u5305\u62ec\u4e00\u4e2a\u7075\u6d3b\u7684\u6837\u5f0f\u7cfb\u7edf\uff0c\u53ef\u81ea\u52a8\u5c06\u60a8\u9009\u62e9\u7684\u6837\u5f0f\u5e94\u7528\u4e8e\u60a8\u7684\u6587\u6863\u3002\u4f7f\u7528\u8bbe\u7f6e\u7684\u89c4\u5219\uff0c\u60a8\u53ef\u4ee5\u914d\u7f6e\u5143\u7d20\u7684\u57fa\u672c\u5c5e\u6027\u3002\u8fd9\u6837\uff0c\u60a8\u5c31\u53ef\u4ee5\u521b\u5efa\u6700\u5e38\u89c1\u7684\u6837\u5f0f\u3002\u4f46\u662f\uff0c\u53ef\u80fd\u6ca1\u6709\u7528\u4e8e\u60a8\u5e0c\u671b\u6267\u884c\u7684\u6240\u6709\u64cd\u4f5c\u7684\u5185\u7f6e\u5c5e\u6027\u3002\u51fa\u4e8e\u8fd9\u4e2a\u539f\u56e0\uff0cTypst \u8fdb\u4e00\u6b65\u652f\u6301\u53ef\u4ee5\u5b8c\u5168\u91cd\u65b0\u5b9a\u4e49\u5143\u7d20\u5916\u89c2\u7684\u663e\u793a\u89c4\u5219\u3002\n= \u8bbe\u7f6e\u89c4\u5219\n\u4f7f\u7528\u8bbe\u7f6e\u7684\u89c4\u5219\uff0c\u60a8\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5143\u7d20\u7684\u5916\u89c2\u3002\u5b83\u4eec\u88ab\u5199\u6210\u5bf9\u5143\u7d20\u51fd\u6570\u7684\u51fd\u6570\u8c03\u7528\uff0c\u524d\u9762\u6709\u5173\u952e\u5b57\uff08\u6216\u5728\u6807\u8bb0\u4e2d\uff09\u3002\u53ea\u80fd\u5411\u8bbe\u7f6e\u89c4\u5219\u63d0\u4f9b\u8be5\u51fd\u6570\u7684\u53ef\u9009\u53c2\u6570\u3002\u8bf7\u53c2\u9605\u6bcf\u4e2a\u51fd\u6570\u7684\u6587\u6863\uff0c\u4e86\u89e3\u54ea\u4e9b\u53c2\u6570\u662f\u53ef\u9009\u7684\u3002\u5728\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u4e24\u4e2a\u8bbe\u7f6e\u89c4\u5219\u6765\u66f4\u6539\u5b57\u4f53\u7cfb\u5217\u548c\u6807\u9898\u7f16\u53f7\u3002\n\n#image(\"1.png\")\n\n\u9876\u7ea7\u96c6\u89c4\u5219\u5728\u6587\u4ef6\u672b\u5c3e\u4e4b\u524d\u4e00\u76f4\u6709\u6548\u3002\u5f53\u5d4c\u5957\u5728\u5757\u5185\u65f6\uff0c\u5b83\u4ec5\u5728\u8be5\u5757\u7ed3\u675f\u4e4b\u524d\u6709\u6548\u3002\u56e0\u6b64\uff0c\u4f7f\u7528\u5757\uff0c\u60a8\u53ef\u4ee5\u5c06\u89c4\u5219\u7684\u6548\u679c\u9650\u5236\u4e3a\u6587\u6863\u7684\u7279\u5b9a\u90e8\u5206\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u4f7f\u7528\u5185\u5bb9\u5757\u5c06\u5217\u8868\u6837\u5f0f\u8303\u56f4\u9650\u5b9a\u4e3a\u4e00\u4e2a\u7279\u5b9a\u5217\u8868\u3002\n\n#image(\"2.png\")\n\n\u6709\u65f6\uff0c\u60a8\u9700\u8981\u6709\u6761\u4ef6\u5730\u5e94\u7528\u8bbe\u7f6e\u89c4\u5219\u3002\u4e3a\u6b64\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 set-if \u89c4\u5219\u3002\n\n#image(\"3.png\")\n\n= \u663e\u793a\u89c4\u5219\n\u4f7f\u7528\u663e\u793a\u89c4\u5219\uff0c\u60a8\u53ef\u4ee5\u6df1\u5ea6\u81ea\u5b9a\u4e49\u5143\u7d20\u7c7b\u578b\u7684\u5916\u89c2\u3002show \u89c4\u5219\u7684\u6700\u57fa\u672c\u5f62\u5f0f\u662f show-set \u89c4\u5219\u3002\u8fd9\u6837\u7684\u89c4\u5219\u88ab\u5199\u6210\u5173\u952e\u5b57\uff0c\u540e\u8ddf\u4e00\u4e2a\u9009\u62e9\u5668\u3001\u4e00\u4e2a\u5192\u53f7\uff0c\u7136\u540e\u662f\u4e00\u4e2a\u96c6\u5408\u89c4\u5219\u3002\u9009\u62e9\u5668\u7684\u6700\u57fa\u672c\u5f62\u5f0f\u662f\u5143\u7d20\u51fd\u6570\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u8bbe\u7f6e\u89c4\u5219\u4ec5\u9002\u7528\u4e8e\u6240\u9009\u5143\u7d20\u3002\u5728\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6807\u9898\u53d8\u4e3a\u6df1\u84dd\u8272\uff0c\u800c\u6240\u6709\u5176\u4ed6\u6587\u672c\u4fdd\u6301\u9ed1\u8272\u3002\n\n#image(\"4.png\")\n\n\u4f7f\u7528\u663e\u793a\u96c6\u89c4\u5219\uff0c\u60a8\u53ef\u4ee5\u6df7\u5408\u548c\u5339\u914d\u6765\u81ea\u4e0d\u540c\u51fd\u6570\u7684\u5c5e\u6027\uff0c\u4ee5\u5b9e\u73b0\u8bb8\u591a\u4e0d\u540c\u7684\u6548\u679c\u3002\u4f46\u662f\u5b83\u4eec\u4ecd\u7136\u5c06\u60a8\u9650\u5236\u5728 Typst \u4e2d\u9884\u5b9a\u4e49\u7684\u5185\u5bb9\u3002\u4e3a\u4e86\u83b7\u5f97\u6700\u5927\u7684\u7075\u6d3b\u6027\uff0c\u60a8\u53ef\u4ee5\u6539\u4e3a\u7f16\u5199\u4e00\u4e2a\u663e\u793a\u89c4\u5219\u6765\u5b9a\u4e49\u5982\u4f55\u4ece\u5934\u5f00\u59cb\u8bbe\u7f6e\u5143\u7d20\u7684\u683c\u5f0f\u3002\u8981\u7f16\u5199\u8fd9\u6837\u7684 show \u89c4\u5219\uff0c\u8bf7\u5c06\u5192\u53f7\u540e\u9762\u7684 set \u89c4\u5219\u66ff\u6362\u4e3a\u4efb\u610f\u51fd\u6570\u3002\u6b64\u51fd\u6570\u63a5\u6536\u6709\u95ee\u9898\u7684\u5143\u7d20\uff0c\u5e76\u53ef\u4ee5\u8fd4\u56de\u4efb\u610f\u5185\u5bb9\u3002\u4f20\u9012\u7ed9\u51fd\u6570\u7684\u5143\u7d20\u4e0a\u7684\u53ef\u7528\u5b57\u6bb5\u518d\u6b21\u4e0e\u76f8\u5e94\u5143\u7d20\u51fd\u6570\u7684\u53c2\u6570\u5339\u914d\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5b9a\u4e49\u4e00\u4e2a\u663e\u793a\u89c4\u5219\uff0c\u7528\u4e8e\u683c\u5f0f\u5316\u5e7b\u60f3\u767e\u79d1\u5168\u4e66\u7684\u6807\u9898\u3002\n\n#image(\"5.png\")\n\n\u4e0e\u8bbe\u7f6e\u89c4\u5219\u4e00\u6837\uff0c\u663e\u793a\u89c4\u5219\u5728\u5f53\u524d\u5757\u6216\u6587\u4ef6\u7ed3\u675f\u4e4b\u524d\u4e00\u76f4\u6709\u6548\u3002\n\n\u9664\u4e86\u51fd\u6570\u4e4b\u5916\uff0cshow \u89c4\u5219\u7684\u53f3\u4fa7\u8fd8\u53ef\u4ee5\u91c7\u7528\u5e94\u76f4\u63a5\u66ff\u6362\u5143\u7d20\u7684\u6587\u672c\u5b57\u7b26\u4e32\u6216\u5185\u5bb9\u5757\u3002\u9664\u4e86\u51fd\u6570\u4e4b\u5916\uff0cshow \u89c4\u5219\u7684\u5de6\u4fa7\u8fd8\u53ef\u4ee5\u91c7\u7528\u8bb8\u591a\u5176\u4ed6\u9009\u62e9\u5668\uff0c\u8fd9\u4e9b\u9009\u62e9\u5668\u5b9a\u4e49\u5c06\u8f6c\u6362\u5e94\u7528\u4e8e\u54ea\u4e9b\u5185\u5bb9\uff1a\n\n#image(\"6.png\")" }, { "repo": "https://github.com/jerrita/CQUPTypst", "file": "https://raw.githubusercontent.com/jerrita/CQUPTypst/master/main.typ", "language": "typst", "license": "", "content": "#import \"template/template.typ\": *\n#import \"template/abstract.typ\": *\n#import \"chapters/foreword.typ\": *\n#import \"chapters/main.typ\": *\n#import \"chapters/tail.typ\": *\n\n\n// TODO:\n// - [ ] \u5c01\u9762\n// - [ ] \u9875\u7709\u9875\u811a\u5236\u4f5c\n\n#show: project.with(\n title: \"CQUPTypst\",\n authors: (\n (name: \"jerrita\", email: \"\"),\n ),\n abstract: [\n // This are two spaces between keywords.\n #abstemp(\n mode: \"cn\",\n abstract: [\n\u6bd5\u4e1a\u8bbe\u8ba1\u662f\u672c\u79d1\u6559\u5b66\u8fc7\u7a0b\u6700\u540e\u9636\u6bb5\u7684\u4e00\u79cd\u603b\u7ed3\u6027\u5b9e\u8df5\u6559\u5b66\u73af\u8282\u3002\u901a\u8fc7\u6bd5\u4e1a\u8bbe\u8ba1\uff0c\u5b66\u751f\u53ef\u4ee5\u7efc\u5408\u5e94\u7528\u6240\u5b66\u7684\u5404\u79cd\u7406\u8bba\u77e5\u8bc6\u548c\u6280\u80fd\uff0c\u8fdb\u884c\u5168\u9762\u3001\u7cfb\u7edf\u3001\u4e25\u683c\u7684\u6280\u672f\u53ca\u57fa\u672c\u80fd\u529b\u7684\u7ec3\u4e60\u3002\u4e3a\u4e86\u63d0\u9ad8\u6bd5\u4e1a\u8bbe\u8ba1\u8bba\u6587\u7684\u8d28\u91cf\uff0c\u505a\u5230\u8bba\u6587\u5728\u5185\u5bb9\u548c\u683c\u5f0f\u4e0a\u7684\u89c4\u8303\u5316\u4e0e\u7edf\u4e00\u5316\uff0c\u7279\u5236\u4f5c\u672c\u6a21\u677f\u3002\n\n\u8bba\u6587\u6458\u8981\u662f\u8bba\u6587\u5185\u5bb9\u4e0d\u52a0\u6ce8\u91ca\u548c\u8bc4\u8bba\u7684\u7b80\u77ed\u9648\u8ff0\uff0c\u5e94\u4ee5\u7b2c\u4e09\u4eba\u79f0\u9648\u8ff0\uff0c\u7528\u8bed\u529b\u6c42\u7b80\u6d01\u3001\u51c6\u786e\u3002\u4e2d\u6587\u6458\u8981\u5b57\u6570\u539f\u5219\u4e0a\u4e3a400-600\u5b57\uff0c\u82f1\u6587\u6458\u8981\u5e94\u4e0e\u4e2d\u6587\u5185\u5bb9\u4e00\u81f4\u3002\n\n\u6458\u8981\u662f\u5b66\u4f4d\u8bba\u6587\u7684\u6d53\u7f29\uff0c\u5e94\u5177\u6709\u72ec\u7acb\u6027\u548c\u81ea\u542b\u6027\uff0c\u5373\u662f\u4e00\u7bc7\u5b8c\u6574\u7684\u77ed\u6587\uff0c\u4e0d\u9605\u8bfb\u8bba\u6587\u7684\u5168\u6587\uff0c\u5c31\u80fd\u83b7\u5f97\u5fc5\u8981\u7684\u4fe1\u606f\u3002\u6458\u8981\u5185\u5bb9\u5e94\u5c3d\u53ef\u80fd\u5305\u62ec\u539f\u8bba\u6587\u7684\u4e3b\u8981\u4fe1\u606f\uff0c\u5305\u62ec\u7814\u7a76\u5de5\u4f5c\u7684\u76ee\u7684\u610f\u4e49\u3001\u4e3b\u8981\u95ee\u9898\u3001\u7814\u7a76\u5185\u5bb9\u3001\u7814\u7a76\u65b9\u6cd5\u3001\u7814\u7a76\u7ed3\u679c\u3001\u4e3b\u8981\u7ed3\u8bba\uff0c\u4f9b\u8bfb\u8005\u786e\u5b9a\u6709\u65e0\u5fc5\u8981\u9605\u8bfb\u5168\u6587\uff0c\u4e5f\u4f9b\u6587\u6458\u6c47\u7f16\u7b49\u4e8c\u6b21\u6587\u732e\u91c7\u7528\u3002\u6458\u8981\u8981\u7528\u6587\u5b57\u8868\u8fbe\uff0c\u4e0d\u7528\u56fe\u3001\u8868\u3001\u5316\u5b66\u7ed3\u6784\u5f0f\u3001\u516c\u5f0f\u3001\u975e\u516c\u77e5\u516c\u7528\u7684\u7b26\u53f7\u548c\u672f\u8bed\u3002 \n\n\u5173\u952e\u8bcd\u662f\u4e3a\u4e86\u6587\u732e\u6807\u5f15\u5de5\u4f5c\u4ece\u8bba\u6587\u4e2d\u9009\u53d6\u51fa\u6765\u7528\u4ee5\u8868\u793a\u5168\u6587\u4e3b\u9898\u5185\u5bb9\u4fe1\u606f\u7684\u5355\u8bcd\u6216\u672f\u8bed\u3002\u81ea\u5b9a\u4e493-5\u4e2a\u5173\u952e\u8bcd\uff0c\u6309\u5916\u5ef6\u7531\u5927\u5230\u5c0f\u6392\u5217\uff0c\u5efa\u8bae\u91c7\u7528EI\u6807\u51c6\u68c0\u7d22\u8bcd\uff0c\u5173\u952e\u8bcd\u95f4\u7528\u9017\u53f7\u5206\u5f00\u3002\u5982\u6709\u53ef\u80fd\uff0c\u5e94\u5c3d\u91cf\u7528\u300a\u6c49\u8bed\u4e3b\u9898\u8bcd\u8868\u300b\u7b49\u8bcd\u8868\u63d0\u4f9b\u7684\u89c4\u8303\u8bcd\u3002\n\n\u201c\u6458\u8981\u201d\u4e8c\u5b57\u4e3a\u9ed1\u4f53\u4e09\u53f7\u5b57\u5c45\u4e2d\uff0c\u662f\u4e00\u7ea7\u6807\u9898\u3002\u6458\u8981\u4e0e\u5185\u5bb9\u4e4b\u95f4\u4e0d\u7a7a\u884c\uff0c\u6458\u8981\u5185\u5bb9\u4e0e\u5173\u952e\u8bcd\u95f4\u7a7a\u4e00\u884c\u3002\u201c\u5173\u952e\u8bcd\u201d\u4e09\u4e2a\u5b57\u91c7\u7528\u5b8b\u4f53\u5c0f\u56db\u53f7\u5b57\u52a0\u7c97\u3002\u6458\u8981\u5185\u5bb9\u548c\u5173\u952e\u8bcd\u91c7\u7528\u4e2d\u6587\u5b8b\u4f53\u3001\u82f1\u6587Times New Roman\uff0c\u5c0f\u56db\u53f7\u5b57\uff0c1.5\u500d\u884c\u8ddd\u3002\n ],\n keywords: \"\u6bd5\u4e1a\u8bbe\u8ba1\uff0c\u8bba\u6587\u683c\u5f0f\uff0c\u89c4\u8303\u5316\uff0c\u6a21\u677f\",\n )\n #abstemp(\n mode: \"en\",\n abstract: [\nAbstract is a brief statement of the thesis without notes and comments, which should be stated in the third person with concise and accurate language in 600-800 Chinese characters and less than 700 words in foreign languages. The writing of an abstract should follow these principles:\n\n+ Abstract should generally state out clearly the purpose, significance, problem, methods, results, main conclusion and its significance, creative achievements and new insights of the research program, and the results and conclusions should be emphasized. \n+ Abstract should be independent and self contained, which can offer the necessary information without reading the full text. It is the miniature and abbreviation of a thesis, which contains the thesis\u2019s main points, views and conclusions in a short and clear way. Abstract is a complete short essay with data and conclusion, which can be adopted and referred to independently. \n+ Abstract should include main information of the original thesis as far as possible for the reader to determine whether to read the full text, which can also be applied for secondary sources. \n+ Abstract should be written in words without any appended drawings and photos. Unless there is no alternative way available, abstract should be presented without graphs, tables, chemical structural equations, non-public common symbols and terminology, subscripts, and other special symbols. It is the best policy to highlight the key points clearly with less data tables.\n\nKeywords are words or terms selected from the thesis for literature indexing to represent the topic information entry. Generally, a thesis should have 3-5 keywords, which should be arranged from broad to narrow entry according to the principle of epitaxial order. EI standard retrieval words are recommended. The keywords should be separated by a comma and there is no punctuation after the last word. If possible, it is better to use the standard words from Chinese Thesauri and other dictionaries of the same type. \n\nAbstract should be centered in bold-3 word size. It is the primary heading without any blank line between the word \u201cabstract\u201d and its content. But there should be one blank line between the abstract content and the key words. The \u201ckeywords\u201d should be in bold Song typeface with small-four word size. The content and the key words are written in Chinese song typeface, English Times New Roman, small-four word size and 1.5 spaced.\n ],\n keywords: \"thesis, format, standardization, template\"\n )\n ],\n date: \"April 7, 2023\",\n logo: \"../resource/icon.png\",\n)\n\n#set text(fs_l4)\n#chapter_foreword\n#pagebreak()\n\n// Only main pages need numbering.\n#set heading(numbering: content_numbering)\n#chapter_main\n#set heading(numbering: none)\n\n#pagebreak()\n#chapter_tail" }, { "repo": "https://github.com/Dherse/ugent-templates", "file": "https://raw.githubusercontent.com/Dherse/ugent-templates/main/masterproef/parts/0_introduction.typ", "language": "typst", "license": "MIT License", "content": "#import \"../ugent-template.typ\": *\n\n= Introduction" }, { "repo": "https://github.com/jgm/typst-hs", "file": "https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-35.typ", "language": "typst", "license": "Other", "content": "// Error: 14-18 cannot compare integer and string\n#calc.min(1, \"hi\")\n\n" }, { "repo": "https://github.com/polarkac/MTG-Stories", "file": "https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/003%20-%20Gatecrash/010_The%20Burying%2C%20Part%202.typ", "language": "typst", "license": "", "content": "#import \"@local/mtgstory:0.2.0\": conf\n#show: doc => conf(\n \"The Burying, Part 2\",\n set_name: \"Gatecrash\",\n story_date: datetime(day: 06, month: 03, year: 2013),\n author: \"\",\n doc\n)\n\n#emph[To be close to the Old Gods, you must go under the earth. There you will hear their voices and feel their power. Some may whisper sacred words to you, some may give you visions, some may fill you with fear, but it is their way of making you whole, of making you a real person who knows his own heart. Do not fear.]\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\n#figure(image(\"010_The Burying, Part 2/01.png\", height: 40%), caption: [], supplement: none, numbering: none)\n\nDomri Rade was entombed in the earth.\n\nAfter Domri was covered in magical symbols and an animal skin shroud, the shaman Sabast laid him in the ceremonial grave. As Domri felt the earth piled on top of him he heard Sabast begin a chant of protection. It kept Domri's body alive, but his mind was unprotected, exposed, and alone.\n\nSound became muffled with each shovelful of dirt. The cold slowly seeped into his body. The weight made it harder to move. Then he was in total darkness and silence. Teenage bravado buoyed him for the first initial moments, and he knew all he had to do was endure the night and in the morning Sabast would be there to dig him out.\n\n#figure(image(\"010_The Burying, Part 2/02.jpg\", width: 100%), caption: [Skarrg Guildmage | Art by Aleksi Briclot], supplement: none, numbering: none)\n\nAll he had to do was last.\n\nBut any measure he had of the passage of time gradually began slipping away from him. An eternity seemed to pass as his mind systematically exhausted its defenses one by one. Eventually, he ran out of things to occupy his thoughts.\n\nThen the deeper layers began to surface. Darker layers.\n\nWas it minutes? Was it hours? Maybe Sabast was taken by a maaka on his way back to camp and no one will know where I am? Would the protection spell wear off? Would I suffocate? Maybe there was a massive Rakdos attack on my tribe and everyone was wiped out.\n\nMaybe I'd always be alone.\n\nMaybe I am going to die here.\n\nHe knew the Old Gods were a myth\u2014something the elders believed in. But now, as cracks of uncertainty began to appear in his mental armor, he felt his mind rushing to cling to them, to make them real, to beg them for deliverance from this fear. His thoughts and emotions raced like rats in a trap, feeding on each other until his mind shut down and blind instinct took over. Domri struggled like a drowning man but his body was pinned in the earth. Frozen. Immobile.\n\nAn overwhelming panic set in... and then something began to take over. A pressure from within surged up through his body, sending a sound through his mind like a chorus of trumpets that threatened to tear him apart. His spine felt like it had turned to liquid fire and his head filled with light and then... it happened. He shot out into the Multiverse to behold the infinite void of the Blind Eternities. Its vastness was incomprehensible to his new eyes\u2014eyes that would never be closed again.\n\nAll the planes of the Multiverse lay before him like facets of a sparkling jewel.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nDomri awoke in what felt like a Gruul steam tent. He picked himself up off of the spongy ground covered in leaf litter. Things smelled differently. He sat up and rubbed his eyes and viewed a world never before seen by a Gruul.\n\nHis mind could barely process the lack of buildings as he staggered to his feet\u2014no stone, no rubble, nothing. He blinked and shook his head but the scene didn't change. Buildings didn't magically appear. He was deep within a primordial rainforest; massive trees covered with lush mosses, ferns, and bromeliads surrounded him. Plants he had never seen before burst in a riot of life all about him. He shuffled in a daze to a break in the trees and there he beheld a deep valley carpeted in the endless, green canopy of a vast jungle far below. Not a building or ruin in sight.\n\n#figure(image(\"010_The Burying, Part 2/03.jpg\", width: 100%), caption: [Forest | Art by & ], supplement: none, numbering: none)\n\n\"Krokt.\" The word escaped his mouth as he gazed in complete wonder at a horizon teeming with unchecked growth. A feeling began to well up within him, as if his Gruul ancestors were chanting in exultation. He was looking at the land of their hopes and dreams\u2014a land without walls, structure, or the blasted Azorius and their scribbling books. This was raw life expressing absolute freedom, and he was in the thick of it. An ululation from some primal part of Domri's being erupted out of him in response to his ancestors' joy.\n\nHe yelled at the top of his lungs, \"Yeeeeeaaaaaahhhhh!\"\n\n#emph[Maybe not so great an idea.]\n\nHe heard an unfamiliar bellow shake every bone in his body. Darting past him came three elves in strange garb, each one looking more surprised and worried than the one before as they fled past him.\n\n#figure(image(\"010_The Burying, Part 2/04.jpg\", width: 100%), caption: [Sages of the Anima | Art by er], supplement: none, numbering: none)\n\nThe first elf glared. \"Idiot!\"\n\nThe second elf ran past. \"Idiot!\"\n\nAs she dashed past him, the last elf said, \"Run, you idiot!\"\n\nHe could feel the earth as it shook under his feet. Something big crashed through the trees, and their trunks and roots groaned as they snapped. Domri sprang into action. He lowered his head and ran after the incredibly fleet feet of the elf girl as she darted through the obstacle course of hanging vines and fallen limbs.\n\nTrees crashed all around him, and he quickly lost sight of the elves as he ran blindly through the endless sea of ferns and leaves. As he ran past a wall of vines, two hands shot out, grabbed him, and pulled him into a dark cave. He could hear the elves breathing.\n\n\"Don't say a word.\" One of the elves whispered.\n\n\"Idiot.\" Another said.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\n\"I don't want to go back,\" Domri said to his three elf companions who looked at him with a mixture of bewilderment and fascination. \"This place is amazing.\"\n\nThe three elves sat and looked at this bedraggled boy, covered in dirt, ash, and ochre symbols of some strange tribe unknown to them, babbling about crossing a great void from another realm. Their elder, Hasal, talked to the stranger while the two younger elves watched him curiously from a distance.\n\n\"He's mad,\" Maklo whispered to Elishta.\n\n\"He's got power. I can feel it. Perhaps Cylia has sent him to help us track the gargantuans.\"\n\n\"I think he's just another scout who got lost in the forest and ate too many spinberries.\"\n\nHasal knew the human was not from any tribe he knew of nearby. Most human travelers\u2014be they drumhunters or simple traders\u2014moved in groups through the jungle, and no one went alone this far. Even Cylian godtrackers, such as themselves, were careful not to get separated this deep in the forest. This human, Hasal decided, was out of his head.\n\nHasal quietly asked questions of the boy, trying to make sense of his outlandish claims, but the more questions he asked, the more Domri came out with wild details of a world he called Ravnica.\n\nDomri sat in bewildered glee as he stared at the lush, endless forest as the elves conferred with each other. After a moment of whispers and over-the-shoulder glances Hasal said, \"Our anima will wish to talk to you. Tell me again of this place you come from. You spoke of an entire world of... buildings?\"\n\n\"Yes. Where I come from, all people do is destroy nature and make buildings from it. My tribe destroys their stuff and gives it back to nature.\"\n\n#figure(image(\"010_The Burying, Part 2/05.jpg\", width: 100%), caption: [Stomping Ground | Art by ], supplement: none, numbering: none)\n\nMaklo looked doubtful. Elishta looked enthralled.\n\nHasal just looked. #emph[This kid is hallucinating.]\n\nDomri rambled on, the adrenaline from the Planeswalk and then being chased by Krokt-knows-what was flowing through his body; his eyes were like saucers as he talked to the elves. \"I mean, imagine if every tree here was a building of some sort and the spaces between them were cobbled alleyways. That's Ravnica. It's a horrible mess and we Gruul just want to tear it down, but the Azorius and all the other guilds fight us. They're all caught up in rules and laws, but we have the Rubblebelt. That's my home. I love the creatures that live there.\"\n\nAs Domri jabbered at the bewildered elves, he started to imagine the Rubblebelt and the great swaths of ruins, caves, and trenches left by wars, beasts, and other devastations. It pulled on him and he felt a strong force begin to arise like a fire within a furnace. The more Domri thought about it, the more the force grew within him, until a dam burst and he felt a tremendous rush of mana overtake him like a ragebeast. It was chaotic. It felt like a swirling storm of earth tangled with trees and vines. Domri began to sweat as the stress of this new vision overtook him. It was as if he was buried in the ground again. Deep in the earth, roots snaked through his body and dissolved his flesh into until nothing but his bones remained. Then those too were crushed into the void. He could faintly hear Hasal calling his name, and he could feel his physical body being shaken as if it was someone else's, but his awareness was elsewhere.\n\nAnd then, in a sickening lurch of unbelievable power, he shot out into the Blind Eternities once more.\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nThe streets of Ravnica at midnight can be a confusing place, especially for a Gruul who had never set foot so deep within the city. Domri had to sneak blindly through what seemed like miles of alleyways and streets before he could find a familiar spire, a familiar hole in the district's wall, and a familiar trail that led back to the Rubblebelt and his tribe's camp.\n\n#figure(image(\"010_The Burying, Part 2/06.jpg\", width: 100%), caption: [Forest | Art by ], supplement: none, numbering: none)\n\nIt was late night when he stumbled in, scraggly, drained of energy, looking like some kind of sewer shambler that crawled out of a Golgari drainpipe.\n\n\"Aieeee!\" Within a split-second, four Gruul warriors had their spears at his throat.\n\n\"It's me, Domri. Get that spear out of my face, Murgul.\"\n\n\"Impossible,\" Murgul said. \"You should still be in the grave.\"\n\n\"Oh, yeah. That.\"\n\n\"You will wait here until Sabast returns,\" Murgul growled, poking Domri with his spear.\n\nNasri flicked at a bit of dirt still in Domri's hair. \"I think he's one of the Golgari now.\"\n\n\"I'll tell you what I am, Nasri,\" Domri said, irritated. \"Starving.\"\n\n#v(0.35em)\n#line(length: 100%, stroke: rgb(90%, 90%, 90%))\n#v(0.35em)\n\nSabast arrived with the dawn and, after he assuaged the warriors, pulled Domri into his tent. For the first time, Domri saw Sabast look completely dumbfounded.\n\n\"How did you get here? I removed the earth from the grave and you weren't there. What manner of spell did you cast? How did you escape the test?\"\n\n#figure(image(\"010_The Burying, Part 2/07.jpg\", width: 100%), caption: [Domri Rade | Art by son], supplement: none, numbering: none)\n\nDomri was on the spot. He knew that Sabast was bound by Gruul tradition to believe the old legends and myths and what Domri just went through blew all that to pieces. If it was found that he didn't go through with the full test, he would lose his guild standing. But if he told Sabast the truth, he would most likely be driven out as a madman or a charlatan, or both. Either way, it didn't look good. The irritating thing was that Domri had always felt he was different than everyone in his tribe and now something truly amazing had occurred to prove it and he couldn't say anything about it without alienating himself. It made Domri mad as a maaka.\n\nHe saw the elder shaman's puzzled face as he expected an answer. Domri decided it didn't really matter what he said now. Everything had changed.\n\n\"I can't tell you what happened,\" Domri said, looking at his feet.\n\n\"What?\"\n\n\"I can't tell you because you wouldn't believe me anyway.\" Domri felt the anger arise in him. \"Do what you feel you have to. Banish me, whatever, it doesn't matter. Nobody has ever believed in me anyway.\" Domri turned to walk out.\n\n\"I'm not going to banish you,\" Sabast said as he grabbed Domri's arm. \"Sit down. I am going to tell you something I have never told anyone in the tribe. There are no laws of the Gruul except that of the wild. I can tell something has happened to you, and that is the real power of the Burying. It is not for me to judge the chaotic forces of nature as good or bad, as the other guilds do; it is for me to guide the Gruul, to keep us in contact with those forces and to keep those forces alive within us. As long as you keep your spirit, Domri, you are Gruul, and you will have a place at the central fire.\"\n\nIn a rare flood of emotion, Domri embraced the old man. He felt like a weight had been lifted off him. On the long walk back to camp, Domri had not been aware of the worry that had gnawed at him about how his tribe would react\u2014especially how Sabast would react. He left the tent, and as he walked past the staring members of his tribe, he felt a grin begin to emerge on his face. Finally, after years of just being a nobody, a kid with an affinity for the wild animals of Ravnica, Domri now felt like he knew something no other Gruul could know about. Not Sabast, not Nikya, not Borborygmos\u2014no one. He knew of another realm, another world completely separate from this one, and it was a world that the Gruul could only dream of. Domri felt the urge to take another trip out into the wild\u2014the real wild. Just the thought about the journey to the amazing jungle realm caused the excitement to rise up within him.\n\nThere was great adventure to be had and he was ready to crash into whatever was out there.\n\n#figure(image(\"010_The Burying, Part 2/08.jpg\", width: 100%), caption: [Boundless Realms | Art by Cliff Childs], supplement: none, numbering: none)\n" }, { "repo": "https://github.com/fiit-community/base-typst-template", "file": "https://raw.githubusercontent.com/fiit-community/base-typst-template/main/src/localization.typ", "language": "typst", "license": "MIT License", "content": "\n#let localization = yaml(\"localization.yaml\")\n\n// TODO: Fix this\n#let get_localization(lang) = {\n if lang == \"en\" {\n return localization.en\n } else if lang == \"sk\" {\n return localization.sk\n } else {\n return localization.en\n }\n}\n" }, { "repo": "https://github.com/denizenging/site", "file": "https://raw.githubusercontent.com/denizenging/site/master/page/about/index.en.typ", "language": "typst", "license": "", "content": "#import \"@local/pub-page:0.0.0\": *\n\n#show: template(\n\ttitle: \"About\",\n\tdescription: \"Linguist, Programmer, Stoic...\",\n\tmenu: (2, \"user\"),\n)\n\nHello there! I am an undergraduate of linguistics at the Medeniyet University of \u0130stanbul who is a well-seasoned programmer, too!\n\nI am 22 years old and I like programming, sharing my knowledge, and of course music! My interests include computational linguistics, phonology, cognitive linguistics. I program mainly using the Web stack, but I do enjoy low-level programming and cryptography.\n\nYou can find me at your local social media platform using #link(\"/page/links\")[the links page].\n" }, { "repo": "https://github.com/Myriad-Dreamin/typst.ts", "file": "https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/opticalsize_02.typ", "language": "typst", "license": "Apache License 2.0", "content": "\n#import \"/contrib/templates/std-tests/preset.typ\": *\n#show: test-page\n\n// Test prime superscript on large symbol\n$ scripts(sum_(k in NN))^prime 1/k^2 $\n$sum_(k in NN)^prime 1/k^2$\n" }, { "repo": "https://github.com/dismint/docmint", "file": "https://raw.githubusercontent.com/dismint/docmint/main/societysystems/iwa1.typ", "language": "typst", "license": "", "content": "#import \"template.typ\": *\n#show: template.with(\n title: \"IWA #1\",\n subtitle: \"6.1850\",\n pset: true,\n toc: false,\n)\n\n#note(title: \"Word Count\")[1269]\n\n= Introduction\n\nBitTorrent is a communication protocol for distributing data across a network of peers in a decentralized manner. It spawned the widely used term \"torrent\", and is a popular method for sharing media. The protocol has reached a level of usage such that there are now additional concerns and complications about how the system is being utilized. Topics such as piracy have become intermingled with torrenting, and there are many complex interactions between stakeholders of BitTorrent.\n\n== Technical Overview\n\nBitTorrent hosts can serve their data through *seeds*. Seeds contain parts of the data that need to be distributed and resemble the more traditional single source downloading protocol. However, since it is a peer-to-peer system, the seeds must support distributed downloading. This is done by running a *tracker*, which will note peers that are attempting to download the file and will route and organize them accordingly to facilitate a peer-to-peer network.\n\nA large piece of data is split into *pieces*, of which any can be downloaded at any given point in time. The idea is for peers to source all the pieces of the original file from peers and seeds, while also acting as as provider should any other peers want the pieces that they have. The final result is then verified against a checksum and completed.\n\nThe BitTorrent protocol specifies how peers should act by describing desired behaviors such as:\n\n- How to balance uploading and downloading as a peer (*choking*)\n- Which pieces to download first (_random_)\n- Which pieces to prioritize (_rarest-first_)\n\n= Impact Analysis\n\n== Content Creators\n\nAs mentioned before, torrenting for many has become synonymous with pirating and the illegal distribution of intellectual property. This impacts many content creators, whether they create video content, music, games, or any other creative medium.\n\nFor the vast majority of cases, these stakeholders are impacted by the system acting on them. Many might not even know what torrenting is, only that it has been causing disallowed distribution and repurposing of their content as well as potential revenue losses. There are certainly content creators that use BitTorrent as a way to positively grow their content with decentralized distribution, with similar benefits to many other users of the system.\n\nHowever the content creators who are the victims of BitTorrent highlight a very interesting demographic of stakeholders - those that feel completely detached from the system, yet profoundly feel the effects. This might be one of the more concerning classes of stakeholders. Imagine as a content creator, you wake up one day to see that your song has gone massively viral, only to find out that it was illegally distributed and you will not be seeing any of the revenue from its success. Without knowledge of the system, it could feel frightening and daunting to try to understand what happened and prevent it in the future.\n\nIt is an interesting question to consider whether it is the duty of more informed stakeholders, perhaps even the creator of the system themselves, to take it upon themselves to help stakeholders who are completely blind to the system yet are affected greatly by it.\n\n== ISPs\n\nDoing some research into the effects of BitTorrent ended up exposing some interesting stakeholders, one of which are Internet Service Providers (ISPs).\n\nISPs are similar to content creators in that they are mostly acted upon by BitTorrent. However, ISPs do act *on* BitTorrent since they are one of the core mechanisms with which peer-to-peer distribution happens. If an ISP decides that they will not allow any traffic that is originating from a BitTorrent protocol (which has happened in the past), then this would heavily impact the system. Unlike content creators however, ISPs are fully aware of what torrenting is and interact with the system as an informed stakeholder.\n\nOne particularly interesting way that BitTorrent acts upon ISPs is the tremendous increase in required bandwidth. ISPs' bandwidth is one of their core resources, so anything that causes that utilization to skyrocket would be incredibly concerning for them. Studies around 2015 showed that BitTorrent traffic accounted for an astounding 53% of all upstream traffic in North America. This type of usage is what has prompted ISPs to crack down on users who interact with BitTorrent, often punishing them for doing so.\n\nAs one of the core mechanisms of BitTorrent, it is possible that ISPs could also feel pressure from other stakeholders such as content creators to stop serving traffic that relates to torrenting.\n\n== Corporations\n\nAlthough there are certainly downsides to every stakeholder, I believe that corporations and BitTorrent are widely positive for each other. There are quite a few ways that corporations can interact with BitTorrent, but for this stakeholder analysis I will consider corporations that are *choosing* to use BitTorrent.\n\nThere are a large number of companies that use BitTorrent to enhance some part of their workflow. For example:\n\n- Facebook and Twitter use BitTorrent to distribute updates so they can ensure high availability\n- Blizzard and other game clients use BitTorrent for quick downloading large games as well as patching the game\n\nThese corporations have no reason not to use BitTorrent if they see it as a superior algorithm to previous systems. BitTorrent clearly states their mission goals on their website, and there is nothing that inhibits companies from using the BitTorrent protocol for their own use. Choosing to adopt a system would mean that it goes widely into use as well - if a large social media website relies on BitTorrent for updates, it is very likely that BitTorrent will become a core software that the entire system relies on. \n\nOn the other side, although the use of BitTorrent might not directly benefit BitTorrent, it brings publicity and attention to the protocol, meaning that others are more likely to adopt or contribute to the project.\n\nWhen big companies use BitTorrent, this impacts users indirectly as well. Very similar to how content creators often suffer unknowingly through the use of BitTorrent, customers of large social media platforms or games are often benefiting from the BitTorrent protocol without even realizing it. This illustrates a type of duality present in stakeholder analysis - it is important to consider all stakeholders and contexts to properly assess what secondary or tertiary impacts may arise from something as simple as a file distribution protocol.\n\n= Design Impact\n\nMany of the impacts that users feel either directly or indirectly from BitTorrent are a result of complex interactions between the protocol and stakeholders. However, there are also impacts that are a direct consequence of design decisions that were made by BitTorrent. In particular, let us take a look at the impact that a peer-to-peer model has on ISPs.\n\nThis design is of interest because it is a core part of the BitTorrent protocol, yet causes a number of negative effects. ISPs are forced to deal with increased strain, reduced bandwidth, and traffic congestion as a result of such protocols. The constant uploading and downloading present in BitTorrent's peer-to-peer design are a clear and direct cause for these pressures to ISPs.\n\nHowever, there are likely reasons for why the developers took this path. On this flip side of congesting the network, having a system that is peer-to-peer will generally increase speed and resilience for users and downloading data. It also creates a fault tolerant and distributed system that allows decentralized distribution of information that doesn't rely on one server paying an extraordinary amount of money to host data at potentially slow rates (or paying the overhead of having multiple mirrors).\n" }, { "repo": "https://github.com/alex-touza/fractal-explorer", "file": "https://raw.githubusercontent.com/alex-touza/fractal-explorer/main/README.md", "language": "markdown", "license": "", "content": "# Fractal Explorer - Mathematical and Computational Study of Fractal Objects\n\n**Mathematical and computational study of fractal objects** is my research project (\"Treball de recerca\") for my last two years of high school (\"Batxillerat\").\n\nThis repository contains both the source code for the end product of my research —a web app that generates fractals and\nprovides mathematical insight— ([`web`](./web) module), and the source for the paper of the project ([`paper`](./paper)\nmodule), written in Typst.\n\n## Development\n\nIt is recommended to use IntelliJ IDEA to open the whole project. Other IDEs may be used to open each module.\n\n## Tutor\n\n has been the tutor for this project.\n" }, { "repo": "https://github.com/jerrita/CQUPTypst", "file": "https://raw.githubusercontent.com/jerrita/CQUPTypst/master/chapters/foreword.typ", "language": "typst", "license": "", "content": "#let chapter_foreword = [\n= \u524d\u8a00\n#lorem(200)\n]" }, { "repo": "https://github.com/Rhinemann/mage-hack", "file": "https://raw.githubusercontent.com/Rhinemann/mage-hack/main/src/chapters/Intro.typ", "language": "typst", "license": "", "content": "#import \"../templates/interior_template.typ\": *\n#show: chapter.with(chapter_name: \"How It Works\")\n\n= How It Works\n\n#show: columns.with(2, gutter: 1em)\n\nIn a tabletop roleplaying game, each player takes on the role of one or more characters. The characters adventure through an imaginary world (which can range from the fantastical to the mundane), and the players use the game's rules to determine the results of their characters' actions. In Cortex, everybody contributes to the story, but at some point you break out dice, contributing just enough randomness so no one knows what will happen until events unfold during play.\n\n== Example characters\nThroughout the book there will be examples of play included, those examples feature the same players, ST, and characters for consistency. They are:\n/ Rhinemann (he/him): A Storyteller.\n\n/ Lydia (she/her): Fashionista Hermetic mage with small stature and large personality.\n\n/ Aurelius (he/him): Studious Hermetic wizard balancing brilliance and madness and Lydia's grandson.\n\n/ (he/him): An anxious Etherite Scientist, making machinery that works on dubious scientific theories, an old friend of Lydia's.\n" }, { "repo": "https://github.com/maxlambertini/troika-srd-typst", "file": "https://raw.githubusercontent.com/maxlambertini/troika-srd-typst/main/chap03.typ", "language": "typst", "license": "", "content": "#let chap03_title=[= The Rules ]\n#let chap03=[\n\n== Rolling the Dice\n\nThere is only one die type used in Troika!, that being the d6. This can\nbe used as a d3, d6, d66, d666, and so on. To roll a d3 just roll a d6\nand halve it, rounding up. To roll a d66, d666, or more just roll a d6\nas many times, in order, as there are 6s. So a d66 would be a d6\nfollowed by another d6 \\(e.g.~I roll a 1 then roll a 4 thus making a\nroll of 14). To do most actions you\u2019ll be required to roll 2d6, adding\nthem together, as a Roll Under or a Roll Versus.\n\n=== Roll Under\n\nRolling Under is the throwing of 2d6 with the intention of scoring equal\nto or under a number. This will mainly be used in unopposed situations\nlike climbing a wall or casting a Spell. Rolling two 6s always results\nin failure.\n\n=== Roll Versus\n\nRoll Versus, mostly used for combat or other contests, occurs when two\nopponents each roll 2d6 and add any applicable bonuses, then compare\nresults, the higher total winning. In a duel you might be rolling 2d6\nand adding your Sword Fighting total, looking to beat your opponent who\nis doing similar.\n\n== Advanced Skills & Spells\n\nCharacters have a variety of Advanced Skills & Spells granted them by\ntheir Background. The number given in the Background plus their Skill is\nreferred to as their Skill Total. Write this on the character sheet. 2.1\nTesting Advanced Skills & Spells Most Tests of Advanced Skills & Spells\nare Roll Under \\(12 & 14).\n\n- When you successfully Test an Advanced Skill or Spell, put a tick next\n to it on your character sheet. These are used to Get Better \\(11.1).\n\n== Luck\n\nOf all the numbers on your character sheet Luck is likely to fluctuate\nthe most. This number represents your character\u2019s fortune and intuition,\ntested whenever fate swipes at them. When this happens the GM will ask\nyou to Test your Luck or suffer the consequences.\n\n=== Testing your Luck\n\nRoll equal to or less than your current Luck score. Every time you Test\nyour Luck, reduce your current Luck score by 1 regardless of whether the\nTest was successful or not. Testing your Luck is optional; you may\nalways refuse to roll and instead accept your fate. The GM is not\nobliged to give you details of the consequences if they are not already\nobvious.\n\n=== Gaining and Losing Luck\n\nFor every 8 hours rest you may regain 2d6 Luck. Luck may not exceed the\nstarting value rolled at character creation save for exceptional\nsituations. Running out of Luck inflicts no special penalty.\n\n=== Use of Luck in Combat\n\nIn the case of a tie the character may Test their Luck to break it in\ntheir favour. When a character successfully hits an opponent, but before\nrolling for Damage, they may decide to Test their Luck and, if\nsuccessful, may add 2 to their Damage Roll.\n\n=== OPTIONAL: Luck Versus Death\n\nIf you find your games are too fatal and that the turnover of characters\nis too much to bear the GM might optionally allow characters who have\ndied to Test their Luck and, instead of dying, be incapacitated,\nwounded, or saved by some bizarre twist of fate.\n\n== Stamina\n\n=== Running Out of Stamina\n\nWhen reduced to 0 Stamina you are in danger of dying and must be healed\nin order to survive. If this is during an Initiative Round the next time\nthe End of the Round Token is drawn you die. If this happens out of\nInitiative your friends have one opportunity to Heal you \\(restoring you\nto 1 Stamina) or else you are dead.\n\n=== Healing\n\nYou regain 2d6 Stamina if you sleep for 8 hours. You may also eat a\nProvision to regain 1d6 Stamina. A maximum of 3 Provisions per day will\nprovide healing benefits. There may be other forms of healing available\nat your GM\u2019s discretion such as visiting bath houses or drinking\npotions. You may never have more Stamina than your starting total.\n\n=== Negative Stamina\n\nIf you ever go below 0 Stamina you are dead.\n\n=== Death\n\nYou may immediately make a new character while others mourn your loss\nand fight over your possessions. This new character starts exactly\naccording to the rules found at the beginning of this book.\n\n== Initiative\n\n=== Assemble the Stack\n\nDuring combat or at other times where it is important to know who goes\nfirst you will need to assemble the Initiative Stack. To do this get a\ncontainer and a selection of coloured dice or other convenient markers\n\\(consider cards, poker chips, and so on).\n\n+ Assign each character 2 Tokens of a single color.\n+ Add Tokens to the Stack for the enemies equal to their total combined\n Initiative \\(if you have 8 Lizard-Men \\(Initiative 2) you would add 16\n tokens to the Stack).\n+ Add 1 Token of a distinct colour to the Stack. This Token signifies\n the End of the Round.\n+ OPTIONAL: Enemy Initiative Limit. It is very likely that sometimes the\n characters\u2019 enemies will grossly outnumber them and make it very hard\n for them to act. The GM may optionally limit the number of Enemy\n Initiative Tokens placed in the Stack to double that which the\n characters contribute. So if a party of 5 \\(10 Initiative Tokens in\n total) is attacked by fifty goblins \\(50 Initiative Tokens) the\n goblins will only contribute 20 Tokens to the Stack. Bear in mind that\n the GM should feel free to balance Initiative Stacks as it seems\n appropriate.\n\n=== Using the Stack\n\nThe GM will remove a Token from the Stack at random, the colour or\ndesign of which will determine who holds the Initiative and takes a\nTurn. Consider giving a copy of their Token to each player so that\neveryone remembers which colour or design is theirs.\n\n=== End of the Round\n\nIf the End of the Round Token is drawn all Tokens, including the End of\nthe Round Token, are put back in the Stack. Remove Tokens contributed by\ndead characters and enemies, resolve any per Round or end of Round\nactivities such as magic effects, Drowning \\(7.9), fire, poison, or\nbleeding, then draw another Token and carry on.\n\n=== Henchmen\n\nHired help that are willing to engage in combat each provide 1\nInitiative Token to the Stack. Henchmen share a single colour Token and\nwhen a henchman Token is drawn the GM determines who acts and what they\ndo. The GM should take the wishes of the players under advisement but\nact in the best interests of the henchman.\n\n=== Enemies\n\nAll enemies contribute a varying number of Initiative Tokens to the\nInitiative Stack according to their combined Initiative and share the\nsame colour or design. When drawing an enemy Initiative Token the GM can\ndeclare that any enemy is acting, including an enemy who has acted\npreviously this Round. Obviously this can be abused for mechanical gain\non the GM\u2019s part though that would be entirely to the detriment of the\ngame and is discouraged. Apply Initiative Tokens as they make sense.\n\n=== Rationale\n\nThe random Turn length adds a degree of uncertainty where you never know\nhow much time you have left. When actions are not taking place it\nrepresents hesitation, panic, or other incidental delays that can happen\nin a tense encounter where every second counts. The goblins have few\nTokens because they are cowardly, not because they are slow; the dragon\nhas many because it knows exactly what it wants, not because it is fast.\n\n== Actions\n\nWhen you hold the Initiative you may take a Turn and can generally\nperform one action. The following list is not exhaustive and the GM is\nencouraged to interpret player intentions as best they can.\n\n=== Hit Someone\n\nTo stab, bludgeon, or otherwise physically interfere with someone, Roll\n\\(2d6+Skill+Advanced Skill) Versus an opponent doing the same thing. The\nwinner Rolls for Damage and the loser deducts the number generated by\nthe Damage Roll from their Stamina. Note that either party in any\nexchange can potentially win. In a tie both parties have avoided hurting\neach other. Also note that this means you can potentially hit an\nunlimited number of people in a Round but may only Initiate once per\nTurn.\n\n=== Shoot Someone\n\nShooting an opponent is resolved by Rolling Versus their Skill or\nappropriate evasive Advanced Skill such as Shield or Dodge.\n\n==== Shooting Into Melee.\n\nWhen shooting into melee on a successful hit assign a number to every\nindividual involved and roll a die. If their number comes up they\nreceive the Damage.\n\n==== Aim\n\nOn your Turn you may decide to take Aim with your ranged Weapon. To do\nso hold onto your Initiative Token. When your next Initiative Token is\ndrawn you may roll twice and pick the best roll. If the End of the Round\nToken comes up and you haven\u2019t used your Aim Token you may decide to\nhold onto it for the next Round.\n\n=== Cast a Spell\n\nEach Spell has its own instructions on how it should be used but in\ngeneral you will need to spend a certain amount of Stamina and Roll\nUnder or Roll Versus \\(for Spells that require you to touch an unwilling\nparty, for instance) in order to create some kind of effect. Unless the\nSpell says otherwise it requires at least one hand free and the ability\nto speak. Roll on the Oops! Table if the result is a Fumble.\n\n=== Delay\n\nYou may choose not to act when you hold Initiative. In that case put\nyour Token back in the Stack.\n\n=== Move\n\nEvery action is assumed to have a bit of movement involved. Anything\nless than 12 metres is folded into whatever else you might be doing. If\nyou wish to chase after someone or perform some other involved\nlocomotion then just spend a Turn doing it.\n\n=== Retrieve an Item\n\nIf you need to get something out that you weren\u2019t already holding in\nyour hands roll 2d6 and score equal to or higher than its position on\nyour Inventory list. If you succeed you can pull it out and do what you\nintended. Otherwise you spend your entire action finding it. Double 1s\nalways indicate a failure. Retrieving an arrow counts as an item\nretrieval. Make sure they\u2019re packed on top! See Sections 10.3 and 10.4.1\nfor more on Inventories.\n\n=== Use an Item\n\nIf an item is in your hands you may use it however you like \\(6.6).\n\n=== Grapple\n\nRoll Versus your opponent\u2019s Wrestling Skill. If you win you may either\nknock them to the ground or deal Damage as Unarmed and knock you both to\nthe ground \\(from throwing or tackling them). On a Mighty Blow \\(7.4)\nyou render them unconscious for 1d6 Rounds. If you fail to grapple them\nthey may deal Damage to you as though they had attacked you normally\nwhereas if you Fumble \\(7.5) they deal you a Mighty Blow.\n\n== Other Concerns\n\n=== Cover\n\nWhen attacking someone in cover they receive a bonus to their roll to\nnot be hit. Consider a waist high bush to be +1 while a castle\u2019s\ncrenulations would be +6.\n\n=== Enemies\n\nMechanically speaking, an opponent is typically reduced to three\nnumbers: Skill, Stamina, and Initiative. Beyond this they may have an\nAdvanced Skill or two or some peculiar special rules.\n\n=== Hitting Someone Unawares\n\nIf your opponent is not aware of your presence your attack is a Roll\nUnder rather than a Roll Versus \\(1.2), they may not attack back, and\nyou may add 2 to your Damage Roll.\n\n=== Mighty Blows\n\nIf you roll a double 6 while attacking you strike a Mighty Blow, win the\nexchange, and inflict Double Damage \\(8.1). If both parties strike a\nMighty Blow a spectacular clinch is formed, shattering both Weapons \\(in\nthe case of beastly claws, tentacles, and so on they will lose 1d6\nStamina instead).\n\n=== Fumbles\n\nA roll of double 1s in combat results in the roller losing the exchange\nand their opponent adding 1 to their Damage Roll. If both parties Fumble\nthey each deal Damage to the other, adding 1 to their Damage Roll.\n\n=== Shields\n\nShields reduce Damage Rolls by 1 to a minimum of 1.\n\n=== Use of Multiple Weapons\n\nWhen rolling Damage you may choose which Weapon to reference the Damage\nRoll against after rolling. You must be holding it in your hands or\nnearest approximations, obviously.\n\n=== Falling Over\n\nWhen on the floor you suffer -2 to all physical rolls against those\nstanding, including Damage Rolls, and must spend a Turn getting to your\nfeet.\n\n==== Falling Too Far.\n\nWhen engaging in uncontrolled falls you lose 1d6 Stamina per 2 metres\nfallen when you land.\n\n=== Drowning\n\nWhen you fail a Swimming Test you begin to Drown and lose 1d6 Stamina.\nFor each consecutive Swimming Test where you make no progress you roll\nan additional 1d6. So for instance your third failed Swimming roll in a\nrow would lose you 3d6 Stamina. Once you lose all Stamina you have\nDrowned.\n\n==== Fire, Poison, and Bleeding.\n\nAny ongoing debilitating effects should be treated similarly to\nDrowning. Unless you have a specific effect in mind have the victim lose\n1d6 Stamina per Turn with it optionally becoming more severe unless they\neither pass a related Advanced Skill Test or successfully Test their\nLuck \\(or Skill for Enemies). Improvisation is strongly encouraged.\n\n==== Degenerative Effects in Combat.\n\nTest for Drowning, fire, etc. only when the End of the Round Token is\ndrawn.\n\n=== Henchmen\n\nHenchmen are created as you would a monster, with truncated abilities\nonly covering their essence. They are their own people with their own\nmotivations and are not just pieces of equipment. It is up to the GM and\nplayers to flesh them out or not as the case may be. Also see Section\n5.4.\n\n=== Time\n