NCW

Foreshortened

Close-up views of Nicholas Wilson

About

portrait

I am a software programmer working at RealVNC with many interests including singing, and am a Christian. Many of my friends remember me as a Part III mathematician at Peterhouse. Find out more or contact me!

blog.unmaskparasites.com

My Disqus account is gone. It’s still there, actually, but I can’t log in or use it, although (other people’s) blog comments apparently still work. They removed OpenID logins, which I used, and forgot even to send an email to existing users telling them they’d have to set a password if they wanted access to their account in future.

Google cancels free Google Apps

So that’s it! I’m officially “grandfathered”, as are all the other people I set up with Google Apps. Bit of a shame.

Member Function Pointers and the Fastest Possible C++ Delegates (Don Clugston)

InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonPainter

Jeanne de Valois fit toutes ces remarques en quelques secondes, c'est-à-dire en moins de temps que nous n'en avons mis pour les consigner ici.
Yeah right! You said it…

Da dada da dada da daa Da da da da da das dada daa dada da… The Tube’s alive! I physically shivered at Walküre’s single, lonely, first instance of the Siegfried love motif, ominous and enthralling… Every community is formed around the overloading of a private vocabulary, and from a young age, these sounds were part of mine…

Cute little thought: It’s obvious why there aren’t APIs for finding out, for example, the current credentials of the process on the other end of a UNIX-domain socket (there might be several processes on the end!) Less obviously, there could be no process on the other end: suppose you have a socket at your end, and the remote end is dup'ed into two related processes. You pass in an fd (with an SCM_RIGHTS message), then close it. It’s not open in your process, and it can’t be associated with either receiving process (either one of them could read it first). So, who ever’s on the other end of the passed fd is in the unusal situation of having a valid, connected socket with absolutely no process on the other end! Quirky.

Rules of static linking: libstdc++, libc, libgcc

When can I link?

  1. Statically linking to libstdc++ is fine. Optional, and harmless (unless you’re using a system library written in C++; very rare indeed on unix). And, sometimes is necessary if producing binaries to run on systems with different versions of libstdc++ (or none). Therefore, I always statically link to libstdc++. It’s the only way to target Ubuntu 6 to 12.04 and RHEL 2 to RHEL 6 with a single binary (those are probably the oldest versions it’s worth compiling for).
  2. Statically linking to libc: never ever do this. One exception only: the entire binary is statically linked, and never uses dlopen to load anything at runtime either.
  3. Statically linking to libgcc: Depends on the system. Never ever do this on a GNU-based system (ie a system that ships with libgcc or gcc, or where libc was compiled with gcc, or where libc is glibc, etc). Never ever do this if loading a shared library (runtime or loadtime) that was compiled with gcc by someone else (don’t break the rules unless you know what you’re doing!). Do do this on systems without libgcc (eg Solaris). Try not to ship binaries that rely on a particular version of some library that the OS doesn’t provide! This relies on you not loading any external C++ libraries (statically or dynamically), except for shared objects you’ve carefully made yourself!

How do I link?

  1. To statically link libstdc++: in each directory where you build binaries (or shared objects), have your makefiles do ln -s `g++ $(CXXFLAGS) -print-file-name=libstdc++.a` libstdc++.a. Then, add -L. to your commandline. If you only use recent versions of GCC, there’s a -shared-libstc++ option.
  2. Don’t statically link libc!
  3. GCC 2 doesn’t add a libgcc dependency by default (on platforms that don’t have it). Nothing to worry about. GCC 3: use the -static-libgcc option if it’s needed (it won’t be needed for example if you compiled gcc with --disable-shared).

Google if you need an explanation for any of the above. The issues are somewhat subtle for a few cases.

[J-PAKE] Password Authenticated Key Exchange by Juggling

If you haven’t seen this before, it’s totally awesome! Wowz! This may even be more useful that SRP et al. I’m considering mocking this up soon. Some caveats.

The fields are full of summer still

And breathe again upon the air

From brown dry side of hedge and hill

More sweetness than the sense can bear.

So some old couple, who in youth

With love were filled and over-full,

And loved with strength and loved with truth,

In heavy age are beautiful.

Edward Shanks

(The previous post was a poem I’ve had on the brain all day, d’après Dave yesterday. I thought I should read one of Shanks’ collections of poems, since I don’t know anything else by him. This is my favourite of his Queen of China volume. Apparently others like it too, because it’s one of the few Shanks poems set by Gurney and Warlock. I like the Gurney setting; I perhaps should buy it and learn it…

(I also recommend The Riddle.)

She is all fire when I do burn,

Gentle when I moody turn,

Brave when I am sad and heavy

And all laughter when I am merry.

Edward Shanks (and set by Finzi)

Are TCP SOCKET handles inheritable?

In a fit of pique, I’ve created a wonderful pair of self-answered Stack Overflow questions, to answer the two sides of this Microsoft coin:

  1. If you try to inherit SOCKET handles, will it work? No, unlike other handles, they’re not always usable in child processes. This is by design (although they regret their ’90s short-sightedness: recently they’ve started to “recommend” that developers don’t abuse the TCP stack with Layered Service Providers).
  2. Can you prevent SOCKET handles from being inherited? No, unlike other handles, they default to inheriting, and unlike other handles, it’s not always possible to prevent them being inherited by child processes. This is by design (although they regret their ’90s short-sightedness: they released a hotfix on Vista provide a way for the first time to make non-inheritable SOCKET handles).

A very neat no-win situation! General astonishment all round the office, and a new patch release last week to work around the places where we assumed differently. This is really the rock-bottom of Windows filth, I hope. Naturally, the only firm documentation we can find is in their supplied code samples, which violate our observations and conclusions now we know where to look.

In deep fear: Gurrelieder blaring through my ears. Mortified by the thought that I might suddenly (very loudly) join in with one of its ecstatic moments (dangers of knowing the words too well)… or even just starting humming. The office is really very quiet.

Last Saturday’s Turangalîla was fabulous too (live). I was very upset by how disrespectful the orchestra was though: I was utterly entranced by it and wanted to bring the ondiste back a third time, but they had so little regard for the music that they brought the extra players for the next piece on stage while we were trying to aplaud them for the last one! Their stupid joke piece at the end was more important to them than the thing we’d come to hear. I was totally caught up in the euphoria of the sound-world though, which I find extremely moving, especially the haunting, longing sweetness of the three love themes. Composers like Messiaen and Bruchner are real gift to us, because unlike for the gorgeous richness of Mahler, Schoenberg and Elgar, we don’t have to switch our minds off to the sordid words.

Odd Comments and Strange Doings in Unix

Fascinating!