-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathintention_repeater_max_2.6.cpp
225 lines (180 loc) · 6.1 KB
/
intention_repeater_max_2.6.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/*
Intention Repeater MAX v2.6 created by Thomas Sweet.
Performance benchmark and enhancement by Karteek Sheri.
Created 11/5/2020 for C++.
Directions to compile on Windows: https://dev.intentionrepeater.com/cpp/Win_MAX_Compile_Directions.txt
To compile on Linux: g++ ./intention_repeater_max.cpp -O3 -o ./intention_repeater_max
Repeats your intention up to 100+ million times per second to make things happen.
When compiled, this is more powerful than the Python version.
Intention Repeater MAX is powered by a Servitor (20 Years / 2000+ hours in the making) [HR 6819 Black Hole System].
Servitor Info: https://enlightenedstates.com/2017/04/07/servitor-just-powerful-spiritual-tool/
Website: https://www.intentionrepeater.com/
Forum: https://forums.intentionrepeater.com/
Licensed under GNU General Public License v3.0
This means you can modify, redistribute and even sell your own modified software, as long as it's open source too and released under this same license.
https://choosealicense.com/licenses/gpl-3.0/
*/
#include <stdio.h>
#include <string>
#include <string.h>
#include <math.h>
#include <iostream>
#include <time.h>
#include <ctime>
#include <ratio>
#include <chrono>
#include <iomanip>
#include <locale.h>
#include <atomic>
using namespace std;
using namespace std::chrono;
//std::string FormatTimeRun(int seconds_elapsed);
#define ONE_MINUTE 60
#define ONE_HOUR 3600
#define PROCESS_STATEMENT " REGULATE/INTEGRATE/OM"
class comma_numpunct: public std::numpunct < char > {
protected: virtual char do_thousands_sep() const {
return ',';
}
virtual std::string do_grouping() const {
return "\03";
}
};
static const char* short_scale[] = {
"",
"k",
"M",
"B",
"T",
"q",
"Q",
"s",
"S"
};
static const char* short_scale_hz[] = {
"",
"k",
"M",
"G",
"T",
"P",
"E",
"Z",
"Y"
};
const char* scale(double n, int decimals = 1, const char* units[] = short_scale)
{
/*
* Number of digits in n is given by
* 10^x = n ==> x = log(n)/log(10) = log_10(n).
*
* So 1000 would be 1 + floor(log_10(10^3)) = 4 digits.
*/
int digits = n==0? 0 : 1+floor(log10l(fabs(n)));
// determine base 10 exponential
int exp = digits <= 4? 0 : 3*((digits-1)/3);
// normalized number
double m = n / powl(10, exp);
// no decimals? then don't print any
if ( m - static_cast<long>(n) == 0 )
decimals = 0;
// don't print unit for exp<3
static char s[32];
static const char* fmt[] = {"%1.*lf%s", "%1.*lf"};
sprintf(s, fmt[exp<3], decimals, m, units[exp/3]);
return s;
}
const char* suffix(double n, int decimals = 1)
{
static char s[32];
strcpy(s, scale(n, decimals, short_scale));
return s;
}
const char* suffix_hz(double n, int decimals = 1)
{
static char s[32];
strcpy(s, scale(n, decimals, short_scale_hz));
return s;
}
std::string FormatTimeRun(int seconds_elapsed) {
int hour, min, sec;
std::string hour_formatted, min_formatted, sec_formatted;
hour = seconds_elapsed / ONE_HOUR;
seconds_elapsed -= hour * ONE_HOUR;
min = seconds_elapsed / ONE_MINUTE;
seconds_elapsed -= min * ONE_MINUTE;
sec = seconds_elapsed;
if (hour < 10) {
hour_formatted = "0" + std::to_string(hour);
} else {
hour_formatted = std::to_string(hour);
}
if (min < 10) {
min_formatted = "0" + std::to_string(min);
} else {
min_formatted = std::to_string(min);
}
if (sec < 10) {
sec_formatted = "0" + std::to_string(sec);
} else {
sec_formatted = std::to_string(sec);
}
return hour_formatted + ":" + min_formatted + ":" + sec_formatted;
}
int main(int argc, char ** argv) {
std::string intention, intention_value, process_intention, duration, param_duration, param_intention, runtime_formatted;
unsigned long long int iterations = 0, cpu_benchmark_count = 0;
int seconds = 0;
if (argc == 3) {
param_duration = argv[1];
param_intention = argv[2];
} else {
param_duration = "Until Stopped";
param_intention = "";
}
std::locale comma_locale(std::locale(), new comma_numpunct());
std::cout.imbue(comma_locale);
cout << "Intention Repeater MAX v2.6 created by Thomas Sweet." << endl;
cout << "Performance benchmark and enhancement by Karteek Sheri." << endl;
cout << "This software comes with no guarantees or warranty of any kind and is for entertainment purposes only." << endl;
cout << "Press Ctrl-C to quit." << endl << endl;
if ((param_intention) == "") {
cout << "Intention: ";
std::getline(std::cin, intention);
} else {
intention = param_intention;
}
intention_value = intention + PROCESS_STATEMENT;
duration = param_duration;
//This code is to benchmark cpu iterations. By Karteek Sheri.
auto b_start = std::chrono::system_clock::now();
auto b_end = std::chrono::system_clock::now();
while ((std::chrono::duration_cast < std::chrono::seconds > (b_end - b_start).count() != 1))
{
process_intention = intention_value;
++cpu_benchmark_count;
b_end = std::chrono::system_clock::now();
}
//Benchmark ends here
auto start = std::chrono::system_clock::now();
auto end = std::chrono::system_clock::now();
do {
start = std::chrono::system_clock::now();
while ((std::chrono::duration_cast < std::chrono::seconds > (end - start).count() != 1)) {
for(int i=0;i<cpu_benchmark_count;++i){
process_intention = intention_value; //This is the Intention Repeater call that actually does the work with the Servitor.
++iterations;
}
end = std::chrono::system_clock::now();
}
++seconds;
runtime_formatted = FormatTimeRun(seconds);
std::cout << "[" + runtime_formatted + "]" << " (" << suffix(iterations) << "/" << suffix_hz(int(iterations/seconds)) << "Hz): " << intention << " \r" << std::flush;
if (runtime_formatted == duration) {
std::cout << endl << std::flush;
exit(0);
}
} while (1);
std::cout << endl << std::flush;
return 0;
}