AJAX "Get Started" videos

For anyone trying to get started with AJAX and the new AJAX control toolkit here are a couple of short videos that you could watch while sipping on your coffee :)

ASP.NET AJAX Extensions: Installation and Setup

ASP.NET AJAX Control Toolkit: Installation and getting started

You may also want to bookmark http://ajax.asp.net.

Unit testing with CollectionAssert

Anyone using the unit testing framework in VSTS has surely become familiar with the Assert class. The Assert class has tonnes of methods to compare results but usually I find they are only good for scalar values and/or individual objects. When we start dealing with collections then one has to write extra code that usually entails looping through the collection and comparing results as you go. And let's face it, we all deal with arrays and collections on a regular basis.

Enter CollectionAssert.

CollectionAssert enables you to perform typical tests on arrays and collections with so much ease that unit testing fuctionality involving these data structures becomes so much more ... fun and productive. E.g.

'''<summary>

'''A test for CollectionAssert

'''</summary>

<TestMethod()> _

Public Sub CollectionAssertTest()

Dim array() As Integer = {1, 2, 3, 6, 6, 3, 6, 11}

Dim expected() As Integer = array

CollectionAssert.AreEqual(expected, array, "This could not have happened.") ' Pass

' CollectionAssert.AreNotEqual(expected, array) ' Fail

Dim MyCollection As New Collection()

For index As Integer = 1 To 10

MyCollection.Add("Value" & 1)

Next

CollectionAssert.AllItemsAreNotNull(MyCollection) ' Pass

CollectionAssert.AllItemsAreUnique(MyCollection) ' Pass

End Sub

 

 

Parkour

One of my good friends has been telling me to go for this movie called “Banlieu 13” aka “District B13”.

http://www.rottentomatoes.com/m/10005823-district_b13/

Apparently it has some some amazing action scenes that are based on a sport/art form called Parkour. Parkour was founded by David Belle who also stars in the movie. I just saw a video of what this sport is about and I gotta say its amazing how strong and fast the human body can get if conditioned right. Here's the video.

http://video.google.com/videoplay?docid=1996675427048738448

I know what movie I am watching next.

 

 

Try Ruby! ... literally (in your browser)

Got back a while ago from John Lam's presentation on “The Future of Programming Languages”. I have to say that it was really good and thought provoking. One of the cool things he mentioned was to try out Ruby in 15 minutes and you could do so in the comfort of your own browser. Goto http://tryruby.hobix.com/, its fun.

 

BSOD

So I got BSOD for the 1st time on Vista today :(. It happened while I was in the middle of installing the AVG anti-virus from Grisoft. It's free for personal use and has been working well on XP for me (not that I've encountered any viruses). It's got nice updating functionality and the email scanner is not a pain either. There is a new version out so I will try installing that with my fingers crossed. I don't think it will support Vista in any case but hopefully Vista will be a little more accomodating this time.

I have installed Office Pro 2003, VS 2005 and SQL Express 2005 without much problems so far (surprise surprise) but my Logitech QuickCam drivers/utility was not successful. Skype v2.0.0.103 and Firefox v1.5.0.2 installed nicely too ... yea yea.

 

Hello Vista

I finally installed Vista Beta 2 (Feb CTP, Build 5308) last night. The installation went smooth and seems like the basic drivers (sound, video, printer) were taken care of. My Dell Flat Panel is still being treated as a generic PnP monitor which wasn't the case with XP and I don't recall installing drivers for it.

One thing that did get my attention was the sheer amount of disk space used. I had installed Beta 1 a while back and I believe it took some where around 3-4 Gigs. But this one uses up round about 7 Gigs, yes 7. The Windows folder alone takes 5.97 Gigs (on disk). Thanks to Vista, I was reassured that HDDs really are cheap.

The reason I installed it on my machine was to start playing with some of the WinFX technologies. I attended a Vista presentation late last year, it was known as Longhorn then. I have to admit I wasn't very impressed from a regular user's point of view but hopefully Beta 2 will change that view. The windows explorer interface has changed and it took me some getting used to. The traditional menus (File, Edit etc) are not visible by default but you can choose to view classic menus if you please. Another thing was my home network detection. After configuring my workgroup I still wasn't able to get on the network. It turns out that the default firewall setting was blocking me to do so and after enabling it from there I was able to access other machines.

One thing I was glad about was that the Windows shortcuts still work as expected.

Goto C#

As I was going through the various control flow statements in C# I came across the goto statement that works the same way as VB6 did. Here is a sample.

using System;

public class GotoTest

{
    static void Main()
    {

        int i;

        for (i = 0; i < 10; i++)
            if (i == 5)
                goto Reached5;

        Reached5:
            Console.WriteLine("i = {0}",i);
    }
}

It can also be used to transfer control to a specific switch-case label but knowing that Goto has the potential to create spaghetti code I wonder why the C# team allowed it. It was understandable in VB .NET due to backward compatibility but developers are discouraged to use it for new development. The C# documentation states:

The goto statement is also useful to get out of deeply nested loops.

Hmm... do we not practice what we preach?

Unlocked

This blog is dedicated to a handy utility I have been using for quite sometime called the Unlocker. Because of this sweet utility I no longer get frustrated when hidden processes lock files that I want to delete or update. Yes, no more restarts for stubborn processes. What's neat is that it installs as a shell extension so all you have to do is right click on the file and you have complete control over what you want to do with it - Kill the process or 'magically' unlock it :)

And oh yea, its freeware too ... Check it out http://www.snapfiles.com/reviews/Unlocker/Unlocker.html

 

Enterprise Library for .NET 2.0 released

The much awaited release targeting .NET 2.0 is here.

http://msdn.microsoft.com/library/?url=/library/en-us/dnpag2/html/EntLib2.asp

If you haven't checked out the CTP ver yet then you will be interested to know that the Configuration Application block is no more. Configuration is now based on the .NET Framework System.Configuration namespace. The new version also includes a new subsystem named ObjectBuilder that provides a flexible way to create and dispose off objects although we will not be directly interfacing with it for the normal functionality provided by Enterprise Library.

For those moving over from the 1.1 release should check out the release docs for useful info on migration. Have fun!