repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/tedaco1/typst-example | https://raw.githubusercontent.com/tedaco1/typst-example/main/document-files/example.typ | typst | MIT License | // Comments are styled like this
/*
* You can comment like this as well, but the language server doesn't always
* pick them up.
*/
// Document directives
//#import "science-template.typ": template
//#show: doc => template(
// title: [
// Practicing templates
// ],
// authors: (
// (
// name: "<NAME>",
// affiliation: "Wacky University",
// email: "<EMAIL>",
// ),
// ),
// abstract: lorem(81),
// doc,
//)
//#import "more-pretty.typ" : template
//#show: doc => template(doc)
#align(center, text(18pt)[
*Typst Example*
])
#align(center, text(14pt)[
By: Ted
])
//#pagebreak()
//#outline()
//
//#pagebreak()
/*
= Basic Text Formatting
I can align things with the `align()` function.
#align(left, text(12pt)[
_i am on the left_
])
#align(center, text(12pt)[
*middle here*
])
#align(right, text(12pt)[
_*im always write*_
])
*/
/*
= Playing with tables
tables look pretty good, but they can be a lot to handle sometimes
#table(
columns: 2,
table.header[*Letter*][*Best Word*],
[A], [Ascent],
[T], [Texas],
[Q], [#link("https://search.brave.com/images?q=quetzal")[Quetzal]]
)
*/
/*
#heading()[Pictures, anyone?]
#figure(
caption: [
im not even a cat person
],
image("cat.jpg", width: 70%)
)
*/
/*
= Headings
== auto subheadings are nice
=== especially when you
=== need to talk a lot about
=== one particular
==== subject that has
===== a lot
=== of
== other detail
*/
/*
= Me gustan las matemáticas
$ A = pi r^2 $
$ "area" = pi dot "radius"^2 $
$ cal(A) :=
{x in RR | x "is natural" } $
#let x = 5
$ #x < 17 $
*/
/*
= include different files in main file
#include "extra-file.typ"
*/ |
https://github.com/sdsc-ordes/modos-poster | https://raw.githubusercontent.com/sdsc-ordes/modos-poster/main/src/themes/themes.typ | typst | Creative Commons Attribution 4.0 International | #import "/src/themes/boxes.typ" |
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/024%20-%20Shadows%20over%20Innistrad/010_The%20Lunarch%20Inquisition.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Lunarch Inquisition",
set_name: "Shadows Over Innistrad",
story_date: datetime(day: 04, month: 05, year: 2016),
author: "<NAME>",
doc
)
#emph[Thalia, the Guardian of Thraben, was instrumental in defending Thraben from the siege of zombies launched by the necromancer siblings Gisa and Geralf. In the city's darkest hour, she faced Liliana Vess at the Helvault, in the heart of Thraben Cathedral. And while the Planeswalker threatened the life of every soldier under her command, Thalia finally acquiesced to her terrible demand: she sundered the Helvault, releasing all the demons it had contained—as well as the archangel Avacyn.]
#emph[Mikaeus, the Lunarch of the Church of Avacyn, died during the siege of Thraben, and his successor was killed in the early days of Avacyn's madness. Now a new Lunarch Council has been established, made up of senior bishops of the church with a few cathar leaders in advisory positions. Another great leader in the defense of Thraben, a cathar named Odric, showed tremendous initiative in organizing the Lunarch Council to deal with Avacyn's madness. He earned a seat on the council as a representative of the cathars, without an actual vote on council matters.]
#emph[But as the madness of the angels continues and spreads into the Lunarch Council, the two cathar leaders are struggling to navigate the waters between loyalty to Avacyn's church and devotion to all the church represents.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The ride from the Elgaud Grounds in Nephalia to Thraben Cathedral had taken days, through the cold air of the hunter's moon. Her fingers were numb, but Thalia's cheeks still felt hot from the flames, and her blood still boiled with outrage. She handed her reins to the stable hand and shot a wary look at the angel that wheeled overhead like a carrion crow before she stormed into the echoing halls.
Out of habit, she traced Avacyn's collar on her own chest, shoulder to heart, shoulder to heart, as she passed the open doors to the sanctuary. Her eyes stung, though, as she thought of that blessed symbol presiding over the atrocities at Elgaud.
She was still the Guardian of Thraben in name, even if she spent precious little time in the High City anymore, so no cathar barred her way or asked her business as she swept up the stairs, down a corridor, and into the chamber that the council had given the Lunarch Marshal to use as an office. He wasn't there, naturally.
Thalia shrugged out of her riding cloak and threw it down on a chair, then stuck her head back into the hall. "You," she called to a nearby cathar standing stiffly on watch. "Find him."
She clapped her gloved hands together and rubbed them hard and fast, trying to ignite a spark of warmth in her frozen fingers as she paced back and forth in the small office.
When she turned away from the doorway, it was empty; three steps later, when she turned back, he was standing there. She stopped short.
"Thalia!" Odric said warmly, opening his arms to embrace her.
He looked older. His hair had been white for years, of course, except for the single shock of raven black at his forehead. But his face had always looked young. Now it was lined with worry.
"It's good to see you, <NAME>," she said, stepping toward him with a smile. But instead of embracing him, she slammed a fist against his silver-inlaid breastplate. Her smile vanished. "Do you know what's happening out there?"
He sighed as his arms flopped down to his sides. "I know these are not the best of times," he said.
"Children," she said. "We're burning children now. Sin-plagued my—"
"Elgaud?" He cut her off.
"Yes. This has to stop, Odric. Ulmach is completely out of control."
"He's Chief Inquisitor, Thalia. He #emph[is] control, as far as the church in Nephalia is concerned."
"No." She thumped his breastplate again. "The Lunarch Council still commands the church, doesn't it? Your council?"
Odric finally managed to squeeze past her and enter his office. "They're not my council," he said, "but the inquisition operates under their aegis, yes."
"It has to stop," she said again.
#figure(image("010_The Lunarch Inquisition/01.jpg", width: 100%), caption: [Thalia, Guardian of Thraben | Art by <NAME>], supplement: none, numbering: none)
"And then what? How do you intend to stem the tide of the angels' wrath?"
"Do you hear yourself? You think the angels are angry because we tolerate sin in our midst? Odric, the angels are supposed to #emph[protect] us, not burn our villages to the ground. And we're supposed to protect children, not burn them at the stake! You really think this is what Avacyn wants from us?"
"Avacyn is leading this purge. You know that. If human sin arouses her fury, we must root out the sin from among us or be caught in her wrath. Avacyn has set the example for us. If she has hardened her heart against the pleas of the wicked, we must do the same."
"The wicked? What sin do you suppose those children harbored?"
"You're questioning the judgment of the inquisition?"
"Of course I am! How can they look into the eyes, into the heart of a child and find evil there—evil that deserves such a horrible death?"
"#emph[If] the inquisitors are putting children to death—"
"They are. I saw them."
"If they are, then they must have good reason. Blessed Avacyn gives her church power to root out evil, punish it, and protect the innocent from its reach."
"They're abusing that power!"
"What would you have me do?"
Thalia grabbed one of his hands. Even through their gloves, it felt warm against the chill in her bones. "Speak to the council," she said. "Help them see reason."
"You know I have no vote on the council."
"But you have a voice. You represent the cathars. They can't just ignore you."
He turned his back on her. "But I am subject to their will. To Avacyn's will."
"Those aren't necessarily the same thing, you know."
He bowed his head, but gave no answer.
Suddenly overcome by exhaustion, Thalia slumped down in the chair where she'd thrown her cloak.
"Did I do the right thing, Odric?" she asked.
He turned and gave her a gentle smile. They had had the same conversation before, but he knew she needed to hear it again from time to time. "You freed Avacyn," he said. "And you saved your soldiers from the necromancer's grip."
"Yes, but I also freed demons beyond counting. And some of them have escaped the angels' reach."
"They are in hiding."
"But they will be back—they will all be back. They can't be destroyed—that's why the Helvault existed in the first place. And I let her destroy it."
#figure(image("010_The Lunarch Inquisition/02.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
"You freed Avacyn," he said again.
"What if that was a mistake too?" she said. The lines between his eyebrows grew deeper, but she pressed on. "What if her time in the Helvault corrupted her? What if she is no better than a demon herself now?"
His face grew stern. "You should not be saying this to me," he said. He was right, of course—and she had never before dared to voice these thoughts to anyone. "I am a member of the Lunarch Council..."
"You're a good man."
"I serve Avacyn and her church. And so do you, in case you've forgotten, Guardian of Thraben."
Thalia sprang to her feet again. "I serve the principles that Avacyn stands for—that she #emph[used] to stand for. I serve the soft light of the moon that holds back the terrors of the night. I serve the bonds between us, driving out the fear that would break us apart. I serve the holiness we all aspire to. If she has turned against those things, then she is no better than a demon, and I can no longer serve Avacyn and her church."
Odric's face was right next to hers, red with anger. "I cannot stand here and let you compare <NAME> to the demons she has battled for uncounted centuries. Because you are my friend, I am going to urge you to leave Thraben, and do not let anyone else hear these blasphemies coming from your lips. Grete?"
A face framed in red hair appeared in the doorway. Thalia was taken aback—she'd had no idea that Odric's champion had been right outside all that time. Had she heard the whole conversation?
"Sir?" Grete said.
Odric turned his back on Thalia again. "Will you please escort Thalia beyond the outer wall?"
"Of course."
Thalia laid her hand on Odric's back. "Odric..."
"Goodbye, Thalia."
She swallowed hard. No other words would come.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Grete held the reins of the horse as Thalia mounted, avoiding her eyes as she had since they left Odric. But as she handed the reins up to her, Grete met her gaze at last.
"What will you do?" she asked quietly.
"I'm going to fight," Thalia answered. "I've sworn to defend the people of this land from the monsters that would destroy them. I'm going to keep doing that. If the cathars and inquisitors have become monsters, then I will defend the people from them. If the angels themselves have become monsters..."
"You would fight the angels themselves?" Grete asked, eyes wide.
"If I must."
"How can you be so certain you're right?"
#figure(image("010_The Lunarch Inquisition/03.jpg", width: 100%), caption: [Strength of Arms | Art by <NAME>o], supplement: none, numbering: none)
Thalia heard so much in that question, including the doubt that had robbed her of a good night's sleep for weeks now. But clearly Grete longed for the same certainty. Thalia wished she could provide it.
"If I'm wrong," she said instead, "well, I would rather be a heretic than betray my conscience."
Grete let go of the reins and looked away as she stepped back from the horse.
"You could come with me," Thalia said.
"No." Grete seemed to be talking to herself as much as to Thalia. "But I hope...I wish you the best, Thalia."
"Thank you."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Weeks later, Odric still heard Thalia's voice when some too-eager cathar stood before the Lunarch Council and reported the latest results of the inquisition's work at Elgaud. Every time the young man drawled the phrase "sin-plagued," he heard Thalia's voice on the brink of vulgarity, and every mention of the Chief Inquisitor made him think of her words: "Ulmach is completely out of control." It was too hard to listen to the details of the questioning, torture, and execution, so he surveyed the faces of the bishops of the council instead.
Some of them were clearly as uncomfortable as he was. But some of them leaned forward, eyes bulging wide, eager smiles tweaking the corners of their mouths as if hungry for the lurid details. #emph[Was Thalia right?] he wondered. #emph[Have we all become monsters?]
#figure(image("010_The Lunarch Inquisition/04.jpg", width: 100%), caption: [Hope Against Hope | Art by <NAME>], supplement: none, numbering: none)
A bang jolted him out of his reverie as the chamber door was thrown open. Thalia's boots echoed on the stone floor as she strode into the hall. The young cathar stepped aside, obviously cowed by her presence—and the anger that burned in her eyes.
"Thalia, what are you doing here?" he asked, breaking the stunned silence.
Bishop Jerren stood and folded his arms. "The business of the Lunarch Council is not to be interrupted," he said.
"I am the Guardian of Thraben," Thalia replied, "and I claim my right to speak before the council."
"You no longer hold that title, Thalia," Odric said gently. He saw Jerren smile. "The council has removed it from you."
Thalia looked at him, clearly not surprised. The anger in her eyes had transformed into contempt, as if he were a snake writhing on the ground before her. He had betrayed her confidence, informing the council of her heresy. His stomach churned.
Jerren simpered. "But we are in a charitable mood," he said. "What business do you bring before the council?"
Thalia turned that withering gaze to Jerren. "I come to accuse you, bishop," she said.
Odric sat back in his chair, his throat tight.
Thalia continued. "I bring evidence that you have been in communion with the demon Ormendahl, called the Profane Prince, and you are now the leader of the Skirsdag."
Jerren laughed. He #emph[laughed] . Other members of the council began shouting their protest, but the nominal leader of the council could only laugh as he was accused of leading a demonic cult.
"Show us this so-called evidence," someone said, and the shouts quieted.
Now it was Thalia's turn to smile. She had been given the chance to present her case, which was all she could have asked. She turned as she spoke, including the entire council in her address—though she did not meet Odric's gaze. "Three days ago," she said, "I led a small party of cathars through the forest of Wittal parish, near the ruins of Estwald. We sought the lair of a notorious witch who had brought curses upon several of the villages in the parish. At last, we came upon hoof prints in the soft earth."
#figure(image("010_The Lunarch Inquisition/05.jpg", width: 100%), caption: [Thalia's Lieutenant | Art by Johannes Voss], supplement: none, numbering: none)
"We are still waiting for your evidence," one of the bishops said.
Odric looked at Jerren. The bishop sat back in his chair, his fingers steepled in front of his mouth, not quite hiding the hint of a smile that quirked his lips.
"The trail led us to the dismal cave where the witch laired. A horse grazed on the blackened grass outside, bearing the livery of this council. Rushing inside, we found the witch lifting the quivering heart from the corpse of a messenger, as if preparing to take a bite from the raw flesh."
A few of the council members made faces of disgust and turned their gaze from Thalia. But Odric noticed that the ones who still stared at her wore the same eager expressions they had while listening to the inquisitor's report.
"We attempted to subdue the witch, but she fought like a fury, with demonic power at her command. We had no choice but to kill her."
"Conveniently negating the possibility that she might give testimony," someone said.
Thalia ignored the interruption. "The dead rider was a messenger of this cathedral, carrying this letter." She produced a sheet of parchment from inside her cloak. Dark splatters and smudges of what must have been blood disfigured the page. "Read it for yourself, and judge the truth of my accusation. The letter bears the seal and signature of none other than <NAME>, giving instructions to this witch in the name of the Profane Prince!"
Odric's feet and hands felt numb, and his pulse was pounding. Thalia had woven a damning tale. Could it be true?
Thalia strode to the far end of the council table and held the parchment out, offering it to one of the lesser bishops, Quilion. Quilion cast a timid glance toward Jerren and refused to take the parchment from her hand. Thalia scoffed and offered it to the bishop beside him. Three bishops refused her as the council sat in stony silence, before <NAME> took it with a quivering hand. Her face paled as she read the page.
"What say you to this, Jerren?" Carlin said after a moment.
"It is clearly a forgery," Quilion said, though he had not examined the parchment.
"The whole tale is an impossibility," another bishop said.
Odric could not believe it, any of it. He knew Thalia would not fabricate evidence, however much she disagreed with the council. And once he allowed himself to consider the possibility, he had to confess that he wouldn't call Jerren the holiest of men. But the leader of the Skirsdag? Chairing the Lunarch Council?
"Of course it's impossible," Jerren said.
"It seems to me there is only one heretic in this room," Quilion said. He cast his gaze toward Jerren as if seeking the senior bishop's approval.
Odric stared in shock as members of the council began shouting again, this time demanding Thalia's execution. Thalia's face was grim—he had seen her grow steadily more pale as more of the bishops sided with Jerren. Surely she had expected some resistance, but perhaps not as much as this. Jerren's influence on the council must have been stronger than she had anticipated. Her hand reached toward her sword.
Cathars came and seized Thalia's arms before she could draw it, looking to Jerren for direction. With the merest wave of his fingers, he condemned her, and they started to drag her away.
"Odric!" she called, her voice piercing the clamor of the still-shouting bishops. "I serve the light!"
#emph[The soft light of the moon that holds back the terrors of the night] , she had said.#emph[ I serve the bonds between us, driving out the fear that would break us apart.]
And here was the Lunarch Council, seized by fear, turning on one of their most devoted servants.
The doors slammed closed behind Thalia, and with a simper, Jerren gestured for the young cathar to continue his testimony about the latest horrors performed at Elgaud on the Lunarch Council's behalf.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Odric hurried to the basement of the cathedral, where he hoped Thalia would still be awaiting execution. They would not have brought her to hang on the tree in the cathedral courtyard just yet, not without time for the ceremonial observance appropriate to the execution of such a prominent heretic.
"I must speak with the prisoner," Odric said to the soldier guarding the cells. The young woman saluted and stepped aside so he could pass.
"Don't speak," he whispered at the window to her cell. "We are leaving here, together."
"What?"
"I said don't speak." He turned back to the soldier. "Guard, open this cell."
Her eyes widened, but the cathar fumbled with the keys at her belt. Odric nodded his approval. #emph[At least some of us still know our duty] , he thought.
Thalia's cell door creaked open, and he helped her up off the filth-encrusted floor. He noticed a fresh bruise, just beginning to blossom on her cheekbone. Had she struggled? Or had the guards who escorted her here been caught up in the cruelty that seemed to have become the norm, even in Avacyn's cathedral?
They walked up the stairs together. Grete met them at the top, carrying Thalia's slim sword.
"Horses?" Odric asked her as Thalia belted on her sword.
"Should be ready by the time we reach the stable," Grete said.
#figure(image("010_The Lunarch Inquisition/06.jpg", width: 100%), caption: [Crusader of Odric | Art by <NAME>], supplement: none, numbering: none)
"Well done."
"Where are we going?" Thalia asked.
"You tell me," Odric said. "You said you had other cathars with you in Wittal parish. Are they still there?"
"Yes."
"Then shall we join them there?"
"Yes. I have a lot to tell you."
They were nearly to the stables now, nearly free of the Lunarch Council and Jerren and whatever corruption festered here. But now five cathars blocked their exit.
"Stop where you stand, Lunarch Marshal," the one in the center said. Dougan was his name, Odric remembered. He had trained the young man, years ago. "Bishop Jerren's orders," he added, sounding almost apologetic.
Odric kept walking. "Step aside and let us pass," he said. Grete and Thalia walked a little closer to him.
"I can't do that, sir." The apology was gone from his voice, replaced with steel. "The bishop expected this treachery from you, and wants you—all three of you—returned to the council chamber."
More cathars were behind them now—three more, from the sound of them. Eight to three, if it came to that.
Odric was face to face with young Dougan now, and Thalia and Grete faced down the cathars on either side of him.
"Dougan, let us pass," Odric said again.
"No."
Odric tried to push his way through, but the sound of drawn steel behind him changed everything.
Eight to three might have been a problem, if the three had not been among the most experienced soldiers in Avacyn's church. Odric's first swing sent Dougan's blade clattering to the floor. While his former student scrambled for his weapon, Odric turned to parry an attack from behind him—Marta, another young cathar he had trained. His riposte drew blood at her shoulder—she had always left that shoulder open in training—and she stumbled backward.
Dougan was back, rushing at him with his sword overhead. Odric shook his head—he had taught the boy better form than that. He ducked below the clumsy swing and jabbed at Dougan's belly, checking his blow before he gutted the lad. He had almost forgotten they were not training with wooden swords.
Perhaps Dougan had forgotten it as well, for his eyes went wide and he fumbled with his sword again as a hand went to the blossoming red stain beneath his ribs.
#figure(image("010_The Lunarch Inquisition/07.jpg", width: 100%), caption: [Odric, Lunarch Marshal | Art by Chase Stone], supplement: none, numbering: none)
A third cathar lunged at him, one whose name escaped him, and the hapless wretch impaled himself on Odric's blade. Marta, fighting on despite the wound in her shoulder, fell under Grete's heavy sword.
Haral came at him then, an older soldier who had fought with him against the zombies. He had years of experience beyond what Dougan could boast, and if his will had been stronger, he would have been commanding this team. He had always lacked that will, that drive. Tears flowed down his face as he faced Odric, blocking the exit.
Odric's sword rang against his helmet, sending the cathar staggering backward, but he kept his feet and clutched his sword more tightly.
"You're going to have to kill me, apostate," he growled.
Odric strode forward and unleashed a storm of steel, driving Haral back from his relentless assault. Haral couldn't muster an effective counterattack—he lacked the will. The inevitable opening came, and Odric took it without thinking, slashing the man's throat open.
The cathedral doors were now in sight. Odric looked back, at the eight loyal cathars bleeding or dying on the polished cathedral floor. Holy cathars of Blessed Avacyn's church. "May the angels of Flight Alabaster guide you—" He choked on the words. Did the angels give a damn about human spirits anymore?
"...guide you to the Blessed Rest," Thalia said, close beside him. Her hand traced the symbol of Avacyn's collar across her chest, shoulder to heart, shoulder to heart. She glanced up at him, eyes bright with tears, then turned and ran toward the doors.
Some part of Odric lay dead on the floor beside the fallen, but he left it there and ran with her, with Grete, to the stables. As his champion had promised, three horses were ready for them. They barely broke their stride to mount and spur the horses into a gallop. And they left the cathedral, then left Thraben, left their old lives far behind.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"Fully two-thirds of them were in the palm of Jerren's hand," Thalia said, addressing the small band of cathars she had gathered in a tiny Nearheath chapel. "Clearly I underestimated the extent to which Ormendahl's influence has taken hold of the council."
The other cathars shook their heads, distraught.
"And you knew nothing of this?" she asked Odric.
But Odric said nothing. He had uttered barely a word since they passed beyond the outer wall of Thraben. She couldn't be sure he had even blinked—he just sat and stared.
She sighed and rested a hand on his shoulder. "I think I know what you're going through, old friend," she whispered in his ear. "I think all of us do."
"He'll be all right," Grete said. "Give him time, time to rest,"
"I know," Thalia said. "He can have all the time he needs."
"What can I do?" Grete asked.
Thalia smiled. "Remember when I invited you to come with me?"
"I should have."
"I'm glad you didn't. I might be hanging in the cathedral courtyard by now if you hadn't been there to help with my escape. You're here now."
"So what is 'here'? What are we doing here?"
"Welcome to the Order of Saint Traft," Thalia said, gesturing to the chapel around her as if it were a grand palace.
"Saint Traft?" Grete said. "You lay claim to a noble pedigree by invoking his name. <NAME>, Beloved of Angels, Martyr of the Needle's Eye—you could hardly have chosen a more worthy patron."
"I did not choose him," Thalia said with a smile. "He chose me."
A luminous mist coalesced in the air behind Thalia, turning her hair to liquid gold, and her face seemed to shine with a light of its own. A moment later there were two faces; they pulled farther apart, and a man stood beside her, radiant but insubstantial, a holy geist. Saint Traft himself.
Thalia laid her hand on Grete's shoulder. "Are you ready to fight?"
Grete fell to her knees, but her eyes remained fixed on Thalia's face. "Wherever you lead."
#figure(image("010_The Lunarch Inquisition/08.jpg", width: 100%), caption: [Invocation of Saint Traft | Art by <NAME>], supplement: none, numbering: none)
|
|
https://github.com/davawen/Cours | https://raw.githubusercontent.com/davawen/Cours/main/typst/physique/0.1.0/optique.typ | typst | #import "utils.typ": *
#let axe-optique() = {
import cetz: draw
import draw: *
line((-5, 0), (5, 0), mark: (end: "straight"))
}
#let lentil(openess, height: 1, fill: none, name: none) = {
import draw: translate, bezier, group, anchor
group(name: name, {
translate((-openess, 0))
bezier((0, height), (0, -height), (-1, 0), name: "left", fill: fill)
translate((openess * 2, 0))
bezier((0, height), (0, -height), (1, 0), name: "right", fill: fill)
translate((-openess, 0))
anchor("north", (0, height))
anchor("south", (0, -height))
})
}
#let draw_lentil_rays(focal, obj, height: 1) = figure(canvas({
import draw: *
line((-4, 0), (4, 0), mark: (end: "straight"))
line((0, 2), (0, -2), name: "lentil")
let mult = if focal > 0 { 1 } else { -1 }
let virt = if obj > 0 { 1 } else { -1 }
mark("lentil.start", (rel: (0, mult * 0.1)), symbol: "straight")
mark("lentil.end", (rel: (0, mult * -0.1)), symbol: "straight")
point((-focal, 0), value: $F$, name: "F")
point((2 * -focal, 0), value: $2F$)
point((focal, 0), value: $F'$, name: "F'")
point((2 * focal, 0), value: $2F'$)
point((-obj, 0), value: $A$, name: "A", anchor: "north")
point((-obj, height), value: $B$, name: "B")
line("A", "B")
// parallel
line((-4, height), (0, height), stroke: red)
line((0, height), (4, height), stroke: (paint: red, dash: "dotted"))
line_through((0, height), "F'", box: ((0, 2), (4, -2)), stroke: (paint: red))
line_through((0, height), "F'", box: ((-4, 2), (0, -2)), stroke: (paint: red, dash: "dotted"))
// centered
line_through("B", (0, 0), box: ((-4, 2), (4, -2)), stroke: (paint: blue))
// through F
intersections("with_lentil", {
line_through("F", "B", box: ((-4, -2), (0, 2)), stroke: green, name: "through_object")
}, "lentil")
line_through("F", "B", box: ((-4, -2), (4, 2)), stroke: (paint: green, dash: "dotted"))
line("with_lentil.0", (rel: (4, 0)), stroke: (paint: green))
line("with_lentil.0", (rel: (-4, 0)), stroke: (paint: green, dash: "dotted"))
// Image
// 1/(OaA') = 1/(OaFa') + 1/(OaAa)
let image_x = 1/(1/(focal) + 1/(-obj))
let growth = (image_x)/(-obj)
point((image_x, 0), value: $A'$, anchor: "north-east", name: "A'")
point((image_x, height*growth), value: $B'$, anchor: "north-east", name: "B'")
line("A'", "B'")
}))
#let figure_lentille_convergente = figure(canvas({
import draw: *
line((-4, 0), (4, 0), mark: (end: "straight"))
line((0, 2), (0, -2), name: "lentil")
mark("lentil.start", (rel: (0, 0.1)), symbol: "straight")
mark("lentil.end", (rel: (0, -0.1)), symbol: "straight")
point((0, 0), value: $O$, anchor: "south-east")
let focal = 1.3
line((-focal, 0), (-focal, 2), stroke: (dash: "dotted"))
line((2 * -focal, 0), (2 * -focal, 2), stroke: (dash: "dotted"))
line((focal, 0), (focal, -2), stroke: (dash: "dotted"))
line((2 * focal, 0), (2 * focal, -2), stroke: (dash: "dotted"))
point((-focal, 0), value: $F$, name: "F", anchor: "north")
point((2 * -focal, 0), value: $2F$, name: "2F", anchor: "north")
point((focal, 0), value: $F'$, name: "F'")
point((2 * focal, 0), value: $2F'$, name: "2F'")
// A
set-style(stroke: blue)
circle((2.5 * -focal, 1), radius: 0.4, name: "A")
content("A", $A$)
circle((1.5 * focal, -1), radius: 0.4, name: "A'")
content("A'", $A'$)
// B
set-style(stroke: red)
circle((1.5 * -focal, 1), radius: 0.4, name: "B")
content("B", $B$)
circle((2.5 * focal, -1), radius: 0.4, name: "B'")
content("B'", $B'$)
// C
set-style(stroke: green)
circle((0.5 * -focal, 1), radius: 0.4, name: "C")
content("C", $C$)
circle((1.5 * -focal, -1.7), radius: 0.4, name: "C'")
content("C'", $C'$)
line((-2.8 * focal, -1), (-0.2 * focal, -1), mark: (start: "straight", end: "straight"))
// D
set-style(stroke: orange)
circle((1.5 * focal, 1.7), radius: 0.4, name: "D")
content("D", $D$)
line((2.8 * focal, 1), (0.2 * focal, 1), mark: (start: "straight", end: "straight"))
circle((0.5 * focal, -1), radius: 0.4, name: "D'")
content("D'", $D'$)
}))
#let figure_lentille_divergente = figure(canvas({
import draw: *
line((-4, 0), (4, 0), mark: (end: "straight"))
line((0, 2), (0, -2), name: "lentil")
mark("lentil.start", (rel: (0, -0.1)), symbol: "straight")
mark("lentil.end", (rel: (0, 0.1)), symbol: "straight")
point((0, 0), value: $O$, anchor: "south-east")
let focal = 1.3
line((-focal, 0), (-focal, -2), stroke: (dash: "dotted"))
line((2 * -focal, 0), (2 * -focal, -2), stroke: (dash: "dotted"))
line((focal, 0), (focal, 2), stroke: (dash: "dotted"))
line((2 * focal, 0), (2 * focal, 2), stroke: (dash: "dotted"))
point((-focal, 0), value: $F$, name: "F")
point((2 * -focal, 0), value: $2F$, name: "2F")
point((focal, 0), value: $F'$, name: "F'")
point((2 * focal, 0), value: $2F'$, name: "2F'")
// A
set-style(stroke: blue)
circle((1.5 * -focal, 1.7), radius: 0.4, name: "A")
content("A", $A$)
line((-2.8 * focal, 1), (-0.2 * focal, 1), mark: (start: "straight", end: "straight"))
circle((-0.5 * focal, -1), radius: 0.4, name: "A'")
content("A'", $A'$)
// B
set-style(stroke: red)
circle((0.5 * focal, 1), radius: 0.4, name: "B")
content("B", $B$)
circle((1.5 * focal, -1.7), radius: 0.4, name: "B'")
content("B'", $B'$)
line((2.8 * focal, -1), (0.2 * focal, -1), mark: (start: "straight", end: "straight"))
// C
set-style(stroke: green)
circle((1.5 * focal, 1), radius: 0.4, name: "C")
content("C", $C$)
circle((2.5 * -focal, -1), radius: 0.4, name: "C'")
content("C'", $C'$)
// D
set-style(stroke: orange)
circle((2.5 * focal, 1), radius: 0.4, name: "D")
content("D", $D$)
circle((1.5 * -focal, -1), radius: 0.4, name: "D'")
content("D'", $D'$)
}))
|
|
https://github.com/liuxu89/Principles | https://raw.githubusercontent.com/liuxu89/Principles/main/book.typ | typst |
#import "@preview/shiroa:0.1.1": *
#show: book
#book-meta(
title: "The Principles of Quantum Mechanics",
summary: [
// #prefix-chapter("sample-page.typ")[Hello, typst]
= The Principles of Quantum Mechanics
// = 1. The Principle of Superposition
- #chapter(none)[The Principle of Superposition]
- #chapter("src/chap-1/sec-1.typ")[The need for a quantum theory]
- #chapter("src/chap-1/sec-2.typ")[ The Polarization of photons]
]
)
// re-export page template
#import "/templates/page.typ": project
#let book-page = project
|
|
https://github.com/Caellian/UNIRI_voxels_doc | https://raw.githubusercontent.com/Caellian/UNIRI_voxels_doc/trunk/problem.typ | typst | #text(weight: "bold")[
(Iza naslovne stranice, na ovome mjestu, prilikom uvezivanja umetnite original zadatka završnog rada kojeg ste preuzeli od mentora)
]
#pagebreak()
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/fontawesome/0.1.0/README.md | markdown | Apache License 2.0 | # typst-fontawesome
A Typst library for Font Awesome icons through the desktop fonts.
## Usage
### Install the fonts
You can download the fonts from the official website: https://fontawesome.com/download
Or you can use the helper script to download the fonts and metadata:
`python helper.py -dd -v {version}`
Here `-dd` means to download and extract the zip file. You can use `-d` to only download the zip file.
After downloading the zip file, you can install the fonts depending on your OS.
#### Typst web app
You can simply upload the `otf` files to the web app and use them with this package.
#### Mac
You can double click the `otf` files to install them.
### Import the library
#### Using the typst packages
You can install the library using the typst packages:
`#import "@preview/fontawesome:0.1.0": *`
#### Manually install
Put the `lib.typ` file in your project directory, and import it:
`#import "lib.typ": *`
Here I recommend renaming the `lib.typ` file to `fontawesome.typ` to avoid name conflicts.
### Use the icons
You can use the `fa-icon` function to create an icon with its name:
`fa-icon("chess-queen")`
Or you can use the `fa-` prefix to create an icon with its name:
`fa-chess-queen()`
#### Full list of icons
You can find all icons on the [official website](https://fontawesome.com/search?o=r&m=free)
#### Different sets
By default, the library uses the free set. You can change it by passing the `fa-set` parameter to `fa-icon`:
`#fa-icon("github", fa-set: "Brands")`
Or you can change the default set by changing the `FA_SET` state.
`#fa-icon("github")` This cannot render the icon because the default set is `Free`.
`FA_SET.update("Brands")`
`#fa-icon("github")` This can render the icon because the default set is `Brands` now.
Reset the default set:
`FA_SET.update("Free")`
The `FA_VERSION` state can also be used to change the default font version. Its original value is `Font Awesome 6`.
#### Customization
The `fa-icon` function passes args to `text`, so you can customize the icon by passing parameters to it:
`#fa-icon("chess-queen", fill: blue)`
## Example
See the [`example.typ`](https://typst.app/project/rQwGUWt5p33vrsb_uNPR9F) file for a complete example.
## Contribution
Feel free to open an issue or a pull request if you find any problems or have any suggestions.
### Python helper
The `helper.py` script is used to download fonts and generate typst code. I aim only to use standard python libraries, so running it on any platform with python installed should be easy.
## License
This library is licensed under the MIT license. Feel free to use it in your project.
|
https://github.com/rinmyo/titech-thm | https://raw.githubusercontent.com/rinmyo/titech-thm/main/template.typ | typst | Other | #import "typst-slides/slides.typ": *
#let color = (
primary: rgb(0, 91, 148),
primary_c: rgb(148, 57, 0),
secondary: rgb(152, 125, 28),
secondary_c: rgb(28,55,152),
text: rgb(32, 56, 100),
text_c: rgb(100, 76, 32),
)
#let titech-theme(lang) = data => {
let scriptsize = 8pt
let flag = image.with("asset/flag.svg")
let _top_bar = place(top, rect(width: 100%, height: .41cm, fill: color.secondary, stroke: none))
let logical-slide = counter("logical-slide")
let alert(background: none, slide-info, bodies) = {
if bodies.len() != 1 {
panic("default variant of default theme only supports one body per slide")
}
let body = bodies.first()
//background
if background != none {
place(background)
}
//header
_top_bar + place(top+center, flag(width: if data.aspect-ratio == "16-9" {3/4} else {1} * 12.126%))
align(center + horizon, block(breakable: false, body))
}
let title-slide(slide-info, bodies) = {
if bodies.len() != 0 {
panic("title slide does not allow any body")
}
alert(background: image("asset/bg_" + data.aspect-ratio + ".jpg"), slide-info, ([
#v(1fr)
#block(inset: 1.65em, text(1.65em)[*#data.title*])
#line(length: 91%, stroke: .55pt)
#{
set text(size: .9em)
if data.subtitle != none {
v(1em)
text[*#data.subtitle*]
}
}
#v(1em)
#grid(
columns: (1fr,) * calc.min(data.authors.len(), 3),
column-gutter: 1em,
row-gutter: 1em,
[#text(size: .9em, data.authors.at(0).affiliation)\ #text(1.5em, data.authors.at(0).name)]
)
#v(4fr)
],))
}
let thanks(slide-info, bodies) = {
if bodies.len() > 1 {
panic("you cannot input bodies more than 1")
}
set text(1.5em, weight: "bold")
let content = if lang == "jp" [ご清聴ありがとうございました]
else if lang == "en" [Thanks for your listening!]
let body = bodies.at(0, default: content)
alert(
background: place(bottom, image("asset/bg_thanks_" + data.aspect-ratio + ".jpg")),
slide-info,
(move(dy: -9%, body),)
)
}
let default(slide-info, bodies) = {
set text(color.text)
set strong(delta: 100)
if bodies.len() != 1 {
panic("default variant of default theme only supports one body per slide")
}
let body = bodies.first()
// header
_top_bar + place(top+left, dx: 91%, flag(width: if data.aspect-ratio == "19-6" {86.84%} else {1} * 6.5%))
v(1em)
if "title" in slide-info {
block(
width: 100%, breakable: false,
inset: (x: 1em), outset: 0em,
heading(level: 1, slide-info.title)
)
}
v(1fr)
block(
width: 100%, inset: (x: 2em), breakable: false, outset: 0em,
body
)
v(2fr)
// footer
place(bottom + right, dx: -.4em, dy: -.5em, text(.9em, logical-slide.display()))
}
let wake-up(slide-info, bodies) = {
set text(color.text)
if bodies.len() != 1 {
panic("wake up variant of default theme only supports one body per slide")
}
let body = bodies.first()
block(
width: 100%, height: 100%, inset: 2em, breakable: false, outset: 0em,
fill: color.secondary,
text(size: 1.5em, fill: white, {v(1fr); body; v(1fr)})
)
}
(
"alert": alert,
"title slide": title-slide,
"thanks": thanks,
"default": default,
"wake up": wake-up,
)
}
#let project(
title: none,
authors: none,
subtitle: none,
date: none,
lang: "jp",
aspect-ratio: "4-3",
handout: false,
body
) = {
show: slides.with(
authors: authors,
theme: titech-theme(lang),
title: title,
subtitle: subtitle,
date: date,
handout: handout,
aspect-ratio: aspect-ratio,
)
// change here with your font size for main text
let main_size = if aspect-ratio == "16-9" {20pt} else {24pt}
set text(
main_size,
font: ("Noto Sans CJK JP", "Noto Sans"),
lang: lang,
)
show link: set text(color.text_c)
show raw: set text(font: "JuliaMono")
show figure: set text(0.7em)
body
} |
https://github.com/monlie/WeeklyRCBI | https://raw.githubusercontent.com/monlie/WeeklyRCBI/main/demo.typ | typst | MIT License | #import "weekly.typ": weekly
#show: doc => weekly(
doc,
author: "朱自清", // 汇报人
plan: "在清华园里继续写作。", // 一周工作计划
problem: "没什么问题。", // 可能存在问题
writting-date: datetime(year: 1927, month: 7, day: 1), // 支持两种日期模式,可以显式指定writting-date,也可以用day-offset控制偏移天数。
day-offset: -2, // 仅在不指定writting-date时,day-offset才会生效。-2表示你周日才写周报,如果你周三就写完了,填2😅
)
// 下面直接开始写正文,不需要关心格式
本周工作内容:
#figure(
image("lotus.png", width: 25%),
)
这几天心里颇不宁静。今晚在院子里坐着乘凉,忽然想起日日走过的荷塘,在这满月的光里,总该另有一番样子吧。月亮渐渐地升高了,墙外马路上孩子们的欢笑,已经听不见了;妻在屋里拍着闰儿#footnote("闰儿:指朱闰生,朱自清次子。"),迷迷糊糊地哼着眠歌。我悄悄地披了大衫,带上门出去。
沿着荷塘,是一条曲折的小煤屑路。这是一条幽僻的路;白天也少人走,夜晚更加寂寞。荷塘四面,长着许多树,蓊蓊郁郁#footnote("蓊(wěng)蓊郁郁:树木茂盛的样子。")的。路的一旁,是些杨柳,和一些不知道名字的树。没有月光的晚上,这路上阴森森的,有些怕人。今晚却很好,虽然月光也还是淡淡的。
路上只我一个人,背着手踱#footnote("踱(duó):慢慢地走。")着。这一片天地好像是我的;我也像超出了平常的自己,到了另一个世界里。我爱热闹,也爱冷静;爱群居,也爱独处。像今晚上,一个人在这苍茫的月下,什么都可以想,什么都可以不想,便觉是个自由的人。白天里一定要做的事,一定要说的话,现在都可不理。这是独处的妙处,我且受用这无边的荷香月色好了。
曲曲折折的荷塘上面,弥望#footnote("弥望:满眼。弥,满。")的是田田#footnote("田田:形容荷叶相连的样子。古乐府《江南曲》中有“莲叶何田田”之句。")的叶子。叶子出水很高,像亭亭的舞女的裙。层层的叶子中间,零星地点缀着些白花,有袅娜#footnote("袅娜(niǎo nuó):柔美的样子。")地开着的,有羞涩地打着朵儿的;正如一粒粒的明珠,又如碧天里的星星,又如刚出浴的美人。微风过处,送来缕缕清香,仿佛远处高楼上渺茫的歌声似的。这时候叶子与花也有一丝的颤动,像闪电般,霎时传过荷塘的那边去了。叶子本是肩并肩密密地挨着,这便宛然有了一道凝碧的波痕。叶子底下是脉脉#footnote("脉(mò)脉:这里形容水没有声音,好像饱含深情的样子。")的流水,遮住了,不能见一些颜色;而叶子却更见风致#footnote("风致:美的姿态。")了。
月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。虽然是满月,天上却有一层淡淡的云,所以不能朗照;但我以为这恰是到了好处——酣眠固不可少,小睡也别有风味的。月光是隔了树照过来的,高处丛生的灌木,落下参差的斑驳的黑影,峭楞楞如鬼一般;弯弯的杨柳的稀疏的倩影,却又像是画在荷叶上。塘中的月色并不均匀;但光与影有着和谐的旋律,如梵婀玲#footnote("梵婀玲:小提琴(violin)的音译。")上奏着的名曲。
荷塘的四面,远远近近,高高低低都是树,而杨柳最多。这些树将一片荷塘重重围住;只在小路一旁,漏着几段空隙,像是特为月光留下的。树色一例是阴阴的,乍看像一团烟雾;但杨柳的丰姿#footnote("丰姿:风度,仪态,一般指美好的姿态。也写作“风姿”"),便在烟雾里也辨得出。树梢上隐隐约约的是一带远山,只有些大意罢了。树缝里也漏着一两点路灯光,没精打采的,是渴睡#footnote("渴睡:也写作“瞌睡”。")人的眼。这时候最热闹的,要数树上的蝉声与水里的蛙声;但热闹是它们的,我什么也没有。
忽然想起采莲的事情来了。采莲是江南的旧俗,似乎很早就有,而六朝时为盛;从诗歌里可以约略知道。采莲的是少年的女子,她们是荡着小船,唱着艳歌去的。采莲人不用说很多,还有看采莲的人。那是一个热闹的季节,也是一个风流的季节。梁元帝《采莲赋》里说得好:
于是妖童媛女#footnote("妖童媛(yuàn)女:俊俏的少年和美丽的少女。妖,艳丽。媛,美女。"),荡舟心许;鷁首#footnote("鷁(yì)首:船头。古代画鷁鸟于船头。")徐回,兼传羽杯#footnote("羽杯:古代饮酒用的耳杯。又称羽觞、耳杯。");棹#footnote("棹(zhào):船桨。")将移而藻挂,船欲动而萍开。尔其纤腰束素#footnote("纤腰束素:腰如束素,齿如含贝(宋玉《登徒子好色赋》),形容女子腰肢细柔。"),迁延顾步#footnote("迁延顾步:形容走走退退不住回视自己动作的样子,有顾影自怜之意。");夏始春余,叶嫩花初,恐沾裳而浅笑,畏倾船而敛裾#footnote("敛裾(jū):这里是提着衣襟的意思。裾,衣襟。")。
可见当时嬉游的光景了。这真是有趣的事,可惜我们现在早已无福消受了。
于是又记起,《西洲曲》里的句子:
采莲南塘秋,莲花过人头;低头弄莲子,莲子清如水。
今晚若有采莲人,这儿的莲花也算得“过人头”了;只不见一些流水的影子,是不行的。这令我到底惦着江南了。——这样想着,猛一抬头,不觉已是自己的门前;轻轻地推门进去,什么声息也没有,妻已睡熟好久了。
一九二七年七月,北京清华园。 |
https://github.com/r8vnhill/apunte-bibliotecas-de-software | https://raw.githubusercontent.com/r8vnhill/apunte-bibliotecas-de-software/main/Unit2/Interfaces.typ | typst | == Interfaces
Una interfaz define un contrato que debe ser cumplido por las clases que la implementan.
Las interfaces especifican qué métodos y propiedades debe implementar una clase, sin proporcionar
una implementación completa.
=== Características de las Interfaces
- *No instanciables:* No se pueden crear instancias directamente de una interfaz.
- *Sin estado:* Las interfaces no almacenan estado.
=== Definición de una Interfaz
Aquí tienes un ejemplo de una interfaz simple en Kotlin, que define propiedades de solo lectura:
```kotlin
interface ReadPlayer {
val name: String
val lifePoints: Int
}
```
=== Extensión de Interfaces
Las interfaces pueden heredar de otras interfaces. En este caso, una interfaz extendida puede
sobreescribir las propiedades de la interfaz base para cambiar sus características, como convertir
una propiedad de solo lectura en una propiedad mutable.
```kotlin
interface ReadWritePlayer : ReadPlayer {
override var lifePoints: Int
}
```
=== Aspectos Importantes de la Herencia y Sobrescritura
- *Herencia:* Se declara usando el operador `:` después del nombre de la interfaz.
- *Sobrescritura explícita:* En Kotlin, cualquier miembro de una interfaz que se sobrescribe en una
subinterfaz o en una clase implementadora debe ser marcado explícitamente con la palabra clave
`override`.
=== Ejemplo Práctico
Aquí un ejemplo de cómo una clase puede implementar `ReadWritePlayer`:
```kotlin
class Player(override val name: String, override var lifePoints: Int) : ReadWritePlayer {
fun updateLifePoints(points: Int) {
lifePoints += points
}
}
```
Este código define una clase `Player` que implementa la interfaz `ReadWritePlayer`.
La clase proporciona una implementación concreta para las propiedades definidas en la interfaz y agrega un método adicional para actualizar los puntos de vida del jugador.
|
|
https://github.com/Dherse/boxaroo | https://raw.githubusercontent.com/Dherse/boxaroo/main/boxaroo.typ | typst | MIT License | #let true-blue = rgb(30, 100, 200)
#let caribbean-current = rgb(30, 100, 101)
#let proper-purple = rgb("#6f006f")
#let federal-blue = rgb(31, 28, 92)
#let earth-yellow = rgb(224, 164, 88)
#let atomic-tangerine = rgb(222, 143, 110)
#let __formats = state("boxaroo__formats", (
info: state("boxaroo_info"),
definition: state("boxaroo_definition"),
question: state("boxaroo_question"),
important: state("boxaroo_important"),
conclusion: state("boxaroo_conclusion"),
good: state("boxaroo_good"),
note: state("boxaroo_note"),
))
/// Define a new format.
#let define-format(name, prefix: none, icon: none, fill-color: none, stroke-color: none) = {
// Allow a default value for stroke-color.
if fill-color == none and stroke-color != none {
fill-color = stroke-color.lighten(90%)
}
__formats.update(formats => {
formats.insert(name, state("boxaroo_" + name, (
prefix: prefix,
icon: icon,
fill-color: fill-color,
stroke-color: stroke-color,
)))
formats
})
}
#let bbox(body, kind: "info", radius: 5pt, footer: none, icon: true, breakable: false) = locate(loc => {
let format = __formats.at(loc)
assert(format.keys().contains(kind), message: "Unknown boxaroo format: " + kind)
let settings = format.at(kind)
assert(type(settings) == state, message: "Invalid boxaroo settings for: " + kind)
let settings = settings.at(loc)
assert(settings != none, message: "Invalid boxaroo settings for: " + kind)
assert(type(settings) == type((:)), message: "Invalid boxaroo settings for: " + kind)
let keys = settings.keys();
assert(keys.contains("prefix"), message: "Missing prefix for: " + kind)
assert(keys.contains("icon"), message: "Missing icon for: " + kind)
assert(keys.contains("fill-color"), message: "Missing fill-color for: " + kind)
assert(keys.contains("stroke-color"), message: "Missing stroke-color for: " + kind)
show par: set block(spacing: 0pt)
let extra = if footer == none {
none
} else {
linebreak()
h(1fr)
underline[#footer]
}
let contents = if icon and settings.icon != none {
table(
columns: if icon { (38pt, 1fr) } else { 1 },
inset: 9.6pt,
stroke: none,
align: horizon,
block(settings.icon, width: 32pt, height: 32pt),
{
settings.prefix
body
extra
}
)
} else {
show: box.with(inset: 9.6pt)
settings.prefix
body
extra
}
block(
width: 100%,
fill: settings.fill-color,
stroke: 1pt + settings.stroke-color,
radius: radius,
inset: 0pt,
breakable: breakable,
contents,
)
})
// An info box.
#let binfo(body, ..args) = bbox(body, kind: "info", ..args)
// A definition box.
#let bdefinition(body, ..args) = bbox(body, kind: "definition", ..args)
// A question box.
#let bquestion(body, ..args) = bbox(body, kind: "question", ..args)
// An important box.
#let bimportant(body, ..args) = bbox(body, kind: "important", ..args)
// A conclusion box.
#let bconclusion(body, ..args) = bbox(body, kind: "conclusion", ..args)
// A note box.
#let bnote(body, ..args) = bbox(body, kind: "note", ..args)
#let boxaroo(body) = {
define-format(
"info",
icon: image("./circle-info.svg"),
stroke-color: true-blue,
)
define-format(
"definition",
prefix: underline(smallcaps[*Definition*]) + smallcaps[:],
icon: image("./highlighter-solid.svg"),
stroke-color: caribbean-current,
)
define-format(
"question",
icon: image("./circle-question.svg"),
stroke-color: proper-purple,
)
define-format(
"important",
icon: image("./circle-exclamation.svg"),
fill-color: federal-blue.lighten(90%),
stroke-color: federal-blue.darken(20%),
)
define-format(
"conclusion",
icon: image("./lightbulb-solid.svg"),
stroke-color: earth-yellow,
)
define-format(
"note",
prefix: underline(smallcaps[*Note*]) + smallcaps[:],
icon: image("./note-sticky.svg"),
stroke-color: atomic-tangerine,
)
body
} |
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/RT/styleAkatist.typ | typst | #import "/style.typ": *
#import "./textsTmp.typ": *
#let kondak(index, txt, zvolanie, velkost: none) = [
#align(center)[#primText[#index. KONDÁK]]
#par(first-line-indent: 1em, text(if (velkost == none) {11pt} else {velkost}, txt))
#if zvolanie == none {
pad(left: 30pt)[Aleluja, aleluja, aleluja.]
} else {
pad(left: 30pt)[#zvolanie]
}
]
#let ikos(index, txt, zvolania) = [
#align(center)[#primText[#index. IKOS]]
#par(first-line-indent: 1em)[#txt]
#let (..all, last) = zvolania
#let c = counter("c");
#c.update(1)
#pad(left: 30pt)[
#table(
columns: (30pt, auto),
stroke: none,
align: (x, y) => (right, left).at(x),
..all.map(k => ([#primText[#c.display("i:")]; #c.step()],[#k])).flatten()
)
]
#pad(left: 30pt)[#last]
]
#let akatistPage(index, content) = {
pagebreak()
kondak(index, content.kondak, content.zvolanie, velkost: if "kondak_velkost" in content {content.kondak_velkost} else {none})
ikos(index, content.ikos, content.prosby)
}
#let akatistGenerate(content) = {
pagebreak()
nacaloPoOtcenas
let counter = counter("kondak")
counter.update(1)
let (..all, last) = content
for page in all {
akatistPage(counter.display(), page)
counter.step()
}
let one = content.at(0)
pagebreak()
kondak(13, last.kondak, last.zvolanie, velkost: 10pt)
note[Tento kondák sa spieva tri razy, ľud vždy odpovedá Aleluja.]
ikos(13, one.ikos, one.prosby)
pagebreak()
kondak(1, one.kondak, one.zvolanie, velkost: 10pt)
if last.modlitba != none [
#text(if "velkost" in last {last.velkost} else {9pt})[
#note[Sv: ]#lettrine(last.modlitba)
#note[L: ]#lettrine("Amiň.")
]
]
prepustenie
} |
|
https://github.com/Lelidle/Q12-cs-scripts | https://raw.githubusercontent.com/Lelidle/Q12-cs-scripts/main/template.typ | typst | #import "@preview/showybox:1.1.0": showybox
#let xAchse = [$x-$Achse]
#let yAchse = [$y-$Achse]
#let setup(doc) = [
#set par(
justify: true
)
#set text(
font: "Times New Roman"
)
#show link: underline
#show link: set text(blue)
#set text(lang: "de")
#set raw(theme: "halcyon.tmTheme")
#set enum(numbering: (..args) => strong(numbering("1.", ..args))) // in Aufzählungen Zahlen fett
#show raw: it => block(
fill: rgb("#1d2433"),
inset: 8pt,
radius: 5pt,
text(fill: rgb("#a2aabc"), it)
)
#doc
]
#let prodRules(content: []) = {
let i = 0
let n = content.len() / 2
let c = []
while i < n {
let nr = i + 1
c = c + [ $ &(#nr) #h(4pt) #content.at(2*i) -> #content.at(2*i + 1) \ $ ]
i = i + 1
}
c = [ $ #c $ ]
c
}
#let definition(body, customTitle: "Definition", borderColor: rgb("4D4DFF")) = {
showybox(
frame: (
title-color: borderColor,
body-color: rgb("99BBFF"),
border-color: borderColor,
thickness: 2pt,
),
title-style: (
color:black
),
title: customTitle,
[
#body
]
)
}
#let satz(body, customTitle: "Satz") = {
showybox(
frame:(
radius: 0pt,
title-color: rgb("E69900"),
border-color: rgb("E69900"),
body-color: rgb("FFBB33")
),
title-style: (
color: black
),
shadow: (
color: black.lighten(25%),
offset: (x: 2pt, y: 4pt)
),
title: customTitle,
[
#body
]
)
}
#let task(body, customTitle: [*_Aufgabe_*]) = {
showybox(
frame: (
title-color: rgb("C9C9C9").lighten(50%),
border-color: rgb("949494"),
body-color: rgb("C9C9C9").lighten(50%)
),
title-style: (
boxed:true,
color: black,
boxed-align: center
),
title: customTitle,
[
#body
]
)
}
#let merke(body, path:"images/achtung.png") = {
showybox(
frame:(
border-color: rgb("FF0000"),
body-color: rgb("FFB3B3"),
inset: 15pt,
thickness: 3pt
),
[
#grid(
columns: (10%, 90%),
rows: (auto),
gutter: 10pt,
[#image(path)], [#align(left)[#body]]
)
]
)
}
#let hinweis(body, customTitle: [*_Hinweis_*], color: rgb("FFFF99"), border-color: rgb("FFDD33")) = {
showybox(
title-style: (
color:black,
sep-thickness: 0pt,
),
frame: (
border-color: border-color ,
thickness: (left:4pt),
radius: 0pt,
title-color:color,
body-color:color
),
title: customTitle,
[
#body
]
)
}
|
|
https://github.com/Dideldumm/realistic-polygons | https://raw.githubusercontent.com/Dideldumm/realistic-polygons/main/parcio-typst/bachelor-thesis/chapters/merge_closest_objects/merge_closest_objects.typ | typst | = Merge Closest Chains Algorithm
The main idea of this algorithm is that vertices that are far apart from each other should less likely be part of the same edge.
During the process, the algorithm builds up long polygonal chains.
In each iteration, the polygonal chains that are closest to each other are merged.
A single point is also considered a polygonal chain, so in the first iteration the algorithm will merge the two points with the smallest distance.
== Pseudocode
```c
function merge_closest_chains(PointSet point_set) -> Polygon {
polygonal_chains := point_set
while (polygonal_chains.size > 1) {
a, b := find_pair_of_nearest_chains(polygonal_chains)
c := merge_chains(a, b)
polygonal_chains.remove(a)
polygonal_chains.remove(b)
polygonal_chains.add(c)
}
return Polygon(polygonal_chains)
}
function find_pair_of_nearest_chains (PolygonalChainSet polygonal_chains) -> (PolygonalChain, PolygonalChain) {
// TODO add implementation
}
function merge_chains(PolygonalChain a, PolygonalChain b) -> PolygonalChain {
// TODO add implementation
}
```
bla |
|
https://github.com/ClazyChen/Table-Tennis-Rankings | https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history_CN/2019/MS-11.typ | typst |
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (1 - 32)",
table(
columns: 4,
[排名], [运动员], [国家/地区], [积分],
[1], [马龙], [CHN], [3546],
[2], [樊振东], [CHN], [3436],
[3], [许昕], [CHN], [3385],
[4], [王楚钦], [CHN], [3313],
[5], [林高远], [CHN], [3300],
[6], [林昀儒], [TPE], [3263],
[7], [蒂姆 波尔], [GER], [3235],
[8], [梁靖崑], [CHN], [3219],
[9], [迪米特里 奥恰洛夫], [GER], [3124],
[10], [周雨], [CHN], [3120],
[11], [雨果 卡尔德拉诺], [BRA], [3114],
[12], [帕特里克 弗朗西斯卡], [GER], [3111],
[13], [张本智和], [JPN], [3089],
[14], [闫安], [CHN], [3080],
[15], [郑荣植], [KOR], [3073],
[16], [于子洋], [CHN], [3055],
[17], [张禹珍], [KOR], [3033],
[18], [水谷隼], [JPN], [3005],
[19], [周启豪], [CHN], [2990],
[20], [金光宏畅], [JPN], [2988],
[21], [赵子豪], [CHN], [2985],
[22], [方博], [CHN], [2984],
[23], [孙闻], [CHN], [2970],
[24], [克里斯坦 卡尔松], [SWE], [2967],
[25], [马克斯 弗雷塔斯], [POR], [2957],
[26], [安宰贤], [KOR], [2956],
[27], [夸德里 阿鲁纳], [NGR], [2956],
[28], [赵胜敏], [KOR], [2956],
[29], [弗拉基米尔 萨姆索诺夫], [BLR], [2943],
[30], [刘丁硕], [CHN], [2941],
[31], [西蒙 高兹], [FRA], [2934],
[32], [乔纳森 格罗斯], [DEN], [2930],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (33 - 64)",
table(
columns: 4,
[排名], [运动员], [国家/地区], [积分],
[33], [马蒂亚斯 法尔克], [SWE], [2928],
[34], [#text(gray, "丁祥恩")], [KOR], [2927],
[35], [徐晨皓], [CHN], [2925],
[36], [宇田幸矢], [JPN], [2910],
[37], [神巧也], [JPN], [2909],
[38], [吉村真晴], [JPN], [2905],
[39], [#text(gray, "郑培峰")], [CHN], [2901],
[40], [森园政崇], [JPN], [2892],
[41], [HIRANO Yuki], [JPN], [2882],
[42], [陈建安], [TPE], [2880],
[43], [达科 约奇克], [SLO], [2879],
[44], [<NAME>], [SWE], [2876],
[45], [丹羽孝希], [JPN], [2871],
[46], [#text(gray, "马特")], [CHN], [2868],
[47], [#text(gray, "大岛祐哉")], [JPN], [2865],
[48], [艾曼纽 莱贝松], [FRA], [2864],
[49], [#text(gray, "朱霖峰")], [CHN], [2863],
[50], [安东 卡尔伯格], [SWE], [2861],
[51], [卢文 菲鲁斯], [GER], [2861],
[52], [李尚洙], [KOR], [2856],
[53], [吉村和弘], [JPN], [2852],
[54], [薛飞], [CHN], [2851],
[55], [<NAME>], [IND], [2851],
[56], [庄智渊], [TPE], [2850],
[57], [SHIBAEV Alexander], [RUS], [2850],
[58], [林钟勋], [KOR], [2849],
[59], [罗伯特 加尔多斯], [AUT], [2844],
[60], [WALTHER Ricardo], [GER], [2838],
[61], [黄镇廷], [HKG], [2830],
[62], [蒂亚戈 阿波罗尼亚], [POR], [2830],
[63], [徐瑛彬], [CHN], [2829],
[64], [托米斯拉夫 普卡], [CRO], [2824],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (65 - 96)",
table(
columns: 4,
[排名], [运动员], [国家/地区], [积分],
[65], [贝内迪克特 杜达], [GER], [2808],
[66], [及川瑞基], [JPN], [2806],
[67], [上田仁], [JPN], [2806],
[68], [PARK Ganghyeon], [KOR], [2804],
[69], [徐海东], [CHN], [2800],
[70], [赵大成], [KOR], [2796],
[71], [田中佑汰], [JPN], [2791],
[72], [王臻], [CAN], [2790],
[73], [吉田雅己], [JPN], [2790],
[74], [卡纳克 贾哈], [USA], [2789],
[75], [ZHAI Yujia], [DEN], [2788],
[76], [DRINKHALL Paul], [ENG], [2788],
[77], [TAKAKIWA Taku], [JPN], [2787],
[78], [特鲁斯 莫雷加德], [SWE], [2780],
[79], [帕纳吉奥迪斯 吉奥尼斯], [GRE], [2779],
[80], [MAJOROS Bence], [HUN], [2772],
[81], [#text(gray, "松平健太")], [JPN], [2772],
[82], [WEI Shihao], [CHN], [2769],
[83], [#text(gray, "GERELL Par")], [SWE], [2767],
[84], [利亚姆 皮切福德], [ENG], [2767],
[85], [巴斯蒂安 斯蒂格], [GER], [2765],
[86], [周恺], [CHN], [2762],
[87], [村松雄斗], [JPN], [2761],
[88], [户上隼辅], [JPN], [2759],
[89], [BADOWSKI Marek], [POL], [2755],
[90], [KOU Lei], [UKR], [2755],
[91], [SKACHKOV Kirill], [RUS], [2747],
[92], [博扬 托基奇], [SLO], [2746],
[93], [雅克布 迪亚斯], [POL], [2745],
[94], [沙拉特 卡马尔 阿昌塔], [IND], [2744],
[95], [#text(gray, "WANG Zengyi")], [POL], [2743],
[96], [HWANG Minha], [KOR], [2741],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (97 - 128)",
table(
columns: 4,
[排名], [运动员], [国家/地区], [积分],
[97], [汪洋], [SVK], [2739],
[98], [廖振珽], [TPE], [2737],
[99], [<NAME>], [SVK], [2735],
[100], [安德烈 加奇尼], [CRO], [2734],
[101], [ROBLES Alvaro], [ESP], [2733],
[102], [AKKUZU Can], [FRA], [2728],
[103], [#text(gray, "詹斯 伦德奎斯特")], [SWE], [2726],
[104], [塞德里克 纽廷克], [BEL], [2726],
[105], [#text(gray, "NORDBERG Hampus")], [SWE], [2725],
[106], [MONTEIRO Joao], [POR], [2723],
[107], [斯特凡 菲格尔], [AUT], [2714],
[108], [HO Kwan Kit], [HKG], [2712],
[109], [#text(gray, "金珉锡")], [KOR], [2708],
[110], [邱党], [GER], [2708],
[111], [牛冠凯], [CHN], [2708],
[112], [ANGLES Enzo], [FRA], [2707],
[113], [ISHIY Vitor], [BRA], [2704],
[114], [哈米特 德赛], [IND], [2703],
[115], [KARAKASEVIC Aleksandar], [SRB], [2697],
[116], [<NAME>], [PRK], [2696],
[117], [向鹏], [CHN], [2696],
[118], [CASSIN Alexandre], [FRA], [2694],
[119], [SZOCS Hunor], [ROU], [2690],
[120], [基里尔 格拉西缅科], [KAZ], [2689],
[121], [斯蒂芬 门格尔], [GER], [2688],
[122], [SIPOS Rares], [ROU], [2688],
[123], [WU Jiaji], [DOM], [2687],
[124], [<NAME>], [SLO], [2684],
[125], [MACHI Asuka], [JPN], [2682],
[126], [<NAME>], [AUT], [2680],
[127], [木造勇人], [JPN], [2680],
[128], [ORT Kilian], [GER], [2680],
)
) |
|
https://github.com/schmidma/typst-workshop | https://raw.githubusercontent.com/schmidma/typst-workshop/main/examples/05-lists.typ | typst | Creative Commons Zero v1.0 Universal | + First
+ Second
+ Third
- First
- First indented
- Second
- Third
- Third indented
- even more |
https://github.com/TJ-CSCCG/tongji-undergrad-thesis-typst | https://raw.githubusercontent.com/TJ-CSCCG/tongji-undergrad-thesis-typst/main/init-files/sections/acknowledgments.typ | typst | MIT License | #import "../../paddling-tongji-thesis/tongjithesis.typ": *
#heading("谢辞", numbering: none)
#empty-par()
本节通常用于感谢在研究过程中给予帮助和支持的人们,例如指导老师、实验室同学、朋友和家人等。
在谢辞中,需要真诚地表达感谢之情,回顾一下在研究过程中所受到的帮助和支持,并提到他们的具体贡献和重要性。同时,也可以简要说明一下自己在研究过程中的收获和体会,表达对他们的感激之情和祝福。
最后,需要注意不要出现太多的感情用词,语言简洁明了,表达真诚和诚恳即可。
谢谢支持本项目的所有朋友们。并且希望选用该模板的朋友们都能顺利通过查重与答辩。
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/syntax/embedded.typ | typst | // Test embedded expressions.
--- markup-expr-incomplete ---
// Error: 2-2 expected expression
#
--- markup-expr-incomplete-followed-by-text ---
// Error: 2-2 expected expression
# hello
|
|
https://github.com/daskol/typst-templates | https://raw.githubusercontent.com/daskol/typst-templates/main/neurips/checklist.typ | typst | MIT License | #import "/neurips.typ": url
#let TODO = text(fill: red, [*[TODO]*])
#let answerNA = text(fill: gray, "[NA]")
#let answerNo = text(fill: red, "[NO]")
#let answerYes = text(fill: blue, "[YES]")
#pagebreak(weak: true)
#set heading(numbering: none)
= NeurIPS Paper Checklist
// BEGIN INSTRUCTIONS
The checklist is designed to encourage best practices for responsible machine
learning research, addressing issues of reproducibility, transparency, research
ethics, and societal impact. Do not remove the checklist: *The papers not
including the checklist will be desk rejected.* The checklist should follow the
references and precede the (optional) supplemental material. The checklist
does NOT count towards the page limit.
Please read the checklist guidelines carefully for information on how to answer
these questions. For each question in the checklist:
- You should answer #answerYes, #answerNo, or #answerNA.
- #answerNA means either that the question is Not Applicable for that
particular paper or the relevant information is Not Available.
- Please provide a short (1–2 sentence) justification right after your answer
(even for NA).
*The checklist answers are an integral part of your paper submission.* They are
visible to the reviewers, area chairs, senior area chairs, and ethics
reviewers. You will be asked to also include it (after eventual revisions) with
the final version of your paper, and its final version will be published with
the paper.
The reviewers of your paper will be asked to use the checklist as one of the
factors in their evaluation. While "#answerYes" is generally preferable to
"#answerNo", it is perfectly acceptable to answer "#answerNo" provided a
proper justification is given (e.g., "error bars are not reported because it
would be too computationally expensive" or "we were unable to find the license
for the dataset we used"). In general, answering "#answerNo" or "#answerNA"
is not grounds for rejection. While the questions are phrased in a binary way,
we acknowledge that the true answer is often more nuanced, so please just use
your best judgment and write a justification to elaborate. All supporting
evidence can appear either in the main paper or the supplemental material,
provided in appendix. If you answer #answerYes to a question, in the
justification please point to the section(s) where related material for the
question can be found.
IMPORTANT, please:
#block({
set list(indent: 1em)
[
- *Delete this instruction block, but keep the section heading "NeurIPS paper
checklist",*
- *Keep the checklist subsection headings, questions/answers and guidelines
below.*
- *Do not modify the questions and only use the provided macros for your
answers.*
]
})
// END INSTRUCTIONS
#let claim(
name: [], question: [], answer: [], justification: [], guidelines: [],
) = {
set list(indent: 1em, tight: false)
show list: set block(spacing: 10pt)
show par: set block(spacing: 5.8pt)
[
*#name*
Question: #question
Answer: #answer
Justification: #justification
Guidelines:
#guidelines
]
}
+ #claim(
name: [Claims],
question: [
Do the main claims made in the abstract and introduction accurately reflect
the paper's contributions and scope?],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the abstract and introduction do not include the
claims made in the paper.
- The abstract and/or introduction should clearly state the claims made,
including the contributions made in the paper and important assumptions and
limitations. A No or NA answer to this question will not be perceived well
by the reviewers.
- The claims made should match theoretical and experimental results, and
reflect how much the results can be expected to generalize to other settings.
- It is fine to include aspirational goals as motivation as long as it is
clear that these goals are not attained by the paper.
])
+ #claim(
name: [Limitations],
question: [
Does the paper discuss the limitations of the work performed by the
authors?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper has no limitation while the answer No
means that the paper has limitations, but those are not discussed in the
paper.
- The authors are encouraged to create a separate "Limitations" section in
their paper.
- The paper should point out any strong assumptions and how robust the
results are to violations of these assumptions (e.g., independence
assumptions, noiseless settings, model well-specification, asymptotic
approximations only holding locally). The authors should reflect on how
these assumptions might be violated in practice and what the implications
would be.
- The authors should reflect on the scope of the claims made, e.g., if the
approach was only tested on a few datasets or with a few runs. In
general, empirical results often depend on implicit assumptions, which
should be articulated.
- The authors should reflect on the factors that influence the performance
of the approach. For example, a facial recognition algorithm may perform
poorly when image resolution is low or images are taken in low lighting.
Or a speech-to-text system might not be used reliably to provide closed
captions for online lectures because it fails to handle technical jargon.
- The authors should discuss the computational efficiency of the proposed
algorithms and how they scale with dataset size.
- If applicable, the authors should discuss possible limitations of their
approach to address problems of privacy and fairness.
- While the authors might fear that complete honesty about limitations
might be used by reviewers as grounds for rejection, a worse outcome
might be that reviewers discover limitations that aren't acknowledged in
the paper. The authors should use their best judgment and recognize that
individual actions in favor of transparency play an important role in
developing norms that preserve the integrity of the community. Reviewers
will be specifically instructed to not penalize honesty concerning
limitations.
])
+ #claim(
name: [Theory Assumptions and Proofs],
question: [
For each theoretical result, does the paper provide the full set of
assumptions and a complete (and correct) proof?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not include theoretical results.
- All the theorems, formulas, and proofs in the paper should be numbered
and cross-referenced.
- All assumptions should be clearly stated or referenced in the statement
of any theorems.
- The proofs can either appear in the main paper or the supplemental
material, but if they appear in the supplemental material, the authors
are encouraged to provide a short proof sketch to provide intuition.
- Inversely, any informal proof provided in the core of the paper should be
complemented by formal proofs provided in appendix or supplemental
material.
- Theorems and Lemmas that the proof relies upon should be properly
referenced.
])
+ #claim(
name: [Experimental Result Reproducibility],
question: [
Does the paper fully disclose all the information needed to reproduce the
main experimental results of the paper to the extent that it affects the
main claims and/or conclusions of the paper (regardless of whether the code
and data are provided or not)?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not include experiments.
- If the paper includes experiments, a No answer to this question will not
be perceived well by the reviewers: Making the paper reproducible is
important, regardless of whether the code and data are provided or not.
- If the contribution is a dataset and/or model, the authors should
describe the steps taken to make their results reproducible or verifiable.
- Depending on the contribution, reproducibility can be accomplished in
various ways. For example, if the contribution is a novel architecture,
describing the architecture fully might suffice, or if the contribution
is a specific model and empirical evaluation, it may be necessary to
either make it possible for others to replicate the model with the same
dataset, or provide access to the model. In general. releasing code and
data is often one good way to accomplish this, but reproducibility can
also be provided via detailed instructions for how to replicate the
results, access to a hosted model (e.g., in the case of a large language
model), releasing of a model checkpoint, or other means that are
appropriate to the research performed.
- While NeurIPS does not require releasing code, the conference does
require all submissions to provide some reasonable avenue for
reproducibility, which may depend on the nature of the contribution. For
example
#set enum(numbering: "(a)")
+ If the contribution is primarily a new algorithm, the paper should make
it clear how to reproduce that algorithm.
+ If the contribution is primarily a new model architecture, the paper
should describe the architecture clearly and fully.
+ If the contribution is a new model (e.g., a large language model), then
there should either be a way to access this model for reproducing the
results or a way to reproduce the model (e.g., with an open-source
dataset or instructions for how to construct the dataset).
+ We recognize that reproducibility may be tricky in some cases, in which
case authors are welcome to describe the particular way they provide
for reproducibility. In the case of closed-source models, it may be
that access to the model is limited in some way (e.g., to registered
users), but it should be possible for other researchers to have some
path to reproducing or verifying the results.
])
+ #claim(
name: [Open access to data and code],
question: [
Does the paper provide open access to the data and code, with sufficient
instructions to faithfully reproduce the main experimental results, as
described in supplemental material?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that paper does not include experiments requiring
code.
- Please see the NeurIPS code and data submission guidelines
(#url("https://nips.cc/public/guides/CodeSubmissionPolicy")) for more
details.
- While we encourage the release of code and data, we understand that this
might not be possible, so "No" is an acceptable answer. Papers cannot be
rejected simply for not including code, unless this is central to the
contribution (e.g., for a new open-source benchmark).
- The instructions should contain the exact command and environment needed
to run to reproduce the results. See the NeurIPS code and data submission
guidelines (#url("https://nips.cc/public/guides/CodeSubmissionPolicy"))
for more details.
- The authors should provide instructions on data access and preparation,
including how to access the raw data, preprocessed data, intermediate
data, and generated data, etc.
- The authors should provide scripts to reproduce all experimental results
for the new proposed method and baselines. If only a subset of
experiments are reproducible, they should state which ones are omitted
from the script and why.
- At submission time, to preserve anonymity, the authors should release
anonymized versions (if applicable).
- Providing as much information as possible in supplemental material
(appended to the paper) is recommended, but including URLs to data and
code is permitted.
])
+ #claim(
name: [Experimental Setting/Details],
question: [
Does the paper specify all the training and test details (e.g., data
splits, hyperparameters, how they were chosen, type of optimizer, etc.)
necessary to understand the results?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not include experiments.
- The experimental setting should be presented in the core of the paper to
a level of detail that is necessary to appreciate the results and make
sense of them.
- The full details can be provided either with the code, in appendix, or as
supplemental material.
])
+ #claim(
name: [Experiment Statistical Significance],
question: [
Does the paper report error bars suitably and correctly defined or other
appropriate information about the statistical significance of the
experiments?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not include experiments.
- The authors should answer "Yes" if the results are accompanied by error
bars, confidence intervals, or statistical significance tests, at least
for the experiments that support the main claims of the paper.
- The factors of variability that the error bars are capturing should be
clearly stated (for example, train/test split, initialization, random
drawing of some parameter, or overall run with given experimental
conditions).
- The method for calculating the error bars should be explained (closed
form formula, call to a library function, bootstrap, etc.)
- The assumptions made should be given (e.g., Normally distributed errors).
- It should be clear whether the error bar is the standard deviation or the
standard error of the mean.
- It is OK to report 1-sigma error bars, but one should state it. The
authors should preferably report a 2-sigma error bar than state that they
have a 96% CI, if the hypothesis of Normality of errors is not verified.
- For asymmetric distributions, the authors should be careful not to show
in tables or figures symmetric error bars that would yield results that
are out of range (e.g. negative error rates).
- If error bars are reported in tables or plots, The authors should explain
in the text how they were calculated and reference the corresponding
figures or tables in the text.
])
+ #claim(
name: [Experiments Compute Resources],
question: [
For each experiment, does the paper provide sufficient information on the
computer resources (type of compute workers, memory, time of execution)
needed to reproduce the experiments?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not include experiments.
- The paper should indicate the type of compute workers CPU or GPU,
internal cluster, or cloud provider, including relevant memory and storage.
- The paper should provide the amount of compute required for each of the
individual experimental runs as well as estimate the total compute.
- The paper should disclose whether the full research project required more
compute than the experiments reported in the paper (e.g., preliminary or
failed experiments that didn't make it into the paper).
])
+ #claim(
name: [Code Of Ethics],
question: [
Does the research conducted in the paper conform, in every respect, with
the NeurIPS Code of Ethics
#url("https://neurips.cc/public/EthicsGuidelines")
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the authors have not reviewed the NeurIPS Code
of Ethics.
- If the authors answer No, they should explain the special circumstances
that require a deviation from the Code of Ethics.
- The authors should make sure to preserve anonymity (e.g., if there is a
special consideration due to laws or regulations in their jurisdiction).
])
+ #claim(
name: [Broader Impacts],
question: [
Does the paper discuss both potential positive societal impacts and
negative societal impacts of the work performed?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that there is no societal impact of the work
performed.
- If the authors answer NA or No, they should explain why their work has no
societal impact or why the paper does not address societal impact.
- Examples of negative societal impacts include potential malicious or
unintended uses (e.g., disinformation, generating fake profiles,
surveillance), fairness considerations (e.g., deployment of technologies
that could make decisions that unfairly impact specific groups), privacy
considerations, and security considerations.
- The conference expects that many papers will be foundational research and
not tied to particular applications, let alone deployments. However, if
there is a direct path to any negative applications, the authors should
point it out. For example, it is legitimate to point out that an
improvement in the quality of generative models could be used to generate
deepfakes for disinformation. On the other hand, it is not needed to
point out that a generic algorithm for optimizing neural networks could
enable people to train models that generate Deepfakes faster.
- The authors should consider possible harms that could arise when the
technology is being used as intended and functioning correctly, harms
that could arise when the technology is being used as intended but gives
incorrect results, and harms following from (intentional or
unintentional) misuse of the technology.
- If there are negative societal impacts, the authors could also discuss
possible mitigation strategies (e.g., gated release of models, providing
defenses in addition to attacks, mechanisms for monitoring misuse,
mechanisms to monitor how a system learns from feedback over time,
improving the efficiency and accessibility of ML).
])
+ #claim(
name: [Safeguards],
question: [
Does the paper describe safeguards that have been put in place for
responsible release of data or models that have a high risk for misuse
(e.g., pretrained language models, image generators, or scraped datasets)?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper poses no such risks.
- Released models that have a high risk for misuse or dual-use should be
released with necessary safeguards to allow for controlled use of the
model, for example by requiring that users adhere to usage guidelines or
restrictions to access the model or implementing safety filters.
- Datasets that have been scraped from the Internet could pose safety
risks. The authors should describe how they avoided releasing unsafe
images.
- We recognize that providing effective safeguards is challenging, and many
papers do not require this, but we encourage authors to take this into
account and make a best faith effort.
])
+ #claim(
name: [Licenses for existing assets],
question: [
Are the creators or original owners of assets (e.g., code, data, models),
used in the paper, properly credited and are the license and terms of use
explicitly mentioned and properly respected?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not use existing assets.
- The authors should cite the original paper that produced the code package
or dataset.
- The authors should state which version of the asset is used and, if
possible, include a URL.
- The name of the license (e.g., CC-BY 4.0) should be included for each
asset.
- For scraped data from a particular source (e.g., website), the copyright
and terms of service of that source should be provided.
- If assets are released, the license, copyright information, and terms of
use in the package should be provided. For popular datasets,
#url("https://paperswithcode.com/datasets") has curated licenses for some
datasets. Their licensing guide can help determine the license of a
dataset.
- For existing datasets that are re-packaged, both the original license and
the license of the derived asset (if it has changed) should be provided.
- If this information is not available online, the authors are encouraged
to reach out to the asset's creators.
])
+ #claim(
name: [New Assets],
question: [
Are new assets introduced in the paper well documented and is the
documentation provided alongside the assets?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not release new assets.
- Researchers should communicate the details of the dataset/code/model as
part of their submissions via structured templates. This includes details
about training, license, limitations, etc.
- The paper should discuss whether and how consent was obtained from people
whose asset is used.
- At submission time, remember to anonymize your assets (if applicable).
You can either create an anonymized URL or include an anonymized zip file.
])
+ #claim(
name: [Crowdsourcing and Research with Human Subjects],
question: [
For crowdsourcing experiments and research with human subjects, does the
paper include the full text of instructions given to participants and
screenshots, if applicable, as well as details about compensation (if any)?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not involve crowdsourcing nor
research with human subjects.
- Including this information in the supplemental material is fine, but if
the main contribution of the paper involves human subjects, then as much
detail as possible should be included in the main paper.
- According to the NeurIPS Code of Ethics, workers involved in data
collection, curation, or other labor should be paid at least the minimum
wage in the country of the data collector.
])
+ #claim(
name: [
Institutional Review Board (IRB) Approvals or Equivalent for Research with
Human Subjects
],
question: [
Does the paper describe potential risks incurred by study participants,
whether such risks were disclosed to the subjects, and whether
Institutional Review Board (IRB) approvals (or an equivalent
approval/review based on the requirements of your country or institution)
were obtained?
],
answer: TODO, // Replace by answerYes, answerNo, or answerNA.
justification: TODO,
guidelines: [
- The answer NA means that the paper does not involve crowdsourcing nor
research with human subjects.
- Depending on the country in which research is conducted, IRB approval (or
equivalent) may be required for any human subjects research. If you
obtained IRB approval, you should clearly state this in the paper.
- We recognize that the procedures for this may vary significantly between
institutions and locations, and we expect authors to adhere to the
NeurIPS Code of Ethics and the guidelines for their institution.
- For initial submissions, do not include any information that would break
anonymity (if applicable), such as the institution conducting the review.
])
|
https://github.com/kokkonisd/typst-cross | https://raw.githubusercontent.com/kokkonisd/typst-cross/main/examples/full/crossword.typ | typst | The Unlicense | #import "@local/cross:0.0.2" as cross
#let crossword-data = toml("data.toml")
#cross.single-page(
crossword-data,
show-solution: false,
show-cell-coordinates: false,
cell-size: 23pt,
letter-size: 7pt,
number-size: 5pt,
margin: 0.2cm,
clue-columns: 3,
)
|
https://github.com/noahjutz/AD | https://raw.githubusercontent.com/noahjutz/AD/main/notizen/sortieralgorithmen/insertion_sort/induction_0.typ | typst | #import "/components/num_row.typ": single_num_row, arrowed, braced
#let nums = (4, 5, 3, 2, 1)
#single_num_row(
nums,
hl_success: range(2),
labels: (
(0, 1, arrowed(`j-1`)),
(1, 2, arrowed(`j`))
),
arrow: (
from: 0,
to: 1,
direction: "bidirectional"
)
) |
|
https://github.com/jcvar/resume | https://raw.githubusercontent.com/jcvar/resume/main/template.typ | typst | #let template(footer: none, c) = {
set page(
"us-letter",
margin: 25.4mm,
footer: align(center, text(0.5em, footer)),
)
let sz = 10pt;
set text(font: "Spectral", size: sz);
set block(spacing: 0.5em)
set par(leading: 0.5em)
show heading.where(level: 1): h => {
block(spacing: 0.5em, text(weight: 600, size: 2 * sz, h.body))
}
show heading.where(level: 2): h => {
block(above: 1.5em, below: 1em, text(weight: 200, size: sz, smallcaps(h.body)))
}
show heading.where(level: 3): h => {
block(above: 1em, below: 0.5em, text(weight: 600, size: sz, h.body))
}
show link: set text(font: "IBM Plex Mono", style: "italic", weight: 200)
c
}
#let date(d) = h(1fr) + text(weight: 200, smallcaps(d))
|
|
https://github.com/glennib/terraform-workshop | https://raw.githubusercontent.com/glennib/terraform-workshop/main/main.typ | typst | // Get Polylux from the official package repository
#import "@preview/polylux:0.3.1": *
#import "@preview/cetz:0.2.2"
#import themes.simple: title-slide, centered-slide, focus-slide, slide, simple-theme
#import pdfpc : speaker-note
// Make the paper dimensions fit for a presentation and the text larger
#set page(paper: "presentation-16-9")
#set text(size: 20pt, lang: "nb")
#show link: t => [#set text(blue); #underline[#t]]
#show heading: set block(below: 1em)
// Functionality for creating handouts.
// Do not remove, since automation tool will replace this
// line with ...(true) when creating handouts.
#enable-handout-mode(false)
// Use #polylux-slide to create a slide and style it using your favourite Typst functions
#title-slide[
= Terraform
Hva, hvorfor og hvordan
#[
#set text(size: 18pt)
Workshop \@ Amedia
]
#datetime(year: 2024, month: 6, day: 12).display()
]
#slide[
#v(1fr)
#grid(columns: (1fr, 1fr), [
#show outline.entry: it => [
#sym.bullet #h(0.2em) #it.element.body
]
#outline(depth: 1, fill: none)
], align(horizon, image("assets/Terraform_Logo.svg", width: 100%)))
#v(1fr)
]
#centered-slide[
= Slik håndterer vi infrastruktur i skyen
]
#centered-slide[
== ClickOps™
_Den raskeste veien til mål_
#link("assets/clickops.webm")[video]
]
#slide[
== CLI
_Presist, repeterbart_
```bash
gcloud --project='amedia-adp-test' pubsub \
topics create 'my-topic' \
--message-retention-duration=1d
gcloud --project='amedia-adp-test' pubsub \
subscriptions create 'my-subscription' \
--topic='my-topic'
```
#v(1fr)
#uncover(
2,
)[
#link(
"https://github.com/amedia/adp-content-metrics-publisher/blob/5f7620548ed3000935b42637b0716461ae74e6a2/infrastructure/create-infrastructure.sh",
)[`create-infrastructure.sh`]
]
]
#let steps_1 = cetz.canvas(
{
import cetz.draw: *
let my_scale = 1.0
set-style(
fill: gray.lighten(70%), stroke: (thickness: my_scale * 2pt), radius: 0.7 * my_scale,
)
circle((0 * my_scale, 1 * my_scale), name: "a")
circle((3 * my_scale, 3 * my_scale), name: "b")
circle((6 * my_scale, 0 * my_scale), name: "c", fill: green.lighten(70%))
set-style(
mark: (end: ">", scale: 3 * my_scale), stroke: (thickness: 4pt * my_scale),
)
line("a", "b")
line("b", "c")
},
);
#let steps_2 = cetz.canvas(
{
import cetz.draw: *
let my_scale = 1.0
set-style(
fill: red.lighten(70%), stroke: (thickness: my_scale * 2pt, dash: "dashed"), radius: 0.7 * my_scale,
)
circle(
(0 * my_scale + 8 * my_scale, 1 * my_scale - 1.0 * my_scale), name: "a2", fill: gray.lighten(70%), stroke: (dash: "solid"),
)
circle(
(3 * my_scale + 8 * my_scale, 3 * my_scale - 1.0 * my_scale), name: "b2",
)
content((), "?")
circle(
(6 * my_scale + 8 * my_scale, 0 * my_scale - 1.0 * my_scale), name: "c2",
)
content((), "?")
set-style(fill: none, stroke: (dash: "solid"), radius: 0.7 * my_scale)
circle((0 * my_scale, 1 * my_scale), name: "a", stroke: (dash: "dashed"))
circle((3 * my_scale, 3 * my_scale), name: "b")
circle((6 * my_scale, 0 * my_scale), name: "c", fill: green.lighten(90%))
content((), ":(")
set-style(
mark: (end: ">", scale: 3 * my_scale), stroke: (thickness: 4pt * my_scale),
)
line("a2", "b2")
line("b2", "c2")
},
);
#slide[
== Fellestrekk
_ClickOps og CLI_
- Sekvens av steg som forhåpentligvis tar deg til mål
- Beskriver handlinger, ikke tilstand
- Er ikke "idempotent"
#v(1em)
#only(1)[#steps_1]
#only(2)[#steps_2]
]
#centered-slide[
= Dette er Terraform
infrastruktur som kode \
_(infrastrucure as code, IaC)_
]
#slide[
== Man beskriver ønsket tilstand
#grid(columns: (1fr, 1fr), [
Jeg vil ha:
- Et pubsub topic som heter `my-fancy-topic`
- En subscription som heter `my-fancy-topic-subscription`
- ack-deadline på 20 sekunder
- pusher til et endepunkt
], [
#uncover(2)[
#set text(size: 13pt)
```hcl
resource "google_pubsub_topic" "the-topic" {
name = "my-fancy-topic"
}
resource "google_pubsub_subscription" "the-subscription" {
name = "my-fancy-topic-subscription"
topic = google_pubsub_topic.the-topic.name
ack_deadline_seconds = 20
push_config {
push_endpoint = "https://example.com/notify"
}
}
```
]
])
]
#slide[
#image("assets/terraform-concepts-1.svg", width: 100%)
]
#centered-slide[
= Derfor er det lurt å bruke Terraform
]
#slide[
== Å bruke Terraform er lurt fordi
- koden _er_ infrastrukturen $==>$ "dokumentasjonen" vedlikeholdes automatisk
- historikk ved hjelp av `git`
- tjenestene blir mer reproduserbare
#v(1fr)
#uncover(2)[
En tjeneste består av både kode _og_ infrastruktur
]
]
#centered-slide[
= Slik fungerer det (_ish_)
]
#slide[
== Eksempel: Et pubsub topic og en subscription
#only((1, 4))[
```hcl
resource "google_pubsub_topic" "the-topic" {
name = "my-fancy-topic"
}
resource "google_pubsub_subscription" "the-subscription" {
name = "my-fancy-topic-subscription"
topic = google_pubsub_topic.the-topic.name
ack_deadline_seconds = 20
push_config {
push_endpoint = "https://my-endpoint.example.com/notify"
}
description = "Subscribes to id ${google_pubsub_topic.the-topic.id}"
}
```
]
// empty lines to make the code blocks the same height
#only(2)[
```hcl
resource "google_pubsub_topic" "the-topic" {
name = "my-fancy-topic"
}
```
ressurstype, navn (scopet), argument
]
#only(3)[
```hcl
resource "google_pubsub_topic" "the-topic" {
name = "my-fancy-topic"
}
resource "google_pubsub_subscription" "the-subscription" {
topic = google_pubsub_topic.the-topic.name
description = "Subscribes to id ${google_pubsub_topic.the-topic.id}"
}
```
referanse til argument og attributt
]
#v(1fr)
]
#slide[
#image("assets/terraform-concepts-1.svg", width: 100%)
]
#slide[
#show heading: set block(below: 0.7em) // in this slide the default block is too large
== Prosessen i grove trekk
#grid(
columns: (1fr, 1fr),
gutter: 1em,
stroke: (x, y) => {
if (x == 0) {
(
right: (dash: "dashed")
)
}
else {
none
}
},
[
- utvikleren endrer på en *konfigurasjon* (f.eks. legger til ressurser i `main.tf`)
#uncover(
"3-",
)[
- terraform sammenlikner konfigurasjonen med en *tilstand* og lager en *plan*
]
#uncover("4-")[
- terraform får tilgang til skyen ved hjelp av en *provider*
]
#uncover("5-")[
- ved hjelp av providerens API-er gjør terraform endringer i ressurser
]
#uncover("6-")[
- tilstanden er nå oppdatert slik at den stemmer med konfigurasjonen
]
], [
#uncover("2-")[
/ konfigurasjon: filer som slutter med `.tf`
]
#uncover("3-")[
/ tilstand: vanligvis `default.tfstate` -- lagret lokalt eller i en bøtte (en *backend*) --
beskriver hvilke ressurser terraform tracker og tilstanden til disse ressursene
-- holdes i synk ved hver `terraform plan/refresh`
/ plan: en sekvens av handlinger som utgjør en diff, og fører til at tilstanden er slik
konfigurasjonen tilsier
]
#uncover(
"4-",
)[
/ provider: en plugin som beskriver hvilke ressurser som er tilgjengelige, og hvordan de
konfigureres
]
],
)
]
#centered-slide[
= Noen vanlige operasjoner
legge til en ressurs \
`count` og `for_each` \
Med demonstrasjon fra lokal kjøring av Terraform
#v(1em)
#uncover("2-")[
```bash
git clone https://github.com/glennib/terraform-workshop.git
cd terraform
```
Her er det mulig å kjøre litt lokalt i et prosjekt du selv har tilgang til.
Bytt ut #box(`amedia-adp-test`) med et annet testprosjekt.
```bash
sed -i 's/amedia-adp-test/YOUR-PROJECT-HERE/' main.tf
gcloud auth application-default login
terraform init
```
]
]
#centered-slide[
== Legge til en ressurs
#speaker-note(
```md
Lag en ny mappe med terraform-filer basert på privat tf test repo
Lag en ny topic ressurs i `main.tf` og kjør `terraform init` og `terraform apply`
Sjekk at ressursen er opprettet i skyen
```,
)
]
#centered-slide[
== Bruke `count` og `for_each`
#speaker-note(```md
Legg til subscribers med `count` og deretter `for_each`
```)
]
#centered-slide[
== Lage en modul
#speaker-note(
```md
Flytt disse ressursene til en modul og bruk modulen i `main.tf`, med variabler og outputs
```
)
]
#centered-slide[
= Håndtering av «drift»
Hva om noen tuller det til med ClickOps™?
]
#slide[
#image("assets/terraform-concepts-2.svg", width: 100%)
]
#slide[
== Noen har lagt til en ressurs med ClickOps™
- Dette er helt OK, Terraform tracker ikke ressurser som ikke er i tilstanden, og
vil derfor ikke gjøre noe med dem.
- Om man ønsker å tracke dem med Terraform etter at de er opprettet, kan man
importere dem.
]
#slide(image("assets/terraform-concepts-3.svg", width: 100%))
#slide[
+ Konfigurér ressursblokker som tilsvarer ressursene som allerede eksisterer
```hcl
resource "google_pubsub_topic" "the-topic" { ... }
```
+ Importér de eksisterende ressursene
```bash
terraform import google_pubsub_topic.the-topic projects/<project-id>/topics/<topic-id>
```
+ Se om konfigurasjonen matcher tilstanden
```bash
terraform plan
```
+ Om konfigurasjonen matcher, vil Terraform ikke gjøre noen endringer. Om ikke, må
konfigurasjonen tilpasses, eller så må man akseptere at tilstanden endres:
```bash
terraform apply
```
]
#slide[
== Har man Terraformet noe som man ønsker å håndtere videre med ClickOps™?
- Da må man få Terraform til å "glemme" ressursen, og fjerne den fra
konfigurasjonen.
]
#slide(image("assets/terraform-concepts-4.svg", width: 100%))
#slide[
+ Fjern ressursen fra konfigurasjonen
```hcl
// fjern denne blokken
resource "google_pubsub_topic" "the-topic" { ... }
```
+ "Glem" ressursen fra tilstanden
```bash
terraform state rm google_pubsub_topic.the-topic
```
+ Se om konfigurasjonen matcher tilstanden
```bash
terraform plan
```
Planen skal ikke vise noen endringer.
]
#slide[
== Hva om man ønsker å terraforme ressursen, men ikke _alle_ attributtene?
+ Oppdater konfigurasjonen med en `lifecycle`-blokk som inneholder `ignore_changes`
```hcl
resource "google_pubsub_topic" "the-topic" {
name = "my-fancy-topic"
lifecycle {
ignore_changes = ["message_retention_duration"]
}
}
```
+ Sjekk at en ny plan ikke medfører endringer.
]
#slide[
== Jeg ønsker å endre navn på eller flytte en ressurskonfigurasjon
+ Flytt eller gi nytt navn til ressursen i konfigurasjonen
```hcl
// endra fra "the-topic"
resource "google_pubsub_topic" "hot-topic" {
name = "my-fancy-topic"
}
```
+ Flytt til riktig adresse i tilstanden
```bash
terraform state mv \
google_pubsub_topic.the-topic \
google_pubsub_topic.hot-topic
```
+ Sjekk at en ny plan ikke medfører endringer.
]
#slide[
== Jeg ønsker å flytte en frittstående ressurs inn i en modul
`terraform state mv` fungerer også mellom, inn, og ut av moduler:
```bash
terraform state mv \
google_pubsub_topic.the-topic \
module.my-fancy-module.google_pubsub_topic.hot-topic
```
]
#slide[
= `amedia-apps-*` - vi må rydde litt
```bash
git clone <EMAIL>:amedia/terraform-selvbetjening.git
cd projects/amedia-apps-test
```
]
#slide[
== Alt er flatt + mapper er moduler
#only("1-2")[
#side-by-side[
```
amedia-apps-test
├── aiven
│ ├── ...
├── atlantis.tf
├── eavis.tf
├── einherjer.tf
├── encamp-write-pubsub.tf
├── imported-buckets.tf
├── jotunheim.tf
├── midgard-bucket.tf
├── midgard.tf
└── ...
```
][
#uncover("2-")[
```hcl
// midgard.tf
resource "google_storage_bucket" "midgard" {
// ...
}
// einherjer.tf
resource "google_storage_bucket" "einherjer" {
// ...
}
```
]
]
]
#only("3-")[
#side-by-side[
```
.
├── modules
│ ├── midgard
│ │ ├── main.tf
│ │ ├── output.tf
│ │ ├── README.md
│ │ └── variables.tf
│ └── yggdrasil/...
└── projects
├── amedia-apps-prod
│ └── main.tf
└── amedia-apps-test/...
```
][
#uncover(4)[
`projects/amedia-apps-prod/main.tf`:
```hcl
module "midgard" {
source = "../modules/midgard"
// parametrize this
}
module "yggdrasil" {
source = "../modules/yggdrasil"
// parametrize this
}
// ...
```
Gjør det likt i `amedia-apps-test`.
]
]
]
]
#slide[
= Annet
- `terraform fmt -recursive` og `terraform validate`
#uncover("2-")[- Kan jeg hoppe over ressurser om noen andre har skapt mye drift? #uncover("3-")[ \ (Ja, se `terraform apply -target=<resource-address>`).]]
#uncover("4-")[- Hva er Atlantis?]
#uncover("5-")[- Alternativer til Terraform?]
]
#slide[
#heading(outlined: false)[Oppsummering]
#v(1em)
#line-by-line[
- Terraform (og andre _IaC_-verktøy) er en måte å håndtere infrastruktur gjennom å beskrive ønsket tilstand framfor sekvenser av handlinger.
- Bruk av _IaC_ gjør at tjenestene våre blir mer reproduserbare og bedre dokumentert.
- Vi har sett på en del vanlige operasjoner og håndtering av "drift".
- Vi har sett på tilstand og (forsøkt og) gjort litt opprydding i `amedia-apps-test`.
]
#set align(right)
#v(1fr)
#image("assets/Terraform_Logo.svg", height: 20%)
]
|
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Maths_Expertes_Ex_12_12_2023.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Maths Expertes Ex 12 12 2023",
authors: (
"<NAME>",
),
date: "11 Décembre, 2023",
)
#set heading(numbering: "1.1.")
=== Exercice 37p150
<exercice-37p150>
+ #block[
#set enum(numbering: "a.", start: 1)
+ $16 times lr((minus 17)) plus 21 times 13 eq 1$ Donc le couple
$lr((minus 17 semi 13))$ est solution de $16 x plus 21 y eq 1$
+ On peut écrire $lr((E))$ comme
$797 lr((16 x plus 21 y)) eq 1 lr((797))$ Donc en multipliant le
couple solution de la première équation on obtient une solution
particulière de $lr((E))$ soit le couple
$lr((minus 13549 semi 10361))$ est solution de $lr((E))$
+ $16 times 4 plus 21 times lr((minus 3)) eq 1$ Donc le couple
$lr((4 semi minus 3))$ est solution de $16 x plus 21 y eq 1$
+ On peut écrire $lr((E))$ comme
$797 lr((16 x plus 21 y)) eq 1 lr((797))$ Donc en multipliant le
couple solution de la première équation on obtient une solution
particulière de $lr((E))$ soit le couple
$lr((3188 semi minus 2391))$ est solution de $lr((E))$
]
+ Soit $lr((x semi y))$ solution. Alors
$16 lr((x minus 3188)) plus 21 lr((y plus 2391)) eq 0$ donc
$16 lr((3188 minus x)) eq 21 lr((y plus 2391))$, or en utilisant
l’algorithme d’Euclide $P G C D lr((16 semi 21)) eq 1$ car
$21 eq 16 times 1 plus 5$ , $16 eq 5 times 3 plus 1$ ,
$5 eq 5 times 1 plus 0$ donc $16$ et $21$ sont premiers entre eux,
selon le théorème de Gauss, $21 bar.v 3188 minus x$ donc il existe un
entier relatif $k$ tel que $3188 minus x eq 21 k$
$x eq 3188 minus 21 k$. On a donc
$16 lr((3188 minus 3188 plus 21 k)) eq 21 lr((y plus 2391))$
$16 k eq y plus 2391$ $y eq 16 k minus 2391$ Donc le couple
$lr((3188 minus 21 k semi 16 k minus 2391))$ est solution avec
$k in m a t h b b Z$
$S eq brace.l lr((3188 minus 21 k semi 16 k minus 2391)) comma k in m a t h b b Z brace.r$
#block[
#set enum(numbering: "1.", start: 2)
+ Tant que $3188 minus 21 k gt 0$ et $16 k minus 2391 gt 0$ car il ne
peut pas perdre de l’argent sur un plat il existe un couple solution.
Or quand $k eq 150$, $lr((38 semi 9))$ est un couple solution et en
prenant $k eq 151$, $lr((17 semi 25))$ Donc pour tout $k gt 149$ il
existe un couple solution dans $bb(N)^2$, on ne peut donc pas
déterminer le nombre de repas de chaque sorte que le restaurateur a
servi.
]
=== Exercice 39p150
<exercice-39p150>
+ Vrai le couple $lr((minus 1 semi 1))$ est solution
+ Faux. En divisant par 3 on obtient $10 x minus 4 y eq 1$ soit selon le
théoème de Bézout $4$ et $10$ premiers entre eux or $4$ et $10$ ont
$2$ comme diviseur commun donc $P G C D eq.not 1$
+ Faux. $lr((1 semi 1))$ sont solution et $lr((4 semi minus 1))$ donc il
existe au moins deux solution à cette équation
+ Vrai. Cette équation a des équations si et seulement si $5$ et $12$
sont premiers entre eux d’après le théorème de Bézout. En utilisant
l’algorithme d’Euclide on obtient $12 eq 2 times 5 plus 2$
$5 eq 2 times 2 plus 1$ $2 eq 1 times 2 plus 0$ soit
$P G C D lr((12 semi 5)) eq 1$ donc $5$ et $12$ sont bien premiers
entre eux.
|
|
https://github.com/Zateros/analizis-1 | https://raw.githubusercontent.com/Zateros/analizis-1/main/elso.typ | typst | #let colorS = color.rgb("#B4D3B4")
#set page(
paper: "a4",
numbering: "1.",
margin: (x: 40pt, y: 40pt)
)
#set document(
author: "<NAME> & <NAME>",
title: "Első Analízis I. ZH kérdései"
)
#set text(
size: 15pt,
font: "Times New Roman"
)
#set par(justify: true)
#set enum(numbering: "i.)")
#show heading.where(level: 2): it => block(
fill: colorS,
inset: 10pt,
radius: 4pt,
)[#it]
#show heading.where(level: 1): it => align(center)[#it]
#show heading.where(level: 3): it => [#underline[#it]]
= I. analízis ZH bizonyítással kért tételek
== Teljes indukció elve
Tegyük fel, hogy minden $n$ természetes számra adott egy $A(n)$ állítás, és azt tudjuk, hogy
+ $A(0)$ igaz
+ ha $A(n)$ állítás igaz, akkor $A(n+1)$ is igaz
Ekkor az $A(n)$ állítás minden $n$ természetes számra igaz.
=== Bizonyítás
Legyen
$ S colon.eq {n in NN bar A(n) "igaz"} $
Ekkor $S subset NN$ és $S$ induktív halmaz, hiszen $0 in S$, és ha $n in S$, azaz $A(n)$ igaz, akkor $A(n + 1)$ is igaz, ezért $n + 1 in S$ teljesül, következésképpen $S$ induktív halmaz. Mivel $NN$ a legszűkebb induktív halmaz, ezért az $NN subset S$ tartalmazás is fennáll, tehát $S eq NN$. Ez pedig azt jelenti, hogy minden $n$ természetes számra igaz.
#pagebreak()
== A szuprémum elv
Legyen $H subset RR$ és tegyük fel, hogy
+ $H eq.not emptyset$
+ $H$ felülről korlátos
Ekkor
$ exists min{K in RR bar K "felsőkorlátja" H"-nak"} $
=== Bizonyítás
Legyen
$ A colon.eq H space "és" space B colon.eq {K in RR bar K "felsőkorlátja" H"-nak"} $
A feltételek miatt $A eq.not emptyset "és" B eq.not emptyset$, továbbá
$ forall a in A "és" forall K in B: a lt.eq K $
A teljességi axiómából következik, hogy
$ exists epsilon in RR: a lt.eq epsilon lt.eq K space (a in A, K in B) $
Erre az $epsilon$-ra az teljesül, hogy
+ $epsilon$ felsőkorlátja $H$-nak, hiszen $a lt.eq epsilon$ minden $a in A$ esetén
+ $epsilon$ a legkisebb felső korlát, ui. ha $K$ egy felső korlát (azaz $K in B$), akkor $K gt.eq epsilon$.
Ez pedig pontosan azt jelenti, hogy $epsilon$ a $H$ halmaz legkisebb felső korlátja.
#pagebreak()
== Az arkhimédészi tulajdonság
Minden $a gt 0$ és minden $b$ valós számhoz létezik olyan $n$ természetes szám, hogy $b lt n dot a$, azaz
$ forall a gt 0 "és" forall b in RR: exists n in NN: b lt n dot a $
=== Bizonyítás (indirekt módon)
Tegyük fel, hogy
$ exists a gt 0 "és" exists b in RR: forall n in NN: b gt.eq n dot a $
Legyen
$ H colon.eq {n dot a in RR bar n in NN} $
Ekkor $H eq.not emptyset$ és $H$ felülről korlátos, hiszen $n dot a lt.eq b$ minden $n in NN$-re. A szuprémum elv szerint:
$ exists sup H eq.colon epsilon $
Ekkor $epsilon$ a legkisebb felsőkorlátja $H$-nak, tehát $epsilon - a$ nem felső korlát. Ez azt jelenti, hogy:
$ exists n_0 in NN: n_0 dot a gt epsilon - a arrow.double.r.l.long (n_0 + 1) dot a gt epsilon $
Azonban $(n_0 + 1) dot a in H$, tehát $(n_0 + 1) dot a lt.eq epsilon$, hiszen $epsilon$ felső korlátja a $H$ halmaznak. Így ellentmondáshoz jutunk.
#pagebreak()
== A Cantor-tulajdonság
Tegyük fel, hogy minden n természetes számra adott az $[a_n,b_n] subset RR$ korlátos és zárt intervallum úgy, hogy
$ [a_(n+1),b_(n+1)] subset [a_n,b_n] space (n in NN) $
Ekkor
$ sect.big_(n in NN)[a_n,b_n] eq.not emptyset $
=== Bizonyítás (teljességi axiómát alkalmazva)
Legyen
$ A colon.eq {a_n bar n in NN} "és" B colon.eq {b_n bar n in NN} $
Először belátjuk, hogy
$ a_n lt.eq b_m "tetszőleges" n,m in NN "esetén" $
Valóban,
+ ha $n lt.eq m$, akkor $a_n lt.eq a_m lt.eq b_m$
+ ha $m lt n$, akkor $a_n lt.eq b_n lt.eq b_m$
Mivel $A eq.not emptyset "és" B eq.not emptyset$, ezért "$a_n lt.eq b_m "tetszőleges" n,m in NN "esetén"$" miatt a teljességi axióma feltételei teljesülnek, így
$ exists epsilon in RR: a_n lt.eq epsilon lt.eq b_m space space forall n,m in RR "indexre" $
Ha $n eq m$, akkor azt kapjuk, hogy
$ a_n lt.eq epsilon lt.eq b_n space arrow.double.l.r.long space epsilon in [a_n,b_n] forall n in NN "esetén" $
és azt jelenti, hogy
$ epsilon in sect.big_(n in NN)[a_n,b_n] eq.not emptyset $
#pagebreak()
== Konvergens sorozatok határértékének egyértelműsége
(\*) #h(weak: true,20pt) $exists A in RR: forall epsilon gt 0: exists n_0 in NN: forall n gt n_0 "indexre" |a_n - A| lt epsilon$
Ha az $(a_n) : NN → RR$ sorozat konvergens, akkor a konvergencia definíciójában szereplő $A$ szám egyértelműen létezik.
=== Bizonyítás
Tegyük fel, hogy az $(a_n)$ sorozatra (\*) az $A_1$ és az $A_2$ számokkal is teljesül.
Indirekt módon tegyük fel azt is, hogy $A_1 eq.not A_2$.
Ekkor $forall epsilon gt 0$ számhoz
$ exists n_1 in NN: forall n gt n_1 : abs(a_n − A_1) lt epsilon $
$ exists n_2 in NN: forall n gt n_2 : abs(a_n − A_2) lt epsilon $
Válasszuk itt speciálisan az
$ epsilon colon.eq abs(A_1 - A_2)/2 $
(pozitív) számot. Az ennek megfelelő $n_1, n_2$ indexeket figyelembe véve legyen
$ n_0 colon.eq max{n_1,n_2} $
Ha $n in NN "és" n gt n_0$, akkor nyilván $n gt n_1 "és" n gt n_2$ is fennáll, következésképpen
$ abs(A_1 - A_2) eq abs((A_1 - a_n) + (a_n - A_2))lt.eq abs(a_n - A_1) + abs(a_n - A_2) \ lt epsilon + epsilon eq 2epsilon eq abs(A_1 - A_2) $
amiből (a nyilván nem igaz) $abs(A_1 − A_2) lt abs(A_1 - A_2)$
következne. Ezért csak $A_1 eq A_2$ lehet.
#pagebreak()
== A konvergencia és a korlátosság kapcsolata
Ha az $(a_n)$ sorozat konvergens, akkor korlátos is.
=== Bizonyítás
Tegyük fel, hogy $(a_n)$ konvergens és $lim(a_n) eq A in RR$. Válasszuk a konvergencia definíciója szerinti jelöléssel $epsilon$-t 1-nek. Ehhez a hibakorláthoz
$ exists n_0 in NN, forall n gt n_0: abs(a_n - A) lt 1 $
Így
$ abs(a_n) eq abs((a_n - A) + A) lt.eq abs(a_n - A) + abs(A) lt 1 + abs(A) space space space (n gt n_0) $
Ha $n lt.eq n_0$, akkor
$ abs(a_n) lt.eq max{abs(a_0),abs(a_1),dots,abs(a_n_0)} $
Legyen
$ K colon.eq max{abs(a_0),abs(a_1),dots,abs(a_n_0), 1 + abs(A)} $
Ekkor $abs(a_n) lt.eq K$ minden $n in NN$ indexre,és ez azt jelenti, hogy $(a_n)$ sorozat korlátos.
#pagebreak()
== Monoton részsorozatok létezésére vonatkozó tétel
Minden $a eq (a_n)$ valós sorozatnak létezik monoton részsorozata, azaz létezik olyan $v eq (v_n)$ indexsorozat, amellyel $a compose v$ monoton növekvő vagy monoton csökkenő.
=== Bizonyítás
Az állítás igazolásához bevezetjük egy sorozat csúcsának a fogalmát: Azt mondjuk, hogy $a_n_0$ az $(a_n)$ sorozat csúcsa (vagy csúcseleme), ha
$ forall n gt.eq n_0 "indexre" a_n lt.eq a_n_0 $
Két eset lehetséges:
+ A sorozatnak végtelen sok csúcsa van. Ez azt jelenti, hogy $ exists v_0 in NN: a_v_0 "csúcselem, azaz " forall n gt.eq v_0: a_n lt.eq a_v_0 $ $ exists v_1 gt v_0: a_v_1 "csúcselem, azaz " forall n gt.eq v_1: a_n lt.eq a_v_1 (lt.eq a_v_0) $ Ezek a lépések folytathatók, mert végtelen sok csúcselem van. Így olyan $v_0 lt v_1 lt v_2 lt dots$ indexsorozatot kapunk, amelyre $ a_v_0 gt.eq a_v_1 gt.eq a_v_2 gt.eq dots"," $ ezért a csúcsok $(a_v_n)$ sorozata $(a_n)$-nek egy monoton csökkenő részsorozata.
+ A sorozatnak legfejlebb véges sok csúcsa van. Ez azt jelenti, hogy $ exists N in NN, forall n gt.eq N "esetén" a_n "már nem csúcs" $ Mivel $a_N$ nem csúcselem, ezért $ exists v_0 gt N: a_v_0 gt a_N $ Azonban $a_v_0$ sem csúcselem, ezért $ exists v_1 gt v_0: a_v_1 gt a_v_0 (gt a_N) $ Az eljárást folytatva most olyan $v_0 lt v_1 lt v_2 lt dots$ indexsorozatot kapunk, amelyre $ a_v_0 lt a_v_1 lt a_v_2 lt dots $ Ebben az esetben tehát $(a_v_0)$ sorozat $(a_n)$-nek egy (szigorúan) monoton növekvő részsorozata.
#pagebreak()
== A sorozatokra vonatkozó közrefogási elv
Tegyük fel, hogy az $(a_n), (b_n), (c_n)$ sorozatokra teljesülnek a következők:
#list(
$ exists N in NN, forall n gt N: a_n lt.eq b_n lt.eq c_n$,
$ "az" (a_n) "és a" (c_n) "sorozatnak van határértéke, továbbá"$
)
$ lim(a_n) eq lim(c_n) eq A in macron(RR) $
Ekkor a $(b_n)$ sorozatnak is van határértéke és $lim(b_n) eq A$
#set enum(numbering: "1.")
=== Bizonyítás
Három eset lehetséges:\
*1. eset:* $A in RR$ Legyen $epsilon gt 0$ tetszőleges valós szám. $lim(a_n) = lim(c_n) = A$ azt jelenti, hogy $(a_n) "és" (c_n)$ azonos A határértékkel rendelkező konvergens sorozatok. A konvergencia definíciója szerint tehát
$ exists n_1 in NN, forall n gt n_1 : A - epsilon lt a_n lt A + epsilon $
$ exists n_2 in NN, forall n gt n_2 : A - epsilon lt c_n lt A + epsilon $
Legyen $n_0 colon.eq max{N, n_1, n_2}.$ Ekkor $forall n gt n_0$ indexre
$ A - epsilon lt a_n lt.eq b_n lt.eq c_n lt A + epsilon $
Ez az jelenti, hogy
$ abs(b_n - A) lt epsilon, space "ha" n gt n_0 $
azaz a $(b_n)$ sorozat konvergens, tehát van határértéke, és $lim(b_n) = A$
*2. eset:* $A eq +infinity$ Tegyük fel, hogy $P gt 0$ tetszőleges valós szám. A $lim(a_n) eq +infinity$ értelmezése szerint
$ exists n_1 in NN, forall n gt n_1 : a_n gt P $
Legyen $n_0 colon.eq max{N, n_1}.$ Ekkor $forall n gt n_0$ indexre
$ P lt a_n lt.eq b_n $
és ez azt jelenti hogy $lim(b_n) eq +infinity$
*3. eset:* $A eq -infinity$ Tegyük fel, hogy $P lt 0$ tetszőleges valós szám. A $lim(c_n) eq -infinity$ értelemzése szerint
$ exists n_1 in NN, forall n gt n_1 : c_n lt P $
Legyen $n_0 colon.eq max{N,n_1}$, akkor $forall n gt n_0$ indexre
$ P gt c_n gt.eq b_n $
Ez pedig azt jelenti, hogy $lim(b_n) eq -infinity$
#pagebreak()
== A határérték és a rendezés kapcsolata
Tegyük fel, hogy az $(a_n)$ és a $(b_n)$ sorozatnak van határértéke és $ lim(a_n) = A in macron(RR) , lim(b_n) = B in macron(RR) $
Ekkor:
1. $ A lt B arrow.r.double.long exists N in NN, forall n gt N : a_n lt b_n $
2. $ exists N in NN, forall n gt N : a_n lt.eq b_n arrow.r.long.double A lt.eq B$
=== Bizonyítás
*1.* Azt már tudjuk, hogy bármely két különböző $macron(RR)$-beli elem szétválasztható diszjunkt környezetekkel:
$ forall A,B in macron(RR), A != B"-hez" exists r_1,r_2 gt 0, K_"r1" (A) sect K_"r2" (B) = emptyset dot $
Világos, hogy ha $A < B$, akkor $forall x in K_"r1" (A), forall y in K_"r2" (B): x lt y$
Mivel $lim(a_n) = A "és" lim(b_n) = B$ , így a definíció értelmében
$ exists n_1 in NN, forall n > n_1 : a_n in K_"r1" (A) $
$ exists n_2 in NN, forall n > n_2 : b_n in K_"r2" (B) $
Legyen $N colon.eq max{n_1,n_2}.$ Ekkor $forall n gt N$ esetén
$ a_n in K_"r1" (A) "és" b_n in K_"r2" (B) arrow.r.long.double a_n lt b_n $
*2.* Indirekt módon bizonyítjuk. Tegyük fel, hogy $A > B$. Ekkor a már igazolt 1. állítás szerint $exists N ∈ NN$, hogy minden $n gt N$ indexre $b_n lt a_n$, ami ellentmond a feltételnek.
#pagebreak()
== Műveletek nullsorozatokkal
Tegyük fel, hogy $lim(a_n) = 0 "és" lim(b_n) = 0$
Ekkor
+ $(a_n + b_n)$ is nullsorozat,
+ ha $(c_n)$ korlátos sorozat, akkor $(c_n dot.op a_n)$ is nullsorozat
+ $(a_n dot.op b_n)$ is nullsorozat
=== Bizonyítás
*1.* Mivel $lim(a_n) = lim(b_n) = 0, "ezért" forall epsilon gt 0"-hoz"$
$ exists n_1 in NN, forall n gt n_1 : abs(a_n) lt epsilon/2 $
$ exists n_2 in NN, forall n gt n_2 : abs(b_n) lt epsilon/2 $
Legyen $n_0 colon.eq max{n_1,n_2}$. Ekkor $forall n gt n_0$ indexre
$ abs(a_n + b_n) lt.eq abs(a_n) + abs(b_n) lt epsilon/2 + epsilon/2 eq epsilon, $
és ez azt jelenti, hogy $lim(a_n + b_n) = 0$, azaz $(a_n + b_n)$ valóban nullsorozat.
*2.* A $(c_n)$ sorozat korlátos, ezért
$ exists K gt 0 : abs(c_n) lt K (n in NN) $
Mivel $(a_n)$ nullsorozat, ezért
$ forall epsilon gt 0"-hoz" exists n_0 in NN, forall n gt n_0 : abs(a_n) lt epsilon/K, $
következésképpen minden $ n gt n_0$ indexre
$ abs(c_n dot.op a_n) eq abs(c_n) dot.op abs(a_n) lt K dot.op epsilon/K eq epsilon, $
azaz $lim(c_n dot.op a_n) eq 0.$
*3.* Mivel minden konvergens sorozat korlátos, ezért a $lim(b_n) = 0$ feltételből következik, hogy $(b_n)$ korlátos sorozat. Az állítás tehát a 2. állítás közvetlen következménye.
#pagebreak()
== Konvergens sorozatok szorzatára vonatkozó tétel
Tegyük fel, hogy az $(a_n)$ és a $(b_n)$ sorozat konvergens. Legyen
$ lim(a_n) = A in RR "és" lim(b_n) = B in RR $
Ekkor
$(a_n dot.op b_n)$ is konvergens és $lim(a_n dot.op b_n) = lim(a_n) dot.op lim(b_n) = A dot.op B$
#set math.cases(reverse: true)
=== Bizonyítás
(\*) #h(weak: true,20pt)$(x_n)$ konvergens, és $alpha in RR$ a határértéke $arrow.r.l.double.long (x_n - alpha)$ nullsorozat
(\*) miatt elég megmutatni, hogy $(a_n b_n - A B)$ nullsorozat. Ez a következő átalakítással igazolható:
$ a_n b_n - A B = a_n b_n - A b_n + A b_n - A B = (b_n) dot.op (a_n - A) + A dot.op (b_n - B) $
A fenti gondolatmenetben a $(b_n)$ sorozat azért korlátos, mert konvergens.
#pagebreak()
== Konvergens sorozatok hányadosára vonatkozó tétel
Tegyük fel, hogy az $(a_n) "és a" (b_n)$ sorozat konvergens. Legyen
$ lim(a_n) = A in RR "és" lim(b_n) = B in RR $
Ekkor ha $b_n != 0 (n in NN) "és" lim(b_n) != 0$, akkor
$ (a_n/b_n) "is konvergens, és" lim(a_n/b_n) = lim(a_n)/lim(b_n) = A/B $
=== Bizonyítás
(\*) $(x_n)$ konvergens, és $alpha in RR$ a határértéke $arrow.r.l.long.double (x_n - alpha)$ nullsorozat.
=== Segédtélel:
Ha $b_n != 0 (n in NN)$ és $(b_n)$ konvergens, továbbá $B colon.eq lim(b_n) != 0$, akkor az
$ (1/b_n) $
reciprok-sorozat korlátos.\
Ennek bizonyításához legyen $epsilon colon.eq abs(B)/2$. Ekkor egy alkalmas $n_0 in NN$ küszöbindex mellett
$ abs(b_n - B) lt epsilon eq abs(B)/2 space space forall n gt n_0 "indexre." $
Így minden $n gt n_0$ esetén
$ abs(b_n) gt.eq abs(B) - abs(b_n - B) gt abs(B) - abs(B)/2 = abs(B)/2 $
hiszen $abs(B) eq abs(B - b_n + b_n) lt.eq abs(B-b_n) + abs(b_n)$. Tehát
$ abs(1/b_n) lt 2/abs(B)," ha " n gt n_0, $
következésképpen az
$ abs(1/b_n) lt.eq max{1/abs(b_0),1/abs(b_1),....,1/abs(b_n_0), 2/abs(B)} $
egyenlőtlenség már minden $n in NN$ számra teljesül, ezért az $(a/b_n)$ sorozat valóban korlátos. A segédtételt tehát bebizonyítottuk.\
\
Most az látjuk be, hogy az
$ (1/b_n) "sorozat konvergens és" lim(1/b_n) = 1/B $
Ez (\*)-ből következik az alábbi átalakítással:
$ 1/b_n - 1/B eq (B - b_n)/(B dot.op b_n) eq 1/(B dot.op b_n) dot.op (B - b_n) $
Az állítás bizonyításának a befejezéséhez már csak azt kell figyelembe venni, hogy
$ a_n/b_n eq a_n dot.op 1/b_n space (n in NN) $
más szóval az $(a_n/b_n)$ hányados-sorozat két konvergens sorozat szorzata. Így a 2. állítás (konvergens sorozat szorzata) és a reciprok sorozatról az előb mondottak miatt
$ (a_n/b_n) "is konvergens és" lim(a_n/b_n) eq A dot.op 1/B = A/B = lim(a_n)/lim(b_n) $
#pagebreak()
== Monoton növekvő sorozatok határértékére vonatkozó tétel (véges és végtelen eset)
Minden $(a_n)$ monoton sorozatnak van határértéke.
1. Ha $(a_n) arrow.tr$ és felülről korlátos, akkor $(a_n)$ konvergens és
$ lim(a_n) = sup{a_n | n in NN} $
2. Ha $(a_n) arrow.tr$ és felülről nem korlátos, akkor $lim(a_n) = +infinity$
=== Bizonyítás
Tegyük fel, hogy az $(a_n)$ sorozat monoton növekvő és felülről korlátos. Legyen
$ A colon.eq sup{a_n | n in NN} in RR. $
Ez azt jelenti, hogy $A$ a szóban forgó halmaznak a legkisebb felső korlátja, azaz
#list($forall n in NN : a_n lt.eq A "és"$,
$forall epsilon gt 0"-hoz" exists n_0 in NN : A - epsilon lt a_"n0" lt.eq A.$)
Mivel a feltételezésünk szerint az $(a_n)$ sorozat monoton növekvő, ezért az
$ A - epsilon lt a_"n0" lt.eq a_n lt.eq A. $
becslés is igaz minden $n gt n_0$ indexre. Azt kaptuk tehát, hogy
$ forall epsilon gt 0"-hoz" exists n_0 in NN, forall n gt n_0 : abs(a_n -A) lt epsilon. $
Ez pontosan azt jelenti, hogy az $(a_n)$ sorozat konvergens, és $lim(a_n) = A$.\
\
2. Tegyük fel, hogy az $(a_n)$ sorozat monoton növekvő és felülről nem korlátos. Ekkor
$ forall P > 0"-hoz" exists n_0 in NN : a_"n0" gt P. $
A monotonitás miat ezért egyúttal az is igaz, hogy
$ forall n gt n_0 : a_n gt.eq a_"n0" gt P, $
és ez pontosan azt jelenti, hogy $lim(a_n) eq +infinity.$
#pagebreak()
== Az $a_n colon.eq (1 + 1 / n)^n (n in NN^(+))$ sorozat konvergenciája
Az $ a_n colon.eq (1 + 1 / n)^n (n in NN^(+)) $ sorozat szigorúan monoton növekvő ls felülről korlátos, tehát konvergens. Legyen
$ e colon.eq limits(lim)_(n arrow.r +infinity)(1+1/n)^n. $
=== Bizonyítás
Az állítást a számtani és a mértani közép közötti egyenlőtlenség „ötletes”
felhasználásaival bizonyítjuk.
#list($"A monotonitás igazolásához az egyenlőtlenséget az " (n+1) "darab"$)
$ 1, 1+1/n, 1+ 1/n, ... space, 1+1/n $
számra alkalmazzuk. Mivel ezek nem mind egyenlők, ezért
$ root(n+1,1 dot.op (1+1/n)^n) lt (1+n dot.op (1+1/n))/(n+1) eq (n+2)/(n+1) = 1 +1/(n+1) $
Mindkét oldalt $(n+1)$-edik hatványra emelve azt kapjuk, hogy
$ a_n eq (1+1/n)^n lt (1+ 1/(n+1))^(n+1) eq a_(n+1) (n in NN^(+)) $
amivel beláttuk, hogy a sorozat szigorúan monoton növekvő.
#list("A korlátosság bebizonyításához most az (n+2) darab")
$ 1/2, 1/2, 1+1/n, 1+ 1/n, ... space, 1+1/n $
számra alkalmazzuk ismét a számtani és a mértani közép közötti egyenlőtlenséget:
$ root(n+2,1/2 dot.op 1/2 dot.op (1+1/n)^n) lt (2 dot.op 1/2 + n dot.op (1+1/n))/(n+2) eq (n+2)/(n+2) = 1 $
Ebből következik, hogy
$ a_n eq (1+1/n)^n lt 4 space space(n in NN^(+)) $
ezért a sorozat felülről korlátos.\
A monoton sorozatok határértékére vonatkozó tételből következik, hogy a sorozat konvergens.
#pagebreak()
== Newton-féle iterációs eljárás m-edik gyökök keresésére
Legyen $A > 0$ valós szám és $m ≥ 2$ természetes szám. Ekkor az
#set math.cases(reverse: false)
$ cases(
a_0 gt 0 "tetszőleges valós szám,",
a_(n+1) colon.eq 1/m (A/a_n^(m-1) + (m-1)a_n) space (n in NN)
) $
rekurzióval értelmezett $(a_n)$ sorozat konvergens, és az $alpha colon.eq lim(a_n)$ határértékére igaz,
hogy $alpha gt 0$ és
$ alpha^m = A. $
=== Bizonyítás
Az állítást több lépésben igazoljuk.\
==== 1.Lépés
Teljes indukcióval könnyen igazolható, hogy az $(a_n)$ sorozat „jól definiált” és
$a_n gt 0 space (n in NN)$.
==== 2.Lépés
Igazoljuk, hogy az $(a_n)$ sorozat konvergens. A monoton sorozatok konvergenciájára vonatkozó tételt fogjuk alkalmazni.\
\
A sorozat alulról korlátos és 0 egy triviális alsó korlát (az 1. lépés alapján).\
\
Most megmutatjuk azt, hogy az $(a_n)$ sorozat a második tagtól kezdve monoton csökkenő, azaz
$ a_(n+1) lt.eq a_n arrow.l.r.long.double a_(n+1)/a_n lt.eq 1, space space "ha" n eq 1,2,... $
A rekurzív képlet szerint minden $n in NN^(+)$ esetén
$ a_(n+1)/a_n eq 1/m (A/a_n^(m) + m-1) lt.eq 1 arrow.l.r.double.long a_n^m gt.eq A $
A jobb oldali egyenlőtlenség igazolására a számtani és a mértani közép közötti egyenlőtlenség következő alakját fogjuk alkalmazni: ha $x_1, x_2, . . . , x_m$ tetszés szerinti nemnegatív valós számok, akkor\
($triangle$) $ x_1 dot.op x_2 dot.op ... dot.op x_m lt.eq ((x_1 +x_2 + ... + x_m)/m)^m. $
és az egyenlőség akkor és csak akkor áll fenn, ha $x_1 = x_2 = · · · = x_m$. Fontos
hangsúlyozni, hogy lényegében ezt az alakot igazoltuk gyakorlaton, és csak az medik gyök egyértelmű létezése után írhatjuk fel az egyenlőtlenséget a megszokott alakban.\
Vegyük észre, hogy a rekurzív képlet jobb oldalán álló összeg az m darab
$ x_1 colon.eq A/(a_n^(m-1)), x_2 = a_n, x_3=a_n, ... ,x_m = a_n space (n in NN) $
pozitív szám számtani közepe. Ezért ($triangle$) miatt
$ a_(n+1)^m eq (1/m dot.op (A/a_n^(m-1) + a_n + ... + a_n))^m eq ((x_1 + x_2 + ... + x_m)/m)^m gt.eq\ x_1 dot.op x_2 dot.op ... dot.op x_m eq A/(a_n^(m-1)) dot.op a_n dot.op a_n dot.op ... dot.op a_n eq A space (n in NN) $
Sikerült igazolnunk tehát, hogy $a_n^m gt.eq A space (n in NN^(+))$, ezzel azt, hogy az $(a_n)$ sorozat a
második tagtól kezdve monoton csökkenő\
Az $(a_n)$ sorozat tehát monoton csökkenő a második tagtól kezdve és alulról korlátos,
ezért a monoton sorozatok határértékére vonatkozó tétel alapján $(a_n)$ konvergens
==== 3.Lépés
Kiszámítjuk a sorozat határértékét. Legyen
$ alpha colon.eq lim(a_n) $
Az eddigiekből az következik, hogy $alpha gt.eq 0$. Fontos észrevétel azonban az, hogy az
$alpha gt 0$ egyenlőtlenség is igaz. Ez az állítás a konvergens sorozatok és a műveletek
kapcsolatára vonatkozó tételből, valamint a határérték és a rendezés kapcsolatára
vonatkozó tételből következik, hiszen
$ a_n^m gt.eq a_n arrow.r alpha arrow.long.double.r a_n^m arrow.r a^m gt.eq A gt 0 arrow.long.double.r alpha gt 0 $
Az $(a_n)$ sorozatot megadó rekurzív összefüggésben az $n arrow +infinity$ határátmenetet véve
az $alpha$ határértékre egy egyenletet kapunk. Valóban, ha alkalmazzuk a konvergens
sorozatok és a műveletek kapcsolatára vonatkozó tételeket (itt használjuk az $alpha gt 0$
egyenlőtlenséget), akkor az adódik, hogy
$ alpha arrow.l a_(n+1) eq 1/m (A/a^(m-1)+(m-1) dot.op a_n) arrow 1/m (A/a^(m-1)+(m-1)alpha). $
A határérték egyértelműsége miatt
$ alpha = 1/m (A/a^(m-1)+(m-1)alpha). $
Innen már egyszerű átrendezéssel az kapjuk, hogy
$ m dot.op a^m eq A + (m-1)alpha^m arrow.r.long.double a^m eq A $
#pagebreak()
== A Cauchy-féle konvergenciakritérium sorozatokra
Legyen $(a_n)$ eg valós sorozat.\
Ekkor\
$ (a_n) "konvergens" arrow.l.r.double.long (a_n) "Cauchy-sorozat" $
=== Bizonyítás
$arrow.double$ Tegyük fel, hogy $(a_n)$ konvergens, és $A colon.eq lim(a_n)$ a határértéke. Legyen $epsilon gt 0$ tetszőleges valós szám. A konvergencia definíciója szerint
$ exists n_0 in NN, forall n gt n_0 : abs(a_n - A) lt epsilon/2 $
Így $forall m,n gt n_0$ index esetén
$ abs(a_n - a_m) eq abs((a_n -A) + (A - a_m)) lt.eq abs(a_n - A) + abs(a_m - A) lt epsilon/2 + epsilon/2 = epsilon $
és ez azt jelenit, hogy $(a_n)$ Cauchy-sorozat.
$arrow.double.l$ Tegyük fel, hogy $(a_n)$ Cauchy-sorozat. Több lélpésen keresztül látjuk be, hogy $(a_n)$ konvergens.
==== 1.Lépés
Igazoljuk, hogy $(a_n)$ korlátos sorozat.\
A Cauchy-sorozat definíciójában $epsilon eq 1$-hez van olyan $n_1 in NN$ index, hogy
$ forall m,n gt n_1 : abs(a_n - a_m) lt 1. $
Legyen $m eq n_1 +1$. Ekkor minden $n gt n_1$ esetén
$ abs(a_n) eq abs((a_n - a_(n_1+1)) + a_(n_1+1)) lt.eq abs(a_n - a_(n_1+1)) + abs(a_(n_1+1)) lt 1 + abs(a_(n_1+1)) $
Következésképpen az
$ abs(a_n) lt.eq max{abs(a_0), abs(a_1), ... , abs(a_n_1), 1 + abs(a_(n_1+1))} $
egyenlőtlenség már minden $n in NN$ számra igaz, azaz a sorozat valóban korlátos
==== 2.Lépés
A Bolzano-Weierstrass-féle kiválasztási tételből következik, hogy $(a_n)$-nek
létezik egy $(a_v_n)$ konvergens részsorozata. Jelölje
$ A colon.eq lim(a_v_n) in RR $
==== 3.Lépés
Belátjuk, hogy $lim(a_n) = A$ is igaz\
Legyen $epsilon gt 0$ tetszőleges. Ekkor A definíciójából következik, hogy
$ exists n_2 in NN, forall n gt n_2 : abs(a_v_n - A) lt epsilon/2 $
Az $(a_n)$ Cauchy-sorozat, ezért $epsilon$/2-höz
$ exists n_3 in NN, forall n,m gt n_3 : abs(a_n - a_m) lt epsilon/2 $
Mivel $(v_n) : NN arrow NN$ indexsorozat (vagyis $(v_n)$ szigorúan monoton növekvő), ezért
$v_n gt.eq n (n in NN)$, amit teljes indukcióval lehet igazolni.\
\
Ha $n gt n_0 colon.eq max{n_2, n_3}$, akkor $v_n gt n_0$, ezért $n$ és $m colon.eq v_n$ is nagyobb, mint $n_2 "és" n_3$, tehát alkalmazhatók a fenti egyenlőtlenségek. Ekkor
$ abs(a_n - A) eq abs((a_n - a_v_n) + (a_v_n - A)) lt.eq abs(a_n - a_m) + abs(a_v_n - A) lt epsilon/2 + epsilon/2 eq epsilon $
és ez azt jelenti, hogy az $(a_n)$ sorozat valóban konvergens, és $lim(a_n) eq A$
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/056%20-%20Outlaws%20of%20Thunder%20Junction/001_Episode%201%3A%20An%20Offer%20of%20Revenge.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Episode 1: An Offer of Revenge",
set_name: "Outlaws of Thunder Junction",
story_date: datetime(day: 11, month: 03, year: 2024),
author: "<NAME>",
doc
)
The sun set over Omenport. Bursts of amber light slipped past the triangular rooftops, casting pointed shadows across the coarse desert grass that ran through the middle of town. Clusters of cacti were dotted around the wooden buildings, and a single fountain sat in the middle of the plaza, water bubbling with magic to keep it permanently cool. The mission bells rang out as they did every evening at sundown, and still, <NAME> checked his pocket watch, again and again.
Two Sterling Company guards stood beside a nearby carriage. One of them gnawed lazily at a piece of sugarcane clamped between his teeth. The other kept his eyes fixed on the Omenpath, watching the portal for movement.
Archie tucked his watch in his vest pocket and let out an exaggerated sigh. It wasn't the first time he'd been hired by the Sterling Company to transport goods across Thunder Junction, but most couriers believed punctuality was of the utmost importance—and Archie had been waiting by the fountain for over an hour.
If it had been another job with another employer, he might've left by now. But the Sterling Company paid well. They'd also provided two armed guards to escort him across the desert, #emph[and] they'd offered an additional fee in exchange for Archie's silence. He couldn't ask questions about who he was meeting or what he was transporting, but money was money, and gossip didn't put food on the table.
Still, he hated when people were late.
Archie was reaching for his watch again when the Omenpath rippled to life, making him stiffen in place. Shades of fluorescent blue crackled like lightning, and a glowing figure appeared.
A man stepped over the threshold, features hidden by a black bandana. Not that it would've mattered; Archie didn't recognize the man any more than he recognized the style of clothing he was wearing.
The stranger was from another plane entirely.
The man's gaze drifted across the barely cobbled plaza before landing on the Sterling guards. He marched across the wide path in silence, stopping several feet away. In his outstretched fist was a burlap sack.
Archie took the bag without a second glance and hurried inside the carriage.
The Sterling guards climbed quickly to the raised driver's seat. One of them flicked his bit of sugarcane into the sand and grabbed hold of the reins, where two brown horses turned their ears back in anticipation. Archie barely rapped his knuckles against the roof when the carriage set off, leaving the masked man and the portal behind.
The horses dragged them across the dusty landscape for miles, a single lantern hung at the front of the carriage to light the way. It battled the growing darkness until it was all Archie could see outside the window.
He clutched the bag to his chest, trying to find the horizon where the desert mountains met the starlit sky. He hoped the quiet was a good sign, but deep down, he knew better. His employer would never have provided two Sterling Company guards unless the job carried risks.
He anticipated bandits—but what found him in the desert was much worse.
A wall of fire erupted in a swooping blaze, creating an impenetrable circle around the carriage. The horses reared in alarm, and the vehicle shuddered to a stop, causing Archie's head to crack against the window frame. He winced, eyes fluttering, and watched in horror as the two guards leapt to the sand and drew their weapons.
"What is it?" Archie asked hurriedly, stomach filling with dread.
"Hellspurs," one of the guards muttered.
The other tightened his grip around his thunder rifle in response.
Several figures appeared through the wall of fire, unaffected by the flames that hissed and snapped around them. They fired their weapons at the guards without warning, sending blasts of energy scattering across the sand. Nearly a dozen holes appeared across the side of the carriage, and the Sterling guards fell immediately.
When the only sound left in the desert was the crackle of fire, the strangers lowered their weapons.
The group parted down the middle, making way for a large figure who stalked forward, spurred talons clinking beneath him. Firelight cascaded over the dragon's looming frame, making the scales across his body appear to flicker. There was no mistaking the leader of the Hellspurs. Not in the desert, where his name carried so much fear.
#emph[Akul.]
#figure(image("001_Episode 1: An Offer of Revenge/01.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
The dragon clacked his strange mandibles, pulled his tail back, and cracked it against the carriage like a whip, splitting what was left of the vehicle in two.
Archie sat in a pool of blood, still clutching the bag. His mortality was slipping away with every staggered breath, eyes wide with panic.
Akul barely seemed to notice him at all.
The dragon plucked the burlap sack from Archie's dying grasp and puffed his chest in triumph. "Finally. The last key is mine."
With a single claw, he sliced the bag open. A few lumps of coal tumbled into his open palm, and he hissed, golden eyes blazing with rage.
Akul snarled, crushing a fist around the coal until the fine black powder seeped through his claws. He spun, tail thrashing, and roared into the vast desert.
Inside the broken carriage, <NAME> watched the Hellspurs take a few steps back as Akul set fire to the sand around him. Archie felt the flames grow close, but his mind was already fading. As he took his last breath, he had the strange and sudden urge to check his pocket watch.
For all he cared about punctuality, he never expected to be so early to his own death.
Archie blinked for the final time—and somewhere in the distance, far beyond the desert blaze, the real key was getting farther away from Akul's reach.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Annie Flash adjusted her wide-brimmed hat and squinted across the sun-beaten terrain, her forehead creasing with heavy lines. She'd been following the rising smoke since daybreak and could finally see the charred source in the distance with her naked eye.
Beneath her, Fortune gave an impatient huff.
She pressed a gloved hand to the animal's neck and leaned over the saddle. "Don't worry. I'll make it up to you with all the apples and sweet grain you can eat once we get home—but those ruins out there are likely how we're going to afford it."
Fortune shook his curled horns in response, clearly unimpressed. Annie cracked a smile. It wasn't something she did often, but there was something about long trail rides that made her more willing to let her guard down.
Annie nudged Mister with her heel, and they rode toward the smoke. She'd seen plenty of carriage fires during her early days with the Freestriders. She could tell the difference between an accident and an ambush—and this was certainly no accident.
But one look at the split in the carriage told her exactly #emph[whose] work this was, too.
Akul had been here.
Grimacing, Annie cast her golden eye across the burned landscape, checking for illusions. Confident she was alone, she dismounted and moved for the remnants of the carriage. She kicked through the wide pile of ash, and several bones scattered to the side.
She tried not to wonder whom they belonged to. Curiosity had never done anything except make her a bigger target.
Reaching for what was left of the seat, Annie gave a tug and revealed a hidden compartment. A lockbox sat inside, untouched. With a pocket knife from her belt, she wedged the lid open and found several stacks of cash.
Attacks like these only seemed to happen for one of two reasons: money or revenge. But something wasn't sitting right in the pit of her stomach.
Even though she knew better than to wonder, she did it anyway.
As far as the Hellspurs were concerned, a carriage fire as an act of revenge was far too tame; Akul preferred making a show of things, often in public. But they left the money behind—which meant they were after something else. Something bigger than a box of cash that could feed a whole family for a month.
#emph[What's he after? ] Annie's thoughts hammered. #emph[And how many carriages did he burn to find it?]
A pang of dread roiled through her. She hated that a monster like Akul was wreaking havoc on the plane, hurting innocents along the way, and still coming out victorious. But she also made up her mind a long time ago to stay as far away from him as possible. Because as long as those innocents weren't the people she'd come to call family, she didn't care. #emph[Couldn't] care.
Akul wasn't someone she'd ever cross again. But she was happy to take the money he'd left behind.
#figure(image("001_Episode 1: An Offer of Revenge/02.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
Annie picked up the lockbox, tucked it safely in one of the saddlebags, and brushed a glowing wisp of mane from Fortune's eyes.
"Think you can get us back to Saddlebrush before midday?" she asked, watching Fortune bow his head in response. She climbed back into the saddle and took the reins in one hand. "Alright, then. Dinner's on me."
Annie pinned her gaze far beyond the next valley, left iris glinting with magic. Even though it was still miles away, she could see the outline of the tiny town in the wastes she called home. Saddlebrush was far from the prettiest town on Thunder Junction, but Annie found it had other charms—mainly how far it was off the grid. She'd come to appreciate the quiet, and the anonymity that came with it.
Annie led Fortune to a watering trough outside the town's general store. The minute she was back on her on two feet, she swung the saddlebag over her shoulder and walked up the crooked, dust-worn steps.
"Afternoon, Mr. Towning," Annie said, pinching the tip of her hat in respect and letting the wooden doors shutter closed behind her.
A man with pepper-gray hair stood up from behind the counter, hands tightened around a crate of vegetables. "I didn't expect to see you today! I've got a delivery going to your ranch in the morning—unless of course you're here to make changes." With a grunt, he set the crate onto a nearby shelf, stepped away, and immediately pressed a hand to his back. "Things don't move the same when you get older," he said, wincing. "But I suppose it's better than the alternative."
Annie placed the lockbox on the warped countertop with a #emph[thud] . "Can't do much about those old bones of yours, but this oughta cheer you up."
Mr. Towning lifted the lid and immediately brightened. "You're too good to me."
Annie watched him divide the cash into two equal parts. He placed his share in a safe behind the counter, and Annie packed hers in a satchel at her hip.
"You sure no one is going to come looking for this kind of money?" he asked, spinning the dial of the safe.
The image of the burned carriage flashed in Annie's mind, but she had a rule when it came to discussing where and how she found her loot.
"No one's gonna waste good hours trekking through the wastes to look for a box they didn't even realize was missing," she pointed out. "Besides, me and Fortune didn't see a soul out in that desert. Whoever left that money is long gone by now."
He nodded, face softening. "I'm not sure our little town would've survived this long if it hadn't been for you. We're real grateful to you. Always have been, always will be."
"Here I was thinking I've been paying to keep you all from selling me out to the highest bidder." Annie lifted a brow. "If I'm the town's hero, we should probably renegotiate this fifty-fifty cut."
Mr. Towning's laugh boomed through the small shop. "Well, now, you know what they say; if it ain't broke …"
Annie motioned across the counter at the basket of produce along the wall. "How about some of those apples, then? I promised Fortune I'd pick up sweet grain while I was here, too."
He reached for the shiniest red apple of the bunch and tossed it over the counter. Annie snatched it in the air with her cupped hands.
"Tell Fortune it's on the house," he said. "I'll get the rest sent over in the morning."
Annie tipped her hat and turned for the door. "Always a pleasure."
She rode to the outskirts of Saddlebrush and arrived at their small ranch just shy of sundown. She stopped near the fields on the way to the house, where Fortune joined the other animals to graze. Sometimes he'd disappear alongside the last rays of sunlight—here one moment, gone the next. Though Annie never knew where he went or what business he got up to, he'd always come back. There was an unspoken understanding between the two of them.
Annie watched him for a moment. His markings were like her other palominos, but Fortune wasn't a creature Annie had a name for. His intelligence matched any human she'd ever met—though Fortune's sense of direction was another thing entirely. They were well suited to one another that way; Annie provided Fortune assistance in navigating the desert, and Fortune offered her a dependability she hadn't had in some time.
Annie moved away from the gate, gripping tight to the strap of her satchel, and trudged back up the dirt road toward her house. She'd been so fixated on Fortune and the memories of her past that she nearly made it to her porch before realizing someone was standing at the bottom of the stairs.
Her hand immediately moved to the knife tucked at her hip, fingers twitching. The man in front of her was dressed like someone from the city, with a crisp, tailored suit and overly polished boots. His wavy blond hair was swept up and over, and there was a smugness in his brow that Annie took an immediate dislike to.
"What are you doing on my property?" she demanded, voice sharpened at the edges.
The stranger flashed his teeth. "Are you the notorious one-time outlaw who goes by the name <NAME>?"
She flinched at the reference, preferring not to think about her days working with criminals. Not after what happened to her nephew. "Who's asking?"
The man's smile persisted. "I came all the way from the city to meet you in person. I suppose you could say I'm a big fan."
"That's only half an answer," she said coolly. Her left eye flashed with a hint of orange, and she saw the man for who he really was beneath the illusion. She knotted her brows in a frown. "What business does a fae have out here in the wastes?"
The man's grin curled with mischief, and he shapeshifted back into his natural form—ink-black hair, pointed ears, and a pale face that appeared to be dusted in silver. He gave a mock bow. "Pleased to make your acquaintance, Annie Flash. My name is Oko—and your ability to see through illusions is #emph[exactly] why I've been looking for you." He tilted his head as if he was admiring a painting. "I was told an angel gave you that eye. A rare gift indeed."
"It wasn't the illusion that gave you away." She folded her arms. "It's the fact that your shoes don't have a speck of dirt on them, despite your claim of traveling across the desert to find me."
Oko laughed. "When faced with a choice between accuracy and appearances, I prefer the latter."
"Whatever game you're playing is of no interest to me. I'm retired. Now get off my porch." She started to move past him, but Oko fixed his eyes on her satchel, making her pause.
"If money doesn't interest you, perhaps revenge will," he offered, voice so much like a dangerous purr. "I've been putting a team together to steal something important from an outlaw you may know as Akul."
Annie tensed, unable to hide the visceral reaction at the sound of his name.
Oko looked pleased. "I heard a rumor there may be some unfinished business between the two of you."
"You heard wrong," Annie spat. She turned then—to the fields and the ranch and everything she'd built for herself since the day Akul almost killed her nephew—and curled her hands into fists. "I won't go backward. I don't need revenge to find peace."
Oko studied her with the kind of calculation that always seemed to follow ambition. After a moment, he reached into his pocket and pulled out a small matchbook with the name of a saloon printed on the side. "Here—in case you change your mind."
Annie took it only because she hoped it would make him leave quicker.
"If it was this easy for me to find you, imagine how easy it will be if the Hellspurs ever decide to come looking." Oko said. "You must really love this town to go to such great lengths to protect it."
Annie squared her shoulders. "Is that a threat?"
Oko pressed a hand to his heart; a gesture of sincerity. "Of course not. I'm only pointing out the obvious." When he dropped his hand, his smile returned. "If you change your mind, come and find me at the saloon. I promise I'll make it worth your while."
Annie watched Oko disappear down the path, grip tightening around the matchbook in her palm.
It was a mistake to stay in one place for so long. She'd put down roots without even meaning to.
Nothing stayed buried in the past forever—and now her old ghosts had followed her to the only place left in the world that she truly cared about.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kellan lifted the last of the metal posts onto the elevator shaft and took a step back. He watched the machine raise the equipment onto the next level of the partially built relay tower.
Pointed lanterns hung all around him, trailing down wires and ropes like a cascade of starlight, glittering in defiance against the darkening sky. It hadn't been long since the sun disappeared behind the canyon, but the air was still thick with heat.
Kellan wiped the sweat from his brow with the back of his hand and looked over his shoulder at what was quickly becoming his new favorite view. The Omenpath sat wedged between the enormous rockface, crackling with blue energy. It was hard to believe it had only been a few weeks since he'd stepped through the portal.
#figure(image("001_Episode 1: An Offer of Revenge/03.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
Even in the daylight, Omenport looked nothing like Eldraine. But Kellan didn't look at the orange and yellow landscape and feel homesick. He felt #emph[hope] .
"Oy—new kid!" a voice bellowed from in the pit. Kellan looked down to find one of the overseers waving her hand in the air. "These pallets aren't going to move themselves!"
Kellan apologized, sheepish, and hurried down the ladder to help with the next load of parts. He lifted one after the other, mind once again drifting to thoughts of traveling to other towns, when a broad-shouldered man holding a crossbow pushed his way past Kellan with a grunt.
There was no mistaking a Sterling Company mercenary. The guard followed <NAME> like a shadow, even though he'd most likely been hired to protect the building site rather than Ral himself.
Ral—along with Niv-Mizzet, back in Ravnica—was developing a way to communicate through the Omenpaths, and the unfinished relay tower was practically a giant, sparkling target. There were plenty of outlaw societies who'd be interested in its technology—and not #emph[just ] on Thunder Junction, but on other planes, too. Whoever gained control of the communications hub first would no doubt find themselves unimaginably wealthy.
The Sterling Company had already invested in Ral's research. Now they needed to protect it.
"Evening, Mr. Zarek," the overseer said. "Didn't expect to see you on site this late."
"I wanted to talk to you about the installation of the optical repeater," Ral said before prattling off a series of questions and specifications that Kellan had a hard time following.
Kellan turned back to the metal stacks. He hadn't taken this job out of an interest in relay towers and Omenpaths. Kellan kept himself busy sorting through the building equipment. He loaded them onto the empty platform one by one, mind wandering with every passing minute, until a loud #emph[bang] broke him from his trance.
At the base of the tower, a technician tugged in horror at a piece of misaligned hardware, trying to remove it from the massive connector. There was another #emph[bang] , and lightning burst from the metal. Sparks flew from the control unit, but the bulk of the energy shot skyward, following along the relay tower's unfinished frame until it scattered into the sky in at least a dozen different directions.
High up on the scaffolding, one of the bigger sparks hit a lantern, making the glass explode. A nearby worker threw his hands up to shield his face, stumbling backward toward the edge of the platform. He teetered, fighting to regain his balance, before releasing a sharp cry.
From the height of the tower, the man fell.
Some of the workers in the pit screamed. Others pointed in shock.
Kellan didn't hesitate. Golden dust burst from his feet as he flew toward the man and wrapped his arms around him midair, plucking him from the sky like a piece of fruit before lowering him gently to the ground.
#figure(image("001_Episode 1: An Offer of Revenge/04.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
The worker sputtered a few words of gratitude, teeth chattering with fear, when Ral appeared. His eyes darted from the tower to the man, then back again.
Ral gestured toward the mercenary with irritation. "Accidents like this could set our progress back by days. Is it too much to expect competency on a project like this?" He pinched the bridge of his nose, inhaling deeply. "Never mind. As I was saying before, I'd like a full report on the electrical conversion prior to the installation …" He marched away without another glance toward the fallen worker.
A group of technicians hurried to the control unit to fix the fault before another surge of power was released. Looping an arm around the man, Kellan helped him find a seat against a stack of metal crates so he could catch his breath away from the commotion.
Kellan pulled a leather canteen filled with water from his hip. "Here—drink this."
"You're too soft-hearted to be working on a job like this," the man pointed out before taking a gulp.
"Because I didn't let you fall?"
"No—because you're still standing around here checking on me when you know full well the boss is going to dock your pay for it."
Kellan looked across the pit where the overseer was deep in conversation with Ral. "I didn't take this job for the money."
"You're a strange one. Even for a fae." The man lifted his chin. "Why #emph[did] you take this job?"
Kellan hesitated before taking a seat on the crate beside him. "My last boss, Ezrim—he told me my dad was on this plane. I—I'm trying to find him."
The man frowned. "Your dad is working on the relay tower?"
Kellan ran a hand through his thick hair, laughing nervously. "No. But Ral offered to hire me, and he knows plenty of people in Omenport. It was too good of an opportunity to miss."
The worker made a face and tipped the last of the water back in one hurried motion. When finished, he released a whistle through his teeth. "You know, most people come to this place to escape something. Maybe if you haven't found your father yet, it's because he doesn't #emph[want] to be found."
"I don't think he's hiding from anything. I think he's #emph[looking ] for something," Kellan admitted.
"Well, if that's the case, I'm sure he'll be happy to see a familiar face when he finds out you're here."
Kellan forced a smile and nodded, ears burning as he kept one vital piece of information to himself: his father had no idea what Kellan looked like, because they'd never actually #emph[met] .
The man returned the canteen. "I better get back up there. Workday's almost over. And not that I don't appreciate your help, but if it's all the same to you? I'll take the stairs this time."
Kellan watched him disappear around the corner and thought of the last time he'd said goodbye to a friend. It brought a familiar pinch back to his chest. He tried to push it away, deciding it was better to finish stacking the metal posts than it was to think about how lonely it felt to be on a new plane without a single person he knew. Even his father was technically a stranger.
#emph[Only for a little while longer] , Kellan assured himself.
He stood up and turned back for the post he'd left moments before when he found a tall figure blocking his way.
The overseer waved a hand at the mess of partially stacked equipment. "Finish up here. Your new shift starts in the morning."
Kellan frowned. "New shift?"
"Mr. Zarek thinks someone with your skillset should be on his security detail instead of working out here in the heat. He's going to visit the Sterling Company headquarters in a few days—and you're going with him."
"To Prosperity?" Kellan asked, heart thumping.
The overseer scowled. "This ain't a field trip, kid. You're going to look after the boss."
Kellan nodded quickly. "I understand," he said, even though hope was swelling up inside his chest like a balloon.
She turned sharply for the elevator. "Better get a move on. I want this mess cleared before the night crew arrives."
Kellan's excitement was impossible to contain. Prosperity was by far the wealthiest town on Thunder Junction—and places with money were usually a hive for gossip. The odds of at least #emph[someone] in the city having information about Oko were bound to be high. Especially if Ral was willing to help ask around.
<NAME> was an important person in Omenport. Maybe he was important in Prosperity, too. Planeswalkers, in Kellan's experience, tended to be pretty important everywhere they went.
There were so many questions Kellan wanted to ask his father—about his fae heritage, his powers, and whether Oko ever felt pulled in two directions the way he did. There were so many missing years between them. So many memories they should've shared but hadn't. Kellan knew there was a chance his father wouldn't feel the same way. Maybe he'd reject him, or refuse to see him at all. He'd heard the stories about Oko being a notorious trickster and having a reputation for being untrustworthy.
But Kellan was never one to believe rumors, and he'd rather trust in someone's potential than shun them for their past mistakes. Besides, he was Oko's son, and that meant something.
It #emph[had] to.
Kellan was ready to meet his father.
And <NAME> was going to help make it happen.
|
|
https://github.com/fathonix/praktikum_alpro | https://raw.githubusercontent.com/fathonix/praktikum_alpro/master/prakalpro.typ | typst | MIT License | // Laporan Praktikum Algoritme Pemrograman ITK
// Template and build script are licensed under MIT.
// Contents are under proprietary license.
// Initial page setup
#import "@preview/codly:1.0.0": *
#show: codly-init.with()
#let def-margin = 2.54cm
#let border-color = rgb("#1eaaf1")
#let heading-color = rgb("#039be5")
#set page(
paper: "a4",
margin: (
x: def-margin,
bottom: def-margin,
top: 5.4cm,
),
header-ascent: 10%,
header: context [
#place(
top,
dx: -2.54cm,
)[
#box(
width: 22cm,
height: 1.5mm,
fill: border-color,
)
]
#align(bottom + left)[
#box(
width: 1.25cm,
height: 0.15cm,
fill: border-color,
)
]
],
footer: context [
#align(right)[#text(
font: "Proxima Nova",
size: 11pt,
)[#context counter(page).display()]]
#place(
bottom,
dx: -def-margin,
)[
#box(
width: 22cm,
height: 0.94cm,
fill: border-color,
)
]
],
)
#set par(justify: true)
#set text(
font: "Times New Roman",
size: 12pt,
)
#show heading: set text(
size: 18pt,
weight: "regular",
fill: heading-color,
)
#show heading.where(level: 2): set text(
size: 16pt,
)
#show heading.where(level: 3): set text(
size: 14pt,
)
// Numbering formatting
#set enum(
numbering: (it => strong[#it.]),
indent: 0.64cm,
)
// Code block formatting
#codly(
display-icon: false,
display-name: false,
zebra-fill: none,
)
// Bibliography configurations
#set bibliography(
title: "Daftar Pustaka",
style: "apa",
full: true,
)
// Text starts below
= Dasar Teori
+ *Variabel*
Variabel adalah penamaan pada data yang akan disimpan pada
komputer. Variabel juga dapat didefinisikan sebagai tempat
menyimpan data yang bersifat sementara. Variabel dapat
diubah atau dimanipulasi selama program dijalankan.
Variabel dapat membuat struktur kode lebih ringkas dan
efisien. Pemberian nama pada variabel bisa dimulai dengan
huruf dan tidak diawali dengan angka maupun spasi kosong,
artinya nilainya bisa berubah-ubah. Variabel dalam python
memiliki format penulisan `nama_variabel =`. Variabel dapat
berisi teks maupun bilangan. Terdapat beberapa aturan
penulisan variabel, yaitu:
- Nama variabel boleh diawali menggunakan huruf atau garis
bawah (\_) dan tidak dapat dimulai dengan angka (0-9),
contoh: `namasaya`, `_nama`.
- karakter pada variabel bersifat sensitif, artinya huruf
kapital dan huruf kecil memiliki arti yang berbeda.
- nama variabel tidak boleh menggunakan kata kunci yang
sudah ada dalam Python.
+ *I/O Konsol*
I/O Konsol adalah mekanisme yang memungkinkan program untuk
menerima input dari pengguna dan memberikan output kepada
pengguna melalui konsol atau terminal. Konsol atau terminal
adalah antarmuka berbasis teks yang sering digunakan untuk
menjalankan aplikasi, menguji kode, atau berinteraksi
dengan sistem operasi.
Input adalah data atau informasi yang dimasukkan ke dalam
sistem atau program dari sumber eksternal. Input ini bisa
berasal dari pengguna, file, atau sumber data lain.
Contoh:
```py
input("Masukkan umur: ")
```
Output adalah data atau informasi yang dihasilkan oleh
sistem atau program dan disampaikan ke pengguna atau ke
sistem lain. Output ini bisa berupa hasil perhitungan,
pesan, atau data yang telah diproses.
Contoh:
```py
print("Memenuhi syarat")
```
+ *Operasi Aritmatika*
Operasi Aritmatika adalah operator yang digunakan untuk
melakukan operasi penjumlahan, pengurangan, pembagian, dan
perkalian atau operator yg berfungsi untuk melakukan
perhitungan pada bilangan. Operasi aritmatika digunakan
dalam proses perhitungan matematis seperti penjumlahan,
pengurangan, perkalian, pembagian dan lainnya. Berikut
operator aritmatika yang dapat digunakan saat memprogram:
#table(
columns: 2,
[Simbol], [Penjelasan],
[+], [Penjumlahan],
[-], [Pengurangan],
[\*], [Perkalian],
[/], [Pembagian],
[\*\*], [Pangkat, misalnya $2^5$ ditulis `2 ** 5`],
[\/\/], [Pembagian bilangan bulat, jika hasil pembagian adalah
desimal maka dibulatkan ke nilai terkecil],
[%], [Modulus atau sisa pembagian, misalnya $6 mod 2$ bernilai 0,
ditulis `6 % 2`],
)
+ *Konversi Tipe Data*
Konversi tipe data adalah operasi mengonversi data dari
satu tipe data ke tipe data yang lainnya, misalnya dari
Number ke String, Number ke Boolean, dan lain sebagainya.
Proses konversi dapat dilakukan secara otomatis (implisit)
maupun manual (eksplisit).
Untuk konversi manual, misalnya dari angka ke string
menggunakan fungsi `str()`, `str(20)` menghasilkan `"20"`.
Objek pembungkus nilai primitif seperti Number, String,
Boolean dan lainnya (tanpa kata kunci new), dapat digunakan
sebagai fungsi untuk mengonversi tipe data ke tipe terkait.
+ *Eksekusi Kondisional*
Eksekusi kondisional adalah tempat kita mulai semacam
menambahkan lebih banyak kecerdasan. Pada eksekusi
kondisional ini kita dapat membuat pilihan, sesuai keadaan
atau kondisi dan juga dapat membuat komputer tampak cerdas
Dengan eksekusi kondisional, kita dapat menuliskan program
yang berguna melalui pengecekan kondisi suatu pernyataan.
Sehingga kita bisa membuat program kita lebih fleksibel.
Type data output dari eksekusi kondisional adalah Boolean,
Boolean merupakan suatu ekspresi yang mempunnyai nilai
`True` dan `False`. Sebagai contoh:
```py
x = 5 == 3
print(x) # output: false
print(type(x)) # output: <class 'bool'>
```
Didalam eksekusi kondisional kita menggunakan perbandingan
untuk mendapatkan nilai Boolean nya, kita bisa menggunakan
beberapa operasi perbandingan ini:
- != (Tidak Sama Dengan)
- > (Lebih Besar Dari)
- >= (Lebih Besar Sama Dengan)
- < (Lebih Kecil Dari)
- <= (Lebih Kecil Sama Dengan)
- == (Sama Dengan)
- != (Tidak sama dengan)
If adalah pernyataan eksekusi konditional untuk menjalankan kode
ketika hasil dari persamaan benar atau salah.
Elif adalah pernyataan untuk kondisi selanjutnya setelah if jika if
bernilai false.
Else adalah kondisi terakhir jika if atau elif bernilai false.
Eksekusi kondisional merupakan suatu cara untuk memprogram
komputer agar mengambil langkah atau keputusan ketika
diberikan kondisi atau syarat tertentu. Contohnya jika
terdapat dua kode program dengan program pertama dapat
dijalankan jika suatu variabel tidak lebih dari pada nol
dan sebaliknya program kedua dapat dijalankan jika kondisi
pertama tidak terpenuhi. Jadi, Eksekusi kondisional adalah
tempat kita mulai semacam menambahkan lebih banyak
kecerdasan. Dengan eksekusi kondisional, kita dapat menulis
program yang berguna melalui pengecekan kondisi kapan suatu
pernyataan akan dijalankan yang tergantung dari masukkan
pengguna. Selain itu, kita dapat memberikan efek
fleksibilitas pada program yang akan kita buat. Suatu
pernyataan akan dijalankan ketika kondisi terpenuhi atau
ketika ekspresi boolean bernilai benar. Sebaliknya,
pernyataan tidak akan dieksekusi jika ekspresi bernilai
False. Ekspresi boolean merupakan suatu ekspresi yang
mengembalikan/memiliki suatu nilai boolean. Boolean sendiri
memiliki nilai berupa Benar atau Salah yang dalam Python
disebut dengan `True` atau `False`.
+ *Eksekusi Kondisional Bersarang*
Eksekusi kondisional bersarang merupakan eksekusi
kondisional yang dilakukan dalam eksekusi kondisional
lainnya. Ini berguna untuk membuat keputusan yang lebih
kompleks. Contoh kodenya pada Python adalah sebagai berikut:
```py
umur = 15
tinggi = 180
if umur >= 17:
print("Umur memenuhi, silakan masuk")
else:
if tinggi >= 150:
print("Umur kurang tapi tinggi mencukupi, silakan masuk")
else:
print("Umur dan tinggi tidak mencukupi, dilarang masuk")
```
+ *Eksekusi Kondisional Majemuk*
Eksekusi kondisional majemuk adalah suatu eksekusi kondisional
dengan beberapa pernyataan persamaan yang berantai, yaitu
menggunakan operator persamaan Boolean. Beberapa contoh operator
persamaan Boolean adalah:
- `and` (persamaan AND) menghasilkan `True` apabila dua Boolean
sama-sama bernilai `True`.
- `or` (persamaan OR) menghasilkan `True` apabila salah satu
dari dua Boolean atau dua-duanya bernilai `True`.
Contohnya dalam kode adalah sebagai berikut:
```py
print(True and True) # output: True
print(True and False) # output: False
print(True or True) # output: True
print(True or False) # output: True
```
= Source Code
== Konversi Suhu
```py
# Program konversi celsius ke fahrenheit
celsius = float(input("Masukkan suhu dalam celsius: "))
fahrenheit = (celsius * 9/5) + 32
print(fahrenheit)
```
=== Screenshot
#image("img/fig1.png")
#image("img/fig2.png")
=== Pembahasan
#table(
columns: 2,
[No. Baris], [Penjelasan],
[3], [Ambil input pengguna dengan fungsi `input()`, ubah ke
tipe data float dengan `float()` dan simpan pada variabel
bernama `celsius`],
[4], [Ubah nilai variabel `celsius` ke Fahrenheit menggunakan
rumus dan simpan pada variabel `fahrenheit`],
[5], [Cetak nilai variabel `fahrenheit`],
)
== Penghitung Gaji Pegawai
```py
upah = int(input("Masukkan upah per jam: "))
jam_kerja = 8
hari_kerja = int(input("Masukkan jumlah hari kerja dalam sepekan: "))
upah_pekanan = upah * jam_kerja * hari_kerja
print("Total upah pekanan yang diterima:", upah_pekanan)
```
=== Screenshot
#image("img/fig3.png")
#image("img/fig4.png")
=== Pembahasan
#table(
columns: 2,
[No. Baris], [Penjelasan],
[1], [Ambil input pengguna dengan fungsi `input()`, ubah ke tipe data
bilangan bulat dengan `int()` dan simpan pada variabel bernama `upah`],
[2], [Buat variabel `jam_kerja` yang bernilai bilangan 8],
[3], [Ambil input pengguna dengan fungsi `input()`, ubah ke tipe data
bilangan bulat dengan `int()` dan simpan pada variabel bernama
`hari_kerja`],
[5], [Kalkulasikan upah pekanan pegawai dengan mengalikan nilai variabel
`upah`, `jam_kerja` dan `hari_kerja`],
[6], [Cetak hasil kalkulasi upah pekanan],
)
== Permainan Suit/Pingsut dengan Gaya Konsol
```py
import random, sys
print("\033[37m:: Permainan Suit/Pingsut ::\033[0m")
print("\033[37m1. Jempol (Gajah)\033[0m")
print("\033[37m2. Telunjuk (Manusia)\033[0m")
print("\033[37m3. Kelingking (Semut)\033[0m")
pil = int(input("Pilihan anda? (1/2/3): "))
if (pil < 1 or pil > 3):
sys.exit("\033[31mMasukkan pilihan yang benar!! Pilihan antara 1-3.\033[0m")
# Pilihan komputer
kom = random.randint(1, 3)
# Tampilkan pilihan komputer
if kom == 1:
print("\033[37mKomputer memilih: Jempol (Gajah)\033[0m")
elif kom == 2:
print("\033[37mKomputer memilih: Telunjuk (Manusia)\033[0m")
else:
print("\033[37mKomputer memilih: Kelingking (Semut)\033[0m")
# Logika permainan
if kom == 1: # Komputer memilih Gajah
if pil == 1:
print("\033[34mSama-sama Gajah! Sesama gajah saling membantu. Seri!\033[0m")
elif pil == 2:
print("\033[31mDiinjek gajah.. kamu kalah!\033[0m")
elif pil == 3:
print("\033[32mKamu gigit gajah, kamu menang!\033[0m")
elif kom == 2: # Komputer memilih Manusia
if pil == 1:
print("\033[32mKamu abis nginjek manusia, kamu menang!\033[0m")
elif pil == 2:
print("\033[34mSama-sama Manusia! Jangan berantem lah... Seri!\033[0m")
elif pil == 3:
print("\033[31mKamu dibunuh manusia, kamu kalah!\033[0m")
elif kom == 3: # Komputer memilih Semut
if pil == 1:
print("\033[32mKamu gak sengaja injek semut, kamu menang!\033[0m")
elif pil == 2:
print("\033[31mKamu abis dikerjain sama semut, kamu kalah!\033[0m")
elif pil == 3:
print("\033[34mSesama semut saling membahu..! Seri!\033[0m")
```
=== Screenshot
#image("img/fig5.png")
#image("img/fig6.png")
=== Pembahasan
#table(
columns: 2,
[No. Baris], [Penjelasan],
[3], [Kode `\033[37m` mengubah perilaku terminal dengan mengatur warna
karakter setelahnya menjadi putih, dan kode `\033[0m` mengembalikan
perilaku terminal ke semula],
[10], [Kode `\033[31m` mengatur warna karakter menjadi merah],
[26], [Kode `\033[34m` mengatur warna karakter menjadi biru],
[30], [Kode `\033[32m` mengatur warna karakter menjadi hijau],
)
== Penerjemah Protein
```py
print("Program Penerjemah Protein")
kodon = input("Masukkan kodon protein: ")
if kodon == "AUG":
print("Methionine")
if kodon == "UUU" or kodon == "UUC":
print("Phenylalanine")
if kodon == "UUA" or kodon == "UUG":
print("Leucine")
if kodon == "UCU" or kodon == "UCC" or kodon == "UCA" or kodon == "UCG":
print("Serine")
if kodon == "UAU" or kodon == "UAC":
print("Tyrosine")
if kodon == "UGU" or kodon == "UGC":
print("Cysteine")
if kodon == "UGG":
print("Tryptophan")
```
=== Screenshot
#image("img/fig7.png")
#image("img/fig8.png")
=== Pembahasan
#table(
columns: 2,
[No. Baris], [Penjelasan],
[1], [Tampilkan judul program ke dalam konsol],
[2], [mengambil kodon dari pengguna yang dimasukkan ke dalam
variabel yang dimasukkan kedalam input],
[4], [Cek apakah pengguna memasukkan kodon AUG],
[5], [jika kodon sesuai maka akan menampilkan Methionine],
[7], [Cek apakah pengguna memasukkan kodon UUU atau UUC],
[8], [Jika kodon sesuai maka akan menampilkan Phynylalanine],
[13], [Cek apakah pengguna memasukkan kodon UCU atau UCC atau UCA
atau UCG],
[14], [Jika kodon sesuai makan akan menampilkan SERINE],
)
== Program Kasir Toko
```py
import sys
print("\033[37mSelamat datang di Toko Grosir Arimbi!\033[0m")
print("\033[32mSetiap pembelian 100 pcs s/d di bawah 200 mendapatkan diskon 15%.\033[0m")
print("\033[32mSetiap pembelian 200 pcs ke atas mendapatkan diskon 25%.\033[0m")
print()
print("Barang yang tersedia:")
print("\033[37m1. Sembako: Rp80.000,-/pcs, tersedia 300 pcs\033[0m")
print("\033[37m2. Aneka makanan ringan: Rp50.000,-/pcs, tersedia 500 pcs\033[0m")
print("\033[37m3. Sabun dan deterjen: Rp30.000,-/pcs, tersedia 400 pcs\033[0m")
barang = int(input("Masukkan nomor barang yang dipilih: "))
jumlah = int(input("Masukkan jumlah barang yang diinginkan: "))
harga = 0
diskon = 0
if barang == 1:
harga = 80000
if jumlah < 100:
diskon = 0
elif jumlah >= 100 and jumlah < 200:
diskon = 15
elif jumlah >= 200 and jumlah <= 300:
diskon = 25
else:
sys.exit("\033[31mStok barang tidak mencukupi!\033[0m")
elif barang == 2:
harga = 50000
if jumlah < 100:
diskon = 0
elif jumlah >= 100 and jumlah < 200:
diskon = 15
elif jumlah >= 200 and jumlah <= 500:
diskon = 25
else:
sys.exit("\033[31mStok barang tidak mencukupi!\033[0m")
elif barang == 3:
harga = 30000
if jumlah < 100:
diskon = 0
elif jumlah >= 100 and jumlah < 200:
diskon = 15
elif jumlah >= 200 and jumlah <= 400:
diskon = 25
else:
sys.exit("\033[31mStok barang tidak mencukupi!\033[0m")
else:
sys.exit("\033[31mBarang yang dipilih tidak terdaftar!\033[0m")
total_awal = harga * jumlah
total_diskon = int(total_awal * (diskon / 100))
total_akhir = total_awal - total_diskon
print()
print("Harga satuan:\033[37m", harga, "\033[0m")
print("Harga jumlah:\033[37m", total_awal, "\033[0m")
print("Diskon", diskon, "%:\033[31m", -total_diskon, "\033[0m")
print("Biaya yang dibayarkan:\033[32m", total_akhir, "\033[0m")
print("\033[37mTerima kasih telah berbelanja di Toko Grosir Arimbi!\033[0m")
```
== Screenshot
#image("img/fig9.png")
#image("img/fig10.png")
== Pembahasan
#table(
columns: 2,
[No. Baris], [Penjelasan],
[1], [Impor modul `sys` untuk memanggil fungsi `sys.exit()`.],
[14], [Deklarasikan variabel `harga` untuk diubah dengan bilangan
bulat berupa harga barang yang dipilih.],
[14], [Variabel `diskon` untuk diubah dengan persenan diskon
yang berlaku.],
[17], [Cek apakah variabel `barang` bernilai bilangan bulat 1,
yaitu pengguna memilih barang pertama.],
[18], [Atur nilai variabel `harga` menjadi harga barang pertama.],
[19], [Cek apakah variabel `jumlah` bernilai di bawah bilangan
bulat 100, yakni jumlah yang dimasukkan pengguna
di bawah seratus.],
[20], [Atur nilai variabel `diskon` menjadi 0. Sebenarnya baris
kode ini adalah _boilerplate_, namun saya tambahkan saja agar
lebih mudah dipahami.],
[21], [Cek apakah variabel `jumlah` bernilai 100 atau lebih, dan
juga bernilai di bawah 200.],
[22], [Atur nilai variabel `diskon` menjadi 15.],
[21], [Cek apakah variabel `jumlah` bernilai 200 atau lebih, dan
juga bernilai di bawah atau sama dengan 300, yaitu stok barang
yang tersedia.],
[22], [Atur nilai variabel `diskon` menjadi 25.],
[26], [Jika tidak ada persamaan `if` dan `elif` atau kondisi yang
terpenuhi, cetak pesan akhir dan hentikan jalannya kode
menggunakan `sys.exit()`.],
[50], [Deklarasikan variabel `total_awal` yang mengambil nilai
dari $\h\a\r\g\a times \j\u\m\l\a\h$.],
[51], [$\t\o\t\a\l" "\d\i\s\k\o\n = \t\o\t\a\l" "\a\w\a\l times
(\d\i\s\k\o\n) / 100$.],
[52], [$\t\o\t\a\l" "\a\k\h\i\r = \t\o\t\a\l" "\a\w\a\l minus
\t\o\t\a\l" "\d\i\s\k\o\n$.],
)
= Kesimpulan
Setelah melakukan praktikum mengenai Variabel, Konsol I/O,
Konversi Tipe Data, Operasi Aritmatika, dan Eksekusi Kondisional,
dapat disimpulkan bahwa variable berfungsi sebagai tempat
penyimpanan sementara dari nilai atau data. Variabel dideklarasikan
dengan nama dan tipe data tertentu seperti integer, float, string,
dan boolean. Didalam bahasa pemrograman, penamaan variabel harus
mengikuti aturan penamaan, seperti tidak dimulai dengan angka dan
tidak menggunakan kata kunci yang sudah didefinisikan oleh bahasa.
Didalam input/output, Input mengacu pada data yang dimasukkan oleh
pengguna, biasanya melalui konsol, sementara output adalah hasil
yang ditampilkan oleh program. Pada bahasa Python, fungsi `input()`
digunakan untuk menerima input dari pengguna, sementara `print()`
digunakan untuk menampilkan output. Tipe data adalah kategori nilai
yang dapat disimpan oleh variabel dalam pemrograman. Tipe data yang
umum digunakan meliputi String, yang menyimpan teks atau karakter,
Integer untuk bilangan bulat, Boolean untuk nilai logika yang hanya
bisa bernilai `True` atau `False`, dan Float untuk bilangan desimal.
Operasi aritmatika juga bagian penting dalam algoritma pemrograman
yang digunakan dalam proses perhitungan matematis seperti
penjumlahan, pengurangan, perkalian, pembagian dan lainnya. Dan
yang terakhir ada eksekusi kondisional yang merupakan konsep dalam
pemrograman yang memungkinkan suatu blok kode hanya dijalankan jika
syarat tertentu terpenuhi. Langkah ini dilakukan dengan menggunakan
pernyataan seperti if-else, yang memeriksa kondisi. Jika kondisi
terpenuhi (`True`) satu blok kode akan dijalankan, jika tidak
(`False`) blok kode alternatif akan dijalankan. Fitur ini
memungkinkan program merespons kondisi yang berbeda dan membuat
keputusan yang dinamis.
= Saran
Penjelasan materi dari asisten lab sudah mudah dipahami, namun akan
lebih baik jika disampaikan dengan tempo yang lebih perlahan agar
semua praktikan, termasuk yang membutuhkan waktu lebih lama untuk
memahami, dapat mengikuti dengan lebih baik. Terimakasih.
#pagebreak()
#bibliography("prakalpro.bib") |
https://github.com/jneug/schule-typst | https://raw.githubusercontent.com/jneug/schule-typst/main/src/subjects/math-fractions.typ | typst | MIT License |
#import "../util/util.typ"
#let field(
a,
b,
num,
size: 1cm,
blank: white,
fill: gray,
flip: false,
draw-node: (size, fill) => square(
size: size,
fill: fill,
stroke: util.clamp(size / 10, .2pt, 2pt) + black,
),
) = box(
width: a * size,
height: b * size,
baseline: (b * size) * 0.5,
for j in range(b) {
for i in range(a) {
place(
top + left,
dx: i * size,
dy: j * size,
draw-node(
size,
if num > 0 {
fill
} else {
blank
},
),
)
num -= 1
}
},
)
|
https://github.com/EpicEricEE/typst-equate | https://raw.githubusercontent.com/EpicEricEE/typst-equate/master/tests/share-align/test.typ | typst | MIT License | #import "/src/lib.typ": equate, share-align
#set page(width: 6cm, height: auto, margin: 1em)
#show: equate
// Test correct behavior of shared alignment blocks.
#share-align[
$ a + b &= c $
leads to
$ c &= b - a $
]
#set math.equation(numbering: "(1.1)")
#share-align[
$ x + y + z &= w \
t &= x $
#figure(
rect[I interrupt], caption: [Caption]
)
$ &= w - u $
]
|
https://github.com/university-makino/Microcomputer-control-and-exercises | https://raw.githubusercontent.com/university-makino/Microcomputer-control-and-exercises/master/report/プレレポート4/report.typ | typst | // ライブラリの実装 //
#import "@preview/codelst:2.0.1": sourcecode
#import "@preview/i-figured:0.2.4"
//フォント設定//
#let gothic = "YuMincho"
//本文フォント//
#set text(11pt, font: gothic, lang: "ja")
//タイトル・見出しフォント//
#set heading(numbering: "1.1")
#let heading_font(body) = {
show regex("[\p{scx: Han}\p{scx: Hira}\p{scx: Kana}]"): set text(font: gothic)
body
}
#show heading: heading_font
// ページ設定 //
#set page(
paper: "a4",
margin: (x: 25mm, y: 25mm),
columns: 1,
//fill: 背景色,
numbering: "1",
number-align: center,
header: [
#set text(8pt)
]
)
// 数式の表示の仕方を表示 //
#set math.equation(numbering: "(1)")
// 図の表示の仕方を表示 //
// #show heading: i-figured.reset-counters.with(level: 2)
// #show figure: i-figured.show-figure.with(level: 2)
//タイトルページここから//
#align(right, text()[
#text[提出日]#datetime.today().display("[year]年[month]月[day]日")
])
#v(150pt)
#align(center, text(30pt)[
#heading_font[*プレ・レポート4*]
])
// #align(center, text(14pt)[
// #heading_font[*サブタイトル*]
// ])
#v(1fr)
#align(right)[
#table(
columns:(auto, auto),
align: (right, left),
stroke: none,
[講義名],[マイコン制御および演習],
[担当教員],[伊藤 暢浩先生],
[],[],
[学籍番号],[k22120],
[所属],[情報科学部 情報科学科],
[学年],[3年],
[氏名],[牧野遥斗]
)
]
#pagebreak()
// 目次
#outline(
title: "目次",
depth: 2,
indent: auto,
)
#pagebreak()
// 図表
// #i-figured.outline(
// title: "zu",
// depth: 2,
// indent: auto,
// )
// #pagebreak()
//本文ここから//
= プレ・レポート(課題 4)
== @H_LEDダイオード @LEDダイオード の電子部品 ( フルカラーLED OSTA5131A) を次のような点から調べなさい。 <H_LEDダイオード>
#figure(
image("./img/LEDダイオード.png",width: 50%),
caption: "LEDダイオード"
)<LEDダイオード>
=== どのような部品か
オプトサプライのフルカラーRGBLED。発光色を混ぜるとフルカラーを表現可能となる @rgbled_akituki 。
=== どのような仕組みか
フルカラーLEDには、それぞれ赤、緑、青で発光する半導体の小さな板(LEDチップ)が入っており、それぞれのLEDチップに流す電流の大きさを変えてそれぞれの色の光の強度を変え、3色の混合割合を変えると、発光色を変化させる 。
=== どのような入力を取り扱うのか
電流を入力として取り扱う。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に) <H_LEDダイオード_data>
OptoSupplyによると、赤色は2.8Vぐらいを加えると最大光量に達成するが、緑と青色は、3.8Vぐらいを加えると最大光量に達成する @rgbled_datasheet 。
@H_LEDダイオード_data @LEDダイオードグラフ は、電圧が増加すると光量が増加する。グラフの形としては指数関数的に増加している。
#figure(
image("./img/LEDダイオードグラフ.png",width: 50%),
caption: "LEDダイオードグラフ"
)<LEDダイオードグラフ>
=== どのようなピンアサイン (各ピンの役割) か <H_LEDダイオード_pin>
OptoSupplyによると、LEDのピンアサインは、緑が1番、青が2番、GNDが3番, 赤が4番である @rgbled_datasheet 。
@H_LEDダイオード_pin @LEDダイオードピンアサイン は、ピンアサインを示している。
#figure(
image("./img/LEDダイオードピンアサイン.png",width: 50%),
caption: "LEDダイオードピンアサイン"
)<LEDダイオードピンアサイン>
=== 正しい動作の条件,範囲は何か
秋月電子通商によると、以下の通りとなる @rgbled_akituki 。
- 種別:砲弾型
- 色:赤・緑・青
- ドミナント波長:赤635nm・緑525nm・青470nm
- ドミナント波長赤:635nm
- ドミナント波長緑:525nm
- ドミナント波長青:470nm
- 光度:赤2000mcd・緑7000mcd・青2500mcd
- 光度赤:2000mcd
- 光度緑:7000mcd
- 光度青:2500mcd
- 順電圧:赤2V・緑3.6V・青3.6V
- 順電圧赤:2V
- 順電圧緑:3.6V
- 順電圧青:3.6V
- 順電流max.:赤30mA・緑30mA・青30mA
- 順電流max.赤:30mA
- 順電流max.緑:30mA
- 順電流max.青:30mA
- 逆電圧:赤5V・緑5V・青5V
- 逆電圧赤:5V
- 逆電圧緑:5V
- 逆電圧青:5V
- 許容損失max.:赤75mW・緑105mW・青105mW
- 許容損失max.赤:75mW
- 許容損失max.緑:105mW
- 許容損失max.青:105mW
- 半減角:30°
- 動作温度min.:-30℃
- 動作温度max.:85℃
- 構成:カソードコモン
- 端子部形状:ピン
- 実装タイプ:スルーホール
- 長さ:8.7mm
- 径:5mm
#pagebreak() // ページを分ける
== @H_LEDアレイ @LEDアレイ の電子部品 ( LEDアレイ C-551SRD) を次のような点から調べなさい。 <H_LEDアレイ>
#figure(
image("./img/LEDアレイ.png",width: 50%),
caption: "LEDアレイ"
)<LEDアレイ>
=== どのような部品か
数字情報の表示に特化したデジタル表示モジュール。表示する数字の形状部に発光ダイオード(LED)を配しているため、大変視認性に優れている。「LED数字表示器」や「7セグLED」と呼ばれる場合もある @led7seg_rohm 。
=== どのような仕組みか <H_LEDアレイ_仕組み>
値を表示するデジット部分と、そのデジット部分を表示するためのLEDが組み合わさったもの。7セグメントLEDは、7つのLEDを組み合わせて数字を表示するデバイスである。7つのLEDは、それぞれが1つのセグメントを表し、数字を表示するためには、それぞれのセグメントを点灯させ数字を表示する。
@H_LEDアレイ_仕組み @7セグメントLED各部の名称 は、7セグメントLEDの各部の名称を示している。
#figure(
image("./img/7セグメントLED各部の名称.png",width: 50%),
caption: "7セグメントLED各部の名称"
)<7セグメントLED各部の名称>
=== どのような入力を取り扱うのか
電流を入力として取り扱う。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に) <H_LEDアレイ_data>
PARALIGHTによると、LEDの立ち上がり電圧は1.6Vとなっており、それ以降は素早く光量が増加していく @led7seg_datasheet 。
@H_LEDアレイ_data @LEDアレイグラフ は、電圧が増加すると電流値が増加する。グラフの形としては指数関数的に増加している。
#figure(
image("./img/LEDアレイグラフ.png",width: 50%),
caption: "LEDアレイグラフ"
)<LEDアレイグラフ>
=== どのようなピンアサイン (各ピンの役割) か <H_LEDアレイ_pin>
@H_LEDアレイ_pin @LEDアレイピンアサイン は、ピンアサインを示している。
カソードコモンの7セグメントLEDであるため、各セグメントのアノードには電圧を加えると点灯する。また、カソードは共通である。
一つ一つのLEDには、それぞれのセグメントに対応するピンがある。
#figure(
image("./img/LEDアレイピンアサイン.png",width: 80%),
caption: "LEDアレイピンアサイン"
)<LEDアレイピンアサイン>
=== 正しい動作の条件,範囲は何か
秋月電子通商によると、以下の通りとなる @led7seg_akituki 。
- セグメント数:7
- 桁数:1
- 色:赤
- 光度:10mcd
- 順電圧:1.8V
- 順電流max.:30mA
- 逆電圧:5V
- 表面色:黒
- コモンタイプ:カソードコモン
- 文字幅:8mm
- 文字高さ:14.2mm
- 許容損失max.:60mW
- 動作温度min.:-35℃
- 動作温度max.:85℃
- 実装タイプ:スルーホール
- 長さ:19mm
- 幅:12.7mm
- 高さ:8mm
#pagebreak() // ページを分ける
== @H_DCモーター @DCモーター の電子部品 ( DCモーター FA-130RA) を次のような点から調べなさい。<H_DCモーター>
#figure(
image("./img/DCモーター.png",width: 50%),
caption: "DCモーター"
)<DCモーター>
=== どのような部品か
DCモーターは、直流電源を用いて回転運動を行うモーターである。モーターを回すと、モーターの軸に取り付けた部品を回転できる。
ラジコンや模型の動力源として使われる @dc_motor_akituki 。
=== どのような仕組みか
FA-130RAはブラシ付きモーターである。ブラシ付きモーターは、モーターの回転子に巻かれたコイルに電流を流すことで、回転子に磁界を発生させ、それによって回転子を回転させる。ブラシ付きモーターは、モーターの回転子に巻かれたコイルに電流を流すことで、回転子に磁界を発生させ、それによって回転子を回転させる。
シンプルな構造だが、ブラシレスDCモータのブラシと整流子は常に接触したまま回転し、摩耗するため、定期的な交換といったメンテナンスが必要である @dc_motor_aspina 。
=== どのような入力を取り扱うのか
電流を入力として取り扱う。
マイコンの電流そのままではモーターを動かすことができないため、モータードライバなどを介して外部電源でモーターを制御する。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に) <H_DCモーター_data>
MERCURY MOTORによると、DCモーターの回転数は、電流が上昇するとトルクが上昇する。 @dc_motor_datasheet 。
@H_DCモーター_data @DCモーターグラフ は、電圧が増加すると回転数が増加する。グラフの形としては線形的に増加している。
#figure(
image("./img/DCモーターグラフ.png",width: 50%),
caption: "DCモーターグラフ"
)<DCモーターグラフ>
=== どのようなピンアサイン (各ピンの役割) か <H_DCモーター_pin>
特にピンアサインなどはないが、モーターの端子には、電流を流すための端子がある。
電流の向きによって回転方向が変わる。
@H_DCモーター_pin @DCモーターの端子 は、DCモーターの端子を表している。
#figure(
image("./img/DCモーターピンアサイン.png",width: 50%),
caption: "DCモーターの端子"
)<DCモーターの端子>
=== 正しい動作の条件,範囲は何か
秋月電子通商によると、以下の通りとなる @dc_motor_akituki 。
- 定格電圧:1.5V
- 無負荷回転数:9100rpm
- 無負荷電流:0.2A
- 定格負荷回転数:6990rpm
- 定格負荷電流:0.66A
- 定格負荷トルク[gf・cm]:6.0gf・cm
- 定格負荷出力:0.43W
- 停動トルク[gf・cm]:26gf・cm
- 停動電流:2.2A
- 端子部形状:ラグ
- 軸径:2mm
- 軸形状:丸
- 長辺:24.8mm
- 短辺:20.1mm
- 高さ:15mm
#pagebreak() // ページを分ける
== @H_トランジスタ @トランジスタ の電子部品 ( トランジスタ 2SC2120Y) を次のような点から調べなさい。<H_トランジスタ>
#figure(
image("./img/トランジスタ.jpg",width: 50%),
caption: "トランジスタ"
)<トランジスタ>
=== どのような部品か <H_トランジスタとは>
トランジスタは、電気信号を増幅したりスイッチングしたりする機能を持っている。
ラジオの場合、空中を伝わってきた極めて微弱な信号を拡大(増幅)して、スピーカーを鳴らす。
また、あらかじめ決められた信号が来た時だけトランジスタが動作するスイッチの役割も果たす @transistor_rohm 。
@H_トランジスタとは @トランジスタとは は、トランジスタの基本機能を示している。
#figure(
image("./img/トランジスタとは.png",width: 90%),
caption: "トランジスタとは"
)<トランジスタとは>
=== どのような仕組みか <H_トランジスタの仕組み>
トランジスタは、PN接合により構成され、ベースに電流を流すことで、コレクタ-エミッタ間に電流が流れる
ベース-エミッタ間に順方向電圧(VBE)を印加すると、エミッタの電子(-の電荷)がベースに流れ込み、一部の電子がベースの正孔(+の電荷)と結合する。これが、ベースの微小電流(IB)となる。
ベース(P型半導体)は構造的に薄く作られており、エミッタからベースに流入してきた電子の多くはコレクタに抜け出す。
コレクタ-エミッタ間電圧(VCE)によって電子(-の電荷)が誘導されてコレクタ電極方向に移動する。これがコレクタ電流ICとなる @transistor_rohm 。
@H_トランジスタの仕組み @トランジスタの仕組み は、トランジスタの基本的な仕組みを示している。
#figure(
image("./img/トランジスタの仕組み.png",width: 50%),
caption: "トランジスタの仕組み"
)<トランジスタの仕組み>
=== どのような入力を取り扱うのか
ベース、エミッタ間の電流を入力として取り扱う。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に) <H_トランジスタ_data>
JIANGSU CHANGJIANG ELECTRONICS TECHNOLOGYによると、トランジスタの電流増幅率は、ベース電流が増加すると、コレクタ電流が増加する @transister_datasheet 。
@H_トランジスタ_data @トランジスタグラフ1 は、Ic-Vbeの特性を示している。
エミッタ接地トランジスタの静特性で、コレクタ電流ICとベース-エミッタ間電圧VBEの関係を表した特性である。
ベース・エミッタ間の電圧Vbeを変化させたときのコレクタ電流Icの変化を示している。
0.7V以上のVbeで急激にIcが増加する。立ち上がりの部分が急激なため、トランジスタのスイッチング特性として利用される。
@H_トランジスタ_data @トランジスタグラフ2 は、Ic-Vceの特性を示している。
静特性(IC-VCE特性)はコレクタ電流Icとコレクタエミッタ間電圧VCEの関係を示している。静特性(IC-VCE特性)とは、あるコレクタエミッタ間電圧Vceにおいて流すことが可能なコレクタ電流Icの能力を示したものである。
Ibの電流を流したときに、Vceを変化させたときのIcの変化を示している。
Ibにそこそこの電流が流れていないと、Icはほとんど流れない。Ibに十分な電流が流れていると、Icはほぼ一定の値を取る。この二つの特性を見ることで、トランジスタの特性をざっくり理解することができる。
#figure(
image("./img/トランジスタグラフ1.png",width: 50%),
caption: "トランジスタグラフ1"
)<トランジスタグラフ1>
#figure(
image("./img/トランジスタグラフ2.png",width: 50%),
caption: "トランジスタグラフ2"
)<トランジスタグラフ2>
=== どのようなピンアサイン (各ピンの役割) か <H_トランジスタ_pin>
JIANGSU CHANGJIANG ELECTRONICS TECHNOLOGYによると、トランジスタのピンアサインは、エミッタが1番、コレクタが2番、ベースが3番である @transister_datasheet 。
@H_トランジスタ_pin @トランジスタピンアサイン は、トランジスタのピンアサインを示している。
#figure(
image("./img/トランジスタピンアサイン.png",width: 50%),
caption: "トランジスタピンアサイン"
)<トランジスタピンアサイン>
=== 正しい動作の条件,範囲は何か
秋月電子通商によると、以下の通りとなる @transistor_akituki 。
- 接合構造:NPN
- コレクターエミッター間電圧:30V
- コレクターベース間電圧:35V
- エミッターベース間電圧:5V
- コレクター電流:800mA
- コレクターエミッター飽和電圧:0.5V
- ベースエミッター間電圧:0.8V
- 許容損失max.:600mW
- 直流電流増幅率min.:160
- 直流電流増幅率max.:320
- トランジション周波数:100MHz
- 実装タイプ:スルーホール
- パッケージ:TO-92
- パッケージタイプ:TO92
#pagebreak() // ページを分ける
== @H_ダイオード @ダイオード の電子部品 (ダイオード 11EQS04) を次のような点から調べなさい。 <H_ダイオード>
#figure(
image("./img/ダイオード.jpg",width: 50%),
caption: "ダイオード"
)<ダイオード>
=== どのような部品か
電流を一定方向に通す半導体素子。電流が一方向にしか流れない性質を利用して、整流器や電圧安定器などに使用される。
=== どのような仕組みか <H_ダイオード仕組み>
金属と半導体との接合によって生じるショットキー障壁を利用したダイオード。
pnダイオードと仕組みは似ていて、P型チャネルは電子を多く含み、N型チャネルは電子を少なく含む。このため、純電流を流すことで、P型チャネルからN型チャネルに電子が流れ、電子が流れることで電流が流れる。しかし、逆電流になると、電子が電極側に集まり、PN結合部に空白地帯が発生して、電気が流れなくなる。
この仕組みを応用して、ショットキーダイオードを作成して、整流を行なっている。
@H_ダイオード仕組み @ダイオード仕組み は、ダイオードの仕組みを示している。
#figure(
image("./img/ダイオード仕組み.png",width: 70%),
caption: "ダイオード仕組み"
)<ダイオード仕組み>
=== どのような入力を取り扱うのか
ベース、エミッタ間の電流を入力として取り扱う。
=== 入力に応じて出力がどう変化するのか (データシートや仕様書を参考に) <H_ダイオード_data>
アノードに正の電圧を加えると、キャリアがアノードに向かって移動し、電流が流れる。逆に、アノードに負の電圧を加えると、キャリアがアノードに向かって移動できなくなり、電流が流れなくなる。
@H_ダイオード_data @ダイオードグラフ は、電圧が増加すると電流値が増加する。グラフの形としては指数関数的に増加している。
立ち上がり電圧は0.4Vである。
#figure(
image("./img/ダイオードグラフ.png",width: 50%),
caption: "ダイオードグラフ"
)<ダイオードグラフ>
=== どのようなピンアサイン (各ピンの役割) か <H_ダイオード_pin>
KYOCERAによると、ダイオード帯がついている側がカソードで、帯がついていない側がアノードである@transister_datasheet 。
@H_ダイオード_pin @ダイオードピンアサイン は、トランジスタのピンアサインを示している。
#figure(
image("./img/ダイオードピンアサイン.png",width: 40%),
caption: "ダイオードピンアサイン"
)<ダイオードピンアサイン>
=== 正しい動作の条件,範囲は何か
秋月電子通商によると、以下の通りとなる @transistor_akituki 。
- 構造:ショットキー接合
- 素材:シリコン
- ピーク耐圧:40V
- 平均順電流:1A
- ピーク順電流:40A
- 順電圧:0.55V
- 実装タイプ:スルーホール
- パッケージ:アキシャルリード
- パッケージタイプ:アキシャルリード
#pagebreak() // ページを分ける
== フルカラーLED を扱う上で、「RGB」・「カソードコモン、アノードコモン」という用語を知っておく必要がある。これらはどういう意味か?レポートで考察することも考慮の上、調べてまとめなさい、なお、「LED アレイ」は7 セグメントLED7、 セグメントディスプレイなどとも呼ばれる.
アノードコモンは、アノードが共通であることを示している。アノードコモンの場合、5V電圧を共通部に接続し、各セグメントに対してGNDを接続することで、各セグメントを点灯させることができる。
また、カソードコモンは、カソードが共通であることを示している。カソードコモンの場合、GNDを共通部に接続し、各セグメントに対して5V電圧を接続することで、各セグメントを点灯させることができる。
#pagebreak() // ページを分ける
// bibファイルの指定 //
#bibliography("./bibliography.bib")
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/visualize/shape-aspect_04.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test different ways of sizing.
#set page(width: 120pt, height: 40pt)
#stack(
dir: ltr,
spacing: 2pt,
circle(radius: 5pt),
circle(width: 10%),
circle(height: 50%),
)
|
https://github.com/jgpr-code/typst_intro | https://raw.githubusercontent.com/jgpr-code/typst_intro/main/slides.typ | typst | #import "@preview/polylux:0.3.1": *
#import themes.clean: *
// ------------------------------------------------------------------------------------------------
#let ul_red = rgb("#ca0123")
#let typst_turquoise = rgb("#239dae")
#set text(font: "Arial") // changing font size won't affect slides...
#let myslide(title, body) = {
slide[
#stack(
heading(level: 2, title),
v(0.25em)
)
#set text(size: 22pt) // here it will affect the slides though
#body
]
}
// ------------------------------------------------------------------------------------------------
// #show: clean-theme.with(
// footer: text(fill: ul_red, weight: "semibold")[Safety. Science. Transformation.™],
// short-title: [Intro to TYPST],
// logo: image("media_private/UL_Logo.png"),
// color: ul_red
// )
#show: clean-theme.with(
footer: text(fill: typst_turquoise, weight: "semibold")[\#SWEC24],
short-title: [Intro to TYPST],
// logo: image("media/Typst_Logo.png"),
color: typst_turquoise
)
#show "TYPST": it => {
set text(font: "Verdana", weight: "semibold", fill: typst_turquoise)
[typst]
}
#show raw.where(block: false): box.with(
fill: luma(240),
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt,
)
#show raw.where(block: true): block.with(
fill: luma(240),
inset: 10pt,
radius: 4pt,
)
#show raw.where(lang: "typ-show"): it => {
grid(
columns: (1fr, 1fr),
align: (center, center),
raw(align: start, block: true, it.text, lang: "typ"),
rect(radius: 10pt, inset: 15pt, {
set text(font: "Arial", size: 16pt)
set align(start)
eval(it.text, mode: "markup")})
)
}
// ------------------------------------------------------------------------------------------------
#title-slide(
title: "TYPST",
subtitle: "An Introduction",
authors: "<NAME>",
date: datetime(year: 2024, month: 5, day: 4).display(),
watermark: [],
secondlogo: []
)
#new-section-slide[Installation & Setup]
#myslide("Installation")[
To install typst we will just use `winget`:
```shell
C:\Users\26383> winget install --id Typst.Typst
```
Now you can already create your first typst file `file.typ` and compile it:
```shell
C:\Users\26383> echo Hello World > first.typ
C:\Users\26383> typst compile first.typ
```
]
#myslide("VS Code Extensions")[
I recommend using VS Code and installing the following extensions:
#grid(
columns: (1fr, 1fr),
align: (center, center),
[
#scale(x: 150%, y: 150%, reflow: true, image("media/Typst_LSP.png"))
],
[
#scale(x: 150%, y: 150%, reflow: true, image("media/VSCode_Pdf.png"))
]
)
]
#new-section-slide[Basics]
#myslide("Simple Text")[
```typ-show
= Heading Level 1
Just text.\ \\ forces a linebreak
== Heading Level 2
An enumeration:
+ basic formattings:
- _italic_
- *bold*
+ /* comment */ 2nd item // comment
```
]
#myslide("Set Rules")[
```typ-show
Set rules allow change of style.
#set text(font: "Consolas")
Now all text has different font
#set align(center)
#set text(
size: 18pt,
fill: red,
weight: "semibold")
Text has many options!
```
]
#myslide("Show Rules")[
```typ-show
Show rules allow further customizations:
#show "difficult": "easy"
#show heading: heading => [
#set align(center)
#underline(heading.body)
]
#show heading.where(level: 3): set text(red)
#show: it => {rect(inset: 10pt, it)}
== Typst is difficult
=== Show rules are difficult
#lorem(20)
```
]
#new-section-slide[Scripting]
#myslide("Variables and Conditionals")[
#only(1)[
```typ-show
#let subject = [Typst] // a variable
#let listeners = 10
#let audience = if listeners > 10 {
[the *Best*]
} else {
[very good]
}
This talk is about #subject.\
Its audience is #audience!
```
]
#only(2)[
```typ-show
#let subject = [Typst] // a variable
#let listeners = 25 // now more!
#let audience = if listeners > 10 {
[the *Best*]
} else {
[very good]
}
This talk is about #subject.\
Its audience is #audience!
```
]
]
#myslide("Types of Blocks")[
```typ-show
+ \[ \] is used for content
+ \# and \{ \} is used for code
For example:
#let a = [Content block]
// #{ to start a code block
#{
let b = [ is the default]
a + b
}
```
]
#myslide("Arrays, Dictionaries and Loops")[
```typ-show
#let arr = (1, 2, 3)
#let dict = (
first: "Hello",
second: "World",
)
#for i in arr {
[#i]
}\
#for (key, val) in dict [
#key: #val
] // newlines in content block -> space 🙁
```
]
#myslide("Functions")[
```typ-show
#let add(x, y) = {x + y}
#add(2, 3)
#let alert(fill: red, body) = {
set text(white)
rect(fill: fill, [*Warning*\ #body])
}
#alert[Functions]
#alert("Functions")
#alert(fill: blue)[Overwritten]
```
]
#myslide("Sinks and Spreading")[
```typ-show
// variable number of arguments
#let separate_words(sep, ..words) = {
let words_array = words.pos()
for word in words_array.intersperse(sep) {
[#word]
}
}
#separate_words("~", "a", "b", "c", "d")\
#let fruits = ("Apple", "Banana", "Cherry")
// pass array as individual arguments
#separate_words("|", ..fruits)
```
]
#new-section-slide[Other]
#myslide("Spacing")[
```typ-show
We can use `#h`#h(15pt) for horizontal and
`#v`#v(10pt)
for vertical spacings
Percentages or fractions are also a cool way
#v(10%)
to #h(1fr) divide #h(2fr) the
#v(10%)
space
```
]
#myslide("Grid")[
```typ-show
#let rects = (aqua, orange, blue, aqua).map(
it => rect(width: 100%, fill: it))
#grid(
columns: (1fr, 2fr, 1fr),
column-gutter: 4pt, row-gutter: 2pt,
grid.cell(
x: 0, y: 1, colspan: 2,
rect(width: 100%, fill: orange)
),
..rects
)
```
]
#myslide("Colors")[
```typ-show
#let ul = rgb("#ca0123")
#let typst = rgb("#239dae")
#let gradient = gradient.linear(
dir: ttb, ul, yellow, typst
)
#set align(center)
#set text(size: 50pt, fill: gradient)
#stack(spacing: 10pt)[Colors][♥❤♥][Typst]
```
]
#new-section-slide[
#link("https://typst.app/docs/reference")[Documentation]\
&\
Live Demo
]
#new-section-slide[Questions?] |
|
https://github.com/Myriad-Dreamin/shiroa | https://raw.githubusercontent.com/Myriad-Dreamin/shiroa/main/CHANGELOG/CHANGELOG-0.1.md | markdown | Apache License 2.0 | # v0.1.5
## Changelog since v0.1.5
- Fixed documentation about building by @duskmoon314 in https://github.com/Myriad-Dreamin/typst-book/pull/67
- Updated typst.ts to v0.5.0-rc4 (with canvas improvements) in https://github.com/Myriad-Dreamin/typst-book/pull/70
- Supported basic theming in https://github.com/Myriad-Dreamin/typst-book/pull/71
**Full Changelog**: https://github.com/Myriad-Dreamin/typst-book/compare/v0.1.4...v0.1.5
# v0.1.4
## Changelog since v0.1.4
**Full Changelog**: https://github.com/Myriad-Dreamin/typst-book/compare/v0.1.3...v0.1.4
- (Fix) Specifying white space pre props in CSS in https://github.com/Myriad-Dreamin/typst-book/pull/54
- (Fix) Improved `plain-text` by @ice1000 in https://github.com/Myriad-Dreamin/typst-book/pull/57
- (Fix) Used `overflow-x: auto` by @ice1000 in https://github.com/Myriad-Dreamin/typst-book/pull/58
- Performed null checking on creating labels in template in https://github.com/Myriad-Dreamin/typst-book/pull/59
- You need to update your template to get this change.
# v0.1.3
## Changelog since v0.1.3
**Full Changelog**: https://github.com/Myriad-Dreamin/typst-book/compare/v0.1.2...v0.1.3
Most efforts are internal improvements and there is no external changes since v0.1.2.
- Implemented new text selection, which already works great on simple pages.
- Improved performance on large pages. Note: you may still get bad performance if you set `#set page(height: auto)`, which will get improved in the future.
# v0.1.2
## Changelog since v0.1.2
**Full Changelog**: https://github.com/Myriad-Dreamin/typst-book/compare/v0.1.1...v0.1.2
## Feature
- feat: automatically assign section number in https://github.com/Myriad-Dreamin/typst-book/pull/37
- dev: enable ligature feature in https://github.com/Myriad-Dreamin/typst-book/pull/38
- scripting: cross link support in https://github.com/Myriad-typstbook/pull/41
- scripting: support semantic link jump in https://github.mMyriad-Dreamin/typst-book/pull/42
## Enhancement
- theme: override target="\_blank" behavior in https://github.com/Myriad-Dreamin/typst-book/pull/27 and https://github.com/Myriad-Dreamin/typst-book/pull/28
- scripting: improve plain text conversion in https://github.com/Myriad-Dreamin/typst-book/pull/39
- This is used by conversion of typst title contents
- scripting: don't justify code block in https://github.com/Myriad-Dreamin/typst-book/pull/40
- You can update your template like it.
- build: upgrade typst.ts to 0.4.1 in https://github.com/Myriad-Dreamin/typst-book/pull/36
- It brings text selection enhancement
# v0.1.1
## Changelog since v0.1.1
**Full Changelog**: https://github.com/Myriad-Dreamin/typst-book/compare/v0.1.0...v0.1.1
## Enhancement
- cli: correctly evict compilation cache in https://github.com/Myriad-Dreamin/typst-book/commit/149446ab63dd9ea628b1d30bc5eed7cac1582b62
- this reduces memory usage slightly.
## Feature
- theme: sidebar improvement in https://github.com/Myriad-Dreamin/typst-book/commit/dfff00639142d881cd11a8ae2da379aa08505b0b and https://github.com/Myriad-Dreamin/typst-book/commit/313c11d37df679670426e85c05431b687aa71056
- theme: scrollbar improvement in https://github.com/Myriad-Dreamin/typst-book/commit/e274777809a6fc469f4b84509cf5522d94bc9daf
- theme: support dark themes and more by @seven-mile in https://github.com/Myriad-Dreamin/typst-book/pull/23
- typesetting: add repository-edit template in https://github.com/Myriad-Dreamin/typst-book/commit/9f1260c0706954faeb7bb90388143cdbf11185ab
- cli: add version command in https://github.com/Myriad-Dreamin/typst-book/pull/25
# v0.1.0
Initial release
|
https://github.com/ntjess/typst-tada | https://raw.githubusercontent.com/ntjess/typst-tada/main/src/ops.typ | typst | The Unlicense | #import "./tabledata.typ": TableData, add-expressions, subset, update-fields, stack
#import "./helpers.typ" as H
/// Performs an aggregation across entire data columns.
///
/// ```example
/// #let td = TableData(data: (a: (1, 2, 3), b: (4, 5, 6)))
/// #to-tablex(agg(td, a: array.sum, b-average: "b.sum() / b.len()"))
/// ```
/// - td (TableData): The table to aggregate
/// - field-info (dictionary): Optional overrides to the initial table's field info.
/// This is useful in case an aggregation function changes the field's type or needs
/// a new display function.
/// - ..field-func-map (dictionary): A mapping of field names to aggregation functions or
/// expressions. Expects a function accepting named arguments, one for each field in the
/// table. The return value will be placed in a single cell.
/// - #text(red)[*Note*!] If the assigned name for a function matches an existing field,
/// _and_ a function (not a string) is passed, the behavior changes: Instead, the
/// function must take one _positional_ argument and only receives values for the field
/// it's assigned to. For instance, in a table with a field `price`, you can easily
/// calculate the total price by calling `agg(td, price: array.sum)`. If this behavior
/// was not enabled, this would be `agg(td, price: (price: none, ..rest) => price.sum()`.
/// - Columns will have their missing (`none`) values removed before being passed to the
/// function or expression.
#let agg(td, field-info: (:), ..field-func-map) = {
let named = field-func-map.named()
let values = (:)
let cleaned-data = H.dict-from-pairs(
td.data.keys().zip(td.data.values().map(arr => arr.filter(v => v != none)))
)
for (field, func) in named {
let result = none
if type(func) == function and field in td.data {
// Special behavior described in docstring
result = func(td.data.at(field))
} else {
result = H.eval-str-or-function(
func, mode: "code", scope: cleaned-data, keyword: cleaned-data
)
}
// Agg results are treated as one value, so even if they return multiple outputs,
// it will be considered a nested array.
values.insert(field, (result, ))
}
let valid-fields = td.field-info.keys().filter(field => field in named)
let valid-field-info = H.keep-keys(td.field-info, keys: valid-fields)
TableData(
..td, field-info: H.merge-nested-dicts(valid-field-info, field-info), data: values
)
}
/// Sequentially applies a list of table operations to a given table.
///
/// The operations can be any function that takes a TableData
/// object as its first argument. It is recommended when applying many transformations
/// in a row, since it avoids the need for deeply nesting operations or keeping many
/// temporary variables.
///
/// Returns a TableData object that results from applying all the operations in sequence.
///
/// ```example
/// #let td = TableData(data: (a: (1, 2, 3), b: (4, 5, 6)))
/// #to-tablex(chain(td,
/// filter.with(expression: "a > 1"),
/// sort-values.with(by: "b", descending: true)
/// ))
/// ```
/// - td (TableData): The initial table to which the operations will be applied.
/// - ..operations (array): A list of table operations. Each operation
/// is applied to the table in sequence. Operations must be compatible with TableData.
/// -> TableData
#let chain(td, ..operations) = {
for op in operations.pos() {
if type(op) == array {
td = op.at(0)(td, ..op.slice(1))
} else {
td = op(td)
}
}
td
}
/// Filters rows in a table based on a given expression, returning a new TableData object
/// containing only the rows for which the expression evaluates to true. This function filters
/// rows in the table based on a boolean expression. The expression is evaluated for each row,
/// and only rows for which the expression evaluates to true are retained in the output table.
///
/// ```example
/// #let td = TableData(data: (a: (1, 2, 3), b: (4, 5, 6)))
/// #to-tablex(filter(td, expression: "a > 1 and b > 5"))
/// ```
///
/// - td (TableData): The table to filter.
/// - expression (string): A boolean expression used to filter rows. The expression
/// can reference fields in the table and must result in a truthy output.
/// -> TableData
///
#let filter(td, expression: none) = {
let mask = add-expressions(td, __filter: expression).data.__filter
let out-data = (:)
for key in td.data.keys() {
out-data.insert(
key,
td.data.at(key).zip(mask)
.filter(val-mask => val-mask.at(1))
.map(val-mask => val-mask.at(0))
)
}
TableData(..td, data: out-data)
}
/// Sorts the rows of a table based on the values of a specified field, returning a new
/// TableData object with rows sorted based on the specified field.
///
/// ```example
/// #let td = TableData(data: (a: (1, 2, 3), b: (4, 5, 6)))
/// #to-tablex(sort-values(td, by: "a", descending: true))
/// ```
/// - td (TableData): The table to be sorted.
/// - by (string): The field name to sort by.
/// - key (function): Optional. A function that transforms the values of the field before
/// sorting. Defaults to the identity function if not provided.
/// - descending (bool): Optional. Specifies whether to sort in descending order. Defaults
/// to false for ascending order.
/// -> TableData
#let sort-values(td, by: none, key: (values) => values, descending: false) = {
if by == none {
panic("`sort()` requires a field name to sort by")
}
let values-and-indexes = td.data.at(by).map(key).enumerate()
let indexes = values-and-indexes
.sorted(key: (idx-vals) => idx-vals.at(1))
.map(idx-vals => idx-vals.at(0))
if descending {
indexes = indexes.rev()
}
let sorted-data = (:)
for (key, column) in td.data {
column = indexes.map(idx => column.at(idx))
sorted-data.insert(key, column)
}
TableData(..td, data: sorted-data)
}
/// Creates a list of (value, group-table) pairs, one for each unique value in the
/// given field. This list is optionally condensed into one table using specified
/// aggregation functions.
///
/// ```example
/// #let td = TableData(data: (
/// a: (1, 1, 1, 2, 3, 3),
/// b: (4, 5, 6, 7, 8, 9),
/// c: (10, 11, 12, 13, 14, 15)
/// ))
/// #let first-group = group-by(td, by: "a").at(0)
/// Group identity: #repr(first-group.at(0))
/// #to-tablex(first-group.at(1))
/// Aggregated:
/// #to-tablex(group-by(td, by: "a", aggs: (count: "a.len()")))
///
/// ```
///
/// - td (TableData): The table to group
/// - by (string): The field whose values are used for grouping.
/// - aggs (dictionary): (field -> function) aggregations. They are applied to each group
/// and the results are concatenated into a single table. See @@agg() for behavior and
/// accepted values.
/// - field-info (dictionary): Optional overrides to the initial table's field info.
/// -> array, TableData
#let group-by(td, by: none, aggs: (:), field-info: (:)) = {
let groups = td.data.at(by).dedup()
let group-agg = groups.map(group-value => {
let filtered = filter(td, expression: by + " == " + repr(group-value))
if aggs.len() == 0 {
return filtered
}
let agg-td = agg(filtered, ..aggs, field-info: field-info)
let cur-group-info = td.field-info.at(by) + (values: (group-value, ))
let updated-field = (:)
updated-field.insert(by, cur-group-info)
// Take a subset to ensure group comes first
return chain(
agg-td,
update-fields.with(..updated-field),
subset.with(fields: (by, ..aggs.keys())),
)
})
if aggs.len() > 0 {
let dummy-data = H.default-dict((by,) + aggs.keys(), value: ())
let initial = TableData(data: dummy-data)
return group-agg.fold(initial, stack)
} else {
return groups.zip(group-agg)
}
}
|
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/PianoDiProgetto/functions.typ | typst | MIT License | #let glossary(content) = {
emph[#content#sub("G")]
}
#let team = {
emph[SWAT Engineering]
}
#let rendicontazioneOreAPosteriori(sprintNumber: "01") = {
let rendicontazioneOre = csv("sprintData/Sprint#" + sprintNumber + "/RendicontazioneOre.csv")
[=== Rendicontazione ore a posteriori]
[I seguenti in tabella, sono i ruoli assunti per ogni componente del gruppo, durante l'attuale #glossary[sprint]:]
figure(
table(
columns: (130pt,auto,auto,auto,auto,auto,auto,130pt),
align: center,
..rendicontazioneOre.flatten().map(item => {
if item == "Nominativo" or item == "Am" or item == "An" or item == "Pr" or item == "Pt" or item == "Re" or item == "Ve" or item == "Totale per persona" or item == "Totale per ruolo" {
return [*#item*]
}else{
return [#item]
}
})
),
caption: "Ore assunte per ciascun componente del gruppo durante l'attuale " + glossary[sprint]
)
figure(
image("sprintData/Sprint#" + sprintNumber + "/RendicontazioneRuoliTorta.png", width: 60%),
caption: [Areogramma della partizione delle ore per ruolo nello #glossary[sprint] numero #sprintNumber.],
)
figure(
image("sprintData/Sprint#" + sprintNumber + "/RendicontazioneRuoliIstogramma.png", width: 60%),
caption: [Istogramma delle ore svolte per persona nello #glossary[sprint] #sprintNumber.],
)
}
#let rendicontazioneCostiAPosteriori(sprintNumber: "01") = {
let rendicontazioneCosti = csv("sprintData/Sprint#" + sprintNumber + "/RendicontazioneCosti.csv")
[=== Rendicontazione costi a posteriori]
[In questo #glossary[sprint], il costo per ogni ruolo assunto viene riportato in tabella:]
figure(
table(
columns: (120pt,60pt,100pt),
align: center,
..rendicontazioneCosti.flatten().map(item => {
if item == "Ruolo" or item == "Ore" or item == "Totale" or item == "Rimanente" {
return [*#item*]
}else if item == "Costo"{
return [*#item* (in €)]
}else{
return [#item]
}
})
),
caption: "Panoramica dei costi dell'attuale " + glossary[sprint] + " in base ai ruoli impiegati."
)
figure(
image("sprintData/Sprint#" + sprintNumber + "/RendicontazioneCostiCashTorta.png", width: 60%),
caption: [Areogramma del budget speso fino alla fine dell'attuale #glossary[sprint] numero #sprintNumber, rispetto al totale.],
)
figure(
image("sprintData/Sprint#" + sprintNumber + "/RendicontazioneCostiTimeTorta.png", width: 60%),
caption: [Areogramma del tempo (in ore) speso fino alla fine dell'attuale #glossary[sprint] numero #sprintNumber, rispetto al totale.],
)
}
#let prospettoOrario(sprintNumber: "1") = {
let table_time = csv("preventivi/assets/tables/tableProspettoOrario" + sprintNumber + ".csv")
[=== Prospetto orario]
[I seguenti in tabella, sono i ruoli assunti per ogni componente del gruppo, durante questo #glossary[sprint]:]
figure(
table(
columns: (130pt,auto,auto,auto,auto,auto,auto,130pt),
align: center,
..table_time.flatten().map(item => {
if item == "Nominativo" or item == "Am" or item == "An" or item == "Pr" or item == "Pt" or item == "Re" or item == "Ve" or item == "Totale per persona" or item == "Totale per ruolo" {
return [*#item*]
}else{
return [#item]
}
})
)
)
figure(
image("preventivi/assets/rolesPie/areogramma" + sprintNumber + ".png", width: 60%),
caption: [Areogramma della partizione delle ore per ruolo nello #glossary[sprint] numero #sprintNumber.],
)
figure(
image("preventivi/assets/barChart/istogramma" + sprintNumber + ".png", width: 60%),
caption: [Istogramma delle ore svolte per persona nello #glossary[sprint] #sprintNumber.],
)
}
#let prospettoEconomico(sprintNumber: "1") = {
let table_cost = csv("preventivi/assets/tables/tableProspettoEconomico" + sprintNumber + ".csv")
[=== Prospetto economico]
[In questo #glossary[sprint], il costo per ogni ruolo assunto viene riportato in tabella:]
figure(
table(
columns: (120pt,60pt,100pt),
align: center,
..table_cost.flatten().map(item => {
if item == "Ruolo" or item == "Ore" or item == "Totale" or item == "Rimanente" {
return [*#item*]
}else if item == "Costo"{
return [*#item* (in €)]
}else{
return [#item]
}
})
)
)
figure(
image("preventivi/assets/cashPie/areogramma" + sprintNumber + ".png", width: 60%),
caption: [Areogramma del budget speso preventivato per lo #glossary[sprint] numero #sprintNumber, rispetto al totale.],
)
figure(
image("preventivi/assets/timePie/areogramma" + sprintNumber + ".png", width: 60%),
caption: [Areogramma del tempo (in ore) speso preventivato per lo #glossary[sprint] numero #sprintNumber, rispetto al totale.],
)
} |
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/text/features.typ | typst | Apache License 2.0 | // Test OpenType features.
---
// Test turning kerning off.
#text(kerning: true)[Tq] \
#text(kerning: false)[Tq]
---
// Test smallcaps.
#smallcaps[Smallcaps]
---
// Test alternates and stylistic sets.
#set text(font: "IBM Plex Serif")
a vs #text(alternates: true)[a] \
ß vs #text(stylistic-set: 5)[ß]
---
// Test ligatures.
fi vs. #text(ligatures: false)[No fi]
---
// Test number type.
#set text(number-type: "old-style")
0123456789 \
#text(number-type: auto)[0123456789]
---
// Test number width.
#text(number-width: "proportional")[0123456789] \
#text(number-width: "tabular")[3456789123] \
#text(number-width: "tabular")[0123456789]
---
// Test extra number stuff.
#set text(font: "IBM Plex Serif")
0 vs. #text(slashed-zero: true)[0] \
1/2 vs. #text(fractions: true)[1/2]
---
// Test raw features.
#text(features: ("smcp",))[Smcp] \
fi vs. #text(features: (liga: 0))[No fi]
---
// Error: 26-31 expected integer or none, found boolean
#set text(stylistic-set: false)
---
// Error: 26-28 stylistic set must be between 1 and 20
#set text(stylistic-set: 25)
---
// Error: 24-25 expected "lining", "old-style", or auto, found integer
#set text(number-type: 2)
---
// Error: 21-26 expected array or dictionary, found boolean
#set text(features: false)
---
// Error: 21-35 expected string, found boolean
#set text(features: ("tag", false))
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/119.%20publishing.html.typ | typst | publishing.html
Post-Medium Publishing
September 2009Publishers of all types, from news to music, are unhappy that
consumers won't pay for content anymore. At least, that's how they
see it.In fact consumers never really were paying for content, and publishers
weren't really selling it either. If the content was what they
were selling, why has the price of books or music or movies always
depended mostly on the format? Why didn't better content cost more?
[1]A copy of Time costs $5 for 58 pages, or 8.6 cents a page.
The Economist costs $7 for 86 pages, or 8.1 cents a page. Better
journalism is actually slightly cheaper.Almost every form of publishing has been organized as if the medium
was what they were selling, and the content was irrelevant. Book
publishers, for example, set prices based on the cost of producing
and distributing books. They treat the words printed in the book
the same way a textile manufacturer treats the patterns printed on
its fabrics.Economically, the print media are in the business of marking up
paper. We can all imagine an old-style editor getting a scoop and
saying "this will sell a lot of papers!" Cross out that final S and
you're describing their business model. The reason they make less
money now is that people don't need as much paper.A few months ago I ran into a friend in a cafe. I had a copy of
the New York Times, which I still occasionally buy on weekends. As
I was leaving I offered it to him, as I've done countless times
before in the same situation. But this time something new happened.
I felt that sheepish feeling you get when you offer someone something
worthless. "Do you, er, want a printout of yesterday's news?" I
asked. (He didn't.)Now that the medium is evaporating, publishers have nothing left
to sell. Some seem to think they're going to sell content—that
they were always in the content business, really. But they weren't,
and it's unclear whether anyone could be.SellingThere have always been people in the business of selling information,
but that has historically been a distinct business from publishing.
And the business of selling information to consumers has always
been a marginal one. When I was a kid there were people who used
to sell newsletters containing stock tips, printed on colored paper
that made them hard for the copiers of the day to reproduce. That
is a different world, both culturally and economically, from the
one publishers currently inhabit.People will pay for information they think they can make money from.
That's why they paid for those stock tip newsletters, and why
companies pay now for Bloomberg terminals and Economist Intelligence
Unit reports. But will people pay for information otherwise?
History offers little encouragement.If audiences were willing to pay more for better content, why wasn't
anyone already selling it to them? There was no reason you couldn't
have done that in the era of physical media. So were the print
media and the music labels simply overlooking this opportunity? Or
is it, rather, nonexistent?What about iTunes? Doesn't that show people will pay for content?
Well, not really. iTunes is more of a tollbooth than a store. Apple
controls the default path onto the iPod. They offer a convenient
list of songs, and whenever you choose one they ding your credit
card for a small amount, just below the threshold of attention.
Basically, iTunes makes money by taxing people, not selling them
stuff. You can only do that if you own the channel, and even then
you don't make much from it, because a toll has to be ignorable to
work. Once a toll becomes painful, people start to find ways around
it, and that's pretty easy with digital content.The situation is much the same with digital books. Whoever controls
the device sets the terms. It's in their interest for content to
be as cheap as possible, and since they own the channel, there's a
lot they can do to drive prices down. Prices will fall even further
once writers realize they don't need publishers. Getting a book
printed and distributed is a daunting prospect for a writer, but
most can upload a file.Is software a counterexample? People pay a lot for desktop software,
and that's just information. True, but I don't think publishers
can learn much from software. Software companies can charge a lot
because (a) many of the customers are businesses, who get in
trouble
if they use pirated versions, and (b) though in form merely
information, software is treated by both maker and purchaser as a
different type of thing from a song or an article. A Photoshop
user needs Photoshop in a way that no one needs a particular song
or article.That's why there's a separate word, "content," for information
that's not software. Software is a different business. Software
and content blur together in some of the most lightweight software,
like casual games. But those are usually free. To make money the
way software companies do, publishers would have to become software
companies, and being publishers gives them no particular head start
in that domain.
[2]The most promising countertrend is the premium cable channel. People
still pay for those. But broadcasting isn't publishing: you're not
selling a copy of something. That's one reason the movie business
hasn't seen their revenues decline the way the news and music
businesses have. They only have one foot in publishing.To the extent the movie business can avoid becoming publishers,
they may avoid publishing's problems. But there are limits to how
well they'll be able to do that. Once publishing—giving people
copies—becomes the most natural way of distributing your content,
it probably doesn't work to stick to old forms of distribution just
because you make more that way. If free copies of your content are
available online, then you're competing with publishing's form of
distribution, and that's just as bad as being a publisher.Apparently some people in the music business hope to retroactively
convert it away from publishing, by getting listeners to pay for
subscriptions. It seems unlikely that will work if they're just
streaming the same files you can get as mp3s.NextWhat happens to publishing if you can't sell content? You have two
choices: give it away and make money from it indirectly, or find
ways to embody it in things people will pay for.The first is probably the future of most current media.
Give music
away and make money from concerts and t-shirts. Publish articles
for free and make money from one of a dozen permutations of
advertising. Both publishers and investors are down on advertising
at the moment, but it has more potential than they realize.I'm not claiming that potential will be realized by the existing
players. The optimal
ways to make money from the written word
probably require different words written by different people.It's harder to say what will happen to movies. They could evolve
into ads. Or they could return to their roots and make going to
the theater a treat. If they made the experience good enough,
audiences might start to prefer it to watching pirated movies at
home.
[3]
Or maybe the movie business will dry up, and the people
working in it will go to work for game developers.I don't know how big embodying information in physical form will
be. It may be surprisingly large; people overvalue
physical stuff.
There should remain some market for printed books, at least.I can see the evolution of book publishing in the books on my
shelves. Clearly at some point in the 1960s the big publishing
houses started to ask: how cheaply can we make books before people
refuse to buy them? The answer turned out to be one step short of
phonebooks. As long as it isn't floppy, consumers still perceive
it as a book.That worked as long as buying printed books was the only way to
read them. If printed books are optional, publishers will have to
work harder to entice people to buy them. There should be some
market, but it's hard to foresee how big, because its size will
depend not on macro trends like the amount people read, but on the
ingenuity of individual publishers.
[4]Some magazines may thrive by focusing on the magazine as a physical
object. Fashion magazines could be made lush in a way that would
be hard to match digitally, at least for a while. But this is
probably not an option for most magazines.I don't know exactly what the future will look like, but I'm not
too worried about it. This sort of change tends to create as many
good things as it kills. Indeed, the really interesting question is not
what will happen to existing forms, but what new forms will appear.The reason I've been writing about existing forms is that I don't
know what new forms will appear. But though I can't predict
specific winners, I can offer a recipe for recognizing them. When
you see something that's taking advantage of new technology to give
people something they want that they couldn't have before, you're
probably looking at a winner. And when you see something that's
merely reacting to new technology in an attempt to preserve some
existing source of revenue, you're probably looking at a loser.
Notes[1]
I don't like the word "content" and tried for a while to avoid
using it, but I have to admit there's no other word that means the
right thing. "Information" is too general.Ironically, the main reason I don't like "content" is the thesis
of this essay. The word suggests an undifferentiated slurry, but
economically that's how both publishers and audiences treat it.
Content is information you don't need.[2]
Some types of publishers would be at a disadvantage trying
to enter the software business. Record labels, for example, would
probably find it more natural to expand into casinos than software,
because the kind of people who run them would be more at home at
the mafia end of the business spectrum than the don't-be-evil end.[3]
I never watch movies in theaters anymore. The tipping point
for me was the ads they show first.[4]
Unfortunately, making physically nice books will only be a
niche within a niche. Publishers are more likely to resort to
expedients like selling autographed copies, or editions with the
buyer's picture on the cover.Thanks to <NAME>, <NAME>, <NAME>, Robert
Morris, and <NAME> for reading drafts of this.
|
|
https://github.com/jxpeng98/Typst-CV-Resume | https://raw.githubusercontent.com/jxpeng98/Typst-CV-Resume/main/legacy/example-single-legacy.typ | typst | MIT License | #import "modernpro-cv-legacy.typ": *
// select the font type: "macfont" or "openfont"
#let fonttype = "macfont"
#show: mainbody => cv-single-legacy(
continue_header: "false",
name: [#lorem(2)], //name:"" or name:[]
address: [#lorem(4)],
lastupdated: "true",
pagecount: "true",
date: "2023.4.7",
contacts: (
(text: "08856", link: ""),
(text: "example.com", link: "https://www.example.com"),
(text: "github.com", link: "https://www.github.com"),
(text: "<EMAIL>", link: "mailto:<EMAIL>"),
),
bibfile: [bib.json],
mainbody,
)
//About
#section("About")
#descript[#lorem(50)]
#sectionsep
#section("Education")
#education[#lorem(4)][#lorem(2)][xxxx-xxxx][UK][Core Modules: #lorem(10)]\
#education[#lorem(4)][#lorem(2)][xxxx-xxxx][UK][]
#sectionsep
#section("Skills")
#descript("Programming Languages")
#info[Python, C++, Java, JavaScript, HTML, CSS, SQL, LaTeX]
#subsectionsep
#descript("Frameworks")
#info[React, Node.js, Express, Flask, Django, Bootstrap, jQuery]
#subsectionsep
#descript("Tools")
#info[Git, GitHub, Docker, AWS, Heroku, MongoDB, MySQL, PostgreSQL, Redis, Linux]
#sectionsep
// Award
#section("Awards")
#awarddetail[2018][Scholarship][University]
#awarddetail[2017][Grant][Organisation]
#awarddetail[2016][Scholarship][University]
#sectionsep
//Experience
#section("Experience")
#jobtitle[#lorem(4)][#lorem(2)][xxxx-xxxx][UK]
#jobdetail[
- #lorem(10)
- #lorem(10)
- #lorem(10)
- #lorem(10)
]
#subsectionsep
#jobtitle[#lorem(4)][#lorem(2)][xxxx-xxxx][UK]
#jobdetail[#lorem(30)]
#sectionsep
// Projects
#section("Projects")
#project[#lorem(2)][Jan 2023][#lorem(40)]
#subsectionsep
#project[#lorem(2)][][
- #lorem(15)
- #lorem(15)
]
#subsectionsep
#project[#lorem(2)][][#lorem(40)]
#sectionsep
// Publication
#section("Publications")
#publication("bib.bib", "chicago-author-date") |
https://github.com/AnsgarLichter/hka-thesis-template | https://raw.githubusercontent.com/AnsgarLichter/hka-thesis-template/main/exposé/template.typ | typst | #import "/common/titlepage.typ": *
#import "/common/settings.typ": *
#let exposé(
degree: "",
program: "",
title: "",
subtitle: "",
titleGerman: "",
subtitleGerman: "",
author: "",
matriculationNumber: "",
placeOfWork: "",
supervisor: "",
advisor: "",
startDate: none,
submissionDate: none,
body,
) = {
//Document Setup
set document(title: title, author: author)
titlepage(
degree: degree,
program: program,
title: title,
subtitle: subtitle,
titleGerman: titleGerman,
subtitleGerman: subtitleGerman,
author: author,
matriculationNumber: matriculationNumber,
placeOfWork: placeOfWork,
supervisor: supervisor,
advisor: advisor,
startDate: startDate,
submissionDate: submissionDate
)
// Page Setup
set page(
margin: (left: 2.5cm, right: 2.5cm, top: 4cm, bottom: 2.5cm),
numbering: "1 / 1",
number-align: center,
footer: locate(currentLocation => {
let currentPage = counter(page).display()
let finalPage = counter(page).final(currentLocation).first()
line(length: 100%, stroke: (paint: gray))
align(center)[#currentPage / #finalPage]
})
)
counter(page).update(1)
// Body Font Family
set text(
font: fontBody,
size: fontBodySize,
lang: "en"
)
show math.equation: set text(weight: 400)
// Citations
set cite(style: citationStyle)
// Headings
show heading: set block(
below: headingsSpacing.below,
above: headingsSpacing.above
)
show heading: set text(
font: fontBody,
size: fontHeadingSize
)
set heading(numbering: headingsNumberingStyle)
// Paragraphs
set par(leading: 1em, justify: true)
// Figures
show figure: set text(size: fontFiguresSubtitleSize)
//Indentation of Lists
set list(indent: listIdentation)
set enum(indent: listIdentation)
// Set after header and after all initial pages to just apply it to the acutal content
show par: set block(spacing: spaceBeforeParagraph)
body
} |
|
https://github.com/v411e/optimal-ovgu-thesis | https://raw.githubusercontent.com/v411e/optimal-ovgu-thesis/main/template/chapter/01-Einleitung.typ | typst | MIT License | = Einleitung
== Motivation <sec_motivation>
Warum ist das Thema relevant? Wie schaffe ich einen Mehrwert mit meiner Untersuchung? Warum ist es notwendig, dieses Problem zu lösen?
== Wissenschaftliche Zielstellung <sec_zielstellung>
Was möchte ich untersuchen? Welche These habe ich, die es zu validieren gilt? Welche Forschungsfragen habe ich mir gestellt? Was möchte ich erreichen?
== Gang der Arbeit <sec_gang_der_arbeit>
Wie gehe ich vor, um die Forschungsfragen zu beantworten? In welche Kapitel gliedert sich die Masterarbeit? Was mache ich in den jeweiligen Kapiteln? See @dijkstraRoleScientificThought1982
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/matrix-gaps_03.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
#set math.vec(gap: 1em)
$ vec(1, 2) $
|
https://github.com/ChristophVanDeest/FH-Kiel-Typst-Template | https://raw.githubusercontent.com/ChristophVanDeest/FH-Kiel-Typst-Template/main/lib/pages/abstract.typ | typst | MIT License | #let abstract_page(
language: "en",
author: "",
title: "",
keywords: (),
abstract: "",
) = {
// TODO Needed, because context creates empty pages with wrong numbering
set page(
numbering: "i",
)
let custom_title(title) = {
text(title, weight: "bold")
}
set par(justify: true)
stack(
spacing: 10mm,
custom_title(author),
v(9mm),
custom_title(if language == "en" {"Title of thesis"} else {"Thema der Arbeit"}),
v(6mm),
text(title),
v(9mm),
custom_title(if language == "en" {"Keywords"} else {"Stichworte"}),
v(6mm),
text(keywords.join(", ")),
v(9mm),
custom_title(if language == "en" {"Abstract"} else {"Kurzzusammenfassung"}),
v(6mm),
text(abstract),
)
} |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz-plot/0.1.0/gallery/line.typ | typst | Apache License 2.0 | #import "@preview/cetz:0.3.1": canvas, draw
#import "@preview/cetz-plot:0.1.0": plot
#set page(width: auto, height: auto, margin: .5cm)
#let style = (stroke: black, fill: rgb(0, 0, 200, 75))
#let f1(x) = calc.sin(x)
#let fn = (
($ x - x^3"/"3! $, x => x - calc.pow(x, 3)/6),
($ x - x^3"/"3! - x^5"/"5! $, x => x - calc.pow(x, 3)/6 + calc.pow(x, 5)/120),
($ x - x^3"/"3! - x^5"/"5! - x^7"/"7! $, x => x - calc.pow(x, 3)/6 + calc.pow(x, 5)/120 - calc.pow(x, 7)/5040),
)
#set text(size: 10pt)
#canvas({
import draw: *
// Set-up a thin axis style
set-style(axes: (stroke: .5pt, tick: (stroke: .5pt)),
legend: (stroke: none, orientation: ttb, item: (spacing: .3), scale: 80%))
plot.plot(size: (12, 8),
x-tick-step: calc.pi/2,
x-format: plot.formats.multiple-of,
y-tick-step: 2, y-min: -2.5, y-max: 2.5,
legend: "inner-north",
{
let domain = (-1.1 * calc.pi, +1.1 * calc.pi)
for ((title, f)) in fn {
plot.add-fill-between(f, f1, domain: domain,
style: (stroke: none), label: title)
}
plot.add(f1, domain: domain, label: $ sin x $,
style: (stroke: black))
})
})
|
https://github.com/qiufei/typst | https://raw.githubusercontent.com/qiufei/typst/main/README.md | markdown | MIT License | # typst 画图
我的tikz画图,替换成typst
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/rivet/0.1.0/docs/config.typ | typst | Apache License 2.0 | /// Creates a dictionary of all configuration parameters
///
/// - default-font-family (str): The default font family
/// - default font-size (length): The absolute default font size
/// - italic-font-family (str): The italic font family (for value descriptions)
/// - italic-font-size (length): The absolute italic font size
/// - background (color): The diagram background color
/// - text-color (color): The default color used to display text
/// - link-color (color): The color used to display links and arrows
/// - bit-i-color (color): The color used to display bit indices
/// - border-color (color): The color used to display borders
/// - bit-width (float): The width of a bit
/// - bit-height (float): The height of a bit
/// - description-margin (float): The margin between descriptions
/// - dash-length (float): The length of individual dashes (for dashed lines)
/// - dash-space (float): The space between two dashes (for dashed lines)
/// - arrow-size (float): The size of arrow heads
/// - margins (tuple[float]): TODO -> remove
/// - arrow-margin (float): The margin between arrows and the structures they link
/// - values-gap (float): The gap between individual values
/// - arrow-label-distance (float): The distance between arrows and their labels
/// - force-descs-on-side (bool): If true, descriptions are placed on the side of the structure, otherwise, they are placed as close as possible to the bit
/// - left-labels (bool): If true, descriptions are put on the left, otherwise, they default to the right hand side
/// - width (float): TODO -> remove
/// - height (float): TODO -> remove
/// - full-page (bool): If true, the page will be resized to fit the diagram and take the background color
/// - all-bit-i (bool): If true, all bit indices will be rendered, otherwise, only the ends of each range will be displayed
/// -> dictionary
#let config(
default-font-family: "Ubuntu Mono",
default-font-size: 15pt,
italic-font-family: "Ubuntu Mono",
italic-font-size: 12pt,
background: white,
text-color: black,
link-color: black,
bit-i-color: black,
border-color: black,
bit-width: 30,
bit-height: 30,
description-margin: 10,
dash-length: 6,
dash-space: 4,
arrow-size: 10,
margins: (20, 20, 20, 20),
arrow-margin: 4,
values-gap: 5,
arrow-label-distance: 5,
force-descs-on-side: false,
left-labels: false,
width: 1200,
height: 800,
full-page: false,
all-bit-i: true
) = {}
/// Dark theme config
/// - ..args (any): see #doc-ref("config.config")
#let dark(..args) = {}
/// Blueprint theme config
/// - ..args (any): see #doc-ref("config.config")
#let blueprint(..args) = {} |
https://github.com/maxtremblay/cv | https://raw.githubusercontent.com/maxtremblay/cv/main/sources/template.typ | typst | #let accent = rgb("#894571") // Accent color for the document
#let grey = rgb("#5D696F") // Lighter color for the document.
#let vspace = 10pt
#let cv(
doc,
name: [Firstname Lastname],
contact: ([first.last#sym.at\email.com], [123-456-7890]),
) = {
set text(
font: "Gontserrat",
size: 10pt,
weight: "light"
)
set page(
paper: "us-letter",
margin: (x: 2cm, y: 2cm),
)
// Header
align(center)[
#text(22pt)[#smallcaps(name)]
#linebreak()
#grid(
columns: contact.len(),
gutter: 1.5em,
..contact.map(item => {
text(fill: grey, weight: "light")[#item]
})
)
]
// Headings
show heading.where(level: 1): it => {
v(1em)
text(smallcaps(it.body), size: 16pt, weight: "light")
v(-0.75em)
line(stroke: ( thickness: 0.5pt, paint: grey, cap: "round", dash: "dotted"), length: 100%)
v(0.5em)
}
show heading.where(level: 2): it => {
text(smallcaps(it.body), size: 12pt, weight: "light")
}
show heading.where(level: 3): it => {
text(it.body, fill: grey, weight: "medium", size: 8pt)
}
doc
}
// Two-column item
#let twoColumns(..content) = {
grid(
columns: (60pt, auto),
rows: auto,
gutter: vspace,
..content
)
}
// Item with date on the left column
#let dateItem(date: [2000 #sym.dash.em 2010], title: [A section], subtitle: [], body: []) = {
twoColumns(
// Date on the first column
[
// #set align(right)
#set text(baseline: 2.8pt)
=== #date
],
// Second column contains the body
[
// #set align(horizon)
== #title
#if subtitle != [] [
#linebreak()
=== #subtitle
]
#if body != [] [
#v(0pt)
#set par(justify: true)
#body
] // else []
],
)
v(vspace)
}
#let simpleItem(
title: [],
subtitle: []
) = [
== #title
#linebreak()
=== #if subtitle != [] [ #subtitle]
#v(5pt)
]
#let reference(
title: [],
authors: [],
publisher: [],
date: [],
) = {
simpleItem(
title: title,
subtitle: [
#authors
#if publisher != [] [ #sym.bar.v #publisher]
#if date != [] [ #sym.bar.v #date ]
]
)
}
#let grant(
title: [],
organization: [],
date: [],
) = {
simpleItem(
title: title,
subtitle: [
#organization
#if date != [] [ #sym.bar.v #date ]
]
)
} |
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/visualize/pattern-small_01.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
//
// // Error: 22-52 pattern tile size must be non-zero
// // Hint: 22-52 try setting the size manually
// #line(stroke: pattern(path((0pt, 0pt), (1em, 0pt)))) |
https://github.com/utilForever/CV | https://raw.githubusercontent.com/utilForever/CV/main/CV.typ | typst | #import "@preview/modern-cv:0.3.1": *
#show: resume.with(
author: (
firstname: "Chris",
lastname: "Ohk",
email: "<EMAIL>",
phone: "(+82) 010-4613-9395",
github: "utilForever",
linkedin: "utilForever",
address: "617, Sampyeong-dong, Bundang-gu, Seongnam-si, South Korea",
positions: (
"Game Programmer",
"Engine Engineer",
"Developer",
"Lecturer",
),
),
date: datetime.today().display(),
language: "en",
colored-headers: true,
)
= Work Experience
#resume-entry(
title: "Embedded Software Engineer",
location: "Seongnam-si, South Korea",
date: "Sep 2024 - Present",
description: "42dot",
)
#resume-item[
- *Develop something using Rust (Secret)*
]
#resume-entry(
title: "Tech Lead",
location: "Seoul, South Korea",
date: "Dec 2023 - Jun 2024",
description: "EJN Corporate",
)
#resume-item[
- *Manage development teams by meeting 1 on 1 regularly and discussing technical decisions and determining direction*
- Develop new project (Unannounced)
]
#resume-entry(
title: "Engine Engineer",
location: "Seoul, South Korea",
date: "Aug 2021 - Nov 2023",
description: "Momenti Korea",
)
#resume-item[
- *Develop cross-platform engine for making and playing interactive media using Rust*
- Create and deploy Swift APIs for use in iOS apps
- Create and deploy Elixir APIs for use in backend
- Transfile and deploy WebAssembly for use in web browsers
]
#resume-entry(
title: "Game Programmer",
location: "Seongnam-si, South Korea",
date: "Sep 2015 - Jul 2021",
description: "Nexon Korea",
)
#resume-item[
- *Update build system by upgrading IDE version (Visual Studio 2008 → Visual Studio 2015)*
- *Develop physics engine for 64-bit application build (Havok Physics → NVIDIA PhysX)*
- Develop many contents such as 'Depart for Battle', 'Quick Departure', 'Pet Book', 'Partholon Vanguard' and 'Friendship System'
- Develop raid 'Macha' and character 'Tessa'
- Improve facial system by facing-related elements to automatically change based on scale value
- Maintain and manage Korea live server
]
= Projects
#resume-entry(
title: "RosettaStone",
location: [#github-link("utilForever/RosettaStone")],
date: "May 2017 - Present",
description: "Developer",
)
#resume-item[
- Implemented Hearthstone simulator for reinforcement learning using C++17
- Wrote extensive unit test to check each card's effect
]
#resume-entry(
title: "CubbyFlow",
location: github-link("CubbyFlow/CubbyFlow"),
date: "Apr 2018 - Present",
description: "Developer",
)
#resume-item[
- Voxel-based fluid simulation engine for computer games using C++17
- Wrote detailed documentation and tests/benchmarks for the library and published it on GitHub
]
#resume-entry(
title: "baba-is-auto",
location: github-link("utilForever/baba-is-auto"),
date: "Apr 2018 - Present",
description: "Developer",
)
#resume-item[
- Implemented Baba Is You simulator for reinforcement learning using C++17
- Worked Python API support for convenience use and benchmarked by using DQN
]
#resume-entry(
title: "rxRust",
location: github-link("rxRust/rxRust"),
date: "Sep 2021 - Nov 2022",
description: "Contributor",
)
#resume-item[
- Rust implementation of Reactive Extensions
- Implemented WebAssembly support
- Implemented several core features such as 'BehaviorSubject', 'WithLatestFrom' and 'StartsWith'
]
~~
~~
= Skills
#resume-skill-item(
"Languages",
(strong("C++"), strong("Rust"), "C#", "Python")
)
#resume-skill-item("Spoken Languages", (strong("Korean"), "English", "Japanese"))
#resume-skill-item(
"Programs",
(strong("Visual Studio"), strong("Visual Studio Code"), strong("RustRover"), "GitKraken", "Word"),
)
= Education
#resume-entry(
title: "KAIST",
location: "Daejeon, South Korea",
date: "Mar 2013 - Aug 2015",
description: "M.S. in Computer Science",
)
#resume-entry(
title: "Kyungpook National University",
location: "Daegu, South Korea",
date: "Mar 2008 - Feb 2013",
description: "B.S. in Computer Science and Engineering",
)
= Honors and Awards
#resume-entry(
title: "Microsoft MVP (Most Valuable Professionals)",
location: "Microsoft",
date: "2015 - Present",
description: "Category: Developer Technologies"
)
#resume-entry(
title: "ACM-ICPC 2012 Daejeon Regional",
location: "Ministry of Future Creation and Science, NIA",
date: "2012",
description: "Honorable Mention",
)
#resume-entry(
title: "1st TOPCIT Competition",
location: "Korea Ministry of Science and ICT, NIPA",
date: "2012",
description: "Special Prize",
)
= Translations
#resume-entry(
title: "Optimized C++",
location: "Hanbit Media",
date: "Jul 2019",
description: "C++ 최적화",
)
#resume-entry(
title: "Discovering Modern C++",
location: "Gilbut",
date: "Dec 2017",
description: "모던 C++ 입문",
)
#resume-entry(
title: "Rust Essentials",
location: "Hanbit Media",
date: "Feb 2017",
description: "러스트 핵심 노트",
)
#resume-entry(
title: "Programming 2D Games",
location: "Acorn Publishing",
date: "Nov 2014",
description: "2D 게임 프로그래밍",
)
#resume-entry(
title: "Unity Shaders and Effects Cookbook",
location: "Acorn Publishing",
date: "Apr 2014",
description: "유니티 Shader와 Effect 제작",
)
#resume-entry(
title: "GameSalad Beginner's Guide",
location: "Acorn Publishing",
date: "Jul 2013",
description: "게임샐러드로 코드 한 줄 없이 게임 만들기",
)
= Communities and Studies
#resume-entry(
title: "C++ Korea",
location: "Voluntary Association",
date: "Nov 2013 - Present",
description: "Founder and Administrator",
)
#resume-item[
- A Facebook community that uses C++ language and shares related information
- Translate "C++ Core Guidelines" to Korean
- Host seminars, meetups and studies periodically
- 6000+@ members
]
#resume-entry(
title: "Reinforcement Learning KR",
location: "Facebook Community",
date: "Jan 2021 - Present",
description: "Administrator",
)
#resume-item[
- A Facebook community that researches reinforcement learning and shares related information
- Host meetups and studies periodically
- 6000+@ members
]
~~
~~
~~
#resume-entry(
title: "Reinforcement Learning Paper Study",
location: "Online",
date: "May 2020 - Apr 2023",
description: "Administrator",
)
#resume-item[
- Review a variety of papers, from DQN to state-of-the-art papers introduced in the latest conferences
- Present and discuss 2 papers per week
- 100+@ papers
- 100+@ members
]
= Teaching
#resume-entry(
title: "Rust Basic + Linux Kernel Development",
location: "Seoul, South Korea",
date: "Jul 2024 - Present",
description: "HSPACE",
)
#resume-entry(
title: "Rust Basic + Cross-platform Application Development",
location: "Seoul, South Korea",
date: "Mar 2024 - Present",
description: "Seoul National University - SCSC + Wafflestudio",
)
#resume-entry(
title: "Rust Basic + Rogue-like Game Development",
location: "Seoul, South Korea",
date: "Mar 2024 - Present",
description: "Konkuk University - GDSC Konkuk + EDGE",
)
#resume-entry(
title: "Rust Basic + Make a Blog",
location: "Seoul, South Korea",
date: "Mar 2024 - Present",
description: "Korea University - MatKor",
)
#resume-entry(
title: "Rust Basic + Make a Minecraft",
location: "Ulsan, South Korea",
date: "Jan 2023 - Present",
description: "UNIST - HeXA",
)
#resume-entry(
title: "Rustonomicon at a Glance",
location: "Seoul, South Korea",
date: "Dec 2023 - Feb 2024",
description: "Korea University - MatKor",
)
#resume-entry(
title: "Rust Basic + Backend Development",
location: "Seoul, South Korea",
date: "Sep 2022 - Sep 2023",
description: "Korea University - GDSC KU",
)
#resume-entry(
title: "Rust Basic + Make an Interpreter",
location: "Seoul, South Korea",
date: "Mar 2023 - Aug 2023",
description: "Korea University - MatKor",
)
#resume-entry(
title: "Rainbow Is All You Need",
location: "Daegu, South Korea",
date: "Oct 2021",
description: "Daegu Software Meister High School",
)
#resume-entry(
title: "Reinforcement Learning Basic",
location: "Ulsan, South Korea",
date: "Jul 2021 - Sep 2021",
description: "UNIST - HeXA",
)
#resume-entry(
title: "Artificial Intelligence Go with AlphaGo and AlphaGo Zero",
location: "Daejeon, South Korea",
date: "Mar 2021 - Jul 2021",
description: "KAIST - Include",
)
#resume-entry(
title: "Artificial Intelligence Go with AlphaGo Zero",
location: "Seoul, South Korea",
date: "Jan 2020",
description: "2020 Winter OSS Developer Forum Camp",
)
#resume-entry(
title: "Reinforcement Learning Basic",
location: "Seoul, South Korea",
date: "Jul 2019",
description: "2019 Summer OSS Developer Forum Camp",
)
= Presentation
#resume-entry(
title: "C++ Korea Meetup",
location: "Seoul, South Korea",
date: "Jun 2024",
description: "A Quick Look of C++ Concurrency",
)
#resume-entry(
title: "2024 Softeer Tech Meetup",
location: "Seoul, South Korea",
date: "Jun 2024",
description: "Why is Rust on the Rise + Introduction to Rust's Key Features",
)
#resume-entry(
title: "4th DevTalk Seminar - Hongik University, Computer Engineering",
location: "Seoul, South Korea",
date: "Mar 2024",
description: "Leap from College Student to Developer",
)
#resume-entry(
title: "Cloud Native Sustainability Week in Seoul",
location: "Seoul, South Korea",
date: "Oct 2023",
description: "Can Rust Save the Earth?",
)
#resume-entry(
title: "C++ Korea Meetup",
location: "Seoul, South Korea",
date: "Jun 2023",
description: "Game Development without using Class",
)
#resume-entry(
title: "C++ Korea Meetup",
location: "Seoul, South Korea",
date: "Feb 2023",
description: "Direction of C++ Education for Beginners",
)
#resume-entry(
title: "ModuLabs MODUPOP",
location: "Seoul, South Korea",
date: "Dec 2022",
description: "Developers' Reinforcement Learning",
)
#resume-entry(
title: "INFCON 2022",
location: "Seoul, South Korea",
date: "Aug 2022",
description: "Rust Cross-platform Programming",
)
#resume-entry(
title: "Korea University, Dept of CSE - Special Lecture",
location: "Seoul, South Korea",
date: "Jun 2022",
description: "Things I wish I'd known in College",
)
#resume-entry(
title: "44BITS Potcast Live",
location: "Online",
date: "Mar 2022",
description: "5 Years of Hearthstone Development",
)
#resume-entry(
title: "Taling Monthly Code Reivew Ver 0.1",
location: "Online",
date: "Oct 2021",
description: "Growing an Open Source Project",
)
#resume-entry(
title: "72th AiFrenz Seminar",
location: "Online",
date: "May 2021",
description: "Reinforcement Learning Environment Development",
)
#resume-entry(
title: "Jeonbuk Science High School - Special Lecture",
location: "Online",
date: "May 2021",
description: "Create an Artificial Neural Network using Python",
)
#resume-entry(
title: "2020 OSS Festival",
location: "Online",
date: "Nov 2020",
description: "Managing an Open Source Project (Community) Well",
)
#resume-entry(
title: "GitHub in DevOps Meetup 2020",
location: "Online",
date: "Nov 2020",
description: "The Journey from Open Source to Inner Source",
)
#resume-entry(
title: "7th C++ Korea Seminar",
location: "Online",
date: "Jul 2020",
description: "Game Development without using Pointer",
)
#resume-entry(
title: "6th C++ Korea Seminar",
location: "Seoul, South Korea",
date: "Sep 2019",
description: "C++ Open Source 101",
)
#resume-entry(
title: "GDG Campus Seoul - Toy Story",
location: "Seongnam-si, South Korea",
date: "Jul 2019",
description: "Trial and Error for a Sustainable Side Project",
)
#resume-entry(
title: "Nexon Developer Conference 2019",
location: "Seongnam-si, South Korea",
date: "Apr 2019",
description: "Experience in developing Hearthstone Reinforcement Learning Environment",
)
#resume-entry(
title: "5th C++ Korea Seminar",
location: "Seoul, South Korea",
date: "Apr 2019",
description: "C++20 Key Features Summary",
)
#resume-entry(
title: "Meltingcon 2018",
location: "Seoul, South Korea",
date: "May 2018",
description: "Create Python API using C++",
)
#resume-entry(
title: "Nexon Developer Conference 2018",
location: "Seongnam-si, South Korea",
date: "Apr 2018",
description: "Experience in developing Fluid Simulation Engine",
)
#resume-entry(
title: "16th Hacking Camp",
location: "Seoul, South Korea",
date: "Aug 2017",
description: "C++ Secure Coding Guide",
)
#resume-entry(
title: "3rd C++ Korea Seminar",
location: "Seoul, South Korea",
date: "Feb 2017",
description: "New C++ in a New Visual Studio, a Migration Story",
)
#resume-entry(
title: "2nd C++ Korea Seminar",
location: "Seoul, South Korea",
date: "May 2016",
description: "C++17 Key Features Summary",
)
#resume-entry(
title: "Microsoft Techdays Korea 2015",
location: "Seoul, South Korea",
date: "Oct 2015",
description: "Grease rusty Old C++ Code with Modern C++",
)
#resume-entry(
title: "1st C++ Korea Seminar",
location: "Seongnam-si, South Korea",
date: "Dec 2014",
description: "C++11 Key Features Summary",
)
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/math/accent-06.typ | typst | Other | // Test high base.
$ tilde(integral), tilde(integral)_a^b, tilde(integral_a^b) $
|
https://github.com/FurryAcetylCoA/sgu-thesis-typst | https://raw.githubusercontent.com/FurryAcetylCoA/sgu-thesis-typst/main/nju-thesis/templates/bachelor-abstract-en.typ | typst | MIT License | #import "@preview/t4t:0.3.2": is
#import "../utils/style.typ": 字号, 字体
#import "../utils/indent.typ": fake-par
#import "../utils/double-underline.typ": double-underline
#import "../utils/invisible-heading.typ": invisible-heading
// 本科生英文摘要页
#let bachelor-abstract-en(
// documentclass 传入的参数
anonymous: false,
twoside: false,
fonts: (:),
info: (:),
// 其他参数
keywords: (),
outline-title: "ABSTRACT",
outlined: true,
anonymous-info-keys: ("author-en", "supervisor-en"),
leading: 1.28em,
spacing: 1.28em,
body,
) = {
// 1. 默认参数
fonts = 字体 + fonts
info = (
title-en: "non-Bullsh*t generatoe with ChatGPT",
author-en: "<NAME>",
department-en: "XX Department",
major-en: "XX Major",
supervisor-en: "Professor <NAME>",
) + info
// 2. 对参数进行处理
// 2.1 如果是字符串,则使用换行符将标题分隔为列表
if (is.str(info.title-en)) {
info.title-en = info.title-en.split("\n")
}
// 3. 内置辅助函数
let info-value(key, body) = {
if (not anonymous or (key not in anonymous-info-keys)) {
body
}
}
// 4. 正式渲染
[
#set text(font: "Times New Roman", size: 字号.五号)
#set par(leading: leading, justify: true)
#show par: set block(spacing: spacing)
#align(center)[
#set text(font: "Times New Roman", size: 字号.三号, weight: "bold")
#(("",)+ info.title-en).sum()
]
#v(2em)
#text(font: "Times New Roman", size: 字号.小四, weight: "bold")[Abstract:]
#[
#body
]
#v(1em)
#text(font: "Times New Roman", size: 字号.小四, weight: "bold")[Key words:]
#(("",)+ keywords.intersperse("; ")).sum()
]
}
|
https://github.com/mgoulao/IST-MSc-Thesis-Typst-Template | https://raw.githubusercontent.com/mgoulao/IST-MSc-Thesis-Typst-Template/main/main.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Técnico Lisboa MSc Thesis Typst Template ",
subtitle: "Optional subtitle",
author: "[Author name]",
degree: "[Degree Name]",
supervisors: (
"Prof. Lorem Ipsum",
"Prof. Lorem Ipsum",
),
committee: (
(
role: "President",
name: "Prof. <NAME>"
),
(
role: "Chair",
name: "Prof. <NAME>"
),
),
date: "October 2023",
// Insert your abstract after the colon, wrapped in brackets.
// Example: `abstract: [This is my abstract...]`
abstract: lorem(59),
)
#include "section_1.typ"
#include "section_2.typ"
#bibliography("bibliography.bib")
#show: appendices
#include "appendix_a.typ"
|
|
https://github.com/EGmux/TheoryOfComputation | https://raw.githubusercontent.com/EGmux/TheoryOfComputation/master/main.typ | typst | #include "./modules.typ"
#include "./sharedFunctions.typ"
#include "./style.typ"
|
|
https://github.com/crd2333/typst-theorem-box | https://raw.githubusercontent.com/crd2333/typst-theorem-box/master/lib.typ | typst | MIT License | /*
Theorems boxes implemented by showybox, providing a beautiful way to display theorems, definitions, lemmas, corollaries, and proofs.
The boxes will be counted like x.y, where x is the first level heading number and y is the box number of the type.
Author: crd233
*/
#import "@preview/showybox:2.0.1": showybox
#let thmrules(doc) = {
let types = ("Theorem", "Definition", "Lemma", "Corollary", "Proof")
// update all counters when first level heading is updated
show heading: it => {
if it.level <= 1 {
for kind in types {
counter(kind).update(1)
}
}
it
}
// use the label name to refer
show ref: it => {
if (it.element != none and it.element.has("kind") and it.element.kind in types) {
return link(it.target, [#str(it.element.at("label"))])
} else {it}
}
doc
}
#let thm-base(
type: "thm-base",
color: blue,
title: "",
count: true,
body,
..args) = {
let heading_num = context counter(heading).get().at(0)
let thm_counter = counter(type)
if title != "" and count {
title = type + " " + heading_num + "." + thm_counter.display() + ": " + title
} else if count {
title = type + " " + heading_num + "." + thm_counter.display()
} else {
title = type
}
return figure(
showybox(
title-style: (
weight: "bold",
boxed-style: (
anchor: (x: left, y: horizon),
radius: (top-left: 10pt, bottom-right: 10pt, rest: 0pt),
)
),
frame: (
title-color: color.lighten(10%),
body-color: color.lighten(90%),
footer-color: color.lighten(70%),
border-color: color,
radius: (top-left: 10pt, bottom-right: 10pt, rest: 0pt)
),
sep: (
dash: "dashed",
),
title: title,
[#thm_counter.step() #body],
..args
),
supplement: type,
kind: type
)
}
#let theorem(..args) = thm-base(type: "Theorem", color: blue, ..args)
#let definition(..args) = thm-base(type: "Definition", color: orange, ..args)
#let lemma(..args) = thm-base(type: "Lemma", color: purple, ..args)
#let corollary(..args) = thm-base(type: "Corollary", color: green, ..args)
#let proof(body, ..args) = {
body = body + h(1fr) + box(scale(160%, origin: bottom + right, sym.square.stroked))
return thm-base(type: "Proof", color: gray.darken(30%), count: false, body, ..args)
}
|
https://github.com/andreasKroepelin/TypstJlyfish.jl | https://raw.githubusercontent.com/andreasKroepelin/TypstJlyfish.jl/main/examples/simple.typ | typst | MIT License | #set page(width: auto, height: auto, margin: 1em)
#import "../typst/lib.typ": *
#read-julia-output(json("simple-jlyfish.json"))
Hello from Typst!
#jl(```julia
greeting = rand(["Hello", "Hi", "Good morning"])
"$greeting, this is Julia in Typst via Jlyfish!"
```)
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas1/2_Utorok.typ | typst | #let V = (
"HV": (
("", "Prechváľniji múčenicy", "Vsé žitijé mojé srámno izžích, Hóspodi, so bludnícami okajánnyj, jákože blúdnyj umilénijem zovú: Ótče nebésnyj, sohriších, očísti i spasí mja, i ne otríni mené, samohó sebé ot tebé udalívšahosja, i bezplódnych rádi ďíl nýňi obniščávšaho."),
("", "", "Obniščáv bohát sýj Christé, čelovíki obohatíl jesí bezsmértijem i svítlostiju. Ťímže obniščávša mjá slasťmí žitéjskimi, dobroďítelmi obohatí, i s níščim Lázarem učiní mja, bohátaho mučénija izimája mjá i hejénny predležáščija mí."),
("", "", "Zlóboju obohatíchsja ľúťi, i píšču vozľubích, i v žitijí vosprijách blahája Hóspodi, i v hejénnu osuždén bých: hládnujuščij úm mój, jáko Lázarja prezrích, pred vratý božéstvennych tvojích ďijánij povéržen, uščédri mjá Hóspodi."),
("", "Prechváľniji múčenicy", "Proróče čúdnyj, Christóv Krestíteľu i Predtéče, izsóchšeje sérdce mojé bezmístijem, ríki sléz prisnotekúščich sotvorí prolijáti molítvami tvojími: i moľú ťa, jáko da spasájem tobóju mnohoboľíznennyj, veličáju tebé vozvelíčivšaho."),
("", "", "Proróče blažénne, k tebí nadéždu mojú vsjú, i živót vozlaháju čájanija mojehó, íže Christá krestív Iisúsa, bézdnu vzémľuščaho míra prehrišénija. Tohó molí Joánne, moľúsja tí, sérdce mojé očístiti, i spastí mja."),
("", "", "Propovídniče múdre blahodáti, íže vsím jazýkom pokajánije predvozvistívyj, vseokajánňij mojéj i oslepľínnoj duší, božéstvennyj Predtéče, prebyváti v pokajániji blahovolí, i vóľu Hospódňu ďíjati vsehdá, da víroju i ľubóviju slávľu ťá."),
("Bohoródičen", "", "Áhnca, míra vsehó vzémľuščaho hrichí, jehóže prevelíkij Predtéča vsím propovída, s ním Ďívo molí, kózlišč části javíti mjá čúžda v čás súdnyj, i ovcám desným jehó sočtáti mené nedostójnaho."),
),
"S": (
("", "", "Jáko pučína mnóha prehrišénij mojích Spáse, i ľúťi pohružájusja sohrešéňmi mojími, dážď mí rúku, jáko Petróvi, i spasí mja Bóže, i pomíluj mjá."),
("", "", "Jáko v pomyšlénijich lukávych i v ďíľich osudíchsja Spáse, mýsľ mňí dáruj obraščénija Bóže, da zovú ti: spasí mja blahoďíteľu blahíj, i pomíluj mjá."),
("Múčeničen", "", "Jéže na sudíšči váše ispovídanije svjatíji, démonov oplevá sílu, i ot prélesti čelovíki svobodí. Ťímže i hlavám usekájemym, vzyváste: da búdet Hóspodi, žértva dúš nášich blahoprijátna pred tobóju, jáko tebé vozľubívše, neradíchom o vrémenňij žízni, čelovikoľúbče."),
("Bohoródičen", "", "Ďívo vsepítaja, júže v tebí tájnu Moiséj proróčeskima víďi očíma, kupinú horjášču i neopaľájemu: Božestvá bo óhň utróbu tvojú čístaja, ne opalí. Ťímže mólim ťá jáko <NAME> nášeho, mír isprosíti mírovi, i véliju mílosť.")
),
)
#let P = (
"1": (
("", "", "Písň pobídnuju pojím vsí Bóhu, sotvóršemu dívnaja čudesá mýšceju vysókoju, i spásšemu Izráiľa, jáko proslávisja."),
("", "", "Svjaščénije prečístoje rádujsja Ďívo, ánhelov ukrašénije, i prijátelišče Dúcha, nevísto neporóčnaja otcá beznačálna, i Máti slóva Bóžija."),
("", "", "Caríca jesí, jáko caréva dščí, prozjábši Bohoródice Vladýčice, i carjá Bóha róždši plótiju, i s ním cárstvuješi."),
("", "", "Pojét roždestvó tvojé Davíd pivéc, prevospivájet že Isáia utróbu tvojú prečístuju, Maríje vsečístaja, Christijánstiji že ľúdije slávjat roždestvó tvojé."),
("", "", "Propovídujet cérkov roždestvó tvojé Ďívo Bohonevísto, pravoslávnymi učéniji, i veščmí božéstvennymi, obrazóm bo voploščénija Sýna tvojehó poklaňájetsja."),
),
"3": (
("", "", "Kámeň, jehóže nebrehóša zížduščiji, séj býsť vo hlavú úhla: tój jésť kámeň, na némže utverdí cérkov Christós, júže ot jazýk iskupí."),
("", "", "Slávu ďívstva imúšči, obleklásja jesí blahodátiju Dúcha svjatáho, prečístaja Maríje, jávľšisja Bohoródica, nóvoje tájinstvo i sokrovénnoje: Káko bo Bóha plótiju róždši ďívstvuješi?"),
("", "", "Ďílo, jéže soďílal jesí Hóspodi, któ skážet? júže bo prokľát v pečáľich rodíti čáda, Sýn pokazálsja jesí sejá, i rádujetsja žénskoje pádšeje jestestvó o tebí Bózi Bohoródicy rádi."),
("", "", "Búrja prehrišénij rišítsja míru, tobóju prečístaja Maríje Bohoródice jedína. Ťím ťá, jáko pristánišče spasénija imúšče, voschvaľájem vírniji, pojúšče velíčija tvojá."),
("", "", "Vospít ďívstvu proróki drévle, rodíti ťá bezľítnaho v ľíta, i páče slóva Slóvo, jedínaho ot Tróicy Christá Bóha nášeho: jehóže cérkov Máti čístaja, počitájet óbrazy."),
),
"4": (
("", "", "Dúchom províďa proróče Avvakúme, slovesé voploščénije, propovídal jesí vopijá: vnehdá priblížitisja ľítom, poznáješisja, vnehdá prijití vrémeni, pokážešisja, sláva síľi tvojéj Hóspodi."),
("", "", "Sedmosvítloje zercálo božéstvennych prorók mnohoobrázno pojét obrazovánija tvojá: mý že ďílom známenija ischóda tvojehó vosprijémše, Bohoródicu ťá voístinnu, veščmí víďašči vírujem."),
("", "", "Bóžiju ťá dostójno Máter, voístinnu Ďívo čístaja, čtúšče slávim mý, svójstvennyj prinosjášče hlás tebí, v zakóňi i prorócich propovídanňij: rádujsja obrádovannaja, Hospóď s tobóju."),
("", "", "Sé božéstvennaja horá, júže víďi Avvakúm, dobroďítelej síň súšči jávi, Bohoródica prosijá v míri, jéjuže drévle otstúpľšiji prestuplénijem, ábije Bóhu priblížichomsja."),
("", "", "Blažén jazýk, prepítaja čístaja, íže čestí spodóbisja roždestvó tvojé vírno, pravoslávijem i učénijem i ďíly, ístinňi javľája vsjá óbrazy voploščénija Sýna tvojehó."),
),
"5": (
("", "", "Ot nóšči útreňujušče, vospivájem ťá Christé Bóže, obniščávšaho nás rádi, i krest, i smérť plótiju preterpívšaho."),
("", "", "Sokrovénno tájňi javľáše ťá kupinú Moiséj, neopalímuju Bohoródice Vladýčice: veščéstvennaja bo tvojá ložesná ne opalíšasja Božestvóm."),
("", "", "Slovesé Bóžija ťá Máter vospivájušče, Bohoródice čístaja, slovésnoje prinósim cvitúščeje darovánije tebí, o némže rádovatisja vírujem."),
("", "", "Ot skvérnych ustén ne otvratí pochvalénija, Bohoródice prečístaja: ňísť bo na zemlí, íže ťá po dostojániju vospíti derzájet."),
("", "", "Jedín jésť vo dvojú suščestvú, íže ot Ďívy roždéjsja, jáko Bóh nevídimyj, i jáko čelovík, vóleju nás rádi upodóbivyjsja čelovíkom."),
),
"6": (
("", "", "Proróka Jónu podražája vopijú: živót mój bláže svobodí iz tlí, i spasí mja Spáse míra, zovúšča: sláva tebí."),
("", "", "Mýslennyj ťá svíščnik Ďívo, i sedmosijánnyj zrít prorók, pokazúja jávi Dúcha ďíjstvija, bleščáščasja v tebi."),
("", "", "Drévo tý javílasja jesí Ďívo živonósnoje voístinnu, plodóm tvojím ľstívaho zmíja umorívšeje, čelovíkom že živót róždši Christá Bóha."),
("", "", "Ne krasná pochvalá ot skvérnych ustén tebí prinósitsja, Máti Bóha nášeho čístaja: no vížď duší mojejá želánije, i sijé prijimí."),
("", "", "Šatájutsja bezzakónniji v molví hórkaho nevírija: jehdá tókmo víďat pravoslávnych sobóry, lobyzájuščich tvój Ďívo óbraz."),
),
"S": (
("", "Hrób tvój Spáse", "Okormí čístaja, okajánnuju mojú žízň, i uščédri vseneporóčnaja, dúšu, popólzšujusja mnóhimi prehrišéniji vo hlubinú pohíbeli, i v čás mjá smértnyj svobodí klevéščuščich bisóv, i strášnaho otvíta."),
),
"7": (
("", "", "Súščym v peščí otrokóm tvojím Spáse, ne prikosnúsja, nižé stuží óhň. Tohdá trijé, jáko jedíňimi ustý pojáchu i blahoslovľáchu, hlahóľušče: Blahoslovén Bóh otéc nášich."),
("", "", "Preukrašénna javísja dobroďíteľmi Bohonevísto, slávoju i čéstiju ďívstva: krasňíjša bo blahoľípijem dobróta tvojá voístinnu, račítel Hospóď tebé privedé Máter božéstvennuju sebí."),
("", "", "Žézl čístaja, právosti jávi bylá jesí, žézl cárstvija prečéstňijšij. Ťímže plód Bóžija Slovesé prozjablá jesí, jéže i čúdo izdaléča Aarónov jávi žézl proobrazí."),
("", "", "Ťilésnymi strasťmí mnóhimi oskvernív ťílo že i slóvo i dúšu, káko tvojú čístaja, dobroďítelej vospojú krasotú? Nedoumíju i ustrašájusja: no samá mňí búdi tvojími molítvami pómošč."),
("", "", "Tvojehó Christé voploščénija čtú sojedinénije, i sehó óbrazu poklaňájusja Bohoľípno, jáko Bóh sýj predvíčnyj, ot Ďívy býsť čelovík nepremínen, sám vo obojú soveršén."),
),
"8": (
("", "", "Jehóže užasájutsja ánheli, i vsjá vóinstva, jáko tvorcá i Hóspoda, pójte svjaščénnicy, proslávite ótrocy, blahoslovíte ľúdije, i prevoznosíte vo vsjá víki."),
("", "", "Božéstvennoje svjaščénije, da vospojétsja Bóžije, ímže izbávisja mír ot tlí. Vostánite vsí pádšiji inohdá: Maríja bo rodí Christá spasénije."),
("", "", "Pojém ťá prečístaja, i Máti Bóžija: i któ ne slávit ťá voístinnu blahúju, súščuju nadéždu dúš nášich? Ťímže presvjatája, moľbú mojú prijimí."),
("", "", "Ujasnítesja dnés písňmi vírniji: proslávite ánheli, i čelovícy vkúpi, jáko dijávol pádajet i otčájanije: Maríja bo rodí nám nadéždu spasénija."),
("", "", "Ne opisújte Božestvá, ne lžíte sľipíji: prósťi bo nevídimo i nezríteľno jésť: plóti že óbraz voobrazúja, poklaňájusja, i víroju slávľu róždšuju Hóspoda Ďívu."),
),
"9": (
("", "", "Svitonósnyj óblak, vóňže vsích Vladýka, jáko dóžď s nebesé na runó sníde, i voplotísja nás rádi, býv čelovík, beznačáľnyj, veličájem vsí jáko Máter Bóha nášeho čístuju."),
("", "", "Rádujsja Maríje, velíkoje vsejá tvári čúdo. Rádujsja dščí úbo Davídova, Hospódňa že Máti. Rádujsja pínije Havrijílovo. Rádujsja pribížišče i utverždénije, i pómošč vsím presvjatája, súščym na zemlí hríšnikom."),
("", "", "Pojét Dúchom božéstvennym, i vospivájet blahodárstvennuju písň, Joakím čúdnyj, i božéstvennaja Ánna, jáko víďaše na zemlí Máter sozdáteľa, júže rodíša dščér Maríju: jejáže molítvami vsích spasí nás jáko Bóh."),
("", "", "O presvjatája Ďívo Máti Bóha výšňaho! Tvojé roždestvó na zemlí spasénije javísja hríšnym i smirénnym: o tebí bo spasóchomsja vírovavše, no spasáješi mjá i nýňi, i vo vsjá víki žíznennyja."),
("", "", "Voploščénna Slóva, no neprelóžna vím. Ťímže vospiváju jehó vírno, vo dvojú úbo suščestvú, ipostási že jedíňij: jehóže voístinnu jáko Bóha i čelovíka propovídaja, písň soveršáju."),
),
)
#let U = (
"S1": (
("", "", "V bezzakónijich začát jésm áz blúdnyj, ne smíju vziráti na vysotú nebésnuju. no naďíjasja na čelovikoľúbije tvojé zovú: Bóže, očísti mjá hríšnaho, i spasí mja."),
("", "", "Ášče právednik jedvá spasájetsja, áz že hríšnyj hďí javľúsja, ťahotý i vára dnevnáho ne ponésšij? No s naémniki jedinonadesjátaho časá sopričtí mja Bóže, i spasí mja."),
("Bohoródičen", "", "Bez mátere na nebesí, páče smýsla i slýšanija, na zemlí bez otcá rodilá jesí. Tohó Bohoródice molí, spastísja dušám nášym."),
),
"S2": (
("", "", "Objátija Ótča otvérsti mí potščísja, blúdno mojé iždích žitijé, na bohátstvo neiždivájemoje vzirája ščedrót tvojích Spáse. Nýňi obniščávšeje mojé da ne prézriši sérdce, tebí bo Hóspodi, umilénijem zovú: sohriších, Ótče, na nébo i pred tobóju, spasí mja."),
("", "", "Bohátstvo Jovlevo zrjá dobroďítelej, podkopáti i ukrásti kózňstvovaše, íže právednych vráh, i razorí stólp ťilésnyj, sokróvišča že ne ukráde duchóvnaho, obríte bo vooružénu neporóčnaho dúšu: mené že i obnažív pľiní. Predvarív úbo préžde koncá, izbávi mjá ot ľstívaho Spáse, i spasí mja."),
("", "", "Jáko dóbriji vójini, jedinomúdrenno vírovavše, preščénija mučítelej ne ubojástesja svjatíji. prijidóste usérdno ko Christú vzémše čéstnýj krest, i skončávše tečénije, s nebesé pobídu prijáste. Sláva ukrípľšemu vás: sláva vinčávšemu vý: sláva ďíjstvujuščemu vámi vsím iscilénija."),
("Bohoródičen", "", "Otčájanije Ninevítskoje predvaríl jesí, vozviščénnoje zapreščénije mimovoďá, i hňív pobidí mílosť tvojá Hóspodi, umilosérdisja nýňi na ľúdi i stádo tvojé: dlániju deržávnoju vrahí náša nizloží, molítvami Bohoródicy dáruj nám mílosť tvojú."),
),
"S3": (
("", "Hrób tvój Spáse", "V razbójniki vpadóch pomyšléňmi, i okradóchsja umóm, i ujazvíša mojú dúšu hrichmí, i ležú neiscílen, Iisúse mnohomílostive: no vozléj Predtéči molítvami tvojú mílosť, i ľútyja jázvy duší mojejá iscilí."),
("", "", "Íže drévle strujámi Jordánskimi krestívyj, Joánne, očiščénije vsehó míra, mnóhimi mjá pohružájema prehrišéňmi vosťahní i omýj ot vsjákija skvérny, čelovikoľúbca vsehdá moľá, jáko chodátaj blahoprijáten."),
("Bohoródičen", "", "Beznevístnaja čístaja Bohoródice Ďívo, jedína vírnym predstáteľnice i pokróve: bíd i skorbéj i ľútych obstojánij vsích izbávi, na ťá upovánije otrokovíce imúščich: i dúši náša spasí božéstvennymi molítvami tvojími."),
),
"K": (
"P1": (
"1": (
("", "", "Písň pobídnuju pojím vsí Bóhu: sotvóršemu dívnaja čudesá mýšceju vysókoju, i spásšemu Izráiľa, jáko proslávisja."),
("", "", "Poraboščájem strasťmí hrichá, pripádaju tí Hóspodi, jáko da javíši mjá ot sích svobódna, slávjašča priľížno tvojú blahostýňu."),
("", "", "Ujazvíchsja okajánnyj hrichóvnym kopijém, i umróch, i zrjá mja ležášča vráh veselítsja: íže voskrešájaj mértvyja, oživív spasí mja."),
("Múčeničen", "", "Lícy proslávišasja stradáľcev, čestnými údy svojími Christá proslávľše, plóť ponosívša, i strastéj rádi tľínije potrébľšaho."),
("Múčeničen", "", "Stolpý i zabrála blahočéstija slávniji múčenicy, prilóhmi vrážijimi nepreklónni prebýša. Ťích molítvami Bóže, uščédri vsích nás."),
("Bohoródičen", "", "Jáko prestól ohnezráčnyj, Ďívo nósiši ziždíteľa, jáko oduševlén čertóh i krásnaja paláta carjá vmiščáješi, bývša jéže jesmý, kromí izminénija i smišénija."),
),
"2": (
("", "", "Písň pobídnuju pojím vsí Bóhu: sotvóršemu dívnaja čudesá mýšceju vysókoju, i spásšemu Izráiľa, jáko proslávisja."),
("", "", "Hlás býl jesí Slóva blažénne, ťímže hlásy náša, jáže tebí tvorím, prijimí Predtéče, svoboždája nás ot zlých chodátajstvom tvojím."),
("", "", "Jáko útro, jáko sólnce vozsijáv, prosviščáješi koncý i pomračáješi dúchi lukávyja. Ťímže mrák ot dúš nášich otžení."),
("", "", "Mértvym živót náš prichoďášč, propovídal jesí Predtéče. Ťímže umerščvľájuščyja mjá strásti umertví, i pokaží blažénne, božéstvennyja svítlosti pričástnika."),
("Bohoródičen", "", "Jedína bezľítnaho Sýna v ľíto róždši, voploščájema, prečístaja Vladýčice, vseľítnyja preokajánnyja mojejá duší strásti iscilí."),
),
),
"P3": (
"1": (
("", "", "Kámeň, jehóže nebrehóša zížduščiji, séj býsť vo hlavú úhla: tój jésť kámeň, na némže utverdí cérkov Christós, júže ot jazýk iskupí."),
("", "", "Vížď mojú némošč obolkíjsja v ňú, vížď duší mojejá ľútoje bezobrázije, i vonmí hlásu mojemú Christé mnohomílostive, i pretvorí sejá neľipótu vo blahoobrázije Spáse."),
("", "", "Spasýj Iisúse blúdnaho, spasí mja jedínaho tvojá spasíteľnyja prestúpľša zakóny, i vsjákij hrích bezslovésno skončávša, i otvedéna pomyšléňmi ot tebé bláže, čúžda mjá tvorjáščimi."),
("Múčeničen", "", "Číni bezplótnych, svjatíji, vášemu múžestvu voístinnu udivíšasja, káko na sudíšči stráždušče preslávno, i pádajušče ťílom, bezplótnyja vsjá vrahí božéstvennoju síloju nizverhóste?"),
("Múčeničen", "", "Ješčé rán krovmí očervléni, ješčé krovéj kápľami strastonóscy oblivájemi, Hóspodevi predstáste rádujuščesja, bezsmértnomu carjú, jáko pobidonóscy vinčavájemi."),
("Bohoródičen", "", "Rodilá jesí, jehóže Otéc rodí préžde vsích vík. Pitála jesí pitáteľa, iskúsa múžeska ne svídušči. Preslávno čúdo, nóvoje tájinstvo Bohoblahodátnaja: ťímže vsjáka dušá vírnych slávit ťá."),
),
"2": (
("", "", "Kámeň, jehóže nebrehóša zížduščiji, séj býsť vo hlavú úhla: tój jésť kámeň, na némže utverdí cérkov Christós, júže ot jazýk iskupí."),
("", "", "Ot neplódove i neraždájuščija Predtéče svjaščénno prozjabýj, javílsja jesí plodonósen ďílanij božéstvennych. Ťímže sérdce mojé vsjáčeski neplódstvujuščeje, blahoplódno sotvorí dóbrym: jáko da vírno vsehdá proslavľáju ťá."),
("", "", "Chľíbom nebésnym utverdí mojé sérdce blažénne, razsláblennoje lukávymi mýsľmi, i dážď mí usérdno tvoríti choťínija vseščédraho Bóha: jáko da vírno prisnoslávľu ťá."),
("", "", "Míra hrichí vzémľuščaho Áhnca propovídal jesí blažénne proróče: hrichóv mojích ťážkoje brémja oblehčí, moľúsja, umilénije mí podajá, skvérny strastéj očiščájuščeje."),
("Bohoródičen", "", "V vsehó Adáma oblečésja iz tebé Bohoródice, vseplotonósno proizšédšeje Slóvo: tohó úbo molí Bohoródice, izbáviti nás ot napástej vsjáčeskich, i ohňá víčnujuščaho."),
),
),
"P4": (
"1": (
("", "", "Dúchom províďa proróče Avvakúme, Slovesé voploščénije, propovídal jesí vopijá: vnehdá priblížitisja ľítom, poznáješisja, vnehdá prijití vrémeni, pokážešisja: sláva síľi tvojéj Hóspodi."),
("", "", "Jéže mí dál jesí Christé bohátstvo, rastočích zľí skončavája bezmístnaja, i bých náh, oblečén v ďilá bezčéstija. Ťímže vopijú ti: odéždeju mjá ukrasí pérvoju, božéstvennoju mjá umiľája blahodátiju ."),
("", "", "Nizvedóchsja bezúmijem, i padóchsja ľúťi, i na zemlí ležú neiscíľno boľáj, vozdvíhni mjá pádšich vostánije, i na kámeni spasíteľnaho pokajánija utverdí Christé, sérdce mojé."),
("Múčeničen", "", "Na krest voznesénnomu Christú podóbjaščesja, prijémľušče rány veseľáchusja vkúpi strastotérpcy, i króvnymi túčami mnohobóžija ustáviša túči, strují iscilénij istočájušče."),
("Múčeničen", "", "Preplývše nemókrenno múk zíľstvo, i hórkoje volnénije, božéstvenniji stradáľcy, okormlénijem spasénija nadéždy, i k výšnemu ustremíšasja pristánišču, vsjákaho vesélija ispolňájemi."),
("Bohoródičen", "", "Udivíšasja zrjášče ťá ánheľskaja vóinstva, káko nevídimyj zrákom, po nám iz tebé vídim býsť, Ďívo Bohorodíteľnice: jehóže molí spasénija spodóbiti vsích, víroju ťá slávjaščich."),
),
"2": (
("", "", "Dúchom províďa proróče Avvakúme, Slovesé voploščénije, propovídal jesí vopijá: vnehdá priblížitisja ľítom, poznáješisja, vnehdá prijití vrémeni, pokážešisja: sláva síľi tvojéj Hóspodi."),
("", "", "Istkáv spasénija rízu sebí, vo obnažéniji ťilésňim Hospódeň Krestíteľu, obnažénnaho ot vsjákaho blahotvorénija, oblecý mja, moľúsja, právdy i vesélija odéždeju."),
("", "", "Kápľu spasénija odoždí mňí Predtéče, istajavájemu razždizánijem póchotej, pohruzívyj vo strujách Jordánskich sládosti potóka, Iisúsa žiznodávca: jáko da po dólhu ťá slávľu."),
("", "", "Ni ánhel, ni chodátaj spasé nás, no sám Hospóď prišédyj na zémľu: jemúže právyja putí uhotóval jesí blažénne. Jehóže nýňi molí, pokazáti mí stezjú, k cárstviju nastavľájuščuju."),
("Bohoródičen", "", "Chrám osvjaščén javílasja jesí Bóžij, v ťá vséľšahosja Ďívo páče umá: tohó molí hrichóvnych skvérn nás očístiti, jáko da chrám javímsja i vselénije božéstvennaho Dúcha."),
),
),
"P5": (
"1": (
("", "", "Tvój mír dážď nám Sýne Bóžij, inóho bo rázvi tebé Bóha ne znájem, ímja tvojé imenújem, jáko Bóh živých i mértvych jesí."),
("", "", "Ispólnichsja hrichopadénij mnóhich i ľútych, Vladýko ščédryj i dolhoterpilívyj: uščédri mjá osuždénnaho, i ne otvérži mené ot licá tvojehó."),
("", "", "Mytarjá opravdál jesí Christé vozdochnúvša, tomú úbo i áz podóbjasja, bijú v pérsi, i zovú ti: očísti mjá jedíne blahoutróbne i ščédryj."),
("Múčeničen", "", "Svjatíji tvojí Hóspodi, svitíla nepreléstnaja javíšasja, prélesti othoňájušče nóšč hlubókuju, i prosviščájušče vselénnuju vsjú čudésnymi svetlosťmí."),
("Múčeničen", "", "Jáko prečestnóje kámenije, tebé kámene živótnaho, Vladýko, vozľúbľše múčenicy múkami vaľájemi, zdánije vsjáko nizverhóša prélesti."),
("Bohoródičen", "", "Vo dvojú vóľach jedínaho ot presvjatýja Tróicy rodilá jesí vseneporóčnaja, nosjáščaho jedínu ipostás: jehóže priľížno molí vsím spastísja nám."),
),
"2": (
("", "", "Tvój mír dážď nám Sýne Bóžij, inóho bo rázvi tebé Bóha ne znájem, ímja tvojé imenújem, jáko Bóh živých i mértvych jesí."),
("", "", "V pustýňu vselívsja predtéče Christóv, jákože drévle Ilijá: ťímže sérdce mojé opusťívšeje prehrišéňmi, priľižánijem božéstvennym utverdí vseblažénne."),
("", "", "Jáko stólp neprelóžen, i zabrálo vírnych býv, velíkij Christóv Predtéče, pomyšlénije mojé koléblemo kozňmí ľstívaho neprelóžno pokaží."),
("", "", "Mértvym blahovistísja svít, íže ot svíta vozsijávyj na zemlí, hlásom tvojím blažénne, i súščiji vo ťmí prosvitíchomsja: ťímže prosvití mja ľúťi omračénnaho."),
("Bohoródičen", "", "Carícu Ďívu ťá propovídajet Davíd prečístaja čístuju: ťímže moľú ťa, nebésnaho mjá cárstvija sotvorí nasľídnika, da ublažáju ťá."),
),
),
"P6": (
"1": (
("", "", "Proróka Jónu podražája, vopijú: živót mój bláže svobodí iz tlí: i spasí mja Spáse míra, zovúšča: sláva tebí."),
("", "", "Sokrušíšasja kósti okajánnyja mojejá duší, i ťahotóju sľakóchsja mnóhich slastéj: no pomozí mi Christé, jedíne vsím pomohánije."),
("", "", "V pučínu ľútych, i búrju strastéj vpadóchsja, vopijú ti vsesíľne Christé: vozvedí mja krípkoju tvojéju rukóju, i spasí mja."),
("Múčeničen", "", "Ťmámi izbránnych, mnóžestvo svjatých strastotérpec, ťmý mýslennych popráša vrahóv, i sovokupíšasja ťmám nebésnych umóv."),
("Múčeničen", "", "Izsušívše hlubinú bezbóžija stradáľcy, potók sládostnyj nasľídovaste. Ťímže izsušíte razlijánija hrichá mojehó."),
("Bohoródičen", "", "Svjaščénija síň javlénnaja Maríje, jedínu oskvernénnuju slasťmí okajánnuju mojú dúšu osvjatí, i božéstvenňij slávi pričástnika mjá sotvorí."),
),
"2": (
("", "", "Proróka Jónu podražája, vopijú: živót mój bláže svobodí iz tlí: i spasí mja Spáse míra, zovúšča: sláva tebí."),
("", "", "Íže pokajánije na zemlí propovídavyj Krestíteľu, pokajánija mí putí nastavľájuščija mjá k svítu pokaží, i ot própasti prélesti izbávi."),
("", "", "Jáko bézdnu vo strujách ríčnych pohruzív, bézdnu izsuší mojích strastéj, podajá mi sléz istóčnik, Predtéče propovídniče Christóv."),
("", "", "Ot nedúh dušévnych, i strastéj plotskích, žitijá napástej, i vsjákich iskušénij i skorbéj spasí mja Hospódeň Predtéče."),
("Bohoródičen", "", "<NAME>u i dóbruju v ženách, moľú ťa priľížno, ne prézri mené čístaja, no uščédri, i ot vsjákaho vréda cíla sobľudí."),
),
),
"P7": (
"1": (
("", "", "Súščym v peščí otrokóm tvojím Spáse, ne prikosnúsja, nižé stuží óhň. Tohdá trijé, jáko jedíňimi ustý pojáchu i blahoslovľáchu, hlahóľušče: blahoslovén Bóh otéc nášich."),
("", "", "Terpíniju izvýče Jov, i prebýsť vsími prilóhi lukávaho neprekloním, jákože stólp dóblestvennyj. Semú revnúj vsehdá o dušé, i nikákože unyváj v ľútych."),
("", "", "Ťilésnymi pobidíchsja slasťmí, i bých bezslovésen, sýj slovésen: Slóve Bóžij, íže slóvom bludnícu spasýj, spasí mja okajánnaho, da pojú blahoslovjá tvojú blahostýňu."),
("Múčeničen", "", "Izbávleni múčenicy múdriji króviju, plótiju postradávšaho nás rádi, za nehóže usérdno izvóliste izlijáti svojá króvi: ťímže neprestánno s ním cárstvujete."),
("Múčeničen", "", "Nazdánijem stradáľčestv svjaščénnych paláta javístesja múdriji, v néjže rádostno Christós počíl jésť, jedín cár i Hospóď, íže ko obítelem nebésnym privedýj vás."),
("Bohoródičen", "", "Ot rodóv ťá vsích Christós vsepítaja, jedínu izvóli sebí, jáko čéstnúju i čístuju v žilíšče: i iz tebé jáko sólnce vozsijáv, zémľu vsjú prosvití."),
),
"2": (
("", "", "Súščym v peščí otrokóm tvojím Spáse, ne prikosnúsja, nižé stuží óhň. Tohdá trijé, jáko jedíňimi ustý pojáchu i blahoslovľáchu, hlahóľušče: blahoslovén Bóh otéc nášich."),
("", "", "Jáko vétchomu i nóvomu býv preizjáščnyj slávnyj chodátaj Krestíteľu, chodátajstvuj, obvetšávšaho hrichmí vsehó obnovíti mjá, obnovíteľa vsjáčeskich moľá Iisúsa."),
("", "", "Zakonopolahája pokajánije na zemlí javílsja jesí Predtéče Christóv i Krestíteľu, jehóže soveršíti vsích ukripí molítvami tvojími, jáko da izbávimsja ot bezmírnych zól, jáže sohrišájem prísno."),
("", "", "Tý ťísnyj prošél jesí púť, vozderžánije vsjáko prochoďá múdre, i širotóju Bóhoviďínij svítlych vés ozarívsja: íchže nasladítisja i nám dáruj, Christá moľá."),
("", "", "Jedíno jestestvó Tróicu vírniji slávim, beznačáľnaho Otcá, i Sýna, i Dúcha ábije, jedíno cárstvujuščeje suščestvó, jedíno Hospóďstvo, jedíno načálo, i živót životvorjáščij nás."),
("Bohoródičen", "", "Moľbú prečístaja, Bóhu prinesí, jáko da prézrit náša prehrišénija, i bezčíslennyja hrichí, i víčnaho svobodít nás ohňá múčaščaho."),
),
),
"P8": (
"1": (
("", "", "Jehóže užasájutsja ánheli, i vsjá vójinstva, jáko tvorcá i Hóspoda, pójte svjaščénnicy, proslávite ótrocy, blahoslovíte ľúdije, i prevoznosíte vo vsjá víki."),
("", "", "Náha mjá soďíla vsjáčeskich dobroďítelej zmíj ľstívyj zlým sovítom: rízoju dobroďítelej ukrasí mja nýňi, obnažívyj Spáse mój sehó zlóby."),
("", "", "Choťáj prijití sudíti ródu čelovíčeskomu, sudijé právednyj, v čás strášnyj, osuždéna súšča ne poslí mené vo óhň hejénskij, no uščédri i spasí mja."),
("Múčeničen", "", "Vás vsechváľniji Hospódni stradáľcy, ni skórb, ni bidá, ni méč, nižé óhň vozmóže razlučíti otňúd ot ľubvé Christóvy, blahoutróbija rádi vás vozľubívšaho"),
("Múčeničen", "", "Plótiju sopletájemi bezplótnomu vrahú, tohó nizložíste dóbliji stradáľcy i nýňi so bezplótnymi slikovstvújete, isciľájušče strásti dúš že i ťilés."),
("Bohoródičen", "", "Jáko cvít vo udólijich žitijá ťá obrít, v ťá vselísja, íže vsích sadíteľ, voňámi dobroďítelej i čistotý nýňi blahouchájaj nás, Bohorodíteľnice."),
),
"2": (
("", "", "Jehóže užasájutsja ánheli, i vsjá vójinstva, jáko tvorcá i Hóspoda, pójte svjaščénnicy, proslávite ótrocy, blahoslovíte ľúdije, i prevoznosíte vo vsjá víki."),
("", "", "Jedín páče vsích sohriších na zemlí róždšichsja, jedín bých prestúpnik tvojích zakónov Hóspodi: ťímže Predtéči rádi uščédri i spasí mja."),
("", "", "Ánhel nrávy javílsja jesí Krestíteľu Joánne, sovíta velíkaho ánhela propovídajaj koncém: ťímže ťá písňmi slávim vo vsjá víki."),
("", "", "Vo hlavú usíčen býl jesí bez právdy blažénne, pohruzívyj hlavú Christóvu v vodách. ukripí vsích nás molítvami tvojími, hlavú popiráti ľstívaho voístinnu hubíteľnuju."),
("Bohoródičen", "", "Izbávi mjá bezmístnych hrichóv, i plámennaho tomlénija, i ťmý múčaščija, skréžeta zúbnaho, i čérvija, Ďívo, jedína predstáteľnice ródu čelovíčeskomu."),
),
),
"P9": (
"1": (
("", "", "Svitonósnyj óblak, vóňže vsích Vladýka, jáko dóžď s nebesé na runó sníde, i voplotísja nás rádi, býv čelovík, beznačáľnyj. Veličájem vsí jáko Máter Bóha nášeho čístuju."),
("", "", "Sé vrémja pokajánija i čísta ďílanija, sé déň, svítla soďílaj ďilá: biží ťmý strastéj, otžení són zláho unýnija dušé mojá, jáko da búdeši božéstvennaho svíta pričástna."),
("", "", "Jáko mytár vozdycháju, jáko bludníca slezjú, i jáko razbójnik vopijú ti: pomjaní mja ščédre: i jáko blúdnyj sýn vzyváju: sohriších, pripádaju tí jáko chananéja: mílostive, ne prézri mené Christé."),
("Múčeničen", "", "Ťlésnym strastém, i dušévnym sokrušénijem, javístesja voístinnu vráčeve: predávše ťílesá k ránam terpilívno, i k smérti núžňij, prechváľniji stradáľcy Hospódni: sehó rádi ublažájetesja prísno."),
("Múčeničen", "", "Sólnečnaho sijánija oblistá mnóžaje terpínije premúdrych Christóvych strastotérpec, ťímže načáľnika ťmý jávi pohubí blahodátiju , i razruší bezbóžija nóšč, i serdcá prosvití vírnych."),
("Bohoródičen", "", "Prosvitíteľnymi sijáňmi vozsijávšaho Slóva, ot svjatáho tvojehó čréva Bohoródice Ďívo, i ozarívšaho zemlí koncý, prosvití dúšu mojú slastéj čérnostiju omračénnuju, i ľínostiju strastéj, da víroju ťá vospiváju."),
),
"2": (
("", "", "Svitonósnyj óblak, vóňže vsích Vladýka, jáko dóžď s nebesé na runó sníde, i voplotísja nás rádi, býv čelovík, beznačáľnyj. Veličájem vsí jáko <NAME> nášeho čístuju."),
("", "", "Sé svitíľnik sijája súščym vo ťmí žitijá, sé dobrohlahólivaja lástovica, vésnu vsím vozviščájuščaja, Christóv velíkij Predtéča, chodátaj vétchomu i nóvomu: jehóže molítvami da sochranímsja prísno."),
("", "", "Jáko ženichú ťa drúha nýňi predlaháju molítvennika, imíjaj mnóžestvo hrichóv, i vopijú ti Krestíteľu: otsečénije mí dolhóv, preblážénne, podážď, i vozžzí duší mojejá svitíľnik uhásšij ľínostiju do koncá."),
("", "", "So bezplótnymi ánhely, s čestnými apóstoly, so strastotérpcy svjaščénnymi, i so proróki Predtéče, prebláháho Bóha molí vsehdá, ulučíti nám bláh víčnych, oboháščšymsja vsehdá tobóju predstátelem blahím."),
("", "", "Lástovice krásnaja, slávije čéstnýj, hólube predóbryj, pustyneľúbnaja hórlice, Hospódeň Krestíteľu, pustýnnoje prozjabénije, zapusťívšuju bezplódijem dúšu mojú pokaží plodonósnu dóbrym."),
("Bohoródičen", "", "Nósiši nosjáščaho vsjáčeskaja, jákože prestól cheruvímskij, i pitáješi pitájuščaho nás: jehóže neprestánno molí, Bohorádovannaja čístaja, trúsa, padéža, pľinénija, i vsjákija núždy, tvojemú stádu izbávitisja prísno."),
),
),
),
"ST": (
("", "", "Ín vík tebé dušé ožidájet, i sudijá chóščet tvojá obličíti tájnaja i ľútaja. Ne prebúdi úbo v ních, no predvarí vopijúšči sudijí: Bóže, očísti mjá i spasí mja."),
("", "", "Ne iskusí mené spáse mój, ľínostiju hrichóvnoju oderžíma, no vozdvíhni mojé pomyšlénije k pokajániju, i tvojehó vinohráda ďílateľa iskúsna javí mja. Dáruj mí jedinonadesjátaho časá mzdú, i véliju mílosť."),
("Múčeničen", "", "Síji vójini carjá velíkaho protívišasja poveľínijem mučítelevym, dóblestvenňi neradíša o múkach, i prélesť vsjú poprávše, dostójno vinčáni býša prósjat u Spása míra dušám nášym, i vélija mílosti."),
("Bohoródičen", "", "Bludnícu i blúdnaho áz, i razbójnika pobidích, i mytarjá prehrišéniji preminúch, i ninevíťany. Uvý mňí, čtó búdu? Káko ubíhnu múki áz okajánnyj? Čístaja, pripádaju tí, uščédri mjá mílostiju tvojéju, jákože ónyja Sýn tvój spásl jésť."),
)
)
#let L = (
"B": (
("", "", "Sňídiju izvedé iz rajá vráh Adáma: krestóm že vvedé Christós vóň razbójnika, pomjaní mja Hóspodi, vopijúšča, jehdá priídeši vo cárstviji tvojém."),
("", "", "Na vsják déň sohrišájušča i prestupájušča tvojá zápovidi, obratí mja Bóže, i ot mučénija ischití, jáko da tvojé neizrečénnoje milosérdije slávľu čelovikoľúbče."),
("", "", "Svitíľnik javílsja jesí Bóžij Predtéče, predchoďá nezachodímomu svítu, iz óblaka svítla vozsijávšemu nám neizrečénno: prísno tohó úbo molí, uščédriti i spastí dúši náša."),
("Múčeničen", "", "Preterpívše mnohopleténnyja múki, múčenicy vsechváľniji, nebésnych výšnich bláh spodóbistesja: ťím ublažájetesja ot vsích čelovík vsehdá."),
("", "", "V trijéch lícich jedíno Božestvó znájem vsí nepresikómo súščeje, so Otcém Sýna že i Dúcha živáho, beznačáľno, neslijánno, vo víki prísno prebyvájuščeje."),
("", "", "Po roždeství prisnoďívo, jákože préžde roždestvá sochranílasja jesí čístaja, Bóha róždši plótiju: jehóže molí prečístaja, plotskích i dušévnych strastéj izbáviti nás, mólimsja."),
)
) |
|
https://github.com/luisnquin/cv | https://raw.githubusercontent.com/luisnquin/cv/main/main.typ | typst |
#let blue = rgb("#1a58c4")
#let HeaderLink(label, url) = {
link(url)[#underline(offset: 0.15em, stroke: 1.05pt, text(
weight: "semibold",
fill: blue,
label
))]
}
#let CompanyExperience(company, description, roles) = {
let Experiences() = {
stack(
dir: ttb,
spacing: 0.2em,
for role in roles {
grid(
text(style: "italic", size: 0.95em, role.title + " (" + role.range + ")")
)
}
)
}
stack(
spacing: 0.8em,
stack(
spacing: 1.1em,
underline(offset: 0.18em, stroke: 1.1pt, text(weight: "medium", size: 1.12em, company)),
if description.len() > 0 {
text(size: 0.9em, description)
}
),
Experiences()
)
}
#let document() = {
stack(
dir: ttb,
spacing: 1.5em,
text(size: 1.3em, weight: "semibold", "<NAME>"),
grid(
columns: (1fr, 1fr),
rows: (1.15em),
gutter: 0.5em,
HeaderLink("<EMAIL>", "mailto:<EMAIL>"),
align(alignment.right, HeaderLink("/in/luisnquin","https://linkedin.com/in/luisnquin/")),
"+51 912052391 / +503 72095581",
align(alignment.right, HeaderLink("github.com/luisnquin","https://github.com/luisnquin"))
),
stack(
text("Software Developer with more than 4 years of experience in digital products, primarily in the Fintech and HR management sectors. My knowledge includes backend, frontend, mobile development, cloud-based environments, embedded systems, and operating systems.") ,
),
stack(
dir: ttb,
spacing: 2em,
text(size: 1.3em, weight: "semibold", "PROFESSIONAL CAREER:"),
CompanyExperience("Chanchita", "", (
(
title: "Senior Backend Developer",
range: "Oct 2024 - present"
),
(
title: "Senior Full Stack Developer",
range: "May 2024 - Oct 2024"
)
)),
CompanyExperience("Qompa", "Building the first LATAM neobank for SMEs, empowering them with AI-driven financial solutions. We provide data-backed insights, user-friendly tools with gamification and tailored products to help businesses growth.", (
(
title: "CTO/Co-Founder",
range: "Jul 2024 - present"
),
)),
CompanyExperience("Inversiones.io", "", (
(
title: "Site Reliability Engineer",
range: "Jan 2024 - Oct 2024"
),
)),
CompanyExperience("WiserSKILLS - NEOBRAIN", "", (
(
title: "Full-Stack Developer",
range: "Jun 2023 - Jan 2024"
),
(
title: "Backend Developer",
range: "Feb 2022 - Jun 2023"
)
)),
CompanyExperience("Desstorm", "", (
(
title: "Web Developer",
range: "Oct 2021 - Dec 2021"
),
))
)
)
}
#text(font: "Roboto", size: 0.9em)[#document()]
|
|
https://github.com/floriandejonckheere/utu-thesis | https://raw.githubusercontent.com/floriandejonckheere/utu-thesis/master/thesis/figures/08-case-study/statistics.typ | typst | #import "@preview/cetz:0.2.2": canvas, chart, draw
#let statistics_chart = (key, ytickstep) => [
#let data = (
(<scn_structural_logical>, yaml("/data/structural_logical.yml")),
(<scn_structural_contributor>, yaml("/data/structural_contributor.yml")),
(<scn_logical_contributor>, yaml("/data/logical_contributor.yml")),
(<scn_structural_logical_contributor>, yaml("/data/structural_logical_contributor.yml")),
)
#(
let rows = data
.enumerate(start: 1)
.map(x => (
label: link(x.at(1).at(0))[[S#x.at(0)]],
x: x.at(0),
min: x.at(1).at(1).at(key).min,
max: x.at(1).at(1).at(key).max,
q1: x.at(1).at(1).at(key).q1,
q2: x.at(1).at(1).at(key).q2,
q3: x.at(1).at(1).at(key).q3,
)
)
)
#let ymin = calc.min(..rows.map(x => x.min))
#let ymax = calc.max(..rows.map(x => x.max))
#canvas(length: .75cm, {
chart.boxwhisker(
size: (6, 4),
label-key: "label",
y-min: (ymin - (ytickstep / 2)),
y-max: (ymax + (ytickstep / 2)),
y-tick-step: ytickstep,
(..rows),
)
})
]
|
|
https://github.com/VisualFP/docs | https://raw.githubusercontent.com/VisualFP/docs/main/SA/design_concept/content/poc/options_deployment_webapp.typ | typst | #import "../../../acronyms.typ": *
= Web Application
A web application has a frontend and a backend.
The frontend is statically served to the user in a web browser and communicates
through an #ac("API") with the backend, which is hosted on a server.
The advantages are that the frontend and backend can be written in entirely
different programming languages, that the users don't have to install anything
on their devices, and that there is no need to support multiple operating
systems explicitly since most devices can run a web browser.
The drawbacks are that the application must be hosted on a server and other
development tools that may require access to the user's device cannot be used.
|
|
https://github.com/timetraveler314/Note | https://raw.githubusercontent.com/timetraveler314/Note/main/24Spring/LinearAlgebra/LA.typ | typst | #import "@local/MetaNote:0.0.1" : *
#import "@preview/commute:0.2.0": node, arr, commutative-diagram
#let detm = math.mat.with(delim: "|")
#show: doc => MetaNote(
title: [
Linear Algebra A (II) Class Notes
],
authors: (
(
name: "timetraveler314",
affiliation: "University of Genshin",
email: "<EMAIL>",
),
),
doc,
)
#let ve = math.bold($e$)
#let opl = math.plus.circle
#let lcm = math.op("lcm")
#let ip(x,y) = $lr(angle.l #x, #y angle.r)$
#let Hom = math.op("Hom")
#outline()
= Vector Spaces
== Operations on Subspaces
#theorem[
Let $V_1,dots,V_n$ be proper subspaces of a vector space $V$ over an infinite field $FF$. Then the intersection $ V_1 union dots union V_n != V. $
]
#proof[
(i) First consider the case where $n=2$. Choose $v_1 in V_2 backslash V_1, v_2 in V_1 backslash V_2$. We show that $v = v_1 + v_2 in.not V$.
Suppose not. If $v in V_1$, then $v_1 = v - v_2$ in $V_1$, a contradiction. Similarly, if $v in V_2$, then $v_2 = v - v_1$ in $V_2$, a contradiction. Thus $v in.not V$.
(ii) (Vandermonde's Determinant) For general $n in NN$:
Let $v_i in V backslash V_i, i = 1, dots, n$. We manage to find a linear combination of them that is not covered by the union of $V_i$.
Consider $u_a = sum_(i=1)^m a^(i-1)v_i, a in FF$. Here, $op("char") FF = 0$. So there exists $V_k$ s.t. $u_a in V_k$ for infinitely many $a$.
WLOG, assume $u_(a_1),dots,u_(a_m) in V_k$, where $a_i$ are distinct. It suffices to show that $v_k in op("span"){u_(a_1),dots,u_(a_m)} subset V_k$, which leads to a contradiction.
To obtain $v_k$, consider linear combinations of $u_(a_i)$. We have a Vandermonde matrix:
$ (u_(a_1),dots,u_(a_m)) vec(x_1,dots,x_m) = v_k
\ <=> (v_1,dots,v_m) underbrace(mat(1,1,dots,1;a_1,a_2,dots,a_m;dots.v,dots.v,dots.down,dots.v; a_1^(m-1),a_2^(m-1),dots,a_m^(m-1)) vec(x_1,dots.v,x_m)) = v_k
$
Letting the underbraced part be $vec(0,dots.v,1 (k-"th"), dots.v,0)$, we have a linear combination of $u_(a_i)$ that equals $v_k$. This is guaranteed by the Vandermonde determinant being nonzero, which gives us a unique solution for $vec(x_1,dots,x_m)$.
]
== Sum of Subspaces
#note[
The sum $limits(plus)_(i in cal(I)) V_i$ of subspaces $V_i$ is the smallest subspace containing all $V_i$. This is the core idea of the sum.
]
After introducing the operation $+$, we want to check whether the new operation behaves well with respect to the old operations $union$ and $sect$. Here, distributivity does not hold in general, but we have the following result.
#theorem[
Let $X,Y,Z$ be subspaces.
(i) $(X sect Z) + (Y sect Z) subset (X+Y) sect Z$,
(ii) $(X sect Y) + Z subset (X+Z) sect (Y+Z)$.
]
#proof[
(i) $ X subset X+Y => (X+Y) sect Z subset X sect Z. $
Similarly, $ Y sect Z subset (X+Y) sect Z. $
(ii) $ X sect Y subset X+Z, Y sect Z subset Y+Z. $
]
// #proof[
// 记 $d(x) = gcd(f(x),g(x)), f'(x) = f(x)/d(x), g'(x) = g(x)/d(x)$. 我们来考虑 $f'$和$g'$.
// 存在性. 由Bezout定理,存在$h(x),k(x)$使得
// $ f' h + g' k = 1. $
// 对$h$做带余除法,得到 $h(x)=p(x) g'(x) + u(x)$,其中 $deg u(x)< deg g'(x)$. 代入上式得到
// $ f' u + g' (p f' + k) = 1. (1)$
// 记 $v(x) = p(x) f'(x) + k(x)$. 断言 $deg v(x) < deg f'(x)$. 若不然,(1)式中 $deg f'(x)u(x) < deg g'(x)v(x)$,二者相加比较次数可知不能成立.
// 故存在 $u(x),v(x)$使得 $f' u + g' v = d$ 且 $deg u < deg g'$, $deg v < deg f'$.
// 唯一性. 若存在 $u',v'$使得 $f' u' + g' v' = d$ 且 $deg u' < deg g'$, $deg v' < deg f'$, 则 $f' (u-u') = g' (v-v')$. 由于 $f',g'$互素,故 $u-u'$是$g'$的倍数,$v-v'$是$f'$的倍数. 由于次数限制,$u-u'=0,v-v'=0$.
// 故存在唯一的 $u,v$ 满足条件 $ f' u + g' v = 1$,这等价于存在唯一的 $u,v$ 满足条件 $ f u + g v = d$.
// ]
= Linear Mappings
#note("Linear Mappings and Matrices")[
Given $T: V -> W$, choose bases ${e_1, dots, e_n}$ and ${eta_1, dots, eta_m}$ for $V$ and $W$ respectively.
We say $A$ is a matrix representation of $T$ if
$ T(e_1,dots,e_n) = (eta_1,dots,eta_n) A. $
Specially, let $T$ be a linear mapping from $V$ to itself. Then $A$ is a matrix representation of $T$ with respect to the same basis.
When basis changes: ${e_1,dots,e_n} -> {f_1,dots,f_n}$, the transition matrix $P$ is defined by
$ (f) = (e) P. $
Then the matrix representation of $T$ with respect to the new basis is given by $B=P^(-1) A P$:
$ T (f) P^(-1) = (f) P^(-1) A => T(f) = P^(-1) A P. $
Generally, $B=Q^(-1) A P$.
]
== Kernel and Image
#question[
Let $S,T$ be subspaces of $V$. Show that
$ (S+T) slash S tilde.eq T slash (S sect T). $
]
#proof[
#note[
Upon seeing isomorphism of quotient spaces, we should consider the first isomorphism theorem.
]
Consider the mapping $ phi : S+T -> T slash (S sect T), s + t |-> t + (S sect T). $
Its linearity is clear. Now for any $v = s + t in ker phi$, $ t + (S sect T) = 0 + (S sect T) <=> t in S sect T <=> t in S <=> v in S. $
Thus $ ker phi = S$. By the first isomorphism theorem, $ (S+T) slash S tilde.eq T slash (S sect T). $
]
#corollary[
$ phi(U) tilde.eq U slash (U sect ker phi). $
]
== Minimal Polynomial and Characteristic Polynomial
#theorem("Primary Decomposition")[
Consider factorization over $FF$.
Let $m_phi = p_1^(r_1) dots p_k^(r_k)$ be the factorization of the minimal polynomial of $phi$. Then
$ V = plus.circle.big ker p_i^(r_i). $
Let $f_phi = p_1^(s_1) dots p_k^(s_k)$ be the factorization of the characteristic polynomial of $phi$. Then
$ V = plus.circle.big ker p_i^(s_i). $
They are both the primary decomposition of $V$.
]
Denote $K(f)$ by the kernel of $f(phi)$.
#theorem("Projection Map as Polynomials")[
Let $phi : V -> V$ be a linear mapping. Then the projection map $pi_i : V ->ker p_i^r_i$ is a polynomial of $phi$.
]
#proof[
The case when $k=1$ is trivial. We prove the general case where $k>2$.
Let $g_j = p_1^(r_1) dots hat(p)_(j)^(r_(j)) dots p_k^(r_k)$. Then $ K(g_j) = ker g_j (phi) = union.big_(t !=j) ker p_t^(r_t). $
We see that all $g_j$ are coprime. By Bezout's identity, there exist $h_j$ s.t.
$ h_1 g_1 + dots + h_k g_k = 1. $
Let $x = x_1 + dots + x_k, x_j in ker p_j^(r_j)$. Then $ sum_j x_j = x &= sum_j h_j (phi) g_j (phi) (x) \
&= sum_(j,t) h_j (phi) g_j (phi) (x_t) \
&= sum_j h_j (phi) g_j (phi) x_j ("Because" K(g_j) = ker g_j (phi) = union.big_(t !=j) ker p_t^(r_t)). \
$
Notice the primary decomposition is a direct sum. Then $ x_j = (h_j dot g_j)(phi) x_j, j = 1, ...,k $
This shows that $pi_i = h_i (phi) g_i (phi)$.
]
#example[
Let $phi in cal(L) (V)$ be diagonalizable. If $W$ is a $phi$-invariant subspace, then $phi|_W$ is also diagonalizable.
]
#proof("1")[
+ Expand a basis $w_1,dots,w_m$ of $W$ to a basis $w_1, dots, w_n$ of $V$.
Then $ phi(w_1,dots,w_m) = (w_1,dots,w_n) mat(A_1,A_2;0,A_3), $
where $A_1$ is the matrix representation of $phi|_W$.
Note that $ mat(A_1,A_2;0,A_3)^k = mat(A_1^k,*;0,A_3^k), $
This shows that for any polynomial $f$, $f(A) = mat(f(A_1),*;0,f(A_3))$.
- $phi$ is diagonalizable, so $m_A$ is a product of distinct linear factors.
$m_A (A) = 0 => m_A (A_1) = 0$, so $m_A_1 | m_A$, which shows that $m_A_1$ is a product of distinct linear factors $=>$ diagonalizable.
]
#proof("2")[
By factorizing the space.
$ V = plus.circle.big V_lambda_i (phi) $
In fact, $W = plus.circle.big (W sect V_lambda_i(phi))$. For all $w in W$, $w = w_1 + ... + w_i, w_k in V_lambda_k$. We prove that $w_i in W$.
Consider the projection $p_i : V -> V_lambda_i$,* $p_i$ is a polynomial of $phi$*.
$ w_i = p_i(w) = g_i(phi) (w) in W (W "is " phi"-invariant"). $
The decomposition $W = plus.circle.big (W sect V_lambda_i(phi))$ gives
]
#example[
Let $A,B$ be diagonalizable, $A B = B A$. Show that $A,B$ is simultaneously diagonalizable.
]
#proof[
Let $V_lambda_i$ be the eigenspace of $A$ corresponding to $lambda_i$. Then $V_lambda_i$ is $B$-invariant.
$B$ is diagonalizable on $V_lambda_i$, so $V_lambda_i$ is the direct sum of eigenspaces of $B$.
$V = plus.circle.big V_lambda_i$ is the direct sum of eigenspaces of $B$. This shows that $A,B$ is simultaneously diagonalizable.
]
Actually, the primary decomposition is not strong enough. When we expand the field to $CC$, we may get more information.
#note("Space Decompositions")[
+ Primary Decomposition $V = plus.circle.big V_lambda_i (phi)$
+ Cyclic Subspace Decomposition
+ Irreducible $phi$-invariant Decomposition
]
== Cyclic Spaces
Consider the Frobenius matrix
$ A = mat(0,0,...,0,-a_0;1,0,...,0,-a_1;0,1,...,0,-a_2;0,0,...,1,-a_(n-1)) $
Then $A ve_1 = ve_2, A ve_2 = ve_3, dots, A ve_(n-1) = -a_(n-1) ve_n, A ve_n = -a_0 ve_1 - a_1 ve_2 - dots - a_(n-1) ve_(n-1) $.
We see that a basis can be $ve_1, A ve_1, A^2 ve_1, dots, A^(n-1) ve_1$. This is such a good property that we want to generalize it.
#definition("Cyclic Spaces")[
Let $phi : V->V, xi in V$. Let
$ W = angle.l xi, phi(xi), phi^2(xi), dots, phi^(n-1)(xi) angle.r . $
$W$ is a $phi$-invariant subspace of $V$ generated by $xi$. We call $W$ a $phi$-cyclic subspace of $V$ generated by $xi$.
]
What is the minimal polynomial of $phi|_W$? How do we construct a basis for $W$?
While trying to construct the maximum number of linearly independent vectors, we may encounter the following problem:
$ a_1 xi + a_2 phi(xi) + dots + a_(n-1) phi^(n-2)(xi) = a_n phi^(n-1)(xi). $
This is equivalent to finding $f(x) in FF[x], f(phi) = 0$. This reduces to finding an annihilating polynomial of $xi$ s.t. $ f(phi)xi = 0$.
Of all the polynomials, the monic polynomial of the smallest degree is unique. Thus we can define the minimal annihilating polynomial of $xi$.
#lemma[
Let $xi != 0$. If the minimal annihilating polynomial of $xi$ w.r.t. $phi$ is $f(x)$, Then
$ xi, phi(xi), dots, phi^(deg f - 1)(xi) $ is a basis of $W$.
A corollary: $dim W = deg m_xi (x)$.
]
#proof[
Assume there exists some $b_i !=0$ s.t.
$ b_0 xi + b_1 phi(xi) + dots + b_(deg f - 1) phi^(deg f - 1)(xi) = 0. $
Then $b_0 + b_1 x + dots + b_(deg f - 1) x^(deg f - 1) != 0$ is an annihilating polynomial of $xi$ with degree less than $deg f$, a contradiction.
]
We call $m_xi, m_phi$ both "annihilating". What is the relationship between them?
#theorem("Annihilating Polynomials")[
$ m_xi | m_phi. $
]
Can they be the same?
#lemma("Steps towards Cyclic Decomposition (Hard)")[
(1) $exists xi in V$ s.t. $m_xi = m_phi$. (An unique $xi$ that cyclically generates $V$)
(2) $exists U$ s.t. $U$ is $phi-$invariant, and
$ V = angle.l xi,dots,phi^(s-1) (xi) angle.r plus.circle U. $
]
#note[
(2) tells us that the complement of the cyclic subspace is still $phi-$invariant. Now go on with $U$ till $U = {0}$, then we get the cyclic decomposition.
After this, we get a basis of $V$ with nicer properties compared to the primary decomposition.
]
By virtue of dual spaces, we may prove the result in a more general setting.
#proof[
(1) Let $m_phi = p_1^(r_1) ... p_s^(r_s)$.
i. $s=1$. Then $m_phi = p^s, p$ is irreducible. By the minimality of $s$, $exists xi, p^(s-1) (phi) (xi) !=0$.
By $m_xi | m_phi$, $m_xi = p^k, k<=s$. If $k<s$, then $p^k (phi) (xi) = 0$, a contradiction. Thus $k=s$.
ii. $s>=2$. By primary decomposition,
$ V = ker p_1^(r_1) (phi) plus.circle ker p_2^(r_2) (phi) plus.circle ... plus.circle ker p_s^(r_s) (phi). $
*Consider the restriction map $phi|V_i$.* The minimal polynomial of $phi|V_i$ is $p_i^(r_i)$. By i., $ exists xi_i in V_i, m_xi_i = p_I^(r_i). $
*Construct $xi = sum xi_i$.* We show that $m_xi = m_phi$.
By definition, $m_xi (phi) (sum xi_i) = sum m_xi (phi) (xi_i) = 0$. Each term $m_xi (phi) (xi_i) in V_i$. Utilize the *direct sum* property, $m_xi (phi) (xi_i) = 0$. Thus $m_xi_i | m_xi$. Because $p_i$ are coprime, $m_phi | m_xi => m_phi = m_xi$.
(2) (GTM 23, last chapter).
]
Apply the lemma repeatedly, we get the cyclic decomposition.
How to prove that a space is cyclic?
#theorem[
$W$ is cyclic iff $dim W = deg m_(phi|_W)$.
]
== Irreducibility
#definition("Irrreducible")[
$V$ is called $phi$-irreducible if $V != V_1 plus.circle V_2 $, where $V_1, V_2$ are $phi$-invariant subspaces of $V$.
]
#theorem[
$V$ is $phi$-irreducible $<=>$ $V$ is $phi$-cyclic, $m_phi = f^k, k>=1$ ($f$ is irreducible).
]
#proof[
$=>$: Let $m_phi = f_1^(k_1) ... f_s^(k_s)$ be the irreducible factorization of $m_phi$.
Then $V = plus.circle.big ker f_i^(k_i)$. Because $ker f_i^(k_i)$ is $phi$-invariant, $V$ is not $phi$-irreducible if $s>=2$. Thus $s=1$.
By the cyclic lemma, $exists xi in V$ s.t. $m_xi = m_phi = f^k$. Then $W = angle.l xi, phi(xi), dots, phi^(k-1)(xi) angle.r$ is $phi$-cyclic.
Moreover, by irreducibility, $W = V$.
$arrow.l.double$: Proof by contradiction. Let $V = V_1 opl V_2$, $V_1, V_2$ are $phi$-invariant. Then $m_phi = lcm(m_(phi|_V_1), m_(phi|_V_2))$. WLOG, we have $m_(phi|_V_1) = f^k = m_phi$. By analyzing the dimension, we get a contradiction.
]
Hence we are able to determine whether a space is irreducible while decomposing it. Then any $V$ must have a decomposition into irreducible cyclic subspaces.
Diving into the irreducible subspaces, we can give a concrete characterization.
For each irreducible space, let $e$ be the cyclic element, $ m_phi = f^k \ f(phi) = phi^p + a_(p-1) phi^(p-1) + dots + a_1 phi + a_0 = 0. $
Utilizing the relation, we can construct a basis of $V$.
$
e, &phi_e, &&..., &&&phi^(p-1) e, \
f(phi)_e, &f(phi)phi(e), &&..., &&&f(phi)phi^(p-1)(e), \
f^2(phi)_e, &f^2(phi)phi(e), &&..., &&&f^2(phi)phi^(p-1)(e), \
&&dots \
f^(k-1)(phi)_e, &f^(k-1)(phi)phi(e), &&..., &&&f^(k-1)(phi)phi^(p-1)(e).
$
The $k p$ elements together form a basis. Let's prove it.
#proof[
$M$ denotes the space spanned by the above $k p$ elements.
It suffices to show $phi(M) subset.eq M$ because of irreducibility. (If there is more than one invariant subspace, $M$ won't be irreducible)
By direct calclation, ...
]
The matrix of $phi$ under this basis is a block matrix
$
mat(F,,;A,F,;,A,F), F = mat(0,0,...,0,-a_0;1,0,...,0,-a_1;0,1,...,0,-a_2;0,0,...,1,-a_(p-1)), A = mat(0,0,...,1;0,0,...,0;dots.v,dots.v,dots.down,dots.v;0,0,...,0)
$
#example("Jordan Normal Form")[
When $FF=CC$, every polynomial can be completely factored, giving fine enough matrix as Jordan blocks. $m_phi = (x-a)^k =>$ $mat(a;1,a;,1,a;,,dots.down,dots.down;,,,1,a;)$
]
#example[
When $FF=RR$, $m_phi (x) = (x^2+a x+b)^k$, $F = mat(0,-b;1,-a)$.
]
#example[
$phi : V->V, m_phi (x) = f^k, f(x)$ is irreducible.
]
#solution[
(1) $m_phi = f$. $V = opl.big V_i$, $m_(phi|_V_i) = f$.
Then $V$ can be decomposed into $(dim V) / (deg f)$ irreducible subspaces.
(2)
]
== Appendix : Linear Maps on Matrix Spaces
#let tov = math.op("vec")
#let oti = math.times.circle
#example[
Let $A in FF^(m times n), B in FF^(p times q)$, consider $ T : X in FF^(n times p) |-> A X B in FF^(m times q). $
It's easy to check that $T$ is linear. What is the matrix representation of $T$?
]
Consider the vectorization of matrices.
#definition("Vectorization")[
Let $A in FF^(m times n)$. The vectorization of $A$ is defined as
$ X = (x_1,...,x_p) in FF^(n times p) |-> op("vec")(X) = vec(x_1,dots.v,x_p) in FF^(n p times 1). $
]
Then our desired matrix representation is given by
$ underbrace(tov(A X B), "coordinate of" T(X)\ m q) = underbrace((B^T oti A), "matrix representation of" T\ m q times n p) underbrace(tov(X), "coordinate of" X\ n p), $
where $oti$ is the Kroenecker product.
#definition("Kroenecker Product")[
$ C oti D = mat(c_11 D, c_12 D, dots, c_1n D; c_21 D, c_22 D, dots, c_2n D; dots, dots, dots, dots; c_(m 1) D, c_(m 2) D, dots, c_(m n) D). $
]
$dim ker T$?
#theorem[
Let $A,B in FF^(n times n)$, $f,g$ be coprime polynomials, $f(A) = g(B) = 0$.
Prove that $T : X in FF^(n times n) |-> A X- X B in FF^(n times n)$ is an isomorphism.
]
#proof[
It suffices to show that $ker T = 0$.
If $A X = X B$, then $f(A) X = X f(B) = 0$. By the coprimality of $f,g$,
$ u f+ v g = 1 ("Bezout"). $
$ X = I X &= (u f + v g) (A) X \
&= 0 + v(A) X g(B) = 0.
$
Thus $ker T = 0$.
]
The form $A B - B A$ is quite common in Lie algebra. We may consider the following.
#theorem[
Define communitator $[A,B] = A B - B A$. Then
If $A, B in op("Hom")(V,V)$ s.t. $[A, B] = A B - B A =I$ Then
(1) there exists no annihilating polynomial of $A$.
(2) $V$ must be infinite-dimensional.
]
#proof[
(1) By easy induction, $ A^k B - B A^k = k A^(k-1). $
Then for any polynomial $f$, $f(A) B - B f(A) = f'(A)$.
(The core idea is utilizing the fact that derivative reduces the degree of the polynomial, thus giving an infinite descent.)
Suppose there exists an annihilating polynomial $f$ of $A$. Then $f(A) B - B f(A) = f'(A) = 0$.
Then $f^((k))$ is an annihilating polynomial of $A$ for all $k$. This is a contradiction since for some $k$, $f^((k)) = "const"$, and the constant is nonzero.
(2) Suppose $V$ is finite-dimensional. Then
$ I, A, A^2, ..., A^((dim V)^2) $
are linearly dependent. Thus there exists a nontrivial linear combination of them that equals $0$. This gives an annihilating polynomial of $A$, a contradiction.
]
#question($A B- B A=C$)[
Let $A,B,C$ be $n$-dimensional matrices. If $A B-B A=C$ and $A C= C A$, then $C$ is non-invertible. Furthermore, $C$ is nilpotent.
]
#proof[
We can use a clever identity $A^k B-B A^k = k C A^{k-1}$.
The proof is done by induction.
#note("Why did we think of this?")[
To prove that $C$ is nilpotent, we should increase the power of $C$ in the given conditions. This can be easily achieved by repeatedly left-multiplying $C$ and simplifying the expression.
]
Consider the linear map $Phi: X |-> X B-B X$. If $C$ is not nilpotent, i.e., $C^k != 0$ for all $k$, then each $k$ is an eigenvalue of $Phi$, which contradicts the finite-dimensional case.
#link("https://math.stackexchange.com/questions/811160/ab-ba-a-implies-a-is-singular-and-a-is-nilpotent")[$->$ StackExchange, https://math.stackexchange.com/questions/811160/ab-ba-a-implies-a-is-singular-and-a-is-nilpotent]b
]
= Linear Spaces with Metric
#definition("Orthogonal Complement")[
Let $f : V times V -> FF$ be a (anti-)symmetric non-
bilinear form. The orthogonal complement of $U$ is defined as
$ U^perp = {v in V | forall u in U, f(u,v) = 0}. $
]
$ V = U opl W or U subset W $
== Multilinear Functions
#definition[
A function $f: V times ... times V -> FF$ is called a $k$-linear function if it is linear in each of its arguments.
]
Now, to see how two vectors relate to each other, we consider bilinear functions, of which the most important are symmetric and antisymmetric bilinear functions.
#definition[
A bilinear function $f: V times V -> FF$ is called symmetric if $f(x, y) = f(y, x)$ for all $x, y in V$.
A bilinear function $f: V times V -> FF$ is called antisymmetric if $f(x, y) = -f(y, x)$ for all $x, y in V$.
Actually, bilinearty can be deduced from linearity in the first argument, and use (anti)symmetry to deduce linearity in the second argument.
]
=== Gram Matrix : Representing Bilinear Functions
Given a basis $B = {v_1, ..., v_n}$ of $V$, we can represent a bilinear function $f: V times V -> FF$ by a matrix $M$ such that $f(x, y) = x^T M y$ for all $x, y in V$. $M_(i j) = f(v_i, v_j)$.
#definition("Gram Matrix")[
The above matrix $M$ is called the Gram matrix of $f$ with respect to the basis $B$. It is denoted by $[f]_B$.
]
Now it suffice to study the properties of the matrix $M$ to understand the bilinear function $f$. For example, if $M$ is symmetric, then $f$ is symmetric.
== Euclidean Spaces and Symplectic Spaces
=== Euclidean Spaces and Inner Products
When $M$ is symmetric and positive definite, we have an inner product similar to the dot product in $RR^n$. This is called an inner product space.
#example("Inner Product of Matrices")[
When $V = M_(n times n) (RR) tilde.eq RR^(n^2)$, we define
$ f(A,B) = tr(A B^T). $
The transpose here is necessary to make the function positive definite, because we have $f(A,A) = tr(A A^T) = sum_(i=1)^n sum_(j=1)^n a_(i j)^2 >= 0$.
Given basis $B = {E_(i j) | 1 <= i, j <= n}$, the Gram matrix is $[f]_B = I_(n^2)$.
]
#example("Inner Product of Functions")[
When $V = C^0[0, 1]$, we define
$ phi(f, g) = integral_0^1 f(t) g(t) dif t. $
Given basis $B = {1, t, t^2, ...}$, the Gram matrix is $[phi]_B = (1/(i+j+1))_(i, j >= 0)$.
]
$[phi]_B = (1/(i+j+1))$ is not easy to deal with. However, by the general property of Gram matrices, we can deduce that $phi$ is symmetric and positive definite.
In Euclidean spaces, inner products give rise to geometric intuition.
#exercise[
Let $dim V = n$, $(V,f)$ is an inner product space. Show that if
$
B = (f(v_i, v_j))_(1 <= i, j <= n),
$
then $
det B !=0 <=> v_1, ..., v_n "is a basis of" V.
$
]
#proof[
If $det B != 0$, then $B$ is invertible. Let $x in V$ be such that $f(x, v_i) = 0$ for all $i$. Then $x^T B = 0$, so $x = 0$. Assume $v_1, ..., v_n$ are not linearly independent. Then there exists $x in V$ such that $x = sum_(i=1)^n a_i v_i$ and $a_i != 0$ for some $i$. Then $f(x, v_i) = a_i f(v_i, v_i) = 0$, so $x = 0$, a contradiction.
]
== Orthogonal Complements
#definition[
Given a subset $S$ of inner product space $V$, the orthogonal complement of $S$ is the set $ S^perp = {v in V | ip(v,s)= 0, forall s in S}. $
The orthogonal complement of $S$ is well-defined i.e. $S$ exists and is unique.
]
#theorem[
$
V = op("span") S opl S^perp.
$
]
#proofsk[
WLOG, we assume $S$ is a subspace by $S^perp = op("span") S^perp$.
If $v in S sect S^perp$, then
$
ip(v,v) = 0 => v = 0. ("by positive definiteness")
$
Besides, $dim S^perp = dim V - dim S$, so that $V = op("span") S opl S^perp$.
]
#theorem("Pythagorean Theorem")[
If $V = W_1 opl W_2$ and $W_1 perp W_2$. Then $norm(v)^2 = norm(w_1)^2 + norm(w_2)^2$ for all $v = w_1 + w_2$, $w_1 in W_1$, $w_2 in W_2$.
]
== Exercises
#question[
Prove that there are most $n+1$ vectors in $V (dim V = n)$ such that the angle between any two of them is obtuse.
]
#proof[
Assume $v_1,...,v_(n+1),v_(n+2)$ are such vectors. Then there exists $lambda_1,...,lambda_(n+1)$ which are not all zero such that $sum_(i=1)^(n+1) lambda_i v_i = 0$. Then $
lambda_1 ip(v_1, v_(n+2)) + ... + lambda_(n+1) ip(v_(n+1), v_(n+2)) = 0.
$
Obviously $lambda_i$ are not all of the same sign, so let $
u = sum_(i : lambda_i > 0) lambda_i v_i = - sum_(i : lambda_i < 0) lambda_i v_i,
$
we have
$
0 &<= ip(u,u) \
&= sum_(i : lambda_i > 0, j : lambda_j < 0) lambda_i (-lambda_j) ip(v_i, v_j) < 0,
$
a contradiction.
]
#proof("Alternative, Gram-Schmidt")[
Note a interesting property of Gram-Schmidt process:
$
w_k = v_k - sum_(i<k) ip(v_k,w_i)/ip(w_i,w_i) w_i.
$
By induction, we see $
w_k "is orthogonal to" w_i "for all" i < k, \
w_k "and " v_(k+1), ..., v_n "are obtuse to each other."
$
Because $
ip(w_k, v_(k+l)) &= underbrace(ip(v_k,v_(k+l)),<0) - underbrace(sum_(i<k) ip(v_k,w_i) ip(w_i,v_(k+l))/ip(w_i,w_i), > 0 "by IH.") \
$
so
]
== Spectral Theorem
=== The Complex Spectral Theorem
Now in the perspective of invariant subspaces, we may prove the spectral theorem in a way different from what we did on matrices (i.e. Schur $->$ diagonalization).
#proof[
Given an normal operator $A$ s.t. $A A^* = A^* A$, it suffices to show $
CC^n = opl.big_lambda ker (lambda I -A),
$
and $ker (lambda I - A)$ are orthogonal to each other. It is clear that
$
CC^n = ker (lambda I - A) opl ker (lambda I - A)^perp.
$
Now we need to show that $ker (lambda I - A)^perp$ is $A$-invariant (then we can apply induction on $A|_(ker (lambda I - A)^perp)$).
For all $v in ker (lambda I -A)^perp$, $
& A v in ker (lambda I - A)^perp \
arrow.double.l & A v perp w, forall w in ker(lambda I-A), \
arrow.double.l & 0 = ip(A v, w) = ip(v, A^* w), \
arrow.double.l & A^* w in ker ker (lambda I - A), forall w in ker(lambda I - A), \
arrow.double.l & ker(lambda I - A) "is " A- "invariant" ("by commutativity").
$
]
#example[
$A$ is Hermitian $=> A^2$ is Hermitian.
]
#question("Canonical Form of Real Normal Matrix")[
Let $A$ be a normal real matrix, then $A$ is (orthogonally) similar to $
op("diag")(a_1,...,a_k, mat(b_1,c_1;-c_1,b_1),...,mat(b_l,c_l;-c_l,b_l)).
$
Actually, the building blocks $
mat(1,0;0,1) |-> 1, mat(0,1;-1,0) |-> i.
$
]
#proof[
Merge the complex eigenspaces into $
W = ker (A^2 - 2b A + (b^2+c^2)I).
$
Try to find $v,w in W$ s.t. $A(v,w) = (v,w) mat(b,c;-c,b)$.
$
A v &= b v - c w => bold(w) = - c^(-1) (A-b I) bold(v) \
=> A w &= c v + b w. ("Note:" A^2 v = 2b A v - (b^2+c^2) v)
$
By the above restriction, find
$
1. w perp v\
2. op("span") (v,w)^perp "is" A "-invariant".
$
Then the result follows from simple induction.
]
= Review
== Multilinear Functions
#example[
Let $f_1,f_2 in V^*$, if $forall v in V, f_1(v) f_2(v) = 0$, prove that $f_1 = 0 "or" f_2 = 0$.
] <product-of-linear-functions>
#proof[
(Matrix) $
[f_1(v_1),...,f_n (v_n)] = (a_1,...,a_n),\
[f_2(v_1),...,f_n (v_n)] = (b_1,...,b_n).
$
$
(a_1,...,a_n) vec(x_1,dots.v,x_n) (b_1,...,b_n) vec(x_1,dots.v,x_n) = 0.
$
Choosing $(x_i) = e_i$, $a_i b_i = 0, forall i$.
Choosing $(x_i) = e_i + e_j$, $a_i b_i + a_j b_j = 0, forall i,j$.
If $f_1 != 0$, then WLOG there exists $i$ s.t. $a_1 != 0$, then $b_1 = 0$. Then $a_1 b_j + a_j b_1 = a_1 b_j = 0, forall j$, so $b_j = 0, forall j$.
]
#question[
If $g: V times V -> FF$ is a bilinear function s.t.
$
g(v_1,v_2) = 0 => g(v_2,v_1) = 0,
$
prove that $g$ must be symmetric or antisymmetric.
]
#example[
Let $g$ be a nonzero alternating bilinear function on $V$, then $g$ cannot be decomposed into the product of two linear functions.
$
exists.not f_1,f_2, g(alpha,beta) = f_1(alpha) f_2(beta)
$
]
#proof[
Proof by contradiction. Assume $g(alpha,beta) = f_1(alpha) f_2(beta)$.
$
g(alpha,beta) &= f_1(alpha) f_2(beta) = - f_1(beta) f_2(alpha).
$
Let $beta = alpha$, By @product-of-linear-functions, we have $f_1 = 0 "or" f_2 = 0$, a contradiction since $g$ is not identically zero.
]
#theorem("Algebraic Problem, Geometric Approach")[
A real symmetric matrix $A$ of order $n$ is orthogonally similar to a matrix whose diagonal entries are zero
$
<=> tr A = 0.
$
]
#note[
$
g(v_i+v_j, v_i+v_j) = g(v_i, v_i) + g(v_j, v_j) + 2 g(v_i, v_j).
$
So studying the properties of the induced quadratic form $q(v) = g(v,v)$ gives us information about the bilinear function $g$.
]
#proofsk[
$=>$ is trivial. Now assume $tr A = 0$.
Discuss the problem on $V slash RR$. $g$ is a symmetric bilinear function, so it induces a quadratic form $q(v) = g(v,v)$.
Choose a basis, $q(v) = f(X) = X^T A X$ where $v = (bold(v)_1,...,bold(v)_n)^(-1) X$.
The change of variable $X = P Y$ gives $f(X) = Y^T P^T A P Y$.
Induction on the dimension of the space.
If $$
]
#theorem[
#definition("Zero Cone of a Quadratic Form")[
The zero cone of a quadratic form $q$ is the set $S = {v in V | q(v) = 0}$.
]
$S$ is a subspace of $V$ $<=>$ $q$ is p.s.d. or n.s.d.
]
#proofsk[
$
S &= {v in V | q(v) = 0 } \
&= {X in RR^n | X^T A X = 0} \
&=^(X=P Y) {Y in RR^n | y_1^2 + ... + y_p^2 - y_(p+1)^2 - ... - y_r^2 = 0} \
$
If $q$ is not definite, then there exists $n$ linearly independent vectors in $S$, so $S = V$, a contradiction.
$
mat(
1,0,...,0\,,1,0,...,0\,,0,...,0;
0,1,...,0\,,1,0,...,0\,,0,...,0;
dots.v,dots.v,dots.down, dots.v,dots.v,dots.v, dots.down,dots.v,dots.v,dots.down,dots.v;
0,0,...,1\,,1,0,...,0\,,0,...,0;
-1,0,...,0\,,1,0,...,0\,,0,...,0;
-1,0,...,0\,,0,1,...,0\,,0,...,0;
dots.v,dots.v,dots.down, dots.v,dots.v,dots.v, dots.down,dots.v,dots.v,dots.down,dots.v;
-1,0,...,0\,,0,0,...,1\,,0,...,0;
0,0,...,0\,,0,0,...,0\,,1,...,0;
dots.v,dots.v,dots.down, dots.v,dots.v,dots.v, dots.down,dots.v,dots.v,dots.down,dots.v;
0,0,...,0\,,0,0,...,0\,,0,...,1;
)
$
Every row is a vector in $S$.
If $q$ is p.s.d., then there exists a basis $eta$ s.t $S = angle.l eta_(p+1),...,eta_n angle.r$. If $q$ is n.s.d., the same argument applies.
]
#question[
$A^H = A$ is p.d. then $det A <= a_(11) a_(22) ... a_(n n)$.
]
#proof[
By induction.
$
A = mat(A_1,alpha;alpha^T,a_(n n)) -> mat(A_1,0;0,a_(n n) - 2alpha^T A_1^(-1) alpha).
$
$
det A = det(A_1) underbrace((a_(n n) - 2alpha^T A_1^(-1) alpha), >0) <= det A_1 a_(n n).
$
"$=$" holds iff $alpha = 0$ (by p.d. of $A_1^(-1)$), i.e. $A$ is diagonal.
]
= Miscellaneous
#proof[
#let mA = math.bold($A$)
#let mB = math.bold($B$)
考虑$n$阶分块对称矩阵 $ mat(bold(0),mA;mA^T,mB), mB^T = mB. $
先设 $mB$ 可逆. 做分块矩阵的初等行变换,不改变行列式是否为$0$的性质.
$ mat(bold(0),mA;mA^T,mB) -> mat(-mA^T mB^(-1) mA, bold(0); mA^T,mB). $
则行列式
$ det mat(-mA^T mB^(-1) mA, bold(0); mA^T,mB) = abs(mB) dot abs(mA^T mB^(-1) mA). $
下面讨论 $mB$ 是 $k (k<n/2)$ 阶矩阵的情况. 此时 $mB^(-1) mA$ 是 $k times (n-k)$ 阶矩阵,且$k<n/2 => k < n-k$. 因此由Cauchy-Binet公式的直接推论, $abs(mA^T mB^(-1) mA) = 0$.
故在 $k<n/2$ 时我们可以断定 $det mat(bold(0),mA;mA^T,mB) = 0$.
若 $mB$ 并不可逆,考虑存在 $epsilon > 0$,微扰 $forall 0<t<epsilon, mB' = mB + t I$ 可逆. 由于 $det mat(bold(0),mA;mA^T,mB + t I)$ 是 $t$ 的多项式,故 $det mat(bold(0),mA;mA^T,mB) = lim_(t->0^+) det mat(bold(0),mA;mA^T,mB + t I) = 0$.
]
|
|
https://github.com/metamuffin/typst | https://raw.githubusercontent.com/metamuffin/typst/main/tests/typ/text/deco.typ | typst | Apache License 2.0 | // Test text decorations.
---
#let red = rgb("fc0030")
// Basic strikethrough.
#strike[Statements dreamt up by the utterly deranged.]
// Move underline down.
#underline(offset: 5pt)[Further below.]
// Different color.
#underline(stroke: red, evade: false)[Critical information is conveyed here.]
// Inherits font color.
#text(fill: red, underline[Change with the wind.])
// Both over- and underline.
#overline(underline[Running amongst the wolves.])
---
#let redact = strike.with(stroke: 10pt, extent: 0.05em)
#let highlight = strike.with(stroke: 10pt + rgb("abcdef88"), extent: 0.05em)
// Abuse thickness and transparency for redacting and highlighting stuff.
Sometimes, we work #redact[in secret].
There might be #highlight[redacted] things.
underline()
---
// Test stroke folding.
#set underline(stroke: 2pt, offset: 2pt)
#underline(text(red, [DANGER!]))
|
https://github.com/sora0116/unix_seminar | https://raw.githubusercontent.com/sora0116/unix_seminar/master/handout/lldb/main-legacy.typ | typst | #import "@preview/big-todo:0.2.0": *
#set text(font: "<NAME>")
#set heading(numbering: "1.1")
#set page(numbering: "1")
#show raw: it => {
if (it.lang == "shell") {
block(fill: rgb("#1d2433"), width: 100%, inset: 10pt, radius: 10pt)[
#text(fill: rgb("#f6f6f6"))[#it]
]
} else {
it
}
}
#let ops(cons) = [
`options`に指定できるオプションは以下の通りです:
#let t = cons.flatten()
#table(
columns: (1fr, 1fr),
align: (x,y) => if y==0 {center} else {left},
[option name], [description],
..t
)
]
#let ops3(cons) = [
`options`に指定できるオプションは以下の通りです:
#let t = cons.flatten()
#table(
columns: (1fr, 1fr, 1fr),
align: (x,y) => if y==0 {center} else {left},
[option name], [description], [],
..t
)
]
#let op_line = (`-l, --line <linenum>`, [行数を指定])
#let op_file = (`-f, --file <filename>`, [ファイル名を指定])
#let op_dummy-breakpoints = (`-D, --dummy-breakpoints`, [ダミーブレークポイントを指定])
#let op_one-liner = (`-o, --one-liner <cmd>`, [停止時に実行するコマンドを設定])
#let op_python-function = ([`-F, --python-function <func>`], [停止時に実行するPythonの関数を設定])
#let op_script-type = (`-s, --script-type <none>`, [コマンドの言語を指定。`command, python, lua, default-script`が指定可能])
#let op_stop-on-error = (`-e, --stop-on-error <bool>`, [コマンド実行時エラーで停止するかの設定])
#let op_structured-data-key = (`-k, --structured-data-key <none>`, [The key for a key/value pair passed to the implementation of a breakpoint command. Pairs can be specified more than once.])
#let op_structured-data-value = (`-v, --structured-data-value <none>`, [The value for the previous key in the pair passed to the implementation of a breakpoint command. Pairs can be specified more than once.])
#let op_ignore-count = (`-i, --ignore-count <count>`, [ignore-counterを設定します])
#let op_disabled = (`-d, --disabled`,[現在無効な(リストで指定した以外の)すべてを指定])
#let op_force = (`-f, --force`,[警告なしですべて指定])
#let op_brief = (`-b, --brief`,[情報を短く表示])
#let op_full = (`-f, --full`,[すべての情報を表示])
#let op_internal = (`-i, --internal`,[デバッガの内部ブレークポイントも表示])
#let op_verbose = (`-v, --verbose`,[わかることすべてを表示])
#let gram(cmd) = [
文法:
#raw(" (lldb) " + cmd, block: true, lang: "shell")
]
= LLDB
== コマンド構文
GDBの自由な形式のコマンドとは異なり、LLDBは構造化されたコマンドを持ちます。すべてのLLDBコマンドは以下の形をしています。
```shell
<noun> <verb> [-<options> [<option-value>]] [<argument> [<argument>...]]
```
- `argument`, `options`, `option-value`は全てホワイトスペースで区切られます。
- スペースを含む引数はシングルまたはダブルクォートで囲むことで保護できます。
- 引数内の"及び\\は\\でエスケープできます。
- バッククォートで囲んだ文字列は式として解釈され値に置き換わります。
- `--`を使用してそれ以前の引数のみをオプションとして明示できます。
- TABによる補完が可能です。
- `help`コマンドがあります。
- `apropos`もあります。
- エイリアスもあります。
```shell
(lldb) command alias bfl breakpoint set -f %1 -l %2
```
- 規定のエイリアスもあります。網羅的ではないです。
- `~/.ldinit`にエイリアスを書けば一般に使用できる。helpにも反映される。
- GDBコマンドのエイリアスも結構ある。
- `unalias`もできる。
- `script`でPythonインタプリタにアクセスできる。
== プログラムをLLDBに読み込む
先ず、デバッグするプログラムを指定します。LLDB起動時に、コマンドラインでデバッグするプログラムを指定できます。
```shell
$ lldb <program>
```
若しくはLLDB起動後に`file`コマンドで指定します。
```shell
(lldb) file <program>
```
== ブレークポイントを管理する
`help breakpoint [<subcommand>]`でブレークポイント関連のコマンドのヘルプを閲覧できます。
=== clear
指定したファイル、行数にあるブレークポイントを削除または無効化します。
#gram("breakpoint clear <options>")
#ops((op_line, op_file))
=== command
停止時のコマンドを設定します。
#gram("breakpoint command <subcommand> [<subcommand-options>] <breakpt-id>")
`subcommand`には`add, delete, list`が指定できます。
==== add
コマンドを追加します。
#gram("breakpoint command add <options> [<breakpoint-id>]")
#ops((
op_dummy-breakpoints,
op_one-liner,
op_python-function,
op_script-type,
op_stop-on-error,
op_structured-data-key,
op_structured-data-value,
))
==== delete
コマンドを削除します。
#gram("breakpoint delete <options> [<breakpoint-id-list>]")
#ops((
op_dummy-breakpoints,
op_disabled,
op_force
))
==== list
設定されているブレークポイントを表示します。
#gram("breakpoint list <options> [<breakpoint-id>]")
#ops3((
op_dummy-breakpoints, [],
op_brief,
table.cell(rowspan: 4)[`bi`, `fi`, `iv`の組み合わせのみ可],
op_full,
op_internal,
op_verbose,
))
=== delete
ブレークポイントを削除します。
#gram("breakpoint delete <options> [<breakpoint-id-list>]")
#ops3((
op_dummy-breakpoints,
table.cell(rowspan: 3)[短縮して指定可能`-Ddf`],
op_disabled,
op_force,
))
=== disable
ブレークポイントを無効化します。
#gram("breakpoint disable [<breakpoint-id-list>]")
=== enable
ブレークポイントを有効化します。
#gram("breakpoint enable [<breakpoint-id-list>]")
=== list
設定されているブレークポイントを表示します。
文法:
```shell
(lldb) breakpoint list [<options>] [<breakpoint-id>]
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr, .3fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],[],
[`-D, --dummy-breakpoints`],[ダミーブレークポイントを表示],[],
[`-b, --brief`],[ブレークポイントの情報を短く表示],
table.cell(rowspan: 4)[`bi`, `fi`, `iv`の組み合わせのみ可],
[`-f, --full`],[ブレークポイントのすべての情報を表示],
[`-i, --internal`],[デバッガの内部ブレークポイントも表示],
[`-v, --verbose`],[ブレークポイントについてわかることすべてを表示],
)
=== modify
設定されているブレークポイントの内容を変更します。
文法:
```shell
(lldb) breakpoint modify [<options>] [<breakpoint-id-list>]
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr, .3fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],[],
[`-D, --dummy-breakpoints`], [ダミーブレークポイント],
table.cell(rowspan: 3)[まとめて`-De`のように指定可能],
[`-d, --disable`], [ブレークポイントを無効化],
[`-e, --enable`],[ブレークポイントを有効化],
[`-G --auto-continue <bool>`], [コマンド実行後自動で再開],
table.cell(rowspan: 8)[],
[`-c, --condition <cond>`], [条件式`cond`を満たすときだけ停止],
[`-i, --ignore-count <n>`], [ブレークポイントを無視する回数],
[`-o, --one-shot <bool>`], [一度停止したら削除],
[`-q, --queue-name <name>`], [指定したキューに入っているスレッドのみ停止],
[`-t, --thread-id <tid>`], [指定したスレッドのみ停止],
[`-x, --thread-index <tidx>`], [指定したインデクスのスレッドのみ停止],
[`-T, --thread-name <name>`], [指定したスレッドのみ停止],
)
=== name
ブレークポイントの名前を管理します。
文法:
```shell
(lldb) breakpoint name <subcommand> [<options>]
```
`subcommand`には`add, configure, delete, list`が指定できます。
==== add
名前を追加します。
文法:
```shell
(lldb) breakpoint name add <options> <breakpoint-id-list>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => if y==0 {center} else {left},
[option name], [description],
[`-N, --name <breakpoint-name>`], [追加する名前],
)
==== configure
名前のあるブレークポイントを編集します。ブレークポイントIDを指定した場合、オプションをコピーします。それ以外ではそのまま編集されます。
文法:
```shell
(lldb) breakpoint name configure [<options>] [<breakpoint-name-list>]
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => if y==0 {center} else {left},
[option name], [description],
[`-d, --disable`], [無効化されたブレークポイントを設置],
[`-e, --enable`],[ブレークポイントを有効化],
[`-G --auto-continue <bool>`], [コマンド実行後自動で再開],
[`-C, --command <cmd>`], [停止時に自動実行するコマンド],
[`-c, --condition <cond>`], [条件式`cond`を満たすときだけ停止],
[`-i, --ignore-count <n>`], [ブレークポイントを無視する回数],
[`-o, --one-shot <bool>`], [一度停止したら削除],
[`-q, --queue-name <name>`], [指定したキューに入っているスレッドのみ停止],
[`-t, --thread-id <tid>`], [指定したスレッドのみ停止],
[`-x, --thread-index <tidx>`], [指定したインデクスのスレッドのみ停止],
[`-T, --thread-name <name>`], [指定したスレッドのみ停止],
[`-D, --allow-delete <bool>`], [名前で削除、すべて削除を許可],
[`-A, --allow-disable <bool>`], [名前で無効化、すべて無効化を許可],
[`-L, --allow-list <bool>`], [明示的に指定されないリストを許可],
[`-B, --breakpoint-id <breakpoint-id>`], [ブレークポイントIDを指定],
[`-H, --help-string <none>`], [名前の目的の説明を設定],
)
==== delete
名前を削除します。
文法:
```shell
(lldb) breakpoint name delete <options> <breakpoint-id-list>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => if y==0 {center} else {left},
[option name], [description],
[`-N --name <name>`], [削除する名前を指定],
)
==== list
名前を表示します。
文法:
```shell
(lldb) breakpoint name list <options>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => if y==0 {center} else {left},
[option name], [description],
[`-D, --dummy-breakpoints`], [ダミーブレークポイントを表示],
)
=== read
以前に`write`で保存したブレークポイントを読み込みます。
文法:
```shell
(lldb) breakpoint read <options>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],
[`-f, --file <filename>`], [読み込むファイルを指定],
[`-N, --breakpoint-name <name>`], [指定した名前のブレークポイントのみ読み込む],
)
=== set
プログラムにブレークポイントを設置します。
文法:
```shell
(lldb) breakpoint set <options>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr, .3fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],[],
[`-A, --all-files`], [全てのファイルを検索],
table.cell(rowspan: 4)[フラグ。\ まとめて`-ADHd`のように指定可能],
[`-D, --dummy-breakpoints`], [ダミーのブレークポイントを設置],
[`-H, --hardware`], [ハードウェアブレークポイントを使用],
[`-d, --disable`], [無効化されたブレークポイントを設置],
[`-l, --line <linenum>`], [行番号`linenum`を指定],
table.cell(rowspan: 11)[場所指定。併用不可],
[`-a, --address <addr>`], [アドレス`addr`を指定],
[`-n, --name <func>`], [関数名`func`を指定],
[`-F, --fullname <name>`], [関数の完全修飾名を指定],
[`-S, --selector <selector>`], [Objective-Cのセレクタ名を指定],
[`-M, --method <method>`], [C++のメソッド名を指定],
[`-r, --func-regex <reg>`], [正規表現`reg`にマッチする関数名を持つ関数を指定],
[`-b, --basename <func>`], [関数の基本名が`func`の関数を指定(C++の名前空間や引数を無視)],
[`-p, --source-pattern-regex <reg>`], [指定したファイル内のソースコードで正規表現にマッチする箇所を指定],
[`-E, --language-exceprion <lang>`], [指定した言語の例外スローを指定],
[`-y, --joint-specifier <linespec>`], [`filename:line[:column]`の形式でファイルと行を指定],
[`-k, --structured-data-key <none>`], [スクリプトによるブレークポイントの実装に渡されるキーと値のペアのキー。 ペアは複数指定できます。],
table.cell(rowspan: 18)[その他のオプション。\ 併用できないものもある],
[`-v, --structured-data-value <none>`], [スクリプトによるブレークポイントの実装に渡されるキーと値のペアの値。 ペアは複数指定できます。],
[`-G --auto-continue <bool>`], [コマンド実行後自動で再開],
[`-C, --command <cmd>`], [停止時に自動実行するコマンド],
[`-c, --condition <cond>`], [条件式`cond`を満たすときだけ停止],
[`-i, --ignore-count <n>`], [ブレークポイントを無視する回数],
[`-o, --one-shot <bool>`], [一度停止したら削除],
[`-q, --queue-name <name>`], [指定したキューに入っているスレッドのみ停止],
[`-t, --thread-id <tid>`], [指定したスレッドのみ停止],
[`-x, --thread-index <tidx>`], [指定したインデクスのスレッドのみ停止],
[`-T, --thread-name <name>`], [指定したスレッドのみ停止],
[`-R, --address-slide <addr>`], [指定されたオフセットを、ブレークポイントが解決するアドレスに追加します。現在のところ、これは指定されたオフセットをそのまま適用し、命令境界に整列させようとはしません。],
[`-N, --breakpoint-name <name>`], [ブレークポイントの名前],
[`-u, --column <col>`], [列を指定],
[`-f, --file <filename>`], [検索するファイルを指定],
[`-m, --move-to-nearest-code <bool>`], [一番近いコードへブレークポイントを移動],
[`-s, --shlib <name>`], [共有ライブラリを指定],
[`-K, --skip-prologue <bool>`], [プロローグをスキップ],
)
=== write
ブレークポイントをファイルに保存します。`read`で読み込めます。ブレークポイントを指定しなければ全て保存されます。
文法:
```shell
(lldb) breakpoint write <options> [<breakpoint-id-list>]
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],
[`-a, --append`], [ファイルが既存ならば追加],
[`-f, --file <filename>`], [保存先のファイル名],
)
== ウォッチポイントを管理する
`help watchpoint [<subcommand>]`でウォッチポイント関連のコマンドのヘルプを閲覧できます。
=== command
ウォッチポイントにヒットしたときに実行するコマンドを管理します。
文法:
```shell
(lldb) watchpoint command <subcommand> [<options>]
```
`subcommand`には`add, delete, list`が指定できます。
==== add
コマンドを追加します。
文法:
```shell
(lldb) watchpoint command add [<options>] <watchpoint-id>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => if y==0 {center} else {left},
[option name], [description],
[`-o, --one-liner <cmd>`], [停止時に実行するコマンドを設定],
[`-F, --python-function <func>`], [停止時に実行するPythonの関数を設定],
[`-s, --script-type <none>`], [コマンドの言語を指定。`command, python, lua, default-script`が指定可能],
[`-e, --stop-on-error <bool>`], [コマンド実行時エラーで停止するかの設定],
)
==== delete
コマンドを削除します。
文法:
```shell
(lldb) watchpoint command delete <watchpoint-id>
```
==== list
コマンドを表示します。
文法:
```shell
(lldb) watchpoint command list <watchpoint-id>
```
=== delete
ウォッチポイントを削除します。
文法:
```shell
(lldb) watchpoint delete [<options>] [<watchpoint-id-list>]
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],
[`-f, --force`], [確認なしで削除],
)
=== disable
ウォッチポイントを無効化します。
文法:
```shell
(lldb) watchpoint disable [<watchpoint-id-list>]
```
=== enable
ウォッチポイントを有効化します。
文法:
```shell
(lldb) watchpoint enable [<watchpoint-id-list>]
```
=== ignore
イグノアカウンタを設定します。
文法:
```shell
(lldb) watchpoint ignore <options> <watchpoint-id-list>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],
[`-i, --ignore-count`], [ウォッチポイントを無視する回数],
)
=== list
設定されたウォッチポイントを表示します。
文法:
```shell
(lldb) watchpoint list [<options>] [<watchpoint-id-list>]
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr, .3fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],[],
[`-b, --brief`], [短い説明を表示],
table.cell(rowspan: 3)[オプションは併用不可],
[`-f, --full`], [完全な説明を表示],
[`-v, --verbose`], [全てを表示],
)
=== modify
ウォッチポイントを変更します。
文法:
```shell
(lldb) watchpoint modify [<options>] [<watchpoint-id-list>]
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],
[`-c, --condition <cond>`], [条件を満たすときだけ停止],
)
=== set
ウォッチポイントを設定します。
文法:
```shell
(lldb) watchpoint set <subcommand> [<options>]
```
`subcommand`には`expression, variable`が設定できます。
==== expression
式の結果が指すアドレスにウォッチポイントを設定します。
文法:
```shell
(lldb) watchpoint set expression [<options>] -- <expr>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],
[`-w, --watch <type>`], [ウォッチのタイプを指定。`read, write, read_write`が指定可能],
[`-s, --size <size>`], [監視するバイト数],
)
==== variable
変数にウォッチポイントを設定します。
文法:
```shell
(lldb) watchpoint set variable [<options>] -- <varname>
```
`options`に指定できるオプションは以下の通りです:
#table(columns: (1fr, 1fr),
align: (x, y) => {if y == 0 {center} else {left}},
[option name], [description],
[`-w, --watch <type>`], [ウォッチのタイプを指定。`read, write, read_write`が指定可能],
[`-s, --size <size>`], [監視するバイト数],
)
== プロセスを制御する
LLDBでプロセスを制御するには`process`コマンドを使用します。
#gram("process <subcommand> [<options>]")
`subcommand`には`attach, connect, continue, detach, handle, interrupt, kill, launch, load, plugin, save-core, signal, status, trace, unload`が指定できます。
=== attach
プロセスにLLDBをアタッチします。
#gram("process attach <options>")
#let op_continue = (`-c, --continue`, [アタッチ後に停止せずに継続])
#let op_include-existing = (`-i, --include-existing`, [`-w`指定時に、すでに存在するプロセスを含む])
#let op_waitfor = (`-w, --waitfor`, [`-n`で指定した名前のプロセスが起動するまで待つ])
#let op_pid = (`-p, --pid`, [プロセスIDを指定])
#let op_name = (`-n, --name`, [名前を指定してアタッチ])
#let op_plugin = (`-P, --plugin <plugin>`, [プロセスプラグインを指定])
#ops((
op_continue,
op_include-existing,
op_waitfor,
op_pid,
op_name,
op_plugin,
))
=== connect
リモートデバッグサービスに接続します。#todo("確認")
#gram("process connect <remote-url>")
=== continue
現在のプロセスのすべてのスレッドを継続実行します。
#gram("process continue <options>")
#ops(op_ignore-count)
=== detach
プロセスからデタッチします。
#gram("process detach <options>")
#ops((
(`-s, --keep-stopped <bool>`, [])
))
=== handle
シグナルのLLDBでの扱いを設定します。
#gram("process handle <options> [<signal>...]")
#ops((
(`-n, --notify <bool>`, [デバッガがシグナル受信をユーザに知らせるか]),
(`-p, --pass <bool>`, [シグナルをプロセスに渡すか]),
(`-s, --stop <bool>`, [シグナル受信時にプロセスを停止するか])
))
`signal`を指定しない場合、すべてのシグナルに対して設定されます。
=== interrupt
現在のターゲットプロセスに割り込みを行います。
#gram("process interrupt")
=== kill
現在のターゲットプロセスをkillします。
#gram("process kill")
=== launch
プログラムを起動します。
#gram("process launch <options> [<args>]")
#ops((
(`-s, --stop-at-entry`, [エントリポイントで停止]),
(`-t, --tty <none>`, [プロセスを開始するターミナル]),
(`-n, --no-stdio`, [標準出力を行わない]),
(`-a, --arch <arch>`, [曖昧なときにアーキテクチャを指定]),
(`-A, --disable-aslr <bool>`, [アドレス空間のランダム化を行うか]),
(`-E, --environment <none>`, [環境変数を`NAME=VALUE`の形で設定]),
(`-P, --plugin <plugin>`, [プロセスプラグイン名]),
(`-c, --shell <filename>`, [プロセスを走らせるシェル]),
(`-e, --stderr <filename>`, [標準エラー出力]),
(`-X, --shell-expand-args <bool>`, [プロセス起動時にシェルが引数を拡張するか]),
(`-i, --stdin <filename>`, [標準入力]),
(`-o, --stdout <filename>`, [標準出力]),
(`-w, --working-dir <dir>`, [プロセスのワーキングディレクトリ]),
(`-C, --script-class <python-class>`, [scripted classの管理クラス名]),
(`-k, --structured-data-key <none>`, [The key for a key/value pair passed to the implementation of a scripted process. Pairs can be specified more than once.]),
(`-v, --structured-data-value <none>`, [The value for the previous key in the pair passed to the implementation of a scripted process. Pairs can be specified more than once.]),
))
=== load
現在のプロセスに共有ライブラリをロードします。
#gram("process load <options> <filename>...")
#ops(((`-i <path>, --install=<path>`, [ターゲットに共有ライブラリをインストール])))
=== plugin
現在のターゲットプロセスプラグインにコマンドを渡します。
#gram("process plugin <args>")
=== save-core
現在のプロセス状態をコアファイルに保存します。
#gram("process save-core <options> <filename>")
#ops((
(`-p <plugin>, --plugin-name=<plugin>`, [コアファイルを生成するためのプラグイン]),
(`-s, --style <corefile-style>`, [コアファイルの保存形式。`full, modified-memory, stack`が指定可能])
))
=== signal
UNIXのシグナルをプロセスに送信します。
#gram("process signal <signal>")
=== status
プロセスのステータスと停止位置を表示します。
#gram("process status <options>")
#ops((`-v, --verbose`, [拡張情報を含むすべてのプロセスステータスを表示]))
=== trace
プロセスをトレースします。
#gram("process trace <subcommand> [<options>]")
`subcommand`には`save, start, stop`が指定できます。
=== save
現在のプロセスのトレースを保存します。
#gram("process trace save [<options>]")
#ops((`-d, --directory <dir>`, [保存場所]))
=== start
トレースを開始します。
#gram("process trace start <options>")
=== stop
トレースを終了します。
#gram("process trace stop")
=== unload
現在のプロセスから共有ライブラリをアンロードします。
#gram("process unload <index>")
== スレッドを制御する
スレッドを制御するには`thread`コマンドを使用します。
#gram("thread <subcommand> [<options>]")
`subcommand`には`backtrace, continue, exception, info, jump, list, plan, return, select, siginfo, step-in, step-inst, step-inst-over, step-out, step-over, step-scripted, trace, until`が指定できます。
=== backtrace
スレッドのコールスタックを表示します。
#gram("thread backtrace <options>")
#ops((
(`-c, --count <count>`, [表示するフレームの数。-1は全て]),
(`-e, --extended <bool>`, [拡張バックトレース]),
(`-s, --start <frame-index>`, [バックトレースの開始フレーム]),
))
=== continue
プロセスを継続実行します。スレッドを指定しない場合全てのスレッドが対象になります。
#gram("thread continue <thread-index>...")
=== exception
現在の例外オブジェクトを表示します。
#gram("thread exception")
=== info
一つ以上のスレッドの概要情報を表示します。スレッドを指定しない場合、現在のスレッドが対象です。
#gram("thread info <options>")
#ops((
(`-j, --json`, [JSON形式で表示]),
(`-s, --stop-info`, [JSON形式で停止情報を表示])
))
=== jump
プログラムカウンタを変更します。
#gram("thread jump <options>")
#ops((
(`-a, --address <expr>`, [ジャンプ先のアドレス]),
(`-b, --by <offset>`, [ジャンプ先のオフセット]),
(`-f, --file <filename>`, [ジャンプするファイル]),
(`-l, --line <linenum>`, [ジャンプするソース行番号]),
(`-r, --force`, [プログラムカウンタが関数の外に出ることを許可]),
))
=== list
各スレッドについての概要を表示します。`setting set thread-format`で表示をカスタマイズできます。
#gram("thread list")
=== plan
スレッドの実行計画を管理するコマンドです。
#gram("thread plan <subcommand> [<options>]")
`subcommand`には`discard, list, prune`が指定できます。
==== discard
スレッド計画を廃棄します。
#gram("thread plan discard <index>")
==== list
スレッド計画を表示します。
#gram("thread plan list <options>")
#ops((
(`-i, --internal`, [内部スレッド計画も表示]),
(`-t, --thread-id`, [スレッドIDを指定]),
(`-u, --unreported`, [unreportedなスレッドを指定]),
(`-v, --verbose`, [より多くの情報を表示])
))
==== prune
現在のunreportedなスレッドのすべての計画を削除します。
#gram("thread plan prune <thread-id>...")
=== return
選択中のスタックフレームから返ります。
#gram("thread return <options>")
#todo("")
#ops((
(`-x, --from-expression`, [一番内側から式の値で返る]),
))
=== select
選択中のスレッドを変更します。
#gram("thread select <index>")
=== siginfo
現在のsiginfoオブジェクトを表示します。
#gram("thread siginfo")
=== step-in<step-in>
ソースコード上のステップを行います。関数呼び出しの場合には関数の中に入ります。スレッドを指定しない限り現在のスレッドにのみ適用されます。
#gram("thread step-in [<options>] [<thread-id>]")
#ops((
(`-A, --step-out-avoids-no-debug <bool>`, [ステップアウト時にデバッグ情報のある関数に当たるまでステップアウトを続ける]),
(`-a, --step-in-avoids-no-debug <bool>`, [デバッグ情報のない関数にステップインせずにステップオーバーする]),
(`-c, --count <count>`, [ステップ回数]),
(`-e, --end-linenumber <linenum>`, [ステップを停止する行番号]),
(`-m, --run-mode <mode>`, [他スレッドの処理方法。`this-thread, all-threads, while-stepping`が指定可能]),
(`-r, --step-over-regexp <regex>`, [正規表現にマッチする関数をスキップ]),
(`-t, --step-in-target <func-name>`, [直接呼び出された関数のステップイン時に停止する関数名]),
))
=== step-inst
命令上のステップを行います。callは中に入ります。
#gram("thread step-inst [<options>] [<thread-id>]")
`options`に指定できるオプションは @step-in と同じです。
=== step-inst-over
命令上のステップを行います。callはステップオーバーします。
#gram("thread step-inst-over [<options>] [<thread-id>]")
`options`に指定できるオプションは @step-in と同じです。
=== step-out
現在のスタックフレームを抜けるまで実行し、停止します。
#gram("thread step-out [<options>] [<thread-id>]")
`options`に指定できるオプションは @step-in と同じです。
=== step-over
ソースコード上のステップを行います。関数呼び出しはステップオーバーします。
#gram("thread step-over [<options>] [<thread-id>]")
`options`に指定できるオプションは @step-in と同じです。
=== step-scripted
Step as instructed by the script class passed in the -C option. You can also specify a dictionary of key (-k) and value (-v) pairs that will be used to populate an SBStructuredData Dictionary, which will be passed to the constructor of the class implementing the scripted step. See the Python Reference for more details.
#gram("thread step-scripted [<options>] [<thread-id>]")
`options`には @step-in で指定できるものに加えて以下が指定可能です。
#ops((
(`-k, --structured-data-key`, [The key for a key/value pair passed to the implementation of a scripted step. Pairs can be specified more than once.]),
(`-v, --structured-data-value`, [The value for the previous key in the pair passed to the implementation of a scripted step. Pairs can be specified more than once.]),
))
=== trace
トレース関連のコマンドです。
#gram("thread trace <subcommand> [<options>]")
`subcommand`には`dump, export, start, stop`が指定可能です。
==== dump
トレース情報を表示します。
#gram("thread trace subcommand [<options>]")
`subcommand`には`info, instructions`が指定できます。
===== info
トレースされた情報をダンプします。
#gram("thread trace info [<options>]")
#ops(((`-v, --verbose`, [冗長なダンプ])))
===== instructions
トレースされた命令をダンプします。
#gram("thread trace instructions [<options>]")
#ops((
(`-c, --count <count>`, [表示する命令の数]),
(`-f, --forwards`, [一番古い地点から表示]),
(`-r, --raw`, [シンボル情報なし]),
(`-s, --skip <index>`, [スキップする命令数]),
(`-t, --tsc`, [可能なら命令ごとにタイムスタンプを表示]),
))
==== export
トレースをエクスポートします。
#gram("thread trace export <plugin> [<options>]")
==== start
トレースを開始します。
#gram("thread trace start [<options>]")
==== stop
トレースを終了します。
#gram("thread trace stop [<thread-index>...]")
=== until
指定した箇所まで実行します。
#gram("thread until <options> <linenum>")
#ops((
(`-a, --address <expr>`, [このアドレスに到達するか関数を抜けるまで実行]),
(`-f, --frane <index>`, [対象のフレーム。デフォルトは0]),
(`-m, --run-mode <mode>`, [実行モード。`this-thread, all-threads`]),
(`-t, --thread <index>`, [対象のスレッド]),
))
== フレームを制御する
フレームを制御するには`frame`コマンドを使用します。
#gram("frame <subcommand> [<options>]")
`subcommand`には``が指定できます。
=== diagnose
現在の停止位置がどのようなパスでレジスタやアドレスに到達したかを判断しようとします。
#gram("frame diagnose [<options>] [<frame-index>]")
#ops((
(`-a, --address <addr>`, [アドレス]),
(`-o, --offset <offset>`, [オフセット]),
(`-r, --register <name>`, [レジスタ]),
))
=== info
現在のフレームの情報を表示します。
#gram("frame info")
=== select
スタックフレームからフレームを選択します。
#gram("frame select [<options>] [<frame-index>]")
#ops((`-r, --relative <offset>`, [現在のフレームからのオフセットで指定]))
=== variable
現在のスタックフレームに存在する変数を表示します。
#gram("frame variable <options> [<varname>...]")
#ops((
(`-A, --show-all-children`, [上限を無視して子を表示]),
(`-D, --depth <count>`, [表示する最大深さ]),
(`-F, --flat`, [フラットフォーマットで表示]),
(`-G, --gdb-format`, [GDBフォーマットで表示]),
(`-L, --locationn`, [位置情報を表示]),
(`-O, --object-description`, [言語ごとの説明APIを使用して表示]),
(`-P, --ptr-depth <count>`, [値をダンプする際のポインタの深さ]),
(`-R, --raw-output`, [フォーマットを行わない]),
(`-S, --synthetic-type <bool>`, [synthetic providerに従うかを表示]),
(`-T, --show-types`, [型を表示]),
(`-V, --validate <bool>`, [型チェックの結果を表示]),
(`-Y [<count>], --no-summary-depth=[<count>]`, [概要情報を省略する深さ]),
(`-Z, --element-count <count>`, [型が配列あるかのように表示]),
(`-a, --no-args`, [関数の引数を省略]),
(`-c, --show-declaration`, [変数の宣言情報を表示]),
(`-d, --dynamic-type <none>`, [オブジェクトの完全な動的型を表示]),
(`-f, --format <fmt>`, [フォーマット]),
(`-g, --show-globals`, [グローバル変数を表示]),
(`-l, --no-locals`, [局所変数を省略]),
(`-r, --regex`, [変数名を正規表現として解釈]),
(`-s, --scope`, [変数のスコープを表示]),
(`-t, --no-recognized-args`, [recognized function argumentsを省略]),
(`-y, --summary <name>`, [変数の出力が使用すべきサマリーを指定]),
(`-z, --summary-string <name>`, [フォーマットに使用するサマリー文]),
))
// EOF
#outline(indent: 1em)
|
|
https://github.com/FlyinPancake/bsc-thesis | https://raw.githubusercontent.com/FlyinPancake/bsc-thesis/main/thesis/pages/titlepage.typ | typst | #import "../preamble.typ": student_name_en as student, consultant, show_today, second_consultant, external_consultant
#page[
#align(center)[
#v(3mm)
#image(
"../figures/BMElogo.png",
width: 60mm
)
*Budapest University of Technology and Economics*\
Faculty of Electrical Engineering and Informatics\
Dept. of Telecommunications and Media Informatics
#v(54mm)
#text(weight: "bold", size: 20pt)[
Performance and useability analysis of virtual clusters in Kubernetes
]
#v(5mm)
#text(size: 14pt)[
#smallcaps[BSc Thesis]
]
#v(40mm)
#grid(
columns: (7cm, 7cm),
box[
_Author_
*#student*
],
box[
_Supervisors_
#consultant\
#second_consultant\
#external_consultant
]
)
#align(bottom)[Budapest, #show_today]
]
] |
|
https://github.com/FlyinPancake/bsc-thesis | https://raw.githubusercontent.com/FlyinPancake/bsc-thesis/main/thesis/pages/project.typ | typst | #set page(margin: 0cm)
#page[
#image("../assets/project.svg")
]
|
|
https://github.com/jomaway/typst-bytefield | https://raw.githubusercontent.com/jomaway/typst-bytefield/main/docs/docs.typ | typst | MIT License | #import "@preview/tidy:0.2.0"
#import "@preview/gentle-clues:0.6.0": abstract, info
#import "@preview/codelst:2.0.0": sourcecode
#import "../bytefield.typ": *
#let tag(value, fill: orange.lighten(45%)) = {
box(
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt,
fill: fill
)[#value]
}
#let default = tag[_default_]
#let positional = tag(fill: green.lighten(60%))[_positional_]
#let named = tag(fill: blue.lighten(60%))[_named_]
#set text(font: "Rubik", weight: 300);
// only show numbers for heading level 1 and 2
#set heading(numbering: (..args) => {
let nums = args.pos()
if nums.len() < 3 { numbering("1.", ..nums)}
})
#show link: set text(blue);
#show ref: set text(blue);
#show raw.where(block: false): it => tag(fill: luma(230))[#it]
#show raw.where(block: true): it => box(width: 100%, inset: 1em, fill: luma(220))[#it]
#let user-api = tidy.show-module(
tidy.parse-module(read("../lib/api.typ"), name: "User API",),
style: tidy.styles.default,
show-outline:true,
sort-functions: none,
)
#let scope = (
"bytefield" : bytefield,
"byte" : byte,
"bytes" : bytes,
"bit" : bit,
"bits" : bits,
"flag": flag,
"note" : note,
"group" : group,
"section": section,
"bitheader": bitheader,
)
#let example(columns:1,source, showlines: none) = {
set text(0.8em);
grid(
columns:columns,
gutter: 1em,
box(align(horizon,sourcecode(showrange: showlines,source))),
box(align(horizon,eval(source.text, mode:"markup", scope: scope))),
)
}
#set page("a4", margin: 2cm)
// read package info from `typst.toml`
#let pkginfo = toml("../typst.toml").package
// title
#align(center, text(24pt, weight: 500)[bytefield manual])
#abstract[
#link("https://github.com/jomaway/typst-bytefield")[*bytefield*] is a package for creating _network protocol headers_, _memory maps_, _register definitions_ and more in typst.
Version: #pkginfo.version \
Authors: #link("https://github.com/jomaway","jomaway") + community contributions. \
License: #pkginfo.license
]
#outline(depth: 2, indent: 2em)
= Example
#block[
#show: bf-config.with(
row-height: 2em,
)
#figure(
bytefield(
msb:right, // left | right (default: right)
// Config the header
bitheader(
"bytes", // adds every multiple of 8 to the header.
0, [start], // number with label
5, // number without label
-12, [#text(14pt, fill: red, "test")], //label without number
23, [end_test],
24, [start_break],
36, [Fix], // will not be shown
marker: true, // true or false (default: auto)
angle: -50deg, // angle (default: -60deg)
text-size: 8pt, // length (default: global header_font_size or 9pt)
),
// Add data fields (bit, bits, byte, bytes) and notes
// A note always aligns on the same row as the start of the next data field.
note(left)[#text(16pt, fill: blue, font: "Consolas", "Testing")],
bytes(3,fill: red.lighten(30%))[Test],
note(right)[#set text(9pt); #sym.arrow.l This field \ breaks into 2 rows.],
bytes(2)[Break],
note(left)[#set text(9pt); and continues \ here #sym.arrow],
bits(24,fill: green.lighten(30%))[Fill],
group(right,3)[spanning 3 rows],
bytes(12)[#set text(20pt); *Multi* Row],
note(left, bracket: true)[Flags],
bits(4)[#text(8pt)[reserved]],
flag[#text(8pt)[SYN]],
flag(fill: orange.lighten(60%))[#text(8pt)[ACK]],
flag[#text(8pt)[BOB]],
bits(25, fill: purple.lighten(60%))[Padding],
// padding(fill: purple.lighten(40%))[Padding],
bytes(2)[Next],
bytes(8, fill: yellow.lighten(60%))[Multi break],
note(right)[#emoji.checkmark Finish],
bytes(2)[_End_],
),
caption: "Random example of a colored bytefield.",
supplement: "Bytefield"
)
Source and more examples can be found #link("https://github.com/jomaway/typst-bytefield/tree/main/examples")[here].
]
= Usage
Import the package from the official package manager
```typc
#import "@preview/bytefield:0.0.4": *
```
or download the package and put it inside the folder for local packages.
= Features
== Data fields
By default a bytefield shows 32 bits per row. This can be changed by using the `bpr` argument. For example `bpr:16` changes the size to 16 bits per row.
You can add fields of different size to the bytefield by using one of the following field functions.
`bit`, `bits`, `byte`, `bytes`, `flag`
- Fields can be colored with a `fill` argument.
Multirow and breaking fields are supported. This means if a field does not fit into one row it will break automatically into the next one.
== Annotations
Define annotations in columns left or right of the bitfields current row with the helpers `note` and `group`.
The needed number of columns is determined automatically,
but can be forced with the `pre` and `post` arguments.
The helper `note` takes the side it should appear on as first argument, an optional `rowspan` for the number of rows it should span
and an optional `level` for the nesting level.
The helper `group` takes the side it should appear on as first argument, as second argument `rowspan` for the number of rows it should span and an optional `level` for the nesting level.
// add in future version
// The helper `section` takes a `start_addr` and a `end_addr` as string values and displays those on the left side of a row. The `start_addr` is aligned to the top and the `end_addr` is aligned to the bottom.
#example(```typst
#bytefield(
pre: (1cm,auto),
post: (auto,1.8cm),
note(left, rowspan:3, level:1)[
#align(center,rotate(270deg)[spanning_3_rows])
],
note(left)[0x00],
group(right,2)[group],
bytes(4)[some thing],
// note(left)[0x04],
group(right,2,level:1)[another group],
bytes(4)[some other thing],
note(left)[0x08],
bytes(4)[some third thing],
)
```)
#pagebreak()
== Headers [WIP]
#emoji.warning The new bitheader api is still a work in progress and might change a bit in the next version.
The current API is described here:
The `bitheader` function defines which bit-numbers and text-labels are shown as a header.
Currently *only the first* `bitheader` per `bytefield` is processed, all others will be ignored.
There are some #named arguments and an arbitrary amount of #positional arguments which you can pass to a header.
Showing a number. #positional
- Just add an `int` value with the number you would like to show.
Showing a text label for a number #positional
- Add a content field after the int value which the label belongs to.
- To show a label without the number use the negativ number. _Example: (-5) instead of (5)_
#info[
Set the order of the bits with the `msb` argument directly on the `bytefield`.
- `msb:right` displays the numbers from (left) 0 --- to --- msb (right) #default
- `msb:left` displays the numbers from (left) msb --- to --- 0 (right)
]
Show or hide numbers
- `numbers: none` hide all numbers
- `numbers: auto` show all specified numbers #default
Some common use cases can be set by adding a `string` value. #positional
- `"all"` will show numbers for all bits.
- `"bytes"` will show every multiple of 8 and the last bit.
- `"bounds"` will show begin and end of each field in the first row.
- `"offsets"` will show begin of each field in the first row.
You can use #named arguments to adjust the header styling.
- `fill` argument adds an background color to the header.
- `text-size` sets the size of the text.
- `stroke` defines the border style.
- `marker` [bool] defines if there is a marker line shown below the label.
- `marker: true`: shows a marker on each label.
- `marker: false`: no marker is shown at all.
- `marker: (true,false)`: shows markers only on labels with numbers.
- `marker: (false, true)`: shows markers only on labels without numbers.
=== Numbers and Labels example
You can also show labels and indexes by specifying a `content` after an `number` (`int`).
#example(showlines: (2,8), ```typst
#bytefield(
bitheader(
0,[LSB],
5, [test],
8, [next_field],
24, [important FLAG],
31, [MSB],
17,19,
),
byte[LSB],
bytes(2)[Two],
flag("URG"),
bits(7)[MSB],
)
```)
== Styling
You can use the `row` argument on the `bytefield` to specify custom row heights. #emoji.warning This does not affect the header row.
Usage is equal to _typst_ table or grid row argument.
See @reg-def as an example.
== Global config
You can set some global default values which affect all `bytefields` by using a show rule.
*Example:*
```typst
#show: bf-config.with(
field_font_size: 15.5pt,
note_font_size: 6pt,
header_font_size: 12pt,
header_background: luma(200),
header_border: luma(80),
)
```
#pagebreak()
= Use cases<chap:use-cases>
== Protocol Headers
Generate protocol headers like the one from the *ipv4* protocol.
#figure(
example(
columns: 2,
```typst
#bytefield(
bitheader("bytes"),
bits(4)[Version], bits(4)[IHL], bytes(1)[TOS], bytes(2)[Total Length],
bytes(2)[Identification], bits(3)[Flags], bits(13)[Fragment Offset],
bytes(1)[TTL], bytes(1)[Protocol], bytes(2)[Header Checksum],
bytes(4)[Source Address],
bytes(4)[Destination Address],
bytes(3)[Options], bytes(1)[Padding]
)
```),
caption: "Common IPv4 Header.",
supplement: "Bytfield",
)
== Memory Maps
Generate memory maps. Currently possible with a little workaround using bits. Better support is on the roadmap.
#figure(
example(columns: 2,
```typst
#bytefield(
bpr: 1,
group(right,4)[On Chip Memory],
section("0x2002 0000", "0x2002 1fff"),
bit[RX Descriptor Memory],
bit[],
section("0x2000 7fff", "0x2000 0000", span: 2),
bits(2)[Bootloader],
group(right,4)[ext. DDR3 RAM],
section("0x1fff ffff", "0x0000 0000", span: 4),
bits(4)[App],
)
```
),
caption: "A memory map example.",
supplement: "Bytefield",
)
#pagebreak()
== Register Definitions<reg-def>
Creating register definition like @bf-reg is currently possible by using two `bytefields` and tweaking the header accordingly.
// #show: bf-config.with(
// row_height: 2cm,
// )
#figure(
example(
```typst
#let reg_field(body, size: 1, rw: "rw") = {
bits(size,table(columns: 1fr,rows: (2fr, auto),body,rw))
}
#let reserved(size) = bits(size)[Reserved]
#set text(8pt)
#bytefield(
bpr: 16,
msb: left,
rows: 2cm,
bitheader(range: (16,32), ..range(16,32), msb: left),
reserved(4),
reg_field(rw: "r")[PLL I2S RDY],
reg_field[PLL I2S ON],
reg_field(rw: "r")[PLL RDY],
reg_field[PLL ON],
reserved(4),
reg_field[CSS ON],
reg_field[HSE BYP],
reg_field(rw: "r")[HSE RDY],
reg_field[HSE ON],
)
#bytefield(
bpr: 16,
msb: left,
rows: 2cm,
bitheader("all", msb: left),
reg_field(size:8, rw: "r")[HSICAL[7:0]],
reg_field(size:5)[HSITRIM[4:0]],
reg_field[Res.],
reg_field(rw: "r")[HSI RDY],
reg_field[HSION],
)
```),
caption: [Register Definition from the STM32 manual recreated with `bytefield`],
supplement: "Bytfield",
)<bf-reg>
#pagebreak()
= Reference
#show heading.where(level:2): set text(18pt) // module names
#show heading.where(level:3): set text(16pt, fill: red.darken(20%)) // function names
#user-api<user-api>
|
https://github.com/fredguth/bid_produto_1 | https://raw.githubusercontent.com/fredguth/bid_produto_1/main/_extensions/fredguth/desid-report/typst-template.typ | typst |
#let report(
title: none,
subtitle: none,
authors: none,
date: none,
abstract: none,
iadb_contract: none,
iadb_project: none,
iadb_product: none,
cols: 1,
lang: "pt",
region: "BR",
font: (),
fontsize: 10pt,
sectionnumbering: none,
toc: false,
toc-depth: none,
bib_syle: "apa",
theme: (
color: blue.darken(30%),
serif: "Harding Text Web",
sans: "Lato",
mono: "SF Mono",
normal: 10pt,
small: 8pt,
),
doc,
) = {
set page(
paper: "a4",
margin: (inside: 1cm, top: 1.5cm, outside: 1cm, bottom: 1.5cm),
numbering: "1",
header-ascent: .5cm,
footer-descent: .5cm,
header: locate(loc => {
if (loc.page() != 1) {
block(
width: 100%,
stroke: (bottom: 1pt + gray),
inset: (bottom: 8pt, right: 2pt, left: 2pt),
[ #set text(font: theme.sans, size: theme.small, fill: gray.darken(50%))
#grid(
columns: (1fr, 1fr),
align(left, []),
align(right, text(weight: "bold", upper[Relatório])),
) ],
)
}
}),
footer: block(
width: 100%,
stroke: (top: 1pt + gray),
inset: (top: 8pt, right: 2pt),
[
#set text(font: theme.sans, size: theme.small, fill: gray.darken(50%))
#grid(
columns: (75%, 25%),
align(left)[#date],
align(
right
)[#counter(page).display() de #locate((loc) => { counter(page).final(loc).first() })],
)
],
)
)
set par(justify: true)
set text(lang: lang,
region: region,
historical-ligatures: true,
ligatures: true,
font: theme.sans,
size: theme.normal)
set heading(numbering: sectionnumbering)
if title != none {
text(font: theme.sans, fill: gray.lighten(60%), upper[Relatório])
v(.2cm)
text(font: theme.serif, size: 20pt, weight: "black", title)
if subtitle != none {
v(-.3cm)
text(font: theme.serif, size: 16pt, weight: "light", subtitle)
}
v(1cm)
line(length: 100%, stroke: 2pt + theme.color)
v(1cm)
}
grid(columns: (62%, 3%, 35%), text(font: theme.serif, doc) ,[], {
if authors != none {
if toc {
block(above: 2em, below: 2em)[
#outline(
title: auto,
depth: 1,
indent: auto
);
]
}
place(dy:6.5cm, block(fill: blue.lighten(95%),width: 100%,inset: 1em,radius: 6pt)[
#for (author) in authors [
#if author.role!= none [*#author.role*]
#h(1em)#author.name #if author.affiliation!=none {text(font: theme.mono, size: theme.small)[(#author.affiliation)]}
#if author.email!=none [#v(-.5em)#h(1em)#text(size: theme.small, author.email)]
]
#if iadb_contract != none [
*Contrato*\
#h(1em)#text(size: theme.small, iadb_contract)
]
#if iadb_project != none [
*Projeto*\
#text(size: theme.small, pad(left: 1em,[#iadb_project]))
]
#if iadb_product != none [
*Produto*\
#h(1em)#text(size: theme.small, iadb_product)
]
])
}
})
if abstract != none {
block(inset: 2em)[
#text(weight: "semibold")[Abstract] #h(1em) #abstract
]
}
}
|
|
https://github.com/FlyinPancake/bsc-thesis | https://raw.githubusercontent.com/FlyinPancake/bsc-thesis/main/README.md | markdown | # Use-cases for vcluster
This repository contains all the research and results in context with my BSc thesis.
## Directories
- `thesis` contains the source files to build the thesis PDF
## Compiling
### Thesis
There are artefacts with every push on the main branch.
If you want to compile the thesis yourself, you need to have `typst` installed.
Then you can run the following command in the root directory of this repository:
```bash
typst compile thesis/main.typ
```
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/return-05.typ | typst | Other | // Test value return from content.
#let x = 3
#let f() = [
Hello 😀
#return "nope"
World
]
#test(f(), "nope")
|
https://github.com/maxgraw/bachelor | https://raw.githubusercontent.com/maxgraw/bachelor/main/apps/document/src/5-implementation/architecture-software.typ | typst | Wie im Kapitel der Konzeption festgelegt, ermöglicht die Entwicklung der Anwendung als Web Component eine modulare und wiederverwendbare Architektur. Die Web Components werden in dem Paket "player" definiert und exportiert. Hierbei werden drei unterschiedliche Komponenten erstellt. Die Klasse "BaseElement" stellt die Grundlage für alle weiteren Komponenten dar und definiert die grundlegenden Variablen und Funktionen. Die Klassen "ARElement" und "ShopARElement" erweitern die Klasse "BaseElement" und definieren die spezifischen Funktionen und Variablen für die Anwendung. Hierbei stellt ARElement die Anwendung für die Evaluation dieser Arbeit dar, während ShopARElement die Anwendung für die Evaluation von <NAME> darstellt.
Jede Klasse folgt einem einheitlichen Aufbau. Im Konstruktor der Klasse werden Variablen und Funktionen definiert, die für die Anwendung von Bedeutung sind. Für die Klasse "BaseElement", welche in @BaseElement-listing auszugsweise vorgestellt wird, umfasst dies grundlegende Variablen für die Three.js-Szene, wie beispielsweise den Renderer, die Szene und die Kamera. Durch die Deklaration dieser Variablen im Konstruktor sind sie innerhalb der Klasse zugänglich. Darüber hinaus werden Funktionen und Hilfsvariablen definiert, die für die Anwendung von Bedeutung sind. Die Klasse "BaseElement" definiert beispielsweise die Funktion "hitTest", die für die Interaktion mit der Umgebung notwendig ist sowie die dazugehörigen Variablen "hitTestSource" und "hitTestSourceRequested". Die Funktion "hitTest" wird in einem späteren Kapitel ausführlich behandelt. Die gesamte Klasse "BaseElement" ist im @appendix-baseElement zu finden.
#let code = ```js
import { hitTest, ... } from "utils";
export class BaseElement extends HTMLElement {
constructor() {
super();
// Three.js Basic Setup
this.renderer = new THREE.WebGLRenderer(...);
this.scene = new THREE.Scene();
this.camera = new THREE.PerspectiveCamera(...);
// Hit Test
this.hitTest = hitTest;
this.hitTestSource = null;
this.hitTestSourceRequested = false;
}
}
```
#figure(
code,
caption: [Ausschnitt der BaseElement Klasse mit grundlegenden Variablen und Funktionen]
) <BaseElement-listing>
Wie im @appendix-baseElement dargestellt, stellt die Klasse BaseElement die Funktion "init" bereit, die die zuvor definierten Variablen und Funktionen nutzt, um eine Three.js-Szene zu erstellen. Ein Ausschnitt dieser Funktion wird in @init-listing dargestellt, um wichtige Funktionalitäten zu verdeutlichen. Zunächst wird das Shadow DOM initialisiert. Wie im @web-components-chapter über Web-Komponenten beschrieben, ermöglicht das Shadow DOM die Erstellung von gekapselten DOM-Bäumen und Logiken.
In diesem Schritt wird ein von Three.js bereitgestellter ARButton hinzugefügt, der die WebXR-Funktionen des Browsers aktiviert und die Anwendung startet. Wie im @webxr-chapter über WebXR definiert, wird eine Liste an benötigten oder optionalen Features übergeben. Für die Anwendung sind die Features "hit-test" erforderlich und "light-estimation" optional.
Anschließend wird die Three.js Render-Klasse konfiguriert und die Unterklasse XR aktiviert. Die Erstellung und Initialisierung einer XRScene wird automatisch von Three.js übernommen. Dabei wird der XRReferenceSpace auf "local-floor" gesetzt, was das Zentrum der Szene auf den Boden legt, wie im @webxr-chapter beschrieben. Zusätzlich werden Elemente wie Lichter und Kameras zur Szene hinzugefügt.
#let code = ```js
init(renderer, scene) {
// Initialize Shadow DOM
const shadow = this.attachShadow({ mode: "open" });
shadow.appendChild(renderer.domElement);
shadow.appendChild(
ARButton.createButton(renderer, {
requiredFeatures: ["hit-test"],
optionalFeatures: ["light-estimation"],
}),
);
// Renderer
renderer.xr.enabled = true;
// Scene
scene.add(this.camera);
// Light
const defaultLight = new THREE.HemisphereLight(0xffffff, 0xbbbbff, 1);
defaultLight.position.set(0.5, 1, 0.25);
scene.add(defaultLight);
}
```
#figure(
code,
caption: [Ausschnitt der init-Funktion der BaseElement Klasse]
) <init-listing>
In @ARElement-listing wird Klasse ARElement definiert. Dabei wird die "connectedCallback"-Funktion verwendet, um die Anwendung zu initialisieren. In dieser Funktion werden die zuvor beschriebene "init"-Funktion sowie die "setAnimationLoop"-Funktion der Three.js Render-Klasse aufgerufen.
Die "setAnimationLoop"-Funktion ruft die "render"-Funktion auf, die den Render-Loop von Three.js startet. Der Render-Loop ist ein kontinuierlicher Prozess, der die Szene in jedem Frame aktualisiert und darstellt. Dies ist entscheidend für die Echtzeit-Darstellung und Interaktion innerhalb der Augmented Reality-Anwendung. Während jedes Frame wird der Zustand der Szene überprüft und alle notwendigen Aktualisierungen vorgenommen, bevor die Szene gerendert wird @threejs-webxr.
#let code = ```js
export class ARElement extends BaseElement {
constructor() {
super();
}
async connectedCallback() {
// Set up
this.init(this.renderer, this.scene);
this.renderer.setAnimationLoop(this.render.bind(this));
}
render(timestamp, frame) {
this.renderer.render(this.scene, this.camera);
}
}
```
#figure(
code,
caption: [Ausschnitt der ARElement Klasse mit connectedCallback- und render-Funktion aus @appendix-ARElement]
) <ARElement-listing>
Durch die Kombination der "init"-Funktion und der Initialisierung des Render-Loops wird die Three.js-Szene erstellt und bereitgestellt. In den folgenden Kapiteln wird diese Szene um die Darstellung und Funktionalitäten der Anwendung erweitert. |
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/text/lorem.typ | typst | // Test blind text.
--- lorem ---
// Test basic call.
#lorem(19)
--- lorem-pars ---
// Test custom paragraphs with user code.
#set text(8pt)
#{
let sentences = lorem(59)
.split(".")
.filter(s => s != "")
.map(s => s + ".")
let used = 0
for s in sentences {
if used < 2 {
used += 1
} else {
parbreak()
used = 0
}
s.trim()
[ ]
}
}
--- lorem-missing-words ---
// Error: 2-9 missing argument: words
#lorem()
|
|
https://github.com/eigenein/typst-templates | https://raw.githubusercontent.com/eigenein/typst-templates/main/letter.typ | typst | MIT License | #let authors(from: (), reply: ()) = [
#set text(size: 8pt)
== Van: \
#for author in from [
#show heading: it => block(upper(it.body))
=== #author.name
#if "email" in author [
*Email*:~#link("mailto:" + author.email) \
]
#if "phone" in author [
*Tel.*:~#link("tel:" + author.phone) \
]
#if "meta" in author [
#for (key, value) in author.meta [
*#key*:~#value \
]
]
]
#pad(top: 1em)[
== Retouradres: \
#reply.address \
#{reply.zip + sym.space.en + reply.city}
]
]
#let letter(
doc,
from: (),
reply: (),
to: (),
date: text(fill: red)[date is not set],
subject: text(fill: red)[subject is not set],
) = {
set document(author: from.map(author => author.name))
set page(
paper: "a4",
header: text(size: 8pt, fill: luma(50%))[Betreft:~#subject],
header-ascent: 4em,
footer: [
#set align(end)
#set text(8pt)
#counter(page).display((number, total) => text[Pagina #number van #total], both: true)
],
)
set text(font: "PT Sans", size: 10pt, lang: "nl")
grid(
columns: (5cm, 100% - 10cm, 5cm),
[
*#to.name* \
#if "department" in to [
*#to.department* \
]
#to.address \
#{to.zip + sym.space.en + to.city}
#parbreak()
],
[],
authors(from: from, reply: reply),
)
pad(top: 3em)[
*Datum:*~#date\
*Betreft:*~#subject
]
pad(top: 3em)[
Geachte heer / mevrouw, \
#doc
]
pad(top: 3em)[
Met vriendelijke groet, \
#for author in from [
_ #author.name _ \
]
]
}
|
https://github.com/sxdl/MCM-Typst-template | https://raw.githubusercontent.com/sxdl/MCM-Typst-template/main/template/main.typ | typst | Apache License 2.0 | #import "@preview/mcm-scaffold:0.1.0": *
#import "@preview/mitex:0.2.2": *
#show: mcm.with(
title: "A Simple Example for MCM/ICM Typst Template",
problem-chosen: "ABCDEF",
team-control-number: "1111111",
year: "2025",
summary: [
#lorem(100)
#lorem(100)
#lorem(100)
#lorem(100)
],
keywords: [MCM; ICM; Mathemetical; template],
magic-leading: 0.65em,
)
///////////////////////Body//////////////////////////
= Introduction
Create a new file and start with following lines.
```typst
#import "@preview/mcm-scaffold:0.1.0": *
#show: mcm.with(
title: "A Simple Example for MCM/ICM Typst Template",
problem-chosen: "ABCDEF",
team-control-number: "1111111",
year: "2025",
summary: [
],
keywords: [MCM; ICM; Mathemetical; template],
magic-leading: 0.65em,
)
///////////////////////Body//////////////////////////
= Introduction
```
= Images
== Single Image
```typst
#img-single(path: str, width: 70%, caption: none, placement: none)
```
=== An image with default width and no caption
```typst
#img-single(path: "template/figures/image1.png")
```
#img-single(path: "template/figures/image1.png")
=== An image with caption
```typst
#img-single(path: "template/figures/image1.png", caption:[workflow])
```
#img-single(path: "template/figures/image1.png", caption:[workflow])
=== Adjust width
```typst
#img-single(
path: "template/figures/image1.png",
width: 50%,
caption:[image of 50% width (default 70%).]
)
```
#img-single(
path: "template/figures/image1.png",
width: 50%,
caption:[image of 50% width (default 70%).]
)
=== Specify image placement
```t
placement: none(default)/auto/top/buttom
```
I put 3 images right below the code.
```typst
#img-single(
path: "template/figures/image1.png",
caption:[placement: top (default none).],
placement: top
)
#img-single(
path: "template/figures/image1.png",
caption:[placement: auto (default none).],
placement: auto
)
#img-single(
path: "template/figures/image1.png",
caption:[placement: bottom (default none).],
placement: bottom
)
```
See where the images are gone:
#img-single(
path: "template/figures/image1.png",
width: 40%,
caption:[placement: top (default none).],
placement: top
)
#img-single(
path: "template/figures/image1.png",
width: 40%,
caption:[placement: auto (default none).],
placement: auto
)
#img-single(
path: "template/figures/image1.png",
width: 40%,
caption:[placement: bottom (default none).],
placement: bottom
)
#pagebreak()
== Multiple Images
If you want to show multiple images in one figure, try this.
```typst
#img-grid(
cols: 2,
rows: 1,
imgs: array,
subcaps: (),
caption: none,
placement: none
)
```
=== Two images in default
If not specified cloumns and rows, $1 times 2$ grid is in default.
```typst
#img-grid(
imgs: ("template/figures/image1.png", "template/figures/image1.png")
)
```
#img-grid(
imgs: ("template/figures/image1.png", "template/figures/image1.png"),
)
=== Subcaptions
```typst
#img-grid(
imgs: ("template/figures/image1.png", "template/figures/image1.png"),
subcaps: ([(a)], [(b)]),
caption: [Two images with subcaptions.]
)
```
#img-grid(
imgs: ("template/figures/image1.png", "template/figures/image1.png"),
subcaps: ([(a)], [(b)]),
caption: [Two images with subcaptions.]
)
=== More images to show!
You can specify the columns and rows to put more images as you like.
```typst
#img-grid(
cols: 2, rows: 2,
imgs: ("template/figures/image1.png",) * 4,
subcaps: ([(a)], [(b)], [(c)], [(d)]),
caption: [Four images with subcaptions.]
)
```
#img-grid(
cols: 2, rows: 2,
imgs: ("template/figures/image1.png",) * 4,
subcaps: ([(a)], [(b)], [(c)], [(d)]),
caption: [Four images with subcaptions.]
)
```typst
#img-grid(
cols: 3, rows: 2,
imgs: ("template/figures/image1.png",) * 6,
subcaps: ([(a)], [(b)], [(c)], [(d)], [(e)], [(f)]),
caption: [Six images with subcaptions.]
)
```
#img-grid(
cols: 3, rows: 2,
imgs: ("template/figures/image1.png",) * 6,
subcaps: ([(a)], [(b)], [(c)], [(d)], [(e)], [(f)]),
caption: [Six images with subcaptions.]
)
```typst
#img-grid(
cols: 4, rows: 3,
imgs: ("template/figures/image1.png",) * 12,
subcaps: (
[(a)], [(b)], [(c)], [(d)], [(e)], [(f)],
[(g)], [(h)], [(i)], [(j)], [(k)], [(l)],
),
caption: [Twelve images with subcaptions.]
)
```
#img-grid(
cols: 4, rows: 3,
imgs: ("template/figures/image1.png",) * 12,
subcaps: (
[(a)], [(b)], [(c)], [(d)], [(e)], [(f)],
[(g)], [(h)], [(i)], [(j)], [(k)], [(l)],
),
caption: [Twelve images with subcaptions.]
)
= Table
```typst
#threee-line-table(
columns: array,
align: auto,
headers: array,
bodies: array,
caption: content
)
```
== Simple three-line-table
ex: Symbols and notations are listed in the @SymbolDescription
```typst
Symbols and notations are listed in the @SymbolDescription
#threee-line-table(
columns: (25%, 60%), // Set colum width(auto/10%/1ft/1pt)
headers: ([Symbol], [Explain]),
bodies: (
[$S_t$], [state of submersible],
[$f_m$], [standard equation of motion],
[$P_k^(\(t\))$], [probability of appearance],
[$R$], [usability score],
[$T_S$], [search mission point set],
[$S_M$], [submersible set],
[$T_D$], [assigned but uncompleted search mission point set],
[$T_U$], [mission point set that violates the assignment]
),
caption: "Symbol Description",
) <SymbolDescription> //ref label
```
#threee-line-table(
columns: (25%, 60%),
headers: ([Symbol], [Explain]),
// align: (left, right),
bodies: (
[$S_t$], [state of submersible],
[$f_m$], [standard equation of motion],
[$P_k^(\(t\))$], [probability of appearance],
[$R$], [usability score],
[$T_S$], [search mission point set],
[$S_M$], [submersible set],
[$T_D$], [assigned but uncompleted search mission point set],
[$T_U$], [mission point set that violates the assignment]
),
caption: "Symbol Description",
) <SymbolDescription>
== Width and alignment
```typst
Symbols and notations are listed in the @SymbolDescription
#threee-line-table(
columns: (auto, 60%),
align: (right, center), // right/center/left
headers: ([Symbol], [Explain]),
bodies: (
[$S_t$], [state of submersible],
[$f_m$], [standard equation of motion],
[$P_k^(\(t\))$], [probability of appearance],
[$R$], [usability score],
[$T_S$], [search mission point set],
[$S_M$], [submersible set],
[$T_D$], [assigned but uncompleted search mission point set],
[$T_U$], [mission point set that violates the assignment]
),
caption: "Symbol Description",
) <SymbolDescription> //ref label
```
#threee-line-table(
columns: (auto, 60%),
align: (right, center),
headers: ([Symbol], [Explain]),
bodies: (
[$S_t$], [state of submersible],
[$f_m$], [standard equation of motion],
[$P_k^(\(t\))$], [probability of appearance],
[$R$], [usability score],
[$T_S$], [search mission point set],
[$S_M$], [submersible set],
[$T_D$], [assigned but uncompleted search mission point set],
[$T_U$], [mission point set that violates the assignment]
),
caption: "Symbol Description",
)
= Enum
```typst
#let enum-default = { set enum(numbering: "1.") }
#let enum-paren(content) = {
set enum(numbering: "1)")
content
enum-default
}
```
== Tight and loose list
A tight enum would like this:
```typst
+ item1
+ item2
+ item3
```
+ item1
+ item2
+ item3
To make it loose, add a blank line after the first line:
```typst
+ #lorem(30)
+ #lorem(30)
+ #lorem(30)
```
+ #lorem(30)
+ #lorem(30)
+ #lorem(30)
== Change numbering
```typst
#enum-paren()[
+ #lorem(20)
+ #lorem(20)
+ #lorem(20)
]
```
#enum-paren()[
+ #lorem(20)
+ #lorem(20)
+ #lorem(20)
]
= References
== bib
Put ``` references.bib ``` in your project file. and use ``` @<tag> ``` to ref them. @2017YOLO9000
```typst
For, emample. @2018YOLOv3
```
For, emample. @2018YOLOv3
== plain text(by yml)
If you want to use plaintext reference directory, there is a trick: Edit references.yml and replace publisher by reference text.
```yml
ref1:
type: Article
publisher: "ZygOS: Achieving Low Tail Latency for Microse"
ref2:
type: Article
publisher: "article title here"
```
= Appendix
```typ
#heading("Appendix A ", numbering: none, outlined: false)
`` `py
import ...
`` `
```
= Handful tools
== Paragraph with no indent
Paragraphs after figure, table or maths will be automatically with indent. Sometimes we don't need the indent.
```typst
#no-indent()
content below
```
For example, after a math block,
$ y = x^2 $
The aragraph after the block is with indent.
```typst
$ y = x^2 $
#no-indent
Paragraph with no indent.
```
$ y = x^2 $
#no-indent
Paragraph with no indent.
== Math without numbering
```typst
#math-no-number(
$ y = sqrt(x) $
)
```
#math-no-number(
$ y = sqrt(x) $
)
== Figures fly away? Place here!
Sometimes, images or tables will fly away and left a huge blank place. Use ``` #place-here() ``` to catch them back!
```typst
#place-here()[
#threee-line-table(
columns: 7 * (10%, ),
headers: ([a], [u], [v], [w], [p], [q], [r]),
bodies: ([30], [10], [-8], [-2], [0.01], [0.004], [0.001]),
caption: [A simpel table]
)
]
```
#place-here()[
#threee-line-table(
columns: 7 * (10%, ),
headers: ([a], [u], [v], [w], [p], [q], [r]),
bodies: ([30], [10], [-8], [-2], [0.01], [0.004], [0.001]),
caption: [A simpel table]
)
]
== Latex math eqaution
Support Mitex, ```typst #mitext('')```
```typst
#mitext(`
\begin{equation}
SSIM(x,y)=\frac{\left(2\mu_x\mu_y+c1\right)\left(\sigma_{xy}+c2\right)}
{\left(\mu_x^2+\mu_y^2+c1\right)\left(\sigma_x^2+\sigma_y^2+c2\right)}
\end{equation}
Where $\mu_x$ is the average of x, $\mu_y$ is the average of y, $\sigma_x^2$ is the variance of x, $\sigma_y^2$ is the variance of y, and $\sigma_{xy}$ is the covariance of x and y. C1=(k1L)2, C1=(k1L)2, is a constant used to maintain stability. L is the dynamic range of the pixel value. K1 = 0.01, k2 = 0.03. The structural similarity ranges from 0 to 1. When the two images are identical, the value of SSIM is equal to one.
`)
```
#mitext(`
\begin{equation}
SSIM(x,y)=\frac{\left(2\mu_x\mu_y+c1\right)\left(\sigma_{xy}+c2\right)}
{\left(\mu_x^2+\mu_y^2+c1\right)\left(\sigma_x^2+\sigma_y^2+c2\right)}
\end{equation}
Where $\mu_x$ is the average of x, $\mu_y$ is the average of y, $\sigma_x^2$ is the variance of x, $\sigma_y^2$ is the variance of y, and $\sigma_{xy}$ is the covariance of x and y. C1=(k1L)2, C1=(k1L)2, is a constant used to maintain stability. L is the dynamic range of the pixel value. K1 = 0.01, k2 = 0.03. The structural similarity ranges from 0 to 1. When the two images are identical, the value of SSIM is equal to one.
`)
#bibliography("references.bib")
#pagebreak()
#heading("Appendix A ", numbering: none, outlined: false)
```py
import cv2
import numpy as np
import matplotlib.pyplot as plt
from skimage import exposure
from skimage.exposure import match_histograms
def plot(img):
plt.subplot(121)
plt.imshow(img, 'gray')
plt.subplot(122)
plt.hist(img.ravel(), 256, [0, 256])
plt.show()
if __name__ == '__main__':
img = cv2.imread('img1.png', cv2.IMREAD_GRAYSCALE)
hist = cv2.calcHist([img], [0], None, [256], [0, 256])
plot(img)
equ = cv2.equalizeHist(img)
plot(equ)
target = cv2.imread('mask.png', cv2.IMREAD_GRAYSCALE)
target_hist = cv2.calcHist([target], [0], None, [256], [0, 256])
plot(target)
matched = match_histograms(img, target)
plot(matched)
```
|
https://github.com/QuadnucYard/cpp-coursework-template | https://raw.githubusercontent.com/QuadnucYard/cpp-coursework-template/main/problematic.typ | typst | // problematic
#import "font.typ": fonts
#import "@preview/treet:0.1.0": *
/// Make the body raw.
///
/// *Examples:*
///
/// #example(`problematic.ensure-raw("114514", block: true)`)
/// #example(`problematic.ensure-raw("114514", block: false)`)
/// #example(``` problematic.ensure-raw(`114514`, block: true)```)
///
/// - body (string, raw): Some text
/// - block (boolean): Whether to force `block = true`.
/// -> content
#let ensure-raw(body, block: true) = {
if type(body) == str {
return raw(body, block: block)
} else if type(body) == content and body.func() == raw {
if (block and not body.block) {
let f = body.fields()
f.insert("block", true)
f.remove("text")
return raw(body.text, ..f)
}
}
body
}
/// Extract text from content.
///
/// *Examples:*
///
/// #example(``` problematic.extract-raw(`something`)```)
/// #example(``` problematic.extract-raw("anything")```)
///
/// - s (content, string): Something like content.
/// -> string
#let extract-raw(s) = {
if type(s) == content and s.has("text") {
s.text
} else {
s
}
}
/// Show test cases in grid.
///
/// *Example:*
///
/// #example(``` problematic.test-cases(`1 2 3`, `A`, `4 5`, `B`) ```, scale-preview: 100%)
///
/// - columns (integer): A dummy argument for prettypst to correctly align items.
/// - ..cases (string, raw): Input and output alternate. If is `raw`, it will be ensured block.
/// -> content
#let test-cases(columns: 2, ..cases) = {
let a = cases.pos().map(ensure-raw)
let content = for i in range(int(a.len() / 2)) {
(box(inset: (y: 0.4em), str(i + 1)), a.at(i * 2), a.at(i * 2 + 1))
}
// [=== Test cases]
table(
columns: (30pt, 50% - 15pt, 50% - 15pt),
align: (center, left, left),
stroke: none,
inset: 2pt,
[*Case*],
[*Sample input*],
[*Sample output*],
..content
)
}
/// Show a sample test case.
///
/// *Example:*
///
/// #example(``` problematic.sample(`114 514`, `1919810`, num: 1, ratio: 40%)```, scale-preview: 100%)
///
/// - input (any): Sample input.
/// - output (any): Sample output.
/// - num (integer, none): The serial number of this sample. If none, does not show the number.
/// - ratio (length): The size of left (input) column.
/// -> content
#let sample(input, output, num: none, ratio: 50%) = {
let postfix = if num != none { " #" + str(num) } else { "" };
table(
columns: (ratio, 100% - ratio),
stroke: none,
{ strong("Sample input" + postfix) },
{ strong("Sample output" + postfix) },
ensure-raw(input),
ensure-raw(output),
)
}
/// Make test cases from input and solver.
///
/// - solver (function): A mapper from input to output.
/// - input (function): A function to process input to feed the solver.
/// - ..cases (string, content): Test cases.
/// -> content
#let make-test-cases(
solver: s => s,
input: s => (s, ),
..cases,
) = {
test-cases(
..for case in cases.pos() {
(ensure-raw(case), ensure-raw(solver(..input(case.text))))
}
)
}
/// Display a problem as heading
#let problem(body, heading-level: 3) = {
show heading: set block(above: 0.65em, below: 0.65em)
heading(level: heading-level, {
counter("problem").step()
strong(counter("problem").display("1. "))
text(weight: "regular", font: fonts.primary, body)
})
}
/// Display multiple choices
///
/// *Example:*
///
/// #example(``` problematic.choices(columns: 2, [Choice A], [`Choice B`]) ```, scale-preview: 100%)
///
/// - columns (integer): Number of columns.
/// - ..children (content): Contents of choices
/// -> content
#let choices(columns: 2, ..children) = {
let cnt = counter("choices")
cnt.update(0)
table(
columns: range(columns).map(t => 1fr),
stroke: none,
..for i in range(children.pos().len()) {
([#cnt.step() #cnt.display("A. ") #children.pos().at(i)], )
}
)
}
/// Put an underline to hold choices
///
/// *Example:*
///
/// #example(`problematic.choice-placer`)
///
/// -> content
#let choice-placer = "______"
#let tag(body, fill: auto) = {
set text(size: 0.8em, fill.darken(40%))
box(inset: (left: 3pt, right: 3pt), box(radius: 4pt, outset: 3pt, fill: fill.lighten(75%), body))
}
#let tag-opt = tag(fill: fuchsia)[*选做*]
#let tag-prog = tag(fill: lime)[*编程*]
#let tag-ans = tag(fill: orange)[*简答*]
#let submission-list(body, root: none) = {
set text(font: fonts.mono, size: 0.8em)
block(inset: (left: 2em, right: 1em), outset: 4pt, radius: 4pt, fill: yellow.lighten(90%), {
if root != none {
[#root \ ]
}
tree-list(body)
})
}
|
|
https://github.com/typst-community/mantodea | https://raw.githubusercontent.com/typst-community/mantodea/main/src/theme.typ | typst | MIT License | #import "_pkg.typ"
#import "_valid.typ"
#let schema = _valid.dictionary.with((
fonts: _valid.dictionary((
serif: _valid.array(_valid.string()),
sans: _valid.array(_valid.string()),
mono: _valid.array(_valid.string()),
text: _valid.array(_valid.string()),
headings: _valid.array(_valid.string()),
code: _valid.array(_valid.string()),
)),
colors: _valid.dictionary((
primary: _valid.paint(),
secondary: _valid.paint(),
argument: _valid.paint(),
option: _valid.paint(),
value: _valid.paint(),
command: _valid.paint(),
comment: _valid.paint(),
module: _valid.paint(),
text: _valid.paint(),
muted: _valid.paint(),
info: _valid.paint(),
warning: _valid.paint(),
error: _valid.paint(),
success: _valid.paint(),
types: _valid.dictionary((
// special
any: _valid.paint(),
"auto": _valid.paint(),
"none": _valid.paint(),
// foundations
arguments: _valid.paint(),
array: _valid.paint(),
bool: _valid.paint(),
bytes: _valid.paint(),
content: _valid.paint(),
datetime: _valid.paint(),
dictionary: _valid.paint(),
float: _valid.paint(),
function: _valid.paint(),
int: _valid.paint(),
location: _valid.paint(),
plugin: _valid.paint(),
regex: _valid.paint(),
selector: _valid.paint(),
str: _valid.paint(),
type: _valid.paint(),
label: _valid.paint(),
// layout
alignment: _valid.paint(),
angle: _valid.paint(),
direction: _valid.paint(),
fraction: _valid.paint(),
length: _valid.paint(),
ratio: _valid.paint(),
relative: _valid.paint(),
// visualize
color: _valid.paint(),
gradient: _valid.paint(),
stroke: _valid.paint(),
)),
)),
))
#let default = (
fonts: (
serif: ("Linux Libertine", "Liberation Serif"),
sans: ("Liberation Sans", "TeX Gyre Heros"),
mono: ("Liberation Mono",),
text: ("Linux Libertine", "Liberation Serif"),
headings: ("Liberation Sans", "TeX Gyre Heros"),
code: ("Liberation Mono",),
),
colors: (
primary: eastern,
secondary: teal,
argument: navy,
option: rgb(214, 182, 93),
value: rgb(181, 2, 86),
command: blue,
comment: gray,
module: rgb(140, 63, 178),
text: rgb(35, 31, 32),
muted: luma(210),
info: rgb(23, 162, 184),
warning: rgb(255, 193, 7),
error: rgb(220, 53, 69),
success: rgb(40, 167, 69),
types: {
let red = rgb(255, 203, 195)
let gray = rgb(239, 240, 243)
let purple = rgb(230, 218, 255)
let gradient-colors = (
(rgb("#7cd5ff"), 0%),
(rgb("#a6fbca"), 33%),
(rgb("#fff37c"), 66%),
(rgb("#ffa49d"), 100%),
)
(
// special
any: gray,
"auto": red,
"none": red,
// foundations
arguments: gray,
array: gray,
bool: rgb(255, 236, 193),
bytes: gray,
content: rgb(166, 235, 229),
datetime: gray,
dictionary: gray,
float: purple,
function: gray,
int: purple,
location: gray,
plugin: gray,
regex: gray,
selector: gray,
str: rgb(209, 255, 226),
type: gray,
label: rgb(167, 234, 255),
// layout
alignment: gray,
angle: purple,
direction: gray,
fraction: purple,
length: purple,
ratio: purple,
relative: purple,
// visualize
color: gradient.linear(..gradient-colors),
gradient: gradient.linear(..gradient-colors),
stroke: gray,
)
}
),
)
|
https://github.com/mattyoung101/uqthesis_eecs_hons | https://raw.githubusercontent.com/mattyoung101/uqthesis_eecs_hons/master/pages/chapters/results.typ | typst | ISC License | = Results
#lorem(500)
== Typst and performance
#lorem(750)
== Typst and ease of use
#lorem(600)
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/tuhi-exam-vuw/0.1.0/template/appendix.typ | typst | Apache License 2.0 |
#pagebreak()
= APPENDIX
=== Vector calculus identities
<vector-calculus-identities>
$nabla lr((f g)) eq f nabla g plus g nabla f$
$nabla lr((bold(A) dot.op bold(B))) eq bold(A) times lr((nabla times bold(B))) plus bold(B) times lr((nabla times bold(A))) plus lr((bold(A) dot.op nabla)) bold(B) plus lr((bold(B) dot.op nabla)) bold(A)$
$nabla dot.op lr((f bold(A))) eq f lr((nabla dot.op bold(A))) plus bold(A) dot.op lr((nabla f))$
$nabla dot.op lr((bold(A) times bold(B))) eq bold(B) dot.op lr((nabla times bold(A))) minus bold(A) dot.op lr((nabla times bold(B)))$
$nabla times lr((f bold(A))) eq f lr((nabla times bold(A))) minus bold(A) times lr((nabla f))$
$nabla times lr((bold(A) times bold(B))) eq lr((bold(B) dot.op nabla)) bold(A) minus lr((bold(A) dot.op nabla)) bold(B) plus lr((nabla dot.op bold(B))) bold(A) minus lr((nabla dot.op bold(A))) bold(B)$
=== Cylindrical coordinates:
<cylindrical-coordinates>
$x & eq s cos phi\
y & eq s sin phi\
z & eq z $
$ nabla f eq & frac(diff f, diff s) bold(hat(s)) plus 1 / s frac(diff f, diff phi) bold(hat(phi)) plus frac(diff f, diff z) bold(hat(z))\
nabla dot.op bold(A) eq & 1 / s frac(diff, diff s) lr((s A_s)) plus 1 / s frac(diff A_phi, diff phi) plus frac(diff A_z, diff z)\
nabla times bold(A) eq & lr((1 / s frac(diff A_z, diff phi) minus frac(diff A_phi, diff z))) bold(hat(s)) plus lr((frac(diff A_s, diff z) minus frac(diff A_z, diff s))) bold(hat(phi)) plus 1 / s lr((frac(diff, diff s) lr((s A_phi)) minus frac(diff A_s, diff phi))) bold(hat(z))\
nabla^2 f eq & 1 / s frac(diff, diff s) lr((s frac(diff f, diff s))) plus 1 / s^2 frac(diff^2 f, diff phi^2) plus frac(diff^2 f, diff z^2) $
=== Spherical coordinates:
<spherical-coordinates>
$x & eq r thin sin theta thin cos phi\
y & eq r thin sin theta thin sin phi\
z & eq r thin cos theta $
$ nabla f eq & frac(diff f, diff r) bold(hat(r)) plus 1 / r frac(diff f, diff theta) bold(hat(theta)) plus frac(1, r sin theta) frac(diff f, diff phi) bold(hat(phi))\
nabla dot.op bold(A) eq & 1 / r^2 frac(diff, diff r) lr((r^2 A_r)) plus frac(1, r sin theta) frac(diff, diff theta) lr((sin theta A_theta)) plus frac(1, r sin theta) frac(diff A_phi, diff phi)\
nabla times bold(A) eq & frac(1, r sin theta) lr((frac(diff, diff theta) lr((A_phi sin theta)) minus frac(diff A_theta, diff phi))) bold(hat(r))\
& plus 1 / r lr((frac(1, sin theta) frac(diff A_r, diff phi) minus frac(diff, diff r) lr((r A_phi)))) bold(hat(theta))\
& plus 1 / r lr((frac(diff, diff r) lr((r A_theta)) minus frac(diff A_r, diff theta))) bold(hat(phi))\
nabla^2 f eq & 1 / r^2 frac(diff, diff r) lr((r^2 frac(diff f, diff r))) plus frac(1, r^2 sin theta) frac(diff, diff theta) lr((sin theta frac(diff f, diff theta))) plus frac(1, r^2 sin^2 theta) frac(diff^2 f, diff phi^2) $
|
https://github.com/CarterT27/cover_letter | https://raw.githubusercontent.com/CarterT27/cover_letter/main/letter.typ | typst | #let letter(body) = {
set list(indent: 1em)
show list: set text(size: 0.92em)
show link: underline
show link: set underline(offset: 3pt)
set page(
paper: "us-letter",
margin: (x: 0.5in, y: 0.5in)
)
set text(
size: 11pt,
font: "New Computer Modern",
)
body
}
#let name_header(name) = {
set text(size: 2.25em)
[*#name*]
}
#let header(
name: "<NAME>",
phone: "123-456-7890",
email: "<EMAIL>",
linkedin: "linkedin.com/in/jake",
site: "github.com/jake",
) = {
align(center,
block[
#name_header(name) \
#phone |
#link("mailto:" + email)[#email] |
#link("https://" + linkedin)[#linkedin] |
#link("https://" + site)[#site]
]
)
v(5pt)
}
#let letter_heading(txt) = {
show heading: set text(size: 0.92em, weight: "regular")
block[
= #smallcaps(txt)
#v(-4pt)
#line(length: 100%, stroke: 1pt + black)
]
}
#let letter_data = yaml("letter.yml")
#let yml_personal(d) = {
header(
name: d.name,
phone: d.phone,
email: d.email,
linkedin: d.linkedin,
site: d.site
)
}
#let letter_salutation(d) = {
align(left, {
h(1fr)
text(10pt, weight: "light")[#datetime.today(offset:
auto).display("[month repr:long] [day padding:none], [year]")\ ]
text(10pt, weight: "regular")[#d.first #d.last\ ]
text(10pt, weight: "regular")[#d.city, #d.state\ ]
if d.phone != "" {
text(10pt, weight: "regular")[#d.phone\ ]
}
if d.email != "" {
text(10pt, weight: "regular")[#d.email\ ]
}
v(2pt)
text(10pt, weight: "regular")[Dear #d.prefix #d.last,\ ]
})
}
#let letter_body(d) = {
set par(justify: true, first-line-indent: 2em)
set text(11pt, weight: "regular")
for paragraph in d {
par()[#paragraph\ ]
}
}
#let letter_signature(d) = {
v(2pt)
align(left, {
text(10pt, weight: "regular")[Sincerely,\ ]
image("signature.png", alt: d.name, width: 10%)
text(10pt, weight: "regular")[#d.name]
})
}
#let yml_letter(data) = {
show: letter
yml_personal(data.personal)
letter_salutation(data.recipient)
letter_body(data.paragraphs)
letter_signature(data.personal)
}
#yml_letter(letter_data)
|
|
https://github.com/kdog3682/2024-typst | https://raw.githubusercontent.com/kdog3682/2024-typst/main/src/render.typ | typst | #import "@preview/cetz:0.2.0"
#import "@preview/splash:0.0.1": tailwind
#import "base-utils.typ": *
#import "canvas-functions.typ": canvas-functions
#let render-canvas(..sink) = {
let kwargs = sink.named()
let items = sink.pos()
cetz.canvas(..kwargs, {
for item in items {
let handler = item.at("handler")
let kwargs = transform-kwargs(item.at("kwargs", default: (:)))
let args = item.at("args", default: ())
canvas-functions.at(handler)(..args, ..kwargs)
}
})
}
#let transform-kwargs(kwargs) = {
let scope-ref = render-functions
let color-ref = tailwind
let pmwh-ref = (
"5pt": 5pt,
"10pt": 10pt,
)
let master = (
"fill": color-ref,
"stroke": color-ref,
"scope": scope-ref,
"x": pmwh-ref,
"inset": pmwh-ref,
"radius": pmwh-ref,
)
for key in master.keys() {
if has(kwargs, key) {
if key == "scope" {
let ref = kwargs.at(key)
for (k, v) in ref.pairs() {
ref.insert(k, scope-ref.at(v))
// panic(ref)
}
kwargs.insert(key, ref)
continue
}
kwargs.insert(key, master.at(key).at(kwargs.at(key)))
}
}
return kwargs
}
#let render(data) = {
let container(..sink) = {
let kwargs = sink.named()
let contents = sink.pos()
block(..kwargs, contents.join())
}
let handler = data.at("handler", default: none)
let fn = if handler == "block" { container } else if handler == "canvas" { render-canvas } else { render-functions.at(handler) }
let value = data.at("value", default: none)
let kwargs = transform-kwargs(data.at("kwargs", default: (:)))
if is-defined(value) {
fn(..kwargs, value)
} else {
let args = data.at("args", default: ())
fn(..kwargs, ..args.map(render))
}
}
// #render(readjson())
// #box(width: 3em, height: 1em, fill: xcolor.dandelion)
// /home/kdog3682/2024-typst/.gitignore
#render-canvas(readjson())
|
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/170.%20jessica.html.typ | typst | jessica.html
<NAME>
November 2015A few months ago an article about Y Combinator said that early on
it had been a "one-man show." It's sadly common to read that sort
of thing. But the problem with that description is not just that
it's unfair. It's also misleading. Much of what's most novel about
YC is due to <NAME>. If you don't understand her, you
don't understand YC. So let me tell you a little about Jessica.YC had 4 founders. Jessica and I decided one night to start it,
and the next day we recruited my friends <NAME> and <NAME>. Jessica and I ran YC day to day, and Robert and Trevor
read applications and did interviews with us.Jessica and I were already dating when we started YC. At first we
tried to act "professional" about this, meaning we tried to conceal
it. In retrospect that seems ridiculous, and we soon dropped the
pretense. And the fact that Jessica and I were a couple is a big
part of what made YC what it was. YC felt like a family. The
founders early on were mostly young. We all had dinner together
once a week, cooked for the first couple years by me. Our first
building had been a private home. The overall atmosphere was
shockingly different from a VC's office on Sand Hill Road, in a way
that was entirely for the better. There was an authenticity that
everyone who walked in could sense. And that didn't just mean that
people trusted us. It was the perfect quality to instill in startups.
Authenticity is one of the most important things YC looks for in
founders, not just because fakers and opportunists are annoying,
but because authenticity is one of the main things that separates
the most successful startups from the rest.Early YC was a family, and Jessica was its mom. And the culture
she defined was one of YC's most important innovations. Culture
is important in any organization, but at YC culture wasn't just how
we behaved when we built the product. At YC, the culture was the
product.Jessica was also the mom in another sense: she had the last word.
Everything we did as an organization went through her first — who
to fund, what to say to the public, how to deal with other companies,
who to hire, everything.Before we had kids, YC was more or less our life. There was no real
distinction between working hours and not. We talked about YC all
the time. And while there might be some businesses that it would
be tedious to let infect your private life, we liked it. We'd started
YC because it was something we were interested in. And some of the
problems we were trying to solve were endlessly difficult. How do
you recognize good founders? You could talk about that for years,
and we did; we still do.I'm better at some things than Jessica, and she's better at some
things than me. One of the things she's best at is judging people.
She's one of those rare individuals with x-ray vision for character.
She can see through any kind of faker almost immediately. Her
nickname within YC was the Social Radar, and this special power of
hers was critical in making YC what it is. The earlier you pick
startups, the more you're picking the founders. Later stage investors
get to try products and look at growth numbers. At the stage where
YC invests, there is often neither a product nor any numbers.Others thought YC had some special insight about the future of
technology. Mostly we had the same sort of insight Socrates claimed:
we at least knew we knew nothing. What made YC successful was being
able to pick good founders. We thought Airbnb was a bad idea. We
funded it because we liked the founders.During interviews, Robert and Trevor and I would pepper the applicants
with technical questions. Jessica would mostly watch. A lot of
the applicants probably read her as some kind of secretary, especially
early on, because she was the one who'd go out and get each new
group and she didn't ask many questions. She was ok with that. It
was easier for her to watch people if they didn't notice her. But
after the interview, the three of us would turn to Jessica and ask
"What does the Social Radar say?"
[1]Having the Social Radar at interviews wasn't just how we picked
founders who'd be successful. It was also how we picked founders
who were good people. At first we did this because we couldn't
help it. Imagine what it would feel like to have x-ray vision for
character. Being around bad people would be intolerable. So we'd
refuse to fund founders whose characters we had doubts about even
if we thought they'd be successful.Though we initially did this out of self-indulgence, it turned out
to be very valuable to YC. We didn't realize it in the beginning,
but the people we were picking would become the YC alumni network.
And once we picked them, unless they did something really egregious,
they were going to be part of it for life. Some now think YC's
alumni network is its most valuable feature. I personally think
YC's advice is pretty good too, but the alumni network is certainly
among the most valuable features. The level of trust and helpfulness
is remarkable for a group of such size. And Jessica is the main
reason why.(As we later learned, it probably cost us little to reject people
whose characters we had doubts about, because how good founders are
and how well they do are not orthogonal. If bad founders succeed
at all, they tend to sell early. The most successful founders are
almost all good.)If Jessica was so important to YC, why don't more people realize
it? Partly because I'm a writer, and writers always get disproportionate
attention. YC's brand was initially my brand, and our applicants
were people who'd read my essays. But there is another reason:
Jessica hates attention. Talking to reporters makes her nervous.
The thought of giving a talk paralyzes her. She was even uncomfortable
at our wedding, because the bride is always the center of attention.
[2]It's not just because she's shy that she hates attention, but because
it throws off the Social Radar. She can't be herself. You can't
watch people when everyone is watching you.Another reason attention worries her is that she hates bragging.
In anything she does that's publicly visible, her biggest fear
(after the obvious fear that it will be bad) is that it will seem
ostentatious. She says being too modest is a common problem for
women. But in her case it goes beyond that. She has a horror of
ostentation so visceral it's almost a phobia.She also hates fighting. She can't do it; she just shuts down. And
unfortunately there is a good deal of fighting in being the public
face of an organization.So although Jessica more than anyone made YC unique, the very
qualities that enabled her to do it mean she tends to get written
out of YC's history. Everyone buys this story that PG started YC
and his wife just kind of helped. Even YC's haters buy it. A
couple years ago when people were attacking us for not funding more
female founders (than exist), they all treated YC as identical with
PG. It would have spoiled the narrative to acknowledge Jessica's
central role at YC.Jessica was boiling mad that people were accusing her company of
sexism. I've never seen her angrier about anything. But she did
not contradict them. Not publicly. In private there was a great
deal of profanity. And she wrote three separate essays about the
question of female founders. But she could never bring herself to
publish any of them. She'd seen the level of vitriol in this debate,
and she shrank from engaging.
[3]It wasn't just because she disliked fighting. She's so sensitive
to character that it repels her even to fight with dishonest people.
The idea of mixing it up with linkbait journalists or Twitter trolls
would seem to her not merely frightening, but disgusting.But Jessica knew her example as a successful female founder would
encourage more women to start companies, so last year she did
something YC had never done before and hired a PR firm to get her
some interviews. At one of the first she did, the reporter brushed
aside her insights about startups and turned it into a sensationalistic
story about how some guy had tried to chat her up as she was waiting
outside the bar where they had arranged to meet. Jessica was
mortified, partly because the guy had done nothing wrong, but more
because the story treated her as a victim significant only for being
a woman, rather than one of the most knowledgeable investors in the
Valley.After that she told the PR firm to stop.You're not going to be hearing in the press about what Jessica has
achieved. So let me tell you what Jessica has achieved. Y Combinator
is fundamentally a nexus of people, like a university. It doesn't
make a product. What defines it is the people. Jessica more than
anyone curated and nurtured that collection of people. In that
sense she literally made YC.Jessica knows more about the qualities of startup founders than
anyone else ever has. Her immense data set and x-ray vision are the
perfect storm in that respect. The qualities of the founders are
the best predictor of how a startup will do. And startups are in
turn the most important source of growth in mature economies.The person who knows the most about the most important factor in
the growth of mature economies — that is who <NAME> is.
Doesn't that sound like someone who should be better known?Notes[1]
<NAME> reminded me that while Jessica didn't ask many
questions, they tended to be important ones:"She was always good at sniffing out any red flags about the team
or their determination and disarmingly asking the right question,
which usually revealed more than the founders realized."[2]
Or more precisely, while she likes getting attention in the
sense of getting credit for what she has done, she doesn't like
getting attention in the sense of being watched in real time.
Unfortunately, not just for her but for a lot of people, how much
you get of the former depends a lot on how much you get of the
latter.Incidentally, if you saw Jessica at a public event, you would never
guess she
hates attention, because (a) she is very polite and (b) when she's
nervous, she expresses it by smiling more.[3]
The existence of people like Jessica is not just something
the mainstream media needs to learn to acknowledge, but something
feminists need to learn to acknowledge as well. There are successful
women who don't like to fight. Which means if the public conversation
about women consists of fighting, their voices will be silenced.There's a sort of Gresham's Law of conversations. If a conversation
reaches a certain level of incivility, the more thoughtful people
start to leave. No one understands female founders better than
Jessica. But it's unlikely anyone will ever hear her speak candidly
about the topic. She ventured a toe in that water a while ago, and
the reaction was so violent that she decided "never again."
Thanks to <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, and
<NAME> for reading drafts of this. And yes, <NAME>,
who made me cut surprisingly little.
|
|
https://github.com/dyc3/senior-design | https://raw.githubusercontent.com/dyc3/senior-design/main/user-personas.typ | typst | = User Personas <Chapter::UserPersonas>
== Persona 1
#figure(
image("figures/persona.jpeg", width: 20%),
caption: "<NAME>"
)
#table(
[*Name:* <NAME>],
[*Goals*],
[*Shared Moments:* Jake seeks ways to create shared experiences with friends, whether it's through watching videos or playing online games.],
[*Easy Connectivity:* He's looking for platforms that effortlessly bring friends together virtually.]
)
== Persona 2
#figure(
image("figures/persona_2.png", width: 20%),
caption: "<NAME>"
)
#table(
[*Name:* <NAME>],
[*Goals*],
[*Easy Setup:* Tommy is looking for horizontal scaling that's fast and intuitive to setup.],
[*Affordability:* Tommy is an independent developer without much extra money, he's looking for something affordable.]
)
== Persona 3
#figure(
image("figures/persona_2.png", width: 20%),
caption: "<NAME>"
)
#table(
[*Name:* <NAME>],
[*Goals*],
[*Reliability:* Eric leads a development team making an MMO, he needs to choose a solution with high avalibility],
[*Support:* Eric and his team are on a tight deadline. He's looking for support in case something goes wrong during development or in production.]
)
|
|
https://github.com/gongke6642/tuling | https://raw.githubusercontent.com/gongke6642/tuling/main/布局/率/率.typ | typst | #image("屏幕截图 2024-04-16 174046.png") |
|
https://github.com/barddust/Kuafu | https://raw.githubusercontent.com/barddust/Kuafu/main/src/Analysis/integer.typ | typst | #import "/mathenv.typ": *
= The integers
If we want to build a new number system, we have to start from the basic bricks, which is the numbers themselves. However, we have no such ability to define the numbers; they are so abstrct and obscure, although we do have a little consciousness on them.
We do not talk about what numbers to be or should be, instead how any two of them are said to be equal. And then we need to check if the equvialence is well-defined, i.e., whether "=" satisfies the following three conditions when given any $a,b,c$ in this number system:
+ $a = a$;
+ $a = b <=> b = a$;
+ $a = b and b = c => a = c$.
Next we can define addition, and deduce the laws of addition. And multiplication and laws of multiplication. Then the order of numbers and rules accordingly.
Finally, it is necessary to tell the advantages of the new number system we have just made. Why we need it? How can we use it in applications?
== Definition of Integers
#definition(name: "Integers")[
Let $a,b$ be natural numbers. We define an _integer_ as a _ordered pair_ $(a,b)$. For another intger $(c,d)$, we define:
$
(a,b) = (c,d) <=> a + d = c + b
$
We let $ZZ$ denote the set of all integers.
]
#remark[
An ordered pair is a form consisting of two objects. For $(a,b)$, "ordered" means that $(a,b) != (b,a)$ does not always hold.
]
#remark[
In fact, integers are derived from substraction of natural numbers. The definition above actually tells that $(a,b) = (c,d)$ means $a - b = c - d$. In this way, we can introduce new object, like negative numbers, implicitly. We will see a similar defnition in rational numbers.
]
#remark[
The integers $(n,0)$ behave in the same way as the natural numbers $n$. It is easy to show that the equality of two integers $(n,0)$ and $(m,0)$ is actually the equality of two natural numbers $n$ and $m$. And it also holds in addition and multiplication, and all the other laws.
]
== Addition
#definition(name: "Addition of integers")[
Give two integers $(a,b)$ and $(c,d)$, we define the sum of two integers by formula:
$
(a,b) + (c,d) := (a+c, b+d)
$
]
#remark[
We have to check if our definition of addition and multiplication is _well-defined_, which means *given equal inputs, we shall obtain equal outputs*.
]
#proposition(name: "Addition of integers are well-defined")[
Let $a,b,c,d,x,y$ be natural numbers. If $(a,b) = (c,d)$, then:
+ $(a,b) + (x,y) = (c,d) + (x,y)$;
+ $(x,y) + (a,b) = (x,y) + (c,d)$.
]
#proof[
By definition we have $a + d = b + c$.
#pf(num:1)[Adding $x+y$ for both sides, we obtain:]
$
a + d + x + y &= b + c + x + y\
(a+x) + (d+y) &= (c+x) + (b+y)\
&arrow.b.double\
(a+x, b+y) &= (c+x, d+y)\
&arrow.b.double\
(a,b) + (x,y) &= (c,d) + (x,y)
$
Proof for 2 is similar since addition of natural numbers is commutative and associative.
]
#proposition(name: "Laws of addition for integers")[
Let $x,y,z$ be integers.
$
x + y = y + x\
x + (y + z) = (x + y) + z\
x = y <=> x + z = y + z
$
]
#proof[
Let $x = (a,b), y = (c,d), z = (e,f)$.
#pf(num:1)[]
$
x + y &= (a,b) + (c,d)\
&= (a + c, b + d)\
&= (c + a, d + b)\
&= (c,d) + (a,b) = y + x
$
#pf(num:2)[]
$
(x + y) + z &= ((a,b) + (c,d)) + z\
&= (a + c, b + d) + (e,f)\
&= (a + c + e , b + d + f)\
&= (a + (c + e), b + (d + f))\
&= (a,b) + ((c + e, d + f))\
&= x + ((c,d) + (e,f)) = x + (y + z)
$
#pf(num:3)[]
$
x + z = y + z &<=> (a + e, b + f) = (c + e, d + f)\
&<=> a + e + d + f = b + f + c + e\
&<=> a + d + (e + f) = b + c + (e + f)\
&<=> a + d = b + c\
&<=> x = y
$
]
== Multiplication
#definition(name: "Multiplication of integers")[
Give two integers $(a,b)$ and $(c,d)$, we define the product of two integers by formula:
$
(a,b) times (c,d) := (a c + b d, b c + b c)
$
]
#lemma[
Let $(a,b)$ be an integer. Then $(a,b)=0$ iff $a=b$.
]
#proof[
$
(a,b) = 0 &<=> (a,b) = (0,0) \
&<=> a + 0 = b + 0\
&<=> a = b
$
]
#lemma[
$forall a,b in ZZ(a b = 0 => a = 0 or b = 0)$.
]
#proof[
To produce contradiction, we assume that $a != 0 and b != 0$. In this way, we have to let $a = (n_1,m_1)$ and $b = (n_2,m_2)$.
Since $a,b$ are both non-zero, we have $n_1 != m_1$ and $n_2 != m_2$. Without loss of generality, we assume that $n_1 > m_1$ and $n_2 > m_2$. This just matters in the end, but it is also easy to fix this.
$
a dot b &= (n_1,m_1) dot (n_2,m_2)\
&= (n_1 n_2 + m_1 m_2, n_1 m_2 + m_1 n_2)\
&= 0
$
By lemma, we have $n_1 n_2 + m_1 m_2 &= n_1 m_2 + m_1 n_2$. By definition of the order for natural numbers, there exist non-zero natural numbers $e_1,e_2$, such that $n_1 = m_1 + e_1$ and $n_2 = m_2 + e_2$, and hence
$
(m_1 + e_1)(m_2 + e_2) + m_1 m_2 &= (m_1 + e_1)m_2 + m_1(m_2 + e_2)\
m_1 m_2 + e_1 m_2 + m_1 e_2 + e_1 e_2 + m_1 m_2 &= m_1 m_2 + e_1 m_2 + m_1 m_2 + m_1 e_2\
e_1 e_2 &= 0
$
we obtain that at least one of $e_1,e_2$ must be zero. However, these two are both non-zero, a contradiction.
]
#proposition(name: "Laws of multiplication for integers")[
Let $x,y,z$ be integers. Then we have
$
x y = y x\
x (y z) = (x y) z\
x (y + z) = x y + x z\
x = y => x z = y z
$
]
#proof[Omitted]
#definition(name: "Negation of integers")[
Let $(a,b)$ be an integer, we define $(b,a)$ as the _negation_ of $(a,b)$, denoted as $-(a,b)$.
]
#definition(name: "Substraction of integers")[
Let $a,b$ be integers. We define the _subtraction_ of these two integers by the formula
$
x - y := x + (-y)
$
]
#remark[
We can define substraction on integers, and the operation is closed, which means the difference of two integers is still a integer (it is not when it comes to natural numbers).
]
#lemma[
$forall x,y in ZZ( -(x dot y) = (-x) dot y = x dot (-y))$
]
#proof[
We just are about to prove $- (x dot y) = (-x) dot y$ since the other one is similar.
Let $x = (n_1,m_1)$ and $y = (n_2,m_2)$. Then
$
- (x dot y) &= -((n_1,m_1) dot (n_2,m_2))\
&= -((n_1 n_2 + m_1 m_2, n_1 m_2 + m_1 n_2))\
&= (n_1 m_2 + m_1 n_2, n_1 n_2 + m_1 m_2)
$
and
$
(-x) dot y &= -(n_1, m_1) dot (n_2,m_2)\
&= (m_1,n_1) dot (n_2,m_2)\
&= (m_1 n_2 + n_1 m_2, m_1 m_2 + n_1 n_2)
$
Prove done here.
]
#proposition(name: "Cancellation law for integers")[
$forall x,y,z in ZZ ((x z = y z and z != 0) => (x = y))$.
]
#proof[
$
x z &= y z\
x z + (- y z) &= y z + (- y z)\
x z + (- y) z &= 0\
(x + (-y)) z &= 0
$
Since $z != 0$, we obtain $x + (-y) = 0$. Adding $y$ on both sides we obatin $x = y$.
]
== Ordering of the integers
#definition(name: "Ordering of the integers")[
Let $n,m$ be integers.
- We say that $n$ is _greater than or equal to_ $m$, and write $n >= m$ or $m <= n$, iff there exists some natural number $a$ such that $n = m + a$;
- We say that $n$ is _greater than_ $m$, and write $n > m$ or $m < n$, iff there exists some natural number $a$ such that $n = m + a$, and $n != m$;
]
#remark[
For "greater than", we still have the equivalent definition like natrual numbers does: there exists a positive natural number $a$, such that $n = m + 1$ if $n > m$.
]
#proposition(name: "Properties of order")[
Let $a,b,c$ be integers.
+ $a > b <=> a - b > 0$;
+ $a > b => a + c > b + c$;
+ $a > b and c > 0 => a c > b c$;
+ $a > b => - a < - b$;
+ $a > b and b > c = > a > c$;
+ Exactly one of the statements $a>b$, $a<b$ or $a=b$ is true.
]
#remark[
For convenience, we use symbol $NNN$ to represent the set of positive natural numbers.
]
#proof[
Let $a = b + e$ for some positive natural number $e$.
#pf(num:1)[
$a>b <=> a = b + e <=> a - b = e > 0$
]
#pf(num:2)[]
$
a &= b + e \
a + c &= b + e + c\
&= (b +c) + e\
$
and hence $a + c > b +c$.
#pf(num:3)[]
$
a &= b + e\
a c &= (b + e)c\
&= b c + e c
$
since $e$ and $c$ are both non-zero, then $a c > b c$.
#pf(num:4)[]
$
a &> b\
a + (-a) + (-b) &> b + (-a) + (-b)\
-b &> -a
$
#pf(num:5)[Let $b = c + f$ for some positive natural number $f$.]
$
a &= b + e\
&= (c + f) + e\
&= c + (f + e)
$
Since $e$ and $f$ are both positive, $f + e$ is positive, and hence $ a > c$.
#pf(num:6)[
We need to prove that
- At most one of them is true, i.e., if two of them happen, then it comes a contradiction.
- At least one of them is true. This can be done by induction.
]
#noin[
_Step 1_#h(1em)By definition, $a > b$ and $a = b$ cannot be both true, so are $a < b$ and $a = b$. Therefore we need to show that $a > b$ and $a < b$ cannot be both true.
]
Suppose they are, and hence
$
exists e in NN_+ (a = b + e)\
exists f in NN_+ (b = a + f)\
arrow.b.double\
a = a + f + e
$
thus we have $e + f = 0$, furthermore, $e = 0 and f = 0$. This is a contradiction since $e$ and $f$ are both positive.
In summary, at most one of those three is true.
#noin[
_Step 2_#h(1em) Like how we do in the proof for the trichotomy for natural numbers, we induct on $a$, fixing $b$. The rest part is similar.
]
]
|
|
https://github.com/ymgyt/techbook | https://raw.githubusercontent.com/ymgyt/techbook/master/math/math.typ | typst | #set text(font: "New Computer Modern")
= 数
#include "number/number.typ"
#include "function/function.typ"
= 行列
#include "matrix/linear_transformation.typ"
#include "matrix/rotation_matrix.typ"
|
|
https://github.com/Dherse/boxaroo | https://raw.githubusercontent.com/Dherse/boxaroo/main/README.md | markdown | MIT License | # Boxaroo: simple & coloful info boxes for Typst
Boxaroo is a collection of functions to create colorful boxes that you can use in your document to break up long text and make it more readable, or to highlight important information. It was originall part of my thesis template, but I decided to make it a separate package so that it can be used by others as well.
```ts
#import "@preview/boxaroo:0.1.0": boxaroo, binfo
#show: boxaroo
#binfo(footer: "It even has a footer")[
This is an info box for all of your important information.
]
```

## Initialization
Boxaroo, just like many other packages, needs to be initialized, this is done with the show rule on the `boxaroo` function:
```typ
#show: boxaroo
```
Once you have done this action, boxaroo is ready to use!
## Pre-made boxes
Boxaroo comes with a few pre-made boxes that you can use right away:
```typ
#import "@preview/boxaroo:0.1.0": boxaroo, binfo, bdefinition, bquestion, bimportant, bconclusion, bnote
#binfo[Info box.]
#bdefinition[Definition box.]
#bquestion[Question box.]
#bimportant[Important box.]
#bconclusion[Conclusion box.]
#bnote[Note box.]
```

## Custom boxes
You can declare custom boxed by name using the `define-format` function:
```typ
#import "@preview/boxaroo:0.1.0": define-format
#define-format(
"bubblegum",
stroke-color: rgb(255, 0, 129)
)
#bbox(kind: "bubblegum")[
This is awfully pink! And it doesn't even have an icon.
]
```

The following parameters are available:
- `stroke-color`: the color of the stroke
- `fill-color`: the color of the fill
- `icon`: the icon to use (any content is allowed)
- `preifx`: the prefix to use for the box
## Overriding parameters
You can also use `define-format` to override the default boxes.
## Additional arguments
The `bbox` function takes a number of additional arguments:
- `kind`: which lets you chose the kind manually
- `radiu`: the radius of the corners
- `footer`: the footer text
- `breakable`: whether the box can be broken over multiple pages
- `icon`: whether to use an icon or not |
https://github.com/FrightenedFoxCN/typst-math-chinese | https://raw.githubusercontent.com/FrightenedFoxCN/typst-math-chinese/main/test/basic.typ | typst | #import "../template.typ": *
#show: doc => conf(doc)
#makecontent()
= 引言
这是一份中文的测试文稿。
我们使用 `makecontent` 指令添加了一个目录。
_这是一个强调块_
$ a^2 + b^2 = c^2 $ <pydagoras>
*这一部分被加粗了*
#quote(author: "作者")[这是一段非常非常非常非常非常长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长的引文。]
#quote()[这是一段非常非常非常非常非常长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长的引文,不知道谁说的。]
#quote(author: "作者")[
这是一段很短的引文。
]
== 下面的小节使用小数字
#lorem(50)
#lorem(100)
== 继续到下一节
#quote()[#lorem(30)]
$ (a^2 + b^2)(c^2 + d^2) >= ((a c)^2 + (b d)^2)^2 $ <cauchy>
是它的一个自然推广。
== 下面这一节测试一些数学模块
#def(supplement: "对象")[以下是定义的内容。]
#def(supplement: "范畴")[
我们称以下资料构成一个范畴……
#lorem(50)
]
#def[如果想要在定义中使用列表,我们希望:
- 对于 bullet list 的 marker
- 它的颜色也是定义的强调色
- 例如在此是蓝色
+ 对于 numbered list 我们
+ 希望也是如此
+ 但是目前参照其源代码中 `numbering` 的写法
+ 看起来还没法实现
]
#thm(
[这里是一个定理。],
proof: [这里是它的证明。],
supplement: "这里是补充说明"
) <thm_ref>
#thm(
[这里是一个没有证明的定理。],
supplement: "这里是补充说明"
)
#coro(
[推论和定理共用计数器。]
)
#lemma(
[引理也是。]
)
#ex(
[这里是一个习题。答案太简单了,所以不给出。],
supplement: "这里是补充说明"
)
#ex(
[这里是一个习题。],
solution: [算了,还是写一下答案吧。],
supplement: "这里是补充说明"
)
#rm[
这是一个注记。
#lorem(50)
]
#conj[
我们也可以添加上猜想。
]
#eg(supplement: "这里是一个例子")[
我们也可以在这里加上一个例子,它由虚线和正文分隔开,字体为楷体以示区分。
]
== 这里测试一下代码块
```rs
fn helloworld() {
println!("helloworld!");
}
```
== 这里测试一些额外功能的可能性
可以使用 `#endofchapter()` 开启新的章节。
#endofchapter()
= 这里是第二章
#thm(
[在新的章节中,定理等环境的编号都会被重置。],
proof: [你看代码去啊!]
)
#endofchapter()
#show : doc => set-appendix(doc)
= 这是一个附录
== 在附录中的小标题将使用字母
#def[
附录中的定义和定理
]
#prop[
也都应该重新编号.
] |
|
https://github.com/Free-Aaron-Li/learning_computer_networking | https://raw.githubusercontent.com/Free-Aaron-Li/learning_computer_networking/master/chapter1/chapter1.typ | typst | #import "../typst/template/reference.typ": POINT,NOTE,TIP,cn_fake-italic,indent,example,example_dc,line_cs,line_end,line_dc,regular_script,THEOREM
#import "../typst/template/page/basic.typ":basic
#import "@preview/tablem:0.1.0": tablem
#let center_title = [
LEARNING \ Computer Networking \
#text(size: 15pt)[A Top-Down Approach]
]
#show:doc=>basic(
title: center_title, // 标题
authors: ((
name: "aaron.li",
affiliation: "pzhu",
email: "<EMAIL>",
),),
doc,
chapter: 1,
)
= 计算机网络和因特网
#image("./asset/image/计算机网络与因特网.png")
目的:不仅能够理解今天的网络,也能理解明天的网络。
== 什么是因特网
我们主要用*公共因特网*作为讨论的主要载体。
对因特网,主要从两个方面描述:
1.因特网的具体构成:基本硬件和软件组建
2.根据分布式应用提供服务的联网基础设施
=== 具体构成描述
*主机*(host,*端系统*(end system)),例如:PC、手机、平板等。
端系统通过*通信链路*(communication link)和*分组交换机*(packet switch)的网络连接在一起。
通信链路由不同物理媒介(同轴电缆、铜线、光纤和无线电频谱)组成。不同链路具有不同的*传输速率*(transmission
rate,以比特/秒(bit/s,或bps)度量)。
两台端系统发送数据时,会将数据分段并在每段首部加上字节。由此形成的信息包称为*分组*(packet)。
常见的分组交换机有*路由器*(router)和*链路层交换机*(link-layer switch)。链路交换机通常用于接入网中,路由器通常用于网络核心中。
从发送端系统到接收端系统,一个分组所经历的一系列通信链路和分组交换机成为通过该网络的*路径*(route或path)。
类比:分组类似于卡车,通信链路类似于高速公路和公路,分组交换机类似于交叉口,端系统类似于建筑物。
端系统通过*因特网服务提供商*(Internet Service
Provider,ISP)接入因特网。每个ISP自身就是一个网络(由多台分组交换机和多段通信链路组成),每个ISP网络独立管理,并运行IP协议,遵从一定的命名和地址规则。
端系统、分组交换机和其他因特网部件运行多个*协议*(protocol),由协议控制因特网中信息的接收和发送。
*TCP*(Transmission Control Protocol,传输控制协议)和*IP*(Internet
Protocol,网际协议)是因特网中最重要的两个协议。IP协议定义了路由器和端系统之间发送和接收的分组格式。因特网的主要协议统称为*TCP/IP*。
*因特网标准*(Internet standard)由因特网工程任务组(Internet Engineering Task
Force,IETF)研发。IETF的标准文档称为*请求评论*(Request For Comment,RFC)。RFC文档往往技术性很强并且相当详细。
=== 服务描述
从#regular_script[应用程序程序提供服务的基础设施]的角度描述因特网,对于因特网应用(运行在端系统之上)来说,由于它们需要涉及多个相互交换数据的端系统,所以被称为*分布式应用*(distributed
application)。
那么产生描述因特网的另一种方式:用于应用的平台。不同端系统上的应用该如何进行数据交换?,对此的解决方案是:与因特网相连的端系统提供了一套*套接字接口*(socket
interface),该接口规定了一系列发送程序必须遵循的规则集合。
同样,因特网上也存在一个套接字接口用于向接收数据的程序交付数据。
=== 什么是协议
网络协议类似于人类协议,在因特网中,涉及两个及以上远程通信实体的所有活动都受协议的约束。
*协议*(protocol)定义了在两个或多个通信实体之间交换的报文的格式和顺序,以及报文的发送/接受或其他事件所采取的操作。
计算机网络*广泛*使用协议,掌握计算机网络知识的过程就是理解网络协议的构成、原理和工作方式的过程。
== 网络边缘
将与因特网连接的计算机或其他设备称为端系统(因为位于因特网的边缘)。
主机有时会被划分成*客户机*(client)和*服务器*(server)两部分。
=== 接入网
*接入网*,指将端系统物理连接到其*边缘路由器*(edge router)的网络。边缘路由器是端系统到任何其他远程端系统的路径上的第一台路由器。
==== 家庭接入:DSL、电缆、FTTH和5G固定式无线
在本书中,提到美国家庭与因特网连接(即宽带住宅接入)一般采用*数字用户线*(Digital Subscriber
Line)或电缆。用户一般通过本地电话公司(也就是其ISP)获得DSL因特网接入,该过程大致如下:
$
"家庭PC" <==> "DSL调制解调器" <==> "分频器" <==> "中心局的复用器(DSLAM)" <==> "因特网"
$
#indent DSL调制解调器的作用是将数字数据转换为高频音,通过电话线传输给本地中心局。同时中心局得到的模拟信号在DSLAM处被转换回数字形式。因为普通的电话信道与数据传输信道的频段不同,使得单根DSL线路能够被共享使用。
#figure(
tablem(
ignore-second-row: false,
align: center,
)[
|信道|频段|传输速率| |普通双向电话信道|0\~4k Hz频段|| |中速上行信道|4k Hz \~ 50k Hz频段|3.5M bps和16M bps|
|高速下行信道|50k Hz \~ 1M Hz频段|24M bps和52M bps|
],
caption: [
DSL传输速率
],
)#indent
由于DSL受到传输距离、双绞线规格和电气干扰程度的影响,一般而言住宅速率小于最大速率。如果住宅不是位于本地中心局的5\~10英里范围内,那么该住宅必须采用其他形式的因特网接入。(事实上,在我国住宅的因特网接入通常是选择光纤到户方式)。
DSL利用的是本地电话基础设施,那么另一项接入方式*电缆因特网接入*(cable Internet access)则是利用有线电视基础设施。大致过程如下:
$
"500~5000个家庭" <==> "同轴电缆" <==> "光纤节点" <==> "光缆" <==> "电缆头端的CMTS" <==> "因特网"
$
#indent 光缆将电缆头端连接到地区枢纽,在该系统中既用到电缆又用到光缆,所以经常被称为*混合光纤同轴*(Hybrid Fiber Coax,HFC)系统。
电缆接入因特网需要*电缆调制解调器*(cable modem)和*电缆调制解调器端接系统*(Cable Modem Termination
System,CMTS)。与DSL一样,HFC网络也划分为上行下行两个不对称信道。
#figure(
tablem(
ignore-second-row: false,
align: center,
)[
|信道|DOCSIS 2.0标准|DOCSIS 3.0标准| |上行信道|30M bps|100M bps| |下行信道|40M bps|1.2G bps|
],
caption: [
HFC传输速率
],
)#indent
由于电缆因特网接入的一个重要特征是*共享广播媒体*,所以当几个用户同时经下行信道下载文件,每个用户接收文件的实际速率将大大低于电缆总计的下行信道(这与DSL的个人信道不同)。但另一方面,如果活跃用户较少,那么用户几乎能够以全部的下行速率接收文件。
因为在接入同一个电缆因特网的用户很少会同一时刻发送请求,所以上行信道也是共享的,但是还是需要一个#regular_script[分布式多路访问协议]来协调传输和避免碰撞。
相对来讲,上述的两种接入网方式都已经过时了,现在更多的是采用光纤入户和5G无线。
*光纤到户*(Fiber To The Home,FTTH)。一般来讲是提供一条从本地中心局直接到家庭的光纤路径,以此提供高速传输速率(大概能提供100M
bps至1G bps [2024])。
光纤分布方案一般有以下三种:
#pad(x: 2em)[
+ 直接光纤。从本地中心局到每户设置一根光纤
+ 从本地中心局出来的光纤在邻近家庭间进行共享,在这种分配方式下,存在两种光纤分布体系结构
- *有源光纤网络*(Active Optical Network,AON)
- *无源光纤网络*(Passive Optical Network,PON)
AON本质上就是交换以太网。
]
在PON分布体系结构下的FTTH,每个家庭都有一个*光纤网络端接器*(Optical Network
Terminator,ONT),在国内通常称为“光猫”。其通过专用光纤连接到邻近分配器(splitter),再由分配器将一些家庭连接到一根共享光纤上,由该光纤连接到本地中心局的*光纤线路端接器*(Optical
Line Terminator,OLT)上。大概过程如下:
$
"众多家庭的ONT" <==> "光纤分配器" <==> "中心局的OLT" <==> "因特网"
$
OLT和ONT进行光信号和电信号之间的转换,以此传递因特网信息。
最后一种接入方式:*5G固定式无线*。使用波束成形技术,数据通过无线方式从供应商的基站发送到家中的调制解调器。
==== 企业(和家庭)接入:以太网和WiFi
现如今,更多的环境使用*局域网*(LAN)将端系统连接到边缘路由器上。通常采用的局域网技术是以太网,以太网用户使用双绞线与一台以太网交换机相连,再与因特网相连,实现100M
bps或1G
bps乃至更大的传输速率。
同样在无线LAN环境下,无线用户通过一个接入点传输数据,该接入点再与有线因特网连接。例如:基于IEEE 802.11技术的无线LAN接入(更通俗称为WiFi)。
==== 广域网无线接入:3G、LTE 4G和5G
通过使用蜂窝移动电话相同的无线基础设施,利用蜂窝网提供商运营的基站来发送和接收分组。在广域网下,用户可以位于基站数万米外通信。
=== 物理媒介
简要概述在因特网中使用的传输媒介。
在端系统通信的过程中,比特通过一系列“传输器-接收器对”进行传递。对于每个传输器-接收器对,该比特通过传播电磁波或光脉冲的方式跨越某种*物理媒介*(physical
medium)进行发送。物理媒介具有多种形状和形式,例如:双绞铜线、同轴电缆、多模光纤电缆、陆地无线电频谱和卫星无线电频谱。
物理媒介可以分为两种类型:
#pad(x: 2em)[
+ *导引型媒介*(guided media),电波或光脉冲沿着固体媒介前进,如光纤、同轴电缆或双绞铜线。
+ *非导引型媒介*(unguided media),电波在空气或外层空间中传播,如无线局域网、数字卫星频道等。
]
#indent 虽然并不想讨论使用这些媒介的成本问题,但对现实生活中的一些实际情况这是不可避免的。物理链路(铜线、电缆)的实际成本相对于其他网络成本通常是*相当小*的。但是其劳动成本又比材料成本高出几个数量级。所以在现代都市中,开发商往往会在住宅中同时安装双绞线、光缆和同轴电缆,以节省经费(避免将来再铺设另外的线缆)。
下面开始正式介绍常见的物理媒介:
==== 双绞铜线
#figure(image("./asset/image/七类双绞线.jpeg", width: 60%), caption: [
七类双绞线
])#indent
最便宜且最常用的导引型传输媒介,在一百来年的历史中,一直用于电话网。通过两根线(构成了一条通信链路)绞合在一起,以减少邻近类似的双绞线的*电气干扰*,并在这些双绞线外覆盖上保护性防护层。无屏蔽双绞线常用在建筑内的计算机网络中,即局域网中。目前局域网中双绞线的传播速率为10M
bps \~ 10G
bps@双绞线 。所能够达到的传输速率取决于导线路径以及传输方与接收方之间的距离。
#figure(
tablem(
ignore-second-row: false,
align: center,
)[
|网线类型|八类网线|七类网线|超六类网线| |传输速率|40G bps|10G bsp| 10G bps| |频率宽带|2000M Hz|600M Hz|
500M Hz| |传输距离|30米|100米|100米| |导体(对)|8|8|8| |线缆类型|双层屏蔽|双层屏蔽|屏蔽\非屏蔽|
|应用环境|高速带宽环境|高速带宽环境|大型企业高速应用|
],
caption: [
双绞线传输速率
],
)<双绞线>#indent
虽然现如今光纤被广泛运用,但是在高速LAN环境下,双绞线仍然是主导性解决方案。
==== 同轴电缆
#figure(image("./asset/image/同轴电缆.png", width: 50%), caption: [
同轴电缆
])#indent
同轴电缆由两根铜导体组成(与双绞线类似,但是导体是同心而非并行)。同轴电缆在电缆电视系统中应用相当普遍。
在电缆电视和电缆因特网接入中,发送设备将数字信号调制到某个特定的频段,产生的模拟信号从发送设备传送到一个或多个接收方。同轴电缆能被用作导引型*共享媒介*(shared
medium)。
==== 光纤
#figure(image("./asset/image/光纤.png", width: 60%), caption: [
光纤
])#indent
光纤是用于导引光脉冲的媒介。每个脉冲表示一个比特,通常一根光纤能够支持极高的比特速率,在商用领域为100G bps乃至400G bps(甚至在实验室中达到26T
bps)。由于光纤不受电磁干扰,对长达100km的光缆信号衰减极低,并且很难窃听。这些特征使得光纤成为长途导引型传输媒介,广泛使用于长途电话网络、因特网主干等。
==== 陆地无线电信道
无线电信道使用电磁频谱传输信号,由于无需安装物理链路,很适合移动用户使用。但是无线电信道极大依赖于传播环境和传播距离。
陆地无线电信道大致分三类:
#pad(x: 2em)[
+ 运行在很短的距离
+ 运行在局域
+ 运行在广域
]
==== 卫星无线电信道
通信卫星通过地面站的发送的信号转发实现信号的传输。在通信中常用到两类卫星:*同步卫星*(geostationary
satellite)和*近地卫星*(Low-Earth Orbiting,LEO)。
同步卫星永久停留在地球上方的同一个点上,但是由于近地轨道距离地球36000km,造成客观的信号时延。
近地卫星需要围绕着地球旋转,所以需要发射多个卫星(并且这些卫星彼此之间能够通信),例如:星链计划。
== 网络核心
网络核心,由互联网特网端系统的分组交换机和链路构成的网状网络。
在网络链路和交换机移动数据上有两种基本方法:*分组交换*(packet switching)和*电路交换*(circuit switching)。
=== 分组交换
端系统间彼此交换*报文*(message)。报文可以是数据,也可以是控制功能。
从源端系统发送到目的端系统的一个报文,源端将会把长报文划分为小的数据块,称为*分组*(packet)。在运输途中由通信链路和*分组交换机*(packet
switch)完成。
如果从某源端系统或者分组交换机经过某一个链路发送一个$L$ bit的分组,该链路的传输速率为$R$ bps,那么该链路传输该分组的时间为$L/R$ s
==== 存储转发传输
多数分组交换机在链路的输入端使用*存储转发传输*(store-and-forward
transmission)机制。其指在交换机开始向输出链路传输该分组的第一个比特之前,必须接收到整个分组。
在一般情况下(不考虑传播时延):通过由$N$条速率均为$R$ bps的链路组成的路径,从源端系统到目的端系统发送一个分组,其端到端时延是
$
d_("end-end")=N L/R
$
==== 排队时延和分组丢失
每台分组交换机往往会与多条链路连接,对于每条相连的链路,该分组交换机具有*输出缓存*【output buffer,也称为*输出队列*(output
queue)】,用于*存储*路由器准备发送那条链路的分组。
如果已经到达交换机的分组准备发往某条链路,但是那条链路正在传输其他分组,那么该分组必须在输出缓存中等待【这种情况称为*排队时延*(queuing
delay)】。排队时延是变化的,其变化程度取决于网络的拥塞等级。
如果某台交换机的缓存空间已满,那么到达的分组或者已经排队的分组之一将会被丢弃【这种情况称为*分组丢失(丢包)*(packet loss)】。
==== 转发表和路由选择协议
不同的计算机网络会以不同方式进行分组转发,在因特网中,每个端系统都具有一个称为*IP地址*的地址。IP地址具有一种等级结构,源会在传输分组时将目的地的IP地址包含在其头部。当一个分组到达网络中的路由器时,路由器会检查该分组的IP地址的一部分,并将目的地址(或其一部分)映射为输出链路。
IP地址的等级结构类似于现实生活中的邮政地址,例如:四川省成都市武侯区……。邮政人员根据邮政地址进行分级投递,最终到达目的地。而在因特网中,路由器根据*转发表*进行检索,当发现适当的输出链路,便将分组导向该链路。
在路由器中,因特网具有一些特殊的*路由选择协议*(routing protocol),用于自动地设置每台路由器的转发表。例如,*开放最短路径优先*(Open
Shortest Path First,OSPF)协议能够找出每台路由器到目的地的最短路径。
=== 电路交换
电路交换的特点便是:在端系统间通信会话期间,#regular_script[预留]了端系统间沿路通信所需要的资源(缓存,链路传输速率)。经典例子便是传统的电话网络。在进行电话通信时,该网络必须为发送方与接收方创建一条#regular_script[名副其实]的连接,该路径上的交换机都将为该连接维护连接状态。用电话的术语表示,这条连接称为一条*电路*(circuit)。
何为电路,即是在两台主机之间创建一条*专用*的*端到端连接*(end-to-end
connection)。与分组交换不同点就在于,分组发送入网络后,并不会预留任何资源,因此当链路中出现阻塞时,会产生时延。这即是因特网(采用分组交换网络)特点:尽最大努力已及时方式交付分组,但它不做任何保证。
==== 电路交换网络中的复用
链路中的电路通过*频分复用*(Frequency-Division Multiplexing,FDM)或*时分复用*(Time-Division
Multiplexing,TDM)实现。
对于FDM,链路的频谱由跨越链路创建的所有连接共享。在连接过程中链路为每条连接专设一个频段。在电话网络中,这个频段的宽度通常是4k
Hz【频段的宽度也被称为*带宽*(band-width)】。同理,调频无线电台也使用FDM来共享88M Hz \~ 108M
Hz,其中每个电台被分配一个特定的频段。
对于TDM,时间被划分为固定时段的帧,每个帧又被划分为固定数量的时隙。当创建一条链路时,网络会指定每个帧的特定时隙用于传输数据(这些时隙就会被单独使用)。
分组交换的支持者总是说,电路交换不够经济,具体证明点有,
#pad(x: 2em)[
+ 在*静默期*(silent period)专用电路是空闲的
+ 创建端到端电路和预留端到端带宽是复杂的,需要复杂的信令软件以协调沿端到端路径的交换机的操作
+ 电路交换的传输时间与链路数量无关
]#indent
==== 分组交换与电路交换的对比
分组交换与电路交换之争的有趣讨论参见@molinaro-fernandez2002ip。
对二者的分歧点我们用实例说明:
#line_dc
#example_dc(
title:[
假定多个用户共享一条1M bps的链路,用户的活跃周期是变化的。活跃期间,用户以100k bps的恒定速率产生数据,静止期间不产生数据,且乎仅有$10 percent$的时间活跃。如果采用电路交换,必须为每个用户预留100k bps的传输速率。
],
solutions:[
如果采用电路交换,那么仅支持$"1M bps"/"100k bps"=10$个并发用户。如果采用分组交换,如果有35个用户,当存在11个或更多并发活跃用户的概率大约为$0.0004$,反之概率高达$0.9996$。在这种概率下,聚合数据的速率是小于或等于该链路的输出速率(100M bps)。
综上所述,在极大概率下,分组交换获得与电路交换相同的性能。
]
)
#example_dc(
title:[
假定有10个用户,某个用户突然产生1000个大小为1000bit的分组,其他用户保持静默。
],
solutions:[
在每帧(1s)具有10个时隙并且每个时隙包含1000bit的TDM电路交换情况下,活跃用户传输完成需要10s时间,而在分组交换情况下,该用户能够以1M bps的满速完成任务,只需要1s的时间。
]
)
#line_dc
电路交换不考虑需求,而预先分配了传输链路,这使得已分配而并不需要的链路时间未被利用。另一方面,分组交换#regular_script[按需]分配链路,链路传输能力将在所有需要在链路上传输分组的用户之间逐分组地被共享。
未来的趋势无疑是朝着分组交换方向发展。 |
|
https://github.com/noahjutz/AD | https://raw.githubusercontent.com/noahjutz/AD/main/components/lefttree.typ | typst | #import "/config.typ": theme
#let lefttree(nodes, i: 0) = {
let node = (nodes.at(i),)
if nodes.len() > 2 * i + 1 {
node.push(lefttree(nodes, i: 2*i+1))
}
if nodes.len() > 2*i+2 {
node.push(lefttree(nodes, i: 2*i+2))
}
return node
}
#let name_to_index(name) = {
if name.at(0) == "g" {
name = name.slice(1)
}
let turns = name.split("-").map(s => int(s)).slice(1)
let i = 0
for turn in turns {
if turn == 0 {
i = 2*i+1
} else {
i = 2*i+2
}
}
return i
}
#let index_to_name(index) = {
if index == 0 {
return "tree.0"
}
let turns = ()
while index > 0 {
let is_right = calc.rem(index, 2) == 0
if is_right {
turns.push("1")
} else {
turns.push("0")
}
index = calc.div-euclid(index - 1, 2)
}
turns = turns.rev()
return "tree.0-" + turns.join("-")
}
#let subtree(i, n) = {
let nodes = ()
let queue = (i,)
while queue.len() > 0 {
let node = queue.remove(0)
if node < n {
nodes.push(node)
let l = 2*node+1
let r = 2*node+2
if l < n {queue.push(l)}
if r < n {queue.push(r)}
}
}
return nodes
}
// Most functions from here must be called from within a canvas that contains a tree with a named anchor "tree".
#import "@preview/cetz:0.3.0"
#import cetz.draw: *
#import cetz.coordinate: resolve
#import cetz.vector as vec
#let connect(from, to, fun) = {
from = index_to_name(from)
to = index_to_name(to)
intersections("i", {
hide(fun(from, to))
hide(circle(from, radius: 10pt))
if from != to {
hide(circle(to, radius: 10pt))
}
})
fun("i.0", "i.1")
}
#let bent_line(from, to, bend: 0, ..args) = get-ctx(ctx => {
let (ctx, from_abs, to_abs) = resolve(
ctx,
from,
to
)
let length = vec.dist(to_abs, from_abs)
let mid = (from, 50%, to)
rotate(90deg, origin: mid)
hide(line(from_abs, to_abs, name: "perp"))
bezier-through(
from,
("perp.start", (bend+1)/2 * 100%, "perp.end"),
to,
..args
)
rotate(-90deg, origin: mid)
})
#let box_around(..nodes, pad: 14pt, fun) = get-ctx(ctx => {
let min_x = calc.inf
let max_x = -calc.inf
let min_y = calc.inf
let max_y = -calc.inf
for node in nodes.pos() {
let name = index_to_name(node)
let (_, (x, y, z)) = resolve(ctx, name)
min_x = calc.min(min_x, x)
max_x = calc.max(max_x, x)
min_y = calc.min(min_y, y)
max_y = calc.max(max_y, y)
}
let (_, a, b) = resolve(ctx, (0, 0), (0, pad))
let dist = vec.dist(a, b)
min_x -= dist
max_x += dist
min_y -= dist
max_y += dist
fun(
(min_x, min_y),
(max_x, max_y)
)
})
#let poly_fill(..points, fill: theme.success_light) = {
line(
..points,
close: true,
stroke: (
paint: fill,
thickness: 32pt,
join: "round"
),
fill: fill,
)
}
#let polygon_around(..nodes, fun) = get-ctx(ctx => {
assert(nodes.pos().len() >= 2)
let is_right_turn(p1, p2, p3) = {
return vec.len(
vec.cross(
vec.as-vec(vec.sub(p2, p1)),
vec.as-vec(vec.sub(p3, p2))
)
) <= 0
}
// Get absolute position of nodes
let points = nodes.pos().map(n => {
let name = index_to_name(n)
let (_, (x, y, z)) = resolve(ctx, name)
(x, y)
})
// Get initial point for Graham Scan
points = points.sorted(key: ((x, y)) => {(y, x)})
let lowest = points.remove(0)
// Sort by polar angle, farthest first
points = points.sorted(key: point => (
vec.angle2(lowest, point),
-vec.dist(lowest, point)
))
points.insert(0, lowest)
// Construct stack
let stack = points.slice(0, 2)
for (i, point) in points.enumerate().slice(2) {
while stack.len() >= 2 and is_right_turn(point, stack.at(-1), stack.at(-2)) {
point = stack.pop()
}
stack.push(point)
}
fun(..stack)
})
#let note(ang: 0deg, at, body) = {
ang = calc.rem(ang.deg(), 360)
if ang < 0 {ang += 360}
ang = eval(str(ang) + "deg")
let to = index_to_name(at)
let from = (rel: (0, 28pt), to: to)
rotate(ang, origin: to)
intersections("i", {
hide(circle(to, radius: 10pt))
hide(line(from, to))
})
line(
from, "i.0",
name: "line",
stroke: theme.fg_light,
mark: (end: ">")
)
content(
"line.start",
frame: "rect",
padding: 2pt,
stroke: none,
anchor: if 22.5deg < ang and ang <= 67.5deg {"south-east"}
else if 67.5deg < ang and ang <= 112.5deg {"east"}
else if 112.5deg < ang and ang <= 157.5deg {"north-east"}
else if 157.5deg < ang and ang <= 202.5deg {"north"}
else if 202.5deg < ang and ang <= 247.5deg {"north-west"}
else if 247.5deg < ang and ang <= 292.5deg {"west"}
else if 292.5deg < ang and ang <= 337.5deg {"south-west"}
else {"south"},
text(fill: theme.fg_light, body)
)
rotate(-ang, origin: to)
}
#let number(at, body) = {
let pos = index_to_name(at)
content(
(rel: (-20pt, 0), to: pos),
fill: black,
stroke: none,
frame: "circle",
padding: 4pt,
place(
center + horizon,
text(
fill: white,
size: 9pt,
weight: "bold",
body
)
)
)
}
#let fade(at, ang: 0deg) = {
let to = index_to_name(at)
let from = (rel: (28pt, 0), to: to)
rotate(ang, origin: to)
intersections("i", {
hide(circle(to, radius: 10pt))
hide(line(from, to))
})
line(
from, "i.0",
name: "line",
stroke: gradient.linear(
black, white,
angle: -ang
),
)
rotate(-ang, origin: to)
}
#let draw_node(
node,
hl_primary: (),
hl_secondary: (),
hl_tertiary: (),
hl_success: (),
..sink
) = {
let index = name_to_index(node.name)
hl_primary = (hl_primary,).flatten()
hl_secondary = (hl_secondary,).flatten()
hl_tertiary = (hl_tertiary,).flatten()
hl_success = (hl_success,).flatten()
content(
(),
frame: "circle",
fill: if index in hl_primary {theme.primary_light}
else if index in hl_secondary {theme.secondary_light}
else if index in hl_tertiary {theme.tertiary_light}
else if index in hl_success {theme.success_light}
else {white},
padding: 7pt,
place(center + horizon, node.content),
)
}
#let loop_line(from, to, ang: 0deg) = {
rotate(ang)
bezier(
from,
to,
(rel: (16pt, 20pt), to: from),
(rel: (-16pt, 20pt), to: to),
mark: (symbol: ">")
)
rotate(-ang)
} |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/valkyrie/0.1.1/src/ctx.typ | typst | Apache License 2.0 | #let ctx-proto = (
strict: false,
soft-error: false,
// TODO(james)
coerce: false,
)
/// Appends options to a context. Used for setting the context of child parses.
///
/// - parent (ctx, none): Current context (if present), to which contextual
/// flags passed in variadic arguments are appended.
/// - ..args (arguments): Variadic contextual flags to set. Positionala rguments are discarded.
#let z-ctx(parent: (:), ..args) = ctx-proto + parent + args.named()
|
https://github.com/GabrielDTB/basalt-backlinks | https://raw.githubusercontent.com/GabrielDTB/basalt-backlinks/main/src/backlinks.typ | typst | MIT License | #let package-name = "basalt-backlinks"
#let package-uuid = "8cfa7814-461b-4cd7-8779-8e8b334e3b95"
#let prefix = package-uuid + ":" + package-name + ":"
/// Show rule for generating backlinks.
///
/// #show link: backlinks.generate
#let generate(it) = {
if type(it.dest) != label {
return it
}
let target = str(it.dest)
return [
#it
#metadata(it.body)
#label(prefix + target)
]
}
/// Get an array of the locations of links
/// that point to a given label.
///
/// Requires context.
#let get(target) = {
query(label(prefix + str(target)))
}
|
https://github.com/nafkhanzam/typst-common | https://raw.githubusercontent.com/nafkhanzam/typst-common/main/src/templates/formal.typ | typst | #import "../common/dates.typ": ID-display-today
#let template(body) = {
// ~ Setups
// set document(title: title, author: author-name)
set page(
paper: "a4",
margin: (
x: 2cm,
y: 3cm,
),
)
set par(justify: true, linebreaks: "optimized")
set text(font: "FreeSerif", size: 12pt, fallback: false, hyphenate: false)
set block(below: 1.5em)
body
}
#let sign-part(
use-info: true,
name: [<NAME>],
city: [Sidoarjo],
date-display: ID-display-today,
info: [Yang membuat pernyataan,],
sign: none,
) = {
set align(left)
if not use-info {
info = none
}
let sign-part = if sign != none {
sign
} else {
v(6em)
}
grid(
columns: (1fr, auto, 2em),
[],
[
#city, #date-display
#info
#sign-part
#name
],
[],
)
}
|
|
https://github.com/EunTilofy/Compiler2024 | https://raw.githubusercontent.com/EunTilofy/Compiler2024/main/hw/编译原理-Chapter4.typ | typst | #import "../template.typ": *
#show: project.with(
course: "编译原理",
title: "Compilers Principals - Chapter4",
date: "2024.4.05",
authors: "<NAME>, 3210106357",
has_cover: false
)
*Problems:4.2.*
#HWProb(name: "4.2")[
Implement Program 4.4 as a recursive-descent parser, with the semantic actions embedded in the parsing functions.
]
\
```plain
// Program 4.4
%{
typedef struct table *Table_;
Table_ {string id; int value; Table_ tail};
Table_ Table(string id, int value, struct table *tail); (see page 13)
Table_ table=NULL;
int lookup(Table_ table, string id) {
assert(table!=NULL);
if (id==table.id) return table.value;
else return lookup(table.tail, id);
}
void update(Table_ *tabptr, string id, int value) {
*tabptr = Table(id, value, *tabptr);
}
%}
%union {int num; string id;}
%token <num> INT
%token <id> ID
%token ASSIGN PRINT LPAREN RPAREN
%type <num> exp
%right SEMICOLON
%left PLUS MINUS
%left TIMES DIV
%start prog
%%
prog: stm
stm : stm SEMICOLON stm
stm : ID ASSIGN exp {update(&table,ID,$3);}
stm : PRINT LPAREN exps RPAREN {printf("\n");}
exps: exp {printf("%d ", $1);}
exps: exps COMMA exp {printf("%d ", $3);}
exp : INT {$$=$1;}
exp : ID {$$=lookup(table,$1);}
exp : exp PLUS exp {$$=$1+$3;}
exp : exp MINUS exp {$$=$1-$3;}
exp : exp TIMES exp {$$=$1*$3;}
exp : exp DIV exp {$$=$1/$3;}
exp : stm COMMA exp {$$=$3;}
exp : LPAREN exp RPAREN {$$=$2;}
```
\
\
\
*Solution*:
\
```cpp
enum token {
ID, INT, PLUS, MINUS, TIMES, DIV, COMMA,
LPAREN, RPAREN, PRINT, SEMICOLON, ASSIGN
};
union tokenval { string id; int num; };
enum token tok;
union tokenval tokval;
typedef struct table *Table_;
Table_ {string id; int value; Table_ tail};
Table_ Table(string id, int value, struct table *tail);
Table_ table = NULL;
int lookup(Table_ table, string id)
{
assert(table != NULL);
if(id == table.id) return table.value;
else return lookup(table.tail, id);
}
void update(Table_ *tabptr, string id, int value)
{
*tabptr = Table(id, value, *tabptr);
}
void eatOrSkipTo(int expected, int *stop)
{
if(tok == expected) eat(expected);
else skipto(stop);
}
int SMT_follow[] = { SEMICOLON, COMMA };
void SMT(void)
{
switch(tok)
{
case ID:
string id = tokval.id;
if (lookahead() == ASSIGN)
{
advance();
update(table, id, E());
}
skipto(SMT_follow);
break;
case PRINT:
advance();
if(lookahead() == LPAREN)
{
L();
eatOrSkipTo(RPAREN, SMT_FOLLOW);
}
break;
default:
printf("expected ID or PRINT\n");
skipto(SMT_FOLLOW);
}
}
int L_follow[] = { COMMA, SEMICOLON, RPAREN };
void L(void)
{
switch(tok)
{
case ID:
case INT:
printf("%d", E());
break;
default:
printf("expected ID or INT\n");
skipto(L_follow);
}
}
int EXP_follow[] = { SEMICOLON, PLUS, MINUS, TIMES, DIV, RPAREN };
int EXP()
{
switch(tok)
{
case ID:
int i = loopup(table, tokval.id);
token pre = lookahead();
if(pre == PLUS || pre == MINUS || pre == TIMES || pre == DIV)
{
advance();
return Binary(i);
}
advance();
return i;
case INT:
int i = tokval.num;
token pre = lookahead();
if(pre == PLUS || pre == MINUS || pre == TIMES || pre == DIV)
{
advance();
return Binary(i);
}
advance();
return i;
case LPAREN:
int i = E();
token pre = lookahead();
if(pre == RPAREN) return i;
else { skipto(EXP_follow); return 0; }
default:
print("expected ID, INT, LPAREN\n");
skipto(EXP_follow);
return 0;
}
}
int Binary_follow[] = { ID, INT, LPAREN };
int Binary (int v)
{
switch(tok)
{
case PLUS:
advance(); return v + EXP();
case MINUS:
advance(); return v - EXP();
case TIMES:
advance(); return v * EXP();
case DIV:
advance(); return v / EXP();
default:
printf("expected some Binary Operator\n");
skipto(Binary_follow);
return 0;
}
}
```
|
|
https://github.com/kznr02/neet-cv | https://raw.githubusercontent.com/kznr02/neet-cv/main/cv-sample.typ | typst | MIT License | #import "template.typ": project, info, job, glory, education, activity, proj, skill, certification, commit
#project()[
#info("蓬莱山辉夜", "114514", "<EMAIL>", "null", "本科", "https://github.com/kznr02", "", "", "./kaguya.jpg")
#education("寺子屋", "neet的自我修养", "本科", "幻想乡学院", ("難題「龍の頸の玉 -五色の弾丸-」", "難題「仏の御石の鉢 -砕けぬ意思-」", "難題「火鼠の皮衣 -焦れぬ心-」", "難題「燕の子安貝 -永命線-」", "難題「蓬莱の弾の枝 -虹色の弾幕-」"), "2003年12月", "2004年8月")
#job(c: (
(
"月都",
"月之公主",
"xxx年y月",
"2004年8月",
"在月都坐着当花瓶(;´д`)ゞ"
),
)
)
#glory(c:
(
(
"xxxx",
"yyyy年,zzzz年",
),
(
"xxxx",
"yyyy年,zzzz年",
),
(
"xxxx",
"yyyy年,zzzz年",
),
)
)
#proj(c:
(
(
"东方永夜抄",
"6面boss",
"2003年12月",
"至今",
"永琳救救我!",
"https://thwiki.cc/%E4%B8%9C%E6%96%B9%E6%B0%B8%E5%A4%9C%E6%8A%84"
),
(
"东方文花帖",
"Level 9 Boss",
"2005年11月",
"至今",
"阿巴阿巴",
"https://thwiki.cc/%E4%B8%9C%E6%96%B9%E6%96%87%E8%8A%B1%E5%B8%96"
),
(
"东方心绮楼",
"背景观众",
none,
none,
"前面忘了,后面忘了",
"https://thwiki.cc/%E4%B8%9C%E6%96%B9%E5%BF%83%E7%BB%AE%E6%A5%BC"
)
)
)
#activity(c:
(
(
"月都",
"月之公主",
"xxx年09月",
"2003年12月",
"当花瓶"
),
(
"永远亭",
"还是公主",
"2003年12月",
"至今",
"当neet"
)
)
)
#skill("拥有操纵永远和须臾的能力。\r永远就是没有历史,未来永劫不会降临的世界。在那世界就算有活动,也和停止时间一样。\r永远亭突然出现在人类的历史上,在人类历史上刻下痕迹,有可能是她解开了永远的魔法。否则施下了永远魔法的永远亭,就会一直隐藏在迷途竹林之中,永不出现在人类的历史之上吧(×2永远亭这名字也成为了物语。)。\r不过,在永远的世界里是拒绝任何变化的。说不定她也是一直活了很久,而没有变化。\r还有一种能力就是须臾,相对永远是一瞬的时间。\r她能集合人类无法感知的一瞬间,以此来使用和行动。\r集合了须臾的时间也是在时间中流动,人类们却完全无法感知。\r利用这时间就能弄出复数不同的历史来。\r无论是哪种能力,都是操纵时间的能力,是种对普通人类来说过于强大的能力。")
#certification(c:
(("永夜抄lnb",), ("霓虹语,英格利希都可以啦",))
)
#commit("她是永远亭的公主。不清楚她正在干什么。")
]
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/set-06.typ | typst | Other | // Error: 19-24 expected boolean, found integer
#set text(red) if 1 + 2
|
https://github.com/ohmycloud/computer-science-notes | https://raw.githubusercontent.com/ohmycloud/computer-science-notes/main/Misc/coursier.typ | typst | #let box_title(body) = {
set text(weight: "regular")
show: box.with(
fill: luma(249),
inset: 1em,
radius: 3pt,
baseline: 0.4em,
width: 100%,
)
[#body]
}
#show heading.where(level: 1): it => {
set text(size: 18pt, fill: red)
align(center)[#it.body]
}
#show heading.where(level: 2): it => {
set text(size: 16pt, fill: rgb(54, 123, 128))
align(center)[#box_title(it.body)]
}
#show raw.where(block: true): block.with(
fill: luma(240),
inset: 10pt,
radius: 4pt,
width: 100%,
)
= 使用 coursier 安装 Scala
== 安装
在 #underline(link("https://get-coursier.io/docs/cli-installation")[get-coursier.io])
下载 Coursier。
== 启动
下载并设置完毕后, 启动 scala3 的 REPL:
```bash
cs launch scala3
```
== 加载依赖
启动 Scala3 的时候, 加载依赖:
```bash
cs launch org.typelevel::cats-effect:3.5.2 scala3
import cats.effect.IO
import cats.implicits._
import cats.effect.unsafe.implicits.global
```
加载多个依赖:
```bash
cs launch org.typelevel::cats-effect:3.5.2 co.fs2::fs2-core:3.9.3 scala3
import fs2._
```
多个依赖之间使用空格分隔。
单独下载依赖:
```bash
cs fetch -p org.typelevel::cats-effect:3.5.2
```
== 在 REPL 中加载 object
```scala
import cats.effect.IO
object model {
opaque type Currency = String
object Currency {
def apply(name: String): Currency = name
extension (currency: Currency) def name: String = currency
}
}
object IoExercise extends App {
import model._
import cats.implicits._
def exchangeTable(from: Currency): IO[Map[Currency, BigDecimal]] = {
IO.delay(exchangeRatesTableApiCall(from.name)
.map(x => (Currency(x._1), x._2))
)
}
}
```
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/058%20-%20Duskmourn%3A%20House%20of%20Horror/010_Dead%20End.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Dead End",
set_name: "Duskmourn: House of Horror",
story_date: datetime(day: 29, month: 08, year: 2024),
author: "<NAME>",
doc
)
Morning broke, the lesser sun rising lonely in the western sky and doing what little it could to beat back the ever-present gloom. The greater sun had been gone for months, swallowed up by that terrible … #emph[thing] … that had sprouted from the city. According to the ones who'd managed to escape the city's grasp, it had been a house in the beginning, as simple and unnatural as any other. It had been possessed of walls, ceilings, windows, a roof. Perhaps it was still a house, somewhere within the nightmare tangle of tendrils and bulges that it had become. Perhaps it still had all those pieces, all those things that a person of the city would look at and say "house." But if that was the case, House no longer kept them on display.
Oh, House had windows, glass eyes that opened and closed along the bulk of it, seeming to watch the narrow protectorate remaining from the natural world. And it had walls, for what is a wall but a distinction between one thing and another? A skin is a wall, if looked at from the right direction.
Shevara stood high in one of the ancient, dreaming beech trees, counting windows as they reflected the lesser sun's pale light across the landscape. House watched her in silent, menacing stillness. No one ever saw it move. That was the necessity of the watches. They lost sight of the great edifice at night, when even the signal fires couldn't possibly allow a view from every angle, but during the day, they could trade off their observation spots and their watchtowers, they could keep their eyes open, and they could count the windows set into House's skin, using them to make guesses about what direction it might try to take within the light of day.
It had all come so very quickly. When this all began, a scant handful of years ago, the elves of the Rotrue Wood had viewed it as a sickness of city, born to city, swallowing city for its crimes against the natural world. Surely, the swelling horror they watched from their borders would stop when it had finished consuming its makers. Surely, it would come no closer to the ancient, tangled trees.
And for a time, it had behaved exactly as they expected. It had swallowed city and then grown outward, following roads and rails and highways to richer feeding grounds. The elves of other woods had sent word when House was first seen in their territories, when it covered the mountains, when it consumed the sea. They had warned the elves of the Rotrue, again and again, "You are not safe." House was coming.
One by one, those warnings had ceased, their messengers vanishing from the sky, messages sent out unreturned. The elves of the Rotrue might well be the last yet living outside the walls of House. The thought was a terrible one, and Shevara faltered, almost losing count of the windows. That they might be the last elves in all the world … it was a horror beyond all consideration, an idea too terrible to bear.
But bear it she must. Bear it they all must. If they were all that remained of the natural world, then they would hold their heads high and remember that life always won, in the end. Death and decay were natural things, and from them, new life would begin. House could not defeat them as long as they clung to the cycle.
It had been a year into what Shevara could only consider the siege, when House had stretched one tall, terrible tower into the sky, a spindly, glass-sided thing taller than any tree had ever grown, piercing the clouds. One tower window had opened wide, so large that it was visible even from the ground, and then it had slammed shut, and the greater sun was gone, leaving the lesser sun to shine alone, as it had never been intended to do.
House was an ever-changing, ever-protean entity. For a time, the greater sun's light had beamed through the tower walls, until gradually the tower had been pulled closer and closer to the ground, absorbing back into the bulk of House. Until finally, one day, the tower was gone, and the greater sun's light was gone as well, and the eternal gloom that was all that remained had fallen over them.
The last refugees of the city had arrived that very day, wounded and winded, limping into the safety of the trees with the few possessions they'd managed to save clutched tightly in their arms. The clan's leadership had been there to meet them, and to explain the terms of sanctuary.
"Whatever blight this is, city brought it on themselves," said the king, his once booming voice hollow and pale from months of terror and privation. Crops didn't grow without the light of the greater sun, and the game of the forest was increasingly underfed and difficult to catch. Resources were running low, and the king ate only after the more vulnerable had been fed. "No machines. None of your clever creations. They aren't allowed among our trees."
Some of the refugees had protested, as they always did. They loved their comforts and the proof of their ingenuity. They loved to feel better than the world around them. Well, look what their love had wrought. The king had held firm, as he always did, and in the end, only a handful had chosen to risk being swallowed by House rather than leave their toys at the forest's edge. The rest had abandoned their forbidden machinery and joined the elves in the fading green, and from them, much had been learned of House, for they were the ones who had survived the longest in its hunting grounds.
It swallowed the world around it like a fungus consumes a piece of ripe fruit, spreading first across the skin and then devouring deeper, until there was nothing left of the original form. Its first incursions were sometimes architectural and strange; a door where no door should be, a window frame tangled in the branches of a tree; a baseboard without a wall. But those specks of House would begin to grow rooms around themselves, and what it surrounded, it possessed.
Other signs were less clear, if no less dangerous. Moths that flew in the middle of the day, wings like brocade or intricate as snowflakes. Human children who appeared out of nowhere without anyone to supervise them, playing at clapping games and skip-rope, their chants filled with menacing cruelties. The children were the worst sign of all, according to the refugees; once you saw the children, House was almost upon you, like an angler viper that couldn't resist flashing its lure at prey already well entangled.
Shevara finished her count, finding the number of windows to be the same as it had been the night before, if somewhat more focused to the north, and descended toward the ground, dropping from branch to branch with ease. The Rotrue might be the last free forest in the world, but it was still a beautiful one. The trees had always blocked most of the light from reaching the ground; the plants which grew there were used to doing so in darkness, shrouded in shadow as they put forth flowers and fruit. And the game might be thin and sparse, but there was enough. Their druids would make sure of it. The forest would provide, as it had always provided, and House, with nothing left to claim, would surely wither into bitter memory.
She was still some branches away from the forest floor when she heard rhythmic, unfamiliar clapping. The hair on the back of her neck stood up, the flesh on her arms drawing itself into hard, uncomfortable lumps. She shivered and began to move toward the sound, more slowly than before. She was a warrior of the Rotrue. She had a responsibility to her clan.
Peering down, she saw a small circle of human children, five in total, dressed in summer clothing, too light for the current chill, their faces drawn into expressions of serious concentration as they clapped in an intricate pattern, each smacking palms with the two to either side.
#emph["Knock, knock, knock at the hidden door:] #linebreak #emph[It isn't hidden anymore.] #linebreak #emph[It takes its victims, two, three, four.] #linebreak #emph[You can't escape the hidden door.]
#emph[Knock, knock, knock on the hungry door.] #linebreak #emph[No point in running anymore.] #linebreak #emph[You'll learn just what it has in store] #linebreak #emph[When you unlock the hungry door] …"
The children. Shevara went cold, the fear becoming an almost physical thing. If the children were here, then House was in the forest. They had missed something. The watch, or the daily patrols of the border, had missed something.
Shevara grabbed the nearest branch, swinging herself higher into the tree, and began to run through the trees, choosing speed over silence. Snapped twigs and rustling leaves marked her progress toward the center of the Rotrue, until she dropped down outside the circle of the elders, falling immediately into a respectful crouch, one knee pressed to good, honest earth, the other providing a rest for her forehead. She supplicated herself before the forest, and only hoped that it would protect her.
"Shevara?" The king's voice, unsure and uneasy. "You bow before me, daughter? What's happened?"
"House." She raised her head. "House is in the forest. I saw the children, playing at their clapping game, in a clearing near the western tree line. We've missed something. House is here."
"House would never dare," he said, offering his hand to pull her from the ground. "We are beloved of the trees, and none of House's city seeds have been carried in this deep."
"We #emph[missed] something," she insisted. "House is here."
"Peace, child. Peace." He sighed. "We'll wait for the other scouts to return and see how many of them have seen House."
"But sire—"
"We wait."
#figure(image("010_Dead End/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
He pulled her with him into the circle, and she sat, sullen in the knowledge that she had done her duty and been rewarded with idleness when she knew what she'd seen. The tangled undergrowth around her seemed suddenly full of shapes she couldn't explain—the outline of a door, the four-paneled sharpness of a window. Shuddering, she wrapped her arms around herself and looked away.
One by one, the other scouts returned. None of them had seen anything like she reported. All were jumpy, flinching and looking behind themselves as they gathered, rubbing their arms like they were chasing away a chill. One young hunter paused near Shevara, and she leaned toward him, asking, "Are you #emph[sure] you didn't see anything?"
He looked at her with the moon-wide eyes of a frightened colt and hurried away to stand with the others.
The king walked back toward her, a regretful expression on his face. "Shevara …"
"I know what I saw!" She stood as she spoke, as if height would lend her authority. "House is #emph[here] !"
"House will never be here," he said. "We have strong trees to protect us, and no taint of city beneath our boughs. Calm yourself, lest you speak your nightmares into being."
There would be no understanding here. Shevara clenched her fists and turned her face away before she could disrespect her king and thus shame herself further than she already had.
The daytime scouts were at their posts. The dawn scouts were all recalled. As they began to make their reports of the night she slipped away, into the tangled brush. She knew what she had seen. She knew what was coming. But no one would #emph[listen] .
After she had wandered a while, she saw them, another circle of unattended human children, their faces turned toward the dim sunlight filtering through the trees, eyes closed and hands clapping fast enough to become a blur.
#emph["There used to be a house next door.] #linebreak #emph[There's not a house there anymore.] #linebreak #emph[Duskmourn got restless, reaching out,] #linebreak #emph[It followed fear, it followed doubt.] #linebreak #emph[It ate that house up, nails and all.] #linebreak #emph[It ate the windows and the walls.] #linebreak #emph[It ate the roof—when it was through,] #linebreak #emph[It bared its teeth and ate me, too.] #linebreak #emph[And soon the House will swallow you."]
On the final word, they opened their eyes as one and turned toward Shevara, standing silent among the trees. She shied away, then turned and ran as the sound of clapping began again.
She returned to the circle of elders to find it silent and still, the hunters and the king sitting slumped with eyes closed and moths alighting in their hair. She ran to the king, frantically slapping the moths away, until they were gone and he clutched her arms, raising his head.
"Shevara?" he asked, sounding baffled. "What's—?"
"House is here," she said, resignation choking her. She gestured to the motionless hunters around them, the moths still resting in their hair. "It's too late. We were the last forest in the world, and we lost. The Rotrue is fallen."
The king straightened, turning her so that her back was to his chest, and put his arms around her waist, holding her close as the delicate filigree of silver-tinted wood that had started growing up from the trees around them wove together in a spire overhead, the spaces between vines already beginning to fill in with glass panes as House constructed its conservatory, with the last of the elves inside. Sunlight through the glass would create an artificial summer; winter would never come. The cycle was broken, and so the world had lost, and House had won.
The walls grew strong. The glass grew thick. The elves of the Rotrue joined the other survivors, scrambling to survive inside the walls of House, and House was the world, and the world was held inside those halls, those rooms, like a cruel and clutching hand.
No one noticed on the day when House took the lesser sun.
There was no one left outside to see.
|
|
https://github.com/Isaac-Fate/booxtyp | https://raw.githubusercontent.com/Isaac-Fate/booxtyp/master/src/theorems/proposition.typ | typst | Apache License 2.0 | #import "./new-theorem-template.typ": new-theorem-template
#let proposition = new-theorem-template("Proposition") |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/touying/0.1.0/slide.typ | typst | Apache License 2.0 | #import "utils/utils.typ"
#import "utils/states.typ"
#import "utils/pdfpc.typ"
// touying pause mark
#let pause = [#"<touying-pause>"]
// parse a sequence into content, and get the repetitions
#let _parse-content-with-pause(self: utils.empty-object, need-cover: true, base: 1, index: 1, ..bodies) = {
let bodies = bodies.pos()
let result-arr = ()
// repetitions
let repetitions = base
// get cover function from self
let cover = self.methods.cover.with(self: self)
for it in bodies {
// if it is a function, then call it with self
if type(it) == function {
// subslide index
self.subslide = index
it = it(self)
}
// parse the content
let result = ()
let cover-arr = ()
let children = if utils.is-sequence(it) { it.children } else { (it,) }
for child in children {
if child == pause {
repetitions += 1
} else if child == linebreak() or child == parbreak() {
// clear the cover-arr when linebreak or parbreak
if cover-arr.len() != 0 {
result.push(cover(cover-arr.sum()))
cover-arr = ()
}
result.push(child)
} else if type(child) == content and child.func() == list.item {
// handle the list item
let (conts, nextrepetitions) = _parse-content-with-pause(
self: self, need-cover: repetitions <= index, base: repetitions, index: index, child.body
)
let cont = conts.first()
if repetitions <= index or not need-cover {
result.push(list.item(cont))
} else {
cover-arr.push(list.item(cont))
}
repetitions = nextrepetitions
} else if type(child) == content and child.func() == enum.item {
// handle the enum item
let (conts, nextrepetitions) = _parse-content-with-pause(
self: self, need-cover: repetitions <= index, base: repetitions, index: index, child.body
)
let cont = conts.first()
if repetitions <= index or not need-cover {
result.push(enum.item(child.at("number", default: none), cont))
} else {
cover-arr.push(enum.item(child.at("number", default: none), cont))
}
repetitions = nextrepetitions
} else if type(child) == content and child.func() == terms.item {
// handle the terms item
let (conts, nextrepetitions) = _parse-content-with-pause(
self: self, need-cover: repetitions <= index, base: repetitions, index: index, child.description
)
let cont = conts.first()
if repetitions <= index or not need-cover {
result.push(terms.item(child.term, cont))
} else {
cover-arr.push(terms.item(child.term, cont))
}
repetitions = nextrepetitions
} else {
if repetitions <= index or not need-cover {
result.push(child)
} else {
cover-arr.push(child)
}
}
}
// clear the cover-arr when end
if cover-arr.len() != 0 {
result.push(cover(cover-arr.sum()))
cover-arr = ()
}
result-arr.push(result.sum(default: []))
}
return (result-arr, repetitions)
}
// touying-slide
#let touying-slide(self: utils.empty-object, repeat: auto, setting: body => body, composer: utils.side-by-side, ..bodies) = {
assert(bodies.named().len() == 0, message: "unexpected named arguments:" + repr(bodies.named().keys()))
let bodies = bodies.pos()
let page-preamble(curr-subslide) = locate(loc => {
if loc.page() == self.first-slide-number {
// preamble
utils.call-or-display(self, self.preamble)
// pdfpc slide markers
if self.pdfpc-file {
pdfpc.pdfpc-file(loc)
}
}
[
#metadata((t: "NewSlide")) <pdfpc>
#metadata((t: "Idx", v: loc.page() - 1)) <pdfpc>
#metadata((t: "Overlay", v: curr-subslide - 1)) <pdfpc>
#metadata((t: "LogicalSlide", v: states.slide-counter.at(loc).first())) <pdfpc>
]
})
// update counters
let update-counters = {
states.slide-counter.step()
if self.appendix == false {
states.last-slide-counter.step()
states.section-step()
}
}
// page header and footer
let header = utils.call-or-display(self, self.page-args.at("header", default: none))
let footer = utils.call-or-display(self, self.page-args.at("footer", default: none))
// for speed up, do not parse the content if repeat is none
if repeat == none {
return {
header = update-counters + header
page(..(self.page-args + (header: header, footer: footer)), setting(
page-preamble(1) + composer(..bodies)
))
}
}
// for single page slide, get the repetitions
if repeat == auto {
let (_, repetitions) = _parse-content-with-pause(
self: self,
base: 1,
index: 1,
..bodies,
)
repeat = repetitions
}
if self.handout {
let (conts, _) = _parse-content-with-pause(self: self, index: repeat, ..bodies)
header = update-counters + header
page(..(self.page-args + (header: header, footer: footer)), setting(
page-preamble(1) + composer(..conts)
))
} else {
// render all the subslides
let result = ()
let current = 1
for i in range(1, repeat + 1) {
let new-header = header
let (conts, _) = _parse-content-with-pause(self: self, index: i, ..bodies)
// update the counter in the first subslide
if i == 1 {
new-header = update-counters + new-header
}
result.push(page(
..(self.page-args + (header: new-header, footer: footer)),
setting(page-preamble(i) + composer(..conts)),
))
}
// return the result
result.sum()
}
}
// build the touying singleton
#let s = (
// handle mode
handout: false,
// appendix mode
appendix: false,
// enable pdfpc-file
pdfpc-file: true,
// first-slide page number, default is 1
first-slide-number: 1,
// global preamble
preamble: [],
// page args
page-args: (
paper: "presentation-16-9",
header: none,
footer: align(right, states.slide-counter.display() + " / " + states.last-slide-number),
fill: rgb("#ffffff"),
),
// register the methods
methods: (
// cover method
cove: utils.wrap-method(hide),
update-cover: (self: utils.empty-object, is-method: false, cover-fn) => {
if is-method {
self.methods.cover = cover-fn
} else {
self.methods.cover = utils.wrap-method(cover-fn)
}
self
},
enable-transparent-cover: (
self: utils.empty-object, constructor: rgb, alpha: 80%) => {
// it is based on the default cover method
self.methods.cover = (self: utils.empty-object, body) => {
utils.cover-with-rect(fill: utils.update-alpha(
constructor: constructor, self.page-args.fill, alpha), body)
}
self
},
// dynamic control
uncover: utils.uncover,
only: utils.only,
alternatives-match: utils.alternatives-match,
alternatives: utils.alternatives,
alternatives-fn: utils.alternatives-fn,
alternatives-cases: utils.alternatives-cases,
// handout mode
enable-handout-mode: (self: utils.empty-object) => {
self.handout = true
self
},
// disable pdfpc-file mode
disable-pdfpc-file: (self: utils.empty-object) => {
self.pdfpc-file = false
self
},
// default slide
touying-slide: touying-slide,
slide: touying-slide,
// append the preamble
append-preamble: (self: utils.empty-object, preamble) => {
self.preamble += preamble
self
},
// default init
init: (self: utils.empty-object, body) => {
// default text size
set text(size: 20pt)
body
},
// default outline
touying-outline: (self: utils.empty-object, ..args) => {
states.touying-outline(..args)
},
appendix: (self: utils.empty-object) => {
self.appendix = true
self
}
),
) |
https://github.com/akai-omurbek/Typst-CV | https://raw.githubusercontent.com/akai-omurbek/Typst-CV/main/cv.typ | typst | #set page(
paper: "a4",
margin: (
top: 0.5cm,
rest: 1cm
)
)
#set par(justify: true)
#set text(
font: "Arial",
size: 12pt,
hyphenate:false
)
/* SHOW RULES | LABELS | ETC */
#show <cv>: it => [
#set align(center + horizon)
#set text(size: 16pt)
#upper(it)
]
#show <name>: it => [
#set align(center + horizon)
#set text(size: 20pt)
#underline(offset: 5pt, upper(it))
]
#show heading.where(level:2): it => [
#set align(center)
#set text(size: 12pt)
#upper(it.body)
]
/* FUNCS AND VARIABLES = FUNCS AND VARIABLES = FUNCS AND VARIABLES */
#let color1 = white
/*#let color1 = luma(230)*/
#let data = yaml("cv_info.yml")
#let myblock(text, radius: {0pt}, under: false, height: auto) = {
block(
width: 100%,
height: height,
fill: color1,
inset: 6pt,
spacing: 0pt,
above: 4pt,
below: 4pt,
radius: radius,
text +
if under {
line(
length: 100%,
stroke: 1pt,
)
}
)
}
#let iconlink(img,url) = {
stack(dir: ltr,spacing: 6pt,
box(
height: 1.5em,
inset: 0pt,
outset: 0pt,
image("media/" + img)
), align(left + horizon, text(size:11pt, link(url) ) )
)
}
#let workitem(inf) = {myblock(
grid(
columns: (35%,65%),
gutter: 2pt,
[ *#inf.at("dates")* #linebreak() _#inf.at("addr")_],
align(right, [ *#inf.at("pos")* \
_#inf.at("employer")_ ])
) + pad(top: 2pt,
[#for i in inf.at("notes") {
list(marker: sym.arrow.r.curve, i)
}
])
)
}
/* *********************************************** */
/* ********** DOCUMENT STARTS HERE *************** */
/* *********************************************** */
/* ********* TOP GRID [CV | NAME | INFO] ************* */
#grid(
columns: (15%,49%,36%),
gutter: 4pt,
/* ********** LEFT CELL (JUST CV)*************** */
myblock([
*C V* <cv>
],
radius: (top-left: 15pt),
under: false,
height: 45pt
),
/* ********** CENTRAL CELL [NAME] *************** */
myblock([
*#data.at("info").at("name")* <name>
],
under: false,
height: 40pt
),
/* ********** RIGHT CELL [INFO] *************** */
myblock(
stack(dir: ttb, spacing: 4pt,
stack(
dir: ltr,
spacing: 4pt,
box(height: 1.1em, image("media/phone.svg")),
box(height: 1.1em, image("media/telegram.svg")),
box(height: 1.1em, image("media/whatsapp.svg")),
align(
left + horizon,
data.at("info").at("phone")
)
),
stack(dir:ltr,
spacing: 4pt,
box(height: 1.1em, image("media/location.svg")),
align(
left + horizon,
data.at("info").at("address")
)
)
),
radius: (top-right: 15pt),
under: false,
height: 40pt
)
)
/* ******** MAIN GRID [WORK EXP | SIDEBAR] *********** */
#grid(
columns: (65%,35%),
gutter: 3pt,
/* ******* LEFT SIDE [WORK EXP] ******** */
myblock([== Work experience], under: true) +
for i in data.at("workplaces"){
workitem(i)
},
/* ******* RIGHT SIDE [SIDEBAR] ******** */
/* ****** E-Mail / Socials ******** */
myblock([== E-Mail / Socials], under: true) +
myblock(
stack(
dir:ttb,
spacing: 4pt,
iconlink("email.svg",data.at("info").at("email")),
iconlink("twitter.svg",data.at("info").at("twitter")),
iconlink("github.svg",data.at("info").at("github"))
)
) +
/* ****** Education ******** */
myblock([== Education] + line(
length: 100%,
stroke: 1pt,
)
) +
myblock(
for i in data.at("education"){[
*#i.at("degree")* \
_#i.at("from")_ \
#text(size:12pt, i.at("dates")) \
\
]}
) +
/* ****** Languages ******** */
myblock([== Languages], under: true) +
myblock(
stack(
dir: ltr,
spacing: 0pt,
for i in data.at("languages") [
*#i.at("cat"):* #h(1fr) #i.at("langs") \
]
)
) +
/* ****** Skills ******** */
myblock([== Technical skills], under: true) +
myblock(
stack(
dir: ltr,
spacing: 0pt,
for i in data.at("skills") [
*#i.at("name")* #h(1fr)
#for p in i.at("values") [
#h(1fr) #p \
]
]
)
) +
/* ****** Certificates ******** */
myblock([== Certificates], under: true) +
myblock(
stack(
dir: ltr,
spacing: 0pt,
for i in data.at("certificates") {[
- _\"#i.at("title")\"_, #i.at("dates")
]}
),
radius: (bottom-right: 10pt),
)
)
|
|
https://github.com/ClazyChen/Table-Tennis-Rankings | https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2013/WS-11.typ | typst |
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (1 - 32)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[1], [LI Xiaoxia], [CHN], [3441],
[2], [LIU Shiwen], [CHN], [3360],
[3], [DING Ning], [CHN], [3274],
[4], [#text(gray, "GUO Yan")], [CHN], [3257],
[5], [WU Yang], [CHN], [3156],
[6], [#text(gray, "GUO Yue")], [CHN], [3107],
[7], [ZHU Yuling], [MAC], [3028],
[8], [FENG Tianwei], [SGP], [3010],
[9], [CHEN Meng], [CHN], [3005],
[10], [FENG Yalan], [CHN], [2951],
[11], [SUH Hyo Won], [KOR], [2883],
[12], [WEN Jia], [CHN], [2850],
[13], [HAN Ying], [GER], [2848],
[14], [LI Fen], [SWE], [2835],
[15], [#text(gray, "DANG Yeseo")], [KOR], [2819],
[16], [KIM Kyungah], [KOR], [2812],
[17], [JIANG Huajun], [HKG], [2807],
[18], [CHENG I-Ching], [TPE], [2806],
[19], [SHEN Yanfei], [ESP], [2800],
[20], [ISHIKAWA Kasumi], [JPN], [2799],
[21], [LI Jiao], [NED], [2799],
[22], [RI Myong Sun], [PRK], [2796],
[23], [YANG Ha Eun], [KOR], [2774],
[24], [LI Xue], [FRA], [2770],
[25], [PAVLOVICH Viktoria], [BLR], [2767],
[26], [SHAN Xiaona], [GER], [2759],
[27], [FUKUHARA Ai], [JPN], [2745],
[28], [LEE Ho Ching], [HKG], [2742],
[29], [LI Xiaodan], [CHN], [2736],
[30], [MOON Hyunjung], [KOR], [2736],
[31], [WAKAMIYA Misako], [JPN], [2727],
[32], [YU Mengyu], [SGP], [2719],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (33 - 64)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[33], [<NAME>], [ROU], [2716],
[34], [PESOTSKA Margaryta], [UKR], [2714],
[35], [LI Jie], [NED], [2705],
[36], [LI Qian], [POL], [2704],
[37], [ZHAO Yan], [CHN], [2701],
[38], [LANG Kristin], [GER], [2698],
[39], [JEON Jihee], [KOR], [2685],
[40], [LIU Jia], [AUT], [2680],
[41], [#text(gray, "FUJII Hiroko")], [JPN], [2677],
[42], [EKHOLM Matilda], [SWE], [2676],
[43], [NI Xia Lian], [LUX], [2669],
[44], [HU Melek], [TUR], [2667],
[45], [WANG Xuan], [CHN], [2666],
[46], [KIM Hye Song], [PRK], [2662],
[47], [SAMARA Elizabeta], [ROU], [2661],
[48], [POTA Georgina], [HUN], [2659],
[49], [<NAME>], [JPN], [2655],
[50], [VACENOVSKA Iveta], [CZE], [2650],
[51], [<NAME>], [JPN], [2648],
[52], [TIE Yana], [HKG], [2639],
[53], [WINTER Sabine], [GER], [2631],
[54], [STRBIKOVA Renata], [CZE], [2624],
[55], [XIAN Yifang], [FRA], [2621],
[56], [YU Fu], [POR], [2617],
[57], [YOON Sunae], [KOR], [2616],
[58], [NONAKA Yuki], [JPN], [2606],
[59], [PARK Seonghye], [KOR], [2603],
[60], [SEOK Hajung], [KOR], [2601],
[61], [TIKHOMIROVA Anna], [RUS], [2595],
[62], [WU Jiaduo], [GER], [2589],
[63], [SZOCS Bernadette], [ROU], [2582],
[64], [<NAME>rene], [GER], [2580],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (65 - 96)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[65], [PASKAUSKIENE Ruta], [LTU], [2576],
[66], [KOMWONG Nanthana], [THA], [2570],
[67], [LEE I-Chen], [TPE], [2569],
[68], [CHOI Moonyoung], [KOR], [2568],
[69], [LEE Eunhee], [KOR], [2561],
[70], [DAS Ankita], [IND], [2553],
[71], [NG Wing Nam], [HKG], [2552],
[72], [HUANG Yi-Hua], [TPE], [2547],
[73], [BALAZOVA Barbora], [SVK], [2543],
[74], [BARTHEL Zhenqi], [GER], [2542],
[75], [KIM Jong], [PRK], [2542],
[76], [LOVAS Petra], [HUN], [2542],
[77], [RI Mi Gyong], [PRK], [2539],
[78], [POLCANOVA Sofia], [AUT], [2538],
[79], [<NAME>], [HUN], [2525],
[80], [#text(gray, "WU Xue")], [DOM], [2522],
[81], [SOLJA Petrissa], [GER], [2519],
[82], [MATSUZAWA Marina], [JPN], [2517],
[83], [PARK Youngsook], [KOR], [2515],
[84], [STEFANOVA Nikoleta], [ITA], [2514],
[85], [<NAME>], [USA], [2504],
[86], [<NAME>], [ITA], [2503],
[87], [MATSUDAIRA Shiho], [JPN], [2499],
[88], [FUKUOKA Haruna], [JPN], [2498],
[89], [CHEN Szu-Yu], [TPE], [2497],
[90], [#text(gray, "MOLNAR Cornelia")], [CRO], [2496],
[91], [ZHANG Mo], [CAN], [2495],
[92], [GU Yuting], [CHN], [2494],
[93], [MIKHAILOVA Polina], [RUS], [2492],
[94], [<NAME>], [SGP], [2490],
[95], [#text(gray, "TOTH Krisztina")], [HUN], [2489],
[96], [ISHIGAKI Yuka], [JPN], [2489],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (97 - 128)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[97], [KUMAHARA Luca], [BRA], [2482],
[98], [CECHOVA Dana], [CZE], [2480],
[99], [<NAME>], [CHN], [2479],
[100], [HAMAMOTO Yui], [JPN], [2479],
[101], [<NAME>], [ESP], [2479],
[102], [SONG Maeum], [KOR], [2474],
[103], [#text(gray, "MISIKONYTE Lina")], [LTU], [2472],
[104], [YAMANASHI Yuri], [JPN], [2471],
[105], [CHE Xiaoxi], [CHN], [2471],
[106], [<NAME>], [SRB], [2470],
[107], [<NAME>], [USA], [2470],
[108], [NG Sock Khim], [MAS], [2467],
[109], [<NAME>], [ENG], [2460],
[110], [#text(gray, "KANG Misoon")], [KOR], [2459],
[111], [PRIVALOVA Alexandra], [BLR], [2459],
[112], [<NAME>], [HKG], [2459],
[113], [<NAME>], [FRA], [2457],
[114], [<NAME>], [CHN], [2453],
[115], [STEFANSKA Kinga], [POL], [2452],
[116], [<NAME>], [AUS], [2452],
[117], [MADARASZ Dora], [HUN], [2448],
[118], [PARTYKA Natalia], [POL], [2446],
[119], [<NAME>], [AUT], [2444],
[120], [<NAME>], [TPE], [2441],
[121], [PAVLOVICH Veronika], [BLR], [2439],
[122], [#text(gray, "TANIOKA Ayuka")], [JPN], [2438],
[123], [FADEEVA Oxana], [RUS], [2438],
[124], [SUZUKI Rika], [JPN], [2436],
[125], [BILENKO Tetyana], [UKR], [2436],
[126], [LI Chunli], [NZL], [2434],
[127], [KATO Miyu], [JPN], [2432],
[128], [MESHREF Dina], [EGY], [2430],
)
) |
|
https://github.com/Error-418-SWE/Documenti | https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/3%20-%20PB/Documentazione%20interna/Verbali/24-02-26/24-02-26.typ | typst | #import "/template.typ": *
#show: project.with(
date: "26/02/24",
subTitle: "Meeting di Design Thinking",
docType: "verbale",
authors: (
"<NAME>",
),
timeStart: "15:10",
timeEnd: "16:50",
);
= Ordine del giorno
- Progettazione:
- Design pattern;
- Architettura;
- Diagramma ER.
- Pianificazione.
== Progettazione
=== Design pattern
Il gruppo ha cercato di determinare i design pattern da utilizzare nella progettazione del prodotto, e ha individuato le seguenti ipotesi:
- model-view pattern, in particolare il model-view-controller (MVC);
- repository pattern.
Il gruppo individua, inoltre, la possibilità di inserire il proxy pattern nel contesto della comunicazione con le API.
Sono sorti dei dubbi riguardo la possibilità che il model-view-controller sia già implementato nativamente nel framework Next.js. In questo caso la sua implementazione risulterebbe un lavoro che aggiungerebbe complessità non necessaria al prodotto. Il gruppo quindi si interroga su come comportarsi nel caso alcuni pattern siano già implementati all'interno di librerie o framework utilizzati.
Durante la discussione riguardo i pattern il gruppo considera la possibilità di non definire classi all'interno del codice. Questo nasce da due osservazioni:
- JavaScript non è un vero e proprio linguaggio ad oggetti;
- gli oggetti presenti nel prodotto, intesi come elementi grafici, non hanno comportamenti particolari che necessitano di essere raggruppati e organizzati.
In conseguenza di ciò, sorge la questione di come affrontare i design pattern in mancanza di vere e proprie classi, la quale verrà esposta tramite mail al #cardin.
=== Architettura
Il gruppo discute sulla scelta dell'architettura più adatta al prodotto da sviluppare, individuando infine l'architettura layered come opzione principale, in quanto l'architettura esagonale, alternativa presa in considerazione, pone molta attenzione sulla business logic, la quale non è presente nel capitolato in quanto il prodotto richiesto è un visualizzatore, e di conseguenza non sono presenti dati su cui eseguire modifiche o validazioni. Inoltre, la comunicazione tra componenti è unidirezionale: da database verso la presentation logic.
Si è concordato l'utilizzo di un monolite come architettura di deploy, vista la sua semplicità e velocità di sviluppo. Inoltre, non è presente un numero di moduli distinti tra loro tale da giustificare l'utilizzo di un'architettura a microservizi.
=== ER
Il gruppo concorda con l'utilizzo del primo schema ER prodotto, applicando i seguenti aggiornamenti:
- presenza di coordinate di posizionamento degli scaffali (verbale esterno del 22/02/2024);
- considerazione dei bin esterni come appartenenti ad un particolare scaffale con un unico ripiano ad altezza 0 e dimensioni uguali a quelle del piano;
- modifica della relazione bin-prodotti: ora i prodotti possono essere presenti nel database ma non essere assegnati a nessun bin.
== Pianificazione
Il gruppo contatterà via mail:
- il #cardin, per esporre in forma scritta i dubbi sorti durante il meeting oggetto di questo verbale. Successivamente alla sua risposta si valuterà se sarà necessario chiedere anche un colloquio via Zoom;
- il Proponente, per:
- confermare il meeting programmato per giovedì 29/02/2024, durante il quale saranno esposti i dubbi di progettazione sorti durante il meeting oggetto di questo verbale;
- convalidare il verbale del meeting di giovedì 22/02/2024;
- inviare lo schema ER del database e la bozza del diagramma delle classi, che saranno il punto di partenza per il prossimo meeting. |
|
https://github.com/The-Notebookinator/notebookinator | https://raw.githubusercontent.com/The-Notebookinator/notebookinator/main/themes/radial/icons/icons.typ | typst | The Unlicense | // Contains the raw text data of each icon. The icons are not stored as content so their colors can be changed later.
#let question-mark = read("./question-mark.svg")
#let light-bulb = read("./light-bulb.svg")
#let target = read("./target.svg")
#let hammer = read("./hammer.svg")
#let terminal = read("./terminal.svg")
#let flask = read("./flask.svg")
#let bar-chart = read("./bar-chart.svg")
#let page = read("./page.svg")
#let pencil = read("./pencil.svg")
#let warning = read("./warning.svg")
#let web = read("./web.svg")
#let quotes = read("./quotes.svg")
#let function = read("./function.svg")
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.