Fail At Once

June 10th, 2008

What if you didn’t have to test your application?

What if you worked together with tools to make sure some bugs never even left the compiler? That would be less to test; faster development cycle and more stable code.

In search of better name I call this Fail At Once.

I will get back on the subject.

Update: I have not gotten back as much as I wanted.

XamlParseException in WPF

June 8th, 2008

>When hacking WPF one sometimes get
System.Windows.Markup.XamlParseException was unhandled
Message=”Cannot create instance of ‘FormMain’ defined in assembly ‘Kopain2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Exception has been thrown by the target of an invocation. Error in markup file ‘Forms/FormMain.xaml’ Line 1 Position 9.

which does not give much of a clue.

So copy exception details to your favourite editor (Copy exception detail to the clipboard…) and scroll down. Typically at the second last row you can read something like
at Kopain2.FormMain..ctor() in C:\Data\Projects\Kopain2\Kopain2\Forms\FormMain.xaml.cs:line 101
which is a magnitude more helpful.

>How come all digital calendars suck?

May 19th, 2008

>This can also be written: why haven’t I written one of my own?

The digital calendars try to mimic their paper cousins the same way as Phillipinean food takes after ditto from USA. They have kept all the bad stuff and thrown away the good parts.

Number 1 bad thing with all the digital calendars I have run into is their obsession with hours. There is no way to enter “after job” or “in the afternoon” or “time will be decided later”.
Number 2 bad thing with all the digital calendars I have run into is that there is no way to enter thing by week. I normally have vacation between week X and week Y (or dates X’ and Y’ if you prefer) and this is marked with a line in the margin. In my paper calendar that is. I cannot enter full day meetings because then my whole vacation is one big blob of “meeting” where I cannot find other stuff like sailing competition, midsommar or the dog’s birtday.
Number 3 is the overview. For the ones living their life like Gantt the solution might be perfect. But for all us others…

Some 100 years ago I had an Apple Newton and for this one I bought a calendar that did what everyone using the paper calendar metaphor should do; throw it in the recycling bin. The solution was to just list things in chronological order with a line for week changes and bold for new day (or something like that) In reality I know that the meeting at the divers’ club is at thursday evening and hence things above it is earlier and below it later on. This way of presenting my calendar turned out to be just the thing.

Last: if someone knows of a calendar program – please tell me.

>Folding everywhere in the editor

May 17th, 2008

>I think I want an editor that can fold every branch in the source code; every if, every switch…

Then I think I want some sort of colour or font coded differentiation of regular code and error handling. This way it should be easy to see the difference between business logic and plumbing.
How to do this without taking up valueable source code lines I do not know.

categories: wishlist | no comments »

Unit testing – can be too much

May 13th, 2008

I like unit tests, I really do. But I have also come to realize that many tests don’t have to be done.

One can for instance code according to Fail At Once to make the compiler do the tests.
Or one can autogenerate code and hence only have to unit test a fraction of the resulting code.
Or one can do integration tests and take for granted that if the integration works the unit tests work too.

I have tried all three and believe in laziness – to get more done while working less. So I say that a thought out mix of all three above supposedly is the right way.

Patrik Löwendahl thinks approximately the same.

WPF and how to move between graphics and XAML

May 4th, 2008

When designing windows/controls in a WPF form there are two panes. One (upper) with the graphics and one (lower) with the XAML code. How do one navigate between these two through the keyboard? The answer is shift-F7.

F7 moves from designer to code.

Shift-F7 is the reverse and moves from code to designer and in the designer toggles between the graphics pane and the XAML pane.

Update: Now I can only switch from XAML to code behind but not back and not between the xaml/designer panes.  New machine, new OS, new service pack, new addons.  I don’t know what to blame.

>Everything is a change

May 3rd, 2008

>There are no bugs and issues. There are no features and bugs. There are no priority changes and work items. There are no new use cases and lack of backup and ugly login page and bad performance.

There is only change.

Do not sigh when the customer comes with a new all important requirement. Put it in the list of changes.

It is only a change.

categories: project | no comments »

>Outlook Express address book error

March 25th, 2008

>Outlook Express has a problem wich cost me an hour of my life. I document it here to the aid of others. (I did search in the knowledgebase on MSDN or support att Microsoft to enter my newfound intel but there was no good place. MSDN which some years ago was a good place to find information has IMHO deteriorated.)

Problem: Outlook Express refused to open the emails. The error information was something like “An error has occurred.” but in swedish so it was useless for googling.
Opening the Address book there was a better error message “The Address book cannot be opened.” but likewise in swedish. Slightly narrower error message which helped me a lot.

I fixed the Wab (address book) file by copying the automatic backup (myusername.wa~).
But OE still complained about a corrupt WAB file.

Googling did little to help so I rebooted “just because”. And it worked.

To make OE read the address book again one has to reboot the computer. (Technically it might be enough to zap exactly the right process or do some registry hack but I don’t know which.)

Lessons learned:
1) When localizing a product – make each error message searchable. Either by a unique ID to search for or by letting the user see the international (english) text besides the local.
2) Give the user a sporting chance to track the error. If it is not possible to give a proper error message – describe where to find it, like in a log file or something.

>Prioritization is about Removing

March 7th, 2008

>Prioritization is about removing things from a list – not putting them in.

The above is very easy to approve of until one is faced with the actual task of removing something.

I have a trick that seems simple enough to work. I have used it with a customer and gotten to know things he didn’t know himself.  I use it on myself and get wiser every time.

Take this list with “all things” and separate it to three piles of equal size. Prio 1, 2 and 3. If three piles is too hard, try 9; but do keep them of equal in size.

This is hard to do and the result is not the final prioritization but it gets blood to the brain and forces the synapses to fire in new patterns. To remove things.

I do not tell the customer but know myself that the lowest third in the list will never be done due to money, time or -best of all- the very requirement disappears.

categories: project | no comments »

>Search IMDB through Opera

February 27th, 2008

>To let opera easily search IMDB for you, enter
    http://imdb.com/find?s=all&q=%s
in the dialogue described here.

Or use
   http://sv.wikipedia.org/wiki/%s
to search swedish wikipedia.

If you get too many hits it is very easy to navigate in Opera without having to grab the mouse – just shift-arrow around.

I use
    http://selfelected.blogspot.com/search?q=%s
to search my own blog.