Why can't FPC automatically call randomize() in the RTL. Put it in
some initialization section. That way, at application startup,
randomize() is already called and only Random() needs to be used?
Please not! This would hamper all kinds of scientific, statistical and
financial modelling. For
On 31/05/2008, Vinzent Höfler [EMAIL PROTECTED] wrote:
Note that random() will always return the same sequence if you don't call
randomize() once in the program.
Yes. But don't make the mistake to call it more than once.
Why can't FPC automatically call randomize() in the RTL. Put it in
[ Charset ISO-8859-1 unsupported, converting... ]
On 31/05/2008, Vinzent H?fler [EMAIL PROTECTED] wrote:
Note that random() will always return the same sequence if you don't call
randomize() once in the program.
Yes. But don't make the mistake to call it more than once.
Why
Graeme Geldenhuys schrieb:
On 31/05/2008, Vinzent Höfler [EMAIL PROTECTED] wrote:
Note that random() will always return the same sequence if you don't call
randomize() once in the program.
Yes. But don't make the mistake to call it more than once.
Why can't FPC automatically call
On 02 Jun 2008, at 09:49, Marco van de Voort wrote:
Why can't FPC automatically call randomize() in the RTL. Put it in
some initialization section. That way, at application startup,
randomize() is already called and only Random() needs to be used?
Then the whole random system is linked in,
On 02/06/2008, Marco van de Voort [EMAIL PROTECTED] wrote:
Then the whole random system is linked in, even when not used.
I would have thought this is already linked in as part of the RTL.
Simply not initialized until the first Randomize() call.
Also when you would want to set a different
Daniël Mantione schreef:
Op Mon, 2 Jun 2008, schreef Florian Klaempfl:
all, if you use Random(), you want something random, yet many
developers make the common mistakes of not calling Randomize() or
calling it to often. If FPC handled that for us, nobody would every
make those mistakes
Op Mon, 2 Jun 2008, schreef Florian Klaempfl:
all, if you use Random(), you want something random, yet many
developers make the common mistakes of not calling Randomize() or
calling it to often. If FPC handled that for us, nobody would every
make those mistakes again!
People might want to
On Mon, 2 Jun 2008, Daniël Mantione wrote:
Op Mon, 2 Jun 2008, schreef Florian Klaempfl:
all, if you use Random(), you want something random, yet many
developers make the common mistakes of not calling Randomize() or
calling it to often. If FPC handled that for us, nobody would
Op Mon, 2 Jun 2008, schreef Michael Van Canneyt:
People might want to start with a defined randseed to reproduce behaviour.
This implies createguid should not call randomize automatically either, it
prevents you having deterministic behaviour, especially in a program where
guids and normal
Klaus Hartnegg schreef:
a call to randomize disrupts the current state of the random
generator. That means that if you use random outside guid creation,
creating a guid can have unintended side effects on your random
generation.
Maybe the GUID generator should have an automatic call to
On Mon, 2 Jun 2008, Daniël Mantione wrote:
Op Mon, 2 Jun 2008, schreef Michael Van Canneyt:
Creating GUIDs should never be deterministic.. ?
a call to randomize disrupts the current
state of the random generator. That means that if you use random outside guid
creation, creating a guid can
Vincent Snijders wrote:
Klaus Hartnegg schreef:
a call to randomize disrupts the current state of the random
generator. That means that if you use random outside guid creation,
creating a guid can have unintended side effects on your random
generation.
Maybe the GUID generator should have
Vinzent Höfler schrieb:
If Randomize() were truly and more random, one wouldn't need
Random() after all, would one?
Randomize is rather slow compared with random.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
Zitat von Graeme Geldenhuys [EMAIL PROTECTED]:
Hi,
I'm trying to do performance testing in Firebird RDBMS using GUID's
and primary keys. I constantly got PK violations. I then wrote the
code show below to create 50,000 GUID's and add them to a StringList
(no duplicates allowed). Every time
On Thu, 29 May 2008, Graeme Geldenhuys wrote:
Hi,
I'm trying to do performance testing in Firebird RDBMS using GUID's
and primary keys. I constantly got PK violations. I then wrote the
code show below to create 50,000 GUID's and add them to a StringList
(no duplicates allowed). Every
On Thu, 29 May 2008, Graeme Geldenhuys wrote:
I'm trying to do performance testing in Firebird RDBMS using GUID's
and primary keys. I constantly got PK violations. I then wrote the
code show below to create 50,000 GUID's and add them to a StringList
(no duplicates allowed). Every time I
On 29 May 2008, at 13:26, Michael Van Canneyt wrote:
The default implementation on Linux uses a random() call to generate a
guid, combined with a timestamp, if I recall correctly.
Note that random() will always return the same sequence if you don't
call randomize() once in the program.
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
Sounds like the Debian openssl key fiasko.
I saw Ubuntu had some updates to resolve this issue on my system. Got
the updates, rebooted, recompiled my application and still 1021 is my
limit before I get duplicates.
What is really weird is that once I
2008/5/29 Michael Van Canneyt [EMAIL PROTECTED]:
The default implementation on Linux uses a random() call to generate a
guid, combined with a timestamp, if I recall correctly.
You can use the kernel mechanism by inluding libuuid in your uses clause.
That should ensure uniqueness.
Yup, that
Zitat von Graeme Geldenhuys [EMAIL PROTECTED]:
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
Sounds like the Debian openssl key fiasko.
I saw Ubuntu had some updates to resolve this issue on my system. Got
the updates, rebooted, recompiled my application and still 1021 is my
limit before
2008/5/29 Marco van de Voort [EMAIL PROTECTED]:
rtl/linux/suuid.inc reads from '/proc/sys/kernel/random/uuid' Maybe it is
not used though.
How do I know if it's using Random or '/proc/sys/kernel/random/uuid'?
Browsing the RTL source code with Lazarus, I believe I am using the
latter, but not
Graeme Geldenhuys schrieb:
2008/5/29 Marco van de Voort [EMAIL PROTECTED]:
rtl/linux/suuid.inc reads from '/proc/sys/kernel/random/uuid' Maybe it is
not used though.
How do I know if it's using Random or '/proc/sys/kernel/random/uuid'?
Browsing the RTL source code with Lazarus, I believe I am
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
Sorry. Openssl has *nothing* to do with the CreateGUID function.
I thought that much, but then thought it wouldn't hurt installing the
patch anyway.
What is really weird is that once I hit the 1021 limit, I can't run
that method again. I get a
2008/5/29 Florian Klaempfl [EMAIL PROTECTED]:
How do I know if it's using Random or '/proc/sys/kernel/random/uuid'?
Browsing the RTL source code with Lazarus, I believe I am using the
latter, but not 100% sure.
If it uses /proc/sys/kernel/random/uuid, strace shows it.
Thanks Florian. I am
Graeme Geldenhuys schreef:
2008/5/29 Florian Klaempfl [EMAIL PROTECTED]:
How do I know if it's using Random or '/proc/sys/kernel/random/uuid'?
Browsing the RTL source code with Lazarus, I believe I am using the
latter, but not 100% sure.
If it uses /proc/sys/kernel/random/uuid, strace shows
Zitat von Graeme Geldenhuys [EMAIL PROTECTED]:
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
Sorry. Openssl has *nothing* to do with the CreateGUID function.
I thought that much, but then thought it wouldn't hurt installing the
patch anyway.
It would hurt a lot *not* installing the patch.
GUID's are supposed to be very unique! Wikipedia says something like:
Create a billion every second for 10 years or something before you
deplete the range.
So what is wrong with my code or maybe the Free Pascal implementation?
I quicktested the FreeBSD implementation, verified it used the
On Thu, 29 May 2008, Mattias Gärtner wrote:
Zitat von Graeme Geldenhuys [EMAIL PROTECTED]:
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
Sorry. Openssl has *nothing* to do with the CreateGUID function.
I thought that much, but then thought it wouldn't hurt installing the
patch
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
It would hurt a lot *not* installing the patch. The bigger problem is that the
other distributions including windows, Mac OS X, BSD, ... server must now
install the blacklist too. I guess non debian systems now have bigger problems
than debian.
On Thu, 29 May 2008, Graeme Geldenhuys wrote:
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
Sorry. Openssl has *nothing* to do with the CreateGUID function.
I thought that much, but then thought it wouldn't hurt installing the
patch anyway.
What is really weird is that once I hit
2008/5/29 Michael Van Canneyt [EMAIL PROTECTED]:
can you send me your test program, so I can test my fixes ?
Here you go. It is pretty much what I sent before, except now I made
it a console application instead of a fpGUI one. Below it tries to
create 50,000 GUID's. My SQL version tries 5mil.
On Thu, 29 May 2008, Graeme Geldenhuys wrote:
2008/5/29 Michael Van Canneyt [EMAIL PROTECTED]:
can you send me your test program, so I can test my fixes ?
Here you go. It is pretty much what I sent before, except now I made
it a console application instead of a fpGUI one. Below it
Michael Van Canneyt schreef:
On Thu, 29 May 2008, Graeme Geldenhuys wrote:
2008/5/29 Michael Van Canneyt [EMAIL PROTECTED]:
can you send me your test program, so I can test my fixes ?
Here you go. It is pretty much what I sent before, except now I made
it a console application instead of a
On Thu, 29 May 2008, Vincent Snijders wrote:
Michael Van Canneyt schreef:
On Thu, 29 May 2008, Graeme Geldenhuys wrote:
2008/5/29 Michael Van Canneyt [EMAIL PROTECTED]:
can you send me your test program, so I can test my fixes ?
Here you go. It is pretty much what I sent
Zitat von Graeme Geldenhuys [EMAIL PROTECTED]:
2008/5/29 Mattias Gärtner [EMAIL PROTECTED]:
It would hurt a lot *not* installing the patch. The bigger problem is that
the
other distributions including windows, Mac OS X, BSD, ... server must now
install the blacklist too. I guess non
Vincent Snijders schrieb:
Michael Van Canneyt schreef:
I patched it so Randomize is called only once.
Merged to fixes.
Thanks. BTW, the log message made me think you introduced a new bug :-)
GetRandomBytes calls random only once
instead of
GetRandomBytes calls randomize only once
... and
37 matches
Mail list logo