Skip to content

Instantly share code, notes, and snippets.

View arthurpetron's full-sized avatar

Arthur Petron arthurpetron

View GitHub Profile
2) Formal scaffold (constructive)
Definitions (prefix-conditioned)
Def. A (Prefix syntax, suffix structure).
Let \mathcal O be the typed operad of architectures with types as interfaces and operations as compositions;
functorial semantics are \text{Model}:\mathcal O\to\mathbf{Sem}.
In Codynamic Theory, take a monoidal “rule” category S as a generator of \mathcal O’s operations;
let C carry pairs (H,S) (history, rules) and compositional morphisms.
import matplotlib.pyplot as plt
from collections import defaultdict
class StainedGlassSimulator:
def __init__(self):
self.panes = [] # List of panes: each is {'utterance': str, 'color': (r, g, b), 'logic': dict}
self.gluings = [] # List of (pane_idx1, pane_idx2, [shared_keys])
self.history = [] # Trace of actions for codynamic build-trace-test
def add_pane(self, utterance, color, logic_dict):
@arthurpetron
arthurpetron / extract_data.py
Created May 26, 2025 03:26
extract data from 6x6 grid
# world_woke_rise_data
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import convolve
from scipy import interpolate
from scipy.signal.windows import hamming
# Step 1: Load the original image
#!/bin/bash
# Colors for better visibility
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
BOLD='\033[1m'
@arthurpetron
arthurpetron / Autonomous Self-Modifying Entities
Created May 8, 2025 08:58
Autonomous Self-Modifying Entities
\documentclass[11pt,a4paper]{article}
% Enhanced font packages for professional typography
\usepackage[T1]{fontenc}
\usepackage[scaled=0.95]{tgheros} % Sans-serif for headings
\usepackage{tgtermes} % Serif for body text
\usepackage{newtxmath} % Math fonts compatible with Times
\usepackage[utf8]{inputenc}
% Standard packages from original document
\usepackage{graphicx}
class Node:
def __init__(self, parent, num_bytes, id):
self.id = id
self.size = num_bytes
self.is_split = False
self.left = None
self.right = None
self.used = False
self.parent = parent
{"x":14, "y":194, "w":15, "h":10, "pixels":73, "cx":21, "cy":199, "rotation":0.433928, "code":1, "count":1, "perimeter":39, "roundness:0.294848"}
{"x":23, "y":205, "w":13, "h":8, "pixels":49, "cx":29, "cy":208, "rotation":0.452304, "code":1, "count":1, "perimeter":39, "roundness:0.309348"}
{"x":166, "y":180, "w":13, "h":10, "pixels":49, "cx":171, "cy":184, "rotation":2.890961, "code":1, "count":1, "perimeter":61, "roundness:0.339211"}
{"x":173, "y":139, "w":16, "h":11, "pixels":108, "cx":181, "cy":144, "rotation":3.099489, "code":1, "count":1, "perimeter":88, "roundness:0.330384"}
{"x":184, "y":101, "w":17, "h":13, "pixels":125, "cx":192, "cy":107, "rotation":2.846034, "code":1, "count":1, "perimeter":96, "roundness:0.482959"}
{"x":165, "y":99, "w":16, "h":14, "pixels":127, "cx":173, "cy":105, "rotation":3.129615, "code":1, "count":1, "perimeter":100, "roundness:0.452518"}
{"x":200, "y":305, "w":8, "h":15, "pixels":27, "cx":203, "cy":313, "rotation":1.156044, "code":1, "count":1, "perimeter":36, "roundness:0.
```# From: Hackers Guide to Neural Networks: http://karpathy.github.io/neuralnets/
# by Andrej Karpathy
import autograd.numpy as np
from autograd import grad
import matplotlib.pyplot as plt
def find_gradient(*args, grad_func, arg_num):
partial = grad(grad_func, arg_num)
return partial(*args)
Output of the container: Acquiring controller client channel: 172.17.0.4:1235.
Controller channel not ready. Waiting. Current state: 0.
INFO: Starting input thread
low_level_txandrx: SUCCESS
low_level_txandrx: SUCCESS
low_level_txandrx: SUCCESS
low_level_txandrx: SUCCESS
low_level_txandrx: SUCCESS
low_level_txandrx: SUCCESS
low_level_txandrx: SUCCESS
//// OWL.Status ////
OWL.Status = function(owl) {
var self = this;
var owl = owl;
var labels = {
status: getElem("status_lbl"),
freq: getElem("freq_lbl"),