Posts

LazySort How-To Guide

Image
LazySort is designed to retrieve elements by index from an unsorted dataset as if the dataset were fully sorted, without sorting the entire dataset or consuming excessive memory. It is ideal when sorting the entire dataset is impractical, but specific indexed elements (such as the median or a specific percentile) need to be retrieved. Additionally, it can determine the index of an element in the sorted representation of the dataset. Overview The core algorithm consists of two phases: Analysis & Clustering: Analyzes the raw dataset and partitions it into indexed clusters. In-Memory Sort & Retrieval: Loads and sorts only the single cluster containing the requested element, then returns the target item. If a cluster containing the requested item exceeds the user-defined memory limit, it is dynamically re-partitioned into smaller sub-clusters. Installation Using pip: pip install lazysort Using uv: uv add lazysort Source code ava...

ExoClone

Image
Introducing ExoClone A Godot 4 Tribute to the ZX Spectrum Classic Exolon If you have a soft spot for the golden age of 8-bit gaming, you might remember Exolon – the unforgiving, screen-by-screen tactical shooter released for the ZX Spectrum back in 1987. It was a masterclass in classic sci-fi atmosphere and brutal gameplay mechanics. As a passionate project and an experiment in game development, I wanted to bring that exact feeling into the modern era. Meet ExoClone, a tactical 2D side-view shooter built entirely from scratch using the Godot 4 engine . You can watch the gameplay trailer on YouTube to see it in action. Preserving the 8-Bit Vibe To feel the game in its retro roots, I enforced some hardware constraints on myself during development: Resolution: The game renders at a crisp, authentic 256x192 pixels. Color Palette: Every visual element adheres to the original Sinclair ZX Spectrum color palette. I handled all th...

HowTo: Hot migration of OS Linux (Debian 12) from one encrypted disk to another

Image
This is a step-by-step HowTo article on performing a hot migration of a Linux operating system to another encrypted disk. It provides almost no explanations, focusing solely on the commands required to complete the task. Use it at your own risk. You could lose your data during the process, so ensure you have a backup of all critical data before proceeding. Part of the output has been removed to make this article shorter. Environment checking $ sudo apt list --installed lvm2 cryptsetup fdisk efibootmgr Listing... Done cryptsetup /stable,now 2:2.6.1-4~deb12u2 amd64 [installed] efibootmgr /stable,now 17-2 amd64 [installed,automatic] fdisk /stable,now 2.38.1-5+deb12u3 amd64 [installed] lvm2 /stable,now 2.03.16-2 amd64 [installed] $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS nvme0n1 259:0 0 931.5G 0 disk nvme1n1 259:4 0 238.5G 0 disk ├─nvme1n1p1 259:5 0 512M 0 part /boot/e...

Dataset Analysis and Sorting Speedup

Image
In this article, I discuss the analysis and sorting of data while saving computational resources. Problem It is extremely rare to need to find the median or another percentile of a large set of unordered numbers, especially when you do not know the minimum, maximum, or the distribution of values in the set. However, when such a situation arises, it can cause a lot of headaches since obtaining an element by index requires sorting the entire set. The situation worsens when there is a lot of data and not enough free memory. The time spent on sorting can also play a significant role. Simple Solution What can be done to retrieve any element from a sorted set without sorting the entire set? You can analyze the data to determine approximately where the element with the desired index is located, thus simplifying the task of finding the needed element. Typically, such an analysis involves dividing the overall range of numbers into an appropriate number of ranges, reading the...

How to create a Simple Captcha Resolver

Image
"All aircraft designers once learned to make paper airplanes." Someone Smart This article shows my journey of developing a simple captcha resolver. By repeating the steps described, you will be able to get acquainted with the technologies and create your own recognizer for experimentation and study. Some specific development points have been omitted to simplify the material in the article. It should be noted that I am not an ML specialist and very superficially familiar with machine learning technologies. I developed this captcha recognizer out of curiosity, driven by an interest in understanding how the learning process works. So I would be very grateful for advice and comments from those who understand this. There are numerous parameters mentioned in the article that I don’t explain in detail. The goal of this approach is to make the article shorter and simpler while encouraging readers to experiment with the parameters themselves. I have used the simplest algorithms po...