Mad Props!

Omniscience is just a Google-search away.

Login

You're reading Mabsterama, the weblog of Matt Hamilton. Enjoy your stay.

I'll Wait for the DVDs

*sigh*

Like many other developers, I eagerly visited the MSDN subscriptions site yesterday to download my copy of Visual Studio 2008. The fact that I can get it this early as an MSDN subscriber is just awesome.

However, Microsoft don't seem to want me to have it.

Why do I think this? Because they make me use this abysmal download manager from a company called Akamai to get the file.

I left it running last night and came in this morning to be greeted with a nice error message about how the download encountered a fatal error and I'd have to restart it. I don't really want to risk having to restart the download of a 3GB file any more than a couple of times.

Not only that, while this download manager is running, I can't click on hyperlinks in Outlook or Live Mail. They simply don't work. Instead of opening in IE as they should, they switch focus to the download manager. It somehow hijacks the http protocol handler for links in Windows.

I'm not the only one who hates this (cr)application - check out this post from Richard Banks. Ooh! And this one from Nigel Spencer!

So yeah - I'll wait for the DVDs. Thanks for nothing, Microsoft (or should I be thanking Akamai?)!

Validation for the Wishy-Washy

In .NET 3.0 we have a newfangled class known as ValidationResult. It's returned from a ValidationRule's Validate method and has a boolean property representing whether the validation succeeded, as well as a string property for the error message if it failed.

In my current project, however, a simple boolean value for validity isn't enough. There are a few edge cases where the validation depends on feedback from the user - an answer to a simple yes/no question.

So I've knocked up a very simple ValidationResult class of my own, which uses a Nullable boolean to represent the IsValid property, where a null value indicates that validation can't be determined until the user is asked the question posted in the Message property.

I've also added some static methods in lieu of public constructors so that the code is a bit more readable. You can return ValidationResult.Success, ValidationResult.Failure(reason) or ValidationResult.Ask(question) from your validation routine.

Keep in mind that this is not a drop-in replacement for the "real" ValidationResult. It's designed to be used in my own (.NET 2.0) project and has no relation to the new class. Here's the code!

 

public class ValidationResult
{
private static ValidationResult _success = new ValidationResult(true);
public static ValidationResult Success
{
get { return _success; }
}
public static ValidationResult Failure(string message)
{
return new ValidationResult(false, message);
}
public static ValidationResult Failure(string message, params object[] args)
{
return Failure(string.Format(message, args));
}
public static ValidationResult Ask(string message)
{
return new ValidationResult(message);
}
public static ValidationResult Ask(string message, params object[] args)
{
return Ask(string.Format(message, args));
}
private ValidationResult(bool? isValid, string message)
{
_isValid = isValid;
_message = message;
}
private ValidationResult(bool isValid)
: this(isValid, string.Empty)
{
}
private ValidationResult(string prompt)
: this(null, prompt)
{
}
private bool? _isValid;
private string _message;
/// <summary>
/// Whether validation was successful. If null, validation depends on the user's
/// response to the question in <see cref="Message">Message</see>.
/// </summary>
public bool? IsValid
{
get { return _isValid; }
set { _isValid = value; }
}
/// <summary>
/// The error message if validation failed, or the question to ask the user if
/// validity could not be determined.
/// </summary>
public string Message
{
get { return _message; }
set { _message = value; }
}
}

Windows Live Mail Memory Hog

Update! I think WLM had tied itself in a knot. I ended up finding a 1.7GB file called Mail.MSMessageStore on my C drive, which I renamed (and also renamed its backup). Re-ran WLM and let it reconstruct the file, and now that file is only 10MB and the memory-usage problem has gone away (although wlmail.exe still uses about 130MB by default).

I noticed this morning that my PC here at work was a bit sluggish, so I checked my processes' memory usage in Task Manager. Windows Live Mail (which I use primarily for newsgroups) was using over 100MB of memory, so I closed it, waited for the wlmail.exe process to disappear, and reran it.

I didn't do anything else - it has been sitting idle at the inbox of a POP3 account in the background for about twenty minutes. I haven't even focused the application.

Here's what my Task Manager looks like now:

image

... and five minutes later (while typing up this post):

image

I suspect there may be a problem! What do you think? I'd post to the newsgroup about it, but I think I'll need to upgrade to a 64-bit platform first so that WLM can access enough RAM to post! :)

Here's one last screenshot (in the time it took me to set the categories on this post and type these last few sentences):

image

Big Week in Software Updates

I'm writing this post from version 12.0.1366.1026 of Windows Live Writer - updated as part of Windows Live Wave 2 of the Windows Live suite of applications, which was released overnight. That includes a new version of Live Messenger, Live Mail, Live Photo Gallery etc.

Also released this week was the first alpha of Paint.NET 3.20. I don't know many people who still don't use Paint.NET, but it's an invaluable addition to Windows if you do any kind of image manipulation. See Rick's blog post for the full list of new features and changes in this version.

And lastly we have the first CTP of PowerShell 2.0! Remember that this is a CTP drop, so it's not for installation on production machines. See Jeffrey's post about CTPs if you're not sure.

Paul Stovell on WPF Designers

Paul has just made an insightful post about the history and future of visual form designers with a Windows Presentation Foundation focus.

I love his concept of a designer that focuses on styles and resources, and gives you a faux-3D "model" of your form rather than trying to accurately render it. That would be really handy for WPF.

Let's face it - WPF is a pretty big step away from the WinForms method of form layout (unless you specifically opt for the Canvas approach and set your controls' Left and Top properties manually). In reality it's a lot closer to HTML - and who here uses a visual designer for their HTML? I tried FrontPage once and to this day I still wake up screaming some nights.

Anyway, give Paul's post a read. Great stuff.

WPF Animations - Eschew "From"

Sorry for the cryptic post title, but this one is handy if you're using Storyboards in WPF to animate properties.

I have an image that I'm scaling and rotating when the mouse pointer's moved over it. It looks great - the image kind of zooms in as you hover over it.

The rotation goes from 5 degrees to -3 degrees, and the scale goes from 1 to 2 times. When the IsMouseOver property returns to "false", the scale returns to 1 and the rotation to 5 degrees.

The problem I found, though, was that if the animation hadn't finished by the time you moved the mouse pointer off the image, there was a noticeable flicker as the image quickly scaled up to 2 times and rotated to -3 degrees.

The solution? Don't specify a "From" value for your animations. If you only specify a "To" value, then the property animates from whatever its current value is.

Here's the code for the trigger in my application as an example:

 <DataTrigger.EnterActions>
<
BeginStoryboard >
<
Storyboard>
<
ParallelTimeline>
<
DoubleAnimation
To="-3"
Duration="0:0:0.3"
Storyboard.TargetName="thumbnailRotation"
Storyboard.TargetProperty="Angle"/>
<
DoubleAnimation
To="2"
Duration="0:0:0.3"
Storyboard.TargetName="thumbnailScale"
Storyboard.TargetProperty="ScaleX"/>
<
DoubleAnimation
To="2"
Duration="0:0:0.3"
Storyboard.TargetName="thumbnailScale"
Storyboard.TargetProperty="ScaleY"/>
</
ParallelTimeline>
</
Storyboard>
</
BeginStoryboard>
</
DataTrigger.EnterActions>
<
DataTrigger.ExitActions>
<
BeginStoryboard>
<
Storyboard>
<
ParallelTimeline>
<
DoubleAnimation
To="5"
Duration="0:0:0.5"
Storyboard.TargetName="thumbnailRotation"
Storyboard.TargetProperty="Angle"/>
<
DoubleAnimation
To="1"
Duration="0:0:0.5"
Storyboard.TargetName="thumbnailScale"
Storyboard.TargetProperty="ScaleX"/>
<
DoubleAnimation
To="1"
Duration="0:0:0.5"
Storyboard.TargetName="thumbnailScale"
Storyboard.TargetProperty="ScaleY"/>
</
ParallelTimeline>
</
Storyboard>
</
BeginStoryboard>
</
DataTrigger.ExitActions>

As you see, I only specify DoubleAnimation.To ... so the image nicely pops back to where it was when the mouse leaves it.

Outlook Meeting Madness

I think the staff here at work (myself included) have been the victims of a mall-hallucination recently, around the "meeting request" feature in Outlook 2007.

Outlook 2007 Meeting Request In Exchange 2007 (and presumably in previous versions) you can set up your meeting rooms as a special kind of Room user in the address list. Then your users can use a special 'Rooms...' button on the 'Meeting Request' form to 'invite' that room to the meeting.

Since there's no human driving Outlook for a room, the rooms are set to automatically process meeting requests. If they're free at the time of the meeting, they accept. If they're already scheduled, they decline. Lovely.

The problem, though, is that this all happens too late. You schedule a meeting in the boardroom and invite twenty people. You forget to check everyone's schedule and hit "Send". Almost immediately a few efficient Outlook-users will accept your meeting. However, a few minutes later the room auto-processes the request and declines because it was already booked. Now you get an email from the room telling you it has declined, and you have to reschedule your meeting! You have to send updates to everybody! This is certainly less-than-ideal.

Here's where the mass-hallucination thing kicks in.

At least three people I've spoken to here at work have seen Outlook warn you that your meeting conflicts with an existing meeting for one of your invitees when you try to send the invitations. So before the room (and everyone else) even gets notified, you have a chance to fix the meeting time so that everyone's free. I've seen it do this too - but I can't for the life of me find where! I certainly can't make it happen again.

We've only been using Outlook for two weeks now, so it's not like this was months ago and we're all misremembering.

Has anyone out there seen Outlook behave like this? It makes sense for it to check invitees' schedules before it sends the invitations, right? Right???

Fake Twitter

Since I'm too slack to actually sign up for a Twitter account, here are a bunch of disconnected one-liners, Twitter-style!

Superman Returns on HD DVD: Fantastic. Transformers and 2001: A Space Odyssey should arrive this week. Pan's Labyrinth released on Boxing Day.

The fact that you need SharePoint installed on your development machine if you want to write any kind of custom code really sucks. On the bright side, it will be a chance to get started in the world of developing on virtual machines.

Exchange 2007 and Office Communications Server 2007 are great, but they suck when your IT department won't purchase a proper certificate and insist on generating their own - one for each server! No wonder we have so many errors and warnings. sigh.

I really wish Office Communicator (and Windows Live Messenger for that matter) supported the pasting of images into the chat window. It would make sending screen-shots to co-workers much easier.

My new ADSL2+ modem (a Linksys WAG54G v3) should arrive early next week. I've decided to roll my modem and wi-fi router into one unit after the two of the stopped talking to each other last week. No wi-fi means no laptop surfing from anywhere in the house.

Currently reading Adam Nathan's Windows Presentation Foundation Unleashed, which Andrew has kindly loaned me. Great read, but I do think you'd need something of a head start to get into it. Euan, for example, found it a bit confusing trying to read it without any experience in WPF.

I love Outlook 2007 so far, but I can't believe that Outlook in general doesn't support usenet newsgroups. I have to run Windows Live Mail side-by-side to get to the Outlook newsgroups. That's just wrong. Yeah, I know there are third-party add-ins to do it, but I really shouldn't have to install (much less buy) anything extra to get to such a fundamental part of the Internet.

That's all for now!

Spammers Sink to New Low

Owing to the fact that I've received about 200 spam email messages from my "Contact Me" form here on Mabsterama over the past weekend, I've had to disable that feature.

For those who legitimately want to contact me (and I have had a few legitimate correspondences via that feature) please use my direct email address (mabster at this domain).

Sorry for any inconvenience, folks.

"Awesome"

The "blog" of "unnecessary" quotation-marks!

It really annoys me when businesses use quotation-marks on their signs as a way of stressing certain words. The worst case is when they wrap the word "free" in 'em. "Free"? Really? Is it free or not? Morons.

Found via Coding Horror's Twitter.