Skip to content

Instantly share code, notes, and snippets.

View josh-kaplan's full-sized avatar

Josh Kaplan josh-kaplan

View GitHub Profile
@josh-kaplan
josh-kaplan / calc.py
Created July 27, 2023 01:07
Calculating percent margin in scaled agile planning
import matplotlib.pyplot as plt
# Globals
L_MIN = 1
L_MAX = 4
N_MIN = 4
N_MAX = 6
WIDTH_SIZE = 8
HEIGHT_SIZE = 6
SAVE_FIGURES = True
@josh-kaplan
josh-kaplan / jk.zsh-theme
Created July 18, 2018 02:02
My ZSH theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )%{$reset_color%}"
local user="%{$FG[236]%}%n%{$fg[white]%}@%{$FG[236]%}%m%{$reset_color%}"
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
PROMPT='${ret_status}%{$fg_bold[grey]%}${user} ${pwd} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$FG[134]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[green]%}+%{$reset_color%}/%{$fg[red]%}-"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@josh-kaplan
josh-kaplan / pset2-2.jl
Created February 14, 2018 17:43
Computations for FESS 1 Problem Set #2, Problem #2
#!/usr/bin/env julia
################################################################################
# pset2-2.jl
#
# Josh Kaplan
# _jk@jhu.edu
#
# Computations for Problem Set #2, Problem #2.
################################################################################
@josh-kaplan
josh-kaplan / pset2-1.jl
Last active February 14, 2018 03:19
Calculations for FESS 1 Problem Set #2, Problem #1
#!/usr/bin/env julia
################################################################################
# pset2-1.jl
#
# Josh Kaplan
# _jk@jhu.edu
#
# Computations for Problem Set #2, Problem #1.
################################################################################
@josh-kaplan
josh-kaplan / M03_Kinetic_Energy_v3.m
Created June 12, 2017 00:02
Bisection Method (More accurate).
%% Newtonian vs. Relativistic Energy Accuracy
% Determines the maximum speed a particle can have such that its
% kinetic energy described as 0.5*m*v^2 with an error of no greater
% than <tolerance>.
close all; clear all; clc;
% Input - The tolerance of the accuracy of the Newtonian kinetic energy
% compared to the relativistic energy.
tolerance = .005;
@josh-kaplan
josh-kaplan / M03_Kinetic_Energy_v2.m
Created June 11, 2017 23:48
Newton's Method. This will work with either MATLAB or Octave. Used to determine the maximum speed at which kinetic energy can be described by the Newtonian equation with an error with a specified tolerance of relativistic energy.
%% Newtonian vs. Relativistic Energy Accuracy - Using Newton's Method
% Determines the maximum speed a particle can have such that its
% kinetic energy described as 0.5*m*v^2 with an error of no greater
% than <tolerance>.
close all; clear all; clc;
% Input - The tolerance of the accuracy of the Newtonian kinetic energy
% compared to the relativistic energy.
tolerance = .005;
@josh-kaplan
josh-kaplan / M03_Kinetic_Energy.m
Last active June 11, 2017 23:49
Bisection Method. This will work with either MATLAB or Octave. Used to determine the maximum speed at which kinetic energy can be described by the Newtonian equation with an error with a specified tolerance of relativistic energy.
%% Newtonian vs. Relativistic Energy Accuracy
% Determines the maximum speed a particle can have such that its
% kinetic energy described as 0.5*m*v^2 with an error of no greater
% than <tolerance>.
close all; clear all; clc;
% Input - The tolerance of the accuracy of the Newtonian kinetic energy
% compared to the relativistic energy.
tolerance = .005;
"""
Sight Reduction
Similar to the last sight reduction one, but modified to use geostationary satellites.
"""
from __future__ import division
import math
from math import sin, cos, tan, asin, acos, atan
@josh-kaplan
josh-kaplan / sight_reduction.py
Created April 16, 2017 18:40
A script used to solve sight reduction homework problems for navigation class.
"""
Sight Reduction
Calculate position on 2000 June 21 2100 UTC
Star Observed Altitude
------- ----------- --------
Regulus 20h 39m 23s 37.4204
Antares 20h 45m 47s 20.3226
Kochab 21h 10m 34s 47.2050
local ret_status="%(?:%{$fg_bold[green]%}∴ :%{$fg_bold[red]%}∴ %s)"
PROMPT='${ret_status}%{$fg_bold[green]%}%p%{$fg_bold[grey]%}%n%{$fg_bold[white]%}@%{$fg_bold[grey]%}%m%{$fg_bold[green]%}%u %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git: (%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"