Messed up Shortcuts under Vista

Messed up Shortcuts under Vista

There are a couple of things that still puzzle me about Vista.  One of which continually frustrates me whenever I go to save something.  Instinctively I navigate to Documents (easily done via the Documents button in the left pane of the explorer window) then click on the My Pictures shortcut only to get a dialog popup and state:


[Window Title] – Location is not available
[Content]- C:UsersnrandolphDocumentsMy Pictures is not accessible. Access is denied.
[OK
]


Now I understand that they have re-routed a few of the old style folders (eg from “Documents and Settings” to “Users”) but how is the average user supposed to deal with that dialog!!!

Working with the Common Feeds with RikReader

Working with the Common Feeds with RikReader

Earlier this month Doug posted version 1.3 of RikReader a free WPF (.NET v3) application that hooks into the common feeds store (the same feed store IE7 uses).  I’ve been playing with the earlier versions of RikReader but was disappointed as it didn’t offer much over the IE7 view.  However the latest version is significantly better.  Similar to the New York Times reader there is a newspaper mode and unlike IE7 the tree on the left indicates how many unread items each node has. 


This said, here are some suggestions for improvements:



  • I like the way that IE7 highlights feeds that are unread in bold.  While I like the RikReader’s indication of the number of unread messages it is located at the end of the blog name.  In the usual position the splitter bar tends to hide this on most of my feeds.  Perhaps this number could go at the beginning of the feed instead of the end.

  • I like the newspaper mode that RikReader supports, except the articles are missing the date?

  • Navigating posts in newspaper mode leaves a little to be desired – using space to mark as read and move to the next article doesn’t reposition the article to the beginning of the page.  This is useful if the article goes over the page.

  • There needs to be an option (similar to IE7) that will automatically mark all items in a feed as read once the feed has been opened.  This is one of the most useful features of IE7 IMHO – I typically scan a lot of feeds without reading every last article so I don’t bother marking them all, I just let IE7 mark the entire feed as read as I navigate down the tree.

The other thing I would love to see someone build (perhaps someone has and I don’t know about it) is a service that will keep multiple computers in sync.  I have two machines that I read feeds on and I find it frustrating that the “read” status is not in-sync.

Occasionally Connected Applications get a new friend

Occasionally Connected Applications get a new friend

One of the topics that I’m particularly passionate about around building applications that work in both connected and disconnected mode.  I’ve had a bit of experience with this both at AutumnCare and now at Intilecta so I would like to think that I’ve encountered most of the issues that typically arise.  Typically the one that causes most headaches is how you go about synchronising data between the server and the client applications.  At AutumnCare we used webservices to pass serialized objects and changeset along the wire; at Intilecta we are using Merge replication to make our lives easier.  Now there is a new kid on the block in the form of the Microsoft Sync Services.  Although the first CTP of this has only just been released, Steve has been talking about this for quite some time.  In fact if you caught the Microsoft Developer Show late last year you will recall that we talked about what the future of occasionally connected applications might look like. 


If you are building Occasionally Connected applications (ie client applications for mobile devices, tablet pcs or UMPCs) then you should really check out the CTP which you can download here.  There is a forum and samples that you can also download.

Heat and computers don’t mix

Heat and computers don’t mix

Anyone who has been in Perth over the last week or so will understand where I’m coming from – for the Australia Day long weekend (ie last weekend) we had a run of reasonably hot days (say around 40 degrees).  Now as most of you will appreciate hot temperatures and computers don’t really go well together.  Unfortunately our house currently has two computers that run pretty much non-stop – we have an SBS server (thanks Wayne for the help in setting this up) and a Vista Media Center.  We also don’t have air conditioning!  Here are just a few of the things that went wrong over the weekend – some of them are computer related, others are just plain frustrating.


SBS – On Saturday the machine hung and needed to be forcibly rebooted.  Since then it seems to be doing silly things like randomly locking accounts.


Vista MCE – Yesterday a whole bunch of updates were downloaded and the machine decided that it was going to automatically reboot.  Now Media Center doesn’t seem to be functioning properly.


Car – Right before the long weekend my car decided that the ignition switch was going to break.  I had already ordered a new key barrel as the key was periodically getting stuck but when the switch went I threw in the towel.  Anyhow the car should be back today and my bank account a little lower.  Thank goodness to the friendly guy from the RAC who opened up the steering column and pulled out the ignition switch so that I could start the car with a screwdriver


Blog – My blog has been performing really badly so earlier this year I made the jump and upgraded the version of community server.  Unfortunately I realised later that of course not only was the database a SQL 2000 db there were also a whole bunch of inconsistencies introduced as part of my poor effort at upgrading.  I decided that I’d better recreate the database – which of course meant I’d loose all my existing posts.  Prior to doing this I used Sql Server Management Studio to do a data export (which was really quick I might add) to a local db.  After recreating the database I then used the import functionality to put all my content back into the new database.  This worked quite successfully until I realised that I was missing like half my posts.  Unfortunately what I didn’t realise (until late last night) was that the import didn’t maintain the correct relationships.  To cut a long story short I then spent a couple of hours sifting through the inner workings of community server working out how the tables relate.  A word of advice:  ALWAYS decide on a naming strategy that makes sense and then stick to it!!!  There seems to be too much going on with the db schema for community server and only half of it seems to make sense – this is a great pity as the product rocks.


Anyhow I’ve hopefully sorted these issues out and will soon be on the road to recovery.  Oh, the other thing was that I repaved my work laptop (Compaq nx8220) and installed Vista.  Vista installed without any issues, detecting and automatically installing correct drivers for everything (nice, really really nice job!!).  The machine is now humming and other than a few complains (like when is Microsoft going to fix Visual Studio and SSMS to work properly under Vista) I am one satisfied customer. 

Imagine Cup (Australia) 2007

Imagine Cup (Australia) 2007

I just noticed that in the latest Flash the Imagine Cup is getting a good rap.  In fact you can go through to the Australian Imagine Cup website which, unlike the full Imagine Cup site (well at least the last time I looked), has a feed!! (disclaimer: even on the Australian site the IE feed button still doesn’t glow – you have to click on the RSS icon on the page????). Click on the following “Blog Button” to access the news/events feed.  For more information on the Imagine Cup you should check out Bernard’s blog


Gaming for the Kiddies

Gaming for the Kiddies

I’ve often wondered how parents are supposed to teach kids about the proper use (if there is such a thing) of technology, especially when it is likely the kids are more knowledgable and learn quicker than they do.  Andrew Parsons, co-author of Professional Visual Studio 2005 (which you can still buy from Amazon here, here and here), runs a website “dedicated to helping parents and carers understand the vaue of technology”. Check it out at www.gameparents.com

Australian Electronic Program Guides for Vista Media Center

Australian Electronic Program Guides for Vista Media Center

While I was in NZ I purchased a standard dell machine (in actual fact it was one of the special offers from the Australian TechEd) and for a while I was running it as a TFS box for playing around with.  Last month when I returned to Perth I decided that it would be better served as a media center machine.  I had thought of this while I was in NZ but after purchasing an external TV Tuner and playing around with Vista Media Center on my laptop I decided that it would have to wait until I got back to Australia because none of the NZ Electronic Program Guides (EPG) seemed to play nice with Vista.

The box is now setup as a Vista Media Center machine and since Christmas I have been attempting to get an EPG to work properly.  I initially signed up for a trial of IceTV which seemed to work nicely to start with but would complain after about 24 hours that the country/region code was invalid and that it couldn’t refresh the guide data. Given I was going to have to pay for this I figured the least they could do was to get the product to work properly with Vista before I shell out the cash.

 Last night I trawled the ever useful Australian Media Center portal and tried Free*EPG.  These guys have done a great job of packaging, including an option to use ClickOnce (oh, did I mention it is a .NET v2 application?).  Unfortunately the installer isn’t quite enough to combat the “intelligence” built into Windows Vista.  Unlike XP Media Center the Vista version does a bit more in the background to allow Microsoft to dynamically change where the guide information is being sucked from.  The typical scenario would be something like this (for countries where Microsoft have organised the EPG): Within MCE you go to set up the guide, you specify the country that you are in, you agree to the licensing conditions, you provide your postcode and hey presto it gives you a list of EPG providers that you can select from – which you then use to link up with the channels that you have detected from the TV tuner.  In the background when you select the country that you are in MCE goes away and connects to the MS site that defines what the providers are for that region.  Under XP this would only happen when you configure the region.  Unfortunately under Vista this not only happens when you attempt to set up the guide, it also happens at frequent intervals whilst MCE is running – this allows MS to dynamically update the location of guide data without any downtime for citizen Bob (unfortunately for citizen Jan that lives in Oz this completely screws up other providers such as IceTV and FreeEPG).

Ok, so what did I need to do to get this all to work:

  • Signup at EpgStream
  • Download and install FreeEPG
  • Run Vista MCE and go to configure the guide
    • When you get to entering a postcode you need to rerun the installer for FreeEPG (selecting to just repair installation – this fixes the download location for the guide data)
  • Download and follow installation instructions for KeepKey – this makes sure that the download location for the guide data is not overwritten by Vista MCE

Some last words of wisdom:

  • Sign the Australian EPG Petition
  • Blog like crazy about the lack of EPG data for Australia, NZ (and other countries that don’t have it – perhaps MS may be able to use that as leverage against the TV companies that refuse to make this data available)
  • Did you realise that behind the scenes the EPG data is stored in a SQL CE data file????  This is interesting given that SQL Server Compact Edition has only just been unlocked to work on the desktop.  Unfortunately when asked whether we were “allowed” to add data straight into the database file we got a flat NO, THAT IS AGAINST THE EULA – I would like to know why the draconian measures, why couldn’t this be opened up with a decent API (not like the current SDK which gives you all but nothing in terms of useful functions around adding/editing EPG data).  Or, better still why can’t we write directly to the database file so that we can extende MCE with some really cool functionality……

SQL Server Compact Edition Goes Gold

SQL Server Compact Edition Goes Gold

Ok I must admit I’m a bit behind as of late.  I also seem to be making a number of disparaging comments on a number of products that I’ve found that just aren’t properly finished or just don’t work properly.  Anyhow in this post I want to reiterate the great news for all application developers – Microsoft have finally released SQL Server Compact Edition (previously SQL Server Everywhere, previously SQL Server Mobile Edition, previously SQL Server CE…).

Download here and readme here.

As can be expected there have been a number of people/teams who are already blogging about SQL Server CE.  To help you track them down, here is a brief list:

Why I wouldn’t use InstallShield

Why I wouldn’t use InstallShield

One of the tasks as we approach the finalisation of a product version is to of course make sure that it is appropriately packaged.  For the most part this has been done along the way to ensure we can easily deploy the application.  Unfortunately we have out grown the capabilities of Visual Studio 2005 so I have been reviewing other products such as InstallShield and Wise (would love to hear from anyone about their preferences in this area).  Today was InstallShield’s day to show how good/bad it was.  Everything installed fine, it was able to create quite a complex installer and “seemed” to uninstall correctly (which you would of course hope for given that’s what they do).

A couple of hours later I am on another task to look at the existing installation packages we have and all I’m getting from VS is ERROR: An error occurred while validating. HRESULT = ‘80040155’.  Initially I thought it was something I had done so I went through the project and made sure everything was correct.  Eventually I gave up and Googled it.  Thankfully this post pointed me here where there is a knowledgebase article about this issue.  Now hang on, they say that it has been resolved in “Developer 7.04 and above” – well I’m not sure what version I installed but I downloaded the evaluation software today, so I would hope that it is “above” and that it shouldn’t have this issue. 

Despite them having a great product, I just don’t think I can bring myself to purchase a product that is going to generate Installers that don’t uninstall properly!!! 

I’ve been renewed

I’ve been renewed

Last week I spent at work sitting in my parents’ house just out of Dunsborough, approx 3 hours South of Perth.  Despite not having an Internet connection I had one of the most productive weeks in a while.  This was probably the result of a number of contributing factors, but I think mainly the good food and wine (of which I’m sure we ate and drank too much).  The downside of working offline for a week is that I now have to go through the rather painful process of merging changes back into our source repository.  Most of this went smoothly but there have been a few hiccups where VS has decided certain files have been checked in, when in actual fact they haven’t.

The other thing I now have to do is to sift through a backlog of emails.  Luckily our email server went offline on Sunday so try as I might I can’t do this until I go and pick it up, reconnect it and turn it back on (which might if I’m luck happen tomorrow).  On Sunday I did manage to do a quick scan through my email and I noticed a couple of rather important onces.  The first being that I have been reawarded/renewed (whatever term you like to use) as a Microsoft MVP for another year.

In the past my community efforts have focused primarily around running the Perth .NET Community of Practice (www.perthdotnet.org); however, in my absence Alastair and Mitch have been doing a great job and I’m reluctant to jump back into doing that.  Plus with my ongoing commitment to The Microsoft Developer Show I suspect that I won’t have too much time to spare.  That said, there are some things that I am going to be taking an active interest in over the next 6-12 months.

  • Imagine Cup 2007 – As you may be aware I helped judge the Worldwide finals in 2004 (Brazil) and 2005 (Japan).  Due credit to the Australian competitors who took part in this event but I was disappointed at the general level of participation in this compeition from universities, and their students.  You would have thought a trip to the Worldwide finals (this year in Seoul) and a cash prize would be enough to get any beer drinking yob (aka regular uni student) to compete (agreed not quite the type of student being targetted but you get the picture), but no, it seems that universities are either too disorganised or decide that because it is Microsoft run it must be a bad thing.  I would like to work with the local universities (UWA, Murdoch, ECU, Curtin…) to get as many students to enter and put together an entry for the finals as possible.
  • Camp Vista – That’s right, we are in the process of organising a full day event dedicated to all the goodness that Microsoft released last year.  Whilst a large proportion of this will be around .NET FX v3 there are some specifics to SQL Server, Office, Vista, SQL Server CE and a host of other products that we want to cover.  Hold onto your hats this day is going to be good. More details on this as they become available but expect the date to be sometime in the 3rd week of February.
  • Orcas – Last year I got all amped up about Linq only to loose interest due to the timetable (ie 18-24 months away).  This year as more CTPs are being dropped (still waiting for the Dec Jan CTP) I will start to blog about the new features particularly in the .NET CF 3.5.  With Linq and related technologies we are finally starting to see real converges across the data divide.
  • Microsoft Sync Services – On The Microsoft Developer Show last year I interviewed Steve Lasker who had recently been doing a number of sessions around the proposed Microsoft Sync Services (MSS).  Anyone building Occasionally Connected applications will understand the pain associated with syncing data.  MSS should dramatically simplify this process so I’m going to be following this one closely.
  • Conferences – As per the last couple of years the big events around Australia (for me at any rate) are going to be Code Camp 07, MEDC (assuming this happens in Oz) and TechEd.

…. I’m sure other things will of course take my interest but they are just escaping my mind for the moment

Someone else’s stupid decision costs me time

Someone else’s stupid decision costs me time

Before I launch into the decision I’m refering to in this particular case I’ll set the scene:  I’m in the process of writing some test code (which admittedly should have been written first, but hey better late than never) and I need to create a temporary database.  Instead of writing lots of lines of .NET code to drop any existing database with the same name (as this test is likely to be run thousands of times) and then create the new database, I figure I would let SQL Management Studio generate a script file which I could then use osql.exe to run.  At this point I had two options; I could include the script file as a content file in which case I would need to make sure it was distributed with the test assembly; alternatively I could include the script file as an assembly resource.  I chose the latter as it seemed easier at the time. 

Osql is great for running sql script files and can be easily executed from .NET using something like:

Dim proc As Process = Process.Start(“C:Program FilesMicrosoft SQL Server90ToolsBinnosql.exe”, “-E -i filename.sql”)
proc.WaitForExit()

NB: If you are planing on running multiple script files (or are relying on the script being completed – eg for the database to be create) you need to ensure you wait for the process to exit!

Now the only difficulty was that my script file was being stored as an embedded resource.  This meant I needed to persist it to file.  Being a VB.NET developer and knowing a bit about the My namespace I figure the easiest way to do this would be to use:

My.Computer.FileSystem.WriteAllText(filename, My.Resources.DropDatabaseSQL, False)

This works fine, except when I invoke osql I get all sorts of weird errors.  I open the created sql file up in SQL Management Studio and run it from there and it works fine, yet even when I manually run osql from the commandline I get these weird errors.  Investigating this further I opened the sql file in notepad, copied the contents to a new file and ran that file using osql – which worked fine??? Ok, so there must be something weird with the sql file that was generated which doesn’t show up in either SSMS or notepad.  Finally I resort to using the commandline to examine the file and sure enough there is a leading character which is the culprit.

C:temp>more dropdatabase.sql
∩╗┐EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N’WebserviceTest’
…..

Going back to my code that writes the sql file out I expand out the code to:

Dim strm as new IO.StreamWriter(filename,False)
strm.Write(My.Resources.DropDatabaseSQL)
strm.Close

Using this code generates the sql file which surprisingly works with osql…..Interesting so there must be a difference in the way that the My…WriteAllText works (I thought that it basically was just a simple wrapper for the expanded code I just wrote).  If you have done much work with files you will understand that there is an encoding (eg ASCII, UTF8) which determines how information is written/read from the file.  The StreamWriter has multiple overloads, some of which allows you to omit the encoding.  Using reflector you can see that this uses a default encoding:

Public Sub New(ByVal path As String, ByVal append As Boolean)
    Me.New(path, append, StreamWriter.UTF8NoBOM, 1024)
End Sub

And if you further drill into the “UTF8NoBOM” you will see that it is UTF8 with out the UTF8 Identifier (the first parameter of the UTF8Encoding constructor is entitled encoderShouldEmitUTF8Identifier as it determines if this identifier should be emitted or not):

Friend Shared ReadOnly Property UTF8NoBOM As Encoding
 Get
  If (StreamWriter._UTF8NoBOM Is Nothing) Then
   Dim encoding1 As New UTF8Encoding(False, True)
   Thread.MemoryBarrier
   StreamWriter._UTF8NoBOM = encoding1
  End If
  Return StreamWriter._UTF8NoBOM
 End Get
End Property

If we do the same with the My…WriteAllText we see that it works slightly differently – this is where the “stupid decision” comes into play:

Public Shared Sub WriteAllText(ByVal file As String, ByVal [text] As String, ByVal append As Boolean)
  FileSystem.WriteAllText(file, [text], append, Encoding.UTF8)
End Sub

So in this case they have chosen to use the standard UTF8 encoding, which of course emits the identifier that was causing me grief.  I have got no idea why this decision was made but consistency is something that is paramount in a good application framework and for this type of mistake to be in the My namespace just give me one more reason not to use it.  That said, there is a fairly simple work around which is to add the optional encoding parameter:

My.Computer.FileSystem.WriteAllText(filename, My.Resources.DropDatabaseSQL, False,Text.Encoding.ASCII)

In my case the ASCII encoding works fine, but there are other default encodings that might be more appropriate to what you are doing.