This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Integrator | |
export PlutoSim | |
const G = 1.48811382e-34 # G in units of AU and day | |
function potential{T<:Real}(mass::Vector{T}, r::Matrix{T}) | |
N = size(r,1) | |
out = zeros(N,3) | |
d = zeros(1,3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function make_remote | |
switch (count $argv) | |
case 0 | |
echo "Not enough arguments." | |
case 1 | |
set REPOPATH "git-repos/$argv[1].git" | |
_make_remote $REPOPATH | |
case 2 | |
set REPOPATH "git-repos/$argv[1].git" | |
_make_remote $REPOPATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import argv | |
# Function to produce verbal names of Finnish numbers up to 10^12 - 1. | |
# If run on the command line, takes an integer parameter and prints the | |
# name of that number. | |
# Requires Python 3 (you should not be running Python 2.x in the year 2020 anyway). | |
INDIVIDUALS = { | |
0 : "", # zero is set to empty string here for convenience below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def JDplot(data, ax, N, resolution=None, white=False, alpha=1.0, stagger=0.0, fill_color=None, fg_color=None): | |
"""Make a sliced histogram plot in the style of Joy Division's album cover. | |
- `data`, a 1D numpy array containing values. | |
- `ax`, the matplotlib Axes to draw onto. | |
- `N`, the number of histogram slices. | |
- `resolution`, the number of bins. Defaults to `N`. | |
- `white`, boolean. Sets black-on-white colour scheme instead default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This converts a BOM file in CSV format, produced by KiCad Pcbnew, | |
# by selecting File / Fabrication Outputs / BOM File | |
# into the format expected by the JLCPCB manufacture service. | |
# At least in KiCad 5.1.4 the CSV output seems a bit broken in terms of column names, | |
# which is reflected in this code. If it changes in later KiCad versions, this script | |
# needs to change, too. | |
# Use this by running the command line: python convert_bom.py inputfile.csv outputfile.csv | |
# It will overwrite your output file without asking so be careful. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calculate Finnish bank reference numbers | |
# The reference is computed by: | |
# | |
# 1. Add together the digits of the number from right to left, | |
# multiplied cyclically by the weights 7, 3, and 1. | |
# E.g. for 1234, the total is 7*4 + 3*3 + 1*2 + 7*1 == 46. | |
# | |
# 2. Subtract the total from the next highest multiple of ten. |