Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott W Harden swharden

View GitHub Profile
@swharden
swharden / Form1.cs
Last active Apr 19, 2020
render graphics outside the GUI thread
View Form1.cs
/* The goal of this program to demonstrate how to use threading to
* continuously render a CPU-intensive graphics without blocking the GUI thread.
* This program works, but I am not yet sure if this is the best way to implement this...
*/
using System;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
@swharden
swharden / version.py
Created Jan 19, 2020
Simple semantic versioning class for Python
View version.py
class Version:
def __init__(self, versionString):
"""semantic version (major.minor.patch)"""
self.setString(versionString)
def __str__(self):
return f"{self.major}.{self.minor}.{self.patch}"
def setNumbers(self, major=None, minor=None, patch=None):
self.major = int(major) if major else self.major