Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Barber honno

View GitHub Profile
View bad_hypothesis_benchmark.py
#!/usr/bin/env python
import pytest
from hypothesis import assume, given, strategies as st
from hypothesis.errors import InvalidArgument
from hypothesis.extra.array_api import DTYPE_NAMES, NUMERIC_NAMES
from tests.array_api.common import COMPLIANT_XP, xp, xps
from tests.common.debug import find_any, minimal
from tests.common.utils import fails_with, flaky
View hypothesis-array-api.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View wip_hypothesis_array_api_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View health_check_problems.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@honno
honno / wip_hypothesis_array_api_demo.ipynb
Last active Aug 5, 2021
WIP demo that demonstrates what my internship project is doing. For those not familiar with Array API and/or Hypothesis I want to try and explain what they do.
View wip_hypothesis_array_api_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@honno
honno / unmute_all.ipynb
Created Jul 18, 2021
Unmute everyone you follow. Yaknow, for those times when you fuck around with the API and mute everybody by accident.
View unmute_all.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@honno
honno / mersenne_twister.py
Last active Feb 8, 2021
Stupid simple Mersenne Twister.
View mersenne_twister.py
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
View readme-example.md

Crimelife 2

Description

-NO MORE UPDATES- Crimelife 2 is a full 3d GTA clone with advanced graphics and phisics. In this beta version you can freeroam around the new huge city. Shoot people and explode vehicles with 7 weapons including uzi, shotguns, rocketlunchers and more. Purchase more weapons from Weapon-Nation shop Drive a car from 16 available all diferent in appearance and interior. Enter a building to explore the rich content and many, many other things.

View lightbox_js_profile.txt
PATH: '/js_/http://sandbox.yoyogames.com/javascripts/lightbox.js'
170065502 function calls (169082960 primitive calls) in 258.442 seconds
Ordered by: internal time, call count
ncalls tottime percall cumtime percall filename:lineno(function)
1959332 122.664 0.000 122.664 0.000 {method 'insert' of 'list' objects}
979667 13.829 0.000 51.557 0.000 /usr/local/lib/python3.8/dist-packages/pywb-2.5.0-py3.8.egg/pywb/warcserver/index/cdxobject.py:107(__init__)
979669 10.424 0.000 10.424 0.000 /usr/lib/python3.8/json/encoder.py:204(iterencode)
979667 6.942 0.000 6.942 0.000 /usr/lib/python3.8/json/decoder.py:343(raw_decode)
@honno
honno / defaultlist.py
Last active Dec 8, 2020
Reference implementation of the list with defaults, defaultlist
View defaultlist.py
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