I set my first steps into programming in 1984. My father bought a Philips P2000T that housed a Z80 processor, used a teletext display chip and had a mini cassette player to store and load programs.

Philips used Microsoft BASIC on their earlier released Videopac G7000 game console and used this also in the P2000. This programming language is responsible for my future love for computers. This weekend I dug up the computer from my parents basement and took it home. I was very surprised that it still worked after all these years. For old time sakes, I input my favorite statement and enjoyed the output very much:



Soon after working on the P2000T, I bought a commodore64 where I learned assembler language and really started to learn the ins and outs of computers but when I look at the P2000T, it is like looking at my first love :-)
I know how lost you can feel when that happens. XamlParseExceptions can be caused by a lot of things. Most of the time the troubled resource is stated in the error. But if you get the following error, what are you going to search for?

The dictionary key ” is already used. Key attributes are used as keys when inserting objects into a dictionary and must be unique.
If this error occurs, it’s possible there are implicit styles that target a type more than once. In my case I got stuck with the following code after a version control update:
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}" />
<Style TargetType="HyperlinkButton" BasedOn="{StaticResource DefaultHyperlinkButtonStyle}" />
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}" />
Implicit style defined twice
When I removed the second ComboBox style the error was gone. I hope this helps!
When I’m stuck on math questions I turn to my friend chris who can write pixel perfect C# code in a chat window. Yesterday I needed to calculate where a line intersects a circle so after a few google searches I came up with this Google Dart code:
double x1=100.0;
double y1=100.0;
double x2=200.0;
double y2=200.0;
double radians=Math.atan2(y2-y1, x2-x1) ;
double radius=50.0;
double y3=y2+radius * Math.cos(radians);
double x3=x2+radius * Math.sin(radians);
As it turned out, I made two mistakes. The last two lines should be:
double y3=y1+radius * Math.sin(radians);
double x3=x1+radius * Math.cos(radians);
How did I find out? Easy! I entered the code in the Dart editor and sent the generated link to Chris. He looked at the code, made some changes and sent a link back.
Calculate intersection point of line and circle
I wrote this post to point out the power of a shared code editor and to show how to calculate where a line intersects a circle. Open the link in a recent Chrome or Firefox browser and press play!
Today I played with the new Google Dart language and I liked what I saw. Google calls it “Structured Web Programming” and it’s purpose is replacing Javascript as the primary scripting language in browsers.
One of the things I really miss in Javascript are proper classes. You can fake classes with functions but it is what it is. Not a Class (NaC). So in my example I rebuilt a C# class that we use a lot in our Silverlight training: ‘Employee’
The Employee class has a constructor that takes a Name (string) and Salary (double). It has a method RaiseSalary(double percentage) and a public property ‘Info’ that returns info about the employee.
Getting started
So let’s start by opening http://try-dart-lang.appspot.com/ in Chrome. I use Chrome 14.0.835.202.
Dart code
Let’s start with a main top level function main function:
main() {
print('Hello, Vera!');
}
Enter the code in the Dart editor and press the play button:

Employee class
So here’s an example of a class with a public property in Google Dart:
class Employee{
String name;
double salary;
Employee(String name, double salary){
this.name=name;
this.salary=salary;
}
get Info()=> "Hello "+name+", your salary is €"+salary;
RaiseSalary(double percentage){
salary=salary+salary*percentage/100;
}
}
Create and use this class like this:
main() {
var emp=new Employee("Vera",4500.0);
print(emp.Info);
emp.RaiseSalary(6);
print(emp.Info);
}
Wich results in:

This is just a small example but it’s a nice start with Dart. You can find the full Language specification on the Dart website. Happy coding!
I am currently working on a very interesting Silverlight Project for Philips Healthcare. Like all projects it is rapidly growing and it’s time for some cleaning up.
When you use Expression blend it’s easy to create static resources for everything you are going to re-use. Static resources are always loaded in Silverlight. Even if they are not used. Unfortunately Expression Blend does not have a way to get rid of unused resources. Last year I built a small WPF app that analyses your project for you and indicates unused static resources. I’ve used it again today and decided to share it with you.
ResourceCounter
Download and extract ResourceCounter.zip and run the exe.
Enter a valid path to a Silverlight or WPF project and click ‘Analyse’
