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
| (setq org-latex-listings 'minted | |
| org-latex-packages-alist '(("" "minted")) | |
| org-latex-pdf-process | |
| '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | |
| "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| \title{Representing Scotland Yard with data structures, and using Computational Thinking to determine Mr X's location} | |
| \author{Matthew Barber\\ | |
| 160056525} | |
| \date{\today} | |
| \documentclass{article} | |
| \usepackage{tikz} | |
| \usepackage{graphicx} | |
| \usepackage{calc} |
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
| 1 | |
| 0 | |
| 1 | |
| 0 | |
| 1 | |
| 0 | |
| 1 | |
| 1 | |
| 1 | |
| 0 |
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 copy import copy | |
| def berlekamp_massey(sequence: List[int]) -> int: | |
| n = len(sequence) | |
| error_locator = [0 for _ in range(n)] | |
| error_locator[0] = 1 | |
| error_locator_prev = copy(error_locator) |
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
| """Store functionality for the CLI | |
| Notes | |
| ----- | |
| A store is an abstraction for a folder in the user's local data directory | |
| which pertains to a specific dataset that comprises of RNG output. The store can | |
| subsequently store test results and report markup for said results. | |
| """ | |
| import pickle | |
| import shelve |
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 collections import Counter | |
| from collections import defaultdict | |
| from itertools import accumulate | |
| from itertools import product | |
| from math import erfc | |
| from math import floor | |
| from math import log | |
| from math import log2 | |
| from math import sqrt | |
| from typing import Iterator |
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 collections.abc import MutableMapping | |
| from bisect import bisect_left | |
| class Bins(MutableMapping): | |
| def __init__(self, intervals): | |
| empty_bins = {interval: 0 for interval in intervals} | |
| self._dict = empty_bins | |
| def __getitem__(self, key): | |
| interval = self._roundkey(key) |
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 collections import defaultdict | |
| from collections.abc import Sequence, MutableSequence | |
| class defaultlist(MutableSequence): | |
| def __init__(self, default_factory=None): | |
| self._ddict = defaultdict(default_factory or defaultlist._none_factory) | |
| @staticmethod | |
| def _none_factory(): | |
| return None |
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
| class Mersenne: | |
| def __init__(self, seed=1234): | |
| self.seed = seed | |
| self.j = 2 ** 31 - 1 | |
| self.k = 16807 | |
| self.period = 2 ** 30 | |
| def __iter__(self): | |
| return self | |