This file contains hidden or 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
| org $7e00 | |
| pia2b equ $ff22 | |
| andcc #$ef | |
| loop | |
| clra text mode, CSS=0 | |
| ; wait for VSYNC, clear CSS at the top of the vertical retrace | |
| sync wait for vsync | |
| sta pia2b |
This file contains hidden or 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 { DND5E } from "../../../systems/dnd5e/module/config.js"; | |
| // Update list of skills | |
| DND5E.skills.eng = "Engineering"; | |
| Hooks.once("init", function () { | |
| game.system.model.Actor.character.skills.eng = {value: 0, ability: "int"}; | |
| }); | |
| // This seems to work. are there any issues? |
This file contains hidden or 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
| #type: ignore | |
| from math import pi | |
| # Original haskell code from: https://www.haskellforall.com/2021/01/the-visitor-pattern-is-essentially-same.html | |
| # -- | This plays the same role as the old `Shape` type | |
| # type Shape = forall shape | |
| # . (Double -> Double -> Double -> shape) | |
| # -> (Double -> Double -> Double -> Double -> shape) | |
| # -> shape |
This file contains hidden or 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
| from contextlib import contextmanager | |
| @contextmanager | |
| def breakable(): | |
| class Break(Exception): pass | |
| def breaker(): raise Break | |
| try: | |
| yield breaker | |
| except Break: | |
| pass |
This file contains hidden or 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
| # Original: https://github.com/python/cpython/blob/46abfc1416ff8e450999611ef8f231ff871ab133/Lib/logging/config.py#L438-L464 | |
| def convert(self, value): | |
| """ | |
| Convert values to an appropriate type. dicts, lists and tuples are | |
| replaced by their converting alternatives. Strings are checked to | |
| see if they have a conversion format and are converted if they do. | |
| """ | |
| match value: | |
| case ConvertingDict() | ConvertingList() | ConvertingTuple: |
This file contains hidden or 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
| # based on https://github.com/python/cpython/blob/9538bc9185e934bee2bd5ae2cda2b2e92a61906d/Lib/distutils/command/build_ext.py#L357-L385 | |
| match ext: | |
| case Extension(): | |
| continue | |
| case tuple((str(ext_name), {"sources": build_src})) if extension_name_re.match(ext_name): | |
| log.warn("old-style (ext_name, build_info) tuple found in " | |
| "ext_modules for extension '%s' " | |
| "-- please convert to Extension instance", ext_name) | |
| ext = Extension(ext_name, build_src) | |
| case _: |
This file contains hidden or 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
| ====================================================== FAILURES ======================================================= | |
| ______________________________________________ TestPEP561.test_typed_pkg ______________________________________________ | |
| [gw1] linux -- Python 3.6.2 /home/machinalis/.virtualenvs/mypy-dev/bin/python3 | |
| self = <mypy.test.testpep561.TestPEP561 testMethod=test_typed_pkg> | |
| def test_typed_pkg(self) -> None: | |
| """Tests type checking based on installed packages. | |
| This test CANNOT be split up, concurrency means that simultaneously |
This file contains hidden or 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
| # Build functions that can be applied with **, mimicing the dollar operator in Haskell | |
| class ApplyableFunc(): | |
| def __init__(self, func): | |
| self.func = func | |
| def __call__(self, *args, **kwargs): | |
| return self.func(*args, **kwargs) | |
| def __pow__(self, arg): |
This file contains hidden or 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
| # An example implementation of Logistic Regression | |
| # Originally by Alejandro Peralta | |
| # Type annotation by Daniel Moisset | |
| import numpy as np | |
| import scipy as sp | |
| from sklearn import cross_validation | |
| from sklearn.utils.fixes import expit as logistic_sigmoid | |
| from sklearn.utils.extmath import log_logistic |
This file contains hidden or 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 json | |
| import sys | |
| # You need scapy installed to run this | |
| from scapy.utils import PcapReader | |
| import scapy.layers.inet | |
| def main(): | |
| if len(sys.argv) != 2: | |
| sys.stderr.write("Usage: %s <filename.pcap>\n\n" % sys.argv[0]) |
NewerOlder