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
| # coding: utf-8 | |
| #!/usr/bin/env python3 | |
| import uuid | |
| import sys | |
| import random | |
| import json | |
| from typing import MutableSequence | |
| from typing import Mapping | |
| from copy import deepcopy | |
| from pathlib import Path |
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
| PKG_PATH="./path/relative/to/your/go/pkg" | |
| go list -f '{{ with $modstr := (printf "%v" $.Module) -}} | |
| {{ range $_, $dep := $.Deps -}} | |
| {{ if ne (slice (printf "%v%v" (module $dep) $modstr) 0 (len $modstr)) $modstr -}} | |
| {{ continue -}} | |
| {{ end -}} | |
| {{ println $dep -}} | |
| {{ end -}} | |
| {{ end -}} |
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
| const rdate = () => new Date(parseInt(Math.random() * Number.MAX_SAFE_INTEGER)); | |
| const data = [ | |
| { Symbol: 'a', Data: 0.0, At: rdate() }, | |
| { Symbol: 'b', Data: 0.0, At: rdate() }, | |
| { Symbol: 'c', Data: 1.0, At: rdate() }, | |
| { Symbol: 'a', Data: 1.0, At: rdate() }, | |
| { Symbol: 'c', Data: 0.0, At: rdate() }, | |
| { Symbol: 'b', Data: 1.0, At: rdate() }, | |
| { Symbol: 'd', Data: 0.0, At: rdate() }, | |
| ]; |
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
| // What is is a materialized view? | |
| // Materialized view is a view on some data that emits a message (or multiple | |
| // per query) when the data view changes and/or when a single query changes. | |
| // | |
| // ┌──────────────────────────┐ | |
| // │ Raw Data │ | |
| // └─────┬────────────────────┘ | |
| // ┌─────│────────────────────┐ | |
| // │┌────▼─────┐ ┌─────┐ │ | |
| // ││View logic◄──────┤Query│ │ |
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
| import * as tx from '@thi.ng/transducers'; | |
| const product = <T>(first?: T[], ...args: T[][]): IterableIterator<T[]> => | |
| first === undefined | |
| ? tx.asIterable([[]]) | |
| : args.length === 0 | |
| ? tx.partition(1, first) | |
| : tx.mapcat((x) => tx.map((y) => [x, ...y], product(...args)), first); |
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
| import * as rx from "https://cdn.skypack.dev/@thi.ng/rstream"; | |
| import * as tx from "https://cdn.skypack.dev/@thi.ng/transducers"; | |
| import { equivObject } from "https://cdn.skypack.dev/@thi.ng/equiv"; | |
| const syncMultiplexKey = (src) => | |
| rx.sync({ src }).transform( | |
| (() => { | |
| const idCache = new Map(); | |
| return tx.mapcat((tup) => | |
| tx.transduce( |
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
| import * as rx from "https://cdn.skypack.dev/@thi.ng/rstream"; | |
| import * as tx from "https://cdn.skypack.dev/@thi.ng/transducers"; | |
| import { equivObject } from "https://cdn.skypack.dev/@thi.ng/equiv"; | |
| const syncMultiplexKey = (src) => | |
| rx.sync({ | |
| src: { | |
| k: rx.merge({ | |
| src: [ | |
| ...tx.map(([k, v]) => v.transform(tx.map((_) => k)), tx.pairs(src)), |
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
| { stdenv, lib, gcc-unwrapped }: | |
| stdenv.mkDerivation rec { | |
| name = "mercurytcpclient"; | |
| version = "0.0.1"; | |
| src = ./.; | |
| dontUnpack = true; | |
| dontConfigure = true; | |
| dontBuild = true; |
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
| try: | |
| from collections.abc import Iterable # noqa | |
| except ImportError: | |
| from collections import Iterable # noqa | |
| def reducer(init, rfn): | |
| def ident(x): | |
| return 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
| { pkgs ? import <nixpkgs> {} }: | |
| let | |
| mypython = pkgs.python39; | |
| in | |
| pkgs.mkShell { | |
| buildInputs = [ | |
| pkgs.poetry | |
| mypython | |
| ]; | |
| shellHook = '' |