Ian Blackburn

January 2004 Entries

Microsoft Content Management Server 2002 training

If you are looking for training on MCMS 2002, then we have put a new outline up on the bbits site: http://www.bbits.co.uk/Services/training/default.aspx?mcms

Unit Testing - great article

Check out this article on Unit Testing - more than others I have seen (or even the docs for nunit!) this goes into some real depth and provides some good examples.

It also introduced me to VSNUnit which I wasn't aware of before, I previously just used the plain old NUnit, but I am going to give this a go.

Google labs - take a look

Following on from my blog on Search Engine Fun, I saw this blog pointing to this article from ResearchBuzz, which in turn links to http://labs.google.com/ - which, according to Google "showcases a few of our favorite ideas that aren't quite ready for prime time." - Some Interesting stuff there, it's worth a look.

 

Are you Mort, Elvis or Einstein?

Nikhil Kithari (development lead on ASP.NET team) had an interesting blog about developer persona's.  It seems that they break developers into three primary persona's, as he says:

  1. Mort, the opportunistic developer, likes to create quick-working solutions for immediate problems and focuses on productivity and learn as needed.
  2. Elvis, the pragmatic programmer, likes to create long-lasting solutions addressing the problem domain, and learn while working on the solution.
  3. Einstein, the paranoid programmer, likes to create the most efficient solution to a given problem, and typically learn in advance before working on the solution

It seems to me that this is more a state of mind at a particular time, than a persona as such.  I know I have been Mort, Elvis and Einstein at some time or other.  But it is interesting to see how this affects the development of server controls in Nikhil's case:

Mort would be a developer most comfortable and satisfied if the control could be used as-is and it just worked. Elvis would like to able to customise the control to get the desired behavior through properties and code, or be willing to wire up multiple controls together. Einstein would love to be able to deeply understand the control implementation, and want to be able to extend it to give it different behavior, or go so far as to re-implement it.

I was thinking of this from the perspective of the delegates on my asp.net courses.  It turns out that the most successful courses I deliver are aimed at Elvis.  I think courses aimed at Mort would be pointless (because they could probably work it out pretty quickly anyway, or just not bother), and Einstein would want a 1 to 1 customised course, with specific content targeted to his particular needs. 

And when I think back to courses I used to run on Visual Interdev, it explains why the Design Time Controls were never popular - they just didn't have the flexibility to satisfy Elvis, and you needed to be an Einstein to understand the implementation (for sure!).  Current asp.net controls certainly appeal much more to Elvis, in my opinion, but things like the DataGrid probably tend toward Einstein when you try and produce rich real world solutions with it.  Which is probably why there is a large third party market for them.

If this jargon takes off, then I may start tagging my courses with a persona, so my delegates can easily identify the level it is aimed at...

Want to buy a TVR?

Details here: www.bbits.co.uk/tvr

You know you want to...

RX-8 vs TVR

For the last 3 years or so I've been having a blast driving a TVR Chimaera - 4 litres of raw power, 260bhp, 0-60mph in 4.7 seconds, no namby-pamby traction control or the like.  It's a bit of a beast!  But now it's time for a change.  I wanted a little more comfort, and two extra seats would be handy now we have 3 children, it means my wife and I don't have to take out the MPV when we just have our baby (while the other two are at school).  So I have ordered an RX-8 - no pillars (something called suicide doors instead - I hope they're safe), no pistons (a rotaty engine called Renesis instead) - I like the techy aspect of this car - seems to fit neatly, and it's still powerfull enough (to be honest you can't appreciate the TVR power on the road, you need a track)  I'll let you know how I get on...

Two great web sites for TVR and Mazda:

www.pistonheads.com - great info on TVR and others and very active forums.

www.rx8ownersclub.co.uk - skip the naff home page, and go straight to the forums: http://www.rx8ownersclub.co.uk/forum/

Problems getting Wrox book code example?

I recently recieved an email from a reader of one of my Wrox books, saying that they could not find the code download.  As you may or may not be aware, Wrox went into liquidation last year, and the rights to the books have been sold to various publishers, so the situation seems a little blurred regarding where people will get code downloads. 

If you are experiencing similar problems, please let me know - if there are enough requests then I may be able to invest some time in make the downloads easier to get.

Looking forward to hearing from you.

Neat summary of standard validation controls

If you use the standard validation controls at all, it's worth having a scan through this MSDN article.  It covers them all in an easy to read fashion, and has a few tips that I had missed before (for example using an Image for the error message).

Validating ASP.NET Server Controls (http://msdn.microsoft.com/asp.net/using/building/web/default.aspx?pull=/library/en-us/dnaspp/html/ASPNet-ValidateASPNetServerControls.asp)

Simple way to control your TITLE and META tags in ASP.Net

Recently, I was looking for a simple way to control the TITLE and META tags on aspx pages. I needed to use standard aspx pages as created by Visual Studio derived from the standard System.Web.UI.Page.  At first I tried changing the Title tag to a server HTML control, by adding

<Title id=PageTitle runat=server></Title>

But it seems that the VS IDE doesn't like this and it occasionally removed those attributes without asking, though I couldn't work out when.  So instead I decided to use a UserControl, with an asp:Literal control in it, and place it in the Head section of each page. instead of the title. 

First I created an XML file with the details of the tags for the pages in my site.  Here's an example:

<?xml version="1.0" encoding="utf-8" ?>
<
HtmlTags>
<Tags>
    
<FolderAndFile>DEFAULT</FolderAndFile>
    
<Title>.net training, consultancy and development</Title>
    
<Description>.net training, consultancy and development with bbits in the uk</Description>
   
<Keywords></Keywords>
</Tags>
<Tags>
<Tags>
    
<FolderAndFile>services/default.aspx</FolderAndFile>
    
<Title>.net services from bbits</Title>
    
<Description>training, consultancy and development services</Description>
    
<Keywords></Keywords>
</Tags>
</
HtmlTags>

Then I created a UserControl with a Literal control - the HTML in it just looks like this:

<asp:Literal id="Literal1" runat="server"></asp:Literal>

In the code behind in the control I added the following to the Page Load event of the Control

string folderAndFile = WebTier.Utils.GetFolderAndFileName(); //this is a call to a static util method I have that returns the folder and file name of the current page without the site name.
DataSet ds = new DataSet();
ds.ReadXml(Request.PhysicalApplicationPath + @"/data/HTMLTags.xml"); //my xml file is stored in the data folder off the root of my site.
DataView dv = new DataView(ds.Tables[0],"FolderAndFile='" + folderAndFile + "'","",DataViewRowState.CurrentRows);
string tags = @"<Title>{0}</Title><meta name=""Description"" value=""{1}""><meta name=""keywords"" value=""{2}"" >";
if (dv.Count ==0)
{
    dv.RowFilter = "FolderAndFile='DEFAULT'";
}
Literal1.Text = string.Format(tags,dv[0]["Title"],dv[0]["Description"],dv[0]["Keywords"]);

Then all I had to do for each page, was make sure it had a the UserControl in the Head section and that any existing Title tag was removed;  and put an entry for it in the xml file of course (though with no entry it will use the DEFAULT).  I went on to cache the dataset with the xml file in it to speed the access up a bit...

Works a treat!

Orange SmartPhone 2003 E200 in my hands.

I've been using this phone for over a month now and generally I am pretty happy with it.  In fact it has replaced my Pocket PC for a lot of stuff, like the diary, email, and mobile browsing.  Actually the browsing was a real suprise - it such a good experience now that there is a "Single Column" view for Pocket IE in 2003.  This means any site is viewable on the phone, without horizontal scrolling, and that's great.  Also having .net compact framework pre-installed is very encouraging.  I have had a little play with creating Smartphone apps in VS 2003, and it looks promising (if a little shaky in parts).  I've also used the camera much more than I anticipated...

The big downer on the phone is the battery life.  If I don't charge it every night then it is dead in the morning.  Some people over at http://smartphone.modaco.com/ believe this is to do with the sd card, but I have not been able to confirm this with my phone.  The other big issue on the boards is that sometime the call quality can be poor (with a buzzing).  Poor battery life and poor sound quality shouldn't really go to make a greate phone!  But in my situation I am often at a desk with the phone on the crade (which can also charge the phone over usb, so I can easily charge my phone from my laptop), or in the car with the car charge, so it hasn't really bothered me.  And I haven't really noticed the buzzing much lately.

However it's the OS that makes this phone so sweet - the great syncing with Active Sync, the great web browsing, and last but cetainly not least, the potential to write my owns .net apps.

Hosting Company's Christmas Cleanup

For the second year on the trot, my hosting company (www.interland.com) decided to perform some clean up of their servers just before xmas, and in doing so they killed my sites (nice xmas pressie Interland!).  Last year they took the server off-line completely and it took a week to get it back up, this year they somehow removed .net so that none of my asp.net sites worked.  After speaking to them, I was assured that my issue was "in the queue" but they had no idea how long it would take.  A week later after still nothing was done, I cancelled my account.  This from the "#1 provider of Web Hosting Services for small and medium-size businesses".  If you are considering hosting with them, then I hope you have better fortune than I!

However I have taken the opportunity to redesign the www.bbits.co.uk web site - and this will be live this week.  In the meantime you have this lovely blog to read.  Every cloud...

The Warbler.

 

Visual Studio.net Whidbey links

If you are looking for some info on the next version of Visual Studio (codenamed Whidbey), currently in alpha release check these out:

The alpha release is only currently available to MSDN subscribers and those who visited the PDC

Search Engine Fun

Alright, Google do seem to be taking over the world and that's not a good thing. Probably.  But have you tried the neat tricks that they provide in the search box?  For example you can prefix your search with define: then a word and it gets the dictionary definitions for you. Try define: Blackburnian Warbler for example.  It can also do conversions and calcuations for you.  Try typing something like 8 feet in metres or 6 * 12 + 39.  That's pretty clever.  Take a look at http://www.google.co.uk/help/features.html for a full list including things like who links to your site, travel conditons (US only I'm afraid), and site specific searches.  Apparently if you search for www by itself it lists the most popular sites in their database - guess who's top?  Here's another: Search for miserable failure and see what you get.

Just to even it up a bit, I've recently started using www.AllTheWeb.com - the results seem pretty accurate, and it's certainly fast.  I don't know about you but I think I have probably been a bit hooked on Google for the past year, and almost forgot to try others search engines when google did not cut the mustard.  I vow now to use the following more frequently: http://www.gigablast.com, www.altavista.com, www.lycos.com - those for starters at least...if you have a favourite, let the Warbler know!

I've also been doing some idle research on search engine optimisation.  After wading through all the usual junk, I came across a couple of pretty interesting ones.  The first www.goodkeywords.com is a free Windows download that lets you see the ranking of your phrases and keywords on various search engines, and a simliar more comprehensive service (though this one you have to pay for) is available at http://www.wordtracker.com/.  Both would prove valuable for choosing keywords to use on your site.  As for a general site, I thought http://www.rank-outsider.co.uk/ looked quite interesting, and has a good self-help section

The Warbler