Saturday, October 17, 2026

AI as a cheat code for the universe... A bummer indeed!

A few years ago, I wrote a small program to convert binary files into a text string of bytes (codify.c). I was fed up with trying to send binary files through Gmail, only to have Google's servers block them.

As it happens, I still had one of those text files lying around: a string of numbers containing the original binary of Microsoft's 1995 MS-DOS editor, edit.exe.

(edit.dec) 77.90.-2.0.-119.0.0.0.-51.1.-6.4.-1.-1.88.15.-128.0.0..... etc

With the help of generative LLMs, AI agents and their recent leaps in reverse-engineering capabilities (99.2% accuracy!), I encouraged my brother to use his ChatGPT Codex subscription and its coding agent to try to reconstruct the source code of Microsoft's classic editor in C, this time for Linux.

The very first interaction produced a version that was remarkably faithful to the original. It needed a bit of steering to iron out a few details, but after a handful of feedback comments and corrections, we had a perfectly functional program in barely ten minutes. A genuine replica of the original.

It felt like magic. 

I'd actually tried to develop a similar editor myself (c-edit), so I know how much work it takes. Years. And I also know how buggy the end result can be when you're an amateur programmer, as I am.

But this is something else. This is magic. No, actually, it's more like activating a cheat code in a video game: AI feels like a cheat code for the universe itself.

But how boring is it to play a video game with all the cheat codes enabled! It's just not the same anymore. Some of the challenge, the effort, the meaning of it all, simply disappears.

The only silver lining in all this is the thought that this same capability, this kind of magic or universal cheat code, might lead to extraordinary breakthroughs in other fields, such as medicine and biology. Perhaps, that's where having all the cheats enabled may actually be worth it.

MS-EDIT: A decompilation and reimagining of Microsoft Edit 1995 for GNU/LInux (AI experiment)

Tuesday, August 4, 2026

TIL - Horner's method: An algorithm for reading a number written in any positional numeral system.

There is a universal algorithm for evaluating numbers written in any positional numeral system. Once you know the base and can convert each symbol into its corresponding digit, the algorithm is simply:

result = result * base + digit;

Suppose you are reading a number in base 10 say 1234:

Let's decompose in exponentials from left to right:

1234 = 1*10³ + 2*10² + 3*10¹ + 4*10⁰

Now we factor 10:

10(1*10² +2*10¹+3)+4

And again:

10(10(1*10+2)+3)+4

Finally:

10(10(10(1) +2)+3+4

Alternatively:

((1×10+2)×10+3)×10+4

This works for any positional numeral system. Changing 2 to 10 parses decimal numbers, changing it to 16 parses hexadecimal numbers (after converting A–F to 10–15) and so on.

Thursday, July 23, 2026

Newton's Binomial Theorem


I stumbled upon this formula in a book the other day and set about coding it in C from scratch. At the end of the day any summation can be easily turned into a for loop.

I also wrote my own functions for exponential, combinatorial numbers and factorial.