Reading book ‘Think Twice’

Interesting book by by Michael J. Mauboussin on how to recognize and avoid common mistakes when making decisions.  Review coming soon…

  • Share/Bookmark

Happy Thanksgiving!

TWAS THE NIGHT OF THANKSGIVING,
BUT I JUST COULDN’T SLEEP.
I TRIED COUNTING BACKWARDS,
I TRIED COUNTING SHEEP.

THE LEFTOVERS BECKONED -
THE DARK MEAT AND WHITE,
BUT I FOUGHT THE TEMPTATION
WITH ALL OF MY MIGHT.

TOSSING AND TURNING WITH ANTICIPATION,
THE THOUGHT OF A SNACK BECAME INFATUATION.
SO, I RACED TO THE KITCHEN, FLUNG OPEN THE DOOR,
AND GAZED AT THE FRIDGE, FULL OF GOODIES GALORE.
GOBBLED UP TURKEY AND BUTTERED POTATOES,
PICKLES AND CARROTS, BEANS AND TOMATOES.

I FELT MYSELF SWELLING SO PLUMP AND SO ROUND,
‘TIL ALL OF A SUDDEN, I ROSE OFF THE GROUND.
I CRASHED THROUGH THE CEILING, FLOATING INTO THE SKY,
WITH A MOUTHFUL OF PUDDING AND A HANDFUL OF PIE.
BUT, I MANAGED TO YELL AS I SOARED PAST THE TREES….
HAPPY EATING TO ALL – PASS THE CRANBERRIES, PLEASE.

MAY YOUR STUFFING BE TASTY,
MAY YOUR TURKEY BE PLUMP.
MAY YOUR POTATOES ‘N GRAVY HAVE NARY A LUMP.
MAY YOUR YAMS BE DELICIOUS.
MAY YOUR PIES TAKE THE PRIZE,
MAY YOUR THANKSGIVING DINNER STAY OFF OF YOUR THIGHS!!

HAPPY THANKSGIVING TO ALL

  • Share/Bookmark

Custom Sorting for Work Items in Team Foundation Server 2008

TFS provides the WIQ Language (Work Item Query) to query work items.  WIQ is very similar to standard SQL — you have a Select statement to pull back columns of data, a Where clause to filter data, and a Sort By clause.  However, WIQ is much more limited than standard SQL. In particular, advanced sorting logic is not supported.  Thus, you may find yourself needing to implement some type of custom solution to sort your work items.  A recent client had a pretty advanced sorting system in place in their old Mercury TestDirector system (they migrated over to TFS and got rid of TestDirector).  You might need custom sorting if, for example, you need special logic to determine the priority of the defects/bugs.  Developers will work on the queue of defects based on the order of the work items.  Here are your options:

  1. Use WIQ.  As stated above, this option is limited to basic sorting.  You can sort by a single field, or multiple fields.  Conditional logic or advanced grouping is not supported.
  2. Develop a web service triggered by the Work Item Changed event.  By adding a field to the work item definition (perhaps an integer field labeled "SortOrder") you can evaluate the work item to determine what sort order it should be assigned.  In our case, we identified 5 sort levels, so the "SortOrder" field was assigned a number between 1 and 5.  Work Item queries were written to sort based on this field first, then by other fields to secondary sort the work items.

    The web service gets run after you save the work item.  The web service event fires, evaluates the work item, assigns a value to the "SortOrder" field, and then saves the work item.

    Sample code (this uses the TFSEvents framework available at Codeplex):

    public void Notify(string eventXml, string tfsIdentityXml)
        {
            WorkItemChangedEvent workItemChangedEvent = this.CreateInstance<WorkItemChangedEvent>(eventXml);
            TFSIdentity tfsIdentity = this.CreateInstance<TFSIdentity>(tfsIdentityXml);

            int WorkItemID = workItemChangedEvent.CoreFields.IntegerFields[0].NewValue;
            Microsoft.TeamFoundation.Client.TeamFoundationServer TFS = new TeamFoundationServer(tfsIdentity.Url);
            TFS.Authenticate();

            WorkItemStore WIS = TFS.GetService(typeof(WorkItemStore)) as WorkItemStore;
            WorkItem updatedWI = WIS.GetWorkItem(WorkItemID);
            string priority = "";
            string environment = "";

            if (updatedWI.Fields.Contains("CustomFields.SortOrder"))
            {
                priority = updatedWI.Fields["CustomFields.Priority"].Value.ToString();
                environment = updatedWI.Fields["CustomFields.FoundInEnvironment"].Value.ToString();

                if (priority == "1-Now")
                {
                    updatedWI.Fields["CustomFields.SortOrder"].Value = 1;

                }
                else if (priority == "2-ASAP")
                {
                    updatedWI.Fields["CustomFields.SortOrder"].Value = 2;
                }
                else if (updatedWI.Fields["CustomFields.CRID"].Value.ToString() != "" ||
                    (updatedWI.Fields["System.IterationID"].Value.ToString() != "154" &&
                    updatedWI.Fields["System.IterationID"].Value.ToString() != "314"))
                {
                    updatedWI.Fields["CustomFields.SortOrder"].Value = 3;
                }
                else if (environment == "2-PRE-PROD" || environment == "3-Test" || environment == "4-DEVL")
                {
                    updatedWI.Fields["CustomFields.SortOrder"].Value = 4;
                }
                else if (environment == "1-PROD")
                {
                    updatedWI.Fields["CustomFields.SortOrder"].Value = 5;
                }

                if (updatedWI.IsDirty)
                {
                    updatedWI.Save();
                }
            }
        }

    A big disadvantage to this method — the work item gets updated by the web service, thus if a user has the work item loaded on their screen, makes a change, and tried to save, it will fail and notify the user the work item has been updated by another user.  This scenario is very likely to happen since the user will have the work item on their screen during the initial save and may want to add additional data or update information on the work item.  They are forced to close and reopen the work item after each save.  For most organizations, this would be frustrating and probably disqualify this solution.

  3. Develop a client-side custom control.  This option is similar to the web service, but the logic lives on the client.  Using a custom field such as "SortOrder" you can assign a sort value based on the work item information.  The logic runs before the work item is saved, so only one update/save operation is required.  The advantage to this method is you don’t have the update problem as you do with the web service.  The disadvantage is that this control needs to be deployed to all your developer/client machines or else the sort logic won’t run and be assigned.

Based on all these options, the best option if you require advanced sorting logic is to develop a client-side custom control.

  • Share/Bookmark

Nicholas Loves Books

We usually read Nicholas a book each night before bed… and he is always so excited!  Here he is flipping through a favorite book.

photo 2

  • Share/Bookmark

Brotherly Love…

Brendon hasn’t been feeling well the last couple days – I think it’s because he is teething right now.  After Nikki told Nicholas that little Brendon wasn’t feeling good, Nicholas offered some love  :-)  

 

photo photo 2 photo 3

  • Share/Bookmark

First Family Camping Trip

We went on our first family camping trip last week!  Yes, real camping in a tent.  We went to Many, LA at Toledo Bend Lake.  It was a pretty camp site – right there on the lake.  Mom & Dad brought their RV, while we had a tent.  Everyone had a great time.  It rained most of the days we were out there, so we didn’t get to go fishing or do some of the activities we planned, but we still enjoyed it.  I’m amazed at how well both Nicholas and Brendon did – especially considering all the rain.  A few photos:

IMG_1997 IMG_2003 IMG_2022 photo 3 photo 5 IMG_1976 IMG_1986 IMG_1990

  • Share/Bookmark

Stonewall Fire Department

We took the boys up to the fire department during our trip to Shreveport / Stonewall last week.  Dad has been volunteer firefighter in Stonewall for many years now.  Nicholas love his play fire trucks – but he was a little scared of the big fire trucks!

IMG_1962 IMG_1953 IMG_1957

  • Share/Bookmark

Brendon growing up

Little Brendon is now crawling all over the place, pulling himself up and almost walking!  Just 8 months old and he seems so grown up.   Amazing how fast it has gone – and what a good baby he is…  never sick, eats like crazy, and is always happy and smiling.

IMG_1843IMG_1852 IMG_1847  IMG_1857  IMG_1854

  • Share/Bookmark

Gas prices…

Click on the image…

  • Share/Bookmark

6-week Pushup Program

I’ve been training a lot lately to improve my 5k performance and work towards triathlon event.  To build up my upper strength, I started a 6-week pushup program (it’s an iPhone app – yes, the iPhone does everything!).  The graph below is my progress so far.  I did 142 pushups at my workout today…  the next two weeks are going to get really difficult to keep up.

graph

  • Share/Bookmark