Skip to content

Instantly share code, notes, and snippets.

@zalo
zalo / multitouch.py
Last active October 5, 2022 05:29
Python Windows Multitouch Interface
from ctypes import *
from ctypes.wintypes import *
# Constants
# For touchMask
TOUCH_MASK_NONE= 0x00000000 # Default
TOUCH_MASK_CONTACTAREA= 0x00000001
TOUCH_MASK_ORIENTATION= 0x00000002
TOUCH_MASK_PRESSURE= 0x00000004
TOUCH_MASK_ALL= 0x00000007
#ifdef RENDER_SNIPPET
#include <vector>
#include "PxPhysicsAPI.h"
#include "../snippetrender/SnippetRender.h"
#include "../snippetrender/SnippetCamera.h"
using namespace physx;
@zalo
zalo / canonicalHomographyFlowScreen.py
Last active November 20, 2025 18:00
Webcam Lightgun Tracking Script and Leap2 Lightgun Tracking Scripts
import numpy as np
import cv2
import dxcam
import win32api
import threading
import time
#from line_profiler import LineProfiler
class webcamThread(threading.Thread):
def __init__(self):
@zalo
zalo / voronoi_decomposition.py
Last active January 27, 2025 13:00
New Convex Decomposition Technique using Weighted-Voronoi Diagrams aka Power Diagrams aka Laguerre Tessellations
import tess
import random
import trimesh
import manifold3d
import numpy as np
from time import perf_counter
rand_color = [random.random(), random.random(), random.random()]
def explode(convex_pieces, explode_amount = 1.5, debug_shapes = None):
global rand_color
@zalo
zalo / index.html
Last active September 30, 2024 22:52
Mouse Jitter Testing
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fullscreen Canvas</title>
<style>
body, html {
margin: 0;
padding: 0;
@zalo
zalo / red-infrared-light-cataracts-2025-03-11.md
Created March 11, 2025 00:38
Claude-DR Report on Cataracts without UV

Effects of Red and Infrared Light (640-940nm) on Cataract Formation in Humans in the Absence of UV Light

Date: March 11, 2025

Executive Summary

This report examines whether red and infrared light in the wavelength range of 640-940nm can cause cataracts in humans when UV light is absent. After analyzing multiple scientific studies, safety guidelines, and expert opinions, the evidence suggests that red and infrared light within this range is unlikely to cause cataracts under normal exposure conditions. The primary mechanism for cataract formation from light exposure appears to be thermal rather than photochemical for these wavelengths. While high-intensity exposure could potentially cause thermal damage, typical therapeutic and environmental exposures fall well below established safety thresholds. Individuals with pre-existing eye conditions or those using photosensitizing medications should exercise caution, but for most people, exposure to red and infrared light (640-940nm) does not present a sign