Skip to content

Instantly share code, notes, and snippets.

View aidangannon's full-sized avatar
🎸
Working from home

Aidan Gannon aidangannon

🎸
Working from home
View GitHub Profile
@aidangannon
aidangannon / ray_tracer.py
Last active May 10, 2022 01:29
heuristic analysis of scene complexity
import string
from datetime import datetime
from typing import Callable
import bpy
from bpy.types import Object
from mathutils import Vector
VECTOR_LENGTH = 5
var endpoint = new IPEndPoint( IPAddress.Loopback, 6000 );
var server = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );
server.SetSocketOption( SocketOptionLevel.Tcp, SocketOptionName.KeepAlive, true );
server.SetSocketOption( SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, 90 );
server.SetSocketOption( SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, 5 );
server.SetSocketOption( SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 3 );
server.Bind( endpoint );
server.Listen( 1 );
Task.Run( ( ) =>
{
# transaction 1
START TRANSACTION;
LOCK TABLE User IN EXCLUSIVE MODE;
INSERT INTO User (Name, Dob, Age) VALUES ('John', '10-10-1999', 24);
UNLOCK TABLE User;
COMMIT;
# transaction 2
START TRANSACTION;
SELECT * FROM User WHERE ID = '1bd76753-f391-453d-bd98-a212789dd652' FOR UPDATE;