Saturday, March 21, 2020

Learning F# - Step 1

With COVID-19 forcing everyone inside and cancelling events, I suddenly find myself with a lot of extra time. For the first few days, I just enjoyed having my weeknights free. Now, I want to use that time to learn something new. There are several things that I may bite off, but I've decided to start by learning F#.

F# is the functional programming language created by Microsoft. I was surprised to find out that it is baked into the .NET SDK that you download to create .NET Core applications! That fact is what prompted me to learn F#.

To get started with F#, you need to download the latest .NET Core SDK. Once you have .NET Core installed, you can get started!

Before I dive in, I wanted to share a little bit about how I approach learning a new programming language. I like to learn technology by doing things. With programming, I like to write code that solves problems. Quite often they are problems that I've solved over and over again, but they are still problems. When I approach a programming language, I want to do the following things:

  1. Create a Hello World program.
  2. Understand how projects are set up in the language.
  3. Learn unit testing in the language.
  4. Learn to work with the file system in the language.
  5. Learn to work with a database in the language.
  6. Learn to make web API calls in the language.
  7. Start learning the "particulars" of the language.
Using this approach allows me to start using the new programming language for real-life tasks, which helps my brain learn better.

Now that we know what language we are going to learn and how we are going to learn it, let's get started!

I have the latest .NET Core SDK installed on my box. To create the "Hello World" program, create a directory named FSharpHelloWorld. Change directory into FSharpHelloWorld, then all I have to do is:

dotnet new console --language f#
This simple command-line call creates a basic F# program that prints "Hello World" to the screen. Unfortunately, Microsoft created the Hello World program for me. In the directory, you should see the following 3 files listed:
obj
FSharpHelloWorld.fsproj
Program.fs
The FSharpHelloWorld.fsproj file is the "project" file that tells the SDK what to build and how to build it. (I'll dive into this file more in my next post.) The obj directory holds build artifacts. The Program.fs file is the code file that will get compiled and run. Inside the Program.fs file, you should see:
// Learn more about F# at http://fsharp.org

open System

[<EntryPoint>]
let main argv =
    printfn "Hello World from F#!"
    0 // return an integer exit code
The words "main" and "argv" look familiar to me as a C# developer, but the rest is a little foreign. I assume the "printfn" is something like a Console.WriteLine statement. The comments give me hints about the other line of the program. Since I have to feel like I've written code, I modify the text after "printfn" to read "Hola Mundo!" Next, I run the program by issuing the following command in my folder:
dotnet run
Lo and behold, I see
Hola Mundo!
printed on the screen!

So, what did I really accomplish? First, I was able to set up the basic SDK and get a simple environment up and running. Second, I was able to generate a simple program and make it run. Third, I was able to modify the program and have it run without compilation or runtime errors. I would say I have accomplished a lot!

Future posts will track my progress learning F#!

Wednesday, August 7, 2019

Google Search Tips

I found this article with some handy Google search tips. I'm putting it here so I can find it again.

Wednesday, July 3, 2019

Gaining Root Access on Windows Subsystem for Linux

Recently I corrupted my /etc/sudoers file in bash on Windows Subsystem for Linux (WSL). I was unable to fix the file from the bash prompt because the corrupted file prevented me from running anything with elevated privileges. I found the commands below from this post.

wsl -u root
# nano /etc/sudoers

Friday, September 14, 2018

Notes on User Story Breakdown

This post is really for myself to capture the links and information from a Twitter thread with me, Ron Jeffries, and Neil Killick. The original thread is here.

The Twitter thread started after I read this article by Ron Jeffries about developers abandoning agile. I asked about teaching developers how to break down stories. That question led to a reference to this article by Neil Killick. One take-away from the article is the quote "We learn what we will build through the story - we don't build the story itself." To me this is a succinct way to approach user stories to get at thin vertical slices.

My other take-away is the example in the article around the user story "Enable customers to pay their bills online." The example made the approach real to me.

The Twitter thread also referenced The Hamburger Method by Gojko Adzic and the Elephant Carpaccio Exercise by Alistair Cockburn.

Monday, May 14, 2018

Microsoft Build 2018 Trip Report

Microsoft Build 2018 Report

Overall View

The conference was good, but didn't seem as good as Ignite was 2 years ago.

On the good side, the conference center was easy to access and navigate. Restrooms were plentiful and didn't seem as overcrowded as one would expect from a large tech conference. There was live music playing in the conference center all three days, and the music was very good. Sessions were located well, meaning that there was ample seating for the sessions that I attended.

Another really good aspect to the conference was networking. I had a chance to catch up with a few former employees and keep those connections going. I was able to meet up with tech leaders from some of our sister companies, and that was great. On a tip from my CTO, I talked to the Azure AD people and learned that we may be able to use the Azure AD B2C service for identity management cheaper than our current provider.

On the negative side, the food was awful. The lunch meals were lackluster, and there was no breakfast. Coffee wasn't served until after the first session or two in the morning, and that makes for grumpy attendees. Registration Monday morning took a LONG time to get a badge and t-shirt, making it almost impossible to catch the first part of the opening keynote. The combination of slow registration and limited seating forced me to attend the opening keynote in an overflow room. I could have had a better view watching it from home.

Session Summaries

Below are the summaries of the sessions I attended, or at least what I took from the sessions.

Future of Visual Studio

Amanda Silver, Kendra Haven, and Anthony Cangialosi

  • VS Code is more popular than Visual Studio.
  • Visual Studio supports side by side installation.
  • Using source-based discovery for unit tests instead of assembly-based discovery.
  • Supports a "watch" functionality where unit tests will automatically run.
  • Can step into code from a NuGet package (Source Link).
  • More editor configs are available.
  • Performance improvements for git branch switching.
  • Can work with pull requests directly in Visual Studio.
  • Debugging support from a code dump (or trace).
    • Can capture what occurred in prod.
    • Using the captured dump, can step through code as the steps occurred.
    • I'm not sure how the trace or dump is created.
  • "Time Travel Debugging"
    • Allows you to step backward through the stack.

.NET Overview

Scott Hanselman and Scott Hunter

  • .NET Core 2.1 RC was made available.
  • .NET Compatibility Pack provides some functionality that is still not supported in .NET Core (i.e. Directory Services).
  • .NET SDK works on Raspberry Pi.
  • There is an embedded HTTP "browser" that support Postman-like calls
  • Has a UI that works with Swagger to exercise API calls.
  • .NET 3.0 will support WPF and WinForms.
  • New refactorings for things like transforming LinQ queries to for each calls.
  • ML.NET was released; OSS machine learning framework.
  • Blazor is .NET running in WebAssembly in the browser.

AI for Earth

Jennifer Marsman

  • Right now, this is mostly a grant program to get researchers using AI for Earth.
  • Has some REST APIs exposing cognitive services for the earth.
  • Starting to do some machine learning based research around the spread of disease and tree cover mapping.

Building Event-Driven Serverless Apps w/ Azure Functions and Azure Containers

Rafat Sarosh and Luis Bosquez

  • There is a CLI tool for working with and developing Azure functions.
  • CosmosDB provides a Change Feed for detecting and working with changes.
    • Provides all changes made to CosmosDB in the order they were made.
    • Change Feed is on by default.
    • The Change Feed is persistent.

Empowering the Quantum Revolution with Q#

John Azariah and Julie Love

  • Q# is inspired by functional programming.
  • Supports first-class functions.
  • Is a strongly-typed system.
  • Being created to support the eventual existence of a quantum computer.
  • Microsoft is working hard to create a scalable quantum computer.

Meet the New Stack for Real-Time We Communication: ASP.NET Core SignalR

Damian Edwards and David Fowler

  • This was mainly live coding and was EXTREMELY entertaining!
  • Javascript SignalR client has been rewritten so that it doesn't use jQuery.
  • The Javascript client and C# client look the same.
  • SignalR uses Kestrel as the "communication" engine.
  • There have been a LOT of performance improvements made to Kestrel.
  • SignalR supports JSON and MessagePack message protocols.
  • Can support additional protocols if someone needs to create something different.
  • Default networking protocol is HTTP, but can support raw TCP now.
  • Additional networking protocols can be created too.

The Future of C#

Mads Torgersen and Dustin Campbell

  • There have been many performance improvements.
    • Many of them have enabled integration with unsafe code in a safe way.
  • Span allocates T in such a way that the memory isn't copied excessively.
  • Introducing a Range operator, very similar to the one in Python.
  • My observation: Many of the changes is that many were done to improve the performance of Kestrel and SignalR.

Demystifying Machine and Deep Learning for Developers

Seth Juarez and Chris Lauren

  • Seth did a GREAT job explaining enough of the math behind data science to make it less scary.
  • I didn't take many notes because I plan on re-watching the video.
  • There is a new "standard" for sharing model data called ONNX. I need to explore this more.

Inside Azure DataCenter Architecture with Mark Russinovich

Mark Russinovich

  • It was interesting seeing how the Azure data centers are set up and configured.
  • Most of the content of this talk should be more publicized because it is cutting-edge research.
  • 2 projects caught my attention:
    • Project Silicia -> storage on panes of glass.
    • Project Palix -> data storage using DNA.

Hybrid multi-cloud Strategies Using Terraform OSS with Azure

Arun Chandrasekhar, Damien Caro, and Tom Harvey

  • I missed the first 5 minutes of this session, and had a hard time catching up.
  • There looks to be some interesting stuff in Terraform, but I couldn't piece it all together.
  • I need to investigate Terraform more.

Looking Ahead with SQL Operations Studio

Ken Van Hyning and Alan Yu

  • It was stressed that SSMS is NOT going away.
  • This tool was created to help support running SQL Server on Linux.
  • The project is a fork of Visual Studio Code.
  • They have some visualizations built-in to the tool.
  • They are very excited to get contributions. ** Seems like everyone who wants to contribute doesn't know C#.

Amplify Your Awesome

Donovan Brown, Lorraine Bardeen, Raymond Chen, Chris Jackson, Jennifer Marsman, Jessica Payne

  • This was a series of 6 "lightning" talks around self-improvement.
  • It was neat seeing the auto-advancing slides.
  • For one of the last sessions of the conference, it was packed.

Other Take-Aways

I spoke with someone at the Azure AD booth. She talked to me about the B2C program, and it sounds like a program we should pursue.

Wednesday, January 3, 2018

Installing OpenSSH Client and Server on Windows 10

I've been trying to install the Beta version of the OpenSSH Client and OpenSSH Server on Windows 10 without luck. The feature simply didn't appear as an option for me.

After ensuring all Windows updates were applied, I finally stumbled on this article. I found this article when searching for the error code 0x800f0954 that I received when the Developer Mode package wouldn't install correctly. I followed the recommendation to modify the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AUUseWUServer" from 1 to 0. After making this change and restarting my machine, the Developer Mode package installed correctly and OpenSSH Client and OpenSSH Server became options I could install.

Friday, November 17, 2017

SQL Operations Studio on Mac

Microsoft recently released SQL Operations Studio for the Mac. It is a SQL Server management tool based on VS Code. I was lukewarm about this release because I use a Mac that is not associated with our domain and the SQL Servers I interact with don't have SQL Login enabled. After a little internet searching (i.e. Google), I found that I could issue Kerberos tickets via the command line and authenticate to Windows domain resources with Windows Authentication. Woo Hoo!

Unfortunately, this didn't work when I tried it. I was able to issue the Kerberos ticket using the instructions below, but SQL Operations Studio would not proerly authenticate. After a little more internet searching (i.e. Google again), I found this issue on Github. One of the comments on the issue recommended using all caps for the information entered in the command to issue the Kerberos ticket. That tidbit is exactly what was needed. I can now access SQL Servers using Windows Authentication using SQL Operations Studio on my Mac!

Instructions for Using Windows Authentication with SQL Operations Studio

  1. Open a terminal window.
  2. Type the following command:
    kinit USERNAME@DOMAIN.COM
  3. Ensure the command issued above uses all caps for the domain information.
  4. Open SQL Operations Studio.
  5. Connect to a database using Windows Authentication.
  6. Enjoy!