Content
Not quite a Yegge long.
Thursday 10 December 2009
-
Filed under
Uncategorized
Rosanna has been very busy making more knitted things:
Castle
You’ve got to have someone to live in the castle. I have step-by-step construction photos for this one, which I’ll post later.
Parrot (and Rosanna, and a pile of dishes.)
Various penguins and a chunk of ice. Apparently this will become a penguin Christmas scene, so I’ll post that when it’s done too.
Baby Kiwi
Here’s some old favorites, in a better photo:

::
Share or discuss
::
2009-12-10 ::
admin
Thursday 10 December 2009
-
Filed under
Uncategorized
Last time we built a very simple web server that can serve up errors and static files off the disk. Now we’re going to add more capabilities. First, redirecting the client from one URI to another:
Routes = new []
{
Server.ServeRedirect("/index.html", "/static/index.html" ),
(more…)
::
Share or discuss
::
2009-12-10 ::
admin
Thursday 10 December 2009
-
Filed under
Uncategorized
First, for those hardcore folks: We’re not going to be implementing the nitty-gritty details of HTTP today. I have done it once, in C, for an embedded system, and I have no great desire to repeat the experience. So we’ll be using HttpListener to do the heavy lifting for us. Blatant cheating, I know, but it will also allow us to cover some interesting behavior, rather than getting bogged down in minutiae.
First, let’s have an example of where we want to be going. To start serving stuff, all we should have to do is create a server object, specify what we want to serve, and start accepting connections:
(more…)
::
Share or discuss
::
2009-12-10 ::
admin
Wednesday 11 November 2009
-
Filed under
Uncategorized
NO, I’m not talking about the various ways people screw up miserably in C++, which must be the language most steeped in idioms of them all(out of necessity, I might add; you’ve got to do something to avoid constantly shooting yourself and your team-mates in the foot…)
In fact, this is about English idioms and their misuse by the unenlightened plebs well-meaning but clueless people who seem to surround me.
It’s without further ado, not without further adieu. Look it up. “ado” means “fuss” or “delay.” Makes sense, hmmn? “Adieu” isn’t even a noun. It means (roughly) “goodbye.” So unless you’re trying to cut a goodbye short (escaping from extended family, perhaps?), you’re failing miserably.
Of course, some of these misuses are just funny. Here’s a few which have high value and are probably best explained by purely-aural meme propagation, combined with today’s ubiquitous sloppy pronunciation:
For all intensive purposes. (…intents and purposes)
We’ll burn that bridge when we come to it. (cross)
Water over the bridge. (under, you’d hope)
Let’s nibble this in the butt. (nip, bud; unless you mean something very different from what we think you mean)
I don’t want to sound like a dead horse. (… flogging a dead horse; a pointless activity)
Don’t jump to contusions. (conclusions, although you can have a contusion too if I hear this one…)
A sorted affair. (sordid, usually, unless you’re a computer scientist, in which case sorting is of great interest.)
I think I’ve given enough examples, so a final word (which, idiomatically, is not merely one word at all, but that’s just tough:
Dear Internets, please try to appear literate. Look things up when they don’t make sense, rather than assuming the illogical is for some reason idiomatic.
1 comment ::
Share or discuss
::
2009-11-11 ::
admin
Friday 6 November 2009
-
Filed under
Uncategorized
I’ve had periodic issues with my work machine keeling over, ever since I got it. Since I can’t reinstall the operating system (the usual fix for this kind of garbage), I’ve just let it slide for the most part… until now.
I happened to be running Process Explorer the other day to get a decent look at whether a memory leak was still happening in one of my components, and noticed that one particular system process had an absurd handle count (around 1.6M), increasing by ~20/s. This is `audiodg.exe`, which the internet tells me is the “audio device graph isolation process”.
Some more digging around reveals that this process is something I didn’t ask for, can’t possibly want, and exists purely to do two things:
- Isolate the “sensitive” parts of the audio device graph functionality in a process that can be given special protection, unlike the svchost in which Windows Audio / Audiosrv runs.
Of course, there’s no possible reason that I (as an end user, or as a developer) could want this functionality. Screw system components that exist to protect my data from being tampered with by… me. (Btw, I have no DRM-protected music on this system).
- Host buggy third-party plugins provided by my audio chip manufacturer, in such a way that the process can fall over without taking a collection of other services with it. Oh wait, I thought that was what the “own process” vs “shared process” flags in the SCM were for? But I digress…
The audio chip in this case is the usual piece of SoundMax/SonicFocus garbage, whose developers’ notion of quality software *still* includes providing a broken substitute for the builtin volume control, spamming up the notification area, chewing through memory for no reason, spinning on a CPU core, and generally being a bad software citizen.
Needless to say, I don’t give a rat’s ass about the ability to do this either. Especially in conjunction with the “protection” features that prevent me from interfering with these buggy plugins when they break. Good job.
So, there’s no reason that I want device graph isolation. But apparently I can’t do anything about it, because that’s just the way Windows does it now.
Anyway, let’s have a look at what all these handles are. Enter procmon, which happily shows this being opened approx 20 times / second and then apparently forgotten about:
7996 9:27:48.0323030 a.m. AUDIODG.EXE 1212 RegOpenKey HKLM\Software\SonicFocus\{0.0.0.00000000}.{02420E38-7F43-45C3-8C7A-26C5946A5FCB} SUCCESS Desired Access: Maximum Allowed
A quick registry tree rename later, we’re back to a stable handle count and 20 requests per second that fail:
8070 9:41:48.0830628 a.m. AUDIODG.EXE 1212 RegOpenKey HKLM\Software\SonicFocus\{0.0.0.00000000}.{02420E38-7F43-45C3-8C7A-26C5946A5FCB} NAME NOT FOUND Desired Access: Maximum Allowed
Owned. As for why they feel the need to read all these keys 20 times per second… beats me, but my system is stable now.
The takeaway: SonicFocus’s sound render plugin is crap and broken, allocating handles out the wazoo and dropping them on the floor. Windows compounds the issue by running it in a process that’s protected from the user. However, you can still fix it by intentionally breaking a registry tree.
1 comment ::
Share or discuss
::
2009-11-06 ::
admin
Monday 2 November 2009
-
Filed under
Uncategorized
Since I’m such a Reddit addict, my wife knitted me a Reddit alien. This is the first pattern she’s made herself.
Isn’t it cute?
::
Share or discuss
::
2009-11-02 ::
admin
Wednesday 28 October 2009
-
Filed under
Uncategorized
I finally got fed up with the limitations of XCC mixer as a SHP viewer, and wrote a real sequence viewer. Eventually, it will function as an editor too.
Key differences:
- It can read sequences.xml
- It can tell you the index of a particular frame, which is really important for big SHPs, from which you only really want a few frames in the middle
- It shows you where your animation boundaries are, so you can debug animation without having to eyeball a unit in the OpenRA game and *hope* you spot the one frame you’re out by.
Enjoy a screenshot, or if you’d rather play with the real thing, grab the code from GitHub.

::
Share or discuss
::
2009-10-28 ::
admin
Friday 9 October 2009
-
Filed under
Uncategorized
Since moving all our open-source bits over to GitHub, we’ve revived the OpenRA project. It’s making quick progress now. In just the last week:
- Unit selection works properly
- Sidebar behavior is far better than it used to be
- New unit rules system is making great progress
- Turrets on vehicles now work
Enjoy a screenshot:

14 comments ::
Share or discuss
::
2009-10-09 ::
admin
Tuesday 6 October 2009
-
Filed under
Uncategorized
I saw an interesting bug report today for OpenRA: A closure constructed in the body of a foreach loop wasn’t capturing the induction variable the way we expected. As usual, the compiler is doing the right thing, and it’s just a weird case you have to watch out for. Here’s a simplified, somewhat contrived version that makes me want to cry:
var xs = new[] { “foo”, “bar”, “baz” };
var ys = new List<Func<string>>();
foreach( var x in xs ) ys.Add( () => x );
foreach( var y in ys ) Console.WriteLine( y() );
One would naively expect that this nonsense would have this output:
foo
bar
baz
Unfortunately, you get this:
baz
baz
baz
Oops. That `x` is being shared between all the closures we created. Apparently, you have to create a “real” local binding within the `foreach` block to separate them:
foreach( var x in xs ) { var y = x; ys.Add( () => y ); }
Uh, right. Let’s expand that foreach manually:
using( var e = xs.Cast<string>().GetEnumerator() )
while( e.MoveNext() ) {
var x = e.Current;
ys.Add( () => x );
}
Pay no attention to the Cast<string>() lameness. Foreach has hax. And no, that’s not really what the compiler did. Enjoy:
using (var e = xs.Cast<string>().GetEnumerator())
{
string x;
while (e.MoveNext()) {
x = e.Current; ys.Add(() => x); }
}
This sucks. In fact, this sucks so much that I’m going to throw out all the imperative crap and do it the nice way, which works properly without being weird:
var ys = xs.Select(x => (Func<string>)(() => x)).ToList();
Oops, still a bit of lameness because the type inference engine sucks. You could hide it with an extension method: AsThunk() :: a –> (() –> a) but we won’t bother, since this is pretty contrived anyway.
Oh well. Anyway, that’s why OpenRA currently makes a Radar Dome when you click on Power Plant.
5 comments ::
Share or discuss
::
2009-10-06 ::
admin
Saturday 3 October 2009
-
Filed under
Uncategorized
A while ago (when it was first posted, I guess) I enjoyed watching Linus’s Google Tech Talk about how much better git is than everything else – the one where he says SVN users are stupid and ugly. Since then, I’d been curious about git, but had held off actually using it, mostly because I had a reliable SVN server that was going fine.
A couple of weeks ago, I stumbled across the second GTT on git – which focuses on how it works, how to use it, etc rather than the chest-beating exercise of the first instalment. And I got hooked.
Why? It’s fast. Really, really insanely fast. Oh, and it works when I don’t have network access, which is quite a bit, because this piece of garbage likes to crash. Don’t buy them.
So tonight beedee and I moved pretty much everything interesting from our SVN server to github:
::
Share or discuss
::
2009-10-03 ::
admin