Skip to content

Instantly share code, notes, and snippets.

View clungzta's full-sized avatar

Alex McClung clungzta

View GitHub Profile
@clungzta
clungzta / trello_continuous_flow.py
Last active January 5, 2024 23:22
A Python-based Continuous Flow Diagram (CFD) for Trello
import os
import sys
import pytz
import numpy as np
import pandas as pd
import plotly.express as px
from termcolor import cprint
from datetime import datetime, timedelta
from collections import namedtuple, defaultdict
from trello import TrelloClient

Traversal is a triple entendre:

  • The movements of entities; people, tools, materials & machines, with all entities Traversing a heavy-industry environment
  • Perception algorithms which Traverse visual scenes to gain an understanding of scene structure and dynamics
  • A data engineering platform where data Traverses a digital network of nodes (sensors, algorithms, compute)
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Let $R$ be the set of identified risks, with each risk denoted as $r_i$ ($i$ ranges from 1 to $|R|$). For each risk $r_i$, let $C_{ij}$ be the cost of implementing control measure $j$ for risk $r_i$ ($j$ ranges from 1 to $|C_i|$, where $|C_i|$ is the number of control measures associated with risk $r_i$). Let $OCC_i$ represent the likelihood of occurrence for risk $r_i$, and let $SEV_i$ represent the severity of risk $r_i$. Define $RR_{ij}$ as the risk reduction achieved by control measure $j$ for risk $r_i$.
Define the indicator function $I_{ij}$ as follows:
\[
@clungzta
clungzta / typed_queries_in_python.py
Created September 27, 2022 11:37
I ended up switching to df.query(), but keeping this dummy code here for reference
# Create class for handling filters with logical operations
class Filter(Generic[T]):
def __init__(self, name: str, value: T, op: str = "=="):
self.name = name
self.value = value
self.op = op
if type(value) == str:
if op == "==":
self.op = "eq"
// Very Simple Differential Drive Odometry. Ported from Python into C++
// Original Python: https://github.com/hbrobotics/ros_arduino_bridge/blob/indigo-devel/ros_arduino_python/src/ros_arduino_python/base_controller.py
double x_;
double y_;
double th_;
double dt; // time between last odometry calculation and this odometry calculation
long prev_left_enc_;
long prev_right_enc_;
@clungzta
clungzta / nvidia_smi_indicator.py
Created November 30, 2020 02:51
Ubuntu indicator for NVIDIA GPU's. Displays utilisation, memory usage, and temperature
import gi
import nvsmi
import signal
import time
from threading import Thread
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk, AppIndicator3, GObject
class Indicator():
import re
import time
import serial
import threading
import numpy as np
from pprint import pprint
from functools import partial
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from collections import deque, defaultdict
import occupancy_grid_utils_python as gu
# geometry_msgs::Point
pt = [1.0, 0.0, 0.0]
# grid, map_info from topics
# map_info = gu.MapMetaData()
cell = pointCell(map_info, pt)
value = get_cell(grid, cell)
@clungzta
clungzta / ros-network.sh
Last active October 13, 2019 05:13 — forked from marc-hanheide/ros-network.sh
ROS network setup depending on route to MASTER
#!/bin/bash
# This script configures the ROS environment variables according to the route
# to the ROS_MASTER. ROS_MASTER can either be defined as an evironment variable
# itself or given as first argument to this script. The ROS_IP and ROS_HOSTNAME
# are set according to the IP that is sitting on the route to this master.
# The ROS_MASTER_URI is also set, using port 11311. ROS_MASTER needs to be defined
# as a numeric IP address, not a hostname.
if [ "$1" ]; then
@clungzta
clungzta / ffmpeg_boomerang.sh
Last active March 21, 2019 03:34
Loop a sequence of images into a back and forth with ffmpeg (1080p, high quality output)
ffmpeg -pattern_type glob -i "*.jpg" -filter_complex "[0]reverse[r];[0][r]concat,loop=5:250,setpts=N/25/TB,scale=1920:1080" -vcodec mpeg4 -q:v 1 output_looped.mp4