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
--- Redis Stream with ordered processing | |
--- | |
--- Redis streams support multiple consumers for throughput and reliability however it doesn't offer | |
--- a native mechanism for processing a set of messages in a specific order. | |
--- | |
--- It's possible though to implement a simple algorithm that resembles Kafka's partitioning algorithm: | |
--- | |
--- - a logical stream becomes N streams in redis (shards from now on) | |
--- - producers place the message into one of the stream shards based on the hashing of some attribute | |
--- - each consumer in the consumer group "acquires" a subset of the streams |
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 module uses an experimental API that is only available on Chromium using | |
// a trial or by enabling a browser flag. It's unlikely that the API will get | |
// standardized and if it is it'll probably end up having a quite different form, | |
// that's to say that we should remove this once the trial is over :) | |
// | |
// - Spec: https://oyiptong.github.io/compute-pressure/ | |
// - Status: https://chromestatus.com/feature/5597608644968448 | |
// - Trial: https://developer.chrome.com/origintrials/#/view_trial/1838594547874004993 | |
// - Chrome flag: Experimental Web Platform features | |
// |
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
[package] | |
name = "global-modifiers" | |
version = "0.1.0" | |
authors = ["drslump <[email protected]>"] | |
edition = "2018" | |
[dependencies] | |
enumset = "1.0.0" | |
x11 = { version = "2.18.2", features = ["xlib"] } |
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
// The theory is that we can avoid moving the video data into RAM since we are only | |
// passing the ImagieBitmap reference around, which should improve the performance when | |
// plotting captured frames. | |
const stream = await navigator.mediaDevices.getUserMedia({video: true}) | |
const [track] = stream.getVideoTracks() | |
const ic = new ImageCapture(track) | |
const bmp = await ic.grabFrame() |
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
LatD | LatM | LatS | NS | LonD | LonM | LonS | EW | City | State | |
---|---|---|---|---|---|---|---|---|---|---|
41 | 5 | 59 | N | 80 | 39 | 0 | W | Youngstown | OH | |
42 | 52 | 48 | N | 97 | 23 | 23 | W | Yankton | SD | |
46 | 35 | 59 | N | 120 | 30 | 36 | W | Yakima | WA | |
42 | 16 | 12 | N | 71 | 48 | 0 | W | Worcester | MA | |
43 | 37 | 48 | N | 89 | 46 | 11 | W | Wisconsin Dells | WI | |
36 | 5 | 59 | N | 80 | 15 | 0 | W | Winston-Salem | NC | |
49 | 52 | 48 | N | 97 | 9 | 0 | W | Winnipeg | MB | |
39 | 11 | 23 | N | 78 | 9 | 36 | W | Winchester | VA | |
34 | 14 | 24 | N | 77 | 55 | 11 | W | Wilmington | NC |
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
41 | 5 | 59 | N | 80 | 39 | 0 | W | Youngstown | OH | |
---|---|---|---|---|---|---|---|---|---|---|
42 | 52 | 48 | N | 97 | 23 | 23 | W | Yankton | SD | |
46 | 35 | 59 | N | 120 | 30 | 36 | W | Yakima | WA | |
42 | 16 | 12 | N | 71 | 48 | 0 | W | Worcester | MA | |
43 | 37 | 48 | N | 89 | 46 | 11 | W | Wisconsin Dells | WI | |
36 | 5 | 59 | N | 80 | 15 | 0 | W | Winston-Salem | NC | |
49 | 52 | 48 | N | 97 | 9 | 0 | W | Winnipeg | MB | |
39 | 11 | 23 | N | 78 | 9 | 36 | W | Winchester | VA | |
34 | 14 | 24 | N | 77 | 55 | 11 | W | Wilmington | NC |
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 sys, types, dis, struct | |
BINARY_SUBSCR = lambda: Op('BINARY_SUBSCR') | |
BUILD_TUPLE = lambda x: Op('BUILD_TUPLE', x) | |
COMPARE_OP = lambda x: Op('COMPARE_OP', x) | |
INPLACE_ADD = lambda: Op('INPLACE_ADD') | |
INPLACE_SUBTRACT = lambda: Op('INPLACE_SUBTRACT') | |
JUMP_ABSOLUTE = lambda x: Op('JUMP_ABSOLUTE', x) | |
LOAD_CONST = lambda x: Op('LOAD_CONST', x) | |
LOAD_FAST = lambda x: Op('LOAD_FAST', x) |
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
#!/usr/bin/env bash | |
# | |
# Summary: Creates a temporary virtualenv based on a version | |
# | |
# Usage: pyenv COMMAND [version] [tmp-name] | |
# | |
# When no version is provided it'll use the currently configured | |
# one. | |
# |
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
#!/usr/bin/env bash | |
# | |
# Copyright (C) 2018 Iván Velencoso Montes <[email protected]>. | |
# This file is licensed under the MIT license. | |
# | |
# Requirements: | |
# | |
# - Bash 3.x or higher | |
# - sqlite3 | |
# - gunzip / bzip2 (for compressed input) |
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
#!/usr/bin/env python | |
# | |
# Converts a CSV (with column headers) to JSONL | |
# | |
import sys, csv, json | |
for row in csv.DictReader(sys.stdin): | |
print(json.dumps(row)) |
NewerOlder