Skip to main content

Bring your hard drive to Community Night

Blue Male Student in a Graduation Cap, Reading a Book and Leaning Against a Stack of Books Clipart IllustrationIf you are coming to tomorrow’s community night, you want to bring your hard drive along because I will have some stuff to fill it up with:

Plus I hear that some prizes may be given away at the events too Winking smile

File attachments

Pulled Apart - Part XIV: DevExpress

Note: This is part of a series, you can find the rest of the parts in the series index.

I make no attempt to hide my love for a company called DevExpress which produces enhancements for Visual Studio and additional controls for WinForms, ASP.NET Web Forms, ASP.NET MVC, WPF & Silverlight.

When I started with Pull I used mostly the standard WinForm controls and over time have changed it be almost 100% DevExpress controls for a number of reasons:

  • Rudi Grobler, Silverlight expert sits across the partition from me and loves to point out how ugly standard WinForms is compared to Silverlight. DevExpress helps me make my applications look MUCH better.
  • Every line of code has a cost to it and the value of that line of code decreases overtime. So standing on the shoulders of giants means my cost of development is MUCH less. This also means I focus on the business aspects and not on the UI aspects.
  • There is a lot of parity between DevExpress controls over different platforms, so if I want to change platform (for example to Silverlight) then I know the feature set will be close, lot’s of code could be reused.

Below is the first public version of Pull, which uses just DevExpress GroupBoxes, the rest is all WinForms:

image

versus the UI currently in development (for the January 2011 release) where only the status bar and web browser control are not from DevExpress! I think you will agree it looks way better now, plus there are many new features there (like filtering grids) which were not supported previously.

image

Grid Extensions

For the January 2011 release we switched to the DevExpress grids, which meant a lot of code needed to be changed (or just deleted) and I ended up writing a few extensions for the grids which I believe may be of use to other people:

Return a collection selected items

Rather than working with a collection of selected rows, this allows you to get the values of the selected rows:

public static IEnumerable<T> SelectedItems<T>(this ColumnView view) where T : class
{
    foreach (int selectedRowHandle in view.GetSelectedRows())
    {
        T item = view.GetRow(selectedRowHandle) as T;
        yield return item;
    }
}

Select a collection of items

The grid normally lets you select a single row or a continuous range, however often I want to provide a list of item values and have the rows which match those values selected:

public static void SelectRows<T>(this GridView view, IList<T> selectedItems) where T : class
{
    foreach (T selectedItem in selectedItems)
    {
        for (int counter = 0; counter < view.DataRowCount; counter++)
        {
            T item = view.GetRow(counter) as T;
            if (item == selectedItem)
            {
                view.SelectRow(counter);
            }
        }
    }
}

Layouts and Strings

You can persist the layout of the grid to a stream, the registry or XML file. However I have a settings file and I would like to save and restore the layout from strings so I can easily add it to my settings file:

public static string SaveLayoutToString(this GridView view)
{
    MemoryStream gridStream = new MemoryStream();
    view.SaveLayoutToStream(gridStream, OptionsLayoutBase.FullLayout);
    gridStream.Position = 0;
    using (StreamReader reader = new StreamReader(gridStream))
    {
        return reader.ReadToEnd();
    }
}

public static void RestoreLayoutFromString(this GridView view, string layout)
{
    if (!string.IsNullOrWhiteSpace(layout))
    {
        using (MemoryStream stream = new MemoryStream(Encoding.Unicode.GetBytes(layout)))
        {
            stream.Position = 0;
            view.RestoreLayoutFromStream(stream, OptionsLayoutBase.FullLayout);
        }
    }
}

Enum + Grid + Images = Headache

imageI have an enum for the podcast state and rather than show the text, which is the default, I want to show an image on the cell. However this is not the easiest thing to figure out since there is no designer support for this Sad smile However you can do most of this in the designer and then only need one line of code per enum value Smile.

Step 1

Set the Column Edit property of the column to an ImageComboxBoxEdit: image

imageStep 2

On the ImageComboBoxEdit editor settings set the small images (and/or large images) property to the image list which contains the items you want to show.

It is important that you know the position (or index) of image in the image list.

Step 3

Now all you need to do is add the item values for the editor in code using the Items.Add method, which takes an ImageComboBoxItem. That class has some overloads which accept an Object for the value and here you can put in the enum value. Once this is done it all works fantastically.

You’ll note in the demo code below that I have an image index of –1 for the first item, this is so that no image is shown!

editor.Items.Add(new ImageComboBoxItem("None", PodcastState.None, -1));
editor.Items.Add(new ImageComboBoxItem("Downloading", PodcastState.Downloading, 0));
editor.Items.Add(new ImageComboBoxItem("Pending", PodcastState.Pending, 1));
editor.Items.Add(new ImageComboBoxItem("New Episodes", PodcastState.NewEpisodes, 3));
editor.Items.Add(new ImageComboBoxItem("Error", PodcastState.Error, 2));

Visual Studio Service Pack 1 - Beta: Field Guide

Brian Harry announced the availability of the service pack 1 beta which is fantastic news for all developers. This post is a field guide of me doing the installs.

Before that I wanted to point out a few key things included in this SP:

  • This can installed in production – this beta includes a “go live” license so it is supported and upgrades to the RTM of the SP will be supported.
  • This includes over 80 hotfixes for between 800 and 1000 bugs and many new features. For a full list see the link above, but here is a brief list:
    • Silverlight 4 tool support!
    • Unit testing can target the 3.5 framework now.
    • IntelliTrace support for 64bit and SharePoint!
    • Performance Wizard for Silverlight!
    • HTML 5 support
    • IIS Express support
    • SQL Compact Edition 4 Tooling

Details on the last three can be found on Hanselman’s blog.

  • Some third party systems may break with this, at this time known ones are:
    • ASP.NET MVC 3 RC 1 – this will be fixed in the next update.
    • Visual Studio Async CTP – this will break completely! No news, yet, on when it will be fixed.

The Process

For me there are three files you need to get:

  • Update for .NET 4
  • Update for Visual Studio
  • Update for Team Foundation Server (not covered in this post)

Step 1

.NET 4 installInstall the .NET 4 update first – this took on my machine 24 minutes to do. It is important to note that I did shutdown Visual Studio first but I had some other applications open, including Pull which is .NET 4.

At the end of the process I needed to restart!

image

This step is no specifically needed as the VS SP will include this automatically, however I personally like the idea of doing it manually and making sure .NET 4 apps continue to work before I continue to the VS install.

Step 2

imageOn to the Visual Studio install which after a few minutes tells you what will be updated and then, tells you that it wants to download 490Mb!

image

What I had done was to download the smaller installer version (less than 1Mb) which means it first figures out what is needed and then downloads the rest. This is great for some people as the download size is less, however since I live in South Africa (read: bandwidth is a luxury) and I work with 300+ other developers it is better for me to get the “DVD” labelled one which is bigger (in my case 103Mb bigger) but contains everything in one go so it can be shared easily and the bandwidth hit just once!

image

Step 3

We re-join the action a while later (when the “DVD” edition downloaded, approx. 1 hour 21 min later) we start process again and this time the download size is 0Mb Open-mouthed smile 

image

This took 29 min to process (remember this is without the download) this install and success!

image

Notes

I haven’t found anything in the many extensions I use daily that has broken! In particular my favourites all work

Upgrade to SharePoint 2010 on Small Business Server: Field Guide

SharePoint2010_LogoRecently I needed to do an upgrade from SharePoint 2007, to be exact WSS 3.0, to SharePoint 2010 – “No big deal” I thought, “I’ve done it before”. Assumptions, they do make for interesting life experiences, because this was something different – this was an upgrade on a Small Business Server (SBS) deployment.

logo-ms-sbsFor those who do not know, SBS is a lightweight all in one server product. So when you install it you get Windows Server 2008, plus Exchange Server, plus ISA, plus SharePoint, plus plus plus – ALL PRE-CONFIGURED! It is fantastic to use in small companies.

Microsoft has produced a fantastic upgrade guide for this very scenario: http://technet.microsoft.com/en-us/library/ff959273(WS.10).aspx but I think is missing a few footnotes of things I found during my upgrades, which this blog post aims to share.

Check Lists

Blue Man Holding a Clipboard While Reviewing Employess Clipart IllustrationI’ve made two check lists of things you should do ahead of time:

Software

This is the software that you will need during the upgrade.

Environment

This is some prep for the environment you can do a head of time.

  • Get a service account created on the domain for SharePoint to use.
  • Get a service account created on the domain for SQL 2008 R2 to use as it can’t use network service on a domain controller.
  • Check if there is a public internet FQDN setup and get the details of that, will need this when setting up the AAM.
  • Get domain name used for email.
  • Check for a local domain name for the site, normally companyweb. Verify this can be access on the server and also from a workstation on the network.
  • Make sure it is a domain controller – there is some scenarios where you are not installing on a domain controller but it is SBS in which case a lot of the guide and process will be broken.

Notes

Here are my additional notes for the guide. For some steps I have no notes because there was nothing extra special about those processes that needed noting.

Step 1

  • It is easier to check the version number in add/remove programs by showing the version number column. Service Pack 2 has a version number of 12.0.0.6421 so we want that or higher.
  • Alternatively turn on show updates in add/remove programs and see if SP 2 is installed.

Step 4

  • It is not important to disable the service during the copy, provided your server will not be rebooted during step 4 and no one is accessing the SharePoint site.
  • It is VITAL to place these files in a backup location and then copy the content database files MDF/LDF to a secondary location. This location is where the database files will be used from in future.
  • Make sure the database files are NOT read only.

Step 6

  • It is a complete farm install, not a stand alone farm install

Step 7

  • It is ok for the site not to exist

Step 8

  • If the Central Admin “Getting Started Wizard” pop’s up, it is ok to cancel it wizard
  • Make sure the app pool is set to Network Service

Step 13

  • If you get a Default Web Error it is because the default and intranet names are the same – make sure they are not.
Additional steps post upgrade

Pull December 2010 Release

Another month, another Pull release Open-mouthed smile This month is not a very feature rich release, but includes some vital features and new ideas:

New Parsing Engine

Internally in Pull, we have added a new parsing engine which now handles feeds which are broken. The scenarios we are catering for:

  • Putting incorrectly encoded content in the description. Ted Talks I’m looking at you.
  • Using DTD’s with the feed. Let’s Talk Geek podcast used to break because of this.
  • Incorrect date and time formats.  702 podcast are an example of this.

What this means to you as a consumer of podcasts, is that more are podcasts available for you to subscribe to now!

Battery Support

imageIf you are on batteries (i.e. laptops not plugged in) downloading can put a big strain on the batteries, so we now have a way to prevent downloads while on batteries. This can be controlled in the settings dialog.

Online Detection

There is no point even trying to download if you are not online (waste of CPU, memory, batteries etc…), so we now ask Windows if you are online and then only if download if you are online. This too can be controlled in the settings dialog for scenarios where you are online but Windows is unable to detect it.

Better Hardware Use

We optimise how many downloads you can do based on the number of CPU cores available, this ensures we download optimally based on the limits of the CPU. This can be adjusted in the settings.

Sync Support

imageWe new have a very basic sync system in Pull, which allows you to easy sync your devices with your downloaded episodes. This is intentionally basic for this release as we try to understand the needs and wants of people who use this. Please provide feedback on this feature.

Twitter Support

Another new feature is a one click way to share using Twitter what podcasts and episodes you are listening to! This is very basic too in this release and can break in some situations. We will be working on this and it will be enhanced in the January release.

Minor Features

  • Improvements to the UI and theming
  • Better last resort crash support

Looking Forward

For the January release we will be implementing some major new features:

  • Grid overhaul – we make use of grids to list your podcasts, episodes, downloads and the log. In January we will be giving them a major overhaul and give you the ability to have filtering and searching, persistent customisations and performance improvements.
  • UI Enhancements – Really working hard on making the UI easier to understand while giving power users more control.
  • Twitter – Better support for Twitter, including using bit.ly for shortening.

Little taste of the current development progress:

image

CommNight December - Some interesting events

Happy Blue Man Partying With a Party Hat, Confetti and a Bottle of Liquor Clipart IllustrationIn the middle of the company parties, you should take one night off to do some fantastic learning and networking at CommNight (Community Night) on the 14th December! You can read about all the details on the Microsoft DPE Blog.

There are two groups which I want to highlight which will be at CommNight:

S.A. Developer

S.A. Developer is a user group for developers and in December will be hosting the following topics:

  • Tool of the month: This short (10min to 15min) session is where someone can present their favourite developer focus tool or add-on.
  • Unit Testing WPF & Silverlight – Tools & Techniques: Silverlight and WPF can be used to create truly immersive UI experiences for users.  Testing these UI components and the logic around it can become complex – especially when using frameworks like PRISM.  Join us in this session as we take a look at a few tools and techniques that can be used when unit testing WPF and Silverlight applications. 

Really looking forward to this session!

Information Worker

Information Worker is a user group for those in the IW space, not just developers but everyone even people who job just involves Excel and Outlook! This month we are looking at:

  • Lync – Microsoft’s Unified Communication System
  • Windows Phone 7 – What does this give the IW user? Things like Office and SharePoint integration will be discussed

What is an ALM MVP?

If you asked me 12 months ago what an ALM MVP was I would likely have told you something – unfortunately that something would have been completely wrong. One of the most important things I learnt this year from being an ALM MVP, is what an ALM MVP actually is.

What is an MVP?

First it is an award, this means you get it as recognition for doing something which benefits the community of people who use a Microsoft product (or products). It is also very important to note that the reason it is awarded to one person is seldom it is awarded to another person – no two people are alike, neither are their community contributions and so the awarding is unique per person.

I think it is safe to assume that if you going to so something which benefits many people using a specific product, you need to know something about that product Winking smile However being a MVP is not meant to indicate that this person is an expert in a certain product/s and they know everything about the product.

This doesn’t mean that a lot of MVP’s aren’t brilliant, many are scary smart, first two that jump to mind are Ed Blankenship ALM MVP and Jon Skeet C# MVP, but at the end of that day – all MVPs are people, like you, with limits and gaps in knowledge.

The ALM Stadium

image

ALM MVP’s have an additional level of complexity since the community that they helped revolves around not one single product, like Zune MVP’s for instance, but is actually made up of many products and components. Above is the “stadium” picture which shows a lot of (most of?) the components which make up ALM.

A ALM MVP may know and work in one product/component and never see the other ones. An example of this is Zayd Kara ALM MVP, who is deeply IT Pro focused – so he understands installing the systems, build in TFS etc.. but he seldom opens or works in the Visual Studio IDE so he may not know as much about it as a other ALM MVPs.

As I stated above the reasons someone is awarded differ and so the area and skills in the ALM MVPs differ from person to person. 

Misconceptions

In the form of a Q&A:

  • Q: As an ALM MVP you must be a TFS expert?
  • A: While TFS is a major part of ALM, that simply is not true. I look at myself and while I know TFS, can do an install, understand the API and how to integrate – ask me to edit a process template and I have no idea where to start. However ask me about Visual Studio and I can talk your ear off!
  • Q: As an ALM MVP you must be a Microsoft fan boy and only promote their tools?
  • A: Not at all! MVP’s are not a Microsoft fan club.

    Yes, I am a fan of Microsoft tools but I am also critical of them. You want to see some of the most critical people of Microsoft is MVP’s – they care and fight on behalf the community. As most (all?) MVP’s we are matured to realise that these are just tools and you need to pick the right tool for the job, and that sometimes isn’t what Microsoft currently offers.

  • Q: Microsoft uses the MVP system as a way to find and hire staff?
  • A: While some MVP’s have moved to Microsoft, Willy-Peter Schaub previously a VSTS MVP and now working for Microsoft comes to mind, the hiring of MVPs is not common practise.

    Also worth thinking about, is that Microsoft wants the best of the best (which company doesn’t?), MVP’s are awarded for their community work – not being the best of the best C# programmer (for example) so sometimes that means that MVP’s are not the best fit and the final thing weighing against you (as told to me by a Microsoft employee) Most of the Microsoft employees do not even know of or understand the MVPs so there is not a lot of help in their.

    However being a MVP means you are likely following key people so when exciting jobs are announced ,like the way I knew about these cool jobs, you are first in with your CV. 

  • Q: You must blog/write a book/tweet/present at x or something else to be a MVP?
  • A: No, there is no formula to become a MVP. If you want to be a MVP, work hard for the community in any and as many ways as possible and the MVP maybe will follow.
  • Q: Becoming a community lead is the way to be a MVP?
  • A: This one has come up recently in the Information Worker user group where people have wanted to become leads so that they become MVP’s.

    First there is no single way to becoming a MVP – the IW user group leads are a good example of that we have a few MVP’s but we have more non-MVP’s as leads. Second if your motivation of helping the community is to become a MVP, then I doubt you will become a MVP because your motives are wrong. MVP’s do what they do for the community not because they want to be a MVP, but because they love the community.

Thanks

To make sure I wasn’t still wrong, I did ask for some feedback from fellow MVP’s and Microsoft staff and I thank you all for your contributions in particular Willy-Peter Schaub, Ruari Plint and Zayd Kara.

T4 Cheat sheets!

I’ve been spending a lot of time working on two things recently: T4 (Text Template Transformation Toolkit) and Windows Phone 7. Part of my work around T4 included creating some cheat sheets to make it easier to get to grips with it!

There is now three posters available (High res PDF’s below or on the DRP site):

General Overview

This provides a high level overview of the various components in T4.

Slide1

@template detail

The @template directive has a lot of options and this sheet provides detail on those.

Slide2

Examples

This sheet provides usage examples of various aspects directives in T4.

Slide3

You can see my time with Windows Phone 7 leaking into these two as I loosely designed them around the Metro UI design guideline that Windows Phone 7 uses. Interestingly for me is that Metro seems to work fantastically well for cheat sheets as these are some of the nicest and easiest to grok sheets I’ve ever done.

File attachments
T4 Cheatsheet.pdf (226.23 KB)
T4 examples.pdf (256.43 KB)

Pull - November 2010 Release

The third stable release for Pull, the simplest podcast downloader in the world. This release has less front end features than the October 2010 release, but that doesn’t mean there hasn’t been a lot of work done under the skin to make this the best release ever.

Major Features in this Release

Download System Re-Done

I’ve said it many times but a podcast tool is really just a download tool that knows how to parse RSS & ATOM. Which means that it should do those two things fantastically. In this release the download system was completely rewritten from scratch to incorporate many new features and to improve the performance.

In the last release we supported cancelling a download but now we can also pause a download, this becomes even more important with another new feature where you can limit the number of concurrent downloads. Add to this the third feature in the trifecta of download management: speed limiting – you now have FULL control of your bandwidth, performance of downloads and how and when you want to download.

image

The other major feature introduced into downloads was to introduce a number of checks about the download prior to the download to see if the download is needed. For the technical people out there, this is done by doing a HEAD request and checking the etag and last-modified date. What this means is that in the October release you would do about 10Kb to refresh a podcast, regardless if it changed. Now we can tell in less than 200 bytes and only pull that 10Kb if it has actually changed.

Ability to not automatically download episodes

Previously if you subscribed to podcast, you were at the mercy of the podcasters because when they published a new episode you downloaded it. Now in Pull, you can disable that so that the podcast will still update but new episodes will not automatically download.

image

BTW this came directly from the community via the discussions, so if you want a feature – LET US KNOW!

Minor Features in this Release

New Version Checking

A feature you won’t see until December is a little text block that appears when a new version of Pull is made available. It will appear next to the Give Feedback link: image

Shutdown Confirm Options

In the settings you can now control the close confirm prompt, so you can set it to Always Confirm (as it has done previously), confirm if there is an active episode download or never confirm.

image

Back story, Rudi Grobler who is my unofficial product owner originally asked for the confirm during the beta because he kept killing it by mistake. During the last sprint, guess who was complaining about it always asking Winking smile 

Refresh Individual Podcast

You can now easily right click on a podcast (or multiple podcasts) and say Refresh selected podcasts to manually refresh ONLY the selected ones.

image

Future

December is the plan for the next release and in the plan (plan = no promise) for it is the ability to fix broken feeds. I’ve seen many feeds that are broken because the authors are doing something wrong. However Pull becomes the bad guy because it can’t deal with it so there will be a fix up engine to try and deal with those.

I am also thinking of syncing to device support, likely this will be BASIC – folder/drive style.

I also want Pull to be a better Windows citizen by working better with the OS via adding a manifest so Windows knows what to expect, better support for running on batteries, better support for Windows Error Reporting, and better understanding of how many CPUs your machine has and what the optimal settings for downloads are based on that.

Windows Phone 7 Training Event

logo_windows_phone_vRudi Grobler, known for his love of WPF, Silverlight and Windows Phone 7, has organised a FREE training event focused on Windows Phone 7! This event will run on the 5th Feb 2011 but space is VERY VERY limited.

The idea is to give you key information via presentations, learning via hands on labs and fun via playing with REAL devices!

You can get all the details and register at: http://sadev.wufoo.com/forms/windows-phone-7-jump-start-feb-2011/

More details about the event will be announced over the coming weeks so follow Rudi’s blog for more!