The local branch of the company I work for has recently included a food allowance of 8 eur/day as a perk. I don't like / have opportunities to eat out most days, so I have built a little utility that fetches via a REST API the offers at the deli / grocery store on the way to my kid's nursery, and solves a knapsack problem to generate the most optimal shopping basket (i.e., closest to but not exceeding 8 euros). I extracted the API from the deli's website, as it seems to be something custom. Of course, I might not care about some of the items that the utility includes in the most optimal basket. To mitigate this, the utility iteratively refines the basket by asking me if there is something I want to remove, and then replaces it with the next most optimal items to fill up the remaining budget.
Ask HN: Most interesting tech you built for just yourself?
231–240 of 1001 posts
Re: Ask HN: Most interesting tech you built for just yourself?
#232I was fascinated by the story of David A. Scott, who was obsessed with "bijective compression". It means compression programs where all files are valid archives, and moreover no two archives decompress to the same file. So no magic number file signatures, no checksums, no redundancy whatsoever. Scott felt that compression algorithms that didn't have this property were wasteful, and of course, in a narrow technical sense he was right. There are of course a number of practical reasons why we tolerate a little redundancy.
But he wouldn't let practicality stop him. He made bijective versions of many common compression algorithms. He made a bijective Huffman encoder (one where you'll never get "unexpected end of file"), a bijective arithmetic encoder, and even a bijective LZ variant. But most impressive of all, he made a bijective BWT version.
The Burrows-Wheeler transform is fascinating on its own, and it's almost bijective. It sorts letters in a text by their context, so that letters with similar context appear close to each other. In a strange vaguely DFT-like way, it switches long-distance and short-distance patterns around. The result is, in a typical text, long runs of the same letter, which can be easily compressed.
But the traditional BWT technically works only up to rotation. You get a rotation of the original string back when reversing it, but you don't know if it's the right rotation. You need to store a tiny piece of extra information, either the index of the rotation, or a single sentinel character known to be the last (or first) letter in the original string. Getting rid of that last piece of information seemed impossible, but Scott figured out a way to do it!
The result is that we have a truly bijective version of the BWT transform. Now I'm no mathematician, but surely that is beautiful? It's a true permutation now, that still does the weird low-order higher-order swapping thing, that you could surely analyse with many algebraic approaches that wouldn't work for the original.
Anyway, what I did was implement this transformation on the lines or pixels of an image. So you get an effect similar to the "pixel sort" effect that glitch artists were into for a while, but it's reversible. I guess it's not really useful for anything other than making glitch art, but it's at least a program that does something pretty unique, and which only a very specific kind of weirdo would have the skills and inclination to write (namely me).
Re: Ask HN: Most interesting tech you built for just yourself?
#233Re: Ask HN: Most interesting tech you built for just yourself?
#234I've modified Ghidra in order to unlink pieces of an executable back into relocatable object files. To keep things simple, source code files are compiled into object files which are linked into an executable. Object files have sections (named array of bytes), symbols (either defined as an offset within a section or undefined) and relocations (a request to patch up an offset within a section with the final address of…
Re: Ask HN: Most interesting tech you built for just yourself?
#235https://github.com/ecliptik/ecliptik.github.io/blob/main/_sc...
Re: Ask HN: Most interesting tech you built for just yourself?
#236I originally built it for a now-ex-girlfriend, but I use it all the time myself to add a little spice to things like tweets or error messages.
Re: Ask HN: Most interesting tech you built for just yourself?
#237A little rough on the edges so probably not ready for a ShowHN yet.
Re: Ask HN: Most interesting tech you built for just yourself?
#238The currently supported setup of Frigate alerts using homeassistant seemed to be very profoundly complex and I just thought I could use the Frigate API and wrote a small tool with Nodejs. It has been working flawlessly, including sending photos of events to my Android phone.
Re: Ask HN: Most interesting tech you built for just yourself?
#239I built myself an automated hydroponic grow tent. It measures and corrects pH, electrical conductivity, oxidation reduction potential, temperature of the air and water, water level, and humidity. It also automates pumps, lights, and fans (I know people normally advise against this). None of it is particularly sophisticated, but I’m really proud of it. I initially used a deep water culture and later moved on to the nu…
If that were NL at this point your whole audience would be on the floor laughing. 'Suuuure...'. What some people won't do to get decent tomatoes.