Customize Lua arithmetic, comparison, indexing, assignment, calls, and string conversion with metatables, __index, __newindex, and proxy-table patterns.
Software notes and practical experiments
This is the English entry point to Nanfeng's development blog. The archive currently contains Chinese-language technical notes; English translations will be published progressively.
Lua import vs require: Standard Module Loading and Framework Helpers
Understand why require is Lua's standard cached module loader while import is usually a framework helper with project-specific path, return-value, or reload behavior.
Python Pillow Pencil Sketch: Grayscale, Invert, Blur and Color Dodge
Convert a color photo into a pencil sketch with Python Pillow by applying grayscale, inversion, Gaussian blur, and color-dodge blending, then save the result.
Lua Iterators and Generic for: Closures, Stateless Iteration and Order
Learn Lua's generic for protocol, build stateful closure and stateless iterators, and implement predictable ordered traversal when normal table iteration is unordered.
Lua Modules and Packages: require, Paths, Searchers and Submodules
Learn how Lua modules and packages work with require, package.loaded, package.path, package.cpath, searchers, returned module tables, names, and submodules.
Lua Error Handling with loadfile, pcall, xpcall, error and assert
Learn Lua code loading and error handling with loadfile, load, pcall, xpcall, error, assert, tracebacks, and protected function calls.
Raspberry Pi WireGuard VPN Server: Keys, Forwarding, Firewall and Clients
Replace an insecure legacy PPTP setup with a Raspberry Pi WireGuard VPN server, including keys, server and client configuration, forwarding, and firewall rules.
Lua Data Files and Serialization: Tables, Cycles and Safe Loading
Read Lua data files safely and serialize primitive values, tables, shared references, and cycles while validating input and avoiding unsafe execution of untrusted data.
Lua Data Structures: Arrays, Matrices, Lists, Queues, Sets and Graphs
Build arrays, records, matrices, sparse matrices, linked lists, queues, deques, sets, string buffers, and graphs with Lua tables and suitable access patterns.
Lua Bits and Bytes: Bitwise Operators, string.pack and unpack
Work with binary data in Lua using bitwise operators, arbitrary byte strings, string.pack and string.unpack formats, integer widths, endianness, and binary files.