Sign in Join
Wiki copytemporary

EverettRandom: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: EverettRandom

OldNewLine
1+## Everett Random Integer Class
2+
3+### Summary
4+
5+The Everett interpretation of quantum mechanics ("Many Worlds") is that when an interaction is made with an elementary wave function (such as an electron or photon etc) the universe bifurcates. ref: [Wikipedia Many Worlds page](https://en.wikipedia.org/wiki/Many-worlds_interpretation)
6+
7+This happens naturally of course (just via radioactive decays in atoms of your body there are about 5000 bifucations per second) but this component brings into the mix "Free Will". By requesting a random number from the online source, which is a beam-splitter based in Austrailia you are bifurcating the Universe deliberately - that is, based on your Free Will. You may or may not find that interesting, but nevertheless this component gives you this ability (to "play God" with the Universe)
8+
9+The random numbers returned are truly random (i.e. not pseudorandom via algorithm)
10+
11+This package is a wrapper for querying a quantum number generator based in Austrailia.\
12+![](/wiki-images/d/d0/Everettrandom_screenshot.png)\
13+----
14+
15+#### Download
16+
17+- the everettrandom package can be downloaded as a zip from [Lazarus ccr site](https://svn.code.sf.net/p/lazarus-ccr/svn/components/everettrandom/latest_stable/updates/everettrandom.zip)
18+
19+\
20+----
21+
22+#### Installation and Usage
23+
24+- Open everettrandom.lpk and compile it.
25+- In your application, include everettrandom as a required package
26+- In a form unit:
27+ - In the Uses clause, add ueverettrandom
28+
29+\
30+----
31+
32+#### Code
33+
34+- Declare as a variable:
35+
36+``` pascal
37+MyEverett: TEverett;
38+```
39+
40+- In form Create:
41+
42+``` pascal
43+MyEverett := TEverett.Create(Self);
44+```
45+
46+- If you don't want to show a dialog whilst querying the server:
47+
48+``` pascal
49+MyEverett.ShowWaitDialog:=FALSE;
50+```
51+
52+- There are 3 functions that will retrieve a single integer:
53+
54+``` pascal
55+// Fetch a single random number
56+function MyEverett.GetSingle8Bit: integer;
57+function MyEverett.GetSingle16Bit: integer;
58+function MyEverett.GetSingleHex: String;
59+```
60+
61+- Array functions will put results into:
62+ - (GetInteger8BitArray, GetInteger16BitArray) populates
63+ ``` pascal
64+ MyEverett.IntegerArray[0..Pred(ArraySize)]
65+ ```
66+ - (GetHexArray) populates
67+ ``` pascal
68+ MyEverett.HexArray[0..Pred(ArraySize)]
69+ ```
70+- First set the properties:
71+ - MyEverett.ArraySize (default=1)
72+ - ..and for Hex results
73+ - MyEverett.HexSize (default=1) e.g. 1=00-\>FF, 2=0000-\>FFFF, 3=000000-\>FFFFFF etc.
74+- Result for array functions is TRUE(Success) or FALSE(failure)
75+
76+``` pascal
77+function MyEverett.GetInteger8BitArray:Boolean;
78+function MyEverett.GetInteger16BitArray:Boolean;
79+function MyEverett.GetHexArray:Boolean;
80+```
81+
82+------------------------------------------------------------------------
83+
84+#### Internationalisation
85+
86+- i8n: everettrandom has a 'locale' folder with all the .po files needed for translation. The base language is English
87+
88+\
89+----
90+
91+#### Demo App
92+
93+- In the /demo folder is a small application to demonstrate the use of everettrandom
94+- Compile and run the app to see if it runs OK on your system.
95+ - *The server can be busy, so be patient and wait for the result*
96+- Study the source code to see how to use the methods and properties of the everettrandom class
97+
98+\
99+----
100+
101+Minesadorada Last Edited: //
102+
103+---
104+*From the Free Pascal wiki, page "EverettRandom", as it stood on 2020-11-29 after a change by Jwdietrich, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
105+Category: Components
106+Category: Packages
107+Category: Statistical algorithms

Back to history