Skip to content

Instantly share code, notes, and snippets.

View GER-NaN's full-sized avatar

Gerald Eckert GER-NaN

View GitHub Profile
@GER-NaN
GER-NaN / gist:76607cd0b6e67f3a736a
Created August 29, 2014 15:43
Check .Net Framework updates
//Determine Which .NET Framework Updates Are Installed
public static string DotNetUpdates()
{
String retVal = "";
using (
RegistryKey baseKey =
RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)
.OpenSubKey(@"SOFTWARE\Microsoft\Updates"))
{
@GER-NaN
GER-NaN / Grid2d.cs
Last active January 4, 2017 17:53
Classes for handling points in a 2d Grid
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class Grid
{
public List<Tile> Tiles;
public int Width;
public int Height;
@GER-NaN
GER-NaN / Line.cs
Created December 29, 2016 16:12
Represents a line in the form ax + by = c (in progress)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class LineT
{
public double A;
@GER-NaN
GER-NaN / PointD.cs
Last active December 29, 2016 19:27
Point class with misc functions (In Progress)
using System;
/// <summary>Represents a Point in 2D space using double to store coordinates.</summary>
public struct PointD
{
public readonly double X;
public readonly double Y;
public PointD(double x, double y)
@GER-NaN
GER-NaN / Node.cs
Last active December 30, 2016 19:57
Node class
/*
https://msdn.microsoft.com/en-us/library/ms379572(v=vs.80).aspx
An Extensive Examination of Data Structures Using C# 2.0
Visual Studio 2005
Scott Mitchell
4GuysFromRolla.com
Update January 2005
@GER-NaN
GER-NaN / NodeList.cs
Created December 30, 2016 19:56
List of Node
/*
https://msdn.microsoft.com/en-us/library/ms379572(v=vs.80).aspx
An Extensive Examination of Data Structures Using C# 2.0
Visual Studio 2005
Scott Mitchell
4GuysFromRolla.com
Update January 2005
@GER-NaN
GER-NaN / GraphNode.cs
Created December 30, 2016 19:58
A GraphNode class
/*
https://msdn.microsoft.com/en-us/library/ms379574(v=vs.80).aspx
An Extensive Examination of Data Structures Using C# 2.0
Visual Studio 2005
Scott Mitchell
4GuysFromRolla.com
Update January 2005
@GER-NaN
GER-NaN / Graph.cs
Created December 30, 2016 19:59
Graph class
/*
https://msdn.microsoft.com/en-us/library/ms379574(v=vs.80).aspx
An Extensive Examination of Data Structures Using C# 2.0
Visual Studio 2005
Scott Mitchell
4GuysFromRolla.com
Update January 2005
@GER-NaN
GER-NaN / hashbytes.sql
Created January 9, 2017 14:19
Using HASHBYTES to calculate decent checksums on table
--Example hashbytes on states table
--https://msdn.microsoft.com/en-us/library/ms174415.aspx
--RoewLength and RowSize were added just for debugging purposes
SELECT
Id = tbl_states.state_id,
Hash = HASHBYTES('MD5', (SELECT tbl_states.* FROM (VALUES(null))X(Y) FOR XML AUTO)),
RowLength = LEN( (SELECT tbl_states.* FROM (VALUES(null))X(Y) FOR XML AUTO)),
RowSize = DATALENGTH( (SELECT tbl_states.* FROM (VALUES(null))X(Y) FOR XML AUTO))
FROM
@GER-NaN
GER-NaN / PointExtensions.cs
Created January 10, 2017 14:40
Extensions to the System.Drawing.Point class
using System;
using System.Drawing;
//Extensions to the System.Drawing.Point class
public static class PointExtensions
{
/// <summary>Formatted as (x,y) where x and y are the unformatted value.</summary>
public static string PrintStr(this Point p)
{