Aggie: the sequel

January 11th, 2003

Well, what do you know... Remember that I wanted to get Aggie to send mail? The only problem was to compile some C#. Today I finally got a go at it. First I tried csc *.cs, but that didn't work. Then I noticed a Makefile in the directory. First try was to type make, but that didn't work. Then, from the depths of my memory, something like nmake came to mind. I typed it, and tadaaa... Aggie compiled! I have no idea where that nmake comes from (was it installed already? Is it installed when you install .NET SDK?), but it magically was there.

The big advantage over Hep? It doesn't require a server. That is, it doesn't have to be reachable from the outside. It only needs outgoing HTTP and SMTP, and that's it. You can get to your RSS feeds from everywhere where you can read your mail. It comes pretty close to this.

I discovered a strange thing though: on Win2K, the finest interval between 2 scheduled tasks is 1 day. I wanted to schedule AggieCmd to run once every hour or so, but that's just not possible. I wonder why... Anyhow, I hacked some C# to get finer intervals. In Java, you would use Thread.sleep(3600000). I casted The Magic on C# sleep, which led me to the Timer class. A quick course in Delegates (summary: you can pass methods as variables), and I got it running. Probably not the shiniest code a C# programmer has ever seen, but it seems to be working. (If you're interested in the code, send me a mail. But I warn you: if you've coded more than 2 lines of C# in your life, it really isn't worth the trouble.)

A final note on the Delegate idea: I've got mixed feelings. I like it, because I missed it in Java a time or two (yes, I know you can design around it, but that always seems such a drag), but it also kind of makes methods and objects interchangeable. The OO purist in me isn't too happy about this. Luckily, I'm pretty good at getting purists in me to shut up.

Leave a Reply