Wednesday 23 July 2008

Velocity Samples

This week's UK MSDN Flash included a piece about Velocity and a link to http://code.msdn.microsoft.com/velocity, which has code samples. Downloading now, will report back later.

Slightly annoyed that I've seen no mention of these on the Velocity team blog!

Monday 21 July 2008

Browsers

In the past I've always been pretty unfazed by different browsers and I suppose I still am - IMHO far too many people see Firefox as the Second Coming. But I think I may be wavering...

I used Firefox a lot last week on my BizTalk course at DevelopMentor, and the installation of FireFox on the machines had a couple of really nice FF plug-ins that I hadn't come across before.
  • FasterFox - which shows you how long a page takes to download. This is really nice, the only thing I don't like is having to register with Mozilla before it would let me install it.
  • FoxClocks - which puts clocks for different time zones on the FireFox status bar.

And now I'm missing these features in IE :-(

And then...

I was sat at Starbucks at Liverpool St on Friday afternoon waiting to get a train back to East Anglia, and browsing on my N95. T-Mobile offered me 'Cool Applications' - how could I not follow the link! Which led to me installing Opera Mini on my phone. I had a little play with it, so far I'm not overly impressed (there's no pointer!) BUT this may be a case of me just being used to the Symbian web browser....

Friday 11 July 2008

Velocity: Struggling :-(

I've finally got to writing some code against Velocity (one of our servers at work has decided it's not going to talk to the domain controller any more so nobody can log onto it). And ... it's not working :-(
I'm pretty sure I'm doing the right things, I suspect it's a configuration issue. The exception I'm getting (having modified my code slightly to throw CacheExceptions rather than just Exceptions) is 'Could not connect to cache service'. I'm slightly gratified to see Christian Weyer gets the same problem - if someone like that gets it, what chance do I have! ;-)

For now, I've removed the extra instances so I'm back to a single host. I thought briefly that it was due to not having set up 'Everyone' to have read/write access but that didn't fix it. Worth remembering as a setup action though.

I'm going to review all my .config files to see if I've missed something - if I don't find anything then I guess it's for the Velocity team.

Thursday 10 July 2008

Pixel8ed Podcast

I listened to Craig Shoemakers' Pixel8ed podcast on debugging with John Robbins yesterday. This isn't a podcast I've come across before, I followed the link from John Robbins' blog. I generally liked it though I found some of the music under the speech a bit distracting.

I've used some of the attributes Craig talks about before - I'm a fan of DebuggerStepthrough for code like property getter/setters where I'm pretty sure they're bulletproof bits of code. I think it's worth noting that you can still set breakpoints in code with DebuggerStepthrough on it and your code will break there if you still need to debug it.

Haven't come across Tess Ferrandez' blog before but it looks like she may well deal with some hardcore ASP.NET debugging situations. I love her Yoda-like 'if it is broken, fix it you should'! Subscribed.

I saw John Robbins speak at DevWeek a few years ago - the man's a legend! I love the concept of a developer who used to be in Special Forces. And it reminds me that I must go back and read some more of his 'Debugging .NET 2.0 Applications'.

Tuesday 8 July 2008

Velocity: Regions

I did a bit more digging into Velocity last night. I still haven't written any code yet but I'm getting there!

I was poking around in the Object Browser at the System.Data.Caching namespace and I discovered that the context-sensitive help for each method is probably more helpful than the helpfile.

But more interesting than that, the help for Cache.Add(key As String, value As Object) suggests that if you call this particular overload, the item gets cached in the default region of the cache. Which raises all kinds of questions: if there is a region created by, well, default, which host is it tied to? Does the default region span hosts (in which case regions suddenly become a lot more appealing to me)? Can I use the default region everywhere?

Now I've got multiple instances, I can do a bit more experimentation with regions and see if they start to be a bit more useful, but I suspect my next course of action is to run ClientLibrary through Reflector and have a look at what Cache.Add actually does.

Creating Multiple Velocity Instances on a Single Machine

I now have three instances of Velocity running on my laptop, as per these instructions. I found it a little painful, though probably I wasn't reading the directions closely enough - it took me a while to get all the .config files set up right as I got confused between the cacheHostName (which is the name of the Windows service) and the hostName (which is the machine name). There may have been additional confusion involving the folder names...

Friday 4 July 2008

Velocity: Digging Deeper

I started looking properly at some Velocity bits and pieces this afternoon, including starting to write a little code against it. And I've already found one or two frustrations, or at least things that don't seem to work quite the way I want them to.

CacheFactory
You use the CacheFactory to create an instance of a Cache. So far, so good - I like the Factory pattern. What I'm not so keen on here is that the CacheFactory's methods all have to be called on an instance e.g. instead of:
Dim cache As Cache
cache = CacheFactory.GetCache("MyCache")
...
you have to write:
Dim factory As CacheFactory
Dim cache As Cache

factory = New CacheFactory
cache = factory.GetCache("MyCache")
[EDIT: It came back to me at the weekend that these are called static methods, or Shared in the one true language of VB]
It's a small annoyance, but I'm a small person sometimes.

Regions
I'm going to come right out and say it: I don't get Regions. I'm completely sold on the concept of a single cross-machine cache - it solves the major issue with the ASP.NET Cache (which runs per-machine). So why then require Regions to live on a single machine? It's like they're saying "here, do this to be fault-tolerant, but to get the most out of it you have to do things that aren't fault tolerant".
It's doubly frustrating when you discover that if you want to add an item to a Velocity cache with an expiry time, you have to add it to a Region. The Cache on its' own just allows you to add an item that's there forever.

CacheDependencies
I really think dependencies are the biggest missing element in the first CTP of Velocity. The SqlCacheDependency in .NET 2.0 was the biggest enabler for caching as it meant you could run multiple web servers and keep their caches in sync with database changes without much effort. You can't do this in CTP1.


I'm interested to see Barry has proposed a session on Velocity for DDD7. That's good 'cos it means I can pick his brain for suggestions to solve some of these things!

Blue Screen: SQL Server Management Studio vs Intellipoint 6.2

I've been randomly getting the Blue Screen of Death when using SQL Server Management Studio 2005, mostly when either scrolling across an open table or resizing a column. It did it again today and I'd had enough.

A bit of Googling suggests that the problem is between Management Studio and Intellipoint. I started hunting through Microsoft's support pages looking for someone to pin this on but it seems the SQL Server team are aware of this but said they aren't going to fix it (though this report is marked as Active at time of writing). Anyway I ended up on the Hardware Support pages where I discovered that I get two free support calls with my Wireless Presenter Mouse. So I've logged the problem with them but with the Intellipoint team, not the SQL Server team. Hopefully the Intellipoint team can either come up with a hotfix or alternatively make the SQL Server team come up with a hotfix. Either way I'm hoping we can get a permanent resolution to the problem.

Update: I've had a first contact from Microsoft. Didn't get to talk to them as I'd already left for the day but I'm hopeful this means they've accepted the issue!
Update 2: Looks like my contact at Microsoft is now trying to pass this off to the Windows team.

Thursday 3 July 2008

Andy Is An MVP!

Saw yesterday that Andy Westgarth has been made an MVP for IIS. Andy's done a lot of work in evangelising the new features in IIS7 for ASP.NET developers and it's great that Microsoft have rewarded him for it.