All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.
# run command in the foreground
command
# run commend in the background
| def train( | |
| model: MikesNN, | |
| train_loader: DataLoader, | |
| config: ExperimentConfig, | |
| logger: Logger | None = None, | |
| ): | |
| num_epochs = config.num_epochs | |
| learning_rate = config.learning_rate | |
| device = config.device |
| #include <cuda_runtime_api.h> | |
| #include <stdio.h> | |
| // Matrices are stored in row-major order: | |
| // M(row, col) = *(M.elements + row * M.width + col) | |
| struct Matrix { | |
| int width; | |
| int height; | |
| float *elements; | |
| }; |
| #include <cuda_runtime_api.h> | |
| #include <stdio.h> | |
| // Matrices are stored in row-major order: | |
| // M(row, col) = *(M.elements + row * M.width + col) | |
| struct Matrix { | |
| int width; | |
| int height; | |
| float *elements; | |
| }; |
| #let typ(body) = html.elem( | |
| "typ", | |
| { | |
| // distinguish parbreak from <p> tag | |
| show parbreak: it => html.elem("typParbreak", "") | |
| show linebreak: it => html.elem("typLinebreak", "") | |
| show strong: it => html.elem("typStrong", it.body) | |
| show emph: it => html.elem("typEmph", it.body) | |
| show highlight: it => html.elem("typHighlight", it.body) |
| { | |
| description = "A simple LaTeX template for writing documents with latexmk"; | |
| inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; | |
| outputs = { self, nixpkgs }: | |
| let | |
| supportedSystems = | |
| [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; | |
| # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. | |
| forAllSupportedSystems = nixpkgs.lib.genAttrs supportedSystems; | |
| in { |
| # This Makefile is to run commands. While justfiles are better purposed | |
| # It is unlikely Make will go away and it works well enough for my needs. | |
| TEX_FILE ?= main.tex | |
| AUX_DIR := aux | |
| .PHONY: pdf open clean | |
| refresh: pdf reload |
| { | |
| "extends": "@tsconfig/recommended/tsconfig.json", | |
| "include": ["./src"], | |
| "compilerOptions": { | |
| /* Visit https://aka.ms/tsconfig.json to read more about this file */ | |
| /* Projects */ | |
| // "incremental": true, /* Enable incremental compilation */ | |
| // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ | |
| // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ |
| env: | |
| commonjs: true | |
| es2021: true | |
| node: true | |
| extends: | |
| - airbnb-base | |
| - "prettier" | |
| parser: "@typescript-eslint/parser" | |
| parserOptions: | |
| ecmaVersion: 5 |