Latest Articles
 by awuehr on 11-10-2008 in Tips & Tricks by Village Idiot on 11-04-2008 in Classes & Objects by codefreek on 10-23-2008 in Basic by wiifanatic on 09-12-2008 in Security & Permissions by drewbee on 07-03-2008 in Tips & Tricks
 IRC Channel
 Join the friendly bunch on IRC... (#TalkPHP on Freenode) ...Also available via a web interface. See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
 Associates
 Associates
 TalkPHP » Same as ET..
 12-05-2009, 09:53 AM #1 (permalink) That guy     Join Date: Sep 2009 Location: San Antonio, TX Posts: 24 Thanks: 0 Same as ET.. I need this translated, please. Any takers? PHP Code: ``` #!/usr/bin/env pythonimport randomdef rand(n):    x = 10000000    r = [random.randint(0, x) for i in xrange(n)]    isrt(r)    for i in r:        print idef isrt(a):    for j in range(1, len(a)):        key = a[j]        i = j - 1        while (i >= 0) and (a[i] > key):            a[i+1] = a[i]            i = i - 1        a[i+1] = keyrand(2000)  ```
 12-05-2009, 02:27 PM #2 (permalink) The Addict     Join Date: Jun 2008 Posts: 335 Thanks: 2 No translation services unfortunately but I will tell you that all this does is create a random string. Simply google random string generator in php will do. __________________ My Blog
Moderateur

Join Date: Apr 2007
Posts: 1,393
Thanks: 5

Quote:
 Originally Posted by cachepl0x I need this translated, please. Any takers?

PHP Code:
``` // Example: my_rand(2000); function my_rand(\$n) {     \$max  = 10000000;     \$nums = array();          // Generate set of random numbers between 0 and \$max (inclusive)     for(\$i = 0; \$i < \$n; \$i++) {         \$nums[] = mt_rand(0, \$max);     }          // Sort in ascending numerical order     sort(\$nums, SORT_NUMERIC);          // Output the numbers     foreach (\$nums as \$num) {         echo \$num . "\n";     } }  ```

 12-06-2009, 03:32 AM #4 (permalink) That guy     Join Date: Sep 2009 Location: San Antonio, TX Posts: 24 Thanks: 0 Thanks, Salathe. I wrote the original, I just wanted to see how it would be implemented in PHP. I hadn't really used PHP's sort() function, and I am surprised at how simple it is for a sorting algorithm.
 06-25-2012, 12:33 PM #5 (permalink) The Wanderer   Join Date: May 2012 Location: usa Posts: 6 Thanks: 0 Nike NFL Jerseys from china, Nike NFL Jerseys online,cheap Nike NFL Jerseys,2012 nike nfl jerseys, nike nfl women jerseys,buy jerseys online, soccer jerseys shop online, nfl jerseys store online

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)