Skip to content

Instantly share code, notes, and snippets.

View HanClinto's full-sized avatar

Clint Herron HanClinto

View GitHub Profile
@HanClinto
HanClinto / ScryfallAutoTagger.ipynb
Last active October 11, 2019 19:46
Quick Jupyter notebook to auto-tag Magic card artwork from Scryfall using Resnet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@HanClinto
HanClinto / highresslowmo.ipynb
Created August 6, 2020 18:49
HighResSlowMo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
## Actions: `env._actions`
### Actions sorted by action index:
| Index | Action | ASCII | Character |
| ----- | ------ | ----- | --------- |
| 0 | CompassDirection.N | '`k`' | 107 |
| 1 | CompassDirection.E | '`l`' | 108 |
| 2 | CompassDirection.S | '`j`' | 106 |
| 3 | CompassDirection.W | '`h`' | 104 |
import aicrowd_gym
import gym
import nle
import numpy as np
import collections
from nle import nethack as nh
def getPrintableChar(a):
non_printable_chars = ['NULL', 'START_OF_HEADING', 'START_OF_TEXT', 'END_OF_TEXT', 'END_OF_TRANSMISSION', 'ENQUIRY', 'ACKNOWLEDGE', 'BELL', 'BACKSPACE', 'HORIZONTAL_TAB', 'LINE_FEED', 'VERTICAL_TAB', 'FORM_FEED', 'CARRIAGE_RETURN', 'SHIFT_OUT', 'SHIFT_IN', 'DATA_LINK_ESCAPE', 'DEVICE_CONTROL_1', 'DEVICE_CONTROL_2', 'DEVICE_CONTROL_3', 'DEVICE_CONTROL_4', 'NEGATIVE_ACKNOWLEDGE', 'SYNCHRONOUS_IDLE', 'END_OF_TRANSMISSION_BLOCK', 'CANCEL', 'END_OF_MEDIUM', 'SUBSTITUTE', 'ESCAPE', 'FILE_SEPARATOR', 'GROUP_SEPARATOR', 'RECORD_SEPARATOR', 'UNIT_SEPARATOR']
if a < 32:
@HanClinto
HanClinto / Response from GPT-J
Created August 11, 2021 17:58
Prompt to GPT-J 6b
A:
I can't tell you where the problem lies, but you should:
make sure you have S3-specific permissions in place for the role you are using for your S3 work, that is, (a) access and (b) full control
make sure you have S3-specific policies attached to the S3 resources in question, that is, (a) access and (b) full control
make sure you are using the correct role
make sure that the resource exists
make sure you have the right policy
@HanClinto
HanClinto / open_tunnel.sh
Last active May 15, 2023 21:06
Open a VSCode tunnel on an arm64 device
# If `code` does not exist in the local directory, then download it.
# https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-arm64
if [ ! -f code ]; then
echo "Downloading code..."
wget -q "https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-arm64" -O code.tar.gz
tar -xzf code.tar.gz
rm code.tar.gz
fi

Description

Tool to calculate the EV of an intentional draw for a player in a Swiss-pairings tournament (such as Magic: The Gathering)

NOTE: WIP -- it is not complete, and this is just a basic structure for keeping track of the tournament structure, as well as the calculations for a players' own points, as well as the various tiers of tiebreakers.

The intention is to build this basic framework into a tool that can do Monte Carlo style simulations (either exhaustive or sampled) to calculate the EV of intentional draws.

Currently a bit stuck on whether or not I should track results at the Game level, or simply at the Match level. Either way, I'm a little stuck on knowing how to determine if a Match is complete via intentional draw, and it's something that I might just have to special-case. Regardless, it's a tricky situation because I'm also trying to write this to support multiplayer, as well as mixed draw+loss resulst being in a single 4-player game (I.E., two players lose, and the final two players tak