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
"""Convenience module for working with grids""" | |
import dataclasses | |
import unittest | |
@dataclasses.dataclass | |
class GridPoint: | |
x: int | |
y: int |
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 Generator | |
def collate_nibbles(upper: bytes, lower: bytes) -> Generator[int]: | |
def to_nibbles(data: bytes) -> bytes: | |
"""Convert bytes to nibbles""" | |
return ( | |
nibble for byte in data for nibble in ((byte & 0xF0), (byte & 0x0F) << 4) | |
) |
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
% Demonstrate attempt at applying x, y offsets via PTB processing hooks. | |
% | |
% Instructions | |
% ------------ | |
% After running, press any key to advance offset position. Position will | |
% not change until key-up event. The script will run indefinitely until the | |
% escape key is pressed. | |
% | |
% Known Issues | |
% ------------ |
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
# %% [markdown] | |
# # Data Generation and Sequencing | |
# %% | |
import pandas as pd | |
import numpy as np | |
import random | |
# %% | |
primary = pd.DataFrame({'primary': ['A', 'B', 'C']}) |
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
import pandas as pd | |
def accounting_month(start, end): | |
month_end = pd.date_range(start=start, end=end, freq=pd.tseries.offsets.LastWeekOfMonth(n=1, weekday=6)) | |
month_start = month_end.shift(periods=-1, freq=pd.tseries.offsets.LastWeekOfMonth(n=1, weekday=6)).shift(periods=1, freq='D') | |
weeks_in_month = (month_end - month_start).shift(periods=1, freq='D') / pd.Timedelta(7, 'D') | |
return pd.DataFrame({'start': month_start, 'end': month_end}, index=month_end.to_period('M')) | |
if __name__ == '__main__': | |
accounting_calendar = accounting_month('2019-01-01', '2022-01-01') |
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
import asyncio | |
import logging | |
import random | |
import sys | |
LOGGER = logging.getLogger(__name__) | |
LOGGER.addHandler(logging.NullHandler()) | |
def config_logging(): |
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
# generated by 'clang2py' | |
# flags '-c -d -l ftd2xx64.dll ftd2xx.h -vvv -o _ftd2xx64.py' | |
# -*- coding: utf-8 -*- | |
# | |
# TARGET arch is: [] | |
# WORD_SIZE is: 4 | |
# POINTER_SIZE is: 8 | |
# LONGDOUBLE_SIZE is: 8 | |
# | |
import ctypes |
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
# Modified based off https://www.oueta.com/microsoft/how-to-uninstall-built-in-apps-from-windows-10/ | |
Get-AppxPackage *twitter* | Remove-AppxPackage | |
Get-AppxPackage *oneconnect* | Remove-AppxPackage | |
Get-AppxPackage *people* | Remove-AppxPackage | |
Get-AppxPackage *messaging* | Remove-AppxPackage | |
Get-AppxPackage *communicationsapps* | Remove-AppxPackage | |
Get-AppxPackage *print3d* | Remove-AppxPackage | |
Get-AppxPackage *autodesksketch* | Remove-AppxPackage | |
Get-AppxPackage *3dview* | Remove-AppxPackage | |
Get-AppxPackage *3dbuilder* | Remove-AppxPackage |
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
# generated by 'clang2py' | |
# flags '-c -d -k defst -l build/libftd2xx.so.1.4.8 -i ftd2xx.h -o test3.py' | |
# -*- coding: utf-8 -*- | |
# | |
# TARGET arch is: [] | |
# WORD_SIZE is: 8 | |
# POINTER_SIZE is: 8 | |
# LONGDOUBLE_SIZE is: 16 | |
# | |
import ctypes |
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
"""multicast_server.py - A simple multicast server that says "Test".""" | |
import socket | |
import struct | |
import time | |
class multicast_speaker(): | |
def __init__(self, address, port, ttl=2, timeout=0.2): | |
self.group = address, int(port) |
NewerOlder