Bela Lugosi's Dead, Jim Below are the 20 most recent journal entries recorded in the "Richard Kettlewell" journal:

[<< Previous 20 entries]

July 12th, 2009
06:55 pm

[Link]

VCS 0.6

I have released VCS 0.6.

What's VCS?

Do you find yourself typing bzr commit in Git branches, or cvs diff in your Perforce workspace? Then perhaps VCS is for you.

VCS is a wrapper for version control systems. It presents an essentially uniform interface to the user, allowing ‘muscle memory’ to use vcs commands rather than adapt to the version control system currently in use. Of course, the downside is that you have yet another three-letter command to start using!

The supported systems are Bazaar, Git, CVS, Subversion, Mercurial, Darcs and Perforce. More could be added. The supported commands are add, annotate (blame), clone, commit, diff, edit, log, remove, revert, status, update. Again, more could be added.

Where Do I Get It?

http://www.greenend.org.uk/rjk/2009/vcs.html for source code, .deb files and Bazaar branches.

What's New In VCS 0.6?

Various things )

Tags: , ,

(3 comments | Leave a comment)

July 9th, 2009
07:23 pm

[Link]

Things that annoy me about Perforce

Missing Features

Things that just aren't there, that shouldn't (in principle) be hard to add.

  • p4 resolve won't show the difference between theirs and merged. A motivating example is where you merge from a release branch (theirs) that has changed more, and more recently, than the merge target (yours). In this case I'm more familiar with the branch changes and so would like to see what else I'm getting (i.e. from the branch I'm merging into) in the eventual submit. (Perforce have an enhancement request open for this one.)
  • There is no command to report the current status of your working tree (like cvs -n up, bzr status etc). When writing VCS I had to write my own. p4 opened is part way there in that it will tell you what have open, but the output format is rather verbose; it lacks the equivalent of .cvsignore; and it doesn't tell you if any files need resolving.
  • p4 diff (etc.) won't do the equivalent of diff -N (even if you set P4DIFF!). This makes the patches they generate incomplete if there are any added, branched or removed files, which is inconvenient for review and means that they're not suitable for use with the patch program.

Interface Inconveniences

Nuisances in the user interface. Again, I don't think these would be especially difficult to change.

  • Perforce forms (e.g. for p4 submit) treat visually identical whitespace as distinct. So if you've configured your editor not to insert raw tab characters (because your coding standard says you shouldn't use them, for instance, which is quite sensible given the trouble they cause) then your change description will appear to be correctly formatted when you submit it but be wrongly indented when you look at it in p4 changes or whatever.
  • p4 submit can only take one filename pattern. i.e. “p4 submit one.c” is OK but “p4 submit one.c two.c” is not; you have to manually add files to a change in separate steps before submitting it, or construct a change listing all the desired files manually.
  • If a change cannot be submitted you have to modify it and resubmit it; you can't delete it and start again, which otherwise might well be more convenient. The restriction seems to be an entirely bureaucratic one, too: you can remove all the files from it and then delete it. (For non-p4 users, the “change” here means the description and metadata, which in p4 have an independent life of their own; not your edits.)
  • Output tends to hide important information among unimportant. For example if a p4 sync updates 100 files and only one of them requires resolving, you're likely to miss it. Summarizing the files that need resolving at the end of the list of updates files would improve matters.

Model Problems

Flaws that result from some aspect of the system's design. These might well be difficult to change. (Which doesn't make them invalid; if the underlying design of a system doesn't support useful features, then perhaps that design is itself wrong.)

  • There's no whole-module graphical branch history view (like gitk or bzr visualise). p4v will show you a per-file branch diagram but nothing better than that.
  • p4 describe and p4 diff2 don't honor P4DIFF (because they do the diffing on the server), so if you have a better diff tool than p4's built-in one (which I do) then you don't get the benefit of it.
  • Execute bits are not properly versioned. You can't just edit a file and chmod it, you have to use a special command to change the execute bit. That's just inconvenient, but worse is that integration (merging) doesn't copy the change, so you have to change it on every branch separately.
  • If the server is running slow or is down, all operations that are in any way related to version control are affected. Since there is no client-side state or caching other than file contents, this includes non-mutating operations (diff, history, etc; even testing whether a file is in version control).

(Yes, some of these problems exist to some extent in some other version control systems too. That doesn't mean they're not annoying...)

Things that aren't annoying

  • The need to p4 edit isn't a big problem in practice (even though it sounds like a nuisance if you're not used to it), given adequate editor integration.
  • It doesn't crash. As a rule the problems seem to be design flaws (such as those above) rather than implementation bugs.
  • It's usually fast.

Tags: ,

(5 comments | Leave a comment)

June 22nd, 2009
08:52 pm

[Link]

The Green Man
Poll #1419599
Open to: All, detailed results viewable to: All

I have...

View Answers

green fingers
5 (25.0%)

green eyes
6 (30.0%)

green hair
2 (10.0%)

green toes
2 (10.0%)

a green beret
1 (5.0%)

a green light
9 (45.0%)

green skin
1 (5.0%)

Dan Dare foiled my invasion plot, you insensitive puny human
11 (55.0%)

If I was a plant I would be...

If [info]ewx was a plant, he would be...

Tags: ,

(5 comments | Leave a comment)

01:34 pm

[Link]

Weird Bash time behavior
richard@araminta:~$ cat busy.c
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char **argv) {
  struct timeval now, end;
  sleep(atoi(argv[1]));
  gettimeofday(&now, NULL);
  end = now;
  end.tv_sec += atoi(argv[2]);
  while(now.tv_sec < end.tv_sec || now.tv_usec < end.tv_usec)
    gettimeofday(&now, NULL);
  return 0;
}

This programs sleeps for a number of seconds and then busy-waits for a number of seconds.

richard@araminta:~$ time ./busy 0 1 | time ./busy 1 2 | time ./busy 4 3
0.63user 1.36system 0:03.00elapsed 66%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+133minor)pagefaults 0swaps
1.00user 1.99system 0:07.00elapsed 42%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+133minor)pagefaults 0swaps

real    0m7.016s
user    0m1.932s
sys     0m4.088s

Superficially it would seem that:

  • busy 0 1 slept 1s and busy-waited 2s
  • busy 1 2 slept 4s and busy-waited 3s
  • busy 4 3 slept 2s and busy-waited 6s

Of course this isn't the case at all, and the different output formats are a hint as to what's really going on. Bash interpreted the first time as applying to the whole pipeline (which does indeed survive for 7s and consume 6s of CPU) while the second and third only apply to the individual commands. The whole-pipeline output of course has to appear last since the computer can't predict the future.

In other words, the actual grammar honored by the shell differs sharply from the natural reading of the command. Bash's interpretation is both documented (in man bash) and allowed by a weird exception in the specification, but if you were naively expecting time to behave like every single other command, you'll be quite surprised (if you notice at all). If you don't notice then you'll misled into thinking that the wrong element of your pipeline needs optimizing.

Allowing time at the start of (some or all) compound commands would have been less surprising and more useful, and still allowed timing whole pipelines (when bracketed).

Tags:

(Leave a comment)

June 18th, 2009
02:22 pm

[Link]

More Python character encoding braindamage
rjk@rackheath:~$ python -c 'print "møøse"'
møøse
rjk@rackheath:~$ python -c 'print u"møøse"'
møøse
rjk@rackheath:~$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
rjk@rackheath:~$ python -V
Python 2.5.2

(...but it's the same in 2.6.x.)

I think it's interpreting each byte in the (actually UTF-81) input string as a Unicode code point in its own right, though another (philosophically different but pragmatically essentially identical) possibility is that it thinks all input strings are encoded using ISO-8859-1.

1 and don't give me the nonsense someone came up with last time about Python having no way to know how the input is encoded. It does have a way, that's what LC_CTYPE is for.

Tags: , ,

(5 comments | Leave a comment)

June 13th, 2009
02:43 pm

[Link]

Rubik's Cube Menger Sponge and Crossword For Multidimensional Aliens

Tags:

(1 comment | Leave a comment)

June 9th, 2009
07:15 pm

[Link]

Stupid Apple
chymax$ ls -lL /usr/X11/lib/libXdamage.*
-rwxr-xr-x 1 root wheel 88496 2009-03-13 00:38 /usr/X11/lib/libXdamage.1.1.0.dylib
-rwxr-xr-x 1 root wheel 88496 2009-03-13 00:38 /usr/X11/lib/libXdamage.1.dylib
-rwxr-xr-x 1 root wheel 88496 2009-03-13 00:38 /usr/X11/lib/libXdamage.dylib
-rwxr-xr-x 1 root wheel   936 2007-09-24 05:39 /usr/X11/lib/libXdamage.la
chymax$ grep ^library_names /usr/X11/lib/libXdamage.la
library_names='libXdamage.1.dylib libXdamage.dylib libXdamage.1.0.0.dylib'

Tags: , ,

(Leave a comment)

May 30th, 2009
11:07 pm

[Link]

Complete the song trilogy
  1. New Order/True Faith
  2. Nik Kershaw/I Won't Let The Sun Go Down On Me
  3. ???

Tags: ,

(4 comments | Leave a comment)

May 23rd, 2009
09:06 pm

[Link]

Safari 4

I downloaded the Safari 4 beta.

The obvious visual change is that tabs now replace the title bar. AFAIK this feature first appeared in Google Chrome. It seems a sensible use of vertical space.

I have a complaint about Apple's implementation of the idea though: when you have more than a few tabs (depending on the width of the window), the first thing to disappear is the close button towards the left. Fair enough, but when you hover over the tab (for instance to select it) the close button reappears. Since until you're there there's no visual indication you need to avoid that part of the title, the result is lots of accidentally closed tabs. Worse, there appears to be no undo close tab option.

In fact the closed tab will be the first thing you see in the history page, so it's not that hard to retrieve it. But you lose any state that you had in that page (unlike Firefox's undo close tab option, which does preserve at least some of the state).

The top sites page makes is effectively an adaptive bookmarks page, showing thumbs of the dozen sites Safari thinks you visit most often. It's initially populated with the NYT, Amazon, Apple, Wikipedia, CNET and various others. Wikipedia presumably got there for free but I did wonder if the others had to pay and if so how much. As you can see from the linked screenshot it's already accumulated a few of the pages I've visited recently.

The history page uses Coverflow (something that's turning up increasingly often in Apple software). Seems quite convenient and allowing visual recognition of pages is nice.

As in earlier Safaris, text entry boxes (such as Livejournal's update form) are resizable, a nice touch that I wish Firefox would pick up.

The advertised "full page zoom" buttons don't exist, though there are menu and keyboard versions. Zooming in randomly jumps around the page, making it very inconvenient to actually use the feature.

Hovering over a link still doesn't reveal what the destination is, unlike Firefox. It seems like a little thing but actually once you're used to it, not knowing for sure where you're going next makes browsing feel surprisingly uncomfortable.

It actually uses more memory than Firefox (RSIZE is the amount of real RAM used, VSIZE counts swap as well and is generally less interesting). It does seem to use less CPU when idle (where "idle" for a web browser means "running various bits of Javascript"), which would lend a bit of plausibility to Apple's performance claims if it weren't for the fact that visiting a page on Apple's own website took around 30s to load (and then proceeded to lag way behind user input, and SPOD some of the time, when scrolling) where Firefox managed to produce it just like that.

(I think it must be something about that page, since other pages don't produce the same problem. But you'd think they'd test it against its own website!)

Tags: ,

(8 comments | Leave a comment)

04:08 pm

[Link]

Fair-weather friends?

(i.e. lots of accounts friended me and then evaporated).

(5 comments | Leave a comment)

03:56 pm

[Link]

Emacs for Macs

Mac support for Emacs (or possibly the other way round) has been a bit of an issue for a while.

The shipped /usr/bin/emacs only runs in a terminal, lacking any kind of GUI support, which is OK for quick edits but rather inferior for extended work.

Compile your own Emacs with X11 support (or use someone else's, e.g. Fink) and that works, but then you're at the mercy of Apple's deranged X11, which gets on badly with Spaces and has very poor cut and paste integration with native applications.

For a while there's been Aquamacs, which bills itself as a Mac-friendly version of Emacs, but I never really got on all that well with it.

A particular problem is that if you type anything while a selection exists, the selection is replaced with what you type. This is Macish enough but if you created the selection using the keyboard rather than the mouse then you can't make the selection go away with the keyboard - you have to use the mouse. The result ends up being a lot of undoing, even after months of use.

It also doesn't tell you what size your window is when resizing and creates new windows (frames, in Emacs's own terminology) with a size matching the last one. So getting a window of a particular size can be rather fiddly.)

Recently [info]fanf mentioned the NextSTEP port of Emacs (or OpenSTEP, if you prefer) which has now been merged into the trunk of Emacs. NextSTEP's direct descendant is of course OS X, so this is a Mac-native Emacs.

The source can be retrieved via CVS. It built an Emacs.app without any trouble. It act much more like my muscle-memory expects Emacs should (no more destructive and un-dismissable selections), but also has concessions to the local OS - for instance it supports native cut and paste using ⌘C, ⌘X, ⌘V etc. Window size behavior is more sane and usable too.

Complaints so far:

  • Trying to save a buffer that doesn't already have a filename offers by default to save it somewhere in the guts of Emacs.app, which isn't very useful.
  • Mac-native means of entering “special” characters don't seem to be available. C-X 8 RET works fine, with tab completion over Unicode character names, but making ⌥⌘T behave as normal would be nice.

These are pretty minor; overall it's a clear improvement over what came before. Perhaps Apple can be persuaded to included it in future releases (with a link from /usr/bin/emacs into the depths of the application bundle)?

Tags: , ,

(9 comments | Leave a comment)

01:37 pm

[Link]

Stupid Microsoft
Further to the instructions here, I'd add that you will need to randomly re-install the new layout from time to time, as Windows randomly breaks or removes it without even telling you.

Tags: , , ,

(Leave a comment)

May 19th, 2009
11:10 pm

[Link]

Meow

Fitzroy St, lunchtime.

Tags: ,

(Leave a comment)

11:09 pm

[Link]

Malign hypercognition disorder
Poll #1402533
Open to: All, detailed results viewable to: All

You acquire a superpower. What is it?

How did you get it?

View Answers

bitten by radioactive/genetically modified arthropod
1 (7.1%)

scientific experiment gone wrong
2 (14.3%)

alien influence
1 (7.1%)

mutation
3 (21.4%)

slept with wrong deity's wife
2 (14.3%)

black-budget military program
1 (7.1%)

other, will describe in comments
4 (28.6%)

You will be...

View Answers

good
6 (42.9%)

evil
8 (57.1%)

What's your superhero/supervillain name?

[info]ewx gets one too. What is it?

How did he get it?

View Answers

bitten by radioactive/genetically modified waterfowl
14 (100.0%)

[info]ewx will be...

View Answers

good
7 (50.0%)

evil
7 (50.0%)

What's [info]ewx's superhero/supervillain name?

You have to choose one of good and evil; black and white comic-book morality here.

Tags: ,

(8 comments | Leave a comment)

May 11th, 2009
04:09 pm

[Link]

Does my indentation level look big in this?
Poll #1398064
Open to: All, detailed results viewable to: All

Maximum width for source code

View Answers

32 columns
0 (0.0%)

80 columns
37 (72.5%)

96 columns
2 (3.9%)

100 columns
3 (5.9%)

132 columns
12 (23.5%)

256 columns
0 (0.0%)

no limit
9 (17.6%)

It is vital that I be able to fit multiple calls to DoorReleaseRemoteControlEscutcheonPlateBezelFactoryFactory.CreateDoorReleaseRemoteControlEscutcheonPlateBezelFactory per line
5 (9.8%)

(48 comments | Leave a comment)

01:54 pm

[Link]

Don't lose your head
Poll #1398014
Open to: All, detailed results viewable to: All

I would rather be...

View Answers

right but repulsive
24 (80.0%)

wrong but wromantic
6 (20.0%)

Tags: ,

(10 comments | Leave a comment)

May 10th, 2009
06:46 pm

[Link]

Yes, they really were that color

+4 )

Tags:

(1 comment | Leave a comment)

May 7th, 2009
04:48 pm

[Link]

/usr/sbin/sendmail
Poll #1396328
Open to: All, detailed results viewable to: All

Which MTA?

View Answers

Exim
32 (66.7%)

Postfix
13 (27.1%)

qmail
1 (2.1%)

Sendmail
7 (14.6%)

Smail
0 (0.0%)

PP
0 (0.0%)

MMDF
0 (0.0%)

Exchange
1 (2.1%)

Something else
3 (6.2%)

I have renounced email in favour of Twitter
2 (4.2%)

I have renounced email in favour of pen and paper
1 (2.1%)

Huh?
1 (2.1%)

Tags: ,

(27 comments | Leave a comment)

02:08 pm

[Link]

Money can't buy you happiness

You're cycling1 along and you spot a coin or note on the ground. Presumably whether you stop to pick it up depends on its value, so how much does it have to be before it's worth stopping, dismounting, picking up, remounting, and picking your speed back up?

Poll #1396261
Open to: All, detailed results viewable to: All

Which would you pick up?

View Answers

½p coin
19 (36.5%)

1p coin
4 (7.7%)

2p coin
4 (7.7%)

3p coin
16 (30.8%)

5p coin
8 (15.4%)

10p coin
13 (25.0%)

20p coin
14 (26.9%)

50p coin
19 (36.5%)

£1 coin
28 (53.8%)

£2 coin
32 (61.5%)

£5 note
45 (86.5%)

£10 note
45 (86.5%)

£20 note
44 (84.6%)

£50 note
44 (84.6%)

I have entirely repudiated money
4 (7.7%)

My country uses some inferior currency
11 (21.2%)

1 If you don't cycle, assume some other means of transport that's comparably inconvenient to interrupt.

Tags:

(39 comments | Leave a comment)

May 4th, 2009
10:35 pm

[Link]

Welcome to the machine

...yes, I'm attempting to make a dent in my photo backlog. I spent very little time taking pictures for the first part of the year, a bit of a shame having bought a new camera towards the end of 2008, but got going properly in April without simultaneously getting back into the habit of doing anything with the output.

Tags:

(1 comment | Leave a comment)

[<< Previous 20 entries]

I deny everything Powered by LiveJournal.com