Architecture – structuring large and expandable projects

TLDR with bald head

I want to create a library (I think that's the right term) for my own learning environments for reinforcement (envs for short).. Most Envs are based on self-implemented games that were created either in pure Python or in C ++ with Python bindings. What would be the best way to structure this project so that it is easy to expand, maintain and make the most sense? I want to be able to reuse code, e.g. B. using a general board class for all my board game implementations (e.g. chess, lot, Gomoku). I plan to make it cross-platform with the help of CMake and could even dare to pack it as a Conda package.

On my first search, I found that this layout (and its variations) is popular, and decided to rely on it.

My original plan was To structure my library into projects, create a repo for each project and insert one project as a Git submodule into another. To create the environment for the game
In 2048 the structure would be as follows (CMakeLists omitted):

(The env vector is based on the env-2048, which is based on the game-2048 that uses the general board class.)

general-board
├── external
│   └── Catch2/
├── include
│   └── general-board
│       └── file.h
├── src
│   └── file.cpp
└── tests
    └── tests.cpp

game-2048
├── app
│   └── manual_game.cpp
├── external
│   ├── Catch2
│   └── general-board
├── include
│   └── game-2048
│       └── file.h
├── src
│   └── file.cpp
└── tests
    └── tests.cpp

env-2048
├── external
│   ├── Catch2/
│   └── game-2048/
├── include
│   └── env-2048
│       └── file.h
├── src
│   └── file.cpp
└── tests
    └── tests.cpp 

env-vector <---- this would be on the top, bundling the envs together
├── external
│   ├── Catch2/
│   ├── env-2048/ 
│   ├── env-chess/ <---- another board game
│   └── env-go/ <---- another board game
├── include
│   └── env-vector
│       └── file.h
├── python
│   └── pybind11_magic_here
├── src
│   └── file.cpp
└── tests
    └── tests.cpp

After some implementation, I was worried if the number of sub-modules and redundancy got too large. With this structure, the project above would include the General Board project n times (where n is the number of games based on one board), and the catch2 would be even more included. Seems fishy and prone to errors.

My second idea was to create a large project and to include everything in the project in a "flat" way and not in a "nested" way as before. It would look like this:

(line ending with '/' depicts a folder)
environments_all_in_one
│
├── external
│   └── Catch2/
├── include
│   └── environments_all_in_one
│       └── **not_even_sure_what_to_put_here**      
├── python
│   └── pybind11_magic_here
├── src
│   ├── env_vector
│   ├── envs
│   │   ├── env-2048/
│   │   ├── env-chess/
│   │   └── env-go/
│   ├── games
│   │   ├── game-2048/
│   │   ├── game-chess/
│   │   └── game-go/
│   └── general-board
│       ├── board_abc/
│       ├── board_array/
│       └── board_vector/
└── tests
    └── tests.cpp

In this way, code would not be present more than once and definitely contributes to transparency. However, since I have no experience, I have to ask:

Is there a better way to do this?

oop – plugin architecture Question: How to avoid using transients

I create an internal plugin that offers a filtering mechanism with AJAX for each post type, depending on the configuration I saved in a JSON.

When the plugin is loaded, I have to set the callback for the AJAX call, and I set that straight away (I'll stick to OOP):

$gfb = FilterBuilder::get_instance();
$action_filter_reg_instance = new ActionFilterRegistration();
$action_filter_reg_instance->add_action( 'wp_ajax_process_filters', $gfb, 'process_filters_callback' );

This sets the callback and it works fine … but this instance of $ gbf is lost when the page that shows the posts is loaded and I have to set other properties when loading the template.

For example, when the page that shows the posts is loaded, I create a new FilterBuilder object and pass the query arguments to it, which are then stored in the instance as a property of the class.

When the callback is called, it is a separate instance of a FilterBuilder, so there is nothing in this class instance that I have defined in the template.

This puts me in a difficult situation because I want to have access to the query arguments that were defined when this particular instance was created.

I initially used transients to share the query arguments that the template instance defined through the callback function, but it just feels wrong. In addition, I believe that transients are of maximum length and can therefore explode if this limit is reached.

What other options are there? Maybe serialize the template class instance into a JSON and load it from the recall? That also sounds … a little more.

I don't want to use global variables … interested in what you think would be an elegant approach to work around this problem.

Thank you for taking the time to read this! 👍🏽

Computer architecture – should a solid-state hard drive cause grating work noise?

I use heavy software. Mostly 3d. I'm used to the soothing sound of a hard drive that sounds like a popcorn popper.

But I just got my first Lenovo with a solid-state hard drive. Model KXG6AZNV512G TOSHIBA
to be exact.

It makes high-frequency cracking noises … even one after the other with every key press (Firefox browser, 1104 memory usage).

Impressive.

When I use zbrush, I hear a buzz every time the model is turned.

Is that normal?

How do I install PolyBase in an availability group architecture?

Background: I am designing a two-node SQL 2019 Availability Group installation that will be hosted on VMs.
We would only have restricted the use of PolyBase (single nodes). The Microsoft Docs do not refer to the installation for HA architectures. It only refers to how to create a PolyBase cluster. I've checked the Microsoft documentation, but I'm not sure how Polybase clusters behave compared to Windows cluster / availability groups.

Question:
How do I install PolyBase in an availability group architecture?

Gates:
The goal is to keep PolyBase queries running after the failover event (without manual intervention). The decision I'm facing is the installation of 2 PolyBase head nodes (1 Polybase head node per HA node) as I currently understand it.

I'm looking for resources, articles, or advice for this situation. How do I install PolyBase in an availability group architecture?

Dynamic data delivery with JSDelivr Architecture / Design Questions

I have a JavaScript application that retrieves and renders data on a map. Due to CORS restrictions, I decided to save the data in a .js file on GitHub and retrieve it with JSDelivr

web analytics