Skip to content

Instantly share code, notes, and snippets.

View szabolcsdombi's full-sized avatar

Szabolcs Dombi szabolcsdombi

View GitHub Profile
@szabolcsdombi
szabolcsdombi / parallel_python_subinterpreters.cpp
Created October 4, 2023 17:29
Running sub-interpreters in parallel with Python 3.12
#include <Windows.h>
#include <Python.h>
void worker(PyThreadState * tstate) {
PyThreadState_Swap(tstate);
PyRun_SimpleString("fib = lambda x: x if x < 2 else fib(x - 1) + fib(x - 2)");
PyRun_SimpleString("print(f'{fib(38) = }')");
}
PyThreadState * new_interpreter() {
@szabolcsdombi
szabolcsdombi / gl-types.txt
Last active January 18, 2023 08:28
OpenGL GLSL types
0x1404 GL_INT
0x1405 GL_UNSIGNED_INT
0x1406 GL_FLOAT
0x140A GL_DOUBLE
0x8B50 GL_FLOAT_VEC2
0x8B51 GL_FLOAT_VEC3
0x8B52 GL_FLOAT_VEC4
0x8B53 GL_INT_VEC2
0x8B54 GL_INT_VEC3
0x8B55 GL_INT_VEC4
root@raspberrypi:~# DISPLAY=:0 XAUTHORITY=/home/pi/.Xauthority glxinfo
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_no_error,
GLX_ARB_create_context_profile, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,