Golf Zero

Some keen golfers face a time when they can enjoy a walk around a golf course, but are not able to swing a golf club like they used to. A golfer’s swing could be interrupted due to injury, sickness or due to natural aging processes.

Should an inability to swing stop a golfer from enjoying the course? No. “Golf Zero” could be an answer. Here is an idea. Let “Golf Zero” be a zero swing game of golf that uses a small compressed air powered cannon to fire a golf ball when on the fairway, and a curved pipe for putting.

The fairway cannon fits onto a golf buggy in place of a bag of golf clubs and the Golf Zero golfer controls it using a wirelessly linked iPhone App that includes the course layout. The golfer chooses which stick to emulate, either an iron or wood plus a variable swing.

On the putting green, the golfer drops a golf ball down a curved pipe that is pointed towards the flag.

The combination of a small air powered cannon on the fairway and a curved pipe on the green may provide a way for golfers who have lost their swing to stay the course!

Do Not Repeat Yourself

Django has won me over. But it can be improved!

Delivering web applications using django is a sublime experience – its core ‘do not repeat yourself’ philosophy and the built in admin application makes development of applications easy and fun.

There remains however a major source of “repeating yourself” with django. The schema in the database is separate from the application definition in .py files.  This separation can currently be addressed in two ways neither of which are entirely satisfactory.

  1. The django admin inspectdb utility will create a basic application definition from an existing database.
  2. The django admin syncdb utility will create tables in a database from a django application definition.

However, neither of these utilities solve the problem of keeping a database and an application synchronised under incremental change.

This situation could be improved by defining the application as a meta-data annotation of the database.
If the application is an annotation of the database then irrespective of how the database structure is changed, the application will be simultaneously updated and vice-versa.
Notes on a candidate solution
A core issue is making 1-1 correspondence links between tables and columns in the database and django application annotations. These links need to survive arbitrary sequences of ALTER statements, and disappear after DROP statements.  In mySQL, one way of doing this would be to store a GUID in the table and column comment fields in the database information_schema.  The comment field survives ALTER statements and will disappear after DROP statements.

With these GUID’s in place, all the django specific annotations (e.g. verbose_name=””) may be stored in an a per-application definition table and the django models.py, admin.py files may be regenerated at any time based on introspection of the database information_schema + this applications annotations.

Academic Research – searching from your reference list

If you (like me) find chasing down references for academic assignments to be a challenge then you may be interested in this. My use-case is the exploring stage where you would like to save a reference then search Scholar for that author and/or search on the title of the article.

I have just enabled Refworks references to link back to Google Scholar search. Google Scholar (which links neatly to your university’s library) naturally pairs with Refworks (I am currently on a 30-day free trial of this magic service for accumulating references from Scholar) But vanilla Refworks is a deadend. But help is at hand — now you use a greasemonkey script (greasemonkey is a plug-in for Firefox browser) to link back to Scholar search!

The script is called œRefworks link to Google Scholar and it makes Refworks.com link back to Scholar! As shown here …
refworks with the script enabled

Without the script enabled, the Refworks view normally shows like this …
refworks without the script enabled

Enjoy!

This script just scratches the surface of what is possible!

Ambi – streamlined – loses SEQ operator

Ambi is proving to be a great extensible RPN calculator. Applying the ‘zen’ of RPN to programming fun!

Enjoy the new release of Ambi.

This week I have discovered that the seq operator is not necessary.  Initially, I thought that seq would be necessary, however it turns out that the other lambda operators are sufficient.  So we now can write an interative approximator of cuberoot in this way …

function; root3;
  dowhile;
    import dup $n = $guess =;
    $guess $prev = $n $prev sq / $prev + .5 * $guess =;
    $guess $prev - abs .000000001 >;
    $guess export ;
125 root3 .

Not a seq in sight!   And we may rewrite the function as a recursive function this way …

function; inner-root3;
 if;
  import $n = import $prev = $prev $n $prev sq / + .5 * $guess = $guess $prev - abs .000000001 >;
  $guess $n inner-root3 $guess =;
  $guess export;

function; root3;
  import dup inner-root3 export ;

100 root3 .

In addition the current release adds the ++ and increment and decrement operators.

Myers-Briggs analysis based on your writing …

Typealyzer correctly analysed this blog and nailed me as an INTJ.  Great work.  Try it out!

Reverse Polish Notation Language

I love RPN calculators.  My favorite is Hypatia which I use regularly for calculations.  I love being able to order my calculation to avoid brackets and being able to enter a list of numbers and add them up with a single command:

hy 12 23.4 43 94 3 d SUM

Now I am wondering about a full computer language built from the ground up as an RPN language?

A bit of googling led me to RPL or Reverse Polish Lisp which is close.  I wonder if this direction has been explored in other languages.

I am imagining a language where assignment is pretty straight forward (with explanatory pseudocode comment):

1 a = # a = 1

boolean expressions are just regular RPN:

a 1 + b > # a + 1 > b

and an if control structure would look like:

; bf ; bt ; a if # if a then bt else bf;

the meaning of the “;” token is to push following tokens (until the next structural token) unevaluated onto the stack as a single entry.  The if token evaluates the top stack entry (a) and then evaluates either the second (bt) or the third (bf).

A do while loop would look like this:

; b ; a dowhile # do b while a;

The dowhile token evaluates the second stack entry (b) and then the first (a) and repeats until a is false.

A key of RPN expressions is that there are no brackets required – by analogy in a RPN language there would be no nested statements!

Open question.  Can this idea be developed into a usable programming language?

Car positioning without GPS

An internal map can be matched to the integration of distance and direction measurements. See pdf.

Personal Franking Machine

I am bugged by buying stamps. What about a personal franking machine? See pdf.

Disposable Suitcase

  • good for maybe 10 flights
  • <$10-15 each
  • same shape as conventional suitcases
  • great for moving to a new area

possible design

  • external plastic sheet
  • middle net like a fishing net
  • inner: cardboard for rigidity

seal with plastic disposable ties.

Kazakh Notes

Kazakh Notes was published in 1991 and is still being used by Kazakh language learners. The key contribution of Kazakhnotes was the consolidation of Kazakh language rules into a common framework.