Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
#!/bin/bash
function template {
cat<<EOF
[
[[1, 2],
[3, 4, 1],
5 ]]
EOF
}
function payload {
for i in $(seq 0 6) ; do
echo Payload#$i
done
}
# Task 1: Template instantiation
payload | jq -Rn --argfile t <(template) '
([inputs] | with_entries(.key |= tostring)) as $dict
| $t
| walk(if type == "number" then $dict[tostring] else . end)
'

View file

@ -0,0 +1,4 @@
payload | jq -Rn --argfile t <(template) '
([inputs] | with_entries(.key |= tostring)) as $dict
| $dict[(($dict|keys_unsorted) - ([ $t | .. | numbers ] | unique | map(tostring) ))[]]
'

View file

@ -0,0 +1,7 @@
payload | jq -Rrn --argfile t <(template) '
([inputs] | with_entries(.key |= tostring)) as $dict
| $t
| walk(if type == "number" then $dict[tostring] else . end),
"\nUnused payload",
$dict[(($dict|keys_unsorted) - ([ $t | .. | numbers ] | unique | map(tostring) ))[]]
'

View file

@ -0,0 +1,18 @@
[
[
[
"Payload#1",
"Payload#2"
],
[
"Payload#3",
"Payload#4",
"Payload#1"
],
"Payload#5"
]
]
Unused payload
Payload#0
Payload#6