Skip to content

Dettorer/training_materials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

330 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programming trainings materials

This repository contains the source files for every document, example, exercise and their solutions used as materials for the corporate trainings I provided on programming topics.

Training list with their latest downloadable builds

Last successful builds for each training:

Workflow status badge Combined documents (PDF) All materials (zip) Presentation slides (zip)
CDU (CUDA) CDU_documents_combined.pdf CDU_materials.zip CDU_presentation_slides.zip
RUX (Rust) RUX_documents_combined.pdf RUX_materials.zip RUX_presentation_slides.zip
THO (Python) THO_documents_combined.pdf THO_materials.zip THO_presentation_slides.zip

Build instructions

Best way for a one-time build: using nix

The most reliable way to build everything is to use the nix package manager (with flakes enabled). Use either nix build to build everything, or nix build .#CDU / nix build .#RUX / nix build .#THO to build one specific training's materials.

Then go grab a coffee, that thing is so overengineered that it takes a while to build everything (see the sections below for how overengineered we're talking about).

After nix is done, you'll find the materials in the result symlink created in your current directory.

For each training, nix will produce:

  • result/XXX_materials/CM*-handout.pdf: some PDF slide deck in a "handout" format with reading notes mimicking what I would say during its presentation;
  • result/XXX_materials/examples/: the buildable and testable code files used as examples in the slides;
  • result/XXX_materials/TP-*.pdf: a PDF practical with exercises;
  • result/XXX_materials/given_files/, result/XXX_materials/exercises/, or similar: the code files given as a starting point for the exercises;
  • result/XXX_materials/ref_files/, result/XXX_materials/correction/, result/XXX_materials/exercises_ref/, or similar: the code files with the solutions to the exercises;
  • occasionnaly other documents (such as the CDU training's "memo");
  • result/XXX_materials.zip: a zip file with all the above materials;
  • result/XXX_presentation_slides/CM*.pdf: a folder containing only the presentation slides (with more transitions and without reading notes).

Best for incremental builds: latexmk and make

To build the PDF documents without nix, you will need the training's subject language toolchain (except for the CDU training which does not actually need CUDA to build the documents), and a LaTeX distribution with: latexmk, xelatex, and the packages listed in the latex-distribution definition of the flake.nix file. You can then go to a training's documents folder and run latexmk to build all slides, practicals and memos, or latexmk <document_name> to build a specific document.

To build the exercises and their solutions (which for some trainings need some processing to be usable in a training session), the process depends on the training (sorry). Go to the training's exercises folder (CDU/filters, RUX/TP, etc.) and use the provided Makefile or script (like RUX's build_given_files.zsh). Please be advised that some of these builds will try to use nix to load a development environment defined in the toplevel flake.nix file (which could involve downloading most of the things that a global nix build would download).

Overengineering details

This repository features no less than

  • nix, to define the development and build environment;
  • latexmk, to build all PDF documents (and run Python/Rust code examples, more on that later);
  • make, to organize the built documents (some organization steps at least, nix then does the rest);
  • some standalone shell scripts;

Some shell scripting is embedded in the nix flake definition, but the funniest part is in the LaTeX documents themselves: common/latex/myhighlighting.sty makes heavy use of VerbatimeOutput LaTeX environment and the \write18 TeX primitive to write and run some shell and Python scripts. Those scripts extract code examples from other CUDA, Rust, Python or other languages source files, run them and capture their output. I then define LaTeX commands that use to script to insert the code samples and their output into the PDF documents. This way, the code examples in the documents are always up to date and tested at build time, as part of the PDF generation process.

About

Slides, exercises and solutions for my corporate trainings (CUDA, Rust, Python)

Topics

Resources

Stars

Watchers

Forks

Contributors