Day 0 - Farewell

Posted by

I thought I'd lost my passport for a while, since I couldn't find it in the place where I usually kept it. Well, after a bit of panicking, and calling Chris to see if it was (for some reason) at the farm, I remembered that the last time I'd seen it was when Edhy was going for his permanent citizenship and I had to give them a photocopy. So I called Shiraz to see if maybe I'd left it with them, but she said I took it home with me that day. But I'd gone back to work after I saw them, so maybe I should check my bag... d'oh!! There it was!

Mental Note: Buy Shiraz a big souvenier :)

I was supposed to meet Grace at 1:30pm, at Central station, so I figured that I'd need to catch about a 12:30 train to get there on time. No problem, thought I, I'll call for a taxi to take me from my house to Seven Hills station at 12:00. That'll give them at least 20 minutes to get to my house and still have enough time to get the train. OK, 12:30 comes and goes and no taxi. I call the taxi company and they say, "oh, no driver has taken the call, we're still waiting." I send Grace a message: "no taxi yet, hopefully I won't be late...". 12:45 and still no taxi. I'm getting a bit annoyed now - I could have walked by now!! So I call them again, and get the same message. 12:50 and still no taxi! So I call them again, and still the same message - no drivers have accepted the call! So I messaged Grace again and said "sorry, definately going to be late now...". Luckily, however, my neighbour was home so I asked if he could give me a lift and it was no problem. I finally got the station around 1:15pm, and Central around 2:10.

Mental Note: Buy my neighbour a big souvenier as well :)

Said goodbye to Grace at the airport. I gave her a little photo frame with our picture in - so she wouldn't forget me, you see - and she gave me some nice chocolates for my mum and I (though I didn't open them until later). Very sad...

The flight itself was rather uneventful. 26 hours long (including two stops) and I'd already seen all the movies (except for "Unleashed" with Jet Li and Morgan Freeman). The food was average (for an aeroplane). Luckily though, I had an aisle seat and the seat next to me was empty, so at least I had a bit of room.

In Thailand (the first stop) I thought I might like to take in a bit of culture (well, as much culture as you can get in an airport!) and try a Thai beer. I only had AU $20 on me, so I changed it for some Thai Baht: ฿600 for $20. The beer only cost me ฿100. So I just hope that when I go back again, I stop over in Thailand again so that I can spend the rest of it! :)

Introduction

Posted by

As most of my friends know, this is a pretty big trip for me. I leave on Sept. 15th, travel around the UK for a month and fly back to Sydney early on Oct. 17th. This is my first trip to the UK, but hopefully not my last. I'll be visiting some of my family on the trip - most of whom I've never met before.

What follows is a day-by-day diary of my trip. I don't know how often I'll get to use the internet while I'm away, but I'll try to update these entries every chance I get. Enjoy (I know I will)!

By the way, all the photos are available here: www.codeka.com/uk. When I get home, I'll update them with thumbnails and stuff, but at least you can browse through what I've got so far.

iseriouslydoubtthatthisurlwilleverexist

Posted by

Heh, I just thought this was amusing. Sometimes I run Fiddler while dugging some web apps that I work on, and the other day I was doing just that. I also was debugging a native process, and I noticed the HTTP requests that it makes to the symbol server.

There were a couple of DLLs for which is was getting a 302 message from the server (which means "temporarily moved" - a technique mostly used to redirect the client to another page) and it was redirected to the url "iseriouslydoubtthatthisurlwilleverexist", as you can see here (click for a full-size version):

iseriouslydoubtthatthisurlwilleverexist

I have no idea why it does it, but I just found it amusing... kind of makes me want to name a server on our network "iseriouslydoubtthatthisurlwilleverexist" just to see what would happen :)

CDO and Custom Headers

Posted by

Seems there's another problem with CDO (see my previous post on the first one I found :) ). This one has to do with custom headers.

Now, according to RFC 822, CRLFs are illegal as part of a header (which makes sense, of course, because the CRLF is the delimiter for headers!). Strangely, bare CR and bare LF are OK, but that doesn't really matter right now. The problem is that if you set the value of a header via one of the short-cut properties (like Subject, To, From, etc) then it replaces any CRs with spaces. But if you set a property visa the Fields property, then it doesn't. This can be a real problem if you have code like this:


static void Main(string[] args)
{
  CDO.Message message = new CDO.MessageClass();
  message.From = "from@example.com";
  message.To = "to@example.com";
  message.Subject = "Hello World!";

  // This is the fateful line here:
  message.Fields["urn:schemas:mailheader:X-MyCustomHeader"]
    .Value = "Something with a new-line at the end:\r\n";
  message.Fields.Update();

  message.TextBody = "Some text goes in the body, too.";

  message.Configuration.Fields
    [CDO.CdoConfiguration.cdoSendUsingMethod].Value
      = CDO.CdoSendUsing.cdoSendUsingPickup;
  message.Configuration.Fields
    [CDO.CdoConfiguration.cdoSMTPServerPickupDirectory].Value
      = Environment.CurrentDirectory;
  message.Configuration.Fields.Update();;

  message.Send();
}

If you have something like this, then any headers that appear after X-MyCustomHeader will look as though they're part of the message body.

Now, obviously, the example above is rather contrived. But it's not always so obvious. There's also a really simple workaround: just strip off all the CRLFs. However, CDOEX that comes with Exchange 2000, doesn't have the same bug - it replaces any CRLFs with spaces, no matter how you put them in there.

Why doesn't the Garbage Collector kick in when my app is idle?

Posted by

I don't know why, but I always seem to post in spurts :)

One of the things with the Garbage Collector is that it only kicks in when you actually run out of memory. Now, that's not entirely true, but the point is that it only kicks in when you allocate memory. But why not kick it in when my application is idle?

The thing is, processes in Windows don't run in isolation. And if you're running a program, it's taking up space in your page file. And that space isn't infinite. So while an idle program's memory will be swapped out to disk (thus freeing up physical memory) it'll still be taking up space in the pagefile - and that space will never be reclaimed until my program becomes active again and start allocating memory.

I can understand that running the GC while a program is idle will immediately swap all that memory back in to physical RAM, even though it's not doing anything, but if you can free up some swap space (especially if you're running low on swap space) then mightn't that be worth it?