Skip to main content

Installing TFS 2010 Basic on a Laptop

I decided that I would like show how easy it is to install TFS 2010 on a laptop in an upcoming presentation, but I also want to use that TFS installation for demo’s which is a worry – what happens if the install fails? So what I decided to do was create a video of me installing TFS, this way I can show the video and not worry about my demos not working because of some demo failure. As I am such as nice guy, I decided to share it with everyone on YouTube, so here is the video:

Article in the BB&D Newsletter

After being at BB&D for almost two years, I finally managed to get an article in the BB&D newsletter! The article is about my trip in January to Canada and US for the ALM Rangers work! This was a different experience than writing for my blog, because this had to go through an editor and a copywriter before it was included. They made enough changes to the article that reading it myself, it felt strange because it sounds like me, just a different me. This article will now be shipped off to the BB&D offices around the world so that should be very exciting!

article

Click the image for a bigger view of it.

Thanks to Martin for spotting that the clicking of the image didn't give a bigger view, which is now fixed up.

Downloaded PowerPoint files need repairs?

I download a lot of PowerPoint presentations and recently I am seeing more and more are stating they need repairs when opened!

image

Unfortunately repairing does not work and downloading them again doesn't help either! What is happening is that Windows is detecting that these files are from the Internet and enabling a block on them for your protection. To remove this block, you need to right click the file, select Properties, click the Unblock button and click OK.

image

You will then be able to open them successfully.

Thanks Joseph for spotting the type-o in the original post.

Reading and writing to Excel 2007 or Excel 2010 from C# - Part V: Full source for reading

[Note: See the series index for a list of all parts in this series.]

Clipboard08

A few people have battled with getting all the bits of code scattered in the series together to actually work. This is not only due to the fact they are scattered, but part III for example was not showing the code correctly and there was a bug in part IV. I have gone back and fixed those issues and to help further here is the full code in one big view (click read more if needed to see it).

using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Packaging;
using System.Linq;
using System.Xml;
using System.Xml.Linq;

namespace ReadFromExcel
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Cell> parsedCells = new List<Cell>();
            string fileName = @"C:\Users\bbdnet0758\Desktop\Demo.xlsx";
            Package xlsxPackage = Package.Open(fileName, FileMode.Open, FileAccess.ReadWrite);
            try
            {
                PackagePartCollection allParts = xlsxPackage.GetParts();

                PackagePart sharedStringsPart = (from part in allParts
                                                 where part.ContentType.Equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml")
                                                 select part).Single();
                
                XElement sharedStringsElement = XElement.Load(XmlReader.Create(sharedStringsPart.GetStream()));

                Dictionary<int, string> sharedStrings = new Dictionary<int, string>();
                ParseSharedStrings(sharedStringsElement, sharedStrings);                

                XElement worksheetElement = GetWorksheet(1, allParts);

                IEnumerable<XElement> cells = from c in worksheetElement.Descendants(ExcelNamespaces.excelNamespace + "c")
                                              select c;

                foreach (XElement cell in cells)
                {
                    string cellPosition = cell.Attribute("r").Value;
                    int index = IndexOfNumber(cellPosition);
                    string column = cellPosition.Substring(0, index);
                    int row = Convert.ToInt32(cellPosition.Substring(index, cellPosition.Length - index));
                    int valueIndex = Convert.ToInt32(cell.Descendants(ExcelNamespaces.excelNamespace + "v").Single().Value);

                    parsedCells.Add(new Cell(column, row, sharedStrings[valueIndex]));
                }
            }
            finally
            {
                xlsxPackage.Close();
            }

            //From here is additional code not covered in the posts, just to show it works
            foreach (Cell cell in parsedCells)
            {
                Console.WriteLine(cell);
            }
        }

        private static void ParseSharedStrings(XElement SharedStringsElement, Dictionary<int, string> sharedStrings)
        {
            IEnumerable<XElement> sharedStringsElements = from s in SharedStringsElement.Descendants(ExcelNamespaces.excelNamespace + "t")
                                                          select s;

            int Counter = 0;
            foreach (XElement sharedString in sharedStringsElements)
            {
                sharedStrings.Add(Counter, sharedString.Value);
                Counter++;
            }
        }

        private static XElement GetWorksheet(int worksheetID, PackagePartCollection allParts)
        {
            PackagePart worksheetPart = (from part in allParts
                                         where part.Uri.OriginalString.Equals(String.Format("/xl/worksheets/sheet{0}.xml", worksheetID))
                                         select part).Single();

            return XElement.Load(XmlReader.Create(worksheetPart.GetStream()));
        }

        private static int IndexOfNumber(string value)
        {
            for (int counter = 0; counter < value.Length; counter++)
            {
                if (char.IsNumber(value[counter]))
                {
                    return counter;
                }
            }

            return 0;
        }                         
    }

    internal static class ExcelNamespaces
    {
        internal static XNamespace excelNamespace = XNamespace.Get("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
        internal static XNamespace excelRelationshipsNamepace = XNamespace.Get("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
    }

    public class Cell
    {
        public Cell(string column, int row, string data)
        {
            this.Column = column;
            this.Row = row;
            this.Data = data;
        }

        public override string ToString()
        {
            return string.Format("{0}:{1} - {2}", Row, Column, Data);
        }

        public string Column { get; set; }
        public int Row { get; set; }
        public string Data { get; set; }
    }
}

Free Visual Studio and TFS training?

Blue Einstein Man Pointing a Stick at a Presentation of a Flying Saucer Clipart Illustration S.A. Architect will be offering FREE training covering Visual Studio and TFS in both 2008 and 2010 versions! This will be done in real life, so you will need to travel to somewhere in Johannesburg and so to figure out where, all you need to is click Yes on the S.A. Architect home page.  Once some numbers have been worked out a venue can be found and it can be arranged!

The only catch is you will need to give up a Saturday for this, and myself and fellow Team System MVP, Zayd Kara, will be there to help or annoy you ;)

DevRally - From fluid idea to reality!

Header

DevRally is an event which has been bubbling in my head, and the heads of many others for a while, most importantly Willie Roberts. The idea of this event is that developer focused event which is not run by a vendor, so that open discussion between developers who would never meet about technology can come about. It is also not centralised – it is distributed using conference technologies so that the best speakers can be brought easily (and cheaply) to the audience.

A while back myself and Willie decided to see if we could pull off arranging it and, as usual for this sort of idea, the first thing we did was put up a website and a survey to see what would interest people. Yesterday marked the second step in the process: Sponsors! Both BB&D and Mr. Price have come on board with venues and infrastructure help for the event! Still need a few more sponsors and we need to nail down the dates, speakers and so on – but what this space this event should be a great deal of fun!

DevDays coming to your town soon!

header DevDays, one of the premier Microsoft software developer is starting this month with events in Johannesburg and Cape Town and will be in Durban next month! Not only does it have great local guys presenting but Bart de Smet and Brian Keller will be there too!
Most importantly I will be there, just admit it you want to see me more than Bart and Brian ;), and will have prizes and giveaways at the BB&D stand!

To see the session list head over to: http://www.microsoft.com/southafrica/devdays/sessions.mspx and once you are sold signup at: https://secure.mseventssa.co.za/DevDays/Landing.aspx

MVP Summit 2010, Sightseeing - Part 3 (Warning Photo Heavy)

[The series index can be found here.]

Considering Zayd Kara, Rudi Grobler, and I were in Seattle we took a few days extra to sightsee around the town and so here is some of the highlights from the camera:

image

First thing we did was find the Needle – since it was the only thing Rudi wanted to see.

DSC03443

The entrance to the Microsoft Visitors Centre – worth a look at the cool tech. Not enough Visual Studio in there though ;)

DSC03430

A entire store devoted to Lego was almost too much for me! You could even buy individual bricks based on type and colour for specific products.

DSC03511

At the Sci-Fi Museum and Hall of Fame (SFM), I geeked out A LOT (ask Rudi about my running tour of the place). R2-D2 was cool.

DSC03575

Still at SFM the flying cop car from Blade Runner!

DSC03577

Right next to SFM was EMP – Experience Music Project. This is the HUGE concert screen in the lobby.

DSC03578

The Yes time capsule at EMP.

4371648730_a89c392672_o

Rudi Grobler, Zayd Kara, and myself in our “band” at EPM!

DSC03593

The Eagle artwork at the SAM (Seattle Art Museum) Olympic Park.

MVP Summit 2010, Shiny - Part 2

[The series index can be found here.]

As with any conference event you can expect to fill you bag with trinkets to bring home. You know the stuff which is interesting but basically you would never pay for it yourself and Summit had some of that, but that Visual Studio jacket I got I would’ve paid for :) However this is not about those things, this is about two VERY special shiny things I got to bring home.

Towards the end of last year I was awarded VSTS Rangers Champion award however at Summit I got my “trophy” – it’s a Visual Studio 2008 Team System box, personally signed with a message from Jeff Beehler!

27022010157

The second special item was a big surprise in that internally in the Team System MVP’s there is an award for the best MVP (think of being called the Tom Cruise of Top Gun), which Ed Blankenship deservedly won! Not to be outdone, I won the MVP in Residence award for spending a ridiculous amount of time away from home and doing stuff for Microsoft. The trophy for this was a photo frame with a certificate signed by Brian Harry!

27022010158