-
Ubuntu - Install Tableplus
摘要:Install Tableplus (https://tableplus.com/blog/2019/10/tableplus-linux-installation.html): Ubuntu 24.04 X86_64 # Add TablePlus gpg key wget -qO - https
阅读全文
-
HTML - Error building template: open ./template/favicon.ico.page.gohtml: no such file or directory
摘要:Add below line in the head part: <link rel="shortcut icon" href="#">
阅读全文
-
Python - Anti-Patterns
摘要:These are common programming practices that, while not necessarily wrong, often lead to less efficient, less readable, and less maintainable code. By
阅读全文
-
Python - Patterns for Testing
摘要:• The Mock Object pattern The Mock Object pattern provides three features: 1.Isolation: Mocks isolate the unit of code being tested, ensuring that tes
阅读全文
-
VSCode - Disable document popup
摘要:Settings --> Editor --> Parameter Hints:
阅读全文
-
Python - Distributed Systems Patterns
摘要:Technical requirements • Install Flask and Flask-Limiter, using python -m pip install flask flask-limiter• Install PyBreaker, using python -m pip inst
阅读全文
-
Python - Performance Patterns
摘要:Performance patterns address common bottlenecks and optimization challenges, providing developers with proven methodologies to improve execution time,
阅读全文
-
Python - Concurrency and Asynchronous Patterns
摘要:Concurrency allows your program to manage multiple operations simultaneously, leveraging the full power of modern processors. It’s akin to a chef prep
阅读全文
-
Python - Architectural Design Patterns
摘要:Architectural design patterns provide a template for solving common architectural problems, facilitating the development of scalable, maintainable, an
阅读全文
-
Python - Behavioral Design Patterns 1
摘要:Behavioral patterns deal with object interconnection and algorithms. • The Chain of Responsibility pattern The Chain of Responsibility pattern offers
阅读全文
-
Python - Behavioral Design Patterns 2
摘要:Behavioral patterns deal with object interconnection and algorithms. • The Strategy pattern Several solutions often exist for the same problem. Consid
阅读全文
-
Python - descriptor
摘要:Primer In this primer, we start with the most basic possible example and then we’ll add new capabilities one by one. Simple example: A descriptor that
阅读全文
-
Python - timeit.Timer
摘要:# Note that this function is already available in the math module as fsum(). def number_sum(n): if n == 0: return 0 else: return n + number_sum(n - 1)
阅读全文
-
Python - Structural Design Patterns
摘要:A structural design pattern proposes a way of composing objects to provide new functionality. • The adapter pattern The adapter pattern is a structura
阅读全文
-
Python - Creational Design Patterns
摘要:Creational design patterns deal with different aspects of object creation. Their goal is to provide better alternatives for situations where direct ob
阅读全文
-
Python - SOLID Principles
摘要:• Single responsibility principle (SRP) • Open-closed principle (OCP) It emphasizes that software entities, such as classes and modules, should be ope
阅读全文
-
Python - Protocols
摘要:Introduced in Python 3.8 via the typing module, Protocols offer a more flexible approach than ABCs, known as structural duck typing, where an object i
阅读全文
-
Python - Foundational Design Principles
摘要:Encapsulate What Varies One of the most common challenges in software development is dealing with change. Requirements evolve, technologies advance, a
阅读全文
-
Markov Chain
摘要:A natural way to deal with uncertainty is to introduce probabilistic rules. In the simplest case, we can imagine an FSM-like device having no commands
阅读全文
-
Finite State Machine (FSM)
摘要:Finite state machines (FSMs) serve as a great example of an important theoretical construction that also turns out to be a useful tool for everyday pr
阅读全文
-
Langton's Ant
摘要:A virtual ant lives on an infinite board, divided into square cells. Each cell can be either black or white. For starters, we can consider an empty (a
阅读全文
-
Python - sum()
摘要:>>> bugs = ["bug1", "bug2"] >>> sum(bugs, []) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate l
阅读全文
-
Lindenmayer systems (or L-systems)
摘要:Among the most conspicuous properties of a plant shape are symmetry and self-similarity. In a nutshell, L-systems are based on three foundational idea
阅读全文
-
Monty Hall problem
摘要:The problem can be formulated as follows. As a participant of a game show, you have to choose one of three doors. Behind one of the doors is a prize,
阅读全文
-
Hooke's Law
-
Newton's Cannonball
-
Newton's law of universal gravitation
-
Central Collision
摘要:import turtle import math from random import uniform from dataclasses import dataclass WIDTH = 1200 HEIGHT = 800 MIN_V = 5 MAX_V = 15 MIN_SIZE_FACTOR
阅读全文
-
Momentum, mass, velocity, KE
摘要:So p=mv normally but why does ∆p = 2mv when a molecule or something hits a wall and comes back? v is velocity and when using velocity direction matter
阅读全文
-
Python - time.perf_counter
摘要:import time SLEEP = 50 def tick(): start = time.perf_counter() # hi-resolution timer (in seconds) # do something ... elapsed = int(1000 * (time.perf_c
阅读全文
-
Python - The turtle module
摘要:A typical event-driven program is not doing anything most of the time, and its functionality is only triggered by external signals, such as user input
阅读全文
|