Net 5 is finally here! Official announcement.

Let’s test it out by writing the famous Hello word console app.

Getting started

  • Download Visual studio 16.8
  • Create a new .Net core application
  • Open your project settings file and change the target framework to .Net 5 as illustrated below:
.Net 5 Console app example
  • Add this code to Program.cs
C#9 Hello world app
  • Now go ahead and run this masterpiece!
  • You can read more about .Net 5 and C#9 here

Easy way to manage python virtual environments.


  • Python 3.x or Python 2.7.x
  • pip (Python package installer)

1. Installation

  • Use pip to install pipenv
$ python -m pip install --upgrade pipenv$ pipenv --version  # Verify installation

2. Create a new pipenv project

  • There are multiple ways to create projects using pipenv. Examples:
# i. Creates new project using the latest version of python 2x or 3x$ pipenv --two
$ pipenv --three

# ii. Using a specific python version
$ pipenv --python 3.6.5

# iii. Specify a path where python is installed
$ pipenv --python /path/to/python

3. Manage project dependencies

  • The project dependencies are stored inside the Pipfile
  • Example:
$ pipenv install requests
  • It’s also possible to install dependencies that will be used in the development environment only.
  • Example:
$ pipenv install --dev pytest
Example Pipfile


A brief comparison of networking modes in Oracle Virtualbox.


  • NAT(Network Address Translation) mode is the default mode when you spin up a new virtual machine(vm) on virtual box.
  • This mode allows the vm to communicate with the ‘internet’ by using the host machine as a proxy
Figure 1: Virtualbox default networking mode
  • Communication to the vm can be made by configuring port forwarding through the vritualbox GUI or a CLI tool such as Vagrant.
# Example (using vagrant) "forwarded_port", guest: 22, host: 2222
  • This means all traffic to port 2222 on the host will be forwarded to port 22 of the vm.

NAT Network

  • Instead of creating…

Example: Say you have an authentication API, that receives a JSON request to register a new user.

How would you log events that occur in the end-to-end new user registration process? Here’s how I would do it:

  • The arrows represent the setting on your logger instance
  • For example, if you set the level to DEBUG, you will see all the logs in your logs.
  • If you set it to warn, you will only see warning, error and fatal logs. Assuming you are using a single logging instance(i.e. All logs go to a single log file)

Using multiple loggers

  • If you use multiple logging…

Reference: pyinstaller home

Question: How do you go from python -verbose to just myscrpt -verbose? Follow along to find out!

Before we begin

  1. Install the required packages
$ pip install --upgrade pyinstaller

2. Add the python scripts folder to the system path if you have not done so already

The basics

  1. Basic usage
$ pyinstaller <your-script>.py# output(s):
# <your-script>.spec - Default settings used to generate exe
# build/ - Build artifacts e.g. build logs
# dist/ - contains <your-script>.exe + python dependencies

2. Useful options

  • — name | Specify the name of the generated executable
  • — onefile | Bundle all binary artifacts into…

This simple guide will show you how you can use pyinstaller and argparse to create a simple console application with python.

Required tools

$ pip install --upgrade psutil
$ pip install --upgrade pyinstaller

Lets try this out by creating a simple console app that will list processes or applications that are currently running on your PC.

  1. Create a python script named from github.gist
  • We use psutil.process_iter([‘pid’, ‘name’]) to get a list of all processes running on a machine
  • The argparse ibrary allows the user of our script to specify…

Useful commands you will need when using vagrant

Before we begin: Make sure vagrant is installed in your machine and added to the path. To verify, run vagrant -v and make sure you get a version number of the vagrant version installed on your machine.

Reference: Vagrant Official Docs

TOP 10

  1. vagrant init
  • Initialize a new vagrant environment by creating a new Vagrantfile if it does not already exist.
# Syntax: vagrant init [name [url]]
# name = name of the box to create i.e.
# url = url to download the box from
# Example:
$ vagrant init my-company-box https://boxes/

2. vagrant up

# Syntax: vagrant up [name|id]

WPF DataGrid Control — Provides flexible a way to display collection of data in rows and columns

  • In simple terms a DataGrid is a customizable grid used to display data collections
  • The DataGrid control also provides some useful built in functionalities for data display, i.e.

# Sorting # Grouping # Filtering etc.

This article assumes you have some exposure to WPF and common data display controls such as ListBoxes,ListViews etc.

1. Basic DataGrid — Auto-generated Columns

  • If you only want to display you data collection, the code below is sufficient to get you started. Full source code.
Basic DataGrid from Observable collection
  • By default the DataGrid…

The term control is generally used to refer to any visual element in a WPF application. Technically this can imply that the element inherits the Control class.

  • A WPF application can be defined loosely as a nested grouping of control elements inside layout panels encapsulated by a single root element, i.e. Window or Page
A simplified model of a WPF application

Layout Panels

  • As mentioned above, UI elements or controls are arranged inside layout panels which inherit form the Panel class.
  • The most common panels in WPF are:

Grid: Child controls are positioned using rows and columns.

StackPanel: Child controls are stacked along a single axis( x or y).

Disclaimer: This is article only covers the C# concepts that are prominent when developing WPF applications. If you are looking for a full C# course, please visit the official Microsoft docs.

This article continues from this article.

2. C#

  • C# is an object oriented based language developed by Microsoft.
  • The main concepts that you need to understand to effectively use WPF are:

2.1. Events & Delegates

  • Delegate — “A reference type that can be used to encapsulate(or point to) a method”
// This delegate can point to any function with a return type of //void and one string argumentpublic delegate void TestDelegate(string arg);// We…

Ndamulelo Nemakhavhani

Former Glorified Electrician(aka Electrical Engineer). Now a Software Developer working on complex Enterprise Software. Lets connect on twitter @NdamuleloNemakh

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store