Sunday, February 24, 2008

Fiscodynamics

This is an idea I've been kicking around for several years. It's a way of representing money dynamically.

You use circles, and the diameter and colour represent the amount and periodicity of a cash flow, both on a logarithmic scale.

The diameter of a circle in millimeters is based on the log of the amount of money under consideration. We add three to the log so that one cent is 1mm, ten cents is 2mm, a dollar is 3mm, a million dollars is 9mm, a billion 12mm, a trillion 15mm, you get the picture.

You can set this up mathematically so you can work with other-than-even-millimeter diameter circles. Also, notice that no matter what size circle you start with, ten of them will add to make a circle with 1mm larger diameter. (Also, three of them will add to make a not-quite-0.5mm larger circle.)



The color of the circle represents the frequency of the cash flow, again on a logarithmic scale. We map the log of the period in seconds of the cash flow to a color on a spectrum. The red end of the spectrum corresponds to high frequency events (tenths of a second are red, seconds orange...) and the blue end to the low frequency events (years are aqua-ish, decades blue. Note that this is exactly opposite to the actual light frequencies involved. Red light is low frequency while blue is much higher. I switched them around because I think it makes more sense "psychologically" to have the "hot" colors represent fast flows and "cold" colors represent slow ones.)

I made a "first draft" color map and labelled the usual temporal divisions (day, week, month (lunar), etc..) I'm not completely satisfied with it yet, but it's good enough to work with for now.

Sunday, February 17, 2008

Figs from a Salt Desert in less than Two Years

If you're curious about the practical applications of Permaculture or want to introduce it to other people, you can direct them to this short Flash movie "Greening the Desert" put out by Geoff Lawton and the good folks at the Permaculture Research Institute of Australia.

It's about a project in the desert of Jordan to reclaim an area of heavily salted farmland. Using Permaculture techniques they manage to grow figs and other crops while de-salting the land and replenishing the water table.

Getting the Currently Selected Text in Tkinter

I tracked down the technique for getting the current text selection in Tkinter, as opposed to getting the current contents of the clipboard, and put them both in a nice neat function:
def _getCurrentText(widget, clipboard=False):
'''
Given a Tkinter widget, return the currently selected text (clipboard
is False) or the current contents of the system clipboard (clipboard
is True) or None if no text is currently available.
'''

try:
if clipboard:
return widget.selection_get(selection='CLIPBOARD')
else:
return widget.selection_get()
except TclError:
pass
The mechanics of that selection_get() method reach through Tk all the way to to the ICCCM standard and the X protocol!

Saturday, February 16, 2008

Pygoo site up.

Sarah set up the Pygoo.com website with a very nice CSS styling. It gives a little history of the code and has links to the Google Code project and some of the source sites.

Oh BTW, pygoo is a simple parser that creates Tkinter widgets from a Little Language textual specification.