This file contains hidden or 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
| // human readable rates | |
| // converting from 1000x to | |
| function rounded(value, precision) { | |
| scale = 10**precision | |
| return Math.round(value * scale) / scale | |
| } | |
| function niceRate(rate, p = 1) { | |
| if (rate < 120) { | |
| return `${rate} x` |
This file contains hidden or 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
| /** | |
| * A stacked hashmap of max height. | |
| * The first element is the first removed | |
| */ | |
| class KeyedStack<K, T> { | |
| private _stack: K[] = []; | |
| private _map: Map<K, T> = new Map(); | |
| private _maxSize: number; |
A simple Keplerian reflector
["Ideal" Cassegrain"](https://phydemo.app/ray-optics/simulator/#XQA
This file contains hidden or 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
| def create_faceted_subsets(data, component, skip_nan=True): | |
| vals = data.to_dataframe()[component].unique() | |
| for v in vals: | |
| if skip_nan and v != v: # catches NaN | |
| continue | |
| dc.new_subset_group( | |
| label=str(v), | |
| subset_state=(data.id[component] == v) |
This file contains hidden or 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 skyfield import almanac | |
| from skyfield.api import load, wgs84 | |
| eph = load("de440s.bsp") | |
| ts = load.timescale() | |
| obs = eph["earth"] + wgs84.latlon(0.0, 0.0, elevation_m=0.0) | |
| sun = eph["sun"] | |
| t_utc = ts.utc(2025, 3, 20, 9, 1, 0) | |
| year, month, day, _, _, _ = t_utc.utc |
This file contains hidden or 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
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <title>WWT Asteroid Orbit (Hosted Model)</title> | |
| </head> | |
| <body> | |
| <div id="wwtcanvas"></div> | |
| <div id="ui"> |
This file contains hidden or 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
| <script setup lang="ts"> | |
| import { ref, type Ref, reactive } from 'vue' | |
| class Person { | |
| name: string | |
| age: number | |
| called = 0; | |
| constructor(name: string, age: number) { | |
| this.name = name | |
| this.age = age |
This file contains hidden or 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
| <script setup> | |
| import { ref } from 'vue' | |
| import { useTest } from './test'; | |
| const notRefValue = 3 | |
| const refValue = ref(7) | |
| const test = useTest(notRefValue, refValue) | |
This file contains hidden or 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
| /* | |
| * Binary Ajax 0.1.10 | |
| * Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/ | |
| * Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt] | |
| */ | |
| var BinaryFile = function(strData, iDataOffset, iDataLength) { | |
| var data = strData; | |
| var dataOffset = iDataOffset || 0; |
NewerOlder