Skip to content

Instantly share code, notes, and snippets.

View StevenCHowell's full-sized avatar
🧙
Working magic

Steven C. Howell StevenCHowell

🧙
Working magic
View GitHub Profile

Keybase proof

I hereby claim:

  • I am stevenchowell on github.
  • I am stevenchowell (https://keybase.io/stevenchowell) on keybase.
  • I have a public key ASCBr41CfrpBRhlx4ksx9Uw6FV-OCypKVNU9ohbFm9RQtgo

To claim this, I am signing this object:

@StevenCHowell
StevenCHowell / pool_update_xml_queue.py
Last active July 18, 2022 16:09
Demo performing parallel tasks with a queue for logging progress.
"""Demo performing parallel tasks with a queue for logging progress."""
import datetime
import multiprocessing as mp
import time
from collections import namedtuple
from xml.dom import minidom
import psutil
from lxml import etree
@StevenCHowell
StevenCHowell / scale_hex.py
Created July 13, 2017 20:23
Scale a Hex color in Python
# Adapted from Thadeus Burgess' Python 2 code
# http://thadeusb.com/weblog/2010/10/10/python_scale_hex_color/
def clamp(val, minimum=0, maximum=255):
if val < minimum:
return minimum
if val > maximum:
return maximum
return val
@StevenCHowell
StevenCHowell / pegs.py
Created April 5, 2017 03:02
Playing at PyData: Pegs
#----------------------------------------------------------------------
def find_non_zero(row, small=1e-5):
n = len(row)
for i_col in range(n):
if abs(row[i_col]) > small:
return row[i_col]
def normalize(row):