Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 9 in line 1.
sample;annotation
форма для выпечки;[(0, 5, 'B-TYPE'), (6, 9, 'I-TYPE'), (10, 17, 'I-TYPE')]
фарш свиной;[(0, 4, 'B-TYPE'), (5, 11, 'I-TYPE')]
сок ананасовый без сахара;[(0, 3, 'B-TYPE'), (4, 14, 'I-TYPE'), (15, 18, 'I-TYPE'), (19, 25, 'I-TYPE')]
еринги;[(0, 6, 'B-TYPE')]
молооко;[(0, 7, 'B-TYPE')]
поролок;[(0, 7, 'B-TYPE')]
свмнина;[(0, 7, 'B-TYPE')]
припрааа для рыбы;[(0, 8, 'B-TYPE'), (9, 12, 'I-TYPE'), (13, 17, 'I-TYPE')]
сулугцн;[(0, 7, 'B-TYPE')]
@Niptlox
Niptlox / 3D-voxel-AABB-GLFW-demo.py
Created September 4, 2025 18:34
A 3D voxel-based game prototype using OpenGL, GLFW, and NumPy with AABB collision detection, Perlin noise terrain generation, raycasting for block selection, and colored mesh rendering. Features player movement, gravity, jumping, and block placement/destruction — like a minimal Minecraft-style engine in Python.
"""
A 3D voxel-based game prototype using OpenGL, GLFW, and NumPy with AABB collision detection, Perlin noise terrain generation, raycasting for block selection, and colored mesh rendering. Features player movement, gravity, jumping, and block placement/destruction — like a minimal Minecraft-style engine in Python.
"""
import numpy as np
import glfw
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.arrays import vbo
import time
import math
@Niptlox
Niptlox / Voxel_GLFW_MuJoCo_demo.py
Created September 4, 2025 16:44
Voxel Game with MuJoCo & GLFW. A minimal 3D voxel sandbox game using MuJoCo for physics and GLFW for rendering. Features terrain generation with Perlin noise, block breaking/placing, first-person camera, and basic physics. Textures are auto-generated. Short demo of procedural world interaction in MuJoCo.
"""
Voxel Game with MuJoCo & GLFW
A minimal 3D voxel sandbox game using MuJoCo for physics and GLFW for rendering. Features terrain generation with Perlin noise, block breaking/placing, first-person camera, and basic physics. Textures are auto-generated.
Short demo of procedural world interaction in MuJoCo.
"""
import mujoco
import glfw
import numpy as np
import time
@Niptlox
Niptlox / json_remove_keys.py
Created August 29, 2025 05:28
Recursively removes specified keys from nested dicts and lists, copying only changed parts.
def remove_keys_copy_on_write(obj, keys_to_delete):
"""
Recursively removes specified keys from a nested data structure (dicts and lists) using a
copy-on-write strategy. This means that only the parts of the structure containing the keys to be removed
are copied and modified, while the rest remains as references to the original objects.
Parameters:
- obj: The input nested data structure (can be a dict, list, or other types).
- keys_to_delete: A collection (set or list) of keys to be removed from dictionaries at any nesting level.
@Niptlox
Niptlox / Fastapi_log.py
Created August 22, 2025 07:42
Logging decorator for FastAPI
import logging
from fastapi import FastAPI, Request, Response
from functools import wraps
import json
app = FastAPI()
logger = logging.getLogger("my_logger")
def log_route(level: str = "info", log_body: bool = False):
def decorator(func):
Сумма_средних_длительностей_по_этапам =
VAR Этапы =
SUMMARIZE(
FILTER(
'этапы перевозки',
RELATED('перевозки'[продукт]) = SELECTEDVALUE('продукты'[id])
),
'этапы перевозки'[номер этапа],
"СредняяДлительность",
AVERAGEX(
@Niptlox
Niptlox / WorkManager.py
Last active July 15, 2025 12:42
Tkinter app for work task management
import tkinter as tk
from tkinter import ttk, messagebox, filedialog
import csv
from datetime import datetime
import os
import pandas as pd
class Task:
def __init__(self, name, archived=False):
self.name = name
DECLARE
v_count NUMBER;
BEGIN
FOR col IN (SELECT column_name FROM all_tab_columns WHERE table_name = 'WETAB') LOOP
EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM wetab WHERE ' || col.column_name || ' = 5000001'
INTO v_count;
IF v_count > 0 THEN
DBMS_OUTPUT.PUT_LINE('Значение найдено в столбце: ' || col.column_name);
END IF;
END LOOP;
@Niptlox
Niptlox / steps.py
Last active February 24, 2025 16:34
import logging
import math
import cv2
from rtmlib import Wholebody, draw_skeleton, BodyWithFeet, Body
from rtmlib.visualization import halpe26
log = logging.getLogger(__name__)