Skip to content

Instantly share code, notes, and snippets.

View chuckwondo's full-sized avatar

Chuck Daniels chuckwondo

View GitHub Profile
@chuckwondo
chuckwondo / README.md
Created September 27, 2023 16:19
Concurrent pystac-client search queries

Concurrent pystac-client Search Queries

Motivation: Implement async requests

This is a very simple performance comparison between approaches for running search queries via pystac-client:

  • sequential (baseline)
  • asyncio with HTTPX library
  • greenlets with gevent library
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chuckwondo
chuckwondo / README.md
Last active June 17, 2019 10:52
Cumulus Verify Granules

Cumulus Verify Granules

Task

Write a new Lambda function using Node.js that validates the checksums of granule files based on the following guidelines:

  • If all checksums are valid, the lambda handler should return nothing
  • If any checksums are invalid, the lambda handler should throw a specific error
  • If a file does not include a checksum or checksum type, ignore it
@chuckwondo
chuckwondo / README.md
Last active February 5, 2019 14:58
Python Tail-Call Optimization

Python Tail-Call Optimization

In order to avoid causing a stack overflow during recursion, do the following:

  1. Ensure each recursive call is a tail call
  2. Decorate the recursive function(s) with thunk (in the case of co-recursive functions, decorate both). This exposes a trampoline function, which is used in the next step.
  3. Append a call to trampoline to only the initial call to each decorated function. Conversely, do not append a call to trampoline to any recursive call to a thunk-decorated function.

For example, suppose we have the following naive recursive implementation of the factorial function:

@chuckwondo
chuckwondo / barley.tsv
Created October 1, 2015 00:57
Barley Data Comparisons
27 Manchuria 1931 University Farm
48.86667 Manchuria 1931 Waseca
27.43334 Manchuria 1931 Morris
39.93333 Manchuria 1931 Crookston
32.96667 Manchuria 1931 Grand Rapids
28.96667 Manchuria 1931 Duluth
43.06666 Glabron 1931 University Farm
55.2 Glabron 1931 Waseca
28.76667 Glabron 1931 Morris
@chuckwondo
chuckwondo / barley.tsv
Created September 29, 2015 01:24
Minnesota Barley Yield 1931-1932
yield variety year site
27 Manchuria 1931 University Farm
48.86667 Manchuria 1931 Waseca
27.43334 Manchuria 1931 Morris
39.93333 Manchuria 1931 Crookston
32.96667 Manchuria 1931 Grand Rapids
28.96667 Manchuria 1931 Duluth
43.06666 Glabron 1931 University Farm
55.2 Glabron 1931 Waseca
28.76667 Glabron 1931 Morris