Skip to content

Instantly share code, notes, and snippets.

View jsmorph's full-sized avatar

Jamie Stephens jsmorph

View GitHub Profile
@jsmorph
jsmorph / doc.md
Last active May 13, 2022 03:19
RemPattern for Quamina

RemPattern for Quamina

Basic problem and proposed solution

Quamina doesn't currently support RemPattern. Some of the contemplated implementations of RemPattern are difficult. At least one approach is pretty easy: Wrap the current matcher to filter removed patterns from match results and periodically rebuild the matcher from scrach with the live patterns. More specifically:

@jsmorph
jsmorph / ops.md
Last active January 26, 2022 20:12
CSS ops

CSS operations

CSS = Conjunction Streaming Service, which consumes orbital data (currently TLEs) and emits conjunction reports for objects on orbit (or crossing orbits).

Contact

Email contact: info@morphism.com.

@jsmorph
jsmorph / genschemagui.md
Last active July 14, 2019 23:01
Generating a GUI from generated JSON schema

To run a model, you need a configuration. The structure of a configuration consists of various Go structures, maps, and other types. We use a fork (with only minor changes) of github.com/alecthomas/jsonschema to generate a JSON schema for model configurations. For one GUI, we then use github.com/json-editor/json-editor to generate a complex HTML/Javascript configuration form dynamically from that JSON schema. A Go program serves the HTML and Javascript, and that program also runs then model. The model output is rendered using d3js.org.

@jsmorph
jsmorph / var.go
Created April 8, 2019 13:28
Incremental variance
// Package main demos TAOCP, Vol. 2, p. 232 algorithm for incremental variance.
package main
import (
"fmt"
"math/rand"
)
type Var struct {
N int
@jsmorph
jsmorph / kyle.tla
Created March 30, 2019 13:22
TLA+ Example
---- MODULE Kyle1 ----
(* Kyle has a rule that turns on his garage light for 10 minutes every time
he opens his garage door. Unfortunately, Kyle has to go into his garage
frequently (in order to get the next exotic tool he urgently needs
for a project). Does his rule really do what he wants? *)
EXTENDS Naturals, Sequences
VARIABLES lts, \* Light timers
o, \* Interal state for deciding whether to open the door
@jsmorph
jsmorph / cal.ipynb
Created November 30, 2018 16:04
Callilbration notes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsmorph
jsmorph / uncertainty.md
Last active May 13, 2018 18:47
Uncertainty

Notes on representing and computing uncertainty

Approach

A simple approach that uses sampling from either probability distributions or approximations of distributions as input and output from deterministic functions.

Terminology

As examples, we'll consider observations and predictions. A prediction is computed from a set of observations. We'll work with observations and predictions of probability distributions of tuples .

@jsmorph
jsmorph / _pixhawkkml.md
Last active July 15, 2020 11:50
Script for generating KML with track timestamps from Pixhawk logs

A Python script for generating KML with timestamps from Pixhawk logs.

See the script for a few comments.

@jsmorph
jsmorph / clj1152.clj
Last active December 25, 2015 21:19
Ugly mitigation of CLJ-1152 (PermGen) bugs in the protocols case
;; Ugly mitigation of http://dev.clojure.org/jira/browse/CLJ-1152 in
;; the protocols case. Motivation: Need to eval lots domain-specific
;; language code rendered in core.logic. Approach: Start a thread to
;; purge protocol caches every second. You should probable write a
;; fancier version.
(defn protocol? [x]
(and (instance? clojure.lang.PersistentArrayMap x)
(boolean (:on-interface x))))
@jsmorph
jsmorph / kg-ex.txt
Created July 18, 2013 21:31
KyotoGraph Example
java -jar kg.jar --threads 2 --partitioned-grandchildren-test
:kc-open 000-foo.kct
:kc-open 001-foo.kct
:load-synthetic-data #<DB 000-foo.kct: 0: 400128> :start
:load-synthetic-data #<DB 000-foo.kct: 0: 400128> :nodes 0
:load-synthetic-data #<DB 001-foo.kct: 0: 400128> :start
:load-synthetic-data #<DB 001-foo.kct: 0: 400128> :nodes 0
:load-synthetic-data #<DB 001-foo.kct: 44505: 400128> :done
{:triples-added 44505, :nodes 10000, :triples-total 44505, :triples-per-second 35718.29855537721}
:load-synthetic-data #<DB 000-foo.kct: 45235: 400128> :done