The Artima Developer Community
Sponsored Link

Weblogs Forum
M Clock 2.0

9 replies on 1 page. Most recent reply: Jan 19, 2006 7:39 AM by Doug Blank

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 9 replies on 1 page
Guido van van Rossum

Posts: 359
Nickname: guido
Registered: Apr, 2003

M Clock 2.0 (View in Weblogs)
Posted: Aug 5, 2005 9:48 AM
Reply to this message Reply
Summary
At OSCON I rewrote one of the earliest Python graphics demos I ever did, this time in Tkinter -- a colorful clock. Miguel de Icaza thinks it's cool!
Advertisement

Some time in the '80s I saw a very cool wall clock. It has two transparent discs attached to the hands, where each disc has nine gradations of a primary color applied to it. The background has a similar, fixed pattern using the third primary color. The result is a clock that looks different every minute! Hard to describe properly; you have to see it. (And you will, hold on.)

My parents bought me that clock as a birthday present. The front says "M Clock" and "Rob Juda". (I've seen other, similar clocks by the same designer.) After having moved half a dozen times, it's still hanging on my kitchen wall telling the time and getting curious looks from visitors.

In the early '90s I did a software implementation of that clock in Python, using the SGI GL bindings that we had just created at CWI. It made it into the Python distribution as a demo, but was eventually withdrawn because GL support died and I didn't have the time to port it to OpenGL. (It's still in the CVS Attic.)

A few weeks I received an email from the designer, Mr. Juda (a compatriot of mine), asking if the software was still available. There is a clock museum in the Netherlands (Schoonhoven) which has all of Mr. Juda's designs on display, and he thought that the museum would be interested in the software version, if it was still available (and ran on Windows). He told me some of the history of the clock -- about 100,000 clocks were produced and sold from '84 through '94. It was hard to sell the clock because people wouldn't realize that three totally different looking clocks were really the same clock at different times!

I promised Mr. Juda that I would consider reviving the software, and here it is: mclock2.py. It runs on Windows and Unix as long as you have a recent version of Python with Tkinter enabled. (The most recent Windows installer of Python is downloadable from python.org/2.4.1/.) Tip for Windows users: rename the file to "mclock2.pyw" to suppress the text console.

PS: It would be cool if someone did an Xscreensaver version of this...

PPSS: The first version I posted had the color gradations reversed. I've fixed that, made the hands look more like those on the original, and removed the right-click-to-zoom feature on Unix (it was using a Tk feature that only works on Windows). URL is unchanged.


Nick Coghlan

Posts: 13
Nickname: ncoghlan
Registered: Dec, 2004

Re: M Clock 2.0 Posted: Aug 6, 2005 6:40 PM
Reply to this message Reply
Not an Xscreensaver version, but one where all 3 discs move, and the pattern changes significantly every second. The old fixed disc now moves with the hour hand, the hour disc now moves with the minute hand, and the minute disc moves with the new second hand.

http://members.iinet.net.au/~ncoghlan/public/mclock2a.py

Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: M Clock 2.0 Posted: Aug 8, 2005 4:28 AM
Reply to this message Reply
Excellent clocks. Increasing the segment count from 9 to 60 is a significant step away from the original design but smooths the colours out in a nice way.

Korakot Chaovavanich

Posts: 6
Nickname: korakot
Registered: Aug, 2005

Re: M Clock 2.0 Posted: Aug 8, 2005 10:55 AM
Reply to this message Reply
Not an Xscreensaver version too. But a Nokia python (python for series 60) version.
http://larndham.net/service/pys60/mclock2s.py

Here's the screenshot.
http://flickr.com/photos/korakot/32337789/

Guido van van Rossum

Posts: 359
Nickname: guido
Registered: Apr, 2003

Re: M Clock 2.0 Posted: Aug 8, 2005 11:01 AM
Reply to this message Reply
Oooh, the Nokia clock is incredibly cool!!!!!

Korakot Chaovavanich

Posts: 6
Nickname: korakot
Registered: Aug, 2005

Re: M Clock 2.0 Posted: Aug 8, 2005 5:17 PM
Reply to this message Reply
Not an Xscreensaver version, either. Here is a Nokia python (python for series 60) version, which run on my Nokia 6600 phone.
http://bigbold.com/snippets/posts/show/571
http://larndham.net/service/pys60/mclock2s.py

Here's the screenshot.
http://flickr.com/photos/korakot/32337789/

Christos Georgiou

Posts: 7
Nickname: tzotzioy
Registered: Mar, 2005

Re: M Clock 2.0 Posted: Aug 11, 2005 7:37 AM
Reply to this message Reply
A minor nitpick re the draw method in the source code: conversions between radians and degrees are available in the math module (functions have the same names as their target). Batteries included ;-)

Guido van van Rossum

Posts: 359
Nickname: guido
Registered: Apr, 2003

Re: M Clock 2.0 Posted: Aug 11, 2005 7:40 AM
Reply to this message Reply
> A minor nitpick re the draw method in the source code:
> conversions between radians and degrees are available in
> the math module (functions have the same names as their
> target). Batteries included ;-)

Ow, thanks. They didn't exist when I first created the math module 15 years ago. :-) Fixed now.

Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: M Clock 2.0 Posted: Dec 20, 2005 3:00 AM
Reply to this message Reply
As a footnote to this:

My PC has now a variant of this clock that starts with the PC. I've just spent twenty minutes trying to find out why my spreadsheet was running so slowly.

So guess what was hogging the CPU? Turning it off speeded my app from <1 to 70+ rows/sec update. Mind you, my version of this clock has the second hand and 360 colour segments, so I've only myself to blame. :)

Doug Blank

Posts: 1
Nickname: dsblank
Registered: Jan, 2006

Re: M Clock 2.0 Posted: Jan 19, 2006 7:39 AM
Reply to this message Reply
If you get really good with your colors, then you don't really need the hands on the clock. The colors will tell you what time it is! That will take me a while to get used to, though; I have trouble with military (24-hour) time...

Flat View: This topic has 9 replies on 1 page
Topic: What's up with Diggins? Previous Topic   Next Topic Topic: Use cases for Generics

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use