Shuffle a Lua Array with Fisher-Yates: In-Place and Copy Variants
Shuffle a Lua array uniformly with the Fisher-Yates algorithm, understand its linear complexity, and choose between an in-place function and a copied result.
Shuffle a Lua array uniformly with the Fisher-Yates algorithm, understand its linear complexity, and choose between an in-place function and a copied result.
Implement object-oriented Lua with tables, functions, metatables, self methods, constructors, inheritance, private state, callable objects, and alternative object models.
Customize Lua arithmetic, comparison, indexing, assignment, calls, and string conversion with metatables, __index, __newindex, and proxy-table patterns.
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.
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.
Learn Lua's generic for protocol, build stateful closure and stateless iterators, and implement predictable ordered traversal when normal table iteration is unordered.
Learn how Lua modules and packages work with require, package.loaded, package.path, package.cpath, searchers, returned module tables, names, and submodules.
Learn Lua code loading and error handling with loadfile, load, pcall, xpcall, error, assert, tracebacks, and protected function calls.
Replace an insecure legacy PPTP setup with a Raspberry Pi WireGuard VPN server, including keys, server and client configuration, forwarding, and firewall rules.
Read Lua data files safely and serialize primitive values, tables, shared references, and cycles while validating input and avoiding unsafe execution of untrusted data.