Skip to content

Instantly share code, notes, and snippets.

View cobergmd's full-sized avatar

Craig Oberg cobergmd

View GitHub Profile
@cobergmd
cobergmd / gist:08dab635efc1708fe3d39a7fab6f5b34
Last active May 15, 2018 13:42
Allocate a VSAM linear dataset
//MTBGLDSX JOB 43312,'CJO',
// CLASS=C,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID,TIME=1,REGION=4096K
//*
//* ALLOCATE A VSAM LINEAR DATASET
//*
//CLUSTPG EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DIVPAK DD UNIT=3390,VOL=SER=SYSDA,DISP=(NEW,CATLG)
//SYSIN DD *
@cobergmd
cobergmd / manhattan.sql
Last active May 15, 2018 13:40
SQL Manhattan Distance
-- Manhattan Distance
-- |a - c| + |b - d|
select
format(abs((min(lat_n) - max(lat_n))) + abs((min(long_w) - max(long_w))),'F4')
from latlongs
@cobergmd
cobergmd / euclidian.sql
Created May 15, 2018 13:41
SQL Euclidian Distance
-- Euclidian Distance
-- a = min lat
-- b = max lat
-- c = min long
-- d = max long
-- sqrt ( square(B - A) + square(D - C) )
select
format (sqrt(square(max(lat_n) - min(lat_n)) + square(max(long_w) - min(long_w))),'F4')
@cobergmd
cobergmd / extract_backup.ps1
Last active May 15, 2018 15:25
Database Extract and Backup
#=========================================================================
# Database Extract and Backup -
# This script will make create/insert SQL for user tables and data,
# execute it to create a new database and create a BAK of the new database.
#=========================================================================
# The directory where the BAK will be saved
$BACKUPDIRECTORY = "c:\temp"
# The number of INSERTs in a transactional batch
$BATCHSIZE = 50
@cobergmd
cobergmd / musicnotes.html
Created January 5, 2020 15:27
Music Notation with Bravura Text and Unicode
<!DOCTYPE html >
<html lang="en">
<head>
<meta charset="utf-8">
<style>
@font-face {
font-family: "BravuraText";
src: url(BravuraText.woff);
}
.notes {