Some little scripts I've found useful for development.
git-watch
retriggers a command when your git repo
changes, so can give interactive rebuilds like
ibazel
except I found that
https://github.com/bazelbuild/bazel-watcher didn't
work for me at all. This is also completely agnostic
to the command, so can be used with CMake as well,
for instance.
I recently built a small agent-based model using Python and wanted to visualize the model in action. But as much as Python is an ideal tool for scientific computation (numpy, scipy, matplotlib), it's not as good for dynamic visualization (pygame?).
You know what's a very mature and flexible tool for drawing graphics? The DOM! For simple graphics you can use HTML and CSS; for more complicated stuff you can use Canvas, SVG, or WebGL. There are countless frameworks, libraries, and tutorials to help you draw exactly what you need. In my case, this was the animation I wanted:
(Each row represents a "worker" in my model, and each rectangle represents a "task.")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
example of consuming insns.xml | |
''' | |
from xml.etree.ElementTree import ElementTree | |
class Instructions: | |
def __init__(s): | |
s.root = ElementTree(file = 'insns.xml') | |
def dump(s): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Image Pyramid Demo</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no"> | |
<script src="pyramiddemo.js"></script> | |
<style> | |
body { |