Monday, November 30, 2009

MeasureUp FAIL

I’m currently studying for the 70-536 on my way towards MCTS certification.

I have the self-paced training kit and thought I’d do the Training Kit Exam Prep “Powered by MeasureUp”

Things go without technical issues until I get to scoring.

Then I am greeted with:

---------------------------
Application Message
---------------------------
An unanticipated error has occurred in the application.InsertScoreHistory

[Microsoft OLE DB Provider for ODBC Drivers] [3604] [Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression '#30.11.2009 21:51:40#'.
---------------------------
OK   Cancel  
---------------------------

Trying to review a particular answer fails with:

---------------------------
Application Message
---------------------------
An unanticipated error has occurred in the application.GoToQuestionSelected

[Microsoft.VisualBasic] [13] Conversion from string "7." to type 'Short' is not valid.
---------------------------
OK   Cancel  
---------------------------

I then eventually end up at the FAQ page at MeasureUp and find

I'm receiving Error: Mismatch 13.
In order for tests to display correctly, your computer's regional settings should be set to English (United States).

In the control panel, please double click on the icon labeled Regional Settings. Please choose English (United States), and click the box that says "use default properties for this input locale."

Alternatively, in the regional settings, look at the Currency tab. If it is set the decimal symbol to . (dot) instead of , (coma), that may be enough to get it working properly.

If the trouble persists, try setting the keyboard language layout to English (United States). In the control panel, double click on the icon labeled "Keyboard". Then click on the tab labeled input locales. Select the Add button. And then choose English (United States) as the input locale.

W T F !?!

It’s kinda ironic that one of the skills measured is “Implementing globalization, … in a .NET Framework application”

What’s even more tragic is that if I actually DO change to en-us, trying to start a new test fails, this time with:

---------------------------
Application Message
---------------------------
An unanticipated error has occurred in the application.PreviousSessionTestRecord

[Microsoft.VisualBasic] [13] Conversion from string "30.11.2009 21:58:26" to type 'Date' is not valid.
---------------------------
OK   Cancel  
---------------------------

Tuesday, November 10, 2009

roleProvider app.config parsing troubles

I recently had the pleasure of trying to get our RC out the door, while doing that we realized that for whatever reason, Microsoft seems to use a non-standard parser for the app.config file.

Basically this does not work:

<system.web>
  <
roleManager defaultProvider="MyCustomProvider" enabled="true">
    <
providers>
      <
clear></clear>
      <
add name="MyCustomProvider" type="Namespace.MyCustomProvider, MyAssembly"/>
    </
providers>
  </
roleManager>
</
system.web>

While this does:

<system.web>
  <
roleManager defaultProvider="MyCustomProvider" enabled="true">
    <
providers>
      <
clear/>
      <
add name="MyCustomProvider" type="Namespace.MyCustomProvider, MyAssembly"/>
    </
providers>
  </
roleManager>
</
system.web>

Of course, the well known commercial installer making tool we are using insists of creating the former… :(

A workaround is to throw the file through an identity XSLT transform in a custom tool / custom action run after custom actions from said vendor have done their job.

Oh, the bug reported on connect is already closed as Won’t Fix

Wednesday, September 02, 2009

Windows Live Movie Maker - FAIL

As I wanted to edit some movies, and Windows 7 no longer includes Windows Movie Maker I had to give Windows Live Movie Maker a try, as based on the name you’d assume it does something similar?

Turns out I was wrong. This application seems to be geared towards dropping a number of photos and creating a “movie” and not actually editing movies.

While you can import video from a DV camera, it does not split the imported video into scenes, instead it chops it into pieces, the size of which you can determine by dragging a slider !?! And to make matters worse, it does not bother to extract thumbnails from the individual pieces but instead uses what seems to be the first frame of the entire movie. Good luck finding the pieces you need.

Of course, the timeline also seemed unnecessary to include …

Time to look for a Video editor, Windows Live Movie Maker is not one.

</rant>

Tuesday, March 03, 2009

Generating GUIDs

This may seem trivial but here we go:

I recently created an installer with WIX and obviously had to create a number of GUIDs along the way. While there is a "Create GUID" option in the Tools menu it has a number of drawbacks:

  • Clicking around a UI with a mouse is not the most efficient thing in the world
  • There is not an immediately suitable format available, registry format is closest, but braces need to be removed and the rest uppercased

The obvious? solution to this problem is to create a macro like the following:

Public Sub CreateWixGuid()
Dim g As Guid = Guid.NewGuid()
Dim textSelection As EnvDTE.TextSelection

textSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection)
textSelection.Text = g.ToString("D").ToUpper()
End Sub


and assign a keyboard shortcut to it (I chose Ctrl+G,Ctrl+G), and voilà a GUID in the correct format is generated and inserted.



 



 

Tuesday, November 11, 2008

How to not do validation

Yesterday when I was trying to do some online shopping I the e-commerce system in use perfomed input validation in a slightly suboptimal way. Here is what happened:

  • To be able check out the stuff in my shopping basket I had to create an account.
  • To create an account I had to enter username, password and address.
  • Go to checkout
  • Confirm to use the just entered address as the shipping address
  • On the following page where the pay button should be there's this small note "The city is not long enough"  WTF!?!
  • Try again with the city name in the other language as it is longer
  • Same story "The city is not long enough" ...
  • Only when changing the primary address the order goes through

A validation rule stating that the city cannot be just three letters are just plain stupid, secondly if there is a need to use stupid validation rules, then do the validation when the data is entered and not when it is used ...

This comic comes to mind.

Saturday, November 08, 2008

Debugging WPF databinding issues

Lately due to switching teams and project I've been doing much more WPF than before. I cannot say I have fully mastered the learning curve yet but I'm getting better and it is an interesting journey.

Occasionally the data bindings does not work as expected and then it is nice to get more information about them in order to figure out what went wrong.

The following is useful when you want to know why a particular binding is misbehaving (or rather you want to know where you screwed up...)

xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"



ItemsSource="{Binding <snip>, diagnostics:PresentationTraceSources.TraceLevel=High}"


The above information and MUCH more is presented by Beatriz Stollnitz



(This post is also a 'reminder to self')

Monday, November 03, 2008

C# quiz 9/?

Consider the following:

Guid globallyUnique1 = new Guid();
Guid globallyUnique2 = new Guid();
if (globallyUnique1 == globallyUnique2)
{
MessageBox.Show("This cannot be");
}
else
{
MessageBox.Show("Everything is well");
}

What is shown? Why?