|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help
lists.php.net
Date: Mon Oct 06 2008 - 02:00:18 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 6 Oct 2008 07:00:18 -0000 Issue 5720
Topics (messages 281451 through 281462):
Re: First 30 characters of a strong
281451 by: Ashley Sheridan
mt_rand() - the same forever?
281452 by: Janek
281453 by: Richard Heyes
281454 by: Janek
281455 by: Ashley Sheridan
281456 by: Janek
281457 by: Jochem Maas
Politics
281458 by: Amy
Re:
281459 by: huaizong wang
Join The Team
281460 by: Hemant Patel
Best Search Algorithm for Millions of record
281461 by: Hemant Patel
281462 by: Micah Gersten
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Sun, 2008-10-05 at 14:52 -0400, Ron Piggott wrote:
> How do I display the first 5 characters of a string?
>
> $string="abcdefghijklmnopqrstuvwxyz";
>
> my desired output is
>
> abcde
>
>
substr($string, 0, 5);
Ash
www.ashleysheridan.co.uk
attached mail follows:
I wonder whether I can rely on the stability of mt_srand() and
mt_rand(). I want them to generate the same sequence for a fixed seed,
regardless of PHP version. Do you think I can trust it?
Janek
attached mail follows:
> I wonder whether I can rely on the stability of mt_srand() and
> mt_rand(). I want them to generate the same sequence for a fixed seed,
> regardless of PHP version. Do you think I can trust it?
> Janek
Keep in mind (if you're not already) that mt_rand() doesn't
technically need to be seeded.
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.phpguru.org/RGraph
attached mail follows:
I know, but I *want* to seed it. My goal is to have a fixed
pseudorandom sequence for each integer (seed) and I don't want those
sequences to change regarding PHP version.
Janek
On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes <richard
php.net> wrote:
>> I wonder whether I can rely on the stability of mt_srand() and
>> mt_rand(). I want them to generate the same sequence for a fixed seed,
>> regardless of PHP version. Do you think I can trust it?
>> Janek
>
> Keep in mind (if you're not already) that mt_rand() doesn't
> technically need to be seeded.
>
> --
> Richard Heyes
>
> HTML5 Graphing for FF, Chrome, Opera and Safari:
> http://www.phpguru.org/RGraph
>
attached mail follows:
On Sun, 2008-10-05 at 21:57 +0200, Janek wrote:
> I know, but I *want* to seed it. My goal is to have a fixed
> pseudorandom sequence for each integer (seed) and I don't want those
> sequences to change regarding PHP version.
>
> Janek
>
> On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes <richard
php.net> wrote:
> >> I wonder whether I can rely on the stability of mt_srand() and
> >> mt_rand(). I want them to generate the same sequence for a fixed seed,
> >> regardless of PHP version. Do you think I can trust it?
> >> Janek
> >
> > Keep in mind (if you're not already) that mt_rand() doesn't
> > technically need to be seeded.
> >
> > --
> > Richard Heyes
> >
> > HTML5 Graphing for FF, Chrome, Opera and Safari:
> > http://www.phpguru.org/RGraph
> >
>
Doesn't it also rely on the system clock as well?
Ash
www.ashleysheridan.co.uk
attached mail follows:
On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan
<ash
ashleysheridan.co.uk> wrote:
> On Sun, 2008-10-05 at 21:57 +0200, Janek wrote:
>> I know, but I *want* to seed it. My goal is to have a fixed
>> pseudorandom sequence for each integer (seed) and I don't want those
>> sequences to change regarding PHP version.
>>
>> Janek
>>
>> On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes <richard
php.net> wrote:
>> >> I wonder whether I can rely on the stability of mt_srand() and
>> >> mt_rand(). I want them to generate the same sequence for a fixed seed,
>> >> regardless of PHP version. Do you think I can trust it?
>> >> Janek
>> >
>> > Keep in mind (if you're not already) that mt_rand() doesn't
>> > technically need to be seeded.
>> >
>> > --
>> > Richard Heyes
>> >
>> > HTML5 Graphing for FF, Chrome, Opera and Safari:
>> > http://www.phpguru.org/RGraph
>> >
>>
> Doesn't it also rely on the system clock as well?
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
No. When I give a fixed seed to mt_srand(), each time I get the same
sequence of mt_rand()s. My question is wheather the actual algorithm
behind these functions is likely to change in the next version of PHP
or not.
Janek
attached mail follows:
Janek schreef:
> On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan
> <ash
ashleysheridan.co.uk> wrote:
>> On Sun, 2008-10-05 at 21:57 +0200, Janek wrote:
>>> I know, but I *want* to seed it. My goal is to have a fixed
>>> pseudorandom sequence for each integer (seed) and I don't want those
>>> sequences to change regarding PHP version.
>>>
>>> Janek
>>>
>>> On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes <richard
php.net> wrote:
>>>>> I wonder whether I can rely on the stability of mt_srand() and
>>>>> mt_rand(). I want them to generate the same sequence for a fixed seed,
>>>>> regardless of PHP version. Do you think I can trust it?
>>>>> Janek
>>>> Keep in mind (if you're not already) that mt_rand() doesn't
>>>> technically need to be seeded.
>>>>
>>>> --
>>>> Richard Heyes
>>>>
>>>> HTML5 Graphing for FF, Chrome, Opera and Safari:
>>>> http://www.phpguru.org/RGraph
>>>>
>> Doesn't it also rely on the system clock as well?
>>
>>
>> Ash
>> www.ashleysheridan.co.uk
>>
>>
>
> No. When I give a fixed seed to mt_srand(), each time I get the same
> sequence of mt_rand()s. My question is wheather the actual algorithm
> behind these functions is likely to change in the next version of PHP
> or not.
not likely to change in the next version at all. but there is no guarantee that
somewhere down the road a new 'rand' algorythm won't be used either,
3 things to consider doing:
1. write your own php extension that copies the mt_srand() function as
it is now and use your extension's version of the function ... then you
can be sure it won't change.
2. ask the devs on internals
lists.php.net what they think the likelyhood
is that the output may change in the future.
3. pre-generate the sequences and store them, then use those pre-generated
sequences instead of using mt_srand() (obviously this may not be viable at all)
>
> Janek
>
attached mail follows:
confronted gillion presently flakey expanded courses newsreader publicaccess storages
attached mail follows:
On Sun, Oct 5, 2008 at 1:00 PM, huaizong wang <huaizongfujian2
gmail.com> wrote:
>
>
attached mail follows:
Hi...ALL...
With Regads,
Hemant Patel
attached mail follows:
My question is Whether I should go for Full Text Based search or Database
Search...?And is there algorithm in php which can help me in this case...?
attached mail follows:
The question is, what are you searching for in the records?
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Hemant Patel wrote:
> My question is Whether I should go for Full Text Based search or Database
> Search...?And is there algorithm in php which can help me in this case...?
>
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]