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
async function getWikiImageURL(searchQuery) { | |
const PROXY = "https://cors-anywhere.herokuapp.com/"; | |
const WIKI_API_ENDPOINT = `${PROXY}https://en.wikipedia.org/w/api.php`; | |
// First fetch to get the page ID | |
let pageId; | |
try { | |
console.log("Trying request 1"); | |
const response1 = await fetch( | |
`${WIKI_API_ENDPOINT}?action=query&list=search&srsearch=${encodeURIComponent( |
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
/** | |
* An entity is just an ID. This is used to look up its associated | |
* Components. | |
*/ | |
export type Entity = number | |
/** | |
* A Component is a bundle of state. Each instance of a Component is | |
* associated with a single Entity. |
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
namespace P02 { | |
/** | |
* An entity is just an ID. This is used to look up its associated | |
* Components. | |
*/ | |
type Entity = number | |
/** |
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
type Entity = number | |
abstract class Component { } | |
abstract class System { | |
public abstract componentsRequired: Set<Function> | |
public abstract update(entities: Set<Entity>): void | |
public ecs: ECS | |
} | |
type ComponentClass<T extends Component> = new (...args: any[]) => T | |
class ComponentContainer { | |
private map = new Map<Function, Component>(); |
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
"""Compare preprocessed scruples to original titles. | |
Usage: | |
python -m sc.scripts.from_scruples | |
""" | |
import code # code.interact(local=dict(globals(), **locals())) | |
import json | |
import os | |
from typing import List, Tuple, Set, Dict, Any, Optional, NamedTuple, Iterator, Callable |
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/bash | |
# ______ ______ ______ ______ ______ | |
# /\ == \/\ __ \ /\ == \/\ ___\ /\ == \ | |
# \ \ _-/\ \ __ \\ \ _-/\ \ __\ \ \ __< | |
# \ \_\ \ \_\ \_\\ \_\ \ \_____\\ \_\ \_\ | |
# \/_/ \/_/\/_/ \/_/ \/_____/ \/_/ /_/ | |
# | |
# | |
# Script that turns a pdf from pixels into paper near you (well, near me). |
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
https://freesound.org/people/vacuumfan7072/sounds/396031/ | |
https://freesound.org/people/DSOADigital/sounds/362256/ | |
https://freesound.org/people/MichelleGrobler/sounds/410560/ | |
https://freesound.org/people/LukeSharples/sounds/209127/ | |
https://freesound.org/people/JoelAudio/sounds/135464/ | |
https://freesound.org/people/tim.kahn/sounds/140455/ | |
https://freesound.org/people/et_graham/sounds/366345/ | |
https://freesound.org/people/kristinhamby/sounds/382637/ | |
https://freesound.org/people/LiamG_SFX/sounds/334238/ | |
https://freesound.org/people/kolczok/sounds/198987/ |
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
def compress(bytes_path: str, compressed_path: str) -> None: | |
logging.info('Compressing "{}" to "{}"'.format( | |
bytes_path, compressed_path, | |
)) | |
with open(bytes_path, 'rb') as f_in: | |
with gzip.open(compressed_path, 'wb') as f_out: | |
shutil.copyfileobj(f_in, f_out) | |
logging.info('Removing "{}"'.format(bytes_path)) | |
os.remove(bytes_path) |
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
out/numpy/__init__.pyi:6: error: No library stub file for module 'numpy.lib' | |
out/numpy/__init__.pyi:6: note: (Stub files are from https://github.com/python/typeshed) | |
out/numpy/__init__.pyi:7: error: No library stub file for module 'numpy.matrixlib' | |
out/numpy/_import_tools.pyi:23: error: Cannot assign to a type | |
out/numpy/__init__.pyi:12: error: No library stub file for module 'numpy.version' | |
out/numpy/__init__.pyi:13: error: Cannot find module named '__builtin__' | |
out/numpy/__init__.pyi:13: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help) | |
dataio.py:17: error: Cannot find module named 'tqdm' | |
out/numpy/ctypeslib.pyi:5: error: No library stub file for standard library module 'ctypes' | |
viewer.py:16: error: Cannot find module named 'visdom' |
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
regression.py:21: error: No library stub file for module 'numpy' | |
regression.py:21: note: (Stub files are from https://github.com/python/typeshed) | |
dataio.py:17: error: Cannot find module named 'tqdm' | |
dataio.py:17: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help) | |
viewer.py:16: error: Cannot find module named 'visdom' | |
viewer.py:30: error: Name 'torch.Tensor' is not defined | |
viewer.py:45: error: Module has no attribute "Tensor" | |
viewer.py:107: error: Module has no attribute "Tensor" | |
dataio.py:34: error: Name 'torch.Tensor' is not defined | |
dataio.py:43: error: Name 'torch.Tensor' is not defined |
NewerOlder