Posts
288
Comments
25
Trackbacks
207
Sunday, April 20, 2008
Phil is mean
I just want everyone to know that Phil smells.
posted @ Sunday, April 20, 2008 7:01 PM | Feedback (2)
Tuesday, April 15, 2008
DDD Ireland

Go Register Now. Go on, you know you want to. Even those of you in the UK could do with an weekend in Galway; a tech day on Saturday and the beautiful West coast on Sunday. A ton of really good talks, including Phil making fun of my code. That's not to be missed.

posted @ Tuesday, April 15, 2008 7:21 PM | Feedback (0)
Sunday, March 30, 2008
Dynamically Selecting Theme or Master Page

I've been linking to this for some time in answer to questions from the forums, but thought it was about time to put up a blog entry so they'd be more discoverable. The master pages and themes forum often gets questions about how to dynamically change the Theme of Master Page, perhaps based upon user criteria. So I created a web site that does both, using the Profile object to store a user selectable Theme and Master Page.

Feel free to download them. There are two versions, one in VB and one in C#.

posted @ Sunday, March 30, 2008 5:26 PM | Feedback (1)
Thursday, March 20, 2008
I Hate Banks

Banks are quite possibly the least customer oriented organisations, not matter what their advertising tells you. I hate the whole money transfer process that takes 3 days, but it's even worse today. I've just tried to transfer some money from my company account and the online system kept telling me "please pick a valid date" or "please pick a valid working day". I've just missed the deadline for today's transfer, because obviously no one wants to transfer money after 4pm, but I now find that the standard transfer won't work until Tuesday, because it's Easter. That's right, a fully automated banking system, with online access, can't work because staff aren't available. No matter that I have funds or it's a payment I've made before, it can't be done for another four days; and then it'll take three days to actually transfer. Sigh.

posted @ Thursday, March 20, 2008 4:10 PM | Feedback (0)
Thursday, March 13, 2008
DDD Heads to Foreign Climes

Well, Ireland, but for us Brits that's foreign enough. On Saturday 3rd May we'll be in Galway for DDD Ireland (http://www.dddireland.com/), which is a free one-day code-camp. It's on a Saturday, so you don't even need to take a day off work. In the UK these things get filled very quickly so go ahead and register now. Go on, do it now. I can wait....

Done? Good.

There is a good list of talks. I'm looking forward to Phil's, titled "ASP.NET Learn from my mistakes (or else)". As someone who works with Phil I'm worried he's actually just using my code to highlight the bad things; I wouldn't wish my code on anyone. Shudder. Mind you, I will be showing some of my code as I've a talk on ASP.NET and Silverlight.

The day ends with Swaggily Fortunes, the perfect opportunity to have some fun and win some free swag. No doubt Guinness will follow that.

posted @ Thursday, March 13, 2008 12:21 PM | Feedback (0)
Monday, March 10, 2008
Post MIX Thoughts

Having arrived home from Mix with a man-cold, I find myself unable to do much beyond staying awake and coughing. I fear TB is just around the corner.

My view of Mix is somewhat, err, mixed. On one hand the event itself was excellent, with some great sessions and a wonderful vibe. But, and it is a small but, I was under whelmed in some areas; this possibly has much to do with my insider knowledge, but I was expecting some wildly amazing new announcements, or at least announcements of amazing new things. Scott's posts about Silverlight 2.0 took the excitement away, but he was sensible in posting them, allowing everyone to get started with 2.0 as soon as possible; and I'll be doing the same, this afternoon, while watching some of the sessions I missed. The demos showed though, were full of inspiration and I've come away with some ideas for a Silverlight project I'll be starting later this year.

It was interesting seeing Scott do the 'manager on stage introducing people' thing in the keynote, rather than coding demos. Anyone not a developer could easily get the impression he was just a corporate stooge introducing partners, but of course those in the know (aka the entire developer community) understand the truth; deeply technical, deeply committed and still finds time to write all his own blog posts. His juggling sucks though and I hope he never takes it up; it's nice to know there is one area where I'm way better than him. Sadly the panel reviewing user submitted videos in the open space area disagreed and the video of Andrew Duthie and I juggling won't be uploaded as it wasn't 'relevant enough'; we thought a title of 'tips for Scott Guthrie' would get it in, but alas. Mind you, I mentioned it to Scott and he said he'd try and work something out.

Another mixed feeling was with IE8. I am glad they've gone to standards mode by default, but I wasn't that impressed by the other additions they've done. Maybe I'll come to like them in time, but just giving me full standards compliance is enough and for that they deserve an enormous amount of credit. I had drinks with some of them on Friday afternoon and they are an excellent bunch.

So, what didn't I do? Well, I didn't attend the main party and instead headed off to the Stratosphere with Phil and Ryan to be scared and scream like a girl (at least, Phil & I did; Ryan was totally cool about the rides). We then headed down to New York New York for a steak at Gallagher's, which was one of the best I've ever had. In all the years I've been travelling to Vegas I can't believe I've never eaten there before. I also skipped a couple of sessions to play with the Surface (totally cool by the way), network, catch up with people I hadn't seen in a while, or even in years in the case of Molly. We first met in Vegas almost 10 years ago and haven't seen each other since, but seemed to just carry one from where we left off; both the leaving off and carrying on were in bars, so that seemed oddly appropriate. We're hoping to get her over to the UK for some talks later in the year.

For those who couldn't attend, you can watch or download all of the sessions and I encourage you to do so. Watch them in your lunch break, put them on your iPod or Zune, but watch them; you'll either learn something or they'll make you think, neither of which are bad things. Would I go again? Definitely.

posted @ Monday, March 10, 2008 2:15 PM | Feedback (0)
Monday, March 03, 2008
The End of an Era

So Alex has broken the news; he's taken the blue pill. Alex has been working for the Patterns and Practices group at Microsoft on contract for some time, writing documentation for products such as Enterprise Library and the application blocks. They finally saw sense and offered him a full time position, which he's accepted; my glowing reference obviously didn't put them off.

It's not like we're going to stop talking - our long rambling chats on the phone will no doubt continue - but I'll certainly miss working closely with Alex; not that we've done a huge amount of that recently, we haven't written a book for about 18 months or so, if not longer, but it still felt as though we were working together. The Dave and Al site will continue and may even get rewritten; now is a good time to bring it up to date.

Now all I need to do is a find a company stupid enough willing to pay me a decent salary and let me work from home. I've been working for myself for over ten years and while the freedom and diversity is great, it might be nice to have a guaranteed salary again. I could buy things. Like door knobs. And carpets. What luxury.

posted @ Monday, March 03, 2008 9:22 AM | Feedback (4)
Saturday, March 01, 2008
Conference Time

Next week I'm off to Mix, which I'm really looking forward to. Last year I was in Ireland running a training course, so sat in the bar in the evenings, streaming the sessions while nursing a Guinness or two. Things I'm really looking forward to? Silverlight 2.0 and IE8.

Midway through April I'm heading to ASP.NET Connections. Not quite as big as the fall event, but still with several thousand attendees, over a huge number of tracks; it's not just ASP.NET, but covers SQL Server, Exchange, Office and much, much more. It's the premier non-Microsoft conference and well worth attending if you can.

200x200_ASP_BeThere

posted @ Saturday, March 01, 2008 11:44 AM | Feedback (0)
Wednesday, February 27, 2008
SQL Server 2008 Spatial Bits

This morning I installed the latest SQL Server 2008 beta on my laptop, just to have a quick look at some of the spatial support. One of the sites I work on has a lot of GPS data, growing all of the time, and performance is something we are continuously working on. So, on an underpowered laptop, with slow discs, I did the following:

  1. Created a new column (Location) of type geography, alongside the existing Longitude and Latitude (both float) columns.
  2. Update the new Location column, creating a new Point object from the existing coordinates
  3. Ran queries to compare our existing distance between points function with the STDistance method of the geography type.

The results were interesting. Over a rowset of 372471 rows:

  Rows returned Time
Existing code, custom function 205 28 seconds
STDistance,
no spatial index
204 1 minute
STDistance,
spatial index
204 1 second

Really interesting. STDistance is twice as slow as our custom function without the index, but way faster once the spatial index is available. There are many other spatial methods that are going to open up huge possibilities for our application as well as improving performance. I can't wait to have more of a play.

posted @ Wednesday, February 27, 2008 12:06 PM | Feedback (0)
Monday, February 25, 2008
More Row Number Magic

Having posted last night about row numbers and ranking, I realised in the shower this morning that there's actually an easy way to get the first and last rows per group, just by using ROW_NUMBER. The trick is to PARTITION, meaning that the row number is reset per partition. So I could do:

SELECT  Employee,  TransactionTime,
  ROW_NUMBER() OVER (PARTITION BY Employee, dbo.DateOnly(TransactionTime) ORDER BY  TransactionTime) AS Row1,   ROW_NUMBER() OVER (PARTITION BY Employee, dbo.DateOnly(TransactionTime) ORDER BY  TransactionTime DESC) AS Row2
FROM ActualData

The result set is:

Employee TransactionTime Row1 Row2
Dave 01 Jan 08 09:00 1 4
Dave 01 Jan 08 13:00 2 3
Dave 01 Jan 08 14:00 3 2
Dave 01 Jan 08 18:00 4 1
Dave 02 Jan 08 09:00 1 2
Dave 02 Jan 08 17:30 2 1
Alex 01 Jan 08 09:00 1 2
Alex 01 Jan 08 17:30 2 1

So now the first row per group is where Row1 = 1 and the last row per group is where Row2 = 1. Easy.

posted @ Monday, February 25, 2008 9:10 AM | Feedback (0)