AllMyNotes Documentation

website·Indexed 30 days ago

https://arnewohletz.github.io/AllMyNotes

A personal knowledge base covering software design principles (SOLID, DRY), design patterns (Singleton, Observer, Strategy, etc.), Python development guides including unittest.mock.Mock and pyenv, Sphinx extension tutorials, and network configuration for SSH and Proxy Jump.

Tokens
170.1K
Snippets
846
Records
1.1K
Agent score
75%

What's inside AllMyNotes

  1. Overview of c’t-WIMage backup solution

    WIMage is a backup solution provided by c’t for the main disk partition (C:\). It creates backups that are compatible with the Windows Setup Tool, allowing them to be transferred back onto hard disk partitions. It supports Windows 8.1, 10 (version 1703 and later), and 11 in both 32-bit and 64-bit variants.
  2. Understand the Docker installation architecture

    A Docker installation follows a client-server architecture consisting of two primary components:

    1. Docker Daemon: A service that runs on the host OS. It must run on Linux because it depends on specific Linux kernel features. The daemon manages Docker images and exposes a REST API.
    2. Docker CLI (Client): A command-line interface installed on the local OS (Linux, macOS, or Windows) that communicates with the Docker daemon via its REST API to manage containers.

    In this ecosystem, the daemon acts as the server and the CLI acts as the client. Third-party clients for various programming languages can also interact with the daemon's API.

  3. Inspect detailed process information and user rights

    To retrieve comprehensive details about a process (such as executable path, version, and priority), pipe Get-Process to Format-List *. To see the user rights associated with a process, use the -Include-UserName parameter, which requires an administrator console.
    # Get all detailed properties
    Get-Process PROCESS_NAME | Format-List *
    
    # Get user rights (Requires Admin)
    Get-Process PROCESS_NAME -Include-UserName
  4. Understand Routing in React

    Routing in React is the process of matching different URLs to different UI views (React components). This allows users to navigate between application screens using the browser URL while keeping the UI in sync with the current address.

    Crucially, React does not include a built-in routing mechanism; it relies on third-party libraries. React Router is the most commonly used library for implementing this functionality.

  5. Understand the purpose of Exception Handling in Java

    Exception handling is used to manage errors that occur during program execution, particularly when the specific context of how an object will be used is unknown at the time of the class's development. Common error sources include:

    • External file issues: Denied read/write access or hardware failure.
    • Invalid user input: Operational errors by the end-user.
    • Software bugs: Logic errors within the code.

    Instead of implementing a generic error handler within a low-level class (like File), which cannot know the specific requirements of every possible application, Java uses exception handling to propagate the error up the call stack. This allows the responsibility for error recovery to be handled by a method that possesses the necessary context and parameters to react correctly to the failure.

  6. Implement a Question and Options component structure

    Create a Question component that receives a question object. To maintain a clean architecture, delegate the rendering of the multiple-choice options to a separate Options component. The Options component iterates over the question.options array to render a button for each available choice.
    // Options.js
    function Options({ question }) {
      return (
        <div className="options">
          {question.options.map((option) => (
            <button className="btn btn-option" key={option}>
              {option}
            </button>
          ))}
        </div>
      );
    }
    export default Options;
    
    // Question.js
    import Options from "./Options";
    
    function Question({ question }) {
      return (
        <div>
          <h4>{question.question}</h4>
          <Options question={question} />
        </div>
      );
    }
    export default Question;
  7. Understand Java thread visibility and memory anomalies

    In Java, local variables defined within the run() method are private to each thread. However, when multiple threads access and modify a global or instance variable, they do so in parallel, which can lead to visibility issues and race conditions. A common anomaly is when a thread fails to see a change made to a variable by another thread (e.g., a flag used to stop a loop), causing the program to run indefinitely even after the variable has been updated.
    // Example of a visibility issue where 'alive' might not be seen as false by the worker thread
    public class CrazyThreads1 implements Runnable {
        boolean alive;
        long i;
    
        @Override
        public void run() {
            alive = true;
            while (true) {
                if (alive) { i++; } else { break; }
            }
        }
    
        public static void main(String[] args) {
            CrazyThreads1 c = new CrazyThreads1();
            new Thread(c).start();
            // ... later in main thread ...
            c.alive = false; // The worker thread may never see this update
        }
    }
  8. Understand Single Page Application (SPA) architecture in React

    A Single Page Application (SPA) is executed entirely on the client side (browser). Unlike multi-page applications that load a complete new page upon URL change, an SPA uses JavaScript (React) to update the DOM and render the component corresponding to the new URL without a full page reload. This creates a user experience similar to a native app. While the page does not reload, the application can still fetch additional data from a web API when rendering specific components.
  9. Configure core Git settings for line endings and editors

    The [core] section manages fundamental Git behavior:

    • autocrlf: Controls line ending conversions. Windows users should set this to true (converts to CRLF). macOS/Linux users should set this to input (omits conversions).
    • editor: Specifies the text editor used for commit and tag messages.
    [core]
    autocrlf = true
    editor = vim