<br><br><div><span class="gmail_quote">On 7/27/07, <b class="gmail_sendername">Tiger12506</b> &lt;<a href="mailto:keridee@jayco.net">keridee@jayco.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hmmm... interesting tie to another post...<br><br>&gt;&gt;&gt; x = timeit.Timer(&#39;random.random()&#39;,&#39;import random&#39;)<br>&gt;&gt;&gt; x.timeit(3000000)<br>1.0161026052194018<br>&gt;&gt;&gt; y = timeit.Timer(&#39;random()&#39;,&#39;from random import random&#39;)
<br>&gt;&gt;&gt; y.timeit(4600000)<br>1.0004307810070827<br><br>Dictionary lookups do take HUGE amounts of time. Interesting.<br><br>Anyway... I&#39;ve got it down to<br>Your numbers with a little more precision gave me<br>
3.4e5987 yrs.<br><br>and mine<br><br>3.0e5987 yrs.<br><br>That&#39;s a hell of a lot of years! Remember that everyone! If you want your<br>code to run forever and to eternity, copy variables to the local namespace<br>first; you get a lot more accomplished (well... whatever)&nbsp;&nbsp;&nbsp;&nbsp;;-)
<br><br>Anyway, the frivolity aside, I can get it to repeat every ten seconds. ;-)<br>Set the computer clock. (okay, maybe i&#39;m just in a silly mood. But<br>seriously,<br>that&#39;s why the docs say that it is NOT meant for cryptography - not that
<br>that matters<br>to the OP, snicker; What have I been drinking????)<br><br>&gt; Well, I was trying to emphasize that it was, for pretty much all intents<br>&gt; and purposes, infinite.<br><br>Nope-nope-nope you&#39;re wrong :-)~
</blockquote><div><br>The way I understood the &#39;period&#39; of the&nbsp; random function was that after x calls to the function, you would start getting the same pattern of results as you did to begin with, in _the same running process_ of a program.
<br>This is a separate situation from having the clock be exactly the same and getting the same random values on program start - we already knew that would happen, because the seed hadn&#39;t changed.<br>Unless I understand the period wrong, but I don&#39;t think so.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The daring cracker enters the room, his heart quickening as the door hinge<br>
creaks with the sound of the smallest ever mouse. His dark clothing masks<br>him from the lit room visible through the window on the adjacent wall. A<br>woman, working late, sits in a comfortable office chair, her face glowing
<br>from the reflection of her computer screen. A cup of Java (pun intended)<br>indicates to anyone watching that she is overworked, and under-paid.<br><br>Each step he takes brings him closer to his target. The big boss gave him a
<br>pay cut so that this new PC could sit on his boss&#39;s desk. The cracker&#39;s<br>jealously seems to almost permeate the room. Vengeance shouts out louder<br>than the compressor of the air conditioner in the north window. The cracker
<br>intinctively looks up to see if his emotions betrayed his presence. But the<br>woman in the other room continues her scrolling through endless lines of<br>buggy, hard to read, unmaintainable, bloated, and otherwise ridiculously
<br>foolish code that could have been so easily fixed if the same &#39;big boss&#39; had<br>ordered the project in Python.<br><br>Soon, a floppy disk is pulled out of a black jacket pocket. No one has ever<br>run the program on the floppy before. Taking the disk, the cracker inserts
<br>it into the drive, starts the machine, swears under his breath when he reads<br>&quot;Non-System disk or disk error. Replace and strike any.&quot;<br><br>Striking the &#39;any&#39; key, he quickly shoves the floppy disk back in. He wants
<br>this over with. Again, he looks to see if he has been detected; still he is<br>safe. Opening the folder containing the floppy drive, he groans silently as<br>the annoying Windows Firewall flashes an update notice. &quot;See...&quot; he thinks
<br>to himself, &quot;Micro$oft *can* actually restrict viruses from entering their<br>OS.&quot; He fights with the window, impatiently waiting for countless libraries<br>to load and free, until the UI responds and he can send it a WM_CLOSE
<br>message.<br><br>Smirking evily, the cracker double-clicks the executable<br>&#39;pink_fuzzy_bunny.exe&#39; and resists the urge to laugh maniacally as he<br>watches the computer clock freeze and not move. Ingenious--his plan--All it
<br>takes to freeze time is to contantly set it to the same second in history.<br>Time. Forever frozen. He frowns as he realizes that in so doing, he provides<br>the only effective means for keeping those pesky Windows notices out of his
<br>boss&#39;s hair. &quot;No matter&quot; --he thinks, &quot;He will have worse troubles in due<br>time.&quot; Again he suppresses a maniacal laugh.<br><br>. . .<br><br>Monday morning brings a bright and cheerful man into an office, his office.
<br>The door creaks a little as he opens it, and the air conditioner buzzing in<br>the north wall window is refreshing to him after the heat from outside. The<br>man waves cheerfully at a woman through the glass in the adjacent wall, whom
<br>looks up only for an instant to scowl. The man, who recently bought his new<br>PC, smiles proudly as he turns it on. His new python program which he keeps<br>on the desktop is his early attempt at a cricket game simulation. He
<br>lovingly double-clicks the icon, and runs the program several times. Each<br>successive time his grin grows smaller and smaller until his face is more<br>than troubled. Why is his program producing the same output every time? A
<br>scream is heard in the office &quot;NOOOOOOO!!!!!!!!&quot;<br>The boss runs from the building, never to notice the clock in the<br>bottom-right hand corner which still shows the caption &#39;10:33 PM&#39;.<br><br>Somewhere, someplace a cracker lies in bed, a silly grin on his face. His
<br>objective, he knows, has been accomplished.</blockquote><div><br>nice story.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; Because the possibility of my computer even existing after that long is<br>&gt; effectively zero, I consider the pattern to never repeat :)<br><br>Ahhh...<br>Your computer ~ sitting on a pedestal in the middle of nowhere in AD
<br>3.0e5988, the last shrine to the ancient past-- A technological marvel to<br>the ape like creatures whom are all that remain of the once all powerful<br>race of human beings.<br><br>Our ape, named Jogg, looks at the bright computer screen, jumps back in fear
<br>as the ancient Windows Beep function is called and the foreign noise hits<br>him. What is this? There is a message there.<br><br>...<br>...<br>&nbsp;&nbsp;File &quot;&lt;stdin&gt;&quot;, line 2, in find<br>&nbsp;&nbsp;File &quot;&lt;stdin&gt;&quot;, line 2, in find
<br>&nbsp;&nbsp;File &quot;&lt;stdin&gt;&quot;, line 2, in find<br>RuntimeError: maximum recursion depth exceeded<br>&gt;&gt;&gt;<br><br>Damn. I guess we will never know.<br><br>(okay... maybe nobody spiked my Mt. Dew, but maybe because it&#39;s after 3:00
<br>am)</blockquote><div><br>as a side note - are you going to enter the September Pyweek?&nbsp; You should! It&#39;s a lot of fun.<br>-Luke<br></div></div><br>