University of Hertfordshire Vista and Office Launch

Today I finally got around to holding my Vista and Office Launch event as part of my role as a Microsoft Student Partner. 

The event was a chance for students to see what was new and upcoming within Windows Vista and to find some of the more hidden features, such as being able to filter search results and the ReadyBoost feature.

I felt my presentation went well, although my laptop wasn’t impressed with me playing the Halo 3 HD trailer while connected to an external projector on power saving mode.  After a quick switch to high performance battery mode it worked like a charm.  I really enjoyed the event and it went really well,  plus it was good experience at presenting again.

Attendance wasn’t amazing, we had 14 people turn up and 9 filled out feedback.  The feedback was based on a mark out of five, so it appears everyone had a good time, which is shown in the chart below.

Some of the comments from the forms included:

“Well presented”, “Very good, learned a lot, thanks”, “Good job on the talk mate” and “Will consider getting Vista in the near future”

I’m sure the attendance would have been better if I had the launch before easter and not just before everyones exams, however with the Imagine cup and coursework the original timing wasnt suitable for me.

I would like to thank Chris Glaister who gave the Office side of the presentation and helped out with the general running of the event and to Microsoft UK for providing the freebies/prizes.

Download PowerPoint slide deck here

 

Bill Gates’ and Steve Jobs’ secret love

Huge credit to Phil for blogging this.  Just in case you don’t subscribe to his RSS and you haven’t saw these, thought I would post it again here.

Bill Gates’ and Steve Jobs’ secret love

These are from a new Sketch show here in the UK called Ruddy Hell! It’s Harry and Paul.

http://www.youtube.com/watch?v=WrhmWkRfyAI

http://www.youtube.com/watch?v=Kwy4R8DfOT4

Enjoy.

Phil.”

Very cool.

Silverlight Samples on Orcas VPC / Windows 2003

After downloading and installing all the new bits onto my Orcas VPC, first thing I did was create a new Hello World Silverlight application and set the Canvas to Red.  Nothing appeared under intellisense like I was expecting, I’ll blog about this later, so I hit F5 and nothing came up.

I then loaded a sample and the same thing happened.

After a moment or two, I realised that Windows 2003 has it’s IE security settings set to high, blocking most things happening – which definitely blocks Silverlight from executing either locally or remotely.

Simple fix is to change the security setting in IE (Tools > Options> Security) to ‘Default Level’ which is Medium.  You should then still have a safe browsing experience, together with Silverlight being able to execute.

Technorati tags:

Silverlight – What do you need?

With the announcement at Mix their has been a lot of downloads made available and if you haven’t been following it might be a little bit confusing so this is the rundown on what you need to use and develop for Silverlight.

The main thing to remember is there are two versions now.  One is Silverlight 1.0 Beta 1 which was previously WPF/E.  This is the runtime for Mac and Windows and uses javascript behind the scene as its programming model and has a Go-Live license, so you can use it in production today.  The second release is Silverlight 1.1 Alpha. This version allows applications to be created using .Net, again available for Mac and Windows.  A feature matrix can be found here – http://silverlight.net/GetStarted/overview.aspx

Runtimes download

Microsoft Silverlight 1.0 Beta – for Mac or for Windows

Microsoft Silverlight 1.1 Alpha – for Mac or for Windows

That will get you up and running, with the ability to view Silverlight powered sites.

But lets focus on the developer tools.

Silverlight is designed to work with Orcas, as shown during the keynote. If you already have Beta 1 VPC, you will need to download the addon – Microsoft Silverlight Tools Alpha for Visual Studio codename Orcas Beta 1 (VS_SilverlightTools_Alpha_Setup.exe).  This will install the templates and other goodies – note, you need 1.1 Alpha installed.

For the designer, Expression Blend 2 May Preview was announced! Allowing you to create Silverlight applications directly within Blend.  Note, Expression Studio is now shipping.  I expect this works with Orcas, but I haven’t had chance to try it yet.

So that’s not it,  there is also the SDK for each version of the runtime.

Silverlight1.0SDK.zip contains Quickstarts, Samples, Documentation and Beta tools for Visual Studio 2005 and some js files which look to be the runtime detection for use on your sites.  Samples looks to be the same as “WPF/E”, just updated.

Silverlight1.1SDK.zip contains Quickstarts, docs, JS, but includes some of the samples online with sourcecode and some UI controls to get you started.  Looks very interesting.

Finally there is Silverlight Streaming over @ http://silverlight.live.com.  This is great to encourage uptake of Silverlight.  4Gb free space and free bandwidth for all your videos.  Did I mention its free?  Well almost free – “Unlimited streaming will also be available for free with advertising, or with payment of a nominal fee for the service for use without advertising”

Hope this helps you find your way to getting started.

Wish I had submitted my Silverlight session for DDD5 now 🙁  Maybe NxtGenUG will allow me to do one…

In summary:

Runtimes (1.0 + 1.1)

Orcas + Addin

Blend 2

SDK (1.0 + 1.1)

More information @ http://silverlight.net/GetStarted/

Technorati tags: ,

LINQ to SQL Pluralisation

Tonight I have been looking into pluralisation (pluralization) with regard to Linq to SQL and how it handles different table names.  As some of you might be aware, there are two ways of creating the mapping between database and objects, one is using the Linq to SQL designer built into Orcas, the other being a command line tool called SQLMetal.  The Linq to SQL designer automatically pluralises the table names where as with SQLMetal you have to add the command line argument ‘/pluralize’.

With most nouns, it simple involves adding a ‘s’ onto the end of the word.  So Order becomes Orders.  Then there are some require ‘es’ such as gas become gases.  The other types are irregular plurals, which are a bit more complicated, for example person becomes people and sheep stays as sheep.

In the DataContext Orders is a property on the DataContext which calls this.GetTable(); to return the table.

To start with, I created the DataContext using the designer.  The designer always displays the name as a singular as when designing you are only working with a single instance of the type. In the .designer.cs class, the generated C# code is stored and this is where you can see the various properties which have been created and see how the table has been pluralised. 

When dragging on simple table names such as Categories and Country it can understand the relationship between plural and single, for example Category and Categories and create the objects accordingly.  However, when it got onto more complicated types such as Gas or People, it wouldn’t pluralise correctly and create Peoples while Gas would become Ga.  SQLMetal would do the same.

One interesting point is that if you create your DataContext using SQLMetal and you have two tables, Category and Categories in the same database, then it will create Categories and Categories2, where as the designer will create Categories and Category1s. Going to be interesting to see how the product team handles this situation.

It is a shame that the two do not produce the same result, this might be due to the way the designer creates the code as the tables are added onto the design surface whereas sqlmetal does a batch process; hopefully in the final release they will always produce the same result.

Also at the moment there is no way to refresh the diagram if the underlying table changes within Orcas.  At the moment you have to delete the object and drag it on again.  Not great if you have created custom properties. 

All this said; it is only beta 1.

Technorati tags:

DDD5 Voting Begins

Just a quick note that voting for DDD5 has begun. 

Please cast your votes @ http://www.developerday.co.uk/ddd/votesessions.asp

“You are allowed to change your choices up until the voting ends, which will be around 19th May.
Note: Final selection and scheduling of sessions will be based on popularilty and availability. Grok talks will be decided separately”

Two sessions which sound really interesting are:

F#: Functional Programming on .Net Framework

and Dynamic Languages and .NET

But every session sounds great!

Technorati tags: ,

Graduate Test Engineer @ Red Gate Software

I’ve known about this for a while now and finally got around to writing a post.

I have accepted a job offer as a Graduate Test Engineer working at Red Gate Software in Cambridge.

“Since 1999, Red Gate Software has been developing ingeniously simple tools that simplify the business of working with SQL Server and .NET. Our tools, which include SQL Compare®, SQL Backup™ and ANTS Profiler™, have become industry standards for developers and DBAs worldwide. “

I’m really looking forward to starting, I feel I will be able to gain a lot of experience and help them continue to create great software products. 

 

Final Year Project Completed!!

Today I completed and handed in my final year project. It’s been a year of hard work, hopefully it will be worth it and I will achieve a good mark (ie First).  Need to give a demo on the project sometime in May, then its onto my three exams. 

Not long left at University now…

Ideas for a Final Year Project, or just for fun…

As some of you will know, I am currently trying to complete my final year project on web application security, then I thought that some of you might be wondering what to do next year for your project – or looking for something to do on the weekend.  So below is a list of some of the ideas I have had which could be really good projects.

Robots / NXT
This is my next thing.  Had a NXT since my birthday, however with the Imagine Cup and Uni I haven’t had time to sit down and play.  If you haven’t heard of the NXT, its from Lego Mindstorms, it comes with bluetooth, senors, motors, and other bits of kit to help you build the robot.  The main part is a ‘brick’ which everything plugs into,  this is what can be programmed using Lego’s own application, Java or .Net.  The NXT is even compatible with the new Robotics Studio and with various books being released over the next few months could make for a great project.
More information at: http://mindstorms.lego.com/

XNA
If you interested in games development, then XNA is definitely the way to go.  XNA allows you to use the .Net framework to create great looking applications on Windows and XBox 360 platforms. It has been out for a while now so lots of help available online. Games development is out of my scope, but if its your thing then I’m sure you could make something really cool using it.
More information at: http://msdn2.microsoft.com/en-us/xna/default.aspx

Mobile phones
Next big platform?  Mobile phone applications are still not reaching their full potential, its a fun platform to develop on and it really needs a killer app.  The project doesn’t have to focus solely on the mobile application, maybe it could communication with other platforms such as Windows Home Server…

Windows Home Server and Home Automation
Windows Home Server is on its way and could be used for home automation.  Your project could focus on integrating everything which as lights, alarms, door locks, phones with a great UI. Problem is you have to deal with hardware, but as long as you have the hardware before you start its ok.  NEVER rely on unreleased or hard to obtain hardware as if it never arrives, you in trouble… unless you use Mock Objects but still.  Make sure you can get access to it.

VoIP/Collaboration
Still yet to reach its full potential, lots could be done around this…

 

http://blogs.msdn.com/coding4fun/  has lots of different projects which you could find useful to gain ideas from.

Technologies to look at and keep in mind when thinking about your ideas include:
WPF WCF WF / .Net Framework 3.0
Windows Mobile 6
Linq / .Net Framework 3.5
Virtual Earth
Ajax

 

But most of all, keep it fun, make sure your really interested in the topic area as its going to take up a large amount of your time.  Also, make sure you can actually do it,  don’t attempt to create Gears of War II for your project but at the same time don’t sell yourself short by only attempting to create a ASP.net application reading data from a database.

One of the points I was told, last week, was reader/marker of the project should learn something from the work you have completed.  Basically, don’t re-invent the wheel for the 100th time.

These where just some initial ideas, personally, I wish I had done my project using the NXT and if not that then Mobile Phones.  If you have any questions or other ideas, then feel free to post a comment.

 

MbUnit DataFixture – Data Driven Unit Testing

After my blog on MbUnit’s RowTest feature, a commenter mentioned:

“Wouldn’t you think it is better to move such data into an XML file. Keeping test data separated from test logic? You can also enable sharing of data across tests”

Well, yes that would be ideal and MbUnit already has the support for this feature via the DataFixture attribute.

The DataFixtureAttribute together with XmlDataProvider and ForEachTest allows you to store your test data in a external XML file and for each XML Node, execute a test with access to the data.

Again, I am testing my simple Add method.  However, instead of using RowTest to store the data for each test, I have moved the tests into their own XML file, called DataFixtureSample.xml which contains:


   
       
       
       
   

These are my three tests, I could include additional data in the XML Node however I have left it as just the test data.  The element names can be anything and are set out within your own test code.

The code for my test fixture is below.

[MbUnit.Framework.DataFixture]
[XmlDataProvider(@”E:My DocumentsVisual Studio 2005ProjectsMbUnitSamplesMbUnitRowTestDataFixtureSample.xml”,
“DataFixture/Test”)]
public class DataFixtureSample
{
    [ForEachTest(“Data”)] //Gotcha – Don’t include a slash!! “/Data” causes it not to display in UI
    public void TestAddMethodUsingXML(XmlNode node)
    {
        int test = MyMethods.Add(Convert.ToInt32(node.Attributes[“a”].InnerText), Convert.ToInt32(node.Attributes[“b”].InnerText));
        Assert.AreEqual(test, Convert.ToInt32(node.Attributes[“expected”].InnerText));
    }

}

The class needs to be decorated with the DataFixture attribute.  XmlDataProvider then takes in the full path to the xml test data, and the XPath for how the framework can find each test data node.

My tests are then decorated with the ForEachTest attribute with a parameter of the XML Node name. A small gotcha here – Don’t include a slash “/Data” causes it not to display in UI. 

My test accepts a standard XmlNode which will refer to the XmlNode within the test data.  Each node in the xml file is tested separately in their own test.

From within my test, I can access the XmlNode normally.  In this case, I am getting the InnerText and casting it to a Int32 so it can be used in my add method.

However, MbUnit allows us to tidy this code up for us by allowing each XmlNode to be strongly typed to an object. In the code I have created a class for the Data node which relates to the Xml.

[XmlRoot(“Data”)]
public class Data
{
    public Data()
    { }

    [XmlAttribute(“a”)]
    public int a;

    [XmlAttribute(“b”)]
    public int b;

    [XmlAttribute(“expected”)]
    public int expected;

    public override string ToString()
    {
        return String.Format(“{0} + {1} = {2}”, a, b, expected);
    }

}

I then change the attribute and parameter on the test method to be:

[ForEachTest(“Data”, DataType = typeof(Data))]
public void ForEachTestWithSerialization(Data data)

Now, each XmlNode is just an object in my test so I can simple write data.expected to get the Int32 value from the Xml Node using serialisation.  Great feature!!!!

We can then take the code to the next level by removing the need to hardcore the path to the Xml test file.

By changing XmlDataProvider for ResourceXmlDataProvider and setting the Xml Test File as a Embedded Resource in our build we can have the code like below:

//Make sure you set the xml file as Build Action : Embedded Resource
[ResourceXmlDataProvider(typeof(DataFixtureSampleResource), “MbUnitSamples.DataFixtureSample.xml”,   //’MbUnitSamples.’ is my project name.
“DataFixture/Test”)]

This makes the code a lot more flexible when accessing it from different machines, such as developers and build, as the file doesn’t always have to be in the same place.

This is a set of great features and allows you to separate your test data from your test code, together with the serialisation it allows us to maintain readable tests.

 

If you interested in any other feature, or want to know more then please get in touch.

Code/Sources/More Information:

http://blog.benhall.me.uk/code/mbunit/DataFixtureSample.xml

http://blog.benhall.me.uk/code/mbunit/DataFixture.cs.txt

http://www.mbunit.com

http://weblogs.asp.net/astopford/articles/257001.aspx

http://www.mertner.com/confluence/display/MbUnit/DataFixture