I hate the word webinar. I just hate it. It sounds stupid.
That is all.
the body of a very slow loop
Business Week’s David Holtzman has written an excellent article about the DRM debacle entitled, The DVD War Against Consumers. Here’s one of his suggestions for Hollywood:
Fuggetaboutit. It’s true that lots of people download movies off the Internet or buy bootleg copies, but how many adults will sit in front of a computer screen and watch a pixilated movie or be content to watch a DVD where someone’s head keeps blocking the camera every few minutes? The kids who download movies off the Net can’t afford to buy a real copy anyway. Stopping them from downloading and watching a movie doesn’t translate into an extra sale.
Scott Meyers wrote an article in CUJ a few years ago entitled How Non-Member Functions Improve Encapsulation. I highly recommend this article, as well as Herb Sutter’s GotW #84: Monoliths “Unstrung”, in which everyone’s favorite scapegoat, std::string, is refactored using this principle.
I have just stumbled onto a rather satisfying, if obvious, extension of this work. First lets review the properties of a friend function. Recall that a friend:
this pointerNow consider a function which:
this pointerWith tongue-in-cheek, I call this an enemy function (alternate names are welcome).
We can add as many enemy functions as we like to a class without reducing its degree of encapsulation, because these functions only have access to the class’s public interface. Better still, since we pass a this pointer, we don’t have the inconsistency between w.eat(.564) and nap(w) (from the Meyers article). This means we can fix std::string without breaking existing code. I envision something like this:
class Foo
{
public:
// ...
private:
// ...
enemy:
void func(); // may not access private members
}
// …time passes…
Foo f;
f.func(); //not really a member function
Update (6/4/06):
I threw caution to the wind and posted this idea to comp.lang.c++.moderated. Maxim Yegorushkin made a great suggestion: why not use a public member function in a derived class?
namespace
{
class FooBase
{
private:
int x;
public:
FooBase(int x) : x(x) {}
int size() { return x; }
};
}
class Foo : public FooBase
{
public:
Foo(int x) : FooBase(x) {}
bool empty() { return size() == 0; }
};
This does exactly what I wanted. The only downside is that I must write forwarding functions for FooBase’s constructors. I find this much more satisfying than Scott Meyer’s class Foo / namespace FooStuff method.
Update (6/15/06):
Many who object to the subclass solution do so on the grounds that it is “misuse of inheritance”. To appease them, I’ve modified the code above to wrap FooBase in an anonymous namespace. The “world” will have no idea I misused inheritance.
I couldn’t agree more with Kevin’s latest article, which tackles the issue of versioned C++.
I’ve been envious of Perl’s require functionality for years. If you don’t already know, Perl programmers use statements like require 5.6.1; to indicate a version dependency.
Maybe we can get this with a #pragma in C++?
I’d like to point out that there is already some precedent for things like this in the C/C++ world:
I think what I’m really trying to do here is whine. The Perl language folks get to change their minds whenever they want. If you don’t like it, you can continue using the old version — nobody is stopping you. Meanwhile, we in the C++ world are unable even to introduce a new reserved word, for fear of breaking existing source.
Update:
I just discovered that the ISO IEC JTC1/SC22/WG21 working group (better known as the C++ Standards Committee) has some papers on this subject:
The University of Texas hosts an archive of the writings of the late Professor Dijkstra. This is a treasure trove of musings by one of the greatest minds in all of Computer Science. You could do much worse with your time than to spend it poking around the archive. Today, for example, I read this gem:
Consider the plane figure Q, defined as the 8 by 8 square from which, at two opposite corners, two 1 by 1 squares have been removed. The area of Q is 62, which equals the combined area of 31 dominos of 1 by 2. The theorem is that the figure Q cannot be covered by 31 of such dominos.
Another way of stating the theorem is that if you start with squared paper and begin covering this by placing each next domino on two new adjacent squares, no placement of 31 dominos will yield the figure Q.
So, a possible way of proving the theorem is by generating all possible placements of dominos and verifying for each placement that it does not yield the figure Q: a tremendously laborious job.
The simple argument, however is as follows. Colour the squares of the squared paper as on a chess board. Each domino, covering two adjacent squares, covers 1 white and 1 black square, and, hence, each placement covers as many white squares as it covers black squares. In the figure Q, however, the number of white squares and the number of black squares differ by 2 –opposite corners lying on the same diagonal– and hence no placement of dominos yields figure Q.
(Credit to Bheeshmar for leading me to EWB1036)
Yes, it’s really true this time! Woohoo!

If I ever got the chance to use Subversion on a large project, I think I’d branch my ass off. Here’s why:
Act 1, The Vacation
Imagine you’re 30% done with some changes to your project. You’ve done some good, but incomplete, work. Perhaps the code doesn’t even compile in it’s current state. Now you need to go on vacation. You can’t check in, because it will break the rest of the system. But unless you do something to backup your work, you risk losing it all in a hard disk failure.
Act 2, Two Roads Diverged
Back from vacation, and you now find yourself 50% done and facing a tough decision. You can think of two different ways to continue your implementation, and you’re not yet sure which is best. Again, you can’t check your half-done work into source control without incurring the wrath of the team.
The state of the art, at least in the places I’ve worked, is to solve both of these problems by going “off the grid”, and copying zip files around. Essentially this forgoes all the benefits of source control for the duration of the task.
The real solution to this problem is a the concept of a work-in-progress branch.
If each developer branches from the mainline before starting work, she can check in broken code at will, because nobody else cares about her branch. She can checkpoint her work, attempt something, and go back if she changes her mind. She can even branch her branch, if she finds herself truly indecisive. Additionally, she gets to put her important source code on a system with regular backups. Eventually, the WIP branch is merged into the trunk and left to wither and die.
Am I crazy, or does that just feel right?
Some of you may have a legitimate excuse for the off-grid behavior, like a poor version control system. None of this is really feasible unless you have extremely cheap branching, like Subversion’s slick copy-on-write system.
I suspect there are plenty of folks out there who are already using WIP branches (because I’m notoriously late to the party). I’d love to hear your comments.
I won’t pay for Aero Glass. I will however, pay for a systray with a clock that reliably shows me the date.

Sometimes, it seems I just can’t hover long enough to appease the date gods. Other days, they taunt me by placing the tooltip behind the systray, partially obscured, so I can’t actually read it.
Anyone know what day it is?
My childhood favorite videogame, Another World, has been remastered and reissued for the PC. Since the game is heavily vector-based, it looks great at modern high resolutions. You can pick it up for 7€ here.

I just rediscovered the Console project on SourceForge.NET. Console is a replacement for the stock CMD.EXE shell that comes with Windows. Turns out a lot of progress has been made since last I looked. It’s amazing. It fixes nearly every annoyance I’ve ever had with CMD.EXE:
title command)Some things I’d like to see added:
If you use the command line on Windows, you want this. I can’t recommend it highly enough.
Latest Comments
RSS