Ford Circles

I picked up a copy of The Math Book after reading the review on John D. Cook's blog.

So far it has been pretty interesting and I've was plesently surprised with how much of the material I am familar with, despite the fact that I haven't studied math beyond the courses that are part of the engineering curriculum at my university.

The best part, though, has been the occasions when I find something that I can play with a little bit on my own. A good example is Ford Circles, which with a little time in NodeBox I had my own renderings:

Ford Circles

Here's the code:

from __future__ import division

scale(1000, 1000)

def circle(x, y, r):
    oval(x * 1000, y * 1000, 2 * r, 2 * r)

def ford(h, k):
    r = 1 / (2 * k**2)
    x, y = h/k, r
    print x, y, r
    circle(x, y, r)


for h in range(0, 200):
    for k in range(1, 200):
        ford(h, k)

... and here's a bigger rendering, if you're interested.

JDisplay but better (part II)

I've been working on my vision for JDisplay and here's a screen shot of what I've got so far:

/blog/entries/2009/05/24/jdisplay_but_better_part_ii/jdisplay-but-better-part-ii-47fbafd8ddd4.min.png

(It's still not hooked up to the running JVM so you can't actually run any code, but it's pretty much the way I want the UI to look/work.)

JDisplay, but better!

JDisplay is pretty cool. It is a view available when using Eclipse JDT's debugger that allows you to execute code and inspect the result when you are stopped at a break point. This is very useful as not only does it allow you to inspect the objects as they currently are (which other views allow you to do pretty well) but it also allows you to see what the return value of a method would be if it was called from here.

JDisplay as it currently looks.

JDisplay as it currently looks.

While the idea is awesome, it adds a little bit of interactivity to your Java development, the design is a little lacking as far as I'm concerned. In order to execute some code I have to:

  1. Write some code (go figure).
  2. Take my hands of the keyboard and select that code.
  3. Click on a button in the top right corner of the view.

The output then gets dumped back into the same input buffer I was using to write code in in the first place. That works okay for the first evaluation, but after your second or third go, it starts to get really messy.

What I want is to be able to do is write code and hit <ENTER> and see the results. I want to be able to hit <UP> and reuse code that I've already written without having to worry about it having been clobbered by the output of subsequent evaluations. I want a Read-eval-print loop for Java debugging.

Time to Stop Whining and be Constructive

Here's where I prove that more than just a useless whiner: Here's a mock-up of what I think JDisplay should look like:

Mock-up of what JDisplay could look like.

Mock-up of what JDisplay should look like.

I even have a vague idea of how I would implement it and noble intentions to develop a patch against JDT.

I'll let you know how that goes.

Lockhart's Lament

A Mathematician's Lament is an essay I read a while ago that was written by Paul Lockhart, a math teacher. It expresses, in ways far more articulate than I ever could, some of the things that are wrong with the way people are taught mathematics: Namely that no-one actually does any mathematics proper until their undergrad and even then only if you are studying one of the few disciplines that requires real math courses.

Check it out. It's a good read.

Logicly is Cool!

Logicly is a logic gate simulator written by Josh Tynjala to showcase some wiring components he developed, but it is very cool in its own right. As far a logic simulators go, it's so easy to put together basic circuits I just had to put together something fun:

A 3 bit shift register built with Logicly.

That is a 3 bit shift register built from 3 edge-triggered D flip-flops. It's so much fun that I want to be able to do so much more. I want to be able to:

  • Save circuits and be able to hand out URLs so that I can share them with other people or simply refer to them later.
  • Take saved circuits and reuse them as blocks in other circuits.