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
"""Tools to find free variables in an expression. | |
>>> import ast | |
>>> my_expr = ast.parse("x + (lambda x, y: x + y + z)(5, 9)").body[0].value | |
>>> reduce_ast(my_expr, free_vars, merge_free_name_sets, state=frozenset()) | |
{'z', 'x'} | |
""" | |
import ast | |
import functools |
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
2022-09-28T11:16:25.185-0600 [INFO] Terraform version: 1.3.0 | |
2022-09-28T11:16:25.185-0600 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0 | |
2022-09-28T11:16:25.185-0600 [DEBUG] using github.com/hashicorp/hcl/v2 v2.14.0 | |
2022-09-28T11:16:25.185-0600 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2 | |
2022-09-28T11:16:25.185-0600 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 | |
2022-09-28T11:16:25.185-0600 [DEBUG] using github.com/zclconf/go-cty v1.11.0 | |
2022-09-28T11:16:25.185-0600 [INFO] Go runtime version: go1.18.5 | |
2022-09-28T11:16:25.185-0600 [INFO] CLI args: []string{"terraform", "apply", "-auto-approve", "-no-color"} | |
2022-09-28T11:16:25.185-0600 [DEBUG] Attempting to open CLI config file: /Users/williambadart/.terraformrc | |
2022-09-28T11:16:25.185-0600 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. |
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
<!DOCTYPE html> | |
<!-- TODO: Main navigation links (Home, index, tags, ...) --><!-- DoNotFormat --> | |
<!-- DoNotFormat --> | |
<html lang='en'> | |
<head> | |
<meta charset='UTF-8' /> | |
<meta name='viewport' content='width=device-width, initial-scale=1' /> | |
<title> |
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
#!/bin/sh | |
security_endpoint="query?function=TIME_SERIES_DAILY&symbol=%s&apikey=$ALPHAVANTAGE_API_KEY" | |
security_jsonpath='.["Time Series (Daily)"] as $res | |
| ($res | keys | last) as $latest | |
| $res[$latest] | .["4. close"]' | |
crypto_endpoint="query?function=CURRENCY_EXCHANGE_RATE&from_currency=%s&to_currency=USD&apikey=$ALPHAVANTAGE_API_KEY" | |
crypto_jsonpath='.["Realtime Currency Exchange Rate"] | |
| .["8. Bid Price"]' |
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
{-# LANGUAGE LambdaCase #-} | |
module Lib where | |
import Data.Char | |
import Data.List.NonEmpty ( NonEmpty ) | |
import Validation | |
data PasswordError | |
= TooShort |
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
{-# LANGUAGE BlockArguments,DeriveFunctor,LambdaCase,ScopedTypeVariables,NoImplicitPrelude #-} | |
import Control.Arrow | |
import Prelude hiding (replicate) | |
newtype Fix f = In { out :: f (Fix f) } | |
type FAlgebra f a = f a -> a | |
cata :: (Functor f) => FAlgebra f a -> Fix f -> a | |
cata f = out >>> fmap (cata f) >>> f |
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
name: numbatest | |
channels: | |
- defaults | |
dependencies: | |
- _libgcc_mutex=0.1=main | |
- attrs=19.3.0=py_0 | |
- blas=1.0=mkl | |
- ca-certificates=2020.1.1=0 | |
- certifi=2020.4.5.1=py38_0 | |
- coverage=5.0=py38h7b6447c_0 |
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
module Main where | |
import Data.Probability | |
main :: IO () | |
main = do | |
s <- readLn | |
case probability s of | |
-- This pattern match wouldn't work w/o PatternSynonyms | |
-- (you could still pattern match on the Maybe, but not on |
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
module Graph where | |
import Data.Function (on) | |
import Data.List (deleteBy) | |
data Edge v id_ payload = Edge (v, v) id_ payload | |
deriving Show | |
data Graph v id_ payload = Graph [v] [Edge v id_ payload] | |
deriving Show |
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
N=1000000 | |
M=1000000 | |
M2=1000001 | |
compare: node.o compare.o main.o | |
$(CC) $^ -o $@ | |
compare_tail: node.o compare_tail.o main.o | |
$(CC) $^ -o $@ |
NewerOlder