Skip to content

Instantly share code, notes, and snippets.

Direct solution weights: [0.79, 0.85, 0.84]
Forward output: [111, 117, 116]
Loss: 0
@secemp9
secemp9 / rot.c
Created November 27, 2024 15:11
rotating cube
#include <TFT_eSPI.h>
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI();
// 3D coordinates for cube vertices
const float vertices[8][3] = {
{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1},
{-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}
};
@secemp9
secemp9 / transparency_trick.py
Created November 24, 2024 12:06
clickthrough + keypassthrough transparency
import pygame
import win32gui
import win32con
import win32api
pygame.init()
# Set up the display (fullscreen for this example)
screen_info = pygame.display.Info()
width, height = screen_info.current_w, screen_info.current_h
;(defun shellfm ()
;(interactive)
; (shell-command-on-region
; (point-min) (point-max) "cat $@"))
(defun shell-command-on-buffer ()
"Asks for a command and executes it in inferior shell with current buffer
as input."
(interactive)
(shell-command-on-region
@secemp9
secemp9 / bilinear_nn.py
Created October 24, 2024 18:03
bilinear NN, attempt 1
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import matplotlib.pyplot as plt
# Define a synthetic multi-linear function f(x, y, z, t) = x * y + z * t
def true_function(x, y, z, t):
return x * y + z * t
@secemp9
secemp9 / ent.py
Created October 19, 2024 10:16
ent port, not mine (forgot the github repo, will update)
import argparse
import collections
import math
import statistics as stat
import sys
__version__ = "2022.08.27"
PI = 3.14159265358979323846
@secemp9
secemp9 / mediapipe_landmark.py
Created September 30, 2024 02:31
fixed yacine code
import cv2
import numpy as np
import mediapipe as mp
# Initialize mediapipe Face Mesh and Hands solutions
mp_face_mesh = mp.solutions.face_mesh
mp_hands = mp.solutions.hands
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
@secemp9
secemp9 / genv.py
Created September 13, 2024 12:40
git env for ssh keys and github accounts
#!/usr/bin/env python3
import os
import subprocess
import argparse
import json
import shutil
CONFIG_FILE = os.path.expanduser('~/.github_account_manager.json')
SSH_CONFIG_FILE = os.path.expanduser('~/.ssh/config')
@secemp9
secemp9 / panda3D_example2.py
Created September 5, 2024 06:06
Interactive example in panda3D
from direct.showbase.ShowBase import ShowBase
from panda3d.core import *
import math
from direct.task import Task
from panda3d.core import ClockObject
globalClock = ClockObject.getGlobalClock()
class MyApp(ShowBase):
def __init__(self):
@secemp9
secemp9 / panda3D_example.py
Created September 5, 2024 06:01
example scene in panda3D using local assets
from direct.showbase.ShowBase import ShowBase
from panda3d.core import *
import math
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
# Load the environment model.
self.scene = self.loader.loadModel("models/environment")