cheap_random 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -1
- data/README.md +19 -3
- data/cheap_random.gemspec +11 -2
- data/lib/cheap_random/version.rb +1 -1
- metadata +28 -17
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -11,15 +11,15 @@ Simple and powerful: The **CheapRandom algorithm** is fast, fast enough to be pr
|
|
11
11
|
|
12
12
|
Version
|
13
13
|
-------
|
14
|
-
v0.9.
|
14
|
+
v0.9.3 with comprehensive tests, developed using ruby 1.9.3 and rspec 2.10.0 is the same as v0.9.1 (gem v0.9.2) aside from the addition of the **examples2** directory.
|
15
15
|
|
16
16
|
Installation
|
17
17
|
------------
|
18
|
-
|
18
|
+
Get the v0.9.3 gem or clone the repository. Create a directory called **random** in the repository root. Use **examples/make\_seed.rb** to make a **the.seed** file - (a 256 byte permutation file) from arbitrary data using the **CheapRandom default seed**.
|
19
19
|
|
20
20
|
Usage and documentation
|
21
21
|
-----------------------
|
22
|
-
Study the programs in the **examples** and **spec** directories and use the **.rb** files in the **lib** directory. See below for more information.
|
22
|
+
Study the programs in the **examples** and **spec** directories and use the **.rb** files in the **lib** directory. See below for more information. Additionally, the **examples2** directory contains tools for the **crx** bash script, using the c programs **cr** and **rpb**, for a very convenient way of working with cheap random files.
|
23
23
|
|
24
24
|
License
|
25
25
|
-------
|
@@ -83,3 +83,19 @@ Other possible uses of CheapRandom
|
|
83
83
|
----------------------------------
|
84
84
|
There are a number of intriguing possible uses for the **CheapRandom algorithm** and the **CheapRandom seed** properties beyond random number generation.
|
85
85
|
|
86
|
+
Additional Examples - C code and In Place File Processing
|
87
|
+
---------------------------------------------------------
|
88
|
+
The **examples2** directory contains examples related to **example2/cr.c** These examples are designed to be on the PATH and require the use of a C compiler.
|
89
|
+
|
90
|
+
cr.c Cheap Random Filter and Friends
|
91
|
+
------------------------------------
|
92
|
+
**gcc -Wall cr.c -o cr** creates the **cr** cheap random filter. Running **cr h** writes out some help text. **cr <somefile >some_file.random** and **cr u <somefile.random >somefile** are the most basic use of **cr**. **the.seed** is hard coded into **cr**. To see how, use **chex\_pipe.rb <the.seed** and compare the console output to the definition of SEED in **cr.c**. **the.seed** was generated by running the bash script **make_seed pet\_cat.png**
|
93
|
+
|
94
|
+
|
95
|
+
crf.rb Cheap Random File, In Place File Processing
|
96
|
+
--------------------------------------------------
|
97
|
+
**crf.rb somefile** => **somefile.random** - somefile over-written in place, **somefile.the.seed**, **somefile.new.seed**. **crf.rb somefile.random** => **somefile** - somefile.random over-written in place, **somefile.random.the.seed**, **somefile.random.new.seed**. The seed used by **crf.rb** is a file designated by the environmental variable CR\_SEED if defined, otherwise **crf.rb** any one file located in **~/.cheap\_random**. If the designated file is a **.seed** file it will be used directly, otherwise a seed will be generated internally from the designated file. **~/.cheap\_random/pet_cat.png** can serve as a seed file for **crf.rb**.
|
98
|
+
|
99
|
+
crx and crxs Cheap Random File, In Place File Processing
|
100
|
+
--------------------------------------------------------
|
101
|
+
**gcc -Wall rpb.c -o rpb**, **rpb** makes in place file processing possible for the bash scripts **crx** and **crxs**. **crx somefile** => **somefile.random** - somefile over-written in place. **crx somefile.random** => **somefile** - somefile.random over-written in place. **crxs** behaves like **crx** with the addition of the creation of the seed files **the.seed** and **new.seed**.
|
data/cheap_random.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'cheap_random'
|
3
|
-
s.version = '0.9.
|
4
|
-
s.date = '2012-06-
|
3
|
+
s.version = '0.9.3'
|
4
|
+
s.date = '2012-06-26'
|
5
5
|
s.summary = 'pseudo random number generation from arbitrary data'
|
6
6
|
s.description = <<-EOT
|
7
7
|
**CheapRandom** is a set of tools for pseudo random number generation from arbitrary data. The properties of the **CheapRandom seed** make convenient random number generation possible -- useful for easily repeatable software testing. The **CheapRandom algorithm** is information conserving and generally appears to produce lower chi-squared statistics than **Kernel::rand** i.e. it appears to be more random. The **CheapRandom algorithm**, an original work by Bardi Einarsson, has been in use for 6 years.
|
@@ -21,6 +21,15 @@ examples/cb.rb
|
|
21
21
|
examples/chi_squared.rb
|
22
22
|
examples/cr.rb
|
23
23
|
examples/make_seed.rb
|
24
|
+
examples2/chex_pipe.rb
|
25
|
+
examples2/cr.c
|
26
|
+
examples2/crf.rb
|
27
|
+
examples2/crx
|
28
|
+
examples2/crxs
|
29
|
+
examples2/make_seed
|
30
|
+
examples2/pet_cat.png
|
31
|
+
examples2/rpb.c
|
32
|
+
examples2/the.seed
|
24
33
|
lib/cheap_big_file.rb
|
25
34
|
lib/cheap_bits.rb
|
26
35
|
lib/cheap_byte_count.rb
|
data/lib/cheap_random/version.rb
CHANGED
metadata
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheap_random
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.9.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Bardi Einarsson
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
|
17
|
-
none: false
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
17
|
requirements:
|
19
18
|
- - ~>
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: '2.2'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
21
|
none: false
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '2.2'
|
27
|
+
none: false
|
28
|
+
prerelease: false
|
29
|
+
type: :development
|
30
30
|
description: ! ' **CheapRandom** is a set of tools for pseudo random number generation
|
31
31
|
from arbitrary data. The properties of the **CheapRandom seed** make convenient
|
32
32
|
random number generation possible -- useful for easily repeatable software testing.
|
@@ -35,7 +35,7 @@ description: ! ' **CheapRandom** is a set of tools for pseudo random number g
|
|
35
35
|
more random. The **CheapRandom algorithm**, an original work by Bardi Einarsson,
|
36
36
|
has been in use for 6 years.
|
37
37
|
|
38
|
-
'
|
38
|
+
'
|
39
39
|
email:
|
40
40
|
- bardi_e@hotmail.com
|
41
41
|
executables: []
|
@@ -50,6 +50,15 @@ files:
|
|
50
50
|
- examples/chi_squared.rb
|
51
51
|
- examples/cr.rb
|
52
52
|
- examples/make_seed.rb
|
53
|
+
- examples2/chex_pipe.rb
|
54
|
+
- examples2/cr.c
|
55
|
+
- examples2/crf.rb
|
56
|
+
- examples2/crx
|
57
|
+
- examples2/crxs
|
58
|
+
- examples2/make_seed
|
59
|
+
- examples2/pet_cat.png
|
60
|
+
- examples2/rpb.c
|
61
|
+
- examples2/the.seed
|
53
62
|
- lib/cheap_big_file.rb
|
54
63
|
- lib/cheap_bits.rb
|
55
64
|
- lib/cheap_byte_count.rb
|
@@ -64,26 +73,28 @@ files:
|
|
64
73
|
- spec/using_cheap_bits_cheap_random_spec.rb
|
65
74
|
homepage: https://github.com/bardibardi/cheap_random
|
66
75
|
licenses: []
|
67
|
-
post_install_message:
|
76
|
+
post_install_message:
|
68
77
|
rdoc_options: []
|
69
78
|
require_paths:
|
70
79
|
- lib
|
71
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
81
|
requirements:
|
74
82
|
- - ! '>='
|
75
83
|
- !ruby/object:Gem::Version
|
76
84
|
version: 1.9.2
|
77
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
85
|
none: false
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
87
|
requirements:
|
80
88
|
- - ! '>='
|
81
89
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
90
|
+
version: !binary |-
|
91
|
+
MA==
|
92
|
+
none: false
|
83
93
|
requirements: []
|
84
|
-
rubyforge_project:
|
85
|
-
rubygems_version: 1.8.
|
86
|
-
signing_key:
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 1.8.24
|
96
|
+
signing_key:
|
87
97
|
specification_version: 3
|
88
98
|
summary: pseudo random number generation from arbitrary data
|
89
99
|
test_files: []
|
100
|
+
...
|