Archive for the ‘Miscellaneous’ Category

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.

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.

>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.

>Bad menus

February 18th, 2008

>Since my first application with menus à la Mac/Win I have wondered over the semi standard menus.

So first we have File, a noun. There is supposed to be things to manipulate Files there.
Then comes Edit, a verb. Is this where you look for ways to edit things?

View which often follows is both a noun and a verb which is good because then you can have lots of stuff in it. Which is bad because you can have lots of stuff in it.
After this there is usually a group of menus that are application specific so I have no opinion of them.
Ending the group of application specific menus is the menu Tools that really is a misspelled acronym for Things Out Of The Standard; or possibly Things That Go Nowhere Else.
The finale is Help that contains ways to get help. And the version number of the application.

Am I the only one who feels this as a bit illogical?
Shouldn’t all top menus be nouns or am I missing something?

>Coloured layers

January 25th, 2008

>In a multi layered application one is bound to travel up and down and up again through the layers. It is usually not hard to keep track of where one is; just read the contents of the methods or check the namespace in suitable textbox.

But wouldn’t it be nice to have an extra signal? I am thinking of changing the colour of the background or frames or something. Not from red to green but something more subtle. Ridiculous thought? That is what I thought too when I first encountered coloured source code. “colouritis” whas my response. Today I cannot live without it and wouldn’t mind using different fonts the same way.

Ok, ok. “cannot live without” was an aggravation.

>Replace Notepad with something better

January 17th, 2008

>This message will be repeated in english.

Notepad.exe är en editor knappt värd namnet. Den väger in på 68k vilket inte är så mycket för en windows-app.
Men så innehåller den två kända buggar också. En som plockar bort text om du använder notepad mycket / har stora filer och en som inte klarar av vissa teckenkombinationer i början.

Tidigare använde jag NoteTab som är en alldeles utmärkt editor som är gjord för att ersätta Notepad. Den både hade “.log -i-början-av-filen”-funktionaliteten och i installationen ingick det en fråga om man ville byta ut Notepad. Det ville man.

Men sedan WinXP har inte det gått. Testa att byt namn på Notepad.exe i %windir%\System32 och den poppar rätt tilbaka igen. Så om du undrar var din hårddisk tagit vägen så ligger det uppenbarligen 2 st operativsystem på den.

Men räddning finns: http://blogs.msdn.com/omars/archive/2004/04/30/124093.aspx

Notepad.exe is an editor hardly worth mentioning. It lacks functionality but has still managed to cramp in 2 bugs into 68k.

I used to use NoteTab earlier which was built as a Notepad replacement. It even had the “.log -in-the-beginning-of-the-file”-functionality and the installtion procedure contained a question whether to replace Notepad. That was the obvious choice.

But since WinXP this has not been possible. Locate Notepad.exe in %windir%\System32 and change its name. A new Notepad.exe will pop up from nowhere. So if you wonder where all your hard disc space is gone you now know – there are two installations of Windows on it.

But Notepad can be replacede byt following this link.

>Dogfood and Kopain

January 17th, 2008

>This message will be repeated in english.

“Eat you own dog food” är ett uttryck för att använda det man själv tillverkat. I mitt fall bestämde jag mig för att använda Kopain från den förste i år.
Det är en enkel editor med RTF-möjlighet och framför allt en hierarkisk meny på sidan. Helt enkelt en rip-off av KeyNote som jag använt i flera år.

När jag började använda Kopain hade den 2 kända buggar. När jag använt applikationen en dag hade jag hittat fem till. Plus att ett par av sakerna på feature-listan (någon som vet en översättning av “feature”?) hade eskalerat till buggar i och med att de störde användningen för mycket.

Varför bygger jag en ersättare till KeyNote? (i den mån den kan kallas ersättare då den inte kan en bråkdel så mycket)
För att jag vill. Och för att jag kan.
Men framför allt att den sparar på ett format jag inte gillar. Det sparade formatet måste vara lätt att läsa och läsbart med något annat än ursprungsapplikationen.

Är det någon som vet en editor/ordblandare jag kan integrera som sparar annat än RTF? Jag vill ha något som är mer lättläst och generellt typ HTML då RTFstandarden verkar vara ungefär “det som WordPad lämnar från sig”.

Jag är nu inne på den 17e användningsdagen av Kopain och jag har fortfarande två kända återskapningsbara buggar. Jag har kraschat applikationen en handfull gånger och den har en gång zappat 2 dagars noteringar. Jag är nöjd.

“Eat you own dog food” is an expression for using what you have created. In my case I started using Kopain from the first day this year.
It is a simple editor with RTF possibility and above all an hierarchical menu to sort the notes. Simply put a rip off of KeyNote which I have been using for several years.

When I started using Kopain it had 2 known bugs. When I had used the application for a day five more had surfaced. Plus two things on my feature list had escalated to Bug status since they had to big an impact on the usability.

Then why did I build a replacement to KeyNote? (if it can be called a replacement at all since it contains a fraction of the functionality)
Because I want. And because I can.
But above all that is saves in a format more easily read. The saved format must require the original application to read.

Is there someone who knows of an editor with formatting capabilities I can integrate instead of the RTF thing I have today? I must be able to save in a more open and easily read format like HTML since the specification for RTF seems to be “whatever WordPad spits out”.

I am now on my 17th day of eating. I still have 2 recreatable bugs. I have crasched a handfull of times. I have lost 2 days of work. All summed I am satisfied.

>Do not start on A

December 11th, 2007

>This message will be repeated in english.

När jag listar kontakter i min nalle börjar den alltid längst upp, på A. Varför inte börja i mitten?

Dessutom är det mer troligt är att jag vill fortsätta där jag var senast, men det är en annan femma.

When I open Contacts in my phone it starts at A. Why not start in the middle?

Then… I probably want to continue where I let off the last time. But that is the source of another posting.

>What a solution is to be used for

November 20th, 2007

>This message will be repeated in english.

När man jobbar med use case är en av parametrarna de olika typerna av användare. Med dem håller man reda på att man bygger rätt sak för rätt roll.

Härom dagen snubblade jag över ett ärendehanteringssystem, ni vet ett sådant som helpdesk/supporten använder. Där kunde man sätta prioritet på ett ärende men vi skulle nogsamt undvika prio 1; för med prio 1 gick det ebrev till en hel hög med folk, bl.a. högsta chefen.

Jag skulle vilja höra den felrapporten.
“Hallå, är det helpdesk? Jag skulle vilja rapportera ett ärende.”
“Ja. Vad är det om?”
“Fabriken brinner.”
“Ok. Noterat. Hur bråttom är det?”
“Görsketabråttom, så det är nog bäst du sätter den på prio 1. Chefen vill nog veta.”

Hur mycket jag än tänker kan jag inte komma på ett supportärende som kräver att chefen behöver veta men inte är allvarligt nog att jag kan ringa honom.

One of the parameters when working with use cases is the different types of uses. They are used as guidance for building the right thing for the right role.

The other day I stumbled over a issue system, you know the kind helpdesk/support uses. One of the values to set was priority but we were asked not to use priority 1 because then an email was sent to more or less everyone including the top boss.

I would like to hear that report.
“Hello. Is it help desk? I would like to file a report.”
“Yes hello. What is it about?”
“The factory is on fire.”
“Ok. It is noted. How urgent is it?”
“Very urgent I believe. So please give it a priority 1. The boss probably wants to know.”

I have been thinking about it but have still to come up with an issue that is important enough to the boss to know but not serious enough to just call him on the phone.

Screen dump of a message box

November 19th, 2007

Since many years – many years before I noticed it – has it been possible to dump the text of a message box with ctrl-c.

Example: an application throws an exception and a dialogue with an error message pops up. Instead of dumping the screen and attaching the picture file just copy the text with ctrl-c and past it in you email.