My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

This project is a repository for things I've developed over the years for my various hobbies. To get to the actual content, click on the Downloads link. I use the revision date in the file names, so don't create a link to one of the files, as it may be deprecated and replaced by a later version.

The main categories are:

  • Computer utilities
  • Math, science, and engineering
  • Shop work (e.g., metalworking and woodworking)

Most of these tools are written in python; a few are in C++. The original packaging was in zip files, but I've been adding things piecemeal for the last few years; this is reflected in the table of additions at the bottom of this page.

Here are some other pages that also might be of interest:

  • Python code to talk to a Radio Shack multimeter
  • Python graphics library that outputs Postscript
  • Python code for a console-based RPN calculator

By the way, Google's wiki's markup causes it to think a group of capitalized words strung together is a link somewhere to the project's pages. Since I name my files with this camel-case convention, you'll see a question mark link after the file name.

Math

archimedean.py Script to calculate the arc length of an Archimedean spiral. For example, use it to estimate the length of toilet paper on a roll. For thin materials, a simple approximation can be used that turns into an arithmetic expression, but the exact problem is integrable and that's how this function works.
BusinessCardMathTables.pdf A document containing small math tables that will print out to be about the size of a business card. These are surprisingly compact and can help you do 1% type calculations when a calculator isn't handy. The document also spends some time explaining the use of some of these old-style tables and how to use approximations, as a lot of this knowledge has disappeared in the last 40 years since electronic calculators and computers became popular. Hide them, or you'll be labeled as a geek. :^)
frac.py A python script that will calculate a rational approximation to a real number. If you download the free mpmath python library, you can calculate to arbitrary precision. Update: python 2.6 and later includes the fractions module, which makes it easy to do such calculations.
frange.py A python module that provides a floating point analog to range(). Doesn't suffer from the typical floating point problems seen in naive implementations all over the web.
ElementaryFunctions.pdf Graphs of a variety of elementary math functions, useful for a quick picture of how they behave or to grab one or two significant figures of the value.
math_cheatsheet.odt math_cheatsheet.pdf How to do things in Open Office's equation writer.
OO_math.pdf Introduces the equation-writing capabilities of Open Office 2.0. I find that I have no need for LaTeX given the equation-handling abilities of Open Office. While not as powerful as TeX or LaTeX, it's adequate for my needs and provides a variety of other tools. I also prefer OO over MS Office.
root.py Implements a general-purpose root-finding method in python that was published in Embedded Systems Programming, May, 2002, pg 7-14. The method is based on fitting a parabola and converges quickly. It is similar to bisection in that it needs two abscissas where the ordinate differs in sign and thus brackets a root. Convergence is highly likely, unlike a single estimate and Newton-Raphson iteration, where a near-zero derivative can send the algorithm into the next county.
ShortTables.zip A set of tables of elementary math functions intended to print on half of an ANSI-A sized piece of paper. These tables are intended for use when a calculator isn't available. The original is an Open Office spreadsheet -- email me if you'd like a copy of it.

Science, engineering

eng_grid.py This script will generate most any linear isotropic graph paper by creating a PostScript file.
iapws95.zip This zipfile contains C++ and python code that implements the IAPWS95 equations for the thermodynamic properties of water. You might also want to take a look at John Pye's freesteam project.
irr.py Calculate irradiance over a wavelength band from a spectral irradiance data file. It is written to work with StellarNet spectroradiometer files, but it can easily be modified to work with other data files.
mixture.py A script to aid in mixture calculations. Adapted from a C program here.
novas.py Translation into python of some C code from the US Naval Observatory. It contains routines that are nearly identical to those used for calculations of the Astronomical Almanac.
reactance.zip Some PDF files containing reactance charts. Two are for monochrome printers and two are for color printers. These are vector drawings, so will scale to any size. They are made for US letter size paper; if you would like them for another paper size, please send me an email and I will put them into the zip file. What I mean by "Free for non-commercial use" is that anyone can use them, but they are not to be sold by or to anyone. If you wish to sell it or brand it with your logo, please contact me.
resistor.zip Contains two tools that help you deal with resistors. The resistor.cpp file is a C++ program that can calculate resistors to use for a voltage divider for a desired ratio. It also has the ability to get a desired resistance using two on-hand resistors in either series or parallel. You can enter the values of your stock resistors or use standard series such as E6, E12, etc. The resistor.ods file is an Open Office spreadsheet that calculates the resistance of wires of circular and rectangular cross sections (handy for designing shunts). The PDF files contain the documentation.

Shop

cheat_sheets.zip Contains various spreadsheets in Open Office format and PDFs of tables that I find handy to have in the shop.
gauge.cpp A C++ program to print out combinations of inch gauge blocks that yield a desired composite length (the subset sum problem). Should work with most any set of gauge blocks. Uses brute-force searching to find solutions -- it's not elegant, but it works. Update April 2012: added gb.py, a python script that solves the same gauge block problem as the C++ program.
reference_cards.zip Contains some reference cards that will print out on 4 by 6 inch cards. I find these handy to keep in my drafting materials box when I'm doing design work at a drafting board.
square.pdf How to use a carpenter's square to lay out angles from 1 degree to 44 degrees. The fractional values given will result in angles accurate to 0.01 degree, assuming your square and your layouts are accurate enough. I find a speed square a much handier tool for carpentry layout than the carpenter's square and it's accurate enough for the usual purposes.
thd.py Prints out various dimensions associated with threads. Calculates the values based on the ASME B1.1-1989 standard document. If you machine threads on a lathe, you may find this program handy.
weigh.pdf Demonstrates how I "weighed" our trailer with a lever. With a 12 foot long 4x4, I was able to measure 2500 pounds.

Utilities

app.cpp Handy application if you like to work at a cygwin command line. Given one or more files, it will cause them to be opened with their registered application.
asc.py Console script to print out ASCII character table in decimal, hex, or octal.
bd.c Performs a comparison between binary files; differences are printed in hex dump format. You can print an ASCII picture that represents where the different bytes in the files are in percentage through the file.
bgrep.py Script to search for regular expressions and strings in binary files.
bidict.py Creates a read-only dictionary in python that lets you treat it in "both directions" as a mapping. If bd is a bidict, you perform normal dictionary access as bd[key], while getting the key that corresponds to a particular value is gotten via bd(value). Simple and easy to use. I wrote this because an application needed to get both the number of month names (e.g., "Feb" to 2 and be able to get the month name associated with a month number). It's an example of a discrete bijective function where both the abscissas and ordinates are unique values.
color.py Short python module to make it easy to print colored text to a Windows console (such as a DOS window or a bash window under cygwin); uses WConio. The interface is minimal: you can set the foreground color, background color, or clear the screen. Run the module as a script to see how it behaves and its interface functions.
fit.py Provides a python function to fit a string of words into a given number of columns. When run as a script, can act as a simple text formatter. You can control the number of spaces after a sentence and it won't recognize common abbreviations with a trailing period as the end of a sentence.
goto.zip Contains a sh-type shell function and a python script that let you navigate around to various directories. I've had a number of UNIX users tell me they couldn't live without this tool once they started using it.
html_tokens.py Will produce a list of readable words from an HTML file, all in lower case, one per line. You could then run the list of words through a spell checker.
mp.py This is a macro processor that is a string substitution tool. You can also include arbitrary python code in your text files. Use mp.py -h to read the man page.
readability.zip Will calculate various readability indexes for text files, such as the Gunning Fog Index, the Flesch-Kinkaid Grade Level, etc.
ruler.py For console windows; prints a variety of rulers to stdout. It's easy to modify to get different ruler types.
scramble.zip Contains a python script to scramble letters in words, leaving the first and last characters alone. I wrote this because an intriguing email that's been circulating the web for years seemed to indicate that only the first and last letters of a word are really important for reading comprehension. You can make up your own mind about the truth of this statement by using the script on a variety of text.
space.py See where the space is being consumed in a directory tree and where the biggest files are.
tlc.py Script to rename all files in a directory to lower or upper case.
unx.py Produces a list of files that are candidates for turning their execute bit permission off. Handy in cygwin, since most Windows programs don't know how to behave properly with respect to the execute bit.
xref.zip A C++ console program that will cross reference the tokens in a set of files -- each token will be listed in alphabetical order with the file it occurs in along with the line numbers it's found on. It can perform spell checking. It has a -k option which makes it useful for programmers, as it will split composite tokens in their source code and spell check the individual tokens. In the late 1990's, I wrote a similar tool in python, but it took a couple of hours to index our project's files (a medium-size project with about 100,000 files). The C++ version runs much faster and is one of the few times I've found it necessary to replace a python script with a C/C++ program.

Other stuff

The file names given here do not include the dates you'll see on the Downloads page (I use the dates to indicate the revision).

ESR.pdf Describes a technique of measuring a capacitor's ESR (equivalent series resistance) without having to buy a special meter.
Python.zip Contains a document that discusses why learning the python programming language might be a good thing for technical folks.
inductance.zip Provides an Open Office spreadsheet that can calculate the inductance of common electrical structures. Includes a PDF document describing the use and which gives references for the formulas used. There is also a PDF file of the spreadsheet so that you can see what it looks like without having Open Office -- this will help you decide if you want to download and install Open Office to be able to use the spreadsheet.
PythonFromCalc.pdfA document explaining how to call python functions from Open Office Calc spreadsheets.
pipes.pdfA document showing a derivation of a formula that can be used to make a template for cutting the end of a pipe so that it can be welded to another pipe.
shaving.pdfI give some thoughts on the process of shaving that beard off your face.
scale.zipThe scale.pdf file contains two sheets of paper with slide rule type scales on them. If you duplex print this and keep it in a binder, you may find it useful for simple technical calculations when an electronic calculator isn't handy. The other file explains how to use things.
flow.pdfNomograph for pipe flow.
Markup.pdfA short blurb about markup and profit used in business. Many folks don't know the relationship, but it's an easy one to remember.
sig.zipContains a python script to format floating point numbers to a specified number of significant figures or round to a specified template. This is what I use for general-purpose printing of numbers, including floats, integers, python Decimals, fractions, mpmath numbers, numpy arrays, and complex numbers, including any mix of these in a container that can be iterated over. It sounds like a simple task, but it took a couple of thousand lines of code (about 75% is documentation and self tests).
AnalyticGeometry.pdfContains a number of formulas relating to analytic geometry in the plane and space. Please submit an issue if you find an error in the document. If you do find an error or want to add material to the document, please submit it in the latest Open Office Writer format.
TrigDegrees.pdfGives some algebraic expressions for a few special values of trigonometric functions in degrees.
BNC_connector_power.pdfGives some experimental data about using RF coax cables with BNC connectors for DC power.
SphericalShell.pdfDiscusses gravitation and electrostatics inside a uniform spherical shell and why there is no force on a particle. Also looks at Henry Cavendish's elegant experiment in the 1700's showing that the exponent in Coulomb's Law is 2.
dupfile.pyScript to find duplicated files in a directory tree. It works by hashing each file, then looking for duplicate hashes and equal file sizes. It may take a long time on a big directory tree, but it will find places you're wasting space, especially if they are big files.
Mortgage.pyA simple table that lets you estimate your mortgage's monthly payment. Doesn't include taxes or insurance though.
diameters.pdfPlots circles showing the relative mean diameters of planets and moons in the solar system.
mod.pyScript to recursively find files that have changed within a specified time period. When you're chronologically-gifted, it helps you find that file you know you worked on recently, but can't remember where it was or what its name is.
HoseFitting.pdfHere's the most effective way to secure a hose to a hose fitting. It's better than anything you can buy in a store.
PartsStorage.pdfDescribes one way of storing lots of little electronic parts and how to find them quickly.
CurrentSource.pdfA battery-operated 1 ampere current source used to make low resistance measurements. You can measure to 0.1 milliohm with the typical DMM.
sine_sticks.pdfHow to build a simple device to measure angles in the shop that works as well as a Starrett machinist's vernier protractor.
bode.pyGenerate a Bode plot with a python script (needs numpy and matplotlib). You define the transfer function in a file which is passed on the command line.
diurnal_variations.pdfShows a plot of the light from the sky measured with a cheap photodiode. Since inexpensive datalogging equipment can be purchased that use e.g. the USB interface, this would be a great experiment for school kids and parents to do together. Because it's so simple to do, I predict you'll get hooked if you try it.
GlendaGuard.pdfDescribes a simple concrete sprinkler guard that my wife designed and built. We've used them for over 20 years and they work well, are simple to make, and cheap.
SolarSystemScaleModel.pdfThis document describes a python script that prints out the dimensions of a scaled solar system. You can use it to make a scale solar system in your yard or on your street. Be warned -- things will be smaller and farther apart than you think. This would be a good exercise for a parent and a child -- both will learn information you can't learn from a book.
elements.zipContains elements.pdf, a document that contains a periodic table of the elements, a plot of the vapor pressures of the elements, values of physical parameters sorted by value, and various physical parameters of the elements plotted as a function of atomic number. The raw data are contained in the elements.ods Open Office spreadsheet; the zip archive includes the python scripts used to generate the plots. If you'd like to generate the plots yourself, you can, as the tools are all open source or freely available, but be warned that there are numerous libraries that you'll need to get. I've wanted a document like this for a long time, but I knew that most of the work would be in manually typing in all the data from various places. I was right... :^)
paper_sizes.pdfShows a scale drawing of various ISO and US paper sizes.
graph_paper.zipProvides some common graph papers in PDF files that print on ANSI A paper. The script that made them is included, so you can hack things if you e.g. want to change to A4 paper or modify colors or line widths.
nozzle.pdfDescribes a nice hose nozzle you can make if you have a lathe. It will work better for cleaning things off than the typical store-bought nozzles.
GNU_units.pdfA short blurb on the capabilities of the wonderful GNU units program. This is one of the most-used programs on my computer because I am constantly converting between various units. It can also help you do back-of-the-envelope type calculations and avoid making dumb unit errors that invalidate everything.
fountain_pen_primer.pdfDiscusses the care and feeding of fountain pens as writing tools.
paper.zipContains a python script to calculate various things about paper. You input the grammage in grams per square meter, size of the paper sheet, number of sheets, and an optional cost and various metrics about the paper are printed out. Lets you compare paper purchases by e.g. looking at the cost in $ per square meter. It includes fpformat.py, a needed python module.
antifreeze.pdfWe were on a road trip a couple summers ago and I had to add some water to the radiators of our cars. For the winter, I wanted to remove some of the diluted antifreeze and add back in an amount of pure antifreeze to get the 50% concentration I wanted. This document discusses how to calculate this and also looks at the refractometer, a very handy device to measure antifreeze concentration and a lead-acid battery's sulfuric acid specific gravity (which tells you the state of charge).
bucket.zipShows how to mark volume calibration marks on nearly any bucket. It turns out there's a reasonably simple closed formula for this, regardless of the cross-sectional shape of the bucket. Includes a python script that will do the calculations for you (you'll have to modify the script if the bucket isn't round or square).
spiral.pyInteractive script that will perform calculations about Archimedean spirals. For example, you could use it to estimate the length of paper on a roll of toilet paper given the outside diameter, inside diameter, and thickness of the paper.
split_cat.zipPython scripts to split a file into chunks, print out SHA1 hashes of each chunk, and allow you to recombine the chunks later back into the original file. Useful for band-limited tools like email and floppy disks.
ext.pyThis python script will make a list of the extensions used in file names in the directories given on the command line. It can also recurse into each directory given on the command line.
regression.zipGeneral-purpose linear regression routines for python. The basic instructions are in the regression.readme file. 3Mar2012: I deprecated the release because I'm working on a more numerically-stable one.
dmath.zipContains a python module dmath.py that is a drop-in replacement (nearly) for the python math module when calculating with python's Decimal numbers.
pdf.pyThis is a python script that can manipulate PDF files. Typical operations are to concatenate a number of PDF files to another PDF file, select certain pages of a PDF file and write them to another PDF file, rotating pages, watermarking. etc. You'll also need to download the pyPdf library to use this script.
drules.pdfContains some drafting rules that I've always wanted. These are primarily 6 inch scales both in inch and mm divisions. You can print them at full scale and glue them to a chunk of wood to make some handy scales.
GuerillaArithmetic.pdfDiscusses some simple techniques to help you do arithmetic a little better. Personally, I think this stuff should be mandatory knowledge for anyone who escapes from any public school system because it's simple knowledge you'll use the rest of your life.

Powered by Google Project Hosting