Smaller than milliseconds
Dar, > You can collect some random bits using the long seconds, I think, but I > don't think you want to base it on how long it takes to execute some > code. You might want to harvest it from operator interactions and if > you don't have enough of those, from Internet response times. The > number of bits you can harvest depends on your estimate of > predictability. Good ideas. As far as I know there is no calculation one can make that 'wobbles'--that is, you always get the same answer. And healthy computers work the same way. The result is the same, but the time to complete it isn't. Computational results are predictable, completion time wobbles. The finer time is cut, the greater the unpredictability. And while it may not be obvious, most events we think of as being random are random only in the time dimension. Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Smaller than milliseconds?
J/, > If you're looking for a random number generator you should check out "a > new kind of science" by stephen wolfram. Wolfram's Rule 30 thing is great at producing a string of random digits, but what we need is a random seed. What we need is the finger that points out the section of Wolfram's string to use. The digits of Pi are random so we could do the same thing with a huge file of Pi digits. We still need the finger. The whole deal with RNGs used for security purposes isn't about having random digits, it about my picking a certain group of the digits and you not being able to guess which group I chose. We're talkin' encryption. Dar, > But do you have any reason to believe the processor clock and the long > seconds clock are not the same? Generally no, but strictly? I suppose I do. My long seconds are being displayed to 20 magnitudes of precision (with proper numberFormat adjustment). Either an alien technology has taken up residence in my machine or something's screwy. I'm betting on the later. Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Smaller than milliseconds?
Microseconds? Now we're talkin'. OK, here's the deal: A high quality Random Number Generator (RNG) needs two things: a good seed and a clever algorithm to turn the seed into pattern-less numbers. A good seed is one that's unpredictable. And for good security RNGs, the seed often comes from some real world event--quantum stuff like radioactive decay or chaos stuff like lava lamps. (see the current WIRED, p. 88) For low-level security or something with no security concerns one can use computer clock time and be done with it. My idea is this: the time it takes to run some little bit of code isn't predictable (temperature of the processor and about a zillion other factors) and changes from moment to moment, and is specific to every local machine and circumstance. So it might be possible to write a very secure RNG that uses the unpredictability of run time for the seed. So, compute something meaningless like deriving God's last name (about a half second) and use the run time as a good unpredictable seed for the rest of the RNG. Thus it would be possible to have a high quality RNG based in software alone. Also: set the numberformat to "0." put the long seconds Punches up the fraction with digits other than zeros, where they come from I don't know. Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Smaller than milliseconds?
Is there any way to access a time period/measurement smaller than milliseconds in either MetaCard or Rev? Nelson Zink ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Random Redirect
andu, > on startup > put "Location: " & any item of "urls, separated, by, comma" & crlf > put "Content-Type: text/html" & crlf & crlf > end startup > > This works with Apache. Bless you! Works without a hitch. Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Random Redirect
I'm using MetaCard/ Reveloution for cgi at my website and want to be able to randomly redirect to pages at my site. How does one send a redirect to the browser? Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: XY
Tereza, > To avoid bottling up the engine servicing your loop: > > on mouseMove mX, mY > put format( "horz: %d vert: %d", mX, mY ) > end mouseMove > > Scott Raney has told us in the past that "repeat until the mouseClick" is > not a good idea because it bolixes up the event handling in the engine. I've > found that mouseMove works wonderfully in situations where you'd be tempted > to use "repeat until the mouse is up" or similar loops. While mousemove seems straight forward, how would one go about turning it on and off as might be needed in the "XY function"? Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: xy
Erik, > any MC analogues for the xy handler? on xy set cursor to cross set the numberformat to "0.##" --set the height of msg for three lines put the mouseloc into temp repeat until the mouseclick put "Loc: "&the mouseloc&" Horz: "&the mouseH&" Vert: "&the mouseV into temp2 put the mouseH-item 1 of temp into XD put the mouseV-item 2 of temp into YD put "Xdist: "&XD&" YDist: "&YD&" Angle: "&90-(round(atan2(abs(XD),abs(YD))*180/pi)) into line 2 of temp2 put (XD^2 + YD^2)^.5 into temp3 put "XYDist: "&temp3 &" pixels, "&(temp3 /72)& " inches" into line 3 of temp2 put temp2 end repeat end xy Here's one that does a little more. I don't know how to set the message box height so it will automatically display the three lines. If you do, stick that line in. Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
cgi-MetaCard Gremlin
All-- I've finally run to ground a gremlin that's been plaguing me for a couple years. If I upload a good script (something.mt) to my site, often it won't run. If I then go through the site manager and open something.mt and save it (without changing anything) it'll run. Why this is, I have no idea. I use GoLive to upload and manage my site, if that makes any difference. If you're having strange problems getting cgi to work right, this may help. Nelson Zink ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Moving an image in a curve
Andrew, If you mean moving an image in an arc the following will work. Create a button with the following script, click on it, and see if this is anywhere close to what you have in mind. on mouseup put 239 into YY put 430 into XX --center of circle between start (260) and finish (600) put 200 into RR --radius of the arc put 5000 into NumSteps --this essentially sets the speed put (Pi/2)*3 into StartPoint --start at the 270 degree point repeat NumSteps set the loc of me to XX+round(RR*sin (StartPoint)),YY+round(RR*cos (StartPoint)) subtract (Pi/NumSteps) from Startpoint --add to go counterclockwise end repeat end mouseup Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Julian Dates
Richard, > Anyone got an xTalk algorithm for converting between standard and Julian > dates they can share? --Georgian to Julian Date converter put the short date into now convert now to dateitems put item 1 of now into year put item 2 of now into month put item 3 of now into day if month<=2 then add 12 to month subtract 1 from year end if put trunc(year/100) into aa put (2-aa+trunc(aa/4)) into bb put trunc(365.25*year) into cc put trunc(30.6001*(month+1)) into dd put (bb+cc+dd+day+1720995) into julian Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Julian Dates
Richard, > Anyone got an xTalk algorithm for converting between standard and Julian > dates they can share? --Georgian to Julian Date converter put the short date into now convert now to dateitems put item 1 of now into year put item 2 of now into month put item 3 of now into day if month<=2 then add 12 to month subtract 1 from year end if put trunc(year/100) into aa put (2-aa+trunc(aa/4)) into bb put trunc(365.25*year) into cc put trunc(30.6001*(month+1)) into dd put (bb+cc+dd+day+1720995) into julian Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Extra Blank Sheet
When printing out a card from script I get an addition blank sheet. If I print from menu this doesn't happen. What setting(s) might be involved and need set? Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Label Printing
Anybody have a label printing program they'd share? Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Re: OT: Page generation Do it locally or put the burden on the Web
Sivakatirswami , > I can move the source text and templates to the web server and convert my > local metacard button script to a .mt script and then let the web server > build the page each time someone hits on it. I did much the same thing at http://www.navaching.com to serve up new daily Haiku and proverbs. The page is built just ONCE a day, automatically at the site. Every time someone hits on the page cgi checks the date (compares it with a text file) and if it's tomorrow rebuilds, if it's today then just sends the page. The trick was (is) two fold: 1) generating a new page 2) and the "Status: 204 No Content" & cr business below. This was the hardest part until I found 204. Without 204 you'll get an error, as the web is set up on a call/response basis. What you want to do is send nothing back and that's what 204 does. So the guts of the script below only kicks in once a day, otherwise the page is sent. 204 is what made the whole thing possible. You can make it work without 204 but the FIRST hit tomorrow (the rebuilding hit) gets today's page. If your traffic is heavy and/or you aren't to concerned about that first soul who shows up tomorrow then you can drop 204. #!mc --- update.mtupdate html pages on startup -checkdate put url "file:seconds.mt" into it if the seconds>it then put the short date into temp convert temp to seconds put (temp+86400) into temp --the daily seconds open file "seconds.mt" for write write temp to file "seconds.mt" at 0 close file "seconds.mt" -- generate data for new pages --update pages You have dummy pages with variables in the html and just search for and replace with the data generated -- send 'Update' page put url "file:../update.html" into buffer put "Content-Type: text/html" & cr put "Content-Length:" && the length of buffer & cr & cr put buffer else put "Status: 204 No Content" & cr --a non response end startup There is a slightly better explanation in Section 8 of http://www.navaching.com/pagem.html. This deal has been running for a couple years without a hitch. Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Lighting up GIFs
We make a new stack, import a GIF, put in btns and furniture and decorate the place. Looks great. Quit and come back the next morning and start it up. No GIF?? Well, it's there (kind of) by not turned on. So what's the language to get it turned on, loaded up or whatever you want to call it. The file name's right there in it's 'image properties'. import paint from file "BronzeImage Folder/PMap.gif" is cranky and only works sometimes and not without the script editor complaining. Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
marked cd number
How do I get the (marked) number of a current marked cd? the number of this marked cd --doesn't work, it just give the cd number. Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
CrossPlatform
I've created a stack on my Mac to keep track of the editions of my wife's bronze sculpture. Cross town the gallery is PC, is there any way to get my stack to run on their PC without creating a standalone? Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Type 2 Errors and Crashed
I've been build a database, on a Mac, and the number of crashes has been increasing. Anytime I do any editing of the group which makes up the basic record card a crash is imminent. This 'group" business seems abnormally temperamental. This evening the stack became fatally poisoned and I'd like to attempt some kind of recovery rather than build forward from the last save. Then there is the data entered in the records. Any suggestions? Everything not on a record card seems alright if I tiptoe carefully. Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
Draw a Line
How might one draw a red line of medium width from say 100,100 to 200,200? Nelson Zink Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.