FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Random function
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Random function [message #180577 is a reply to message #180574] Wed, 27 February 2013 23:22 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Markus Grob wrote:

> Salvatore schrieb:
>> On 2013-02-25, sonnichjensen(at)gmail(dot)com <sonnichjensen(at)gmail(dot)com> wrote:
>>> I use the rand function to get 10 items of 1808 current itemes.
>>
>> If you want ten random items from an array, you could try the following:
>>
>> <?php
>> // This is the big array you're pulling something out of.
>> $lotsOfItems = array( /* ... */ );
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ...
>
> Sorry, but this line is the problem, which every pseudo random generator
> has. What will you fill in here. What is really different.

That is *irrelevant*. The items *there* do not need to be different and can
even be ordered. It is just the data base for subsequent (pseudo-)random
selection; it suffices that the *key* for accessing that array is a
(pseudo-)random number, and if key repetitions are to be avoided, that you
remember which keys have been used.

> Do you have anything, that's changing in an order, you couldn't tell?
> […]

Sorry, you are posting in gibberish even for a native speaker of German who
could, in theory, try to guess what you meant in English by translating that
word-by-word back to German. But in practice, with what you posted this one
cannot. Therefore, I strongly suggest you stop posting in English until you
improve your English so as you need not rely only on online translators.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Request for proofreading
Next Topic: XML error when accessing a certain method of a wsdl service
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 15:20:12 GMT 2024

Total time taken to generate the page: 0.26711 seconds