Blog

Writing on AI engineering, software architecture, and leadership.

"Why We Sleep" Changed How I Think About Performance

Personal DevelopmentLeadership

The first thing my mindset coach Adrienne Carter told me to read when we started working together was Matthew Walker's Why We Sleep. Not a productivity book. Not a leadership book. A book about sleep. I thought it was an odd choice. It turned out to be the maybe the most important thing.

I spent most of my career wearing sleep deprivation like a badge of honor. "I'll sleep when I'm dead" was my mantra. Late nights debugging production issues, early mornings catching up on email, weekends pushing through on side projects. I thought that was what it took. I was wrong.

How a Mindset Coach Changed Everything

Personal Development

I was going to cancel during our intro call. I had signed up for coaching with Adrienne Carter through Primed Mind. and the day before our first session I had already decided that I would cancel, every excuse in the book showed up:

I don't need this.
It's too expensive.
I'm doing fine.

But then I got on the call and somthing just felt right. It felt like this was an opportunity that I shouldn't pass up. It turned out to be the best decision I've ever made.

How I Got Here

I'd been a Primed Mind member for a couple of years. I'm a poker player, and Jonathan Little had a deal for 70% off and I figured why not. Primed Mind was already popular in the poker world for mental game coaching, so I signed up and listened to a bunch of sessions. Then Primed Mind ran one of their New Year challenges — "10 Days to a Primed Mind" I had signed up before and never followed through. This time I finally leaned in and did it. Something clicked. At the end, they promoted their one-on-one coaching program. And something in the back of my head said do it.
Even then, I almost backed out. Im glad I didn't.

.Net Aspire Preview 2 with Dapr and the secretstore

Development.Net

In my recent SaaS personal projects, I've been exploring the capabilities of Dapr, based off of the eShopOnDapr sample. Dapr, with its integrated APIs and best practices for building distributed applications, has significantly streamlined my development process. Learn more about Dapr.

I've also been incorporating architectural insights and best practices from YouTube channels like Milan Jovanovic, Nick Chapsas, and Codewrinkles. Their guidance has refinined my approach to these solutions especially around using MediatR, Vertical Slice architecture and performance. Check out their insights:

Learning Current Angular Tool Best Practices

DevelopmentAngular

Over the last couple of weeks I have been diving back into Angular development using Angular 6 and ngrx.  One of the things that quickly became apparent is that now the best practices of installing JavaScript tools is to install them locally instead of globally to prevent version collisions.

When I first started I installed the angular cli globally and encountered this type of error when running many of the sample apps that I downloaded.

Your global Angular CLI version (6.0.8) is greater than your local version (1.7.3). The local Angular CLI version is used.

This didn’t seem to cause me an issues but still the error bugged me and when I was reading the book Angular 6 for Enterprise-Ready Web Applications by Doguhan Uluca he really drives home that you should keep the number of globally installed packages to a minimum.

I was able to find out what commands I had installed globally using this command

npm list -g --depth=0

Which showed I only had the angular cli and npm install globally.

So I was able to uninstall the global angular cli and get rid to the ugly warnings.

Doguhan also points our that you should use npm-windows-upgrade instead of using npm i -g npm to upgrade npm on Windows or you are going to run into npm corruption issues.

https://github.com/felixrieseberg/npm-windows-upgrade

Random Stuff I want to remember

Random

Windows 10 Home password expiration.

Today I had a couple of Windows 10 Home machines had their passwords expire.

To turn off the Windows 10 password expiration

net accounts /maxpwage:0

From http://www.thewindowsclub.com/customizing-the-password-policy-in-windows-7

Upgrading npm on Windows

I was installing jspm on a new machine and after I installed node 4.3.1 it was running npm I was trying to upgrade npm.  I tried a bunch of different commands I found on stack overflow but this command from the npm site (I feel like Colonel Sanders looking for the Nashville Hot Chicken Recipe) did the trick on both Windows and the Mac.

npm install npm@latest –g

From*:* https://docs.npmjs.com/getting-started/installing-node

http-server

In my recent javascript library/framework exploration I found myself needing a quick way to server html without having to have gulp or more permanent web server.  I found http-server fits the bill nicely.

npm install –g http-server

http-server –o –c-1

-o opens browser window after starting the server

-c-1 disables caching

From: https://github.com/indexzero/http-server

VisualStudio Code fix for icons not appearing

Development

When VisualStudio code was announced I went out and installed it right away on my Mac and Windows machines.  One my home development machine I was unable to see the icons.  I was thinking that it was due to my 4K display and an High DPI issue but it turns out not to be the case.

image

In reading the Reacting to feedback, common issues, and our first update post on the Visual Studio Code bug it was due to the svg file extension being associated to something other than image/svg+xml in my case due to Inkscape it was set to application/svg.

image

Changing the Content Type to image/svg+xml made the icons visible.

image

There is a FAQ with several fixes and workarounds for Visual Studio Code at https://code.visualstudio.com/Docs/FAQ

Setting an IP address using netsh instead of arp -s on Windows 8.1

Hardware

I recently had to setup many Epson TM-T88V receipt printers for a POS installation and out of the box they are configured with a static address of 192.168.192.168.  Pressing the reset button for 3 seconds prints out the status of the printer including the MAC address so I though I would just use arp –s to configure the printers but I received an error.  So after a some googling with Bing I turned up this article that pointed me to the the fact that you need to use netsh with recent versions of Windows.

First you need to get the name of the interface that the device is connected to.  Then you execute the netsh interface ipv4 add neighbors command.

netsh interface ipv4 show interfaces

Idx     Met         MTU          State                Name
---  ----------  ----------  ------------  ---------------------------
  3          10        1500  connected     Ethernet
  1          50  4294967295  connected     Loopback Pseudo-Interface 1
 63          10        1400  connected     vowire hosting
 10           5        1500  connected     vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)
 29          10        1500  connected     vEthernet (VirtualBox Host-Only Ethernet Adapter Virtual Switch)

netsh interface ipv4 add neighbors "Ethernet" 10.1.10.45 xx-xx-xx-xx-xx-xx

Cool Development Utility - xip.io

DevelopmentTools

I stumbled across a mention of a free service xip.io that spared developers the hassle of editing their host file for every new development web site they needed to setup. Having had to edit the host file many times this really appealed to me. So I went to find out what type of black magic enabled this.

What I found was a very simple and brilliant solution from Basecamp (formally 37signals. xip.io is a public custom dns service that given a [domain name].[ip address].xip.io returns the ip address specified.

For example

www.gabrewer.com.192.168.1.10.xip.io resolves to 192.168.1.10
dev.gabrewer.com.192.168.1.10.xip.io resolves to 192.168.1.10
dev.www.gabrewer.com.192.168.1.10.xip.io returns 192.168.1.10

Since this is a hosted service it works for all devices that have an Internet connection including tables, phones and other Internet connected devices.

I always love it when I find a nice piece of engineering that simplifies my development experience.

My first pull request - WebApiContrib.Formatting.CollectionJson

DevelopmentWEBAPI

In my latest project I am using the great Collection+Json ASP.NET Web API library that Glenn Block put up on GitHub a while ago.  After using it for a while I decided to refactor my code and use something other than an int for my type identifiers.  When I changed to use the generic type, I discovered an issue with the code that had added the generic identifier capability to the library.  The Create method was still retuning an int instead of the generic TId.

So I wrote up the issue on GitHub and Glenn Block immediately responded asking if I was going to submit a Pull Request.  I am still relatively new to git and am still trying to grok it.  But since I had already forked the repository and updated the code, I figured this would be as good time as any to figure how to submit a pull request. 

Even though it was a one line change to the return type of the Create method, I realized that there were no unit tests for the CollectionJsonController class taking a generic identifier value.  So I decided I should fix that as well and created a XUnit test for this scenario by cloning the existing tests with just a Controller that used a string for the identifier.  Once I had the tests and the code working, I went about figure out how to submit my first pull request.

I found an excellent resource that made the process relativity straight forward and painless.  https://www.openshift.com/wiki/github-workflow-for-submitting-pull-requests 

You can find my first pull request (modest as it may be) at

https://github.com/WebApiContrib/WebApiContrib.Formatting.CollectionJson/pull/12#issuecomment-22815387

Nice JavaScript library for formating numbers and currency

DevelopmentJavaScript

In my continuing effort to really learn JavaScript, I was working on putting together a shopping cart application using JavaScript.  One of the things I needed to do was format some of values as currency. 

So I started looking around at the various techniques to accomplish this and ran across accounting.js a tiny JavaScript for number, money and currency formatting that seemed to fit the bill nicely. 

Now I can just do this.

accounting.formatMoney(12345678);    // $12,345,678.00
http://josscrowcroft.github.com/accounting.js/

Cisco Nexus 1000V for Microsoft Hyper-V Beta Program and Webinar

Hyper-VHyper-VNetworking

I just found this post from Aidan Finn via Damian Flynn’s blog post regarding the webinar and beta program for the Cisco Nexus 1000V switch for Microsoft Hyper-V on March 6th at 12pm EST. 

I am interested in learning what features the Nexus 1000V will provide leveraging the Hyper-V Extensible Switch.  We are currently using the SFlow Agent for Window Server 2012 Hyper-V to monitor our VM traffic and it is great for getting insight into the network utilization of the individual VMs.

Damian Flynn - Cisco Nexus 1000v Public Beta Program

Aidan Finn - Unveil Of Cisco Nexus 1000V Distributed Switch For Windows Server 2012 Hyper-V

ASP.NET and Web Tool 2012.2 Released Today

ASP.NETDevelopmentVisual StudioWEBAPI

The ASP.NET and Web Tools 2012.2 update was released today. There were many updates including some big additions like OData support and SignalR. Some of the things that jump out at me from the release notes.

"Paste JSON as a .NET class. Using this Special Paste command to paste JSON into a C# or VB.NET code file, and Visual Studio will automatically generate .NET classes inferred from the JSON."

"Mobile Emulator support adds extensibility hooks so that third-party emulators can be installed as a VSIX. The installed emulators will show up in the F5 dropdown, so that developers can preview their websites on a variety of mobile devices. Read more about this feature in Scott Hanselman's blog entry on the new BrowserStack integration with Visual Studio."

Web Platform Installer crash when viewing Products or Applications

DevelopmentIISWordPress

Today when I was trying to setup WordPress on my Windows 8 development machine the IIS Manager would crash with an System.OutOfMemoryException exception.

Exception:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.
Check InnerException for exception details. ---> System.OutOfMemoryException: Out of memory.

After doing a quick Bing search turn up this article on the IIS.NET Forums and after clicking “Get New Web Platform Components” problem solved.

Node.js, JQuery and Mocha on Windows 8 x64 and PowerShell

DevelopmentNode.jsPowerShell

Since the Microsoft Patterns and Practices symposium, I have been wanting to get started learning Node.js.  So I added the JumpStart Node.js to my Safari Books Online bookshelf and installed Node.js from http://nodejs.org/

The sample in the first chapter uses a Mongo db provider (MongoLab) but I decided to install mongo locally instead.  It installed easily using the Windows Quick Start.

I was on a roll until I got to the next chapter and tried to get the modules installed.  The sample uses Mocha for its unit tests.  It also uses jQuery.  Both proved to be a challenge to get working on my Windows 8 machine.

Misleading error in Cluster Validation Wizard

ClusteringHardwareHyper-V

This weekend we were migrating a Hyper-V cluster form Windows Server 2008 R2 to Windows Server 2012.  Our hosts were HP DL360p Gen 8 servers connected to a HP P2000 G3 MSA iSCSI storage array. 

After getting our hosts all configured and connected to the SAN we were ready to install the cluster.  When we ran the Cluster Validation Wizard we received some warnings.  One of warnings seemed quite troubling. 

Test Disk 0 does not support SCSI-3 Persistent Reservations commands needed to support clustered Storage Pools. Some storage devices require specific firmware versions or settings to function properly with failover clusters. Please contact your storage administrator or storage vendor to check the configuration of the storage to allow it to function properly with failover clusters.

This appears to be a big problem because SCSI-3 Persistent Reservations are very important to the cluster working correctly. 

Passing values from your ASP.NET MVC Controller to Javascript

ASP.NETDevelopmentJavaScriptMVC

Inspired by John Papa’s Single Page Application series on Pluralsight, in my latest project I am making heavy use of the JavaScript MVVM pattern.  Since my application isn't a true single page application I found myself in some cases needing use values from my Controller in my JavaScript methods.

After doing some research I came across this post from A. Friedman about Ngon a port he created of the Ruby Gon gem.  Ngon allows you to add a value to a ViewBag NGon property and then consume it in your JavaScript.

To use Ngon I can just add the NGonActionFilterAttribute to my RegisterGlobalFilters

Unable to open Database Project after upgrading to SQL Server 2012 SP1

DevelopmentSQL ServerVisual Studio

I recently upgraded SQL Server 2012 on my development machine to SP1.  Once it was installed, my solutions with SQL Server Database Projects complain that the version of SQL Server Data Tools is not compatible with the database runtime components install on this computer.

/images/ssdt3-300x253.jpg

Both the “Learn more…” and “Get the latest version of SQL Server Data Tools…” links do not currently resolve to an active page.

Luckily  I was able to find Mr. Wharty’s Ramblings - Everything SQL blog which had the solution, install the latest version of the SQL Server Data Tools – November 2012 update and migrate the database projects.

Windows Server 2012 RC and Window 8 Release Preview are now available - Plus VS 2012

SoftwareVisual StudioWindows Server

Time to start burning through bandwidth.

Latest pre release versions are now available

Windows 8 Release Preview http://windows.microsoft.com/en-US/windows-8/download

Windows Server 2012 Release Candidate http://technet.microsoft.com/en-us/evalcenter/hh670538.aspx

First found via http://msmvps.com/blogs/bradley/

Also Visual Studio 2012 Release Candidate is also available. http://www.microsoft.com/visualstudio/11/en-us

Visual Studio 11 Beta - Dark Theme using White Background - Fix

DevelopmentTools

Last night I was playing around with the Visual Studio 11 settings and something I did caused the dark theme to use a white background.  Reselecting the dark theme did not reset the background.  After consulting Bing, I found the fix.  This is a known issue with a simple fix.

http://blogs.msdn.com/b/davedev/archive/2012/05/07/help-visual-studio-11-beta-dark-theme-incorrectly-using-white-background.aspx

Cool Development Utility - smtp4dev

DevelopmentTools

The other day I needed to test the Mail functionality of an application I was developing on Windows 7 and I realized that the built in SMTP server had been removed.  I initially thought about just installing the free version of SmarterMail and configuring that but I decided to take a look and see what else I could find.  I ran across smtp4dev on CodePlex.  Codeplex Link

ASP.NET Web API replaces WCF Web API

ASP.NETDevelopmentWCFWEBAPI

The new MVC 4 beta was released last Thursday / Friday.  One of the big changes is the moving of the WCF Web API into the ASP.NET MVC code stream.

Get the bits and the initial documentation on the ASP.NET Web API page at http://www.asp.net/web-api

The team has provided some initial guidance on migrating from the WCF Web API to ASP.NET Web API on the WCF CodePlex site.

PowerShell Quick Reference Guides and Cheat Sheets

PowerShell

Becoming effective with PowerShell is quickly becoming essential to working effectively with Windows Server products.  With PowerShell modules for so many products it is getting hard to keep track of all the command lets.  Luckily Jonathan Noble has put together a list of PowerShell Quick Reference Guides and Cheat Sheets for various products.

http://www.jonoble.com/blog/2011/12/12/powershell-quick-reference-guides-and-cheat-sheets.html