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
#!/usr/bin/env python3 | |
from functools import reduce | |
from itertools import count, cycle, islice, repeat | |
def fizzbuzz(*args): | |
class Fizz(int): | |
__add__ = lambda fi, z: z | |
__call__ = lambda b, u, z: z(u) |
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
#!/usr/bin/env python3 | |
from itertools import count | |
# This is stable up to about x=34. | |
# Above that, reimplement with rational arithmetic. | |
def Si(x): | |
"""Sine integral. Numerically stable up to about x=34.""" | |
sign = +1 |
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
// Example Arduino sketch shows how to make a "rotor" of LEDs that light up, | |
// then fade away as the rotor passes them by. | |
// See https://mstdn.social/@alpenglow/111722310220283286 | |
#define ROTOR_LED_COUNT 10 | |
#define ROTOR_UPDATE_MSEC 1 | |
#define ROTOR_ADVANCE_MSEC 100 | |
#define ROTOR_MAX_BRIGHTNESS 255 | |
#define ROTOR_MIN_BRIGHTNESS 0 |
OlderNewer