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
| from __future__ import annotations | |
| import base64 | |
| import dataclasses | |
| import hashlib | |
| import importlib | |
| import json | |
| import os | |
| import re | |
| import tempfile |
| import hashlib | |
| import importlib | |
| import json | |
| import logging | |
| import os | |
| import random | |
| import time | |
| from contextlib import contextmanager | |
| from dataclasses import asdict, dataclass, field, make_dataclass | |
| from datetime import datetime, timezone |
| 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 |