👨👧👧
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
name: Check Version Change and Tag | |
on: [push] | |
jobs: | |
tag-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 |
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 fib(): | |
a = 0 | |
b = 1 | |
while True: | |
yield a | |
a, b = b, a + b | |
for i, v in enumerate(fib(), start=1): | |
if i == 1_000_000: |
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
# Copyright 2021 Two Sigma Open Source LLC. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
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
import math | |
import numpy | |
import pyaudio | |
import analyse | |
import pygame | |
from pygame import * | |
import pygame, time, numpy, pygame.sndarray | |
sample_rate = 44100 |
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
"""Benchmarks for vector classes in Python""" | |
from timeit import Timer | |
def timeit(name, stmt): | |
defs = dict( | |
v=v, | |
a=v(1.0, 2.0), | |
b=v(-1.0, -1.0), | |
) |
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
# 1000 balls find an equilibrium spatial hash collision | |
# credit to Daniel Pope for showing me the light :) | |
# fb.com/groups/pygame | |
import pygame | |
import random, math | |
from itertools import product | |
from pygame.math import Vector2 as v2 | |
import colorsys |
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
# Created by Anthony Cook | |
# fb.com/groups/pygame | |
import pygame | |
from pygame import gfxdraw | |
import random | |
import numpy as np | |
import time | |
import os | |
from itertools import product, count |
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
# Created by Anthony Cook | |
# fb.com/groups/pygame | |
import pygame | |
from pygame import gfxdraw | |
import random | |
import os | |
import time | |
from itertools import product |
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
import sys, os | |
import pygame | |
from pygame.locals import * | |
from unicodedata import normalize | |
try: | |
import pygame.freetype as freetype | |
except ImportError: | |
print("No FreeType support compiled") | |
sys.exit() |
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 check_dubious_concat(src): | |
"""Check for suspicious string literal concatenation. | |
We will warn about instances of string literal concatenation in list-like | |
contexts - that is, where concatenated string literals are adjacent to | |
commas or inside square brackets. | |
Such a heuristic will catch instances like this:: | |
foo = [ |
NewerOlder