Saturday, 8 August 2026

xcopy still works

You can still do a mean recursive copy in cmd.exe using:

xcopy *.* /s

But when copying to a target directory, make sure the directory exists, or it will create a file (as it has done consistently in previous versions).  

MS-DOS is still alive and well.

The Codex Incompleteness Theorem

A few Codex gaps with workarounds.

Codex will create a .git directory - but without initializing. Before you check in code, do a git init.

For Windows, IDE based builds won't work - as settings need to be done in the GUI to persist in config. This makes debugging from the IDE difficult - "if I change settings in IDE for my ease of debugging will it break build process used by Codex?"

OAuth2 - Read the RFC

Given its widespread usage, it is worth reading the OAuth2 specification (RFC6749). OAuth2.1 is in development to integrate the OAuth2 spec with common extensions.

Entire

Entire is a new developer platform which boasts "every agent session/decision/tool stored in your repo". It aims to be the GitHub equivalent for agentic development.  Accessing Entire requires giving it access to your GitHub repos with authentication via GitHub OAuth (which uses OAuth2 - the current industry standard protocol for authorization).

Statistical Similarity

KL divergence is a way to measure "closeness" of two probability distributions. It is used in the literature on model cloning/model distillation.

Another name for it is "relative entropy".

Its full form is Kullback-Leibler divergence. 
It is denoted D[KL]( P || Q ). P is the true probability distribution and Q is the approximating probability distribution.

Mathematically:

D[

Thursday, 6 August 2026

Time Synchronization in Distributed Systems - A Different Take

Distributed systems employ a lot of synchronization - data synchronization (get all nodes consistent on data) as well as time synchronization (so every node has the same view of time).

Time synchronization can be achieved via protocols like NTP and PTP (the latter is precision time protocol - for applications like high frequency trading), but also logical systems like Lamport timestamps which order events without relying on physical time.

Lamport timestamps are a logical clock mechanism to capture chronological and causal relationships in a distributed system. Leslie Lamport introduce this as far back as 1978.

A variation of logical clock known as a vector clock is used in a variety of distributed database systems.

Tuesday, 4 August 2026

Revisiting Refactoring -> Purpose - "Confidence in Code"

Martin Fowler's book "Refactoring - Improving the Design of Existing Code" (with contributions by Kent Beck), first published in 1999, is really interesting and deserves a revisit in the context of AI.

On the cover of the Addison-Wesley Second Edition, he is quoted as saying: 

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand".

Erich Gamma (one of the "Gang of Four" behind Design Patterns) remarks in the preface that refactoring began in "Smalltalk circles" and found its way into other programming language camps. 

He also emphasises its core role in framework development. 

"Frameworkers know that a framework won't be right the first time around—it must evolve
as they gain experience...The key to keeping code readable and modifiable is refactoring—for frameworks, in particular, but also for software in general." - Erich Gamma

Erich expands on the risk of refactoring - the fact it can set you back days or weeks and "refactoring becomes riskier when practiced informally or ad hoc".

Erich emphasises that a system is needed for successful refactoring: "To avoid digging your own grave, refactoring must be done systematically".

He mentions the core of the book is a "comprehensive catalog of refactorings".

He also relates a coding session with Kent Beck involving disciplined "one step at a time" refactoring and how we felt afterwards - 

"Not only did my confidence in the resulting code increase, I also felt less stressed."