Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-09 Thread Dennis Brown
Geoff, It does have a certain elegance to it --and it preserves the subject header of 17 LINES of CODE ;-) The 3 MINUTES has grown just a tad to get it to it's current evolution. I just don't like the long math line to get the hours straight -- could there be a simpler way? Now all we need

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-09 Thread Geoff Canyon
On Jun 9, 2005, at 5:51 AM, Dennis Brown wrote: I also just took out the hour 'if' statement in yours, so that minutes and hours are updated together after only 10 seconds from start. The extra time for doing the hours every ten seconds is trivial. But that's just...wrong ;-) I just s

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-09 Thread Geoff Canyon
I considered this option and went the other way for a couple reasons. It seemed more natural to leave it in one handler. It takes more lines of code to split the handlers up. I wonder what the overhead is to have three messages pending as opposed to one. That said, I think this is the way t

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-09 Thread Dennis Brown
Geoff, I also just took out the hour 'if' statement in yours, so that minutes and hours are updated together after only 10 seconds from start. The extra time for doing the hours every ten seconds is trivial. Dennis On Jun 9, 2005, at 1:12 AM, Geoff Canyon wrote: On Jun 8, 2005, at 8:40

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-08 Thread Geoff Canyon
On Jun 8, 2005, at 8:40 AM, Eric Chatonet wrote: Just a little thing: with this new very clever code, the clock will not be at time just when opening ;-) So 4 lines more and 2 repetitions that are not satisfying: I bet you will find a better solution in 3 minutes! Thanks for the compliment.

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-08 Thread Dennis Brown
Geoff, Your new idea gave me an idea. Make three handlers --one for each hand (I hope I got the hour math straight) You can find it in my user space (see3d). Dennis on openCard setSeconds; setMinutes; setHours end openCard on setSeconds send setSeconds to me in 1-(the long seconds mod

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-08 Thread Eric Chatonet
Hi Scott, I'm afraid preOpenCard instead of openCard will not solve the problem. In the worst case, you will have to wait 9 seconds to see the minutes hand correctly positionned and almost 2 minutes for the hours one. Best regards from Paris, Eric Chatonet. Le 8 juin 05 à 18:14, Scott Rossi

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-08 Thread Scott Rossi
Recently, Eric Chatonet wrote: > on openCard > setTime > end openCard > > on setTime > send "setTime" to me in 1 - (the long seconds mod 1) seconds > put word 1 of the long time into T --8:13:15 > put T & char 2 to 7 of (the long seconds mod 1) into fld "Time" > split T using ":" > se

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-08 Thread Dar Scott
On Jun 8, 2005, at 8:04 AM, Geoff Canyon wrote: Let me know what you think. You can even put the advance for the minute hand and for the hour hand in separate send cycles that can be approximate. Dar -- ** DSC (Dar Scott Consulting & Dar's L

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-08 Thread Eric Chatonet
Hi Geoff, Kudos. Very impressed to see how much a code can be improved again and again. Just a little thing: with this new very clever code, the clock will not be at time just when opening ;-) So 4 lines more and 2 repetitions that are not satisfying: I bet you will find a better solution in

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-08 Thread Geoff Canyon
I came up with a radically different approach. Several iterations ago, we realized that we didn't have to guess when it would be time to set the clock graphics. We could use 1-(the long seconds mod 1) to get a message sent exactly when we need it. Well, we're still guessing at when it's tim

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-07 Thread Dennis Brown
Dar pointed out that this clock does not have a graceful stop. I changed the clock in my user space (see3d) to shut down the clock when the card is closed. Dennis On Jun 7, 2005, at 12:40 AM, Geoff Canyon wrote: I've posted the new revision: on openCard setTime end openCard on setTime

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-06 Thread Geoff Canyon
I've posted the new revision: on openCard setTime end openCard on setTime put word 1 of the long time into T --8:13:15 put T & char 2 to 5 of (the long seconds mod 1) into fld "Time" split T using ":" get (450 - (30 * T[1]) - (T[2] div 2)) mod 360 if (the angle of grc "Hour") <> it t

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-06 Thread Geoff Canyon
I missed that comment. Of course that's the case. I'm adding it in. On Jun 6, 2005, at 9:38 AM, Dennis Brown wrote: Good catch. As was pointed out before, trunc(T[2] / 2) can be simplified to (T [2] div 2) ___ use-revolution mailing list use-revo

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-06 Thread Dennis Brown
Geoff, Good catch. As was pointed out before, trunc(T[2] / 2) can be simplified to (T[2] div 2) Dennis On Jun 6, 2005, at 11:45 AM, Geoff Canyon wrote: I've put up a summary of the refinement of this code at: http://www.inspiredlogic.com/beautiful/clockface.html I had to make a modificat

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-06-06 Thread Geoff Canyon
I've put up a summary of the refinement of this code at: http://www.inspiredlogic.com/beautiful/clockface.html I had to make a modification to the below "final" version, both to use the split command and because I realized that sometimes 450 - (30 * T[1]) - trunc(T[2] / 2) won't fall into

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-31 Thread Eric Chatonet
Hi Dar, Agreed a thousand times. To pass code (we say that in french but not in english may be :-) may be very valuable (and I often admire) but it is not enough... Code is not a goal. It is only a means (often exciting). Our final goal is an application that suits the needs of our clients (

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-31 Thread Dennis Brown
I updated my clock and tested the cpu time again. I must have slipped a tick or something, because now I get 1.5% cpu with the simple script and 0.8% cpu with my time saving script. Much more like I though it should be. I am happy with either one, so I put both scripts in the clock in my

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-31 Thread Dar Scott
Concerning the "coded in 3 minutes" in the subject. I wouldn't want anybody to be intimidated by this. I'm an experienced programmer. My customers come back for more. Though others create in a different style, my design style might be a yardstick. I might code a similar solution in 3 minut

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-31 Thread Mark Wieder
Geoff- Monday, May 30, 2005, 9:55:48 PM, you wrote: GC> Darn, forgot one more thing. Instead of setting the itemDelimiter, GC> using the split command allows a cleaner T[1] syntax instead of item GC> 1 of T. It is probably a bit faster as well. Thanks for the example. I never think about the spl

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-31 Thread Geoff Canyon
On May 31, 2005, at 6:05 AM, Dennis Brown wrote: I can't say that I would make the tradeoff of the extra lines of code for a few microseconds, but I really like the split idea --it shows another concept in a simple way and makes the script look even simpler. I updated my clock with it. Go

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-31 Thread Bill
I like that "split" concept. I am always setting itemdelimiter to odd characters and then depending on it to reset itself and sometimes getting caught. On 5/31/05 12:55 AM, "Geoff Canyon" <[EMAIL PROTECTED]> wrote: > Darn, forgot one more thing. Instead of setting the itemDelimiter, > using the

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-31 Thread Dennis Brown
I can't say that I would make the tradeoff of the extra lines of code for a few microseconds, but I really like the split idea --it shows another concept in a simple way and makes the script look even simpler. I updated my clock with it. Good thinking! Dennis On May 31, 2005, at 12:55 AM

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Judy Perry
Ummm... beep's working just fine here (Rev 2.5B1, Mac OS 10.3.8). Judy On Mon, 30 May 2005, Thomas McGrath III wrote: > I have not been able to get REV on the MAC to Beep. Can anyone else get > the beep to work? ___ use-revolution mailing list use-rev

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Geoff Canyon
Darn, forgot one more thing. Instead of setting the itemDelimiter, using the split command allows a cleaner T[1] syntax instead of item 1 of T. It is probably a bit faster as well. New script: on openCard setTime end openCard local sHourAngle -- the angle for the hour hand local sMinuteAn

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Geoff Canyon
On May 30, 2005, at 4:37 PM, Dennis Brown wrote: That is a good point. I tested it out, and the useless "set angle" results in about 70ms of wasted time every second (7% CPU). I am surprised it is so high. Doing the test and skipping it is a thousand times faster. I fixed up the script

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Thomas McGrath III
I went looking and although the system beeps and sound works the sound pane in OSX had no item selected for system beeps. That is very odd. I wonder how that could get changed. Aside from me doing it of course. Beeps are fine now, Thanks Björnke Tom On May 30, 2005, at 7:57 PM, Björnke von Gi

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread =?ISO-8859-1?Q?Bj=F6rnke_von_Gierke?=
On May 31 2005, at 01:44, Thomas McGrath III wrote: I have not been able to get REV on the MAC to Beep. Can anyone else get the beep to work? 1. check if you get sound from other apps, and that you have actually a sound allocated for beeping 2. the command to do a beep is "beep", try it in

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Thomas McGrath III
I have not been able to get REV on the MAC to Beep. Can anyone else get the beep to work? Thanks Tom On May 30, 2005, at 1:04 PM, Dennis Brown wrote: Nice! I learn something every minute on this list --four heads are better than one. I do believe that the clock is down to its essence now.

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Dennis Brown
That is a good point. I tested it out, and the useless "set angle" results in about 70ms of wasted time every second (7% CPU). I am surprised it is so high. Doing the test and skipping it is a thousand times faster. I fixed up the script as my own exercise for the student. You can see

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Dar Scott
On May 30, 2005, at 12:18 PM, Geoff Canyon wrote: I considered that possibility as well, but in practice it seems not. I think we thought of this because we're both being worrywarts. The math should result in, at minimum, a wait to _exactly_ the next second. If that happens _and_ the time spe

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Geoff Canyon
On May 30, 2005, at 10:04 AM, Dennis Brown wrote: Nice! I learn something every minute on this list --four heads are better than one. I do believe that the clock is down to its essence now. Every line does something essential, except displaying the "Time" field to check its accuracy. I

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Geoff Canyon
On May 30, 2005, at 9:43 AM, Dar Scott wrote: On May 30, 2005, at 10:22 AM, Geoff Canyon wrote: send "setTime" to me in (1 - (the long seconds mod 1)) seconds Very nice. If I ever get around to updating the Primer on Message Mechanics, this should go in there. At first I thought thi

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Dennis Brown
Nice! I learn something every minute on this list --four heads are better than one. I do believe that the clock is down to its essence now. Every line does something essential, except displaying the "Time" field to check its accuracy. I put the latest version in my user space also (see3

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Dar Scott
On May 30, 2005, at 10:22 AM, Geoff Canyon wrote: send "setTime" to me in (1 - (the long seconds mod 1)) seconds Very nice. If I ever get around to updating the Primer on Message Mechanics, this should go in there. At first I thought this might need a little fudge value added, but now

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Geoff Canyon
I had just finished swapping out my clunky send...in loop code for something similar to yours when I checked mail and saw yours. I took two steps: put the long seconds into t send in (something based on t - trunc(t) Your method of the long seconds mod 1 is of course much better. But you do

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Dennis Brown
I love this clock example. Just so simple. You guys are great! I could not resist seeing how the thinking was progressing and took it to the next step. Fewer lines, more accuracy (I have often noted that the simplest most elegant solutions take the most time to create and the least time

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Malte Brill
Hi all, I wouldn´t have expected so many reactions on the short script I postet. Thanks for the feedback.I should have taken the time to read through the code before posting it and clean it up a bit, though.(You are right DOM, I forgot the quotes around the name of the graphic) And I would ha

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Dom
Geoff Canyon <[EMAIL PROTECTED]> wrote: > go stack url "http://www.inspiredlogic.com/rev/clock.rev"; nice one, too! now, what about making a rounded window, with the time and the date? -- Revolutionario ___ use-revolution mailing list use-revolution

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-30 Thread Geoff Canyon
I originally went with polygon graphics, which put me at about twenty lines of code by your way of counting (including "on" and "end" statements). Switching to oval graphics I got it down to 11 lines, which sweep both the hour and minute hands. But the second hand is jumpy. Simply using s

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-29 Thread Howard Bornstein
On 5/27/05, Malte Brill <[EMAIL PROTECTED]> wrote: > Sorry, couldn't resist > Hey Malte, This is so brilliant! I love it. I tweaked its visuals a little (made the second hand a different color, fattened and shortened the hour hand, etc.) and built it as a standalone. It now runs on my desktop.

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-27 Thread Dom
Malte Brill <[EMAIL PROTECTED]> wrote: > Sorry, couldn´t resist Faites, cher ami :-) Brilliant, indeed, sort of "Rev widget"! (need to quote the "minutes" litteral and, perhaps, to declare local dasecs,daminutes,dahours) -- Revolutionario ___ use-r

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-27 Thread Thomas McGrath III
you didn't even try to do it yourself You just looked at someone else's code and decided it must all be that way? Then HOW WOULD YOU KNOW QUALITY TRANSCRIPT at all On May 27, 2005, at 8:47 PM, [EMAIL PROTECTED] wrote: that seams like QUALITY TRANSCRIPT.

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-27 Thread Richard Gaskin
[EMAIL PROTECTED] wrote: that seams like QUALITY TRANSCRIPT the clock face i looked at was 100 lines of code...and awfull you must be GOOD at transcript ...to do this clock...in 3 minutes.VERY GOOD INDEED... Malte as a true master. You should see the games he demo'd at the Euro Rev

Re: here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

2005-05-27 Thread Vjstbenz
yes that seams like QUALITY TRANSCRIPT the clock face i looked at was 100 lines of code...and awfull you must be GOOD at transcript ...to do this clock...in 3 minutes.VERY GOOD INDEED... it would take meDAYS to achieve this still, it does NOT helpwhen the REV tutorial