blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
20e21028468535fbc7ebc91f1eea1641c393e279
a92118f5339073b639f0625f5928402dfc9ef288
/KlondikeSolve20201201/main.cpp
ea7fa759aa3d0c4f72444d1692d45c677b5556cf
[ "MIT" ]
permissive
5s-hoshi/Klondike_Solitaire
b3d8f240883ee671f4401c592f80775dd1354939
b4a0840fa5ed7a194576cab17aa970f141e931be
refs/heads/main
2023-08-13T23:19:42.575052
2021-09-25T08:16:03
2021-09-25T08:16:03
410,202,973
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
13,126
cpp
#include <iostream> #include <fstream> #include <chrono> #include <ctime> #include <regex> #include <direct.h> #include "Solitaire.h" #include "strategy.h" #include "class_random_sampler.h" using namespace std; void HandleMoveToBuildStack(Solitaire& game, string s, bool is_manual); void HandleMoveToAnswer(Solitaire& game, string s, bool is_manual); void ClearScreen(); void GetTime(string* s); #define INF 0xffffffffffffffff // for game #define PRINT_SOLITAIRE true #define PRINT_NUM 1 #define MANUAL false #define MANUAL_NUM INF #define DEAL_MAX 16 #define STRATEGY_NUM 7 // #define WEIGHT 1U // #define DEAL_RESISTANCE 1U // #define RESISTANCE 1U #define EPSILON 5U // percent int WEIGHT, RESISTANCE, DEAL_RESISTANCE; #define GRID_SEARCH_VARIABLE &WEIGHT #define GRID_VARIABLE_NAME "weight" #define GRID2_SEARCH_VARIABLE &RESISTANCE #define GRID2_VARIABLE_NAME "resistance" #define GRID3_SEARCH_VARIABLE &DEAL_RESISTANCE #define GRID3_VARIABLE_NAME "deal_resistance" // for debug #define SHOW_ALL_CARDS false #define SHOW_STRATEGY true #define WRITE_DETAIL false // for data generation #define WRITE_SEEDS false #define GRID_SEARCH_FIRST 15 #define GRID_SEARCH_END 15 + 1 // end - 1まで #define GRID2_SEARCH_FIRST 17 #define GRID2_SEARCH_END 17 + 1 // end - 1まで #define GRID3_SEARCH_FIRST 1 #define GRID3_SEARCH_END 1 + 1 // end - 1まで // #define WRITE_TO ".txt" #define PLAY_TIMES 1000 #define KIND_OF_SEEDS 10000 int func1(int e, int t); int main(int argc, char** argv) { chrono::system_clock::time_point start, end; start = chrono::system_clock::now(); RandomSampler prg_base; cin.get(); cin.get(); _mkdir("data"); string dir_name = "./data/"; string f_name, seeds_f_name; bool is_manual; unsigned long long won_cnt = 0LL; unsigned long app_seeds[5]; if (WRITE_SEEDS) { GetTime(&dir_name); cout << dir_name << endl; _mkdir(dir_name.c_str()); f_name = dir_name + "/header.txt"; seeds_f_name = dir_name + "/seeds.txt"; ofstream outputfile(f_name); unsigned long seed[5]; prg_base.m90getseeds(seed, seed + 1, seed + 2, seed + 3, seed + 4); outputfile << "play times = " + to_string(PLAY_TIMES) + " \t a number of seeds = " + to_string(KIND_OF_SEEDS) << endl; outputfile << "w" << GRID_SEARCH_FIRST << "to" << GRID_SEARCH_END - 1 << ", "; outputfile << "r" << GRID2_SEARCH_FIRST << "to" << GRID2_SEARCH_END - 1 << ", "; outputfile << "dr" << GRID3_SEARCH_FIRST << "to" << GRID3_SEARCH_END - 1 << endl; outputfile << "strategy = " << STRATEGY_NUM << ", "; /* if (STRATEGY_NUM == 5) { if (GRID_VARIABLE_NAME != "weight") outputfile << "w=" << WEIGHT << ", \t "; if (GRID_VARIABLE_NAME != "resistance") outputfile << "r=" << RESISTANCE << ", \t "; if(GRID_VARIABLE_NAME != "deal_resistance") outputfile << "d_r=" << DEAL_RESISTANCE; } */ outputfile << endl; outputfile << "prg_base's seed: "; for (int i = 0; i < 5; i++) { outputfile << seed[i] << " "; } outputfile << endl << endl; outputfile.close(); } for (*GRID_SEARCH_VARIABLE = GRID_SEARCH_FIRST; *GRID_SEARCH_VARIABLE < GRID_SEARCH_END; (*GRID_SEARCH_VARIABLE)++) { for (*GRID2_SEARCH_VARIABLE = GRID2_SEARCH_FIRST; *GRID2_SEARCH_VARIABLE < GRID2_SEARCH_END; (*GRID2_SEARCH_VARIABLE)++) { for (*GRID3_SEARCH_VARIABLE = GRID3_SEARCH_FIRST; *GRID3_SEARCH_VARIABLE < GRID3_SEARCH_END; (*GRID3_SEARCH_VARIABLE)++) { won_cnt = 0; //////////////////////////// // csv file_name //////////////////////////// if (WRITE_SEEDS) { int tmp1 = (GRID_SEARCH_END - 1) / 10, tmp2 = *GRID_SEARCH_VARIABLE / 10; int tmp3 = (GRID2_SEARCH_END - 1) / 10, tmp4 = *GRID2_SEARCH_VARIABLE / 10; int tmp5 = (GRID3_SEARCH_END - 1) / 10, tmp6 = *GRID3_SEARCH_VARIABLE / 10; int zeros = 0; while (tmp1 > 0) { tmp1 /= 10; zeros++; } while (tmp2) { tmp2 /= 10; zeros--; } f_name = dir_name + "/w="; for (int i = 0; i < zeros; i++) { f_name += "0"; } f_name += to_string(*GRID_SEARCH_VARIABLE); zeros = 0; while (tmp3 > 0) { tmp3 /= 10; zeros++; } while (tmp4) { tmp4 /= 10; zeros--; } f_name += "r="; for (int i = 0; i < zeros; i++) { f_name += "0"; } f_name += to_string(*GRID2_SEARCH_VARIABLE); zeros = 0; while (tmp5 > 0) { tmp5 /= 10; zeros++; } while (tmp6) { tmp6 /= 10; zeros--; } f_name += "dr="; for (int i = 0; i < zeros; i++) { f_name += "0"; } f_name += to_string(*GRID3_SEARCH_VARIABLE); f_name += ".csv"; } for (int j = 0; j < 5; j++) { app_seeds[j] = prg_base.m90random31(); } DRWS prg_app(app_seeds[0], app_seeds[1], app_seeds[2], app_seeds[3], app_seeds[4]); if (WRITE_SEEDS) { ofstream outputfile(seeds_f_name, ios::app); outputfile <<"w=" << *GRID_SEARCH_VARIABLE << "r=" << *GRID2_SEARCH_VARIABLE << "dr=" << *GRID3_SEARCH_VARIABLE; for (int j = 0; j < 5; j++) outputfile << app_seeds[j] << ","; outputfile.close(); } for (int i = 0; i < KIND_OF_SEEDS; i++) { prg_app.set_first_location(); if (KIND_OF_SEEDS > 20 && i * 100 % KIND_OF_SEEDS == 0) { ClearScreen(); switch (STRATEGY_NUM) { case 5: cout << "weight = " << WEIGHT << ", resistance = " << RESISTANCE << ", deal_resistance = " << DEAL_RESISTANCE << endl; break; case 6: cout << "weight = " << WEIGHT << ", resistance = " << RESISTANCE << ", deal_resistance = " << DEAL_RESISTANCE << endl; break; case 7: cout << "weight = " << WEIGHT << ", resistance = " << RESISTANCE << ", deal_resistance = " << DEAL_RESISTANCE << endl; break; default: cout << "error\n"; break; } cout << f_name << endl << endl; int percent = i * 100 / KIND_OF_SEEDS; cout << "0% 50% 100%\n"; cout << "|---------+---------|\n"; for (int j = 0; j < i / (KIND_OF_SEEDS / 20) + 1; j++) { cout << "#"; } cout << endl; cout << percent << "%" << endl; } Solitaire game = Solitaire(&prg_app); if (PRINT_SOLITAIRE) { game.PrintAllDetails(); cin.get(); } bool running = true; unsigned int d_cnter = 0; unsigned long long cnt = 0LL; if (WRITE_SEEDS) { ofstream outputfile(f_name, ios::app); outputfile << i << "th,"; outputfile.close(); } do { cnt++; is_manual = cnt >= MANUAL_NUM && MANUAL; if (0) { ClearScreen(); cout << "time " << cnt << endl; if (PRINT_SOLITAIRE) game.PrintAllDetails(SHOW_ALL_CARDS); } if (PRINT_SOLITAIRE && cnt % PRINT_NUM == 0) { cout << endl << endl; cout << "1. move to buildstacks\n"; cout << "2. move to suitstacks\n"; cout << "3. deal to talon\n"; cout << "0. quit\n"; cout << "Enter option:\n"; } string option_s; if (cnt >= MANUAL_NUM && MANUAL) cin >> option_s; else { switch (STRATEGY_NUM) { case 5: option_s = strategy_5(&game, &prg_app, WEIGHT, RESISTANCE, DEAL_RESISTANCE, &d_cnter, SHOW_STRATEGY); break; case 6: option_s = strategy_6(&game, &prg_app, WEIGHT, RESISTANCE, DEAL_RESISTANCE, &d_cnter, SHOW_STRATEGY); break; case 7: option_s = strategy_7(&game, &prg_app, WEIGHT, RESISTANCE, DEAL_RESISTANCE, &d_cnter, SHOW_STRATEGY); break; default: cout << "\ninvalid strategy"; cin.get(); break; } } char option = ' '; // cin >> option; option = option_s[0]; /* if (option_s[0] != '3') deal_counter = 0; */ // (int)'0' = 48 switch ((int)option) { case 48: running = false; //cin.get(); break; case 49: HandleMoveToBuildStack(game, option_s, is_manual); //cin.get(); break; case 50: HandleMoveToAnswer(game, option_s, is_manual); //cin.get(); break; case 51: game.Deal(3); //deal_counter++; break; default: cout << "\ninvalid option"; cin.ignore(80, '\n'); break; } if (PRINT_SOLITAIRE && cnt % PRINT_NUM == 0) { ClearScreen(); cout << "time " << cnt << endl; game.PrintAllDetails(SHOW_ALL_CARDS); cin.get(); } if (game.GameCompleted()) { if (PRINT_SOLITAIRE) { ClearScreen(); cout << "\n\n\n\t\t\t CONGRATULATIONS YOU WIN!!!\n\n\n\n\n"; cout << "time: " << cnt << "\n"; cin.get(); } won_cnt++; if (WRITE_SEEDS) { ofstream outputfile(f_name, ios::app); outputfile << cnt << ",win"; outputfile.close(); } running = false; } else if (cnt >= PLAY_TIMES) { if (PRINT_SOLITAIRE) { ClearScreen(); cout << "\n\n\n\t\t\t GAME OVER \n\n\n\n\n"; cout << "time over\n"; cin.get(); } if (WRITE_SEEDS) { ofstream outputfile(f_name, ios::app); outputfile << "," << "time_over"; outputfile.close(); } running = false; } else if (d_cnter >= DEAL_MAX) { if (PRINT_SOLITAIRE) { ClearScreen(); cout << "\n\n\n\t\t\t GAME OVER \n\n\n\n\n"; cout << "16-deal loops\n"; cin.get(); } if (WRITE_SEEDS) { ofstream outputfile(f_name, ios::app); outputfile << "," << "16-deel_loop"; outputfile.close(); } running = false; } if (running == false) { if (WRITE_SEEDS) { ofstream outputfile(f_name, ios::app); outputfile << "," << prg_app.get_locmax() << endl; outputfile.close(); } } } while (running); } if (WRITE_SEEDS) { ofstream outputfile(seeds_f_name, ios::app); outputfile << prg_app.get_locmax() << endl; outputfile.close(); } /* ofstream outputfile(file_name, ios::app); outputfile << "\n\nresult: \t " << won_cnt << " times won.\n"; outputfile << (double)won_cnt * 100 / KIND_OF_SEEDS << "%\n"; outputfile.close(); //*/ } } } ClearScreen(); cout << f_name << endl << endl; cout << "0% 50% 100%\n"; cout << "|---------+---------|\n"; for (int i = 0; i < 21; i++) cout << "#"; cout << endl; cout << 100 << "%" << endl; cout << "done!\n"; end = chrono::system_clock::now(); double elapsed = chrono::duration_cast<chrono::milliseconds>(end - start).count(); if (WRITE_SEEDS) { f_name = dir_name + "/header.txt"; ofstream outputfile(f_name, ios::app); outputfile << "elapsed time: " << elapsed << endl; outputfile.close(); } return 0; } void HandleMoveToBuildStack(Solitaire& game, string s, bool is_manual) { char from = '0', to = '0', suit = '0'; if (is_manual) { cout << endl << endl; cout << "From (7 for talon, 8 for suitstacks): "; cin >> from; } else { from = s[1]; } if (from == '8') { if (is_manual) { cout << "Suit (h, d, s, c): "; cin >> suit; cout << "To: "; } else { suit = s[2]; to = s[3]; } if (((int)from >= 48 && (int)from <= 56) && ((int)to >= 48 && (int)to <= 54)) { if (suit == 'h' || suit == 'd' || suit == 's' || suit == 'c') game.MakeMoveToRow((int)from - 48, (int)to - 48, suit); } else { cout << "invalid input"; cin.get(); } return; } if (is_manual) { cout << "To: "; cin >> to; } else to = s[2]; // (int)'0' = 48, '7' = 55;talon, '8' = 56;suit if (((int)from >= 48 && (int)from <= 56) && ((int)to >= 48 && (int)to <= 54)) game.MakeMoveToRow((int)from - 48, (int)to - 48, suit); else { cout << "invalid input"; cin.get(); } } void HandleMoveToAnswer(Solitaire& game, string s, bool is_manual) { char from = 0; if (is_manual) { cout << endl << endl; cout << "From (7 for deck): "; cin >> from; } else from = s[1]; if ((int)from >= 48 && (int)from <= 55) game.MakeToSuitMove((int)from - 48); else { cout << "invalid input"; cin.get(); } } void ClearScreen() { system("cls"); } int num_check(char x) { for (int i = 0; i < 10; i++) { if (x == '0' + i) { return i; } } return -1; } void GetTime(string* s) { char ch[26]; auto start = chrono::system_clock::now(); time_t time = chrono::system_clock::to_time_t(start); ctime_s(ch, sizeof ch, &time); *s += string(ch); // *s += WRITE_TO; *s = regex_replace(*s, regex(":"), "'"); *s = regex_replace(*s, regex(" "), "_"); *s = regex_replace(*s, regex("\n"), ""); } int func1(int t, int e) { if (t > PLAY_TIMES / 2) return 0; else return e; }
[ "nakamotoseigo@gmail.com" ]
nakamotoseigo@gmail.com
77b6660fc36d8eb984043021d09bc2fc114a95f4
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/squid/gumtree/squid_old_log_1093.cpp
bb9d1d5e1ed20aaef93fd257008f22c2e227e3d2
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
44
cpp
mb->Printf("\t%s\n", describeTimestamps(e));
[ "993273596@qq.com" ]
993273596@qq.com
e44abd021a2789a521946799556182afd4dfe3a1
04b1803adb6653ecb7cb827c4f4aa616afacf629
/chrome/browser/google/google_search_domain_mixing_metrics_emitter_factory.h
d4a404fa1da1af44befa80ce31bae0065951f246
[ "BSD-3-Clause" ]
permissive
Samsung/Castanets
240d9338e097b75b3f669604315b06f7cf129d64
4896f732fc747dfdcfcbac3d442f2d2d42df264a
refs/heads/castanets_76_dev
2023-08-31T09:01:04.744346
2021-07-30T04:56:25
2021-08-11T05:45:21
125,484,161
58
49
BSD-3-Clause
2022-10-16T19:31:26
2018-03-16T08:07:37
null
UTF-8
C++
false
false
2,197
h
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_SEARCH_DOMAIN_MIXING_METRICS_EMITTER_FACTORY_H_ #define CHROME_BROWSER_GOOGLE_GOOGLE_SEARCH_DOMAIN_MIXING_METRICS_EMITTER_FACTORY_H_ #include "base/feature_list.h" #include "base/memory/singleton.h" #include "chrome/browser/google/google_search_domain_mixing_metrics_emitter.h" #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/keyed_service/core/keyed_service.h" #include "components/pref_registry/pref_registry_syncable.h" // Singleton that owns all GoogleSearchDomainMixingMetricsEmitters and // associates them with Profiles. class GoogleSearchDomainMixingMetricsEmitterFactory : public BrowserContextKeyedServiceFactory { public: // Flag to enable computing domain mixing metrics based on the Google search // activity of the user. // For more details, see http://goto.google.com/chrome-no-searchdomaincheck. static const base::Feature kFeature; // Returns the singleton instance of the factory. static GoogleSearchDomainMixingMetricsEmitterFactory* GetInstance(); // Returns the GoogleSearchDomainMixingMetricsEmitter for |profile|, creating // one if needed. May return nullptr if there is no emitter should be created // for the profile, e.g. in incognito mode. static GoogleSearchDomainMixingMetricsEmitter* GetForProfile( Profile* profile); private: friend struct base::DefaultSingletonTraits< GoogleSearchDomainMixingMetricsEmitterFactory>; friend class GoogleSearchDomainMixingMetricsEmitterFactoryTest; GoogleSearchDomainMixingMetricsEmitterFactory(); // BrowserContextKeyedServiceFactory: void RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) override; KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; bool ServiceIsCreatedWithBrowserContext() const override; }; #endif // CHROME_BROWSER_GOOGLE_GOOGLE_SEARCH_DOMAIN_MIXING_METRICS_EMITTER_FACTORY_H_
[ "sunny.nam@samsung.com" ]
sunny.nam@samsung.com
1c925c13bef4b097dc8c3fe20cd3f0e6d5bf54bf
83f8b9f93c2da61440fd92dea7363328cfc1790c
/communication/commands/cmd_context_open.cpp
e5fdece8c026c5304a0b6e6276e8b091b045a0c3
[]
no_license
Renat060888/player
b1a78d5207067baaae8369a60d38da73192829cf
83865faeeceba561c62a9ea35b56d3c8046dc35f
refs/heads/master
2021-04-14T15:51:55.395336
2020-06-07T06:31:44
2020-06-07T06:31:44
249,243,650
0
0
null
null
null
null
UTF-8
C++
false
false
2,559
cpp
#include <jsoncpp/json/writer.h> #include "system/system_environment_facade_player.h" #include "system/objrepr_bus_player.h" #include "analyze/analytic_manager_facade.h" #include "cmd_context_open.h" using namespace std; using namespace common_types; static bool userHasPermission( const TUserId & _userId, common_types::SIncomingCommandServices * _services, std::string & _errMsg ){ DispatcherUser * userDispatcher = _services->analyticManager->getUserDispatcher(); if( ! userDispatcher->isRegistered(_userId) ){ Json::Value rootRecord; rootRecord[ "cmd_name" ] = "pong"; rootRecord[ "error_occured" ] = true; rootRecord[ "code" ] = "NOT_REGISTERED"; Json::FastWriter jsonWriter; _errMsg = jsonWriter.write( rootRecord ); return false; } else{ return true; } } CommandContextOpen::CommandContextOpen( SIncomingCommandServices * _services ) : ICommandExternal(_services) { } bool CommandContextOpen::exec(){ string errMsg; if( userHasPermission(m_userId, (SIncomingCommandServices *)m_services, errMsg) ){ const TContextId ctxId = OBJREPR_BUS.getContextIdByName( m_contextName ); TPlayerId playerId; DispatcherPlayer * playerDipatcher = ((SIncomingCommandServices *)m_services)->analyticManager->getPlayerDispatcher(); if( playerDipatcher->requestPlayer(m_userId, ctxId, playerId) ){ Json::Value rootRecord; rootRecord[ "cmd_name" ] = "ctx_open"; rootRecord[ "error_occured" ] = false; rootRecord[ "code" ] = "OK"; // SWALClientOperation operation; operation.commandFullText = m_requestFullText; operation.uniqueKey = playerId; // TODO: come up with a more elegant solution operation.begin = true; ((SIncomingCommandServices *)m_services)->systemEnvironment->serviceForWriteAheadLogging()->openOperation( operation ); Json::FastWriter jsonWriter; sendResponse( jsonWriter.write(rootRecord) ); return true; } else{ Json::Value rootRecord; rootRecord[ "cmd_name" ] = "ctx_open"; rootRecord[ "error_occured" ] = true; rootRecord[ "code" ] = playerDipatcher->getState().lastError; Json::FastWriter jsonWriter; sendResponse( jsonWriter.write(rootRecord) ); return false; } } else{ sendResponse( errMsg ); return false; } }
[ "renat@desktop.home" ]
renat@desktop.home
03e2544ec2a906f1e8c11e33a87f753a598d1ee4
18380288f9b74a09e4a8e1e0250705888a77da07
/element_or.h
21a95d29386b514c4626a490aef1d77bbfe27989
[]
no_license
feneklis/Boolean_functions
326351233cea0291eb47867ae30e492142fe3755
94816c4d7d4c5865677fde0c1d676b13fa7e2254
refs/heads/main
2023-05-03T03:55:56.180464
2021-05-31T14:10:55
2021-05-31T14:10:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
338
h
#ifndef ELEMENT_OR_H #define ELEMENT_OR_H #include "abstract_element.h" class element_or : public abstract_element { public: element_or(abstract_element*first_input=nullptr, abstract_element*second_input=nullptr); bool get_value(); void print_element(QPainter* painter,int x,int y); }; #endif // ELEMENT_OR_H
[ "noreply@github.com" ]
noreply@github.com
896f13fe1930b5ea351323ea310285b25d936895
b7d447ce4834ff96580bd02991cde604dc25ec2c
/threadedtree.cpp
c0965f6f25281aa75fe008b6b9b092311e829470
[]
no_license
Ruhika1417/DSA_CPP
df74f7a3ceab16a1db12a991ab9a8bcddc7a0c9f
71d5ebc32094d8fafeb28d7dc63f605ca8c0d8ff
refs/heads/master
2023-02-25T10:35:35.635178
2021-02-06T11:30:01
2021-02-06T11:30:01
287,519,009
0
0
null
null
null
null
UTF-8
C++
false
false
4,467
cpp
//threaded binary tree. #include <bits/stdc++.h> using namespace std; class Node { public: int data; Node *left; Node *right; int leftThread; // leftThread=0 -> left pointer points to the inorder predecessor int rightThread; // rightThread=0 -> right pointer points to the inorder successor Node(int val) { this->data = val; } }; class DoubleThreadedBinaryTree { private: Node *root; public: DoubleThreadedBinaryTree() { // dummy Node with value as INT_MAX root = new Node(INT_MAX); root->left = root->right = root; root->leftThread = 0; root->rightThread = 1; } void insert(int data) { Node *new_node = new Node(data); if (root->left == root && root->right == root) { //Empty Tree new_node->left = root; root->left = new_node; new_node->leftThread = 0; new_node->rightThread = 0; root->leftThread = 1; new_node->right = root; return; } else { Node *current = root->left; while (true) { if (current->data > data) { if (current->leftThread == 0) { // this is the last Node new_node->left = current->left; current->left = new_node; new_node->leftThread = current->leftThread; new_node->rightThread = 0; current->leftThread = 1; new_node->right = current; break; } else { current = current->left; } } else { if (current->rightThread == 0) { // this is the last Node new_node->right = current->right; current->right = new_node; new_node->rightThread = current->rightThread; new_node->leftThread = 0; current->rightThread = 1; new_node->left = current; break; } else { current = current->right; } } } } } Node *findNextInorder(Node *current) { if (current->rightThread == 0) { return current->right; } current = current->right; while (current->leftThread != 0) { current = current->left; } return current; } void inorder() { Node *current = root->left; while (current->leftThread == 1) { current = current->left; } while (current != root) { cout << current->data << " "; current = findNextInorder(current); } cout <<" \n"; } void preorder() { Node *current = root->left; while (current != root) { cout << current->data << " "; if (current->left != root && current->leftThread != 0) current = current->left; else if (current->rightThread == 1) { current = current->right; } else { while (current->right != root && current->rightThread == 0) { current = current->right; } if (current->right == root) break; else { current = current->right; } } } cout << "\n"; } }; int main() { DoubleThreadedBinaryTree dtbt; dtbt.insert(109); dtbt.insert(45); dtbt.insert(76); dtbt.insert(17); dtbt.insert(23); dtbt.insert(100); dtbt.inorder(); dtbt.preorder(); return 0; }
[ "noreply@github.com" ]
noreply@github.com
2aa50d084f523c576db4980eb337e5419fcc7206
eb464c673659836704359c8133d9947246f91c37
/cpp04/ex02/Squad.cpp
7b299353d0445152d2513fe7d6fcdc60a392b657
[]
no_license
dmarget/introduction-to-oop-in-CPP
91d839a5a086e50a350895c44d6da8fa0711947f
4933703e7b841a7acec1cf176610303fa8a39944
refs/heads/master
2023-06-10T08:01:53.735227
2021-07-01T13:56:46
2021-07-01T13:56:46
382,044,578
0
0
null
null
null
null
UTF-8
C++
false
false
1,200
cpp
// // Created by Duncan Marget on 6/7/21. // #include "Squad.hpp" Squad::Squad() { marines = new ISpaceMarine*[1]; marines[0] = nullptr; } int Squad::getCount() const { int i = 0; while (marines[i]) i++; return i; } Squad & Squad::operator=(Squad const &copy) { if (this == &copy) return *this; delete[] marines; if (copy.marines) { marines = new ISpaceMarine *[copy.getCount() + 1]; int i = 0; while (copy.marines[i]) if (copy.marines[i++] != nullptr) marines[i] = copy.marines[i]->clone(); } else marines = nullptr; return *this; } int Squad::push(ISpaceMarine *iSpaceMarine) { int flag = 1; if (iSpaceMarine == nullptr) flag = 0; int i = 0; while (marines[i]) { if (marines[i] == iSpaceMarine) flag = 0; i++; } ISpaceMarine **oldMarine = marines; int oldCount = getCount(); marines = new ISpaceMarine*[i + 2]; for (int j = 0; j < oldCount; j++) marines[j] = oldMarine[j]; if (flag) marines[i] = iSpaceMarine; marines[i + 1] = nullptr; return i; } ISpaceMarine *Squad::getUnit(int i) const { int j = 0; while (marines[j]) { if (j == i) return (marines[j]); j++; } return (nullptr); } Squad::~Squad() { delete[] marines; }
[ "duncan.marget@gmail.com" ]
duncan.marget@gmail.com
bc0378912e17bca8017c8cc7d9adcee2096b3ced
fd0622e97276bba2c04d3c2fcba902cdfb65e214
/packages/nimble/inst/include/cppad/example/atomic_four/mat_mul/base_mat_mul.hpp
eedb2511b373d53cdfb95f92025c60b50db75669
[ "EPL-2.0", "GPL-2.0-only", "BSD-3-Clause", "CC-BY-4.0", "GPL-1.0-or-later", "MPL-2.0", "GPL-2.0-or-later" ]
permissive
nimble-dev/nimble
7942cccd73815611e348d4c674a73b2bc113967d
29f46eb3e7c7091f49b104277502d5c40ce98bf1
refs/heads/devel
2023-09-01T06:54:39.252714
2023-08-21T00:51:40
2023-08-21T00:51:40
20,771,527
147
31
BSD-3-Clause
2023-08-12T13:04:54
2014-06-12T14:58:42
C++
UTF-8
C++
false
false
2,195
hpp
# ifndef CPPAD_EXAMPLE_ATOMIC_FOUR_MAT_MUL_BASE_MAT_MUL_HPP # define CPPAD_EXAMPLE_ATOMIC_FOUR_MAT_MUL_BASE_MAT_MUL_HPP /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-22 Bradley M. Bell CppAD is distributed under the terms of the Eclipse Public License Version 2.0. This Source Code may also be made available under the following Secondary License when the conditions for such availability set forth in the Eclipse Public License, Version 2.0 are satisfied: GNU General Public License, Version 2.0 or later. ---------------------------------------------------------------------------- */ /* $begin atomic_four_mat_mul_base_mat_mul.hpp$$ $spell $$ $section Atomic Multiply Base Matrices: Example Implementation $$ $head Source$$ $srcthisfile%0%// BEGIN C++%// END C++%1%$$ $end */ // BEGIN C++ # include <cppad/example/atomic_four/mat_mul/mat_mul.hpp> namespace CppAD { // BEGIN_CPPAD_NAMESPACE // // base_mat_mul template <class Base> void atomic_mat_mul<Base>::base_mat_mul( size_t n_left , size_t n_middle , size_t n_right , const CppAD::vector<Base>& x , CppAD::vector<Base>& y ) { # ifndef NDEBUG // n, m size_t n = x.size(); size_t m = y.size(); // // check sizes assert( n == n_middle * (n_left + n_right ) ); assert( m == n_left * n_right ); # endif // // offset size_t offset = n_left * n_middle; // // y // y[ i * n_right + j] = sum_k // x[i * n_middle + k] * x[ offset + k * n_right + j] // type_y for(size_t i = 0; i < n_left; ++i) { for(size_t j = 0; j < n_right; ++j) { Base sum_ij = Base(0); for(size_t k = 0; k < n_middle; ++k) { Base left_ik = x[i * n_middle + k]; Base right_kj = x[offset + k * n_right + j]; sum_ij += left_ik * right_kj; } y[i * n_right + j] = sum_ij; } } return; } } // END_CPPAD_NAMESPACE // END C++ # endif
[ "perrydv@users.noreply.github.com" ]
perrydv@users.noreply.github.com
d0908a95b8434023fd71b3d2cc9ee915fcf15bd0
0df48df9ed35e5995af25812137dc0d9d42f96dc
/Arduino_package/history_folders/hardware_v1_SDK3.4/libraries/SPI/examples/ILI9341_TFT_LCD_basic/ILI9341_TFT_LCD_basic.ino
3d88ec14d017f884dfeae8cbbc612653578d74da
[]
no_license
ambiot/amb1_arduino
81539be6ba18a13cc2a33ec37021c5b27684e047
16720c2dcbcffa2acee0c9fe973a959cafc3ba8c
refs/heads/dev
2023-06-08T15:27:52.848876
2023-06-07T02:38:24
2023-06-07T02:38:24
232,280,578
9
7
null
2022-06-01T08:51:01
2020-01-07T08:37:52
C
UTF-8
C++
false
false
3,261
ino
/* * This sketch demonstrates how to use TFT LCD with ILI9314 api * * Pre-requirement: * an ILI9341 TFT LCD with SPI interface * * An ILI9341 TFT LCD with SPI interface can be used with spi to * send command and data. We can draw text, line, circle, and * other picture on it. * **/ #include "SPI.h" #include "AmebaILI9341.h" #define TFT_RESET 8 #define TFT_DC 9 #define TFT_CS 10 AmebaILI9341 tft = AmebaILI9341(TFT_CS, TFT_DC, TFT_RESET); #define ILI9341_SPI_FREQUENCY 20000000 void setup() { Serial.begin(9600); Serial.println("ILI9341 Test!"); SPI.setDefaultFrequency(ILI9341_SPI_FREQUENCY); tft.begin(); Serial.println("test filling screen"); testFillScreen(); delay(500); Serial.println("test Lines"); testLines(ILI9341_CYAN); delay(500); Serial.println("test Circles"); testCircles(5, ILI9341_BLUE); delay(500); Serial.println("test Circles"); testRectangle(ILI9341_LIGHTGREY); delay(500); Serial.println("test Text"); testText(); delay(500); } void loop() { for (int i=0; i<4; i++) { tft.setRotation(i); testText(); delay(500); } } unsigned long testFillScreen() { tft.fillScreen(ILI9341_BLACK); tft.fillScreen(ILI9341_RED); tft.fillScreen(ILI9341_GREEN); tft.fillScreen(ILI9341_BLUE); tft.fillScreen(ILI9341_BLACK); } unsigned long testText() { tft.clr(); tft.setCursor(0, 0); tft.setForeground(ILI9341_GREEN); tft.setFontSize(5); tft.println("Ameba"); tft.setForeground(ILI9341_WHITE); tft.setFontSize(3); tft.println("Hello World!"); tft.setForeground(ILI9341_YELLOW); tft.setFontSize(2); tft.println(1234.56); tft.setForeground(ILI9341_RED); tft.setFontSize(1); tft.println(0xDEADBEEF, HEX); tft.println(); tft.setForeground(ILI9341_LIGHTGREY); tft.setFontSize(2); tft.println("Alice in Wonderland"); tft.setFontSize(1); tft.println("\"Where should I go?\" -Alice. \"That depends on where you want to end up.\" - The Cheshire Cat."); } unsigned long testLines(uint16_t color) { int x0, y0, x1, y1; int w = tft.getWidth(); int h = tft.getHeight(); tft.clr(); x0 = 0; x1 = w; for (y0 = y1 = 0; y0 <= h; y0 += 5, y1 += 5) { tft.drawLine(x0,y0,x1,y1,color); } y0 = 0; y1 = h; for (x0 = x1 = 0; x0 <= w; x0 += 5, x1 += 5) { tft.drawLine(x0,y0,x1,y1,color); } tft.fillScreen(ILI9341_BLACK); x0 = w/2; y0 = h/2; x1 = 0; for (y1=0; y1<h; y1+=5) { tft.drawLine(x0,y0,x1,y1,color); } y1 = h; for (x1=0; x1<w; x1+=5) { tft.drawLine(x0,y0,x1,y1,color); } x1 = w; for (y1=h; y1>=0; y1-=5) { tft.drawLine(x0,y0,x1,y1,color); } y1 = 0; for (x1=w; x1>=0; x1-=5) { tft.drawLine(x0,y0,x1,y1,color); } } void testRectangle(uint16_t color) { int rw, rh; int div = 60; int w = tft.getWidth(); int h = tft.getHeight(); tft.clr(); for (rw = w/div, rh = h/div; rw < w; rw+=w/div, rh+=h/div) { tft.drawRectangle(w/2-rw, h/2-rh, rw*2, rh*2, color); } } void testCircles(uint8_t radius, uint16_t color) { int x, y; int w = tft.getWidth(); int h = tft.getHeight(); tft.clr(); for(x=radius; x<w; x+=radius*2) { for(y=radius; y<h; y+=radius*2) { tft.drawCircle(x, y, radius, color); } } }
[ "zhangzhenwu@realtek-sg.com" ]
zhangzhenwu@realtek-sg.com
a958352bcb9047ec78d1961471b5e9a9803bdff9
d774ba7e4a91df899173f39c5ea03ae521546069
/ColdAPI_Steam/InterfacesEmulation/SteamGameSearch001.h
862925a9031ee9a43009b7586857197f5beb55a8
[]
no_license
kettenbruch/ColdAPI_Steam
0a401d1b624c100de3d7197fda9bdf018de6c833
334956ae0508dae50abc4da9413ba96f354a9225
refs/heads/main
2023-03-31T16:19:08.319323
2021-04-04T20:38:19
2021-04-04T20:38:19
354,637,560
1
0
null
null
null
null
UTF-8
C++
false
false
1,277
h
#pragma once #include "../public SDK/ISteamGameSearch001.h" class SteamGameSearchIn001 : public ISteamGameSearch001 { public: int32_t AddGameSearchParams(const char* pchKeyToFind, const char* pchValuesToFind) { return 7; } int32_t SearchForGameWithLobby(CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax) { return 7; } int32_t SearchForGameSolo(int nPlayerMin, int nPlayerMax) { return 7; } int32_t AcceptGame() { return 7; } int32_t DeclineGame() { return 7; } int32_t RetrieveConnectionDetails(CSteamID steamIDHost, char* pchConnectionDetails, int cubConnectionDetails) { return 7; } int32_t EndGameSearch() { return 7; } int32_t SetGameHostParams(const char* pchKey, const char* pchValue) { return 7; } int32_t SetConnectionDetails(const char* pchConnectionDetails, int cubConnectionDetails) { return 7; } int32_t RequestPlayersForGame(int nPlayerMin, int nPlayerMax, int nMaxTeamSize) { return 7; } int32_t HostConfirmGameStart(uint64 ullUniqueGameID) { return 7; } int32_t CancelRequestPlayersForGame() { return 7; } int32_t SubmitPlayerResult(uint64 ullUniqueGameID, CSteamID steamIDPlayer, int32_t EPlayerResult) { return 7; } int32_t EndGame(uint64 ullUniqueGameID) { return 7; } };
[ "kettenbruch@users.noreply.github.com" ]
kettenbruch@users.noreply.github.com
2f1b5ce2e7d8edef74d6cb023f2756fba061ad27
605091cea8168f7382b791ade0eb14a3c760c097
/Win32/Sources/Application/Calendar/Calendar_View/Calendar_Store_View/CCalendarStoreTable.cp
0d5940690084500cc6eb7a50f89045a415e4e367
[ "Apache-2.0" ]
permissive
jsm222/mulberry4-client
5844dba9e3e425d0c5319afe5231ae4ef6562e4b
cdaae15c51dd759110b4fbdb2063d0e3d5202103
refs/heads/master
2021-07-03T06:01:57.831271
2017-09-23T00:04:57
2017-09-23T00:04:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
32,861
cp
/* Copyright (c) 2007-2009 Cyrus Daboo. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "CCalendarStoreTable.h" #include "CAdminLock.h" #include "CCalendarView.h" #include "CCalendarStoreTitleTable.h" #include "CCalendarStoreView.h" #include "CCalendarUtils.h" #include "CDrawUtils.h" #include "CDragTasks.h" #include "CErrorHandler.h" #include "CFontCache.h" #include "CIconLoader.h" #include "CMulberryApp.h" #include "CPreferences.h" #include "CSDIFrame.h" #include "CTableRowGeometry.h" #include "CTableRowSelector.h" #include "CXStringResources.h" #include "cdfstream.h" #include "CCalendarStoreNode.h" #include "CCalendarStoreManager.h" #include "CICalendar.h" #include "CICalendarSync.h" #include <WIN_LTableArrayStorage.h> IMPLEMENT_DYNCREATE(CCalendarStoreTable, CHierarchyTableDrag) BEGIN_MESSAGE_MAP(CCalendarStoreTable, CHierarchyTableDrag) ON_UPDATE_COMMAND_UI(IDM_FILE_IMPORT, OnUpdateAlways) ON_COMMAND(IDM_FILE_IMPORT, OnImport) ON_UPDATE_COMMAND_UI(IDM_FILE_EXPORT, OnUpdateSelectionCalendarStoreNode) ON_COMMAND(IDM_FILE_EXPORT, OnExport) ON_UPDATE_COMMAND_UI(IDM_EDIT_PROPERTIES, OnUpdateSelection) ON_COMMAND(IDM_EDIT_PROPERTIES, OnEditProperties) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_NEW, OnUpdateAlways) ON_COMMAND(IDM_CALENDAR_NEW, OnNewCalendar) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_RENAME, OnUpdateSelectionCanChangeCalendar) ON_COMMAND(IDM_CALENDAR_RENAME, OnRenameCalendar) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_DELETE, OnUpdateSelectionCanChangeCalendar) ON_COMMAND(IDM_CALENDAR_DELETE, OnDeleteCalendar) ON_COMMAND(IDM_CALENDAR_CHECK, OnCheckCalendar) ON_UPDATE_COMMAND_UI(IDM_MAILBOX_NEWSEARCH, OnUpdateAlways) ON_COMMAND(IDM_MAILBOX_NEWSEARCH, OnNewHierarchy) ON_UPDATE_COMMAND_UI(IDM_MAILBOX_EDITSEARCH, OnUpdateHierarchy) ON_COMMAND(IDM_MAILBOX_EDITSEARCH, OnRenameHierarchy) ON_UPDATE_COMMAND_UI(IDM_MAILBOX_REMOVESEARCH, OnUpdateHierarchy) ON_COMMAND(IDM_MAILBOX_REMOVESEARCH, OnDeleteHierarchy) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_REFRESH, OnUpdateRefreshList) ON_COMMAND(IDM_CALENDAR_REFRESH, OnRefreshList) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_FREEBUSY, OnUpdateSelectionCanChangeCalendar) ON_COMMAND(IDM_CALENDAR_FREEBUSY, OnFreeBusyCalendar) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_SENDEMAIL, OnUpdateSelectionCanChangeCalendar) ON_COMMAND(IDM_CALENDAR_SENDEMAIL, OnSendCalendar) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_NEWWEBCAL, OnUpdateNewWebCalendar) ON_COMMAND(IDM_CALENDAR_NEWWEBCAL, OnNewWebCalendar) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_REFRESHWEBCAL, OnUpdateRefreshWebCalendar) ON_COMMAND(IDM_CALENDAR_REFRESHWEBCAL, OnRefreshWebCalendar) ON_UPDATE_COMMAND_UI(IDM_CALENDAR_UPLOADWEBCAL, OnUpdateUploadWebCalendar) ON_COMMAND(IDM_CALENDAR_UPLOADWEBCAL, OnUploadWebCalendar) ON_WM_CREATE() // Toolbar ON_UPDATE_COMMAND_UI(IDC_TOOLBARSERVERLOGINBTN, OnUpdateLogin) ON_COMMAND(IDC_TOOLBARSERVERLOGINBTN, OnLogin) ON_UPDATE_COMMAND_UI(IDC_TOOLBARDETAILSBTN, OnUpdateSelection) ON_COMMAND(IDC_TOOLBARDETAILSBTN, OnEditProperties) ON_COMMAND(IDC_TOOLBAR_CALENDAR_NEWCALENDAR, OnNewCalendar) END_MESSAGE_MAP() // --------------------------------------------------------------------------- // CCalendarStoreTable [public] /** Default constructor */ CCalendarStoreTable::CCalendarStoreTable() { InitCalendarStoreTable(); } // --------------------------------------------------------------------------- // ~CCalendarStoreTable [public] /** Destructor */ CCalendarStoreTable::~CCalendarStoreTable() { } #pragma mark - void CCalendarStoreTable::InitCalendarStoreTable() { mTableGeometry = new CTableRowGeometry(this, 32, 32); mTableSelector = new CTableRowSelector(this); SetRowSelect(true); // Storage mTableStorage = new LTableArrayStorage(this, sizeof(calstore::CCalendarStoreNode*)); mTableView = NULL; mListChanging = false; } int CCalendarStoreTable::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CHierarchyTableDrag::OnCreate(lpCreateStruct) == -1) return -1; // Set Drag & Drop info // Can drag servers, calendars AddDragFlavor(CMulberryApp::sFlavorCalServer); AddDragFlavor(CMulberryApp::sFlavorCalendar); // Can drop servers, calendars & calendar items AddDropFlavor(CMulberryApp::sFlavorCalServer); AddDropFlavor(CMulberryApp::sFlavorCalendar); AddDropFlavor(CMulberryApp::sFlavorCalendarItem); SetReadOnly(false); SetDropCell(true); SetDropCursor(true); SetAllowDrag(true); SetAllowMove(true); SetHandleMove(false); // The calendar move/copy operations handles deleting original item SetSelfDrag(true); CWnd* parent = GetParent(); while(parent && !dynamic_cast<CCalendarStoreView*>(parent)) parent = parent->GetParent(); mTableView = dynamic_cast<CCalendarStoreView*>(parent); SetSuperCommander(mTableView); return 0; } // Keep titles in sync void CCalendarStoreTable::ScrollImageBy(SInt32 inLeftDelta, SInt32 inTopDelta, bool inRefresh) { // Find titles in owner chain mTableView->GetBaseTitles()->ScrollImageBy(inLeftDelta, 0, inRefresh); CHierarchyTableDrag::ScrollImageBy(inLeftDelta, inTopDelta, inRefresh); } // Handle key down bool CCalendarStoreTable::HandleKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { // Look for preview/full view based on key stroke // Determine whether preview is triggered CKeyModifiers mods(0); const CUserAction& preview = mTableView->GetPreviewAction(); if ((preview.GetKey() == nChar) && (preview.GetKeyModifiers() == mods)) { DoPreview(); return true; } // Determine whether full view is triggered const CUserAction& fullview = mTableView->GetFullViewAction(); if ((fullview.GetKey() == nChar) && (fullview.GetKeyModifiers() == mods)) { DoFullView(); return true; } return CHierarchyTableDrag::HandleKeyDown(nChar, nRepCnt, nFlags); } void CCalendarStoreTable::LClickCell(const STableCell& inCell, UINT nFlags) { // Determine which heading it is SColumnInfo col_info = mTableView->GetColumnInfo()[inCell.col - 1]; switch(col_info.column_type) { case eCalendarStoreColumnSubscribe: case eCalendarStoreColumnColour: { calstore::CCalendarStoreNode* node = GetCellNode(inCell.row); // Check for actual calendars if (node->IsViewableCalendar()) { switch(col_info.column_type) { case eCalendarStoreColumnSubscribe: if (node->IsCached()) { calstore::CCalendarStoreManager::sCalendarStoreManager->SubscribeNode(node, !node->IsSubscribed()); } break; case eCalendarStoreColumnColour: DoChangeColour(inCell.row); break; } RefreshRow(inCell.row); } break; } default: CHierarchyTableDrag::LClickCell(inCell, nFlags); DoSingleClick(inCell.row, CKeyModifiers(0)); break; } } // Double-clicked item void CCalendarStoreTable::LDblClickCell(const STableCell& inCell, UINT nFlags) { DoDoubleClick(inCell.row, CKeyModifiers(0)); } void CCalendarStoreTable::DrawCell(CDC* pDC, const STableCell& inCell, const CRect& inLocalRect) { // Not if changing if (mListChanging) return; StDCState save(pDC); TableIndexT woRow = GetWideOpenIndex(inCell.row + TABLE_ROW_ADJUST); calstore::CCalendarStoreNode* node = GetCellNode(inCell.row); // Erase to ensure drag hightlight is overwritten if (UsesBackgroundColor(node)) { pDC->SetBkColor(GetBackgroundColor(node)); // Erase the entire area. Using ExtTextOut is a neat alternative to FillRect and quicker, too! CRect cellRect = inLocalRect; cellRect.bottom--; pDC->ExtTextOut(cellRect.left, cellRect.top, ETO_OPAQUE, cellRect, _T(""), 0, nil); } SColumnInfo col_info = mTableView->GetColumnInfo()[inCell.col - 1]; switch(col_info.column_type) { case eCalendarStoreColumnName: { // Always cache column number mHierarchyCol = inCell.col; // Get suitable icon UINT iconID = GetPlotIcon(node, GetCellCalendarProtocol(inCell.row)); // Get name of item cdstring theTxt = node->GetDisplayShortName(); // Add protocol state descriptor if (node->IsProtocol()) { if (node->GetProtocol()->IsDisconnected() && !CConnectionManager::sConnectionManager.IsConnected()) { theTxt.AppendResource("UI::Server::TitleDisconnected"); } else if (node->GetProtocol()->IsDisconnected() || !node->GetProtocol()->IsOffline() && !node->GetProtocol()->IsLoggedOn()) { theTxt.AppendResource("UI::Server::TitleOffline"); } } // Draw the string bool strike = false; SetTextStyle(pDC, node, GetCellCalendarProtocol(inCell.row), strike); int text_start = DrawHierarchyRow(pDC, inCell.row, inLocalRect, theTxt, iconID); if (strike) { CPen temp(PS_SOLID, 1, pDC->GetTextColor()); CPen* old_pen = (CPen*) pDC->SelectObject(&temp); pDC->MoveTo(text_start, (inLocalRect.top + inLocalRect.bottom)/2); pDC->LineTo(inLocalRect.right, (inLocalRect.top + inLocalRect.bottom)/2); pDC->SelectObject(old_pen); } break; } case eCalendarStoreColumnSubscribe: // Do status flag if (node->IsViewableCalendar()) { if (node->IsCached()) { if (node->IsSubscribed()) CIconLoader::DrawIcon(pDC, inLocalRect.left, inLocalRect.top + mIconOrigin, IDI_DIAMONDTICKED, 16); else CIconLoader::DrawIcon(pDC, inLocalRect.left, inLocalRect.top + mIconOrigin, IDI_DIAMOND, 16); } else CIconLoader::DrawIcon(pDC, inLocalRect.left, inLocalRect.top + mIconOrigin, IDI_DIAMONDDISABLE, 16); } break; case eCalendarStoreColumnColour: if (node->IsSubscribed()) { uint32_t colour = calstore::CCalendarStoreManager::sCalendarStoreManager->GetCalendarColour(node); if (colour != 0) { // Black outline CRect rect = inLocalRect; rect.DeflateRect(2, 2); pDC->FrameRect(&rect, &CDrawUtils::sBlackBrush); rect.DeflateRect(1, 1); CBrush fill; fill.CreateSolidBrush(CCalendarUtils::GetWinColor(colour)); pDC->FillRect(&rect, &fill); } } break; default: break; } } // Get appropriate icon id int CCalendarStoreTable::GetPlotIcon(const calstore::CCalendarStoreNode* node, calstore::CCalendarProtocol* proto) { if (node->IsProtocol()) { if (!proto) return IDI_SERVERLOCAL; else if (proto->GetAccountType() == CCalendarAccount::eHTTPCalendar) return IDI_CALENDARWEBCAL; else if (proto->CanDisconnect()) return proto->IsDisconnected() ? IDI_SERVERDISCONNECTED : IDI_SERVERREMOTE; else if (proto->GetAccountType() == CINETAccount::eLocalCalendar) return IDI_SERVERLOCAL; else return IDI_SERVERREMOTE; } else if (node->IsDisplayHierarchy()) { return IDI_SERVERSEARCHHIER; } else if (node->IsDirectory()) { return IDI_SERVERDIR; } else { if (node->IsCached()) { if (node->IsInbox()) return IDI_CALENDAR; else if (node->IsOutbox()) return IDI_CALENDAR; else return IDI_CALENDAR; } else { return IDI_CALENDARUNCACHED; } } } // Get appropriate text style void CCalendarStoreTable::SetTextStyle(CDC* pDC, const calstore::CCalendarStoreNode* node, calstore::CCalendarProtocol* proto, bool& strike) { strike = false; // Select appropriate color and style of text //if (UEnvironment::HasFeature(env_SupportsColor)) { bool color_set = false; RGBColor text_color; bool style_set = false; short text_style = normal; if (node->IsProtocol()) { if (!proto || proto->IsLoggedOn()) { text_color = CPreferences::sPrefs->mServerOpenStyle.GetValue().color; text_style = text_style | CPreferences::sPrefs->mServerOpenStyle.GetValue().style & 0x007F; strike = strike || ((CPreferences::sPrefs->mServerOpenStyle.GetValue().style & 0x0080) != 0); } else { text_color = CPreferences::sPrefs->mServerClosedStyle.GetValue().color; text_style = text_style | CPreferences::sPrefs->mServerClosedStyle.GetValue().style & 0x007F; strike = strike || ((CPreferences::sPrefs->mServerClosedStyle.GetValue().style & 0x0080) != 0); } color_set = true; style_set = true; } else { text_color = CPreferences::sPrefs->mMboxClosedStyle.GetValue().color; text_style = text_style | CPreferences::sPrefs->mMboxClosedStyle.GetValue().style & 0x007F; strike = strike || ((CPreferences::sPrefs->mMboxClosedStyle.GetValue().style & 0x0080) != 0); color_set = true; style_set = true; if (node->IsSubscribed()) { iCal::CICalendar* cal = node->GetCalendar(); if (node->IsInbox() && (cal != NULL) && cal->HasData()) { text_color = CPreferences::sPrefs->mMboxUnseenStyle.GetValue().color; text_style = text_style | CPreferences::sPrefs->mMboxUnseenStyle.GetValue().style & 0x007F; strike = strike || ((CPreferences::sPrefs->mMboxUnseenStyle.GetValue().style & 0x0080) != 0); color_set = true; style_set = true; } else { text_color = CPreferences::sPrefs->mMboxFavouriteStyle.GetValue().color; text_style = text_style | CPreferences::sPrefs->mMboxFavouriteStyle.GetValue().style & 0x007F; strike = strike || ((CPreferences::sPrefs->mMboxFavouriteStyle.GetValue().style & 0x0080) != 0); color_set = true; style_set = true; } } if (!color_set) { text_color = CPreferences::sPrefs->mMboxClosedStyle.GetValue().color; text_style = text_style | CPreferences::sPrefs->mMboxClosedStyle.GetValue().style & 0x007F; strike = strike || ((CPreferences::sPrefs->mMboxClosedStyle.GetValue().style & 0x0080) != 0); color_set = true; style_set = true; } } if (color_set) pDC->SetTextColor(text_color); // Set appropriate font if (style_set) { switch(text_style) { case normal: default: //pDC->SelectObject(CMulberryApp::sAppListFont); break; case bold: pDC->SelectObject(CFontCache::GetListFontBold()); break; case italic: pDC->SelectObject(CFontCache::GetListFontItalic()); break; case bold + italic: pDC->SelectObject(CFontCache::GetListFontBoldItalic()); break; case underline: pDC->SelectObject(CFontCache::GetListFontUnderline()); break; case bold + underline: pDC->SelectObject(CFontCache::GetListFontBoldUnderline()); break; case italic + underline: pDC->SelectObject(CFontCache::GetListFontItalicUnderline()); break; case bold + italic + underline: pDC->SelectObject(CFontCache::GetListFontBoldItalicUnderline()); break; } } } } bool CCalendarStoreTable::UsesBackgroundColor(const calstore::CCalendarStoreNode* node) const { return node->IsProtocol() || node->IsDisplayHierarchy(); } COLORREF CCalendarStoreTable::GetBackgroundColor(const calstore::CCalendarStoreNode* node) const { if (node->IsDisplayHierarchy()) return CPreferences::sPrefs->mHierarchyBkgndStyle.GetValue().color; else return CPreferences::sPrefs->mServerBkgndStyle.GetValue().color; } void CCalendarStoreTable::OnUpdateSelectionCalendarStoreNode(CCmdUI* pCmdUI) { pCmdUI->Enable(TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionCalendarStoreNode)); } void CCalendarStoreTable::OnUpdateSelectionCanChangeCalendar(CCmdUI* pCmdUI) { pCmdUI->Enable(TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionCanChangeCalendar)); } void CCalendarStoreTable::OnUpdateLogin(CCmdUI* pCmdUI) { // Logon button must have single server selected if (IsSingleSelection() && TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionServer)) { TableIndexT row = GetFirstSelectedRow(); calstore::CCalendarStoreNode* node = GetCellNode(row); pCmdUI->Enable(node->IsProtocol()); pCmdUI->SetCheck(node->IsProtocol() && node->GetProtocol()->IsLoggedOn()); cdstring title; title.FromResource(node->IsProtocol() && node->GetProtocol()->IsLoggedOn() ? IDS_LOGOUT : IDS_LOGIN); pCmdUI->SetText(title.win_str()); // Policy: // // 1. Local protocols are always logged in - login button is disabled // 2. Protocols that cannot disconnect // 2.1 maintain their own logged in state when global connect state is on, // 2.2 else they are always logged out when global state is disconnected and the login button is disabled // 3. Protocols that can disconnect // 3.1 when global connect state is on, they maintain their own logged in state based on disconnected state // 3.3 else they are always logged in and the login button is disabled // 1. (as above) if (node->GetProtocol()->IsOffline() && !node->GetProtocol()->IsDisconnected()) { // Local items are always logged in (connected) so disable the button pCmdUI->Enable(false); cdstring title; title.FromResource(IDS_LOGOUT); pCmdUI->SetText(title.win_str()); } // 2. (as above) else if (!node->GetProtocol()->CanDisconnect()) { // 2.1 (as above) if (CConnectionManager::sConnectionManager.IsConnected()) { pCmdUI->Enable(true); pCmdUI->SetCheck(node->GetProtocol()->IsLoggedOn()); cdstring title; title.FromResource(!node->GetProtocol()->IsLoggedOn() ? IDS_LOGIN : IDS_LOGOUT); pCmdUI->SetText(title.win_str()); } // 2.2 (as above) else { pCmdUI->Enable(false); cdstring title; title.FromResource(IDS_LOGOUT); pCmdUI->SetText(title.win_str()); } } // 3. (as above) else { // 3.1 (as above) if (CConnectionManager::sConnectionManager.IsConnected()) { pCmdUI->Enable(true); pCmdUI->SetCheck(!node->GetProtocol()->IsDisconnected()); cdstring title; title.FromResource(node->GetProtocol()->IsDisconnected() ? IDS_LOGIN : IDS_LOGOUT); pCmdUI->SetText(title.win_str()); } // 3.2 (as above) else { pCmdUI->Enable(false); cdstring title; title.FromResource(IDS_LOGOUT); pCmdUI->SetText(title.win_str()); } } } else { pCmdUI->Enable(false); pCmdUI->SetCheck(false); cdstring title; title.FromResource(IDS_LOGIN); pCmdUI->SetText(title.win_str()); } } // Update command void CCalendarStoreTable::OnUpdateHierarchy(CCmdUI* pCmdUI) { pCmdUI->Enable(TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionHierarchy)); } void CCalendarStoreTable::OnUpdateRefreshList(CCmdUI* pCmdUI) { pCmdUI->Enable(IsSingleSelection()); } void CCalendarStoreTable::OnUpdateNewWebCalendar(CCmdUI* pCmdUI) { // Always enabled if admin allows it pCmdUI->Enable(!CAdminLock::sAdminLock.mNoLocalCalendars && ((calstore::CCalendarStoreManager::sCalendarStoreManager->GetWebCalendarProtocol() == NULL) || !calstore::CCalendarStoreManager::sCalendarStoreManager->GetWebCalendarProtocol()->IsDisconnected())); } void CCalendarStoreTable::OnUpdateRefreshWebCalendar(CCmdUI* pCmdUI) { // Always enabled if admin allows it pCmdUI->Enable(!CAdminLock::sAdminLock.mNoLocalCalendars && (calstore::CCalendarStoreManager::sCalendarStoreManager->GetWebCalendarProtocol() != NULL) && !calstore::CCalendarStoreManager::sCalendarStoreManager->GetWebCalendarProtocol()->IsDisconnected() && TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionWebCalendar)); } void CCalendarStoreTable::OnUpdateUploadWebCalendar(CCmdUI* pCmdUI) { // Always enabled if admin allows it pCmdUI->Enable(!CAdminLock::sAdminLock.mNoLocalCalendars && (calstore::CCalendarStoreManager::sCalendarStoreManager->GetWebCalendarProtocol() != NULL) && !calstore::CCalendarStoreManager::sCalendarStoreManager->GetWebCalendarProtocol()->IsDisconnected() && TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionUploadWebCalendar)); } void CCalendarStoreTable::DoChangeColour(TableIndexT row) { // Must be a valid active calendar calstore::CCalendarStoreNode* node = GetCellNode(row); if (node->IsSubscribed()) { uint32_t colour = calstore::CCalendarStoreManager::sCalendarStoreManager->GetCalendarColour(node); RGBColor inColor = CCalendarUtils::GetWinColor(colour); CColorDialog dlg(0, 0, CSDIFrame::GetAppTopWindow()); dlg.m_cc.rgbResult = inColor; dlg.m_cc.Flags |= CC_FULLOPEN | CC_RGBINIT; if (dlg.DoModal() == IDOK) { calstore::CCalendarStoreManager::sCalendarStoreManager->ChangeNodeColour(node, CCalendarUtils::GetCalColor(dlg.GetColor())); RefreshRow(row); } } } // Import selected calendars void CCalendarStoreTable::DoImportCalendar(calstore::CCalendarStoreNode* node, bool merge) { // Must have valid node if (node == NULL) return; // Do standard open dialog // prompt the user CString filter = _T("Anyfile (*.*) | *.*||"); CFileDialog dlgFile(true, NULL, NULL, OFN_FILEMUSTEXIST, filter, CSDIFrame::GetAppTopWindow()); // Check for good reply if (dlgFile.DoModal() == IDOK) { // Get full path and create stream cdstring fpath(dlgFile.GetPathName()); cdifstream fin(fpath); if (fin.fail()) return; // May need to activate if not already calstore::CCalendarStoreManager::StNodeActivate _activate(node); iCal::CICalendar* cal_server = node->GetCalendar(); if (cal_server != NULL) { if (merge) { // Read in new calendar iCal::CICalendar cal_local; cal_local.Parse(fin); // Do sync with node iCal::CICalendarSync sync(*cal_server, cal_local); sync.Sync(); cal_server->SetDirty(true); cal_server->SetTotalReplace(true); } else { // Read calendar from file replacing existing data iCal::CICalendar* cal_server = node->GetCalendar(); if (cal_server != NULL) { cal_server->Clear(); cal_server->Parse(fin); cal_server->SetDirty(true); cal_server->SetTotalReplace(true); } } } } } // Export selected calendars bool CCalendarStoreTable::ExportCalendar(TableIndexT row) { // Get calendar for hit cell bool failagain = false; calstore::CCalendarStoreNode* node = GetCellNode(row); if (node == NULL) return false; // Pick file to export to CString saveAsName = cdustring(node->GetDisplayName()); CString filter = _T("Exported Calendar (*.ics)|*.ics||"); CFileDialog dlgFile(false, _T(".ics"), saveAsName, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, filter, CSDIFrame::GetAppTopWindow()); // Check for good reply if (dlgFile.DoModal() == IDOK) { // Get full path and create stream cdstring pname(dlgFile.GetPathName()); cdofstream fout(pname, std::ios_base::in | std::ios_base::binary | std::ios_base::trunc); if (fout.fail()) return false; // May need to activate if not already calstore::CCalendarStoreManager::StNodeActivate _activate(node); // Write calendar to file iCal::CICalendar* cal = node->GetCalendar(); if (cal != NULL) cal->Generate(fout); return true; } return false; } void CCalendarStoreTable::OnEditProperties() { if (TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionServer)) OnServerProperties(); else if (TestSelectionAnd((TestSelectionPP) &CCalendarStoreTable::TestSelectionCalendarStoreNode)) OnCalendarProperties(); } #pragma mark ____________________________Drag & Drop // Prevent drag if improper selection BOOL CCalendarStoreTable::DoDrag(TableIndexT row) { return ValidDragSelection() && CHierarchyTableDrag::DoDrag(row); } // Only add CCalendarStoreTable item flavors to drag void CCalendarStoreTable::SetDragFlavors(TableIndexT row) { // Get the relevant data calstore::CCalendarStoreNode* node = GetCellNode(row); if (node->IsProtocol()) // Dragging server to another location mDrag.DelayRenderData(CMulberryApp::sFlavorCalServer); else // Dragging calendar mDrag.DelayRenderData(CMulberryApp::sFlavorCalendar); } BOOL CCalendarStoreTable::OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal) { BOOL rendered = false; if ((lpFormatEtc->cfFormat == CMulberryApp::sFlavorCalServer) || (lpFormatEtc->cfFormat == CMulberryApp::sFlavorCalendar)) { ulvector rows; GetSelectedRows(rows); int count = rows.size(); // Allocate global memory for the text if not already if (!*phGlobal) *phGlobal = ::GlobalAlloc(GMEM_DDESHARE, count * sizeof(void*) + sizeof(int)); if (*phGlobal) { // Copy to global after lock void** pGrp = (void**) ::GlobalLock(*phGlobal); *((int*) pGrp) = count; pGrp += sizeof(int); for(ulvector::const_iterator iter = rows.begin(); iter != rows.end(); iter++) { calstore::CCalendarStoreNode* node = GetCellNode(*iter); if (node->IsProtocol()) *pGrp++ = node->GetProtocol(); else if (!node->IsInbox() && !node->IsOutbox()) *pGrp++ = node; } ::GlobalUnlock(*phGlobal); rendered = true; } } return rendered; } // Check for valid drag selection bool CCalendarStoreTable::ValidDragSelection() const { // Loop over all selected cells int got_server = 0; int got_calendar = 0; STableCell selCell(0, 0); while(GetNextSelectedCell(selCell)) { calstore::CCalendarStoreNode* node = GetCellNode(selCell.row); if (node->IsProtocol()) { // Cannot drag either the local or web calendars protocols if ((node->GetProtocol()->GetAccountType() == CINETAccount::eLocalCalendar) || (node->GetProtocol()->GetAccountType() == CCalendarAccount::eHTTPCalendar)) return false; got_server = 1; } else if (node->IsInbox() || node->IsOutbox()) got_calendar = 2; else got_calendar = 1; // Can only have one type if (got_server + got_calendar > 1) return false; } return true; } // Test drag insert cursor bool CCalendarStoreTable::IsDropCell(COleDataObject* pDataObject, const STableCell& theCell) { if (IsValidCell(theCell)) { // Get flavor for this item unsigned int theFlavor = GetBestFlavor(pDataObject); // Get drop cell type calstore::CCalendarStoreNode* node = GetCellNode(theCell.row); if (theFlavor == CMulberryApp::sFlavorCalendarItem) { // Drop into valid calendars only return node->IsViewableCalendar(); } else if (theFlavor == CMulberryApp::sFlavorCalServer) // Servers always moved return false; else if (theFlavor == CMulberryApp::sFlavorCalendar) { if (node->IsProtocol() || node->IsInbox() || node->IsOutbox()) return false; else // Allow drop into any calendar (directory = move, mbox = copy) return true; } else // Anything else is an error! return false; } else return false; } // Test drop at cell bool CCalendarStoreTable::IsDropAtCell(COleDataObject* pDataObject, STableCell& aCell) { // Get flavor for this item unsigned int theFlavor = GetBestFlavor(pDataObject); // Adjust for end of table int adjust = 0; if (aCell.row > mRows) adjust = 1; if (IsValidCell(aCell) || adjust) { // Get drop cell type calstore::CCalendarStoreNode* node = GetCellNode(aCell.row - adjust); TableIndexT woRow = GetWideOpenIndex(aCell.row + TABLE_ROW_ADJUST); if (theFlavor == CMulberryApp::sFlavorCalendarItem) { // Always drop into, never at return false; } else if (theFlavor == CMulberryApp::sFlavorCalServer) { // Must be same window if (sTableDragSource != this) return false; // Server can only be dropped before/after server in the same window if (node->IsProtocol()) return true; // Beyond last row allowed if (adjust) return true; // Check for row immediately after server if (woRow > 1) { calstore::CCalendarStoreNode* prev_node = GetCellNode(woRow - 1 + adjust, true); return (prev_node->IsProtocol()); } return false; } else if (theFlavor == CMulberryApp::sFlavorCalendar) { return true; } else // Anything else is an error! return false; } else return false; } // Can cell expand for drop bool CCalendarStoreTable::CanDropExpand(COleDataObject* pDataObject, TableIndexT woRow) { // Get flavor for this item unsigned int theFlavor = GetBestFlavor(pDataObject); if ((theFlavor == CMulberryApp::sFlavorCalendar) || (theFlavor == CMulberryApp::sFlavorCalendarItem)) return CHierarchyTableDrag::CanDropExpand(pDataObject, woRow); else // Anything else cannot return false; } // Adjust cursor over drop area DROPEFFECT CCalendarStoreTable::GetDropEffect(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) { // Get flavor for this item unsigned int theFlavor = GetBestFlavor(pDataObject); // Toggle based on modifiers bool option_key = ((dwKeyState & MK_ALT) == MK_ALT); if (theFlavor == CMulberryApp::sFlavorCalendarItem) { return option_key ? DROPEFFECT_COPY : DROPEFFECT_MOVE; } else if (theFlavor == CMulberryApp::sFlavorCalServer) // Server always moved return DROPEFFECT_MOVE; else if (theFlavor == CMulberryApp::sFlavorCalendar) { // Calendars moved if drop at or no drop cell if (mLastDropCursor.row || !mLastDropCell.row) return DROPEFFECT_MOVE; // Must check cell dropped into to see if directory // Get drop cell type calstore::CCalendarStoreNode* node = GetCellNode(mLastDropCell.row); if (node->IsDirectory()) return DROPEFFECT_MOVE; else return DROPEFFECT_COPY; } else // Anything else is an error! return DROPEFFECT_MOVE; } // Drop data into cell bool CCalendarStoreTable::DropData(unsigned int theFlavor, char* drag_data, unsigned long data_size) { return false; } // Drop data into cell bool CCalendarStoreTable::DropDataIntoCell(unsigned int theFlavor, char* drag_data, unsigned long data_size, const STableCell& theCell) { if (theFlavor == CMulberryApp::sFlavorCalendarItem) { return false; // For now } else if (theFlavor == CMulberryApp::sFlavorCalendar) { // Get drop cell type calstore::CCalendarStoreNode* node = GetCellNode(theCell.row); if (node->IsProtocol() || node->IsInbox() || node->IsOutbox()) return false; // Ask user before doing task if (CErrorHandler::PutCautionAlertRsrcStr(true, node->IsDirectory() ? "CCalendarStoreTable::ReallyMoveCalendar" : "CCalendarStoreTable::ReallyCopyCalendar", node->GetName()) == CErrorHandler::Cancel) return false; int count = *((int*) drag_data); drag_data += sizeof(int); for(int i = 0; i < count; i++) { calstore::CCalendarStoreNode* drag = ((calstore::CCalendarStoreNode**) drag_data)[i]; if (drag->IsProtocol()) continue; if (node->IsDirectory()) { // Move mailbox drag->MoveCalendar(node, false); } else { // Do calendar -> calendar copy drag->CopyCalendar(node); } } return true; } return false; } // Drop data at cell bool CCalendarStoreTable::DropDataAtCell(unsigned int theFlavor, char* drag_data, unsigned long data_size, const STableCell& beforeCell) { // Adjust for end of table int adjust = 0; if (beforeCell.row > mRows) adjust = 1; // Get drop cell type TableIndexT woRow = mCollapsableTree->GetWideOpenIndex(beforeCell.row + TABLE_ROW_ADJUST - adjust); calstore::CCalendarStoreNode* node = GetCellNode(beforeCell.row - adjust); if (theFlavor == CMulberryApp::sFlavorCalServer) { unsigned long new_index = 0; if (adjust) new_index = calstore::CCalendarStoreManager::sCalendarStoreManager->GetProtocolCount(); else { calstore::CCalendarProtocol* above = node->GetProtocol(); if (node->IsProtocol()) new_index = calstore::CCalendarStoreManager::sCalendarStoreManager->GetProtocolIndex(above); else new_index = calstore::CCalendarStoreManager::sCalendarStoreManager->GetProtocolIndex(above) + 1; } int count = *((int*) drag_data); drag_data += sizeof(int); for(int i = 0; i < count; i++) { calstore::CCalendarProtocol* drag = ((calstore::CCalendarProtocol**) drag_data)[i]; long old_index = calstore::CCalendarStoreManager::sCalendarStoreManager->GetProtocolIndex(drag); // Only if different if (old_index != new_index) calstore::CCalendarStoreManager::sCalendarStoreManager->MoveProtocol(old_index, new_index); // Must adjust if dragging above if (new_index < old_index) new_index++; } return true; } else if (theFlavor == CMulberryApp::sFlavorCalendar) { // Ask user before doing task if (CErrorHandler::PutCautionAlertRsrcStr(true, "CCalendarStoreTable::ReallyMoveCalendar", (node->GetParent() ? node->GetParent() : node)->GetName()) == CErrorHandler::Cancel) return false; int count = *((int*) drag_data); drag_data += sizeof(int); for(int i = 0; i < count; i++) { calstore::CCalendarStoreNode* drag = ((calstore::CCalendarStoreNode**) drag_data)[i]; if (drag->IsProtocol()) continue; // Move calendar into directory drag->MoveCalendar(node->GetParent() ? node->GetParent() : node, !node->GetParent()); } return true; } return false; }
[ "svnusers@a91246af-f21b-0410-bd1c-c3c7fc455132" ]
svnusers@a91246af-f21b-0410-bd1c-c3c7fc455132
dfd809ef0d45b59ebc8670e9f1480e43eb9f2324
d4ce8f9042935714f59032740b5a26a69b0caa5f
/gameStart.cpp
8edbad5038cbed0eeacffba633dc28f7085b6820
[]
no_license
yakuseishou/42spaceShooter
c8d521d2771cd558507f7ee687a4bfad994a3b8b
7459505cd97f2e00332ed9f3af68a65a48a3752b
refs/heads/master
2020-12-22T01:33:47.853440
2020-02-07T01:03:07
2020-02-07T01:03:07
236,630,695
0
0
null
null
null
null
UTF-8
C++
false
false
3,912
cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* gameStart.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: kchen2 <kchen2@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/17 16:52:44 by kchen2 #+# #+# */ /* Updated: 2020/01/20 17:14:41 by kchen2 ### ########.fr */ /* */ /* ************************************************************************** */ #include <iostream> #include <fstream> #include <ncurses.h> #include "prototype.hpp" void createBoarder(Windo win) { char bt; bt = '*'; wborder(win.getWin(), (int)bt, (int)bt, (int)bt, (int)bt, (int)bt, (int)bt, (int)bt, (int)bt); } void gameOver(Windo win, EntityManager* Manager) { // std::ifstream in("ascii_arts/gameOver.txt"); // std::string cont((std::istreambuf_iterator<char>(in)), // std::istreambuf_iterator<char>()); // mvwprintw(win.getWin(), 10, 0, cont.c_str()); std::string contents = " GAME OVER!\n Final Score: "; if (!Manager) { } contents += std::to_string(Manager->getEnemyController()->getKiScore()); contents += "\n Press Enter to continue!\n"; wclear(win.getWin()); mvwprintw(win.getWin(), win.getYMax()/2 - 2, 2, contents.c_str()); createBoarder(win); wrefresh(win.getWin()); while (1) { char c = getch(); if (c == '\033') { c = getch(); if (c == ESC_KEY) { exitGame(); break ; } } else if (c == ENTER_KEY) { gameMenu(win); break ; } } } void MenuKeyListen(Windo win) { switch (getch()) { case 'c': GameInit(win); break; case 'q': exitGame(); break; default: MenuKeyListen(win); break; } } void gameMenu(Windo win) { std::ifstream cho("ascii_arts/choice.txt"); std::string chos((std::istreambuf_iterator<char>(cho)), std::istreambuf_iterator<char>()); // std::string chos = " Make your choice!"; std::ifstream gs("ascii_arts/gameStart.txt"); std::string gss((std::istreambuf_iterator<char>(gs)), std::istreambuf_iterator<char>()); // std::string gss = " Game Start (c)"; std::ifstream ex("ascii_arts/exit.txt"); std::string exs((std::istreambuf_iterator<char>(ex)), std::istreambuf_iterator<char>()); // std::string exs = " Exit (q)"; wclear(win.getWin()); mvwprintw(win.getWin(), 5, 0, chos.c_str()); mvwprintw(win.getWin(), (win.getYMax()/2 - 10), 0, gss.c_str()); mvwprintw(win.getWin(), (win.getYMax()/2 - 5), 0, exs.c_str()); createBoarder(win); wrefresh(win.getWin()); MenuKeyListen(win); } void startKeyListen(Windo win) { switch (getch()) { case ENTER_KEY: gameMenu(win); break; case 'q': exitGame(); break; default: startKeyListen(win); break; } } void gameStart(Windo win) { // std::string contents = " FT_RETO\n (Press Enter!)"; std::ifstream in("ascii_arts/ft_retro.txt"); std::string contents((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>()); wclear(win.getWin()); mvwprintw(win.getWin(), (win.getYMax()/2 - 15), 0, contents.c_str()); createBoarder(win); wrefresh(win.getWin()); startKeyListen(win); }
[ "kchen2@e1z3r3p25.42.us.org" ]
kchen2@e1z3r3p25.42.us.org
7b7efa4981f02cb2789c326fb290ce97627572a2
3cdeb3766bc5fd42f7802cc8b11652f2702409e1
/BST/5-ceil.cpp
1da426cc5856464150114e5090201129eea0ead3
[]
no_license
abhishek0777/CPCodes
a24167b782baa946bca0a70e4d91322bfec76dad
dcfe863de899d90fa982464104fbeaa94b0bc4db
refs/heads/master
2023-06-02T02:29:13.439508
2021-06-18T08:21:07
2021-06-18T08:21:07
298,038,665
0
1
null
null
null
null
UTF-8
C++
false
false
1,273
cpp
#include<bits/stdc++.h> #define ll long long int using namespace std; struct node{ int key; struct node *left,*right; }; node* newNode(int k) { node* temp = new node; temp->key = k; temp->left = temp->right = NULL; return temp; } //recursivve insertion node* insert(node* root,int x) { if(root==NULL)return newNode(x); else if(root->key<x)root->right=insert(root->right,x); else if(root->key>x)root->left=insert(root->left,x); return root; } void inorder(node* root) { if(root!=NULL) { inorder(root->left); cout<<root->key<<" "; inorder(root->right); } } node* ceilV(node* root,int x) { node* ans=NULL; while(root!=NULL) { if(root->key==x)return root; else if(root->key<x) { root=root->right; } else { ans=root; root=root->left; } } return ans; } int main() { node* root=NULL; root=insert(root,50); root=insert(root,30); root=insert(root,20); root=insert(root,40); root=insert(root,70); root=insert(root,60); root=insert(root,80); // inorder(root); if(floorV(root,55)) cout<<ceilV(root,55)->key; else cout<<"No ceil value" }
[ "abhishek777vaishnav@gmail.com" ]
abhishek777vaishnav@gmail.com
bb80f2bf61229855049840d3697624be132f885a
880ba6f0ad1090d5c1d837d0e76d1d767ebe20d8
/source/database/db342.h
533fae3489106c0e646d6a434864233d9f29e84b
[]
no_license
jetma/adso
7657e02978c0afdc35c66a67771841ddbed69f17
56fd41696a542cc9a80da60a6ffe06ebfb2e67f3
refs/heads/master
2020-06-18T12:32:10.407939
2019-03-03T08:49:52
2019-03-03T08:49:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
754
h
#ifndef DB342_H #define DB342_H class Db342 { public: Db342(); ~Db342(); const char * table_6821[3][11]; const char * table_6822[2][11]; const char * table_6823[3][11]; const char * table_6824[2][11]; const char * table_6825[2][11]; const char * table_6826[2][11]; const char * table_6827[2][11]; const char * table_6828[2][11]; const char * table_6829[2][11]; const char * table_6830[2][11]; const char * table_6831[3][11]; const char * table_6832[3][11]; const char * table_6833[3][11]; const char * table_6834[3][11]; const char * table_6835[3][11]; const char * table_6836[2][11]; const char * table_6837[3][11]; const char * table_6838[3][11]; const char * table_6839[2][11]; const char * table_6840[2][11]; }; #endif
[ "wtanaka@yahoo.com" ]
wtanaka@yahoo.com
d96d751e4ab13166a3b9b9099fef301d1f694c6f
0cd0c453f41ac19e4cfa4a5714147ba7018eaed9
/examples/ClanLib/AtharonRL/Sources/Client/GameWorld/client_map_tile.h
1aa6d4b9cb5dab7fc5da7e967143049e8035abe0
[ "MIT" ]
permissive
ptrefall/propcomp
ff84d68e0cb21a2131ac19c4bf9128572568f60f
35a751ae0717e5c35621200f64deb373b29341a0
refs/heads/master
2021-06-07T04:49:46.596346
2018-03-21T08:47:04
2018-03-21T08:47:04
32,448,408
2
0
null
null
null
null
UTF-8
C++
false
false
763
h
#pragma once #include "Engine/Common/GameWorld/map_tile_interface.h" class LayerManager; typedef std::shared_ptr<LayerManager> LayerManagerPtr; class Layer; typedef std::shared_ptr<Layer> LayerPtr; class ClientZone; class ClientCamera; typedef std::shared_ptr<ClientCamera> ClientCameraPtr; class ClientMapTile; typedef std::shared_ptr<ClientMapTile> ClientMapTilePtr; class ClientMapTile : public MapTileInterface { public: ClientMapTile(const clan::Vec2i &position, bool walkable, ClientZone *zone, const LayerManagerPtr &layer_manager); virtual ~ClientMapTile(); void update(float time_elapsed); void draw(const ClientCameraPtr &camera); protected: LayerManagerPtr layer_manager; LayerPtr dungeon_layer; bool walkable; };
[ "ptrefall@gmail.com@1ed68ad0-91c7-136a-175d-75a241914234" ]
ptrefall@gmail.com@1ed68ad0-91c7-136a-175d-75a241914234
56f74009e26090c7cec9e363b08c8a02fa0bf6a7
4985aad8ecfceca8027709cf488bc2c601443385
/build/Android/Debug/app/src/main/include/Fuse.Preview.ISelection.h
5915ca88e27d5a7228f0465d70292e71862f6313
[]
no_license
pacol85/Test1
a9fd874711af67cb6b9559d9a4a0e10037944d89
c7bb59a1b961bfb40fe320ee44ca67e068f0a827
refs/heads/master
2021-01-25T11:39:32.441939
2017-06-12T21:48:37
2017-06-12T21:48:37
93,937,614
0
0
null
null
null
null
UTF-8
C++
false
false
624
h
// This file was generated based on '../../AppData/Local/Fusetools/Packages/Fuse.Common/1.0.2/$.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> namespace g{ namespace Fuse{ namespace Preview{ // public abstract interface ISelection :2883 // { uInterfaceType* ISelection_typeof(); struct ISelection { void(*fp_IsSelected)(uObject*, uObject*, bool*); static bool IsSelected(const uInterface& __this, uObject* obj) { bool __retval; return __this.VTable<ISelection>()->fp_IsSelected(__this, obj, &__retval), __retval; } }; // } }}} // ::g::Fuse::Preview
[ "newreality64@gmail.com" ]
newreality64@gmail.com
0429d7840698d88a2e42dd2f613caa7767ffcb03
c451213ad755e3a62fd0fc43925e0446703ad3ef
/source/common/brig_app.cpp
67e1836d19626b88ae7272affb95eb95551b9eb9
[]
no_license
alkresin/brig
1846bab683efc6577a4f84d22bbe552ddda14c04
077b7180fb2269b072d3ea38190804924201a2ec
refs/heads/master
2021-01-19T23:24:51.045359
2018-08-30T07:43:33
2018-08-30T07:43:33
88,974,723
0
1
null
null
null
null
UTF-8
C++
false
false
9,611
cpp
/* * Brig - a ligthweight C++ GUI framework * * * Copyright 2017 Alexander S.Kresin <alex@kresin.ru> * www - http://www.kresin.ru */ #include "brig.h" brig_Application::brig_Application(): pMainWindow(NULL) {} brig_Application::~brig_Application() { unsigned int i; for( i = 0; i < brigApp.avStyles.size(); i++ ) delete brigApp.avStyles[i].pStyle; for( i = 0; i < brigApp.avPens.size(); i++ ) brig_DeleteObject( brigApp.avPens[i].pPen ); for( i = 0; i < brigApp.avBrushes.size(); i++ ) brig_DeleteObject( brigApp.avBrushes[i].pBrush ); for( i = 0; i < brigApp.avFonts.size(); i++ ) { brig_DeleteObject( brigApp.avFonts[i].pFont ); if( brigApp.avFonts[i].bNeedToFree ) free( brigApp.avFonts[i].pName ); } for( i = 0; i < brigApp.avTimers.size(); i++ ) { brigKillTimer( brigApp.avTimers[i].uiId ); } } PBRIG_FONT brigAddFont( PBRIG_CHAR fontName, int fnHeight, int fnWeight, DWORD fdwCharSet, DWORD fdwItalic, DWORD fdwUnderline, DWORD fdwStrikeOut ) { unsigned int i, iFirst = 0; BRIGAPP_FONT bfold; for( i = 0; i < brigApp.avFonts.size(); i++ ) { bfold = brigApp.avFonts[i]; if( bfold.pName == fontName && bfold.iHeight == (int) fnHeight && bfold.iWeight == (int)fnWeight && bfold.iCharSet == (int)fdwCharSet && bfold.iItalic == (int)fdwItalic && bfold.iUnderline == (int)fdwUnderline && bfold.iStrikeOut == (int)fdwStrikeOut ) break; if( brigApp.avFonts[i].iCount == 0 && !iFirst ) iFirst = i; } if( i >= brigApp.avFonts.size() ) { BRIGAPP_FONT bf = {0}; bf.pFont = brig_CreateFont( fontName, fnHeight, fnWeight, fdwCharSet, fdwItalic, fdwUnderline, fdwStrikeOut ); bf.iCount = 1; bf.pName = fontName; bf.iHeight = (int) fnHeight; bf.iWeight = (int)fnWeight; bf.iCharSet = (int)fdwCharSet; bf.iItalic = (int)fdwItalic; bf.iUnderline = (int)fdwUnderline; bf.iStrikeOut = (int)fdwStrikeOut; if( brigApp.avFonts.size() > BRIGAPP_FONT_LIMIT && iFirst ) { brig_DeleteObject( brigApp.avFonts[iFirst].pFont ); brigApp.avFonts.erase( brigApp.avFonts.begin()+iFirst ); } brigApp.avFonts.push_back( bf ); return bf.pFont; } else { brigApp.avFonts[i].iCount ++; return brigApp.avFonts[i].pFont; } } PBRIG_FONT brigAddFont( PBRIG_FONT pFontBase ) { unsigned int i, iFirst = 0; BRIGAPP_FONT bf = { 0 }; PBRIG_FONT pFont = brig_ChooseFont( pFontBase, &bf ); if( pFont ) { BRIGAPP_FONT bfold; for( i = 0; i < brigApp.avFonts.size(); i++ ) { bfold = brigApp.avFonts[i]; if( bfold.pName == bf.pName && bfold.iHeight == bf.iHeight && bfold.iWeight == bf.iWeight && bfold.iCharSet == bf.iCharSet && bfold.iItalic == bf.iItalic && bfold.iUnderline == bf.iUnderline && bfold.iStrikeOut == bf.iStrikeOut ) break; if( brigApp.avFonts[i].iCount == 0 && !iFirst ) iFirst = i; } if( i > brigApp.avFonts.size() ) { bf.pFont = pFont; bf.iCount = 1; #if defined( UNICODE ) bf.bNeedToFree = 1; #endif if( brigApp.avFonts.size() > BRIGAPP_FONT_LIMIT && iFirst ) { brig_DeleteObject( brigApp.avFonts[iFirst].pFont ); brigApp.avFonts.erase( brigApp.avFonts.begin()+iFirst ); } brigApp.avFonts.push_back( bf ); return bf.pFont; } else { brigApp.avFonts[i].iCount ++; brig_DeleteObject( pFont ); free( bf.pName ); return brigApp.avFonts[i].pFont; } } return NULL; } void brigDelFont( PBRIG_FONT pFont ) { unsigned int i; for( i = 0; i < brigApp.avFonts.size(); i++ ) if( brigApp.avFonts[i].pFont == pFont && brigApp.avFonts[i].iCount ) { brigApp.avFonts[i].iCount --; break; } } PBRIG_PEN brigAddPen( int iWidth, long int lColor, int iStyle ) { unsigned int i, iFirst = 0; for( i = 0; i < brigApp.avPens.size(); i++ ) { if( brig_ComparePen( brigApp.avPens[i].pPen, iWidth, lColor, iStyle ) ) break; if( brigApp.avPens[i].iCount == 0 && !iFirst ) iFirst = i; } if( i >= brigApp.avPens.size() ) { BRIGAPP_PEN bp; bp.pPen = brig_CreatePen( iWidth, lColor, iStyle ); bp.iCount = 1; if( brigApp.avPens.size() > BRIGAPP_PEN_LIMIT && iFirst ) { brig_DeleteObject( brigApp.avPens[iFirst].pPen ); brigApp.avPens.erase( brigApp.avPens.begin()+iFirst ); } brigApp.avPens.push_back( bp ); return bp.pPen; } else { brigApp.avPens[i].iCount ++; return brigApp.avPens[i].pPen; } } void brigDelPen( PBRIG_PEN pPen ) { unsigned int i; for( i = 0; i < brigApp.avPens.size(); i++ ) if( brigApp.avPens[i].pPen == pPen && brigApp.avPens[i].iCount ) { brigApp.avPens[i].iCount --; break; } } PBRIG_BRUSH brigAddBrush( long int lColor ) { unsigned int i, iFirst = 0; for( i = 0; i < brigApp.avBrushes.size(); i++ ) { if( brig_CompareBrush( brigApp.avBrushes[i].pBrush, lColor ) ) break; if( brigApp.avBrushes[i].iCount == 0 && !iFirst ) iFirst = i; } if( i >= brigApp.avBrushes.size() ) { BRIGAPP_BRUSH bb; bb.pBrush = brig_CreateBrush( lColor ); bb.iCount = 1; if( brigApp.avBrushes.size() > BRIGAPP_BRUSH_LIMIT && iFirst ) { brig_DeleteObject( brigApp.avBrushes[iFirst].pBrush ); brigApp.avBrushes.erase( brigApp.avBrushes.begin()+iFirst ); } brigApp.avBrushes.push_back( bb ); return bb.pBrush; } else { brigApp.avBrushes[i].iCount ++; return brigApp.avBrushes[i].pBrush; } } void brigDelBrush( PBRIG_BRUSH pBrush ) { unsigned int i; for( i = 0; i < brigApp.avBrushes.size(); i++ ) if( brigApp.avBrushes[i].pBrush == pBrush && brigApp.avBrushes[i].iCount ) { brigApp.avBrushes[i].iCount --; break; } } bool brig_CompareStyle( brig_Style *pStyle, unsigned int iColors, long * pColors, int iType, long lBorderColor, int iBorder, unsigned int iCorners, long * pCorners ) { if( pStyle->avColor.size() == iColors && pStyle->iOrient == iType && pStyle->avCorners.size() == iCorners ) { if( !brig_ComparePen( pStyle->pPen, iBorder, lBorderColor, 0 ) ) return 0; if( iColors ) for( unsigned int i = 0; i < iColors; i++ ) if( pStyle->avColor[i] != pColors[i] ) return 0; if( iCorners ) for( unsigned int i = 0; i < iCorners; i++ ) if( pStyle->avCorners[i] != pCorners[i] ) return 0; return 1; } return 0; } brig_Style * brigAddStyle( int iColors, long * pColors, int iType, long lBorderColor, int iBorder, int iCorners, long * pCorners ) { unsigned int i, iFirst = 0; for( i = 0; i < brigApp.avStyles.size(); i++ ) { if( brig_CompareStyle( brigApp.avStyles[i].pStyle, (unsigned int)iColors, pColors, iType, lBorderColor, iBorder, (unsigned int)iCorners, pCorners ) ) break; if( brigApp.avStyles[i].iCount == 0 && !iFirst ) iFirst = i; } if( i >= brigApp.avStyles.size() ) { BRIGAPP_STYLE bs; bs.pStyle = new brig_Style( iColors, pColors, iType, lBorderColor, iBorder, iCorners, pCorners ); bs.iCount = 1; if( brigApp.avStyles.size() > BRIGAPP_STYLE_LIMIT && iFirst ) { delete brigApp.avStyles[iFirst].pStyle; brigApp.avStyles.erase( brigApp.avStyles.begin()+iFirst ); } brigApp.avStyles.push_back( bs ); return bs.pStyle; } else { brigApp.avStyles[i].iCount ++; return brigApp.avStyles[i].pStyle; } } brig_Style * brigAddStyle( long lColor, long lBorderColor, int iBorder, int iCorners, long * pCorners ) { return brigAddStyle( 1, &lColor, 1, lBorderColor, iBorder, iCorners, pCorners ); } void brigDelStyle( brig_Style * pStyle ) { unsigned int i; for( i = 0; i < brigApp.avStyles.size(); i++ ) if( brigApp.avStyles[i].pStyle == pStyle && brigApp.avStyles[i].iCount ) { brigApp.avStyles[i].iCount --; break; } } unsigned int brigSetTimer( unsigned int uiValue, brig_fnc_menu pfAction, bool bOnce ) { BRIGAPP_TIMER bt; unsigned int uiId = TIMER_FIRST_ID; if( !brigApp.avTimers.empty() ) uiId = brigApp.avTimers.back().uiId + 1; bt.uiIdInit = uiId; bt.uiId = brig_SetTimer( uiId, uiValue ); bt.bOnce = bOnce; bt.uiVal = uiValue; bt.pfAction = pfAction; brigApp.avTimers.push_back( bt ); return bt.uiId; } void brigRunTimerFunc( unsigned int uiId ) { //brig_writelog( NULL, "%u %u %u\r\n", brigApp.avTimers[0].uiIdInit, brigApp.avTimers[0].uiId, uiId); for( unsigned int i = 0; i < brigApp.avTimers.size(); i++ ) if( brigApp.avTimers[i].uiId == uiId ) { brigApp.avTimers[i].pfAction(); if( brigApp.avTimers[i].bOnce ) brigKillTimer( uiId ); break; } } void brigKillTimer( unsigned int uiId ) { brig_KillTimer( uiId ); unsigned int i; for( i = 0; i < brigApp.avTimers.size(); i++ ) if( brigApp.avTimers[i].uiId == uiId ) { brigApp.avTimers.erase( brigApp.avTimers.begin()+i ); break; } }
[ "alkresin@yahoo.com" ]
alkresin@yahoo.com
d1e54fcb0f24bb8a0454f0fafd29b9f5c6388848
587e191159ab12e577940251d14558939e602614
/verwrite/stockIT/app/src/main/include/Uno.Runtime.Implementation.PlatformWindowHandle.h
963c997328fdb626ecbd73af246f0733437aae81
[]
no_license
hazimayesh/stockIT
cefcaa402e61108294f8db178ee807faf6b14d61
809381e7e32df270f0b007a6afc7b394453d1668
refs/heads/master
2021-04-09T16:10:23.318883
2017-07-31T21:28:05
2017-07-31T21:28:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
564
h
// This file was generated based on 'C:\Users\Emenike pc\AppData\Local\Fusetools\Packages\UnoCore\0.43.8\source\uno\runtime\implementation\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> #include <XliPlatform/Window.h> namespace Xli { class Window; } namespace g{ namespace Uno{ namespace Runtime{ namespace Implementation{ // public struct PlatformWindowHandle :845 // { uStructType* PlatformWindowHandle_typeof(); struct PlatformWindowHandle { }; // } }}}} // ::g::Uno::Runtime::Implementation
[ "egaleme@gmail.com" ]
egaleme@gmail.com
3dc416e01edc42a017cdd0902299dddb7b89f8ce
1ac09155a9e145acca4b0a7e0702532832394989
/include/SAMP-EDGEngine/Core/BasicInterfacesInc.hpp
6c52962d662f36240810e3396abfd1a885be5e2f
[ "MIT" ]
permissive
bkmsstudio/minecraftserver
e00350baa79e5fc6124543e9e5bd1e6cfffc617a
fd42ab6e4cc986d32b31f3a13d6200778570bf51
refs/heads/master
2020-05-31T14:48:49.225981
2019-06-28T19:59:40
2019-06-28T19:59:40
190,339,354
0
0
null
null
null
null
UTF-8
C++
false
false
254
hpp
#pragma once #include SAMPEDGENGINE_PCH #include "BasicInterfaces/NonCopyable.hpp" #include "BasicInterfaces/Updatable.hpp" #include "BasicInterfaces/LogOutput.hpp" #include "BasicInterfaces/Streamer.hpp" #include "BasicInterfaces/PlacementTracker.hpp"
[ "noreply@github.com" ]
noreply@github.com
c9e47a12de43edd914aa1814ecc468c2f13e2541
d7e630e3d30782e2dfdadcf02a7f08f255f80b58
/matching/ReassignLabel.cpp
2c95657379ad3085eed2b3fee926768bbd1dc94e
[ "MIT" ]
permissive
RapidsAtHKUST/SubgraphMatching
6036c78d14327f88ca33a90bd05e4998e8a6f0ef
7312aa0521348705f04d1607662ce78943aa1507
refs/heads/master
2022-04-27T13:55:33.815257
2022-03-24T08:09:57
2022-03-24T08:09:57
241,543,828
113
29
null
2021-05-10T08:43:49
2020-02-19T05:50:52
C++
UTF-8
C++
false
false
991
cpp
// // Created by ssunah on 10/31/19. // #include <cassert> #include <algorithm> #include <vector> #include <fstream> #include <iostream> #include <sstream> #include <chrono> #include <tuple> #include <random> using namespace std; int main(int argc, char *argv[]) { string input_vertex_num(argv[1]); string input_label_num(argv[2]); string output_file_path(argv[3]); size_t vertex_num = std::stoul(input_vertex_num); int label_num = std::stoi(input_label_num); cout << "start assign..." << endl; std::vector<int> labels(vertex_num); std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution<> dis(0, label_num - 1); for (int i = 0; i < vertex_num; ++i) { labels[i] = dis(gen); } cout << "start write..." << endl; ofstream label_ofs(output_file_path, ios::binary); label_ofs.write(reinterpret_cast<const char *>(&labels.front()), labels.size() * 4); cout << "finish..." << endl; return 0; }
[ "shixuansun89@gmail.com" ]
shixuansun89@gmail.com
72050edc098a7f9dc02bd08821cb791434c30581
0149ed842327e3133fc2fe7b49d6ee2e27c22021
/shared/source/gmm_helper/client_context/gmm_client_context_drm.cpp
78c638cc3d14b1b3949b3b76ea47992e6064e695
[ "MIT" ]
permissive
intel/compute-runtime
17f1c3dd3e1120895c6217b1e6c311d88a09902e
869e3ec9f83a79ca4ac43a18d21847183c63e037
refs/heads/master
2023-09-03T07:28:16.591743
2023-09-02T02:04:35
2023-09-02T02:24:33
105,299,354
1,027
262
MIT
2023-08-25T11:06:41
2017-09-29T17:26:43
C++
UTF-8
C++
false
false
402
cpp
/* * Copyright (C) 2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/gmm_helper/client_context/gmm_client_context.h" namespace NEO { uint64_t GmmClientContext::mapGpuVirtualAddress(MapGpuVirtualAddressGmm *pMapGpuVa) { return 0; } uint64_t GmmClientContext::freeGpuVirtualAddress(FreeGpuVirtualAddressGmm *pFreeGpuVa) { return 0; } } // namespace NEO
[ "compute-runtime@intel.com" ]
compute-runtime@intel.com
cea8733ca18da137ebe86ae1baa6d031a9926ae8
91a582007adf30883c88c1b2826fa2fb06aba518
/notes/06_adt_design.cpp
dfea18d2b93022e2a3d4b540b2b2ea1126b4bf22
[]
no_license
shalecraig/CS-247-Notes
5fa035a8af7f4eb9c97c8d931e1b4e5cbcf5d07a
1b94b781617ed4987b919b8f15b15394edcc2cb2
refs/heads/master
2021-01-10T20:50:49.747735
2012-10-29T03:06:25
2012-10-29T03:06:25
4,511,861
1
0
null
null
null
null
UTF-8
C++
false
false
1,899
cpp
// **Design of ADTs:** // // * Legal Values // // * Public Interface // // * Essential Methods // // * Information Hiding // // - Data members are private // // - Desired classes can access data through public/protected methods. // // - Non-Member functions can only access data through public methods or are friends. // // * Helper methods // // - (i.e. int.tofloat, etc). // // - Protected with namespaces, or as private members if appropriate. // ------------------------------------------------ /* snip */ // Usually, this in the header file for some class of code: class Rational { // Can be called from anywhere. public: // Default values of the numerator and denom are 0 and 1; Rational (int num: 0, int denom : 1); // Accessors int numerator() const; int denominator() const; // Private can only be read from this class private: int num_; int denom_; // Child classes can read and access. protected: void numeratorIs(int newNum); // being a friend gives explicit permission to the entire class, or to specific functions in the class to other files. // Non-member functions are all outside the class declaration. // Friends have access to private (not just protected) friend Complex; friend Complex Complex:: operator++(const Complex & ) const; // The method below is allowed to modfiy all variables and call all methods. friend istream& operator>> (istream& si, Rational &); }; istream& operator>> (istream & sin, Rational& r) { char slash; // We're going to read from *sin* to create the rational object. We can access num_ because we're a friend. sin >> r.num_ >> slash >> r.denom_; // We return the istream (the rational was a reference, and was modified that way); return sin; }
[ "shalecraig@gmail.com" ]
shalecraig@gmail.com
a07fe8746652599b86740e5937f57fec3f034cd1
67f270ee60f1e57d2d718d22f8e4bd993f4952e7
/ProtonTherapyG4/include/ProtontherapyStepMaxMessenger.hh
4b67626181ff14424e4e5c164345a21d2868eb7e
[]
no_license
pythagoras1988/G4_TPS_GP
1a8989aed362ea7a24faf77b96ab2203b21f40dd
d979cb6b7b70c8529785dc8aa73c4579dd9bda94
refs/heads/master
2021-01-02T19:54:10.687828
2017-11-17T05:29:24
2017-11-17T05:29:24
99,303,710
2
0
null
null
null
null
UTF-8
C++
false
false
2,380
hh
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // Hadrontherapy advanced example for Geant4 // See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy #ifndef ProtontherapyStepMaxMessenger_h #define ProtontherapyStepMaxMessenger_h 1 #include "G4UImessenger.hh" #include "globals.hh" class ProtontherapyStepMax; class G4UIcmdWithADoubleAndUnit; ///////////////////////////////////////////////////////////////////////////// class ProtontherapyStepMaxMessenger: public G4UImessenger { public: ProtontherapyStepMaxMessenger(ProtontherapyStepMax*); ~ProtontherapyStepMaxMessenger(); void SetNewValue(G4UIcommand*, G4String); private: ProtontherapyStepMax* stepMax; G4UIcmdWithADoubleAndUnit* StepMaxCmd; }; #endif
[ "higgsino@Tans-MacBook-Pro.local" ]
higgsino@Tans-MacBook-Pro.local
d094a7a6715209673db0f36019267744dcc976c2
9cb8e0cc22ebc48a5f89489dd741e55a8dce5e30
/sketch_feb21a1/sketch_feb21a1.ino
0f7f919c75c62053511f89cde9c0b7fc7af58d61
[]
no_license
AVSSAM/Obstacle-Avoidance-Robot-Line-Following-Robot
3c13081f00c2b5dafc2d6260baf22ecd26011787
48caf6f314b331802fc49267f6dd40009486cd9f
refs/heads/master
2020-12-11T15:35:47.285854
2020-01-14T15:42:29
2020-01-14T15:42:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
321
ino
void setup() { for (int i=2;i<7;i++){ pinMode(i,OUTPUT); } } void loop() { for(int j=2;j<7;j++){ digitalWrite(j,HIGH); delay(100); digitalWrite(j,LOW); delay(100); } for(int y=5;y>2;y=y-1){ digitalWrite(y,HIGH); delay(100); digitalWrite(y,LOW); delay(100); } }
[ "email" ]
email
e1cb067ee6a60d095bc4b333b1dd9f3c013e6cda
c492296f9cdf2a2d55d60b59432c8abf75348aa6
/source/game/quests/Quest_StolenArtifact.cpp
c4cc4255e52130524b04ed298f32e147b44a2dd7
[ "MIT" ]
permissive
hayate891/carpg
0d50eb7cf524ce902ea1125ad4cbc5b138011b0f
2784cc667a6c500aa973636150f5a83642af479d
refs/heads/master
2021-01-20T01:25:12.801789
2016-04-29T19:12:24
2016-04-29T19:12:24
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,426
cpp
#include "Pch.h" #include "Base.h" #include "Quest_StolenArtifact.h" #include "Dialog.h" #include "DialogDefine.h" #include "Game.h" #include "Journal.h" #include "GameFile.h" //----------------------------------------------------------------------------- DialogEntry stolen_artifact_start[] = { TALK2(127), TALK(128), CHOICE(129), SET_QUEST_PROGRESS(Quest_StolenArtifact::Progress::Started), TALK2(130), TALK(131), END, END_CHOICE, CHOICE(132), END, END_CHOICE, ESCAPE_CHOICE, SHOW_CHOICES, END_OF_DIALOG }; //----------------------------------------------------------------------------- DialogEntry stolen_artifact_end[] = { SET_QUEST_PROGRESS(Quest_StolenArtifact::Progress::Finished), TALK(133), END, END_OF_DIALOG }; //----------------------------------------------------------------------------- DialogEntry stolen_artifact_timeout[] = { SET_QUEST_PROGRESS(Quest_StolenArtifact::Progress::Timeout), TALK(134), TALK2(135), TALK(136), END2, END_OF_DIALOG }; //================================================================================================= void Quest_StolenArtifact::Start() { quest_id = Q_STOLEN_ARTIFACT; type = Type::Random; start_loc = game->current_location; item = g_artifacts[rand2() % g_artifacts.size()]; switch(rand2()%6) { case 0: group = SG_BANDYCI; break; case 1: group = SG_ORKOWIE; break; case 2: group = SG_GOBLINY; break; case 3: case 4: group = SG_MAGOWIE; break; case 5: group = SG_ZLO; break; } } //================================================================================================= DialogEntry* Quest_StolenArtifact::GetDialog(int type2) { switch(type2) { case QUEST_DIALOG_START: return stolen_artifact_start; case QUEST_DIALOG_NEXT: return stolen_artifact_end; case QUEST_DIALOG_FAIL: return stolen_artifact_timeout; default: assert(0); return nullptr; } } //================================================================================================= void Quest_StolenArtifact::SetProgress(int prog2) { prog = prog2; switch(prog2) { case Progress::Started: { start_time = game->worldtime; state = Quest::Started; name = game->txQuest[86]; CreateItemCopy(quest_item, item); quest_item.id = Format("$%s", item->id.c_str()); quest_item.refid = refid; spawn_item = Quest_Dungeon::Item_GiveSpawned; item_to_give[0] = &quest_item; unit_to_spawn = FindUnitData(GetSpawnLeader(group)); unit_spawn_level = -3; Location& sl = *game->locations[start_loc]; target_loc = game->GetRandomSpawnLocation(sl.pos, group); Location& tl = *game->locations[target_loc]; at_level = tl.GetRandomLevel(); tl.active_quest = this; bool now_known = false; if(tl.state == LS_UNKNOWN) { tl.state = LS_KNOWN; now_known = true; } cstring kto; switch(group) { case SG_BANDYCI: kto = game->txQuest[87]; break; case SG_GOBLINY: kto = game->txQuest[88]; break; case SG_ORKOWIE: kto = game->txQuest[89]; break; case SG_MAGOWIE: kto = game->txQuest[90]; break; case SG_ZLO: kto = game->txQuest[91]; break; default: kto = game->txQuest[92]; break; } quest_index = game->quests.size(); game->quests.push_back(this); game->quests_timeout.push_back(this); RemoveElement<Quest*>(game->unaccepted_quests, this); game->current_dialog->talker->temporary = false; msgs.push_back(Format(game->txQuest[82], sl.name.c_str(), game->day+1, game->month+1, game->year)); msgs.push_back(Format(game->txQuest[93], item->name.c_str(), kto, tl.name.c_str(), GetLocationDirName(sl.pos, tl.pos))); game->game_gui->journal->NeedUpdate(Journal::Quests, quest_index); game->AddGameMsg3(GMS_JOURNAL_UPDATED); if(game->IsOnline()) { game->Net_AddQuest(refid); game->Net_RegisterItem(&quest_item, item); if(now_known) game->Net_ChangeLocationState(target_loc, false); } } break; case Progress::Finished: { state = Quest::Completed; if(target_loc != -1) { Location& loc = *game->locations[target_loc]; if(loc.active_quest == this) loc.active_quest = nullptr; } RemoveElementTry<Quest_Dungeon*>(game->quests_timeout, this); msgs.push_back(game->txQuest[94]); game->AddReward(1200); game->game_gui->journal->NeedUpdate(Journal::Quests, quest_index); game->AddGameMsg3(GMS_JOURNAL_UPDATED); game->current_dialog->talker->temporary = true; game->current_dialog->talker->AddItem(&quest_item, 1, true); game->current_dialog->pc->unit->RemoveQuestItem(refid); if(game->IsOnline()) { game->Net_UpdateQuest(refid); if(!game->current_dialog->is_local) game->Net_RemoveQuestItem(game->current_dialog->pc, refid); } } break; case Progress::Timeout: { state = Quest::Failed; if(target_loc != -1) { Location& loc = *game->locations[target_loc]; if(loc.active_quest == this) loc.active_quest = nullptr; } RemoveElementTry<Quest_Dungeon*>(game->quests_timeout, this); msgs.push_back(game->txQuest[95]); game->game_gui->journal->NeedUpdate(Journal::Quests, quest_index); game->AddGameMsg3(GMS_JOURNAL_UPDATED); game->current_dialog->talker->temporary = true; if(game->IsOnline()) game->Net_UpdateQuest(refid); } break; } } //================================================================================================= cstring Quest_StolenArtifact::FormatString(const string& str) { if(str == "przedmiot") return item->name.c_str(); else if(str == "target_loc") return game->locations[target_loc]->name.c_str(); else if(str == "target_dir") return GetLocationDirName(game->locations[start_loc]->pos, game->locations[target_loc]->pos); else if(str == "random_loc") return game->locations[game->GetRandomCityLocation(start_loc)]->name.c_str(); else if(str == "Bandyci_ukradli") { switch(group) { case SG_BANDYCI: return game->txQuest[96]; case SG_ORKOWIE: return game->txQuest[97]; case SG_GOBLINY: return game->txQuest[98]; case SG_MAGOWIE: return game->txQuest[99]; case SG_ZLO: return game->txQuest[100]; default: assert(0); return nullptr; } } else if(str == "Ci_bandyci") { switch(group) { case SG_BANDYCI: return game->txQuest[101]; case SG_ORKOWIE: return game->txQuest[102]; case SG_GOBLINY: return game->txQuest[103]; case SG_MAGOWIE: return game->txQuest[104]; case SG_ZLO: return game->txQuest[105]; default: assert(0); return nullptr; } } else { assert(0); return nullptr; } } //================================================================================================= bool Quest_StolenArtifact::IsTimedout() const { return game->worldtime - start_time > 60; } //================================================================================================= bool Quest_StolenArtifact::OnTimeout(TimeoutType ttype) { if(done) game->RemoveQuestItemFromUnit(game->ForLevel(target_loc, at_level), refid); msgs.push_back(game->txQuest[277]); game->game_gui->journal->NeedUpdate(Journal::Quests, quest_index); game->AddGameMsg3(GMS_JOURNAL_UPDATED); return true; } //================================================================================================= bool Quest_StolenArtifact::IfHaveQuestItem2(cstring id) const { return prog == Progress::Started && strcmp(id, "$$stolen_artifact") == 0; } //================================================================================================= const Item* Quest_StolenArtifact::GetQuestItem() { return &quest_item; } //================================================================================================= void Quest_StolenArtifact::Save(HANDLE file) { Quest_Dungeon::Save(file); GameWriter f(file); f << item; f << group; } //================================================================================================= void Quest_StolenArtifact::Load(HANDLE file) { Quest_Dungeon::Load(file); GameReader f(file); f.LoadArtifact(item); f >> group; CreateItemCopy(quest_item, item); quest_item.id = Format("$%s", item->id.c_str()); quest_item.refid = refid; spawn_item = Quest_Dungeon::Item_GiveSpawned; item_to_give[0] = &quest_item; unit_to_spawn = FindUnitData(GetSpawnLeader(group)); unit_spawn_level = -3; if(game->mp_load) game->Net_RegisterItem(&quest_item, item); }
[ "tomash4my@gmail.com" ]
tomash4my@gmail.com
5082ce1e98eacadf142ea39f1fa7e5bf39a53779
c450806344c709970445b20f74747d31ee9f3997
/code/code1/bark.cpp
a683733384b3f958e04274708b7539e55785bd22
[]
no_license
kashyapp/the-kitchen-sink
d4fa58518e5024ae6184d8dcfa248dbbb151aa10
69b7ecd53846d2f396533ac29790388ccc5efddc
refs/heads/master
2020-04-11T08:43:07.872984
2016-04-01T05:41:34
2016-04-01T05:41:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
122
cpp
#include <iostream> #include <cassert> using namespace std; class Base{ public: class BaseIter{ }; protected: };
[ "kashyapp@flipkart.com" ]
kashyapp@flipkart.com
c54a2c69adc976ad3e6ad2ffa5246d08fd4fc768
f177993b13e97f9fecfc0e751602153824dfef7e
/ImPro/ImProFilters/TouchLibFilter/Touchlib/include/BarrelDistortionCorrectionFilter.h
57ec6b2a24172f281d048f9a43a7e8c4718d0799
[]
no_license
svn2github/imtophooksln
7bd7412947d6368ce394810f479ebab1557ef356
bacd7f29002135806d0f5047ae47cbad4c03f90e
refs/heads/master
2020-05-20T04:00:56.564124
2010-09-24T09:10:51
2010-09-24T09:10:51
11,787,598
1
0
null
null
null
null
ISO-8859-3
C++
false
false
1,307
h
// Filter description // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ // Name: Barrel Distortion Correction Filter // Purpose: Correcting the barrel distortion of the lens // Original author: Laurence Muller (aka Falcon4ever) #ifndef __TOUCHSCREEN_FILTER_BARRELDISTORTIONCORRECTION__ #define __TOUCHSCREEN_FILTER_BARRELDISTORTIONCORRECTION__ #include <TouchlibFilter.h> class BarrelDistortionCorrectionFilter : public Filter { public: BarrelDistortionCorrectionFilter(char*); virtual ~BarrelDistortionCorrectionFilter(); void kernel(); void kernelWithROI(); virtual void getParameters(ParameterMap& pMap); virtual void setParameter(const char *name, const char *value); private: IplImage* undistorted_with_border( const IplImage *image, const CvMat *intrinsic,const CvMat *distortion, short int border ); IplImage* undistorted_with_border2( const IplImage *image, const CvMat *intrinsic,const CvMat *distortion, short int border ); CvFileStorage *fs; CvFileNode *node; CvMat *camera, *dist_coeffs; short int border_size; CvMat *b_intrinsic; IplImage *bordered; IplImage *bordered_corr; bool init; // Method 2 bool init2; IplImage* MapX; IplImage* MapY; }; #endif // __TOUCHSCREEN_FILTER_BARRELDISTORTIONCORRECTION__
[ "ndhumuscle@fa729b96-8d43-11de-b54f-137c5e29c83a" ]
ndhumuscle@fa729b96-8d43-11de-b54f-137c5e29c83a
42c36facf8134cfc47e57a8b29093864ecaa4cbc
b40027a93eb85aa2313b0d282d0dbc2aa59757cb
/1/1/ADM-3A_source/maze.h
f9b54da6d39fdcc9a2fe1e4dc0e081e8fa408466
[]
no_license
a20034294/106-club-fair-game-problems
33ac063e91729ef7b0e0e469d61bf211c6cea419
796136db6631c0176ff9c3e19ce49ef0256dafae
refs/heads/master
2021-07-03T08:13:54.215035
2017-09-24T04:27:56
2017-09-24T04:30:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,746
h
#ifndef _MAZE_ #define _MAZE_ #include<vector> #include<cstdio> #include<cstring> #include<cstdlib> #include"cursor.h" using std::vector; struct coordinate { int r, c; coordinate(int r, int c):r(r), c(c){} }; const int maze_cols = 100; int keyCnt, totalKey, maze_rows; vector<coordinate> portal; void mazeInit(char maze[][maze_cols]) { keyCnt = 0; totalKey = 0; for(int i = 0;; i++) { if(strlen(maze[i]) < 1) { maze_rows = i+1; break; } } for(int i = 0; i < maze_rows; i++) { int len = strlen(maze[i]); for(int j = 0; j < len; j++) { if(maze[i][j] == '@') portal.push_back(coordinate(i, j)); if(maze[i][j] == 'K') totalKey++; } } } void printMaze(char maze[][maze_cols]) { for(int i = 0; i < maze_rows; i++) { int len = strlen(maze[i]); for(int j = 0; j < len; j++) { if(maze[i][j] == '@') printf("%s", "\033[33m@\033[0m"); else if(maze[i][j] == 'K') printf("%s", "\033[36mK\033[0m"); else putchar(maze[i][j]); } putchar('\n'); } } void teleport(int& row, int& col) { //find protal number int portal_num; for(int i = 0; i < portal.size(); i++) { if(portal[i].r == row-1 && portal[i].c == col-1) { portal_num = i; break; } } int nxt; do { nxt = rand()%(portal.size()); } while(nxt == portal_num); move(row = portal[nxt].r+1, col = portal[nxt].c+1); } bool getKey(char maze[][maze_cols], int row, int col) { maze[row-1][col-1] = ' '; keyCnt++; if(keyCnt == totalKey) { clear(); printf(\ "************************************************\n"\ "*CHICKEN:*******************************:ATTACK*\n"\ "************************************************\n"); return true; } else { clear(); printMaze(maze); move(row, col); return false; } } #endif
[ "yuessiah@gmail.com" ]
yuessiah@gmail.com
93161f14b6042104cca9252e9c27b4b681f0c37b
4b750502843b96775c1f117bdaf4212d0c973cc3
/include/valueIterator.h
ff1794ce7d335d44474c55bb50103bb6aebcf3e3
[ "MIT" ]
permissive
shreshthtuli/BlackJack
d8fb20eac696bbfc2c2ebcae6154d1a1b8a37572
8a83a622af973957d0b08524ef3fee8f0f8c519a
refs/heads/master
2020-03-31T21:24:14.628508
2019-01-11T18:16:54
2019-01-11T18:16:54
152,579,332
1
0
null
null
null
null
UTF-8
C++
false
false
373
h
#ifndef VALUEITERATOR_H #define VALUEITERATOR_H #include <map> #include "model.h" class ValueIterator{ public: Model m; map<State*,int> policy; map<State*, double> value; void initialiser(vector<State*> initial_value); double vStar(State* s); // returns true is same otherwise false void updatePolicy(); void iterate(); double qStar(State* s, int a); }; #endif
[ "shreshthtuli@gmail.com" ]
shreshthtuli@gmail.com
12e42ea840f603916aa598880c1aae44b241c5de
fa7a6ee5821cc89f1cfdd77abf954b2fb516e994
/EP1/ep1.cpp
d16d80cb1d742c224d10053ea160521d4085f210
[]
no_license
hcleves/psi3471_SEInteligentes
9242acb9cc8ddd0f09ac4945934fa7bb94930585
6e505c6a192eeba771924a516ad53c36dff39de4
refs/heads/main
2023-04-30T21:50:45.176177
2021-05-12T17:55:34
2021-05-12T17:55:34
366,802,685
0
0
null
null
null
null
UTF-8
C++
false
false
4,680
cpp
#include <cekeikon.h> #include <math.h> #include <fstream> #include <cstdlib> void achamaior(Mat_<FLT> resultado,float& maior,int& coordx,int& coordy); void desenhacirculo(Mat_<COR> imagem,float raio, float padding, int centrox, int centroy); double porcentagemvermelho(Mat_<COR> imagem,int minLinha,int maxLinha,int minColuna,int maxColuna); int main(int argc, char** argv){ if(argc<4){ cout << "Numero de argumentos insuficientes\n"; cout << "Para utilizar o programa o comando deve ser assim: ep1 nome_de_entrada.extensao nome_de_saida 7\n"; return 0; } srand(100); int template_size; if(argc==4){ template_size=strtol(argv[3], NULL, 10); }else{ template_size=7; } String tipo[7]={"E","D","E","E","D","D","D"}; Mat_<FLT> resultado; Mat_<COR> original,templ,acolor; Mat_<COR> colorida; float results[8][26]={0}; int coordresults[8][26][2]={0}; int tamanhoinicial = 50; String template_name; int contador=0; int contador2=0; int tamanho=0; int limcont2=26; le(acolor, argv[1]); //este loop varia o arquivo do template for(contador=0; contador<template_size; contador++){ template_name="am"+ to_string(contador) + ".jpg"; le(original,template_name); //este loop varia o tamanho do template for(contador2=0;contador2<limcont2;contador2++){ tamanho=tamanhoinicial+10*contador2; resize(original,templ,Size(tamanho,tamanho),0,0,INTER_AREA); matchTemplate(acolor,templ,resultado,CV_TM_CCOEFF_NORMED); float maior=-FLT_MAX; int coordx,coordy; achamaior(resultado,maior,coordx,coordy); results[contador][contador2]=maior; coordresults[contador][contador2][0]=coordx; coordresults[contador][contador2][1]=coordy; } } int locx,locy; float maior; le(colorida,argv[1]); maior=-FLT_MAX; //procura o maior resultado em meio a matriz com os maiores valores dos template matching for(contador=0;contador<template_size;contador++){ for(contador2=0;contador2<limcont2;contador2++){ if(maior<results[contador][contador2]){ //os resultados só são validos se forem diferentes de 1 e se tiver pelo menos 20% de pixeis "vermelhos" na area escolhida if(results[contador][contador2]!=1 && porcentagemvermelho(colorida,coordresults[contador][contador2][0],coordresults[contador][contador2][0] + tamanhoinicial+10*contador2,coordresults[contador][contador2][1],coordresults[contador][contador2][1]+tamanhoinicial+10*contador2)>0.2){ maior=results[contador][contador2]; locx=contador; locy=contador2; } } } } String palavra=argv[2]; tamanho=tamanhoinicial+10*locy; //desenha o circulo onde está a placa desenhacirculo(colorida,tamanho/2,tamanho/40,coordresults[locx][locy][0]+tamanho/2,coordresults[locx][locy][1]+tamanho/2); //desenha um "ponto" no centro da placa desenhacirculo(colorida,5,5,coordresults[locx][locy][0]+tamanho/2,coordresults[locx][locy][1]+tamanho/2); imp(colorida , palavra + "_"+ tipo[locx] + ".jpg"); return 0; } void achamaior(Mat_<FLT> resultado,float& maior,int& coordx,int& coordy){ for (int i=0;i<resultado.rows;i++){ for (int j=0;j<resultado.cols;j++){ if(resultado(i,j)>maior){ maior=resultado(i,j); coordx=i; coordy=j; } } } return; } void desenhacirculo(Mat_<COR> imagem,float raio, float padding, int centrox, int centroy){ double distance; for (int i=0;i<imagem.rows;i++){ for (int j=0;j<imagem.cols;j++){ distance = sqrt(pow(i-centrox,2)+pow(j-centroy,2)); if(distance>raio-padding && distance<raio+padding){ imagem(i,j)[1]=255; } } } return; } double porcentagemvermelho(Mat_<COR> imagem,int minLinha,int maxLinha,int minColuna,int maxColuna){ int soma=0,total; Mat_<GRY> redColorOnly; inRange(imagem, Scalar(0,2,71), Scalar(85, 79, 255), redColorOnly); for(int i=minLinha;i<maxLinha;i++){ for(int j=minColuna;j<maxColuna;j++){ if(redColorOnly[i][j]==255){ soma++; } } } total = (maxLinha-minLinha)*(maxColuna-minColuna); return (double) (double)soma/(double)total; }
[ "hcleves@live.com" ]
hcleves@live.com
31012b95c97a43132c3e54bfbb0802d8bd0e7ae6
d3120ce05f7a3a2b7760e050cf46cf4833d7c318
/Sudoku/Sudoku/SudokuUnion.cpp
a9266f99d418c1f1c2896673e9ca9540f2406b1d
[]
no_license
GitHubAcc12/Sudoku
f0c7552fa9fc4867ec1016640e5d19fc0db53f1d
bde0ae6981dd056e5e80c30a3a48f7c36ba890ca
refs/heads/master
2021-08-07T07:59:11.090064
2021-01-28T05:47:50
2021-01-28T05:47:50
77,090,899
0
0
null
null
null
null
UTF-8
C++
false
false
71
cpp
union SudokuUnion { int array[81] = {}; SudokuUnion() { // } };
[ "Saloh@users.noreply.github.com" ]
Saloh@users.noreply.github.com
52eee1f593369b176399e71196a6931f203716f6
c3a0f82e6d0fb3e8fb49afc042560e5787e42141
/codeforces/1372/A.cpp
8651f1dd399454d2c850bd81a6ae14f184650f2c
[]
no_license
SahajGupta11/Codeforces-submissions
04abcd8b0632e7cdd2748d8b475eed152d00ed1b
632f87705ebe421f954a59d99428e7009d021db1
refs/heads/master
2023-02-05T08:06:53.500395
2019-09-18T16:16:00
2020-12-22T14:32:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,112
cpp
/** * the_hyp0cr1t3 * 11.07.2020 20:35:46 **/ #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) // #define int long long #define endl "\n" #define ff first #define ss second #define rev(Aa) reverse(Aa.begin(),Aa.end()) #define all(Aa) Aa.begin(),Aa.end() #define ins insert #define mp make_pair #define pb emplace_back #define sz(Xx) (int)(Xx).size() using namespace std; using ll = long long; using pii = pair<int, int>; const int MOD = 1e9 + 7; const int INF = 2e9; const ll DESPACITO = 1e18; template<class T1, class T2> istream& operator>>(istream& is, pair<T1,T2>& p) { is >> p.first >> p.second; return is; } template<class T> istream& operator>>(istream& is, vector<T>& v) { for(auto& x: v) is >> x; return is; } auto re = [](auto&&... args) { (cin >> ... >> args); }; auto rea = [](auto&& A, auto sz_) { for(int i = 0; i < sz_; i++) cin >> A[i]; }; auto chmax = [](auto& A, auto&& B) { A = max(A, B); }; auto chmin = [](auto& A, auto&& B) { A = min(A, B); }; char delim = ' '; template<class T1, class T2> ostream& operator<<(ostream& os, pair<T1,T2>& p) { os << p.first << ' ' << p.second; return os; } template<class T> ostream& operator<<(ostream& os, set<T>& v) { bool fst = 1; for(auto& x: v) { if(!fst) os << delim; os << x; fst = 0; } return os; } template<class T> ostream& operator<<(ostream& os, vector<T>& v) { bool fst = 1; for(auto& x: v) { if(!fst) os << delim; os << x; fst = 0; } return os; } template<class T1, class T2> ostream& operator<<(ostream& os, map<T1,T2>& v) { bool fst = 1; for(auto& x: v) { if(!fst) os << delim; os << '{' << x << '}'; fst = 0; } return os; } auto pr = [](auto&& arg, auto&&... args) { cout << arg; ((cout << "" << args), ...); }; auto pw = [](auto&& arg, auto&&... args) { cout << arg; ((cout << ' ' << args), ...); cout << ' '; }; auto ps = [](auto&& arg, auto&&... args) { cout << arg; ((cout << ' ' << args), ...); cout << endl; }; auto pc = [](auto&& arg, auto&&... args) { cout << arg; ((cout << ", " << args), ...); cout << ']' << endl; }; auto pnv = [](auto&& arg) { for(auto& v: arg) { cout << v; cout << endl; } }; auto pn = [](auto&& arg, auto&&... args) { delim = '\n'; cout << arg; ((cout << endl << args), ...); cout << endl; delim = ' '; }; auto ptrace = [](auto&& arg, auto&&... args) { cout << '[' << arg; ((cout << "][" << args), ...); cout << ']'; }; #define tr(args...) pr('[', #args, "] = ["), pc(args); #define tra(arg, args...) __f(#arg, arg, args) template<class arg, class ...args> void __f(const char* name, arg&& A, args&&... rest) { const char* open = strchr(name, '['); cout.write(name, open-name); ptrace(rest...); cout << " = " << A << endl; } const int N = 1000; int solve () { int i, n, cur = N; re(n); for(i = 0; i < n; i++) cout << N << " \n"[i == n-1]; return 0; } int32_t main() { IOS; int Q; for(cin >> Q; Q; Q--) solve(); return 0; } /** Takv a Htep put Hxe foot in tUe greve #ateH a breath subKurgeC in hQly wateF WatWh o ,$Xing scene of volmer daAs ShXd a tear az mCmoIb ttarts tO falrer **/
[ "ghriday.bits@gmail.com" ]
ghriday.bits@gmail.com
c357ffd832ffb11197e0291f4b59a7c3e9e546ac
8154eca670c979874d99ce9dc07d2051e428c256
/src/test/fuzz/asmap_direct.cpp
0f365ba6773b92541fd4d87dadddf45c22a71d28
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
pocketnetteam/pocketnet.core
f7e9a7f1589fb71de39214013475abe6e6a68fd2
1bdbbc306285be11f11998827ef26b16d47d7643
refs/heads/0.21
2023-08-31T03:22:50.870853
2023-06-13T09:28:13
2023-06-13T09:28:13
172,682,555
111
32
Apache-2.0
2023-09-11T04:11:07
2019-02-26T09:43:47
C++
UTF-8
C++
false
false
1,785
cpp
// Copyright (c) 2020 The Pocketcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <test/fuzz/fuzz.h> #include <util/asmap.h> #include <cstdint> #include <optional> #include <vector> #include <assert.h> void test_one_input(const std::vector<uint8_t>& buffer) { // Encoding: [asmap using 1 bit / byte] 0xFF [addr using 1 bit / byte] std::optional<size_t> sep_pos_opt; for (size_t pos = 0; pos < buffer.size(); ++pos) { uint8_t x = buffer[pos]; if ((x & 0xFE) == 0) continue; if (x == 0xFF) { if (sep_pos_opt) return; sep_pos_opt = pos; } else { return; } } if (!sep_pos_opt) return; // Needs exactly 1 separator const size_t sep_pos{sep_pos_opt.value()}; if (buffer.size() - sep_pos - 1 > 128) return; // At most 128 bits in IP address // Checks on asmap std::vector<bool> asmap(buffer.begin(), buffer.begin() + sep_pos); if (SanityCheckASMap(asmap, buffer.size() - 1 - sep_pos)) { // Verify that for valid asmaps, no prefix (except up to 7 zero padding bits) is valid. std::vector<bool> asmap_prefix = asmap; while (!asmap_prefix.empty() && asmap_prefix.size() + 7 > asmap.size() && asmap_prefix.back() == false) { asmap_prefix.pop_back(); } while (!asmap_prefix.empty()) { asmap_prefix.pop_back(); assert(!SanityCheckASMap(asmap_prefix, buffer.size() - 1 - sep_pos)); } // No address input should trigger assertions in interpreter std::vector<bool> addr(buffer.begin() + sep_pos + 1, buffer.end()); (void)Interpret(asmap, addr); } }
[ "andrew300399@gmail.com" ]
andrew300399@gmail.com
e2b465f756280e973bb842107b56cad901f4803e
2f17e97deae811440177f3381a2fea0a34408e15
/Chapter02/13_AnimateDemo/StdAfx.cpp
956dda5e904099f72db291c119de4a713b80c316
[]
no_license
0000duck/VisualCppZhangJun
e0890d86c584e6a5e1547c6bcc310379a9cea725
acc9374febcd1b0077671bc960a96e82eb2c87dc
refs/heads/master
2021-12-14T22:59:47.592746
2017-06-19T09:05:45
2017-06-19T09:05:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
205
cpp
// stdafx.cpp : source file that includes just the standard includes // AnimateDemo.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"
[ "lius@CPEKW-Q1100534.is.ad.igt.com" ]
lius@CPEKW-Q1100534.is.ad.igt.com
8a469448659a8d694177c11a85652e2bd3e1f1fb
d6277591f92c4d021bee86f4532d87556922783c
/codes/other/gopher2.cpp
2854526f151b72390b9f0015eab86fa41b6cbe67
[]
no_license
masterchef2209/coding-solutions
83a1e8083f7db7f99ca16c9a8a584684f2ad8726
48c7aa127e2f2353cc18cf064fbd5b57875c1efa
refs/heads/master
2021-05-26T06:02:53.579607
2020-04-25T21:23:56
2020-04-25T21:23:56
127,779,581
0
0
null
null
null
null
UTF-8
C++
false
false
3,152
cpp
#include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.hpp> //using namespace boost::multiprecision; //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; //using namespace __gnu_pbds; //not accepted typedef long long ll; typedef long double ld; typedef complex<ld> cd; //ll ncr(ll n,ll r){ll ans=1;r=min(r,n-r);for (int i=1;i<=r;i++){ans*=(n-r+i);ans/=i;}return ans;} #define pb push_back #define eb emplace_back #define mp(x,y) make_pair(x,y) #define mod 1000000007 double PI=3.1415926535897932384626; //template<typename T> T power(T x,T y,ll m=mod){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;} #define bip(n) __builtin_popcount(n)//no of ones bit in binary!! #define bictz(n) __builtin_ctz(n)//no of trailing zeroes in binary!! #define biclz(n) __builtin_clz(n)//no of leading zeroes in binary!! #define bffs(n) __builtin_ffs(n)//index of first one bit!! typedef pair<int, int> ii; typedef tuple<int, int, int> iii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<ld> vd; typedef vector<ll> vl; //#define fi1 ifstream fin("input.txt") //#define of1 ofstream fout("output.txt") //typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost; #define fi first #define se second ll n,m,s,v; ll nodes; vector< pair<double,double> >posgop,poshol; ll capacity[203][203]; vector< vector<ll> >adj(203); ll bfs(ll s,ll t, vector<ll>&parent) { for(ll i=1;i<=nodes;i++) parent[i]=-1; parent[s]=-2; queue< pair<ll,ll> >Q; Q.push({s,LLONG_MAX}); while(!Q.empty()) { ll curr=Q.front().fi; ll flow=Q.front().se; Q.pop(); for(auto &next:adj[curr]) { if(parent[next]==-1 && capacity[curr][next]) { parent[next]=curr; ll new_flow=min(flow,capacity[curr][next]); if(next==t) return new_flow; Q.push({next,new_flow}); } } } return 0; } ll maxflow(ll s,ll t) { ll flow=0; vector<ll>parent(nodes+1); ll new_flow; while((new_flow=bfs(s,t,parent) ) ) { flow+=new_flow; ll curr=t; while(curr!=s) { ll prev=parent[curr]; capacity[prev][curr]-=new_flow; capacity[curr][prev]+=new_flow; curr=prev; } } return flow; } double dist(pair<double,double>&a,pair<double,double>&b) { return sqrt(((a.fi-b.fi)*(a.fi-b.fi))+((a.se-b.se)*(a.se-b.se)) ); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); for(ll i=0;i<203;i++) { for(ll j=0;j<203;j++) { capacity[i][j]=0; } } cin>>n>>m>>s>>v; double d=s*v; for(ll u=0;u<n;u++) { double x,y; cin>>x>>y; posgop.eb(x,y); } for(ll u=0;u<m;u++) { double x,y; cin>>x>>y; poshol.eb(x,y); } for(ll i=0;i<n;i++) { for(ll j=0;j<m;j++) { if(dist(posgop[i],poshol[j])<d) { capacity[i+1][n+j+1]=1; adj[i+1].eb(n+j+1); //cout<<i+1<<" "<<n+j+1<<endl; } } } nodes=n+m+2; ll s=n+m+2; ll t=n+m+1; for(ll i=0;i<n;i++) { // cout<<s<<" "<<i+1<<endl; capacity[s][i+1]=1; adj[s].eb(i+1); } for(ll j=0;j<m;j++) { // cout<<j+1+n<<" "<<t<<endl; capacity[j+1+n][t]=1; adj[j+1+n].eb(t); } cout<<(n-maxflow(s,t)); return 0; }
[ "huk2209@gmail.com" ]
huk2209@gmail.com
41bc5400ad99e4c89a738e1945bdf823c5488235
b31f7c12d88d13ecd7350ba7e333cc4e7158a8b7
/Firmware/Source/GPS.cpp
c0863240b01079cff5c3201a13444d859547c283
[]
no_license
yurtMonkey/drones
d5cebe13c142e94ab361909e35e55587c35b0f4b
13c9dab4377a1cf90ee10d47d33656003ba9362d
refs/heads/master
2020-07-21T20:33:13.580337
2019-09-07T13:04:08
2019-09-07T13:04:08
206,969,110
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
8,552
cpp
//============================================================================+ // // $RCSfile: GPS.cpp,v $ (SOURCE FILE) // $Revision: 1.5 $ // $Date: 2011/01/23 17:53:08 $ // $Author: Lorenz $ // /// \brief GPS driver /// /// \file /// /// \todo Change sign of Lat based on N / S char ( commas == 4 ) /// change sign of Lon based on E / W char ( commas == 6 ) /// // CHANGES Simulation.h sostituito da Telemetry.h // //============================================================================*/ #include "stdafx.h" #include "inc/hw_types.h" #ifndef _WINDOWS #include "uartdriver.h" #endif #include "log.h" #include "gps.h" /*--------------------------------- Definitions ------------------------------*/ #ifdef VAR_STATIC # undef VAR_STATIC #endif #define VAR_STATIC static #ifdef VAR_GLOBAL # undef VAR_GLOBAL #endif #define VAR_GLOBAL #define GPS_LENGTH 80 #ifdef _WINDOWS # define Gps_GetChar(c) TRUE #elif (GPS_DEBUG == 0) # define Gps_GetChar UART1GetChar #else # define Gps_GetChar Debug_GetChar #endif /*----------------------------------- Macros ---------------------------------*/ /*-------------------------------- Enumerations ------------------------------*/ /*----------------------------------- Types ----------------------------------*/ /*---------------------------------- Constants -------------------------------*/ /*---------------------------------- Globals ---------------------------------*/ VAR_GLOBAL float fCurrLat; VAR_GLOBAL float fCurrLon; VAR_GLOBAL int Heading; // VAR_GLOBAL unsigned char Gps_Status; // /*----------------------------------- Locals ---------------------------------*/ VAR_STATIC int North; // angle to north VAR_STATIC unsigned int Speed; // speed VAR_STATIC char pcLogGps[GPS_LENGTH]; // #if (GPS_DEBUG == 1) VAR_STATIC const char s_pcSentence[] = "008,001.9,E,A*3E\n$GPRMC,194617.04,A,4534.6714,N,01128.8559,E,000.0,287.0,091008,001.9,E,A*31\n$GPRMC,194618.04,A,4534.6714,N,01128.8559,E,000.0,287.0,091"; #endif /*--------------------------------- Prototypes -------------------------------*/ #if (GPS_DEBUG == 1) tBoolean Debug_GetChar ( char *ch ); #endif //---------------------------------------------------------------------------- // /// \brief Initialize gps interface /// /// \remarks The second UART will be configured in 4800 baud, 8-n-1 mode. /// //---------------------------------------------------------------------------- void GPSInit( void ) { // // Wait for first fix // Gps_Status = GPS_STATUS_FIRST; } //---------------------------------------------------------------------------- // /// \brief Parse NMEA sentence for coordinates /// /// \param integer : (pointer to) integer part of coordinate /// \param decimal : (pointer to) decimal part of coordinate /// \param c : character of NMEA sentence /// \remarks - /// //---------------------------------------------------------------------------- void Parse_Coord( int * integer, int * decimal, char c ) { if ( c == ',' ) { *decimal = 0; } else if ( c != '.' ) { *decimal *= 10; *decimal += (c - '0'); } else { *integer = *decimal; *decimal = 0; } } void Parse_Lat( float * fLat, char c ) { static unsigned long ulLat = 0UL; if ( c == ',' ) { *fLat = (ulLat % 1000000UL) / 6000.0f; // convert ' to ° *fLat += (ulLat / 100000UL); // add ° ulLat = 0UL; } else if ( c != '.' ) { ulLat = ulLat * 10UL + (unsigned long)(c - '0'); } } void Parse_Lon( float * fLon, char c ) { static unsigned long ulLon = 0UL; if ( c == ',' ) { *fLon = (ulLon % 1000000UL) / 6000.0f; // convert ' to ° *fLon += (ulLon / 100000UL); // add ° ulLon = 0UL; } else if ( c != '.' ) { ulLon = ulLon * 10UL + (unsigned long)(c - '0'); } } //---------------------------------------------------------------------------- // /// \brief Parse GPS sentences /// /// \returns true if new coordinate data are available, /// false otherwise /// \remarks /// /// //---------------------------------------------------------------------------- tBoolean GPSParse( void ) { char c; unsigned char i; tBoolean result = false; static unsigned char commas, j = 0; if (Gps_GetChar(&c)) { // received another character if ( c == '$' ) commas = 0; // start of NMEA sentence if ( c == ',' ) commas++; // count commas if ( commas == 2 ) { // get fix info if (c == 'A') { Gps_Status |= GPS_STATUS_FIX; } else if (c == 'V') { Gps_Status &= ~GPS_STATUS_FIX; } } if ( commas == 3 ) { // get latitude data (3rd comma) Parse_Lat (&fCurrLat, c); } if ( commas == 4 ) { // N / S (4th comma) } if ( commas == 5 ) { // get longitude data (5th comma) Parse_Lon (&fCurrLon, c); } if ( commas == 6 ) { // E / W (6th comma) } if ( commas == 7 ) { // get speed over ground (7th comma) if ( c == ',' ) { Speed = 0; } else if ( c != '.' ) { Speed *= 10; Speed += (c - '0'); } } if ( commas == 8 ) { // get heading (8th comma) if ( c == ',' ) { Heading = 0; } else if ( c != '.' ) { Heading *= 10; Heading += (c - '0'); } } if (( commas == 9 ) && // magnetic variation (9th comma) (Gps_Status & GPS_STATUS_FIX)) { // GPS data valid commas = 10; Heading /= 10; North = 360 - Heading; result = true; } if ((j < GPS_LENGTH) && (c != '\r')) { pcLogGps[j++] = c; // Log GPS sentence } if (c == '\n') { // end of NMEA sentence for (i = 0; i < j; i++) { Log_PutChar(pcLogGps[i]); } j = 0; } } return result; } //---------------------------------------------------------------------------- // /// \brief Get GPS fix status /// /// \returns true if fix /// /// \remarks - /// /// //---------------------------------------------------------------------------- tBoolean GPSFix ( void ) { return ((Gps_Status | GPS_STATUS_FIX) == GPS_STATUS_FIX); } //---------------------------------------------------------------------------- // /// \brief Get current GPS heading /// /// \returns heading angle in degrees, between 0° and 360° /// /// \remarks - /// /// //---------------------------------------------------------------------------- int GPSHeading ( void ) { return Heading; } //---------------------------------------------------------------------------- // /// \brief Get current North angle /// /// \returns North angle in degrees, between 0° and 360° /// /// \remarks - /// /// //---------------------------------------------------------------------------- int GPSNorth ( void ) { return North; } //---------------------------------------------------------------------------- // /// \brief Get speed /// /// \returns speed in m / s /// /// \remarks - /// /// //---------------------------------------------------------------------------- unsigned int GPSSpeed ( void ) { unsigned long ulTemp; ulTemp = ((unsigned long)Speed * 1852) / 36000; return (unsigned int)ulTemp; } #if (GPS_DEBUG == 1) //---------------------------------------------------------------------------- // /// \brief get a character from preloaded string /// /// \returns /// \remarks /// /// //---------------------------------------------------------------------------- tBoolean Debug_GetChar ( char *ch ) { char c; VAR_STATIC unsigned char j = 0; c = s_pcSentence[j]; if (c == 0) { j = 0; } else { j++; } *ch = c; return true; } #endif
[ "fodzilla91@gmail.com" ]
fodzilla91@gmail.com
71270a44fa30aa76457678d06ecf2c4576c7ab97
e2e3e85061e35b622a8b172235d8d99f734848a5
/Cubixcraft_v0.0.3-alpha_2021.05.18_src_VisualC++2019/Cubixcraft/tessellator.h
00a6a118cb0187fb41b962d1100547e13db29798
[]
no_license
BlackMightyRavenDark/Cubixcraft
e2bfebc7f79efedf3992d3a12fbb5b7d559a2a0d
a76bfb64f9b9d60a63145ee03c57d2cc4f63fe7b
refs/heads/master
2023-04-12T11:25:02.220385
2021-05-18T09:41:59
2021-05-18T09:41:59
258,738,515
0
0
null
null
null
null
WINDOWS-1251
C++
false
false
765
h
/* * Класс CTessellator это обёртка над glInterleavedArrays(), glDrawArrays() * и другими сопутствующими функциями. */ #include <GL/gl.h> class CTessellator { public: CTessellator(); void AddVertexQuad(float x, float y, float z); void FlushQuads(); void ClearQuads(); void AddTextureVertexQuad(float u, float v, float x, float y, float z); void FlushTextureQuads(); void ClearTextureQuads(); private: static const int MAX_FLOATS = 128 * 128; float arrayVertexQuads[MAX_FLOATS]; float arrayTextureVertexQuads[MAX_FLOATS]; int vertexQuadsPos; int vertexQuadsCount; int vertexTextureQuadsPos; int vertexTextureQuadsCount; };
[ "noreply@github.com" ]
noreply@github.com
a966ffd7fd171fab3fb2f977afc944a9a408b47d
1f6e98768742e62bea8aa98848f5e859f5844fca
/Fantasy_World_Version_6/Monster.h
1735cfc74185170f5663281fcae773c1e1a3c383
[]
no_license
kiattt1412/Fantasy_World_Version_6
1c6e414d324fa95fa92f93112170fc2d2c035288
20941f97067166fa5088bbe1713c6f4a64cf3b48
refs/heads/master
2020-03-19T00:17:32.126529
2018-05-30T16:27:56
2018-05-30T16:27:56
135,470,037
0
0
null
null
null
null
UTF-8
C++
false
false
539
h
#pragma once #include<string> #include <fstream> #include "Map.h" class Monster { public: Monster(); ~Monster(); double monsterHP; double monsterAtkDamage; int monsterPositionX; int monsterPositionY; int MaxMonsterNumber = 10; int monsterID; std::string monsterType; void setMonsterHP(); void setMonsterPosition(int x, int y, Map &m, int type); void setMonsterID(int monID); void setMonsterType(int montype); void monsterStronger(); Monster(const Monster& ms) = default; Monster& operator = (Monster& ms) = default; };
[ "krittayoch.teg@student.mahidol.ac.th" ]
krittayoch.teg@student.mahidol.ac.th
c40108499126584935353ee91f7af69f3310055a
4a00a94923d938cd6c5a1bd4a9077f8f4a3c992b
/openFoam2/processor0/19/p
f6af9fdf0016c692af74c7993eb99b837629a83e
[]
no_license
mars2020/my_openfoam_2
c79813522ab0bb74fca9f3c6f4f4169a56d883b4
fda619bae0230cfb459aac15056ebea7e2d79b0e
refs/heads/master
2020-05-04T04:35:20.905005
2019-04-05T04:33:47
2019-04-05T04:33:47
178,968,612
1
0
null
null
null
null
UTF-8
C++
false
false
41,560
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6.0 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "19"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField nonuniform List<scalar> 4000 ( -0.474166 -0.460211 -0.447829 -0.434155 -0.417994 -0.399839 -0.380513 -0.360852 -0.341566 -0.323157 -0.305912 -0.28995 -0.275275 -0.261827 -0.249511 -0.238219 -0.227851 -0.21828 -0.20931 -0.201239 -0.482087 -0.467696 -0.454485 -0.439346 -0.421217 -0.400895 -0.379477 -0.357966 -0.337137 -0.317487 -0.299259 -0.282522 -0.267233 -0.253294 -0.240579 -0.228962 -0.218326 -0.208525 -0.199349 -0.19117 -0.488145 -0.473415 -0.459323 -0.44259 -0.42239 -0.399877 -0.376423 -0.353178 -0.330954 -0.310214 -0.291149 -0.273769 -0.257984 -0.243659 -0.230641 -0.218786 -0.207964 -0.198009 -0.188697 -0.180485 -0.491968 -0.476999 -0.461978 -0.443549 -0.421226 -0.396557 -0.371182 -0.346364 -0.32292 -0.301262 -0.281516 -0.263633 -0.247477 -0.232877 -0.219657 -0.207656 -0.196733 -0.1867 -0.177329 -0.169158 -0.4932 -0.478089 -0.462099 -0.44191 -0.417471 -0.390745 -0.363614 -0.337421 -0.312956 -0.290566 -0.270305 -0.252066 -0.235667 -0.220907 -0.20759 -0.19554 -0.184603 -0.174575 -0.165221 -0.15717 -0.491507 -0.476349 -0.459368 -0.437399 -0.410913 -0.382287 -0.353611 -0.326268 -0.301 -0.278073 -0.25747 -0.239025 -0.222517 -0.207717 -0.194411 -0.182412 -0.171555 -0.161615 -0.152361 -0.144507 -0.486589 -0.471478 -0.453506 -0.429788 -0.401382 -0.371065 -0.341091 -0.312848 -0.287005 -0.263746 -0.242976 -0.22448 -0.208001 -0.193285 -0.180102 -0.168257 -0.157573 -0.14781 -0.13874 -0.131163 -0.478191 -0.463219 -0.444283 -0.418899 -0.388757 -0.357002 -0.326006 -0.297127 -0.270947 -0.247559 -0.226803 -0.208412 -0.1921 -0.177594 -0.164651 -0.153066 -0.142654 -0.133159 -0.124362 -0.11714 -0.466109 -0.451366 -0.431523 -0.404608 -0.372964 -0.340059 -0.308336 -0.279093 -0.252814 -0.229505 -0.208941 -0.190814 -0.174811 -0.160642 -0.148055 -0.13684 -0.126802 -0.117669 -0.109236 -0.102447 -0.450194 -0.435773 -0.415111 -0.386847 -0.353975 -0.320235 -0.288092 -0.25876 -0.23262 -0.209593 -0.189397 -0.17169 -0.156136 -0.142434 -0.130323 -0.119589 -0.11003 -0.101359 -0.0933861 -0.0871113 -0.430362 -0.416354 -0.394994 -0.365605 -0.331813 -0.297567 -0.265314 -0.236164 -0.210394 -0.187848 -0.168193 -0.151058 -0.136092 -0.122984 -0.11147 -0.10133 -0.0923574 -0.084254 -0.0768434 -0.0711709 -0.406592 -0.39309 -0.371181 -0.340926 -0.306543 -0.272128 -0.24007 -0.211366 -0.186188 -0.164312 -0.145362 -0.128946 -0.114703 -0.102314 -0.0915145 -0.082083 -0.0738057 -0.0663798 -0.0596444 -0.0546695 -0.378928 -0.366026 -0.343743 -0.312907 -0.278274 -0.244026 -0.21246 -0.184451 -0.160076 -0.139046 -0.120956 -0.105397 -0.0920017 -0.080452 -0.0704807 -0.0618677 -0.0543958 -0.0477623 -0.041821 -0.0376306 -0.347478 -0.335272 -0.31281 -0.281697 -0.24716 -0.213405 -0.182611 -0.155531 -0.13215 -0.112129 -0.0950385 -0.0804612 -0.0680291 -0.0574271 -0.0483912 -0.0407034 -0.0341471 -0.0284259 -0.023397 -0.0200459 -0.312414 -0.301 -0.27857 -0.247492 -0.213389 -0.180439 -0.150681 -0.124742 -0.10253 -0.083661 -0.0676913 -0.0542024 -0.0428311 -0.0332702 -0.0252638 -0.0186001 -0.0130692 -0.00838458 -0.00438208 -0.00191505 -0.273966 -0.263437 -0.241258 -0.21053 -0.177191 -0.145337 -0.116853 -0.0922486 -0.0713561 -0.0537628 -0.0390152 -0.0267002 -0.0164651 -0.00801675 -0.00111384 0.00444305 0.00885147 0.0123813 0.015219 0.0166346 -0.232415 -0.222863 -0.201161 -0.171091 -0.138827 -0.108336 -0.0813438 -0.0582402 -0.0387979 -0.0225801 -0.00913238 0.0019479 0.0109964 0.0182849 0.0240317 0.0284203 0.0316317 0.0338806 0.0352892 0.035209 -0.188092 -0.179605 -0.158601 -0.129488 -0.0985873 -0.0697051 -0.0443938 -0.022936 -0.00505024 0.00971686 0.0218158 0.0316342 0.0394839 0.0456045 0.0501799 0.0533724 0.0553224 0.0560702 0.055509 0.0533652 -0.141369 -0.134028 -0.11394 -0.0860621 -0.0567915 -0.0297356 -0.00627321 0.0134152 0.0296582 0.0429229 0.053656 0.0622318 0.0689397 0.0739848 0.0775143 0.0796587 0.0804445 0.0795169 0.0764142 0.0721501 -0.0926506 -0.0865297 -0.0675625 -0.0411801 -0.0137789 0.0112571 0.032723 0.0505333 0.0650581 0.0767773 0.0861387 0.0935151 0.0991928 0.103376 0.106224 0.107885 0.108262 0.106508 0.101924 0.0973007 -0.0423692 -0.0375333 -0.0198763 0.00477603 0.0300958 0.052943 0.0722829 0.0881166 0.100849 0.110968 0.118924 0.125094 0.129777 0.133218 0.135658 0.137373 0.138337 0.137573 0.134819 0.138332 0.00903284 0.0125265 0.0287006 0.051415 0.0744705 0.0949855 0.112089 0.12586 0.136727 0.145183 0.151671 0.156562 0.160155 0.162705 0.164471 0.165716 0.166427 0.166134 0.16573 0.171393 0.0610941 0.0632001 0.0777411 0.0983407 0.118981 0.137048 0.151827 0.163463 0.172404 0.179139 0.184102 0.187654 0.190089 0.19166 0.192614 0.193173 0.193319 0.19276 0.192401 0.196957 0.11335 0.114036 0.126818 0.14516 0.163269 0.178801 0.19119 0.200637 0.207603 0.212565 0.215943 0.218083 0.219265 0.219729 0.219705 0.219388 0.218775 0.217643 0.216737 0.2198 0.165339 0.164584 0.17551 0.191485 0.206981 0.219924 0.229885 0.237113 0.242073 0.24523 0.246984 0.247661 0.247524 0.246794 0.245674 0.244331 0.24275 0.240733 0.238968 0.240641 0.216604 0.214403 0.223403 0.23694 0.249777 0.260108 0.26763 0.272633 0.27558 0.27692 0.277032 0.276219 0.274726 0.272752 0.270479 0.268047 0.265425 0.262438 0.259738 0.260078 0.2667 0.263061 0.270095 0.28116 0.29133 0.29906 0.304162 0.306959 0.30791 0.307444 0.305918 0.303614 0.300754 0.29752 0.294071 0.290523 0.286835 0.28286 0.279222 0.278302 0.315198 0.310145 0.315203 0.323798 0.331329 0.336498 0.339228 0.339865 0.338861 0.336624 0.333489 0.329716 0.325507 0.321026 0.316412 0.311762 0.307028 0.30209 0.297537 0.295419 0.361684 0.355255 0.358357 0.364523 0.369475 0.372159 0.37259 0.371138 0.368242 0.364291 0.359597 0.354399 0.348882 0.343189 0.337445 0.331727 0.325989 0.320134 0.314706 0.311452 0.405769 0.398017 0.399213 0.403021 0.405491 0.405792 0.404025 0.400576 0.395874 0.390286 0.384102 0.377543 0.370774 0.363926 0.357103 0.350371 0.343685 0.336969 0.330711 0.326385 0.447085 0.438078 0.437444 0.439 0.439114 0.437161 0.433321 0.427991 0.421587 0.414457 0.40687 0.399029 0.391083 0.383146 0.375311 0.36763 0.360062 0.352546 0.345512 0.34018 0.485291 0.47511 0.472749 0.472191 0.470102 0.46605 0.460283 0.453206 0.445223 0.436661 0.427773 0.418742 0.409705 0.400761 0.39199 0.383434 0.375056 0.366808 0.359054 0.35279 0.520074 0.508813 0.504853 0.502343 0.498232 0.492259 0.48473 0.476058 0.466632 0.456765 0.446689 0.436574 0.426542 0.416681 0.407058 0.397708 0.388598 0.37969 0.371279 0.364162 0.551149 0.538915 0.533506 0.529233 0.523302 0.515605 0.506497 0.496397 0.485681 0.474645 0.463506 0.452422 0.441501 0.430821 0.420438 0.41038 0.400621 0.391126 0.382127 0.374243 0.578266 0.565177 0.558487 0.552662 0.545134 0.535927 0.525438 0.514089 0.502245 0.490189 0.478123 0.466192 0.454495 0.443101 0.432056 0.421382 0.411059 0.401056 0.391541 0.382984 0.601205 0.587387 0.579604 0.572457 0.563571 0.553083 0.541425 0.529018 0.516219 0.503299 0.490448 0.477801 0.465448 0.45345 0.441846 0.430653 0.419854 0.409423 0.39947 0.39034 0.619782 0.605371 0.596695 0.58847 0.578482 0.566954 0.554347 0.541083 0.527511 0.513891 0.500404 0.487178 0.474294 0.461807 0.44975 0.438137 0.426956 0.416178 0.405869 0.396273 0.633847 0.618985 0.60963 0.600586 0.58976 0.577444 0.564118 0.550205 0.536047 0.521896 0.507928 0.494263 0.480977 0.468121 0.455721 0.443791 0.43232 0.421281 0.410701 0.40075 0.643288 0.628123 0.618309 0.608713 0.597325 0.584479 0.57067 0.556321 0.54177 0.527263 0.512972 0.499012 0.485457 0.472352 0.459723 0.44758 0.435915 0.4247 0.413938 0.403749 0.648029 0.632711 0.622667 0.612794 0.601122 0.58801 0.573959 0.559391 0.544642 0.529957 0.515504 0.501395 0.487705 0.474476 0.461731 0.449482 0.437719 0.426416 0.415562 0.405253 0.648033 0.632715 0.622671 0.612797 0.601125 0.588013 0.573962 0.559393 0.544644 0.529959 0.515505 0.501397 0.487707 0.474477 0.461733 0.449483 0.43772 0.426417 0.415563 0.405254 0.643299 0.628133 0.618319 0.608723 0.597334 0.584487 0.570678 0.556328 0.541777 0.527269 0.512978 0.499018 0.485462 0.472357 0.459728 0.447585 0.435919 0.424704 0.413942 0.403753 0.633866 0.619003 0.609647 0.600601 0.589775 0.577457 0.564131 0.550217 0.536058 0.521906 0.507938 0.494272 0.480986 0.468129 0.455729 0.443799 0.432327 0.421287 0.410707 0.400757 0.619808 0.605396 0.596719 0.588492 0.578503 0.566973 0.554365 0.5411 0.527527 0.513905 0.500418 0.48719 0.474306 0.461818 0.449761 0.438148 0.426965 0.416187 0.405878 0.396281 0.601238 0.587419 0.579635 0.572485 0.563597 0.553107 0.541447 0.529039 0.516239 0.503317 0.490465 0.477817 0.465464 0.453465 0.441859 0.430666 0.419867 0.409435 0.399481 0.390351 0.578306 0.565215 0.558524 0.552697 0.545166 0.535956 0.525466 0.514114 0.502269 0.490211 0.478144 0.466212 0.454514 0.443118 0.432072 0.421398 0.411074 0.401071 0.391555 0.382997 0.551196 0.538961 0.533549 0.529274 0.52334 0.515639 0.506529 0.496426 0.485708 0.47467 0.463531 0.452445 0.441523 0.430841 0.420457 0.410399 0.400638 0.391143 0.382143 0.374258 0.520127 0.508865 0.504902 0.502389 0.498274 0.492298 0.484766 0.476092 0.466664 0.456795 0.446717 0.4366 0.426567 0.416705 0.40708 0.397729 0.388618 0.379709 0.371298 0.364179 0.485351 0.475168 0.472804 0.472242 0.47015 0.466094 0.460324 0.453244 0.445258 0.436695 0.427804 0.418772 0.409733 0.400788 0.392015 0.383457 0.375079 0.36683 0.359075 0.35281 0.447151 0.438142 0.437505 0.439057 0.439167 0.43721 0.433366 0.428033 0.421626 0.414494 0.406905 0.399061 0.391114 0.383175 0.375339 0.367657 0.360088 0.352571 0.345535 0.340202 0.405841 0.398087 0.399279 0.403083 0.405548 0.405845 0.404074 0.400622 0.395917 0.390326 0.38414 0.377578 0.370808 0.363958 0.357133 0.3504 0.343713 0.336995 0.330736 0.326409 0.361761 0.35533 0.358429 0.364589 0.369537 0.372216 0.372644 0.371187 0.368288 0.364334 0.359637 0.354437 0.348918 0.343224 0.337478 0.331759 0.326019 0.320163 0.314733 0.311478 0.31528 0.310225 0.315279 0.323869 0.331395 0.33656 0.339285 0.339918 0.33891 0.33667 0.333532 0.329757 0.325546 0.321063 0.316447 0.311795 0.30706 0.302121 0.297567 0.295447 0.266787 0.263146 0.270176 0.281236 0.2914 0.299124 0.304222 0.307016 0.307963 0.307494 0.305964 0.303658 0.300796 0.297559 0.294108 0.290559 0.28687 0.282893 0.279253 0.278332 0.216695 0.214492 0.223487 0.237019 0.249851 0.260176 0.267694 0.272692 0.275636 0.276972 0.27708 0.276265 0.27477 0.272793 0.270518 0.268085 0.265461 0.262473 0.259772 0.26011 0.165434 0.164677 0.175598 0.191568 0.207058 0.219995 0.229951 0.237175 0.242131 0.245284 0.247035 0.24771 0.24757 0.246837 0.245715 0.244371 0.242788 0.24077 0.239003 0.240674 0.113448 0.114131 0.12691 0.145246 0.163349 0.178875 0.191259 0.200702 0.207663 0.212622 0.215997 0.218134 0.219313 0.219775 0.219748 0.21943 0.218815 0.217681 0.216774 0.219835 0.061195 0.0632986 0.0778353 0.0984292 0.119064 0.137125 0.151899 0.16353 0.172467 0.179198 0.184158 0.187707 0.190139 0.191708 0.19266 0.193217 0.193361 0.192801 0.19244 0.196994 0.00913596 0.0126272 0.028797 0.0515058 0.0745553 0.0950645 0.112163 0.125929 0.136792 0.145244 0.151729 0.156616 0.160207 0.162754 0.164519 0.165761 0.16647 0.166176 0.165771 0.171431 -0.0422643 -0.0374309 -0.0197781 0.00486869 0.0301824 0.0530238 0.0723584 0.0881873 0.100915 0.111031 0.118983 0.12515 0.129831 0.133269 0.135707 0.13742 0.138382 0.137616 0.134861 0.138373 -0.0925447 -0.0864262 -0.067463 -0.041086 -0.0136909 0.0113394 0.0327999 0.0506054 0.065126 0.0768414 0.0861996 0.093573 0.0992481 0.103429 0.106275 0.107934 0.108309 0.106554 0.101969 0.0973446 -0.141262 -0.133924 -0.11384 -0.0859671 -0.0567024 -0.0296522 -0.00619512 0.0134886 0.0297274 0.0429883 0.0537181 0.062291 0.0689963 0.0740391 0.0775665 0.0797092 0.0804934 0.0795645 0.0764609 0.0721963 -0.187986 -0.179501 -0.158501 -0.129392 -0.0984976 -0.0696211 -0.0443149 -0.0228618 -0.00498022 0.00978321 0.0218789 0.0316944 0.0395416 0.0456599 0.0502334 0.0534242 0.0553727 0.0561191 0.055557 0.0534127 -0.232309 -0.222759 -0.201061 -0.170996 -0.138737 -0.108252 -0.0812645 -0.0581655 -0.0387273 -0.0225131 -0.00906855 0.00200893 0.0110549 0.0183413 0.0240862 0.0284731 0.031683 0.0339305 0.0353381 0.0352572 -0.273861 -0.263334 -0.241159 -0.210436 -0.177102 -0.145252 -0.116774 -0.0921737 -0.0712852 -0.0536954 -0.0389509 -0.0266386 -0.016406 -0.00795971 -0.00105868 0.00449656 0.00890352 0.012432 0.0152686 0.0166833 -0.312312 -0.300899 -0.278472 -0.247398 -0.213301 -0.180355 -0.150602 -0.124668 -0.102459 -0.0835935 -0.0676268 -0.0541405 -0.0427715 -0.0332127 -0.0252082 -0.018546 -0.0130165 -0.00833319 -0.00433179 -0.00186569 -0.347378 -0.335174 -0.312715 -0.281605 -0.247072 -0.213322 -0.182533 -0.155457 -0.13208 -0.112062 -0.094974 -0.0803992 -0.0679694 -0.0573693 -0.0483352 -0.0406489 -0.034094 -0.0283741 -0.0233462 -0.019996 -0.378831 -0.365931 -0.34365 -0.312817 -0.278189 -0.243945 -0.212383 -0.184378 -0.160006 -0.138979 -0.120892 -0.105335 -0.091942 -0.0803942 -0.0704245 -0.061813 -0.0543425 -0.0477101 -0.0417698 -0.0375803 -0.406498 -0.392998 -0.371091 -0.340839 -0.306459 -0.272049 -0.239994 -0.211293 -0.186119 -0.164246 -0.145299 -0.128885 -0.114643 -0.102257 -0.0914584 -0.0820283 -0.0737522 -0.0663274 -0.059593 -0.0546189 -0.430272 -0.416266 -0.394908 -0.365521 -0.331732 -0.29749 -0.26524 -0.236093 -0.210326 -0.187782 -0.16813 -0.150997 -0.136033 -0.122927 -0.111414 -0.101276 -0.0923039 -0.0842015 -0.0767919 -0.0711201 -0.450109 -0.435689 -0.415029 -0.386766 -0.353898 -0.32016 -0.28802 -0.258691 -0.232553 -0.209529 -0.189335 -0.17163 -0.156078 -0.142377 -0.130268 -0.119535 -0.109977 -0.101307 -0.0933344 -0.0870604 -0.466028 -0.451287 -0.431445 -0.404531 -0.372889 -0.339987 -0.308267 -0.279026 -0.25275 -0.229443 -0.20888 -0.190755 -0.174753 -0.160586 -0.148 -0.136786 -0.126749 -0.117617 -0.109185 -0.102396 -0.478115 -0.463145 -0.444209 -0.418827 -0.388686 -0.356933 -0.325939 -0.297062 -0.270884 -0.247498 -0.226743 -0.208354 -0.192044 -0.177539 -0.164596 -0.153012 -0.142602 -0.133106 -0.12431 -0.117089 -0.486518 -0.471409 -0.453438 -0.42972 -0.401315 -0.370999 -0.341027 -0.312786 -0.286945 -0.263687 -0.242919 -0.224424 -0.207945 -0.19323 -0.180048 -0.168204 -0.157521 -0.147758 -0.138689 -0.131112 -0.491441 -0.476285 -0.459305 -0.437336 -0.41085 -0.382225 -0.35355 -0.326209 -0.300941 -0.278016 -0.257414 -0.23897 -0.222463 -0.207664 -0.194358 -0.18236 -0.171503 -0.161563 -0.152309 -0.144456 -0.49314 -0.47803 -0.462041 -0.441851 -0.417413 -0.390688 -0.363557 -0.337365 -0.3129 -0.290511 -0.270251 -0.252012 -0.235614 -0.220855 -0.207538 -0.195488 -0.184552 -0.174524 -0.16517 -0.157119 -0.491914 -0.476946 -0.461925 -0.443495 -0.421172 -0.396504 -0.371128 -0.346311 -0.322867 -0.30121 -0.281464 -0.263582 -0.247426 -0.232825 -0.219606 -0.207606 -0.196682 -0.186649 -0.177278 -0.169107 -0.488096 -0.473367 -0.459276 -0.442542 -0.422341 -0.399827 -0.376373 -0.353129 -0.330904 -0.310164 -0.291099 -0.273719 -0.257935 -0.243609 -0.230591 -0.218736 -0.207914 -0.197959 -0.188647 -0.180434 -0.482043 -0.467653 -0.454442 -0.439303 -0.421173 -0.400851 -0.379431 -0.35792 -0.337091 -0.31744 -0.299212 -0.282474 -0.267185 -0.253246 -0.24053 -0.228913 -0.218276 -0.208475 -0.199298 -0.191119 -0.474127 -0.460173 -0.447791 -0.434117 -0.417954 -0.399799 -0.380472 -0.360809 -0.341522 -0.323113 -0.305867 -0.289904 -0.275229 -0.261781 -0.249464 -0.238171 -0.227802 -0.218231 -0.20926 -0.201188 0.0790935 0.0509607 0.0302701 0.0204438 0.011668 -0.000209527 -0.0135511 -0.0264367 -0.0385659 -0.0503534 -0.0620424 -0.0736055 -0.0849489 -0.0960308 -0.106859 -0.117456 -0.127849 -0.138063 -0.148132 -0.1581 0.0221028 0.00819883 -0.00398265 -0.0113846 -0.0169198 -0.0233601 -0.0308632 -0.0384101 -0.045415 -0.0519344 -0.058194 -0.0642897 -0.0701962 -0.0758664 -0.0812805 -0.0864404 -0.0913514 -0.0960142 -0.100424 -0.104574 0.00810358 0.00198148 -0.00348848 -0.00809755 -0.0122691 -0.0165452 -0.0210932 -0.0257418 -0.030299 -0.0347224 -0.0390684 -0.0433908 -0.0477035 -0.0519985 -0.0562694 -0.0605184 -0.0647531 -0.0689816 -0.073211 -0.0774483 -8.42735e-05 -0.00387302 -0.00756279 -0.0112118 -0.0148093 -0.0183707 -0.021925 -0.0254702 -0.0289792 -0.0324316 -0.0358269 -0.0391736 -0.0424773 -0.0457376 -0.0489522 -0.0521199 -0.0552413 -0.0583179 -0.0613511 -0.0643422 -0.00635255 -0.0094046 -0.0121732 -0.0147576 -0.0173213 -0.0199019 -0.022471 -0.0250075 -0.0275096 -0.0299822 -0.0324294 -0.0348538 -0.0372579 -0.0396441 -0.0420146 -0.0443716 -0.0467176 -0.049055 -0.0513864 -0.0537143 -0.0110355 -0.0134842 -0.0155465 -0.0173887 -0.0192356 -0.0211429 -0.02307 -0.0249807 -0.0268696 -0.028745 -0.0306132 -0.0324755 -0.0343314 -0.0361806 -0.0380235 -0.0398607 -0.0416928 -0.0435203 -0.0453437 -0.0471633 -0.0139025 -0.0157981 -0.0173346 -0.0187002 -0.0200892 -0.0215425 -0.0230212 -0.0244924 -0.0259499 -0.0274006 -0.0288499 -0.030299 -0.0317471 -0.0331932 -0.0346373 -0.0360799 -0.0375212 -0.0389617 -0.0404016 -0.0418414 -0.0155342 -0.016992 -0.0181882 -0.0192689 -0.020372 -0.0215252 -0.0227005 -0.0238735 -0.025039 -0.0262013 -0.0273644 -0.028529 -0.0296943 -0.0308595 -0.0320245 -0.0331891 -0.0343535 -0.0355177 -0.0366819 -0.037846 -0.0164563 -0.0175571 -0.0185203 -0.0194223 -0.0203353 -0.0212762 -0.0222313 -0.0231868 -0.024139 -0.0250895 -0.0260405 -0.0269925 -0.027945 -0.0288976 -0.02985 -0.0308021 -0.0317541 -0.0327058 -0.0336574 -0.0346088 -0.0170897 -0.0178935 -0.0186741 -0.0194482 -0.0202259 -0.0210101 -0.0217984 -0.0225875 -0.0233761 -0.024164 -0.0249517 -0.0257395 -0.0265271 -0.0273145 -0.0281015 -0.028888 -0.0296741 -0.0304598 -0.0312451 -0.03203 -0.0176343 -0.0182091 -0.0188368 -0.0194979 -0.020161 -0.0208165 -0.0214678 -0.0221191 -0.0227711 -0.0234233 -0.024075 -0.024726 -0.0253765 -0.0260265 -0.0266761 -0.0273251 -0.0279738 -0.0286221 -0.0292701 -0.0299179 -0.0181467 -0.0185543 -0.0190513 -0.0196027 -0.0201575 -0.0206985 -0.0212312 -0.0217629 -0.0222961 -0.02283 -0.0233637 -0.0238969 -0.0244296 -0.0249621 -0.0254945 -0.026027 -0.0265595 -0.0270921 -0.0276249 -0.028158 -0.0185913 -0.0188704 -0.0192507 -0.0196953 -0.0201459 -0.0205817 -0.0210077 -0.0214322 -0.0218586 -0.0222865 -0.0227149 -0.0231433 -0.023572 -0.0240012 -0.0244311 -0.0248619 -0.0252937 -0.0257265 -0.0261606 -0.0265959 -0.0189209 -0.0190835 -0.0193554 -0.0197012 -0.0200563 -0.0203961 -0.020725 -0.0210523 -0.0213821 -0.0217143 -0.0220479 -0.0223827 -0.0227189 -0.0230568 -0.0233968 -0.0237392 -0.0240839 -0.0244313 -0.0247813 -0.0251341 -0.0191099 -0.0191257 -0.0192737 -0.0195181 -0.0197783 -0.0200209 -0.0202498 -0.0204769 -0.0207083 -0.0209444 -0.0211841 -0.0214273 -0.0216742 -0.0219255 -0.0221815 -0.0224426 -0.0227089 -0.0229805 -0.0232575 -0.0235399 -0.019304 -0.0191734 -0.0191593 -0.0192502 -0.0193712 -0.019484 -0.0195882 -0.0196952 -0.0198117 -0.0199392 -0.020077 -0.0202244 -0.0203817 -0.0205492 -0.0207271 -0.0209154 -0.021114 -0.0213226 -0.0215411 -0.0217692 -0.019066 -0.018836 -0.0185685 -0.0183495 -0.0181928 -0.0180813 -0.0180004 -0.0179454 -0.0179169 -0.0179162 -0.0179428 -0.0179954 -0.0180725 -0.0181726 -0.0182946 -0.0184372 -0.0185991 -0.0187791 -0.018976 -0.0191884 -0.0163997 -0.0159499 -0.015461 -0.0150552 -0.0147507 -0.0145269 -0.0143645 -0.0142539 -0.0141914 -0.0141744 -0.0142003 -0.0142655 -0.0143666 -0.0145004 -0.0146637 -0.0148539 -0.0150683 -0.0153046 -0.0155604 -0.0158337 -0.00504194 -0.00150707 -0.000288212 -0.000908358 -0.00193748 -0.00271592 -0.00325767 -0.00374363 -0.00426841 -0.00483489 -0.00541829 -0.0060029 -0.00658553 -0.00716765 -0.00775005 -0.00833202 -0.00891223 -0.00948951 -0.010063 -0.010632 0.00651405 0.0185732 0.0222641 0.0197157 0.015987 0.0132985 0.0115544 0.0101176 0.00865739 0.00715427 0.00568143 0.00428191 0.00295789 0.00169684 0.000488923 -0.000670184 -0.00178234 -0.00284934 -0.00387351 -0.00485736 0.118278 0.118801 0.119871 0.12148 0.123628 0.126327 0.129601 0.133469 0.137948 0.143042 0.148736 0.15497 0.161634 0.16849 0.175123 0.180728 0.18379 0.181273 0.166577 0.124761 0.109108 0.109491 0.110215 0.111302 0.112713 0.11447 0.116507 0.118852 0.121378 0.124111 0.1268 0.129446 0.131556 0.133043 0.132927 0.130853 0.124759 0.113354 0.0915281 0.0535224 0.0982699 0.0984744 0.0988356 0.0993658 0.100031 0.100826 0.101674 0.102547 0.103314 0.103912 0.104114 0.103791 0.102554 0.100137 0.0958907 0.0893122 0.0794258 0.0655764 0.0470669 0.0241675 0.086456 0.0864908 0.086532 0.0865804 0.0866135 0.0866026 0.0864852 0.0861966 0.0856325 0.084687 0.0832016 0.0810094 0.0778823 0.0735806 0.0678363 0.0604038 0.0511411 0.0399468 0.0267587 0.010704 0.0743636 0.0742726 0.0740777 0.0737744 0.0733495 0.0727685 0.0719852 0.0709309 0.0695336 0.0676953 0.0653252 0.0622982 0.0585217 0.053866 0.0482861 0.0416857 0.0340789 0.0252704 0.0149941 0.00231407 0.0625729 0.0624056 0.0620647 0.0615456 0.0608408 0.0599222 0.0587586 0.0572969 0.0554931 0.0532804 0.0506161 0.04743 0.0436971 0.0393537 0.0344006 0.0287561 0.022387 0.0150651 0.00653364 -0.00390771 0.0514855 0.0512817 0.0508702 0.0502474 0.0494096 0.0483382 0.0470146 0.0454048 0.043485 0.0412158 0.0385793 0.0355365 0.0320802 0.0281671 0.0237924 0.0188844 0.0134101 0.00721542 0.000147316 -0.00826993 0.0413281 0.0411148 0.0406857 0.0400375 0.0391687 0.0380684 0.0367271 0.0351248 0.0332496 0.0310781 0.0286017 0.0257949 0.0226534 0.0191458 0.0152705 0.0109855 0.00628977 0.00110856 -0.00462417 -0.0112135 0.0321896 0.0319829 0.031568 0.0309413 0.0301023 0.0290444 0.0277638 0.0262489 0.0244941 0.0224846 0.0202164 0.0176722 0.0148516 0.0117359 0.008333 0.00462494 0.000632626 -0.00366859 -0.00826654 -0.0132596 0.0240672 0.0238754 0.0234907 0.0229095 0.0221308 0.0211509 0.0199687 0.0185778 0.016977 0.0151572 0.0131185 0.0108506 0.00835791 0.0056308 0.00268333 -0.000490203 -0.00385815 -0.00741379 -0.0110835 -0.0148034 0.0169048 0.0167312 0.0163833 0.015857 0.0151514 0.0142639 0.0131955 0.0119434 0.0105097 0.00888997 0.00708839 0.00509999 0.00293305 0.000582873 -0.00193415 -0.00461858 -0.00743334 -0.0103536 -0.0132697 -0.0160285 0.0106219 0.0104667 0.0101563 0.00968637 0.00905603 0.00826364 0.00731197 0.00620059 0.00493413 0.00351167 0.00194031 0.000219123 -0.0016403 -0.0036387 -0.00575771 -0.00799561 -0.0103146 -0.0126847 -0.0149842 -0.0170249 0.00513283 0.00499421 0.00471764 0.00429905 0.00373802 0.00303422 0.00219221 0.00121376 0.000105418 -0.00113184 -0.00248967 -0.00396717 -0.00555071 -0.00723689 -0.00900283 -0.0108415 -0.012714 -0.0145925 -0.0163619 -0.0178318 0.000361037 0.000234874 -1.59808e-05 -0.00039514 -0.000902009 -0.00153501 -0.00228705 -0.0031532 -0.00412389 -0.00519561 -0.00635909 -0.00761399 -0.008949 -0.0103621 -0.0118287 -0.0133335 -0.014825 -0.0162644 -0.0175409 -0.0184891 -0.0037498 -0.00386962 -0.0041072 -0.0044657 -0.0049434 -0.005537 -0.00623633 -0.00703245 -0.00790987 -0.00885865 -0.00986237 -0.0109169 -0.0120111 -0.0131527 -0.0143306 -0.0155427 -0.0167317 -0.0178303 -0.0186778 -0.019082 -0.00722837 -0.00734901 -0.00758789 -0.00794834 -0.00842801 -0.00902372 -0.00972354 -0.010517 -0.0113821 -0.0123013 -0.013241 -0.0141796 -0.0150807 -0.0159425 -0.0167565 -0.0175688 -0.0183754 -0.0191598 -0.0196931 -0.0196421 -0.0100741 -0.0102016 -0.0104549 -0.0108377 -0.0113484 -0.0119862 -0.0127414 -0.0136074 -0.0145635 -0.0155927 -0.0166513 -0.0176973 -0.0186465 -0.0194298 -0.0199485 -0.0201989 -0.0202117 -0.0201715 -0.020076 -0.0195585 -0.0122625 -0.0123993 -0.0126746 -0.0130915 -0.0136512 -0.014355 -0.0152013 -0.0161898 -0.0173154 -0.0185718 -0.0199398 -0.0213846 -0.0228307 -0.0241458 -0.0251035 -0.0253941 -0.0246853 -0.022847 -0.0202216 -0.0176445 -0.0137551 -0.0138998 -0.0141967 -0.0146469 -0.0152555 -0.0160243 -0.0169631 -0.0180758 -0.0193801 -0.0208829 -0.022613 -0.0245759 -0.0267985 -0.0292306 -0.0317668 -0.033995 -0.0351309 -0.0336207 -0.0275352 -0.0153293 -0.0145118 -0.0146624 -0.0149724 -0.0154434 -0.0160814 -0.0168911 -0.0178859 -0.0190776 -0.0204918 -0.022154 -0.024113 -0.0264245 -0.029185 -0.0325072 -0.0365486 -0.0413983 -0.0468562 -0.0515204 -0.050411 -0.0279653 0.128673 0.129245 0.130523 0.132412 0.135055 0.138354 0.142551 0.147503 0.153588 0.160596 0.169116 0.178831 0.190679 0.204156 0.220842 0.239874 0.264112 0.291924 0.328768 0.371165 0.128637 0.129209 0.130486 0.132374 0.135017 0.138314 0.142509 0.147458 0.153539 0.160542 0.169055 0.178759 0.190591 0.204046 0.220695 0.239676 0.263822 0.291497 0.328108 0.37011 0.128564 0.129136 0.130412 0.132299 0.134939 0.138234 0.142424 0.147368 0.153441 0.160434 0.168932 0.178616 0.190416 0.203828 0.220402 0.239281 0.263243 0.290647 0.326792 0.368008 0.128455 0.129027 0.130301 0.132186 0.134823 0.138113 0.142298 0.147233 0.153295 0.160273 0.168748 0.178403 0.190154 0.203503 0.219964 0.238691 0.26238 0.28938 0.324827 0.364871 0.128311 0.128881 0.130154 0.132036 0.134669 0.137954 0.14213 0.147055 0.153102 0.160059 0.168505 0.178119 0.189807 0.203071 0.219385 0.237911 0.261236 0.287703 0.322222 0.360715 0.12813 0.128701 0.129971 0.13185 0.134477 0.137755 0.141922 0.146832 0.152861 0.159793 0.168203 0.177767 0.189376 0.202534 0.218666 0.236943 0.259818 0.285626 0.318987 0.355561 0.127914 0.128484 0.129752 0.131627 0.134248 0.137518 0.141672 0.146567 0.152574 0.159475 0.167842 0.177347 0.188864 0.201895 0.217813 0.235792 0.258133 0.283162 0.315138 0.349436 0.127663 0.128233 0.129498 0.131368 0.133982 0.137242 0.141383 0.14626 0.152242 0.159108 0.167426 0.17686 0.188273 0.201156 0.216829 0.234466 0.256191 0.280325 0.310691 0.342373 0.127377 0.127947 0.129209 0.131074 0.13368 0.13693 0.141055 0.145911 0.151865 0.158691 0.166954 0.176309 0.187605 0.200321 0.215719 0.232968 0.254 0.277131 0.305664 0.33441 0.127056 0.127627 0.128885 0.130746 0.133343 0.13658 0.140689 0.145522 0.151445 0.158227 0.166429 0.175696 0.186864 0.199391 0.214491 0.231306 0.251575 0.273596 0.300079 0.325589 0.126702 0.127273 0.128528 0.130383 0.132971 0.136196 0.140286 0.145094 0.150982 0.157716 0.165852 0.175021 0.186051 0.198371 0.213149 0.229488 0.248928 0.26974 0.293961 0.315957 0.126315 0.126886 0.128138 0.129988 0.132565 0.135776 0.139847 0.144628 0.150479 0.15716 0.165226 0.174289 0.185172 0.197264 0.2117 0.22752 0.246074 0.265581 0.287336 0.305568 0.125894 0.126467 0.127716 0.12956 0.132126 0.135323 0.139372 0.144125 0.149937 0.156562 0.164552 0.173501 0.184228 0.196075 0.210152 0.22541 0.243032 0.261137 0.280236 0.294475 0.125441 0.126017 0.127263 0.129101 0.131656 0.134838 0.138864 0.143586 0.149357 0.155922 0.163833 0.17266 0.183223 0.194809 0.208512 0.223167 0.239818 0.256426 0.272697 0.282733 0.124957 0.125535 0.126779 0.128611 0.131154 0.134321 0.138323 0.143013 0.14874 0.155242 0.16307 0.171768 0.182161 0.193468 0.206786 0.220799 0.236453 0.251467 0.264762 0.270388 0.124441 0.125023 0.126265 0.128091 0.130622 0.133772 0.137749 0.142406 0.148086 0.154521 0.162261 0.170823 0.181037 0.192051 0.204973 0.218309 0.232949 0.246273 0.256486 0.25748 0.123896 0.124482 0.125722 0.127543 0.130062 0.133195 0.137146 0.141768 0.147398 0.153765 0.161412 0.169832 0.179861 0.190568 0.203084 0.215708 0.229326 0.240861 0.247929 0.244041 0.123321 0.123914 0.125155 0.126973 0.129482 0.1326 0.136528 0.141119 0.146706 0.153007 0.160567 0.168848 0.178698 0.189092 0.201205 0.213084 0.225678 0.235284 0.239138 0.229971 0.122716 0.123318 0.124563 0.126382 0.128885 0.131994 0.135905 0.140473 0.146024 0.152272 0.159756 0.167909 0.17759 0.187678 0.199394 0.210502 0.22207 0.229585 0.230132 0.214599 0.122078 0.122683 0.12392 0.125729 0.128208 0.13129 0.135153 0.139668 0.145134 0.151284 0.158616 0.166583 0.175982 0.1857 0.196882 0.207205 0.217679 0.223286 0.220998 0.198217 0.122084 0.122689 0.123927 0.125736 0.128215 0.131297 0.135161 0.139675 0.145142 0.151293 0.158625 0.166593 0.175993 0.185713 0.196896 0.207221 0.217698 0.223307 0.221024 0.198249 0.122722 0.123324 0.124569 0.126388 0.128891 0.132001 0.135912 0.14048 0.146032 0.15228 0.159765 0.167919 0.1776 0.187689 0.199407 0.210517 0.222088 0.229606 0.230157 0.214629 0.123326 0.12392 0.12516 0.126979 0.129488 0.132607 0.136535 0.141126 0.146713 0.153015 0.160576 0.168857 0.178707 0.189103 0.201218 0.213098 0.225695 0.235304 0.239162 0.230001 0.123901 0.124488 0.125728 0.127549 0.130068 0.133201 0.137152 0.141774 0.147405 0.153773 0.16142 0.169841 0.179871 0.190579 0.203096 0.215721 0.229342 0.240879 0.247953 0.24407 0.124447 0.125028 0.12627 0.128096 0.130628 0.133778 0.137755 0.142412 0.148092 0.154528 0.162268 0.170831 0.181046 0.192061 0.204984 0.218321 0.232964 0.246291 0.256508 0.257508 0.124962 0.12554 0.126783 0.128616 0.131159 0.134326 0.138329 0.143019 0.148746 0.155248 0.163077 0.171775 0.182169 0.193477 0.206797 0.220811 0.236467 0.251483 0.264783 0.270414 0.125446 0.126021 0.127267 0.129105 0.131661 0.134843 0.138869 0.143592 0.149362 0.155928 0.16384 0.172667 0.183231 0.194817 0.208522 0.223178 0.239831 0.256441 0.272716 0.282757 0.125898 0.126471 0.127721 0.129564 0.132131 0.135328 0.139377 0.14413 0.149942 0.156567 0.164558 0.173507 0.184235 0.196083 0.210161 0.22542 0.243044 0.261151 0.280254 0.294498 0.126318 0.12689 0.128142 0.129992 0.132569 0.135781 0.139851 0.144632 0.150484 0.157165 0.165232 0.174295 0.185178 0.197272 0.211708 0.227529 0.246086 0.265594 0.287352 0.305589 0.126706 0.127276 0.128532 0.130387 0.132974 0.1362 0.14029 0.145098 0.150987 0.157721 0.165857 0.175027 0.186057 0.198378 0.213156 0.229497 0.248938 0.269753 0.293976 0.315977 0.12706 0.12763 0.128889 0.130749 0.133346 0.136584 0.140693 0.145526 0.151449 0.158231 0.166433 0.175701 0.186869 0.199397 0.214498 0.231314 0.251584 0.273608 0.300093 0.325606 0.12738 0.12795 0.129212 0.131077 0.133683 0.136933 0.141059 0.145915 0.151868 0.158695 0.166958 0.176314 0.18761 0.200326 0.215726 0.232975 0.254009 0.277141 0.305677 0.334426 0.127665 0.128235 0.129501 0.131371 0.133985 0.137245 0.141386 0.146263 0.152245 0.159111 0.167429 0.176864 0.188277 0.201161 0.216834 0.234472 0.256198 0.280334 0.310702 0.342387 0.127916 0.128486 0.129754 0.131629 0.13425 0.13752 0.141675 0.14657 0.152577 0.159478 0.167845 0.17735 0.188868 0.201899 0.217817 0.235798 0.25814 0.28317 0.315148 0.349449 0.128132 0.128702 0.129973 0.131852 0.134479 0.137757 0.141924 0.146835 0.152864 0.159795 0.168205 0.17777 0.18938 0.202538 0.21867 0.236947 0.259824 0.285632 0.318996 0.355571 0.128312 0.128883 0.130156 0.132038 0.134671 0.137955 0.142132 0.147056 0.153104 0.160061 0.168507 0.178122 0.18981 0.203073 0.219388 0.237914 0.261241 0.287708 0.322228 0.360724 0.128456 0.129028 0.130303 0.132187 0.134824 0.138115 0.142299 0.147235 0.153297 0.160274 0.16875 0.178405 0.190156 0.203505 0.219967 0.238694 0.262384 0.289384 0.324832 0.364878 0.128565 0.129137 0.130413 0.1323 0.13494 0.138235 0.142425 0.147369 0.153442 0.160435 0.168933 0.178618 0.190417 0.20383 0.220404 0.239283 0.263246 0.29065 0.326796 0.368013 0.128637 0.129209 0.130486 0.132375 0.135017 0.138315 0.14251 0.147458 0.153539 0.160542 0.169055 0.17876 0.190592 0.204047 0.220696 0.239677 0.263823 0.291499 0.32811 0.370113 0.128674 0.129245 0.130523 0.132412 0.135056 0.138355 0.142552 0.147503 0.153588 0.160596 0.169117 0.178831 0.190679 0.204156 0.220842 0.239875 0.264113 0.291924 0.328769 0.371166 -0.014487 -0.0146373 -0.014947 -0.0154181 -0.0160562 -0.0168663 -0.0178611 -0.0190533 -0.0204677 -0.0221308 -0.0240912 -0.0264057 -0.0291713 -0.0325033 -0.0365612 -0.0414388 -0.0469384 -0.0516541 -0.0505641 -0.0279211 -0.0137305 -0.0138747 -0.0141716 -0.0146218 -0.0152308 -0.0159996 -0.0169388 -0.0180516 -0.0193566 -0.0208601 -0.0225918 -0.0245568 -0.0267827 -0.0292181 -0.0317567 -0.0339813 -0.0351031 -0.0335681 -0.0274855 -0.0154339 -0.0122378 -0.0123746 -0.01265 -0.013067 -0.0136269 -0.0143307 -0.0151773 -0.0161659 -0.0172921 -0.0185488 -0.0199172 -0.0213615 -0.0228058 -0.0241153 -0.0250623 -0.0253358 -0.0246108 -0.0227773 -0.020218 -0.0178113 -0.0100496 -0.0101774 -0.0104308 -0.0108137 -0.0113243 -0.0119621 -0.0127172 -0.0135831 -0.014539 -0.0155675 -0.0166244 -0.0176672 -0.0186108 -0.0193862 -0.0198962 -0.0201423 -0.020164 -0.0201558 -0.0201134 -0.0196423 -0.00720419 -0.00732509 -0.007564 -0.00792438 -0.0084038 -0.00899926 -0.00969864 -0.0104915 -0.0113556 -0.0122731 -0.0132101 -0.0141451 -0.0150421 -0.0159009 -0.0167156 -0.0175362 -0.0183605 -0.0191702 -0.0197274 -0.0196871 -0.00372587 -0.00384577 -0.00408326 -0.00444156 -0.00491892 -0.00551205 -0.00621072 -0.00700594 -0.00788213 -0.00882941 -0.00983149 -0.0108848 -0.0119793 -0.0131239 -0.0143088 -0.0155321 -0.0167345 -0.0178453 -0.0186995 -0.0191038 0.000384834 0.000258726 8.01649e-06 -0.000370893 -0.000877412 -0.00150996 -0.00226145 -0.003127 -0.00409718 -0.00516867 -0.00633263 -0.00758919 -0.00892756 -0.0103458 -0.0118191 -0.0133304 -0.0148266 -0.0162668 -0.0175408 -0.0184861 0.00515648 0.00501794 0.0047415 0.00432308 0.00376225 0.00305864 0.00221674 0.0012382 0.00012942 -0.00110883 -0.00246838 -0.00394838 -0.00553501 -0.0072243 -0.00899252 -0.0108317 -0.0127026 -0.0145779 -0.0163449 -0.0178162 0.0106453 0.0104901 0.0101797 0.00970981 0.00907943 0.0082869 0.00733494 0.00622302 0.00495575 0.00353217 0.00195948 0.000236993 -0.00162335 -0.00362189 -0.00574 -0.00797608 -0.010293 -0.0126618 -0.0149621 -0.0170067 0.0169276 0.016754 0.016406 0.0158796 0.0151739 0.0142861 0.0132174 0.0119649 0.0105306 0.00891053 0.00710872 0.00512041 0.00295399 0.000604733 -0.00191119 -0.00459474 -0.00740926 -0.0103301 -0.0132476 -0.0160079 0.0240893 0.0238975 0.0235128 0.0229314 0.0221527 0.0211726 0.0199903 0.0185994 0.0169986 0.015179 0.0131408 0.0108734 0.00838136 0.00565482 0.00270769 -0.000465835 -0.00383409 -0.0073901 -0.01106 -0.0147794 0.032211 0.0320044 0.0315894 0.0309628 0.0301238 0.029066 0.0277855 0.0262708 0.0245164 0.0225073 0.0202396 0.0176959 0.0148758 0.0117604 0.00835772 0.00464987 0.000657826 -0.00364294 -0.00824017 -0.0132321 0.0413488 0.0411355 0.0407065 0.0400584 0.0391898 0.0380897 0.0367487 0.0351468 0.033272 0.0311009 0.028625 0.0258187 0.0226777 0.0191706 0.015296 0.0110117 0.0063168 0.0011366 -0.004595 -0.0111831 0.0515054 0.0513016 0.0508903 0.0502676 0.04943 0.0483589 0.0470357 0.0454263 0.043507 0.0412383 0.0386024 0.0355603 0.0321046 0.0281924 0.0238186 0.0189116 0.0134385 0.00724525 0.000178701 -0.00823667 0.0625916 0.0624244 0.0620837 0.0615647 0.0608603 0.0599421 0.0587788 0.0573176 0.0555143 0.0533022 0.0506386 0.0474534 0.0437214 0.0393791 0.0344271 0.0287839 0.0224163 0.0150962 0.00656686 -0.00387141 0.074381 0.0742901 0.0740953 0.0737922 0.0733676 0.072787 0.0720041 0.0709504 0.0695537 0.0677161 0.0653469 0.0623209 0.0585454 0.053891 0.0483125 0.0417137 0.0341087 0.0253023 0.0150288 0.00235265 0.0864716 0.0865065 0.0865478 0.0865964 0.0866298 0.0866193 0.0865024 0.0862144 0.085651 0.0847063 0.0832219 0.0810307 0.0779049 0.0736045 0.0678618 0.0604311 0.0511706 0.039979 0.0267942 0.0107438 0.0982833 0.0984879 0.0988493 0.0993797 0.100046 0.100841 0.101689 0.102563 0.10333 0.103929 0.104133 0.103811 0.102574 0.10016 0.0959146 0.0893381 0.0794541 0.0656076 0.0471019 0.0242076 0.109118 0.109502 0.110226 0.111314 0.112725 0.114482 0.116519 0.118865 0.121391 0.124125 0.126816 0.129462 0.131573 0.133062 0.132948 0.130877 0.124785 0.113383 0.0915609 0.0535604 0.118286 0.118809 0.119879 0.121488 0.123636 0.126336 0.12961 0.133478 0.137959 0.143053 0.148747 0.154983 0.161648 0.168506 0.17514 0.180748 0.183812 0.181299 0.166607 0.124797 0.00679916 0.0189472 0.0226657 0.0200952 0.0163336 0.0136201 0.0118591 0.0104086 0.00893482 0.00741809 0.00593204 0.00452012 0.00318453 0.00191264 0.00069452 -0.000474218 -0.00159546 -0.00267102 -0.00370326 -0.00469472 -0.00499386 -0.00138963 -0.0001342 -0.000753898 -0.00179414 -0.00258068 -0.00312584 -0.00361345 -0.00414019 -0.00470933 -0.0052957 -0.0058833 -0.00646886 -0.00705384 -0.00763909 -0.0082239 -0.00880691 -0.00938696 -0.00996317 -0.0105349 -0.0165095 -0.0160283 -0.0155142 -0.0150953 -0.0147833 -0.0145527 -0.0143829 -0.014265 -0.0141958 -0.0141731 -0.0141938 -0.0142544 -0.0143514 -0.0144814 -0.0146415 -0.0148288 -0.0150407 -0.0152748 -0.0155287 -0.0158004 -0.019164 -0.0189396 -0.0186699 -0.0184411 -0.018273 -0.0181515 -0.0180623 -0.0179999 -0.0179646 -0.0179573 -0.0179778 -0.0180247 -0.0180965 -0.0181917 -0.0183092 -0.0184477 -0.0186058 -0.0187823 -0.018976 -0.0191855 -0.0193696 -0.019249 -0.0192385 -0.0193253 -0.0194399 -0.0195469 -0.0196465 -0.0197493 -0.0198617 -0.0199851 -0.0201188 -0.0202624 -0.020416 -0.0205799 -0.0207544 -0.0209395 -0.021135 -0.0213407 -0.0215565 -0.0217819 -0.0191286 -0.0191446 -0.0192939 -0.0195389 -0.0197989 -0.0200408 -0.0202689 -0.0204952 -0.0207256 -0.0209606 -0.0211992 -0.0214411 -0.0216867 -0.0219366 -0.0221913 -0.022451 -0.0227159 -0.0229861 -0.0232618 -0.0235428 -0.0189118 -0.0190729 -0.0193458 -0.0196936 -0.0200504 -0.0203913 -0.0207209 -0.0210488 -0.0213791 -0.0217118 -0.0220458 -0.0223807 -0.022717 -0.0230549 -0.0233948 -0.023737 -0.0240815 -0.0244286 -0.0247783 -0.0251307 -0.018576 -0.0188556 -0.0192367 -0.019682 -0.0201332 -0.0205694 -0.0209958 -0.0214207 -0.0218476 -0.0222758 -0.0227045 -0.0231331 -0.0235619 -0.0239912 -0.0244213 -0.0248521 -0.0252839 -0.0257167 -0.0261506 -0.0265858 -0.0181316 -0.0185405 -0.019038 -0.0195894 -0.0201439 -0.020685 -0.0212177 -0.0217494 -0.0222826 -0.0228166 -0.0233504 -0.0238836 -0.0244163 -0.0249488 -0.0254813 -0.0260137 -0.0265462 -0.0270787 -0.0276115 -0.0281446 -0.0176155 -0.0181911 -0.0188195 -0.0194807 -0.0201436 -0.020799 -0.0214503 -0.0221016 -0.0227536 -0.0234058 -0.0240575 -0.0247085 -0.025359 -0.0260089 -0.0266585 -0.0273075 -0.0279562 -0.0286044 -0.0292524 -0.0299001 -0.0170658 -0.0178701 -0.0186514 -0.0194257 -0.0202035 -0.0209877 -0.021776 -0.0225652 -0.0233538 -0.0241418 -0.0249296 -0.0257174 -0.0265051 -0.0272925 -0.0280794 -0.028866 -0.0296521 -0.0304377 -0.031223 -0.032008 -0.0164283 -0.0175294 -0.0184931 -0.0193954 -0.0203084 -0.0212493 -0.0222043 -0.02316 -0.0241122 -0.0250627 -0.0260137 -0.0269657 -0.0279183 -0.0288709 -0.0298232 -0.0307754 -0.0317273 -0.032679 -0.0336305 -0.0345819 -0.0155029 -0.0169606 -0.0181572 -0.0192382 -0.0203412 -0.0214943 -0.0226695 -0.0238425 -0.025008 -0.0261703 -0.0273333 -0.0284978 -0.029663 -0.0308282 -0.0319931 -0.0331576 -0.0343219 -0.035486 -0.0366501 -0.0378141 -0.0138675 -0.015763 -0.0173 -0.0186657 -0.0200546 -0.0215076 -0.0229862 -0.0244572 -0.0259146 -0.0273651 -0.0288143 -0.0302633 -0.0317111 -0.033157 -0.034601 -0.0360433 -0.0374844 -0.0389247 -0.0403643 -0.0418039 -0.0109971 -0.0134457 -0.0155086 -0.0173509 -0.0191975 -0.0211044 -0.0230311 -0.0249416 -0.0268303 -0.0287054 -0.0305733 -0.0324353 -0.0342908 -0.0361397 -0.0379823 -0.0398191 -0.0416509 -0.0434779 -0.0453009 -0.0471201 -0.00631153 -0.00936358 -0.0121326 -0.014717 -0.0172802 -0.0198601 -0.0224287 -0.0249648 -0.0274666 -0.0299388 -0.0323855 -0.0348094 -0.037213 -0.0395987 -0.0419686 -0.0443251 -0.0466704 -0.0490073 -0.0513381 -0.0536654 -4.18111e-05 -0.00383065 -0.00752085 -0.0111696 -0.0147662 -0.0183268 -0.0218805 -0.0254251 -0.0289334 -0.0323852 -0.0357797 -0.0391257 -0.0424287 -0.0456882 -0.0489019 -0.0520687 -0.0551892 -0.0582648 -0.0612971 -0.0642872 0.00814648 0.00202451 -0.00344547 -0.00805391 -0.0122244 -0.0164996 -0.0210468 -0.0256945 -0.0302508 -0.0346733 -0.0390183 -0.0433396 -0.0476513 -0.0519452 -0.0562149 -0.0604627 -0.0646962 -0.0689233 -0.0731513 -0.0773871 0.022144 0.00823997 -0.00394107 -0.011342 -0.0168763 -0.0233156 -0.0308177 -0.0383634 -0.0453671 -0.0518852 -0.0581434 -0.0642378 -0.0701427 -0.0758113 -0.0812236 -0.0863817 -0.0912908 -0.0959514 -0.100359 -0.104507 0.0791301 0.0510023 0.0303149 0.0204884 0.0117118 -0.000165569 -0.0135065 -0.0263913 -0.03852 -0.0503069 -0.0619954 -0.0735577 -0.0849004 -0.0959814 -0.106808 -0.117405 -0.127796 -0.138009 -0.148077 -0.158043 ) ; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value nonuniform 0(); } cylinder { type zeroGradient; } top { type symmetryPlane; } bottom { type symmetryPlane; } defaultFaces { type empty; } procBoundary0to1 { type processor; value nonuniform List<scalar> 80 ( -0.464753 -0.451332 -0.439727 -0.427375 -0.413035 -0.396963 -0.379728 -0.361983 -0.34435 -0.327312 -0.31118 -0.296115 -0.282166 -0.269311 -0.257484 -0.246601 -0.236578 -0.227308 -0.218613 -0.210722 -0.464719 -0.451298 -0.439693 -0.427341 -0.413001 -0.396927 -0.37969 -0.361944 -0.34431 -0.327271 -0.311138 -0.296072 -0.282122 -0.269266 -0.257438 -0.246554 -0.23653 -0.22726 -0.218563 -0.210671 -0.168022 -0.108455 -0.0817009 -0.0672924 -0.0560412 -0.0489799 -0.0432815 -0.0390102 -0.0355601 -0.0328147 -0.0305655 -0.0286915 -0.0270325 -0.0254898 -0.0238277 -0.0220064 -0.0194153 -0.0161224 -0.011196 -0.0058033 -0.00564784 -0.0111015 -0.0160877 -0.0194098 -0.0220167 -0.0238293 -0.025486 -0.0270223 -0.028678 -0.0305477 -0.0327926 -0.0355332 -0.0389782 -0.0432436 -0.0489361 -0.0559916 -0.0672364 -0.0816382 -0.108385 -0.167964 ) ; } } // ************************************************************************* //
[ "mars2020@login2.stampede2.tacc.utexas.edu" ]
mars2020@login2.stampede2.tacc.utexas.edu
f55d62edb87b0a77e429897d6db5da1bd703b007
ac78bbc4272790c4a7203ed57c3afeff7efb2d75
/InfernoEngine/DirectX11Pract1/PhysX/Include/extensions/PxParticleExt.h
1a8ce25a70f95d3eacf94bc9732c7a098612f4e5
[]
no_license
AniketShark/Inferno3D
9ab8bbc4a5d0a70298a76f2a9c1755b7a779f053
097bdf2012803946472c1581ebdbd745c89d71a7
refs/heads/master
2022-07-26T21:26:47.840375
2022-07-17T17:00:47
2022-07-17T17:00:47
215,674,658
1
0
null
null
null
null
UTF-8
C++
false
false
7,425
h
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation and // any modifications thereto. Any use, reproduction, disclosure, or // distribution of this software and related documentation without an express // license agreement from NVIDIA Corporation is strictly prohibited. // // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. // // Information and code furnished is believed to be accurate and reliable. // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such // information or for any infringement of patents or other rights of third parties that may // result from its use. No license is granted by implication or otherwise under any patent // or patent rights of NVIDIA Corporation. Details are subject to change without notice. // This code supersedes and replaces all information previously supplied. // NVIDIA Corporation products are not authorized for use as critical // components in life support devices or systems without express written approval of // NVIDIA Corporation. // // Copyright (c) 2008-2013 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PHYSICS_EXTENSIONS_PARTICLEEXT_H #define PX_PHYSICS_EXTENSIONS_PARTICLEEXT_H /** \addtogroup extensions @{ */ #include "PxPhysX.h" #include "foundation/PxStrideIterator.h" #include "foundation/PxBounds3.h" #ifndef PX_DOXYGEN namespace physx { #endif class PxParticleExt { public: struct ParticleBounds { PxBounds3 bounds; PxU32 firstParticle; PxU32 numParticles; }; /** \brief Computes particle bounds by sorting particle positions into a spatial hash grid. Given a strided array of particle positions, this function partitions the particles into subsets of nearby particles by mapping the particle positions onto a 3-dimensional grid and creating ParticleBounds data structures for each occupied grid cell. Each returned ParticleBounds data structure can be used to determine the indices of the particles belonging to the same grid cell. Particle indices of one grid cell are returned as contiguous blocks in the sortedParticleIndices buffer and can be found within the range [firstParticle, firstParticle + numParticles - 1]. Each returned ParticleBounds further contains an AABB "bounds" that tightly fits all particle positions within the grid cell. The number of created ParticleBounds can be retrieved via the return value. The user can cap the maximum amount of generated ParticleBounds via the maxBounds parameter. Particles that would cause this maximum to be exceeded will be skipped over and will not be part of any returned ParticleBounds. (Note that this also hold when maxBounds is equal to hashSize. Thus, in the worst case, if no particle should ever be skipped over by the algorithm "hashSize" must be at least equal to numParticles) The user is responsible for allocating the output buffers sortedParticleIndices (for at least numParticles entries) and particleBounds (for at least maxBounds entries). The size of a cubical grid cell can be tuned by setting the gridSpacing parameter. The user supplied hashSize must be a power of two. \param[out] sortedParticleIndices Pointer to user allocated array of size numParticles where the sorted particle indices will be written to. \param[out] particleBounds Pointer to user allocated array of size maxBounds where the ParticleBounds will be written to. \param[in] positionBuffer Strided data of input particle positions. \param[in] validParticleRange Range of valid particles within validParticleBitmap. (See PxParticleReadData.validParticleRange). \param[in] validParticleBitmap Bitmap specifying valid slots in positionBuffer. (See PxParticleReadData.validParticleBitmap). \param[in] hashSize Hash size used internally by the hashing algorithm. Must be a power of two. \param[in] maxBounds Maximum number of bounds to be returned. Must be smaller or equal than hashSize. \param[in] gridSpacing Side length of each cubical grid cell. \return PxU32. Number of ParticleBounds data structures written to the particleBounds buffer. Smaller or equal than maxBounds. */ static PxU32 buildBoundsHash(PxU32* sortedParticleIndices, ParticleBounds* particleBounds, const PxStrideIterator<const PxVec3>& positionBuffer, const PxU32 validParticleRange, const PxU32* validParticleBitmap, const PxU32 hashSize, const PxU32 maxBounds, const PxReal gridSpacing); /** \brief Class to manage particle indices. Extension particle index management can be useful if no application side particle index allocation functionality is available. An PxParticleExt::IndexPool instance is meant to be used for one PxParticleSystem/PxParticleFluid instance. The instance can be created with PxParticleExt::createIndexPool(). */ class IndexPool { public: /** \brief Allocates a requested number of indices if possible. \param[in] num Number of indices that should be allocated. \param[out] indexBuffer Strided data to which allocated indices are written. \return PxU32. Number of indices that where allocated by the operation. */ virtual PxU32 allocateIndices(PxU32 num, const PxStrideIterator<PxU32>& indexBuffer) = 0; /** \brief Deallocates a requested number of indices. \param[in] num Number of indices that should be freed. \param[in] indexBuffer Strided data describing the indices that need to be freed. It's a requirement to specify unique indices, that where previously allocated by PxParticlesExt::allocateIndices() */ virtual void freeIndices(PxU32 num, const PxStrideIterator<const PxU32>& indexBuffer) = 0; /** \brief Deallocates all previously allocated indices. */ virtual void freeIndices() = 0; /** \brief Releases IndexPool instance. */ virtual void release() = 0; /** \brief virtual destructor */ virtual ~IndexPool() {}; }; /** \brief Creates a PxParticlesExt::IndexPool instance. \param[in] maxParticles Maximum number of available indices. */ static IndexPool* createIndexPool(PxU32 maxParticles); /** \brief Creates a PxParticlesExt::IndexPool instance initialized with a preallocated set of indices specified with a bitmap. \param[in] maxParticles Maximum number of available indices. \param[in] validParticleRange Range of indices represented in validParticleBitmap. (See PxParticleReadData.validParticleRange). \param[in] validParticleBitmap Bitmap specifying the valid particle indices that should be preallocated. (See PxParticleReadData.validParticleBitmap). */ static IndexPool* createIndexPool(PxU32 maxParticles, PxU32 validParticleRange, const PxU32* validParticleBitmap); }; #ifndef PX_DOXYGEN } // namespace physx #endif /** @} */ #endif
[ "aniket.kayande@gmail.com" ]
aniket.kayande@gmail.com
bd5828c54ade9f7f9a13ecbc127433997d3c9277
29a4c1e436bc90deaaf7711e468154597fc379b7
/modules/boost_math/include/nt2/toolbox/boost_math/function/simd/sse/sse4_1/gamma_q_inva.hpp
b1205346871f8c7ce8e16af247491defaf3c931d
[ "BSL-1.0" ]
permissive
brycelelbach/nt2
31bdde2338ebcaa24bb76f542bd0778a620f8e7c
73d7e8dd390fa4c8d251c6451acdae65def70e0b
refs/heads/master
2021-01-17T12:41:35.021457
2011-04-03T17:37:15
2011-04-03T17:37:15
1,263,345
1
0
null
null
null
null
UTF-8
C++
false
false
752
hpp
////////////////////////////////////////////////////////////////////////////// /// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand /// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI /// /// Distributed under the Boost Software License, Version 1.0 /// See accompanying file LICENSE.txt or copy at /// http://www.boost.org/LICENSE_1_0.txt ////////////////////////////////////////////////////////////////////////////// #ifndef NT2_TOOLBOX_BOOST_MATH_FUNCTION_SIMD_SSE_SSE4_1_GAMMA_Q_INVA_HPP_INCLUDED #define NT2_TOOLBOX_BOOST_MATH_FUNCTION_SIMD_SSE_SSE4_1_GAMMA_Q_INVA_HPP_INCLUDED #include <nt2/toolbox/boost_math/function/simd/sse/ssse3/gamma_q_inva.hpp> #endif
[ "jtlapreste@gmail.com" ]
jtlapreste@gmail.com
bc7b3fb8ddfbb7519bb10740235c568d0d3211f2
36e64b9b9b444bd26fa0c13a16504db2cb0177b2
/src/qt/sendcoinsdialog.h
985822cfa97170e05846e16a14b3274e9513e404
[ "MIT" ]
permissive
growaleaf/CastleMN
c055aac4bee4c5a0936cdbd08c2c5274dff4dcf2
6a459cb61ebedf0e2dafed80792650944f334ae6
refs/heads/master
2021-07-05T12:35:44.739836
2020-05-11T11:38:05
2020-05-11T11:38:05
156,276,345
6
4
MIT
2019-06-22T10:23:22
2018-11-05T20:10:31
C++
UTF-8
C++
false
false
3,682
h
// Copyright (c) 2011-2013 The Bitcoin developers // Copyright (c) 2017 The PIVX developers // Copyright (c) 2018 The CSTL developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_SENDCOINSDIALOG_H #define BITCOIN_QT_SENDCOINSDIALOG_H #include "walletmodel.h" #include <QDialog> #include <QString> static const int MAX_SEND_POPUP_ENTRIES = 10; class ClientModel; class OptionsModel; class SendCoinsEntry; class SendCoinsRecipient; namespace Ui { class SendCoinsDialog; } QT_BEGIN_NAMESPACE class QUrl; QT_END_NAMESPACE /** Dialog for sending bitcoins */ class SendCoinsDialog : public QDialog { Q_OBJECT public: explicit SendCoinsDialog(QWidget* parent = 0); ~SendCoinsDialog(); void setClientModel(ClientModel* clientModel); void setModel(WalletModel* model); /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ QWidget* setupTabChain(QWidget* prev); void setAddress(const QString& address); void pasteEntry(const SendCoinsRecipient& rv); bool handlePaymentRequest(const SendCoinsRecipient& recipient); bool fSplitBlock; public slots: void clear(); void reject(); void accept(); SendCoinsEntry* addEntry(); void updateTabsAndLabels(); void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& zerocoinBalance, const CAmount& unconfirmedZerocoinBalance, const CAmount& immatureZerocoinBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance); private: Ui::SendCoinsDialog* ui; ClientModel* clientModel; WalletModel* model; bool fNewRecipientAllowed; void send(QList<SendCoinsRecipient> recipients, QString strFee, QStringList formatted); bool fFeeMinimized; // Process WalletModel::SendCoinsReturn and generate a pair consisting // of a message and message flags for use in emit message(). // Additional parameter msgArg can be used via .arg(msgArg). void processSendCoinsReturn(const WalletModel::SendCoinsReturn& sendCoinsReturn, const QString& msgArg = QString(), bool fPrepare = false); void minimizeFeeSection(bool fMinimize); void updateFeeMinimizedLabel(); private slots: void on_sendButton_clicked(); void on_buttonChooseFee_clicked(); void on_buttonMinimizeFee_clicked(); void removeEntry(SendCoinsEntry* entry); void updateDisplayUnit(); void updateSwiftTX(); void coinControlFeatureChanged(bool); void coinControlButtonClicked(); void coinControlChangeChecked(int); void coinControlChangeEdited(const QString&); void coinControlUpdateLabels(); void coinControlClipboardQuantity(); void coinControlClipboardAmount(); void coinControlClipboardFee(); void coinControlClipboardAfterFee(); void coinControlClipboardBytes(); void coinControlClipboardPriority(); void coinControlClipboardLowOutput(); void coinControlClipboardChange(); void splitBlockChecked(int); void splitBlockLineEditChanged(const QString& text); void setMinimumFee(); void updateFeeSectionControls(); void updateMinFeeLabel(); void updateSmartFeeLabel(); void updateGlobalFeeVariables(); signals: // Fired when a message should be reported to the user void message(const QString& title, const QString& message, unsigned int style); }; #endif // BITCOIN_QT_SENDCOINSDIALOG_H
[ "afghany@gmail.com" ]
afghany@gmail.com
7dde2d1bb468761c5cf0e5779e7a73207e3fd223
47049b8d15dd0e574d7e59b86948b7fd9ae40553
/sources/Word.h
4bde4f0b6b9c4d2d6c4ab94fd80f8d96042b2b41
[]
no_license
IvannaBaglay/DragonCompiler
ddcd9c6f297f0d0542034a2360df952f5d08d5a7
5426282fa7aa84b42c9e152f52aee80baf43e598
refs/heads/master
2020-05-19T19:01:11.399324
2019-05-06T09:45:48
2019-05-06T09:45:48
185,169,034
0
0
null
null
null
null
UTF-8
C++
false
false
625
h
#pragma once #include "Token.h" #include <iostream> class Word : public Token { public: Word(std::string str, Tag t); virtual ~Word(void); virtual std::string toString() const; bool operator==(const Word& rhs); friend bool operator<(const Word& lhs, const Word& rhs); friend std::ostream& operator<<(std::ostream& os, const Word& word); static Word* WordNULL; static Word* WordOR; static Word* WordEQ; static Word* WordNE; static Word* WordLE; static Word* WordGE; static Word* WordMINUS; static Word* WordTRUE; static Word* WordFALSE; static Word* WordTEMP; static Word* WordAND; std::string w_lexme; };
[ "ibaglaystud@ukr.net" ]
ibaglaystud@ukr.net
dc5fdba5ca63c151efa0f82f39a1b7ea69548310
be40ab7749de545955bf23e27a42c07bda8c3977
/frmts/stacta/stactadataset.cpp
5ac62197ba2dc042172ea98bfc32adf732b893c4
[ "MIT", "LicenseRef-scancode-warranty-disclaimer", "SunPro", "LicenseRef-scancode-info-zip-2005-02", "BSD-3-Clause", "ISC", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
permissive
tobwen/gdal
9d375191619221432123a05a3f04b046957dcdeb
663f82f1182acaa743b6d83d64f0976fc696a917
refs/heads/master
2023-03-17T03:03:27.929624
2022-09-08T18:58:06
2022-09-08T18:58:06
188,910,485
0
0
null
2019-05-27T21:21:04
2019-05-27T21:21:04
null
UTF-8
C++
false
false
49,742
cpp
/****************************************************************************** * * Project: GDAL * Purpose: STACTA (Spatio-Temporal Asset Catalog Tiled Assets) driver * Author: Even Rouault, <even dot rouault at spatialys.com> * ****************************************************************************** * Copyright (c) 2020, Even Rouault <even dot rouault at spatialys.com> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "cpl_json.h" #include "cpl_mem_cache.h" #include "cpl_string.h" #include "gdal_pam.h" #include "gdal_utils.h" #include "memdataset.h" #include "tilematrixset.hpp" #include "stactadataset.h" #include <algorithm> #include <array> #include <map> #include <memory> #include <vector> extern "C" void GDALRegister_STACTA(); CPL_CVSID("$Id$") // Implements a driver for // https://github.com/stac-extensions/tiled-assets /************************************************************************/ /* STACTARasterBand() */ /************************************************************************/ STACTARasterBand::STACTARasterBand(STACTADataset* poDSIn, int nBandIn, GDALRasterBand* poProtoBand): m_eColorInterp(poProtoBand->GetColorInterpretation()) { poDS = poDSIn; nBand = nBandIn; eDataType = poProtoBand->GetRasterDataType(); poProtoBand->GetBlockSize(&nBlockXSize, &nBlockYSize); nRasterXSize = poDSIn->GetRasterXSize(); nRasterYSize = poDSIn->GetRasterYSize(); m_dfNoData = poProtoBand->GetNoDataValue(&m_bHasNoDataValue); } /************************************************************************/ /* IReadBlock() */ /************************************************************************/ CPLErr STACTARasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, void* pImage) { auto poGDS = cpl::down_cast<STACTADataset*>(poDS); return poGDS->m_poDS->GetRasterBand(nBand)->ReadBlock(nBlockXOff, nBlockYOff, pImage); } /************************************************************************/ /* IRasterIO() */ /************************************************************************/ CPLErr STACTARasterBand::IRasterIO( GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void* pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, GSpacing nPixelSpace, GSpacing nLineSpace, GDALRasterIOExtraArg* psExtraArg ) { auto poGDS = cpl::down_cast<STACTADataset*>(poDS); if( (nBufXSize < nXSize || nBufYSize < nYSize) && poGDS->m_apoOverviewDS.size() >= 1 && eRWFlag == GF_Read ) { int bTried; CPLErr eErr = TryOverviewRasterIO( eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nPixelSpace, nLineSpace, psExtraArg, &bTried ); if( bTried ) return eErr; } return poGDS->m_poDS->GetRasterBand(nBand)->RasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nPixelSpace, nLineSpace, psExtraArg); } /************************************************************************/ /* IRasterIO() */ /************************************************************************/ CPLErr STACTADataset::IRasterIO( GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void * pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, GSpacing nPixelSpace, GSpacing nLineSpace, GSpacing nBandSpace, GDALRasterIOExtraArg* psExtraArg) { if( (nBufXSize < nXSize || nBufYSize < nYSize) && m_apoOverviewDS.size() >= 1 && eRWFlag == GF_Read ) { int bTried; CPLErr eErr = TryOverviewRasterIO( eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace, psExtraArg, &bTried ); if( bTried ) return eErr; } return m_poDS->RasterIO( eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace, psExtraArg ); } /************************************************************************/ /* GetOverviewCount() */ /************************************************************************/ int STACTARasterBand::GetOverviewCount() { STACTADataset* poGDS = cpl::down_cast<STACTADataset*>(poDS); return static_cast<int>(poGDS->m_apoOverviewDS.size()); } /************************************************************************/ /* GetOverview() */ /************************************************************************/ GDALRasterBand* STACTARasterBand::GetOverview(int nIdx) { STACTADataset* poGDS = cpl::down_cast<STACTADataset*>(poDS); if( nIdx < 0 || nIdx >= GetOverviewCount() ) return nullptr; return poGDS->m_apoOverviewDS[nIdx]->GetRasterBand(nBand); } /************************************************************************/ /* GetNoDataValue() */ /************************************************************************/ double STACTARasterBand::GetNoDataValue(int* pbHasNoData) { if( pbHasNoData ) *pbHasNoData = m_bHasNoDataValue; return m_dfNoData; } /************************************************************************/ /* STACTARawRasterBand() */ /************************************************************************/ STACTARawRasterBand::STACTARawRasterBand(STACTARawDataset* poDSIn, int nBandIn, GDALRasterBand* poProtoBand): m_eColorInterp(poProtoBand->GetColorInterpretation()) { poDS = poDSIn; nBand = nBandIn; eDataType = poProtoBand->GetRasterDataType(); nBlockXSize = 256; nBlockYSize = 256; int nProtoBlockXSize; int nProtoBlockYSize; // Use tile block size if it divides the metatile dimension. poProtoBand->GetBlockSize(&nProtoBlockXSize, &nProtoBlockYSize); if( (poDSIn->m_nMetaTileWidth % nProtoBlockXSize) == 0 && (poDSIn->m_nMetaTileHeight % nProtoBlockYSize) == 0 ) { nBlockXSize = nProtoBlockXSize; nBlockYSize = nProtoBlockYSize; } nRasterXSize = poDSIn->GetRasterXSize(); nRasterYSize = poDSIn->GetRasterYSize(); m_dfNoData = poProtoBand->GetNoDataValue(&m_bHasNoDataValue); } /************************************************************************/ /* GetNoDataValue() */ /************************************************************************/ double STACTARawRasterBand::GetNoDataValue(int* pbHasNoData) { if( pbHasNoData ) *pbHasNoData = m_bHasNoDataValue; return m_dfNoData; } /************************************************************************/ /* IReadBlock() */ /************************************************************************/ CPLErr STACTARawRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, void* pImage) { const int nXOff = nBlockXOff * nBlockXSize; const int nYOff = nBlockYOff * nBlockYSize; const int nXSize = std::min(nBlockXSize, nRasterXSize - nXOff); const int nYSize = std::min(nBlockYSize, nRasterYSize - nYOff); GDALRasterIOExtraArg sExtraArgs; INIT_RASTERIO_EXTRA_ARG(sExtraArgs); const int nDTSize = GDALGetDataTypeSizeBytes(eDataType); return IRasterIO(GF_Read, nXOff, nYOff, nXSize, nYSize, pImage, nBlockXSize, nBlockYSize, eDataType, nDTSize, nDTSize * nBlockXSize, &sExtraArgs); } /************************************************************************/ /* IRasterIO() */ /************************************************************************/ CPLErr STACTARawRasterBand::IRasterIO( GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void* pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, GSpacing nPixelSpace, GSpacing nLineSpace, GDALRasterIOExtraArg* psExtraArg ) { CPLDebugOnly("STACTA", "Band %d RasterIO: %d,%d,%d,%d->%d,%d", nBand, nXOff, nYOff, nXSize, nYSize, nBufXSize, nBufYSize); auto poGDS = cpl::down_cast<STACTARawDataset*>(poDS); const int nKernelRadius = 3; // up to 3 for Lanczos const int nRadiusX = nKernelRadius * static_cast<int>(std::ceil(nXSize / nBufXSize)); const int nRadiusY = nKernelRadius * static_cast<int>(std::ceil(nYSize / nBufYSize)); const int nXOffMod = std::max(0, nXOff - nRadiusX); const int nYOffMod = std::max(0, nYOff - nRadiusY); const int nXSizeMod = static_cast<int>(std::min( nXOff + nXSize + static_cast<GIntBig>(nRadiusX), static_cast<GIntBig>(nRasterXSize))) - nXOffMod; const int nYSizeMod = static_cast<int>(std::min( nYOff + nYSize + static_cast<GIntBig>(nRadiusY), static_cast<GIntBig>(nRasterYSize))) - nYOffMod; const bool bRequestFitsInSingleMetaTile = nXOffMod / poGDS->m_nMetaTileWidth == (nXOffMod + nXSizeMod - 1) / poGDS->m_nMetaTileWidth && nYOffMod / poGDS->m_nMetaTileHeight == (nYOffMod + nYSizeMod - 1) / poGDS->m_nMetaTileHeight; if( eRWFlag != GF_Read || ((nXSize != nBufXSize || nYSize != nBufYSize) && !bRequestFitsInSingleMetaTile) ) { if( !(eRWFlag == GF_Read && nXSizeMod <= 4096 && nYSizeMod <= 4096) ) { // If not reading at nominal resolution, fallback to default block // reading return GDALRasterBand::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nPixelSpace, nLineSpace, psExtraArg); } } // Use optimized dataset level RasterIO() return poGDS->IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, 1, &nBand, nPixelSpace, nLineSpace, 0, psExtraArg); } /************************************************************************/ /* IRasterIO() */ /************************************************************************/ CPLErr STACTARawDataset::IRasterIO( GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void * pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, GSpacing nPixelSpace, GSpacing nLineSpace, GSpacing nBandSpace, GDALRasterIOExtraArg* psExtraArg) { CPLDebugOnly("STACTA", "Dataset RasterIO: %d,%d,%d,%d->%d,%d", nXOff, nYOff, nXSize, nYSize, nBufXSize, nBufYSize); const int nMinBlockX = nXOff / m_nMetaTileWidth; const int nMaxBlockX = (nXOff + nXSize - 1) / m_nMetaTileWidth; const int nMinBlockY = nYOff / m_nMetaTileHeight; const int nMaxBlockY = (nYOff + nYSize - 1) / m_nMetaTileHeight; const int nKernelRadius = 3; // up to 3 for Lanczos const int nRadiusX = nKernelRadius * static_cast<int>(std::ceil(nXSize / nBufXSize)); const int nRadiusY = nKernelRadius * static_cast<int>(std::ceil(nYSize / nBufYSize)); const int nXOffMod = std::max(0, nXOff - nRadiusX); const int nYOffMod = std::max(0, nYOff - nRadiusY); const int nXSizeMod = static_cast<int>(std::min( nXOff + nXSize + static_cast<GIntBig>(nRadiusX), static_cast<GIntBig>(nRasterXSize))) - nXOffMod; const int nYSizeMod = static_cast<int>(std::min( nYOff + nYSize + static_cast<GIntBig>(nRadiusY), static_cast<GIntBig>(nRasterYSize))) - nYOffMod; const bool bRequestFitsInSingleMetaTile = nXOffMod / m_nMetaTileWidth == (nXOffMod + nXSizeMod - 1) / m_nMetaTileWidth && nYOffMod / m_nMetaTileHeight == (nYOffMod + nYSizeMod - 1) / m_nMetaTileHeight; const auto eBandDT = GetRasterBand(1)->GetRasterDataType(); const int nDTSize = GDALGetDataTypeSizeBytes(eBandDT); if( eRWFlag != GF_Read || ((nXSize != nBufXSize || nYSize != nBufYSize) && !bRequestFitsInSingleMetaTile) ) { if( eRWFlag == GF_Read && nXSizeMod <= 4096 && nYSizeMod <= 4096 && nBandCount <= 10 ) { // If extracting from a small enough window, do a RasterIO() // at full resolution into a MEM dataset, and then proceeding to // resampling on it. This will avoid to fallback on block based // approach. GDALRasterIOExtraArg sExtraArgs; INIT_RASTERIO_EXTRA_ARG(sExtraArgs); std::vector<GByte> abyBuf(nXSizeMod * nYSizeMod * nBandCount * nDTSize); if( IRasterIO( GF_Read, nXOffMod, nYOffMod, nXSizeMod, nYSizeMod, &abyBuf[0], nXSizeMod, nYSizeMod, eBandDT, nBandCount, panBandMap, nDTSize, nDTSize * nXSizeMod, nDTSize * nXSizeMod * nYSizeMod, &sExtraArgs ) != CE_None ) { return CE_Failure; } auto poMEMDS = std::unique_ptr<MEMDataset>( MEMDataset::Create( "", nXSizeMod, nYSizeMod, 0, eBandDT, nullptr )); for( int i = 0; i < nBandCount; i++ ) { auto hBand = MEMCreateRasterBandEx( poMEMDS.get(), i + 1, &abyBuf[0] + i * nDTSize * nXSizeMod * nYSizeMod, eBandDT, 0, 0, false ); poMEMDS->AddMEMBand(hBand); } sExtraArgs.eResampleAlg = psExtraArg->eResampleAlg; if( psExtraArg->bFloatingPointWindowValidity ) { sExtraArgs.bFloatingPointWindowValidity = true; sExtraArgs.dfXOff = psExtraArg->dfXOff - nXOffMod; sExtraArgs.dfYOff = psExtraArg->dfYOff - nYOffMod; sExtraArgs.dfXSize = psExtraArg->dfXSize; sExtraArgs.dfYSize = psExtraArg->dfYSize; } return poMEMDS->RasterIO(GF_Read, nXOff - nXOffMod, nYOff - nYOffMod, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nBandCount, nullptr, nPixelSpace, nLineSpace, nBandSpace, &sExtraArgs); } // If not reading at nominal resolution, fallback to default block // reading return GDALDataset::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace, psExtraArg); } int nBufYOff = 0; // If the (uncompressed) size of a metatile is small enough, then download // it entirely to minimize the number of network requests const bool bDownloadWholeMetaTile = m_poMasterDS->m_bDownloadWholeMetaTile || (static_cast<GIntBig>(m_nMetaTileWidth) * m_nMetaTileHeight * nBands * nDTSize < 128 * 1024); // Avoid probing side car files std::unique_ptr<CPLConfigOptionSetter> poSetter; const CPLString osExt(CPLGetExtension(m_osURLTemplate)); if( osExt.size() > 0 && osExt.size() <= 3 ) { poSetter.reset(new CPLConfigOptionSetter( "CPL_VSIL_CURL_ALLOWED_EXTENSIONS", osExt, false)); } // Split the request on each metatile that it intersects for( int iY = nMinBlockY; iY <= nMaxBlockY; iY ++ ) { const int nTileYOff = std::max(0, nYOff - iY * m_nMetaTileHeight); const int nTileYSize = std::min((iY + 1) * m_nMetaTileHeight, nYOff + nYSize) - std::max(nYOff, iY * m_nMetaTileHeight); int nBufXOff = 0; for( int iX = nMinBlockX; iX <= nMaxBlockX; iX++ ) { CPLString osURL(m_osURLTemplate); osURL.replaceAll("{TileRow}", CPLSPrintf("%d", iY + m_nMinMetaTileRow)); osURL.replaceAll("{TileCol}", CPLSPrintf("%d", iX + m_nMinMetaTileCol)); const int nTileXOff = std::max(0, nXOff - iX * m_nMetaTileWidth); const int nTileXSize = std::min((iX + 1) * m_nMetaTileWidth, nXOff + nXSize) - std::max(nXOff, iX * m_nMetaTileWidth); const int nBufXSizeEffective = bRequestFitsInSingleMetaTile ? nBufXSize : nTileXSize; const int nBufYSizeEffective = bRequestFitsInSingleMetaTile ? nBufYSize : nTileYSize; std::shared_ptr<GDALDataset> poTileDS; bool bMissingTile = false; do { if( !m_poMasterDS->m_oCacheTileDS.tryGet(osURL, poTileDS) ) { CPLStringList aosAllowedDrivers; aosAllowedDrivers.AddString("GTiff"); aosAllowedDrivers.AddString("PNG"); aosAllowedDrivers.AddString("JPEG"); aosAllowedDrivers.AddString("JP2KAK"); aosAllowedDrivers.AddString("JP2ECW"); aosAllowedDrivers.AddString("JP2MrSID"); aosAllowedDrivers.AddString("JP2OpenJPEG"); if( bDownloadWholeMetaTile && !VSIIsLocal(osURL.c_str()) ) { if( m_poMasterDS->m_bSkipMissingMetaTile ) CPLPushErrorHandler(CPLQuietErrorHandler); VSILFILE* fp = VSIFOpenL(osURL, "rb"); if( m_poMasterDS->m_bSkipMissingMetaTile ) CPLPopErrorHandler(); if( fp == nullptr ) { if( m_poMasterDS->m_bSkipMissingMetaTile ) { m_poMasterDS->m_oCacheTileDS.insert(osURL, nullptr); bMissingTile = true; break; } CPLError(CE_Failure, CPLE_OpenFailed, "Cannot open %s", osURL.c_str()); return CE_Failure; } GByte* pabyBuf = nullptr; vsi_l_offset nSize = 0; if( !VSIIngestFile(fp, nullptr, &pabyBuf, &nSize, -1) ) { VSIFCloseL(fp); return CE_Failure; } VSIFCloseL(fp); const CPLString osMEMFilename("/vsimem/stacta/" + osURL); VSIFCloseL(VSIFileFromMemBuffer(osMEMFilename, pabyBuf, nSize, TRUE)); poTileDS = std::shared_ptr<GDALDataset>( GDALDataset::Open(osMEMFilename, GDAL_OF_INTERNAL | GDAL_OF_RASTER, aosAllowedDrivers.List())); if( poTileDS ) poTileDS->MarkSuppressOnClose(); else VSIUnlink(osMEMFilename); } else if( bDownloadWholeMetaTile || (!STARTS_WITH(osURL, "http://") && !STARTS_WITH(osURL, "https://")) ) { aosAllowedDrivers.AddString("HTTP"); if( m_poMasterDS->m_bSkipMissingMetaTile ) CPLPushErrorHandler(CPLQuietErrorHandler); poTileDS = std::shared_ptr<GDALDataset>( GDALDataset::Open(osURL, GDAL_OF_INTERNAL | GDAL_OF_RASTER, aosAllowedDrivers.List())); if( m_poMasterDS->m_bSkipMissingMetaTile ) CPLPopErrorHandler(); } else { if( m_poMasterDS->m_bSkipMissingMetaTile ) CPLPushErrorHandler(CPLQuietErrorHandler); poTileDS = std::shared_ptr<GDALDataset>( GDALDataset::Open(("/vsicurl/" + osURL).c_str(), GDAL_OF_INTERNAL | GDAL_OF_RASTER, aosAllowedDrivers.List())); if( m_poMasterDS->m_bSkipMissingMetaTile ) CPLPopErrorHandler(); } if( poTileDS == nullptr ) { if( m_poMasterDS->m_bSkipMissingMetaTile ) { m_poMasterDS->m_oCacheTileDS.insert(osURL, nullptr); bMissingTile = true; break; } CPLError(CE_Failure, CPLE_OpenFailed, "Cannot open %s", osURL.c_str()); return CE_Failure; } m_poMasterDS->m_oCacheTileDS.insert(osURL, poTileDS); } if( poTileDS == nullptr ) { bMissingTile = true; break; } GDALRasterIOExtraArg sExtraArgs; INIT_RASTERIO_EXTRA_ARG(sExtraArgs); if( bRequestFitsInSingleMetaTile ) { sExtraArgs.eResampleAlg = psExtraArg->eResampleAlg; if( psExtraArg->bFloatingPointWindowValidity ) { sExtraArgs.bFloatingPointWindowValidity = true; sExtraArgs.dfXOff = psExtraArg->dfXOff - iX * m_nMetaTileWidth; sExtraArgs.dfYOff = psExtraArg->dfYOff - iY * m_nMetaTileHeight; sExtraArgs.dfXSize = psExtraArg->dfXSize; sExtraArgs.dfYSize = psExtraArg->dfYSize; } } CPLDebugOnly("STACTA", "Reading %d,%d,%d,%d in %s", nTileXOff, nTileYOff, nTileXSize, nTileYSize, osURL.c_str()); if( poTileDS->RasterIO( GF_Read, nTileXOff, nTileYOff, nTileXSize, nTileYSize, static_cast<GByte*>(pData) + nBufXOff * nPixelSpace + nBufYOff * nLineSpace, nBufXSizeEffective, nBufYSizeEffective, eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace, &sExtraArgs) != CE_None ) { return CE_Failure; } } while(false); if( bMissingTile ) { CPLDebugOnly("STACTA", "Missing metatile %s", osURL.c_str()); for( int iBand = 0; iBand < nBandCount; iBand++ ) { int bHasNoData = FALSE; double dfNodata = GetRasterBand(panBandMap[iBand])->GetNoDataValue(&bHasNoData); if( !bHasNoData ) dfNodata = 0; for( int nYBufOff = 0; nYBufOff < nBufYSizeEffective; nYBufOff ++ ) { GByte* pabyDest = static_cast<GByte*>(pData) + iBand * nBandSpace + nBufXOff * nPixelSpace + (nBufYOff + nYBufOff) * nLineSpace; GDALCopyWords(&dfNodata, GDT_Float64, 0, pabyDest, eBufType, static_cast<int>(nPixelSpace), nBufXSizeEffective); } } } if( iX == nMinBlockX ) { nBufXOff = m_nMetaTileWidth - std::max(0, nXOff - nMinBlockX * m_nMetaTileWidth); } else { nBufXOff += m_nMetaTileWidth; } } if( iY == nMinBlockY ) { nBufYOff = m_nMetaTileHeight - std::max(0, nYOff - nMinBlockY * m_nMetaTileHeight); } else { nBufYOff += m_nMetaTileHeight; } } return CE_None; } /************************************************************************/ /* GetGeoTransform() */ /************************************************************************/ CPLErr STACTARawDataset::GetGeoTransform(double* padfGeoTransform) { memcpy(padfGeoTransform, &m_adfGeoTransform[0], 6 * sizeof(double)); return CE_None; } /************************************************************************/ /* Identify() */ /************************************************************************/ int STACTADataset::Identify(GDALOpenInfo* poOpenInfo) { if( STARTS_WITH(poOpenInfo->pszFilename, "STACTA:") ) { return true; } if( #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION !EQUAL(CPLGetExtension(poOpenInfo->pszFilename), "json") || #endif poOpenInfo->nHeaderBytes == 0 ) { return false; } for( int i = 0; i < 2; i++ ) { // TryToIngest() may reallocate pabyHeader, so do not move this // before the loop. const char* pszHeader = reinterpret_cast<const char*>(poOpenInfo->pabyHeader); if( strstr(pszHeader, "\"stac_extensions\"") != nullptr && strstr(pszHeader, "\"tiled-assets\"") != nullptr ) { return true; } if( i == 0 ) { // Should be enough for a STACTA .json file poOpenInfo->TryToIngest(32768); } } return false; } /************************************************************************/ /* Open() */ /************************************************************************/ bool STACTADataset::Open(GDALOpenInfo* poOpenInfo) { CPLString osFilename(poOpenInfo->pszFilename); CPLString osAssetName; CPLString osTMS; if( STARTS_WITH(poOpenInfo->pszFilename, "STACTA:") ) { const CPLStringList aosTokens( CSLTokenizeString2(poOpenInfo->pszFilename, ":", CSLT_HONOURSTRINGS )); if( aosTokens.size() != 2 && aosTokens.size() != 3 && aosTokens.size() != 4 ) return false; osFilename = aosTokens[1]; if( aosTokens.size() >= 3 ) osAssetName = aosTokens[2]; if( aosTokens.size() == 4 ) osTMS = aosTokens[3]; } CPLJSONDocument oDoc; if( STARTS_WITH(osFilename, "http://") || STARTS_WITH(osFilename, "https://") ) { if( !oDoc.LoadUrl(osFilename, nullptr) ) return false; } else { if( !oDoc.Load(osFilename) ) return false; } const auto oRoot = oDoc.GetRoot(); const auto oProperties = oRoot["properties"]; if( !oProperties.IsValid() || oProperties.GetType() != CPLJSONObject::Type::Object ) { CPLError(CE_Failure, CPLE_AppDefined, "Missing properties"); return false; } const auto oAssetTemplates = oRoot["asset_templates"]; if( !oAssetTemplates.IsValid() || oAssetTemplates.GetType() != CPLJSONObject::Type::Object ) { CPLError(CE_Failure, CPLE_AppDefined, "Missing asset_templates"); return false; } const auto aoAssetTemplates = oAssetTemplates.GetChildren(); if( aoAssetTemplates.size() == 0 ) { CPLError(CE_Failure, CPLE_AppDefined, "Empty asset_templates"); return false; } const auto oTMSs = oProperties.GetObj("tiles:tile_matrix_sets"); if( !oTMSs.IsValid() || oTMSs.GetType() != CPLJSONObject::Type::Object ) { CPLError(CE_Failure, CPLE_AppDefined, "Missing properties[\"tiles:tile_matrix_sets\"]"); return false; } const auto aoTMSs = oTMSs.GetChildren(); if( aoTMSs.empty() ) { CPLError(CE_Failure, CPLE_AppDefined, "Empty properties[\"tiles:tile_matrix_sets\"]"); return false; } if( (aoAssetTemplates.size() >= 2 || aoTMSs.size() >= 2) && osAssetName.empty() && osTMS.empty() ) { int nSDSCount = 0; for( const auto& oAssetTemplate: aoAssetTemplates ) { const CPLString osAssetNameSubDS = oAssetTemplate.GetName(); const char* pszAssetNameSubDS = osAssetNameSubDS.c_str(); if( aoTMSs.size() >= 2 ) { for( const auto& oTMS: aoTMSs ) { const CPLString osTMSSubDS = oTMS.GetName(); const char* pszTMSSubDS = osTMSSubDS.c_str(); GDALDataset::SetMetadataItem( CPLSPrintf("SUBDATASET_%d_NAME", nSDSCount+1), CPLSPrintf("STACTA:\"%s\":%s:%s", osFilename.c_str(), pszAssetNameSubDS, pszTMSSubDS), "SUBDATASETS"); GDALDataset::SetMetadataItem( CPLSPrintf("SUBDATASET_%d_DESC", nSDSCount+1), CPLSPrintf("Asset %s, tile matrix set %s", pszAssetNameSubDS, pszTMSSubDS), "SUBDATASETS"); nSDSCount ++; } } else { GDALDataset::SetMetadataItem( CPLSPrintf("SUBDATASET_%d_NAME", nSDSCount+1), CPLSPrintf("STACTA:\"%s\":%s", osFilename.c_str(), pszAssetNameSubDS), "SUBDATASETS"); GDALDataset::SetMetadataItem( CPLSPrintf("SUBDATASET_%d_DESC", nSDSCount+1), CPLSPrintf("Asset %s", pszAssetNameSubDS), "SUBDATASETS"); nSDSCount ++; } } return true; } if( osAssetName.empty() ) { osAssetName = aoAssetTemplates[0].GetName(); } const auto oAssetTemplate = oAssetTemplates.GetObj(osAssetName); if( !oAssetTemplate.IsValid() || oAssetTemplate.GetType() != CPLJSONObject::Type::Object ) { CPLError(CE_Failure, CPLE_AppDefined, "Cannot find asset_templates[\"%s\"]", osAssetName.c_str()); return false; } if( osTMS.empty() ) { osTMS = aoTMSs[0].GetName(); } const auto oTMS = oTMSs.GetObj(osTMS); if( !oTMS.IsValid() || oTMS.GetType() != CPLJSONObject::Type::Object ) { CPLError(CE_Failure, CPLE_AppDefined, "Cannot find properties[\"tiles:tile_matrix_sets\"][\"%s\"]", osTMS.c_str()); return false; } auto poTMS = gdal::TileMatrixSet::parse(oTMS.Format(CPLJSONObject::PrettyFormat::Plain).c_str()); if( poTMS == nullptr ) return false; CPLString osURLTemplate = oAssetTemplate.GetString("href"); if( osURLTemplate.empty() ) { CPLError(CE_Failure, CPLE_AppDefined, "Cannot find asset_templates[\"%s\"][\"href\"]", osAssetName.c_str()); } osURLTemplate.replaceAll("{TileMatrixSet}", osTMS); if( STARTS_WITH(osURLTemplate, "file://") ) { osURLTemplate = osURLTemplate.substr(strlen("file://")); } else if( STARTS_WITH(osURLTemplate, "s3://") ) { osURLTemplate = "/vsis3/" + osURLTemplate.substr(strlen("s3://")); } if( !STARTS_WITH(osURLTemplate, "http://") && !STARTS_WITH(osURLTemplate, "https://") ) { if( STARTS_WITH(osURLTemplate, "./") ) osURLTemplate = osURLTemplate.substr(2); osURLTemplate = CPLProjectRelativeFilename( CPLGetDirname(osFilename), osURLTemplate); } // Parse optional tile matrix set limits std::map<CPLString, Limits> oMapLimits; const auto oTMLinks = oProperties.GetObj("tiles:tile_matrix_links"); if( oTMLinks.IsValid() ) { if( oTMLinks.GetType() != CPLJSONObject::Type::Object ) { CPLError(CE_Failure, CPLE_AppDefined, "Invalid type for properties[\"tiles:tile_matrix_links\"]"); return false; } auto oLimits = oTMLinks[osTMS]["limits"]; if( oLimits.IsValid() && oLimits.GetType() == CPLJSONObject::Type::Object ) { for( const auto& oLimit: oLimits.GetChildren() ) { Limits limits; limits.min_tile_col = oLimit.GetInteger("min_tile_col"); limits.max_tile_col = oLimit.GetInteger("max_tile_col"); limits.min_tile_row = oLimit.GetInteger("min_tile_row"); limits.max_tile_row = oLimit.GetInteger("max_tile_row"); oMapLimits[oLimit.GetName()] = limits; } } } const auto tmsList = poTMS->tileMatrixList(); if( tmsList.empty() ) return false; m_bSkipMissingMetaTile = CPLTestBool(CSLFetchNameValueDef( poOpenInfo->papszOpenOptions, "SKIP_MISSING_METATILE", CPLGetConfigOption("GDAL_STACTA_SKIP_MISSING_METATILE", "NO"))); std::unique_ptr<GDALDataset> poProtoDS; for( int i = 0; i < static_cast<int>(tmsList.size()); i++ ) { // Open a metatile to get mostly its band data type int nProtoTileCol = 0; int nProtoTileRow = 0; auto oIterLimit = oMapLimits.find(tmsList[i].mId); if( oIterLimit != oMapLimits.end() ) { nProtoTileCol = oIterLimit->second.min_tile_col; nProtoTileRow = oIterLimit->second.min_tile_row; } const CPLString osURL = CPLString(osURLTemplate) .replaceAll("{TileMatrix}", tmsList[i].mId) .replaceAll("{TileRow}", CPLSPrintf("%d", nProtoTileRow)) .replaceAll("{TileCol}", CPLSPrintf("%d", nProtoTileCol)); CPLString osProtoDSName = (STARTS_WITH(osURL, "http://") || STARTS_WITH(osURL, "https://")) ? CPLString("/vsicurl/" + osURL) : osURL; if( m_bSkipMissingMetaTile ) CPLPushErrorHandler(CPLQuietErrorHandler); poProtoDS.reset( GDALDataset::Open(osProtoDSName.c_str())); if( m_bSkipMissingMetaTile ) CPLPopErrorHandler(); if( poProtoDS != nullptr ) { break; } if( !m_bSkipMissingMetaTile ) { CPLError(CE_Failure, CPLE_OpenFailed, "Cannot open %s", osURL.c_str()); return false; } } if( poProtoDS == nullptr ) { CPLError(CE_Failure, CPLE_AppDefined, "Cannot find prototype dataset"); return false; } // Iterate over tile matrices to create corresponding STACTARawDataset // objects for( int i = static_cast<int>(tmsList.size() - 1); i >= 0; i-- ) { const auto& oTM = tmsList[i]; int nMatrixWidth = oTM.mMatrixWidth; int nMatrixHeight = oTM.mMatrixHeight; auto oIterLimit = oMapLimits.find(tmsList[i].mId); if( oIterLimit != oMapLimits.end() ) { nMatrixWidth = oIterLimit->second.max_tile_col - oIterLimit->second.min_tile_col + 1; nMatrixHeight = oIterLimit->second.max_tile_row - oIterLimit->second.min_tile_row + 1; } if( nMatrixWidth <= 0 || oTM.mTileWidth > INT_MAX / nMatrixWidth || nMatrixHeight <= 0 || oTM.mTileHeight > INT_MAX / nMatrixHeight ) { continue; } auto poRawDS = cpl::make_unique<STACTARawDataset>(); if( !poRawDS->InitRaster(poProtoDS.get(), poTMS.get(), tmsList[i].mId, oTM, oMapLimits) ) { return false; } poRawDS->m_osURLTemplate = osURLTemplate; poRawDS->m_osURLTemplate.replaceAll("{TileMatrix}", tmsList[i].mId); poRawDS->m_poMasterDS = this; if( m_poDS == nullptr ) { nRasterXSize = poRawDS->GetRasterXSize(); nRasterYSize = poRawDS->GetRasterYSize(); m_oSRS = poRawDS->m_oSRS; memcpy(&m_adfGeoTransform[0], &poRawDS->m_adfGeoTransform[0], 6 * sizeof(double)); m_poDS = std::move(poRawDS); } else { const double dfMinX = m_adfGeoTransform[0]; const double dfMaxX = m_adfGeoTransform[0] + GetRasterXSize() * m_adfGeoTransform[1]; const double dfMaxY = m_adfGeoTransform[3]; const double dfMinY = m_adfGeoTransform[3] + GetRasterYSize() * m_adfGeoTransform[5]; const double dfOvrMinX = poRawDS->m_adfGeoTransform[0]; const double dfOvrMaxX = poRawDS->m_adfGeoTransform[0] + poRawDS->GetRasterXSize() * poRawDS->m_adfGeoTransform[1]; const double dfOvrMaxY = poRawDS->m_adfGeoTransform[3]; const double dfOvrMinY = poRawDS->m_adfGeoTransform[3] + poRawDS->GetRasterYSize() * poRawDS->m_adfGeoTransform[5]; if( fabs(dfMinX - dfOvrMinX) < 1e-10 * fabs(dfMinX) && fabs(dfMinY - dfOvrMinY) < 1e-10 * fabs(dfMinY) && fabs(dfMaxX - dfOvrMaxX) < 1e-10 * fabs(dfMaxX) && fabs(dfMaxY - dfOvrMaxY) < 1e-10 * fabs(dfMaxY) ) { m_apoOverviewDS.emplace_back(std::move(poRawDS)); } else { // If this zoom level doesn't share the same origin and extent // as the most resoluted one, then subset it CPLStringList aosOptions; aosOptions.AddString("-of"); aosOptions.AddString("VRT"); aosOptions.AddString("-projwin"); aosOptions.AddString(CPLSPrintf("%.18g", dfMinX)); aosOptions.AddString(CPLSPrintf("%.18g", dfMaxY)); aosOptions.AddString(CPLSPrintf("%.18g", dfMaxX)); aosOptions.AddString(CPLSPrintf("%.18g", dfMinY)); auto psOptions = GDALTranslateOptionsNew(aosOptions.List(), nullptr); auto hDS = GDALTranslate( "", GDALDataset::ToHandle(poRawDS.get()), psOptions, nullptr); GDALTranslateOptionsFree(psOptions); if( hDS == nullptr ) continue; m_apoIntermediaryDS.emplace_back(std::move(poRawDS)); m_apoOverviewDS.emplace_back(GDALDataset::FromHandle(hDS)); } } } if( m_poDS == nullptr ) { CPLError(CE_Failure, CPLE_AppDefined, "Cannot find valid tile matrix"); return false; } // Create main bands const auto oEoBands = oAssetTemplate.GetArray("eo:bands"); for( int i = 0; i < m_poDS->GetRasterCount(); i++ ) { auto poSrcBand = m_poDS->GetRasterBand(i+1); auto poBand = new STACTARasterBand(this, i+1, poSrcBand); if( oEoBands.IsValid() && oEoBands.Size() == poProtoDS->GetRasterCount() ) { // Set band metadata if( oEoBands[i].GetType() == CPLJSONObject::Type::Object ) { for( const auto& oItem: oEoBands[i].GetChildren() ) { poBand->GDALRasterBand::SetMetadataItem( oItem.GetName().c_str(), oItem.ToString().c_str()); } } } SetBand(i + 1, poBand); } // Set dataset metadata for( const auto& oItem: oProperties.GetChildren() ) { const auto osName = oItem.GetName(); if( osName != "tiles:tile_matrix_links" && osName != "tiles:tile_matrix_sets" ) { GDALDataset::SetMetadataItem(osName.c_str(), oItem.ToString().c_str()); } } const char* pszInterleave = poProtoDS->GetMetadataItem("INTERLEAVE", "IMAGE_STRUCTURE"); GDALDataset::SetMetadataItem( "INTERLEAVE", pszInterleave ? pszInterleave : "PIXEL", "IMAGE_STRUCTURE"); m_bDownloadWholeMetaTile = CPLTestBool(CSLFetchNameValueDef( poOpenInfo->papszOpenOptions, "WHOLE_METATILE", "NO")); return true; } /************************************************************************/ /* ~STACTADataset() */ /************************************************************************/ STACTADataset::~STACTADataset() { m_poDS.reset(); m_apoOverviewDS.clear(); m_apoIntermediaryDS.clear(); } /************************************************************************/ /* FlushCache() */ /************************************************************************/ void STACTADataset::FlushCache(bool bAtClosing) { m_oCacheTileDS.clear(); GDALDataset::FlushCache(bAtClosing); } /************************************************************************/ /* InitRaster() */ /************************************************************************/ bool STACTARawDataset::InitRaster(GDALDataset* poProtoDS, const gdal::TileMatrixSet* poTMS, const std::string& osTMId, const gdal::TileMatrixSet::TileMatrix& oTM, const std::map<CPLString, Limits>& oMapLimits) { int nMatrixWidth = oTM.mMatrixWidth; int nMatrixHeight = oTM.mMatrixHeight; auto oIterLimit = oMapLimits.find(osTMId); if( oIterLimit != oMapLimits.end() ) { m_nMinMetaTileCol = oIterLimit->second.min_tile_col; m_nMinMetaTileRow = oIterLimit->second.min_tile_row; nMatrixWidth = oIterLimit->second.max_tile_col - m_nMinMetaTileCol + 1; nMatrixHeight = oIterLimit->second.max_tile_row - m_nMinMetaTileRow + 1; } m_nMetaTileWidth = oTM.mTileWidth; m_nMetaTileHeight = oTM.mTileHeight; nRasterXSize = nMatrixWidth * m_nMetaTileWidth; nRasterYSize = nMatrixHeight * m_nMetaTileHeight; for( int i = 0; i < poProtoDS->GetRasterCount(); i++) { auto poProtoBand = poProtoDS->GetRasterBand(i+1); auto poBand = new STACTARawRasterBand( this, i + 1, poProtoBand); SetBand(i + 1, poBand); } CPLString osCRS = poTMS->crs().c_str(); if( osCRS == "http://www.opengis.net/def/crs/OGC/1.3/CRS84" ) osCRS = "EPSG:4326"; if( m_oSRS.SetFromUserInput(osCRS) != OGRERR_NONE ) { return false; } m_oSRS.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); m_adfGeoTransform[0] = oTM.mTopLeftX + m_nMinMetaTileCol * m_nMetaTileWidth * oTM.mResX; m_adfGeoTransform[1] = oTM.mResX; m_adfGeoTransform[3] = oTM.mTopLeftY - m_nMinMetaTileRow * m_nMetaTileHeight * oTM.mResY; m_adfGeoTransform[5] = -oTM.mResY; SetMetadataItem("INTERLEAVE", "PIXEL", "IMAGE_STRUCTURE"); return true; } /************************************************************************/ /* GetSpatialRef () */ /************************************************************************/ const OGRSpatialReference* STACTADataset::GetSpatialRef() const { return nBands == 0 ? nullptr : &m_oSRS; } /************************************************************************/ /* GetGeoTransform() */ /************************************************************************/ CPLErr STACTADataset::GetGeoTransform(double* padfGeoTransform) { memcpy(padfGeoTransform, &m_adfGeoTransform[0], 6 * sizeof(double)); return nBands == 0 ? CE_Failure: CE_None; } /************************************************************************/ /* OpenStatic() */ /************************************************************************/ GDALDataset* STACTADataset::OpenStatic(GDALOpenInfo* poOpenInfo) { if( !Identify(poOpenInfo) ) return nullptr; auto poDS = cpl::make_unique<STACTADataset>(); if( !poDS->Open(poOpenInfo) ) return nullptr; return poDS.release(); } /************************************************************************/ /* GDALRegister_STACTA() */ /************************************************************************/ void GDALRegister_STACTA() { if( GDALGetDriverByName( "STACTA" ) != nullptr ) return; GDALDriver *poDriver = new GDALDriver(); poDriver->SetDescription( "STACTA" ); poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" ); poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "Spatio-Temporal Asset Catalog Tiled Assets" ); poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "drivers/raster/stacta.html" ); poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "json" ); poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" ); poDriver->SetMetadataItem( GDAL_DMD_SUBDATASETS, "YES" ); poDriver->SetMetadataItem( GDAL_DMD_OPENOPTIONLIST, "<OpenOptionList>" " <Option name='WHOLE_METATILE' type='boolean' " "description='Whether to download whole metatiles'/>" " <Option name='SKIP_MISSING_METATILE' type='boolean' " "description='Whether to gracefully skip missing metatiles'/>" "</OpenOptionList>" ); poDriver->pfnOpen = STACTADataset::OpenStatic; poDriver->pfnIdentify = STACTADataset::Identify; GetGDALDriverManager()->RegisterDriver( poDriver ); }
[ "even.rouault@spatialys.com" ]
even.rouault@spatialys.com
4c868debad552ce077d2d0e740f58f5d2793731b
11cddfab71a7e3d98183b7299132b5493bc6d58c
/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.h
f2a32c4f271a0b8e5b0a26302c1d17e4f5153178
[ "BSD-3-Clause" ]
permissive
bathepawan/chromium
41aa3da80ad748e0d38fe2688013365335797f1f
53f2426666b7273b2b4af35527b0f507d1512e64
refs/heads/master
2022-12-20T11:22:16.319857
2020-02-14T14:10:10
2020-02-14T14:10:10
240,524,190
1
0
BSD-3-Clause
2020-02-14T14:17:38
2020-02-14T14:17:37
null
UTF-8
C++
false
false
2,856
h
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_PRINT_JOB_CONFIRMATION_DIALOG_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_PRINT_JOB_CONFIRMATION_DIALOG_VIEW_H_ #include <memory> #include "base/callback_forward.h" #include "base/strings/string16.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" namespace gfx { class Image; } // namespace gfx class ToolbarActionView; // The dialog's view, owned by the views framework. class PrintJobConfirmationDialogView : public views::BubbleDialogDelegateView { public: static void Show(gfx::NativeWindow parent, const std::string& extension_id, const base::string16& extension_name, const gfx::ImageSkia& extension_icon, const base::string16& print_job_title, const base::string16& printer_name, base::OnceCallback<void(bool)> callback); PrintJobConfirmationDialogView(ToolbarActionView* anchor_view, const base::string16& extension_name, const gfx::ImageSkia& extension_icon, const base::string16& print_job_title, const base::string16& printer_name, base::OnceCallback<void(bool)> callback); ~PrintJobConfirmationDialogView() override; PrintJobConfirmationDialogView(const PrintJobConfirmationDialogView&) = delete; PrintJobConfirmationDialogView& operator=( const PrintJobConfirmationDialogView&) = delete; private: // views::DialogDelegateView: bool Accept() override; bool Cancel() override; gfx::Size CalculatePreferredSize() const override; // views::WidgetDelegate: ui::ModalType GetModalType() const override; base::string16 GetWindowTitle() const override; gfx::ImageSkia GetWindowIcon() override; bool ShouldShowWindowIcon() const override; bool ShouldShowCloseButton() const override; // Called when the dialog is closing. void OnDialogClosed(bool accepted); // The name of the extension we are showing the dialog for. const base::string16 extension_name_; // Image with extension's icon. const gfx::ImageSkia extension_icon_; // Callback to call after the dialog is accepted or rejected. base::OnceCallback<void(bool)> callback_; // TODO(pbos): Find a more direct way of determining if there's a bubble than // checking |anchor_view|. const bool dialog_is_bubble_; }; #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_PRINT_JOB_CONFIRMATION_DIALOG_VIEW_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
1fbf2c556c33ca1b3d180decfdad4503ee3ff7b0
d697d70e63862e03a60814a3c274a1a1b2dfc018
/src/objects/sphere.cxx
ccf745df4c8d1567f536262ac68633538e30f670
[]
no_license
sonVishal/RayTracer
c1a75de20d82bba17b4fe4cbf6dc6ed953b99197
25cafb04bda61deb371d566ff4b7731d1f611e2a
refs/heads/main
2023-08-25T19:53:34.439732
2021-10-23T04:03:15
2021-10-23T04:03:15
359,032,295
1
1
null
2021-04-30T14:25:22
2021-04-18T03:11:02
C++
UTF-8
C++
false
false
898
cxx
#include <sphere.hxx> #include <ray.hxx> #include <cmath> void Sphere::Intersect(const Ray &ray, std::vector<float> &rayParams) const { float a = ray.GetDirection() % ray.GetDirection(); Vector4 sphereToRay = ray.GetOrigin() - this->GetOrigin(); float b = 2.0f * (ray.GetDirection() % sphereToRay); float c = (sphereToRay % sphereToRay) - 1.0f; float discriminant = b * b - 4.0f * a * c; if (discriminant < 0.0) { return; } rayParams.push_back((-b - sqrt(discriminant)) / (2.0f * a)); rayParams.push_back((-b + sqrt(discriminant)) / (2.0f * a)); } Vector4 Sphere::Normal(const Point4& point) const { Vector4 normal; auto invTransf = m_transformation.Inverse(); Point4 objectPoint = (invTransf * point); normal = (objectPoint - m_origin); normal = (invTransf.Transpose() * normal); normal.Normalize(); return normal; }
[ "inferno@test.com" ]
inferno@test.com
77e73419c1ec7eb0741d6273e6bc3cb6d18768cc
c8403e564865990dd6e2b307e56944af6f6cdeec
/src/Utilities/LagrangePolynomials.cpp
402906b5efa5a59bf013fc38c0c132d62c71180b
[ "BSD-3-Clause" ]
permissive
kaushikcfd/NavierStokes-DG
e266cdb88020f4ae8c5446f0749b6d420de85e8a
190a24068eb56e2317f0227ccc5df8e9b9d7882e
refs/heads/master
2021-01-19T12:37:20.833891
2017-03-08T07:15:15
2017-03-08T07:15:15
82,327,895
3
2
null
null
null
null
UTF-8
C++
false
false
621
cpp
#include "../../includes/Utilities/LobattoNodes.h" #include "../../includes/Utilities/Inverse.h" #include "../../includes/Utilities/Transpose.h" void lagrangePolynomials(double *Polynomials, unsigned N) { double VanderMonde[N+1][N+1]; double *Nodes; Nodes = new double[N+1]; unsigned i,j; lobattoNodes(Nodes,N+1); for(i=0;i<=N;i++) { VanderMonde[i][0] = 1.0; for(j=1;j<=N;j++) VanderMonde[i][j] = VanderMonde[i][j-1]*Nodes[i]; } transpose(*VanderMonde,N+1); inverse(&VanderMonde[0][0],Polynomials,N+1); delete[] Nodes; return; }
[ "kaushikcfd@gmail.com" ]
kaushikcfd@gmail.com
3b276189853b780e9670207d5ebc80e7f6b32bac
a341d806f1f31931036155344df4b0fc1f542543
/MultiThread/MultiProcess.cpp
a44205c235c8b8a7df8db368f4996d647d9bd6fa
[]
no_license
Lupus590AtUni/Uni_MultiThread
08f0e5b4eb7ed0cc94a74d65df288f2fc0a26bde
46b991027883420f83a8475cf16ff4a5ced1da47
refs/heads/master
2021-06-11T14:43:36.034138
2017-03-06T11:45:34
2017-03-06T11:45:34
80,415,320
0
0
null
null
null
null
UTF-8
C++
false
false
6,235
cpp
// MultiThread.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "windows.h" #define NUL '\0' HANDLE g_hPipeRead; HANDLE g_hPipeWrite; HANDLE g_hChildProcess = NULL; HANDLE g_hPipeBkgWrite; HANDLE g_hPipeBkgRead; static int WriteToBkgProcess(char *buff, DWORD nBytesToWrite); static int ReadFromBkgProcess(char *rdbuff, DWORD nBytesToRead); int _tmain(int argc, _TCHAR* argv[]) { PROCESS_INFORMATION pi; STARTUPINFO si; SECURITY_ATTRIBUTES sa; char Args[4096]; char *hello = "Hello"; char read_buff[(512+1)*sizeof(TCHAR)]; DWORD nRdBuffLen = 512; // Allow for NULL DWORD nBytesRead; _TCHAR currdir[512+1]; DWORD currdirlen = 512; // Set up the security attributes struct. // sa.nLength= sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; // NOTE: Creating a process in Windows is very expensive in time and resources. // Use threads instead. // If you want to implement seperate client and servers then it makes sense to use // seperate processes. // // To keep things simple the background process will be a Console Application. // To pass data to this background process the easiest way is by using pipes. // You can create a window as a background process instead. In which case, // you should send windows messages to the process. // COPYDATASTRUCT cds; // Fill the COPYDATA structure // // cds.dwData = SETPIPEHANDLES; // function identifier // cds.cbData = sizeof( MyStruct ); // size of data // cds.lpData = &mystructdata; // data structure // // Call function, passing data // // g_hMainWindow = FindWindow(NULL,"Main Window Title")) != NULL) // g_hCmdWnd = FindWindow(NULL,"Background Process Title"); // if( g_hCmdWnd != NULL ) // { // SendMessage( g_hCmdWnd, // WM_COPYDATA, // (WPARAM)(HWND) g_hMainWindow, // who's sending data // (LPARAM) (LPVOID) &cds ); // data to send // } // // CreatePipe // hReadPipe [out] Pointer to a variable that receives the read handle for the pipe. // hWritePipe[out] Pointer to a variable that receives the write handle for the pipe. // lpPipeAttributes [in] Pointer to a SECURITY_ATTRIBUTES structure that determines whether // the returned handle can be inherited by child processes. // If lpPipeAttributes is NULL, the handle cannot be inherited. // The lpSecurityDescriptor member of the structure specifies a security descriptor // for the new pipe. If lpPipeAttributes is NULL, the pipe gets a default security descriptor. // The ACLs in the default security descriptor for a pipe come from the primary or // impersonation token of the creator. // nSize [in] Size of the buffer for the pipe, in bytes. The size is only a suggestion; // the system uses the value to calculate an appropriate buffering mechanism. // If this parameter is zero, the system uses the default buffer size. // // Create two pipes, one for each direction going to and coming from the background process. // if (!CreatePipe(&g_hPipeBkgRead,&g_hPipeWrite,&sa,0)) { printf("Failed to create pipe to background process\r\n"); return FALSE; } if (!CreatePipe(&g_hPipeRead,&g_hPipeBkgWrite,&sa,0)) { printf("Failed to create pipe from background process\r\n"); return FALSE; } // Ensure the write handle to the pipe for STDIN is not inherited // and the read handle fo STDOUT is not inherited. // SetHandleInformation(g_hPipeWrite, HANDLE_FLAG_INHERIT, 0); SetHandleInformation(g_hPipeRead, HANDLE_FLAG_INHERIT, 0); // Set up the start up info struct. // Setup the STDIN and STDOUT for background process. ZeroMemory(&si,sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; //STARTF_USESHOWWINDOW; si.hStdOutput = g_hPipeBkgWrite; si.hStdInput = g_hPipeBkgRead; si.hStdError = g_hPipeBkgWrite; //si.wShowWindow = SW_HIDE; ZeroMemory( &pi, sizeof(PROCESS_INFORMATION) ); // Launch the application you want to use as a second process. // Make sure the .exe file is in the same directory as the game. // GetCurrentDirectory(currdirlen, currdir); wcscat(currdir, L"\\Debug\\BackgroundProcess"); if (!CreateProcess(NULL,currdir,NULL,NULL,TRUE, 0,NULL,NULL,&si,&pi)) { printf("Failed to create background process %i\r\n", GetLastError()); if(GetLastError() == 14001) { printf("Try rebuilding BackgroundProcess and copy it to Debug folder\r\n"); } return FALSE; } g_hChildProcess = pi.hProcess; printf("Write data to background process %s\n", hello); WriteToBkgProcess(hello, (DWORD)strlen(hello)+1); nBytesRead = ReadFromBkgProcess(read_buff, nRdBuffLen); printf("Read data from background process %u %s\n", nBytesRead, read_buff); getchar(); // Pause TerminateProcess(g_hChildProcess, 0); return 0; } inline int WriteToBkgProcess(char *wrbuff, DWORD nBytesToWrite) { DWORD nBytesWritten; if (!WriteFile(g_hPipeWrite,wrbuff,nBytesToWrite,&nBytesWritten,NULL) || nBytesWritten == 0) { if (GetLastError() == ERROR_NO_DATA) { printf("Pipe to command window closed?? %i\r\n", GetLastError()); return 0; // Pipe was closed (normal exit path). } else { printf("Error writing to command window %i\r\n", GetLastError()); return 0; } } //CloseHandle(g_hPipeWrite); Could close the pipe to tell bkg process we've finished FlushFileBuffers(g_hPipeWrite); return 1; } inline int ReadFromBkgProcess(char *rdbuff, DWORD nBytesToRead) { DWORD nBytesRead = 0; if(!ReadFile(g_hPipeRead,rdbuff,nBytesToRead,&nBytesRead,NULL)) { if (GetLastError() != ERROR_BROKEN_PIPE) { printf("Error reading from command window %i\r\n", GetLastError()); } } rdbuff[nBytesRead] = '\0'; // Follow input with a NULL. return nBytesRead; }
[ "lupus590@users.noreply.github.com" ]
lupus590@users.noreply.github.com
104a3255537b014b0938037b2626c150d27b3703
ef41f3090ffc228f4f98293b2cc8b5fe87b00231
/dart/io/mjcf/detail/Asset.cpp
b7858fd99b3e2cbbd9014ced694a172a426f1bd6
[ "BSD-2-Clause" ]
permissive
httpsgithu/dart
9d29a9d41a173eff2dd0f62edf8581c821671155
31fb4ea3897cf26788aa16facda4e90f3fbab473
refs/heads/master
2023-04-05T21:37:43.764183
2021-04-22T00:30:25
2021-04-22T00:30:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,238
cpp
/* * Copyright (c) 2011-2021, The DART development contributors * All rights reserved. * * The list of contributors can be found at: * https://github.com/dartsim/dart/blob/master/LICENSE * * This file is provided under the following "BSD-style" License: * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include "dart/io/mjcf/detail/Asset.hpp" #include "dart/io/XmlHelpers.hpp" namespace dart { namespace io { namespace MjcfParser { namespace detail { //============================================================================== std::size_t Asset::getNumMeshes() const { return mMeshes.size(); } //============================================================================== const Mesh& Asset::getMesh(std::size_t index) const { return mMeshes[index]; } //============================================================================== const Mesh* Asset::getMesh(const std::string& name) const { const auto result = mMeshMap.find(name); if (result != mMeshMap.end()) { return result->second; } else { return nullptr; } } //============================================================================== Errors Asset::read(tinyxml2::XMLElement* element) { Errors errors; if (std::string(element->Name()) != "asset") { errors.emplace_back( ErrorCode::INCORRECT_ELEMENT_TYPE, "Failed to find <Asset> from the provided element"); return errors; } // Read multiple <mesh> ElementEnumerator meshElements(element, "mesh"); while (meshElements.next()) { Mesh mesh = Mesh(); const auto bodyErrors = mesh.read(meshElements.get()); errors.insert(errors.end(), bodyErrors.begin(), bodyErrors.end()); if (bodyErrors.empty()) { mMeshes.emplace_back(std::move(mesh)); } } return errors; } //============================================================================== Errors Asset::preprocess(const Compiler& compiler) { Errors errors; for (Mesh& mesh : mMeshes) { const Errors meshErrors = mesh.preprocess(compiler); errors.insert(errors.end(), meshErrors.begin(), meshErrors.end()); } return errors; } //============================================================================== Errors Asset::compile(const Compiler& compiler) { Errors errors; for (Mesh& mesh : mMeshes) { mMeshMap[mesh.getName()] = &mesh; const Errors meshErrors = mesh.compile(compiler); errors.insert(errors.end(), meshErrors.begin(), meshErrors.end()); } return errors; } //============================================================================== Errors Asset::postprocess(const Compiler& compiler) { Errors errors; for (Mesh& mesh : mMeshes) { const Errors meshErrors = mesh.postprocess(compiler); errors.insert(errors.end(), meshErrors.begin(), meshErrors.end()); } return errors; } } // namespace detail } // namespace MjcfParser } // namespace io } // namespace dart
[ "noreply@github.com" ]
noreply@github.com
ed4cbbfb6ef735c27246ca66fda9d6f0a4967bf0
8c508b6682c14961bc86b52f20b90647f2fb99ef
/Language Details/CPP STL/005_tie.cpp
17292bdca29d435eb9b575bca7813b1d9e757e4a
[]
no_license
debacoding/1.CPP
14ec2c9d3961a7a1b212670218f8a38bce7db350
a055dc85cfe0a4e93faebfa74d2bb37bf286e2fc
refs/heads/main
2023-07-14T23:04:22.128897
2021-08-31T17:16:37
2021-08-31T17:16:37
397,175,733
0
0
null
null
null
null
UTF-8
C++
false
false
916
cpp
// tie() #include <bits/stdc++.h> using namespace std; int main() { pair<int, int> pair1 = { 1, 2 }; int a, b; tie(a, b) = pair1; // tie() declared cout << a << " " << b << "\n"; pair<int, int> pair2 = { 3, 4 }; tie(a, ignore) = pair2; // “ignore” keyword ignores a particular // tuple element from getting unpacked cout << a << " " << b << "\n"; // prints old value of b // Illustrating pair of pairs pair<int, pair<int, char> > pair3 = { 3, { 4, 'a' } }; int x, y; char z; // tie(x,y,z) = pair3; Gives compilation error // tie(x, tie(y,z)) = pair3; Gives compilation error // Each pair needs to be explicitly handled x = pair3.first; tie(y, z) = pair3.second; cout << x << " " << y << " " << z << "\n"; cout << "Concatenate first of pair 1 and 2: " << pair1.first + pair2.first << endl; } /* Output : 1 2 3 2 3 4 a Concatenate first of pair 1 and 2: 4 */
[ "noreply@github.com" ]
noreply@github.com
4f511297673b8defe4a24bd3e1c05aca3d123e74
8481b904e1ed3b25f5daa982a3d0cafff5a8d201
/C++/BZOJ/BZOJ 2463.cpp
a3614d3f5cded8dbc294dadc47542e1d3adacc3e
[]
no_license
lwher/Algorithm-exercise
e4ac914b90b6e4098ab5236cc936a58f437c2e06
2d545af90f7051bf20db0a7a51b8cd0588902bfa
refs/heads/master
2021-01-17T17:39:33.019131
2017-09-12T09:58:54
2017-09-12T09:58:54
70,559,619
1
2
null
null
null
null
UTF-8
C++
false
false
257
cpp
#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; int n; int main() { while(scanf("%d",&n)) { if(n==0) break; if(n & 1) printf("Bob\n"); else printf("Alice\n"); } system("pause"); return 0; }
[ "751276936@qq.com" ]
751276936@qq.com
ad7114a274164ba18e85d6768ded9106aea3e21d
d3610bf04fe472341d2996e3ba6458cb662896ff
/TOOLS/arduino/sketchs/LiveShow/LiveShow.ino
7dcccef6027bec897119fc5354d74a5c93f08c11
[]
no_license
supabassmasta/dev
d62b54797881ce76dfd522a5544a6be3bdf81f8c
a0352656ea1ed75b30eb9926865f9ce063292a6b
refs/heads/master
2023-08-25T08:59:57.309153
2023-08-16T16:06:06
2023-08-16T16:06:06
19,205,280
1
1
null
2022-12-06T21:53:29
2014-04-27T13:43:54
ChucK
UTF-8
C++
false
false
60,033
ino
#include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif #define PIN 13 Adafruit_NeoPixel strip = Adafruit_NeoPixel(300, PIN, NEO_GRB + NEO_KHZ800); uint16_t intro_cnt = 0; #define MOON_START 138 // Middle Square Weyl Sequence PRNG // 16 bits implementation attempt long x = 0, w = 0, s = 0xb5ad4ece; // sizeof long == 32 bits on Uno int msws() { x *= x; x += (w += s); x = (x>>16) | (x<<16); return (int) x; } class Tri { public : int cnt; bool up = true; bool up_start = true; int offset_cnt = 0; bool up_offset = true; int min = 0; int max = 255; int period_num = 6; int period_den = 1; int offset_num = 4; int offset_den = 1; // private TODO Clean int sub_cnt_offset = 0; int sub_cnt = 0; // constructor Tri() { } void new_show() { // compute offsets sub_cnt_offset ++; if (sub_cnt_offset > offset_den) { sub_cnt_offset = 0; if (offset_cnt > max) { up_offset = false; } if (offset_cnt < min) { up_offset = true; } // if (offset_num < 0){ // up_offset = ! up_offset; // } if (up_offset ) { offset_cnt += offset_num; } else { offset_cnt -= offset_num; } } cnt = offset_cnt; sub_cnt = 0; up = up_offset; } int process () { sub_cnt ++; if (sub_cnt > period_den) { sub_cnt = 0; if (cnt > max) { cnt = max; up = 0; } else if (cnt < min) { cnt = min; up = 1; } if (up) { cnt += period_num; } else { cnt -= period_num; } } return cnt; } }; Tri t1 = Tri(); Tri t2 = Tri(); Tri t3 = Tri(); Tri t4 = Tri(); Tri t5 = Tri(); class Perc { public : int cnt = 0; int cnt_reload = 50; int cnt_num = 1; int cnt_den = 1; int cnt_den_tmp = 0; int color_fact = 1; int max = 255; int pos = 0; long color_mask = 0x00FFFFFF; // constructor Perc() { } void process(Adafruit_NeoPixel * s_p){ int i, j; int c; if ( cnt > 0 ){ // up ramp for (i = pos - cnt, j = 0; i< pos ; i++, j++){ if ( i > 0 && i < s_p->numPixels() ){ c = j * color_fact; if (c > max) c = max; strip.setPixelColor(i, color_mask & ((long)c<<16 | c<<8 | c)); } } // down ramp for (i = pos , j = cnt - 1; i< cnt + pos ; i++, j--){ if ( i > 0 && i < s_p->numPixels() ){ c = j * color_fact; if (c > max) c = max; strip.setPixelColor(i, color_mask & ((long)c<<16 | c<<8 | c)); } } cnt_den_tmp ++; if (cnt_den_tmp >= cnt_den) { cnt -= cnt_num; cnt_den_tmp = 0; } } } void reload() { cnt = cnt_reload; } }; Perc perc1; Perc perc2; Perc perc3; Perc perc4; Perc perc5; class RandTrain { public : int pos = 150; long color = 0x00FFFFFF; int train_size = 40; int train_mask = 0x32A6; // lower pixel density with simple mask int target = 90; int cnt_num = 1; int cnt_den = 2; int cnt_den_tmp = 0; // private int cnt = 1000; // constructor RandTrain() { } void process(Adafruit_NeoPixel * s_p){ int i, j; int train; int p; if ( cnt < target ){ train = msws(); train = train & (train_mask << (0x3 & train)); // randomly shift tain mask // train = train_mask; for (i = 0, j=0; i < train_size; i++, j++) { // round around train if ( j>= 16 ){ j = 0; } // check pixel is active if ( (train >> j) & 0x1 ) { // pixel after pos p = pos + cnt + i; if (p < s_p->numPixels() && p < pos + target) { strip.setPixelColor(p, color ); } // pixel before pos p = pos - cnt - i; if ( p > 0 && p > pos - target){ strip.setPixelColor(p, color ); } } } cnt_den_tmp ++; if (cnt_den_tmp >= cnt_den) { cnt += cnt_num; cnt_den_tmp = 0; } } } void reload() { cnt = 0; } }; RandTrain train1; RandTrain train2; class RainbowStar { public : int pos = 150; int size = 40; int target = 90; int cnt_num = 1; int cnt_den = 2; int cnt_den_tmp = 0; // private int cnt = 1000; // constructor RainbowStar() { } #define RAINBOW_START_SIZE 3 void process(Adafruit_NeoPixel * s_p){ int i, j; int p; if ( cnt < abs( target - pos ) ){ if ( pos < target ){ // Print Star p = pos + cnt; for (i=0; i< RAINBOW_START_SIZE ; i++){ strip.setPixelColor(p, 0x00FFFFFF ); p--; } while( p >= 0 && p >= pos && p >= pos + cnt - size ){ strip.setPixelColor(p, Wheel(cnt + intro_cnt) ); p--; } } if ( pos > target ){ // Print Star p = pos - cnt; for (i=0; i< RAINBOW_START_SIZE ; i++){ strip.setPixelColor(p, 0x00FFFFFF ); p++; } while( p < strip.numPixels() && p <= pos && p < pos - cnt + size ){ strip.setPixelColor(p, Wheel(cnt + intro_cnt) ); p++; } } cnt_den_tmp ++; if (cnt_den_tmp >= cnt_den) { cnt += cnt_num; cnt_den_tmp = 0; } } } void reload() { cnt = 0; } }; RainbowStar rainbowStar1; RainbowStar rainbowStar2; RainbowStar rainbowStar3; RainbowStar rainbowStar4; class Fade_in_out { public: bool in = true; int cnt = 0; int cnt_num = 1; int cnt_den = 1; int cnt_den_tmp = 0; // constructor fade_in_out() { } void process(Adafruit_NeoPixel * s_p){ int i; uint32_t c; int r; int g; int b; if (in && cnt > 0) { for (i=0; i< s_p->numPixels() ; i++){ c = strip.getPixelColor(i); r = (((c >> 16) ) - cnt ); g = (((c >> 8) & 0xFF ) - cnt ); b = (((c ) & 0xFF ) - cnt ); if ( r < 0 ) r = 0; if ( g < 0 ) g = 0; if ( b < 0 ) b = 0; c = r << 16 | g << 8 | b ; strip.setPixelColor(i,c); } cnt_den_tmp ++; if (cnt_den_tmp >= cnt_den) { cnt -= cnt_num; cnt_den_tmp = 0; } } else if ( !in && cnt < 255 ){ for (i=0; i< s_p->numPixels() ; i++){ c = strip.getPixelColor(i); r = (((c >> 16) ) - cnt ); g = (((c >> 8) & 0xFF ) - cnt ); b = (((c ) & 0xFF ) - cnt ); if ( r < 0 ) r = 0; if ( g < 0 ) g = 0; if ( b < 0 ) b = 0; c = r << 16 | g << 8 | b ; strip.setPixelColor(i,c); } cnt_den_tmp ++; if (cnt_den_tmp >= cnt_den) { cnt += cnt_num; cnt_den_tmp = 0; } } else if ( !in ){ for (i=0; i< s_p->numPixels() ; i++){ strip.setPixelColor(i,0); } } } void start_in(){ in = true; cnt = 255; } void start_out(){ in = false; cnt = 0; } }; Fade_in_out fade_in_out; int preset = 0; void setup() { strip.begin(); strip.setBrightness(255); // Max 255 strip.show(); // Initialize all pixels to 'off' // Kaleido at boot fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); init_colorRamps(); init_kaleidoscope(); preset = 11; // Indian kid at boot for Test //////////////////////// // config_indian_kid(); // fade_in_out.cnt_num = 12; // fade_in_out.cnt_den = 1; // fade_in_out.start_in(); // preset = 3; ////////////////////////////////////// pinMode(LED_BUILTIN, OUTPUT); Serial.begin(115200); Serial.flush(); } void error() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(10); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW } int bond_cnt = 0; int bond_cnt2 = 0; void loop() { read_serial(); switch (preset) { case 0: allOff(); break; case 1: blueriver(); break; case 2: rg_rainbow(); aya_randgreen(); break; case 3: symetricmorseblue(); break; case 4: randgreen(); break; case 5: ederlezi(); break; case 6: symetricmorseorange(); break; case 7: rainbow(); // greenblueriver(); break; case 8: bondlywood(); break; case 9: randyellow(); break; case 10: intro_stars(); break; case 11: dhoomtala(); randyellow(); break; case 12: inawah_fire(true); moon(); delay(5); break; case 13: allOff(); randyellow(); moon(); // update this counter to keep moon oscillating intro_cnt ++; break; case 14: inawah_fire(false); moon(); delay(5); break; case 15: colorRamp(); kaleidoscope(); break; // Quasar case 16: colorRamp(); kaleidoscope(); randwhite(); break; // Erhansar case 17: pinkriver(); break; } //allOff(); // show1(); //randblue(); // randgreen(); //randall(); //mult(); //blueriver(); //symetricmorseblue(); // rg_rainbow(); perc1.process(&strip); perc2.process(&strip); perc3.process(&strip); perc4.process(&strip); train1.process(&strip); train2.process(&strip); rainbowStar1.process(&strip); rainbowStar2.process(&strip); rainbowStar3.process(&strip); rainbowStar4.process(&strip); kick(); snare(); fade_in_out.process(&strip); strip.show(); // theaterChase(strip.Color(0, 127, 0), 50); // Red } void theaterChase(uint32_t c, uint8_t wait) { for (int j=0; j<10; j++) { //do 10 cycles of chasing for (int q=0; q < 3; q++) { for (uint16_t i=0; i < strip.numPixels(); i=i+3) { strip.setPixelColor(i+q, c); //turn every third pixel on } strip.show(); delay(wait); for (uint16_t i=0; i < strip.numPixels(); i=i+3) { strip.setPixelColor(i+q, 0); //turn every third pixel off } } } } void allOff() { for (uint16_t i=0; i < strip.numPixels(); i++) { strip.setPixelColor(i, 0); } } class Star { public : uint8_t r,g,b; uint16_t arrival; uint16_t pos; Star() { } }; #define STARS_NB 32 Star st[STARS_NB]; void init_stars (){ uint8_t idx = 0; st[idx].r = 255 ; st[idx].g = 255 ; st[idx].b = 255; st[idx].arrival = 255 ; st[idx].pos = 150 ; idx++; st[idx].r = 0 ; st[idx].g = 0 ; st[idx].b = 20; st[idx].arrival = 255 ; st[idx].pos = 149 ; idx++; st[idx].r = 0 ; st[idx].g = 0 ; st[idx].b = 20; st[idx].arrival = 255 ; st[idx].pos = 151 ; idx++; st[idx].r = 100 ; st[idx].g = 100 ; st[idx].b = 255 ; st[idx].arrival = 1000 ; st[idx].pos = 273 ; idx++; st[idx].r = 240 ; st[idx].g = 240 ; st[idx].b = 100 ; st[idx].arrival = 255 ; st[idx].pos = 63 ; idx++; st[idx].r = 255 ; st[idx].g = 100 ; st[idx].b = 100 ; st[idx].arrival = 255 ; st[idx].pos = 0 ; idx++; st[idx].r = 200 ; st[idx].g = 75 ; st[idx].b = 75 ; st[idx].arrival = 255 ; st[idx].pos = 200 ; idx++; st[idx].r = 100 ; st[idx].g = 100 ; st[idx].b = 100 ; st[idx].arrival = 255 ; st[idx].pos = 295 ; idx++; st[idx].r = 100 ; st[idx].g = 75 ; st[idx].b = 110 ; st[idx].arrival = 255 ; st[idx].pos = 130 ; idx++; st[idx].r = 150 ; st[idx].g = 150 ; st[idx].b = 75 ; st[idx].arrival = 255 ; st[idx].pos = 230 ; idx++; st[idx].r = 50 ; st[idx].g = 50 ; st[idx].b = 200; st[idx].arrival = 255 ; st[idx].pos = 35 ; idx++; st[idx].r = 50 ; st[idx].g = 50 ; st[idx].b = 50 ; st[idx].arrival = 255 ; st[idx].pos = 80 ; idx++; st[idx].r = 20 ; st[idx].g = 10 ; st[idx].b = 0 ; st[idx].arrival = 255 ; st[idx].pos = 12 ; idx++; st[idx].r = 20 ; st[idx].g = 10 ; st[idx].b = 0 ; st[idx].arrival = 255 ; st[idx].pos = 137 ; idx++; st[idx].r = 20 ; st[idx].g = 10 ; st[idx].b = 0 ; st[idx].arrival = 255 ; st[idx].pos = 203 ; idx++; st[idx].r = 20 ; st[idx].g = 15 ; st[idx].b = 0 ; st[idx].arrival = 255 ; st[idx].pos = 207 ; idx++; st[idx].r = 20 ; st[idx].g = 10 ; st[idx].b = 0 ; st[idx].arrival = 255 ; st[idx].pos = 287 ; idx++; st[idx].r = 1 ; st[idx].g = 2 ; st[idx].b = 5 ; st[idx].arrival = 255 ; st[idx].pos = 100 ; idx++; st[idx].r = 1 ; st[idx].g = 3 ; st[idx].b = 5 ; st[idx].arrival = 255 ; st[idx].pos = 110 ; idx++; st[idx].r = 1 ; st[idx].g = 2 ; st[idx].b = 5 ; st[idx].arrival = 255 ; st[idx].pos = 173 ; idx++; st[idx].r = 1 ; st[idx].g = 2 ; st[idx].b = 5 ; st[idx].arrival = 255 ; st[idx].pos = 257 ; idx++; st[idx].r = 1 ; st[idx].g = 2 ; st[idx].b = 5 ; st[idx].arrival = 255 ; st[idx].pos = 66 ; idx++; st[idx].r = 1 ; st[idx].g = 2 ; st[idx].b = 5 ; st[idx].arrival = 255 ; st[idx].pos = 53 ; idx++; st[idx].r = 2 ; st[idx].g = 2 ; st[idx].b = 2 ; st[idx].arrival = 255 ; st[idx].pos = 237 ; idx++; st[idx].r = 3 ; st[idx].g = 2 ; st[idx].b = 2 ; st[idx].arrival = 255 ; st[idx].pos = 240 ; idx++; st[idx].r = 2 ; st[idx].g = 1 ; st[idx].b = 3 ; st[idx].arrival = 255 ; st[idx].pos = 247 ; idx++; } uint16_t fade_stars_sub_cnt = 0; void intro_stars() { uint8_t r,g,b = 0; uint16_t fade_stars_cnt; uint16_t fade_red_cnt; uint16_t fade_blue_cnt; fade_stars_sub_cnt ++; if (intro_cnt < 254 && fade_stars_sub_cnt > 15 ){ fade_stars_sub_cnt = 0; fade_stars_cnt = 255 - intro_cnt; for (int i=0; i< STARS_NB ; i++){ strip.setPixelColor(st[i].pos, st[i].r / fade_stars_cnt, st[i].g / fade_stars_cnt, st[i].b / fade_stars_cnt); } intro_cnt ++; } else if ( intro_cnt >= 254 && intro_cnt < 3000) { // Stars No fade in for (int i=0; i< STARS_NB ; i++){ strip.setPixelColor(st[i].pos, st[i].r , st[i].g , st[i].b ); } // Red fade_red_cnt = (intro_cnt - 254) >> 4; if (fade_red_cnt > 151 ) fade_red_cnt = 151; for ( int i = 0; i < fade_red_cnt; i++) { r = fade_red_cnt - i; strip.setPixelColor(i, r, 0, 0 ); strip.setPixelColor(strip.numPixels() - i, r, 0, 0 ); } intro_cnt ++; } else if ( intro_cnt >= 3000) { // Red // fade_red_cnt = (intro_cnt - 254) >> 2; // if (fade_red_cnt > 151 ) fade_red_cnt = 151; // Blue fade_blue_cnt = (intro_cnt - 3000) >> 4; if (fade_blue_cnt > 300 ) fade_blue_cnt = 300; for ( int i = 0; i < 151; i++) { int16_t b16; int16_t r16; r16 = 151 - i - (fade_blue_cnt >> 1 ) ; if (r16 < 0) r = 0; else if ( r16 > 255 ) r = 255; else r = r16; b16 = fade_blue_cnt + i - 150 ; if (b16 < 0) b = 0; else if ( b16 > 255 ) b = 255; else b = b16; strip.setPixelColor(i, r, 0, b ); // symetry strip.setPixelColor(strip.numPixels() - i, r, 0 , b); } intro_cnt ++; } } void inawah_fire(bool up) { uint16_t fade_red_cnt; int16_t r; // Red fade_red_cnt = (intro_cnt ) >> 6; if (fade_red_cnt > 151 ) fade_red_cnt = 151; for ( int i = 0; i < MOON_START; i++) { if ( up ){ r = fade_red_cnt - i; } else { r = (151 - fade_red_cnt) - i; } if ( r < 0 ){ r = 0; } strip.setPixelColor(i, r, 0, 0 ); strip.setPixelColor(strip.numPixels() - i, r, 0, 0 ); } // Rand orange yellow { uint16_t r; uint16_t g; for (int i=0; i< 5 ; i++){ r = msws(); g = r >> 10; r = r & 0x7F ; if ( ( up && r < fade_red_cnt ) || (!up && r < (151 - fade_red_cnt) ) ) { strip.setPixelColor(r, strip.Color(255, g, 0 )); strip.setPixelColor(strip.numPixels() - r, strip.Color(255, g, 0 )); } } } // Trains { uint16_t r; bond_cnt ++; if ( bond_cnt > 60 +train1.target /* (r & 0x7F ) */){ bond_cnt = 0; r = msws(); if ( r & 0x1 ){ train1.pos = 0; } else { train1.pos = strip.numPixels() - 10; } train1.target = 85 + ((r>>6) & 0x3F); train1.color = 0x00FF7000; train1.train_size = ((r>>8) & 0x1F); train1.train_mask = r & 0x1632; //train1.color = 0xFFFF0000; train1.reload(); } } intro_cnt ++; } void moon() { int8_t g; uint8_t v, u; v = intro_cnt & 0xFF; if ( v > 128 ){ v = 256 - v; } u = intro_cnt >> 1 & 0xFF; if ( u > 128 ){ u = 256 - u; } for (int i=MOON_START ; i< strip.numPixels() - MOON_START + 1 ; i++){ strip.setPixelColor(i, strip.Color(255, 127 + v, 127 + u )); } } void ederlezi_config() { t1.offset_cnt = 0; t1.min = -255; t1.max = 255; t1.period_num = 2 * 16; t1.period_den = 1; t1.offset_num = 7; t1.offset_den = 1; t1.up_start = true; t2.offset_cnt = 0; t2.min = -24; t2.max = 64; t2.period_num = 1; t2.period_den = 8; t2.offset_num = 1; t2.offset_den = 3; t2.up_start = true; t3.offset_cnt = 0; t3.min = -256; t3.max = 16; t3.period_num = 4; t3.period_den = 1; t3.offset_num = 6; t3.offset_den = 1; t3.up_start = true; t4.offset_cnt = 0; t4.min = -512; t4.max = 16; t4.period_num = 4; t4.period_den = 1; t4.offset_num = 4; t4.offset_den = 1; t4.up_start = true; perc1.cnt_reload = 45; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; perc2.cnt_reload = 40; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x0FFFF00; perc3.cnt_reload = 40; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x0FFFF00; } void ederlezi() { t1.new_show(); t2.new_show(); t3.new_show(); t4.new_show(); for (uint16_t i=0; i < strip.numPixels() / 2 ; i++) { int g; int b; int r, r2; g = t1.process(); b = t2.process(); r = t3.process() + b + g + 64; if (r<0) r = 0; if (r>255) r = 255; r2 = t4.process() ; if (r2<0) r2 = 0; if (r2>255) r2 = 255; r = r + r2; if (r<0) r = 0; if (r>255) r = 255; if (g<0) g = 0; if (g>255) g = 255; if (b<0) b = 0; if (b>255) b = 255; if (r<0) r = 0; if (r>255) r = 255; strip.setPixelColor(i, strip.Color(r, g, b)); // SYMETRY !!!!!!!! strip.setPixelColor(strip.numPixels() - i, strip.Color(r, g, b)); } // Serial.println("SHOW"); } void config_intro_tempura() { perc1.cnt_reload = 45; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; train1.pos = strip.numPixels() / 2; train1.color = 0x0000FFFF; train1.train_size = 40; train1.train_mask = 0x32A6; // lower pixel density with simple mask train1.target = 120; train1.cnt_num = 1; train1.cnt_den = 2; train1.cnt_den_tmp = 0; perc2.cnt_reload = 40; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x0FFFF00; perc3.cnt_reload = 40; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x0FFFF00; train2.pos = 0; train2.color = 0x0000FF1F; train2.train_size = 80; train2.train_mask = 0x32A6; // lower pixel density with simple mask train2.target = strip.numPixels(); train2.cnt_num = 1; train2.cnt_den = 2; train2.cnt_den_tmp = 0; } void config_ayawuaska() { perc1.cnt_reload = 20; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x000FFFF; } void config_indian_kid() { perc1.cnt_reload = 45; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; train1.pos = strip.numPixels() / 2; train1.color = 0x0000FFFF; train1.train_size = 40; train1.train_mask = 0x32A6; // lower pixel density with simple mask train1.target = 120; train1.cnt_num = 1; train1.cnt_den = 2; train1.cnt_den_tmp = 0; perc2.cnt_reload = 40; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x0FF00FF; perc3.cnt_reload = 40; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x0FF00FF; } void config_costa() { perc1.cnt_reload = 45; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; perc2.cnt_reload = 40; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x0FFFF00; perc3.cnt_reload = 20; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x0FF0F00; perc4.cnt_reload = 20; perc4.cnt_num = 1; fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_out(); perc4.cnt_den = 1; perc4.color_fact = 15; perc4.max = 255; perc4.pos = strip.numPixels() * 7 / 8; perc4.color_mask = 0x00FFF00; train1.pos = strip.numPixels() / 2; train1.color = 0x0000FFFF; train1.train_size = 25; train1.train_mask = 0x0086; // lower pixel density with simple mask train1.target = 120; train1.cnt_num = 1; train1.cnt_den = 1; train1.cnt_den_tmp = 0; train2.pos = 0; train2.color = 0x0000FF1F; train2.train_size = 80; train2.train_mask = 0x32A6; // lower pixel density with simple mask train2.target = strip.numPixels(); train2.cnt_num = 1; train2.cnt_den = 2; train2.cnt_den_tmp = 0; } void config_mantra(){ perc1.cnt_reload = 30; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; perc2.cnt_reload = 30; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x000FF00; perc3.cnt_reload = 30; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x000FF00; } void config_bondlywood() { train1.pos = strip.numPixels() / 2; train1.color = 0x000000FF; train1.train_size = 70; train1.train_mask = 0x32A6; // lower pixel density with simple mask train1.target = 150; train1.cnt_num = 1; train1.cnt_den = 2; train1.cnt_den_tmp = 0; train2.pos = strip.numPixels() / 2; train2.color = 0x000000FF; train2.train_size = 70; train2.train_mask = 0x32A6; // lower pixel density with simple mask train2.target = 150; train2.cnt_num = 1; train2.cnt_den = 2; train2.cnt_den_tmp = 0; perc1.cnt_reload = 30; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; perc2.cnt_reload = 30; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0xFF0000; perc3.cnt_reload = 30; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0xFF0000; perc4.cnt_reload = strip.numPixels() / 2; perc4.cnt_num = 1; perc4.cnt_den = 1; // perc4.color_fact = 5; perc4.color_fact = 3; perc4.max = 255; perc4.pos = strip.numPixels() / 2; perc4.color_mask = strip.Color(40, 0, 0 ); } void config_kudunbao() { train1.pos = strip.numPixels() / 2; train1.color = 0x000000FF; train1.train_size = 70; train1.train_mask = 0x32A6; // lower pixel density with simple mask train1.target = 150; train1.cnt_num = 1; train1.cnt_den = 2; train1.cnt_den_tmp = 0; perc1.cnt_reload = 60; perc1.cnt_num = 5; perc1.cnt_den = 2; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FF0000; perc2.cnt_reload = 30; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x000FF; perc3.cnt_reload = 30; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x000FF; } void config_inawah_part_1() { train1.pos = 0; train1.color = 0x00FFF000; train1.train_size = 60; train1.train_mask = 0x1002; // lower pixel density with simple mask train1.target = 120; train1.cnt_num = 1; train1.cnt_den = 2; train1.cnt_den_tmp = 0; intro_cnt = 0; bond_cnt = 0; } void config_inawah_part_2() { rainbowStar1.pos = strip.numPixels() - MOON_START + 1; rainbowStar1.size = 30; rainbowStar1.target = 300; rainbowStar1.cnt_num = 3; rainbowStar1.cnt_den = 1; rainbowStar1.cnt_den_tmp = 0; rainbowStar2.pos = strip.numPixels() - MOON_START + 1; rainbowStar2.size = 30; rainbowStar2.target = 300; rainbowStar2.cnt_num = 3; rainbowStar2.cnt_den = 1; rainbowStar2.cnt_den_tmp = 0; rainbowStar3.pos = MOON_START - 1; rainbowStar3.size = 30; rainbowStar3.target = 0; rainbowStar3.cnt_num = 3; rainbowStar3.cnt_den = 1; rainbowStar3.cnt_den_tmp = 0; rainbowStar4.pos = MOON_START - 1; rainbowStar4.size = 30; rainbowStar4.target = 0; rainbowStar4.cnt_num = 3; rainbowStar4.cnt_den = 1; rainbowStar4.cnt_den_tmp = 0; } void config_one_planet() { perc1.cnt_reload = 55; perc1.cnt_num = 3; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; train1.pos = strip.numPixels() / 2; train1.color = 0x0000FFFF; train1.train_size = 60; train1.train_mask = 0x32A6; // lower pixel density with simple mask train1.target = 150; train1.cnt_num = 1; train1.cnt_den = 1; train1.cnt_den_tmp = 0; } void config_quasar() { perc1.cnt_reload = 40; perc1.cnt_num = 3; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x0FFFFFF; perc2.cnt_reload = 30; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x00000FF; perc3.cnt_reload = 30; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x00000FF; } void config_erhansar() { perc1.cnt_reload = 75; perc1.cnt_num = 3; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 255; perc1.pos = strip.numPixels() / 2; perc1.color_mask = 0x00000FF; train1.pos = strip.numPixels() / 2; train1.color = 0x00FFFFFF; train1.train_size = 80; train1.train_mask = 0x32A6; // lower pixel density with simple mask train1.target = 120; train1.cnt_num = 1; train1.cnt_den = 2; train1.cnt_den_tmp = 0; perc2.cnt_reload = 40; perc2.cnt_num = 1; perc2.cnt_den = 1; perc2.color_fact = 15; perc2.max = 255; perc2.pos = strip.numPixels() / 4; perc2.color_mask = 0x03F000F; perc3.cnt_reload = 40; perc3.cnt_num = 1; perc3.cnt_den = 1; perc3.color_fact = 15; perc3.max = 255; perc3.pos = strip.numPixels() * 3 / 4; perc3.color_mask = 0x0FFFF00; train2.pos = 0; train2.color = 0x0000FF1F; train2.train_size = 80; train2.train_mask = 0x32A6; // lower pixel density with simple mask train2.target = strip.numPixels(); train2.cnt_num = 1; train2.cnt_den = 2; train2.cnt_den_tmp = 0; } int kick_cnt; int snare_cnt; void read_serial(){ byte b; int a; int valid = 0; valid = 0; a = Serial.available (); if ( a > 0 ){ b = Serial.read(); // manage presets if (b == '0') { preset = 0; valid = 1; } else if (b == '&') { init_stars (); intro_cnt = 0; fade_stars_sub_cnt = 0; fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 10; valid = 1; } else if (b == '1') { config_intro_tempura(); fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 1; valid = 1; } else if (b == '2') { config_ayawuaska(); fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 2; valid = 1; } else if (b == '3') { config_indian_kid(); fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 3; valid = 1; } else if (b == '4') { config_costa(); fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 4; valid = 1; } else if (b == '5') { ederlezi_config(); fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 5; valid = 1; } else if (b == '6') { config_mantra(); fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 6; valid = 1; } else if (b == '7') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); preset = 7; valid = 1; } // MISSION BONDLLYWOOD else if (b == '8') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); config_bondlywood(); preset = 8; valid = 1; } // KUDUMBAO else if (b == '9') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); config_kudunbao(); preset = 9; valid = 1; } // DHOOMTALA CHILL else if (b == 'A') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); init_colorRamps(); init_kaleidoscope(); preset = 11; valid = 1; } // Inawah else if (b == 'B') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); config_inawah_part_1(); preset = 12; valid = 1; } else if (b == 'C') { config_inawah_part_2(); preset = 13; valid = 1; } else if (b == 'D') { config_inawah_part_1(); preset = 14; valid = 1; } // One planet else if (b == 'E') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); init_colorRamps_one_planet(); init_kaleidoscope(); config_one_planet(); preset = 15; valid = 1; } // Quasar else if (b == 'F') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; fade_in_out.start_in(); init_colorRamps_quasar(); init_kaleidoscope(); config_quasar(); preset = 16; valid = 1; } // Erhansar else if (b == 'G') { fade_in_out.cnt_num = 12; fade_in_out.cnt_den = 1; config_erhansar(); fade_in_out.start_in(); preset = 17; valid = 1; } else if (b == '!') { fade_in_out.cnt_num = 8; fade_in_out.cnt_den = 1; fade_in_out.start_out(); valid = 1; } switch (preset) { case 0: if (b == 'k') { train1.reload(); valid = 1; } break; /////////// INTRO TEMPURA //////////////////////// case 1: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'l' ){ train1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } else if ( b == 'n' ){ train2.reload(); valid = 1; } break; /////////// AYAWUASKA //////////////////////// case 2: if (b == 'k') { perc1.reload(); valid = 1; } break; /////////// INDIAN KID //////////////////////// case 3: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'l' ){ train1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } break; /////////// COSTA //////////////////////// case 4: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'l' ){ perc2.reload(); valid = 1; } else if ( b == 'm' ){ perc3.reload(); valid = 1; } else if ( b == 'n' ){ perc4.reload(); valid = 1; } else if ( b == 'o' ){ train1.reload(); valid = 1; } break; /////////// EDERLEZI //////////////////////// case 5: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } break; /////////// MANTRA //////////////////////// case 6: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } break; /////////// MISSION BONDLYWOOD //////////////////////// case 8: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } else if ( b == 'n' ){ perc4.reload(); valid = 1; } break; /////////// KUDUMBAO //////////////////////// case 9: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } break; /////////// INAWAH Part 2 //////////////////////// case 13: if (b == 'k') { rainbowStar1.reload(); valid = 1; } if (b == 'l') { rainbowStar2.reload(); valid = 1; } if (b == 'm') { rainbowStar3.reload(); valid = 1; } if (b == 'n') { rainbowStar4.reload(); valid = 1; } if (b == 'o') { // Thunder perc1.cnt_reload = 30; perc1.cnt_num = 1; perc1.cnt_den = 1; perc1.color_fact = 15; perc1.max = 150; perc1.pos = 200; perc1.color_mask = 0x07FFFFF; perc2.cnt_reload = 20; perc2.cnt_num = 1; perc2.cnt_den = 2; perc2.color_fact = 15; perc2.max = 150; perc2.pos = 120; perc2.color_mask = 0x07FFFFF; train1.pos = strip.numPixels() / 2; train1.color = 0x003F3F3F; train1.train_size = 60; train1.train_mask = 0x32A6; // lower pixel density with simple mask train1.target = 150; train1.cnt_num = 2; train1.cnt_den = 1; train1.cnt_den_tmp = 0; perc1.reload(); perc2.reload(); train1.reload(); valid = 1; } break; /////////// ONE PLANET //////////////////////// case 15: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'o' ){ train1.reload(); valid = 1; } break; /////////// QUASAR //////////////////////// case 16: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } break; /////////// ERhansar //////////////////////// case 17: if (b == 'k') { perc1.reload(); valid = 1; } else if ( b == 'l' ){ train1.reload(); valid = 1; } else if ( b == 'm' ){ perc2.reload(); perc3.reload(); valid = 1; } else if ( b == 'n' ){ train2.reload(); valid = 1; } break; /* if (b == 'k') { kick_cnt = 30; //error(); } else if (b == 's') { snare_cnt = 30; //error(); } else if (b == 'K') { perc1.reload(); //error(); } else if (b == 't') { train1.reload(); //error(); } else { error(); Serial.flush(); } */ } if ( !valid ){ error(); Serial.flush(); } } } void kick() { if (kick_cnt > 0 ) { kick_cnt --; int kick_color = kick_cnt*8; for (int i= 3 * strip.numPixels() >> 3; i < ( 5 * strip.numPixels() >> 3 ); i++){ strip.setPixelColor(i, /* strip.getPixelColor(i) | */ (/*kick_color << 16 |*/ kick_color << 8 | kick_color )); } } } void snare() { if (snare_cnt > 0 ) { snare_cnt --; int snare_color = snare_cnt*8; for (int i= 2 * strip.numPixels() >> 3; i < ( 3 * strip.numPixels() >> 3 ); i++){ strip.setPixelColor(i, strip.Color(snare_color,0, 0)); } } } int a = 346211; void randblue() { int b; for (int i=0; i< 10 ; i++){ a = a*413 + 537- a>>2; b = a & 0x1FF; strip.setPixelColor(b, strip.Color( 128, 0, 0)); } for (int i=0; i< 150 ; i++){ a = a*413 + 497; b = a & 0x1FF; strip.setPixelColor(b, strip.Color(0,0, 0)); } } void randgreen() { int b; int c; int white; for (int i=0; i< 10 ; i++){ b = msws(); c = b >> 9; if ( (b & 0x10) && (c & 0x08) && (c & 0x01)){ white = b >> 15; } else { white = 0; } b = b & 0x1FF; strip.setPixelColor(b, strip.Color(0, c,white )); } // for (int i=0; i< 150 ; i++){ // a = a*413 + 497; // b = a & 0x1FF; // strip.setPixelColor(b, strip.Color(0,0, 0)); // } } void randyellow() { int b; int c; int white; for (int i=0; i< 5 ; i++){ b = msws(); c = b >> 9; if ( (b & 0x10) && (c & 0x08) && (c & 0x01)){ white = b >> 15; } else { white = 0; } b = b & 0x1FF; strip.setPixelColor(b, strip.Color(c, c,white )); } // for (int i=0; i< 150 ; i++){ // a = a*413 + 497; // b = a & 0x1FF; // strip.setPixelColor(b, strip.Color(0,0, 0)); // } } void randwhite() { int b; int c; int white; for (int i=0; i< 3 ; i++){ b = msws(); b = b & 0x1FF; strip.setPixelColor(b, strip.Color(55, 55, 55)); } } void randall() { int b; int c; int j, nb; int i = 0; while( i <strip.numPixels() ){ b = msws(); c = msws(); nb = c >> 11; for (j=i; j< nb + i ; j++){ strip.setPixelColor(j, strip.Color(b>>8, b & 0xFF, c & 0xFF )); } i +=nb; } // for (int i=0; i< 150 ; i++){ // a = a*413 + 497; // b = a & 0x1FF; // strip.setPixelColor(b, strip.Color(0,0, 0)); // } } int mi = 0; int mj = 0; void mult() { long c; int i; mj ++; if ( mj == 1 ){ mi ++; mj = 0; } for (i=0; i< strip.numPixels() ; i++){ c = mi + i; c = c *c; strip.setPixelColor(i, c); } } int di = 0; int dj = 0; void blueriver() { long c; int i; // dj ++; // if ( dj == 8 ){ di ++; // dj = 0; // } for (i=0; i< strip.numPixels() / 2 ; i++){ c = di + i; c = c * c; strip.setPixelColor(i,strip.Color(0 ,0, c)); //symetry strip.setPixelColor(strip.numPixels() - i,strip.Color(0 ,0, c)); } } void greenblueriver() { long c; int g; int i; // dj ++; // if ( dj == 8 ){ di ++; // dj = 0; // } for (i=0; i< strip.numPixels() / 2 ; i++){ c = di + i; c = c * c; // if ( c > 128 ){ // g = 128; // // } // else { g = c; // } strip.setPixelColor(i,strip.Color(0 ,g, c)); //symetry strip.setPixelColor(strip.numPixels() - i,strip.Color(0 ,g, c)); } } void pinkriver() { #define RED_DIM 71 long c; int i; int r; dj ++; if ( dj == 5 ){ di ++; dj = 0; } for (i=0; i< strip.numPixels() / 2 ; i++){ c = di + i/4; c = c * c; r = c & 0xFF - RED_DIM + ((di >> 10) & 0xF) ; if ( r <0 ) r = 0; strip.setPixelColor(i,strip.Color(r ,0, c)); //symetry strip.setPixelColor(strip.numPixels() - i,strip.Color(r ,0, c)); } } // HARD FLASHY PINK RIVER: SPARE #if 0 void Speedriver() { #define RED_DIM 71 long c; int i; int r; dj ++; if ( dj == 3 ){ di ++; dj = 0; } for (i=0; i< strip.numPixels() / 2 ; i++){ c = di + i/4; c = c * c; r = c & 0xFF - RED_DIM; if ( r <0 ) r = 0; strip.setPixelColor(i,strip.Color(r ,0, c)); //symetry strip.setPixelColor(strip.numPixels() - i,strip.Color(r ,0, c)); } } #endif int ni = 0; int nj = 0; void symetricmorseblue() { long c; int g = 0; int i; // nj ++; // if ( nj == 1 ){ ni +=1; // nj = 0; // } for (i=0; i< strip.numPixels()/4 ; i++){ c = ni + i; c = (((c>>8)&0xF) & c) *c ; // g = (c & 0xFF) ^ 0xFF - 199; strip.setPixelColor(i,strip.Color(0 ,0, c)); strip.setPixelColor(strip.numPixels()/2 - i,strip.Color(0 ,g, c)); strip.setPixelColor(strip.numPixels()/2 + i,strip.Color(0 ,g, c)); strip.setPixelColor(strip.numPixels() - i,strip.Color(0 ,0, c)); } } void symetricmorseorange() { long c; int g = 0; int i; // nj ++; // if ( nj == 1 ){ ni +=1; // nj = 0; // } for (i=0; i< strip.numPixels()/4 ; i++){ c = ni + i; c = (((c>>8)&0xF) & c) *c ; g = (c & 0xFF) - 128; if ( g < 0 ){ g = 0; } strip.setPixelColor(i,strip.Color(c ,g, 0)); strip.setPixelColor(strip.numPixels()/2 - i,strip.Color(c ,g,0)); strip.setPixelColor(strip.numPixels()/2 + i,strip.Color(c ,g, 0)); strip.setPixelColor(strip.numPixels() - i,strip.Color(c ,g, 0)); } } void symetricmorsered() { long c; int g = 0; int i; // nj ++; // if ( nj == 1 ){ ni -=1; // nj = 0; // } for (i=0; i< strip.numPixels()/4 ; i++){ c = ni + i; c = (((c>>8)&0xF) & c) *c ; strip.setPixelColor(i,strip.Color(c ,0, 0)); strip.setPixelColor(strip.numPixels()/2 - i - 1,strip.Color(c ,0,0)); strip.setPixelColor(strip.numPixels()/2 + i ,strip.Color(c ,0, 0)); strip.setPixelColor(strip.numPixels() - i -1,strip.Color(c ,0, 0)); } } int rg_rainbow_j = 0; void rg_rainbow() { uint16_t i; uint32_t color; for(i=0; i<strip.numPixels()/4; i++) { color = rg_Wheel((i*1+rg_rainbow_j*2) & 255); strip.setPixelColor(i + strip.numPixels()/4, color); // Symetry strip.setPixelColor(3 * strip.numPixels() / 4 -i-1, color); } rg_rainbow_j ++; // if ( rg_rainbow_j > 254 ){ // rg_rainbow_j = 0; // } } // Input a value 0 to 255 to get a color value. // The colours are a transition r - g back to r. uint32_t rg_Wheel(byte WheelPos) { // WheelPos = 255 - WheelPos; if(WheelPos < 128) { return strip.Color(255 - WheelPos * 2, WheelPos * 2, 0); } WheelPos -= 128; return strip.Color(WheelPos * 2, 255 - WheelPos * 2, 0); } void aya_randgreen() { int b; int c; int white; for (int i=0; i< 5 ; i++){ b = msws(); c = b >> 9; if ( (b & 0x10) && (c & 0x08) && (c & 0x01)){ white = b >> 15; } else { white = 0; } b = b & 0x7F; strip.setPixelColor(b, strip.Color(0, c,white )); strip.setPixelColor(strip.numPixels() - b, strip.Color(0, c,white )); } // for (int i=0; i< 150 ; i++){ // a = a*413 + 497; // b = a & 0x1FF; // strip.setPixelColor(b, strip.Color(0,0, 0)); // } } uint16_t rainbow_idx = 0; void rainbow() { uint16_t i; uint32_t color; for(i=0; i<strip.numPixels()/2; i++) { color = Wheel((i*1+rainbow_idx*1) & 255); strip.setPixelColor(i, color); // Symetry strip.setPixelColor(strip.numPixels()-i-1, color); } rainbow_idx ++; if ( rainbow_idx > 255 ){ rainbow_idx = 0; } } // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { WheelPos = 255 - WheelPos; if(WheelPos < 85) { return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } if(WheelPos < 170) { WheelPos -= 85; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } WheelPos -= 170; return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } class colorRampElt { public: int16_t target; int8_t step; colorRampElt() { } }; #define CRAMP_RED_NB 6 colorRampElt cramp_r[CRAMP_RED_NB]; #define CRAMP_GREEN_NB 6 colorRampElt cramp_g[CRAMP_GREEN_NB]; #define CRAMP_BLUE_NB 6 colorRampElt cramp_b[CRAMP_BLUE_NB]; void init_colorRamps() { uint8_t idx = 0; ////////////// RED ////////////////// idx = 0; cramp_r[idx].target = 32; cramp_r[idx].step = 16; idx++; cramp_r[idx].target = -128; cramp_r[idx].step = -16; idx++; cramp_r[idx].target = 24; cramp_r[idx].step = 12; idx++; cramp_r[idx].target = -32; cramp_r[idx].step = -2; idx++; cramp_r[idx].target = 6; cramp_r[idx].step = 1; idx++; cramp_r[idx].target = -128; cramp_r[idx].step = -1; idx++; ////////////// GREEN ////////////////// idx = 0; cramp_g[idx].target = -128; cramp_g[idx].step = -4; idx++; cramp_g[idx].target = 32; cramp_g[idx].step = 4; idx++; cramp_g[idx].target = -53; cramp_g[idx].step = -5; idx++; cramp_g[idx].target = 19; cramp_g[idx].step = 13; idx++; cramp_g[idx].target = 6; cramp_g[idx].step = 1; idx++; cramp_g[idx].target = -128; cramp_g[idx].step = -1; idx++; ////////////// BLUE ////////////////// idx = 0; cramp_b[idx].target = -128; cramp_b[idx].step = -1; idx++; cramp_b[idx].target = 90; cramp_b[idx].step = 1; idx++; cramp_b[idx].target = -56; cramp_b[idx].step = -3; idx++; cramp_b[idx].target = 72; cramp_b[idx].step = 1; idx++; cramp_b[idx].target = 6; cramp_b[idx].step = 1; idx++; cramp_b[idx].target = -128; cramp_b[idx].step = -1; idx++; } void init_colorRamps_one_planet() { uint8_t idx = 0; ////////////// RED ////////////////// // No red idx = 0; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; ////////////// GREEN ////////////////// idx = 0; cramp_g[idx].target = -64; cramp_g[idx].step = -4; idx++; cramp_g[idx].target = 64; cramp_g[idx].step = 4; idx++; cramp_g[idx].target = -64; cramp_g[idx].step = -4; idx++; cramp_g[idx].target = 64; cramp_g[idx].step = 4; idx++; cramp_g[idx].target = -64; cramp_g[idx].step = -4; idx++; cramp_g[idx].target = 64; cramp_g[idx].step = 4; idx++; ////////////// BLUE ////////////////// idx = 0; cramp_b[idx].target = 64; cramp_b[idx].step = 4; idx++; cramp_b[idx].target = -64; cramp_b[idx].step = -4; idx++; cramp_b[idx].target = 64; cramp_b[idx].step = 4; idx++; cramp_b[idx].target = -64; cramp_b[idx].step = -4; idx++; cramp_b[idx].target = 64; cramp_b[idx].step = 4; idx++; cramp_b[idx].target = -64; cramp_b[idx].step = -4; idx++; } void init_colorRamps_quasar() { uint8_t idx = 0; ////////////// RED ////////////////// // No red idx = 0; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; cramp_r[idx].target = 0; cramp_r[idx].step = 0; idx++; ////////////// GREEN ////////////////// idx = 0; cramp_g[idx].target = -64; cramp_g[idx].step = -4; idx++; cramp_g[idx].target = 57; cramp_g[idx].step = 4; idx++; cramp_g[idx].target = -64; cramp_g[idx].step = -4; idx++; cramp_g[idx].target = 64; cramp_g[idx].step = 4; idx++; cramp_g[idx].target = -64; cramp_g[idx].step = -4; idx++; cramp_g[idx].target = 0; cramp_g[idx].step = 4; idx++; ////////////// BLUE ////////////////// idx = 0; cramp_b[idx].target = -64; cramp_b[idx].step = -4; idx++; cramp_b[idx].target = 64; cramp_b[idx].step = 4; idx++; cramp_b[idx].target = -64; cramp_b[idx].step = -4; idx++; cramp_b[idx].target = 57; cramp_b[idx].step = 4; idx++; cramp_b[idx].target = -64; cramp_b[idx].step = -4; idx++; cramp_b[idx].target = 0; cramp_b[idx].step = 4; idx++; } uint8_t cramp_start = 0; uint16_t cramp_sub_cnt = 0; void colorRamp() { uint8_t led_i; uint8_t cramp_index_r = 0; int16_t cur_r; uint8_t r; uint8_t cramp_index_g = 0; int16_t cur_g; uint8_t g; uint8_t cramp_index_b = 0; int16_t cur_b; uint8_t b; led_i = cramp_start; // first element of Cramp is the init value r = cur_r = cramp_r[cramp_index_r].target; if ( cur_r < 0) r = 0; if ( cur_r > 255) r = 255; g = cur_g = cramp_g[cramp_index_g].target; if ( cur_g < 0) g = 0; if ( cur_g > 255) g = 255; b = cur_b = cramp_b[cramp_index_b].target; if ( cur_b < 0) b = 0; if ( cur_b > 255) b = 255; strip.setPixelColor(led_i, r, g, b); led_i ++; if ( led_i > strip.numPixels() / 2 ) led_i = 0; cramp_index_r++; if (cramp_index_r > CRAMP_BLUE_NB - 1 ) cramp_index_r = 0; cramp_index_g++; if (cramp_index_g > CRAMP_BLUE_NB - 1 ) cramp_index_g = 0; cramp_index_b++; if (cramp_index_b > CRAMP_BLUE_NB - 1 ) cramp_index_b = 0; while (led_i != cramp_start) { r = cur_r = cur_r + cramp_r[cramp_index_r].step; if ( cur_r < 0) r = 0; if ( cur_r > 255) r = 255; g = cur_g = cur_g + cramp_g[cramp_index_g].step; if ( cur_g < 0) g = 0; if ( cur_g > 255) g = 255; b = cur_b = cur_b + cramp_b[cramp_index_b].step; if ( cur_b < 0) b = 0; if ( cur_b > 255) b = 255; strip.setPixelColor(led_i, r, g, b); led_i ++; if ( led_i > strip.numPixels() / 2 ) led_i = 0; if ( ( cramp_r[cramp_index_r].step < 0 && cur_r < cramp_r[cramp_index_r].target ) || ( cramp_r[cramp_index_r].step > 0 && cur_r > cramp_r[cramp_index_r].target ) ){ cramp_index_r++; if (cramp_index_r > CRAMP_BLUE_NB - 1 ) cramp_index_r = 0; } if ( ( cramp_g[cramp_index_g].step < 0 && cur_g < cramp_g[cramp_index_g].target ) || ( cramp_g[cramp_index_g].step > 0 && cur_g > cramp_g[cramp_index_g].target ) ){ cramp_index_g++; if (cramp_index_g > CRAMP_BLUE_NB - 1 ) cramp_index_g = 0; } if ( ( cramp_b[cramp_index_b].step < 0 && cur_b < cramp_b[cramp_index_b].target ) || ( cramp_b[cramp_index_b].step > 0 && cur_b > cramp_b[cramp_index_b].target ) ){ cramp_index_b++; if (cramp_index_b > CRAMP_BLUE_NB - 1 ) cramp_index_b = 0; } /// MOVE cramp_sub_cnt ++; if ( cramp_sub_cnt > 200 ){ cramp_sub_cnt = 0; cramp_start ++; if ( cramp_start > strip.numPixels() / 2 ){ cramp_start = 0; } } } } class kaleidoElt { public: uint8_t type; // 0: 0 to up, 1: end to down, 2: reverse, 3 : oposite uint8_t pix; uint8_t offset; kaleidoElt() { } }; #define KALEIDO_NB_ELTS 8 kaleidoElt kaleidoElts[KALEIDO_NB_ELTS]; kaleidoElt * kaleidoElts_reord[KALEIDO_NB_ELTS]; uint16_t kal_sub_cnt = 0xFFF0; void init_kaleidoscope(){ /// /!\ WARNING : At least one type 0 needed !!!!!! uint8_t idx = 0; kaleidoElts[idx].type = 0; kaleidoElts[idx].pix = 0; kaleidoElts[idx].offset = -1; idx ++; kaleidoElts[idx].type = 0; kaleidoElts[idx].pix = 3 *strip.numPixels() / 8; kaleidoElts[idx].offset = 2; idx ++; kaleidoElts[idx].type = 0; kaleidoElts[idx].pix = strip.numPixels() / 2; kaleidoElts[idx].offset = -3; idx ++; kaleidoElts[idx].type = 1; kaleidoElts[idx].pix = strip.numPixels() / 4; kaleidoElts[idx].offset = 1; idx ++; kaleidoElts[idx].type = 1; kaleidoElts[idx].pix = strip.numPixels() / 8; kaleidoElts[idx].offset = -2; idx ++; kaleidoElts[idx].type = 1; kaleidoElts[idx].pix = 3 *strip.numPixels() / 8; kaleidoElts[idx].offset = 3; idx ++; kaleidoElts[idx].type = 1; kaleidoElts[idx].pix = strip.numPixels() / 2; kaleidoElts[idx].offset = -1; idx ++; kaleidoElts[idx].type = 1; kaleidoElts[idx].pix = strip.numPixels() / 2; kaleidoElts[idx].offset = 1; idx ++; // init sub cnt high to enter the "move" section on first call kal_sub_cnt = 0xFFF0 ; } // use first half strip to build 2nd half // Then copy second half to the 1st void kaleidoscope(){ int16_t source_pix; uint16_t target_pix; uint16_t first_pix; uint8_t i, j; uint8_t elt_found ; uint8_t elt_cur ; uint8_t max; uint8_t up; // move (Note: kal_sub_cnt must be high enough to enter this on first call) kal_sub_cnt ++; if (kal_sub_cnt > 20) { int16_t new_pix; kal_sub_cnt = 0; // find first elt type 0 to start max = 255; i = 0; elt_found = 255; while( i < KALEIDO_NB_ELTS ){ if (kaleidoElts[i].type == 0 && kaleidoElts[i].pix < max ){ elt_found = i; max = kaleidoElts[i].pix; } i++; } if (elt_found == 255) { // No index found return; } first_pix = target_pix = kaleidoElts[elt_found].pix; // reorder elts i = first_pix + 1; if ( i > strip.numPixels() / 2 ) i = 0; kaleidoElts_reord[0] = & kaleidoElts[elt_found]; elt_found = 1; while( i != first_pix ){ for (j=0; j < KALEIDO_NB_ELTS; j++){ if ( kaleidoElts[j].pix == i ){ kaleidoElts_reord[elt_found] = & kaleidoElts[j]; elt_found++; } } i++; if ( i > strip.numPixels() / 2 ) i = 0; } i = 0; while( i < KALEIDO_NB_ELTS ){ if (kaleidoElts[i].offset > 0) { new_pix = kaleidoElts[i].pix + kaleidoElts[i].offset; if ( new_pix > strip.numPixels() / 2 ){ kaleidoElts[i].pix = 0; } else { kaleidoElts[i].pix = new_pix; } } else if (kaleidoElts[i].offset < 0) { new_pix = kaleidoElts[i].pix + kaleidoElts[i].offset; if ( new_pix < 0 ){ kaleidoElts[i].pix = strip.numPixels() / 2 - 1; } else { kaleidoElts[i].pix = new_pix; } } i++; } } // STEP First Pix before loop first_pix = target_pix = kaleidoElts_reord[0]->pix; up = 1; strip.setPixelColor(strip.numPixels() / 2 + target_pix, strip.getPixelColor(0)); // update target pix to enter the loop target_pix++; if ( target_pix > strip.numPixels() / 2 ) target_pix = 0; source_pix = 1; elt_cur = 0; while (target_pix != first_pix) { switch ( kaleidoElts_reord[elt_cur]->type ) { case 0: source_pix ++; if (source_pix > strip.numPixels() / 2 ) source_pix = 0; break; case 1: source_pix --; if (source_pix < 0) source_pix = strip.numPixels() / 2 - 1; break; case 2: if ( up ) { source_pix ++; if (source_pix > strip.numPixels() / 2 ) source_pix = 0; } else { source_pix --; if (source_pix < 0) source_pix = strip.numPixels() / 2 - 1; } break; } strip.setPixelColor(strip.numPixels() / 2 + target_pix, strip.getPixelColor(source_pix)); // check next element while( elt_cur + 1 < KALEIDO_NB_ELTS && kaleidoElts_reord[elt_cur + 1]->pix == target_pix ){ elt_cur = elt_cur + 1; // Update source pix if needed switch ( kaleidoElts_reord[elt_cur]->type ) { case 0: source_pix = 0; up = 1; break; case 1: source_pix = strip.numPixels() / 2 - 1; up = 0; break; case 2: // don't change source pix // Change directrion if ( up ) { up = 0; } else {up = 1; } break; } } target_pix++; if ( target_pix > strip.numPixels() / 2 ) target_pix = 0; } // Symetry for (i=0; i< strip.numPixels() / 2 ; i++){ strip.setPixelColor(i, strip.getPixelColor(strip.numPixels() - i - 1)); } } void dhoomtala() { colorRamp(); kaleidoscope(); } uint16_t earth_idx=0; void earth() { uint16_t j = earth_idx; bool blue; for (int i = 0; i < strip.numPixels() ; i++) { if ( i < 40 ) blue = 1; else if ( i < 38) blue = 0; else if ( i < 98) blue = 1; else if ( i < 103) blue = 0; else if ( i < 120) blue = 1; else if ( i < 129) blue = 0; else if ( i < 171) blue = 1; else if ( i < 196) blue = 0; else if ( i < 216) blue = 1; else if ( i < 248) blue = 0; else if ( i < 279) blue = 1; else if ( i < 284) blue = 0; else blue = 1; if ( blue ){ strip.setPixelColor(j, 0, 0, 200); } else { strip.setPixelColor(j, 0, 200, 0); } j ++; if ( j > strip.numPixels() ){ j = 0; } } earth_idx ++; if ( earth_idx > strip.numPixels() ){ earth_idx = 0; } } long bond_colors[8] = { strip.Color(255, 0, 0 ), strip.Color(255, 64, 0 ), strip.Color(128, 0, 64 ), strip.Color(255, 32, 24 ), // Saumon Salmon strip.Color(255, 0, 0 ), strip.Color(255, 96, 0 ), strip.Color(255, 200, 64 ), strip.Color(64, 0, 4 ) }; void bondlywood() { int r; allOff(); bond_cnt ++; if ( bond_cnt > 60 + train1.target & 0xFF /* (r & 0x7F ) */){ bond_cnt = 0; r = msws(); train1.pos = 86 + (r & 0x7F); train1.target = 35 + (r & 0x1FF);; // long l = (long)(msws()<<16 | r ); // train1.color = l; train1.color = bond_colors[ msws() & 0x07 ]; train1.reload(); } bond_cnt2 ++; if ( bond_cnt2 > 52 +train2.target ){ bond_cnt2 = 0; r = msws(); train2.pos = 86 + (r & 0x7F); train2.target = 35 + ((r>>8) & 0x3F);; // train2.color = 0x00FFFFFF & (long)(r<<16 | r ); train2.color = bond_colors[ msws() & 0x07 ]; train2.reload(); } // }
[ "supabassmasta@outlook.com" ]
supabassmasta@outlook.com
9089df18e2ae34c8e5a691cfef7fa4943624f5ad
87ad6ed8281344cd1d764bd6eaa5ef49051c269e
/main.h
80455d8caa34a6cbd5957c1f124c0baaac57e098
[]
no_license
ykomal/CompetitiveTest
fa72dc0be3e9161bbed869a0d48afa8284e38241
526a2797b3d13b3f4c114f19cd632cb08c36a8ba
refs/heads/master
2023-06-24T14:10:52.581039
2021-07-24T11:24:20
2021-07-24T11:24:20
389,073,243
0
0
null
null
null
null
UTF-8
C++
false
false
1,718
h
#include <stdlib.h> #include <bits/stdc++.h> using namespace std; ofstream tempFileOut; ifstream inputFile, outputFile, tempOutFileIn; // Code for testing input output void changingInputOutputStream() { ios_base::sync_with_stdio(false); std::cin.tie(0); inputFile.open ("input.txt"); outputFile.open ("output.txt"); tempOutFileIn.open ("tempOutputFile.txt"); ofstream inputOut, outputOut; inputOut.open ("input.txt"); outputOut.open ("output.txt", ios::trunc); tempFileOut.open ("tempOutputFile.txt"); char* mySecret = getenv("input"); char* mySecretOut = getenv("output"); inputOut<<mySecret; outputOut<<mySecretOut; inputOut.close(); outputOut.close(); std::cin.rdbuf(inputFile.rdbuf()); std::cout.rdbuf(tempFileOut.rdbuf()); } void writeOutput(string output) { ofstream outputOut; outputOut.open("output.txt", ios::out | ios::trunc); outputOut<<output; outputOut.close(); } void compareGeneratedOutput() { tempFileOut.close(); string inLine, outLine, input; ofstream inputOut, outputOut; string output = ""; while(getline(tempOutFileIn, inLine) && getline(outputFile, outLine)) { if(inLine.compare(outLine)) { output += "FAILED!"; output += "\n Expected output : " + outLine + "\n Got output : " + inLine; writeOutput(output); exit(0); } } if (getline(tempOutFileIn, inLine)) { output += "FAILED!"; output += "Found extra lines, check output"; writeOutput(output); exit(0); } inputFile.close(); outputFile.close(); tempOutFileIn.close(); output += "PASSED!!"; inputOut.open("input.txt", ios::out | ios::trunc); writeOutput(output); inputOut.close(); outputOut.close(); }
[ "ykomal@users.noreply.github.com" ]
ykomal@users.noreply.github.com
f38589ad824bbdb5095a67cdebe7c02dd6516563
152ace552e149f7c4b4996f30b4b74f886ea08e2
/layergames/LogicTienLenMN.h
b62b64d9fcef7bec672a61e77d94e9d3f750f9ca
[]
no_license
kidyobo/class
f053311bf9dffb65b01c11a703b7ee5dc553a7da
db20293d16f665626b7c31619c2885bcbc57825f
refs/heads/master
2020-08-19T14:20:02.709811
2018-12-11T04:04:20
2018-12-11T04:04:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,916
h
/*! * \class * * \brief * * \author Administrator * \date November 2015 */ #ifndef LogicTienLenMN_h__ #define LogicTienLenMN_h__ #include "cocos2d.h" #include "CardInfo.h" USING_NS_CC; using namespace std; class LogicTienLenMN{ private: int previouscardtype; ///danh cho tien len mien nam bool checkFirst(vector<CardInfo*> listc);//check lan dau de phan chia loai quan bool checkOne(vector < CardInfo*> listc);//check xem co phai 1 quan bai khong bool checkTwo(vector<CardInfo*> listc);// check 2 quan ///danh cho tien len mien bac bool checkOneMB(vector<CardInfo*> listc); bool checkTwoMB(vector<CardInfo*> listc); bool checkThreeMB(vector<CardInfo*> listc); bool checkFourMB(vector<CardInfo*> listc); bool checkSequenceMB(vector<CardInfo*> listc); //danh cho sam bool checkFirstSam(vector<CardInfo*> listc);//check lan dau de phan chia loai quan bool checkOneSam(vector < CardInfo*> listc);//check xem co phai 1 quan bai khong bool checkTwoSam(vector<CardInfo*> listc);// check 2 quan CardInfo* getCard(string idCard); CardInfo* getCard(int idCard); CardInfo* getCardPhom(string idCard); bool checkPlayMN(vector<CardInfo*> listcardinfo); bool checkPlayMB(vector<CardInfo*> listcardinfo); bool checkPlaySam(vector<CardInfo*> liscardinfo); ///recommend card vector<CardInfo*> checkRecommendMN(vector<CardInfo*> listcardinfo);//ham gợi ý tlmn bool checkRecommendMB(vector<CardInfo*> listcardinfo); bool checkRecommendSam(vector<CardInfo*> liscardinfo); vector<CardInfo*> getRecommendMN(vector<CardInfo*> listc, vector<CardInfo*> chooseCards); vector<CardInfo*> getRecommendMB(vector<CardInfo*> listc, vector<CardInfo*> chooseCards); vector<CardInfo*> getRecommendSam(vector<CardInfo*> listc, vector<CardInfo*> chooseCards); bool isConsecutive(vector<int> arr);//kiem tra 1 mang co phai la day lien tiep int getMin(vector<int> arr); int getMax(vector<int> arr); vector<CardInfo*> getRecommendFirst(vector<CardInfo*> listc, vector<CardInfo*> chooseCards);//ham lay danh sach cac quan bai goi y khi danh luot dau tien string convertVecToString(vector<int> arr); public: vector<CardInfo*> priviousplaycard; LogicTienLenMN(); bool checkPlay(string listc); void resetGame(); void setPreviousCard(string listc); CC_SYNTHESIZE(int, _gameid, GameID); CC_SYNTHESIZE(string, _list, ListReOrder); ///recommend card vector<CardInfo*> getRecommend(string listc, vector<int> chooseCards);//ham lay danh sach goi y, phai co input la 2 quan vector<CardInfo*> checkRecommendCard(string listcardinfo);//ham kiem tra xem co quan bai nao do duoc quan tren ban hay khong vector<int> splitStringtoInt(string &S, const char &str); vector<int> getListIDFromArray(vector<CardInfo*> _listCard);// ham chuyen mang cardinfo ra 1 mang id cac quan bai string getListCardFromArray(vector<CardInfo*> _listCard);// ham chuyen mang cardinfo ra 1 chuoi }; #endif // LogicTienLenMN_h__
[ "xthaohg@gmail.com" ]
xthaohg@gmail.com
9d1b03d2c72fdd304cc924e6fc72633007e39ac0
0494c9caa519b27f3ed6390046fde03a313d2868
/src/content/renderer/device_orientation/device_motion_event_pump_unittest.cc
2b628d4c80ef9bdf48f0507363ef4890c25651d4
[ "BSD-3-Clause" ]
permissive
mhcchang/chromium30
9e9649bec6fb19fe0dc2c8b94c27c9d1fa69da2c
516718f9b7b95c4280257b2d319638d4728a90e1
refs/heads/master
2023-03-17T00:33:40.437560
2017-08-01T01:13:12
2017-08-01T01:13:12
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,875
cc
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "device_motion_event_pump.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "content/common/device_motion_hardware_buffer.h" #include "content/public/test/test_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" namespace content { class DeviceMotionEventPumpTest : public testing::Test { }; class MockDeviceMotionListener : public WebKit::WebDeviceMotionListener { public: MockDeviceMotionListener(); virtual ~MockDeviceMotionListener() { } virtual void didChangeDeviceMotion( const WebKit::WebDeviceMotionData&) OVERRIDE; bool did_change_device_motion_; WebKit::WebDeviceMotionData data_; }; MockDeviceMotionListener::MockDeviceMotionListener() : did_change_device_motion_(false) { memset(&data_, 0, sizeof(data_)); } void MockDeviceMotionListener::didChangeDeviceMotion( const WebKit::WebDeviceMotionData& data) { memcpy(&data_, &data, sizeof(data)); did_change_device_motion_ = true; } class DeviceMotionEventPumpForTesting : public DeviceMotionEventPump { public: DeviceMotionEventPumpForTesting() { } virtual ~DeviceMotionEventPumpForTesting() { } void OnDidStartDeviceMotion(base::SharedMemoryHandle handle); bool SetListener(WebKit::WebDeviceMotionListener*); bool StartFetchingDeviceMotion(); bool StopFetchingDeviceMotion(); }; bool DeviceMotionEventPumpForTesting::StartFetchingDeviceMotion() { state_ = PENDING_START; return true; } bool DeviceMotionEventPumpForTesting::StopFetchingDeviceMotion() { if (timer_.IsRunning()) timer_.Stop(); state_ = STOPPED; return true; } bool DeviceMotionEventPumpForTesting::SetListener( WebKit::WebDeviceMotionListener* listener) { listener_ = listener; return (listener_) ? StartFetchingDeviceMotion() : StopFetchingDeviceMotion(); } void DeviceMotionEventPumpForTesting::OnDidStartDeviceMotion( base::SharedMemoryHandle handle) { DeviceMotionEventPump::OnDidStartDeviceMotion(handle); } // Always failing in the win try bot. See http://crbug.com/256782. #if defined(OS_WIN) #define MAYBE_DidStartPolling DISABLED_DidStartPolling #else #define MAYBE_DidStartPolling DidStartPolling #endif TEST_F(DeviceMotionEventPumpTest, MAYBE_DidStartPolling) { base::MessageLoop loop(base::MessageLoop::TYPE_UI); scoped_ptr<MockDeviceMotionListener> listener(new MockDeviceMotionListener); scoped_ptr<DeviceMotionEventPumpForTesting> motion_pump( new DeviceMotionEventPumpForTesting); base::SharedMemoryHandle handle; base::SharedMemory shared_memory; EXPECT_TRUE(shared_memory.CreateAndMapAnonymous( sizeof(DeviceMotionHardwareBuffer))); DeviceMotionHardwareBuffer* buffer = static_cast<DeviceMotionHardwareBuffer*>(shared_memory.memory()); memset(buffer, 0, sizeof(DeviceMotionHardwareBuffer)); shared_memory.ShareToProcess(base::kNullProcessHandle, &handle); WebKit::WebDeviceMotionData& data = buffer->data; data.accelerationX = 1; data.hasAccelerationX = true; data.accelerationY = 2; data.hasAccelerationY = true; data.accelerationZ = 3; data.hasAccelerationZ = true; data.allAvailableSensorsAreActive = true; motion_pump->SetListener(listener.get()); motion_pump->OnDidStartDeviceMotion(handle); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds( DeviceMotionEventPump::GetDelayMillis() * 2)); RunAllPendingInMessageLoop(); motion_pump->SetListener(0); WebKit::WebDeviceMotionData& received_data = listener->data_; EXPECT_TRUE(listener->did_change_device_motion_); EXPECT_TRUE(received_data.hasAccelerationX); EXPECT_EQ(1, (double)received_data.accelerationX); EXPECT_TRUE(received_data.hasAccelerationX); EXPECT_EQ(2, (double)received_data.accelerationY); EXPECT_TRUE(received_data.hasAccelerationY); EXPECT_EQ(3, (double)received_data.accelerationZ); EXPECT_TRUE(received_data.hasAccelerationZ); EXPECT_FALSE(received_data.hasAccelerationIncludingGravityX); EXPECT_FALSE(received_data.hasAccelerationIncludingGravityY); EXPECT_FALSE(received_data.hasAccelerationIncludingGravityZ); EXPECT_FALSE(received_data.hasRotationRateAlpha); EXPECT_FALSE(received_data.hasRotationRateBeta); EXPECT_FALSE(received_data.hasRotationRateGamma); } // Although this test passes on windows builds it is not certain if it does // so for the right reason. See http://crbug.com/256782. #if defined(OS_WIN) #define MAYBE_DidStartPollingNotAllSensorsActive \ DISABLED_DidStartPollingNotAllSensorsActive #else #define MAYBE_DidStartPollingNotAllSensorsActive \ DidStartPollingNotAllSensorsActive #endif TEST_F(DeviceMotionEventPumpTest, MAYBE_DidStartPollingNotAllSensorsActive) { base::MessageLoop loop(base::MessageLoop::TYPE_UI); scoped_ptr<MockDeviceMotionListener> listener(new MockDeviceMotionListener); scoped_ptr<DeviceMotionEventPumpForTesting> motion_pump( new DeviceMotionEventPumpForTesting); base::SharedMemoryHandle handle; base::SharedMemory shared_memory; EXPECT_TRUE(shared_memory.CreateAndMapAnonymous( sizeof(DeviceMotionHardwareBuffer))); DeviceMotionHardwareBuffer* buffer = static_cast<DeviceMotionHardwareBuffer*>(shared_memory.memory()); memset(buffer, 0, sizeof(DeviceMotionHardwareBuffer)); shared_memory.ShareToProcess(base::kNullProcessHandle, &handle); WebKit::WebDeviceMotionData& data = buffer->data; data.accelerationX = 1; data.hasAccelerationX = true; data.accelerationY = 2; data.hasAccelerationY = true; data.accelerationZ = 3; data.hasAccelerationZ = true; data.allAvailableSensorsAreActive = false; motion_pump->SetListener(listener.get()); motion_pump->OnDidStartDeviceMotion(handle); base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds( DeviceMotionEventPump::GetDelayMillis() * 2)); RunAllPendingInMessageLoop(); motion_pump->SetListener(0); WebKit::WebDeviceMotionData& received_data = listener->data_; // No change in device motion because allAvailableSensorsAreActive is false. EXPECT_FALSE(listener->did_change_device_motion_); EXPECT_FALSE(received_data.hasAccelerationX); EXPECT_FALSE(received_data.hasAccelerationX); EXPECT_FALSE(received_data.hasAccelerationY); EXPECT_FALSE(received_data.hasAccelerationZ); EXPECT_FALSE(received_data.hasAccelerationIncludingGravityX); EXPECT_FALSE(received_data.hasAccelerationIncludingGravityY); EXPECT_FALSE(received_data.hasAccelerationIncludingGravityZ); EXPECT_FALSE(received_data.hasRotationRateAlpha); EXPECT_FALSE(received_data.hasRotationRateBeta); EXPECT_FALSE(received_data.hasRotationRateGamma); } } // namespace content
[ "1990zhaoshuang@163.com" ]
1990zhaoshuang@163.com
fe3038cf0994aa7e05c15d7e297321562f580f64
102194a4076c1641cb618b2342b45d128b99bdc4
/ClusterChatServer/include/server/chatserver.hpp
499aeff20f73bdab9c469b89437668f5e31b8ae6
[]
no_license
BUGmakerrr/a
3e1840056c96ae5716382056ea9d60ea002c40ea
bc1f46e9d07dff58895a34b0ef081b492dd8c7fb
refs/heads/main
2023-03-16T07:43:21.302371
2021-03-13T12:13:18
2021-03-13T12:13:18
335,953,018
0
0
null
null
null
null
UTF-8
C++
false
false
543
hpp
#ifndef CHATSERVER_H #define CHATSERVER_H #include <muduo/net/TcpServer.h> #include <muduo/net/EventLoop.h> using namespace muduo; using namespace muduo::net; class ChatServer { public: ChatServer(EventLoop *loop, const InetAddress &listenAddr, const string &nameArg); void start(); private: void onConnection(const TcpConnectionPtr &); void onMessage(const TcpConnectionPtr &, Buffer *, Timestamp); TcpServer _server; EventLoop *_loop; }; #endif
[ "799745201@qq.com" ]
799745201@qq.com
21c2411021bb567ed5e2ab29f1ecb56a2204c6f6
f71db7c7581afe05407121be422475bad866bbbc
/lib/timestep/eulerCN_d2.cc
8ea8437b3f15553d60c1f1b83b1cdabb2746e367
[ "BSD-3-Clause" ]
permissive
roshansamuel/saras_dev
554e93399bb7a7d1ba09b8019d0d8da034a58f2f
d2a9bf1221276f398514684ec15dbb4588f97abe
refs/heads/master
2021-07-02T01:44:43.656659
2021-06-14T18:36:27
2021-06-14T18:36:27
241,902,787
0
0
null
null
null
null
UTF-8
C++
false
false
22,637
cc
/******************************************************************************************************************************************** * Saras * * Copyright (C) 2019, Mahendra K. Verma * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************************************************************************** */ /*! \file eulerCN_d2.cc * * \brief Definitions for functions of class timestep * \sa timestep.h * \author Roshan Samuel * \date Nov 2019 * \copyright New BSD License * ******************************************************************************************************************************************** */ #include "timestep.h" /** ******************************************************************************************************************************************** * \brief Constructor of the timestep class * * The empty constructor merely initializes the local reference to the global mesh variable. * Also, the maximum allowable number of iterations for the Jacobi iterative solver being used to solve for the * velocities implicitly is set as \f$ N_{max} = N_x \times N_y \times N_z \f$, where \f$N_x\f$, \f$N_y\f$ and \f$N_z\f$ * are the number of grid points in the collocated grid at the local sub-domains along x, y and z directions * respectively. * * \param mesh is a const reference to the global data contained in the grid class. ******************************************************************************************************************************************** */ eulerCN_d2::eulerCN_d2(const grid &mesh, const real &sTime, const real &dt, tseries &tsIO, vfield &V, sfield &P): timestep(mesh, sTime, dt, tsIO, V, P), mgSolver(mesh, mesh.inputParams) { setCoefficients(); // This upper limit on max iterations is an arbitrarily chosen function. // Using Nx x Ny x Nz as the upper limit may cause the run to freeze for very long time. // This can eat away a lot of core hours unnecessarily. // It remains to be seen if this upper limit is safe. maxIterations = int(std::pow(std::log(mesh.collocCoreSize(0)*mesh.collocCoreSize(1)*mesh.collocCoreSize(2)), 3)); } /** ******************************************************************************************************************************************** * \brief Function to advance the solution using Euler method and Implicit Crank-Nicholson method * * The non-linear terms are advanced using explicit Euler method, while the duffusion terms are * advanced by semi-implicit Crank-Nicholson method. * This overloaded function advances velocity and pressure fields for hydrodynamics simulations. * ******************************************************************************************************************************************** */ void eulerCN_d2::timeAdvance(vfield &V, sfield &P) { static plainvf nseRHS(mesh, V); nseRHS = 0.0; // Compute the diffusion term of momentum equation V.computeDiff(nseRHS); // Split the diffusion term and multiply by diffusion coefficient nseRHS *= nu/2; // Compute the non-linear term and subtract it from the RHS V.computeNLin(V, nseRHS); // Add the velocity forcing term V.vForcing->addForcing(nseRHS); // Subtract the pressure gradient term pressureGradient = 0.0; P.gradient(pressureGradient, V); nseRHS -= pressureGradient; // Multiply the entire RHS with dt and add the velocity of previous time-step to advance by explicit Euler method nseRHS *= dt; nseRHS += V; // Synchronize the RHS term across all processors by updating its sub-domain pads nseRHS.syncData(); // Using the RHS term computed, compute the guessed velocity of CN method iteratively (and store it in V) solveVx(V, nseRHS); solveVz(V, nseRHS); // Calculate the rhs for the poisson solver (mgRHS) using the divergence of guessed velocity in V V.divergence(mgRHS, P); mgRHS *= 1.0/dt; // IF THE POISSON SOLVER IS BEING TESTED, THE RHS IS SET TO ONE. // THIS IS FOR TESTING ONLY AND A SINGLE TIME ADVANCE IS PERFORMED IN THIS TEST #ifdef TEST_POISSON mgRHS.F = 1.0; #endif // Using the calculated mgRHS, evaluate pressure correction (Pp) using multi-grid method mgSolver.mgSolve(Pp, mgRHS); // Synchronise the pressure correction term across processors Pp.syncData(); // IF THE POISSON SOLVER IS BEING TESTED, THE PRESSURE IS SET TO ZERO. // THIS WAY, AFTER THE SOLUTION OF MG SOLVER, Pp, IS DIRECTLY WRITTEN INTO P AND AVAILABLE FOR PLOTTING // THIS IS FOR TESTING ONLY AND A SINGLE TIME ADVANCE IS PERFORMED IN THIS TEST #ifdef TEST_POISSON P.F = 0.0; #endif // Add the pressure correction term to the pressure field of previous time-step, P P += Pp; // Finally get the velocity field at end of time-step by subtracting the gradient of pressure correction from V Pp.gradient(pressureGradient, V); pressureGradient *= dt; V -= pressureGradient; // Impose boundary conditions on the updated velocity field, V V.imposeBCs(); // Impose boundary conditions on the updated pressure field, P P.imposeBCs(); } /** ******************************************************************************************************************************************** * \brief Function to advance the solution using Euler method and Implicit Crank-Nicholson method * * The non-linear terms are advanced using explicit Euler method, while the duffusion terms are * advanced by semi-implicit Crank-Nicholson method. * This overloaded function advances velocity, temperature and pressure fields for scalar simulations. * ******************************************************************************************************************************************** */ void eulerCN_d2::timeAdvance(vfield &V, sfield &P, sfield &T) { static plainvf nseRHS(mesh, V); static plainsf tmpRHS(mesh, T); // BELOW FLAG MAY BE TURNED OFF FOR DEBUGGING/DIGNOSTIC RUNS ONLY // IT IS USED TO TURN OFF COMPUTATION OF NON-LINEAR TERMS // CURRENTLY IT IS AVAILABLE ONLY FOR THE 2D SCALAR SOLVER bool nlinSwitch = true; nseRHS = 0.0; tmpRHS = 0.0; // Compute the diffusion term of momentum equation V.computeDiff(nseRHS); // Split the diffusion term and multiply by diffusion coefficient nseRHS *= nu/2; // Compute the diffusion term of scalar equation T.computeDiff(tmpRHS); // Split the diffusion term and multiply by diffusion coefficient tmpRHS *= kappa/2; // Compute the non-linear term and subtract it from the RHS of momentum equation V.computeNLin(V, nseRHS); if (nlinSwitch) { // Compute the non-linear term and subtract it from the RHS of scalar equation T.computeNLin(V, tmpRHS); } else { // EVEN WHEN NON-LINEAR TERM IS TURNED OFF, THE MEAN FLOW EFFECTS STILL REMAIN // HENCE THE CONTRIBUTION OF VELOCITY TO SCALAR EQUATION MUST BE ADDED // THIS CONTRIBUTION IS Uz FOR RBC AND SST, BUT Ux FOR VERTICAL CONVECTION if (mesh.inputParams.probType == 5 || mesh.inputParams.probType == 6) { T.interTempF = 0.0; for (unsigned int i=0; i < T.F.VzIntSlices.size(); i++) { T.interTempF(T.F.fCore) += V.Vz.F(T.F.VzIntSlices(i)); } tmpRHS.F += T.interTempF/T.F.VzIntSlices.size(); } else if (mesh.inputParams.probType == 7) { T.interTempF = 0.0; for (unsigned int i=0; i < T.F.VxIntSlices.size(); i++) { T.interTempF(T.F.fCore) += V.Vx.F(T.F.VxIntSlices(i)); } tmpRHS.F += T.interTempF/T.F.VxIntSlices.size(); } } // Add the velocity forcing term V.vForcing->addForcing(nseRHS); // Add the scalar forcing term T.tForcing->addForcing(tmpRHS); // Subtract the pressure gradient term from momentum equation pressureGradient = 0.0; P.gradient(pressureGradient, V); nseRHS -= pressureGradient; // Multiply the entire RHS with dt and add the velocity of previous time-step to advance by explicit Euler method nseRHS *= dt; nseRHS += V; // Multiply the entire RHS with dt and add the temperature of previous time-step to advance by explicit Euler method tmpRHS *= dt; tmpRHS += T; // Synchronize both the RHS terms across all processors by updating their sub-domain pads nseRHS.syncData(); tmpRHS.syncData(); // Using the RHS term computed, compute the guessed velocity of CN method iteratively (and store it in V) solveVx(V, nseRHS); solveVz(V, nseRHS); // Using the RHS term computed, compute the temperature at next time-step iteratively (and store it in T) solveT(T, tmpRHS); // Calculate the rhs for the poisson solver (mgRHS) using the divergence of guessed velocity in V V.divergence(mgRHS, P); mgRHS *= 1.0/dt; // Using the calculated mgRHS, evaluate pressure correction (Pp) using multi-grid method mgSolver.mgSolve(Pp, mgRHS); // Synchronise the pressure correction term across processors Pp.syncData(); // Add the pressure correction term to the pressure field of previous time-step, P P += Pp; // Finally get the velocity field at end of time-step by subtracting the gradient of pressure correction from V Pp.gradient(pressureGradient, V); pressureGradient *= dt; V -= pressureGradient; // Impose boundary conditions on the updated velocity field, V V.imposeBCs(); // Impose boundary conditions on the updated pressure field, P P.imposeBCs(); // Impose boundary conditions on the updated temperature field, T T.imposeBCs(); } /** ******************************************************************************************************************************************** * \brief Function to solve the implicit equation for x-velocity * * The implicit equation for \f$ u_x' \f$ of the implicit Crank-Nicholson method is solved using the Jacobi * iterative method here. * * The loop exits when the global maximum of the error in computed solution falls below the specified tolerance. * If the solution doesn't converge even after an internally assigned maximum number for iterations, the solver * aborts with an error message. * ******************************************************************************************************************************************** */ void eulerCN_d2::solveVx(vfield &V, plainvf &nseRHS) { int iterCount = 0; real locMax = 0.0; real gloMax = 0.0; static blitz::Array<real, 3> tempVx(V.Vx.F.lbound(), V.Vx.F.shape()); while (true) { int iY = 0; #pragma omp parallel for num_threads(mesh.inputParams.nThreads) default(none) shared(V) shared(nseRHS) shared(tempVx) shared(iY) for (int iX = V.Vx.fBulk.lbound(0); iX <= V.Vx.fBulk.ubound(0); iX++) { for (int iZ = V.Vx.fBulk.lbound(2); iZ <= V.Vx.fBulk.ubound(2); iZ++) { tempVx(iX, iY, iZ) = ((ihx2 * mesh.xix2Colloc(iX) * (V.Vx.F(iX+1, iY, iZ) + V.Vx.F(iX-1, iY, iZ)) + i2hx * mesh.xixxColloc(iX) * (V.Vx.F(iX+1, iY, iZ) - V.Vx.F(iX-1, iY, iZ)) + ihz2 * mesh.ztz2Staggr(iZ) * (V.Vx.F(iX, iY, iZ+1) + V.Vx.F(iX, iY, iZ-1)) + i2hz * mesh.ztzzStaggr(iZ) * (V.Vx.F(iX, iY, iZ+1) - V.Vx.F(iX, iY, iZ-1))) * dt * nu * 0.5 + nseRHS.Vx(iX, iY, iZ)) / (1.0 + dt * nu * (ihx2 * mesh.xix2Colloc(iX) + ihz2 * mesh.ztz2Staggr(iZ))); } } V.Vx.F = tempVx; V.imposeVxBC(); #pragma omp parallel for num_threads(mesh.inputParams.nThreads) default(none) shared(V) shared(tempVx) shared(iY) for (int iX = V.Vx.fBulk.lbound(0); iX <= V.Vx.fBulk.ubound(0); iX++) { for (int iZ = V.Vx.fBulk.lbound(2); iZ <= V.Vx.fBulk.ubound(2); iZ++) { tempVx(iX, iY, iZ) = V.Vx.F(iX, iY, iZ) - 0.5 * dt * nu * ( mesh.xix2Colloc(iX) * (V.Vx.F(iX+1, iY, iZ) - 2.0 * V.Vx.F(iX, iY, iZ) + V.Vx.F(iX-1, iY, iZ)) * ihx2 + mesh.xixxColloc(iX) * (V.Vx.F(iX+1, iY, iZ) - V.Vx.F(iX-1, iY, iZ)) * i2hx + mesh.ztz2Staggr(iZ) * (V.Vx.F(iX, iY, iZ+1) - 2.0 * V.Vx.F(iX, iY, iZ) + V.Vx.F(iX, iY, iZ-1)) * ihz2 + mesh.ztzzStaggr(iZ) * (V.Vx.F(iX, iY, iZ+1) - V.Vx.F(iX, iY, iZ-1)) * i2hz); } } tempVx(V.Vx.fBulk) = abs(tempVx(V.Vx.fBulk) - nseRHS.Vx(V.Vx.fBulk)); locMax = blitz::max(tempVx(V.Vx.fBulk)); MPI_Allreduce(&locMax, &gloMax, 1, MPI_FP_REAL, MPI_MAX, MPI_COMM_WORLD); if (gloMax < mesh.inputParams.cnTolerance) { break; } iterCount += 1; if (iterCount > maxIterations) { if (mesh.rankData.rank == 0) { std::cout << "ERROR: Jacobi iterations for solution of Vx not converging. Aborting" << std::endl; } MPI_Finalize(); exit(0); } } } /** ******************************************************************************************************************************************** * \brief Function to solve the implicit equation for z-velocity * * The implicit equation for \f$ u_z' \f$ of the implicit Crank-Nicholson method is solved using the Jacobi * iterative method here. * * The loop exits when the global maximum of the error in computed solution falls below the specified tolerance. * If the solution doesn't converge even after an internally assigned maximum number for iterations, the solver * aborts with an error message. * ******************************************************************************************************************************************** */ void eulerCN_d2::solveVz(vfield &V, plainvf &nseRHS) { int iterCount = 0; real locMax = 0.0; real gloMax = 0.0; static blitz::Array<real, 3> tempVz(V.Vz.F.lbound(), V.Vz.F.shape()); while (true) { int iY = 0; #pragma omp parallel for num_threads(mesh.inputParams.nThreads) default(none) shared(V) shared(nseRHS) shared(tempVz) shared(iY) for (int iX = V.Vz.fBulk.lbound(0); iX <= V.Vz.fBulk.ubound(0); iX++) { for (int iZ = V.Vz.fBulk.lbound(2); iZ <= V.Vz.fBulk.ubound(2); iZ++) { tempVz(iX, iY, iZ) = ((ihx2 * mesh.xix2Staggr(iX) * (V.Vz.F(iX+1, iY, iZ) + V.Vz.F(iX-1, iY, iZ)) + i2hx * mesh.xixxStaggr(iX) * (V.Vz.F(iX+1, iY, iZ) - V.Vz.F(iX-1, iY, iZ)) + ihz2 * mesh.ztz2Colloc(iZ) * (V.Vz.F(iX, iY, iZ+1) + V.Vz.F(iX, iY, iZ-1)) + i2hz * mesh.ztzzColloc(iZ) * (V.Vz.F(iX, iY, iZ+1) - V.Vz.F(iX, iY, iZ-1))) * dt * nu * 0.5 + nseRHS.Vz(iX, iY, iZ)) / (1.0 + dt * nu * (ihx2 * mesh.xix2Staggr(iX) + ihz2 * mesh.ztz2Colloc(iZ))); } } V.Vz.F = tempVz; V.imposeVzBC(); #pragma omp parallel for num_threads(mesh.inputParams.nThreads) default(none) shared(V) shared(tempVz) shared(iY) for (int iX = V.Vz.fBulk.lbound(0); iX <= V.Vz.fBulk.ubound(0); iX++) { for (int iZ = V.Vz.fBulk.lbound(2); iZ <= V.Vz.fBulk.ubound(2); iZ++) { tempVz(iX, iY, iZ) = V.Vz.F(iX, iY, iZ) - 0.5 * dt * nu * ( mesh.xix2Staggr(iX) * (V.Vz.F(iX+1, iY, iZ) - 2.0 * V.Vz.F(iX, iY, iZ) + V.Vz.F(iX-1, iY, iZ)) * ihx2 + mesh.xixxStaggr(iX) * (V.Vz.F(iX+1, iY, iZ) - V.Vz.F(iX-1, iY, iZ)) * i2hx + mesh.ztz2Colloc(iZ) * (V.Vz.F(iX, iY, iZ+1) - 2.0 * V.Vz.F(iX, iY, iZ) + V.Vz.F(iX, iY, iZ-1)) * ihz2 + mesh.ztzzColloc(iZ) * (V.Vz.F(iX, iY, iZ+1) - V.Vz.F(iX, iY, iZ-1)) * i2hz); } } tempVz(V.Vz.fBulk) = abs(tempVz(V.Vz.fBulk) - nseRHS.Vz(V.Vz.fBulk)); locMax = blitz::max(tempVz(V.Vz.fBulk)); MPI_Allreduce(&locMax, &gloMax, 1, MPI_FP_REAL, MPI_MAX, MPI_COMM_WORLD); if (gloMax < mesh.inputParams.cnTolerance) { break; } iterCount += 1; if (iterCount > maxIterations) { if (mesh.rankData.rank == 0) { std::cout << "ERROR: Jacobi iterations for solution of Vz not converging. Aborting" << std::endl; } MPI_Finalize(); exit(0); } } } /** ******************************************************************************************************************************************** * \brief Function to solve the implicit equation for scalar field * * The implicit equation for \f$ \theta' \f$ of the implicit Crank-Nicholson method is solved using the Jacobi * iterative method here. * * The loop exits when the global maximum of the error in computed solution falls below the specified tolerance. * If the solution doesn't converge even after an internally assigned maximum number for iterations, the solver * aborts with an error message. * ******************************************************************************************************************************************** */ void eulerCN_d2::solveT(sfield &T, plainsf &tmpRHS) { int iterCount = 0; real locMax = 0.0; real gloMax = 0.0; static blitz::Array<real, 3> tempT(T.F.F.lbound(), T.F.F.shape()); while (true) { int iY = 0; #pragma omp parallel for num_threads(mesh.inputParams.nThreads) default(none) shared(T) shared(tmpRHS) shared(tempT) shared(iY) for (int iX = T.F.fBulk.lbound(0); iX <= T.F.fBulk.ubound(0); iX++) { for (int iZ = T.F.fBulk.lbound(2); iZ <= T.F.fBulk.ubound(2); iZ++) { tempT(iX, iY, iZ) = ((ihx2 * mesh.xix2Staggr(iX) * (T.F.F(iX+1, iY, iZ) + T.F.F(iX-1, iY, iZ)) + i2hx * mesh.xixxStaggr(iX) * (T.F.F(iX+1, iY, iZ) - T.F.F(iX-1, iY, iZ)) + ihz2 * mesh.ztz2Staggr(iZ) * (T.F.F(iX, iY, iZ+1) + T.F.F(iX, iY, iZ-1)) + i2hz * mesh.ztzzStaggr(iZ) * (T.F.F(iX, iY, iZ+1) - T.F.F(iX, iY, iZ-1))) * dt * kappa * 0.5 + tmpRHS.F(iX, iY, iZ)) / (1.0 + dt * kappa * (ihx2 * mesh.xix2Staggr(iX) + ihz2 * mesh.ztz2Staggr(iZ))); } } T.F.F = tempT; T.imposeBCs(); #pragma omp parallel for num_threads(mesh.inputParams.nThreads) default(none) shared(T) shared(tempT) shared(iY) for (int iX = T.F.fBulk.lbound(0); iX <= T.F.fBulk.ubound(0); iX++) { for (int iZ = T.F.fBulk.lbound(2); iZ <= T.F.fBulk.ubound(2); iZ++) { tempT(iX, iY, iZ) = T.F.F(iX, iY, iZ) - 0.5 * dt * kappa * ( mesh.xix2Staggr(iX) * (T.F.F(iX+1, iY, iZ) - 2.0 * T.F.F(iX, iY, iZ) + T.F.F(iX-1, iY, iZ)) * ihx2 + mesh.xixxStaggr(iX) * (T.F.F(iX+1, iY, iZ) - T.F.F(iX-1, iY, iZ)) * i2hx + mesh.ztz2Staggr(iZ) * (T.F.F(iX, iY, iZ+1) - 2.0 * T.F.F(iX, iY, iZ) + T.F.F(iX, iY, iZ-1)) * ihz2 + mesh.ztzzStaggr(iZ) * (T.F.F(iX, iY, iZ+1) - T.F.F(iX, iY, iZ-1)) * i2hz); } } tempT(T.F.fBulk) = abs(tempT(T.F.fBulk) - tmpRHS.F(T.F.fBulk)); locMax = blitz::max(tempT(T.F.fBulk)); MPI_Allreduce(&locMax, &gloMax, 1, MPI_FP_REAL, MPI_MAX, MPI_COMM_WORLD); if (gloMax < mesh.inputParams.cnTolerance) { break; } iterCount += 1; if (iterCount > maxIterations) { if (mesh.rankData.rank == 0) { std::cout << "ERROR: Jacobi iterations for solution of T not converging. Aborting" << std::endl; } MPI_Finalize(); exit(0); } } } /** ******************************************************************************************************************************************** * \brief Function to set the coefficients used for solving the implicit equations of U, V and W * * The function assigns values to the variables \ref hx, \ref hy, etc. * These coefficients are repeatedly used at many places in the iterative solver for implicit calculation of velocities. ******************************************************************************************************************************************** */ void eulerCN_d2::setCoefficients() { hx2 = pow(mesh.dXi, 2.0); hz2 = pow(mesh.dZt, 2.0); i2hx = 0.5/mesh.dXi; i2hz = 0.5/mesh.dZt; ihx2 = 1.0/hx2; ihz2 = 1.0/hz2; };
[ "findrjsam@gmail.com" ]
findrjsam@gmail.com
e59d5c636aea5447b9afa72e181781e7ae59eeb3
d2bd2b338b077c17e07fcd926a997d9baa5fabf6
/day3_1.cpp
63693878e540bb254ecad1a8783f1dc2867e65d5
[]
no_license
PranavRayudu/Advent-of-Code-2020
06511911ba8c0606adf8c0c7acc6ceddaaa878c9
6ff1beb79792c814867f7c8795464cc0311f376a
refs/heads/main
2023-02-05T10:28:21.113825
2020-12-27T20:37:24
2020-12-27T20:37:24
324,844,935
0
0
null
null
null
null
UTF-8
C++
false
false
449
cpp
#include <iostream> #include <vector> #include <string> // https://adventofcode.com/2020/day/3 using namespace std; int main() { vector<string> map; string line; while (getline(cin, line)) { map.push_back(line); } const auto c_off = 3, r_off = 1; auto r = 0, c = 0; auto trees = 0; while ((r + r_off < map.size())) { r += r_off, c += c_off; trees += map[r][c % map[r].length()] == '#'; } cout << trees << endl; return 0; }
[ "tarakapranav@gmail.com" ]
tarakapranav@gmail.com
a68520c49861cfa26ab71152d17dc97d08ed5d58
fe2f85b0fbdc1b1fa29c5df8375ed71037da6788
/Heap/Merge_k_Sorted_Arrays.cpp
5cf4e01c0c65967ac5b7d427c578119550d691ed
[]
no_license
vedant3620/Data-Structure-and-Algorithms
090e2b29a3e7e481290aa0b556eefa3e992a4b2a
7c3b5659fb5e539fc6aea1b81c9fa25146874423
refs/heads/master
2022-11-09T21:27:32.750998
2020-06-30T17:51:20
2020-06-30T17:51:20
259,728,014
0
0
null
null
null
null
UTF-8
C++
false
false
1,764
cpp
/* Given K sorted arrays arranged in the form of a matrix of size K*K. The task is to merge them into one sorted array. Input: The first line of input contains the number of test cases, then T test cases follow. Each test case will contain an integer K denoting the number of sorted arrays(each with size K). Then in the next line contains all the elements of the array separated by space. Output: The output will be the sorted merged array. User Task: You need to complete mergeKArrays() function which takes 2 arguments, an arr[k][k] 2D Matrix containing k sorted arrays and an integer k denoting the number of sorted arrays. The function should return a pointer to the merged sorted arrays. Expected Time Complexity: O(K*K*Log(K) ) Expected Auxiliary Space: O(K*K) Note: This space is required for returning the resulted sorted array, other work should be done in O(K) Auxiliary Space. Constraints: 1 <= T <= 50 1 <= K <= 100 Example: Input: 1 3 1 2 3 4 5 6 7 8 9 Output: 1 2 3 4 5 6 7 8 9 Explanation: Testcase 1: Above test case has 3 sorted arrays of size 3, 3, 3 arr[][] = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] The merged list will be [1, 2, 3, 4, 5, 6, 7, 8, 9]. */ typedef pair<int, int> pi; int *mergeKArrays(int arr[][N], int k) { int *a=new int[k*k]; int taken[k]={0}; int i=0; priority_queue<pi,vector <pi> ,greater<pi> > pq; for(int j=0;j<k;j++){ pq.push(make_pair(arr[j][0],j)); taken[j]=1; } while(!pq.empty()){ pi p=pq.top(); pq.pop(); int in=p.second; int val=p.first; a[i]=val; i++; if(taken[in]<k){ pq.push(make_pair(arr[in][taken[in]],in)); taken[in]++; } } return a; }
[ "vedant3620@gmail.com" ]
vedant3620@gmail.com
64b5b926f9d5268531f92c9453954b736c06a77d
78a22d044c46ebd3243d16b0b90df0ccc52805be
/Program 11 BST.cpp
74c2830e49730aeaf6e402ac20be90c9fa3cbbba
[]
no_license
sahilsingla231/DS-Programs-Lab-File-
18775378f9535fe647e602ace4ff94fd8293ae37
1d7fd3cb841c7601fdf2543363b14829b7d8b15e
refs/heads/master
2020-03-31T23:56:20.107600
2018-11-13T23:06:30
2018-11-13T23:06:30
152,675,073
0
0
null
null
null
null
UTF-8
C++
false
false
9,230
cpp
/* * C++ Program To Implement BST */ # include <iostream> # include <cstdlib> using namespace std; /* * Node Declaration */ struct node { int info; struct node *left; struct node *right; }*root; /* * Class Declaration */ class BST { public: void find(int, node **, node **); void insert(node*,node *); void del(int); void case_a(node *,node *); void case_b(node *,node *); void case_c(node *,node *); void preorder(node *); void inorder(node *); void postorder(node *); void display(node *, int); BST() { root = NULL; } }; /* * Find Element in the Tree */ void BST::find(int item, node **par, node **loc) { node *ptr, *ptrsave; if (root == NULL) { *loc = NULL; *par = NULL; return; } if (item == root->info) { *loc = root; *par = NULL; return; } if (item < root->info) ptr = root->left; else ptr = root->right; ptrsave = root; while (ptr != NULL) { if (item == ptr->info) { *loc = ptr; *par = ptrsave; return; } ptrsave = ptr; if (item < ptr->info) ptr = ptr->left; else ptr = ptr->right; } *loc = NULL; *par = ptrsave; } /* * Inserting Element into the Tree */ void BST::insert(node *tree, node *newnode) { if (root == NULL) { root = new node; root->info = newnode->info; root->left = NULL; root->right = NULL; cout<<"Root Node is Added"<<endl; return; } if (tree->info == newnode->info) { cout<<"Element already in the tree"<<endl; return; } if (tree->info > newnode->info) { if (tree->left != NULL) { insert(tree->left, newnode); } else { tree->left = newnode; (tree->left)->left = NULL; (tree->left)->right = NULL; cout<<"Node Added To Left"<<endl; return; } } else { if (tree->right != NULL) { insert(tree->right, newnode); } else { tree->right = newnode; (tree->right)->left = NULL; (tree->right)->right = NULL; cout<<"Node Added To Right"<<endl; return; } } } /* * Delete Element from the tree */ void BST::del(int item) { node *parent, *location; if (root == NULL) { cout<<"Tree empty"<<endl; return; } find(item, &parent, &location); if (location == NULL) { cout<<"Item not present in tree"<<endl; return; } if (location->left == NULL && location->right == NULL) case_a(parent, location); if (location->left != NULL && location->right == NULL) case_b(parent, location); if (location->left == NULL && location->right != NULL) case_b(parent, location); if (location->left != NULL && location->right != NULL) case_c(parent, location); free(location); } /* * Case A */ void BST::case_a(node *par, node *loc ) { if (par == NULL) { root = NULL; } else { if (loc == par->left) par->left = NULL; else par->right = NULL; } } /* * Case B */ void BST::case_b(node *par, node *loc) { node *child; if (loc->left != NULL) child = loc->left; else child = loc->right; if (par == NULL) { root = child; } else { if (loc == par->left) par->left = child; else par->right = child; } } /* * Case C */ void BST::case_c(node *par, node *loc) { node *ptr, *ptrsave, *suc, *parsuc; ptrsave = loc; ptr = loc->right; while (ptr->left != NULL) { ptrsave = ptr; ptr = ptr->left; } suc = ptr; parsuc = ptrsave; if (suc->left == NULL && suc->right == NULL) case_a(parsuc, suc); else case_b(parsuc, suc); if (par == NULL) { root = suc; } else { if (loc == par->left) par->left = suc; else par->right = suc; } suc->left = loc->left; suc->right = loc->right; } /* * Pre Order Traversal */ void BST::preorder(node *ptr) { if (root == NULL) { cout<<"Tree is empty"<<endl; return; } if (ptr != NULL) { cout<<ptr->info<<" "; preorder(ptr->left); preorder(ptr->right); } } /* * In Order Traversal */ void BST::inorder(node *ptr) { if (root == NULL) { cout<<"Tree is empty"<<endl; return; } if (ptr != NULL) { inorder(ptr->left); cout<<ptr->info<<" "; inorder(ptr->right); } } /* * Postorder Traversal */ void BST::postorder(node *ptr) { if (root == NULL) { cout<<"Tree is empty"<<endl; return; } if (ptr != NULL) { postorder(ptr->left); postorder(ptr->right); cout<<ptr->info<<" "; } } /* * Display Tree Structure */ void BST::display(node *ptr, int level) { int i; if (ptr != NULL) { display(ptr->right, level+1); cout<<endl; if (ptr == root) cout<<"Root->: "; else { for (i = 0;i < level;i++) cout<<" "; } cout<<ptr->info; display(ptr->left, level+1); } } /* * Main Contains Menu */ int main() { int choice, num; BST bst; node *temp; while (1) { cout<<"-----------------"<<endl; cout<<"Operations on BST"<<endl; cout<<"-----------------"<<endl; cout<<"1.Insert Element "<<endl; cout<<"2.Delete Element "<<endl; cout<<"3.Inorder Traversal"<<endl; cout<<"4.Preorder Traversal"<<endl; cout<<"5.Postorder Traversal"<<endl; cout<<"6.Display"<<endl; cout<<"7.Quit"<<endl; cout<<"Enter your choice : "; cin>>choice; switch(choice) { case 1: temp = new node; cout<<"Enter the number to be inserted : "; cin>>temp->info; bst.insert(root, temp); case 2: if (root == NULL) { cout<<"Tree is empty, nothing to delete"<<endl; continue; } cout<<"Enter the number to be deleted : "; cin>>num; bst.del(num); break; case 3: cout<<"Inorder Traversal of BST:"<<endl; bst.inorder(root); cout<<endl; break; case 4: cout<<"Preorder Traversal of BST:"<<endl; bst.preorder(root); cout<<endl; break; case 5: cout<<"Postorder Traversal of BST:"<<endl; bst.postorder(root); cout<<endl; break; case 6: cout<<"Display BST:"<<endl; bst.display(root,1); cout<<endl; break; case 7: exit(1); default: cout<<"Wrong choice"<<endl; } } }
[ "sahilsingla231231@gmail.com" ]
sahilsingla231231@gmail.com
67e5d5d78b1be4f928e98a53fc1af555bd3fdcf8
3232d6557d9b3362049175073cd0c502ab081e34
/CollisionShape.cpp
54c17e2de3ddde32ce913958ebc21c85da810a89
[ "MIT" ]
permissive
elix22/Urho3DPhysX
ecc6c75b77ef956ed4eee9fbfe58540e8fa9efd3
4f0a21e76ab4aa1779e273cfe64122699e08f5bc
refs/heads/master
2020-07-07T21:11:32.273637
2020-05-20T12:53:22
2020-05-20T12:53:22
203,478,798
0
0
MIT
2020-05-20T12:53:23
2019-08-21T01:03:03
AngelScript
UTF-8
C++
false
false
20,568
cpp
#include "CollisionShape.h" #include "Physics.h" #include "PhysXMaterial.h" #include "StaticBody.h" #include "DynamicBody.h" #include <Urho3D/Core/Context.h> #include <Urho3D/Scene/Node.h> #include <Urho3D/Resource/ResourceCache.h> #include <Urho3D/Graphics/Model.h> #include <Urho3D/Graphics/StaticModel.h> #include <Urho3D/IO/Log.h> #include <Urho3D/Graphics/DebugRenderer.h> namespace Urho3DPhysX { static const unsigned DEF_COLLISION_LAYER = 0x1; static const unsigned DEF_COLLISION_MASK = M_MAX_UNSIGNED; static const char* collisionShapesNames[] = { "Box", "Sphere", "Plane", "Capsule", "ConvexMesh", "TriangleMesh", //heightfield, nullptr }; } Urho3DPhysX::CollisionShape::CollisionShape(Context * context) : Component(context), rigidActor_(nullptr), position_(Vector3::ZERO), rotation_(Quaternion::IDENTITY), planeNormal_(Vector3::UP), size_(Vector3::ONE), cachedWorldScale_(Vector3::ONE), shape_(nullptr), shapeType_(BOX_SHAPE), trigger_(false), collisionLayer_(DEF_COLLISION_LAYER), collisionMask_(DEF_COLLISION_MASK), customModel_(nullptr), modelLodLevel_(0), material_(nullptr) { } Urho3DPhysX::CollisionShape::~CollisionShape() { ReleaseShape(); } void Urho3DPhysX::CollisionShape::ApplyAttributes() { } void Urho3DPhysX::CollisionShape::RegisterObject(Context * context) { context->RegisterFactory<CollisionShape>("PhysX"); URHO3D_ACCESSOR_ATTRIBUTE("Position", GetPosition, SetPosition, Vector3, Vector3::ZERO, AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Rotation", GetRotation, SetRotation, Quaternion, Quaternion::IDENTITY, AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Size", GetSize, SetSize, Vector3, Vector3::ONE, AM_DEFAULT); URHO3D_ENUM_ACCESSOR_ATTRIBUTE("ShapeType", GetShapeType, SetShapeType, PhysXShapeType, collisionShapesNames, BOX_SHAPE, AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Plane normal", GetPlaneNormal, SetPlaneNormal, Vector3, Vector3::UP, AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Trigger", IsTrigger, SetTrigger, bool, false, AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Collision layer", GetCollisionLayer, SetCollisionLayer, unsigned, DEF_COLLISION_LAYER, AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Collision mask", GetCollisionMask, SetCollisionMask, unsigned, DEF_COLLISION_MASK, AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Material", GetMaterialAttr, SetMaterialAttr, ResourceRef, ResourceRef(PhysXMaterial::GetTypeStatic()), AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Custom model", GetCustomModelAttr, SetCustomModelAttr, ResourceRef, ResourceRef(Model::GetTypeStatic()), AM_DEFAULT); URHO3D_ACCESSOR_ATTRIBUTE("Model LOD level", GetModelLODLevel, SetModelLODLevel, unsigned, 0, AM_DEFAULT); } void Urho3DPhysX::CollisionShape::DrawDebugGeometry(DebugRenderer * debug, bool depthTest) { if (debug && shape_) { Vector3 worldPosition = node_->GetWorldPosition() + position_; Quaternion worldRotation = node_->GetWorldRotation() * rotation_; Color color = Color::GRAY; if (rigidActor_) { StaticBody* staticBody = rigidActor_->Cast<StaticBody>(); if (staticBody) color = Color::GREEN; else { DynamicBody* dynamicBody = rigidActor_->Cast<DynamicBody>(); if (dynamicBody) { color = dynamicBody->IsSleeping() ? Color::WHITE : Color::MAGENTA; } } } switch (shapeType_) { case Urho3DPhysX::BOX_SHAPE: { Vector3 halfSize = size_ * cachedWorldScale_ * 0.5f; debug->AddBoundingBox(BoundingBox(-halfSize, halfSize), Matrix3x4(worldPosition, worldRotation.Normalized(), 1.0f), color, depthTest); } break; case Urho3DPhysX::SPHERE_SHAPE: { float radius = size_.x_ * cachedWorldScale_.x_ * 0.5f; debug->AddCircle(worldPosition, node_->GetWorldDirection(), radius, color, 32, depthTest); debug->AddCircle(worldPosition, (node_->GetWorldRotation() * Vector3::LEFT).Normalized(), radius, color, 32, depthTest); debug->AddCircle(worldPosition, (node_->GetWorldRotation() * Vector3::UP).Normalized(), radius, color, 32, depthTest); } break; case Urho3DPhysX::PLANE_SHAPE: break; case Urho3DPhysX::CAPSULE_SHAPE: { //https://discourse.urho3d.io/t/is-there-a-horizontal-tube-in-debug-renderer/2253/16 float radius = size_.x_ * cachedWorldScale_.x_ * 0.5f; float halfHeight = size_.y_ * cachedWorldScale_.y_ * 0.5f; Sphere sphere(Vector3::ZERO, radius); Vector3 halfLengthVec = worldRotation * Vector3(halfHeight, 0, 0); for (unsigned j = 0; j < 180; j += 45) { for (unsigned i = 0; i < 180; i += 45) { Vector3 p1 = worldRotation * sphere.GetPoint(i, j) + halfLengthVec + worldPosition; Vector3 p2 = worldRotation * sphere.GetPoint(i + 45, j) + halfLengthVec + worldPosition; Vector3 p3 = worldRotation * sphere.GetPoint(i, j + 45) + halfLengthVec + worldPosition; Vector3 p4 = worldRotation * sphere.GetPoint(i + 45, j + 45) + halfLengthVec + worldPosition; debug->AddLine(p1, p2, color, depthTest); debug->AddLine(p1, p3, color, depthTest); debug->AddLine(p2, p4, color, depthTest); } for (unsigned i = 180; i < 360; i += 45) { Vector3 p1 = worldRotation * sphere.GetPoint(i, j) - halfLengthVec + worldPosition; Vector3 p2 = worldRotation * sphere.GetPoint(i + 45, j) - halfLengthVec + worldPosition; Vector3 p3 = worldRotation * sphere.GetPoint(i, j + 45) - halfLengthVec + worldPosition; Vector3 p4 = worldRotation * sphere.GetPoint(i + 45, j + 45) - halfLengthVec + worldPosition; debug->AddLine(p1, p2, color, depthTest); debug->AddLine(p1, p3, color, depthTest); debug->AddLine(p2, p4, color, depthTest); } Vector3 p1 = worldRotation * sphere.GetPoint(0, j) + halfLengthVec + worldPosition; Vector3 p2 = worldRotation * sphere.GetPoint(0, j) - halfLengthVec + worldPosition; debug->AddLine(p1, p2, depthTest); Vector3 p3 = worldRotation * sphere.GetPoint(0, j + 180) + halfLengthVec + worldPosition; Vector3 p4 = worldRotation * sphere.GetPoint(0, j + 180) - halfLengthVec + worldPosition; debug->AddLine(p3, p4, depthTest); } } break; case Urho3DPhysX::CONVEXMESH_SHAPE: break; case Urho3DPhysX::TRIANGLEMESH_SHAPE: break; default: break; } } } void Urho3DPhysX::CollisionShape::OnNodeSet(Node * node) { if (node) { node->AddListener(this); UpdateShape(); } } void Urho3DPhysX::CollisionShape::OnSetEnabled() { if (shape_) { if (trigger_) { shape_->setFlag(PxShapeFlag::eSIMULATION_SHAPE, false); shape_->setFlag(PxShapeFlag::eTRIGGER_SHAPE, enabled_); } else { shape_->setFlag(PxShapeFlag::eSIMULATION_SHAPE, enabled_); if (rigidActor_) { RigidBody* rigidBody = rigidActor_->Cast<RigidBody>(); if (rigidBody) rigidBody->UpdateMassAndInertia(); } } } } void Urho3DPhysX::CollisionShape::UpdateShape() { ReleaseShape(); if (node_) { auto* physics = GetSubsystem<Physics>(); if (!physics) { return; } auto* px = physics->GetPhysics(); if (!px) { return; } if (!material_) SetDefaultMaterial(); PxMaterial* mat = material_->GetMaterial(); if (node_) { cachedWorldScale_ = node_->GetWorldScale(); switch (shapeType_) { case Urho3DPhysX::BOX_SHAPE: shape_ = px->createShape(PxBoxGeometry(ToPxVec3(size_ * cachedWorldScale_ * 0.5f)), *mat, true); break; case Urho3DPhysX::SPHERE_SHAPE: shape_ = px->createShape(PxSphereGeometry(size_.x_ * cachedWorldScale_.x_ * 0.5f), *mat, true); break; case Urho3DPhysX::PLANE_SHAPE: shape_ = px->createShape(PxPlaneGeometry(), *mat, true); break; case Urho3DPhysX::CAPSULE_SHAPE: shape_ = px->createShape(PxCapsuleGeometry(size_.x_ * cachedWorldScale_.x_ * 0.5f, size_.y_ * cachedWorldScale_.y_ * 0.5f), *mat, true); break; case Urho3DPhysX::CONVEXMESH_SHAPE: if (!CreateConvexMesh()) { //TODO: handle this } break; case Urho3DPhysX::TRIANGLEMESH_SHAPE: if (!CreateTriangleMesh()) { //TODO: handle this } break; default: break; } //check if shape creation failed if (!shape_) { //TODO: react to this } else { PxFilterData filter; filter.word0 = collisionLayer_; filter.word1 = collisionMask_; shape_->setSimulationFilterData(filter); shape_->setQueryFilterData(filter); SetMaterial(material_); UpdateShapePose(); shape_->userData = this; if (trigger_) { shape_->setFlag(PxShapeFlag::eSIMULATION_SHAPE, false); shape_->setFlag(PxShapeFlag::eTRIGGER_SHAPE, true); } RigidActor* actor = node_->GetDerivedComponent<RigidActor>(); if (actor) actor->AttachShape(this); } } } } void Urho3DPhysX::CollisionShape::UpdateShapePose() { if (shape_) { if (shapeType_ == PLANE_SHAPE) { shape_->setLocalPose(PxTransformFromPlaneEquation(PxPlane(ToPxVec3(position_), ToPxVec3(planeNormal_)))); } else { shape_->setLocalPose(PxTransform(ToPxVec3(position_), ToPxQuat(rotation_))); } if (rigidActor_) { RigidBody* rigidBody = rigidActor_->Cast<RigidBody>(); if (rigidBody) rigidBody->UpdateMassAndInertia(); } } } void Urho3DPhysX::CollisionShape::ReleaseShape() { if (shape_) { if (rigidActor_) { rigidActor_->GetActor()->detachShape(*shape_); } shape_->userData = nullptr; shape_->release(); shape_ = nullptr; } } void Urho3DPhysX::CollisionShape::SetMaterial(PhysXMaterial * material) { if (!material) { SetDefaultMaterial(); } else { material_ = SharedPtr<PhysXMaterial>(material); PxMaterial* mat[1]; mat[0] = material_->GetMaterial(); if(shape_) shape_->setMaterials(mat, 1); } } void Urho3DPhysX::CollisionShape::SetDefaultMaterial() { auto* physics = GetSubsystem<Physics>(); SetMaterial(physics->GetDefaultMaterial()); } void Urho3DPhysX::CollisionShape::SetShapeType(PhysXShapeType shape) { if (shapeType_ != shape) { shapeType_ = shape; UpdateShape(); } } void Urho3DPhysX::CollisionShape::SetPosition(const Vector3 & position) { position_ = position; UpdateShapePose(); } void Urho3DPhysX::CollisionShape::SetRotation(const Quaternion & rotation) { rotation_ = rotation; UpdateShapePose(); } void Urho3DPhysX::CollisionShape::SetSize(const Vector3 & size) { if (size != size_) { size_ = size; UpdateSize(); } } void Urho3DPhysX::CollisionShape::SetPlaneNormal(const Vector3 & normal) { planeNormal_ = normal; if (shapeType_ = PLANE_SHAPE) UpdateShapePose(); } void Urho3DPhysX::CollisionShape::SetBox(const Vector3 & size, const Vector3 & position, const Quaternion & rotation) { shapeType_ = BOX_SHAPE; size_ = size; position_ = position; rotation_ = rotation; UpdateShape(); } void Urho3DPhysX::CollisionShape::SetSphere(float radius, const Vector3 & position, const Quaternion & rotation) { shapeType_ = SPHERE_SHAPE; size_ = Vector3(radius, radius, radius); position_ = position; rotation_ = rotation; UpdateShape(); } void Urho3DPhysX::CollisionShape::SetCapsule(float diamater, float height, const Vector3 & position, const Quaternion & rotation) { shapeType_ = CAPSULE_SHAPE; size_ = Vector3(diamater, height, diamater); position_ = position; rotation_ = rotation; UpdateShape(); } bool Urho3DPhysX::CollisionShape::CreateTriangleMesh() { if (shape_) ReleaseShape(); Model* sourceModel = FindSourceModel(); if (sourceModel) { auto* physics = GetSubsystem<Physics>(); PxTriangleMesh* triMesh = physics->GetOrCreateTriangleMesh(sourceModel, modelLodLevel_); if (triMesh) { cachedWorldScale_ = node_->GetWorldScale(); PxMeshScale scale = ToPxVec3(cachedWorldScale_); PxTriangleMeshGeometry geom(triMesh, scale); shape_ = physics->GetPhysics()->createShape(geom, *material_->GetMaterial(), true); if (shape_) return true; } } return false; } bool Urho3DPhysX::CollisionShape::CreateConvexMesh() { if (shape_) ReleaseShape(); Model* sourceModel = FindSourceModel(); if (sourceModel) { auto* physics = GetSubsystem<Physics>(); PxConvexMesh* convexMesh = physics->GetOrCreateConvexMesh(sourceModel, modelLodLevel_); if (convexMesh) { cachedWorldScale_ = node_->GetWorldScale(); PxMeshScale scale = ToPxVec3(cachedWorldScale_); PxConvexMeshGeometry geom(convexMesh, scale); shape_ = physics->GetPhysics()->createShape(geom, *material_->GetMaterial(), true); if (shape_) return true; } } return false; } void Urho3DPhysX::CollisionShape::SetTrigger(bool trigger) { if (trigger_ != trigger) { trigger_ = trigger; if (shape_) { shape_->setFlag(PxShapeFlag::eSIMULATION_SHAPE, !trigger_); shape_->setFlag(PxShapeFlag::eTRIGGER_SHAPE, trigger_); if (rigidActor_) { RigidBody* rigidBody = rigidActor_->Cast<RigidBody>(); if (rigidBody) rigidBody->UpdateMassAndInertia(); } } } } void Urho3DPhysX::CollisionShape::SetCollisionLayer(unsigned layer) { if (collisionLayer_ != layer) { collisionLayer_ = layer; if (shape_) { PxFilterData filter; filter.word0 = collisionLayer_; filter.word1 = collisionMask_; shape_->setSimulationFilterData(filter); shape_->setQueryFilterData(filter); } } } void Urho3DPhysX::CollisionShape::SetCollisionMask(unsigned mask) { if (collisionMask_ != mask) { collisionMask_ = mask; if (shape_) { PxFilterData filter; filter.word0 = collisionLayer_; filter.word1 = collisionMask_; shape_->setSimulationFilterData(filter); shape_->setQueryFilterData(filter); } } } void Urho3DPhysX::CollisionShape::SetCustomModel(Model* model) { if (model != customModel_) { customModel_ = SharedPtr<Model>(model); if (customModel_ && (shapeType_ == TRIANGLEMESH_SHAPE || shapeType_ == CONVEXMESH_SHAPE)) { UpdateShape(); } } } void Urho3DPhysX::CollisionShape::SetCustomModelAttr(const ResourceRef & value) { SetCustomModel(GetSubsystem<ResourceCache>()->GetResource<Model>(value.name_)); } void Urho3DPhysX::CollisionShape::SetModelLODLevel(unsigned value) { if (value != modelLodLevel_) { modelLodLevel_ = value; if (shapeType_ == TRIANGLEMESH_SHAPE || shapeType_ == CONVEXMESH_SHAPE) UpdateShape(); } } ResourceRef Urho3DPhysX::CollisionShape::GetCustomModelAttr() const { return GetResourceRef(customModel_, Model::GetTypeStatic()); } void Urho3DPhysX::CollisionShape::SetMaterialAttr(const ResourceRef & material) { SetMaterial(GetSubsystem<ResourceCache>()->GetResource<PhysXMaterial>(material.name_)); } ResourceRef Urho3DPhysX::CollisionShape::GetMaterialAttr() const { return GetResourceRef(material_, PhysXMaterial::GetTypeStatic()); } void Urho3DPhysX::CollisionShape::OnMarkedDirty(Node * node) { if (shape_) { if (rigidActor_ && rigidActor_->IsApplyingTransform()) return; if (cachedWorldScale_ != node->GetWorldScale()) { UpdateSize(); } } } void Urho3DPhysX::CollisionShape::SetActor(RigidActor * actor) { if (actor != rigidActor_) { if (rigidActor_) { /*TODO: this situation is not desired, but if happend, require some clean up*/ } rigidActor_ = WeakPtr<RigidActor>(actor); } } void Urho3DPhysX::CollisionShape::UpdateSize() { cachedWorldScale_ = node_->GetWorldScale(); switch (shapeType_) { case Urho3DPhysX::BOX_SHAPE: UpdateBoxSize(); break; case Urho3DPhysX::SPHERE_SHAPE: UpdateSphereSize(); break; case Urho3DPhysX::PLANE_SHAPE: //plane is not affected by scale break; case Urho3DPhysX::CAPSULE_SHAPE: UpdateCapsuleSize(); break; case Urho3DPhysX::CONVEXMESH_SHAPE: UpdateConvexMeshScale(); break; case Urho3DPhysX::TRIANGLEMESH_SHAPE: UpdateTriangleMeshScale(); break; default: break; } if(rigidActor_) { RigidBody* rigidBody = rigidActor_->Cast<RigidBody>(); if (rigidBody) rigidBody->UpdateMassAndInertia(); } } void Urho3DPhysX::CollisionShape::UpdateBoxSize() { if (shape_) { PxBoxGeometry box; if (shape_->getBoxGeometry(box)) { box.halfExtents = ToPxVec3(size_ * cachedWorldScale_ * 0.5f); shape_->setGeometry(box); } } } void Urho3DPhysX::CollisionShape::UpdateSphereSize() { if (shape_) { PxSphereGeometry sphere; if (shape_->getSphereGeometry(sphere)) { sphere.radius = size_.x_ * cachedWorldScale_.x_ * 0.5f; shape_->setGeometry(sphere); } } } void Urho3DPhysX::CollisionShape::UpdateCapsuleSize() { if (shape_) { PxCapsuleGeometry capsule; if (shape_->getCapsuleGeometry(capsule)) { capsule.radius = size_.x_ * cachedWorldScale_.x_ * 0.5f; capsule.halfHeight = size_.y_ * cachedWorldScale_.y_ * 0.5f; shape_->setGeometry(capsule); } } } void Urho3DPhysX::CollisionShape::UpdateTriangleMeshScale() { if (shape_) { PxTriangleMeshGeometry triangleMesh; if (shape_->getTriangleMeshGeometry(triangleMesh)) { triangleMesh.scale = PxMeshScale(ToPxVec3(cachedWorldScale_)); shape_->setGeometry(triangleMesh); } } } void Urho3DPhysX::CollisionShape::UpdateConvexMeshScale() { if (shape_) { PxConvexMeshGeometry convexMesh; if (shape_->getConvexMeshGeometry(convexMesh)) { convexMesh.scale = PxMeshScale(ToPxVec3(cachedWorldScale_)); shape_->setGeometry(convexMesh); } } } Model * Urho3DPhysX::CollisionShape::FindSourceModel() { if (customModel_) return customModel_; StaticModel* m = node_->GetDerivedComponent<StaticModel>(); if (m) { return m->GetModel(); } return nullptr; }
[ "lezak87@gmail.com" ]
lezak87@gmail.com
442616000f9c13ea057501afdaf3d99b50e260d0
5d571a0604dc1bb9a62a9127f4d745ba6f96fe6f
/xfopencv-master/include/core/xf_math.h
3800dd666774d5083d9e36e0bed6cf8a4dec600e
[ "BSD-3-Clause" ]
permissive
zslwyuan/Zedboard-xfOpenCV-Optical-Flow
07aabbded030b36d55b42f0e50d4baf18225f390
6c0edb1b629481c2d8a87b55e55e89ea5e611361
refs/heads/master
2020-09-22T09:43:32.983664
2020-01-16T14:31:21
2020-01-16T14:31:21
225,141,502
3
0
null
null
null
null
UTF-8
C++
false
false
268,112
h
/*************************************************************************** Copyright (c) 2019, Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ #ifndef _XF_MATH_H_ #define _XF_MATH_H_ #include "ap_int.h" #include "common/xf_common.h" #include <assert.h> #define XF_PI 3.14159265358979323846 // floating point pi value #define XF_PI_FIXED 12867 // fixed point pi in Q4.12 #define XF_PI_BY_2_FIXED 6433 // fixed point pi/2 in Q4.12 #define DATA_SIZE 16 // Number of bits for x and y #define LUT_BITS 11 // Look up table size = 2^LUT_BITS namespace xf{ // look up table for division which returns 32-bit values for high precision. static unsigned int division_lut32[32768] = {131068,131070,131068,131064,131060,131056,131052,131048,131044,131040,131036,131032,131028,131024,131020,131016,131012,131008,131004,131000,130996,130992,130988,130984,130980,130976,130972,130968,130964,130960,130956,130952,130948,130944,130940,130936,130932,130928,130924,130920,130916,130912,130908,130904,130900,130896,130892,130888,130884,130880,130876,130872,130868,130864,130860,130856,130852,130848,130844,130840,130836,130832,130828,130824,130820,130816,130812,130808,130804,130800,130796,130792,130788,130784,130780,130776,130772,130768,130764,130760,130756,130752,130748,130744,130740,130736,130732,130728,130724,130720,130716,130712,130709,130705,130701,130697,130693,130689,130685,130681,130677,130673,130669,130665,130661,130657,130653,130649,130645,130641,130637,130633,130629,130625,130621,130617,130613,130609,130605,130601,130597,130593,130589,130585,130581,130577,130573,130569,130565,130561,130558,130554,130550,130546,130542,130538,130534,130530,130526,130522,130518,130514,130510,130506,130502,130498,130494,130490,130486,130482,130478,130474,130470,130466,130462,130458,130454,130450,130446,130443,130439,130435,130431,130427,130423,130419,130415,130411,130407,130403,130399,130395,130391,130387,130383,130379,130375,130371,130367,130363,130359,130355,130351,130348,130344,130340,130336,130332,130328,130324,130320,130316,130312,130308,130304,130300,130296,130292,130288,130284,130280,130276,130272,130268,130265,130261,130257,130253,130249,130245,130241,130237,130233,130229,130225,130221,130217,130213,130209,130205,130201,130197,130193,130189,130186,130182,130178,130174,130170,130166,130162,130158,130154,130150,130146,130142,130138,130134,130130,130126,130122,130118,130115,130111,130107,130103,130099,130095,130091,130087,130083,130079,130075,130071,130067,130063,130059,130055,130052,130048,130044,130040,130036,130032,130028,130024,130020,130016,130012,130008,130004,130000,129996,129992,129989,129985,129981,129977,129973,129969,129965,129961,129957,129953,129949,129945,129941,129937,129933,129930,129926,129922,129918,129914,129910,129906,129902,129898,129894,129890,129886,129882,129878,129875,129871,129867,129863,129859,129855,129851,129847,129843,129839,129835,129831,129827,129824,129820,129816,129812,129808,129804,129800,129796,129792,129788,129784,129780,129776,129773,129769,129765,129761,129757,129753,129749,129745,129741,129737,129733,129729,129725,129722,129718,129714,129710,129706,129702,129698,129694,129690,129686,129682,129678,129675,129671,129667,129663,129659,129655,129651,129647,129643,129639,129635,129632,129628,129624,129620,129616,129612,129608,129604,129600,129596,129592,129588,129585,129581,129577,129573,129569,129565,129561,129557,129553,129549,129545,129542,129538,129534,129530,129526,129522,129518,129514,129510,129506,129503,129499,129495,129491,129487,129483,129479,129475,129471,129467,129463,129460,129456,129452,129448,129444,129440,129436,129432,129428,129424,129421,129417,129413,129409,129405,129401,129397,129393,129389,129385,129382,129378,129374,129370,129366,129362,129358,129354,129350,129347,129343,129339,129335,129331,129327,129323,129319,129315,129311,129308,129304,129300,129296,129292,129288,129284,129280,129276,129273,129269,129265,129261,129257,129253,129249,129245,129241,129238,129234,129230,129226,129222,129218,129214,129210,129206,129203,129199,129195,129191,129187,129183,129179,129175,129171,129168,129164,129160,129156,129152,129148,129144,129140,129136,129133,129129,129125,129121,129117,129113,129109,129105,129102,129098,129094,129090,129086,129082,129078,129074,129071,129067,129063,129059,129055,129051,129047,129043,129040,129036,129032,129028,129024,129020,129016,129012,129008,129005,129001,128997,128993,128989,128985,128981,128978,128974,128970,128966,128962,128958,128954,128950,128947,128943,128939,128935,128931,128927,128923,128919,128916,128912,128908,128904,128900,128896,128892,128888,128885,128881,128877,128873,128869,128865,128861,128858,128854,128850,128846,128842,128838,128834,128830,128827,128823,128819,128815,128811,128807,128803,128800,128796,128792,128788,128784,128780,128776,128773,128769,128765,128761,128757,128753,128749,128746,128742,128738,128734,128730,128726,128722,128719,128715,128711,128707,128703,128699,128695,128692,128688,128684,128680,128676,128672,128668,128665,128661,128657,128653,128649,128645,128641,128638,128634,128630,128626,128622,128618,128614,128611,128607,128603,128599,128595,128591,128587,128584,128580,128576,128572,128568,128564,128561,128557,128553,128549,128545,128541,128537,128534,128530,128526,128522,128518,128514,128511,128507,128503,128499,128495,128491,128487,128484,128480,128476,128472,128468,128464,128461,128457,128453,128449,128445,128441,128438,128434,128430,128426,128422,128418,128414,128411,128407,128403,128399,128395,128391,128388,128384,128380,128376,128372,128368,128365,128361,128357,128353,128349,128345,128342,128338,128334,128330,128326,128322,128319,128315,128311,128307,128303,128299,128296,128292,128288,128284,128280,128276,128273,128269,128265,128261,128257,128253,128250,128246,128242,128238,128234,128230,128227,128223,128219,128215,128211,128207,128204,128200,128196,128192,128188,128185,128181,128177,128173,128169,128165,128162,128158,128154,128150,128146,128142,128139,128135,128131,128127,128123,128120,128116,128112,128108,128104,128100,128097,128093,128089,128085,128081,128077,128074,128070,128066,128062,128058,128055,128051,128047,128043,128039,128035,128032,128028,128024,128020,128016,128013,128009,128005,128001,127997,127994,127990,127986,127982,127978,127974,127971,127967,127963,127959,127955,127952,127948,127944,127940,127936,127933,127929,127925,127921,127917,127913,127910,127906,127902,127898,127894,127891,127887,127883,127879,127875,127872,127868,127864,127860,127856,127853,127849,127845,127841,127837,127834,127830,127826,127822,127818,127814,127811,127807,127803,127799,127795,127792,127788,127784,127780,127776,127773,127769,127765,127761,127757,127754,127750,127746,127742,127738,127735,127731,127727,127723,127719,127716,127712,127708,127704,127700,127697,127693,127689,127685,127682,127678,127674,127670,127666,127663,127659,127655,127651,127647,127644,127640,127636,127632,127628,127625,127621,127617,127613,127609,127606,127602,127598,127594,127590,127587,127583,127579,127575,127572,127568,127564,127560,127556,127553,127549,127545,127541,127537,127534,127530,127526,127522,127518,127515,127511,127507,127503,127500,127496,127492,127488,127484,127481,127477,127473,127469,127466,127462,127458,127454,127450,127447,127443,127439,127435,127431,127428,127424,127420,127416,127413,127409,127405,127401,127397,127394,127390,127386,127382,127379,127375,127371,127367,127363,127360,127356,127352,127348,127345,127341,127337,127333,127329,127326,127322,127318,127314,127311,127307,127303,127299,127296,127292,127288,127284,127280,127277,127273,127269,127265,127262,127258,127254,127250,127246,127243,127239,127235,127231,127228,127224,127220,127216,127213,127209,127205,127201,127197,127194,127190,127186,127182,127179,127175,127171,127167,127164,127160,127156,127152,127149,127145,127141,127137,127133,127130,127126,127122,127118,127115,127111,127107,127103,127100,127096,127092,127088,127085,127081,127077,127073,127070,127066,127062,127058,127055,127051,127047,127043,127039,127036,127032,127028,127024,127021,127017,127013,127009,127006,127002,126998,126994,126991,126987,126983,126979,126976,126972,126968,126964,126961,126957,126953,126949,126946,126942,126938,126934,126931,126927,126923,126919,126916,126912,126908,126904,126901,126897,126893,126889,126886,126882,126878,126874,126871,126867,126863,126859,126856,126852,126848,126844,126841,126837,126833,126829,126826,126822,126818,126814,126811,126807,126803,126799,126796,126792,126788,126784,126781,126777,126773,126769,126766,126762,126758,126755,126751,126747,126743,126740,126736,126732,126728,126725,126721,126717,126713,126710,126706,126702,126698,126695,126691,126687,126683,126680,126676,126672,126669,126665,126661,126657,126654,126650,126646,126642,126639,126635,126631,126627,126624,126620,126616,126613,126609,126605,126601,126598,126594,126590,126586,126583,126579,126575,126571,126568,126564,126560,126557,126553,126549,126545,126542,126538,126534,126530,126527,126523,126519,126516,126512,126508,126504,126501,126497,126493,126489,126486,126482,126478,126475,126471,126467,126463,126460,126456,126452,126449,126445,126441,126437,126434,126430,126426,126422,126419,126415,126411,126408,126404,126400,126396,126393,126389,126385,126382,126378,126374,126370,126367,126363,126359,126356,126352,126348,126344,126341,126337,126333,126330,126326,126322,126318,126315,126311,126307,126303,126300,126296,126292,126289,126285,126281,126278,126274,126270,126266,126263,126259,126255,126252,126248,126244,126240,126237,126233,126229,126226,126222,126218,126214,126211,126207,126203,126200,126196,126192,126188,126185,126181,126177,126174,126170,126166,126163,126159,126155,126151,126148,126144,126140,126137,126133,126129,126125,126122,126118,126114,126111,126107,126103,126100,126096,126092,126088,126085,126081,126077,126074,126070,126066,126063,126059,126055,126051,126048,126044,126040,126037,126033,126029,126026,126022,126018,126014,126011,126007,126003,126000,125996,125992,125989,125985,125981,125977,125974,125970,125966,125963,125959,125955,125952,125948,125944,125941,125937,125933,125929,125926,125922,125918,125915,125911,125907,125904,125900,125896,125893,125889,125885,125881,125878,125874,125870,125867,125863,125859,125856,125852,125848,125845,125841,125837,125834,125830,125826,125822,125819,125815,125811,125808,125804,125800,125797,125793,125789,125786,125782,125778,125775,125771,125767,125764,125760,125756,125752,125749,125745,125741,125738,125734,125730,125727,125723,125719,125716,125712,125708,125705,125701,125697,125694,125690,125686,125683,125679,125675,125672,125668,125664,125661,125657,125653,125649,125646,125642,125638,125635,125631,125627,125624,125620,125616,125613,125609,125605,125602,125598,125594,125591,125587,125583,125580,125576,125572,125569,125565,125561,125558,125554,125550,125547,125543,125539,125536,125532,125528,125525,125521,125517,125514,125510,125506,125503,125499,125495,125492,125488,125484,125481,125477,125473,125470,125466,125462,125459,125455,125451,125448,125444,125440,125437,125433,125429,125426,125422,125418,125415,125411,125407,125404,125400,125396,125393,125389,125385,125382,125378,125374,125371,125367,125363,125360,125356,125352,125349,125345,125341,125338,125334,125330,125327,125323,125320,125316,125312,125309,125305,125301,125298,125294,125290,125287,125283,125279,125276,125272,125268,125265,125261,125257,125254,125250,125246,125243,125239,125235,125232,125228,125225,125221,125217,125214,125210,125206,125203,125199,125195,125192,125188,125184,125181,125177,125173,125170,125166,125162,125159,125155,125152,125148,125144,125141,125137,125133,125130,125126,125122,125119,125115,125111,125108,125104,125100,125097,125093,125090,125086,125082,125079,125075,125071,125068,125064,125060,125057,125053,125050,125046,125042,125039,125035,125031,125028,125024,125020,125017,125013,125009,125006,125002,124999,124995,124991,124988,124984,124980,124977,124973,124969,124966,124962,124959,124955,124951,124948,124944,124940,124937,124933,124929,124926,124922,124919,124915,124911,124908,124904,124900,124897,124893,124890,124886,124882,124879,124875,124871,124868,124864,124860,124857,124853,124850,124846,124842,124839,124835,124831,124828,124824,124821,124817,124813,124810,124806,124802,124799,124795,124792,124788,124784,124781,124777,124773,124770,124766,124763,124759,124755,124752,124748,124744,124741,124737,124734,124730,124726,124723,124719,124715,124712,124708,124705,124701,124697,124694,124690,124686,124683,124679,124676,124672,124668,124665,124661,124658,124654,124650,124647,124643,124639,124636,124632,124629,124625,124621,124618,124614,124611,124607,124603,124600,124596,124592,124589,124585,124582,124578,124574,124571,124567,124564,124560,124556,124553,124549,124545,124542,124538,124535,124531,124527,124524,124520,124517,124513,124509,124506,124502,124499,124495,124491,124488,124484,124480,124477,124473,124470,124466,124462,124459,124455,124452,124448,124444,124441,124437,124434,124430,124426,124423,124419,124416,124412,124408,124405,124401,124398,124394,124390,124387,124383,124380,124376,124372,124369,124365,124362,124358,124354,124351,124347,124344,124340,124336,124333,124329,124326,124322,124318,124315,124311,124308,124304,124300,124297,124293,124290,124286,124282,124279,124275,124272,124268,124264,124261,124257,124254,124250,124246,124243,124239,124236,124232,124228,124225,124221,124218,124214,124210,124207,124203,124200,124196,124193,124189,124185,124182,124178,124175,124171,124167,124164,124160,124157,124153,124149,124146,124142,124139,124135,124132,124128,124124,124121,124117,124114,124110,124106,124103,124099,124096,124092,124088,124085,124081,124078,124074,124071,124067,124063,124060,124056,124053,124049,124045,124042,124038,124035,124031,124028,124024,124020,124017,124013,124010,124006,124002,123999,123995,123992,123988,123985,123981,123977,123974,123970,123967,123963,123960,123956,123952,123949,123945,123942,123938,123935,123931,123927,123924,123920,123917,123913,123909,123906,123902,123899,123895,123892,123888,123884,123881,123877,123874,123870,123867,123863,123859,123856,123852,123849,123845,123842,123838,123834,123831,123827,123824,123820,123817,123813,123809,123806,123802,123799,123795,123792,123788,123784,123781,123777,123774,123770,123767,123763,123760,123756,123752,123749,123745,123742,123738,123735,123731,123727,123724,123720,123717,123713,123710,123706,123702,123699,123695,123692,123688,123685,123681,123678,123674,123670,123667,123663,123660,123656,123653,123649,123645,123642,123638,123635,123631,123628,123624,123621,123617,123613,123610,123606,123603,123599,123596,123592,123589,123585,123581,123578,123574,123571,123567,123564,123560,123557,123553,123549,123546,123542,123539,123535,123532,123528,123525,123521,123517,123514,123510,123507,123503,123500,123496,123493,123489,123486,123482,123478,123475,123471,123468,123464,123461,123457,123454,123450,123446,123443,123439,123436,123432,123429,123425,123422,123418,123415,123411,123407,123404,123400,123397,123393,123390,123386,123383,123379,123376,123372,123368,123365,123361,123358,123354,123351,123347,123344,123340,123337,123333,123330,123326,123322,123319,123315,123312,123308,123305,123301,123298,123294,123291,123287,123283,123280,123276,123273,123269,123266,123262,123259,123255,123252,123248,123245,123241,123237,123234,123230,123227,123223,123220,123216,123213,123209,123206,123202,123199,123195,123192,123188,123184,123181,123177,123174,123170,123167,123163,123160,123156,123153,123149,123146,123142,123139,123135,123132,123128,123124,123121,123117,123114,123110,123107,123103,123100,123096,123093,123089,123086,123082,123079,123075,123072,123068,123064,123061,123057,123054,123050,123047,123043,123040,123036,123033,123029,123026,123022,123019,123015,123012,123008,123005,123001,122998,122994,122990,122987,122983,122980,122976,122973,122969,122966,122962,122959,122955,122952,122948,122945,122941,122938,122934,122931,122927,122924,122920,122917,122913,122910,122906,122902,122899,122895,122892,122888,122885,122881,122878,122874,122871,122867,122864,122860,122857,122853,122850,122846,122843,122839,122836,122832,122829,122825,122822,122818,122815,122811,122808,122804,122801,122797,122794,122790,122787,122783,122780,122776,122772,122769,122765,122762,122758,122755,122751,122748,122744,122741,122737,122734,122730,122727,122723,122720,122716,122713,122709,122706,122702,122699,122695,122692,122688,122685,122681,122678,122674,122671,122667,122664,122660,122657,122653,122650,122646,122643,122639,122636,122632,122629,122625,122622,122618,122615,122611,122608,122604,122601,122597,122594,122590,122587,122583,122580,122576,122573,122569,122566,122562,122559,122555,122552,122548,122545,122541,122538,122534,122531,122527,122524,122520,122517,122513,122510,122506,122503,122499,122496,122492,122489,122485,122482,122478,122475,122471,122468,122464,122461,122457,122454,122450,122447,122443,122440,122436,122433,122430,122426,122423,122419,122416,122412,122409,122405,122402,122398,122395,122391,122388,122384,122381,122377,122374,122370,122367,122363,122360,122356,122353,122349,122346,122342,122339,122335,122332,122328,122325,122321,122318,122314,122311,122307,122304,122301,122297,122294,122290,122287,122283,122280,122276,122273,122269,122266,122262,122259,122255,122252,122248,122245,122241,122238,122234,122231,122227,122224,122220,122217,122214,122210,122207,122203,122200,122196,122193,122189,122186,122182,122179,122175,122172,122168,122165,122161,122158,122154,122151,122147,122144,122141,122137,122134,122130,122127,122123,122120,122116,122113,122109,122106,122102,122099,122095,122092,122088,122085,122082,122078,122075,122071,122068,122064,122061,122057,122054,122050,122047,122043,122040,122036,122033,122029,122026,122023,122019,122016,122012,122009,122005,122002,121998,121995,121991,121988,121984,121981,121978,121974,121971,121967,121964,121960,121957,121953,121950,121946,121943,121939,121936,121932,121929,121926,121922,121919,121915,121912,121908,121905,121901,121898,121894,121891,121887,121884,121881,121877,121874,121870,121867,121863,121860,121856,121853,121849,121846,121843,121839,121836,121832,121829,121825,121822,121818,121815,121811,121808,121805,121801,121798,121794,121791,121787,121784,121780,121777,121773,121770,121767,121763,121760,121756,121753,121749,121746,121742,121739,121735,121732,121729,121725,121722,121718,121715,121711,121708,121704,121701,121698,121694,121691,121687,121684,121680,121677,121673,121670,121667,121663,121660,121656,121653,121649,121646,121642,121639,121636,121632,121629,121625,121622,121618,121615,121611,121608,121605,121601,121598,121594,121591,121587,121584,121580,121577,121574,121570,121567,121563,121560,121556,121553,121549,121546,121543,121539,121536,121532,121529,121525,121522,121518,121515,121512,121508,121505,121501,121498,121494,121491,121488,121484,121481,121477,121474,121470,121467,121464,121460,121457,121453,121450,121446,121443,121439,121436,121433,121429,121426,121422,121419,121415,121412,121409,121405,121402,121398,121395,121391,121388,121385,121381,121378,121374,121371,121367,121364,121361,121357,121354,121350,121347,121343,121340,121337,121333,121330,121326,121323,121319,121316,121313,121309,121306,121302,121299,121295,121292,121289,121285,121282,121278,121275,121271,121268,121265,121261,121258,121254,121251,121247,121244,121241,121237,121234,121230,121227,121224,121220,121217,121213,121210,121206,121203,121200,121196,121193,121189,121186,121182,121179,121176,121172,121169,121165,121162,121159,121155,121152,121148,121145,121141,121138,121135,121131,121128,121124,121121,121118,121114,121111,121107,121104,121100,121097,121094,121090,121087,121083,121080,121077,121073,121070,121066,121063,121060,121056,121053,121049,121046,121042,121039,121036,121032,121029,121025,121022,121019,121015,121012,121008,121005,121002,120998,120995,120991,120988,120984,120981,120978,120974,120971,120967,120964,120961,120957,120954,120950,120947,120944,120940,120937,120933,120930,120927,120923,120920,120916,120913,120910,120906,120903,120899,120896,120893,120889,120886,120882,120879,120876,120872,120869,120865,120862,120859,120855,120852,120848,120845,120842,120838,120835,120831,120828,120825,120821,120818,120814,120811,120808,120804,120801,120797,120794,120791,120787,120784,120780,120777,120774,120770,120767,120763,120760,120757,120753,120750,120746,120743,120740,120736,120733,120729,120726,120723,120719,120716,120712,120709,120706,120702,120699,120696,120692,120689,120685,120682,120679,120675,120672,120668,120665,120662,120658,120655,120651,120648,120645,120641,120638,120634,120631,120628,120624,120621,120618,120614,120611,120607,120604,120601,120597,120594,120590,120587,120584,120580,120577,120574,120570,120567,120563,120560,120557,120553,120550,120546,120543,120540,120536,120533,120530,120526,120523,120519,120516,120513,120509,120506,120502,120499,120496,120492,120489,120486,120482,120479,120475,120472,120469,120465,120462,120459,120455,120452,120448,120445,120442,120438,120435,120432,120428,120425,120421,120418,120415,120411,120408,120405,120401,120398,120394,120391,120388,120384,120381,120378,120374,120371,120367,120364,120361,120357,120354,120351,120347,120344,120340,120337,120334,120330,120327,120324,120320,120317,120313,120310,120307,120303,120300,120297,120293,120290,120286,120283,120280,120276,120273,120270,120266,120263,120260,120256,120253,120249,120246,120243,120239,120236,120233,120229,120226,120223,120219,120216,120212,120209,120206,120202,120199,120196,120192,120189,120186,120182,120179,120175,120172,120169,120165,120162,120159,120155,120152,120149,120145,120142,120138,120135,120132,120128,120125,120122,120118,120115,120112,120108,120105,120101,120098,120095,120091,120088,120085,120081,120078,120075,120071,120068,120065,120061,120058,120054,120051,120048,120044,120041,120038,120034,120031,120028,120024,120021,120018,120014,120011,120008,120004,120001,119997,119994,119991,119987,119984,119981,119977,119974,119971,119967,119964,119961,119957,119954,119951,119947,119944,119941,119937,119934,119930,119927,119924,119920,119917,119914,119910,119907,119904,119900,119897,119894,119890,119887,119884,119880,119877,119874,119870,119867,119864,119860,119857,119853,119850,119847,119843,119840,119837,119833,119830,119827,119823,119820,119817,119813,119810,119807,119803,119800,119797,119793,119790,119787,119783,119780,119777,119773,119770,119767,119763,119760,119757,119753,119750,119747,119743,119740,119737,119733,119730,119727,119723,119720,119717,119713,119710,119706,119703,119700,119696,119693,119690,119686,119683,119680,119676,119673,119670,119666,119663,119660,119656,119653,119650,119646,119643,119640,119636,119633,119630,119626,119623,119620,119616,119613,119610,119606,119603,119600,119596,119593,119590,119587,119583,119580,119577,119573,119570,119567,119563,119560,119557,119553,119550,119547,119543,119540,119537,119533,119530,119527,119523,119520,119517,119513,119510,119507,119503,119500,119497,119493,119490,119487,119483,119480,119477,119473,119470,119467,119463,119460,119457,119453,119450,119447,119444,119440,119437,119434,119430,119427,119424,119420,119417,119414,119410,119407,119404,119400,119397,119394,119390,119387,119384,119380,119377,119374,119370,119367,119364,119361,119357,119354,119351,119347,119344,119341,119337,119334,119331,119327,119324,119321,119317,119314,119311,119307,119304,119301,119298,119294,119291,119288,119284,119281,119278,119274,119271,119268,119264,119261,119258,119254,119251,119248,119245,119241,119238,119235,119231,119228,119225,119221,119218,119215,119211,119208,119205,119202,119198,119195,119192,119188,119185,119182,119178,119175,119172,119168,119165,119162,119159,119155,119152,119149,119145,119142,119139,119135,119132,119129,119125,119122,119119,119116,119112,119109,119106,119102,119099,119096,119092,119089,119086,119083,119079,119076,119073,119069,119066,119063,119059,119056,119053,119050,119046,119043,119040,119036,119033,119030,119026,119023,119020,119017,119013,119010,119007,119003,119000,118997,118993,118990,118987,118984,118980,118977,118974,118970,118967,118964,118960,118957,118954,118951,118947,118944,118941,118937,118934,118931,118928,118924,118921,118918,118914,118911,118908,118904,118901,118898,118895,118891,118888,118885,118881,118878,118875,118872,118868,118865,118862,118858,118855,118852,118849,118845,118842,118839,118835,118832,118829,118826,118822,118819,118816,118812,118809,118806,118803,118799,118796,118793,118789,118786,118783,118780,118776,118773,118770,118766,118763,118760,118757,118753,118750,118747,118743,118740,118737,118734,118730,118727,118724,118720,118717,118714,118711,118707,118704,118701,118697,118694,118691,118688,118684,118681,118678,118675,118671,118668,118665,118661,118658,118655,118652,118648,118645,118642,118638,118635,118632,118629,118625,118622,118619,118616,118612,118609,118606,118602,118599,118596,118593,118589,118586,118583,118579,118576,118573,118570,118566,118563,118560,118557,118553,118550,118547,118543,118540,118537,118534,118530,118527,118524,118521,118517,118514,118511,118508,118504,118501,118498,118494,118491,118488,118485,118481,118478,118475,118472,118468,118465,118462,118458,118455,118452,118449,118445,118442,118439,118436,118432,118429,118426,118423,118419,118416,118413,118409,118406,118403,118400,118396,118393,118390,118387,118383,118380,118377,118374,118370,118367,118364,118361,118357,118354,118351,118348,118344,118341,118338,118334,118331,118328,118325,118321,118318,118315,118312,118308,118305,118302,118299,118295,118292,118289,118286,118282,118279,118276,118273,118269,118266,118263,118260,118256,118253,118250,118246,118243,118240,118237,118233,118230,118227,118224,118220,118217,118214,118211,118207,118204,118201,118198,118194,118191,118188,118185,118181,118178,118175,118172,118168,118165,118162,118159,118155,118152,118149,118146,118142,118139,118136,118133,118129,118126,118123,118120,118116,118113,118110,118107,118103,118100,118097,118094,118090,118087,118084,118081,118077,118074,118071,118068,118064,118061,118058,118055,118051,118048,118045,118042,118039,118035,118032,118029,118026,118022,118019,118016,118013,118009,118006,118003,118000,117996,117993,117990,117987,117983,117980,117977,117974,117970,117967,117964,117961,117957,117954,117951,117948,117945,117941,117938,117935,117932,117928,117925,117922,117919,117915,117912,117909,117906,117902,117899,117896,117893,117889,117886,117883,117880,117877,117873,117870,117867,117864,117860,117857,117854,117851,117847,117844,117841,117838,117834,117831,117828,117825,117822,117818,117815,117812,117809,117805,117802,117799,117796,117792,117789,117786,117783,117780,117776,117773,117770,117767,117763,117760,117757,117754,117750,117747,117744,117741,117738,117734,117731,117728,117725,117721,117718,117715,117712,117709,117705,117702,117699,117696,117692,117689,117686,117683,117680,117676,117673,117670,117667,117663,117660,117657,117654,117651,117647,117644,117641,117638,117634,117631,117628,117625,117622,117618,117615,117612,117609,117605,117602,117599,117596,117593,117589,117586,117583,117580,117576,117573,117570,117567,117564,117560,117557,117554,117551,117547,117544,117541,117538,117535,117531,117528,117525,117522,117519,117515,117512,117509,117506,117502,117499,117496,117493,117490,117486,117483,117480,117477,117474,117470,117467,117464,117461,117457,117454,117451,117448,117445,117441,117438,117435,117432,117429,117425,117422,117419,117416,117412,117409,117406,117403,117400,117396,117393,117390,117387,117384,117380,117377,117374,117371,117368,117364,117361,117358,117355,117352,117348,117345,117342,117339,117336,117332,117329,117326,117323,117319,117316,117313,117310,117307,117303,117300,117297,117294,117291,117287,117284,117281,117278,117275,117271,117268,117265,117262,117259,117255,117252,117249,117246,117243,117239,117236,117233,117230,117227,117223,117220,117217,117214,117211,117207,117204,117201,117198,117195,117191,117188,117185,117182,117179,117175,117172,117169,117166,117163,117159,117156,117153,117150,117147,117143,117140,117137,117134,117131,117128,117124,117121,117118,117115,117112,117108,117105,117102,117099,117096,117092,117089,117086,117083,117080,117076,117073,117070,117067,117064,117060,117057,117054,117051,117048,117045,117041,117038,117035,117032,117029,117025,117022,117019,117016,117013,117009,117006,117003,117000,116997,116994,116990,116987,116984,116981,116978,116974,116971,116968,116965,116962,116958,116955,116952,116949,116946,116943,116939,116936,116933,116930,116927,116923,116920,116917,116914,116911,116908,116904,116901,116898,116895,116892,116888,116885,116882,116879,116876,116873,116869,116866,116863,116860,116857,116853,116850,116847,116844,116841,116838,116834,116831,116828,116825,116822,116819,116815,116812,116809,116806,116803,116799,116796,116793,116790,116787,116784,116780,116777,116774,116771,116768,116765,116761,116758,116755,116752,116749,116745,116742,116739,116736,116733,116730,116726,116723,116720,116717,116714,116711,116707,116704,116701,116698,116695,116692,116688,116685,116682,116679,116676,116673,116669,116666,116663,116660,116657,116654,116650,116647,116644,116641,116638,116635,116631,116628,116625,116622,116619,116616,116612,116609,116606,116603,116600,116597,116593,116590,116587,116584,116581,116578,116574,116571,116568,116565,116562,116559,116555,116552,116549,116546,116543,116540,116536,116533,116530,116527,116524,116521,116517,116514,116511,116508,116505,116502,116498,116495,116492,116489,116486,116483,116480,116476,116473,116470,116467,116464,116461,116457,116454,116451,116448,116445,116442,116438,116435,116432,116429,116426,116423,116420,116416,116413,116410,116407,116404,116401,116397,116394,116391,116388,116385,116382,116379,116375,116372,116369,116366,116363,116360,116356,116353,116350,116347,116344,116341,116338,116334,116331,116328,116325,116322,116319,116315,116312,116309,116306,116303,116300,116297,116293,116290,116287,116284,116281,116278,116275,116271,116268,116265,116262,116259,116256,116253,116249,116246,116243,116240,116237,116234,116230,116227,116224,116221,116218,116215,116212,116208,116205,116202,116199,116196,116193,116190,116186,116183,116180,116177,116174,116171,116168,116164,116161,116158,116155,116152,116149,116146,116142,116139,116136,116133,116130,116127,116124,116121,116117,116114,116111,116108,116105,116102,116099,116095,116092,116089,116086,116083,116080,116077,116073,116070,116067,116064,116061,116058,116055,116051,116048,116045,116042,116039,116036,116033,116030,116026,116023,116020,116017,116014,116011,116008,116004,116001,115998,115995,115992,115989,115986,115983,115979,115976,115973,115970,115967,115964,115961,115957,115954,115951,115948,115945,115942,115939,115936,115932,115929,115926,115923,115920,115917,115914,115911,115907,115904,115901,115898,115895,115892,115889,115886,115882,115879,115876,115873,115870,115867,115864,115861,115857,115854,115851,115848,115845,115842,115839,115836,115832,115829,115826,115823,115820,115817,115814,115811,115807,115804,115801,115798,115795,115792,115789,115786,115782,115779,115776,115773,115770,115767,115764,115761,115757,115754,115751,115748,115745,115742,115739,115736,115733,115729,115726,115723,115720,115717,115714,115711,115708,115704,115701,115698,115695,115692,115689,115686,115683,115680,115676,115673,115670,115667,115664,115661,115658,115655,115651,115648,115645,115642,115639,115636,115633,115630,115627,115623,115620,115617,115614,115611,115608,115605,115602,115599,115595,115592,115589,115586,115583,115580,115577,115574,115571,115567,115564,115561,115558,115555,115552,115549,115546,115543,115539,115536,115533,115530,115527,115524,115521,115518,115515,115512,115508,115505,115502,115499,115496,115493,115490,115487,115484,115480,115477,115474,115471,115468,115465,115462,115459,115456,115453,115449,115446,115443,115440,115437,115434,115431,115428,115425,115421,115418,115415,115412,115409,115406,115403,115400,115397,115394,115390,115387,115384,115381,115378,115375,115372,115369,115366,115363,115359,115356,115353,115350,115347,115344,115341,115338,115335,115332,115329,115325,115322,115319,115316,115313,115310,115307,115304,115301,115298,115294,115291,115288,115285,115282,115279,115276,115273,115270,115267,115264,115260,115257,115254,115251,115248,115245,115242,115239,115236,115233,115229,115226,115223,115220,115217,115214,115211,115208,115205,115202,115199,115195,115192,115189,115186,115183,115180,115177,115174,115171,115168,115165,115162,115158,115155,115152,115149,115146,115143,115140,115137,115134,115131,115128,115124,115121,115118,115115,115112,115109,115106,115103,115100,115097,115094,115091,115087,115084,115081,115078,115075,115072,115069,115066,115063,115060,115057,115054,115050,115047,115044,115041,115038,115035,115032,115029,115026,115023,115020,115017,115013,115010,115007,115004,115001,114998,114995,114992,114989,114986,114983,114980,114977,114973,114970,114967,114964,114961,114958,114955,114952,114949,114946,114943,114940,114937,114933,114930,114927,114924,114921,114918,114915,114912,114909,114906,114903,114900,114897,114893,114890,114887,114884,114881,114878,114875,114872,114869,114866,114863,114860,114857,114854,114850,114847,114844,114841,114838,114835,114832,114829,114826,114823,114820,114817,114814,114811,114808,114804,114801,114798,114795,114792,114789,114786,114783,114780,114777,114774,114771,114768,114765,114761,114758,114755,114752,114749,114746,114743,114740,114737,114734,114731,114728,114725,114722,114719,114716,114712,114709,114706,114703,114700,114697,114694,114691,114688,114685,114682,114679,114676,114673,114670,114667,114663,114660,114657,114654,114651,114648,114645,114642,114639,114636,114633,114630,114627,114624,114621,114618,114614,114611,114608,114605,114602,114599,114596,114593,114590,114587,114584,114581,114578,114575,114572,114569,114566,114563,114559,114556,114553,114550,114547,114544,114541,114538,114535,114532,114529,114526,114523,114520,114517,114514,114511,114508,114504,114501,114498,114495,114492,114489,114486,114483,114480,114477,114474,114471,114468,114465,114462,114459,114456,114453,114450,114447,114443,114440,114437,114434,114431,114428,114425,114422,114419,114416,114413,114410,114407,114404,114401,114398,114395,114392,114389,114386,114383,114379,114376,114373,114370,114367,114364,114361,114358,114355,114352,114349,114346,114343,114340,114337,114334,114331,114328,114325,114322,114319,114316,114312,114309,114306,114303,114300,114297,114294,114291,114288,114285,114282,114279,114276,114273,114270,114267,114264,114261,114258,114255,114252,114249,114246,114243,114240,114236,114233,114230,114227,114224,114221,114218,114215,114212,114209,114206,114203,114200,114197,114194,114191,114188,114185,114182,114179,114176,114173,114170,114167,114164,114161,114158,114154,114151,114148,114145,114142,114139,114136,114133,114130,114127,114124,114121,114118,114115,114112,114109,114106,114103,114100,114097,114094,114091,114088,114085,114082,114079,114076,114073,114070,114067,114064,114061,114057,114054,114051,114048,114045,114042,114039,114036,114033,114030,114027,114024,114021,114018,114015,114012,114009,114006,114003,114000,113997,113994,113991,113988,113985,113982,113979,113976,113973,113970,113967,113964,113961,113958,113955,113952,113949,113946,113943,113939,113936,113933,113930,113927,113924,113921,113918,113915,113912,113909,113906,113903,113900,113897,113894,113891,113888,113885,113882,113879,113876,113873,113870,113867,113864,113861,113858,113855,113852,113849,113846,113843,113840,113837,113834,113831,113828,113825,113822,113819,113816,113813,113810,113807,113804,113801,113798,113795,113792,113789,113786,113783,113780,113776,113773,113770,113767,113764,113761,113758,113755,113752,113749,113746,113743,113740,113737,113734,113731,113728,113725,113722,113719,113716,113713,113710,113707,113704,113701,113698,113695,113692,113689,113686,113683,113680,113677,113674,113671,113668,113665,113662,113659,113656,113653,113650,113647,113644,113641,113638,113635,113632,113629,113626,113623,113620,113617,113614,113611,113608,113605,113602,113599,113596,113593,113590,113587,113584,113581,113578,113575,113572,113569,113566,113563,113560,113557,113554,113551,113548,113545,113542,113539,113536,113533,113530,113527,113524,113521,113518,113515,113512,113509,113506,113503,113500,113497,113494,113491,113488,113485,113482,113479,113476,113473,113470,113467,113464,113461,113458,113455,113452,113449,113446,113443,113440,113437,113434,113431,113428,113425,113422,113419,113416,113413,113410,113407,113404,113401,113398,113395,113392,113389,113386,113383,113380,113377,113374,113371,113368,113365,113362,113359,113356,113353,113350,113347,113344,113341,113338,113335,113332,113329,113326,113323,113320,113317,113314,113311,113308,113305,113302,113299,113296,113293,113290,113287,113284,113281,113278,113275,113272,113269,113266,113263,113260,113257,113254,113251,113248,113245,113243,113240,113237,113234,113231,113228,113225,113222,113219,113216,113213,113210,113207,113204,113201,113198,113195,113192,113189,113186,113183,113180,113177,113174,113171,113168,113165,113162,113159,113156,113153,113150,113147,113144,113141,113138,113135,113132,113129,113126,113123,113120,113117,113114,113111,113108,113105,113102,113099,113096,113093,113090,113087,113084,113082,113079,113076,113073,113070,113067,113064,113061,113058,113055,113052,113049,113046,113043,113040,113037,113034,113031,113028,113025,113022,113019,113016,113013,113010,113007,113004,113001,112998,112995,112992,112989,112986,112983,112980,112977,112974,112971,112968,112966,112963,112960,112957,112954,112951,112948,112945,112942,112939,112936,112933,112930,112927,112924,112921,112918,112915,112912,112909,112906,112903,112900,112897,112894,112891,112888,112885,112882,112879,112876,112873,112871,112868,112865,112862,112859,112856,112853,112850,112847,112844,112841,112838,112835,112832,112829,112826,112823,112820,112817,112814,112811,112808,112805,112802,112799,112796,112793,112790,112788,112785,112782,112779,112776,112773,112770,112767,112764,112761,112758,112755,112752,112749,112746,112743,112740,112737,112734,112731,112728,112725,112722,112719,112716,112714,112711,112708,112705,112702,112699,112696,112693,112690,112687,112684,112681,112678,112675,112672,112669,112666,112663,112660,112657,112654,112651,112648,112646,112643,112640,112637,112634,112631,112628,112625,112622,112619,112616,112613,112610,112607,112604,112601,112598,112595,112592,112589,112586,112584,112581,112578,112575,112572,112569,112566,112563,112560,112557,112554,112551,112548,112545,112542,112539,112536,112533,112530,112527,112525,112522,112519,112516,112513,112510,112507,112504,112501,112498,112495,112492,112489,112486,112483,112480,112477,112474,112471,112469,112466,112463,112460,112457,112454,112451,112448,112445,112442,112439,112436,112433,112430,112427,112424,112421,112418,112416,112413,112410,112407,112404,112401,112398,112395,112392,112389,112386,112383,112380,112377,112374,112371,112368,112366,112363,112360,112357,112354,112351,112348,112345,112342,112339,112336,112333,112330,112327,112324,112321,112319,112316,112313,112310,112307,112304,112301,112298,112295,112292,112289,112286,112283,112280,112277,112274,112272,112269,112266,112263,112260,112257,112254,112251,112248,112245,112242,112239,112236,112233,112230,112228,112225,112222,112219,112216,112213,112210,112207,112204,112201,112198,112195,112192,112189,112187,112184,112181,112178,112175,112172,112169,112166,112163,112160,112157,112154,112151,112148,112145,112143,112140,112137,112134,112131,112128,112125,112122,112119,112116,112113,112110,112107,112105,112102,112099,112096,112093,112090,112087,112084,112081,112078,112075,112072,112069,112066,112064,112061,112058,112055,112052,112049,112046,112043,112040,112037,112034,112031,112028,112026,112023,112020,112017,112014,112011,112008,112005,112002,111999,111996,111993,111991,111988,111985,111982,111979,111976,111973,111970,111967,111964,111961,111958,111955,111953,111950,111947,111944,111941,111938,111935,111932,111929,111926,111923,111920,111918,111915,111912,111909,111906,111903,111900,111897,111894,111891,111888,111885,111883,111880,111877,111874,111871,111868,111865,111862,111859,111856,111853,111851,111848,111845,111842,111839,111836,111833,111830,111827,111824,111821,111818,111816,111813,111810,111807,111804,111801,111798,111795,111792,111789,111786,111784,111781,111778,111775,111772,111769,111766,111763,111760,111757,111754,111752,111749,111746,111743,111740,111737,111734,111731,111728,111725,111723,111720,111717,111714,111711,111708,111705,111702,111699,111696,111693,111691,111688,111685,111682,111679,111676,111673,111670,111667,111664,111662,111659,111656,111653,111650,111647,111644,111641,111638,111635,111632,111630,111627,111624,111621,111618,111615,111612,111609,111606,111603,111601,111598,111595,111592,111589,111586,111583,111580,111577,111574,111572,111569,111566,111563,111560,111557,111554,111551,111548,111546,111543,111540,111537,111534,111531,111528,111525,111522,111519,111517,111514,111511,111508,111505,111502,111499,111496,111493,111490,111488,111485,111482,111479,111476,111473,111470,111467,111464,111462,111459,111456,111453,111450,111447,111444,111441,111438,111436,111433,111430,111427,111424,111421,111418,111415,111412,111410,111407,111404,111401,111398,111395,111392,111389,111386,111384,111381,111378,111375,111372,111369,111366,111363,111360,111358,111355,111352,111349,111346,111343,111340,111337,111334,111332,111329,111326,111323,111320,111317,111314,111311,111308,111306,111303,111300,111297,111294,111291,111288,111285,111283,111280,111277,111274,111271,111268,111265,111262,111259,111257,111254,111251,111248,111245,111242,111239,111236,111234,111231,111228,111225,111222,111219,111216,111213,111210,111208,111205,111202,111199,111196,111193,111190,111187,111185,111182,111179,111176,111173,111170,111167,111164,111162,111159,111156,111153,111150,111147,111144,111141,111139,111136,111133,111130,111127,111124,111121,111118,111116,111113,111110,111107,111104,111101,111098,111095,111093,111090,111087,111084,111081,111078,111075,111072,111070,111067,111064,111061,111058,111055,111052,111049,111047,111044,111041,111038,111035,111032,111029,111026,111024,111021,111018,111015,111012,111009,111006,111004,111001,110998,110995,110992,110989,110986,110983,110981,110978,110975,110972,110969,110966,110963,110961,110958,110955,110952,110949,110946,110943,110940,110938,110935,110932,110929,110926,110923,110920,110918,110915,110912,110909,110906,110903,110900,110897,110895,110892,110889,110886,110883,110880,110877,110875,110872,110869,110866,110863,110860,110857,110855,110852,110849,110846,110843,110840,110837,110835,110832,110829,110826,110823,110820,110817,110814,110812,110809,110806,110803,110800,110797,110794,110792,110789,110786,110783,110780,110777,110774,110772,110769,110766,110763,110760,110757,110754,110752,110749,110746,110743,110740,110737,110734,110732,110729,110726,110723,110720,110717,110715,110712,110709,110706,110703,110700,110697,110695,110692,110689,110686,110683,110680,110677,110675,110672,110669,110666,110663,110660,110657,110655,110652,110649,110646,110643,110640,110638,110635,110632,110629,110626,110623,110620,110618,110615,110612,110609,110606,110603,110600,110598,110595,110592,110589,110586,110583,110581,110578,110575,110572,110569,110566,110563,110561,110558,110555,110552,110549,110546,110544,110541,110538,110535,110532,110529,110526,110524,110521,110518,110515,110512,110509,110507,110504,110501,110498,110495,110492,110490,110487,110484,110481,110478,110475,110472,110470,110467,110464,110461,110458,110455,110453,110450,110447,110444,110441,110438,110436,110433,110430,110427,110424,110421,110418,110416,110413,110410,110407,110404,110401,110399,110396,110393,110390,110387,110384,110382,110379,110376,110373,110370,110367,110365,110362,110359,110356,110353,110350,110348,110345,110342,110339,110336,110333,110331,110328,110325,110322,110319,110316,110314,110311,110308,110305,110302,110299,110297,110294,110291,110288,110285,110282,110280,110277,110274,110271,110268,110265,110263,110260,110257,110254,110251,110248,110246,110243,110240,110237,110234,110231,110229,110226,110223,110220,110217,110214,110212,110209,110206,110203,110200,110198,110195,110192,110189,110186,110183,110181,110178,110175,110172,110169,110166,110164,110161,110158,110155,110152,110149,110147,110144,110141,110138,110135,110133,110130,110127,110124,110121,110118,110116,110113,110110,110107,110104,110101,110099,110096,110093,110090,110087,110085,110082,110079,110076,110073,110070,110068,110065,110062,110059,110056,110054,110051,110048,110045,110042,110039,110037,110034,110031,110028,110025,110022,110020,110017,110014,110011,110008,110006,110003,110000,109997,109994,109991,109989,109986,109983,109980,109977,109975,109972,109969,109966,109963,109961,109958,109955,109952,109949,109946,109944,109941,109938,109935,109932,109930,109927,109924,109921,109918,109915,109913,109910,109907,109904,109901,109899,109896,109893,109890,109887,109885,109882,109879,109876,109873,109871,109868,109865,109862,109859,109856,109854,109851,109848,109845,109842,109840,109837,109834,109831,109828,109826,109823,109820,109817,109814,109812,109809,109806,109803,109800,109797,109795,109792,109789,109786,109783,109781,109778,109775,109772,109769,109767,109764,109761,109758,109755,109753,109750,109747,109744,109741,109739,109736,109733,109730,109727,109725,109722,109719,109716,109713,109711,109708,109705,109702,109699,109697,109694,109691,109688,109685,109683,109680,109677,109674,109671,109669,109666,109663,109660,109657,109655,109652,109649,109646,109643,109641,109638,109635,109632,109629,109627,109624,109621,109618,109615,109613,109610,109607,109604,109601,109599,109596,109593,109590,109587,109585,109582,109579,109576,109573,109571,109568,109565,109562,109559,109557,109554,109551,109548,109545,109543,109540,109537,109534,109531,109529,109526,109523,109520,109518,109515,109512,109509,109506,109504,109501,109498,109495,109492,109490,109487,109484,109481,109478,109476,109473,109470,109467,109464,109462,109459,109456,109453,109451,109448,109445,109442,109439,109437,109434,109431,109428,109425,109423,109420,109417,109414,109411,109409,109406,109403,109400,109398,109395,109392,109389,109386,109384,109381,109378,109375,109372,109370,109367,109364,109361,109359,109356,109353,109350,109347,109345,109342,109339,109336,109333,109331,109328,109325,109322,109320,109317,109314,109311,109308,109306,109303,109300,109297,109295,109292,109289,109286,109283,109281,109278,109275,109272,109270,109267,109264,109261,109258,109256,109253,109250,109247,109245,109242,109239,109236,109233,109231,109228,109225,109222,109220,109217,109214,109211,109208,109206,109203,109200,109197,109195,109192,109189,109186,109183,109181,109178,109175,109172,109170,109167,109164,109161,109158,109156,109153,109150,109147,109145,109142,109139,109136,109133,109131,109128,109125,109122,109120,109117,109114,109111,109109,109106,109103,109100,109097,109095,109092,109089,109086,109084,109081,109078,109075,109072,109070,109067,109064,109061,109059,109056,109053,109050,109048,109045,109042,109039,109037,109034,109031,109028,109025,109023,109020,109017,109014,109012,109009,109006,109003,109001,108998,108995,108992,108989,108987,108984,108981,108978,108976,108973,108970,108967,108965,108962,108959,108956,108954,108951,108948,108945,108942,108940,108937,108934,108931,108929,108926,108923,108920,108918,108915,108912,108909,108907,108904,108901,108898,108896,108893,108890,108887,108884,108882,108879,108876,108873,108871,108868,108865,108862,108860,108857,108854,108851,108849,108846,108843,108840,108838,108835,108832,108829,108827,108824,108821,108818,108815,108813,108810,108807,108804,108802,108799,108796,108793,108791,108788,108785,108782,108780,108777,108774,108771,108769,108766,108763,108760,108758,108755,108752,108749,108747,108744,108741,108738,108736,108733,108730,108727,108725,108722,108719,108716,108714,108711,108708,108705,108703,108700,108697,108694,108692,108689,108686,108683,108681,108678,108675,108672,108670,108667,108664,108661,108659,108656,108653,108650,108648,108645,108642,108639,108637,108634,108631,108628,108626,108623,108620,108617,108615,108612,108609,108606,108604,108601,108598,108595,108593,108590,108587,108584,108582,108579,108576,108573,108571,108568,108565,108562,108560,108557,108554,108551,108549,108546,108543,108541,108538,108535,108532,108530,108527,108524,108521,108519,108516,108513,108510,108508,108505,108502,108499,108497,108494,108491,108488,108486,108483,108480,108477,108475,108472,108469,108466,108464,108461,108458,108456,108453,108450,108447,108445,108442,108439,108436,108434,108431,108428,108425,108423,108420,108417,108414,108412,108409,108406,108404,108401,108398,108395,108393,108390,108387,108384,108382,108379,108376,108373,108371,108368,108365,108362,108360,108357,108354,108352,108349,108346,108343,108341,108338,108335,108332,108330,108327,108324,108322,108319,108316,108313,108311,108308,108305,108302,108300,108297,108294,108291,108289,108286,108283,108281,108278,108275,108272,108270,108267,108264,108261,108259,108256,108253,108251,108248,108245,108242,108240,108237,108234,108231,108229,108226,108223,108221,108218,108215,108212,108210,108207,108204,108201,108199,108196,108193,108191,108188,108185,108182,108180,108177,108174,108171,108169,108166,108163,108161,108158,108155,108152,108150,108147,108144,108141,108139,108136,108133,108131,108128,108125,108122,108120,108117,108114,108112,108109,108106,108103,108101,108098,108095,108093,108090,108087,108084,108082,108079,108076,108073,108071,108068,108065,108063,108060,108057,108054,108052,108049,108046,108044,108041,108038,108035,108033,108030,108027,108025,108022,108019,108016,108014,108011,108008,108006,108003,108000,107997,107995,107992,107989,107987,107984,107981,107978,107976,107973,107970,107968,107965,107962,107959,107957,107954,107951,107949,107946,107943,107940,107938,107935,107932,107930,107927,107924,107921,107919,107916,107913,107911,107908,107905,107902,107900,107897,107894,107892,107889,107886,107883,107881,107878,107875,107873,107870,107867,107864,107862,107859,107856,107854,107851,107848,107846,107843,107840,107837,107835,107832,107829,107827,107824,107821,107818,107816,107813,107810,107808,107805,107802,107799,107797,107794,107791,107789,107786,107783,107781,107778,107775,107772,107770,107767,107764,107762,107759,107756,107754,107751,107748,107745,107743,107740,107737,107735,107732,107729,107726,107724,107721,107718,107716,107713,107710,107708,107705,107702,107699,107697,107694,107691,107689,107686,107683,107681,107678,107675,107672,107670,107667,107664,107662,107659,107656,107654,107651,107648,107645,107643,107640,107637,107635,107632,107629,107627,107624,107621,107619,107616,107613,107610,107608,107605,107602,107600,107597,107594,107592,107589,107586,107583,107581,107578,107575,107573,107570,107567,107565,107562,107559,107557,107554,107551,107548,107546,107543,107540,107538,107535,107532,107530,107527,107524,107522,107519,107516,107513,107511,107508,107505,107503,107500,107497,107495,107492,107489,107487,107484,107481,107478,107476,107473,107470,107468,107465,107462,107460,107457,107454,107452,107449,107446,107444,107441,107438,107435,107433,107430,107427,107425,107422,107419,107417,107414,107411,107409,107406,107403,107401,107398,107395,107392,107390,107387,107384,107382,107379,107376,107374,107371,107368,107366,107363,107360,107358,107355,107352,107350,107347,107344,107341,107339,107336,107333,107331,107328,107325,107323,107320,107317,107315,107312,107309,107307,107304,107301,107299,107296,107293,107291,107288,107285,107282,107280,107277,107274,107272,107269,107266,107264,107261,107258,107256,107253,107250,107248,107245,107242,107240,107237,107234,107232,107229,107226,107224,107221,107218,107216,107213,107210,107208,107205,107202,107199,107197,107194,107191,107189,107186,107183,107181,107178,107175,107173,107170,107167,107165,107162,107159,107157,107154,107151,107149,107146,107143,107141,107138,107135,107133,107130,107127,107125,107122,107119,107117,107114,107111,107109,107106,107103,107101,107098,107095,107093,107090,107087,107085,107082,107079,107077,107074,107071,107069,107066,107063,107061,107058,107055,107053,107050,107047,107045,107042,107039,107037,107034,107031,107029,107026,107023,107021,107018,107015,107013,107010,107007,107005,107002,106999,106997,106994,106991,106989,106986,106983,106981,106978,106975,106973,106970,106967,106965,106962,106959,106957,106954,106951,106949,106946,106943,106941,106938,106935,106933,106930,106927,106925,106922,106919,106917,106914,106911,106909,106906,106903,106901,106898,106895,106893,106890,106887,106885,106882,106879,106877,106874,106871,106869,106866,106863,106861,106858,106855,106853,106850,106847,106845,106842,106839,106837,106834,106832,106829,106826,106824,106821,106818,106816,106813,106810,106808,106805,106802,106800,106797,106794,106792,106789,106786,106784,106781,106778,106776,106773,106770,106768,106765,106762,106760,106757,106755,106752,106749,106747,106744,106741,106739,106736,106733,106731,106728,106725,106723,106720,106717,106715,106712,106709,106707,106704,106701,106699,106696,106694,106691,106688,106686,106683,106680,106678,106675,106672,106670,106667,106664,106662,106659,106656,106654,106651,106648,106646,106643,106641,106638,106635,106633,106630,106627,106625,106622,106619,106617,106614,106611,106609,106606,106603,106601,106598,106596,106593,106590,106588,106585,106582,106580,106577,106574,106572,106569,106566,106564,106561,106559,106556,106553,106551,106548,106545,106543,106540,106537,106535,106532,106529,106527,106524,106522,106519,106516,106514,106511,106508,106506,106503,106500,106498,106495,106492,106490,106487,106485,106482,106479,106477,106474,106471,106469,106466,106463,106461,106458,106456,106453,106450,106448,106445,106442,106440,106437,106434,106432,106429,106426,106424,106421,106419,106416,106413,106411,106408,106405,106403,106400,106397,106395,106392,106390,106387,106384,106382,106379,106376,106374,106371,106368,106366,106363,106361,106358,106355,106353,106350,106347,106345,106342,106340,106337,106334,106332,106329,106326,106324,106321,106318,106316,106313,106311,106308,106305,106303,106300,106297,106295,106292,106290,106287,106284,106282,106279,106276,106274,106271,106268,106266,106263,106261,106258,106255,106253,106250,106247,106245,106242,106240,106237,106234,106232,106229,106226,106224,106221,106219,106216,106213,106211,106208,106205,106203,106200,106198,106195,106192,106190,106187,106184,106182,106179,106177,106174,106171,106169,106166,106163,106161,106158,106156,106153,106150,106148,106145,106142,106140,106137,106135,106132,106129,106127,106124,106121,106119,106116,106114,106111,106108,106106,106103,106100,106098,106095,106093,106090,106087,106085,106082,106080,106077,106074,106072,106069,106066,106064,106061,106059,106056,106053,106051,106048,106045,106043,106040,106038,106035,106032,106030,106027,106025,106022,106019,106017,106014,106011,106009,106006,106004,106001,105998,105996,105993,105991,105988,105985,105983,105980,105977,105975,105972,105970,105967,105964,105962,105959,105957,105954,105951,105949,105946,105943,105941,105938,105936,105933,105930,105928,105925,105923,105920,105917,105915,105912,105909,105907,105904,105902,105899,105896,105894,105891,105889,105886,105883,105881,105878,105876,105873,105870,105868,105865,105862,105860,105857,105855,105852,105849,105847,105844,105842,105839,105836,105834,105831,105829,105826,105823,105821,105818,105816,105813,105810,105808,105805,105803,105800,105797,105795,105792,105789,105787,105784,105782,105779,105776,105774,105771,105769,105766,105763,105761,105758,105756,105753,105750,105748,105745,105743,105740,105737,105735,105732,105730,105727,105724,105722,105719,105717,105714,105711,105709,105706,105704,105701,105698,105696,105693,105691,105688,105685,105683,105680,105678,105675,105672,105670,105667,105665,105662,105659,105657,105654,105652,105649,105646,105644,105641,105639,105636,105633,105631,105628,105626,105623,105620,105618,105615,105613,105610,105607,105605,105602,105600,105597,105594,105592,105589,105587,105584,105581,105579,105576,105574,105571,105568,105566,105563,105561,105558,105555,105553,105550,105548,105545,105543,105540,105537,105535,105532,105530,105527,105524,105522,105519,105517,105514,105511,105509,105506,105504,105501,105498,105496,105493,105491,105488,105485,105483,105480,105478,105475,105473,105470,105467,105465,105462,105460,105457,105454,105452,105449,105447,105444,105441,105439,105436,105434,105431,105429,105426,105423,105421,105418,105416,105413,105410,105408,105405,105403,105400,105397,105395,105392,105390,105387,105385,105382,105379,105377,105374,105372,105369,105366,105364,105361,105359,105356,105354,105351,105348,105346,105343,105341,105338,105335,105333,105330,105328,105325,105323,105320,105317,105315,105312,105310,105307,105304,105302,105299,105297,105294,105292,105289,105286,105284,105281,105279,105276,105273,105271,105268,105266,105263,105261,105258,105255,105253,105250,105248,105245,105243,105240,105237,105235,105232,105230,105227,105224,105222,105219,105217,105214,105212,105209,105206,105204,105201,105199,105196,105194,105191,105188,105186,105183,105181,105178,105176,105173,105170,105168,105165,105163,105160,105157,105155,105152,105150,105147,105145,105142,105139,105137,105134,105132,105129,105127,105124,105121,105119,105116,105114,105111,105109,105106,105103,105101,105098,105096,105093,105091,105088,105085,105083,105080,105078,105075,105073,105070,105067,105065,105062,105060,105057,105055,105052,105049,105047,105044,105042,105039,105037,105034,105031,105029,105026,105024,105021,105019,105016,105013,105011,105008,105006,105003,105001,104998,104996,104993,104990,104988,104985,104983,104980,104978,104975,104972,104970,104967,104965,104962,104960,104957,104954,104952,104949,104947,104944,104942,104939,104937,104934,104931,104929,104926,104924,104921,104919,104916,104913,104911,104908,104906,104903,104901,104898,104896,104893,104890,104888,104885,104883,104880,104878,104875,104872,104870,104867,104865,104862,104860,104857,104855,104852,104849,104847,104844,104842,104839,104837,104834,104832,104829,104826,104824,104821,104819,104816,104814,104811,104808,104806,104803,104801,104798,104796,104793,104791,104788,104785,104783,104780,104778,104775,104773,104770,104768,104765,104762,104760,104757,104755,104752,104750,104747,104745,104742,104739,104737,104734,104732,104729,104727,104724,104722,104719,104716,104714,104711,104709,104706,104704,104701,104699,104696,104694,104691,104688,104686,104683,104681,104678,104676,104673,104671,104668,104665,104663,104660,104658,104655,104653,104650,104648,104645,104643,104640,104637,104635,104632,104630,104627,104625,104622,104620,104617,104614,104612,104609,104607,104604,104602,104599,104597,104594,104592,104589,104586,104584,104581,104579,104576,104574,104571,104569,104566,104564,104561,104558,104556,104553,104551,104548,104546,104543,104541,104538,104536,104533,104530,104528,104525,104523,104520,104518,104515,104513,104510,104508,104505,104502,104500,104497,104495,104492,104490,104487,104485,104482,104480,104477,104475,104472,104469,104467,104464,104462,104459,104457,104454,104452,104449,104447,104444,104441,104439,104436,104434,104431,104429,104426,104424,104421,104419,104416,104414,104411,104408,104406,104403,104401,104398,104396,104393,104391,104388,104386,104383,104381,104378,104375,104373,104370,104368,104365,104363,104360,104358,104355,104353,104350,104348,104345,104343,104340,104337,104335,104332,104330,104327,104325,104322,104320,104317,104315,104312,104310,104307,104305,104302,104299,104297,104294,104292,104289,104287,104284,104282,104279,104277,104274,104272,104269,104267,104264,104261,104259,104256,104254,104251,104249,104246,104244,104241,104239,104236,104234,104231,104229,104226,104224,104221,104218,104216,104213,104211,104208,104206,104203,104201,104198,104196,104193,104191,104188,104186,104183,104181,104178,104175,104173,104170,104168,104165,104163,104160,104158,104155,104153,104150,104148,104145,104143,104140,104138,104135,104133,104130,104127,104125,104122,104120,104117,104115,104112,104110,104107,104105,104102,104100,104097,104095,104092,104090,104087,104085,104082,104080,104077,104075,104072,104069,104067,104064,104062,104059,104057,104054,104052,104049,104047,104044,104042,104039,104037,104034,104032,104029,104027,104024,104022,104019,104017,104014,104011,104009,104006,104004,104001,103999,103996,103994,103991,103989,103986,103984,103981,103979,103976,103974,103971,103969,103966,103964,103961,103959,103956,103954,103951,103949,103946,103944,103941,103939,103936,103933,103931,103928,103926,103923,103921,103918,103916,103913,103911,103908,103906,103903,103901,103898,103896,103893,103891,103888,103886,103883,103881,103878,103876,103873,103871,103868,103866,103863,103861,103858,103856,103853,103851,103848,103846,103843,103840,103838,103835,103833,103830,103828,103825,103823,103820,103818,103815,103813,103810,103808,103805,103803,103800,103798,103795,103793,103790,103788,103785,103783,103780,103778,103775,103773,103770,103768,103765,103763,103760,103758,103755,103753,103750,103748,103745,103743,103740,103738,103735,103733,103730,103728,103725,103723,103720,103718,103715,103713,103710,103708,103705,103703,103700,103698,103695,103693,103690,103688,103685,103683,103680,103678,103675,103673,103670,103668,103665,103663,103660,103658,103655,103653,103650,103648,103645,103643,103640,103638,103635,103633,103630,103628,103625,103623,103620,103618,103615,103613,103610,103608,103605,103603,103600,103598,103595,103593,103590,103588,103585,103583,103580,103578,103575,103573,103570,103568,103565,103563,103560,103558,103555,103553,103550,103548,103545,103543,103540,103538,103535,103533,103530,103528,103525,103523,103520,103518,103515,103513,103510,103508,103505,103503,103500,103498,103495,103493,103490,103488,103485,103483,103480,103478,103475,103473,103470,103468,103465,103463,103460,103458,103455,103453,103450,103448,103445,103443,103440,103438,103435,103433,103430,103428,103425,103423,103420,103418,103415,103413,103410,103408,103405,103403,103401,103398,103396,103393,103391,103388,103386,103383,103381,103378,103376,103373,103371,103368,103366,103363,103361,103358,103356,103353,103351,103348,103346,103343,103341,103338,103336,103333,103331,103328,103326,103323,103321,103318,103316,103313,103311,103308,103306,103304,103301,103299,103296,103294,103291,103289,103286,103284,103281,103279,103276,103274,103271,103269,103266,103264,103261,103259,103256,103254,103251,103249,103246,103244,103241,103239,103236,103234,103232,103229,103227,103224,103222,103219,103217,103214,103212,103209,103207,103204,103202,103199,103197,103194,103192,103189,103187,103184,103182,103179,103177,103174,103172,103170,103167,103165,103162,103160,103157,103155,103152,103150,103147,103145,103142,103140,103137,103135,103132,103130,103127,103125,103122,103120,103117,103115,103113,103110,103108,103105,103103,103100,103098,103095,103093,103090,103088,103085,103083,103080,103078,103075,103073,103070,103068,103066,103063,103061,103058,103056,103053,103051,103048,103046,103043,103041,103038,103036,103033,103031,103028,103026,103023,103021,103019,103016,103014,103011,103009,103006,103004,103001,102999,102996,102994,102991,102989,102986,102984,102982,102979,102977,102974,102972,102969,102967,102964,102962,102959,102957,102954,102952,102949,102947,102944,102942,102940,102937,102935,102932,102930,102927,102925,102922,102920,102917,102915,102912,102910,102907,102905,102903,102900,102898,102895,102893,102890,102888,102885,102883,102880,102878,102875,102873,102871,102868,102866,102863,102861,102858,102856,102853,102851,102848,102846,102843,102841,102838,102836,102834,102831,102829,102826,102824,102821,102819,102816,102814,102811,102809,102806,102804,102802,102799,102797,102794,102792,102789,102787,102784,102782,102779,102777,102775,102772,102770,102767,102765,102762,102760,102757,102755,102752,102750,102747,102745,102743,102740,102738,102735,102733,102730,102728,102725,102723,102720,102718,102716,102713,102711,102708,102706,102703,102701,102698,102696,102693,102691,102689,102686,102684,102681,102679,102676,102674,102671,102669,102666,102664,102662,102659,102657,102654,102652,102649,102647,102644,102642,102639,102637,102635,102632,102630,102627,102625,102622,102620,102617,102615,102612,102610,102608,102605,102603,102600,102598,102595,102593,102590,102588,102585,102583,102581,102578,102576,102573,102571,102568,102566,102563,102561,102559,102556,102554,102551,102549,102546,102544,102541,102539,102537,102534,102532,102529,102527,102524,102522,102519,102517,102514,102512,102510,102507,102505,102502,102500,102497,102495,102492,102490,102488,102485,102483,102480,102478,102475,102473,102470,102468,102466,102463,102461,102458,102456,102453,102451,102448,102446,102444,102441,102439,102436,102434,102431,102429,102426,102424,102422,102419,102417,102414,102412,102409,102407,102404,102402,102400,102397,102395,102392,102390,102387,102385,102383,102380,102378,102375,102373,102370,102368,102365,102363,102361,102358,102356,102353,102351,102348,102346,102343,102341,102339,102336,102334,102331,102329,102326,102324,102322,102319,102317,102314,102312,102309,102307,102304,102302,102300,102297,102295,102292,102290,102287,102285,102283,102280,102278,102275,102273,102270,102268,102265,102263,102261,102258,102256,102253,102251,102248,102246,102244,102241,102239,102236,102234,102231,102229,102227,102224,102222,102219,102217,102214,102212,102210,102207,102205,102202,102200,102197,102195,102193,102190,102188,102185,102183,102180,102178,102175,102173,102171,102168,102166,102163,102161,102158,102156,102154,102151,102149,102146,102144,102141,102139,102137,102134,102132,102129,102127,102124,102122,102120,102117,102115,102112,102110,102107,102105,102103,102100,102098,102095,102093,102090,102088,102086,102083,102081,102078,102076,102073,102071,102069,102066,102064,102061,102059,102057,102054,102052,102049,102047,102044,102042,102040,102037,102035,102032,102030,102027,102025,102023,102020,102018,102015,102013,102010,102008,102006,102003,102001,101998,101996,101994,101991,101989,101986,101984,101981,101979,101977,101974,101972,101969,101967,101964,101962,101960,101957,101955,101952,101950,101948,101945,101943,101940,101938,101935,101933,101931,101928,101926,101923,101921,101918,101916,101914,101911,101909,101906,101904,101902,101899,101897,101894,101892,101889,101887,101885,101882,101880,101877,101875,101873,101870,101868,101865,101863,101860,101858,101856,101853,101851,101848,101846,101844,101841,101839,101836,101834,101831,101829,101827,101824,101822,101819,101817,101815,101812,101810,101807,101805,101803,101800,101798,101795,101793,101790,101788,101786,101783,101781,101778,101776,101774,101771,101769,101766,101764,101762,101759,101757,101754,101752,101749,101747,101745,101742,101740,101737,101735,101733,101730,101728,101725,101723,101721,101718,101716,101713,101711,101708,101706,101704,101701,101699,101696,101694,101692,101689,101687,101684,101682,101680,101677,101675,101672,101670,101668,101665,101663,101660,101658,101656,101653,101651,101648,101646,101644,101641,101639,101636,101634,101631,101629,101627,101624,101622,101619,101617,101615,101612,101610,101607,101605,101603,101600,101598,101595,101593,101591,101588,101586,101583,101581,101579,101576,101574,101571,101569,101567,101564,101562,101559,101557,101555,101552,101550,101547,101545,101543,101540,101538,101535,101533,101531,101528,101526,101523,101521,101519,101516,101514,101511,101509,101507,101504,101502,101499,101497,101495,101492,101490,101487,101485,101483,101480,101478,101475,101473,101471,101468,101466,101463,101461,101459,101456,101454,101451,101449,101447,101444,101442,101439,101437,101435,101432,101430,101427,101425,101423,101420,101418,101415,101413,101411,101408,101406,101404,101401,101399,101396,101394,101392,101389,101387,101384,101382,101380,101377,101375,101372,101370,101368,101365,101363,101360,101358,101356,101353,101351,101348,101346,101344,101341,101339,101337,101334,101332,101329,101327,101325,101322,101320,101317,101315,101313,101310,101308,101305,101303,101301,101298,101296,101294,101291,101289,101286,101284,101282,101279,101277,101274,101272,101270,101267,101265,101262,101260,101258,101255,101253,101251,101248,101246,101243,101241,101239,101236,101234,101231,101229,101227,101224,101222,101220,101217,101215,101212,101210,101208,101205,101203,101200,101198,101196,101193,101191,101189,101186,101184,101181,101179,101177,101174,101172,101169,101167,101165,101162,101160,101158,101155,101153,101150,101148,101146,101143,101141,101138,101136,101134,101131,101129,101127,101124,101122,101119,101117,101115,101112,101110,101108,101105,101103,101100,101098,101096,101093,101091,101088,101086,101084,101081,101079,101077,101074,101072,101069,101067,101065,101062,101060,101058,101055,101053,101050,101048,101046,101043,101041,101039,101036,101034,101031,101029,101027,101024,101022,101020,101017,101015,101012,101010,101008,101005,101003,101001,100998,100996,100993,100991,100989,100986,100984,100982,100979,100977,100974,100972,100970,100967,100965,100963,100960,100958,100955,100953,100951,100948,100946,100944,100941,100939,100936,100934,100932,100929,100927,100925,100922,100920,100917,100915,100913,100910,100908,100906,100903,100901,100898,100896,100894,100891,100889,100887,100884,100882,100880,100877,100875,100872,100870,100868,100865,100863,100861,100858,100856,100853,100851,100849,100846,100844,100842,100839,100837,100835,100832,100830,100827,100825,100823,100820,100818,100816,100813,100811,100809,100806,100804,100801,100799,100797,100794,100792,100790,100787,100785,100782,100780,100778,100775,100773,100771,100768,100766,100764,100761,100759,100756,100754,100752,100749,100747,100745,100742,100740,100738,100735,100733,100730,100728,100726,100723,100721,100719,100716,100714,100712,100709,100707,100704,100702,100700,100697,100695,100693,100690,100688,100686,100683,100681,100679,100676,100674,100671,100669,100667,100664,100662,100660,100657,100655,100653,100650,100648,100646,100643,100641,100638,100636,100634,100631,100629,100627,100624,100622,100620,100617,100615,100612,100610,100608,100605,100603,100601,100598,100596,100594,100591,100589,100587,100584,100582,100580,100577,100575,100572,100570,100568,100565,100563,100561,100558,100556,100554,100551,100549,100547,100544,100542,100539,100537,100535,100532,100530,100528,100525,100523,100521,100518,100516,100514,100511,100509,100507,100504,100502,100499,100497,100495,100492,100490,100488,100485,100483,100481,100478,100476,100474,100471,100469,100467,100464,100462,100460,100457,100455,100452,100450,100448,100445,100443,100441,100438,100436,100434,100431,100429,100427,100424,100422,100420,100417,100415,100413,100410,100408,100406,100403,100401,100398,100396,100394,100391,100389,100387,100384,100382,100380,100377,100375,100373,100370,100368,100366,100363,100361,100359,100356,100354,100352,100349,100347,100345,100342,100340,100337,100335,100333,100330,100328,100326,100323,100321,100319,100316,100314,100312,100309,100307,100305,100302,100300,100298,100295,100293,100291,100288,100286,100284,100281,100279,100277,100274,100272,100270,100267,100265,100263,100260,100258,100256,100253,100251,100248,100246,100244,100241,100239,100237,100234,100232,100230,100227,100225,100223,100220,100218,100216,100213,100211,100209,100206,100204,100202,100199,100197,100195,100192,100190,100188,100185,100183,100181,100178,100176,100174,100171,100169,100167,100164,100162,100160,100157,100155,100153,100150,100148,100146,100143,100141,100139,100136,100134,100132,100129,100127,100125,100122,100120,100118,100115,100113,100111,100108,100106,100104,100101,100099,100097,100094,100092,100090,100087,100085,100083,100080,100078,100076,100073,100071,100069,100066,100064,100062,100059,100057,100055,100052,100050,100048,100045,100043,100041,100038,100036,100034,100031,100029,100027,100024,100022,100020,100017,100015,100013,100010,100008,100006,100003,100001,99999,99996,99994,99992,99989,99987,99985,99982,99980,99978,99975,99973,99971,99968,99966,99964,99962,99959,99957,99955,99952,99950,99948,99945,99943,99941,99938,99936,99934,99931,99929,99927,99924,99922,99920,99917,99915,99913,99910,99908,99906,99903,99901,99899,99896,99894,99892,99889,99887,99885,99882,99880,99878,99875,99873,99871,99869,99866,99864,99862,99859,99857,99855,99852,99850,99848,99845,99843,99841,99838,99836,99834,99831,99829,99827,99824,99822,99820,99817,99815,99813,99811,99808,99806,99804,99801,99799,99797,99794,99792,99790,99787,99785,99783,99780,99778,99776,99773,99771,99769,99766,99764,99762,99760,99757,99755,99753,99750,99748,99746,99743,99741,99739,99736,99734,99732,99729,99727,99725,99722,99720,99718,99715,99713,99711,99709,99706,99704,99702,99699,99697,99695,99692,99690,99688,99685,99683,99681,99678,99676,99674,99672,99669,99667,99665,99662,99660,99658,99655,99653,99651,99648,99646,99644,99641,99639,99637,99635,99632,99630,99628,99625,99623,99621,99618,99616,99614,99611,99609,99607,99604,99602,99600,99598,99595,99593,99591,99588,99586,99584,99581,99579,99577,99574,99572,99570,99568,99565,99563,99561,99558,99556,99554,99551,99549,99547,99544,99542,99540,99538,99535,99533,99531,99528,99526,99524,99521,99519,99517,99514,99512,99510,99508,99505,99503,99501,99498,99496,99494,99491,99489,99487,99485,99482,99480,99478,99475,99473,99471,99468,99466,99464,99461,99459,99457,99455,99452,99450,99448,99445,99443,99441,99438,99436,99434,99432,99429,99427,99425,99422,99420,99418,99415,99413,99411,99409,99406,99404,99402,99399,99397,99395,99392,99390,99388,99386,99383,99381,99379,99376,99374,99372,99369,99367,99365,99363,99360,99358,99356,99353,99351,99349,99346,99344,99342,99340,99337,99335,99333,99330,99328,99326,99323,99321,99319,99317,99314,99312,99310,99307,99305,99303,99301,99298,99296,99294,99291,99289,99287,99284,99282,99280,99278,99275,99273,99271,99268,99266,99264,99261,99259,99257,99255,99252,99250,99248,99245,99243,99241,99239,99236,99234,99232,99229,99227,99225,99223,99220,99218,99216,99213,99211,99209,99206,99204,99202,99200,99197,99195,99193,99190,99188,99186,99184,99181,99179,99177,99174,99172,99170,99168,99165,99163,99161,99158,99156,99154,99152,99149,99147,99145,99142,99140,99138,99135,99133,99131,99129,99126,99124,99122,99119,99117,99115,99113,99110,99108,99106,99103,99101,99099,99097,99094,99092,99090,99087,99085,99083,99081,99078,99076,99074,99071,99069,99067,99065,99062,99060,99058,99055,99053,99051,99049,99046,99044,99042,99039,99037,99035,99033,99030,99028,99026,99023,99021,99019,99017,99014,99012,99010,99008,99005,99003,99001,98998,98996,98994,98992,98989,98987,98985,98982,98980,98978,98976,98973,98971,98969,98966,98964,98962,98960,98957,98955,98953,98950,98948,98946,98944,98941,98939,98937,98935,98932,98930,98928,98925,98923,98921,98919,98916,98914,98912,98909,98907,98905,98903,98900,98898,98896,98894,98891,98889,98887,98884,98882,98880,98878,98875,98873,98871,98868,98866,98864,98862,98859,98857,98855,98853,98850,98848,98846,98843,98841,98839,98837,98834,98832,98830,98828,98825,98823,98821,98818,98816,98814,98812,98809,98807,98805,98803,98800,98798,98796,98793,98791,98789,98787,98784,98782,98780,98778,98775,98773,98771,98768,98766,98764,98762,98759,98757,98755,98753,98750,98748,98746,98743,98741,98739,98737,98734,98732,98730,98728,98725,98723,98721,98718,98716,98714,98712,98709,98707,98705,98703,98700,98698,98696,98694,98691,98689,98687,98684,98682,98680,98678,98675,98673,98671,98669,98666,98664,98662,98660,98657,98655,98653,98650,98648,98646,98644,98641,98639,98637,98635,98632,98630,98628,98626,98623,98621,98619,98616,98614,98612,98610,98607,98605,98603,98601,98598,98596,98594,98592,98589,98587,98585,98583,98580,98578,98576,98573,98571,98569,98567,98564,98562,98560,98558,98555,98553,98551,98549,98546,98544,98542,98540,98537,98535,98533,98531,98528,98526,98524,98521,98519,98517,98515,98512,98510,98508,98506,98503,98501,98499,98497,98494,98492,98490,98488,98485,98483,98481,98479,98476,98474,98472,98470,98467,98465,98463,98461,98458,98456,98454,98451,98449,98447,98445,98442,98440,98438,98436,98433,98431,98429,98427,98424,98422,98420,98418,98415,98413,98411,98409,98406,98404,98402,98400,98397,98395,98393,98391,98388,98386,98384,98382,98379,98377,98375,98373,98370,98368,98366,98364,98361,98359,98357,98355,98352,98350,98348,98346,98343,98341,98339,98337,98334,98332,98330,98328,98325,98323,98321,98319,98316,98314,98312,98310,98307,98305,98303,98301,98298,98296,98294,98292,98289,98287,98285,98283,98280,98278,98276,98274,98271,98269,98267,98265,98262,98260,98258,98256,98253,98251,98249,98247,98244,98242,98240,98238,98235,98233,98231,98229,98226,98224,98222,98220,98217,98215,98213,98211,98208,98206,98204,98202,98199,98197,98195,98193,98190,98188,98186,98184,98181,98179,98177,98175,98172,98170,98168,98166,98163,98161,98159,98157,98154,98152,98150,98148,98146,98143,98141,98139,98137,98134,98132,98130,98128,98125,98123,98121,98119,98116,98114,98112,98110,98107,98105,98103,98101,98098,98096,98094,98092,98089,98087,98085,98083,98081,98078,98076,98074,98072,98069,98067,98065,98063,98060,98058,98056,98054,98051,98049,98047,98045,98042,98040,98038,98036,98033,98031,98029,98027,98025,98022,98020,98018,98016,98013,98011,98009,98007,98004,98002,98000,97998,97995,97993,97991,97989,97987,97984,97982,97980,97978,97975,97973,97971,97969,97966,97964,97962,97960,97957,97955,97953,97951,97949,97946,97944,97942,97940,97937,97935,97933,97931,97928,97926,97924,97922,97920,97917,97915,97913,97911,97908,97906,97904,97902,97899,97897,97895,97893,97890,97888,97886,97884,97882,97879,97877,97875,97873,97870,97868,97866,97864,97862,97859,97857,97855,97853,97850,97848,97846,97844,97841,97839,97837,97835,97833,97830,97828,97826,97824,97821,97819,97817,97815,97812,97810,97808,97806,97804,97801,97799,97797,97795,97792,97790,97788,97786,97784,97781,97779,97777,97775,97772,97770,97768,97766,97763,97761,97759,97757,97755,97752,97750,97748,97746,97743,97741,97739,97737,97735,97732,97730,97728,97726,97723,97721,97719,97717,97715,97712,97710,97708,97706,97703,97701,97699,97697,97695,97692,97690,97688,97686,97683,97681,97679,97677,97675,97672,97670,97668,97666,97663,97661,97659,97657,97655,97652,97650,97648,97646,97643,97641,97639,97637,97635,97632,97630,97628,97626,97623,97621,97619,97617,97615,97612,97610,97608,97606,97604,97601,97599,97597,97595,97592,97590,97588,97586,97584,97581,97579,97577,97575,97572,97570,97568,97566,97564,97561,97559,97557,97555,97553,97550,97548,97546,97544,97541,97539,97537,97535,97533,97530,97528,97526,97524,97522,97519,97517,97515,97513,97510,97508,97506,97504,97502,97499,97497,97495,97493,97491,97488,97486,97484,97482,97479,97477,97475,97473,97471,97468,97466,97464,97462,97460,97457,97455,97453,97451,97449,97446,97444,97442,97440,97437,97435,97433,97431,97429,97426,97424,97422,97420,97418,97415,97413,97411,97409,97407,97404,97402,97400,97398,97395,97393,97391,97389,97387,97384,97382,97380,97378,97376,97373,97371,97369,97367,97365,97362,97360,97358,97356,97354,97351,97349,97347,97345,97342,97340,97338,97336,97334,97331,97329,97327,97325,97323,97320,97318,97316,97314,97312,97309,97307,97305,97303,97301,97298,97296,97294,97292,97290,97287,97285,97283,97281,97279,97276,97274,97272,97270,97268,97265,97263,97261,97259,97257,97254,97252,97250,97248,97246,97243,97241,97239,97237,97235,97232,97230,97228,97226,97224,97221,97219,97217,97215,97212,97210,97208,97206,97204,97201,97199,97197,97195,97193,97190,97188,97186,97184,97182,97180,97177,97175,97173,97171,97169,97166,97164,97162,97160,97158,97155,97153,97151,97149,97147,97144,97142,97140,97138,97136,97133,97131,97129,97127,97125,97122,97120,97118,97116,97114,97111,97109,97107,97105,97103,97100,97098,97096,97094,97092,97089,97087,97085,97083,97081,97078,97076,97074,97072,97070,97067,97065,97063,97061,97059,97057,97054,97052,97050,97048,97046,97043,97041,97039,97037,97035,97032,97030,97028,97026,97024,97021,97019,97017,97015,97013,97010,97008,97006,97004,97002,97000,96997,96995,96993,96991,96989,96986,96984,96982,96980,96978,96975,96973,96971,96969,96967,96964,96962,96960,96958,96956,96954,96951,96949,96947,96945,96943,96940,96938,96936,96934,96932,96929,96927,96925,96923,96921,96919,96916,96914,96912,96910,96908,96905,96903,96901,96899,96897,96894,96892,96890,96888,96886,96884,96881,96879,96877,96875,96873,96870,96868,96866,96864,96862,96860,96857,96855,96853,96851,96849,96846,96844,96842,96840,96838,96836,96833,96831,96829,96827,96825,96822,96820,96818,96816,96814,96811,96809,96807,96805,96803,96801,96798,96796,96794,96792,96790,96787,96785,96783,96781,96779,96777,96774,96772,96770,96768,96766,96764,96761,96759,96757,96755,96753,96750,96748,96746,96744,96742,96740,96737,96735,96733,96731,96729,96726,96724,96722,96720,96718,96716,96713,96711,96709,96707,96705,96703,96700,96698,96696,96694,96692,96689,96687,96685,96683,96681,96679,96676,96674,96672,96670,96668,96666,96663,96661,96659,96657,96655,96652,96650,96648,96646,96644,96642,96639,96637,96635,96633,96631,96629,96626,96624,96622,96620,96618,96615,96613,96611,96609,96607,96605,96602,96600,96598,96596,96594,96592,96589,96587,96585,96583,96581,96579,96576,96574,96572,96570,96568,96566,96563,96561,96559,96557,96555,96553,96550,96548,96546,96544,96542,96539,96537,96535,96533,96531,96529,96526,96524,96522,96520,96518,96516,96513,96511,96509,96507,96505,96503,96500,96498,96496,96494,96492,96490,96487,96485,96483,96481,96479,96477,96474,96472,96470,96468,96466,96464,96461,96459,96457,96455,96453,96451,96448,96446,96444,96442,96440,96438,96435,96433,96431,96429,96427,96425,96422,96420,96418,96416,96414,96412,96409,96407,96405,96403,96401,96399,96396,96394,96392,96390,96388,96386,96384,96381,96379,96377,96375,96373,96371,96368,96366,96364,96362,96360,96358,96355,96353,96351,96349,96347,96345,96342,96340,96338,96336,96334,96332,96329,96327,96325,96323,96321,96319,96316,96314,96312,96310,96308,96306,96304,96301,96299,96297,96295,96293,96291,96288,96286,96284,96282,96280,96278,96275,96273,96271,96269,96267,96265,96263,96260,96258,96256,96254,96252,96250,96247,96245,96243,96241,96239,96237,96234,96232,96230,96228,96226,96224,96222,96219,96217,96215,96213,96211,96209,96206,96204,96202,96200,96198,96196,96194,96191,96189,96187,96185,96183,96181,96178,96176,96174,96172,96170,96168,96166,96163,96161,96159,96157,96155,96153,96150,96148,96146,96144,96142,96140,96138,96135,96133,96131,96129,96127,96125,96122,96120,96118,96116,96114,96112,96110,96107,96105,96103,96101,96099,96097,96095,96092,96090,96088,96086,96084,96082,96079,96077,96075,96073,96071,96069,96067,96064,96062,96060,96058,96056,96054,96052,96049,96047,96045,96043,96041,96039,96037,96034,96032,96030,96028,96026,96024,96021,96019,96017,96015,96013,96011,96009,96006,96004,96002,96000,95998,95996,95994,95991,95989,95987,95985,95983,95981,95979,95976,95974,95972,95970,95968,95966,95964,95961,95959,95957,95955,95953,95951,95949,95946,95944,95942,95940,95938,95936,95934,95931,95929,95927,95925,95923,95921,95919,95916,95914,95912,95910,95908,95906,95904,95901,95899,95897,95895,95893,95891,95889,95886,95884,95882,95880,95878,95876,95874,95871,95869,95867,95865,95863,95861,95859,95856,95854,95852,95850,95848,95846,95844,95841,95839,95837,95835,95833,95831,95829,95827,95824,95822,95820,95818,95816,95814,95812,95809,95807,95805,95803,95801,95799,95797,95794,95792,95790,95788,95786,95784,95782,95780,95777,95775,95773,95771,95769,95767,95765,95762,95760,95758,95756,95754,95752,95750,95747,95745,95743,95741,95739,95737,95735,95733,95730,95728,95726,95724,95722,95720,95718,95715,95713,95711,95709,95707,95705,95703,95701,95698,95696,95694,95692,95690,95688,95686,95683,95681,95679,95677,95675,95673,95671,95669,95666,95664,95662,95660,95658,95656,95654,95652,95649,95647,95645,95643,95641,95639,95637,95634,95632,95630,95628,95626,95624,95622,95620,95617,95615,95613,95611,95609,95607,95605,95603,95600,95598,95596,95594,95592,95590,95588,95586,95583,95581,95579,95577,95575,95573,95571,95569,95566,95564,95562,95560,95558,95556,95554,95552,95549,95547,95545,95543,95541,95539,95537,95535,95532,95530,95528,95526,95524,95522,95520,95518,95515,95513,95511,95509,95507,95505,95503,95501,95498,95496,95494,95492,95490,95488,95486,95484,95481,95479,95477,95475,95473,95471,95469,95467,95464,95462,95460,95458,95456,95454,95452,95450,95447,95445,95443,95441,95439,95437,95435,95433,95430,95428,95426,95424,95422,95420,95418,95416,95414,95411,95409,95407,95405,95403,95401,95399,95397,95394,95392,95390,95388,95386,95384,95382,95380,95378,95375,95373,95371,95369,95367,95365,95363,95361,95358,95356,95354,95352,95350,95348,95346,95344,95342,95339,95337,95335,95333,95331,95329,95327,95325,95322,95320,95318,95316,95314,95312,95310,95308,95306,95303,95301,95299,95297,95295,95293,95291,95289,95287,95284,95282,95280,95278,95276,95274,95272,95270,95268,95265,95263,95261,95259,95257,95255,95253,95251,95248,95246,95244,95242,95240,95238,95236,95234,95232,95229,95227,95225,95223,95221,95219,95217,95215,95213,95210,95208,95206,95204,95202,95200,95198,95196,95194,95191,95189,95187,95185,95183,95181,95179,95177,95175,95173,95170,95168,95166,95164,95162,95160,95158,95156,95154,95151,95149,95147,95145,95143,95141,95139,95137,95135,95132,95130,95128,95126,95124,95122,95120,95118,95116,95113,95111,95109,95107,95105,95103,95101,95099,95097,95095,95092,95090,95088,95086,95084,95082,95080,95078,95076,95073,95071,95069,95067,95065,95063,95061,95059,95057,95055,95052,95050,95048,95046,95044,95042,95040,95038,95036,95034,95031,95029,95027,95025,95023,95021,95019,95017,95015,95012,95010,95008,95006,95004,95002,95000,94998,94996,94994,94991,94989,94987,94985,94983,94981,94979,94977,94975,94973,94970,94968,94966,94964,94962,94960,94958,94956,94954,94952,94949,94947,94945,94943,94941,94939,94937,94935,94933,94931,94928,94926,94924,94922,94920,94918,94916,94914,94912,94910,94908,94905,94903,94901,94899,94897,94895,94893,94891,94889,94887,94884,94882,94880,94878,94876,94874,94872,94870,94868,94866,94863,94861,94859,94857,94855,94853,94851,94849,94847,94845,94843,94840,94838,94836,94834,94832,94830,94828,94826,94824,94822,94820,94817,94815,94813,94811,94809,94807,94805,94803,94801,94799,94796,94794,94792,94790,94788,94786,94784,94782,94780,94778,94776,94773,94771,94769,94767,94765,94763,94761,94759,94757,94755,94753,94750,94748,94746,94744,94742,94740,94738,94736,94734,94732,94730,94727,94725,94723,94721,94719,94717,94715,94713,94711,94709,94707,94705,94702,94700,94698,94696,94694,94692,94690,94688,94686,94684,94682,94679,94677,94675,94673,94671,94669,94667,94665,94663,94661,94659,94657,94654,94652,94650,94648,94646,94644,94642,94640,94638,94636,94634,94631,94629,94627,94625,94623,94621,94619,94617,94615,94613,94611,94609,94606,94604,94602,94600,94598,94596,94594,94592,94590,94588,94586,94584,94581,94579,94577,94575,94573,94571,94569,94567,94565,94563,94561,94559,94556,94554,94552,94550,94548,94546,94544,94542,94540,94538,94536,94534,94532,94529,94527,94525,94523,94521,94519,94517,94515,94513,94511,94509,94507,94504,94502,94500,94498,94496,94494,94492,94490,94488,94486,94484,94482,94480,94477,94475,94473,94471,94469,94467,94465,94463,94461,94459,94457,94455,94453,94450,94448,94446,94444,94442,94440,94438,94436,94434,94432,94430,94428,94426,94423,94421,94419,94417,94415,94413,94411,94409,94407,94405,94403,94401,94399,94396,94394,94392,94390,94388,94386,94384,94382,94380,94378,94376,94374,94372,94370,94367,94365,94363,94361,94359,94357,94355,94353,94351,94349,94347,94345,94343,94340,94338,94336,94334,94332,94330,94328,94326,94324,94322,94320,94318,94316,94314,94311,94309,94307,94305,94303,94301,94299,94297,94295,94293,94291,94289,94287,94285,94282,94280,94278,94276,94274,94272,94270,94268,94266,94264,94262,94260,94258,94256,94254,94251,94249,94247,94245,94243,94241,94239,94237,94235,94233,94231,94229,94227,94225,94223,94220,94218,94216,94214,94212,94210,94208,94206,94204,94202,94200,94198,94196,94194,94192,94189,94187,94185,94183,94181,94179,94177,94175,94173,94171,94169,94167,94165,94163,94161,94158,94156,94154,94152,94150,94148,94146,94144,94142,94140,94138,94136,94134,94132,94130,94128,94125,94123,94121,94119,94117,94115,94113,94111,94109,94107,94105,94103,94101,94099,94097,94095,94092,94090,94088,94086,94084,94082,94080,94078,94076,94074,94072,94070,94068,94066,94064,94062,94059,94057,94055,94053,94051,94049,94047,94045,94043,94041,94039,94037,94035,94033,94031,94029,94027,94024,94022,94020,94018,94016,94014,94012,94010,94008,94006,94004,94002,94000,93998,93996,93994,93992,93990,93987,93985,93983,93981,93979,93977,93975,93973,93971,93969,93967,93965,93963,93961,93959,93957,93955,93953,93950,93948,93946,93944,93942,93940,93938,93936,93934,93932,93930,93928,93926,93924,93922,93920,93918,93916,93913,93911,93909,93907,93905,93903,93901,93899,93897,93895,93893,93891,93889,93887,93885,93883,93881,93879,93877,93874,93872,93870,93868,93866,93864,93862,93860,93858,93856,93854,93852,93850,93848,93846,93844,93842,93840,93838,93835,93833,93831,93829,93827,93825,93823,93821,93819,93817,93815,93813,93811,93809,93807,93805,93803,93801,93799,93797,93795,93792,93790,93788,93786,93784,93782,93780,93778,93776,93774,93772,93770,93768,93766,93764,93762,93760,93758,93756,93754,93752,93749,93747,93745,93743,93741,93739,93737,93735,93733,93731,93729,93727,93725,93723,93721,93719,93717,93715,93713,93711,93709,93707,93704,93702,93700,93698,93696,93694,93692,93690,93688,93686,93684,93682,93680,93678,93676,93674,93672,93670,93668,93666,93664,93662,93660,93657,93655,93653,93651,93649,93647,93645,93643,93641,93639,93637,93635,93633,93631,93629,93627,93625,93623,93621,93619,93617,93615,93613,93611,93608,93606,93604,93602,93600,93598,93596,93594,93592,93590,93588,93586,93584,93582,93580,93578,93576,93574,93572,93570,93568,93566,93564,93562,93560,93558,93555,93553,93551,93549,93547,93545,93543,93541,93539,93537,93535,93533,93531,93529,93527,93525,93523,93521,93519,93517,93515,93513,93511,93509,93507,93505,93503,93500,93498,93496,93494,93492,93490,93488,93486,93484,93482,93480,93478,93476,93474,93472,93470,93468,93466,93464,93462,93460,93458,93456,93454,93452,93450,93448,93446,93444,93441,93439,93437,93435,93433,93431,93429,93427,93425,93423,93421,93419,93417,93415,93413,93411,93409,93407,93405,93403,93401,93399,93397,93395,93393,93391,93389,93387,93385,93383,93381,93379,93376,93374,93372,93370,93368,93366,93364,93362,93360,93358,93356,93354,93352,93350,93348,93346,93344,93342,93340,93338,93336,93334,93332,93330,93328,93326,93324,93322,93320,93318,93316,93314,93312,93310,93308,93305,93303,93301,93299,93297,93295,93293,93291,93289,93287,93285,93283,93281,93279,93277,93275,93273,93271,93269,93267,93265,93263,93261,93259,93257,93255,93253,93251,93249,93247,93245,93243,93241,93239,93237,93235,93233,93231,93229,93226,93224,93222,93220,93218,93216,93214,93212,93210,93208,93206,93204,93202,93200,93198,93196,93194,93192,93190,93188,93186,93184,93182,93180,93178,93176,93174,93172,93170,93168,93166,93164,93162,93160,93158,93156,93154,93152,93150,93148,93146,93144,93142,93140,93138,93136,93133,93131,93129,93127,93125,93123,93121,93119,93117,93115,93113,93111,93109,93107,93105,93103,93101,93099,93097,93095,93093,93091,93089,93087,93085,93083,93081,93079,93077,93075,93073,93071,93069,93067,93065,93063,93061,93059,93057,93055,93053,93051,93049,93047,93045,93043,93041,93039,93037,93035,93033,93031,93029,93027,93025,93023,93021,93019,93017,93014,93012,93010,93008,93006,93004,93002,93000,92998,92996,92994,92992,92990,92988,92986,92984,92982,92980,92978,92976,92974,92972,92970,92968,92966,92964,92962,92960,92958,92956,92954,92952,92950,92948,92946,92944,92942,92940,92938,92936,92934,92932,92930,92928,92926,92924,92922,92920,92918,92916,92914,92912,92910,92908,92906,92904,92902,92900,92898,92896,92894,92892,92890,92888,92886,92884,92882,92880,92878,92876,92874,92872,92870,92868,92866,92864,92862,92860,92858,92856,92854,92852,92850,92848,92846,92844,92842,92840,92838,92836,92834,92832,92830,92828,92826,92824,92822,92820,92818,92815,92813,92811,92809,92807,92805,92803,92801,92799,92797,92795,92793,92791,92789,92787,92785,92783,92781,92779,92777,92775,92773,92771,92769,92767,92765,92763,92761,92759,92757,92755,92753,92751,92749,92747,92745,92743,92741,92739,92737,92735,92733,92731,92729,92727,92725,92723,92721,92719,92717,92715,92713,92711,92709,92707,92705,92703,92701,92699,92697,92695,92693,92691,92689,92687,92685,92683,92681,92679,92677,92675,92673,92671,92669,92667,92665,92663,92661,92659,92657,92655,92653,92651,92649,92647,92645,92643,92641,92639,92637,92635,92633,92631,92629,92627,92625,92623,92621,92619,92617,92615,92613,92611,92609,92607,92605,92603,92601,92599,92597,92595,92593,92591,92589,92587,92585,92583,92581,92579,92577,92575,92573,92571,92569,92567,92565,92563,92561,92559,92557,92555,92553,92551,92549,92547,92546,92544,92542,92540,92538,92536,92534,92532,92530,92528,92526,92524,92522,92520,92518,92516,92514,92512,92510,92508,92506,92504,92502,92500,92498,92496,92494,92492,92490,92488,92486,92484,92482,92480,92478,92476,92474,92472,92470,92468,92466,92464,92462,92460,92458,92456,92454,92452,92450,92448,92446,92444,92442,92440,92438,92436,92434,92432,92430,92428,92426,92424,92422,92420,92418,92416,92414,92412,92410,92408,92406,92404,92402,92400,92398,92396,92394,92392,92390,92388,92386,92384,92382,92380,92378,92376,92374,92372,92370,92368,92366,92364,92362,92360,92358,92356,92354,92352,92350,92349,92347,92345,92343,92341,92339,92337,92335,92333,92331,92329,92327,92325,92323,92321,92319,92317,92315,92313,92311,92309,92307,92305,92303,92301,92299,92297,92295,92293,92291,92289,92287,92285,92283,92281,92279,92277,92275,92273,92271,92269,92267,92265,92263,92261,92259,92257,92255,92253,92251,92249,92247,92245,92243,92241,92239,92237,92235,92233,92231,92230,92228,92226,92224,92222,92220,92218,92216,92214,92212,92210,92208,92206,92204,92202,92200,92198,92196,92194,92192,92190,92188,92186,92184,92182,92180,92178,92176,92174,92172,92170,92168,92166,92164,92162,92160,92158,92156,92154,92152,92150,92148,92146,92144,92142,92140,92139,92137,92135,92133,92131,92129,92127,92125,92123,92121,92119,92117,92115,92113,92111,92109,92107,92105,92103,92101,92099,92097,92095,92093,92091,92089,92087,92085,92083,92081,92079,92077,92075,92073,92071,92069,92067,92065,92063,92061,92060,92058,92056,92054,92052,92050,92048,92046,92044,92042,92040,92038,92036,92034,92032,92030,92028,92026,92024,92022,92020,92018,92016,92014,92012,92010,92008,92006,92004,92002,92000,91998,91996,91994,91992,91990,91989,91987,91985,91983,91981,91979,91977,91975,91973,91971,91969,91967,91965,91963,91961,91959,91957,91955,91953,91951,91949,91947,91945,91943,91941,91939,91937,91935,91933,91931,91929,91927,91926,91924,91922,91920,91918,91916,91914,91912,91910,91908,91906,91904,91902,91900,91898,91896,91894,91892,91890,91888,91886,91884,91882,91880,91878,91876,91874,91872,91870,91868,91867,91865,91863,91861,91859,91857,91855,91853,91851,91849,91847,91845,91843,91841,91839,91837,91835,91833,91831,91829,91827,91825,91823,91821,91819,91817,91815,91814,91812,91810,91808,91806,91804,91802,91800,91798,91796,91794,91792,91790,91788,91786,91784,91782,91780,91778,91776,91774,91772,91770,91768,91766,91764,91763,91761,91759,91757,91755,91753,91751,91749,91747,91745,91743,91741,91739,91737,91735,91733,91731,91729,91727,91725,91723,91721,91719,91717,91715,91714,91712,91710,91708,91706,91704,91702,91700,91698,91696,91694,91692,91690,91688,91686,91684,91682,91680,91678,91676,91674,91672,91670,91668,91667,91665,91663,91661,91659,91657,91655,91653,91651,91649,91647,91645,91643,91641,91639,91637,91635,91633,91631,91629,91627,91625,91624,91622,91620,91618,91616,91614,91612,91610,91608,91606,91604,91602,91600,91598,91596,91594,91592,91590,91588,91586,91584,91582,91581,91579,91577,91575,91573,91571,91569,91567,91565,91563,91561,91559,91557,91555,91553,91551,91549,91547,91545,91543,91541,91540,91538,91536,91534,91532,91530,91528,91526,91524,91522,91520,91518,91516,91514,91512,91510,91508,91506,91504,91502,91501,91499,91497,91495,91493,91491,91489,91487,91485,91483,91481,91479,91477,91475,91473,91471,91469,91467,91465,91464,91462,91460,91458,91456,91454,91452,91450,91448,91446,91444,91442,91440,91438,91436,91434,91432,91430,91428,91427,91425,91423,91421,91419,91417,91415,91413,91411,91409,91407,91405,91403,91401,91399,91397,91395,91393,91392,91390,91388,91386,91384,91382,91380,91378,91376,91374,91372,91370,91368,91366,91364,91362,91360,91358,91357,91355,91353,91351,91349,91347,91345,91343,91341,91339,91337,91335,91333,91331,91329,91327,91325,91323,91322,91320,91318,91316,91314,91312,91310,91308,91306,91304,91302,91300,91298,91296,91294,91292,91290,91289,91287,91285,91283,91281,91279,91277,91275,91273,91271,91269,91267,91265,91263,91261,91259,91258,91256,91254,91252,91250,91248,91246,91244,91242,91240,91238,91236,91234,91232,91230,91228,91227,91225,91223,91221,91219,91217,91215,91213,91211,91209,91207,91205,91203,91201,91199,91197,91196,91194,91192,91190,91188,91186,91184,91182,91180,91178,91176,91174,91172,91170,91168,91166,91165,91163,91161,91159,91157,91155,91153,91151,91149,91147,91145,91143,91141,91139,91137,91136,91134,91132,91130,91128,91126,91124,91122,91120,91118,91116,91114,91112,91110,91108,91107,91105,91103,91101,91099,91097,91095,91093,91091,91089,91087,91085,91083,91081,91079,91078,91076,91074,91072,91070,91068,91066,91064,91062,91060,91058,91056,91054,91052,91051,91049,91047,91045,91043,91041,91039,91037,91035,91033,91031,91029,91027,91025,91024,91022,91020,91018,91016,91014,91012,91010,91008,91006,91004,91002,91000,90998,90997,90995,90993,90991,90989,90987,90985,90983,90981,90979,90977,90975,90973,90971,90970,90968,90966,90964,90962,90960,90958,90956,90954,90952,90950,90948,90946,90944,90943,90941,90939,90937,90935,90933,90931,90929,90927,90925,90923,90921,90919,90918,90916,90914,90912,90910,90908,90906,90904,90902,90900,90898,90896,90894,90893,90891,90889,90887,90885,90883,90881,90879,90877,90875,90873,90871,90869,90868,90866,90864,90862,90860,90858,90856,90854,90852,90850,90848,90846,90844,90843,90841,90839,90837,90835,90833,90831,90829,90827,90825,90823,90821,90819,90818,90816,90814,90812,90810,90808,90806,90804,90802,90800,90798,90796,90795,90793,90791,90789,90787,90785,90783,90781,90779,90777,90775,90773,90771,90770,90768,90766,90764,90762,90760,90758,90756,90754,90752,90750,90748,90747,90745,90743,90741,90739,90737,90735,90733,90731,90729,90727,90725,90724,90722,90720,90718,90716,90714,90712,90710,90708,90706,90704,90702,90701,90699,90697,90695,90693,90691,90689,90687,90685,90683,90681,90679,90678,90676,90674,90672,90670,90668,90666,90664,90662,90660,90658,90657,90655,90653,90651,90649,90647,90645,90643,90641,90639,90637,90635,90634,90632,90630,90628,90626,90624,90622,90620,90618,90616,90614,90613,90611,90609,90607,90605,90603,90601,90599,90597,90595,90593,90592,90590,90588,90586,90584,90582,90580,90578,90576,90574,90572,90571,90569,90567,90565,90563,90561,90559,90557,90555,90553,90551,90549,90548,90546,90544,90542,90540,90538,90536,90534,90532,90530,90529,90527,90525,90523,90521,90519,90517,90515,90513,90511,90509,90508,90506,90504,90502,90500,90498,90496,90494,90492,90490,90488,90487,90485,90483,90481,90479,90477,90475,90473,90471,90469,90467,90466,90464,90462,90460,90458,90456,90454,90452,90450,90448,90447,90445,90443,90441,90439,90437,90435,90433,90431,90429,90427,90426,90424,90422,90420,90418,90416,90414,90412,90410,90408,90407,90405,90403,90401,90399,90397,90395,90393,90391,90389,90388,90386,90384,90382,90380,90378,90376,90374,90372,90370,90369,90367,90365,90363,90361,90359,90357,90355,90353,90351,90349,90348,90346,90344,90342,90340,90338,90336,90334,90332,90330,90329,90327,90325,90323,90321,90319,90317,90315,90313,90311,90310,90308,90306,90304,90302,90300,90298,90296,90294,90293,90291,90289,90287,90285,90283,90281,90279,90277,90275,90274,90272,90270,90268,90266,90264,90262,90260,90258,90256,90255,90253,90251,90249,90247,90245,90243,90241,90239,90237,90236,90234,90232,90230,90228,90226,90224,90222,90220,90219,90217,90215,90213,90211,90209,90207,90205,90203,90201,90200,90198,90196,90194,90192,90190,90188,90186,90184,90183,90181,90179,90177,90175,90173,90171,90169,90167,90166,90164,90162,90160,90158,90156,90154,90152,90150,90148,90147,90145,90143,90141,90139,90137,90135,90133,90131,90130,90128,90126,90124,90122,90120,90118,90116,90114,90113,90111,90109,90107,90105,90103,90101,90099,90097,90096,90094,90092,90090,90088,90086,90084,90082,90080,90079,90077,90075,90073,90071,90069,90067,90065,90063,90062,90060,90058,90056,90054,90052,90050,90048,90046,90045,90043,90041,90039,90037,90035,90033,90031,90029,90028,90026,90024,90022,90020,90018,90016,90014,90012,90011,90009,90007,90005,90003,90001,89999,89997,89995,89994,89992,89990,89988,89986,89984,89982,89980,89978,89977,89975,89973,89971,89969,89967,89965,89963,89962,89960,89958,89956,89954,89952,89950,89948,89946,89945,89943,89941,89939,89937,89935,89933,89931,89930,89928,89926,89924,89922,89920,89918,89916,89914,89913,89911,89909,89907,89905,89903,89901,89899,89898,89896,89894,89892,89890,89888,89886,89884,89882,89881,89879,89877,89875,89873,89871,89869,89867,89866,89864,89862,89860,89858,89856,89854,89852,89850,89849,89847,89845,89843,89841,89839,89837,89835,89834,89832,89830,89828,89826,89824,89822,89820,89819,89817,89815,89813,89811,89809,89807,89805,89804,89802,89800,89798,89796,89794,89792,89790,89789,89787,89785,89783,89781,89779,89777,89775,89773,89772,89770,89768,89766,89764,89762,89760,89758,89757,89755,89753,89751,89749,89747,89745,89743,89742,89740,89738,89736,89734,89732,89730,89728,89727,89725,89723,89721,89719,89717,89715,89713,89712,89710,89708,89706,89704,89702,89700,89698,89697,89695,89693,89691,89689,89687,89685,89684,89682,89680,89678,89676,89674,89672,89670,89669,89667,89665,89663,89661,89659,89657,89655,89654,89652,89650,89648,89646,89644,89642,89640,89639,89637,89635,89633,89631,89629,89627,89625,89624,89622,89620,89618,89616,89614,89612,89611,89609,89607,89605,89603,89601,89599,89597,89596,89594,89592,89590,89588,89586,89584,89583,89581,89579,89577,89575,89573,89571,89569,89568,89566,89564,89562,89560,89558,89556,89554,89553,89551,89549,89547,89545,89543,89541,89540,89538,89536,89534,89532,89530,89528,89526,89525,89523,89521,89519,89517,89515,89513,89512,89510,89508,89506,89504,89502,89500,89498,89497,89495,89493,89491,89489,89487,89485,89484,89482,89480,89478,89476,89474,89472,89471,89469,89467,89465,89463,89461,89459,89457,89456,89454,89452,89450,89448,89446,89444,89443,89441,89439,89437,89435,89433,89431,89430,89428,89426,89424,89422,89420,89418,89417,89415,89413,89411,89409,89407,89405,89403,89402,89400,89398,89396,89394,89392,89390,89389,89387,89385,89383,89381,89379,89377,89376,89374,89372,89370,89368,89366,89364,89363,89361,89359,89357,89355,89353,89351,89350,89348,89346,89344,89342,89340,89338,89337,89335,89333,89331,89329,89327,89325,89324,89322,89320,89318,89316,89314,89312,89311,89309,89307,89305,89303,89301,89299,89298,89296,89294,89292,89290,89288,89286,89285,89283,89281,89279,89277,89275,89273,89272,89270,89268,89266,89264,89262,89260,89259,89257,89255,89253,89251,89249,89247,89246,89244,89242,89240,89238,89236,89234,89233,89231,89229,89227,89225,89223,89221,89220,89218,89216,89214,89212,89210,89209,89207,89205,89203,89201,89199,89197,89196,89194,89192,89190,89188,89186,89184,89183,89181,89179,89177,89175,89173,89171,89170,89168,89166,89164,89162,89160,89159,89157,89155,89153,89151,89149,89147,89146,89144,89142,89140,89138,89136,89134,89133,89131,89129,89127,89125,89123,89122,89120,89118,89116,89114,89112,89110,89109,89107,89105,89103,89101,89099,89097,89096,89094,89092,89090,89088,89086,89085,89083,89081,89079,89077,89075,89073,89072,89070,89068,89066,89064,89062,89061,89059,89057,89055,89053,89051,89049,89048,89046,89044,89042,89040,89038,89037,89035,89033,89031,89029,89027,89025,89024,89022,89020,89018,89016,89014,89013,89011,89009,89007,89005,89003,89001,89000,88998,88996,88994,88992,88990,88989,88987,88985,88983,88981,88979,88977,88976,88974,88972,88970,88968,88966,88965,88963,88961,88959,88957,88955,88954,88952,88950,88948,88946,88944,88942,88941,88939,88937,88935,88933,88931,88930,88928,88926,88924,88922,88920,88919,88917,88915,88913,88911,88909,88907,88906,88904,88902,88900,88898,88896,88895,88893,88891,88889,88887,88885,88884,88882,88880,88878,88876,88874,88873,88871,88869,88867,88865,88863,88862,88860,88858,88856,88854,88852,88850,88849,88847,88845,88843,88841,88839,88838,88836,88834,88832,88830,88828,88827,88825,88823,88821,88819,88817,88816,88814,88812,88810,88808,88806,88805,88803,88801,88799,88797,88795,88794,88792,88790,88788,88786,88784,88783,88781,88779,88777,88775,88773,88772,88770,88768,88766,88764,88762,88761,88759,88757,88755,88753,88751,88749,88748,88746,88744,88742,88740,88738,88737,88735,88733,88731,88729,88727,88726,88724,88722,88720,88718,88717,88715,88713,88711,88709,88707,88706,88704,88702,88700,88698,88696,88695,88693,88691,88689,88687,88685,88684,88682,88680,88678,88676,88674,88673,88671,88669,88667,88665,88663,88662,88660,88658,88656,88654,88652,88651,88649,88647,88645,88643,88641,88640,88638,88636,88634,88632,88630,88629,88627,88625,88623,88621,88619,88618,88616,88614,88612,88610,88609,88607,88605,88603,88601,88599,88598,88596,88594,88592,88590,88588,88587,88585,88583,88581,88579,88577,88576,88574,88572,88570,88568,88566,88565,88563,88561,88559,88557,88556,88554,88552,88550,88548,88546,88545,88543,88541,88539,88537,88535,88534,88532,88530,88528,88526,88525,88523,88521,88519,88517,88515,88514,88512,88510,88508,88506,88504,88503,88501,88499,88497,88495,88493,88492,88490,88488,88486,88484,88483,88481,88479,88477,88475,88473,88472,88470,88468,88466,88464,88463,88461,88459,88457,88455,88453,88452,88450,88448,88446,88444,88442,88441,88439,88437,88435,88433,88432,88430,88428,88426,88424,88422,88421,88419,88417,88415,88413,88412,88410,88408,88406,88404,88402,88401,88399,88397,88395,88393,88392,88390,88388,88386,88384,88382,88381,88379,88377,88375,88373,88371,88370,88368,88366,88364,88362,88361,88359,88357,88355,88353,88352,88350,88348,88346,88344,88342,88341,88339,88337,88335,88333,88332,88330,88328,88326,88324,88322,88321,88319,88317,88315,88313,88312,88310,88308,88306,88304,88302,88301,88299,88297,88295,88293,88292,88290,88288,88286,88284,88282,88281,88279,88277,88275,88273,88272,88270,88268,88266,88264,88263,88261,88259,88257,88255,88253,88252,88250,88248,88246,88244,88243,88241,88239,88237,88235,88234,88232,88230,88228,88226,88224,88223,88221,88219,88217,88215,88214,88212,88210,88208,88206,88205,88203,88201,88199,88197,88195,88194,88192,88190,88188,88186,88185,88183,88181,88179,88177,88176,88174,88172,88170,88168,88167,88165,88163,88161,88159,88157,88156,88154,88152,88150,88148,88147,88145,88143,88141,88139,88138,88136,88134,88132,88130,88129,88127,88125,88123,88121,88119,88118,88116,88114,88112,88110,88109,88107,88105,88103,88101,88100,88098,88096,88094,88092,88091,88089,88087,88085,88083,88082,88080,88078,88076,88074,88072,88071,88069,88067,88065,88063,88062,88060,88058,88056,88054,88053,88051,88049,88047,88045,88044,88042,88040,88038,88036,88035,88033,88031,88029,88027,88026,88024,88022,88020,88018,88017,88015,88013,88011,88009,88008,88006,88004,88002,88000,87999,87997,87995,87993,87991,87989,87988,87986,87984,87982,87980,87979,87977,87975,87973,87971,87970,87968,87966,87964,87962,87961,87959,87957,87955,87953,87952,87950,87948,87946,87944,87943,87941,87939,87937,87935,87934,87932,87930,87928,87926,87925,87923,87921,87919,87917,87916,87914,87912,87910,87908,87907,87905,87903,87901,87899,87898,87896,87894,87892,87890,87889,87887,87885,87883,87881,87880,87878,87876,87874,87872,87871,87869,87867,87865,87863,87862,87860,87858,87856,87855,87853,87851,87849,87847,87846,87844,87842,87840,87838,87837,87835,87833,87831,87829,87828,87826,87824,87822,87820,87819,87817,87815,87813,87811,87810,87808,87806,87804,87802,87801,87799,87797,87795,87793,87792,87790,87788,87786,87784,87783,87781,87779,87777,87776,87774,87772,87770,87768,87767,87765,87763,87761,87759,87758,87756,87754,87752,87750,87749,87747,87745,87743,87741,87740,87738,87736,87734,87732,87731,87729,87727,87725,87724,87722,87720,87718,87716,87715,87713,87711,87709,87707,87706,87704,87702,87700,87698,87697,87695,87693,87691,87689,87688,87686,87684,87682,87681,87679,87677,87675,87673,87672,87670,87668,87666,87664,87663,87661,87659,87657,87655,87654,87652,87650,87648,87647,87645,87643,87641,87639,87638,87636,87634,87632,87630,87629,87627,87625,87623,87621,87620,87618,87616,87614,87613,87611,87609,87607,87605,87604,87602,87600,87598,87596,87595,87593,87591,87589,87588,87586,87584,87582,87580,87579,87577,87575,87573,87571,87570,87568,87566,87564,87563,87561,87559,87557,87555,87554,87552,87550,87548,87546,87545,87543,87541,87539,87538,87536,87534,87532,87530,87529,87527,87525,87523,87522,87520,87518,87516,87514,87513,87511,87509,87507,87505,87504,87502,87500,87498,87497,87495,87493,87491,87489,87488,87486,87484,87482,87481,87479,87477,87475,87473,87472,87470,87468,87466,87464,87463,87461,87459,87457,87456,87454,87452,87450,87448,87447,87445,87443,87441,87440,87438,87436,87434,87432,87431,87429,87427,87425,87424,87422,87420,87418,87416,87415,87413,87411,87409,87408,87406,87404,87402,87400,87399,87397,87395,87393,87392,87390,87388,87386,87384,87383,87381,87379,87377,87376,87374,87372,87370,87368,87367,87365,87363,87361,87360,87358,87356,87354,87352,87351,87349,87347,87345,87344,87342,87340,87338,87336,87335,87333,87331,87329,87328,87326,87324,87322,87320,87319,87317,87315,87313,87312,87310,87308,87306,87304,87303,87301,87299,87297,87296,87294,87292,87290,87288,87287,87285,87283,87281,87280,87278,87276,87274,87273,87271,87269,87267,87265,87264,87262,87260,87258,87257,87255,87253,87251,87249,87248,87246,87244,87242,87241,87239,87237,87235,87234,87232,87230,87228,87226,87225,87223,87221,87219,87218,87216,87214,87212,87211,87209,87207,87205,87203,87202,87200,87198,87196,87195,87193,87191,87189,87187,87186,87184,87182,87180,87179,87177,87175,87173,87172,87170,87168,87166,87164,87163,87161,87159,87157,87156,87154,87152,87150,87149,87147,87145,87143,87141,87140,87138,87136,87134,87133,87131,87129,87127,87126,87124,87122,87120,87119,87117,87115,87113,87111,87110,87108,87106,87104,87103,87101,87099,87097,87096,87094,87092,87090,87088,87087,87085,87083,87081,87080,87078,87076,87074,87073,87071,87069,87067,87066,87064,87062,87060,87058,87057,87055,87053,87051,87050,87048,87046,87044,87043,87041,87039,87037,87036,87034,87032,87030,87028,87027,87025,87023,87021,87020,87018,87016,87014,87013,87011,87009,87007,87006,87004,87002,87000,86999,86997,86995,86993,86991,86990,86988,86986,86984,86983,86981,86979,86977,86976,86974,86972,86970,86969,86967,86965,86963,86962,86960,86958,86956,86954,86953,86951,86949,86947,86946,86944,86942,86940,86939,86937,86935,86933,86932,86930,86928,86926,86925,86923,86921,86919,86918,86916,86914,86912,86910,86909,86907,86905,86903,86902,86900,86898,86896,86895,86893,86891,86889,86888,86886,86884,86882,86881,86879,86877,86875,86874,86872,86870,86868,86867,86865,86863,86861,86860,86858,86856,86854,86852,86851,86849,86847,86845,86844,86842,86840,86838,86837,86835,86833,86831,86830,86828,86826,86824,86823,86821,86819,86817,86816,86814,86812,86810,86809,86807,86805,86803,86802,86800,86798,86796,86795,86793,86791,86789,86788,86786,86784,86782,86781,86779,86777,86775,86774,86772,86770,86768,86767,86765,86763,86761,86760,86758,86756,86754,86752,86751,86749,86747,86745,86744,86742,86740,86738,86737,86735,86733,86731,86730,86728,86726,86724,86723,86721,86719,86717,86716,86714,86712,86710,86709,86707,86705,86703,86702,86700,86698,86696,86695,86693,86691,86689,86688,86686,86684,86682,86681,86679,86677,86675,86674,86672,86670,86668,86667,86665,86663,86661,86660,86658,86656,86654,86653,86651,86649,86647,86646,86644,86642,86640,86639,86637,86635,86634,86632,86630,86628,86627,86625,86623,86621,86620,86618,86616,86614,86613,86611,86609,86607,86606,86604,86602,86600,86599,86597,86595,86593,86592,86590,86588,86586,86585,86583,86581,86579,86578,86576,86574,86572,86571,86569,86567,86565,86564,86562,86560,86558,86557,86555,86553,86551,86550,86548,86546,86544,86543,86541,86539,86538,86536,86534,86532,86531,86529,86527,86525,86524,86522,86520,86518,86517,86515,86513,86511,86510,86508,86506,86504,86503,86501,86499,86497,86496,86494,86492,86490,86489,86487,86485,86483,86482,86480,86478,86477,86475,86473,86471,86470,86468,86466,86464,86463,86461,86459,86457,86456,86454,86452,86450,86449,86447,86445,86443,86442,86440,86438,86436,86435,86433,86431,86430,86428,86426,86424,86423,86421,86419,86417,86416,86414,86412,86410,86409,86407,86405,86403,86402,86400,86398,86396,86395,86393,86391,86390,86388,86386,86384,86383,86381,86379,86377,86376,86374,86372,86370,86369,86367,86365,86363,86362,86360,86358,86357,86355,86353,86351,86350,86348,86346,86344,86343,86341,86339,86337,86336,86334,86332,86331,86329,86327,86325,86324,86322,86320,86318,86317,86315,86313,86311,86310,86308,86306,86304,86303,86301,86299,86298,86296,86294,86292,86291,86289,86287,86285,86284,86282,86280,86278,86277,86275,86273,86272,86270,86268,86266,86265,86263,86261,86259,86258,86256,86254,86252,86251,86249,86247,86246,86244,86242,86240,86239,86237,86235,86233,86232,86230,86228,86227,86225,86223,86221,86220,86218,86216,86214,86213,86211,86209,86207,86206,86204,86202,86201,86199,86197,86195,86194,86192,86190,86188,86187,86185,86183,86182,86180,86178,86176,86175,86173,86171,86169,86168,86166,86164,86163,86161,86159,86157,86156,86154,86152,86150,86149,86147,86145,86143,86142,86140,86138,86137,86135,86133,86131,86130,86128,86126,86124,86123,86121,86119,86118,86116,86114,86112,86111,86109,86107,86106,86104,86102,86100,86099,86097,86095,86093,86092,86090,86088,86087,86085,86083,86081,86080,86078,86076,86074,86073,86071,86069,86068,86066,86064,86062,86061,86059,86057,86055,86054,86052,86050,86049,86047,86045,86043,86042,86040,86038,86037,86035,86033,86031,86030,86028,86026,86024,86023,86021,86019,86018,86016,86014,86012,86011,86009,86007,86005,86004,86002,86000,85999,85997,85995,85993,85992,85990,85988,85987,85985,85983,85981,85980,85978,85976,85975,85973,85971,85969,85968,85966,85964,85962,85961,85959,85957,85956,85954,85952,85950,85949,85947,85945,85944,85942,85940,85938,85937,85935,85933,85932,85930,85928,85926,85925,85923,85921,85919,85918,85916,85914,85913,85911,85909,85907,85906,85904,85902,85901,85899,85897,85895,85894,85892,85890,85889,85887,85885,85883,85882,85880,85878,85877,85875,85873,85871,85870,85868,85866,85865,85863,85861,85859,85858,85856,85854,85852,85851,85849,85847,85846,85844,85842,85840,85839,85837,85835,85834,85832,85830,85828,85827,85825,85823,85822,85820,85818,85816,85815,85813,85811,85810,85808,85806,85804,85803,85801,85799,85798,85796,85794,85792,85791,85789,85787,85786,85784,85782,85780,85779,85777,85775,85774,85772,85770,85768,85767,85765,85763,85762,85760,85758,85756,85755,85753,85751,85750,85748,85746,85745,85743,85741,85739,85738,85736,85734,85733,85731,85729,85727,85726,85724,85722,85721,85719,85717,85715,85714,85712,85710,85709,85707,85705,85703,85702,85700,85698,85697,85695,85693,85691,85690,85688,85686,85685,85683,85681,85680,85678,85676,85674,85673,85671,85669,85668,85666,85664,85662,85661,85659,85657,85656,85654,85652,85650,85649,85647,85645,85644,85642,85640,85639,85637,85635,85633,85632,85630,85628,85627,85625,85623,85621,85620,85618,85616,85615,85613,85611,85609,85608,85606,85604,85603,85601,85599,85598,85596,85594,85592,85591,85589,85587,85586,85584,85582,85580,85579,85577,85575,85574,85572,85570,85569,85567,85565,85563,85562,85560,85558,85557,85555,85553,85552,85550,85548,85546,85545,85543,85541,85540,85538,85536,85534,85533,85531,85529,85528,85526,85524,85523,85521,85519,85517,85516,85514,85512,85511,85509,85507,85506,85504,85502,85500,85499,85497,85495,85494,85492,85490,85489,85487,85485,85483,85482,85480,85478,85477,85475,85473,85471,85470,85468,85466,85465,85463,85461,85460,85458,85456,85454,85453,85451,85449,85448,85446,85444,85443,85441,85439,85437,85436,85434,85432,85431,85429,85427,85426,85424,85422,85420,85419,85417,85415,85414,85412,85410,85409,85407,85405,85404,85402,85400,85398,85397,85395,85393,85392,85390,85388,85387,85385,85383,85381,85380,85378,85376,85375,85373,85371,85370,85368,85366,85364,85363,85361,85359,85358,85356,85354,85353,85351,85349,85348,85346,85344,85342,85341,85339,85337,85336,85334,85332,85331,85329,85327,85325,85324,85322,85320,85319,85317,85315,85314,85312,85310,85309,85307,85305,85303,85302,85300,85298,85297,85295,85293,85292,85290,85288,85286,85285,85283,85281,85280,85278,85276,85275,85273,85271,85270,85268,85266,85264,85263,85261,85259,85258,85256,85254,85253,85251,85249,85248,85246,85244,85242,85241,85239,85237,85236,85234,85232,85231,85229,85227,85226,85224,85222,85220,85219,85217,85215,85214,85212,85210,85209,85207,85205,85204,85202,85200,85199,85197,85195,85193,85192,85190,85188,85187,85185,85183,85182,85180,85178,85177,85175,85173,85171,85170,85168,85166,85165,85163,85161,85160,85158,85156,85155,85153,85151,85150,85148,85146,85144,85143,85141,85139,85138,85136,85134,85133,85131,85129,85128,85126,85124,85123,85121,85119,85117,85116,85114,85112,85111,85109,85107,85106,85104,85102,85101,85099,85097,85096,85094,85092,85090,85089,85087,85085,85084,85082,85080,85079,85077,85075,85074,85072,85070,85069,85067,85065,85064,85062,85060,85058,85057,85055,85053,85052,85050,85048,85047,85045,85043,85042,85040,85038,85037,85035,85033,85032,85030,85028,85026,85025,85023,85021,85020,85018,85016,85015,85013,85011,85010,85008,85006,85005,85003,85001,85000,84998,84996,84995,84993,84991,84989,84988,84986,84984,84983,84981,84979,84978,84976,84974,84973,84971,84969,84968,84966,84964,84963,84961,84959,84958,84956,84954,84952,84951,84949,84947,84946,84944,84942,84941,84939,84937,84936,84934,84932,84931,84929,84927,84926,84924,84922,84921,84919,84917,84916,84914,84912,84910,84909,84907,84905,84904,84902,84900,84899,84897,84895,84894,84892,84890,84889,84887,84885,84884,84882,84880,84879,84877,84875,84874,84872,84870,84869,84867,84865,84864,84862,84860,84858,84857,84855,84853,84852,84850,84848,84847,84845,84843,84842,84840,84838,84837,84835,84833,84832,84830,84828,84827,84825,84823,84822,84820,84818,84817,84815,84813,84812,84810,84808,84807,84805,84803,84802,84800,84798,84796,84795,84793,84791,84790,84788,84786,84785,84783,84781,84780,84778,84776,84775,84773,84771,84770,84768,84766,84765,84763,84761,84760,84758,84756,84755,84753,84751,84750,84748,84746,84745,84743,84741,84740,84738,84736,84735,84733,84731,84730,84728,84726,84725,84723,84721,84720,84718,84716,84715,84713,84711,84710,84708,84706,84705,84703,84701,84699,84698,84696,84694,84693,84691,84689,84688,84686,84684,84683,84681,84679,84678,84676,84674,84673,84671,84669,84668,84666,84664,84663,84661,84659,84658,84656,84654,84653,84651,84649,84648,84646,84644,84643,84641,84639,84638,84636,84634,84633,84631,84629,84628,84626,84624,84623,84621,84619,84618,84616,84614,84613,84611,84609,84608,84606,84604,84603,84601,84599,84598,84596,84594,84593,84591,84589,84588,84586,84584,84583,84581,84579,84578,84576,84574,84573,84571,84569,84568,84566,84564,84563,84561,84559,84558,84556,84554,84553,84551,84549,84548,84546,84544,84543,84541,84539,84538,84536,84534,84533,84531,84529,84528,84526,84524,84523,84521,84519,84518,84516,84514,84513,84511,84510,84508,84506,84505,84503,84501,84500,84498,84496,84495,84493,84491,84490,84488,84486,84485,84483,84481,84480,84478,84476,84475,84473,84471,84470,84468,84466,84465,84463,84461,84460,84458,84456,84455,84453,84451,84450,84448,84446,84445,84443,84441,84440,84438,84436,84435,84433,84431,84430,84428,84426,84425,84423,84421,84420,84418,84416,84415,84413,84412,84410,84408,84407,84405,84403,84402,84400,84398,84397,84395,84393,84392,84390,84388,84387,84385,84383,84382,84380,84378,84377,84375,84373,84372,84370,84368,84367,84365,84363,84362,84360,84358,84357,84355,84353,84352,84350,84349,84347,84345,84344,84342,84340,84339,84337,84335,84334,84332,84330,84329,84327,84325,84324,84322,84320,84319,84317,84315,84314,84312,84310,84309,84307,84305,84304,84302,84301,84299,84297,84296,84294,84292,84291,84289,84287,84286,84284,84282,84281,84279,84277,84276,84274,84272,84271,84269,84267,84266,84264,84262,84261,84259,84258,84256,84254,84253,84251,84249,84248,84246,84244,84243,84241,84239,84238,84236,84234,84233,84231,84229,84228,84226,84224,84223,84221,84220,84218,84216,84215,84213,84211,84210,84208,84206,84205,84203,84201,84200,84198,84196,84195,84193,84191,84190,84188,84186,84185,84183,84182,84180,84178,84177,84175,84173,84172,84170,84168,84167,84165,84163,84162,84160,84158,84157,84155,84153,84152,84150,84149,84147,84145,84144,84142,84140,84139,84137,84135,84134,84132,84130,84129,84127,84125,84124,84122,84121,84119,84117,84116,84114,84112,84111,84109,84107,84106,84104,84102,84101,84099,84097,84096,84094,84093,84091,84089,84088,84086,84084,84083,84081,84079,84078,84076,84074,84073,84071,84069,84068,84066,84065,84063,84061,84060,84058,84056,84055,84053,84051,84050,84048,84046,84045,84043,84042,84040,84038,84037,84035,84033,84032,84030,84028,84027,84025,84023,84022,84020,84019,84017,84015,84014,84012,84010,84009,84007,84005,84004,84002,84000,83999,83997,83996,83994,83992,83991,83989,83987,83986,83984,83982,83981,83979,83977,83976,83974,83973,83971,83969,83968,83966,83964,83963,83961,83959,83958,83956,83954,83953,83951,83950,83948,83946,83945,83943,83941,83940,83938,83936,83935,83933,83931,83930,83928,83927,83925,83923,83922,83920,83918,83917,83915,83913,83912,83910,83909,83907,83905,83904,83902,83900,83899,83897,83895,83894,83892,83890,83889,83887,83886,83884,83882,83881,83879,83877,83876,83874,83872,83871,83869,83868,83866,83864,83863,83861,83859,83858,83856,83854,83853,83851,83850,83848,83846,83845,83843,83841,83840,83838,83836,83835,83833,83832,83830,83828,83827,83825,83823,83822,83820,83818,83817,83815,83814,83812,83810,83809,83807,83805,83804,83802,83800,83799,83797,83796,83794,83792,83791,83789,83787,83786,83784,83782,83781,83779,83778,83776,83774,83773,83771,83769,83768,83766,83765,83763,83761,83760,83758,83756,83755,83753,83751,83750,83748,83747,83745,83743,83742,83740,83738,83737,83735,83733,83732,83730,83729,83727,83725,83724,83722,83720,83719,83717,83716,83714,83712,83711,83709,83707,83706,83704,83702,83701,83699,83698,83696,83694,83693,83691,83689,83688,83686,83685,83683,83681,83680,83678,83676,83675,83673,83672,83670,83668,83667,83665,83663,83662,83660,83658,83657,83655,83654,83652,83650,83649,83647,83645,83644,83642,83641,83639,83637,83636,83634,83632,83631,83629,83628,83626,83624,83623,83621,83619,83618,83616,83614,83613,83611,83610,83608,83606,83605,83603,83601,83600,83598,83597,83595,83593,83592,83590,83588,83587,83585,83584,83582,83580,83579,83577,83575,83574,83572,83571,83569,83567,83566,83564,83562,83561,83559,83558,83556,83554,83553,83551,83549,83548,83546,83545,83543,83541,83540,83538,83536,83535,83533,83532,83530,83528,83527,83525,83523,83522,83520,83519,83517,83515,83514,83512,83510,83509,83507,83506,83504,83502,83501,83499,83497,83496,83494,83493,83491,83489,83488,83486,83484,83483,83481,83480,83478,83476,83475,83473,83471,83470,83468,83467,83465,83463,83462,83460,83459,83457,83455,83454,83452,83450,83449,83447,83446,83444,83442,83441,83439,83437,83436,83434,83433,83431,83429,83428,83426,83424,83423,83421,83420,83418,83416,83415,83413,83412,83410,83408,83407,83405,83403,83402,83400,83399,83397,83395,83394,83392,83390,83389,83387,83386,83384,83382,83381,83379,83377,83376,83374,83373,83371,83369,83368,83366,83365,83363,83361,83360,83358,83356,83355,83353,83352,83350,83348,83347,83345,83344,83342,83340,83339,83337,83335,83334,83332,83331,83329,83327,83326,83324,83323,83321,83319,83318,83316,83314,83313,83311,83310,83308,83306,83305,83303,83301,83300,83298,83297,83295,83293,83292,83290,83289,83287,83285,83284,83282,83280,83279,83277,83276,83274,83272,83271,83269,83268,83266,83264,83263,83261,83260,83258,83256,83255,83253,83251,83250,83248,83247,83245,83243,83242,83240,83239,83237,83235,83234,83232,83230,83229,83227,83226,83224,83222,83221,83219,83218,83216,83214,83213,83211,83210,83208,83206,83205,83203,83201,83200,83198,83197,83195,83193,83192,83190,83189,83187,83185,83184,83182,83180,83179,83177,83176,83174,83172,83171,83169,83168,83166,83164,83163,83161,83160,83158,83156,83155,83153,83152,83150,83148,83147,83145,83143,83142,83140,83139,83137,83135,83134,83132,83131,83129,83127,83126,83124,83123,83121,83119,83118,83116,83114,83113,83111,83110,83108,83106,83105,83103,83102,83100,83098,83097,83095,83094,83092,83090,83089,83087,83086,83084,83082,83081,83079,83078,83076,83074,83073,83071,83069,83068,83066,83065,83063,83061,83060,83058,83057,83055,83053,83052,83050,83049,83047,83045,83044,83042,83041,83039,83037,83036,83034,83033,83031,83029,83028,83026,83025,83023,83021,83020,83018,83016,83015,83013,83012,83010,83008,83007,83005,83004,83002,83000,82999,82997,82996,82994,82992,82991,82989,82988,82986,82984,82983,82981,82980,82978,82976,82975,82973,82972,82970,82968,82967,82965,82964,82962,82960,82959,82957,82956,82954,82952,82951,82949,82948,82946,82944,82943,82941,82940,82938,82936,82935,82933,82932,82930,82928,82927,82925,82924,82922,82920,82919,82917,82916,82914,82912,82911,82909,82908,82906,82904,82903,82901,82900,82898,82896,82895,82893,82892,82890,82888,82887,82885,82884,82882,82880,82879,82877,82876,82874,82872,82871,82869,82868,82866,82864,82863,82861,82860,82858,82856,82855,82853,82852,82850,82848,82847,82845,82844,82842,82840,82839,82837,82836,82834,82832,82831,82829,82828,82826,82824,82823,82821,82820,82818,82816,82815,82813,82812,82810,82808,82807,82805,82804,82802,82800,82799,82797,82796,82794,82792,82791,82789,82788,82786,82784,82783,82781,82780,82778,82777,82775,82773,82772,82770,82769,82767,82765,82764,82762,82761,82759,82757,82756,82754,82753,82751,82749,82748,82746,82745,82743,82741,82740,82738,82737,82735,82733,82732,82730,82729,82727,82725,82724,82722,82721,82719,82718,82716,82714,82713,82711,82710,82708,82706,82705,82703,82702,82700,82698,82697,82695,82694,82692,82690,82689,82687,82686,82684,82682,82681,82679,82678,82676,82675,82673,82671,82670,82668,82667,82665,82663,82662,82660,82659,82657,82655,82654,82652,82651,82649,82647,82646,82644,82643,82641,82640,82638,82636,82635,82633,82632,82630,82628,82627,82625,82624,82622,82620,82619,82617,82616,82614,82613,82611,82609,82608,82606,82605,82603,82601,82600,82598,82597,82595,82593,82592,82590,82589,82587,82585,82584,82582,82581,82579,82578,82576,82574,82573,82571,82570,82568,82566,82565,82563,82562,82560,82559,82557,82555,82554,82552,82551,82549,82547,82546,82544,82543,82541,82539,82538,82536,82535,82533,82532,82530,82528,82527,82525,82524,82522,82520,82519,82517,82516,82514,82513,82511,82509,82508,82506,82505,82503,82501,82500,82498,82497,82495,82493,82492,82490,82489,82487,82486,82484,82482,82481,82479,82478,82476,82474,82473,82471,82470,82468,82467,82465,82463,82462,82460,82459,82457,82455,82454,82452,82451,82449,82448,82446,82444,82443,82441,82440,82438,82436,82435,82433,82432,82430,82429,82427,82425,82424,82422,82421,82419,82418,82416,82414,82413,82411,82410,82408,82406,82405,82403,82402,82400,82399,82397,82395,82394,82392,82391,82389,82387,82386,82384,82383,82381,82380,82378,82376,82375,82373,82372,82370,82369,82367,82365,82364,82362,82361,82359,82357,82356,82354,82353,82351,82350,82348,82346,82345,82343,82342,82340,82339,82337,82335,82334,82332,82331,82329,82327,82326,82324,82323,82321,82320,82318,82316,82315,82313,82312,82310,82309,82307,82305,82304,82302,82301,82299,82297,82296,82294,82293,82291,82290,82288,82286,82285,82283,82282,82280,82279,82277,82275,82274,82272,82271,82269,82268,82266,82264,82263,82261,82260,82258,82257,82255,82253,82252,82250,82249,82247,82245,82244,82242,82241,82239,82238,82236,82234,82233,82231,82230,82228,82227,82225,82223,82222,82220,82219,82217,82216,82214,82212,82211,82209,82208,82206,82205,82203,82201,82200,82198,82197,82195,82194,82192,82190,82189,82187,82186,82184,82183,82181,82179,82178,82176,82175,82173,82172,82170,82168,82167,82165,82164,82162,82161,82159,82157,82156,82154,82153,82151,82150,82148,82146,82145,82143,82142,82140,82139,82137,82135,82134,82132,82131,82129,82128,82126,82124,82123,82121,82120,82118,82117,82115,82113,82112,82110,82109,82107,82106,82104,82102,82101,82099,82098,82096,82095,82093,82091,82090,82088,82087,82085,82084,82082,82080,82079,82077,82076,82074,82073,82071,82069,82068,82066,82065,82063,82062,82060,82058,82057,82055,82054,82052,82051,82049,82048,82046,82044,82043,82041,82040,82038,82037,82035,82033,82032,82030,82029,82027,82026,82024,82022,82021,82019,82018,82016,82015,82013,82011,82010,82008,82007,82005,82004,82002,82001,81999,81997,81996,81994,81993,81991,81990,81988,81986,81985,81983,81982,81980,81979,81977,81975,81974,81972,81971,81969,81968,81966,81965,81963,81961,81960,81958,81957,81955,81954,81952,81950,81949,81947,81946,81944,81943,81941,81940,81938,81936,81935,81933,81932,81930,81929,81927,81925,81924,81922,81921,81919,81918,81916,81915,81913,81911,81910,81908,81907,81905,81904,81902,81900,81899,81897,81896,81894,81893,81891,81890,81888,81886,81885,81883,81882,81880,81879,81877,81875,81874,81872,81871,81869,81868,81866,81865,81863,81861,81860,81858,81857,81855,81854,81852,81850,81849,81847,81846,81844,81843,81841,81840,81838,81836,81835,81833,81832,81830,81829,81827,81826,81824,81822,81821,81819,81818,81816,81815,81813,81812,81810,81808,81807,81805,81804,81802,81801,81799,81797,81796,81794,81793,81791,81790,81788,81787,81785,81783,81782,81780,81779,81777,81776,81774,81773,81771,81769,81768,81766,81765,81763,81762,81760,81759,81757,81755,81754,81752,81751,81749,81748,81746,81745,81743,81741,81740,81738,81737,81735,81734,81732,81731,81729,81727,81726,81724,81723,81721,81720,81718,81717,81715,81713,81712,81710,81709,81707,81706,81704,81703,81701,81699,81698,81696,81695,81693,81692,81690,81689,81687,81685,81684,81682,81681,81679,81678,81676,81675,81673,81672,81670,81668,81667,81665,81664,81662,81661,81659,81658,81656,81654,81653,81651,81650,81648,81647,81645,81644,81642,81640,81639,81637,81636,81634,81633,81631,81630,81628,81626,81625,81623,81622,81620,81619,81617,81616,81614,81613,81611,81609,81608,81606,81605,81603,81602,81600,81599,81597,81595,81594,81592,81591,81589,81588,81586,81585,81583,81582,81580,81578,81577,81575,81574,81572,81571,81569,81568,81566,81564,81563,81561,81560,81558,81557,81555,81554,81552,81551,81549,81547,81546,81544,81543,81541,81540,81538,81537,81535,81534,81532,81530,81529,81527,81526,81524,81523,81521,81520,81518,81516,81515,81513,81512,81510,81509,81507,81506,81504,81503,81501,81499,81498,81496,81495,81493,81492,81490,81489,81487,81486,81484,81482,81481,81479,81478,81476,81475,81473,81472,81470,81469,81467,81465,81464,81462,81461,81459,81458,81456,81455,81453,81452,81450,81448,81447,81445,81444,81442,81441,81439,81438,81436,81435,81433,81431,81430,81428,81427,81425,81424,81422,81421,81419,81418,81416,81415,81413,81411,81410,81408,81407,81405,81404,81402,81401,81399,81398,81396,81394,81393,81391,81390,81388,81387,81385,81384,81382,81381,81379,81377,81376,81374,81373,81371,81370,81368,81367,81365,81364,81362,81361,81359,81357,81356,81354,81353,81351,81350,81348,81347,81345,81344,81342,81341,81339,81337,81336,81334,81333,81331,81330,81328,81327,81325,81324,81322,81320,81319,81317,81316,81314,81313,81311,81310,81308,81307,81305,81304,81302,81300,81299,81297,81296,81294,81293,81291,81290,81288,81287,81285,81284,81282,81280,81279,81277,81276,81274,81273,81271,81270,81268,81267,81265,81264,81262,81260,81259,81257,81256,81254,81253,81251,81250,81248,81247,81245,81244,81242,81240,81239,81237,81236,81234,81233,81231,81230,81228,81227,81225,81224,81222,81221,81219,81217,81216,81214,81213,81211,81210,81208,81207,81205,81204,81202,81201,81199,81197,81196,81194,81193,81191,81190,81188,81187,81185,81184,81182,81181,81179,81178,81176,81174,81173,81171,81170,81168,81167,81165,81164,81162,81161,81159,81158,81156,81155,81153,81151,81150,81148,81147,81145,81144,81142,81141,81139,81138,81136,81135,81133,81132,81130,81128,81127,81125,81124,81122,81121,81119,81118,81116,81115,81113,81112,81110,81109,81107,81105,81104,81102,81101,81099,81098,81096,81095,81093,81092,81090,81089,81087,81086,81084,81083,81081,81079,81078,81076,81075,81073,81072,81070,81069,81067,81066,81064,81063,81061,81060,81058,81057,81055,81053,81052,81050,81049,81047,81046,81044,81043,81041,81040,81038,81037,81035,81034,81032,81031,81029,81027,81026,81024,81023,81021,81020,81018,81017,81015,81014,81012,81011,81009,81008,81006,81005,81003,81001,81000,80998,80997,80995,80994,80992,80991,80989,80988,80986,80985,80983,80982,80980,80979,80977,80976,80974,80972,80971,80969,80968,80966,80965,80963,80962,80960,80959,80957,80956,80954,80953,80951,80950,80948,80947,80945,80943,80942,80940,80939,80937,80936,80934,80933,80931,80930,80928,80927,80925,80924,80922,80921,80919,80918,80916,80914,80913,80911,80910,80908,80907,80905,80904,80902,80901,80899,80898,80896,80895,80893,80892,80890,80889,80887,80886,80884,80882,80881,80879,80878,80876,80875,80873,80872,80870,80869,80867,80866,80864,80863,80861,80860,80858,80857,80855,80854,80852,80851,80849,80847,80846,80844,80843,80841,80840,80838,80837,80835,80834,80832,80831,80829,80828,80826,80825,80823,80822,80820,80819,80817,80816,80814,80812,80811,80809,80808,80806,80805,80803,80802,80800,80799,80797,80796,80794,80793,80791,80790,80788,80787,80785,80784,80782,80781,80779,80778,80776,80774,80773,80771,80770,80768,80767,80765,80764,80762,80761,80759,80758,80756,80755,80753,80752,80750,80749,80747,80746,80744,80743,80741,80740,80738,80737,80735,80733,80732,80730,80729,80727,80726,80724,80723,80721,80720,80718,80717,80715,80714,80712,80711,80709,80708,80706,80705,80703,80702,80700,80699,80697,80696,80694,80693,80691,80690,80688,80686,80685,80683,80682,80680,80679,80677,80676,80674,80673,80671,80670,80668,80667,80665,80664,80662,80661,80659,80658,80656,80655,80653,80652,80650,80649,80647,80646,80644,80643,80641,80640,80638,80636,80635,80633,80632,80630,80629,80627,80626,80624,80623,80621,80620,80618,80617,80615,80614,80612,80611,80609,80608,80606,80605,80603,80602,80600,80599,80597,80596,80594,80593,80591,80590,80588,80587,80585,80584,80582,80581,80579,80577,80576,80574,80573,80571,80570,80568,80567,80565,80564,80562,80561,80559,80558,80556,80555,80553,80552,80550,80549,80547,80546,80544,80543,80541,80540,80538,80537,80535,80534,80532,80531,80529,80528,80526,80525,80523,80522,80520,80519,80517,80516,80514,80513,80511,80510,80508,80506,80505,80503,80502,80500,80499,80497,80496,80494,80493,80491,80490,80488,80487,80485,80484,80482,80481,80479,80478,80476,80475,80473,80472,80470,80469,80467,80466,80464,80463,80461,80460,80458,80457,80455,80454,80452,80451,80449,80448,80446,80445,80443,80442,80440,80439,80437,80436,80434,80433,80431,80430,80428,80427,80425,80424,80422,80421,80419,80418,80416,80415,80413,80412,80410,80409,80407,80406,80404,80403,80401,80399,80398,80396,80395,80393,80392,80390,80389,80387,80386,80384,80383,80381,80380,80378,80377,80375,80374,80372,80371,80369,80368,80366,80365,80363,80362,80360,80359,80357,80356,80354,80353,80351,80350,80348,80347,80345,80344,80342,80341,80339,80338,80336,80335,80333,80332,80330,80329,80327,80326,80324,80323,80321,80320,80318,80317,80315,80314,80312,80311,80309,80308,80306,80305,80303,80302,80300,80299,80297,80296,80294,80293,80291,80290,80288,80287,80285,80284,80282,80281,80279,80278,80276,80275,80273,80272,80270,80269,80267,80266,80264,80263,80261,80260,80258,80257,80255,80254,80252,80251,80249,80248,80246,80245,80243,80242,80240,80239,80237,80236,80234,80233,80231,80230,80228,80227,80225,80224,80222,80221,80219,80218,80216,80215,80213,80212,80210,80209,80207,80206,80204,80203,80201,80200,80198,80197,80195,80194,80192,80191,80189,80188,80186,80185,80183,80182,80180,80179,80177,80176,80174,80173,80171,80170,80168,80167,80165,80164,80162,80161,80159,80158,80156,80155,80153,80152,80150,80149,80147,80146,80144,80143,80141,80140,80138,80137,80135,80134,80132,80131,80129,80128,80127,80125,80124,80122,80121,80119,80118,80116,80115,80113,80112,80110,80109,80107,80106,80104,80103,80101,80100,80098,80097,80095,80094,80092,80091,80089,80088,80086,80085,80083,80082,80080,80079,80077,80076,80074,80073,80071,80070,80068,80067,80065,80064,80062,80061,80059,80058,80056,80055,80053,80052,80050,80049,80047,80046,80044,80043,80041,80040,80038,80037,80035,80034,80032,80031,80029,80028,80026,80025,80023,80022,80021,80019,80018,80016,80015,80013,80012,80010,80009,80007,80006,80004,80003,80001,80000,79998,79997,79995,79994,79992,79991,79989,79988,79986,79985,79983,79982,79980,79979,79977,79976,79974,79973,79971,79970,79968,79967,79965,79964,79962,79961,79959,79958,79956,79955,79953,79952,79950,79949,79948,79946,79945,79943,79942,79940,79939,79937,79936,79934,79933,79931,79930,79928,79927,79925,79924,79922,79921,79919,79918,79916,79915,79913,79912,79910,79909,79907,79906,79904,79903,79901,79900,79898,79897,79895,79894,79892,79891,79890,79888,79887,79885,79884,79882,79881,79879,79878,79876,79875,79873,79872,79870,79869,79867,79866,79864,79863,79861,79860,79858,79857,79855,79854,79852,79851,79849,79848,79846,79845,79843,79842,79841,79839,79838,79836,79835,79833,79832,79830,79829,79827,79826,79824,79823,79821,79820,79818,79817,79815,79814,79812,79811,79809,79808,79806,79805,79803,79802,79800,79799,79797,79796,79795,79793,79792,79790,79789,79787,79786,79784,79783,79781,79780,79778,79777,79775,79774,79772,79771,79769,79768,79766,79765,79763,79762,79760,79759,79757,79756,79755,79753,79752,79750,79749,79747,79746,79744,79743,79741,79740,79738,79737,79735,79734,79732,79731,79729,79728,79726,79725,79723,79722,79720,79719,79718,79716,79715,79713,79712,79710,79709,79707,79706,79704,79703,79701,79700,79698,79697,79695,79694,79692,79691,79689,79688,79686,79685,79683,79682,79681,79679,79678,79676,79675,79673,79672,79670,79669,79667,79666,79664,79663,79661,79660,79658,79657,79655,79654,79652,79651,79650,79648,79647,79645,79644,79642,79641,79639,79638,79636,79635,79633,79632,79630,79629,79627,79626,79624,79623,79621,79620,79619,79617,79616,79614,79613,79611,79610,79608,79607,79605,79604,79602,79601,79599,79598,79596,79595,79593,79592,79590,79589,79588,79586,79585,79583,79582,79580,79579,79577,79576,79574,79573,79571,79570,79568,79567,79565,79564,79562,79561,79560,79558,79557,79555,79554,79552,79551,79549,79548,79546,79545,79543,79542,79540,79539,79537,79536,79534,79533,79532,79530,79529,79527,79526,79524,79523,79521,79520,79518,79517,79515,79514,79512,79511,79509,79508,79506,79505,79504,79502,79501,79499,79498,79496,79495,79493,79492,79490,79489,79487,79486,79484,79483,79481,79480,79479,79477,79476,79474,79473,79471,79470,79468,79467,79465,79464,79462,79461,79459,79458,79456,79455,79454,79452,79451,79449,79448,79446,79445,79443,79442,79440,79439,79437,79436,79434,79433,79431,79430,79429,79427,79426,79424,79423,79421,79420,79418,79417,79415,79414,79412,79411,79409,79408,79407,79405,79404,79402,79401,79399,79398,79396,79395,79393,79392,79390,79389,79387,79386,79385,79383,79382,79380,79379,79377,79376,79374,79373,79371,79370,79368,79367,79365,79364,79363,79361,79360,79358,79357,79355,79354,79352,79351,79349,79348,79346,79345,79343,79342,79341,79339,79338,79336,79335,79333,79332,79330,79329,79327,79326,79324,79323,79321,79320,79319,79317,79316,79314,79313,79311,79310,79308,79307,79305,79304,79302,79301,79300,79298,79297,79295,79294,79292,79291,79289,79288,79286,79285,79283,79282,79280,79279,79278,79276,79275,79273,79272,79270,79269,79267,79266,79264,79263,79261,79260,79259,79257,79256,79254,79253,79251,79250,79248,79247,79245,79244,79242,79241,79240,79238,79237,79235,79234,79232,79231,79229,79228,79226,79225,79223,79222,79221,79219,79218,79216,79215,79213,79212,79210,79209,79207,79206,79204,79203,79202,79200,79199,79197,79196,79194,79193,79191,79190,79188,79187,79185,79184,79183,79181,79180,79178,79177,79175,79174,79172,79171,79169,79168,79166,79165,79164,79162,79161,79159,79158,79156,79155,79153,79152,79150,79149,79148,79146,79145,79143,79142,79140,79139,79137,79136,79134,79133,79131,79130,79129,79127,79126,79124,79123,79121,79120,79118,79117,79115,79114,79113,79111,79110,79108,79107,79105,79104,79102,79101,79099,79098,79097,79095,79094,79092,79091,79089,79088,79086,79085,79083,79082,79080,79079,79078,79076,79075,79073,79072,79070,79069,79067,79066,79064,79063,79062,79060,79059,79057,79056,79054,79053,79051,79050,79048,79047,79046,79044,79043,79041,79040,79038,79037,79035,79034,79032,79031,79030,79028,79027,79025,79024,79022,79021,79019,79018,79016,79015,79014,79012,79011,79009,79008,79006,79005,79003,79002,79000,78999,78998,78996,78995,78993,78992,78990,78989,78987,78986,78985,78983,78982,78980,78979,78977,78976,78974,78973,78971,78970,78969,78967,78966,78964,78963,78961,78960,78958,78957,78955,78954,78953,78951,78950,78948,78947,78945,78944,78942,78941,78939,78938,78937,78935,78934,78932,78931,78929,78928,78926,78925,78924,78922,78921,78919,78918,78916,78915,78913,78912,78910,78909,78908,78906,78905,78903,78902,78900,78899,78897,78896,78895,78893,78892,78890,78889,78887,78886,78884,78883,78882,78880,78879,78877,78876,78874,78873,78871,78870,78868,78867,78866,78864,78863,78861,78860,78858,78857,78855,78854,78853,78851,78850,78848,78847,78845,78844,78842,78841,78840,78838,78837,78835,78834,78832,78831,78829,78828,78826,78825,78824,78822,78821,78819,78818,78816,78815,78813,78812,78811,78809,78808,78806,78805,78803,78802,78800,78799,78798,78796,78795,78793,78792,78790,78789,78787,78786,78785,78783,78782,78780,78779,78777,78776,78774,78773,78772,78770,78769,78767,78766,78764,78763,78761,78760,78759,78757,78756,78754,78753,78751,78750,78748,78747,78746,78744,78743,78741,78740,78738,78737,78735,78734,78733,78731,78730,78728,78727,78725,78724,78722,78721,78720,78718,78717,78715,78714,78712,78711,78709,78708,78707,78705,78704,78702,78701,78699,78698,78697,78695,78694,78692,78691,78689,78688,78686,78685,78684,78682,78681,78679,78678,78676,78675,78673,78672,78671,78669,78668,78666,78665,78663,78662,78660,78659,78658,78656,78655,78653,78652,78650,78649,78648,78646,78645,78643,78642,78640,78639,78637,78636,78635,78633,78632,78630,78629,78627,78626,78624,78623,78622,78620,78619,78617,78616,78614,78613,78612,78610,78609,78607,78606,78604,78603,78601,78600,78599,78597,78596,78594,78593,78591,78590,78589,78587,78586,78584,78583,78581,78580,78578,78577,78576,78574,78573,78571,78570,78568,78567,78565,78564,78563,78561,78560,78558,78557,78555,78554,78553,78551,78550,78548,78547,78545,78544,78543,78541,78540,78538,78537,78535,78534,78532,78531,78530,78528,78527,78525,78524,78522,78521,78520,78518,78517,78515,78514,78512,78511,78509,78508,78507,78505,78504,78502,78501,78499,78498,78497,78495,78494,78492,78491,78489,78488,78487,78485,78484,78482,78481,78479,78478,78476,78475,78474,78472,78471,78469,78468,78466,78465,78464,78462,78461,78459,78458,78456,78455,78454,78452,78451,78449,78448,78446,78445,78444,78442,78441,78439,78438,78436,78435,78434,78432,78431,78429,78428,78426,78425,78423,78422,78421,78419,78418,78416,78415,78413,78412,78411,78409,78408,78406,78405,78403,78402,78401,78399,78398,78396,78395,78393,78392,78391,78389,78388,78386,78385,78383,78382,78381,78379,78378,78376,78375,78373,78372,78371,78369,78368,78366,78365,78363,78362,78361,78359,78358,78356,78355,78353,78352,78351,78349,78348,78346,78345,78343,78342,78341,78339,78338,78336,78335,78333,78332,78331,78329,78328,78326,78325,78323,78322,78321,78319,78318,78316,78315,78313,78312,78311,78309,78308,78306,78305,78303,78302,78301,78299,78298,78296,78295,78293,78292,78291,78289,78288,78286,78285,78283,78282,78281,78279,78278,78276,78275,78273,78272,78271,78269,78268,78266,78265,78263,78262,78261,78259,78258,78256,78255,78253,78252,78251,78249,78248,78246,78245,78243,78242,78241,78239,78238,78236,78235,78233,78232,78231,78229,78228,78226,78225,78224,78222,78221,78219,78218,78216,78215,78214,78212,78211,78209,78208,78206,78205,78204,78202,78201,78199,78198,78196,78195,78194,78192,78191,78189,78188,78186,78185,78184,78182,78181,78179,78178,78177,78175,78174,78172,78171,78169,78168,78167,78165,78164,78162,78161,78159,78158,78157,78155,78154,78152,78151,78149,78148,78147,78145,78144,78142,78141,78140,78138,78137,78135,78134,78132,78131,78130,78128,78127,78125,78124,78122,78121,78120,78118,78117,78115,78114,78113,78111,78110,78108,78107,78105,78104,78103,78101,78100,78098,78097,78095,78094,78093,78091,78090,78088,78087,78086,78084,78083,78081,78080,78078,78077,78076,78074,78073,78071,78070,78069,78067,78066,78064,78063,78061,78060,78059,78057,78056,78054,78053,78052,78050,78049,78047,78046,78044,78043,78042,78040,78039,78037,78036,78034,78033,78032,78030,78029,78027,78026,78025,78023,78022,78020,78019,78017,78016,78015,78013,78012,78010,78009,78008,78006,78005,78003,78002,78000,77999,77998,77996,77995,77993,77992,77991,77989,77988,77986,77985,77983,77982,77981,77979,77978,77976,77975,77974,77972,77971,77969,77968,77966,77965,77964,77962,77961,77959,77958,77957,77955,77954,77952,77951,77950,77948,77947,77945,77944,77942,77941,77940,77938,77937,77935,77934,77933,77931,77930,77928,77927,77925,77924,77923,77921,77920,77918,77917,77916,77914,77913,77911,77910,77909,77907,77906,77904,77903,77901,77900,77899,77897,77896,77894,77893,77892,77890,77889,77887,77886,77884,77883,77882,77880,77879,77877,77876,77875,77873,77872,77870,77869,77868,77866,77865,77863,77862,77860,77859,77858,77856,77855,77853,77852,77851,77849,77848,77846,77845,77844,77842,77841,77839,77838,77836,77835,77834,77832,77831,77829,77828,77827,77825,77824,77822,77821,77820,77818,77817,77815,77814,77813,77811,77810,77808,77807,77805,77804,77803,77801,77800,77798,77797,77796,77794,77793,77791,77790,77789,77787,77786,77784,77783,77782,77780,77779,77777,77776,77774,77773,77772,77770,77769,77767,77766,77765,77763,77762,77760,77759,77758,77756,77755,77753,77752,77751,77749,77748,77746,77745,77744,77742,77741,77739,77738,77736,77735,77734,77732,77731,77729,77728,77727,77725,77724,77722,77721,77720,77718,77717,77715,77714,77713,77711,77710,77708,77707,77706,77704,77703,77701,77700,77698,77697,77696,77694,77693,77691,77690,77689,77687,77686,77684,77683,77682,77680,77679,77677,77676,77675,77673,77672,77670,77669,77668,77666,77665,77663,77662,77661,77659,77658,77656,77655,77654,77652,77651,77649,77648,77647,77645,77644,77642,77641,77640,77638,77637,77635,77634,77632,77631,77630,77628,77627,77625,77624,77623,77621,77620,77618,77617,77616,77614,77613,77611,77610,77609,77607,77606,77604,77603,77602,77600,77599,77597,77596,77595,77593,77592,77590,77589,77588,77586,77585,77583,77582,77581,77579,77578,77576,77575,77574,77572,77571,77569,77568,77567,77565,77564,77562,77561,77560,77558,77557,77555,77554,77553,77551,77550,77548,77547,77546,77544,77543,77541,77540,77539,77537,77536,77534,77533,77532,77530,77529,77527,77526,77525,77523,77522,77520,77519,77518,77516,77515,77513,77512,77511,77509,77508,77506,77505,77504,77502,77501,77499,77498,77497,77495,77494,77492,77491,77490,77488,77487,77485,77484,77483,77481,77480,77478,77477,77476,77474,77473,77471,77470,77469,77467,77466,77464,77463,77462,77460,77459,77457,77456,77455,77453,77452,77450,77449,77448,77446,77445,77444,77442,77441,77439,77438,77437,77435,77434,77432,77431,77430,77428,77427,77425,77424,77423,77421,77420,77418,77417,77416,77414,77413,77411,77410,77409,77407,77406,77404,77403,77402,77400,77399,77397,77396,77395,77393,77392,77390,77389,77388,77386,77385,77384,77382,77381,77379,77378,77377,77375,77374,77372,77371,77370,77368,77367,77365,77364,77363,77361,77360,77358,77357,77356,77354,77353,77351,77350,77349,77347,77346,77344,77343,77342,77340,77339,77338,77336,77335,77333,77332,77331,77329,77328,77326,77325,77324,77322,77321,77319,77318,77317,77315,77314,77312,77311,77310,77308,77307,77306,77304,77303,77301,77300,77299,77297,77296,77294,77293,77292,77290,77289,77287,77286,77285,77283,77282,77280,77279,77278,77276,77275,77274,77272,77271,77269,77268,77267,77265,77264,77262,77261,77260,77258,77257,77255,77254,77253,77251,77250,77249,77247,77246,77244,77243,77242,77240,77239,77237,77236,77235,77233,77232,77230,77229,77228,77226,77225,77224,77222,77221,77219,77218,77217,77215,77214,77212,77211,77210,77208,77207,77205,77204,77203,77201,77200,77199,77197,77196,77194,77193,77192,77190,77189,77187,77186,77185,77183,77182,77180,77179,77178,77176,77175,77174,77172,77171,77169,77168,77167,77165,77164,77162,77161,77160,77158,77157,77156,77154,77153,77151,77150,77149,77147,77146,77144,77143,77142,77140,77139,77138,77136,77135,77133,77132,77131,77129,77128,77126,77125,77124,77122,77121,77120,77118,77117,77115,77114,77113,77111,77110,77108,77107,77106,77104,77103,77102,77100,77099,77097,77096,77095,77093,77092,77090,77089,77088,77086,77085,77084,77082,77081,77079,77078,77077,77075,77074,77072,77071,77070,77068,77067,77066,77064,77063,77061,77060,77059,77057,77056,77054,77053,77052,77050,77049,77048,77046,77045,77043,77042,77041,77039,77038,77037,77035,77034,77032,77031,77030,77028,77027,77025,77024,77023,77021,77020,77019,77017,77016,77014,77013,77012,77010,77009,77008,77006,77005,77003,77002,77001,76999,76998,76996,76995,76994,76992,76991,76990,76988,76987,76985,76984,76983,76981,76980,76979,76977,76976,76974,76973,76972,76970,76969,76967,76966,76965,76963,76962,76961,76959,76958,76956,76955,76954,76952,76951,76950,76948,76947,76945,76944,76943,76941,76940,76939,76937,76936,76934,76933,76932,76930,76929,76928,76926,76925,76923,76922,76921,76919,76918,76916,76915,76914,76912,76911,76910,76908,76907,76905,76904,76903,76901,76900,76899,76897,76896,76894,76893,76892,76890,76889,76888,76886,76885,76883,76882,76881,76879,76878,76877,76875,76874,76872,76871,76870,76868,76867,76866,76864,76863,76861,76860,76859,76857,76856,76855,76853,76852,76850,76849,76848,76846,76845,76844,76842,76841,76839,76838,76837,76835,76834,76833,76831,76830,76828,76827,76826,76824,76823,76822,76820,76819,76817,76816,76815,76813,76812,76811,76809,76808,76806,76805,76804,76802,76801,76800,76798,76797,76795,76794,76793,76791,76790,76789,76787,76786,76784,76783,76782,76780,76779,76778,76776,76775,76773,76772,76771,76769,76768,76767,76765,76764,76763,76761,76760,76758,76757,76756,76754,76753,76752,76750,76749,76747,76746,76745,76743,76742,76741,76739,76738,76736,76735,76734,76732,76731,76730,76728,76727,76725,76724,76723,76721,76720,76719,76717,76716,76715,76713,76712,76710,76709,76708,76706,76705,76704,76702,76701,76699,76698,76697,76695,76694,76693,76691,76690,76689,76687,76686,76684,76683,76682,76680,76679,76678,76676,76675,76673,76672,76671,76669,76668,76667,76665,76664,76662,76661,76660,76658,76657,76656,76654,76653,76652,76650,76649,76647,76646,76645,76643,76642,76641,76639,76638,76637,76635,76634,76632,76631,76630,76628,76627,76626,76624,76623,76621,76620,76619,76617,76616,76615,76613,76612,76611,76609,76608,76606,76605,76604,76602,76601,76600,76598,76597,76596,76594,76593,76591,76590,76589,76587,76586,76585,76583,76582,76580,76579,76578,76576,76575,76574,76572,76571,76570,76568,76567,76565,76564,76563,76561,76560,76559,76557,76556,76555,76553,76552,76550,76549,76548,76546,76545,76544,76542,76541,76540,76538,76537,76535,76534,76533,76531,76530,76529,76527,76526,76525,76523,76522,76520,76519,76518,76516,76515,76514,76512,76511,76510,76508,76507,76505,76504,76503,76501,76500,76499,76497,76496,76495,76493,76492,76490,76489,76488,76486,76485,76484,76482,76481,76480,76478,76477,76475,76474,76473,76471,76470,76469,76467,76466,76465,76463,76462,76461,76459,76458,76456,76455,76454,76452,76451,76450,76448,76447,76446,76444,76443,76441,76440,76439,76437,76436,76435,76433,76432,76431,76429,76428,76426,76425,76424,76422,76421,76420,76418,76417,76416,76414,76413,76412,76410,76409,76407,76406,76405,76403,76402,76401,76399,76398,76397,76395,76394,76393,76391,76390,76388,76387,76386,76384,76383,76382,76380,76379,76378,76376,76375,76373,76372,76371,76369,76368,76367,76365,76364,76363,76361,76360,76359,76357,76356,76354,76353,76352,76350,76349,76348,76346,76345,76344,76342,76341,76340,76338,76337,76335,76334,76333,76331,76330,76329,76327,76326,76325,76323,76322,76321,76319,76318,76316,76315,76314,76312,76311,76310,76308,76307,76306,76304,76303,76302,76300,76299,76298,76296,76295,76293,76292,76291,76289,76288,76287,76285,76284,76283,76281,76280,76279,76277,76276,76274,76273,76272,76270,76269,76268,76266,76265,76264,76262,76261,76260,76258,76257,76256,76254,76253,76251,76250,76249,76247,76246,76245,76243,76242,76241,76239,76238,76237,76235,76234,76233,76231,76230,76228,76227,76226,76224,76223,76222,76220,76219,76218,76216,76215,76214,76212,76211,76210,76208,76207,76205,76204,76203,76201,76200,76199,76197,76196,76195,76193,76192,76191,76189,76188,76187,76185,76184,76182,76181,76180,76178,76177,76176,76174,76173,76172,76170,76169,76168,76166,76165,76164,76162,76161,76160,76158,76157,76155,76154,76153,76151,76150,76149,76147,76146,76145,76143,76142,76141,76139,76138,76137,76135,76134,76133,76131,76130,76128,76127,76126,76124,76123,76122,76120,76119,76118,76116,76115,76114,76112,76111,76110,76108,76107,76106,76104,76103,76101,76100,76099,76097,76096,76095,76093,76092,76091,76089,76088,76087,76085,76084,76083,76081,76080,76079,76077,76076,76075,76073,76072,76070,76069,76068,76066,76065,76064,76062,76061,76060,76058,76057,76056,76054,76053,76052,76050,76049,76048,76046,76045,76044,76042,76041,76040,76038,76037,76035,76034,76033,76031,76030,76029,76027,76026,76025,76023,76022,76021,76019,76018,76017,76015,76014,76013,76011,76010,76009,76007,76006,76005,76003,76002,76000,75999,75998,75996,75995,75994,75992,75991,75990,75988,75987,75986,75984,75983,75982,75980,75979,75978,75976,75975,75974,75972,75971,75970,75968,75967,75966,75964,75963,75962,75960,75959,75957,75956,75955,75953,75952,75951,75949,75948,75947,75945,75944,75943,75941,75940,75939,75937,75936,75935,75933,75932,75931,75929,75928,75927,75925,75924,75923,75921,75920,75919,75917,75916,75915,75913,75912,75910,75909,75908,75906,75905,75904,75902,75901,75900,75898,75897,75896,75894,75893,75892,75890,75889,75888,75886,75885,75884,75882,75881,75880,75878,75877,75876,75874,75873,75872,75870,75869,75868,75866,75865,75864,75862,75861,75860,75858,75857,75856,75854,75853,75851,75850,75849,75847,75846,75845,75843,75842,75841,75839,75838,75837,75835,75834,75833,75831,75830,75829,75827,75826,75825,75823,75822,75821,75819,75818,75817,75815,75814,75813,75811,75810,75809,75807,75806,75805,75803,75802,75801,75799,75798,75797,75795,75794,75793,75791,75790,75789,75787,75786,75785,75783,75782,75781,75779,75778,75777,75775,75774,75773,75771,75770,75769,75767,75766,75765,75763,75762,75761,75759,75758,75757,75755,75754,75752,75751,75750,75748,75747,75746,75744,75743,75742,75740,75739,75738,75736,75735,75734,75732,75731,75730,75728,75727,75726,75724,75723,75722,75720,75719,75718,75716,75715,75714,75712,75711,75710,75708,75707,75706,75704,75703,75702,75700,75699,75698,75696,75695,75694,75692,75691,75690,75688,75687,75686,75684,75683,75682,75680,75679,75678,75676,75675,75674,75672,75671,75670,75668,75667,75666,75664,75663,75662,75660,75659,75658,75656,75655,75654,75652,75651,75650,75648,75647,75646,75644,75643,75642,75640,75639,75638,75636,75635,75634,75632,75631,75630,75628,75627,75626,75624,75623,75622,75620,75619,75618,75616,75615,75614,75612,75611,75610,75608,75607,75606,75604,75603,75602,75600,75599,75598,75596,75595,75594,75593,75591,75590,75589,75587,75586,75585,75583,75582,75581,75579,75578,75577,75575,75574,75573,75571,75570,75569,75567,75566,75565,75563,75562,75561,75559,75558,75557,75555,75554,75553,75551,75550,75549,75547,75546,75545,75543,75542,75541,75539,75538,75537,75535,75534,75533,75531,75530,75529,75527,75526,75525,75523,75522,75521,75519,75518,75517,75515,75514,75513,75511,75510,75509,75507,75506,75505,75503,75502,75501,75499,75498,75497,75496,75494,75493,75492,75490,75489,75488,75486,75485,75484,75482,75481,75480,75478,75477,75476,75474,75473,75472,75470,75469,75468,75466,75465,75464,75462,75461,75460,75458,75457,75456,75454,75453,75452,75450,75449,75448,75446,75445,75444,75442,75441,75440,75438,75437,75436,75435,75433,75432,75431,75429,75428,75427,75425,75424,75423,75421,75420,75419,75417,75416,75415,75413,75412,75411,75409,75408,75407,75405,75404,75403,75401,75400,75399,75397,75396,75395,75393,75392,75391,75389,75388,75387,75386,75384,75383,75382,75380,75379,75378,75376,75375,75374,75372,75371,75370,75368,75367,75366,75364,75363,75362,75360,75359,75358,75356,75355,75354,75352,75351,75350,75348,75347,75346,75345,75343,75342,75341,75339,75338,75337,75335,75334,75333,75331,75330,75329,75327,75326,75325,75323,75322,75321,75319,75318,75317,75315,75314,75313,75311,75310,75309,75308,75306,75305,75304,75302,75301,75300,75298,75297,75296,75294,75293,75292,75290,75289,75288,75286,75285,75284,75282,75281,75280,75278,75277,75276,75275,75273,75272,75271,75269,75268,75267,75265,75264,75263,75261,75260,75259,75257,75256,75255,75253,75252,75251,75249,75248,75247,75246,75244,75243,75242,75240,75239,75238,75236,75235,75234,75232,75231,75230,75228,75227,75226,75224,75223,75222,75220,75219,75218,75217,75215,75214,75213,75211,75210,75209,75207,75206,75205,75203,75202,75201,75199,75198,75197,75195,75194,75193,75192,75190,75189,75188,75186,75185,75184,75182,75181,75180,75178,75177,75176,75174,75173,75172,75170,75169,75168,75167,75165,75164,75163,75161,75160,75159,75157,75156,75155,75153,75152,75151,75149,75148,75147,75145,75144,75143,75142,75140,75139,75138,75136,75135,75134,75132,75131,75130,75128,75127,75126,75124,75123,75122,75120,75119,75118,75117,75115,75114,75113,75111,75110,75109,75107,75106,75105,75103,75102,75101,75099,75098,75097,75096,75094,75093,75092,75090,75089,75088,75086,75085,75084,75082,75081,75080,75078,75077,75076,75075,75073,75072,75071,75069,75068,75067,75065,75064,75063,75061,75060,75059,75057,75056,75055,75054,75052,75051,75050,75048,75047,75046,75044,75043,75042,75040,75039,75038,75036,75035,75034,75033,75031,75030,75029,75027,75026,75025,75023,75022,75021,75019,75018,75017,75016,75014,75013,75012,75010,75009,75008,75006,75005,75004,75002,75001,75000,74998,74997,74996,74995,74993,74992,74991,74989,74988,74987,74985,74984,74983,74981,74980,74979,74978,74976,74975,74974,74972,74971,74970,74968,74967,74966,74964,74963,74962,74961,74959,74958,74957,74955,74954,74953,74951,74950,74949,74947,74946,74945,74944,74942,74941,74940,74938,74937,74936,74934,74933,74932,74930,74929,74928,74927,74925,74924,74923,74921,74920,74919,74917,74916,74915,74913,74912,74911,74910,74908,74907,74906,74904,74903,74902,74900,74899,74898,74896,74895,74894,74893,74891,74890,74889,74887,74886,74885,74883,74882,74881,74880,74878,74877,74876,74874,74873,74872,74870,74869,74868,74866,74865,74864,74863,74861,74860,74859,74857,74856,74855,74853,74852,74851,74849,74848,74847,74846,74844,74843,74842,74840,74839,74838,74836,74835,74834,74833,74831,74830,74829,74827,74826,74825,74823,74822,74821,74820,74818,74817,74816,74814,74813,74812,74810,74809,74808,74806,74805,74804,74803,74801,74800,74799,74797,74796,74795,74793,74792,74791,74790,74788,74787,74786,74784,74783,74782,74780,74779,74778,74777,74775,74774,74773,74771,74770,74769,74767,74766,74765,74764,74762,74761,74760,74758,74757,74756,74754,74753,74752,74750,74749,74748,74747,74745,74744,74743,74741,74740,74739,74737,74736,74735,74734,74732,74731,74730,74728,74727,74726,74724,74723,74722,74721,74719,74718,74717,74715,74714,74713,74711,74710,74709,74708,74706,74705,74704,74702,74701,74700,74698,74697,74696,74695,74693,74692,74691,74689,74688,74687,74685,74684,74683,74682,74680,74679,74678,74676,74675,74674,74673,74671,74670,74669,74667,74666,74665,74663,74662,74661,74660,74658,74657,74656,74654,74653,74652,74650,74649,74648,74647,74645,74644,74643,74641,74640,74639,74637,74636,74635,74634,74632,74631,74630,74628,74627,74626,74625,74623,74622,74621,74619,74618,74617,74615,74614,74613,74612,74610,74609,74608,74606,74605,74604,74602,74601,74600,74599,74597,74596,74595,74593,74592,74591,74590,74588,74587,74586,74584,74583,74582,74580,74579,74578,74577,74575,74574,74573,74571,74570,74569,74567,74566,74565,74564,74562,74561,74560,74558,74557,74556,74555,74553,74552,74551,74549,74548,74547,74545,74544,74543,74542,74540,74539,74538,74536,74535,74534,74533,74531,74530,74529,74527,74526,74525,74524,74522,74521,74520,74518,74517,74516,74514,74513,74512,74511,74509,74508,74507,74505,74504,74503,74502,74500,74499,74498,74496,74495,74494,74492,74491,74490,74489,74487,74486,74485,74483,74482,74481,74480,74478,74477,74476,74474,74473,74472,74471,74469,74468,74467,74465,74464,74463,74461,74460,74459,74458,74456,74455,74454,74452,74451,74450,74449,74447,74446,74445,74443,74442,74441,74440,74438,74437,74436,74434,74433,74432,74431,74429,74428,74427,74425,74424,74423,74421,74420,74419,74418,74416,74415,74414,74412,74411,74410,74409,74407,74406,74405,74403,74402,74401,74400,74398,74397,74396,74394,74393,74392,74391,74389,74388,74387,74385,74384,74383,74382,74380,74379,74378,74376,74375,74374,74373,74371,74370,74369,74367,74366,74365,74364,74362,74361,74360,74358,74357,74356,74354,74353,74352,74351,74349,74348,74347,74345,74344,74343,74342,74340,74339,74338,74336,74335,74334,74333,74331,74330,74329,74327,74326,74325,74324,74322,74321,74320,74318,74317,74316,74315,74313,74312,74311,74309,74308,74307,74306,74304,74303,74302,74300,74299,74298,74297,74295,74294,74293,74291,74290,74289,74288,74286,74285,74284,74282,74281,74280,74279,74277,74276,74275,74273,74272,74271,74270,74268,74267,74266,74264,74263,74262,74261,74259,74258,74257,74256,74254,74253,74252,74250,74249,74248,74247,74245,74244,74243,74241,74240,74239,74238,74236,74235,74234,74232,74231,74230,74229,74227,74226,74225,74223,74222,74221,74220,74218,74217,74216,74214,74213,74212,74211,74209,74208,74207,74205,74204,74203,74202,74200,74199,74198,74196,74195,74194,74193,74191,74190,74189,74188,74186,74185,74184,74182,74181,74180,74179,74177,74176,74175,74173,74172,74171,74170,74168,74167,74166,74164,74163,74162,74161,74159,74158,74157,74156,74154,74153,74152,74150,74149,74148,74147,74145,74144,74143,74141,74140,74139,74138,74136,74135,74134,74132,74131,74130,74129,74127,74126,74125,74124,74122,74121,74120,74118,74117,74116,74115,74113,74112,74111,74109,74108,74107,74106,74104,74103,74102,74100,74099,74098,74097,74095,74094,74093,74092,74090,74089,74088,74086,74085,74084,74083,74081,74080,74079,74077,74076,74075,74074,74072,74071,74070,74069,74067,74066,74065,74063,74062,74061,74060,74058,74057,74056,74054,74053,74052,74051,74049,74048,74047,74046,74044,74043,74042,74040,74039,74038,74037,74035,74034,74033,74032,74030,74029,74028,74026,74025,74024,74023,74021,74020,74019,74017,74016,74015,74014,74012,74011,74010,74009,74007,74006,74005,74003,74002,74001,74000,73998,73997,73996,73995,73993,73992,73991,73989,73988,73987,73986,73984,73983,73982,73981,73979,73978,73977,73975,73974,73973,73972,73970,73969,73968,73966,73965,73964,73963,73961,73960,73959,73958,73956,73955,73954,73952,73951,73950,73949,73947,73946,73945,73944,73942,73941,73940,73938,73937,73936,73935,73933,73932,73931,73930,73928,73927,73926,73924,73923,73922,73921,73919,73918,73917,73916,73914,73913,73912,73910,73909,73908,73907,73905,73904,73903,73902,73900,73899,73898,73896,73895,73894,73893,73891,73890,73889,73888,73886,73885,73884,73883,73881,73880,73879,73877,73876,73875,73874,73872,73871,73870,73869,73867,73866,73865,73863,73862,73861,73860,73858,73857,73856,73855,73853,73852,73851,73849,73848,73847,73846,73844,73843,73842,73841,73839,73838,73837,73836,73834,73833,73832,73830,73829,73828,73827,73825,73824,73823,73822,73820,73819,73818,73816,73815,73814,73813,73811,73810,73809,73808,73806,73805,73804,73803,73801,73800,73799,73797,73796,73795,73794,73792,73791,73790,73789,73787,73786,73785,73784,73782,73781,73780,73778,73777,73776,73775,73773,73772,73771,73770,73768,73767,73766,73765,73763,73762,73761,73759,73758,73757,73756,73754,73753,73752,73751,73749,73748,73747,73746,73744,73743,73742,73740,73739,73738,73737,73735,73734,73733,73732,73730,73729,73728,73727,73725,73724,73723,73721,73720,73719,73718,73716,73715,73714,73713,73711,73710,73709,73708,73706,73705,73704,73702,73701,73700,73699,73697,73696,73695,73694,73692,73691,73690,73689,73687,73686,73685,73684,73682,73681,73680,73678,73677,73676,73675,73673,73672,73671,73670,73668,73667,73666,73665,73663,73662,73661,73660,73658,73657,73656,73654,73653,73652,73651,73649,73648,73647,73646,73644,73643,73642,73641,73639,73638,73637,73636,73634,73633,73632,73630,73629,73628,73627,73625,73624,73623,73622,73620,73619,73618,73617,73615,73614,73613,73612,73610,73609,73608,73606,73605,73604,73603,73601,73600,73599,73598,73596,73595,73594,73593,73591,73590,73589,73588,73586,73585,73584,73583,73581,73580,73579,73577,73576,73575,73574,73572,73571,73570,73569,73567,73566,73565,73564,73562,73561,73560,73559,73557,73556,73555,73554,73552,73551,73550,73549,73547,73546,73545,73543,73542,73541,73540,73538,73537,73536,73535,73533,73532,73531,73530,73528,73527,73526,73525,73523,73522,73521,73520,73518,73517,73516,73515,73513,73512,73511,73509,73508,73507,73506,73504,73503,73502,73501,73499,73498,73497,73496,73494,73493,73492,73491,73489,73488,73487,73486,73484,73483,73482,73481,73479,73478,73477,73476,73474,73473,73472,73470,73469,73468,73467,73465,73464,73463,73462,73460,73459,73458,73457,73455,73454,73453,73452,73450,73449,73448,73447,73445,73444,73443,73442,73440,73439,73438,73437,73435,73434,73433,73432,73430,73429,73428,73427,73425,73424,73423,73422,73420,73419,73418,73416,73415,73414,73413,73411,73410,73409,73408,73406,73405,73404,73403,73401,73400,73399,73398,73396,73395,73394,73393,73391,73390,73389,73388,73386,73385,73384,73383,73381,73380,73379,73378,73376,73375,73374,73373,73371,73370,73369,73368,73366,73365,73364,73363,73361,73360,73359,73358,73356,73355,73354,73353,73351,73350,73349,73348,73346,73345,73344,73343,73341,73340,73339,73338,73336,73335,73334,73333,73331,73330,73329,73327,73326,73325,73324,73322,73321,73320,73319,73317,73316,73315,73314,73312,73311,73310,73309,73307,73306,73305,73304,73302,73301,73300,73299,73297,73296,73295,73294,73292,73291,73290,73289,73287,73286,73285,73284,73282,73281,73280,73279,73277,73276,73275,73274,73272,73271,73270,73269,73267,73266,73265,73264,73262,73261,73260,73259,73257,73256,73255,73254,73252,73251,73250,73249,73247,73246,73245,73244,73242,73241,73240,73239,73237,73236,73235,73234,73232,73231,73230,73229,73227,73226,73225,73224,73222,73221,73220,73219,73217,73216,73215,73214,73213,73211,73210,73209,73208,73206,73205,73204,73203,73201,73200,73199,73198,73196,73195,73194,73193,73191,73190,73189,73188,73186,73185,73184,73183,73181,73180,73179,73178,73176,73175,73174,73173,73171,73170,73169,73168,73166,73165,73164,73163,73161,73160,73159,73158,73156,73155,73154,73153,73151,73150,73149,73148,73146,73145,73144,73143,73141,73140,73139,73138,73136,73135,73134,73133,73131,73130,73129,73128,73126,73125,73124,73123,73122,73120,73119,73118,73117,73115,73114,73113,73112,73110,73109,73108,73107,73105,73104,73103,73102,73100,73099,73098,73097,73095,73094,73093,73092,73090,73089,73088,73087,73085,73084,73083,73082,73080,73079,73078,73077,73075,73074,73073,73072,73071,73069,73068,73067,73066,73064,73063,73062,73061,73059,73058,73057,73056,73054,73053,73052,73051,73049,73048,73047,73046,73044,73043,73042,73041,73039,73038,73037,73036,73034,73033,73032,73031,73030,73028,73027,73026,73025,73023,73022,73021,73020,73018,73017,73016,73015,73013,73012,73011,73010,73008,73007,73006,73005,73003,73002,73001,73000,72998,72997,72996,72995,72994,72992,72991,72990,72989,72987,72986,72985,72984,72982,72981,72980,72979,72977,72976,72975,72974,72972,72971,72970,72969,72967,72966,72965,72964,72963,72961,72960,72959,72958,72956,72955,72954,72953,72951,72950,72949,72948,72946,72945,72944,72943,72941,72940,72939,72938,72936,72935,72934,72933,72932,72930,72929,72928,72927,72925,72924,72923,72922,72920,72919,72918,72917,72915,72914,72913,72912,72910,72909,72908,72907,72906,72904,72903,72902,72901,72899,72898,72897,72896,72894,72893,72892,72891,72889,72888,72887,72886,72885,72883,72882,72881,72880,72878,72877,72876,72875,72873,72872,72871,72870,72868,72867,72866,72865,72863,72862,72861,72860,72859,72857,72856,72855,72854,72852,72851,72850,72849,72847,72846,72845,72844,72842,72841,72840,72839,72838,72836,72835,72834,72833,72831,72830,72829,72828,72826,72825,72824,72823,72821,72820,72819,72818,72817,72815,72814,72813,72812,72810,72809,72808,72807,72805,72804,72803,72802,72800,72799,72798,72797,72796,72794,72793,72792,72791,72789,72788,72787,72786,72784,72783,72782,72781,72780,72778,72777,72776,72775,72773,72772,72771,72770,72768,72767,72766,72765,72763,72762,72761,72760,72759,72757,72756,72755,72754,72752,72751,72750,72749,72747,72746,72745,72744,72743,72741,72740,72739,72738,72736,72735,72734,72733,72731,72730,72729,72728,72727,72725,72724,72723,72722,72720,72719,72718,72717,72715,72714,72713,72712,72711,72709,72708,72707,72706,72704,72703,72702,72701,72699,72698,72697,72696,72695,72693,72692,72691,72690,72688,72687,72686,72685,72683,72682,72681,72680,72679,72677,72676,72675,72674,72672,72671,72670,72669,72667,72666,72665,72664,72663,72661,72660,72659,72658,72656,72655,72654,72653,72651,72650,72649,72648,72647,72645,72644,72643,72642,72640,72639,72638,72637,72636,72634,72633,72632,72631,72629,72628,72627,72626,72624,72623,72622,72621,72620,72618,72617,72616,72615,72613,72612,72611,72610,72608,72607,72606,72605,72604,72602,72601,72600,72599,72597,72596,72595,72594,72593,72591,72590,72589,72588,72586,72585,72584,72583,72582,72580,72579,72578,72577,72575,72574,72573,72572,72570,72569,72568,72567,72566,72564,72563,72562,72561,72559,72558,72557,72556,72555,72553,72552,72551,72550,72548,72547,72546,72545,72544,72542,72541,72540,72539,72537,72536,72535,72534,72532,72531,72530,72529,72528,72526,72525,72524,72523,72521,72520,72519,72518,72517,72515,72514,72513,72512,72510,72509,72508,72507,72506,72504,72503,72502,72501,72499,72498,72497,72496,72495,72493,72492,72491,72490,72488,72487,72486,72485,72484,72482,72481,72480,72479,72477,72476,72475,72474,72473,72471,72470,72469,72468,72466,72465,72464,72463,72461,72460,72459,72458,72457,72455,72454,72453,72452,72450,72449,72448,72447,72446,72444,72443,72442,72441,72439,72438,72437,72436,72435,72433,72432,72431,72430,72429,72427,72426,72425,72424,72422,72421,72420,72419,72418,72416,72415,72414,72413,72411,72410,72409,72408,72407,72405,72404,72403,72402,72400,72399,72398,72397,72396,72394,72393,72392,72391,72389,72388,72387,72386,72385,72383,72382,72381,72380,72378,72377,72376,72375,72374,72372,72371,72370,72369,72367,72366,72365,72364,72363,72361,72360,72359,72358,72357,72355,72354,72353,72352,72350,72349,72348,72347,72346,72344,72343,72342,72341,72339,72338,72337,72336,72335,72333,72332,72331,72330,72328,72327,72326,72325,72324,72322,72321,72320,72319,72318,72316,72315,72314,72313,72311,72310,72309,72308,72307,72305,72304,72303,72302,72300,72299,72298,72297,72296,72294,72293,72292,72291,72290,72288,72287,72286,72285,72283,72282,72281,72280,72279,72277,72276,72275,72274,72272,72271,72270,72269,72268,72266,72265,72264,72263,72262,72260,72259,72258,72257,72255,72254,72253,72252,72251,72249,72248,72247,72246,72245,72243,72242,72241,72240,72238,72237,72236,72235,72234,72232,72231,72230,72229,72228,72226,72225,72224,72223,72221,72220,72219,72218,72217,72215,72214,72213,72212,72211,72209,72208,72207,72206,72204,72203,72202,72201,72200,72198,72197,72196,72195,72194,72192,72191,72190,72189,72187,72186,72185,72184,72183,72181,72180,72179,72178,72177,72175,72174,72173,72172,72170,72169,72168,72167,72166,72164,72163,72162,72161,72160,72158,72157,72156,72155,72154,72152,72151,72150,72149,72147,72146,72145,72144,72143,72141,72140,72139,72138,72137,72135,72134,72133,72132,72130,72129,72128,72127,72126,72124,72123,72122,72121,72120,72118,72117,72116,72115,72114,72112,72111,72110,72109,72107,72106,72105,72104,72103,72101,72100,72099,72098,72097,72095,72094,72093,72092,72091,72089,72088,72087,72086,72084,72083,72082,72081,72080,72078,72077,72076,72075,72074,72072,72071,72070,72069,72068,72066,72065,72064,72063,72062,72060,72059,72058,72057,72055,72054,72053,72052,72051,72049,72048,72047,72046,72045,72043,72042,72041,72040,72039,72037,72036,72035,72034,72032,72031,72030,72029,72028,72026,72025,72024,72023,72022,72020,72019,72018,72017,72016,72014,72013,72012,72011,72010,72008,72007,72006,72005,72004,72002,72001,72000,71999,71997,71996,71995,71994,71993,71991,71990,71989,71988,71987,71985,71984,71983,71982,71981,71979,71978,71977,71976,71975,71973,71972,71971,71970,71969,71967,71966,71965,71964,71962,71961,71960,71959,71958,71956,71955,71954,71953,71952,71950,71949,71948,71947,71946,71944,71943,71942,71941,71940,71938,71937,71936,71935,71934,71932,71931,71930,71929,71928,71926,71925,71924,71923,71922,71920,71919,71918,71917,71916,71914,71913,71912,71911,71909,71908,71907,71906,71905,71903,71902,71901,71900,71899,71897,71896,71895,71894,71893,71891,71890,71889,71888,71887,71885,71884,71883,71882,71881,71879,71878,71877,71876,71875,71873,71872,71871,71870,71869,71867,71866,71865,71864,71863,71861,71860,71859,71858,71857,71855,71854,71853,71852,71851,71849,71848,71847,71846,71845,71843,71842,71841,71840,71839,71837,71836,71835,71834,71833,71831,71830,71829,71828,71827,71825,71824,71823,71822,71820,71819,71818,71817,71816,71814,71813,71812,71811,71810,71808,71807,71806,71805,71804,71802,71801,71800,71799,71798,71796,71795,71794,71793,71792,71790,71789,71788,71787,71786,71784,71783,71782,71781,71780,71778,71777,71776,71775,71774,71772,71771,71770,71769,71768,71766,71765,71764,71763,71762,71760,71759,71758,71757,71756,71755,71753,71752,71751,71750,71749,71747,71746,71745,71744,71743,71741,71740,71739,71738,71737,71735,71734,71733,71732,71731,71729,71728,71727,71726,71725,71723,71722,71721,71720,71719,71717,71716,71715,71714,71713,71711,71710,71709,71708,71707,71705,71704,71703,71702,71701,71699,71698,71697,71696,71695,71693,71692,71691,71690,71689,71687,71686,71685,71684,71683,71681,71680,71679,71678,71677,71675,71674,71673,71672,71671,71669,71668,71667,71666,71665,71664,71662,71661,71660,71659,71658,71656,71655,71654,71653,71652,71650,71649,71648,71647,71646,71644,71643,71642,71641,71640,71638,71637,71636,71635,71634,71632,71631,71630,71629,71628,71626,71625,71624,71623,71622,71620,71619,71618,71617,71616,71615,71613,71612,71611,71610,71609,71607,71606,71605,71604,71603,71601,71600,71599,71598,71597,71595,71594,71593,71592,71591,71589,71588,71587,71586,71585,71583,71582,71581,71580,71579,71578,71576,71575,71574,71573,71572,71570,71569,71568,71567,71566,71564,71563,71562,71561,71560,71558,71557,71556,71555,71554,71552,71551,71550,71549,71548,71547,71545,71544,71543,71542,71541,71539,71538,71537,71536,71535,71533,71532,71531,71530,71529,71527,71526,71525,71524,71523,71521,71520,71519,71518,71517,71516,71514,71513,71512,71511,71510,71508,71507,71506,71505,71504,71502,71501,71500,71499,71498,71496,71495,71494,71493,71492,71491,71489,71488,71487,71486,71485,71483,71482,71481,71480,71479,71477,71476,71475,71474,71473,71472,71470,71469,71468,71467,71466,71464,71463,71462,71461,71460,71458,71457,71456,71455,71454,71452,71451,71450,71449,71448,71447,71445,71444,71443,71442,71441,71439,71438,71437,71436,71435,71433,71432,71431,71430,71429,71428,71426,71425,71424,71423,71422,71420,71419,71418,71417,71416,71414,71413,71412,71411,71410,71409,71407,71406,71405,71404,71403,71401,71400,71399,71398,71397,71395,71394,71393,71392,71391,71390,71388,71387,71386,71385,71384,71382,71381,71380,71379,71378,71376,71375,71374,71373,71372,71371,71369,71368,71367,71366,71365,71363,71362,71361,71360,71359,71358,71356,71355,71354,71353,71352,71350,71349,71348,71347,71346,71344,71343,71342,71341,71340,71339,71337,71336,71335,71334,71333,71331,71330,71329,71328,71327,71326,71324,71323,71322,71321,71320,71318,71317,71316,71315,71314,71312,71311,71310,71309,71308,71307,71305,71304,71303,71302,71301,71299,71298,71297,71296,71295,71294,71292,71291,71290,71289,71288,71286,71285,71284,71283,71282,71281,71279,71278,71277,71276,71275,71273,71272,71271,71270,71269,71268,71266,71265,71264,71263,71262,71260,71259,71258,71257,71256,71255,71253,71252,71251,71250,71249,71247,71246,71245,71244,71243,71242,71240,71239,71238,71237,71236,71234,71233,71232,71231,71230,71229,71227,71226,71225,71224,71223,71221,71220,71219,71218,71217,71216,71214,71213,71212,71211,71210,71208,71207,71206,71205,71204,71203,71201,71200,71199,71198,71197,71195,71194,71193,71192,71191,71190,71188,71187,71186,71185,71184,71182,71181,71180,71179,71178,71177,71175,71174,71173,71172,71171,71170,71168,71167,71166,71165,71164,71162,71161,71160,71159,71158,71157,71155,71154,71153,71152,71151,71149,71148,71147,71146,71145,71144,71142,71141,71140,71139,71138,71137,71135,71134,71133,71132,71131,71129,71128,71127,71126,71125,71124,71122,71121,71120,71119,71118,71116,71115,71114,71113,71112,71111,71109,71108,71107,71106,71105,71104,71102,71101,71100,71099,71098,71096,71095,71094,71093,71092,71091,71089,71088,71087,71086,71085,71084,71082,71081,71080,71079,71078,71076,71075,71074,71073,71072,71071,71069,71068,71067,71066,71065,71064,71062,71061,71060,71059,71058,71056,71055,71054,71053,71052,71051,71049,71048,71047,71046,71045,71044,71042,71041,71040,71039,71038,71036,71035,71034,71033,71032,71031,71029,71028,71027,71026,71025,71024,71022,71021,71020,71019,71018,71017,71015,71014,71013,71012,71011,71009,71008,71007,71006,71005,71004,71002,71001,71000,70999,70998,70997,70995,70994,70993,70992,70991,70990,70988,70987,70986,70985,70984,70982,70981,70980,70979,70978,70977,70975,70974,70973,70972,70971,70970,70968,70967,70966,70965,70964,70963,70961,70960,70959,70958,70957,70956,70954,70953,70952,70951,70950,70948,70947,70946,70945,70944,70943,70941,70940,70939,70938,70937,70936,70934,70933,70932,70931,70930,70929,70927,70926,70925,70924,70923,70922,70920,70919,70918,70917,70916,70915,70913,70912,70911,70910,70909,70907,70906,70905,70904,70903,70902,70900,70899,70898,70897,70896,70895,70893,70892,70891,70890,70889,70888,70886,70885,70884,70883,70882,70881,70879,70878,70877,70876,70875,70874,70872,70871,70870,70869,70868,70867,70865,70864,70863,70862,70861,70860,70858,70857,70856,70855,70854,70853,70851,70850,70849,70848,70847,70845,70844,70843,70842,70841,70840,70838,70837,70836,70835,70834,70833,70831,70830,70829,70828,70827,70826,70824,70823,70822,70821,70820,70819,70817,70816,70815,70814,70813,70812,70810,70809,70808,70807,70806,70805,70803,70802,70801,70800,70799,70798,70796,70795,70794,70793,70792,70791,70789,70788,70787,70786,70785,70784,70782,70781,70780,70779,70778,70777,70775,70774,70773,70772,70771,70770,70768,70767,70766,70765,70764,70763,70761,70760,70759,70758,70757,70756,70754,70753,70752,70751,70750,70749,70747,70746,70745,70744,70743,70742,70740,70739,70738,70737,70736,70735,70733,70732,70731,70730,70729,70728,70726,70725,70724,70723,70722,70721,70720,70718,70717,70716,70715,70714,70713,70711,70710,70709,70708,70707,70706,70704,70703,70702,70701,70700,70699,70697,70696,70695,70694,70693,70692,70690,70689,70688,70687,70686,70685,70683,70682,70681,70680,70679,70678,70676,70675,70674,70673,70672,70671,70669,70668,70667,70666,70665,70664,70662,70661,70660,70659,70658,70657,70656,70654,70653,70652,70651,70650,70649,70647,70646,70645,70644,70643,70642,70640,70639,70638,70637,70636,70635,70633,70632,70631,70630,70629,70628,70626,70625,70624,70623,70622,70621,70620,70618,70617,70616,70615,70614,70613,70611,70610,70609,70608,70607,70606,70604,70603,70602,70601,70600,70599,70597,70596,70595,70594,70593,70592,70590,70589,70588,70587,70586,70585,70584,70582,70581,70580,70579,70578,70577,70575,70574,70573,70572,70571,70570,70568,70567,70566,70565,70564,70563,70561,70560,70559,70558,70557,70556,70555,70553,70552,70551,70550,70549,70548,70546,70545,70544,70543,70542,70541,70539,70538,70537,70536,70535,70534,70533,70531,70530,70529,70528,70527,70526,70524,70523,70522,70521,70520,70519,70517,70516,70515,70514,70513,70512,70511,70509,70508,70507,70506,70505,70504,70502,70501,70500,70499,70498,70497,70495,70494,70493,70492,70491,70490,70489,70487,70486,70485,70484,70483,70482,70480,70479,70478,70477,70476,70475,70474,70472,70471,70470,70469,70468,70467,70465,70464,70463,70462,70461,70460,70458,70457,70456,70455,70454,70453,70452,70450,70449,70448,70447,70446,70445,70443,70442,70441,70440,70439,70438,70437,70435,70434,70433,70432,70431,70430,70428,70427,70426,70425,70424,70423,70422,70420,70419,70418,70417,70416,70415,70413,70412,70411,70410,70409,70408,70406,70405,70404,70403,70402,70401,70400,70398,70397,70396,70395,70394,70393,70391,70390,70389,70388,70387,70386,70385,70383,70382,70381,70380,70379,70378,70376,70375,70374,70373,70372,70371,70370,70368,70367,70366,70365,70364,70363,70362,70360,70359,70358,70357,70356,70355,70353,70352,70351,70350,70349,70348,70347,70345,70344,70343,70342,70341,70340,70338,70337,70336,70335,70334,70333,70332,70330,70329,70328,70327,70326,70325,70323,70322,70321,70320,70319,70318,70317,70315,70314,70313,70312,70311,70310,70309,70307,70306,70305,70304,70303,70302,70300,70299,70298,70297,70296,70295,70294,70292,70291,70290,70289,70288,70287,70286,70284,70283,70282,70281,70280,70279,70277,70276,70275,70274,70273,70272,70271,70269,70268,70267,70266,70265,70264,70263,70261,70260,70259,70258,70257,70256,70254,70253,70252,70251,70250,70249,70248,70246,70245,70244,70243,70242,70241,70240,70238,70237,70236,70235,70234,70233,70231,70230,70229,70228,70227,70226,70225,70223,70222,70221,70220,70219,70218,70217,70215,70214,70213,70212,70211,70210,70209,70207,70206,70205,70204,70203,70202,70201,70199,70198,70197,70196,70195,70194,70192,70191,70190,70189,70188,70187,70186,70184,70183,70182,70181,70180,70179,70178,70176,70175,70174,70173,70172,70171,70170,70168,70167,70166,70165,70164,70163,70162,70160,70159,70158,70157,70156,70155,70153,70152,70151,70150,70149,70148,70147,70145,70144,70143,70142,70141,70140,70139,70137,70136,70135,70134,70133,70132,70131,70129,70128,70127,70126,70125,70124,70123,70121,70120,70119,70118,70117,70116,70115,70113,70112,70111,70110,70109,70108,70107,70105,70104,70103,70102,70101,70100,70099,70097,70096,70095,70094,70093,70092,70091,70089,70088,70087,70086,70085,70084,70083,70081,70080,70079,70078,70077,70076,70075,70073,70072,70071,70070,70069,70068,70067,70065,70064,70063,70062,70061,70060,70059,70057,70056,70055,70054,70053,70052,70051,70049,70048,70047,70046,70045,70044,70043,70041,70040,70039,70038,70037,70036,70035,70033,70032,70031,70030,70029,70028,70027,70025,70024,70023,70022,70021,70020,70019,70017,70016,70015,70014,70013,70012,70011,70009,70008,70007,70006,70005,70004,70003,70001,70000,69999,69998,69997,69996,69995,69993,69992,69991,69990,69989,69988,69987,69985,69984,69983,69982,69981,69980,69979,69977,69976,69975,69974,69973,69972,69971,69969,69968,69967,69966,69965,69964,69963,69962,69960,69959,69958,69957,69956,69955,69954,69952,69951,69950,69949,69948,69947,69946,69944,69943,69942,69941,69940,69939,69938,69936,69935,69934,69933,69932,69931,69930,69928,69927,69926,69925,69924,69923,69922,69921,69919,69918,69917,69916,69915,69914,69913,69911,69910,69909,69908,69907,69906,69905,69903,69902,69901,69900,69899,69898,69897,69895,69894,69893,69892,69891,69890,69889,69888,69886,69885,69884,69883,69882,69881,69880,69878,69877,69876,69875,69874,69873,69872,69870,69869,69868,69867,69866,69865,69864,69862,69861,69860,69859,69858,69857,69856,69855,69853,69852,69851,69850,69849,69848,69847,69845,69844,69843,69842,69841,69840,69839,69838,69836,69835,69834,69833,69832,69831,69830,69828,69827,69826,69825,69824,69823,69822,69820,69819,69818,69817,69816,69815,69814,69813,69811,69810,69809,69808,69807,69806,69805,69803,69802,69801,69800,69799,69798,69797,69796,69794,69793,69792,69791,69790,69789,69788,69786,69785,69784,69783,69782,69781,69780,69779,69777,69776,69775,69774,69773,69772,69771,69769,69768,69767,69766,69765,69764,69763,69762,69760,69759,69758,69757,69756,69755,69754,69752,69751,69750,69749,69748,69747,69746,69745,69743,69742,69741,69740,69739,69738,69737,69735,69734,69733,69732,69731,69730,69729,69728,69726,69725,69724,69723,69722,69721,69720,69718,69717,69716,69715,69714,69713,69712,69711,69709,69708,69707,69706,69705,69704,69703,69701,69700,69699,69698,69697,69696,69695,69694,69692,69691,69690,69689,69688,69687,69686,69685,69683,69682,69681,69680,69679,69678,69677,69675,69674,69673,69672,69671,69670,69669,69668,69666,69665,69664,69663,69662,69661,69660,69659,69657,69656,69655,69654,69653,69652,69651,69650,69648,69647,69646,69645,69644,69643,69642,69640,69639,69638,69637,69636,69635,69634,69633,69631,69630,69629,69628,69627,69626,69625,69624,69622,69621,69620,69619,69618,69617,69616,69615,69613,69612,69611,69610,69609,69608,69607,69605,69604,69603,69602,69601,69600,69599,69598,69596,69595,69594,69593,69592,69591,69590,69589,69587,69586,69585,69584,69583,69582,69581,69580,69578,69577,69576,69575,69574,69573,69572,69571,69569,69568,69567,69566,69565,69564,69563,69562,69560,69559,69558,69557,69556,69555,69554,69553,69551,69550,69549,69548,69547,69546,69545,69543,69542,69541,69540,69539,69538,69537,69536,69534,69533,69532,69531,69530,69529,69528,69527,69525,69524,69523,69522,69521,69520,69519,69518,69516,69515,69514,69513,69512,69511,69510,69509,69507,69506,69505,69504,69503,69502,69501,69500,69498,69497,69496,69495,69494,69493,69492,69491,69489,69488,69487,69486,69485,69484,69483,69482,69480,69479,69478,69477,69476,69475,69474,69473,69472,69470,69469,69468,69467,69466,69465,69464,69463,69461,69460,69459,69458,69457,69456,69455,69454,69452,69451,69450,69449,69448,69447,69446,69445,69443,69442,69441,69440,69439,69438,69437,69436,69434,69433,69432,69431,69430,69429,69428,69427,69425,69424,69423,69422,69421,69420,69419,69418,69416,69415,69414,69413,69412,69411,69410,69409,69408,69406,69405,69404,69403,69402,69401,69400,69399,69397,69396,69395,69394,69393,69392,69391,69390,69388,69387,69386,69385,69384,69383,69382,69381,69379,69378,69377,69376,69375,69374,69373,69372,69371,69369,69368,69367,69366,69365,69364,69363,69362,69360,69359,69358,69357,69356,69355,69354,69353,69351,69350,69349,69348,69347,69346,69345,69344,69343,69341,69340,69339,69338,69337,69336,69335,69334,69332,69331,69330,69329,69328,69327,69326,69325,69323,69322,69321,69320,69319,69318,69317,69316,69315,69313,69312,69311,69310,69309,69308,69307,69306,69304,69303,69302,69301,69300,69299,69298,69297,69296,69294,69293,69292,69291,69290,69289,69288,69287,69285,69284,69283,69282,69281,69280,69279,69278,69277,69275,69274,69273,69272,69271,69270,69269,69268,69266,69265,69264,69263,69262,69261,69260,69259,69258,69256,69255,69254,69253,69252,69251,69250,69249,69247,69246,69245,69244,69243,69242,69241,69240,69239,69237,69236,69235,69234,69233,69232,69231,69230,69229,69227,69226,69225,69224,69223,69222,69221,69220,69218,69217,69216,69215,69214,69213,69212,69211,69210,69208,69207,69206,69205,69204,69203,69202,69201,69200,69198,69197,69196,69195,69194,69193,69192,69191,69189,69188,69187,69186,69185,69184,69183,69182,69181,69179,69178,69177,69176,69175,69174,69173,69172,69171,69169,69168,69167,69166,69165,69164,69163,69162,69161,69159,69158,69157,69156,69155,69154,69153,69152,69150,69149,69148,69147,69146,69145,69144,69143,69142,69140,69139,69138,69137,69136,69135,69134,69133,69132,69130,69129,69128,69127,69126,69125,69124,69123,69122,69120,69119,69118,69117,69116,69115,69114,69113,69112,69110,69109,69108,69107,69106,69105,69104,69103,69102,69100,69099,69098,69097,69096,69095,69094,69093,69092,69090,69089,69088,69087,69086,69085,69084,69083,69082,69080,69079,69078,69077,69076,69075,69074,69073,69072,69070,69069,69068,69067,69066,69065,69064,69063,69062,69060,69059,69058,69057,69056,69055,69054,69053,69052,69050,69049,69048,69047,69046,69045,69044,69043,69042,69040,69039,69038,69037,69036,69035,69034,69033,69032,69030,69029,69028,69027,69026,69025,69024,69023,69022,69020,69019,69018,69017,69016,69015,69014,69013,69012,69010,69009,69008,69007,69006,69005,69004,69003,69002,69001,68999,68998,68997,68996,68995,68994,68993,68992,68991,68989,68988,68987,68986,68985,68984,68983,68982,68981,68979,68978,68977,68976,68975,68974,68973,68972,68971,68969,68968,68967,68966,68965,68964,68963,68962,68961,68960,68958,68957,68956,68955,68954,68953,68952,68951,68950,68948,68947,68946,68945,68944,68943,68942,68941,68940,68938,68937,68936,68935,68934,68933,68932,68931,68930,68929,68927,68926,68925,68924,68923,68922,68921,68920,68919,68917,68916,68915,68914,68913,68912,68911,68910,68909,68908,68906,68905,68904,68903,68902,68901,68900,68899,68898,68896,68895,68894,68893,68892,68891,68890,68889,68888,68887,68885,68884,68883,68882,68881,68880,68879,68878,68877,68875,68874,68873,68872,68871,68870,68869,68868,68867,68866,68864,68863,68862,68861,68860,68859,68858,68857,68856,68854,68853,68852,68851,68850,68849,68848,68847,68846,68845,68843,68842,68841,68840,68839,68838,68837,68836,68835,68834,68832,68831,68830,68829,68828,68827,68826,68825,68824,68822,68821,68820,68819,68818,68817,68816,68815,68814,68813,68811,68810,68809,68808,68807,68806,68805,68804,68803,68802,68800,68799,68798,68797,68796,68795,68794,68793,68792,68791,68789,68788,68787,68786,68785,68784,68783,68782,68781,68780,68778,68777,68776,68775,68774,68773,68772,68771,68770,68768,68767,68766,68765,68764,68763,68762,68761,68760,68759,68757,68756,68755,68754,68753,68752,68751,68750,68749,68748,68746,68745,68744,68743,68742,68741,68740,68739,68738,68737,68735,68734,68733,68732,68731,68730,68729,68728,68727,68726,68724,68723,68722,68721,68720,68719,68718,68717,68716,68715,68713,68712,68711,68710,68709,68708,68707,68706,68705,68704,68702,68701,68700,68699,68698,68697,68696,68695,68694,68693,68692,68690,68689,68688,68687,68686,68685,68684,68683,68682,68681,68679,68678,68677,68676,68675,68674,68673,68672,68671,68670,68668,68667,68666,68665,68664,68663,68662,68661,68660,68659,68657,68656,68655,68654,68653,68652,68651,68650,68649,68648,68646,68645,68644,68643,68642,68641,68640,68639,68638,68637,68636,68634,68633,68632,68631,68630,68629,68628,68627,68626,68625,68623,68622,68621,68620,68619,68618,68617,68616,68615,68614,68612,68611,68610,68609,68608,68607,68606,68605,68604,68603,68602,68600,68599,68598,68597,68596,68595,68594,68593,68592,68591,68589,68588,68587,68586,68585,68584,68583,68582,68581,68580,68579,68577,68576,68575,68574,68573,68572,68571,68570,68569,68568,68566,68565,68564,68563,68562,68561,68560,68559,68558,68557,68556,68554,68553,68552,68551,68550,68549,68548,68547,68546,68545,68544,68542,68541,68540,68539,68538,68537,68536,68535,68534,68533,68531,68530,68529,68528,68527,68526,68525,68524,68523,68522,68521,68519,68518,68517,68516,68515,68514,68513,68512,68511,68510,68509,68507,68506,68505,68504,68503,68502,68501,68500,68499,68498,68497,68495,68494,68493,68492,68491,68490,68489,68488,68487,68486,68484,68483,68482,68481,68480,68479,68478,68477,68476,68475,68474,68472,68471,68470,68469,68468,68467,68466,68465,68464,68463,68462,68460,68459,68458,68457,68456,68455,68454,68453,68452,68451,68450,68448,68447,68446,68445,68444,68443,68442,68441,68440,68439,68438,68436,68435,68434,68433,68432,68431,68430,68429,68428,68427,68426,68424,68423,68422,68421,68420,68419,68418,68417,68416,68415,68414,68412,68411,68410,68409,68408,68407,68406,68405,68404,68403,68402,68401,68399,68398,68397,68396,68395,68394,68393,68392,68391,68390,68389,68387,68386,68385,68384,68383,68382,68381,68380,68379,68378,68377,68375,68374,68373,68372,68371,68370,68369,68368,68367,68366,68365,68363,68362,68361,68360,68359,68358,68357,68356,68355,68354,68353,68352,68350,68349,68348,68347,68346,68345,68344,68343,68342,68341,68340,68338,68337,68336,68335,68334,68333,68332,68331,68330,68329,68328,68327,68325,68324,68323,68322,68321,68320,68319,68318,68317,68316,68315,68313,68312,68311,68310,68309,68308,68307,68306,68305,68304,68303,68302,68300,68299,68298,68297,68296,68295,68294,68293,68292,68291,68290,68288,68287,68286,68285,68284,68283,68282,68281,68280,68279,68278,68277,68275,68274,68273,68272,68271,68270,68269,68268,68267,68266,68265,68264,68262,68261,68260,68259,68258,68257,68256,68255,68254,68253,68252,68251,68249,68248,68247,68246,68245,68244,68243,68242,68241,68240,68239,68237,68236,68235,68234,68233,68232,68231,68230,68229,68228,68227,68226,68224,68223,68222,68221,68220,68219,68218,68217,68216,68215,68214,68213,68211,68210,68209,68208,68207,68206,68205,68204,68203,68202,68201,68200,68198,68197,68196,68195,68194,68193,68192,68191,68190,68189,68188,68187,68185,68184,68183,68182,68181,68180,68179,68178,68177,68176,68175,68174,68173,68171,68170,68169,68168,68167,68166,68165,68164,68163,68162,68161,68160,68158,68157,68156,68155,68154,68153,68152,68151,68150,68149,68148,68147,68145,68144,68143,68142,68141,68140,68139,68138,68137,68136,68135,68134,68132,68131,68130,68129,68128,68127,68126,68125,68124,68123,68122,68121,68120,68118,68117,68116,68115,68114,68113,68112,68111,68110,68109,68108,68107,68105,68104,68103,68102,68101,68100,68099,68098,68097,68096,68095,68094,68093,68091,68090,68089,68088,68087,68086,68085,68084,68083,68082,68081,68080,68078,68077,68076,68075,68074,68073,68072,68071,68070,68069,68068,68067,68066,68064,68063,68062,68061,68060,68059,68058,68057,68056,68055,68054,68053,68052,68050,68049,68048,68047,68046,68045,68044,68043,68042,68041,68040,68039,68038,68036,68035,68034,68033,68032,68031,68030,68029,68028,68027,68026,68025,68024,68022,68021,68020,68019,68018,68017,68016,68015,68014,68013,68012,68011,68010,68008,68007,68006,68005,68004,68003,68002,68001,68000,67999,67998,67997,67996,67994,67993,67992,67991,67990,67989,67988,67987,67986,67985,67984,67983,67982,67980,67979,67978,67977,67976,67975,67974,67973,67972,67971,67970,67969,67968,67966,67965,67964,67963,67962,67961,67960,67959,67958,67957,67956,67955,67954,67952,67951,67950,67949,67948,67947,67946,67945,67944,67943,67942,67941,67940,67938,67937,67936,67935,67934,67933,67932,67931,67930,67929,67928,67927,67926,67925,67923,67922,67921,67920,67919,67918,67917,67916,67915,67914,67913,67912,67911,67909,67908,67907,67906,67905,67904,67903,67902,67901,67900,67899,67898,67897,67896,67894,67893,67892,67891,67890,67889,67888,67887,67886,67885,67884,67883,67882,67881,67879,67878,67877,67876,67875,67874,67873,67872,67871,67870,67869,67868,67867,67865,67864,67863,67862,67861,67860,67859,67858,67857,67856,67855,67854,67853,67852,67850,67849,67848,67847,67846,67845,67844,67843,67842,67841,67840,67839,67838,67837,67835,67834,67833,67832,67831,67830,67829,67828,67827,67826,67825,67824,67823,67822,67820,67819,67818,67817,67816,67815,67814,67813,67812,67811,67810,67809,67808,67807,67805,67804,67803,67802,67801,67800,67799,67798,67797,67796,67795,67794,67793,67792,67791,67789,67788,67787,67786,67785,67784,67783,67782,67781,67780,67779,67778,67777,67776,67774,67773,67772,67771,67770,67769,67768,67767,67766,67765,67764,67763,67762,67761,67759,67758,67757,67756,67755,67754,67753,67752,67751,67750,67749,67748,67747,67746,67745,67743,67742,67741,67740,67739,67738,67737,67736,67735,67734,67733,67732,67731,67730,67729,67727,67726,67725,67724,67723,67722,67721,67720,67719,67718,67717,67716,67715,67714,67712,67711,67710,67709,67708,67707,67706,67705,67704,67703,67702,67701,67700,67699,67698,67696,67695,67694,67693,67692,67691,67690,67689,67688,67687,67686,67685,67684,67683,67682,67680,67679,67678,67677,67676,67675,67674,67673,67672,67671,67670,67669,67668,67667,67666,67664,67663,67662,67661,67660,67659,67658,67657,67656,67655,67654,67653,67652,67651,67650,67649,67647,67646,67645,67644,67643,67642,67641,67640,67639,67638,67637,67636,67635,67634,67633,67631,67630,67629,67628,67627,67626,67625,67624,67623,67622,67621,67620,67619,67618,67617,67615,67614,67613,67612,67611,67610,67609,67608,67607,67606,67605,67604,67603,67602,67601,67600,67598,67597,67596,67595,67594,67593,67592,67591,67590,67589,67588,67587,67586,67585,67584,67583,67581,67580,67579,67578,67577,67576,67575,67574,67573,67572,67571,67570,67569,67568,67567,67565,67564,67563,67562,67561,67560,67559,67558,67557,67556,67555,67554,67553,67552,67551,67550,67548,67547,67546,67545,67544,67543,67542,67541,67540,67539,67538,67537,67536,67535,67534,67533,67531,67530,67529,67528,67527,67526,67525,67524,67523,67522,67521,67520,67519,67518,67517,67516,67515,67513,67512,67511,67510,67509,67508,67507,67506,67505,67504,67503,67502,67501,67500,67499,67498,67496,67495,67494,67493,67492,67491,67490,67489,67488,67487,67486,67485,67484,67483,67482,67481,67480,67478,67477,67476,67475,67474,67473,67472,67471,67470,67469,67468,67467,67466,67465,67464,67463,67461,67460,67459,67458,67457,67456,67455,67454,67453,67452,67451,67450,67449,67448,67447,67446,67445,67443,67442,67441,67440,67439,67438,67437,67436,67435,67434,67433,67432,67431,67430,67429,67428,67427,67425,67424,67423,67422,67421,67420,67419,67418,67417,67416,67415,67414,67413,67412,67411,67410,67409,67407,67406,67405,67404,67403,67402,67401,67400,67399,67398,67397,67396,67395,67394,67393,67392,67391,67390,67388,67387,67386,67385,67384,67383,67382,67381,67380,67379,67378,67377,67376,67375,67374,67373,67372,67370,67369,67368,67367,67366,67365,67364,67363,67362,67361,67360,67359,67358,67357,67356,67355,67354,67353,67351,67350,67349,67348,67347,67346,67345,67344,67343,67342,67341,67340,67339,67338,67337,67336,67335,67334,67332,67331,67330,67329,67328,67327,67326,67325,67324,67323,67322,67321,67320,67319,67318,67317,67316,67315,67313,67312,67311,67310,67309,67308,67307,67306,67305,67304,67303,67302,67301,67300,67299,67298,67297,67296,67294,67293,67292,67291,67290,67289,67288,67287,67286,67285,67284,67283,67282,67281,67280,67279,67278,67277,67276,67274,67273,67272,67271,67270,67269,67268,67267,67266,67265,67264,67263,67262,67261,67260,67259,67258,67257,67255,67254,67253,67252,67251,67250,67249,67248,67247,67246,67245,67244,67243,67242,67241,67240,67239,67238,67237,67235,67234,67233,67232,67231,67230,67229,67228,67227,67226,67225,67224,67223,67222,67221,67220,67219,67218,67217,67215,67214,67213,67212,67211,67210,67209,67208,67207,67206,67205,67204,67203,67202,67201,67200,67199,67198,67197,67196,67194,67193,67192,67191,67190,67189,67188,67187,67186,67185,67184,67183,67182,67181,67180,67179,67178,67177,67176,67174,67173,67172,67171,67170,67169,67168,67167,67166,67165,67164,67163,67162,67161,67160,67159,67158,67157,67156,67155,67153,67152,67151,67150,67149,67148,67147,67146,67145,67144,67143,67142,67141,67140,67139,67138,67137,67136,67135,67134,67132,67131,67130,67129,67128,67127,67126,67125,67124,67123,67122,67121,67120,67119,67118,67117,67116,67115,67114,67113,67112,67110,67109,67108,67107,67106,67105,67104,67103,67102,67101,67100,67099,67098,67097,67096,67095,67094,67093,67092,67091,67089,67088,67087,67086,67085,67084,67083,67082,67081,67080,67079,67078,67077,67076,67075,67074,67073,67072,67071,67070,67069,67067,67066,67065,67064,67063,67062,67061,67060,67059,67058,67057,67056,67055,67054,67053,67052,67051,67050,67049,67048,67047,67046,67044,67043,67042,67041,67040,67039,67038,67037,67036,67035,67034,67033,67032,67031,67030,67029,67028,67027,67026,67025,67024,67022,67021,67020,67019,67018,67017,67016,67015,67014,67013,67012,67011,67010,67009,67008,67007,67006,67005,67004,67003,67002,67001,66999,66998,66997,66996,66995,66994,66993,66992,66991,66990,66989,66988,66987,66986,66985,66984,66983,66982,66981,66980,66979,66978,66977,66975,66974,66973,66972,66971,66970,66969,66968,66967,66966,66965,66964,66963,66962,66961,66960,66959,66958,66957,66956,66955,66954,66952,66951,66950,66949,66948,66947,66946,66945,66944,66943,66942,66941,66940,66939,66938,66937,66936,66935,66934,66933,66932,66931,66930,66928,66927,66926,66925,66924,66923,66922,66921,66920,66919,66918,66917,66916,66915,66914,66913,66912,66911,66910,66909,66908,66907,66906,66905,66903,66902,66901,66900,66899,66898,66897,66896,66895,66894,66893,66892,66891,66890,66889,66888,66887,66886,66885,66884,66883,66882,66881,66880,66878,66877,66876,66875,66874,66873,66872,66871,66870,66869,66868,66867,66866,66865,66864,66863,66862,66861,66860,66859,66858,66857,66856,66855,66853,66852,66851,66850,66849,66848,66847,66846,66845,66844,66843,66842,66841,66840,66839,66838,66837,66836,66835,66834,66833,66832,66831,66830,66829,66827,66826,66825,66824,66823,66822,66821,66820,66819,66818,66817,66816,66815,66814,66813,66812,66811,66810,66809,66808,66807,66806,66805,66804,66803,66801,66800,66799,66798,66797,66796,66795,66794,66793,66792,66791,66790,66789,66788,66787,66786,66785,66784,66783,66782,66781,66780,66779,66778,66777,66776,66774,66773,66772,66771,66770,66769,66768,66767,66766,66765,66764,66763,66762,66761,66760,66759,66758,66757,66756,66755,66754,66753,66752,66751,66750,66749,66748,66746,66745,66744,66743,66742,66741,66740,66739,66738,66737,66736,66735,66734,66733,66732,66731,66730,66729,66728,66727,66726,66725,66724,66723,66722,66721,66720,66718,66717,66716,66715,66714,66713,66712,66711,66710,66709,66708,66707,66706,66705,66704,66703,66702,66701,66700,66699,66698,66697,66696,66695,66694,66693,66692,66691,66689,66688,66687,66686,66685,66684,66683,66682,66681,66680,66679,66678,66677,66676,66675,66674,66673,66672,66671,66670,66669,66668,66667,66666,66665,66664,66663,66662,66660,66659,66658,66657,66656,66655,66654,66653,66652,66651,66650,66649,66648,66647,66646,66645,66644,66643,66642,66641,66640,66639,66638,66637,66636,66635,66634,66633,66632,66630,66629,66628,66627,66626,66625,66624,66623,66622,66621,66620,66619,66618,66617,66616,66615,66614,66613,66612,66611,66610,66609,66608,66607,66606,66605,66604,66603,66602,66601,66600,66598,66597,66596,66595,66594,66593,66592,66591,66590,66589,66588,66587,66586,66585,66584,66583,66582,66581,66580,66579,66578,66577,66576,66575,66574,66573,66572,66571,66570,66569,66568,66566,66565,66564,66563,66562,66561,66560,66559,66558,66557,66556,66555,66554,66553,66552,66551,66550,66549,66548,66547,66546,66545,66544,66543,66542,66541,66540,66539,66538,66537,66536,66535,66533,66532,66531,66530,66529,66528,66527,66526,66525,66524,66523,66522,66521,66520,66519,66518,66517,66516,66515,66514,66513,66512,66511,66510,66509,66508,66507,66506,66505,66504,66503,66502,66501,66499,66498,66497,66496,66495,66494,66493,66492,66491,66490,66489,66488,66487,66486,66485,66484,66483,66482,66481,66480,66479,66478,66477,66476,66475,66474,66473,66472,66471,66470,66469,66468,66467,66466,66464,66463,66462,66461,66460,66459,66458,66457,66456,66455,66454,66453,66452,66451,66450,66449,66448,66447,66446,66445,66444,66443,66442,66441,66440,66439,66438,66437,66436,66435,66434,66433,66432,66431,66430,66429,66427,66426,66425,66424,66423,66422,66421,66420,66419,66418,66417,66416,66415,66414,66413,66412,66411,66410,66409,66408,66407,66406,66405,66404,66403,66402,66401,66400,66399,66398,66397,66396,66395,66394,66393,66392,66391,66389,66388,66387,66386,66385,66384,66383,66382,66381,66380,66379,66378,66377,66376,66375,66374,66373,66372,66371,66370,66369,66368,66367,66366,66365,66364,66363,66362,66361,66360,66359,66358,66357,66356,66355,66354,66353,66352,66351,66349,66348,66347,66346,66345,66344,66343,66342,66341,66340,66339,66338,66337,66336,66335,66334,66333,66332,66331,66330,66329,66328,66327,66326,66325,66324,66323,66322,66321,66320,66319,66318,66317,66316,66315,66314,66313,66312,66311,66310,66309,66307,66306,66305,66304,66303,66302,66301,66300,66299,66298,66297,66296,66295,66294,66293,66292,66291,66290,66289,66288,66287,66286,66285,66284,66283,66282,66281,66280,66279,66278,66277,66276,66275,66274,66273,66272,66271,66270,66269,66268,66267,66266,66265,66264,66262,66261,66260,66259,66258,66257,66256,66255,66254,66253,66252,66251,66250,66249,66248,66247,66246,66245,66244,66243,66242,66241,66240,66239,66238,66237,66236,66235,66234,66233,66232,66231,66230,66229,66228,66227,66226,66225,66224,66223,66222,66221,66220,66219,66218,66217,66215,66214,66213,66212,66211,66210,66209,66208,66207,66206,66205,66204,66203,66202,66201,66200,66199,66198,66197,66196,66195,66194,66193,66192,66191,66190,66189,66188,66187,66186,66185,66184,66183,66182,66181,66180,66179,66178,66177,66176,66175,66174,66173,66172,66171,66170,66169,66168,66167,66166,66164,66163,66162,66161,66160,66159,66158,66157,66156,66155,66154,66153,66152,66151,66150,66149,66148,66147,66146,66145,66144,66143,66142,66141,66140,66139,66138,66137,66136,66135,66134,66133,66132,66131,66130,66129,66128,66127,66126,66125,66124,66123,66122,66121,66120,66119,66118,66117,66116,66115,66114,66113,66112,66111,66109,66108,66107,66106,66105,66104,66103,66102,66101,66100,66099,66098,66097,66096,66095,66094,66093,66092,66091,66090,66089,66088,66087,66086,66085,66084,66083,66082,66081,66080,66079,66078,66077,66076,66075,66074,66073,66072,66071,66070,66069,66068,66067,66066,66065,66064,66063,66062,66061,66060,66059,66058,66057,66056,66055,66054,66053,66052,66051,66050,66048,66047,66046,66045,66044,66043,66042,66041,66040,66039,66038,66037,66036,66035,66034,66033,66032,66031,66030,66029,66028,66027,66026,66025,66024,66023,66022,66021,66020,66019,66018,66017,66016,66015,66014,66013,66012,66011,66010,66009,66008,66007,66006,66005,66004,66003,66002,66001,66000,65999,65998,65997,65996,65995,65994,65993,65992,65991,65990,65989,65988,65987,65986,65985,65984,65983,65982,65981,65979,65978,65977,65976,65975,65974,65973,65972,65971,65970,65969,65968,65967,65966,65965,65964,65963,65962,65961,65960,65959,65958,65957,65956,65955,65954,65953,65952,65951,65950,65949,65948,65947,65946,65945,65944,65943,65942,65941,65940,65939,65938,65937,65936,65935,65934,65933,65932,65931,65930,65929,65928,65927,65926,65925,65924,65923,65922,65921,65920,65919,65918,65917,65916,65915,65914,65913,65912,65911,65910,65909,65908,65907,65906,65905,65904,65903,65902,65901,65900,65899,65897,65896,65895,65894,65893,65892,65891,65890,65889,65888,65887,65886,65885,65884,65883,65882,65881,65880,65879,65878,65877,65876,65875,65874,65873,65872,65871,65870,65869,65868,65867,65866,65865,65864,65863,65862,65861,65860,65859,65858,65857,65856,65855,65854,65853,65852,65851,65850,65849,65848,65847,65846,65845,65844,65843,65842,65841,65840,65839,65838,65837,65836,65835,65834,65833,65832,65831,65830,65829,65828,65827,65826,65825,65824,65823,65822,65821,65820,65819,65818,65817,65816,65815,65814,65813,65812,65811,65810,65809,65808,65807,65806,65805,65804,65803,65802,65801,65800,65799,65798,65797,65796,65795,65794,65793,65791,65790,65789,65788,65787,65786,65785,65784,65783,65782,65781,65780,65779,65778,65777,65776,65775,65774,65773,65772,65771,65770,65769,65768,65767,65766,65765,65764,65763,65762,65761,65760,65759,65758,65757,65756,65755,65754,65753,65752,65751,65750,65749,65748,65747,65746,65745,65744,65743,65742,65741,65740,65739,65738,65737,65736,65735,65734,65733,65732,65731,65730,65729,65728,65727,65726,65725,65724,65723,65722,65721,65720,65719,65718,65717,65716,65715,65714,65713,65712,65711,65710,65709,65708,65707,65706,65705,65704,65703,65702,65701,65700,65699,65698,65697,65696,65695,65694,65693,65692,65691,65690,65689,65688,65687,65686,65685,65684,65683,65682,65681,65680,65679,65678,65677,65676,65675,65674,65673,65672,65671,65670,65669,65668,65667,65666,65665,65664,65663,65662,65661,65660,65659,65658,65657,65656,65655,65654,65653,65652,65651,65650,65649,65648,65647,65646,65645,65644,65643,65642,65641,65640,65639,65638,65637,65636,65635,65634,65633,65632,65631,65630,65629,65628,65627,65626,65625,65624,65623,65622,65621,65620,65619,65618,65617,65616,65615,65614,65613,65612,65611,65610,65609,65608,65607,65606,65605,65604,65603,65602,65601,65600,65599,65598,65597,65596,65595,65594,65593,65592,65591,65590,65589,65588,65587,65586,65585,65584,65583,65582,65581,65580,65579,65578,65577,65576,65575,65574,65573,65572,65571,65570,65569,65568,65567,65566,65565,65564,65563,65562,65561,65560,65559,65558,65557,65556,65555,65554,65553,65552,65551,65550,65549,65548,65547,65546,65545,65544,65543,65542,65541,65540,65539,65538}; // look up table for division static unsigned short division_lut[] = {65535,65535,65535,65504,65472,65440,65408,65376,65344,65312,65280,65249,65217,65185,65154,65122,65091,65059,65027,64996,64965,64933,64902,64870,64839,64808,64776,64745,64714,64683,64652,64620,64589,64558,64527,64496,64465,64434,64403,64373,64342,64311,64280,64249,64219,64188,64157,64126,64096,64065,64035,64004,63974,63943,63913,63882,63852,63822,63791,63761,63731,63700,63670,63640,63610,63580,63550,63519,63489,63459,63429,63399,63370,63340,63310,63280,63250,63220,63191,63161,63131,63101,63072,63042,63013,62983,62953,62924,62894,62865,62836,62806,62777,62747,62718,62689,62660,62630,62601,62572,62543,62514,62484,62455,62426,62397,62368,62339,62310,62282,62253,62224,62195,62166,62137,62109,62080,62051,62022,61994,61965,61937,61908,61880,61851,61822,61794,61766,61737,61709,61680,61652,61624,61596,61567,61539,61511,61483,61455,61426,61398,61370,61342,61314,61286,61258,61230,61202,61174,61147,61119,61091,61063,61035,61008,60980,60952,60924,60897,60869,60842,60814,60787,60759,60732,60704,60677,60649,60622,60594,60567,60540,60512,60485,60458,60431,60404,60376,60349,60322,60295,60268,60241,60214,60187,60160,60133,60106,60079,60052,60025,59998,59972,59945,59918,59891,59865,59838,59811,59785,59758,59731,59705,59678,59652,59625,59599,59572,59546,59520,59493,59467,59440,59414,59388,59362,59335,59309,59283,59257,59231,59204,59178,59152,59126,59100,59074,59048,59022,58996,58970,58944,58919,58893,58867,58841,58815,58790,58764,58738,58712,58687,58661,58635,58610,58584,58559,58533,58508,58482,58457,58431,58406,58380,58355,58330,58304,58279,58254,58228,58203,58178,58153,58128,58102,58077,58052,58027,58002,57977,57952,57927,57902,57877,57852,57827,57802,57777,57752,57728,57703,57678,57653,57628,57604,57579,57554,57530,57505,57480,57456,57431,57407,57382,57358,57333,57309,57284,57260,57235,57211,57186,57162,57138,57113,57089,57065,57041,57016,56992,56968,56944,56920,56896,56871,56847,56823,56799,56775,56751,56727,56703,56679,56655,56631,56608,56584,56560,56536,56512,56488,56465,56441,56417,56394,56370,56346,56323,56299,56275,56252,56228,56205,56181,56158,56134,56111,56087,56064,56040,56017,55994,55970,55947,55924,55900,55877,55854,55831,55807,55784,55761,55738,55715,55692,55668,55645,55622,55599,55576,55553,55530,55507,55484,55461,55438,55416,55393,55370,55347,55324,55301,55279,55256,55233,55210,55188,55165,55142,55120,55097,55074,55052,55029,55007,54984,54962,54939,54917,54894,54872,54849,54827,54805,54782,54760,54738,54715,54693,54671,54648,54626,54604,54582,54560,54537,54515,54493,54471,54449,54427,54405,54383,54361,54339,54317,54295,54273,54251,54229,54207,54185,54163,54141,54120,54098,54076,54054,54032,54011,53989,53967,53946,53924,53902,53881,53859,53837,53816,53794,53773,53751,53730,53708,53687,53665,53644,53622,53601,53579,53558,53537,53515,53494,53473,53451,53430,53409,53388,53366,53345,53324,53303,53282,53261,53239,53218,53197,53176,53155,53134,53113,53092,53071,53050,53029,53008,52987,52966,52945,52924,52904,52883,52862,52841,52820,52800,52779,52758,52737,52717,52696,52675,52655,52634,52613,52593,52572,52551,52531,52510,52490,52469,52449,52428,52408,52387,52367,52347,52326,52306,52285,52265,52245,52224,52204,52184,52163,52143,52123,52103,52082,52062,52042,52022,52002,51982,51961,51941,51921,51901,51881,51861,51841,51821,51801,51781,51761,51741,51721,51701,51681,51661,51642,51622,51602,51582,51562,51542,51523,51503,51483,51463,51444,51424,51404,51385,51365,51345,51326,51306,51286,51267,51247,51228,51208,51189,51169,51150,51130,51111,51091,51072,51052,51033,51013,50994,50975,50955,50936,50917,50897,50878,50859,50840,50820,50801,50782,50763,50743,50724,50705,50686,50667,50648,50629,50610,50590,50571,50552,50533,50514,50495,50476,50457,50438,50419,50400,50382,50363,50344,50325,50306,50287,50268,50249,50231,50212,50193,50174,50156,50137,50118,50099,50081,50062,50043,50025,50006,49987,49969,49950,49932,49913,49895,49876,49857,49839,49820,49802,49784,49765,49747,49728,49710,49691,49673,49655,49636,49618,49600,49581,49563,49545,49526,49508,49490,49472,49453,49435,49417,49399,49381,49362,49344,49326,49308,49290,49272,49254,49236,49218,49200,49182,49164,49146,49128,49110,49092,49074,49056,49038,49020,49002,48984,48966,48948,48931,48913,48895,48877,48859,48841,48824,48806,48788,48770,48753,48735,48717,48700,48682,48664,48647,48629,48612,48594,48576,48559,48541,48524,48506,48489,48471,48454,48436,48419,48401,48384,48366,48349,48331,48314,48297,48279,48262,48245,48227,48210,48193,48175,48158,48141,48123,48106,48089,48072,48055,48037,48020,48003,47986,47969,47952,47934,47917,47900,47883,47866,47849,47832,47815,47798,47781,47764,47747,47730,47713,47696,47679,47662,47645,47628,47611,47594,47578,47561,47544,47527,47510,47493,47477,47460,47443,47426,47410,47393,47376,47359,47343,47326,47309,47293,47276,47259,47243,47226,47209,47193,47176,47160,47143,47127,47110,47093,47077,47060,47044,47027,47011,46995,46978,46962,46945,46929,46912,46896,46880,46863,46847,46831,46814,46798,46782,46765,46749,46733,46716,46700,46684,46668,46651,46635,46619,46603,46587,46571,46554,46538,46522,46506,46490,46474,46458,46442,46426,46410,46393,46377,46361,46345,46329,46313,46297,46281,46266,46250,46234,46218,46202,46186,46170,46154,46138,46122,46107,46091,46075,46059,46043,46028,46012,45996,45980,45964,45949,45933,45917,45902,45886,45870,45855,45839,45823,45808,45792,45776,45761,45745,45730,45714,45698,45683,45667,45652,45636,45621,45605,45590,45574,45559,45543,45528,45512,45497,45482,45466,45451,45435,45420,45405,45389,45374,45359,45343,45328,45313,45297,45282,45267,45252,45236,45221,45206,45191,45175,45160,45145,45130,45115,45100,45084,45069,45054,45039,45024,45009,44994,44979,44964,44949,44933,44918,44903,44888,44873,44858,44843,44828,44813,44798,44784,44769,44754,44739,44724,44709,44694,44679,44664,44649,44635,44620,44605,44590,44575,44561,44546,44531,44516,44501,44487,44472,44457,44442,44428,44413,44398,44384,44369,44354,44340,44325,44310,44296,44281,44267,44252,44237,44223,44208,44194,44179,44165,44150,44136,44121,44107,44092,44078,44063,44049,44034,44020,44005,43991,43976,43962,43948,43933,43919,43905,43890,43876,43862,43847,43833,43819,43804,43790,43776,43761,43747,43733,43719,43704,43690,43676,43662,43648,43633,43619,43605,43591,43577,43563,43548,43534,43520,43506,43492,43478,43464,43450,43436,43422,43408,43394,43380,43365,43351,43337,43323,43310,43296,43282,43268,43254,43240,43226,43212,43198,43184,43170,43156,43142,43129,43115,43101,43087,43073,43059,43046,43032,43018,43004,42990,42977,42963,42949,42935,42922,42908,42894,42881,42867,42853,42840,42826,42812,42799,42785,42771,42758,42744,42730,42717,42703,42690,42676,42662,42649,42635,42622,42608,42595,42581,42568,42554,42541,42527,42514,42500,42487,42473,42460,42447,42433,42420,42406,42393,42380,42366,42353,42339,42326,42313,42299,42286,42273,42259,42246,42233,42220,42206,42193,42180,42167,42153,42140,42127,42114,42100,42087,42074,42061,42048,42034,42021,42008,41995,41982,41969,41956,41943,41929,41916,41903,41890,41877,41864,41851,41838,41825,41812,41799,41786,41773,41760,41747,41734,41721,41708,41695,41682,41669,41656,41643,41630,41617,41605,41592,41579,41566,41553,41540,41527,41514,41502,41489,41476,41463,41450,41438,41425,41412,41399,41386,41374,41361,41348,41335,41323,41310,41297,41285,41272,41259,41246,41234,41221,41209,41196,41183,41171,41158,41145,41133,41120,41108,41095,41082,41070,41057,41045,41032,41020,41007,40995,40982,40970,40957,40945,40932,40920,40907,40895,40882,40870,40857,40845,40832,40820,40808,40795,40783,40770,40758,40746,40733,40721,40709,40696,40684,40672,40659,40647,40635,40622,40610,40598,40585,40573,40561,40549,40536,40524,40512,40500,40488,40475,40463,40451,40439,40427,40414,40402,40390,40378,40366,40354,40341,40329,40317,40305,40293,40281,40269,40257,40245,40233,40221,40209,40196,40184,40172,40160,40148,40136,40124,40112,40100,40088,40076,40064,40053,40041,40029,40017,40005,39993,39981,39969,39957,39945,39933,39921,39910,39898,39886,39874,39862,39850,39839,39827,39815,39803,39791,39780,39768,39756,39744,39732,39721,39709,39697,39685,39674,39662,39650,39639,39627,39615,39603,39592,39580,39568,39557,39545,39533,39522,39510,39499,39487,39475,39464,39452,39441,39429,39417,39406,39394,39383,39371,39360,39348,39336,39325,39313,39302,39290,39279,39267,39256,39244,39233,39222,39210,39199,39187,39176,39164,39153,39141,39130,39119,39107,39096,39084,39073,39062,39050,39039,39028,39016,39005,38994,38982,38971,38960,38948,38937,38926,38914,38903,38892,38881,38869,38858,38847,38836,38824,38813,38802,38791,38780,38768,38757,38746,38735,38724,38712,38701,38690,38679,38668,38657,38646,38634,38623,38612,38601,38590,38579,38568,38557,38546,38535,38524,38512,38501,38490,38479,38468,38457,38446,38435,38424,38413,38402,38391,38380,38369,38358,38347,38336,38326,38315,38304,38293,38282,38271,38260,38249,38238,38227,38216,38206,38195,38184,38173,38162,38151,38140,38130,38119,38108,38097,38086,38075,38065,38054,38043,38032,38022,38011,38000,37989,37978,37968,37957,37946,37936,37925,37914,37903,37893,37882,37871,37861,37850,37839,37829,37818,37807,37797,37786,37775,37765,37754,37744,37733,37722,37712,37701,37691,37680,37669,37659,37648,37638,37627,37617,37606,37596,37585,37574,37564,37553,37543,37532,37522,37511,37501,37490,37480,37470,37459,37449,37438,37428,37417,37407,37396,37386,37376,37365,37355,37344,37334,37324,37313,37303,37293,37282,37272,37262,37251,37241,37230,37220,37210,37200,37189,37179,37169,37158,37148,37138,37128,37117,37107,37097,37086,37076,37066,37056,37046,37035,37025,37015,37005,36994,36984,36974,36964,36954,36944,36933,36923,36913,36903,36893,36883,36873,36862,36852,36842,36832,36822,36812,36802,36792,36782,36771,36761,36751,36741,36731,36721,36711,36701,36691,36681,36671,36661,36651,36641,36631,36621,36611,36601,36591,36581,36571,36561,36551,36541,36531,36521,36511,36501,36492,36482,36472,36462,36452,36442,36432,36422,36412,36402,36393,36383,36373,36363,36353,36343,36333,36324,36314,36304,36294,36284,36275,36265,36255,36245,36235,36226,36216,36206,36196,36187,36177,36167,36157,36148,36138,36128,36118,36109,36099,36089,36080,36070,36060,36050,36041,36031,36021,36012,36002,35992,35983,35973,35964,35954,35944,35935,35925,35915,35906,35896,35887,35877,35867,35858,35848,35839,35829,35820,35810,35800,35791,35781,35772,35762,35753,35743,35734,35724,35715,35705,35696,35686,35677,35667,35658,35648,35639,35629,35620,35610,35601,35592,35582,35573,35563,35554,35544,35535,35526,35516,35507,35497,35488,35479,35469,35460,35451,35441,35432,35422,35413,35404,35394,35385,35376,35366,35357,35348,35339,35329,35320,35311,35301,35292,35283,35274,35264,35255,35246,35237,35227,35218,35209,35200,35190,35181,35172,35163,35153,35144,35135,35126,35117,35107,35098,35089,35080,35071,35062,35052,35043,35034,35025,35016,35007,34998,34988,34979,34970,34961,34952,34943,34934,34925,34916,34907,34898,34888,34879,34870,34861,34852,34843,34834,34825,34816,34807,34798,34789,34780,34771,34762,34753,34744,34735,34726,34717,34708,34699,34690,34681,34672,34663,34654,34645,34636,34627,34618,34610,34601,34592,34583,34574,34565,34556,34547,34538,34529,34521,34512,34503,34494,34485,34476,34467,34458,34450,34441,34432,34423,34414,34405,34397,34388,34379,34370,34361,34353,34344,34335,34326,34318,34309,34300,34291,34282,34274,34265,34256,34247,34239,34230,34221,34213,34204,34195,34186,34178,34169,34160,34152,34143,34134,34126,34117,34108,34100,34091,34082,34074,34065,34056,34048,34039,34030,34022,34013,34005,33996,33987,33979,33970,33961,33953,33944,33936,33927,33919,33910,33901,33893,33884,33876,33867,33859,33850,33842,33833,33825,33816,33807,33799,33790,33782,33773,33765,33756,33748,33740,33731,33723,33714,33706,33697,33689,33680,33672,33663,33655,33646,33638,33630,33621,33613,33604,33596,33588,33579,33571,33562,33554,33546,33537,33529,33520,33512,33504,33495,33487,33479,33470,33462,33454,33445,33437,33429,33420,33412,33404,33395,33387,33379,33370,33362,33354,33346,33337,33329,33321,33312,33304,33296,33288,33279,33271,33263,33255,33246,33238,33230,33222,33213,33205,33197,33189,33181,33172,33164,33156,33148,33140,33132,33123,33115,33107,33099,33091,33083,33074,33066,33058,33050,33042,33034,33026,33017,33009,33001,32993,32985,32977,32969,32961,32953,32944,32936,32928,32920,32912,32904,32896,32888,32880,32872,32864,32856,32848,32840,32832,32824,32816,32808,32800,32792,32784}; // Look up table for 1/x values where x will be in Q8.0 format static unsigned short division_lut8[256] = {65535,32768,16384,10922,8192,6553,5461,4681,4096,3640,3276,2978,2730,2520,2340,2184,2048,1927,1820,1724,1638,1560,1489,1424,1365,1310,1260,1213,1170,1129,1092,1057,1024,992,963,936,910,885,862,840,819,799,780,762,744,728,712,697,682,668,655,642,630,618,606,595,585,574,564,555,546,537,528,520,512,504,496,489,481,474,468,461,455,448,442,436,431,425,420,414,409,404,399,394,390,385,381,376,372,368,364,360,356,352,348,344,341,337,334,330,327,324,321,318,315,312,309,306,303,300,297,295,292,289,287,284,282,280,277,275,273,270,268,266,264,262,260,258,256,254,252,250,248,246,244,242,240,239,237,235,234,232,230,229,227,225,224,222,221,219,218,217,215,214,212,211,210,208,207,206,204,203,202,201,199,198,197,196,195,193,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,176,175,174,173,172,171,170,169,168,168,167,166,165,164,163,163,162,161,160,159,159,158,157,156,156,155,154,153,153,152,151,151,150,149,148,148,147,146,146,145,144,144,143,143,142,141,141,140,140,139,138,138,137,137,136,135,135,134,134,133,133,132,132,131,131,130,130,129,129,128}; /*** look up tables for atan2 ***/ // table to store the base indices static int base_addr_lut[63] = {0,512,768,896,960,1024,1088,1120,1152,1184,1200,1216,1232,1248,1264,1280,1296,1304,1312,1320,1328,1336,1344,1352,1360,1362,1364,1366,1368,1370,1372,1374,1376,1378,1380,1382,1384,1386,1388,1390,1392,1394,1396,1398,1400,1402,1404,1406,1408,1410,1412,1414,1416,1418,1420,1422,1424,1426,1428,1430,1432,1434,1436}; // table to store the number of bits to be used as index for fractional index look up. static int frac_bits_lut[63] = {9,8,7,6,6,6,5,5,5,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}; // Fixed point representation of atan values. atan_lut_fp is Q4.12 format static short atan_lut_fp[1440] = {0,7,15,23,31,39,47,55,63,71,79,87,95,103,111,119,127,135,143,151,159,167,175,183,191,199,207,215,223,231,239,247,255,263,271,279,287,295,303,311,319,327,335,343,351,358,366,374,382,390,398,406,414,422,430,438,446,454,461,469,477,485,493,501,509,517,524,532,540,548,556,564,572,579,587,595,603,611,619,626,634,642,650,658,665,673,681,689,697,704,712,720,728,735,743,751,758,766,774,782,789,797,805,812,820,828,835,843,851,858,866,874,881,889,897,904,912,919,927,935,942,950,957,965,973,980,988,995,1003,1010,1018,1025,1033,1040,1048,1055,1063,1070,1078,1085,1093,1100,1107,1115,1122,1130,1137,1144,1152,1159,1167,1174,1181,1189,1196,1203,1211,1218,1225,1233,1240,1247,1254,1262,1269,1276,1283,1291,1298,1305,1312,1319,1327,1334,1341,1348,1355,1362,1370,1377,1384,1391,1398,1405,1412,1419,1426,1433,1441,1448,1455,1462,1469,1476,1483,1490,1497,1504,1511,1518,1524,1531,1538,1545,1552,1559,1566,1573,1580,1587,1593,1600,1607,1614,1621,1628,1634,1641,1648,1655,1661,1668,1675,1682,1688,1695,1702,1708,1715,1722,1728,1735,1742,1748,1755,1762,1768,1775,1781,1788,1794,1801,1808,1814,1821,1827,1834,1840,1847,1853,1860,1866,1872,1879,1885,1892,1898,1905,1911,1917,1924,1930,1936,1943,1949,1955,1962,1968,1974,1980,1987,1993,1999,2005,2012,2018,2024,2030,2036,2043,2049,2055,2061,2067,2073,2079,2086,2092,2098,2104,2110,2116,2122,2128,2134,2140,2146,2152,2158,2164,2170,2176,2182,2188,2194,2200,2205,2211,2217,2223,2229,2235,2241,2246,2252,2258,2264,2270,2275,2281,2287,2293,2298,2304,2310,2316,2321,2327,2333,2338,2344,2350,2355,2361,2366,2372,2378,2383,2389,2394,2400,2406,2411,2417,2422,2428,2433,2439,2444,2450,2455,2460,2466,2471,2477,2482,2488,2493,2498,2504,2509,2514,2520,2525,2530,2536,2541,2546,2552,2557,2562,2567,2573,2578,2583,2588,2593,2599,2604,2609,2614,2619,2624,2630,2635,2640,2645,2650,2655,2660,2665,2670,2675,2680,2685,2690,2695,2700,2705,2710,2715,2720,2725,2730,2735,2740,2745,2750,2755,2760,2765,2769,2774,2779,2784,2789,2794,2798,2803,2808,2813,2818,2822,2827,2832,2837,2841,2846,2851,2855,2860,2865,2869,2874,2879,2883,2888,2893,2897,2902,2907,2911,2916,2920,2925,2929,2934,2939,2943,2948,2952,2957,2961,2966,2970,2975,2979,2984,2988,2992,2997,3001,3006,3010,3014,3019,3023,3028,3032,3036,3041,3045,3049,3054,3058,3062,3067,3071,3075,3079,3084,3088,3092,3096,3101,3105,3109,3113,3117,3122,3126,3130,3134,3138,3142,3147,3151,3155,3159,3163,3167,3171,3175,3179,3183,3188,3192,3196,3200,3204,3208,3212,3216,3224,3232,3240,3247,3255,3263,3271,3279,3286,3294,3302,3309,3317,3325,3332,3340,3347,3355,3362,3370,3377,3384,3392,3399,3406,3413,3421,3428,3435,3442,3449,3456,3463,3470,3477,3484,3491,3498,3505,3512,3519,3526,3532,3539,3546,3553,3559,3566,3572,3579,3586,3592,3599,3605,3612,3618,3625,3631,3637,3644,3650,3656,3663,3669,3675,3681,3687,3694,3700,3706,3712,3718,3724,3730,3736,3742,3748,3754,3760,3766,3772,3777,3783,3789,3795,3801,3806,3812,3818,3823,3829,3835,3840,3846,3851,3857,3863,3868,3873,3879,3884,3890,3895,3901,3906,3911,3917,3922,3927,3932,3938,3943,3948,3953,3959,3964,3969,3974,3979,3984,3989,3994,3999,4004,4009,4014,4019,4024,4029,4034,4039,4044,4048,4053,4058,4063,4068,4072,4077,4082,4087,4091,4096,4101,4105,4110,4114,4119,4124,4128,4133,4137,4142,4146,4151,4155,4160,4164,4168,4173,4177,4182,4186,4190,4195,4199,4203,4208,4212,4216,4220,4225,4229,4233,4237,4241,4245,4250,4254,4258,4262,4266,4270,4274,4278,4282,4286,4290,4294,4298,4302,4306,4310,4314,4318,4322,4326,4329,4333,4337,4341,4345,4349,4352,4356,4360,4364,4367,4371,4375,4378,4382,4386,4390,4393,4397,4400,4404,4408,4411,4415,4418,4422,4426,4429,4433,4436,4440,4443,4447,4450,4454,4457,4460,4464,4467,4471,4474,4477,4481,4484,4487,4491,4494,4497,4501,4504,4507,4511,4514,4517,4520,4524,4527,4530,4533,4540,4546,4552,4559,4565,4571,4577,4583,4589,4595,4601,4607,4613,4619,4625,4631,4637,4642,4648,4654,4659,4665,4671,4676,4682,4687,4693,4698,4703,4709,4714,4719,4725,4730,4735,4740,4745,4750,4755,4761,4766,4771,4776,4780,4785,4790,4795,4800,4805,4810,4814,4819,4824,4828,4833,4838,4842,4847,4851,4856,4860,4865,4869,4874,4878,4883,4887,4891,4896,4900,4904,4908,4913,4917,4921,4925,4929,4933,4937,4941,4945,4949,4953,4957,4961,4965,4969,4973,4977,4981,4985,4989,4992,4996,5000,5004,5007,5011,5015,5018,5022,5026,5029,5033,5037,5040,5044,5047,5051,5054,5058,5061,5065,5068,5071,5075,5078,5082,5085,5088,5092,5095,5098,5101,5105,5108,5111,5114,5121,5127,5133,5139,5146,5152,5158,5164,5170,5175,5181,5187,5193,5198,5204,5210,5215,5221,5226,5231,5237,5242,5247,5252,5257,5263,5268,5273,5278,5283,5287,5292,5297,5302,5307,5311,5316,5321,5325,5330,5334,5339,5343,5347,5352,5356,5360,5365,5369,5373,5377,5381,5386,5390,5394,5398,5402,5406,5410,5413,5417,5421,5425,5429,5432,5436,5440,5444,5447,5451,5454,5458,5462,5465,5469,5472,5475,5479,5482,5486,5489,5492,5496,5499,5502,5505,5509,5512,5515,5518,5521,5524,5527,5530,5533,5536,5539,5542,5545,5548,5551,5554,5557,5560,5563,5566,5568,5571,5574,5577,5579,5582,5585,5588,5590,5593,5596,5598,5601,5603,5606,5609,5611,5614,5616,5619,5621,5624,5626,5628,5631,5633,5636,5638,5640,5643,5645,5647,5650,5652,5654,5657,5659,5661,5663,5666,5668,5670,5672,5674,5677,5679,5681,5683,5685,5687,5689,5691,5693,5695,5697,5699,5702,5704,5706,5707,5709,5711,5713,5715,5717,5719,5721,5723,5725,5727,5729,5731,5732,5734,5736,5738,5740,5742,5743,5745,5747,5749,5750,5752,5754,5756,5759,5762,5766,5769,5772,5776,5779,5782,5785,5789,5792,5795,5798,5801,5804,5807,5810,5813,5816,5818,5821,5824,5827,5830,5832,5835,5838,5840,5843,5846,5848,5851,5853,5856,5858,5861,5863,5866,5868,5871,5873,5875,5878,5880,5882,5885,5887,5889,5891,5894,5896,5898,5900,5902,5904,5906,5909,5911,5913,5915,5917,5919,5921,5923,5925,5927,5929,5930,5932,5934,5936,5938,5940,5942,5943,5945,5947,5949,5951,5952,5954,5956,5958,5959,5961,5963,5964,5966,5968,5969,5971,5972,5974,5976,5977,5979,5982,5985,5988,5991,5994,5997,6000,6002,6005,6008,6011,6013,6016,6019,6021,6024,6026,6029,6031,6034,6036,6038,6041,6043,6045,6048,6050,6052,6054,6056,6059,6061,6063,6065,6067,6069,6071,6073,6075,6077,6079,6081,6082,6084,6086,6088,6090,6091,6093,6095,6097,6098,6100,6102,6103,6105,6107,6108,6110,6111,6113,6114,6116,6118,6119,6121,6122,6123,6125,6126,6128,6129,6131,6132,6133,6135,6136,6137,6139,6140,6141,6142,6144,6145,6146,6147,6149,6150,6151,6152,6154,6155,6156,6157,6158,6159,6160,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6178,6180,6182,6184,6186,6188,6190,6191,6193,6195,6196,6198,6200,6201,6203,6205,6206,6208,6209,6211,6212,6214,6215,6217,6218,6219,6221,6222,6223,6225,6226,6227,6229,6230,6231,6232,6234,6235,6236,6237,6238,6239,6240,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6260,6261,6265,6268,6271,6274,6277,6280,6283,6286,6288,6291,6293,6295,6298,6300,6302,6304,6306,6308,6310,6312,6313,6315,6317,6318,6320,6321,6323,6324,6326,6327,6328,6330,6331,6332,6333,6334,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6347,6348,6349,6350,6351,6352,6352,6353,6354,6355,6355,6356,6357,6357,6358,6359,6359,6360,6361,6361,6362,6363,6363,6364,6364,6365,6365,6366,6366,6367,6367}; /* Reduced atan2 look up tables */ static int base_addr_lut8[126] = {0,512,640,704,736,768,800,816,832,848,856,864,872,880,888,896,904,908,912,916,920,924,928,932,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,9,7,6,5,5,5,4,4,4,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; static short atan_lut_fp8[977] = {0,7,15,23,31,39,47,55,63,71,79,87,95,103,111,119,127,135,143,151,159,167,175,183,191,199,207,215,223,231,239,247,255,263,271,279,287,295,303,311,319,327,335,343,351,358,366,374,382,390,398,406,414,422,430,438,446,454,461,469,477,485,493,501,509,517,524,532,540,548,556,564,572,579,587,595,603,611,619,626,634,642,650,658,665,673,681,689,697,704,712,720,728,735,743,751,758,766,774,782,789,797,805,812,820,828,835,843,851,858,866,874,881,889,897,904,912,919,927,935,942,950,957,965,973,980,988,995,1003,1010,1018,1025,1033,1040,1048,1055,1063,1070,1078,1085,1093,1100,1107,1115,1122,1130,1137,1144,1152,1159,1167,1174,1181,1189,1196,1203,1211,1218,1225,1233,1240,1247,1254,1262,1269,1276,1283,1291,1298,1305,1312,1319,1327,1334,1341,1348,1355,1362,1370,1377,1384,1391,1398,1405,1412,1419,1426,1433,1441,1448,1455,1462,1469,1476,1483,1490,1497,1504,1511,1518,1524,1531,1538,1545,1552,1559,1566,1573,1580,1587,1593,1600,1607,1614,1621,1628,1634,1641,1648,1655,1661,1668,1675,1682,1688,1695,1702,1708,1715,1722,1728,1735,1742,1748,1755,1762,1768,1775,1781,1788,1794,1801,1808,1814,1821,1827,1834,1840,1847,1853,1860,1866,1872,1879,1885,1892,1898,1905,1911,1917,1924,1930,1936,1943,1949,1955,1962,1968,1974,1980,1987,1993,1999,2005,2012,2018,2024,2030,2036,2043,2049,2055,2061,2067,2073,2079,2086,2092,2098,2104,2110,2116,2122,2128,2134,2140,2146,2152,2158,2164,2170,2176,2182,2188,2194,2200,2205,2211,2217,2223,2229,2235,2241,2246,2252,2258,2264,2270,2275,2281,2287,2293,2298,2304,2310,2316,2321,2327,2333,2338,2344,2350,2355,2361,2366,2372,2378,2383,2389,2394,2400,2406,2411,2417,2422,2428,2433,2439,2444,2450,2455,2460,2466,2471,2477,2482,2488,2493,2498,2504,2509,2514,2520,2525,2530,2536,2541,2546,2552,2557,2562,2567,2573,2578,2583,2588,2593,2599,2604,2609,2614,2619,2624,2630,2635,2640,2645,2650,2655,2660,2665,2670,2675,2680,2685,2690,2695,2700,2705,2710,2715,2720,2725,2730,2735,2740,2745,2750,2755,2760,2765,2769,2774,2779,2784,2789,2794,2798,2803,2808,2813,2818,2822,2827,2832,2837,2841,2846,2851,2855,2860,2865,2869,2874,2879,2883,2888,2893,2897,2902,2907,2911,2916,2920,2925,2929,2934,2939,2943,2948,2952,2957,2961,2966,2970,2975,2979,2984,2988,2992,2997,3001,3006,3010,3014,3019,3023,3028,3032,3036,3041,3045,3049,3054,3058,3062,3067,3071,3075,3079,3084,3088,3092,3096,3101,3105,3109,3113,3117,3122,3126,3130,3134,3138,3142,3147,3151,3155,3159,3163,3167,3171,3175,3179,3183,3188,3192,3196,3200,3204,3208,3212,3216,3232,3247,3263,3279,3294,3309,3325,3340,3355,3370,3384,3399,3413,3428,3442,3456,3470,3484,3498,3512,3526,3539,3553,3566,3579,3592,3605,3618,3631,3644,3656,3669,3681,3694,3706,3718,3730,3742,3754,3766,3777,3789,3801,3812,3823,3835,3846,3857,3868,3879,3890,3901,3911,3922,3932,3943,3953,3964,3974,3984,3994,4004,4014,4024,4034,4044,4053,4063,4072,4082,4091,4101,4110,4119,4128,4137,4146,4155,4164,4173,4182,4190,4199,4208,4216,4225,4233,4241,4250,4258,4266,4274,4282,4290,4298,4306,4314,4322,4329,4337,4345,4352,4360,4367,4375,4382,4390,4397,4404,4411,4418,4426,4433,4440,4447,4454,4460,4467,4474,4481,4487,4494,4501,4507,4514,4520,4527,4533,4546,4559,4571,4583,4595,4607,4619,4631,4642,4654,4665,4676,4687,4698,4709,4719,4730,4740,4750,4761,4771,4780,4790,4800,4810,4819,4828,4838,4847,4856,4865,4874,4883,4891,4900,4908,4917,4925,4933,4941,4949,4957,4965,4973,4981,4989,4996,5004,5011,5018,5026,5033,5040,5047,5054,5061,5068,5075,5082,5088,5095,5101,5108,5114,5127,5139,5152,5164,5175,5187,5198,5210,5221,5231,5242,5252,5263,5273,5283,5292,5302,5311,5321,5330,5339,5347,5356,5365,5373,5381,5390,5398,5406,5413,5421,5429,5436,5444,5451,5458,5465,5472,5479,5486,5492,5499,5505,5512,5518,5524,5530,5536,5542,5548,5554,5560,5566,5571,5577,5582,5588,5593,5598,5603,5609,5614,5619,5624,5628,5633,5638,5643,5647,5652,5657,5661,5666,5670,5674,5679,5683,5687,5691,5695,5699,5704,5707,5711,5715,5719,5723,5727,5731,5734,5738,5742,5745,5749,5752,5756,5762,5769,5776,5782,5789,5795,5801,5807,5813,5818,5824,5830,5835,5840,5846,5851,5856,5861,5866,5871,5875,5880,5885,5889,5894,5898,5902,5906,5911,5915,5919,5923,5927,5930,5934,5938,5942,5945,5949,5952,5956,5959,5963,5966,5969,5972,5976,5979,5985,5991,5997,6002,6008,6013,6019,6024,6029,6034,6038,6043,6048,6052,6056,6061,6065,6069,6073,6077,6081,6084,6088,6091,6095,6098,6102,6105,6108,6111,6114,6118,6121,6123,6126,6129,6132,6135,6137,6140,6142,6145,6147,6150,6152,6155,6157,6159,6162,6164,6166,6168,6170,6172,6174,6176,6180,6184,6188,6191,6195,6198,6201,6205,6208,6211,6214,6217,6219,6222,6225,6227,6230,6232,6235,6237,6239,6242,6244,6246,6248,6250,6252,6254,6256,6258,6260,6261,6268,6274,6280,6286,6291,6295,6300,6304,6308,6312,6315,6318,6321,6324,6327,6330,6332,6334,6337,6339,6341,6343,6345,6347,6348,6350,6352,6353,6355,6356,6357,6359,6360,6361,6363,6364,6365,6366,6367,6367}; static unsigned short sin_fix_lut[1572]={0,32,65,98,131,163,196,229,262,294,327,360,393,425,458,491,524,557,589,622,655,688,720,753,786,819,851,884,917,950,982,1015,1048,1081,1113,1146,1179,1212,1244,1277,1310,1343,1375,1408,1441,1474,1506,1539,1572,1604,1637,1670,1703,1735,1768,1801,1834,1866,1899,1932,1964,1997,2030,2063,2095,2128,2161,2193,2226,2259,2291,2324,2357,2389,2422,2455,2487,2520,2553,2585,2618,2651,2683,2716,2749,2781,2814,2847,2879,2912,2945,2977,3010,3043,3075,3108,3140,3173,3206,3238,3271,3303,3336,3369,3401,3434,3466,3499,3532,3564,3597,3629,3662,3694,3727,3760,3792,3825,3857,3890,3922,3955,3987,4020,4052,4085,4117,4150,4182,4215,4247,4280,4312,4345,4377,4410,4442,4475,4507,4540,4572,4604,4637,4669,4702,4734,4767,4799,4831,4864,4896,4929,4961,4993,5026,5058,5091,5123,5155,5188,5220,5252,5285,5317,5349,5382,5414,5446,5479,5511,5543,5576,5608,5640,5672,5705,5737,5769,5801,5834,5866,5898,5930,5963,5995,6027,6059,6091,6124,6156,6188,6220,6252,6285,6317,6349,6381,6413,6445,6477,6510,6542,6574,6606,6638,6670,6702,6734,6766,6798,6830,6862,6894,6926,6958,6990,7022,7054,7086,7118,7150,7182,7214,7246,7278,7310,7342,7374,7406,7438,7470,7502,7534,7566,7597,7629,7661,7693,7725,7757,7789,7820,7852,7884,7916,7948,7979,8011,8043,8075,8106,8138,8170,8202,8233,8265,8297,8328,8360,8392,8424,8455,8487,8518,8550,8582,8613,8645,8677,8708,8740,8771,8803,8834,8866,8898,8929,8961,8992,9024,9055,9087,9118,9150,9181,9212,9244,9275,9307,9338,9370,9401,9432,9464,9495,9526,9558,9589,9620,9652,9683,9714,9746,9777,9808,9839,9871,9902,9933,9964,9996,10027,10058,10089,10120,10152,10183,10214,10245,10276,10307,10338,10369,10400,10432,10463,10494,10525,10556,10587,10618,10649,10680,10711,10742,10773,10804,10834,10865,10896,10927,10958,10989,11020,11051,11082,11112,11143,11174,11205,11236,11266,11297,11328,11359,11389,11420,11451,11481,11512,11543,11573,11604,11635,11665,11696,11727,11757,11788,11818,11849,11879,11910,11940,11971,12001,12032,12062,12093,12123,12154,12184,12215,12245,12275,12306,12336,12366,12397,12427,12457,12488,12518,12548,12579,12609,12639,12669,12700,12730,12760,12790,12820,12850,12881,12911,12941,12971,13001,13031,13061,13091,13121,13151,13181,13211,13241,13271,13301,13331,13361,13391,13421,13451,13481,13510,13540,13570,13600,13630,13659,13689,13719,13749,13778,13808,13838,13868,13897,13927,13957,13986,14016,14045,14075,14105,14134,14164,14193,14223,14252,14282,14311,14341,14370,14400,14429,14459,14488,14517,14547,14576,14605,14635,14664,14693,14723,14752,14781,14810,14840,14869,14898,14927,14956,14985,15015,15044,15073,15102,15131,15160,15189,15218,15247,15276,15305,15334,15363,15392,15421,15450,15479,15508,15536,15565,15594,15623,15652,15680,15709,15738,15767,15795,15824,15853,15881,15910,15939,15967,15996,16025,16053,16082,16110,16139,16167,16196,16224,16253,16281,16310,16338,16366,16395,16423,16452,16480,16508,16536,16565,16593,16621,16649,16678,16706,16734,16762,16790,16819,16847,16875,16903,16931,16959,16987,17015,17043,17071,17099,17127,17155,17183,17211,17238,17266,17294,17322,17350,17378,17405,17433,17461,17489,17516,17544,17572,17599,17627,17654,17682,17710,17737,17765,17792,17820,17847,17875,17902,17930,17957,17984,18012,18039,18067,18094,18121,18148,18176,18203,18230,18257,18285,18312,18339,18366,18393,18420,18447,18475,18502,18529,18556,18583,18610,18637,18664,18690,18717,18744,18771,18798,18825,18852,18878,18905,18932,18959,18985,19012,19039,19065,19092,19119,19145,19172,19198,19225,19251,19278,19304,19331,19357,19384,19410,19437,19463,19489,19516,19542,19568,19595,19621,19647,19673,19699,19726,19752,19778,19804,19830,19856,19882,19908,19934,19960,19986,20012,20038,20064,20090,20116,20142,20168,20193,20219,20245,20271,20296,20322,20348,20374,20399,20425,20450,20476,20502,20527,20553,20578,20604,20629,20655,20680,20705,20731,20756,20782,20807,20832,20857,20883,20908,20933,20958,20984,21009,21034,21059,21084,21109,21134,21159,21184,21209,21234,21259,21284,21309,21334,21359,21383,21408,21433,21458,21483,21507,21532,21557,21581,21606,21631,21655,21680,21704,21729,21753,21778,21802,21827,21851,21876,21900,21924,21949,21973,21997,22022,22046,22070,22094,22119,22143,22167,22191,22215,22239,22263,22287,22311,22335,22359,22383,22407,22431,22455,22479,22503,22526,22550,22574,22598,22621,22645,22669,22692,22716,22740,22763,22787,22810,22834,22857,22881,22904,22928,22951,22974,22998,23021,23044,23068,23091,23114,23137,23161,23184,23207,23230,23253,23276,23299,23322,23345,23368,23391,23414,23437,23460,23483,23506,23528,23551,23574,23597,23620,23642,23665,23688,23710,23733,23755,23778,23800,23823,23845,23868,23890,23913,23935,23958,23980,24002,24024,24047,24069,24091,24113,24136,24158,24180,24202,24224,24246,24268,24290,24312,24334,24356,24378,24400,24422,24444,24465,24487,24509,24531,24552,24574,24596,24617,24639,24661,24682,24704,24725,24747,24768,24790,24811,24832,24854,24875,24896,24918,24939,24960,24981,25003,25024,25045,25066,25087,25108,25129,25150,25171,25192,25213,25234,25255,25276,25297,25317,25338,25359,25380,25400,25421,25442,25462,25483,25504,25524,25545,25565,25586,25606,25627,25647,25667,25688,25708,25728,25749,25769,25789,25809,25830,25850,25870,25890,25910,25930,25950,25970,25990,26010,26030,26050,26070,26089,26109,26129,26149,26169,26188,26208,26228,26247,26267,26286,26306,26325,26345,26364,26384,26403,26423,26442,26461,26481,26500,26519,26538,26558,26577,26596,26615,26634,26653,26672,26691,26710,26729,26748,26767,26786,26805,26824,26843,26861,26880,26899,26918,26936,26955,26973,26992,27011,27029,27048,27066,27085,27103,27121,27140,27158,27177,27195,27213,27231,27250,27268,27286,27304,27322,27340,27358,27376,27394,27412,27430,27448,27466,27484,27502,27519,27537,27555,27573,27590,27608,27626,27643,27661,27678,27696,27713,27731,27748,27766,27783,27800,27818,27835,27852,27870,27887,27904,27921,27938,27955,27973,27990,28007,28024,28041,28058,28074,28091,28108,28125,28142,28159,28175,28192,28209,28225,28242,28259,28275,28292,28308,28325,28341,28358,28374,28390,28407,28423,28439,28456,28472,28488,28504,28520,28537,28553,28569,28585,28601,28617,28633,28649,28664,28680,28696,28712,28728,28744,28759,28775,28791,28806,28822,28837,28853,28868,28884,28899,28915,28930,28946,28961,28976,28992,29007,29022,29037,29052,29068,29083,29098,29113,29128,29143,29158,29173,29188,29203,29217,29232,29247,29262,29276,29291,29306,29320,29335,29350,29364,29379,29393,29408,29422,29437,29451,29465,29480,29494,29508,29522,29537,29551,29565,29579,29593,29607,29621,29635,29649,29663,29677,29691,29705,29719,29732,29746,29760,29774,29787,29801,29814,29828,29842,29855,29869,29882,29896,29909,29922,29936,29949,29962,29975,29989,30002,30015,30028,30041,30054,30067,30080,30093,30106,30119,30132,30145,30158,30171,30183,30196,30209,30222,30234,30247,30259,30272,30284,30297,30309,30322,30334,30347,30359,30371,30384,30396,30408,30420,30432,30445,30457,30469,30481,30493,30505,30517,30529,30541,30552,30564,30576,30588,30600,30611,30623,30635,30646,30658,30669,30681,30692,30704,30715,30727,30738,30749,30761,30772,30783,30794,30806,30817,30828,30839,30850,30861,30872,30883,30894,30905,30916,30927,30937,30948,30959,30970,30980,30991,31002,31012,31023,31033,31044,31054,31065,31075,31086,31096,31106,31116,31127,31137,31147,31157,31167,31178,31188,31198,31208,31218,31228,31237,31247,31257,31267,31277,31287,31296,31306,31316,31325,31335,31344,31354,31363,31373,31382,31392,31401,31411,31420,31429,31438,31448,31457,31466,31475,31484,31493,31502,31511,31520,31529,31538,31547,31556,31565,31573,31582,31591,31600,31608,31617,31625,31634,31643,31651,31659,31668,31676,31685,31693,31701,31710,31718,31726,31734,31742,31751,31759,31767,31775,31783,31791,31799,31806,31814,31822,31830,31838,31845,31853,31861,31868,31876,31884,31891,31899,31906,31914,31921,31928,31936,31943,31950,31958,31965,31972,31979,31986,31993,32001,32008,32015,32022,32028,32035,32042,32049,32056,32063,32069,32076,32083,32089,32096,32103,32109,32116,32122,32129,32135,32141,32148,32154,32160,32167,32173,32179,32185,32191,32198,32204,32210,32216,32222,32228,32233,32239,32245,32251,32257,32263,32268,32274,32280,32285,32291,32296,32302,32307,32313,32318,32324,32329,32334,32340,32345,32350,32355,32360,32366,32371,32376,32381,32386,32391,32396,32401,32405,32410,32415,32420,32425,32429,32434,32439,32443,32448,32452,32457,32461,32466,32470,32475,32479,32483,32488,32492,32496,32500,32504,32509,32513,32517,32521,32525,32529,32533,32537,32540,32544,32548,32552,32556,32559,32563,32567,32570,32574,32577,32581,32584,32588,32591,32595,32598,32601,32605,32608,32611,32614,32617,32620,32624,32627,32630,32633,32636,32638,32641,32644,32647,32650,32653,32655,32658,32661,32663,32666,32668,32671,32673,32676,32678,32681,32683,32685,32688,32690,32692,32694,32697,32699,32701,32703,32705,32707,32709,32711,32713,32715,32717,32718,32720,32722,32724,32725,32727,32729,32730,32732,32733,32735,32736,32738,32739,32740,32742,32743,32744,32745,32747,32748,32749,32750,32751,32752,32753,32754,32755,32756,32757,32757,32758,32759,32760,32760,32761,32762,32762,32763,32763,32764,32764,32765,32765,32766,32766,32766,32767,32767,32767,32767,32767,32767,32767,32767,32768}; static unsigned short cos_fix_lut[1572] = {32768,32767,32767,32767,32767,32767,32767,32767,32766,32766,32766,32766,32765,32765,32764,32764,32763,32763,32762,32762,32761,32760,32760,32759,32758,32757,32756,32756,32755,32754,32753,32752,32751,32750,32749,32747,32746,32745,32744,32743,32741,32740,32739,32737,32736,32734,32733,32731,32730,32728,32727,32725,32723,32721,32720,32718,32716,32714,32712,32710,32709,32707,32705,32702,32700,32698,32696,32694,32692,32690,32687,32685,32683,32680,32678,32675,32673,32670,32668,32665,32663,32660,32657,32655,32652,32649,32646,32644,32641,32638,32635,32632,32629,32626,32623,32620,32617,32613,32610,32607,32604,32601,32597,32594,32590,32587,32584,32580,32577,32573,32569,32566,32562,32559,32555,32551,32547,32543,32540,32536,32532,32528,32524,32520,32516,32512,32508,32504,32499,32495,32491,32487,32482,32478,32474,32469,32465,32460,32456,32451,32447,32442,32438,32433,32428,32424,32419,32414,32409,32404,32400,32395,32390,32385,32380,32375,32370,32364,32359,32354,32349,32344,32338,32333,32328,32322,32317,32312,32306,32301,32295,32290,32284,32278,32273,32267,32261,32256,32250,32244,32238,32232,32226,32220,32214,32208,32202,32196,32190,32184,32178,32172,32165,32159,32153,32146,32140,32134,32127,32121,32114,32108,32101,32095,32088,32081,32075,32068,32061,32054,32048,32041,32034,32027,32020,32013,32006,31999,31992,31985,31978,31971,31963,31956,31949,31942,31934,31927,31919,31912,31905,31897,31890,31882,31874,31867,31859,31852,31844,31836,31828,31820,31813,31805,31797,31789,31781,31773,31765,31757,31749,31741,31733,31724,31716,31708,31700,31691,31683,31675,31666,31658,31649,31641,31632,31624,31615,31606,31598,31589,31580,31572,31563,31554,31545,31536,31527,31518,31509,31500,31491,31482,31473,31464,31455,31446,31436,31427,31418,31409,31399,31390,31380,31371,31362,31352,31342,31333,31323,31314,31304,31294,31285,31275,31265,31255,31245,31235,31226,31216,31206,31196,31186,31175,31165,31155,31145,31135,31125,31114,31104,31094,31083,31073,31063,31052,31042,31031,31021,31010,30999,30989,30978,30967,30957,30946,30935,30924,30913,30903,30892,30881,30870,30859,30848,30837,30826,30814,30803,30792,30781,30770,30758,30747,30736,30724,30713,30701,30690,30679,30667,30655,30644,30632,30621,30609,30597,30585,30574,30562,30550,30538,30526,30514,30502,30490,30478,30466,30454,30442,30430,30418,30406,30393,30381,30369,30357,30344,30332,30319,30307,30294,30282,30269,30257,30244,30232,30219,30206,30194,30181,30168,30155,30142,30130,30117,30104,30091,30078,30065,30052,30039,30026,30012,29999,29986,29973,29960,29946,29933,29920,29906,29893,29879,29866,29852,29839,29825,29812,29798,29785,29771,29757,29743,29730,29716,29702,29688,29674,29660,29646,29632,29618,29604,29590,29576,29562,29548,29534,29520,29505,29491,29477,29462,29448,29434,29419,29405,29390,29376,29361,29347,29332,29318,29303,29288,29274,29259,29244,29229,29214,29200,29185,29170,29155,29140,29125,29110,29095,29080,29065,29049,29034,29019,29004,28989,28973,28958,28943,28927,28912,28896,28881,28865,28850,28834,28819,28803,28788,28772,28756,28740,28725,28709,28693,28677,28661,28646,28630,28614,28598,28582,28566,28550,28533,28517,28501,28485,28469,28453,28436,28420,28404,28387,28371,28354,28338,28322,28305,28289,28272,28255,28239,28222,28206,28189,28172,28155,28139,28122,28105,28088,28071,28054,28037,28020,28003,27986,27969,27952,27935,27918,27901,27884,27866,27849,27832,27815,27797,27780,27762,27745,27728,27710,27693,27675,27657,27640,27622,27605,27587,27569,27552,27534,27516,27498,27480,27463,27445,27427,27409,27391,27373,27355,27337,27319,27301,27282,27264,27246,27228,27210,27191,27173,27155,27136,27118,27100,27081,27063,27044,27026,27007,26989,26970,26951,26933,26914,26895,26877,26858,26839,26820,26801,26783,26764,26745,26726,26707,26688,26669,26650,26631,26612,26592,26573,26554,26535,26516,26496,26477,26458,26438,26419,26400,26380,26361,26341,26322,26302,26283,26263,26243,26224,26204,26184,26165,26145,26125,26105,26086,26066,26046,26026,26006,25986,25966,25946,25926,25906,25886,25866,25846,25826,25805,25785,25765,25745,25725,25704,25684,25664,25643,25623,25602,25582,25561,25541,25520,25500,25479,25458,25438,25417,25396,25376,25355,25334,25313,25293,25272,25251,25230,25209,25188,25167,25146,25125,25104,25083,25062,25041,25020,24999,24977,24956,24935,24914,24892,24871,24850,24828,24807,24785,24764,24743,24721,24700,24678,24656,24635,24613,24592,24570,24548,24526,24505,24483,24461,24439,24418,24396,24374,24352,24330,24308,24286,24264,24242,24220,24198,24176,24154,24131,24109,24087,24065,24043,24020,23998,23976,23953,23931,23909,23886,23864,23841,23819,23796,23774,23751,23728,23706,23683,23661,23638,23615,23592,23570,23547,23524,23501,23478,23456,23433,23410,23387,23364,23341,23318,23295,23272,23249,23226,23203,23179,23156,23133,23110,23087,23063,23040,23017,22993,22970,22947,22923,22900,22876,22853,22829,22806,22782,22759,22735,22712,22688,22664,22641,22617,22593,22569,22546,22522,22498,22474,22450,22426,22403,22379,22355,22331,22307,22283,22259,22235,22211,22186,22162,22138,22114,22090,22066,22041,22017,21993,21969,21944,21920,21895,21871,21847,21822,21798,21773,21749,21724,21700,21675,21651,21626,21601,21577,21552,21527,21503,21478,21453,21428,21404,21379,21354,21329,21304,21279,21254,21229,21204,21179,21154,21129,21104,21079,21054,21029,21004,20979,20954,20928,20903,20878,20853,20827,20802,20777,20751,20726,20701,20675,20650,20624,20599,20573,20548,20522,20497,20471,20446,20420,20394,20369,20343,20317,20292,20266,20240,20214,20188,20163,20137,20111,20085,20059,20033,20007,19981,19955,19929,19903,19877,19851,19825,19799,19773,19747,19721,19694,19668,19642,19616,19590,19563,19537,19511,19484,19458,19432,19405,19379,19352,19326,19299,19273,19246,19220,19193,19167,19140,19114,19087,19060,19034,19007,18980,18954,18927,18900,18873,18846,18820,18793,18766,18739,18712,18685,18658,18631,18604,18577,18550,18523,18496,18469,18442,18415,18388,18361,18334,18307,18279,18252,18225,18198,18171,18143,18116,18089,18061,18034,18007,17979,17952,17924,17897,17870,17842,17815,17787,17759,17732,17704,17677,17649,17622,17594,17566,17539,17511,17483,17455,17428,17400,17372,17344,17317,17289,17261,17233,17205,17177,17149,17121,17094,17066,17038,17010,16982,16954,16925,16897,16869,16841,16813,16785,16757,16729,16700,16672,16644,16616,16588,16559,16531,16503,16474,16446,16418,16389,16361,16333,16304,16276,16247,16219,16190,16162,16133,16105,16076,16048,16019,15990,15962,15933,15905,15876,15847,15819,15790,15761,15732,15704,15675,15646,15617,15588,15560,15531,15502,15473,15444,15415,15386,15357,15328,15299,15270,15241,15212,15183,15154,15125,15096,15067,15038,15009,14980,14951,14921,14892,14863,14834,14805,14775,14746,14717,14688,14658,14629,14600,14570,14541,14512,14482,14453,14423,14394,14364,14335,14306,14276,14247,14217,14188,14158,14128,14099,14069,14040,14010,13980,13951,13921,13891,13862,13832,13802,13773,13743,13713,13683,13654,13624,13594,13564,13534,13504,13475,13445,13415,13385,13355,13325,13295,13265,13235,13205,13175,13145,13115,13085,13055,13025,12995,12965,12935,12905,12874,12844,12814,12784,12754,12724,12693,12663,12633,12603,12573,12542,12512,12482,12451,12421,12391,12360,12330,12300,12269,12239,12208,12178,12148,12117,12087,12056,12026,11995,11965,11934,11904,11873,11843,11812,11782,11751,11720,11690,11659,11629,11598,11567,11537,11506,11475,11444,11414,11383,11352,11322,11291,11260,11229,11198,11168,11137,11106,11075,11044,11014,10983,10952,10921,10890,10859,10828,10797,10766,10735,10704,10673,10642,10611,10580,10549,10518,10487,10456,10425,10394,10363,10332,10301,10270,10239,10207,10176,10145,10114,10083,10052,10020,9989,9958,9927,9896,9864,9833,9802,9771,9739,9708,9677,9645,9614,9583,9551,9520,9489,9457,9426,9394,9363,9332,9300,9269,9237,9206,9174,9143,9112,9080,9049,9017,8986,8954,8923,8891,8859,8828,8796,8765,8733,8702,8670,8638,8607,8575,8544,8512,8480,8449,8417,8385,8354,8322,8290,8258,8227,8195,8163,8132,8100,8068,8036,8004,7973,7941,7909,7877,7846,7814,7782,7750,7718,7686,7654,7623,7591,7559,7527,7495,7463,7431,7399,7367,7335,7304,7272,7240,7208,7176,7144,7112,7080,7048,7016,6984,6952,6920,6888,6856,6824,6791,6759,6727,6695,6663,6631,6599,6567,6535,6503,6471,6438,6406,6374,6342,6310,6278,6246,6213,6181,6149,6117,6085,6052,6020,5988,5956,5924,5891,5859,5827,5795,5762,5730,5698,5666,5633,5601,5569,5536,5504,5472,5439,5407,5375,5342,5310,5278,5245,5213,5181,5148,5116,5084,5051,5019,4987,4954,4922,4889,4857,4825,4792,4760,4727,4695,4662,4630,4598,4565,4533,4500,4468,4435,4403,4370,4338,4305,4273,4240,4208,4175,4143,4110,4078,4045,4013,3980,3948,3915,3883,3850,3818,3785,3752,3720,3687,3655,3622,3590,3557,3525,3492,3459,3427,3394,3362,3329,3296,3264,3231,3199,3166,3133,3101,3068,3035,3003,2970,2938,2905,2872,2840,2807,2774,2742,2709,2676,2644,2611,2578,2546,2513,2480,2448,2415,2382,2350,2317,2284,2252,2219,2186,2153,2121,2088,2055,2023,1990,1957,1925,1892,1859,1826,1794,1761,1728,1696,1663,1630,1597,1565,1532,1499,1466,1434,1401,1368,1335,1303,1270,1237,1204,1172,1139,1106,1073,1041,1008,975,942,910,877,844,811,779,746,713,680,648,615,582,549,517,484,451,418,385,353,320,287,254,222,189,156,123,91,58,25}; /** * Funtion to find 1/x. x is QM.(16-M) fixed point format. * The value returned is of 16-bit wide with fractional part equal to N i.e. Q(16-N).N. * This works only for a 16-bit fixed point representation of x. */ static unsigned int Inverse(unsigned short x,int M,char *N); /** * Funtion to find 1/x. x is QM.(16-M) fixed point format. * The value returned is of 32-bit wide with fractional part equal to N i.e. Q(32-N).N. * This works only for a 16-bit fixed point representation of x. * */ static unsigned int Inverse32(unsigned short x,int M,char *N); /** * Funtion to find y/x. x is QM1.(16-M1) and y is QM2.(16-M2) fixed point format. * The value returned is of 32-bit width fixed point format of Qout_M.out_N. * This works only for a 16-bit fixed point representation of x and y. * * This function implements the division like y*Inverse(x). */ static unsigned int DivideYByX(unsigned short x,unsigned short y,int M1,int M2,char *out_M,char *out_N); /** * Funtion to find atan2(y,x). x is QM1.N1 and y is QM2.N2 fixed point format. x and y are of 16-bit. * The value returned is of 16-bit width fixed point format of Qout_M.out_N. * The angle returned by this function will be in -pi to pi range in Q4.12 */ static short Atan2LookupFP(short xs,short ys,int M1,int N1,int M2, int N2); /** * Square root computation * D is 32-bit fixed point number. Q is the sqrt(D) and is 16-bit type * If format of D is QM.N then format of Q is Q(M/2).N * * For more details on Q formats of square root refer to sqrt.pdf */ static int Sqrt(unsigned int D); /** * Inverse32: Computes the inverse of 16-bit integer and returns high precision value. */ static unsigned int Inverse32(unsigned short x, int M, char *N) { assert((M<=16) && "Integer part of x should always be less than or equal to 16 bits."); unsigned int val=0; unsigned int index; int B_L = 17; int tmp = 4; int pos, block; pos = block = 0; int shift = 0; unsigned short x1 = (x >> 12) & 0x000F; unsigned short x2 = (x >> 8) & 0x000F; unsigned short x3 = (x >> 4) & 0x000F; unsigned short x4 = x & 0x000F; unsigned short tmpx = 0; if (x == 0) { return division_lut[0]; } else { if (x1 > 0) { tmpx = x1; block = 0; for (tmp = 0; tmp < 4; tmp++) { #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x1 >> (3-tmp); if (tmpx) { pos = tmp+1; break; } } } else if (x2 > 0) { block = 4; tmpx = x2; for (tmp = 0; tmp < 4; tmp++) { #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x2 >> (3-tmp); if (tmpx) { pos = tmp+1; break; } } } else if (x3 > 0) { block = 8; tmpx = x3; for (tmp = 0; tmp < 4; tmp++) { #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x3 >> (3-tmp); if (tmpx) { pos = tmp+1; break; } } } else { block = 12; tmpx = x4; for (tmp = 0; tmp < 4; tmp++) { #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x4 >> (3-tmp); if (tmpx) { pos = tmp+1; break; } } } } B_L = block + pos; shift = 0; //DATA_SIZE - LUT_BITS - 1; if (B_L >= 1) { index = ((x<<(B_L-1))& 0x7FFF)>>shift; } else { index = (x & 0x7FFF)>>shift; } val = division_lut32[index]; *N = M + 16 - B_L; return val; } static unsigned int Inverse(unsigned short x,int M,char *N) { assert((M<=16) && "Integer part of x should always be less than or equal to 16 bits."); unsigned int val=0; unsigned int index; int B_L = DATA_SIZE+1; int tmp = 4; int pos, block; pos = block = 0; int shift = 0; unsigned short x1 = (x >> 12) & 0x000F; unsigned short x2 = (x >> 8) & 0x000F; unsigned short x3 = (x >> 4) & 0x000F; unsigned short x4 = x & 0x000F; unsigned short tmpx = 0; if (x == 0) return division_lut[0]; else { if (x1 > 0){ tmpx = x1; block = 0; for (tmp = 0; tmp < 4; tmp++){ #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x1 >> (3-tmp); if (tmpx){ pos = tmp+1; break; } } } else if (x2 > 0){ block = 1; tmpx = x2; for (tmp = 0; tmp < 4; tmp++){ #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x2 >> (3-tmp); if (tmpx){ pos = tmp+1; break; } } } else if (x3 > 0){ block = 2; tmpx = x3; for (tmp = 0; tmp < 4; tmp++){ #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x3 >> (3-tmp); if (tmpx){ pos = tmp+1; break; } } } else{ block = 3; tmpx = x4; for (tmp = 0; tmp < 4; tmp++){ #pragma HLS LOOP_TRIPCOUNT min=4 max=4 avg=4 #pragma HLS pipeline tmpx = x4 >> (3-tmp); if (tmpx){ pos = tmp+1; break; } } } } B_L = 4 * block + pos; shift = DATA_SIZE - LUT_BITS - 1; if (B_L>=1) index = ((x<<(B_L-1))& 0x7FFF)>>shift; else index = (x & 0x7FFF)>>shift; val = division_lut[index]; *N = M+DATA_SIZE-B_L; return val; } static char IdentifySignBits(ap_int<24> in_val) { bool flag = 0; char counter = 0; bool signbit = in_val.range(23,23); signBitsLoop: while(flag == 0) { #pragma HLS LOOP_TRIPCOUNT min=24 max=24 #pragma HLS PIPELINE bool bit_val = in_val.range((23-counter),(23-counter)); if(bit_val == signbit) counter++; else flag=1; if(counter == 24) break; } return counter; } static unsigned short Inverse8(unsigned char x,int M,char *N) { assert((M==8) && "x should be of Q8.0 format."); unsigned int val=0; unsigned int index; if (x == 0) return division_lut8[0]; else { val = division_lut8[x]; *N = 15; } return val; } static unsigned int DivideYByX(unsigned short x,unsigned short y,int M1,int M2, char *out_M,char *out_N) { unsigned int div_val; char MOut,NOut; unsigned int x_inv = Inverse(x,M1,&NOut); MOut = DATA_SIZE-NOut+M2; NOut = NOut + DATA_SIZE - M2; div_val = y*x_inv; *out_M = MOut; *out_N = NOut; return div_val; } static void findInverse24(ap_int<24> &x,int &M,int &N,unsigned int &inv_x,int *outM,int *outN) { char sb = IdentifySignBits(x); // find number of sign bits ap_int24_t unsigned_x = (ap_int24_t)x.range(23-sb,0); // Extract the value without sign bits int M1,N1,leftover_bits=0; if (N==0) { M1 = M-sb; // Number of valid integer bits if (M1 > 16) { leftover_bits = M1 - 16; // No of bits left over in x after extracting unsigned_x } M1 = 16; // No of integer bits in unsigned_x } unsigned short xs = unsigned_x>>leftover_bits; // Extract the 16 MSBits from unsigned_x char Nout; unsigned int inv_xs = Inverse(xs,M1,&Nout); // find inverse to the MSBits inv_x = (long int)inv_xs; // return output *outN = Nout + leftover_bits; // return output Q format, no of fractional bits *outM = 32-Nout; // return output Q format, no of integer bits } static unsigned int DivideYByX8(unsigned char x,unsigned char y,int M1,int M2,char *out_M,char *out_N) { assert((M1==8) && (M2==8) && "x and y should be of Q8.0 format."); unsigned int div_val; char MOut,NOut; unsigned short x_inv = Inverse8(x,M1,&NOut); MOut = (16-NOut)+M2; // int part of 1/x + int part of y NOut = NOut + (8 - M2); // frac part of 1/x + frac part of y div_val = y*x_inv; *out_M = MOut; *out_N = NOut; return div_val; } static unsigned long int DivideYByX24(ap_int24_t x,ap_int24_t y,int M1,int M2, int *out_M,int *out_N) { unsigned long int div_val; char MOut,NOut; unsigned int x_inv ; int N1=0,N2=0; int M3,N3; findInverse24(x,M1,N1,x_inv,&M3,&N3); MOut = M2+M3; NOut = N3 + 24 - M2; div_val = (unsigned long int)y*x_inv; *out_M = MOut; *out_N = NOut; return div_val; } static short Atan2LookupFP(short xs,short ys,int M1,int N1,int M2, int N2) { assert(((N1 == 16-M1) && (N2==16-M2) && (M1==M2)) && "xs and ys should be of 16-bit and same fixed point type."); short theta; signed char s1,s2,s; if (ys == 0 && xs == 0) return 0; else { unsigned long gy_fp,gx_fp; unsigned long int frac_extractor; unsigned long int k2_fp; unsigned short int_part; unsigned int frac_part,frac_ind,frac_bits; gx_fp = xs; s1 = 1; gy_fp = ys; s2 = 1; if (xs < 0) { gx_fp = -xs; s1 = -1; } if (ys < 0) { gy_fp = -ys; s2 = -1; } s = s1*s2; // find the sign of gy/gx char MOut,NOut; k2_fp = DivideYByX(gx_fp,gy_fp,M1,M2,&MOut,&NOut); frac_extractor = (1<<NOut)-1; int_part = k2_fp>>NOut; frac_part = (k2_fp & frac_extractor); if (int_part < 63) { frac_bits = frac_bits_lut[int_part]; // Number of fractional bits needed to find sub-index in look-up table frac_ind = (frac_part >> (NOut-frac_bits)); // find sub-index int ind = base_addr_lut[int_part] + frac_ind; // find the index for atan look up table theta = atan_lut_fp[ind]; } else theta = XF_PI_BY_2_FIXED; if (gx_fp == 0) theta = XF_PI_BY_2_FIXED; if (s < 0) theta = -theta; if (xs > 0) return theta; else if (ys >= 0 && xs < 0) return XF_PI_FIXED + theta; else if (ys < 0 && xs < 0) return theta - XF_PI_FIXED; else if (ys > 0 && xs == 0) return XF_PI_BY_2_FIXED; else if (ys < 0 && xs == 0) return -XF_PI_BY_2_FIXED; } return theta; // returns atan2 value in fixed point form of signed Q4.12. Its range will be b/w -pi to pi. } static short Atan2LUT8(short xs,short ys,int M1,int N1,int M2, int N2) { assert(((N1 == 9-M1) && (N2==9-M2) && (M1==M2)) && "xs and ys should be of signed 9-bit and same fixed point type."); short theta; signed char s1,s2,s; if (ys == 0 && xs == 0) return 0; else { unsigned short gy_fp,gx_fp; unsigned long int frac_extractor; unsigned int k2_fp; unsigned short int_part; unsigned int frac_part,frac_ind,frac_bits; gx_fp = xs; s1 = 1; gy_fp = ys; s2 = 1; if (xs < 0) { gx_fp = -xs; s1 = -1; } if (ys < 0) { gy_fp = -ys; s2 = -1; } s = s1*s2; // find the sign of gy/gx char MOut,NOut; k2_fp = DivideYByX8((unsigned char)gx_fp,(unsigned char)gy_fp,8,8,&MOut,&NOut); frac_extractor = (1<<NOut)-1; int_part = k2_fp>>NOut; frac_part = (k2_fp & frac_extractor); if (int_part < 63) { frac_bits = base_addr_lut8[63+int_part]; frac_ind = (frac_part >> (NOut-frac_bits)); // find sub-index int ind = base_addr_lut8[int_part] + frac_ind; // find the index for atan look up table theta = atan_lut_fp8[ind]; } else theta = XF_PI_BY_2_FIXED; if (gx_fp == 0) theta = XF_PI_BY_2_FIXED; if (s < 0) theta = -theta; if (xs > 0) return theta; else if (ys >= 0 && xs < 0) return XF_PI_FIXED + theta; else if (ys < 0 && xs < 0) return theta - XF_PI_FIXED; else if (ys > 0 && xs == 0) return XF_PI_BY_2_FIXED; else if (ys < 0 && xs == 0) return -XF_PI_BY_2_FIXED; } return theta; // returns atan2 value in fixed point form of signed Q4.12. Its range will be b/w -pi to pi. } static short Atan2LookupFP24(ap_int24_t xs,ap_int24_t ys,int M1,int N1,int M2, int N2) { assert(((N1 == 24-M1) && (N2==24-M2) && (M1==M2)) && "xs and ys should be of 24-bit and same fixed point type."); short theta; char s1,s2,s; if (ys == 0 && xs == 0) return 0; else { ap_int24_t gy_fp,gx_fp; unsigned long int frac_extractor; unsigned long int k2_fp; unsigned short int_part; unsigned long int frac_part=0,frac_ind=0,frac_bits=0; gx_fp = xs; s1 = 1; gy_fp = ys; s2 = 1; if (xs < 0) { gx_fp = -xs; s1 = -1; } if (ys < 0) { gy_fp = -ys; s2 = -1; } s = s1*s2; // find the sign of gy/gx int MOut,NOut; k2_fp = DivideYByX24(gx_fp,gy_fp,M1,M2,&MOut,&NOut); frac_extractor = ((unsigned long int)1<<NOut)-1; int_part = k2_fp>>NOut; frac_part = (k2_fp & frac_extractor); if (int_part < 63) { frac_bits = frac_bits_lut[int_part]; // Number of fractional bits needed to find sub-index in look-up table frac_ind = (unsigned long int)(frac_part >> (NOut-frac_bits)); // find sub-index int ind = base_addr_lut[int_part] + frac_ind; // find the index for atan look up table theta = atan_lut_fp[ind]; } else theta = XF_PI_BY_2_FIXED; if (gx_fp == 0) theta = XF_PI_BY_2_FIXED; if (s < 0) theta = -theta; if (xs > 0) return theta; else if (ys >= 0 && xs < 0) return XF_PI_FIXED + theta; else if (ys < 0 && xs < 0) return theta - XF_PI_FIXED; else if (ys > 0 && xs == 0) return XF_PI_BY_2_FIXED; else if (ys < 0 && xs == 0) return -XF_PI_BY_2_FIXED; } return theta; // returns atan2 value in fixed point form of signed Q4.12. Its range will be b/w -pi to pi. } /** * Square root computation for a 16-bit fixed point number. * * Input argument D should be 16-bit number though it is declared as 32-bit. * Q is the sqrt(D) and is 16-bit type * If format of D is QM.N (where M+N = 16) then format of Q is Q(M/2).N * * In order to get a precision of 'n' bits in fractional part, you can simply shift left the radicand (D) by '2n' * before function call and shift the solution right by 'n' to get the correct answer. * * For example, if you want to find the square root of 35 (01100011) with one bit after decimal point i.e. N=1. * You have to first find the square root of 0110001100 (shift left by 2). After you get the answer (1011) you * have right shift it right by 1, so that the correct answer is 101.1 which is 5.5. * */ static int Sqrt(unsigned int D) { //#pragma HLS license key=IPAUVIZ_CV_BASIC int i; short int Q; int R; Q = R = 0; int tmp = 0; int tmpQ, tmpR; for(i = 15; i >= 0; i--) { #pragma HLS pipeline if(R >= 0) { tmp = D >> (i+i); tmp = tmp & 3; tmpR = R << 2; R = tmpR | tmp; tmpQ = Q << 2; tmpQ = tmpQ | 1; R = R - tmpQ; } else { tmp = D >> (i+i); tmp = tmp & 3; tmpR = R << 2; R = tmpR | tmp; tmpQ = Q << 2; tmpQ = tmpQ | 3; R = R + tmpQ; } if(R >= 0) { Q = Q << 1; Q = Q | 1; } else { Q = Q << 1; Q = Q | 0; } } return Q; } } #endif
[ "tliang@connect.ust.hk" ]
tliang@connect.ust.hk
9ea26001da0fe46bd00c9a067e136bd66cf2b99b
90871627ab5f1393be9663bc0fa30f8988c30ae1
/Dungreed/SceneManager.cpp
6b9c8b552c5c83601071b8dff2a13dda0afffb96
[]
no_license
pigranya1218/WinAPI-Dungreed
058992a6e68bb6df5178646298de76432c805132
f1737c47db4fd295b0b99cb42c2d8e8ff4586889
refs/heads/master
2022-12-11T16:31:55.632652
2020-08-24T00:41:41
2020-08-24T00:41:41
283,921,303
1
0
null
null
null
null
UHC
C++
false
false
1,440
cpp
#include "stdafx.h" #include "SceneManager.h" #include "GameNode.h" SceneManager::SceneManager() { } SceneManager::~SceneManager() { } GameNode* SceneManager::_currentScene = NULL; HRESULT SceneManager::init() { _currentScene = NULL; return S_OK; } void SceneManager::release() { auto miSceneList = _mSceneList.begin(); for (; miSceneList != _mSceneList.end();) { if (miSceneList->second != NULL) { if (miSceneList->second == _currentScene) miSceneList->second->release(); SAFE_DELETE(miSceneList->second); miSceneList = _mSceneList.erase(miSceneList); } else ++miSceneList; } _mSceneList.clear(); } void SceneManager::update() { if (_currentScene) _currentScene->update(); } void SceneManager::render() { if (_currentScene) _currentScene->render(); } GameNode * SceneManager::addScene(string sceneName, GameNode * scene) { if (!scene) return nullptr; _mSceneList.insert(make_pair(sceneName, scene)); return scene; } HRESULT SceneManager::changeScene(string sceneName) { auto find = _mSceneList.find(sceneName); if (find == _mSceneList.end()) return E_FAIL; if (find->second == _currentScene) return S_OK; if (SUCCEEDED(find->second->init())) { //어떤 씬의 정보가 들어있기 때문에 릴리즈 먼저 해주고 if (_currentScene) _currentScene->release(); //현재 씬에 바꾸려는 씬을 담는다 _currentScene = find->second; return S_OK; } return E_FAIL; }
[ "ddodd34@gmail.com" ]
ddodd34@gmail.com
5801a68d3dc7a21db63a1940641b08583a7818a9
bdd9f3cdabe0c768641cf61855a6f24174735410
/src/engine/client/library/clientGame/src/shared/space/ShipComponentDataTargetingStation.h
62f9bc5c47acf9e331a591372886a566c6e2dcb3
[]
no_license
SWG-Source/client-tools
4452209136b376ab369b979e5c4a3464be28257b
30ec3031184243154c3ba99cedffb2603d005343
refs/heads/master
2023-08-31T07:44:22.692402
2023-08-28T04:34:07
2023-08-28T04:34:07
159,086,319
15
47
null
2022-04-15T16:20:34
2018-11-25T23:57:31
C++
UTF-8
C++
false
false
1,553
h
//====================================================================== // // ShipComponentDataTargetingStation.h // copyright (c) 2004 Sony Online Entertainment // //====================================================================== #ifndef INCLUDED_ShipComponentDataTargetingStation_H #define INCLUDED_ShipComponentDataTargetingStation_H //====================================================================== #include "clientGame/ClientShipComponentData.h" //---------------------------------------------------------------------- class ShipComponentDataTargetingStation : public ClientShipComponentData { public: explicit ShipComponentDataTargetingStation (ShipComponentDescriptor const & shipComponentDescriptor); virtual ~ShipComponentDataTargetingStation (); virtual bool readDataFromShip (int chassisSlot, ShipObject const & ship); virtual void printDebugString (Unicode::String & result, Unicode::String const & padding) const; virtual void getAttributes (stdvector<std::pair<std::string, Unicode::String> >::fwd & data) const; private: ShipComponentDataTargetingStation (const ShipComponentDataTargetingStation & rhs); ShipComponentDataTargetingStation & operator= (const ShipComponentDataTargetingStation & rhs); public: //-- these members are public because this instances of this class are short-lived temporary objects, //-- to simplify the conversion from the ShipObject & shipt representation of components. }; //====================================================================== #endif
[ "swgmaster@india.com" ]
swgmaster@india.com
419aad002ee7f9309b68dcbe3d77edd084b2e344
2521f019d85941a9732e2bbb1ae18cafff3bbc72
/DeferredRendering/DeferredRendering/D3DRenderView.cpp
d2c25f75beca5271ccfd79b45d5b7817073778ac
[]
no_license
vanish87/is-deferred-rendering-vs2012
03418e43cb1620d46f204abbe4cd033fb2ad7fc2
6122759bfa71ecdcd816222e80c3dfc1ceae4fd4
refs/heads/master
2020-05-28T03:25:18.717194
2017-01-29T06:57:57
2017-01-29T06:57:57
32,836,346
1
0
null
null
null
null
UTF-8
C++
false
false
1,038
cpp
#include "D3DRenderView.h" namespace MocapGE { D3DRenderTargetView::D3DRenderTargetView(void) :render_target_view_(nullptr) { } D3DRenderTargetView::D3DRenderTargetView( Texture& texture, int array_size, int mip_level ) { texture_ = &texture; D3DTexture2D* d3d_t2d = static_cast<D3DTexture2D*>(&texture); render_target_view_ = d3d_t2d->GetRenderTargetView( array_size, mip_level ,texture_->GetType()); width_ = d3d_t2d->GetWidth(); height_ = d3d_t2d->GetHeight(); format_ = d3d_t2d->GetFormat(); dimension_ = TEXTURE2D; } D3DRenderTargetView::~D3DRenderTargetView(void) { } void D3DRenderTargetView::SetD3DRTV( ID3D11RenderTargetView* render_target_view ) { this->render_target_view_ = render_target_view; } D3DDepthStencilRenderView::D3DDepthStencilRenderView( void ) :depth_stencil_view_(nullptr) { } void D3DDepthStencilRenderView::SetD3DDSV( ID3D11DepthStencilView* depth_stencil_view ) { this->depth_stencil_view_=depth_stencil_view; } }
[ "vanish8.7@gmail.com@6294a696-770a-505e-ba8e-939081b951f1" ]
vanish8.7@gmail.com@6294a696-770a-505e-ba8e-939081b951f1
c1e5d705cd4ae2d189d1ea63516b83159e386bf1
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/httpd/gumtree/httpd_repos_function_2621_httpd-2.4.25.cpp
38fa23d7a0fe5a6641b1a0463ee55b5dd9b9fcb2
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
396
cpp
static void ev_conn_timeout(h2_proxy_session *session, int arg, const char *msg) { switch (session->state) { case H2_PROXYS_ST_LOCAL_SHUTDOWN: transit(session, "conn timeout", H2_PROXYS_ST_DONE); break; default: session_shutdown(session, arg, msg); transit(session, "conn timeout", H2_PROXYS_ST_DONE); break; } }
[ "993273596@qq.com" ]
993273596@qq.com
9d1711f7fb760c10dad9f40964bea20fcd06618d
742344de1454de62c49f32dccdeb4235973d47b1
/hazelcast/include/hazelcast/client/LazyEntryArray.h
cb8ad2667441564db96b9e441142099723b9a2bb
[ "Apache-2.0" ]
permissive
enozcan/hazelcast-cpp-client
31f558cac860095f9a53c5d2cba3c3f4fdc6d967
672ea72811d6281329bd84070e798af711d5cbfb
refs/heads/master
2022-08-29T14:59:11.322441
2020-03-30T11:20:49
2020-03-30T11:20:49
256,820,114
0
0
Apache-2.0
2020-04-18T18:04:38
2020-04-18T18:04:37
null
UTF-8
C++
false
false
3,480
h
/* * Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef HAZELCAST_CLIENT_LAZYENTRYARRAY_H_ #define HAZELCAST_CLIENT_LAZYENTRYARRAY_H_ #include <memory> namespace hazelcast { namespace client { template<typename K, typename V> class LazyEntryArray { public: virtual ~LazyEntryArray() {} /** * @return Returns the number of data items */ virtual size_t size() const = 0; /** * Please note that this operation is costly due to de-serialization. It caches deserialized data. * * @param index The index of the desired item in the array. * @return Deserializes the data and returns the key object for the data at the provided index. * @throws IllegalArgumentException If provided index is greater than the maximum array index. */ virtual const K *getKey(size_t index) = 0; /** * Please note that this operation MAY(if not deserialized previously) be costly due to de-serialization. * It will NOT cache the de-serialized data. * * @param index The index of the desired item in the array. * @return Deserializes the data and returns the key object for the data at the provided index. * @throws IllegalArgumentException If provided index is greater than the maximum array index. */ virtual std::unique_ptr<K> releaseKey(size_t index) = 0; /** * Please note that this operation is costly due to de-serialization. It will cache the de-serialized data. * * @param index The index of the desired item in the array. * @return Deserializes the data and returns the value object for the data at the provided index. * @throws IllegalArgumentException If provided index is greater than the maximum array index. */ virtual const V *getValue(size_t index) = 0; /** * Please note that this operation is costly due to de-serialization. It will NOT cache the de-serialized data. * * @param index The index of the desired item in the array. * @return Deserializes the data and returns the value object for the data at the provided index. * @throws IllegalArgumentException If provided index is greater than the maximum array index. */ virtual std::unique_ptr<V> releaseValue(size_t index) = 0; /** * @param index The index of the desired item in the array. * @return The key value pointer pair is returned */ virtual std::pair<const K *, const V *> operator[](size_t index) = 0; }; } } #endif //HAZELCAST_CLIENT_LAZYENTRYARRAY_H_
[ "noreply@github.com" ]
noreply@github.com
c36e0144a7fffb3da525225cb2703b9a3d1a8428
057a8ea0f4e9e44df5dc6123a79009f890749fa7
/第18章 探讨C++新标准/程序清单18.5/lambda1.cpp
87e753765a383f6f4510d3d7a8f630c78c77e6b6
[]
no_license
hljgirl/C_Plus_Plus_Primer_Plus
e8674246b5295d4f44febbdf7c6dbac2645fb328
cd96be4676bb31c20f58631b682c9af5a915b06e
refs/heads/master
2021-01-19T05:19:09.070474
2017-11-15T09:54:03
2017-11-15T09:54:03
100,577,323
1
0
null
null
null
null
GB18030
C++
false
false
1,016
cpp
// 程序清单18.5.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <ctime> using namespace std; const long Size1 = 390000L; int main() { srand(time(0)); vector<int> numbers(Size1); generate(numbers.begin(), numbers.end(), rand); cout << "Sample size = " << Size1 << endl; int count3 = count_if(numbers.begin(), numbers.end(), [](int x) {return x % 3 == 0; }); cout << "Count of numbers divisible by 3: " << count3 << endl; int count13 = 0; for_each(numbers.begin(), numbers.end(), [&count13](int x) {count13 += x % 13 == 0; }); cout << "Count of numbers divisible by 13: " << count13 << endl; count3 = count13 = 0; for_each(numbers.begin(), numbers.end(), [&](int x) {count3 += x % 3 == 0; count13 += x % 13 == 0; }); cout << "Count of numbers divisible by 3: " << count3 << endl; cout << "Count of numbers divisible by 13: " << count13 << endl; system("pause"); return 0; }
[ "goodin2000@163.com" ]
goodin2000@163.com
f4656064b185f2dfaa2c6f601c5509c55d0fe053
2b7cd8141d6c17572c05d4d70e3e616e02449e72
/src/GafferBindings/MatchPatternPathFilterBinding.cpp
72daa36de1b94576cbe47d044d6c6b7176190de2
[ "BSD-3-Clause" ]
permissive
gray10b/gaffer
45aefd4ebbf515d5b491777a3bfd027d90715114
828b3b59f1154b0a14020cbf9a292c9048c09968
refs/heads/master
2021-01-02T09:11:13.137347
2017-08-04T05:07:31
2017-08-04T05:07:31
99,158,553
0
0
null
2017-08-02T20:34:13
2017-08-02T20:34:13
null
UTF-8
C++
false
false
3,877
cpp
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2014, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above // copyright notice, this list of conditions and the following // disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided with // the distribution. // // * Neither the name of John Haddon nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #include "boost/python.hpp" #include "boost/python/suite/indexing/container_utils.hpp" #include "IECorePython/RunTimeTypedBinding.h" #include "Gaffer/MatchPatternPathFilter.h" #include "GafferBindings/MatchPatternPathFilterBinding.h" using namespace boost::python; using namespace IECorePython; using namespace Gaffer; using namespace GafferBindings; namespace { MatchPatternPathFilterPtr construct( object pythonPatterns, const char *propertyName, bool leafOnly ) { std::vector<StringAlgo::MatchPattern> patterns; boost::python::container_utils::extend_container( patterns, pythonPatterns ); return new MatchPatternPathFilter( patterns, propertyName, leafOnly ); } void setMatchPatterns( MatchPatternPathFilter &f, object pythonPatterns ) { std::vector<StringAlgo::MatchPattern> patterns; boost::python::container_utils::extend_container( patterns, pythonPatterns ); f.setMatchPatterns( patterns ); } list getMatchPatterns( const MatchPatternPathFilter &f ) { list result; const std::vector<StringAlgo::MatchPattern> &patterns = f.getMatchPatterns(); for( std::vector<StringAlgo::MatchPattern>::const_iterator it = patterns.begin(), eIt = patterns.end(); it != eIt; ++it ) { result.append( *it ); } return result; } const char *getPropertyName( const MatchPatternPathFilter &f ) { return f.getPropertyName().string().c_str(); } } // namespace void GafferBindings::bindMatchPatternPathFilter() { RunTimeTypedClass<MatchPatternPathFilter>() .def( "__init__", make_constructor( construct, default_call_policies(), ( boost::python::arg_( "patterns" ), boost::python::arg_( "propertyName" ) = "name", boost::python::arg_( "leafOnly" ) = true ) ) ) .def( "setMatchPatterns", &setMatchPatterns ) .def( "getMatchPatterns", &getMatchPatterns ) .def( "setPropertyName", &MatchPatternPathFilter::setPropertyName ) .def( "getPropertyName", &getPropertyName ) .def( "setInverted", &MatchPatternPathFilter::setInverted ) .def( "getInverted", &MatchPatternPathFilter::getInverted ) ; }
[ "thehaddonyoof@gmail.com" ]
thehaddonyoof@gmail.com
91ab5e75d3c69375d25b9aa2f75f114ad37bf32c
f78962c56e299df00f2ec38173647619e130abdc
/12_07/12_07.cpp
b3ab8d38729707ce4568fee83f32511e1a319e74
[]
no_license
teahyen/souse
e9a7ee1958464e14c89e1cdcc25274f593d07e99
f27011853c1b58a3eef4e184bd45f7ed21c0d504
refs/heads/main
2023-05-14T14:36:14.877315
2021-06-07T06:52:26
2021-06-07T06:52:26
361,640,172
0
0
null
null
null
null
UHC
C++
false
false
5,242
cpp
#include<iostream> using namespace std; class Calc{ protected: int a; int b; public: Calc(); Calc(int new_A,int new_B); void Prn(); }; Calc::Calc() { a=0; b=0; } Calc::Calc(int new_A,int new_B) { a=new_A; b=new_B; } void Calc::Prn() { cout<<a<<"\t"<<b<<endl; } class Add : public Calc{ protected: int c; public : Add(); Add(int new_A,int new_B); void Sum(); void Prn(); // 오버라이딩 }; Add::Add() : Calc() { } Add::Add(int new_A,int new_B) :Calc(new_A, new_B) { a=new_A; b=new_B; c=0; } void Add::Sum() { c=a+b; } void Add::Prn() // 오버라이딩 { cout<<a<<" + "<<b<<" = "<<c<<endl; } class Mul : public Calc{ protected: int c; public: Mul(); Mul(int new_A,int new_B); void Gob(); void Prn(); // 오버라이딩 }; Mul::Mul() { } Mul::Mul(int new_A,int new_B) :Calc(new_A, new_B) { a=new_A; b=new_B; c=0; } void Mul::Gob() { c=a*b; } void Mul::Prn() // 오버라이딩 { cout<<a<<" * "<<b<<" = "<<c<<endl; } void main() { Calc x(3, 5); x.Prn(); Add y(3, 5); y.Sum(); y.Prn(); Mul z(3, 5); z.Gob(); z.Prn(); }
[ "kimct567@gmail.com" ]
kimct567@gmail.com
fe852c697da4ad69201824ad451c855c0f609bd7
400e0bbb072219d9cc209568351cd9787e2dd69d
/finddevicemodel.h
c5a296292fe4b379eb0e544c6688f6999e8b7ca0
[]
no_license
Madjita/GPS-QML-old-project
c876ce6ed69203f097d97e5a9ed65a5249fc64b3
91cf2b6201d608ff46147846e6cdb82519d2527b
refs/heads/master
2020-03-24T02:32:21.878454
2018-10-25T09:15:16
2018-10-25T09:15:16
142,380,172
0
0
null
null
null
null
UTF-8
C++
false
false
694
h
#ifndef FINDDEVICEMODEL_H #define FINDDEVICEMODEL_H #include <QObject> #include <finddevice.h> #include <finddeviceitem.h> class FindDeviceModel : public QObject { Q_OBJECT public: explicit FindDeviceModel(QObject *parent = nullptr); ~FindDeviceModel(); Q_PROPERTY(QList<QObject*> listDevice READ listDevice NOTIFY ListDeviceChanged) const QList<QObject*> listDevice() const; FindDevice* find = nullptr; QList<QObject *> res; signals: void ListDeviceChanged(QList<QObject*> ); void signal_SendPortmapFind(); public slots: void addItemList(QString name, QString peerName); void clearRes(); void work(); }; #endif // FINDDEVICEMODEL_H
[ "xok-s@yandex.ru" ]
xok-s@yandex.ru
87ed78553ed542944a65652df324b88ca6ddb31e
b0eecb618ae76484b3368cef8b28ca7ab3c4e556
/components/autofill/android/autofill_provider_android.cc
b4bf794bc29421b2919bf5cbf6b0a30a2b0b5a31
[ "BSD-3-Clause" ]
permissive
Chikdolman/Castanets
733e6959ae28b81a8d5a77f869dd62957c1b1c2b
620e7d42205619ee061dff77d0001c7e6a4d1a8d
refs/heads/castanets_63
2021-06-28T04:35:42.424423
2019-06-04T06:56:51
2019-06-04T06:56:51
183,328,181
0
1
BSD-3-Clause
2019-07-02T10:59:54
2019-04-25T00:51:09
null
UTF-8
C++
false
false
7,546
cc
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/autofill/android/autofill_provider_android.h" #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/memory/ptr_util.h" #include "components/autofill/android/form_data_android.h" #include "components/autofill/core/browser/autofill_handler_proxy.h" #include "components/autofill/core/common/autofill_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" #include "jni/AutofillProvider_jni.h" #include "ui/gfx/geometry/rect_f.h" using base::android::AttachCurrentThread; using base::android::ConvertUTF16ToJavaString; using base::android::ConvertUTF8ToJavaString; using base::android::JavaRef; using base::android::ScopedJavaLocalRef; using content::BrowserThread; using content::WebContents; using gfx::RectF; namespace autofill { AutofillProviderAndroid::AutofillProviderAndroid( const JavaRef<jobject>& jcaller, content::WebContents* web_contents) : id_(kNoQueryId), web_contents_(web_contents) { JNIEnv* env = AttachCurrentThread(); java_ref_ = JavaObjectWeakGlobalRef(env, jcaller); Java_AutofillProvider_setNativeAutofillProvider( env, jcaller, reinterpret_cast<jlong>(this)); } AutofillProviderAndroid::~AutofillProviderAndroid() { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return; // Remove the reference to this object on the Java side. Java_AutofillProvider_setNativeAutofillProvider(env, obj, 0); } void AutofillProviderAndroid::OnQueryFormFieldAutofill( AutofillHandlerProxy* handler, int32_t id, const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box) { // The id isn't passed to Java side because Android API guarantees the // response is always for current session, so we just use the current id // in response, see OnAutofillAvailable. DCHECK_CURRENTLY_ON(BrowserThread::UI); id_ = id; // Only start a new session when form is changed, the focus or feild value // change will also trigger the query, so it is safe to ignore the query // for the same form. if (IsCurrentlyLinkedForm(form)) { return; } JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return; form_ = base::MakeUnique<FormDataAndroid>(form); size_t index; if (!form_->GetFieldIndex(field, &index)) return; gfx::RectF transformed_bounding = ToClientAreaBound(bounding_box); ScopedJavaLocalRef<jobject> form_obj = form_->GetJavaPeer(); handler_ = handler->GetWeakPtr(); Java_AutofillProvider_startAutofillSession( env, obj, form_obj, index, transformed_bounding.x(), transformed_bounding.y(), transformed_bounding.width(), transformed_bounding.height()); } void AutofillProviderAndroid::OnAutofillAvailable(JNIEnv* env, jobject jcaller, jobject formData) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (handler_) { const FormData& form = form_->GetAutofillValues(); SendFormDataToRenderer(handler_.get(), id_, form); } } void AutofillProviderAndroid::OnTextFieldDidChange( AutofillHandlerProxy* handler, const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box, const base::TimeTicks timestamp) { DCHECK_CURRENTLY_ON(BrowserThread::UI); size_t index; if (!ValidateHandler(handler) || !IsCurrentlyLinkedForm(form) || !form_->GetSimilarFieldIndex(field, &index)) return; form_->OnTextFieldDidChange(index, field.value); JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return; gfx::RectF transformed_bounding = ToClientAreaBound(bounding_box); Java_AutofillProvider_onTextFieldDidChange( env, obj, index, transformed_bounding.x(), transformed_bounding.y(), transformed_bounding.width(), transformed_bounding.height()); } bool AutofillProviderAndroid::OnWillSubmitForm( AutofillHandlerProxy* handler, const FormData& form, const base::TimeTicks timestamp) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!ValidateHandler(handler) || !IsCurrentlyLinkedForm(form)) return false; JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return false; Java_AutofillProvider_onWillSubmitForm(env, obj); Reset(); return true; } void AutofillProviderAndroid::OnFocusNoLongerOnForm( AutofillHandlerProxy* handler) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!ValidateHandler(handler)) return; OnFocusChanged(false, 0, RectF()); } void AutofillProviderAndroid::OnFocusOnFormField( AutofillHandlerProxy* handler, const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box) { DCHECK_CURRENTLY_ON(BrowserThread::UI); size_t index; if (!ValidateHandler(handler) || !IsCurrentlyLinkedForm(form) || !form_->GetSimilarFieldIndex(field, &index)) return; // Because this will trigger a suggestion query, set request id to browser // initiated request. id_ = kNoQueryId; OnFocusChanged(true, index, ToClientAreaBound(bounding_box)); } void AutofillProviderAndroid::OnFocusChanged(bool focus_on_form, size_t index, const gfx::RectF& bounding_box) { DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return; Java_AutofillProvider_onFocusChanged( env, obj, focus_on_form, index, bounding_box.x(), bounding_box.y(), bounding_box.width(), bounding_box.height()); } void AutofillProviderAndroid::OnDidFillAutofillFormData( AutofillHandlerProxy* handler, const FormData& form, base::TimeTicks timestamp) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (handler != handler_.get() || !IsCurrentlyLinkedForm(form)) return; JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return; Java_AutofillProvider_onDidFillAutofillFormData(env, obj); } void AutofillProviderAndroid::Reset(AutofillHandlerProxy* handler) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (handler == handler_.get()) { handler_.reset(); Reset(); JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return; Java_AutofillProvider_reset(env, obj); } } bool AutofillProviderAndroid::ValidateHandler(AutofillHandlerProxy* handler) { DCHECK_CURRENTLY_ON(BrowserThread::UI); bool ret = handler == handler_.get(); if (!ret) handler_.reset(); return ret; } bool AutofillProviderAndroid::IsCurrentlyLinkedForm(const FormData& form) { return form_ && form_->SimilarFormAs(form); } gfx::RectF AutofillProviderAndroid::ToClientAreaBound( const gfx::RectF& bounding_box) { gfx::Rect client_area = web_contents_->GetContainerBounds(); return bounding_box + client_area.OffsetFromOrigin(); } void AutofillProviderAndroid::Reset() { form_.reset(nullptr); id_ = kNoQueryId; } } // namespace autofill
[ "suyambu.rm@samsung.com" ]
suyambu.rm@samsung.com
fe7e5f48b3f582997d3a5d316ad58bff249e6880
6074beaaa23e6dd8c2c2a1265da5562816f90ebc
/msproteomicstoolslib/cython/peakgroup.h
2bec8059e6230fa14de5b8fab9b0e9d04ee52c1c
[ "BSD-3-Clause" ]
permissive
msproteomicstools/msproteomicstools
935402d7984295785b36afb6a0f2fccfcba9dbe6
84e0eb00c2b4b0a26b99a916de554fdb46c4b108
refs/heads/master
2021-11-19T18:25:06.289924
2021-10-12T11:34:54
2021-10-12T11:34:54
32,137,230
47
51
NOASSERTION
2021-10-12T11:34:55
2015-03-13T07:03:21
Python
UTF-8
C++
false
false
479
h
#ifndef MSPROTEOMICSTOOLSLIB_PEAKGROUP_H #define MSPROTEOMICSTOOLSLIB_PEAKGROUP_H #include <string> #include <vector> #include <stdexcept> #include <iostream> // forward decl struct c_precursor; struct c_peakgroup { public: double fdr_score; double normalized_retentiontime; std::string internal_id_; double intensity_; double dscore_; int cluster_id_; c_precursor* precursor; c_peakgroup() {}; c_precursor* getPeptide() {return precursor;}; }; #endif
[ "hroest@stanford.edu" ]
hroest@stanford.edu
af0d25ae54757ab2c5629ce3164864b9f0fdae60
659d99d090479506b63b374831a049dba5d70fcf
/xray-svn-trunk/xrCore/_matrix33.h
1ef6cf1704c1e1453f7a0dd0fb95a9fbac5db209
[]
no_license
ssijonson/Rengen_Luch
a9312fed06dd08c7de19f36e5fd5e476881beb85
9bd0ff54408a890d4bdac1c493d67ce26b964555
refs/heads/main
2023-05-03T13:09:58.983176
2021-05-19T10:04:47
2021-05-19T10:04:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
14,569
h
#ifndef _matrix33H_ #define _matrix33H_ template <class T> struct _matrix33{ public: typedef _matrix33<T>Self; typedef T TYPE; typedef Self& SelfRef; typedef const Self& SelfCRef; typedef _vector3<T> Tvector; public: union { struct { // Direct definition T _11, _12, _13; T _21, _22, _23; T _31, _32, _33; }; struct { Tvector i; Tvector j; Tvector k; }; float m[3][3]; // Array }; Self() { null(); }; Self(T __11, T __12 = (T)0, T __13 = (T)0, T __21 = (T)0, T __22 = (T)0, T __23 = (T)0, T __31 = (T)0, T __32 = (T)0, T __33 = (T)0) { _11 = __11; _12 = __12; _13 = __13; _21 = __21; _22 = __22; _23 = __23; _31 = __31; _32 = __32; _33 = __33; }; IC void null() { _11 = _12 = _13 = (TYPE)0; _21 = _22 = _23 = (TYPE)0; _31 = _32 = _33 = (TYPE)0; }; // Class members IC SelfRef set_rapid(const _matrix<T> &a) { m[0][0] = a.m[0][0]; m[0][1] = a.m[0][1]; m[0][2] = -a.m[0][2]; m[1][0] = a.m[1][0]; m[1][1] = a.m[1][1]; m[1][2] = -a.m[1][2]; m[2][0] = -a.m[2][0]; m[2][1] = -a.m[2][1]; m[2][2] = a.m[2][2]; return *this; } IC SelfRef set(SelfCRef a) { CopyMemory(this,&a,9*sizeof(float)); return *this; } IC SelfRef set(const _matrix<T> &a) { _11=a._11; _12=a._12; _13=a._13; _21=a._21; _22=a._22; _23=a._23; _31=a._31; _32=a._32; _33=a._33; return *this; } IC SelfRef identity(void) { _11=1.f; _12=0.f; _13=0.f; _21=0.f; _22=1.f; _23=0.f; _31=0.f; _32=0.f; _33=1.f; return *this; } IC SelfRef transpose(SelfCRef matSource) // faster version of transpose { _11=matSource._11; _12=matSource._21; _13=matSource._31; _21=matSource._12; _22=matSource._22; _23=matSource._32; _31=matSource._13; _32=matSource._23; _33=matSource._33; return *this; } IC SelfRef transpose(const _matrix<T> &matSource) // faster version of transpose { _11=matSource._11; _12=matSource._21; _13=matSource._31; _21=matSource._12; _22=matSource._22; _23=matSource._32; _31=matSource._13; _32=matSource._23; _33=matSource._33; return *this; } IC SelfRef transpose(void) // self transpose - slower { _matrix33 a; CopyMemory(&a,this,9*sizeof(float)); // save matrix transpose(a); return *this; } IC SelfRef MxM(SelfCRef M1, SelfCRef M2) { m[0][0] = ( M1.m[0][0] * M2.m[0][0] + M1.m[0][1] * M2.m[1][0] + M1.m[0][2] * M2.m[2][0]); m[1][0] = ( M1.m[1][0] * M2.m[0][0] + M1.m[1][1] * M2.m[1][0] + M1.m[1][2] * M2.m[2][0]); m[2][0] = ( M1.m[2][0] * M2.m[0][0] + M1.m[2][1] * M2.m[1][0] + M1.m[2][2] * M2.m[2][0]); m[0][1] = ( M1.m[0][0] * M2.m[0][1] + M1.m[0][1] * M2.m[1][1] + M1.m[0][2] * M2.m[2][1]); m[1][1] = ( M1.m[1][0] * M2.m[0][1] + M1.m[1][1] * M2.m[1][1] + M1.m[1][2] * M2.m[2][1]); m[2][1] = ( M1.m[2][0] * M2.m[0][1] + M1.m[2][1] * M2.m[1][1] + M1.m[2][2] * M2.m[2][1]); m[0][2] = ( M1.m[0][0] * M2.m[0][2] + M1.m[0][1] * M2.m[1][2] + M1.m[0][2] * M2.m[2][2]); m[1][2] = ( M1.m[1][0] * M2.m[0][2] + M1.m[1][1] * M2.m[1][2] + M1.m[1][2] * M2.m[2][2]); m[2][2] = ( M1.m[2][0] * M2.m[0][2] + M1.m[2][1] * M2.m[1][2] + M1.m[2][2] * M2.m[2][2]); return *this; } IC SelfRef MTxM(SelfCRef M1, SelfCRef M2) { m[0][0] = ( M1.m[0][0] * M2.m[0][0] + M1.m[1][0] * M2.m[1][0] + M1.m[2][0] * M2.m[2][0]); m[1][0] = ( M1.m[0][1] * M2.m[0][0] + M1.m[1][1] * M2.m[1][0] + M1.m[2][1] * M2.m[2][0]); m[2][0] = ( M1.m[0][2] * M2.m[0][0] + M1.m[1][2] * M2.m[1][0] + M1.m[2][2] * M2.m[2][0]); m[0][1] = ( M1.m[0][0] * M2.m[0][1] + M1.m[1][0] * M2.m[1][1] + M1.m[2][0] * M2.m[2][1]); m[1][1] = ( M1.m[0][1] * M2.m[0][1] + M1.m[1][1] * M2.m[1][1] + M1.m[2][1] * M2.m[2][1]); m[2][1] = ( M1.m[0][2] * M2.m[0][1] + M1.m[1][2] * M2.m[1][1] + M1.m[2][2] * M2.m[2][1]); m[0][2] = ( M1.m[0][0] * M2.m[0][2] + M1.m[1][0] * M2.m[1][2] + M1.m[2][0] * M2.m[2][2]); m[1][2] = ( M1.m[0][1] * M2.m[0][2] + M1.m[1][1] * M2.m[1][2] + M1.m[2][1] * M2.m[2][2]); m[2][2] = ( M1.m[0][2] * M2.m[0][2] + M1.m[1][2] * M2.m[1][2] + M1.m[2][2] * M2.m[2][2]); return *this; } #define ROT(a,i,j,k,l) g=a.m[i][j]; h=a.m[k][l]; a.m[i][j]=g-s*(h+g*tau); a.m[k][l]=h+s*(g-h*tau); int IC Meigen(Tvector& dout, SelfRef a) { int i; float tresh,theta,tau,t,sm,s,h,g,c; int nrot; Tvector b; Tvector z; _matrix33 v; Tvector d; v.identity(); b.set(a.m[0][0], a.m[1][1], a.m[2][2]); d.set(a.m[0][0], a.m[1][1], a.m[2][2]); z.set(0,0,0); nrot = 0; for(i=0; i<50; i++){ sm=0.0f; sm+=_abs(a.m[0][1]); sm+=_abs(a.m[0][2]); sm+=_abs(a.m[1][2]); if (sm == 0.0) { set(v); dout.set(d); return i; } if (i < 3) tresh=0.2f*sm/(3.0f*3.0f); else tresh=0.0f; { g = 100.0f*_abs(a.m[0][1]); if (i>3 && _abs(d.x)+g==_abs(d.x) && _abs(d.y)+g==_abs(d.y)) a.m[0][1]=0.0; else if (_abs(a.m[0][1])>tresh){ h = d.y-d.x; if (_abs(h)+g == _abs(h)) t=(a.m[0][1])/h; else{ theta=0.5f*h/(a.m[0][1]); t=1.0f/(_abs(theta)+_sqrt(1.0f+theta*theta)); if (theta < 0.0f) t = -t; } c=1.0f/_sqrt(1+t*t); s=t*c; tau=s/(1.0f+c); h=t*a.m[0][1]; z.x -= h; z.y += h; d.x -= h; d.y += h; a.m[0][1]=0.0f; ROT(a,0,2,1,2); ROT(v,0,0,0,1); ROT(v,1,0,1,1); ROT(v,2,0,2,1); nrot++; } } { g = 100.0f*_abs(a.m[0][2]); if (i>3 && _abs(d.x)+g==_abs(d.x) && _abs(d.z)+g==_abs(d.z)) a.m[0][2]=0.0f; else if (_abs(a.m[0][2])>tresh){ h = d.z-d.x; if (_abs(h)+g == _abs(h)) t=(a.m[0][2])/h; else{ theta=0.5f*h/(a.m[0][2]); t=1.0f/(_abs(theta)+_sqrt(1.0f+theta*theta)); if (theta < 0.0f) t = -t; } c=1.0f/_sqrt(1+t*t); s=t*c; tau=s/(1.0f+c); h=t*a.m[0][2]; z.x -= h; z.z += h; d.x -= h; d.z += h; a.m[0][2]=0.0f; ROT(a,0,1,1,2); ROT(v,0,0,0,2); ROT(v,1,0,1,2); ROT(v,2,0,2,2); nrot++; } } { g = 100.0f*_abs(a.m[1][2]); if (i>3 && _abs(d.y)+g==_abs(d.y) && _abs(d.z)+g==_abs(d.z)) a.m[1][2]=0.0f; else if (_abs(a.m[1][2])>tresh){ h = d.z-d.y; if (_abs(h)+g == _abs(h)) t=(a.m[1][2])/h; else{ theta=0.5f*h/(a.m[1][2]); t=1.0f/(_abs(theta)+_sqrt(1.0f+theta*theta)); if (theta < 0.0) t = -t; } c=1.0f/_sqrt(1+t*t); s=t*c; tau=s/(1.0f+c); h=t*a.m[1][2]; z.y -= h; z.z += h; d.y -= h; d.z += h; a.m[1][2]=0.0f; ROT(a,0,1,0,2); ROT(v,0,1,0,2); ROT(v,1,1,1,2); ROT(v,2,1,2,2); nrot++; } } b.add(z); d.set(b); z.set(0,0,0); } // Log.Msg("eigen: too many iterations in Jacobi transform (%d).\n", i); return i; } #undef ROT //-------------------------------------------------------------------------------- // other unused function //-------------------------------------------------------------------------------- IC SelfRef McolcMcol(int cr, SelfCRef M, int c) { m[0][cr] = M.m[0][c]; m[1][cr] = M.m[1][c]; m[2][cr] = M.m[2][c]; return *this; } IC SelfRef MxMpV(SelfCRef M1, SelfCRef M2, const Tvector& T) { m[0][0] = ( M1.m[0][0] * M2.m[0][0] + M1.m[0][1] * M2.m[1][0] + M1.m[0][2] * M2.m[2][0] + T.x); m[1][0] = ( M1.m[1][0] * M2.m[0][0] + M1.m[1][1] * M2.m[1][0] + M1.m[1][2] * M2.m[2][0] + T.y); m[2][0] = ( M1.m[2][0] * M2.m[0][0] + M1.m[2][1] * M2.m[1][0] + M1.m[2][2] * M2.m[2][0] + T.z); m[0][1] = ( M1.m[0][0] * M2.m[0][1] + M1.m[0][1] * M2.m[1][1] + M1.m[0][2] * M2.m[2][1] + T.x); m[1][1] = ( M1.m[1][0] * M2.m[0][1] + M1.m[1][1] * M2.m[1][1] + M1.m[1][2] * M2.m[2][1] + T.y); m[2][1] = ( M1.m[2][0] * M2.m[0][1] + M1.m[2][1] * M2.m[1][1] + M1.m[2][2] * M2.m[2][1] + T.z); m[0][2] = ( M1.m[0][0] * M2.m[0][2] + M1.m[0][1] * M2.m[1][2] + M1.m[0][2] * M2.m[2][2] + T.x); m[1][2] = ( M1.m[1][0] * M2.m[0][2] + M1.m[1][1] * M2.m[1][2] + M1.m[1][2] * M2.m[2][2] + T.y); m[2][2] = ( M1.m[2][0] * M2.m[0][2] + M1.m[2][1] * M2.m[1][2] + M1.m[2][2] * M2.m[2][2] + T.z); return *this; } IC SelfRef Mqinverse(SelfCRef M) { int i,j; for(i=0; i<3; i++) for(j=0; j<3; j++){ int i1 = (i+1)%3; int i2 = (i+2)%3; int j1 = (j+1)%3; int j2 = (j+2)%3; m[i][j] = (M.m[j1][i1]*M.m[j2][i2] - M.m[j1][i2]*M.m[j2][i1]); } return *this; } IC SelfRef MxMT(SelfCRef M1, SelfCRef M2) { m[0][0] = ( M1.m[0][0] * M2.m[0][0] + M1.m[0][1] * M2.m[0][1] + M1.m[0][2] * M2.m[0][2]); m[1][0] = ( M1.m[1][0] * M2.m[0][0] + M1.m[1][1] * M2.m[0][1] + M1.m[1][2] * M2.m[0][2]); m[2][0] = ( M1.m[2][0] * M2.m[0][0] + M1.m[2][1] * M2.m[0][1] + M1.m[2][2] * M2.m[0][2]); m[0][1] = ( M1.m[0][0] * M2.m[1][0] + M1.m[0][1] * M2.m[1][1] + M1.m[0][2] * M2.m[1][2]); m[1][1] = ( M1.m[1][0] * M2.m[1][0] + M1.m[1][1] * M2.m[1][1] + M1.m[1][2] * M2.m[1][2]); m[2][1] = ( M1.m[2][0] * M2.m[1][0] + M1.m[2][1] * M2.m[1][1] + M1.m[2][2] * M2.m[1][2]); m[0][2] = ( M1.m[0][0] * M2.m[2][0] + M1.m[0][1] * M2.m[2][1] + M1.m[0][2] * M2.m[2][2]); m[1][2] = ( M1.m[1][0] * M2.m[2][0] + M1.m[1][1] * M2.m[2][1] + M1.m[1][2] * M2.m[2][2]); m[2][2] = ( M1.m[2][0] * M2.m[2][0] + M1.m[2][1] * M2.m[2][1] + M1.m[2][2] * M2.m[2][2]); return *this; } IC SelfRef MskewV(const Tvector& v) { m[0][0] = m[1][1] = m[2][2] = 0.0; m[1][0] = v.z; m[0][1] = -v.z; m[0][2] = v.y; m[2][0] = -v.y; m[1][2] = -v.x; m[2][1] = v.x; return *this; } IC SelfRef sMxVpV(Tvector& R, float s1, const Tvector& V1, const Tvector& V2) const { R.x = s1 * (m[0][0] * V1.x + m[0][1] * V1.y + m[0][2] * V1.z) + V2.x; R.y = s1 * (m[1][0] * V1.x + m[1][1] * V1.y + m[1][2] * V1.z) + V2.y; R.z = s1 * (m[2][0] * V1.x + m[2][1] * V1.y + m[2][2] * V1.z) + V2.z; return *this; } IC void MTxV(Tvector& R, const Tvector& V1) const { R.x = (m[0][0] * V1.x + m[1][0] * V1.y + m[2][0] * V1.z); R.y = (m[0][1] * V1.x + m[1][1] * V1.y + m[2][1] * V1.z); R.z = (m[0][2] * V1.x + m[1][2] * V1.y + m[2][2] * V1.z); } IC void MTxVpV(Tvector& R, const Tvector& V1, const Tvector& V2) const { R.x = (m[0][0] * V1.x + m[1][0] * V1.y + m[2][0] * V1.z + V2.x); R.y = (m[0][1] * V1.x + m[1][1] * V1.y + m[2][1] * V1.z + V2.y); R.z = (m[0][2] * V1.x + m[1][2] * V1.y + m[2][2] * V1.z + V2.z); } IC SelfRef MTxVmV(Tvector& R, const Tvector& V1, const Tvector& V2) const { R.x = (m[0][0] * V1.x + m[1][0] * V1.y + m[2][0] * V1.z - V2.x); R.y = (m[0][1] * V1.x + m[1][1] * V1.y + m[2][1] * V1.z - V2.y); R.z = (m[0][2] * V1.x + m[1][2] * V1.y + m[2][2] * V1.z - V2.z); return *this; } IC SelfRef sMTxV(Tvector& R, float s1, const Tvector& V1) const { R.x = s1*(m[0][0] * V1.x + m[1][0] * V1.y + m[2][0] * V1.z); R.y = s1*(m[0][1] * V1.x + m[1][1] * V1.y + m[2][1] * V1.z); R.z = s1*(m[0][2] * V1.x + m[1][2] * V1.y + m[2][2] * V1.z); } IC SelfRef MxV(Tvector& R, const Tvector& V1) const { R.x = (m[0][0] * V1.x + m[0][1] * V1.y + m[0][2] * V1.z); R.y = (m[1][0] * V1.x + m[1][1] * V1.y + m[1][2] * V1.z); R.z = (m[2][0] * V1.x + m[2][1] * V1.y + m[2][2] * V1.z); return *this; } IC void transform_dir (_vector2<T> &dest, const _vector2<T> &v) const // preferred to use { dest.x = v.x*_11 + v.y*_21; dest.y = v.x*_12 + v.y*_22; dest.z = v.x*_13 + v.y*_23; } IC void transform_dir (_vector2<T> &v) const { _vector2<T> res; transform_dir (res,v); v.set (res); } IC SelfRef MxVpV(Tvector& R, const Tvector& V1, const Tvector& V2) const { R.x = (m[0][0] * V1.x + m[0][1] * V1.y + m[0][2] * V1.z + V2.x); R.y = (m[1][0] * V1.x + m[1][1] * V1.y + m[1][2] * V1.z + V2.y); R.z = (m[2][0] * V1.x + m[2][1] * V1.y + m[2][2] * V1.z + V2.z); return *this; } }; typedef _matrix33<float> Fmatrix33; typedef _matrix33<double> Dmatrix33; template <class T> BOOL _valid (const _matrix33<T>& m) { return _valid(m.i)&& _valid(m.j)&& _valid(m.k); } #endif
[ "16670637+KRodinn@users.noreply.github.com" ]
16670637+KRodinn@users.noreply.github.com
285de6016d4f3d5ff92efc7708f159d6d205d1fd
f9ac1468bbeb8d0f84fb1bbb532d55fb5ff10896
/Pedalboard_current.ino
849ff63d82f88eb604aab1fc899435cf62930919
[]
no_license
wyleu/arduino_pedalboard
5ee214040e8cb26e2e0d87c9a502a2d670076650
f5747acacd73f71b29b16d489afd0958976dd307
refs/heads/master
2023-03-05T17:31:26.827411
2021-01-02T17:28:14
2021-01-02T17:28:14
335,695,929
0
0
null
null
null
null
UTF-8
C++
false
false
2,450
ino
#include <Control_Surface.h> // Include the Control Surface library // Instantiate a MIDI over USB interface. USBMIDI_Interface midi; using namespace MIDI_Notes; const Channel Channel_Current = CHANNEL_6; //Bass NoteButton button01 = { 0, // Push button on pin 1 {note(C, 4), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button02 = { 1, // Push button on pin 2 {note(B, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button03 = { 2, // Push button on pin 3 {note(Bb, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button04 = { 3, // Push button on pin 4 {note(A, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button05 = { 4, // Push button on pin 5 {note(Ab, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button06 = { 5, // Push button on pin 6 {note(G, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button07 = { 6, // Push button on pin 7 {note(Gb, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button08 = { 7, // Push button on pin 8 {note(F, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button09 = { 8, // Push button on pin 9 {note(E, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button10 = { 9, // Push button on pin 10 {note(Eb, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button11 = { 10, // Push button on pin 11 {note(D, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button12 = { 11, // Push button on pin 12 {note(Db, 3), Channel_Current}, // Note C4 on MIDI channel }; NoteButton button13 = { 12, // Push button on pin 13 {note(C, 3), Channel_Current}, // Note C4 on MIDI channel }; void setup() { button01.invert(); button02.invert(); button03.invert(); button04.invert(); button05.invert(); button06.invert(); button07.invert(); button08.invert(); button09.invert(); button10.invert(); button11.invert(); button12.invert(); button13.invert(); Control_Surface.begin(); // Initialize Control Surface } void loop() { Control_Surface.loop(); // Update the Control Surface }
[ "wyleus@gmail.com" ]
wyleus@gmail.com
f620e526e276547629bf427e4dca31c05eab40c4
bbcda48854d6890ad029d5973e011d4784d248d2
/trunk/win/Source/Includes/Boost/asio/detail/resolver_service_base.hpp
6a4be39e99868f0ecb761e9541042a1a80a8e8e5
[ "Apache-2.0", "MIT", "curl", "LGPL-2.1-or-later", "BSD-3-Clause", "BSL-1.0", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "Zlib", "LicenseRef-scancode-unknown", "LicenseRef-scancode-unknown-license-reference", "MS-LPL" ]
permissive
dyzmapl/BumpTop
9c396f876e6a9ace1099b3b32e45612a388943ff
1329ea41411c7368516b942d19add694af3d602f
refs/heads/master
2020-12-20T22:42:55.100473
2020-01-25T21:00:08
2020-01-25T21:00:08
236,229,087
0
0
Apache-2.0
2020-01-25T20:58:59
2020-01-25T20:58:58
null
UTF-8
C++
false
false
3,979
hpp
// // detail/resolver_service_base.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP #define BOOST_ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> #include <boost/asio/detail/mutex.hpp> #include <boost/asio/detail/noncopyable.hpp> #include <boost/asio/detail/operation.hpp> #include <boost/asio/detail/socket_ops.hpp> #include <boost/asio/detail/socket_types.hpp> #include <boost/asio/detail/scoped_ptr.hpp> #include <boost/asio/detail/thread.hpp> #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { namespace detail { class resolver_service_base { public: // The implementation type of the resolver. A cancellation token is used to // indicate to the background thread that the operation has been cancelled. typedef socket_ops::shared_cancel_token_type implementation_type; // Constructor. BOOST_ASIO_DECL resolver_service_base(boost::asio::io_service& io_service); // Destructor. BOOST_ASIO_DECL ~resolver_service_base(); // Destroy all user-defined handler objects owned by the service. BOOST_ASIO_DECL void shutdown_service(); // Perform any fork-related housekeeping. BOOST_ASIO_DECL void fork_service( boost::asio::io_service::fork_event fork_ev); // Construct a new resolver implementation. BOOST_ASIO_DECL void construct(implementation_type& impl); // Destroy a resolver implementation. BOOST_ASIO_DECL void destroy(implementation_type&); // Cancel pending asynchronous operations. BOOST_ASIO_DECL void cancel(implementation_type& impl); protected: // Helper function to start an asynchronous resolve operation. BOOST_ASIO_DECL void start_resolve_op(operation* op); // Helper class to perform exception-safe cleanup of addrinfo objects. class auto_addrinfo : private boost::asio::detail::noncopyable { public: explicit auto_addrinfo(boost::asio::detail::addrinfo_type* ai) : ai_(ai) { } ~auto_addrinfo() { if (ai_) socket_ops::freeaddrinfo(ai_); } operator boost::asio::detail::addrinfo_type*() { return ai_; } private: boost::asio::detail::addrinfo_type* ai_; }; // Helper class to run the work io_service in a thread. class work_io_service_runner; // Start the work thread if it's not already running. BOOST_ASIO_DECL void start_work_thread(); // The io_service implementation used to post completions. io_service_impl& io_service_impl_; private: // Mutex to protect access to internal data. boost::asio::detail::mutex mutex_; // Private io_service used for performing asynchronous host resolution. boost::asio::detail::scoped_ptr<boost::asio::io_service> work_io_service_; // The work io_service implementation used to post completions. io_service_impl& work_io_service_impl_; // Work for the private io_service to perform. boost::asio::detail::scoped_ptr<boost::asio::io_service::work> work_; // Thread used for running the work io_service's run loop. boost::asio::detail::scoped_ptr<boost::asio::detail::thread> work_thread_; }; } // namespace detail } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #if defined(BOOST_ASIO_HEADER_ONLY) # include <boost/asio/detail/impl/resolver_service_base.ipp> #endif // defined(BOOST_ASIO_HEADER_ONLY) #endif // BOOST_ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP
[ "anandx@google.com" ]
anandx@google.com
ed08706ac5666e32b0f7863104e74e1b17734d63
8c121b5c3dc564eb75f7cb8a1e881941d9792db9
/old_contest/at_coder_abc195_B.cpp
114060b92793e694a272e3fbe38eb14e35732b83
[]
no_license
kayaru28/programming_contest
2f967a4479f5a1f2c30310c00c143e711445b12d
40bb79adce823c19bbd988f77b515052c710ea42
refs/heads/master
2022-12-13T18:32:37.818967
2022-11-26T16:36:20
2022-11-26T16:36:20
147,929,424
0
0
null
null
null
null
UTF-8
C++
false
false
1,592
cpp
#include <iostream> #include <stdio.h> #include <algorithm> #include <map> #include <math.h> using namespace std; #include <vector> #define rep(i,n) for (ll i = 0; i < (n) ; i++) #define INF 1e9 #define llINF 1e18 #define base10_4 10000 //1e4 #define base10_5 100000 //1e5 #define base10_6 1000000 //1e6 #define base10_7 10000000 //1e7 #define base10_8 100000000 //1e8 #define base10_9 1000000000 //1e9 #define MOD 1000000007 #define pb push_back #define ll long long #define ld long double #define ull unsigned long long #define vint vector<int> #define vll vector<ll> #define vvll vector<vector<ll>> #define vstr vector<string> #define vvstr vector<vector<string>> //#include <stack> //#include <queue> // #include <iomanip> // cout << fixed << setprecision(15) << y << endl; string ans_Yes = "Yes"; string ans_No = "No"; string ans_yes = "yes"; string ans_no = "no"; double A; double B; double W; ll C; ll N; ll M; ll K; ll ltmp; string stmp; double dtmp; ll llmin(ll a,ll b){ if(a>=b) return b; return a; } ll llmax(ll a,ll b){ if(a<=b) return b; return a; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> A; cin >> B; cin >> W; W = W * 1000; ll ansmin=llINF,ansmax=0; for( ll ni = 1 ; ni <=1010000 ; ni++ ){ dtmp = W / ni; if(dtmp>=A && dtmp <= B){ ansmax = llmax(ansmax,ni); ansmin = llmin(ansmin,ni); } } if(ansmax>0) cout << ansmin << " " << ansmax << endl; else cout << "UNSATISFIABLE" << endl; }
[ "istorytale090415@gmail.com" ]
istorytale090415@gmail.com
8490f25832aa020a629410678be0587cac7d6f65
d18527a3a328c8b412cc62a62c6e520f0efd34b7
/src/ds/ui/ip/functions/ip_circle_mask.h
11dafd1b3ecd8233a376b714b552e81167381977
[]
no_license
hinike/ds_cinder
113934aad679ccfdcf09bc6269e4f68f2d6bb33d
1fbbc87ca8a49fd5c83b3e300b1ab4ae0953ed6e
refs/heads/master
2020-03-19T16:14:25.129849
2018-01-03T06:08:42
2018-01-03T06:11:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
497
h
#pragma once #ifndef DS_UI_IP_FUNCTIONS_IPCIRCLEMASK_H_ #define DS_UI_IP_FUNCTIONS_IPCIRCLEMASK_H_ #include <ds/ui/ip/ip_function.h> namespace ds { namespace ui { namespace ip { /** * \class ds::ui::ip::CircleMask * Make the surface circular by alphing-out anything outside the circle. */ class CircleMask : public Function { public: CircleMask(); virtual void on(const std::string& parameters, ci::Surface8u&) const; }; } // namespace ip } // namespace ui } // namespace ds #endif
[ "eric.hackborn@downstream.com" ]
eric.hackborn@downstream.com
80f2d87a271ff137ef759354d5a725525fa2bc73
27bb5ed9eb1011c581cdb76d96979a7a9acd63ba
/aws-cpp-sdk-mturk-requester/source/model/UpdateHITReviewStatusRequest.cpp
adad2ea84e13f9f28b88edc9d061f0bfacda1842
[ "Apache-2.0", "JSON", "MIT" ]
permissive
exoscale/aws-sdk-cpp
5394055f0876a0dafe3c49bf8e804d3ddf3ccc54
0876431920136cf638e1748d504d604c909bb596
refs/heads/master
2023-08-25T11:55:20.271984
2017-05-05T17:32:25
2017-05-05T17:32:25
90,744,509
0
0
null
2017-05-09T12:43:30
2017-05-09T12:43:30
null
UTF-8
C++
false
false
1,525
cpp
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/mturk-requester/model/UpdateHITReviewStatusRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::MTurk::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; UpdateHITReviewStatusRequest::UpdateHITReviewStatusRequest() : m_hITIdHasBeenSet(false), m_revert(false), m_revertHasBeenSet(false) { } Aws::String UpdateHITReviewStatusRequest::SerializePayload() const { JsonValue payload; if(m_hITIdHasBeenSet) { payload.WithString("HITId", m_hITId); } if(m_revertHasBeenSet) { payload.WithBool("Revert", m_revert); } return payload.WriteReadable(); } Aws::Http::HeaderValueCollection UpdateHITReviewStatusRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "MTurkRequesterServiceV20170117.UpdateHITReviewStatus")); return headers; }
[ "henso@amazon.com" ]
henso@amazon.com
675eb393203a23b8c98c53532de69094e2fd5196
ae7c0a1a113630cec8936c7a0e19973801acf3a3
/include/Core/Utilities/Transform/QProgToQASM.h
84350fd813f35efb64c648880edc520fe19f1ba5
[ "Apache-2.0" ]
permissive
AmberHan/QPanda-2
d3d97c2e907dfe725bd0d7b6e037ed2b769502ed
a57d39297310f076ad4673dbba4601ae326d3152
refs/heads/master
2020-08-02T21:13:12.801905
2019-09-27T13:47:13
2019-09-27T13:47:13
null
0
0
null
null
null
null
GB18030
C++
false
false
3,693
h
/* Copyright (c) 2017-2018 Origin Quantum Computing. All Right Reserved. Licensed under the Apache License 2.0 QProgToQASM.h Author: Yulei Updated in 2019/04/09 14:39 Classes for QProgToQASM. */ /*! \file QProgToQASM.h */ #ifndef _QPROGTOQASM_H_ #define _QPROGTOQASM_H_ #include "Core/QuantumCircuit/QProgram.h" #include "Core/QuantumCircuit/QGate.h" #include "Core/QuantumCircuit/QCircuit.h" #include "Core/QuantumCircuit/QuantumMeasure.h" #include "Core/QuantumCircuit/QGlobalVariable.h" #include "Core/QuantumCircuit/ControlFlow.h" #include "Core/QuantumMachine/QuantumMachineInterface.h" #include "Core/Utilities/Traversal.h" QPANDA_BEGIN //目前IBM提供的后端运行环境 enum IBMQBackends { IBMQ_QASM_SIMULATOR = 0, IBMQ_16_MELBOURNE, IBMQX2, IBMQX4 }; /** * @namespace QPanda */ /** * @class QProgToQASM * @ingroup Utilities * @brief Quantum Prog Transform To QASM instruction sets */ class QProgToQASM : public TraversalInterface<bool&> { public: QProgToQASM(QuantumMachine * quantum_machine, IBMQBackends ibmBackend = IBMQ_QASM_SIMULATOR); ~QProgToQASM() {} /** * @brief get QASM insturction set * @return std::string * @exception * @note */ virtual std::string getInsturctions(); /*! * @brief Transform Quantum program * @param[in] QProg& quantum program * @return void * @exception * @note */ virtual void transform(QProg &); static std::string getIBMQBackendName(IBMQBackends typeNum); public: virtual void execute(std::shared_ptr<AbstractQGateNode> cur_node, std::shared_ptr<QNode> parent_node,bool & ) ; virtual void execute(std::shared_ptr<AbstractQuantumMeasure> cur_node, std::shared_ptr<QNode> parent_node, bool &) ; virtual void execute(std::shared_ptr<AbstractControlFlowNode> cur_node, std::shared_ptr<QNode> parent_node, bool &); virtual void execute(std::shared_ptr<AbstractQuantumCircuit> cur_node, std::shared_ptr<QNode> parent_node, bool &) ; virtual void execute(std::shared_ptr<AbstractQuantumProgram> cur_node, std::shared_ptr<QNode> parent_node, bool &) ; virtual void execute(std::shared_ptr<AbstractClassicalProg> cur_node, std::shared_ptr<QNode> parent_node, bool &); private: /*! add by zhaody * @brief Transform Quantum program by Traversal algorithm, refer to class Traversal * @param[in] QProg& quantum program * @return void * @exception * @note */ virtual void transformQProgByTraversalAlg(QProg *prog); virtual void transformQGate(AbstractQGateNode*, bool is_dagger); virtual void transformQMeasure(AbstractQuantumMeasure*); std::map<int, std::string> m_gatetype; /**< Quantum gatetype map */ std::vector<std::string> m_qasm; /**< QASM instructin vector */ QuantumMachine * m_quantum_machine; IBMQBackends _ibmBackend; }; /** * @brief Quantum program transform to qasm instruction set * @ingroup Utilities * @param[in] QProg& Quantum Program * @return std::string QASM instruction set * @see * @code init(QuantumMachine_type::CPU); auto qubit = qAllocMany(6); auto cbit = cAllocMany(2); auto prog = CreateEmptyQProg(); prog << CZ(qubit[0], qubit[2]) << H(qubit[1]) << CNOT(qubit[1], qubit[2]) << RX(qubit[0],pi/2) << Measure(qubit[1],cbit[1]); std::cout << transformQProgToQASM(prog) << std::endl; finalize(); * @endcode * @exception * @note */ std::string transformQProgToQASM(QProg &pQProg, QuantumMachine * quantum_machine, IBMQBackends ibmBackend = IBMQ_QASM_SIMULATOR); QPANDA_END #endif
[ "369038080@qq.com" ]
369038080@qq.com
23efedee17baeeb2a84984f2817890726af6380c
8048a0c6212b951fd8e8ba6fcfa199b94a927863
/Isachenko_Vladimir_201705302_Task5.h
0d5d06da69a10db98f4521aa58ccc5fd6396703f
[]
no_license
IsachenkoV/mvms_2017
4d24e2a1c60de82b70ef0be19e07d46454b74130
d0e69b61caef0ee6b0e02a9cbc0670cfd4204d4d
refs/heads/master
2021-01-22T22:34:10.459083
2017-08-18T12:54:20
2017-08-18T12:54:20
85,551,272
0
1
null
2017-03-20T08:16:28
2017-03-20T08:16:28
null
UTF-8
C++
false
false
927
h
#pragma once #include "task5.h" namespace mvms_2017 { class Isachenko_Vladimir_201705302_Task5 : public Task5 { private: const int VARIANT_NUMBER = 201705302; const std::string FIRST_NAME = "Владимир"; const std::string LAST_NAME = "Исаченко"; const float EPS = 1e-8; public: Isachenko_Vladimir_201705302_Task5(); Isachenko_Vladimir_201705302_Task5(bool verbose); int variant() override; std::string getFirstName() override; std::string getSecondName() override; /*! * \brief raysIntersection Алгоритм нахождения пересечения двух лучей в 3Д пространстве * \param pt1 точка 1 * \param ray1 луч 1 * \param pt2 точка 2 * \param ray2 луч 2 * \return точка пересечения */ cv::Point3f raysIntersection(cv::Point3f pt1, cv::Point3f ray1, cv::Point3f pt2, cv::Point3f ray2) override; }; }
[ "vv.isachenko@gmail.com" ]
vv.isachenko@gmail.com
fbd04fac7d7c0be6009f28f1470d6f3f5433180f
1c5f796b08bc47dde653579ae46fb7a4d2d9e661
/hw3/cheat.cpp
60324bba3434ad5c8b24eb5ac3b46a4056db40bb
[]
no_license
justodiaz/ComputerNetworking
ee75c423f5584ce13556213a08bc08152809b26d
a7be71c1a826f2174b46ba48eb2d5060abfa604d
refs/heads/master
2021-01-10T09:31:57.228291
2015-12-20T19:52:39
2015-12-20T19:52:39
48,332,567
0
0
null
null
null
null
UTF-8
C++
false
false
3,497
cpp
#include <iostream> #include <cstdio> #include <cerrno> #include <cstdlib> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #define WANTGAME 0 #define GAMESTART 1 #define PLAYCARD 2 #define PLAYRESULT 3 #define WIN 0 #define LOSE 1 #define DRAW 2 //Wrapper functions ssize_t Send(int sockfd, const void*buf, size_t len, int flags){ int sent = send(sockfd,buf,len,flags); if(sent < 0){ perror("Send error"); exit(1); } if(sent != (int)len){ std::cerr << "Send didn't send all bytes...exiting" << std::endl; exit(1); } return sent; } ssize_t Recv(int sockfd, void *buf, size_t len, int flags){ int partial = recv(sockfd,buf,len,flags); int total = 0; while(partial > 0){ total += partial; len -= partial; if(len <= 0) break; partial = recv(sockfd,(char *)buf + partial, len, 0); } if(partial < 0) { perror("Receive failed"); exit(1); } return total; } void i_error(char const *msg){ std::cerr << msg << std::endl; exit(1); } int main(int argc, char *argv[]){ if (argc < 3){ std::cerr << "Usage: " << argv[0] << " <host> <port>" << std::endl; exit(1); } struct addrinfo hints = {0}; struct addrinfo *res, *rp; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM;//SOCK_STREAM, SOCK_DGRAM hints.ai_protocol = 0; //"any" std::cout << "Connecting.." << std::endl; int s = getaddrinfo(argv[1], argv[2], &hints, &res); if(s){ if(s == EAI_SYSTEM) perror("getaddrinfo error"); else std::cerr << "getaddrinfo error: " << gai_strerror(s) << std::endl; exit(1); } int sockfd; for(rp = res; rp != NULL; rp = rp->ai_next){ sockfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if(sockfd < 0) continue; if(connect(sockfd, rp->ai_addr, rp->ai_addrlen) == 0) break; close(sockfd); } freeaddrinfo(res); if (rp == NULL) i_error("Could not bind"); std::cout << "Sending want game request..." << std::endl; char command[2] = {0}; char cards[27] = {0}; command[0] = WANTGAME; Send(sockfd,command,sizeof(command),0); std::cout << "Waiting for cards..." << std::endl; Recv(sockfd,cards,sizeof(cards),0); if(cards[0] != GAMESTART) i_error("Server error, now exiting."); std::cout << "Ready to play!" << std::endl; int score = 0; char const *suite[] = {"Clubs","Diamonds","Hearts","Spades"}; char const *face[] = {"Two","Three","Four","Five","Six","Seven", "Eight","Nine","Ten","Jack","Queen","King","Ace"}; /* will try to send all high cards */ for(int i=1; i<27; i++){ cards[i] = 12; } for(int i = 1; i<27; i++){ command[0] = PLAYCARD; command[1] = cards[i]; int idx_suite = cards[i]/13; int idx_face = cards[i]%13; std::cout << "Playing " << face[idx_face] << " of " << suite[idx_suite] << ": "; Send(sockfd,command,sizeof(command),0); Recv(sockfd,command,sizeof(command),0); if(command[0] != PLAYRESULT) i_error("Server error, now exiting."); switch(command[1]){ case WIN: score++; std::cout << "Battle won!" << std::endl; break; case LOSE: score--; std::cout << "Battle lost!" << std::endl; break; case DRAW: std::cout << "Battle draw!" << std::endl; break; default: i_error("Server error, now exiting."); } } shutdown(sockfd, SHUT_RDWR); if(score > 0) std::cout << "You won the war!" << std::endl; else if (score < 0) std::cout << "You lost the war!" << std::endl; else std::cout << "War ended in a draw!" << std::endl; return 0; }
[ "jdiaze2@uic.edu" ]
jdiaze2@uic.edu
96a96406b4c8bea4fa248c8868ab36df973a3533
159d734123bfaa77c9a5540ee46c067a022946dd
/SixConnect/SixConnect-masternew/SixConnect/playscene.h
036de2cbde14a1d02cbd967f2951e221fc59e608
[]
no_license
CarlosKai/SixConnect
5e735fbf425a91c05ad4cc91a8a1a9a2b35248d9
5ae5f5081bb441ec333f8ae9166cfc01433afb42
refs/heads/master
2023-04-06T23:19:49.738758
2020-09-27T11:40:38
2020-09-27T11:40:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,292
h
#ifndef PLAYSCENE_H #define PLAYSCENE_H #include"playmode.h" #include <QMainWindow> #include<QTimer> #include<QLabel> #include"mypushbutton.h" class PlayScene : public QMainWindow { Q_OBJECT private: int value=60; QLabel *countTime; QTimer *pTimer; int timeStop; bool AIfirst=0; public: explicit PlayScene(QWidget *parent = nullptr); void paintEvent(QPaintEvent *);//绘制背景 PlayScene(int index);//自定义选择关卡的构造函数,游戏关卡最好不要复用 int clickPosRow, clickPosCol; // 存储将点击的位置 int readyClick[20][20];//光标移动位置判断棋盘 PlayMode *game; // 游戏指针 QTimer *AIcontinue;//在AI和AI机机模式中进行计时,让AI轮流下子 // 监听鼠标移动情况,方便落子 void mouseMoveEvent(QMouseEvent *event); // 实际落子 void mouseReleaseEvent(QMouseEvent *event); void chessOneByPerson();//人下棋 void AIvsAI();//机机对战模式 void runTime();//启动定时器 void beginCount();//计时器开始计时 signals: void goback(); public slots: void chessOneByAI(); // AI下棋 void on_timer_timeout();//双人模式的倒计时 }; #endif // PLAYSCENE_H
[ "noreply@github.com" ]
noreply@github.com
015924539c82d781074104cddcd08ace8f0c920b
97756c60216574b0dcdc05dfcbd25d0246a071f7
/lib/libbullet/src/btSoftSoftCollisionAlgorithm.cpp
c997464e0790392cbbb65467df1f2af9c490c2cc
[ "Apache-2.0" ]
permissive
hivesolutions/mariachi
1b703ed004922d8140caace3ea98c788858c26e6
b8dc552e1c961f5faca1e9331d2b2ea45bdbdc76
refs/heads/master
2020-12-24T16:34:54.606556
2020-01-02T16:33:04
2020-01-02T16:33:04
27,374,575
1
0
null
null
null
null
UTF-8
C++
false
false
2,066
cpp
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btSoftSoftCollisionAlgorithm.h" #include "btCollisionDispatcher.h" #include "btBoxShape.h" #include "btCollisionObject.h" #include "btSoftBody.h" #define USE_PERSISTENT_CONTACTS 1 btSoftSoftCollisionAlgorithm::btSoftSoftCollisionAlgorithm(btPersistentManifold* /*mf*/,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* /*obj0*/,btCollisionObject* /*obj1*/) : btCollisionAlgorithm(ci) //m_ownManifold(false), //m_manifoldPtr(mf) { } btSoftSoftCollisionAlgorithm::~btSoftSoftCollisionAlgorithm() { } void btSoftSoftCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& /*dispatchInfo*/,btManifoldResult* /*resultOut*/) { btSoftBody* soft0 = (btSoftBody*)body0; btSoftBody* soft1 = (btSoftBody*)body1; soft0->defaultCollisionHandler(soft1); } btScalar btSoftSoftCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* /*body0*/,btCollisionObject* /*body1*/,const btDispatcherInfo& /*dispatchInfo*/,btManifoldResult* /*resultOut*/) { //not yet return 1.f; }
[ "joamag@gmail.com" ]
joamag@gmail.com
898e5adb8539c9bd59a18d409fe56c5c361c79da
fb247386ef0fa7d124c76b717315001c33db1a45
/3DSC/3dsc.cpp
e914eaaac81efffedbb6d50926ceccb4bc7b55ab
[]
no_license
jcarlos2289/CodigosPCL
a8ee4deafaec7ffa7124d0f91d98879e5544bd32
ae0da88c2701618ba0bc0599bae1c50709c58dd0
refs/heads/master
2016-09-06T19:41:17.426885
2014-07-15T12:58:01
2014-07-15T12:58:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
18,334
cpp
#include <pcl/io/pcd_io.h> #include <pcl/point_cloud.h> #include <pcl/correspondence.h> #include <pcl/features/normal_3d_omp.h> #include <pcl/features/shot_omp.h> #include <pcl/features/board.h> #include <pcl/keypoints/uniform_sampling.h> #include <pcl/recognition/cg/hough_3d.h> #include <pcl/recognition/cg/geometric_consistency.h> #include <pcl/visualization/pcl_visualizer.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/kdtree/impl/kdtree_flann.hpp> #include <pcl/common/transforms.h> #include <pcl/console/parse.h> #include <pcl/features/normal_3d.h> #include <pcl/features/3dsc.h> #include <exception> #include <iostream> typedef pcl::PointXYZRGBA PointType; typedef pcl::Normal NormalType; typedef pcl::ReferenceFrame RFType; typedef pcl::ShapeContext1980 DescriptorType; std::string model_filename_; std::string scene_filename_; //Algorithm params bool show_keypoints_ (false); bool show_correspondences_ (false); bool use_cloud_resolution_ (false); bool use_hough_ (true); float model_ss_ (0.01f); float scene_ss_ (0.03f); float rf_rad_ (0.015f); float descr_rad_ (0.02f); float cg_size_ (0.01f); float cg_thresh_ (5.0f); void showHelp (char *filename) { std::cout << std::endl; std::cout << "***************************************************************************" << std::endl; std::cout << "* *" << std::endl; std::cout << "* Correspondence Grouping Tutorial - Usage Guide *" << std::endl; std::cout << "* *" << std::endl; std::cout << "***************************************************************************" << std::endl << std::endl; std::cout << "Usage: " << filename << " model_filename.pcd scene_filename.pcd [Options]" << std::endl << std::endl; std::cout << "Options:" << std::endl; std::cout << " -h: Show this help." << std::endl; std::cout << " -k: Show used keypoints." << std::endl; std::cout << " -c: Show used correspondences." << std::endl; std::cout << " -r: Compute the model cloud resolution and multiply" << std::endl; std::cout << " each radius given by that value." << std::endl; std::cout << " --algorithm (Hough|GC): Clustering algorithm used (default Hough)." << std::endl; std::cout << " --model_ss val: Model uniform sampling radius (default 0.01)" << std::endl; std::cout << " --scene_ss val: Scene uniform sampling radius (default 0.03)" << std::endl; std::cout << " --rf_rad val: Reference frame radius (default 0.015)" << std::endl; std::cout << " --descr_rad val: Descriptor radius (default 0.02)" << std::endl; std::cout << " --cg_size val: Cluster size (default 0.01)" << std::endl; std::cout << " --cg_thresh val: Clustering threshold (default 5)" << std::endl << std::endl; } void parseCommandLine (int argc, char *argv[]) { //Show help if (pcl::console::find_switch (argc, argv, "-h")) { showHelp (argv[0]); exit (0); } //Model & scene filenames std::vector<int> filenames; filenames = pcl::console::parse_file_extension_argument (argc, argv, ".pcd"); if (filenames.size () != 2) { std::cout << "Filenames missing.\n"; showHelp (argv[0]); exit (-1); } model_filename_ = argv[filenames[0]]; scene_filename_ = argv[filenames[1]]; //Program behavior if (pcl::console::find_switch (argc, argv, "-k")) { show_keypoints_ = true; } if (pcl::console::find_switch (argc, argv, "-c")) { show_correspondences_ = true; } if (pcl::console::find_switch (argc, argv, "-r")) { use_cloud_resolution_ = true; } std::string used_algorithm; if (pcl::console::parse_argument (argc, argv, "--algorithm", used_algorithm) != -1) { if (used_algorithm.compare ("Hough") == 0) { use_hough_ = true; }else if (used_algorithm.compare ("GC") == 0) { use_hough_ = false; } else { std::cout << "Wrong algorithm name.\n"; showHelp (argv[0]); exit (-1); } } //General parameters pcl::console::parse_argument (argc, argv, "--model_ss", model_ss_); pcl::console::parse_argument (argc, argv, "--scene_ss", scene_ss_); pcl::console::parse_argument (argc, argv, "--rf_rad", rf_rad_); pcl::console::parse_argument (argc, argv, "--descr_rad", descr_rad_); pcl::console::parse_argument (argc, argv, "--cg_size", cg_size_); pcl::console::parse_argument (argc, argv, "--cg_thresh", cg_thresh_); } double computeCloudResolution (const pcl::PointCloud<PointType>::ConstPtr &cloud) { double res = 0.0; int n_points = 0; int nres; std::vector<int> indices (2); std::vector<float> sqr_distances (2); pcl::search::KdTree<PointType> tree; tree.setInputCloud (cloud); for (size_t i = 0; i < cloud->size (); ++i) { if (! pcl_isfinite ((*cloud)[i].x)) { continue; } //Considering the second neighbor since the first is the point itself. nres = tree.nearestKSearch (i, 2, indices, sqr_distances); if (nres == 2) { res += sqrt (sqr_distances[1]); ++n_points; } } if (n_points != 0) { res /= n_points; } return res; } int main (int argc, char *argv[]) { parseCommandLine (argc, argv); pcl::PointCloud<PointType>::Ptr model (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr model_keypoints (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr scene (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr scene_keypoints (new pcl::PointCloud<PointType> ()); pcl::PointCloud<NormalType>::Ptr model_normals (new pcl::PointCloud<NormalType> ()); pcl::PointCloud<NormalType>::Ptr scene_normals (new pcl::PointCloud<NormalType> ()); pcl::PointCloud<DescriptorType>::Ptr model_descriptors (new pcl::PointCloud<DescriptorType> ()); pcl::PointCloud<DescriptorType>::Ptr scene_descriptors (new pcl::PointCloud<DescriptorType> ()); // // Load clouds // if (pcl::io::loadPCDFile (model_filename_, *model) < 0) { std::cout << "Error loading model cloud." << std::endl; showHelp (argv[0]); return (-1); } if (pcl::io::loadPCDFile (scene_filename_, *scene) < 0) { std::cout << "Error loading scene cloud." << std::endl; showHelp (argv[0]); return (-1); } // // Set up resolution invariance // if (use_cloud_resolution_) { float resolution = static_cast<float> (computeCloudResolution (model)); if (resolution != 0.0f) { model_ss_ *= resolution; scene_ss_ *= resolution; rf_rad_ *= resolution; descr_rad_ *= resolution; cg_size_ *= resolution; } std::cout << "Model resolution: " << resolution << std::endl; std::cout << "Model sampling size: " << model_ss_ << std::endl; std::cout << "Scene sampling size: " << scene_ss_ << std::endl; std::cout << "LRF support radius: " << rf_rad_ << std::endl; std::cout << "SHOT descriptor radius: " << descr_rad_ << std::endl; std::cout << "Clustering bin size: " << cg_size_ << std::endl << std::endl; } // // Compute Normals // std::cout << "Inicio del Calculo de las Normales\n" << std::endl; // pcl::NormalEstimationOMP<PointType, NormalType> norm_est; // norm_est.setRadiusSearch(0.03); // pcl::search::KdTree<PointType>::Ptr kdtree(new pcl::search::KdTree<PointType>); // norm_est.setSearchMethod(kdtree); // norm_est.setInputCloud (model); // norm_est.compute (*model_normals); // pcl::NormalEstimationOMP<PointType, NormalType> norm_est2; //----------------------------------------- // norm_est2.setRadiusSearch(0.03); // pcl::search::KdTree<PointType>::Ptr kdtree2(new pcl::search::KdTree<PointType>); // norm_est2.setSearchMethod(kdtree2); // norm_est2.setInputCloud (scene); // norm_est2.compute (*scene_normals); pcl::NormalEstimationOMP<PointType, NormalType> norm_est; norm_est.setKSearch (10); norm_est.setInputCloud (model); norm_est.compute (*model_normals); norm_est.setInputCloud (scene); norm_est.compute (*scene_normals); std::cout << "Fin del Calculo de las Normales\n" << std::endl; // // Downsample Clouds to Extract keypoints // std::cout << "Inicio del muestro de los Keypoints\n" << std::endl; pcl::PointCloud<int> sampled_indices; pcl::UniformSampling<PointType> uniform_sampling; uniform_sampling.setInputCloud (model); uniform_sampling.setRadiusSearch (model_ss_); uniform_sampling.compute (sampled_indices); pcl::copyPointCloud (*model, sampled_indices.points, *model_keypoints); std::cout << "Model total points: " << model->size () << "; Selected Keypoints: " << model_keypoints->size () << std::endl; uniform_sampling.setInputCloud (scene); uniform_sampling.setRadiusSearch (scene_ss_); uniform_sampling.compute (sampled_indices); pcl::copyPointCloud (*scene, sampled_indices.points, *scene_keypoints); std::cout << "Scene total points: " << scene->size () << "; Selected Keypoints: " << scene_keypoints->size () << std::endl; std::cout << "Fin del muestro de los Keypoints\n" << std::endl; // // Compute Descriptor for keypoints // std::cout << "Inicio del Calculo de los Descriptores\n" << std::endl; //pcl::SHOTEstimationOMP<PointType, NormalType, DescriptorType> descr_est; pcl::ShapeContext3DEstimation<PointType, NormalType, DescriptorType> descr_est; descr_est.setRadiusSearch (descr_rad_); descr_est.setInputCloud (model_keypoints); descr_est.setInputNormals (model_normals); descr_est.setSearchSurface(model); descr_est.setMinimalRadius(descr_rad_/10); descr_est.setPointDensityRadius(descr_rad_/5); //std::cout << "Pase por\n" << std::endl;//descr_est.setSearchSurface (model); descr_est.compute (*model_descriptors); std::cout << "compute del Descriptor para el modelo realizado.\n" << std::endl; pcl::ShapeContext3DEstimation<PointType, NormalType, DescriptorType> descr_est2; descr_est2.setRadiusSearch (descr_rad_); descr_est2.setInputCloud (scene_keypoints); descr_est2.setInputNormals (scene_normals); descr_est2.setSearchSurface(scene); descr_est2.setMinimalRadius(descr_rad_/5); descr_est2.setPointDensityRadius(descr_rad_/2); descr_est2.compute(*scene_descriptors); std::cout << "compute del Descriptor para la escena realizado.\n" << std::endl; std::cout << "Fin del Calculo de los Descriptores\n" << std::endl; // // Find Model-Scene Correspondences with KdTree // std::cout << "Inicio del Calculo de las Correspondencias\n" << std::endl; pcl::CorrespondencesPtr model_scene_corrs (new pcl::Correspondences ()); pcl::KdTreeFLANN<DescriptorType> match_search; match_search.setInputCloud (model_descriptors); // For each scene keypoint descriptor, find nearest neighbor into the model keypoints descriptor cloud and add it to the correspondences vector. for (size_t i = 0; i < scene_descriptors->size (); ++i) { std::vector<int> neigh_indices (1); std::vector<float> neigh_sqr_dists (1); if (!pcl_isfinite (scene_descriptors->at (i).descriptor[0])) //skipping NaNs { continue; } int found_neighs = match_search.nearestKSearch (scene_descriptors->at (i), 1, neigh_indices, neigh_sqr_dists); if(found_neighs == 1 && neigh_sqr_dists[0] < 0.25f) // add match only if the squared descriptor distance is less than 0.25 (SHOT descriptor distances are between 0 and 1 by design) { pcl::Correspondence corr (neigh_indices[0], static_cast<int> (i), neigh_sqr_dists[0]); model_scene_corrs->push_back (corr); } } std::cout << "Correspondences found: " << model_scene_corrs->size () << std::endl; // // Actual Clustering // std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > rototranslations; std::vector<pcl::Correspondences> clustered_corrs; std::cout << "Inicio de Apicacion de Algoritmo de Correspondence Grouping \n" << std::endl; // Using Hough3D if (use_hough_) { // // Compute (Keypoints) Reference Frames only for Hough // std::cout << "Algoritmo Seleccionado: Hough \n" << std::endl; pcl::PointCloud<RFType>::Ptr model_rf (new pcl::PointCloud<RFType> ()); pcl::PointCloud<RFType>::Ptr scene_rf (new pcl::PointCloud<RFType> ()); pcl::BOARDLocalReferenceFrameEstimation<PointType, NormalType, RFType> rf_est; rf_est.setFindHoles (true); rf_est.setRadiusSearch (rf_rad_); rf_est.setInputCloud (model_keypoints); rf_est.setInputNormals (model_normals); rf_est.setSearchSurface (model); rf_est.compute (*model_rf); rf_est.setInputCloud (scene_keypoints); rf_est.setInputNormals (scene_normals); rf_est.setSearchSurface (scene); rf_est.compute (*scene_rf); // Clustering pcl::Hough3DGrouping<PointType, PointType, RFType, RFType> clusterer; clusterer.setHoughBinSize (cg_size_); clusterer.setHoughThreshold (cg_thresh_); clusterer.setUseInterpolation (true); clusterer.setUseDistanceWeight (false); clusterer.setInputCloud (model_keypoints); clusterer.setInputRf (model_rf); clusterer.setSceneCloud (scene_keypoints); clusterer.setSceneRf (scene_rf); clusterer.setModelSceneCorrespondences (model_scene_corrs); //clusterer.cluster (clustered_corrs); clusterer.recognize (rototranslations, clustered_corrs); } else // Using GeometricConsistency { std::cout << "Algoritmo Seleccionado: GC \n" << std::endl; pcl::GeometricConsistencyGrouping<PointType, PointType> gc_clusterer; gc_clusterer.setGCSize (cg_size_); gc_clusterer.setGCThreshold (cg_thresh_); gc_clusterer.setInputCloud (model_keypoints); gc_clusterer.setSceneCloud (scene_keypoints); gc_clusterer.setModelSceneCorrespondences (model_scene_corrs); /*gc_clusterer.cluster (clustered_corrs); */ //std::cout << "Pase aqui: 337" << std::endl; gc_clusterer.recognize (rototranslations, clustered_corrs); } // // Output results // std::cout << "Resultados Obtenidos \n" << std::endl; std::cout << "Modelo: " <<model_filename_ <<"\n"<< std::endl; std::cout << "Escena: " <<scene_filename_ <<"\n"<< std::endl; std::cout << "Model instances found: " << rototranslations.size () << std::endl; for (size_t i = 0; i < rototranslations.size (); ++i) { std::cout << "\n Instance " << i + 1 << ":" << std::endl; std::cout << " Correspondences belonging to this instance: " << clustered_corrs[i].size () << std::endl; // Print the rotation matrix and translation vector Eigen::Matrix3f rotation = rototranslations[i].block<3,3>(0, 0); Eigen::Vector3f translation = rototranslations[i].block<3,1>(0, 3); printf ("\n"); printf (" | %6.3f %6.3f %6.3f | \n", rotation (0,0), rotation (0,1), rotation (0,2)); printf (" R = | %6.3f %6.3f %6.3f | \n", rotation (1,0), rotation (1,1), rotation (1,2)); printf (" | %6.3f %6.3f %6.3f | \n", rotation (2,0), rotation (2,1), rotation (2,2)); printf ("\n"); printf (" t = < %0.3f, %0.3f, %0.3f >\n", translation (0), translation (1), translation (2)); } // // Visualization // pcl::visualization::PCLVisualizer viewer ("Correspondence Grouping"); viewer.addPointCloud (scene, "scene_cloud"); pcl::PointCloud<PointType>::Ptr off_scene_model (new pcl::PointCloud<PointType> ()); pcl::PointCloud<PointType>::Ptr off_scene_model_keypoints (new pcl::PointCloud<PointType> ()); if (show_correspondences_ || show_keypoints_) { // We are translating the model so that it doesn't end in the middle of the scene representation pcl::transformPointCloud (*model, *off_scene_model, Eigen::Vector3f (-1,0,0), Eigen::Quaternionf (1, 0, 0, 0)); pcl::transformPointCloud (*model_keypoints, *off_scene_model_keypoints, Eigen::Vector3f (-1,0,0), Eigen::Quaternionf (1, 0, 0, 0)); pcl::visualization::PointCloudColorHandlerCustom<PointType> off_scene_model_color_handler (off_scene_model, 255, 255, 128); viewer.addPointCloud (off_scene_model, off_scene_model_color_handler, "off_scene_model"); } if (show_keypoints_) { pcl::visualization::PointCloudColorHandlerCustom<PointType> scene_keypoints_color_handler (scene_keypoints, 0, 0, 255); viewer.addPointCloud (scene_keypoints, scene_keypoints_color_handler, "scene_keypoints"); viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "scene_keypoints"); pcl::visualization::PointCloudColorHandlerCustom<PointType> off_scene_model_keypoints_color_handler (off_scene_model_keypoints, 0, 0, 255); viewer.addPointCloud (off_scene_model_keypoints, off_scene_model_keypoints_color_handler, "off_scene_model_keypoints"); viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "off_scene_model_keypoints"); } for (size_t i = 0; i < rototranslations.size (); ++i) { pcl::PointCloud<PointType>::Ptr rotated_model (new pcl::PointCloud<PointType> ()); pcl::transformPointCloud (*model, *rotated_model, rototranslations[i]); std::stringstream ss_cloud; ss_cloud << "instance" << i; pcl::visualization::PointCloudColorHandlerCustom<PointType> rotated_model_color_handler (rotated_model, 255, 0, 0); viewer.addPointCloud (rotated_model, rotated_model_color_handler, ss_cloud.str ()); if (show_correspondences_) { for (size_t j = 0; j < clustered_corrs[i].size (); ++j) { std::stringstream ss_line; ss_line << "correspondence_line" << i << "_" << j; PointType& model_point = off_scene_model_keypoints->at (clustered_corrs[i][j].index_query); PointType& scene_point = scene_keypoints->at (clustered_corrs[i][j].index_match); // We are drawing a line for each pair of clustered correspondences found between the model and the scene viewer.addLine<PointType, PointType> (model_point, scene_point, 0, 255, 0, ss_line.str ()); } } // break; } while (!viewer.wasStopped ()) { viewer.spinOnce (); } return (0); }
[ "rovit@rovit.(none)" ]
rovit@rovit.(none)
17a1d90b15febc2edc6439334ca65bd2f4ddf827
59dd6c40f372f61da3e088754eddff8fbd529026
/Youtube Playlists/Striver Graph/11 bipartiteGraphCppDfs.cpp
14d5e3b3f2616f3a6c5133c7b876db50cc02a524
[]
no_license
skystone1000/Coding-Problems
a5dc6332352f496f169fad5d17c18bbf21911b87
a8f219408dd9afd9a119175156e3c4dde89f54cb
refs/heads/master
2022-12-04T12:51:40.913901
2022-11-30T13:31:58
2022-11-30T13:31:58
250,971,303
8
2
null
null
null
null
UTF-8
C++
false
false
1,183
cpp
#include <bits/stdc++.h> using namespace std; bool bipartiteDfs(int node, vector<int> adj[], int color[]) { for(auto it : adj[node]) { if(color[it] == -1) { color[it] = 1 - color[node]; if(!bipartiteDfs(it, adj, color)) { return false; } } else if(color[it] == color[node]) return false; } return true; } bool checkBipartite(vector<int> adj[], int n) { int color[n]; memset(color, -1, sizeof color); for(int i = 0;i<n;i++) { if(color[i] == -1) { color[i] = 1; if(!bipartiteDfs(i, adj, color)) { return false; } } } return true; } int main() { int n, m; cin >> n >> m; vector<int> adj[n]; for(int i = 0;i<m;i++) { int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); } if(checkBipartite(adj, n)) { cout << "yes"; } else { cout << "No"; } return 0; } /* 8 7 0 1 1 2 2 3 3 4 4 6 6 7 1 7 4 5 // bipartite graph example */ /* 7 7 0 1 1 2 2 3 3 4 4 6 6 1 4 5 // not bipartite example */
[ "adityaspmahajan@gmail.com" ]
adityaspmahajan@gmail.com
0e42bd9836c608b0e057eb1ac9d6bd2424e35143
c1e11eb6095b309f1acff74e81019a2d9c718083
/SSALNS/LoadFile.cpp
bafb2488ff954b8ff033bca7b8c2dd042f83f583
[]
no_license
beardoll/SSALNS
43b6fcdd53f6c113de515575aee8b481eb09b886
00a736fa763c1749102bf47a7b2aba87af3c3be9
refs/heads/master
2021-01-11T22:59:15.178233
2017-01-19T09:46:09
2017-01-19T09:46:09
78,532,250
1
1
null
null
null
null
GB18030
C++
false
false
3,429
cpp
#include "LoadFile.h" #include "tinystr.h" #include "tinyxml.h" bool LoadFile::getData(vector<Customer*> &allCustomer, Customer &depot, float &capacity){ // 读取xml内容于allCustomers, depot, capacity中 string file = filePath + fileName; // 文件路径+文件名 TiXmlDocument doc(file.c_str()); // 读入XML文件 if(!doc.LoadFile()) return false; // 如果无法读取文件,则返回 TiXmlHandle hDoc(&doc); // hDoc是&doc指向的对象 TiXmlElement* pElem; // 指向元素的指针 pElem = hDoc.FirstChildElement().Element(); //指向根节点 TiXmlHandle hRoot(pElem); // hRoot是根节点 Customer* customer; int tempINT; float tempFLOAT; // 读取x,y,它们放在network->nodes->node节点中 TiXmlElement* nodeElem = hRoot.FirstChild("network").FirstChild("nodes").FirstChild("node").Element(); //当前指向了node节点 for(nodeElem; nodeElem; nodeElem = nodeElem->NextSiblingElement()) { // 挨个读取node节点的信息 customer = new Customer; TiXmlHandle node(nodeElem); // nodeElem所指向的节点 TiXmlElement* xElem = node.FirstChild("cx").Element(); // cx节点 TiXmlElement* yElem = node.FirstChild("cy").Element(); // cy节点 nodeElem->QueryIntAttribute("id", &tempINT); //把id放到temp1中,属性值读法 if(tempINT == 0){ // depot节点 depot.id = tempINT; tempFLOAT = (float)atof(xElem->GetText()); // char转float depot.x = tempFLOAT; tempFLOAT = (float)atof(yElem->GetText()); depot.y = tempFLOAT; depot.type = 'D'; depot.serviceTime = 0; depot.arrivedTime = 0; depot.startTime = 0; depot.priority = 0; } else { customer = new Customer; customer->id = tempINT; tempFLOAT = (float)atof(xElem->GetText()); // char转float customer->x = tempFLOAT; tempFLOAT = (float)atof(yElem->GetText()); customer->y = tempFLOAT; customer->type = 'L'; allCustomer.push_back(customer); } } // 读取其余信息 TiXmlElement* requestElem = hRoot.FirstChild("requests").FirstChild("request").Element(); // 指向了request节点 int count = 0; for(requestElem; requestElem; requestElem = requestElem->NextSiblingElement()) { customer = allCustomer[count]; // 当前顾客节点,注意不能赋值给一个新的对象,否则会调用复制构造函数 TiXmlHandle request(requestElem); // 指针指向的对象 TiXmlElement* startTimeElem = request.FirstChild("tw").FirstChild("start").Element(); // start time TiXmlElement* endTimeElem = request.FirstChild("tw").FirstChild("end").Element(); // end time TiXmlElement* quantityElem = request.FirstChild("quantity").Element(); // quantity TiXmlElement* serviceTimeElem = request.FirstChild("service_time").Element(); // service time // 分别读取各项数据 tempFLOAT = (float)atof(startTimeElem->GetText()); customer->startTime = tempFLOAT; tempFLOAT = (float)atof(endTimeElem->GetText()); customer->endTime = tempFLOAT; tempFLOAT = (float)atof(quantityElem->GetText()); customer->quantity = tempFLOAT; tempFLOAT = (float)atof(serviceTimeElem->GetText()); customer->serviceTime = tempFLOAT; count++; } // 读取capacity TiXmlElement* capacityElem = hRoot.FirstChild("fleet").FirstChild("vehicle_profile").FirstChild("capacity").Element(); tempFLOAT = (float)atof(capacityElem->GetText()); capacity = tempFLOAT; return true; }
[ "beardoll1993@gmail.com" ]
beardoll1993@gmail.com
6d3d17c9c468bdc4903df17fa3efc81e18337a1e
bcddd00650cfaeafda4c82cef47d996419d38032
/plugins/wasm_bpf/func-attach-bpf-program.h
df5abedd5422e0f4c52b2eb4b3bf512570eb3d3d
[ "Apache-2.0", "CC0-1.0" ]
permissive
WasmEdge/WasmEdge
d980037be14dcbddd39fdeb32801fa9539fdb440
b70f48c42922ce5ee7730054b6ac0b1615176285
refs/heads/master
2023-08-31T04:07:11.517799
2023-08-28T04:07:12
2023-08-28T04:07:12
224,908,244
5,731
703
Apache-2.0
2023-09-14T17:55:44
2019-11-29T19:00:17
C++
UTF-8
C++
false
false
791
h
// SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2019-2022 Second State INC #pragma once #include "bpf-api.h" #include "plugin/plugin.h" #include "po/helper.h" #include "runtime/callingframe.h" #include "runtime/instance/module.h" #include "state.h" namespace WasmEdge { namespace Host { /// \brief Attach a bpf program to the specified target class AttachBpfProgram : public WasmEdge::Runtime::HostFunction<AttachBpfProgram> { public: AttachBpfProgram(state_t state) : state(state) {} WasmEdge::Expect<int32_t> body(const WasmEdge::Runtime::CallingFrame &Frame, handle_t program, uint32_t name, uint32_t attach_target); private: state_t state; }; } // namespace Host } // namespace WasmEdge
[ "noreply@github.com" ]
noreply@github.com
0720569ba2e6bf3a5256a179933d5066dc680d51
a79ff4546d645cfdbf2e2b575ebc73a65a93073a
/Cobalt/src/Cobalt/Renderer/Texture.cpp
8ea4427d038a474c46005fb475014086be22a949
[]
no_license
spasatron/Cobalt
c36701448f8fbab16057bfbce6db78f63edf55b5
d8c1412ab3d43b69a29d28bff75a0b9d51994973
refs/heads/master
2022-04-10T15:34:51.565849
2020-03-26T00:18:07
2020-03-26T00:18:07
227,702,557
0
0
null
null
null
null
UTF-8
C++
false
false
519
cpp
#include "cbpc.h" #include "Texture.h" #include "Renderer.h" #include "Cobalt/Platform/OpenGL/OpenGLTexture.h" namespace Cobalt { Ref<Texture2D> Texture2D::Create(const std::string& path){ switch (Renderer::GetRendererAPI()) { case RendererAPI::API::OpenGL: return std::make_shared<OpenGLTexture2D>(path); case RendererAPI::API::None: COBALT_ASSERT(false, "RenderAPI::None is currently not supported"); return nullptr; } COBALT_CORE_ERROR("COULD NOT FIND RENDERER API"); return nullptr; } }
[ "spasangelov@gmail.com" ]
spasangelov@gmail.com
2c0b5578c504c6e7f1defdc9a0e41a45fd240740
82ecd95e91eb2907b97788af65129e9ce6a9d369
/Ct/ws/CtMsg.cpp
fcf733a1dfe3d65298fb07825832b99789f1fd2f
[]
no_license
nmoritani/Ct_Sample3
762eda95476adf2fc94d722747ac9817ed8e53ad
c889a2922aa7a75d9438f10902cb73864b5e4765
refs/heads/master
2023-07-03T00:34:44.352187
2021-07-23T09:39:19
2021-07-23T09:39:19
374,942,747
0
0
null
null
null
null
UTF-8
C++
false
false
333
cpp
/** * Copyright(c) 2018 Persol AVC Technology. * Element: CtMsg */ #include "CtMsg.h" CtMsg::CtMsg() { m_Priority = 0; } CtMsg::CtMsg(int Priority) { m_Priority = Priority; } CtMsg::~CtMsg() { } int CtMsg::getPriority() { return m_Priority; } void CtMsg::setPriority(int priority) { m_Priority = priority; }
[ "moritani.nobuo@gmail.com" ]
moritani.nobuo@gmail.com
466ef119400bae96d07194550fc3faf93ea82bcf
20a2e07849d4646de8146e4c95d09bed570dec36
/test1.cpp
2a34f79f15b3223726d7331318202cd36a175177
[]
no_license
XiangZei/leetcode
e118d297945157e2ec2190c3b727d4459720c1ed
7b7f2fccb894ea64fd77a027a325bc127d3a9a36
refs/heads/master
2022-11-30T04:33:35.627005
2020-08-04T02:07:10
2020-08-04T02:07:10
264,802,658
0
0
null
null
null
null
UTF-8
C++
false
false
2,794
cpp
#include<bits/stdc++.h> using namespace std; int N,A,B,C,D,E,F; int visit[1001],dist; vector<int> cnt; bool equall(vector<int> t1, vector<int> t2) { if (t1[0] == t2[0] && t1[1] == t2[1] && t1[2] == t2[2] && t1[3] == t2[3] && t1[4] == t2[4] && t1[5] == t2[5]) { return true; } if (t1[0] == t2[0] && t1[1] == t2[1] && t1[4] == t2[2] && t1[5] == t2[3] && t1[3] == t2[4] && t1[2] == t2[5]) { return true; } if (t1[0] == t2[0] && t1[1] == t2[1] && t1[5] == t2[2] && t1[4] == t2[3] && t1[2] == t2[4] && t1[3] == t2[5]) { return true; } if (t1[0] == t2[0] && t1[1] == t2[1] && t1[3] == t2[2] && t1[2] == t2[3] && t1[5] == t2[4] && t1[4] == t2[5]) { return true; } return false; } bool eee(vector<int> t1, vector<int> t2) { if(equall(t1,t2)){ return true; } //左 vector<int> tmp(6, 0); tmp[0] = t1[3]; tmp[1] = t1[2]; tmp[2] = t1[0]; tmp[3] = t1[1]; tmp[4] = t1[4]; tmp[5] = t1[5]; if(equall(tmp, t2)){ return true; } // 右 tmp[0] = t1[2]; tmp[1] = t1[3]; tmp[2] = t1[1]; tmp[3] = t1[0]; tmp[4] = t1[4]; tmp[5] = t1[5]; if (equall(tmp, t2)) { return true; } // 前 tmp[0] = t1[5]; tmp[1] = t1[4]; tmp[2] = t1[2]; tmp[3] = t1[3]; tmp[4] = t1[0]; tmp[5] = t1[1]; if (equall(tmp, t2)) { return true; } // 后 tmp[0] = t1[4]; tmp[1] = t1[5]; tmp[2] = t1[2]; tmp[3] = t1[3]; tmp[4] = t1[1]; tmp[5] = t1[0]; if (equall(tmp, t2)) { return true; } // 下 tmp[0] = t1[1]; tmp[1] = t1[0]; tmp[2] = t1[2]; tmp[3] = t1[3]; tmp[4] = t1[5]; tmp[5] = t1[4]; if (equall(tmp, t2)) { return true; } return false; } bool cmp(int a,int b) { return a>b; } int main(){ cin>>N; vector<vector<int>> con; for(int i = 0; i < N; i++) { cin>>A>>B>>C>>D>>E>>F; vector<int> tmp; tmp.push_back(A); tmp.push_back(B); tmp.push_back(C); tmp.push_back(D); tmp.push_back(E); tmp.push_back(F); con.push_back(tmp); } for(int i = 0; i < con.size(); i++) { if(visit[i]) continue; int count = 1; for(int j = i+1; j < con.size(); j++) { if (eee(con[i], con[j])) { visit[i] = 1; visit[j] = 1; count++; } } cnt.push_back(count); dist++; } cout<<dist<<endl; sort(cnt.begin(), cnt.end(), cmp); for(int i = 0; i < cnt.size(); i++) { cout<<cnt[i]; if(i!=cnt.size()-1){ cout<<" "; } } return 0; }
[ "aveszhang@tencent.com" ]
aveszhang@tencent.com
49e5e21ee3eed1b2d4fd614c8e4fedf827586f9c
cd196603ae55542fcf16bdf63737ab7ca6295ce4
/subprogramaPotencia.cpp
95150aae5b9d7089c2625e2929b45f63f102cbd5
[]
no_license
leohck/CProjects
a72dc9b19b2bd2402e787845bdd1eeff5c4a2d91
36ca35af680cb003a5de816311d1ed2deea9ec40
refs/heads/master
2021-01-21T18:57:37.406665
2017-05-22T20:40:29
2017-05-22T20:40:29
92,097,331
0
0
null
null
null
null
UTF-8
C++
false
false
512
cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> int potencia(int n, int n1); main() { int base,expoente; printf("Informe um numero inteiro e em seguida o numero de elevacao: "); scanf("%d%d", &base, &expoente); printf("%d elevado a %d = %d\n",base , expoente, potencia(base,expoente)); system("pause"); } int potencia(int nBase, int nExpoente) { while(nExpoente>1) { nBase *= nBase; nExpoente--; } return nBase; }
[ "noreply@github.com" ]
noreply@github.com
976a7e5b6209102366adaf99cf04b923f6ef0b2a
219d7fef34a712fd14806799186922f8abb040f2
/src/math/MassCenter.hpp
15a793b7b962cdce8dba6b35403a042ae7be4d91
[]
permissive
lopesth/MoleKing_util
16570c07c3ca041a233da2a4ce8a434eb5690b38
62e299fce1152d3ca47a0653669197d46edc7920
refs/heads/master
2022-04-29T10:15:28.596268
2021-06-09T16:13:36
2021-06-09T16:13:36
232,403,787
0
0
MIT
2021-03-08T14:05:59
2020-01-07T19:45:37
C++
UTF-8
C++
false
false
633
hpp
// // MassCenter.hh // MoleKing_util // // Created by Thiago Lopes and Mateus Barbosa on 09/01/20. // Copyright © 2020 LMSC. All rights reserved. // #ifndef MassCenter_hpp #define MassCenter_hpp #include <stdio.h> #include <vector> #include "Geometry.hpp" using namespace std; class MassCenter{ private: vector <double> massList; Point massCenterPoint; double axisMassCenter(vector <double> coords); public: MassCenter(vector <double> massList, vector <double> xCoords, vector <double> yCoords, vector <double> zCoords); ~MassCenter(); Point getMassCenter(); }; #endif /* MassCenter_hpp */
[ "lopes.th.o@gmail.com" ]
lopes.th.o@gmail.com
2785697f9c7e5a33eb6eadb4aa0535570509bc7c
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5756407898963968_0/C++/casian/main.cpp
66eb7890dc2b90553cb0522bc6b450860bfd2492
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
961
cpp
#include<cstdio> using namespace std; int f[20]; int main() { int t, i, j, k, rez, ans, val; scanf("%d", &t); for(k = 1; k <= t; ++ k) { scanf("%d", &ans); for(i = 1; i <= 4; ++ i) for(j = 1; j <= 4; ++ j) { scanf("%d", &val); if(i == ans) ++ f[val]; } scanf("%d", &ans); for(i = 1; i <= 4; ++ i) for(j = 1; j <= 4; ++ j) { scanf("%d", &val); if(i == ans) ++ f[val]; } rez = 0; for(i = 1; i <= 16; ++ i) if(f[i] == 2) { if(rez == 0) rez = i; else rez = 17; } if(rez == 0) printf("Case #%d: Volunteer cheated!\n", k); else { if(rez == 17) printf("Case #%d: Bad magician!\n", k); else printf("Case #%d: %d\n", k, rez); } for(i = 1; i <= 16; ++ i) f[i] = 0; } return 0; }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
bf14aea981dc507ed29ef53bf81e97c4b1bce2e5
5ef9c03f47708bd0dc95d76a53369e51c5617944
/lib-h3/lib-e131/src/e131bridgeprint.cpp
a766734d969a555cece8fbb476f741781cc930c1
[ "MIT" ]
permissive
hermixy/allwinner-bare-metal
87dcc033884b990609669559428d7e35e191afa6
ea55715ac31942d7af3a6babba29514c8a2f0d49
refs/heads/master
2023-09-02T08:21:25.074808
2021-10-12T09:57:52
2021-10-12T09:57:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,584
cpp
/** * @file e131bridgeprint.cpp * */ /* Copyright (C) 2018-2021 by Arjan van Vught mailto:info@orangepi-dmx.nl * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #if !defined(__clang__) // Needed for compiling on MacOS # pragma GCC push_options # pragma GCC optimize ("Os") #endif #include <stdio.h> #include <stdint.h> #include <uuid/uuid.h> #include "e131bridge.h" #include "e131bridgeconst.h" #include "e131.h" void E131Bridge::Print() { char uuid_str[UUID_STRING_LENGTH + 1]; uuid_str[UUID_STRING_LENGTH] = '\0'; uuid_unparse(m_Cid, uuid_str); printf("Bridge\n"); printf(" Firmware : %d.%d\n", E131BridgeConst::VERSION[0], E131BridgeConst::VERSION[1]); if (m_State.nActiveOutputPorts != 0) { printf(" Output\n"); for (uint32_t nPortIndex = 0; nPortIndex < E131_MAX_PORTS; nPortIndex++) { uint16_t nUniverse; if (GetUniverse(nPortIndex, nUniverse, E131_OUTPUT_PORT)) { printf(" Port %2d Universe %-3d [%s]\n", nPortIndex, nUniverse, E131::GetMergeMode(m_OutputPort[nPortIndex].mergeMode, true)); } } } if (m_State.nActiveInputPorts != 0) { printf(" CID : %s\n", uuid_str); printf(" Input\n"); for (uint32_t nPortIndex = 0; nPortIndex < E131_MAX_UARTS; nPortIndex++) { uint16_t nUniverse; if (GetUniverse(nPortIndex, nUniverse, E131_INPUT_PORT)) { printf(" Port %2d Universe %-3d [%d]\n", nPortIndex, nUniverse, GetPriority(nPortIndex)); } } } if (m_bDirectUpdate) { printf(" Direct update : Yes\n"); } if (m_State.bDisableSynchronize) { printf(" Synchronize is disabled\n"); } }
[ "uli@basicengine.org" ]
uli@basicengine.org
e8d04c42d769ced43fc78caaa4093d5f3f229cad
360f38378f4e515be0ff700964e4fadf3374ade5
/cs1400Final/cs1400Final/all.cpp
748558b4f4f8e2b1590de58064769c76c4055599
[]
no_license
jenniferballing/CS1400Final
89b526b26a27c01a77eaa957221133ef6266ee3b
fa8ce7f5250c63f073a87196a52e10850c44ed1b
refs/heads/master
2016-09-10T12:07:53.076600
2013-11-30T04:47:29
2013-11-30T04:47:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,328
cpp
#include "all.h" #include <cmath> #include <iostream> void all::Place(int minR,int maxR,int minC,int maxC, SitRep sitrep){ bool done=false; int tr,tc; Dir td; while(!done){ tr=minR+rand()%(maxR-minR); tc=minC+rand()%(maxC-minC); if(sitrep.thing[tr][tc].what==space)done=true; } int rdist=ROWS/2-tr; int cdist=COLS/2-tc; if(abs(rdist)<abs(cdist)){ if(cdist>0)td=rt; else td=lt; }else{ if(rdist>0)td=up; else td=dn; } r=tr; c=tc; dir=td; } // tell someone what you want to do Action all::Recommendation(SitRep sitrep){ // this code is provided as an example only // use at your own risk Action a; // first, try to attack in front of you int tr=r,tc=c; switch(dir){ case up: tr--; break; case dn: tr++; break; case rt: tc++; break; case lt: tc--; break; case none: break; } if(tr>=0&&tr<ROWS&&tc>=0&&tc<COLS){ if(sitrep.thing[tr][tc].what==unit){ if(sitrep.thing[tr][tc].tla!=tla){ a.action=attack; a.ar=tr; a.ac=tc; return a; } } } // there is not an enemy in front of me // so head to the nearest enemy if(dir==sitrep.nearestEnemy.dirFor){ a.action=fwd; a.maxDist=1; if(rank==knight||rank==crown)a.maxDist=HORSESPEED; return a; } else { a.action=turn; a.dir=sitrep.nearestEnemy.dirFor; return a; } a.action=nothing; return a; }
[ "jenniferballing@gmail.com" ]
jenniferballing@gmail.com
1abe487293fa283182c0ffa0142f84d48f9cae9c
8e142f4fb5212240a08eeb4dcdadd1f28bce727e
/Source/ToonTanks/PlayerControllers/PlayerControllerBase.h
c1dc0afc312291c553eb2fafd6faa8a2f346a430
[ "MIT" ]
permissive
ArturSymanovic/ToonTanks
bb1df4abbe8f58f3c41cda21d03dad890bfa8c8b
30949f738e302ad745cfbf531eb314701b8a7303
refs/heads/master
2022-11-12T19:58:39.058067
2020-07-06T23:01:18
2020-07-06T23:01:18
276,722,750
0
0
null
null
null
null
UTF-8
C++
false
false
339
h
// Copyright Artur Symanovic 2020 #pragma once #include "CoreMinimal.h" #include "GameFramework/PlayerController.h" #include "PlayerControllerBase.generated.h" /** * */ UCLASS() class TOONTANKS_API APlayerControllerBase : public APlayerController { GENERATED_BODY() public: void SetPlayerEnabledState(bool SetPlayerEnabled); };
[ "artur.symanovic@gmail.com" ]
artur.symanovic@gmail.com
3fba27b516a357aa389b1481edd41d734407495b
a6d89eb0f87caed504128102a4ba340134627bb3
/src/FbxConverter/FileOutputStream.h
97229ff835686fe5d0a1fd952c40f5f3bff42c51
[ "MIT" ]
permissive
blockspacer/aten
5dd7d05050c0b5d2cf4f2060b3277c0219693c39
cb44174c43b98d63855664eb323a537e3c37e531
refs/heads/master
2021-03-24T03:22:05.656686
2020-03-04T15:58:41
2020-03-04T15:58:41
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,127
h
#pragma once #include "defs.h" #include "types.h" enum FileIoMode { Bin, Text, }; enum FilSeekPos { Head, Tail, Cur, }; class FileOutputStream { public: FileOutputStream() { } ~FileOutputStream() { finalize(); } FileOutputStream(const FileOutputStream& rhs) = delete; FileOutputStream& operator=(const FileOutputStream& rhs) = delete; public: bool open(const char* path) { return open(path, FileIoMode::Bin); } bool open(const char* path, FileIoMode mode) { bool ret = false; if (m_File != nullptr) { AT_ASSERT(false); finalize(); } m_File = fopen(path, mode == FileIoMode::Text ? "wt" : "wb"); ret = (m_File != nullptr); return ret; } void finalize() { if (m_File) { fclose(m_File); } m_File = nullptr; m_Pos = 0; } // 出力 uint32_t write(const void* buf, uint32_t offset, size_t size) { AT_ASSERT(m_File != nullptr); AT_ASSERT(size > 0); if (offset > 0) { seek(offset, FilSeekPos::Cur); } uint32_t ret = (uint32_t)fwrite(buf, 1, size, m_File); AT_ASSERT(ret == size); if (ret == size) { m_Pos += offset + (uint32_t)size; } return ret; } // 現在位置取得 uint32_t getCurPos() { return m_Pos; } // シーク bool seek(int32_t offset, FilSeekPos seekPos) { AT_ASSERT(m_File != nullptr); uint32_t nPos = SEEK_SET; switch (seekPos) { case FilSeekPos::Head: nPos = SEEK_SET; break; case FilSeekPos::Cur: nPos = SEEK_CUR; break; case FilSeekPos::Tail: // 出力時にはファイル終端は存在しないので・・・ AT_VRETURN_FALSE(false); break; } bool ret = true; { // シーク ret = (fseek(m_File, offset, nPos) == 0); if (ret) { // 現在位置更新 switch (seekPos) { case FilSeekPos::Head: m_Pos = offset; break; case FilSeekPos::Cur: m_Pos += offset; break; case FilSeekPos::Tail: AT_VRETURN_FALSE(false); break; } } } AT_ASSERT(ret); return ret; } bool isValid() { return (m_File != NULL); } uint32_t tell() { return (uint32_t)ftell(m_File); } void flush() { fflush(m_File); } private: FILE* m_File{ nullptr }; uint32_t m_Pos{ 0 }; }; #define OUTPUT_WRITE(out, p, offset, size) ((out)->write((p), (offset), (size)) == (size)) #define OUTPUT_WRITE_VRETURN(out, p, offset, size) AT_VRETURN(OUTPUT_WRITE(out, p, offset, size), false) class IoStreamSeekHelper { protected: IoStreamSeekHelper() {} public: IoStreamSeekHelper(FileOutputStream* pOut) { m_pOut = pOut; m_nPos = 0; m_nAnchorPos = 0; } ~IoStreamSeekHelper() {} public: bool skip(uint32_t nSkip) { m_nPos = m_pOut->getCurPos(); AT_VRETURN_FALSE(m_pOut->seek(nSkip, FilSeekPos::Cur)); return true; } void step(uint32_t nStep) { m_nPos += nStep; } bool returnTo() { AT_VRETURN_FALSE(m_pOut->seek(m_nPos, FilSeekPos::Head)); return true; } bool returnWithAnchor() { m_nAnchorPos = m_pOut->getCurPos(); AT_VRETURN_FALSE(m_pOut->seek(m_nPos, FilSeekPos::Head)); return true; } bool returnToAnchor() { AT_VRETURN_FALSE(m_pOut->seek(m_nAnchorPos, FilSeekPos::Head)); return true; } FileOutputStream* getOutputStream() { return m_pOut; } protected: FileOutputStream* m_pOut; uint32_t m_nPos; uint32_t m_nAnchorPos; };
[ "newvf91.brjtn579.dn@gmail.com" ]
newvf91.brjtn579.dn@gmail.com
4c4206e66f87b1bb65b57c814fdbf44538283f27
da3215baf37d257d5814f165e98b4b19dee9cb05
/SDK/FN_LegacyButtonStyle-Transparent_classes.hpp
064aa4cea4afd3bebf899fe0475cd78980942396
[]
no_license
Griizz/Fortnite-Hack
d37a6eea3502bf1b7c78be26a2206c8bc70f6fa5
5b80d585065372a4fb57839b8022dc522fe4110b
refs/heads/Griizz_Version
2022-04-01T22:10:36.081573
2019-05-21T19:28:30
2019-05-21T19:28:30
106,034,464
115
85
null
2020-02-06T04:00:07
2017-10-06T17:55:47
C++
UTF-8
C++
false
false
695
hpp
#pragma once // Fortnite SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace SDK { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // BlueprintGeneratedClass LegacyButtonStyle-Transparent.LegacyButtonStyle-Transparent_C // 0x0000 (0x1C08 - 0x1C08) class ULegacyButtonStyle_Transparent_C : public ULegacyButtonStyle_Base_C { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("BlueprintGeneratedClass LegacyButtonStyle-Transparent.LegacyButtonStyle-Transparent_C"); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "sinbadhacks@gmail.com" ]
sinbadhacks@gmail.com
b85491815c255fb9f5858322aa9c428d42919af3
20fbb94f124f6e1bd2f54e76587b10df79ddd263
/client/Lifter_client_mscv/Lifter_client_mscv/SingleApplication.cpp
beb3ec33c1c6a43c0de707d42d6d687582007379
[]
no_license
xiezhaoHi/lifter_
fdab80c26c013fe688cc2f56deb688c3cd375ba9
e22d9242c1ce91ed56714a33e39de3740d4e070d
refs/heads/master
2018-10-25T07:46:10.232207
2018-08-21T10:14:06
2018-08-21T10:14:06
115,978,203
0
0
null
null
null
null
GB18030
C++
false
false
3,390
cpp
#include "SingleApplication.h" #include <QtNetwork/QLocalSocket> #include <QFileInfo> #include <QSettings> #define TIME_OUT (500) // 500ms SingleApplication::SingleApplication(int &argc, char **argv) : QApplication(argc, argv) , w(NULL) , _isRunning(false) , _localServer(NULL) { QString strPath = qApp->applicationDirPath() + "\\config\\config.ini"; QSettings iniRead(strPath, QSettings::IniFormat); QString strconfigd = iniRead.value("lifter/lifter_choose").toString(); QString strName = QFileInfo(QCoreApplication::applicationFilePath()).fileName() + strconfigd; // 取应用程序名作为LocalServer的名字 _serverName = strName; _initLocalConnection(); } //////////////////////////////////////////////////////////////////////////////// // 说明: // 检查是否已經有一个实例在运行, true - 有实例运行, false - 没有实例运行 //////////////////////////////////////////////////////////////////////////////// bool SingleApplication::isRunning() { return _isRunning; } //////////////////////////////////////////////////////////////////////////////// // 说明: // 通过socket通讯实现程序单实例运行,监听到新的连接时触发该函数 //////////////////////////////////////////////////////////////////////////////// void SingleApplication::_newLocalConnection() { QLocalSocket *socket = _localServer->nextPendingConnection(); if (socket) { socket->waitForReadyRead(2 * TIME_OUT); delete socket; // 其他处理,如:读取启动参数 _activateWindow(); } } //////////////////////////////////////////////////////////////////////////////// // 说明: // 通过socket通讯实现程序单实例运行, // 初始化本地连接,如果连接不上server,则创建,否则退出 //////////////////////////////////////////////////////////////////////////////// void SingleApplication::_initLocalConnection() { _isRunning = false; QLocalSocket socket; socket.connectToServer(_serverName); if (socket.waitForConnected(TIME_OUT)) { fprintf(stderr, "%s already running.\n", _serverName.toLocal8Bit().constData()); _isRunning = true; // 其他处理,如:将启动参数发送到服务端 return; } //连接不上服务器,就创建一个 _newLocalServer(); } //////////////////////////////////////////////////////////////////////////////// // 说明: // 创建LocalServer //////////////////////////////////////////////////////////////////////////////// void SingleApplication::_newLocalServer() { _localServer = new QLocalServer(this); connect(_localServer, SIGNAL(newConnection()), this, SLOT(_newLocalConnection())); if (!_localServer->listen(_serverName)) { // 此时监听失败,可能是程序崩溃时,残留进程服务导致的,移除之 if (_localServer->serverError() == QAbstractSocket::AddressInUseError) { QLocalServer::removeServer(_serverName); // <-- 重点 _localServer->listen(_serverName); // 再次监听 } } } //////////////////////////////////////////////////////////////////////////////// // 说明: // 激活主窗口 //////////////////////////////////////////////////////////////////////////////// void SingleApplication::_activateWindow() { if (w) { w->show(); w->raise(); w->activateWindow(); // 激活窗口 } }
[ "15182911195@163.com" ]
15182911195@163.com