Sunday, May 14, 2017

First Alert Smoke Detector Keeps Chirping/Beeping 5 Times Every 45 Seconds

Came home today and our First Alert model 9120B smoke detector/fire alarm was chirping 5 times every 45 seconds.  Changed the battery like Youtube said, but to no avail.
Turns out it was the carbon monoxide detector located near the smoke detector that had gone bad.  9120B smoke detectors chirp 3 times when their having issues, not 5 times.  Thanks to the First Alert hotline for figuring this out (1-800-323-9005 option 1).

Saturday, May 06, 2017

In C# .Net MVC, How to Pass Arguments to RenderPartial

Sometimes you just need to pass a bit of extra information to a RenderPartial.  It's easy in Microsoft MVC.  Assuming you need to pass the "name" of a zoo animal for the picture tiles:

Html.RenderPartial("_ZooAnimalTile", Animal);

All you need to do is add an entry to the ViewDataDictionary like this:

Html.RenderPartial("_ZooAnimalTile", Animal, new ViewDataDictionary { { "name",  "Mikey"} });

Then in the "_ZooAnimalTile" partial, you can extract the name like this:

string name= this.ViewData.ContainsKey("name")  && ViewData["name"] != null ? this.ViewData["name"].ToString() : string.Empty;

 Enjoy.  (I know the picture of the meerkat is superfluous, but ... I like meerkats).

PS: We have to be paranoid and check for the presence of "name" (i.e., this.ViewData.ContainsKey("name")  && ViewData["name"] != null) since this partial may be called from different places now or in the future.

Thursday, May 04, 2017

In TFS How to Close a Zombie Pull Request From a Deleted Branch

I had an old pull request hanging around in TFS and could not delete it since it's branch had been delete months ago.  Through the GUI, you cannot delete the Pull Request.

Simple steps to delete:
1. Create a new git branch with the same name as the deleted one.
2. Make a small change in the code.
3. Push the branch to the origin
4. On the TFS website you can now "Close" the zombie Pull Request.

Wednesday, April 05, 2017

How to Upgrade to Latest Point Release of Visual Studio 2017

Visual Studio 2017 has been great, but when I upgraded to ReSharper 2017.1, RS complained about not being able to run MSTest routines since I wasn't on the latest VS2017 release ("Hey, I just installed two weeks ago"). I checked this page and learned about weekly updates to VS.  But how do I install those weekly updates?

1. Easy Way:
In Visual Studio select "Tools/Extensions and Updates..."

And then select "Update", then select the next button, and it will start a download.

Then this will pop-up:

Kill your VS instance, and it will start installing the new update.  It takes a while.

Ok, it takes forever, but at least it works.

2. The Hard Way:
You can re-run your original VS2017 installer (e.g., mu_visual_studio_enterprise_2017_x86_x64_10049783.exe) and it will check for new updates and ask to install those for you.  The latest release is "March 31, 2017 - version 15.0 (26228.12)"


This is a good sign that Microsoft is updating VS frequently.