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
# listen.py | |
from threading import Thread | |
import socket | |
import time | |
import sys | |
VERBOSE = False # Enables/Disables printing of debug messages | |
IP_PORT = 22000 # the port that tinkerboard listens to | |
TIME_INTERVAL = 10 # sec |
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 (C) 2012 Daniel Maturana | |
# This file is part of binvox-rw-py. | |
# | |
# binvox-rw-py is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# binvox-rw-py is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
using System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
public static class ResourcesExtension | |
{ | |
/// <summary> | |
/// Recursively traverses each folder under <paramref name="path"/> and returns the list of file paths. | |
/// It will only work in Editor mode. | |
/// </summary> |
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 | |
from matplotlib import pyplot as plt | |
plt.ion() | |
class AxesWrapper: | |
def __init__(self, lines, ax, max_display_capacity=None): | |
self.lines = lines |
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 asyncio | |
import multiprocessing as mp | |
from websockets.server import serve | |
from websockets.exceptions import ConnectionClosedOK | |
import time | |
class DuplexWebsocketsServerProcess(mp.Process): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self._send_queue = mp.Queue() |
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
using UnityEngine; | |
using Unity.VisualScripting; | |
public static class MathExtensions | |
{ | |
public static float Remap(this float value, float fromMin, float fromMax, float toMin, float toMax, bool isClamped = false) | |
{ | |
return isClamped | |
? Mathf.Clamp01((value - fromMin) / (fromMax - fromMin)) * (toMax - toMin) + toMin | |
: (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin; |