xot 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b300601324c88ccfa6fc6e1c7c2aee5780dab91a
4
- data.tar.gz: 3a1084e6aa373e275acdeda17ddc825151266ed4
3
+ metadata.gz: c91ff7087089082faf7e63799ae57afba9f61125
4
+ data.tar.gz: b063917ac96375cc7e84ae49b2b66414f5e2fd02
5
5
  SHA512:
6
- metadata.gz: ff596b6f8d92698e58f2aab19c98234251a2bf4ad9489b9f11a04a637d23ac88aee5a7e61c3f2ea90d9c6cefbc9bcf32cdd9d8d512a5da31b156c5c3e45ff7bd
7
- data.tar.gz: ea6adff9f5dba95b7403da54c0e6c7f075c82d1e0c2d8dbad987a7c426dac7eaaf9a5626118e9c6490113c855fedd71825521203aaf224c5d173fa95ddc862bb
6
+ metadata.gz: 1c607f74531a45cacc4e9ec184edfbc9727d397d65b63d4daba613599dec3e96ea713bd6fbb0f0e05be6a7de4bb364893d47718d14caa767cbc62e32e9944f24
7
+ data.tar.gz: fd6a798557ebcc20a22cd8d3351b25c5335ec72d0b393ec73aea46a02dc97cacab268dd1f0d1cd46e771ca3bf67c812c196343757ff386fb98b77c905c2fb76a
data/README.md CHANGED
@@ -0,0 +1,4 @@
1
+
2
+ # Xot - Some useful utility classes and functions.
3
+
4
+ ## by snori@xord.org
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -55,6 +55,9 @@ namespace Xot
55
55
  enum {UNKNOWN = 0};
56
56
 
57
57
 
58
+ using namespace Types;
59
+
60
+
58
61
  }// Xot
59
62
 
60
63
 
@@ -61,6 +61,11 @@ namespace Xot
61
61
  if (del) delete this;
62
62
  }
63
63
 
64
+ virtual bool rucy_wrapped () const
65
+ {
66
+ return false;
67
+ }
68
+
64
69
  protected:
65
70
 
66
71
  RefCountable ()
@@ -5,6 +5,9 @@
5
5
 
6
6
 
7
7
  #include <stdint.h>
8
+ #include <math.h>
9
+ #include <xot/defs.h>
10
+ #include <xot/time.h>
8
11
 
9
12
 
10
13
  namespace Xot
@@ -16,6 +19,26 @@ namespace Xot
16
19
  int byte2bit (int bytes);
17
20
 
18
21
 
22
+ void seed (uint value = (uint) (time() * 1000));
23
+
24
+ double random (double max_ = 1);
25
+
26
+ double random (double min_, double max_);
27
+
28
+
29
+ template <typename T>
30
+ inline T deg2rad (T degree)
31
+ {
32
+ return degree / (T) 180 * M_PI;
33
+ }
34
+
35
+ template <typename T>
36
+ inline T rad2deg (T radian)
37
+ {
38
+ return radian / M_PI * (T) 180;
39
+ }
40
+
41
+
19
42
  template <typename T>
20
43
  inline T clip (T minval, T maxval, T value)
21
44
  {
@@ -1,6 +1,9 @@
1
1
  #include "xot/util.h"
2
2
 
3
3
 
4
+ #include <stdlib.h>
5
+
6
+
4
7
  namespace Xot
5
8
  {
6
9
 
@@ -19,4 +22,31 @@ namespace Xot
19
22
  }
20
23
 
21
24
 
25
+ static bool seeded = false;
26
+
27
+ void
28
+ seed (uint value)
29
+ {
30
+ srand(value);
31
+ seeded = true;
32
+ }
33
+
34
+ double
35
+ random (double max_)
36
+ {
37
+ return random(0, max_);
38
+ }
39
+
40
+ double
41
+ random (double min_, double max_)
42
+ {
43
+ if (!seeded) seed();
44
+
45
+ double n = (double) rand() / (double) RAND_MAX;
46
+ if (max_ != 1) n *= max_;
47
+ if (min_ != 0) n += min_;
48
+ return n;
49
+ }
50
+
51
+
22
52
  }// Xot
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.authors = %w[snori]
25
25
  s.email = 'snori@xord.org'
26
- s.homepage = "http://github.com/xord/#{name}/wiki"
26
+ s.homepage = "https://github.com/xord/spacy/wiki/#{name.capitalize}-Home"
27
27
 
28
28
  s.platform = Gem::Platform::RUBY
29
29
  s.required_ruby_version = '>=1.9.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - snori
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-07 00:00:00.000000000 Z
11
+ date: 2014-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -89,7 +89,7 @@ files:
89
89
  - test/test_setter.rb
90
90
  - test/test_tester.rb
91
91
  - xot.gemspec
92
- homepage: http://github.com/xord/xot/wiki
92
+ homepage: https://github.com/xord/spacy/wiki/Xot-Home
93
93
  licenses: []
94
94
  metadata: {}
95
95
  post_install_message: