Rectangles


Rectangle Recursion A sub-component of my electrical circuit generation project. Spatial linked node structures can be generated with little code. The algorithm can be used to generate some pleasing “modern art” images. Here is a collection of the outputs. The code used to generate is at the bottom of the page. The algorithm comes from the following paper. credit: Automatic Real-Time Generation of Floor Plans Based on Squarified Treemaps Algorithm…
Read more ⟶

Python: Structures


Struct: Options in Python Structs are commonly used to format data sent between services over a network. A struct contains types organized in continuous memmory. In c/c++, structs can be directly created using the ‘struct’ keyword. Structs can be transformed to/from their continuous byte representations. This allows for a consise representation in code. Python does not contain a built-in ‘struct’ object. There are a number of ways to replicate the functionality of structs in python.…
Read more ⟶

Python: Multicast


Send/Receive multicast messages: The following code block shows how to instantiate a multicast socket on windows/linux. Features: socket can both send/receive multicast messages avoid binding to all interfaces (‘0.0.0.0’), this can be a security issue Many online examples for python multicast sockets no longer work for newer version of Linux. This code snippet was tested to work on Ubuntu 22 as of 7/24/2022. YOU LIE: This code does not work on my system!…
Read more ⟶