Skip to content

Instantly share code, notes, and snippets.

View geoffreygarrett's full-sized avatar
🇺🇦

Geoffrey Garrett geoffreygarrett

🇺🇦
  • Delft University of Technology
  • Netherlands
View GitHub Profile
@geoffreygarrett
geoffreygarrett / bazel_build.yml
Created July 3, 2023 17:30
pkg-config-github-actions-windows
- name: Setup PkgConfig (Windows)
if: runner.os == 'Windows'
env:
PKG_CONFIG_ZIP: "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip"
GETTEXT_RUNTIME_ZIP: "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip"
GLIB_ZIP: "http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip"
run: |
curl -LO "${{ env.PKG_CONFIG_ZIP }}"
7z x pkg-config_0.26-1_win32.zip -oC:\MinGW\bin pkg-config.exe
curl -LO "${{ env.GETTEXT_RUNTIME_ZIP }}"
bazel run --tool_tag=ijwb:CLion --curses=no --color=yes --progress_in_terminal_title=no -- //odin/examples:example_autodiff_stts
WARNING: ========================================================
WARNING: || ||
WARNING: || ██████╗ ██████╗ ██████╗ ||
WARNING: || ██╔══██╗██╔═══██╗██╔══██╗ ||
WARNING: || ██████╔╝██║ ██║██████╔╝ ||
WARNING: || ██╔══██╗██║ ██║██╔══██╗ ||
WARNING: || ██████╔╝╚██████╔╝██║ ██║ ||
WARNING: || ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ||
WARNING: || ||
// include for size_t
#include <Eigen/Core>
#include <tuple>
//#include <unsupported/Eigen/CXX11/Tensor>
//#ifdef ODIN_AUTODIFF
//#define ODIN_CONST
#include <autodiff/forward/dual.hpp>
#include <autodiff/forward/dual/eigen.hpp>
from sympy import symbols, Matrix, diff, lambdify
import numpy as np
# Compute the 1st-order State Transition Tensor
def dfdx(eom, wrt, at):
u = eom.subs(at).evalf()
m = len(u) if hasattr(u, "__len__") else 1
n = len(wrt)
t2 = np.zeros((m, n))
"""
Symbolic, auto differentiated implementation of the STTS in [1]
References:
[1] https://arc.aiaa.org/doi/full/10.2514/1.G003897
"""
import itertools
@geoffreygarrett
geoffreygarrett / deno_dependency_analyzer.awk
Created June 22, 2024 10:25
This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes, converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest dependencies sorted by size in descending order.
#!/usr/bin/env gawk -f
# deno_dependency_analyzer.awk
#
# Usage:
# deno info --import-map ./import_map.json <your_deno_script>.ts | gawk -f deno_dependency_analyzer.awk
#
# Description:
# This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes,
# converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest
# dependencies sorted by size in descending order.
@geoffreygarrett
geoffreygarrett / deno_dependency_analyzer.sh
Created June 22, 2024 10:36
This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes, converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest dependencies sorted by size in descending order.
#!/usr/bin/env gawk -f
# deno_dependency_analyzer.sh
#
# Description:
# This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes,
# converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest
# dependencies sorted by size in descending order.
# Execute 'deno info' with provided import map and script, and process the output with gawk
deno info --import-map "$IMPORT_MAP" "$DENO_SCRIPT" | gawk '
@geoffreygarrett
geoffreygarrett / .envrc
Last active January 19, 2025 12:16
Nix DevShell for Leptos with pinned Rust toolchains via Fenix
#!/usr/bin/env bash
# 1. If .rust-channel exists, read it; otherwise default to stable
if [ -f .rust-channel ]; then
RUST_CHANNEL="$(cat .rust-channel)"
else
RUST_CHANNEL="stable"
fi
# 2. Validate the channel; if it's not "nightly", assume stable