Friday, January 29. 2010DVCSs and Changeset NumberingOne of my big beefs with DVCSs is their version numbers. For example, take two changesets I committed today: 6899 and 02a9. Which one is more recent? How many changesets separate them? Without access to a repository, there's no way to tell… But that sort of information can be useful to have. Two of the three DVCSs I have experience with,
And, of course,
I'd like to see this taken a step further, though: I'd like the changeset hashes themselves to encode some basic information about where they live in the repository. For example, one way to do this could be using the first two bytes of the hash to store the distance from the root*, and the next two bytes to store a "repository id", which is generated once, when a repository is first cloned or initialized. So, for example, one of these changeset hashes might look like this: 0afc53bf02f1, and committing again to the same repository would produce 0bfc109dca65. Of course, this scheme doesn't guarantee anything - it's entirely possible to generate two completely different changesets with the exact same four-byte prefix… But in the general case, this sort of scheme could make it significantly easier to figure out how arbitrary changesets relate to one another. *: Doug Philips suggested this - thanks. Friday, January 22. 2010Self documenting code is a lieBe very, very wary of anyone who suggests that "self documenting" code can replace comments. Case in point: I consider myself a mediocre programmer, who is usually capable of producing mostly coherent code. Below is a hunk of the code I wrote today - keywords are blue, variables are white, comments are green:
I don't think I could take much away from that without doing a serious disservice to the poor person (probably me) who will be tasked with fixing the inevitable bugs in the above code. Sunday, January 17. 2010Django settings.py mini-tip: the `path` lambdaThere are a few things I do every time I start a new Django site, and one of those things is add my
From then on, it's drop-dead simple to create absolute paths which are relative to the root of the project (or, at least, the directory which contains settings.py). For example:
And some other places where it is useful:
Tuesday, January 12. 2010dm-crypt and confusing error messages(this is a post intended for Google - sorry for bothering you, faithful RSS readers) I've been setting up encrypted backups for my Linux machine, found that $ cryptsetup luksFormat /dev/sda3 ~/.backupKey WARNING! ======== This will overwrite data on /dev/sda3 irrevocably. Are you sure? (Type uppercase yes): YES Failed to setup dm-crypt key mapping. Check kernel for support for the aes-cbc-essiv:sha256 cipher spec and verify that /dev/sda3 contains at least 133 sectors. Failed to write to key storage. Command failed. $ Google will suggest lots of things… But none of them solved my problem. What was I doing wrong? I needed to run D'oh. Sunday, January 10. 2010Makefile for Arduino 0017I picked up an Arduino yesterday, and I was quite dismayed by how much work it took to build/flash from the command line. After some hours of Googling, though, I finally found an up-to-date Makefile, and it didn't take too much to make it "just work" with the default install of Arduino.app on the Mac. To use this Makefile, simply drop it into the project sketch directory, then run Get the Makefile from: http://gist.github.com/273821. Just a note: I haven't had much time to tinker with this system yet, so it may have some serious issues... If so, drop me a comment below. Also, leave a comment if you want me to let you know if (when?) I update this.
(Page 1 of 1, totaling 5 entries)
|
QuicksearchArchivesLinks
CategoriesSyndicate This Blog |
