Rico's Nerd Cluster

「离开世界之前 一切都是过程」

Python - Messaging Tools

zeromq

ZeroMQ Blocking vs Poll Block could get stuck here : - Worker thread, as in our example: Ctrl+C goes to the main thread. It does not automatically interrupt the worker’s recv_multipart(), so tha...

Python - Numpy File Management

Load, Save, npy, npz

numpy.save() saves npy file to cache When this runs: 1 np.save(npy_path, points) Linux usually does not immediately send every byte to the physical SSD. It first places the file’s data in RAM, ...

Python - Type hints

annotation

from __future__ import annotations A rough mental model: Without it: annotations are evaluated immediately at definition time With it: annotations are stored as strings and resolved later ...

Compute Comparison

Arduino Uno vs Rpi Zero vs Rpi 4b+ vs Rpi 5 vs Nvidia Orin Nano Across Multiple Dimensions

Memory Device RAM Cache (L1 / L2) Disk / Storage / Non-Volatile Memory Notes Arduino UNO 2 KB ❌ None No Disk; Program...

Arduino Notes

View

Common Commands millis() is unsigned long 1 unsigned long previous_time = millis() uint8_t lowByte(uint16_t value); 1 2 3 uint16_t value = 0x1234; uint8_t lower = lowByte(value); ...

Python - Numpy View and Contiguous Array

View

What is np.view When slicing or transpose takes place on an array, we actually get a np.view object that shares the underlying memory with the array. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...

Python - Numpy and Pandas Operations

A Mumbo Jumbo Of Numpy and Pandas Operations and Examples

Numpy General Programming Rules In Numpy np allocates memory like C, so it’s contiguous. Math operations can be applied to all elements, which is a lot faster than for loop and use math modu...

Python - Data Structures

Dictionary, tuple

Dictionary setdefault if value does exist, return the existing value; Otherwise, set the key with a new value. 1 2 3 4 5 counts = {} value = counts.setdefault("apples", 0) print(value) # 0...

Python - Python Subprocessing

Subprocess

Subprocess Module Reference The recommended approach to invoking subprocesses is to use the run() function for all use cases it can handle. For more advanced use cases, the underlying Popen inter...

Python - Python Packaging System

Packaging, Pip, wheels

Setuptools Entrypoints Entrypoints are a way to specify components in your package to the rest of the python space, so they can be dynamically discovered. So this enables: Console scripts (co...