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
# stolen from here: https://amor.cms.hu-berlin.de/~rodrigus/Jupyter%20Notebooks/Solar_System_N-Body_Simulation.html | |
import numpy as np | |
import scipy as sp | |
import time | |
import scipy.constants as cs | |
import matplotlib.pyplot as plt | |
from numba import jit | |
from numba import cuda | |
from mpl_toolkits.mplot3d import Axes3D | |
from astropy.time import Time |
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
# Python 3.9+ | |
# You need to get and put your API key here https://developers.google.com/youtube/v3/getting-started | |
APIKEY = "XYZYOURSECRETAPIKEYXYZ" | |
from time import sleep | |
import csv | |
import requests | |
f = open("subscriptions.csv") |
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
""" | |
Dependencies: | |
find_orb (specifically the non-gui 'fo'): https://www.projectpluto.com/find_orb.htm | |
pip install pandas plotly | |
$ grab_mpc obs.txt 2023 CX1 | |
# -E 8 includes ground track latlon+alt | |
# only with -e generates combined.json i think |
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 ortools.linear_solver import pywraplp | |
# Create the mip solver with the SCIP backend. | |
solver = pywraplp.Solver.CreateSolver('SCIP') | |
infinity = solver.infinity() | |
numSteps = 25 | |
shipBuyingPrice = 10 | |
shipSellingPrice = 10 | |
factoryBuyingPrice = 20 |
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
int numSteps = 35; | |
float shipBuyingPrice = 10; | |
float factoryBuyingPrice = 30; | |
float workshopBuyingPrice = 50; | |
float passiveIncome = 1; | |
float shipIncomeMuliplier = 3; | |
float factoryIncomeMultiplier = 5; | |
float workshopIncomeMultiplier = 9; | |
range Times = 0..numSteps; | |
float initState_money = 50; |
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 shutil | |
from glob import glob | |
from natsort import natsorted | |
import os | |
RESULTF = "results" | |
os.makedirs(RESULTF, exist_ok=True) | |
def nextFilename(): |
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 zstandard | |
path = "test.txt.zst" | |
class Buffer: | |
def __init__(self, path): | |
self.f = open(path, "rb") | |
self.reader = zstandard.ZstdDecompressor().stream_reader(self.f) | |
self.buffer = "" | |
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
$ solve-field --overwrite field.png | |
Reading input file 1 of 1: "field.png"... | |
Read file stdin: 516 x 738 pixels x 1 color(s); maxval 255 | |
Using 8-bit output | |
Extracting sources... | |
simplexy: found 1341 sources. | |
Solving... | |
Reading file "./field.axy"... | |
Field 1 did not solve (index index-5206-47.fits, field objects 1-10). | |
Field 1 did not solve (index index-5206-46.fits, field objects 1-10). |
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
$ solve-field --overwrite field.png | |
Reading input file 1 of 1: "field.png"... | |
Read file stdin: 516 x 738 pixels x 1 color(s); maxval 255 | |
Using 8-bit output | |
Extracting sources... | |
simplexy: found 1341 sources. | |
Solving... | |
Reading file "./field.axy"... | |
Field 1 did not solve (index index-4219.fits, field objects 1-10). | |
Field 1 did not solve (index index-4218.fits, field objects 1-10). |
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
# Python | |
# pip install python-chess | |
import chess | |
moves = [] | |
# Queen, covers all lines and diagonals | |
for x in range(8): | |
for y in range(8): | |
board = chess.Board("8/8/8/8/8/8/8/8") |
NewerOlder