Skip to content

Instantly share code, notes, and snippets.

View JerryNixon's full-sized avatar
🤔
Trying to make a living.

Jerry Nixon JerryNixon

🤔
Trying to make a living.
View GitHub Profile
@JerryNixon
JerryNixon / demo.cs
Created July 18, 2022 23:13
CIS-230-01 Week 05 Internet research
using System.Drawing;
// read file as bytes
var path = @"c:\dev\ent.png";
var bytes = File.ReadAllBytes(path);
// save as text
@JerryNixon
JerryNixon / demo.cs
Created July 18, 2022 23:07
CIS-230-01 Week 05 Assignment Demo
using System.IO;
var path = @"c:\dev";
Directory.Delete(path, true);
Directory.CreateDirectory(path);
var array = new[] { "a", "b", "c" };
for (double i = 0; i < 500; i = i + .35)
@JerryNixon
JerryNixon / csv.cs
Created June 1, 2022 17:42
Read a CSV
using Microsoft.Azure.WebJobs;
using System;
using System.Collections.Generic;
using System.Linq;
public static class Csv
{
public static IEnumerable<T> Read<T>(ExecutionContext context, string file) where T : new()
@JerryNixon
JerryNixon / code-terms.txt
Last active May 26, 2022 20:18
.NET Coding Terms
NuGet
WinGet
GitHub
Git versus GitHub
Visual Studio Code
Visual Studio Code versus Visual Studio
Visual Studio Version
Visual Studio Edition
Visual Studio Architecture
@JerryNixon
JerryNixon / UnitTest.cs
Last active March 8, 2022 21:03
Write your own unit test framework
using System;
using System.Linq;
using System.Collections.Generic;
using JerryUnit;
using static JerryUnit.UnitTestAttribute;
public class Program
{
public static void Main()
@JerryNixon
JerryNixon / graph.puzzle.md
Last active January 31, 2022 23:28
Triple constrained Edges in a Graph

Scenario

  1. Every Store (wants) every Product
  2. Every Warehouse (Has) every Product
  3. Stores (Must_Use) certain Warehouses for certain Products.

Problem

  1. A graph Edge only references two Nodes: from & to
  2. How can we constrain an Edge to a third Node (Product)

Solution

@JerryNixon
JerryNixon / data_lake_delta_tables.py
Last active November 4, 2021 19:31
Snoop all the delta tables in your data lake
# Databricks notebook source
# COMMAND ----------
%py
def recurse(path: str) -> [str]:
def is_delta_path_valid(path: str) -> bool:
try:
return [] != [x for x in dbutils.fs.ls(path) if x.isDir() and x.name == "_delta_log/"]
@JerryNixon
JerryNixon / CreateExternalTables.py
Created August 31, 2021 21:29
Databricks reusable routine to create External tables
class Data(dict):
__getattr__, __setattr__ = dict.get, dict.__setitem__
tables = [
Data(
path = "abfss://name@acct/path1",
database = "my_db",
table = "table1",
),
Data(
public class Program
{
static void Main()
{
BenchmarkRunner.Run<Harness>();
}
}
public class Harness
{
public class Program
{
static void Main()
{
BenchmarkRunner.Run<Harness>();
}
}
public class Harness
{