Author Archives: gghh

Exploding intersections with the Inclusion-Exclusion Principle

How many elements in the union of two sets? The sum of those in each set respectively, you say? Of course not, there might be some element in common that you counted twice. How if the sets involved are three? … Continue reading

Posted in Uncategorized | Leave a comment

The annoying merge conflicts in case of criss cross

Here I show an example of problematic merge that sometimes I have with Mercurial. What happens is that for a given file foo.txt two commits, one parent of the other, get in competition at merge time. Obviously the child edit … Continue reading

Posted in Uncategorized | Leave a comment

How does Mercurial select the Greatest Common Ancestor

The GCA of two nodes X and Y in a DAG (Directed Acyclic Graph) is an ancestor of both X and Y such that no descendant of it is also a common ancestor of X and Y. This definition is … Continue reading

Posted in Uncategorized | Leave a comment

Caching in python with a descriptor and a decorator

The Mercurial SCM has several strategies to cache expensive computations; you can find an overview of all of them at this page. This post is about the propertycache decorator: a mechanism to replace a function with its result the very … Continue reading

Posted in Uncategorized | 1 Comment

Mercurial histedit behind the scenes

What’s the magic behind the history rewriting extension in Mercurial? It’s called histedit, it’s written by Augie Fackler, and it’s a fundamental tool in my daily coding activity. I fired up pdb and watched closely to what it does. Lean … Continue reading

Posted in Uncategorized | Leave a comment

Is TCP turing complete?

Is the TCP protocol capable of… computing things? In other words: if you consider the topology of your network (nodes and connections between them) and the data that each node plans to send across the network as “the input” of … Continue reading

Posted in Uncategorized | 1 Comment

A feature of (q)bzr I really love

Bazaar lets you compare branches. Not just branches from the same repository, i.e. all stored in the same .bzr/ folder, but arbitrary branches that may (or may not) have some common history. All those years of typing code for fun … Continue reading

Posted in Uncategorized | Leave a comment

All your rebase are belong to us

When I hit “commit” on my version control system, I behave very much like when I click “save” on my text editor. I just do it whenever I feel like. I can’t see in advance how the thing is gonna … Continue reading

Posted in Uncategorized | Leave a comment

chord diagram layout in d3.js: implementation

In a previous post I wrote how much I like the d3 chord diagram? per se, and how little I like to configure it via the matrix API function?. I argued that a different interface can be more useful; in … Continue reading

Posted in Uncategorized | 8 Comments

A new API to configure chord diagrams in d3.js

I really like the chord diagram from the d3 javascript library?, but the function used to build those diagrams could be better. Here I discuss a possible alternative. Have you ever heard of circos? It’s a visualization tool written in … Continue reading

Posted in Uncategorized | Leave a comment