Category Archives: Development

Some Strange (but Logical?) Behavior of GitHub

Lets say there is a repository on GitHub called someweirdname/MyAwesomeRepo. I want to fork this repo, so I do. Now I have davidshq/MyAwesomeRepo.

I don’t get a chance to work on it for a few days and GitHub tells me in the interim 100 commits have been made to the upstream origin repo. So I create a pull request in my own repo (davidshq/MyAwesomeRepo) to pull in all the changes. I approve and merge the changes.

My (erroneous) expectation at this point is that davidshq/MyAwesomeRepo will now be exactly as someweirdname/MyAwesomeRepo – but it isn’t. Instead I’m one commit ahead (merging the pull request I just created).

Okay, slightly annoying but no big deal. But if I now make a change to my repo and attempt to create a pull request to the upstream origin repo GitHub adds in my merge commit as part of the pull request. Well, ain’t that annoying.

Now I know GitHub has an article on syncing forks, I’ve used it successfully in the past. But this time I didn’t.

I’m also sure there are multitudinous answers to this question floating around on the internet but I’m not quite sure how to succinctly query for them. What exactly is the problem I’m having and will Google understand it? Unlikely.

So I appeal to my fellow humans who have these incredibly powerful brains to assist me in finding the answer to my question(s):

  1. Why does creating a pull request of changes from the upstream origin via GitHub make the fork one commit ahead?
  2. Why does this seem not to happen when one performs the command line method offered in GitHub’s syncing forks documentation?
  3. What should one do once one has this aberrant commit (which, granted, is empty, but still shouldn’t be pushing an empty commit)?

Why Does Yarn 2 Work This Way?

One of the larger reasons using node modules can be a nightmare is the amount of time wasted installing/uninstalling/reinstalling modules on a per project basis using npm.

Facebook’s Yarn 2 uses a different methodology for installing modules that should provide significantly faster module management, so I figured I’d give it a try.

The install instructions say thus:

Installing Yarn 2.x globally is discouraged as we’re moving to a per-project install strategy.

Fine, this is the way a lot of development software does things these days. It continues:

We advise you to keep Yarn 1.x (Classic) as your global binary by installing it via the instructions you can find here.

Wait a second, what? We are installing a legacy software application to manage our current application? If we are going to do this why not just use Yarn 2.x globally?

Unfortunately there is no explanation (nor link to an explanation) and I was not able to quickly surface (via a Google search) why this should be.

I assume that:

  1. Having Yarn 2.x installed globally and on a per-project basis might cause problems (or simply not work at all).
  2. Eventually Yarn 2.x will be installable on a per-project basis without the necessity for a global package manager.

Can anyone shed some light on why exactly this is the recommended route?

Can You Run Oracle’s VirtualBox on a Windows System with Microsoft’s Hyper-V enabled?

Every year or two I try running VirtualBox on a system with Hyper-V enabled and it goes poorly. Recently there was some hope that VB would run alongside Hyper-V…and I actually had this working for a split second. But when I updated to the latest Windows build it broke again.

Figured I’d share what I’ve learned here. Right now the information seems to be scattered around the web and it can take a while to follow the threads and figure out what the current status really is.

If you aren’t familiar with why VirtualBox (and other hypervisors) can’t run on a system with Hyper-V enabled check out this SuperUser Q&A.

The confusion is largely driven by VirtualBox’s own documentation which states: “Oracle VM VirtualBox can be used on a Windows host where Hyper-V is running.”

This did work on Windows 10 1809 but then was broken by Windows 10 1903 (the next release). For more details see this post over on the VirtualBox forums.

Currently there are only two ways to run VB and Hyper-V on the same machine – and they aren’t running simultaneously. One is to add/remove Hyper-V every time one wants to use VirtualBox and the other is to edit one’s boot records using BCDEdit, which requires a restart every time you make the switch. There is a free utility available that automates this process, but it still involves a reboot (I haven’t tried the utility yet).

If you are wondering why one would even want to run the two simultaneously there are at least two good reasons I know of: (1) WSL 2 requires Hyper-V and (2) Docker’s future on Windows involves utilizing WSL 2 and thus Hyper-V.

Note: I personally don’t use VMWare these days (have in the past) so this article focuses on VirtualBox and Hyper-V’s interactions but the problem holds true for VMWare as well.

If anyone hears of any new developments regarding this topic, I’d love to hear about them!

Automatically Adding Tests (e.g., Unit, Integration) to a Legacy Code Base

Many of us have written code that lacks tests to ensure code correctness and protect against human error. Most of us have worked with legacy code bases that have lacked these tests. Oftentimes the code has been written in a way that makes such testing quite difficult to add after the fact.

I’m curious if there are currently tools available that automatically add testing to legacy code bases? I understand that in many cases there may not be enough context from the code for the automated creation of fool-proof tests. For example:

a = 10
b = 23
while z < 100:
  t = (b + a) * 2

The variable names tell us nothing about what the values represent – are they ages? monetary values? temperatures? And z appears out of nowhere – potentially a value which is mutated numerous times before being called by this code. And so on…

While we might not be able to provide mathematically provable tests for this code could we not provide “good enough” tests in many instances? Example: If I wanted to ensure I wasn’t accidentally altering my code I could create a test with a limited (but sufficient) number of inputs to create a baseline.

In the example above this might include running the code with some series of z values like: 1, -10, 1.22, 5.88, 100, 100,000,000, 99, 99.887492421, etc. The output would then serve as a baseline. Lets say using these values it came out looking something like: 10, 100, 10, 50, 10,000,000,000, 990, 990, etc.

As I made modifications to the code the test could be rerun and the test would fail if inputting the same value for z resulted in altered outputs. For instance, if inputting -10 resulted in -100 instead of the expected baseline of 100.

This still leaves a human making the final determination on whether the failure is a correct result but at least makes the developer aware that a change has occurred.

Beyond these more difficult cases one will have code segments which are quite easy to test as the available inputs / expected outputs are known quantities. For example, this should be easier:

int myAge = 10;
int magicAge = 23;
int randomFactor = generateRandomNumber();
while randomFactor < 100:
  int theNewAge = (myAge + magicAge) * 2; 

In this case we have clearly limited input/output values (we know that the potential range of numbers is limited to those supported by the integer data type; assuming generateRandomNumber() is fairly self-contained we also should have a good idea of what values will be returned by the function and in a worst case still know that the valid value cannot be outside the range of an integer).

Okay, a bit of a long-winded question. To sum up: “Is there an automated way to add tests to legacy code bases?” with the caveat that, “Some tests need not be mathematically provable, only pragmatically useful.”

A Few Hints For Getting Portainer Running on Windows

Portainer is a GUI mean to make managing Docker easier. By default Docker is managed using mainly CLI tools and while this is all grand it can be a bit much for those who just need quick access for simple purposes.

I recently attempted to setup Portainer on my local Windows 10 Enterprise Edition PC using the basic installation instructions. I opened up PowerShell and ran:

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

And of course that didn’t work. Instead I was shown this error message:

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: pull access denied to portainer/portainer, repository does not exist or may required 'docker login': denied: requested access to the resource is denied. See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.

I tried authenticating without issue to Docker using docker login as recommended in above error. I reran the initial command again but received the same error. I decided to try pulling down the portainer image to my local machine without any attempt to run it:

docker pull portainer/portainer

Shouldn’t work right? It did! Now I rerun the initial command but Docker is still telling me it is “Unable to find image ‘portainer/portainer:latest’ locally”. It is at this point that I notice the Note in the installation documentation:

Note: the -v /var/run/docker.sock:/var/run/docker.sock option can be used in Linux environments only.

Oops. Okay, so how do I get Portainer running on Windows? Unfortunately the next instructions are for setting up Portainer on a Windows Docker Host running Windows Containers – but I’m trying to run Linux Containers on a Windows Docker Container. Still, I get a hint:

$ docker volume create portainer_data 
$ docker run -d -p 8000:8000 -p 9000:9000 --name portainer --restart always -v \\.\pipe\docker_engine:\\.\pipe\docker_engine -v portainer_data:C:\data portainer/portainer 

Note in the above the highlighted portion. Here we see that portainer_data has been specified using a Windows rather than *nix path as in our original command. So I swap this Windows path into my original command (forgetting, btw, to change out the -v /var/run/docker.sock…):

docker run -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v C:\ProgramData\Portainer:/data portainer/portainer

Now I’m getting another error…

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: Mount denied: The source path "C:/ProgramData/Portainer" doesn't exist and is not known to Docker..."

Some Googling done I stumble upon Issue #2575 on GitHub for the portainer repository. And then Manuel Patrone’s question on the Docker Forums. Based on this my understanding is that the issue is two fold:

  1. When we use a *nix path when setting up the data location for Portainer it becomes a local path within the Docker VM on Windows (but theoretically fixed this by changing the path to a Windows path above)
  2. For some reason Docker/Portainer attempt to save the Docker image to C:\ProgramData\Portainer where no such folder exists and Windows isn’t too happy to create one.

So I make one last change to my command:

docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v C:\Portainer:/data portainer/portainer

And it works beautifully. I’m able to launch Portainer, setup my admin password, and begin navigating around the UI. You’ll note in the above that I set the path as C:\Portainer instead of inside C:\ProgramData. This path could be anywhere, but I figured setting it outside of ProgramData might save me some pain in the future (or not).

You may also note that my command is still technically incorrect. According to the Portainer documentation I should have replaced /var/run/docker.sock:/var/run/docker.sock with \\.\pipe\docker_engine:\\.\pipe\docker_engine – since the former only runs on Linux according to the Portainer documentation.

Why is this working? I don’t know. Maybe I’ll go back and rerun it later using the correct path, but it is worth noting that the pipe path used is only available in 1803+ versions of Windows, so if you have something before that you’ll need to (1) upgrade (I would), (2) use the Linux command as I did above, or (3) find some other command that works pre-1803.

I hope this rambling journey helps others who may find themselves running into the same issue.

A New Take on Classic Programmer’s Humor.

Cayla Belser, a great friend and very talented artist, created a new take on a piece of classic programming humor I’ve used as my Facebook cover for some time now. I figured I’d share it with everyone, along with what the original looked like.

Here is Cayla’s creation:

A joke about programming, with a grumpy cat.

Illustration by Cayla Belser

Here is the original:

Programming Humor Comic with Grumpy Cat

This is the older version of the programming humor comic, its original author lost to the ages.


A Development Journey


I’m working on a project…and this is just a post for me to chronicle thoughts about this project. Read if you so desire…

I have not yet started actual code development, I have given myself until July 1st to acquire additional knowledge and skills in various technologies. Starting July 1st I’ll begin composing code, whether I feel entirely prepared or not (I have a tendency to want to forever learn more), though I will continue learning as I go.

[Suggestions for better methods, technologies, books, etc. are welcomed]

[See the end of this post for a change log].


  • I have a background in Systems Administration but am trying to utilize IaaS and SaaS services as much as possible to allow for more focus on the development of the application.
  • I’ve been accepted into the Microsoft BizSpark program which provides a number of different benefits including significant ($750) credits monthly for Microsoft Azure services.
    • Microsoft Azure Web Apps – For static content hosting (HTML, CSS, JavaScript).
      • Microsoft abstracts away the underlying VM, OS, IIS, etc. letting one focus on the application layer.
      • It easily scales to multiple systems, allowing for robust scaling capabilities.
      • It integrates Application Request Routing (ARR) which is essentially load balancing, intelligently distributing requests to available assets.
    • Microsoft Azure SQL Database – For database back-end.


Potential Technologies:

  • jQuery
  • AngularJS
  • SASS

Transactional Email Providers

4Other providers which don’t fall within the price range listed below (are higher) include Postmark. Zapier provides a great guide on transactional emails.

  • Mandrill – First 12k/mo. free, $.20/1k additional.5I currently utilize Mandrill, which I found via Mailchimp, which I already loved.
  • Mailgun – First 10k/mo. free, $.50/1k additional.
  • SendGrid – First 12k/mo. free, $.10/1k additional.
  • Amazon SES – First 62k/mo. free (if you have EC2), $.10/1k additional (but doesn’t include bandwidth charges).

Spam Filtering Providers

  • Akismet – $5/mo. for 75k checks.
  • CleanTalk – $8/yr. for unlimited checks.
  • MolloM – $41/mo., unlimited spam checks, 1k legitimate/day.

Additional Potential Malicious User Prevention Providers

End Product

  • Initial:
    • Extension for Google Chrome.
    • Server Back-End Processing App.
    • Web Administration Console.
    • End User (Type I) Web Administration Console.
    • End User (Type 2) Web Administration Console.
  • Eventual:
    • Creation of an API.
    • Extension for WordPress.
    • Extension for Mozilla Firefox.
    • Extension for Microsoft Edge.

Learning Resources


  • Visual Studio 2015 Pro
  • Microsoft Visual Studio Online

Books to Read / Currently Reading

  • Steve McConnell. Code Complete, 2nd ed. Microsoft Press, 2004.
  • Dan Pilone; Russ Miles. Head First Software Development. O’Reilly Media, 2007.
  • Eric Freeman; Bert Bates; Kathy Sierra; Elisabeth Robson. Head First Design Patterns. O’Reilly Media, 2004.
  • Andrew Hunt; David Thomas. The Pragmatic Programmer. Addison-Wesley Professional, 1999.
  • Potential:
    • Frank Tsui; Orlando Karam; Barbara Bernal. Essentials of Software Engineering, 3rd ed. Jones & Bartlett Learning, 2013.
    • Brett McLaughlin; Gary Pollice; David West. Head First Object-Oriented Analysis and Design. O’Reilly Media, 2006.
    • Richard Monson-Haefel. 97 Things Every Software Architect Should Know. O’Reilly Media, 2009.
    • Frederick P. Brooks, Jr. The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition. Addison-Wesley Professional, 1995.
    • Chad Fowler. The Passionate Programmer. Pragmatic Bookshelf, 2009.
    • Neal Ford. The Productive Programmer. O’Reilly Media, 2008.
    • Rod Stephens. Beginning Software Engineering. Wrox, 2015.
    • Sergey Barskiy. Code-First Development with Entity Framework. Packt Publishing, 2015.
    • Raul Sidnei Wazlawick. Object-Oriented Analysis and Design for Information Systems. Morgan Kaufman, 2014.
    • Lars Powers; Mike Snell. Microsoft Visual Studio 2015 Unleashed, 3rd ed. Sams, 2015.


  • Have Attended:
    • May 18th – Microsoft Build Tour – New York City.
    • May 28th – Google I/O Extended: New Jersey – Montclair State University.
  • Really Want To / Hope To / Will Attend:
    • What should I…?
  • Might Attend:
    • July 20th-22nd – DevCon 5 – New York City.
    • Sept. 28th – Oct. 1st – Visual Studio Live! – New York City.
    • Oct. 2nd – GothamGo 2015 – New York City.

Existing Projects

Two of my long-term projects are Layered Bible and Open Source Scriptures. I have chosen to temporarily redirect the vast majority of my free time and energy to this project (which shall rename unnamed) due to its potential for creating significant revenue which could be reinvested (at least in part) into the above named projects. I haven’t abandoned these projects, this is an endeavor to further and accelerate them.

Change Log

  • 7/3/15
    • Added information about Azure Web Apps.
  •  6/13/15
    • Added section for other resources, added MSDN Code Samples links.
    • Added a bunch of additional sites/articles to other (learning) resources.
  •  6/12/15
    • Update 2:
      • Added link to article on EF Code-First.
    • Update 1:
      • Added OWIN and Oauth references.
      • Moved ASP.NET Identity from Potential Technologies to actual technologies.
      • Added ASP.NET Web API under Potential Technologies.
      • Added transactional mail providers section.
      • Added spam filtering providers section.