Archive for the ‘Tech’ Category

Quoth Winforms Designer: Error HRESULT E_FAIL from a call to a COM component

Thursday, February 8th, 2007
Call to a COM component

Eerie. This designer thing seems to know when I’m under schedule pressure and pull out all its tricks.

Now I get “Error HRESULT E_FAIL has been returned from a call to a COM component.”

Never seen this before, don’t know what it means, don’t know what caused it, and don’t know how to find out.

Yes, my changes were lost.
No, I couldn’t repeat it by making (what I believe to be) the same changes again.
Yes, I’m happy about being able to make the changes after all.
No, I’m not happy about having no idea when this will happen again, or whether it might happen at runtime.

Quoth Windows Forms Designer: Specified Cast Is Not Valid

Thursday, February 8th, 2007

Let’s say you have a UserControl with a property like this:

public double DoubleValue
{
    get { return (double)NestedControl.EditValue; }
    set { Control.EditValue = value; }
}

where NestedControl.EditValue is of type object. Yeah, that’s careless handling of a possible typecast. But c’est la vie, sometimes that’s what you have, and you don’t know it, and that control is used in somebody else’s form that you’ve never seen before, and you are editing that form with the Windows Forms designer.

Specified cast is not valid

The designer will work merrily until you close it and say “yes, save for me please.” At this point it will present you with a dialog box saying simply “Specified cast is not valid” and inviting you to misrepresent your feelings by clicking “OK.”

When you do, it will give you the same dialog box again. You will click “OK” again, even less truthfully. And you will get that dialog box once again.

After the third time, tender mercies: the designer lets you off the hook and closes, saving your form. Phew, you think, maybe that wasn’t so bad. That’s until you discover that the designer has thrown out all the information associated with the problematic control instance, its name, text, tooltip text, sizing information, everything.

When you set out to find the cause of the problem, what do you have to go on? “Specified cast is not valid.” And which control instances got messed up. There may be dozens of them, with dozens of properties each. Happy hunting.

The lesson: when I write a tool for developers, and do it under a schedule crunch, and write a catch-all handler to display unanticipated errors … I pledge to include whatever specific contextual information I can. At least the exception stack trace. Surely that’s the least I could do.

Impressions of that splash screen spec

Wednesday, February 7th, 2007

Microsoft has posted a splash screen spec for the Orcas version of Visual Studio, asking for our impressions.

And here I was determined to start taking a more positive tack in my tech blog. Dear me.

My impressions are as follows:

The triviality

They wrote a nine-page specification complete with “Microsoft Corporation Technical Documentation License Agreement (Standard)” and stamp of approval from Microsoft Law And Corporate Affairs and table of contents and overview and context and definitions and appeal-to-stereotype Elvis arguments …

… for a drop-shadow and rounded corners and no other changes?

And thought it would be a good idea to post it publicly?

The specious claims

“[the splash screen] is no less critical than any other part of the Visual Studio User Experience.”

They lost me right there on the front page. Let me rephrase this statement while retaining the precise meaning:

“There is no part of the Visual Studio User Experience that is more critical than the splash screen.”

Gee, I could have sworn there were a couple.

We don’t even interact with this thing. It’s not a User Experience, it’s a Viewer Experience. And that’s if we even bother to View it, instead of fetching a cup of coffee while Visual Studio loads, or starting it with /nosplash.

How could it possibly be as critical as any other part of the User Experience?

This is the kind of text that comes out when you are thinking “what would sound impressive here?” instead of “what’s the plain and useful truth here?”

“The Splash Screen typifies some of the worst aspects of the Visual Studio User Experience.”

No no no. The worst aspects of said User Experience are, unsurprisingly, things we Use. Such as:

It’s OK to exaggerate the importance of your work in order to motivate yourself. But don’t go overboard.

The singularly clueless marketing stereotype banter

When Elvis first heard about Visual Studio Orcas being released, he wasn’t convinced that it was worth upgrading to, especially since he felt as though he had just purchased a copy of Visual Studio 2005.

So, like any frugal developer, Elvis went and downloaded a trial copy of Orcas to test drive.

Elvis could see that Visual Studio Orcas was new and different from the moment he started the application. The changes in the Splash Screen suggested to him immediately that this release was, indeed, different.

Well, wasn’t that a nice story.

Really, this Mort-and-Elvis stuff has to go. It pains me to see dinky little stories of these contrived stereotypes masquerading as product marketing wisdom.

The inattention

Chapter 6, “Feature Decisions / Q&A” is not just blank; it consists entirely of the placeholder text from the document template: “Include a quick description [...] describe decisions and rationale here [...] We will do so and so”

This is the document equivalent of:

/// <summary>
/// Insert summary description here
/// </summary>
public class Class1
{
    /// <summary>
    /// Construct a new Class1 instance.
    /// </summary>
    public Class1()
    {
        // Add initialization code here
    }
}

Do we post this kind of code for public review? For private review? Do we even check it in?

The implied background

One can’t help wondering whether this spec gives a glimpse of some contorted in-house dynamic, where people have to participate in a ritual Product Marketing dance by writing a Mort or Elvis “scenario” for every feature spec, and inflating the importance of their work with baseless hyperbole.

It sounds like the FeatureSpec.dot document template contained the placeholder text “Insert scenario involving Mort and Elvis here,” as a hoop for each feature spec writer to jump through.

It may not really be that way, but we’re talking impressions here.

Summary

Why did nobody’s nonsense detector go wild and prevent this embarrassment from publication? The splash screen improvements themselves are nice and understated, and should have been put in place without a word.

LaTeX in WordPress

Saturday, January 20th, 2007

This:

\displaystyle\frac12 &lt; \left\lfloor \mathrm{mod} \left( \left\lfloor \frac{y}{17}\right\rfloor 2^{-17\lfloor x\rfloor -\mathrm{mod}(\lfloor y\rfloor , 17)},2\right)\right\rfloor

is called Tupper’s self-referential formula. If you graph it over particular values of x and y, it makes a picture of itself, and that is quite neat. Follow the link for details.

And this is a property of the unit impulse:

\displaystyle\int_{-\infty}^t\delta(\tau)d\tau = u(t)

But that’s not really the point. The point is the mathematical notation; you can integrate \LaTeX mathematical notation in your WordPress blog very easily, using Steve Mayer’s LatexRender plugin.

And the point here is that you can install that plugin even more easily and correct a nasty bug in the offset beta functionality, using my LatexRender installation script (or the BSD version).

Go to the wp-content/plugins subdirectory of your WordPress installation, and then either:

wget http://fugato.net/wp-content/install-latexrender.bash
bash install-latexrender.bash

or, if your webserver is running BSD (or anything with the same kooky version of sed as my hosting provider’s BSD installation):

wget http://fugato.net/wp-content/install-latexrender.bsd.bash
bash install-latexrender.bsd.bash

and with any luck, the script will set everything up right. Then you’ll just need to activate the plugin LatexRender in your WordPress admin panel, and try it out by putting something like [tex]e^{i\pi}=-1[/tex] in a blog entry. That should render the classic e^{i\pi}=-1.

This is tested working fine in WordPress versions 2.0 through 2.5.1 (the current stable version, which this blog is running).

The script assumes that your blog is located at the root of your website. If it isn’t, then you must provide the base path as an argument to the script. E.g. if your blog is at http://o.com/all/ye/faithful/, then you must run the script like this:

bash install-latexrender.bash /all/ye/faithful

and it should work right.

Some formulas may be slightly misaligned with the text baseline. You can work around this by manually surrounding them with stuff like <span style="vertical-align: -0.5px;"> ... </span> on a case-by-case basis (assuming you edit your blog entries in straight HTML, not the rich text editor).

They use the same software for losing our luggage

Friday, December 15th, 2006

Heathrow software crash

To complete the installation, you must reboot your computer.

Friday, December 15th, 2006

You can choose to reboot now or later. Note that your computer may not function correctly until the reboot.

As far as I know, I did not agree to install any operating system updates.

If there weren’t any, why is a reboot necessary?

If there were, why wasn’t I told in advance?

Still on that dagnabbed installation

Friday, December 15th, 2006

My ongoing multi-hour installation stopped (without notification) to ask me, once again:

Do you want to install Microsoft Visual Studio 2005 Team Explorer - ENU Service Pack 1 (KB926601) on Microsoft Visual Studio 2005 Team Explorer - ENU?

“Gee, hey, I’m feeling wild, I think I’ll just skip this part of my 432MB installation, and see what breaks!”

Suggestion for future lengthy installations: either ask right at the beginning, or don’t ask at all.

Transparency

Friday, December 15th, 2006

By the way, what is it exactly that I am installing? What bugs did they fix? What improvements did they make?

Well, let’s find out. The download page says:

Additional details and known issues regarding this Service Pack can be found in Release Notes Knowledge base article 928957.

But click that link and you get “The Knowledge Base (KB) Article You Requested Is Currently Not Available”

So let’s try the KB article contained in the name of the service pack, KB926601.

Nope. “The Knowledge Base (KB) Article You Requested Is Currently Not Available”

Some companies have the guts to open up their bug database. I guess it makes business sense not to do so when you’re a 300 billion dollar lawsuit target. But that doesn’t make it any less customer-unfriendly.

Update: Brian Harry summarizes major new features and bug fixes in the TFS part of this service pack. Kudos to him … but this is almost three months old and there is no link to it from the download page or other pages about the service pack release. Why is this not done officially, and accessibly, and up-to-date, for the whole product?

Update 2: Brian Harry comments that it will be. They just haven’t finished the release notes yet.

Moore’s Law Premier Partner Edition for Software Developers - ENU Service Pack 1 RTM

Friday, December 15th, 2006

Do you want to install Microsoft Visual Studio 2005 Team Edition for Software Developers - ENU Service Pack 1 (KB926601) on Microsoft Visual Studio 2005 Team Edition for Software Developers - ENU?

(Wait, didn’t it just finish doing that? Oh, nono, that wasn’t Team Edition for Software Developers, that was Premier Partner Edition. Silly me.)

After about 15 minutes, this installation is still at 50% of the step “Gathering required information.”

So it’s time for Moore’s law 2005 Premier Partner Edition for Software Developers - ENU Service Pack 1 RTM:

Every 18 months, the following metrics double:

  • Memory
  • CPU speeds
  • Hard disk capacity
  • Microsoft product names
  • Microsoft SCM file rename time
  • Microsoft developer tools installation time
  • The sum of time intervals I spend waiting for my computer each day
  • The seriousness with which I wish I had stayed with the previous platform and development environment

Microsoft Visual Studio 2005 Premier Partner Edition - ENU Service Pack 1 (KB926601) has been successfully installed on Microsoft Visual Studio 2005 Premier Partner Edition - ENU

Friday, December 15th, 2006

Seems unprofessionally short and concise. A 432MB installation needs a more majestic name.

How about adding “Customer Technology Preview Limited Beta Release Candidate Ultimate Enterprise Communication Expression Interactive Presentation Foundation” at the end?

And maybe sprinkle in a few ™s and ®s? The crowd loves those.

Update: As an afterthought, I think I’ll add a couple of ☺ ☺ smileys here. This blog series ended up getting terribly negative!