blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
sequencelengths
1
1
author_id
stringlengths
0
158
b789f0140332afa158f2959439491edf56cb6636
05414e7dc42f711f5f108dcb4f736f4877f7eead
/1006/1006_11.cpp
46df26970f5dd19fc3d2a383ff1aeff6dcf010d0
[]
no_license
shangli-cuc/ACM
43a97c4d7252ac4294099ae254ea63680084126e
d3eaab56a2b5c4eb86f9be4f13ffd8f333e7d694
refs/heads/master
2021-09-11T21:04:10.801941
2018-04-12T11:32:07
2018-04-12T11:32:07
103,899,362
0
0
null
null
null
null
GB18030
C++
false
false
792
cpp
// 1006_11.cpp : 定义控制台应用程序的入口点。 //假设一共有N对新婚夫妇, 其中有M个新郎找错了新娘, 求发生这种情况一共有多少种可能. #include<iostream> using namespace std; long long Cnm(int n, int m)//Cnm=n!/(m!*(n-m)!) { int i; long long sum=1; for (i = n; i > m; i--) sum *= i; for (i = n - m; i > 1; i--) sum /= i; return sum; } int main() { int C; cin >> C; int i; long long num[21]; num[0] = num[1] = 0; num[2] = 1; for (i = 3; i < 21; i++) num[i] = (i - 1)*(num[i - 2] + num[i - 1]); while (C != EOF && C--) { int n, m; cin >> n >> m; if (m <= 1 || m > n || n > 20) break; cout << Cnm(n, m)*num[m] << endl; //for (i = 0; i < n; i++) //cout << num[i] << endl; } //system("pause"); return 0; }
83e024f298b2582730b435fd67584726f87a4ce9
ed39c6a1fae65706849528dfa1a2830b3f51205b
/Week_06/task-scheduler.cpp
e2e45923cae8972551e78c3efd85cc9af634eeec
[]
no_license
hanqichen/algorithm014-algorithm014
4d4f200d104a9c699563bb409a88ebd55d8e7cda
a9667259d5add22bfa2ff6d258b54c51d1d0c456
refs/heads/master
2023-01-08T23:42:41.469960
2020-11-03T05:46:25
2020-11-03T05:46:25
286,763,768
0
0
null
2020-08-11T14:19:04
2020-08-11T14:19:03
null
UTF-8
C++
false
false
447
cpp
class Solution { public: int leastInterval(vector<char>& tasks, int n) { int len = tasks.size(); vector<int> nums(26, 0); for (auto task : tasks) { nums[task - 'A']++; } sort(nums.begin(), nums.end(), [](int &x, int &y) {return x > y;}); int cnt = 1; while (cnt < nums.size() && nums[cnt] == nums[0]) cnt++; return max(len, (n + 1) * (nums[0] - 1) + cnt); } };
7ec445145c56c9f8fb848e6e4e8143108f920447
271b55b1c899ae3d3e91ae95e2b71aebc1e270d7
/src/main.cpp
8829fba4921f5faf4c8aab3c08049ba73589fbea
[]
no_license
mafian89/SNT-Projekt-2014
71049bead0313984053ad8f0d5c6363d1e3aea08
9b710e7b8e3a051139ad35ef16181e8dbbe06b0c
refs/heads/master
2016-09-05T21:41:48.768951
2014-06-20T11:57:22
2014-06-20T11:57:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
14,087
cpp
#include "common.h" struct mySortFuncDistFromDepotDown { bool operator()(const tCustomer& a, const tCustomer& b) const { return a.distanceFromDepot > b.distanceFromDepot; } } distance_sort_down; struct mySortFuncDistFromDepotUp { bool operator()(const tCustomer& a, const tCustomer& b) const { return a.distanceFromDepot < b.distanceFromDepot; } } distance_sort_up; struct mySortFuncSavings { bool operator()(const tVertexPair & a, const tVertexPair & b) const { return a.savings > b.savings; } } saving_sort_dec; double distance(tNode from, tNode to) { return sqrt(pow((to.x - from.x), 2) + pow((to.y - from.y), 2)); } int processFile(char * name, std::vector<tCustomer> &customers, tDepot &dep) { std::ifstream f(name); tCustomer tmp; std::string line; tNode depCoords,custCoords; if (f.is_open()) { while (std::getline(f, line)) { std::istringstream buffer(line); int stop, ot1, ct1, ot2, ct2, st; buffer >> stop; if (stop == 0) { dep.id = stop; buffer >> dep.coords.x; //x buffer >> dep.coords.y; //y depCoords.x = dep.coords.x; depCoords.y = dep.coords.y; } else { tmp.id = stop; buffer >> tmp.coords.x; //x buffer >> tmp.coords.y; //y custCoords.x = tmp.coords.x; custCoords.y = tmp.coords.y; } buffer >> ot1; buffer >> ct1; buffer >> ot2; buffer >> ct2; //demand buffer >> tmp.demand; buffer >> st; //type of service buffer >> tmp.typeOfService; tmp.parent = NULL; if (stop != 0) { tmp.distanceFromDepot = distance(depCoords,custCoords); customers.push_back(tmp); } } f.close(); } else { std::cerr << "Cannot open file: " << name << std::endl; return -1; } return 0; } void printStructures(std::vector<tCustomer> &customers, tDepot &dep) { std::cout <<dep.id<<" "<< dep.coords.x << " " << dep.coords.y << std::endl; for (unsigned i = 0; i < customers.size(); i++) { std::cout << customers[i].id<< " " <<customers[i].coords.x << " " << customers[i].coords.y << " " << customers[i].demand << " " << customers[i].typeOfService << " " << customers[i].distanceFromDepot << std::endl; } } void geometricalCenter(tCluster &c) { int sumX = 0; int sumY = 0; for (unsigned i = 0; i < c.members.size(); i++) { sumX += c.members[i].coords.x; sumY += c.members[i].coords.y; } c.gc.x = sumX / c.members.size(); c.gc.y = sumY / c.members.size(); //c.gc.y = } tCustomer closestNode(tNode from, std::vector<tCustomer> &ref) { tCustomer tmp; double minDist = 9999999.0; int indexMax = 0; for (unsigned i = 0; i < ref.size(); i++) { ref[i].distanceFromGC = distance(from, ref[i].coords); //std::cout << "[" << ref[i].coords.x << ", " << ref[i].coords.y << "] distance: " << ref[i].distanceFromGC << " "; if (ref[i].distanceFromGC < minDist) { minDist = ref[i].distanceFromGC; indexMax = i; } } //std::cout << std::endl; //std::cout << "GC = [" << from.x << ", " << from.y << "] -> "; //std::cout << "[" << ref[indexMax].coords.x << ", " << ref[indexMax].coords.y << "] distance: " << ref[indexMax].distanceFromGC << "\n"; /*std::cout << indexMax << " size: " << ref.size() << "\n";*/ tmp = ref[indexMax]; ref.erase(ref.begin() + indexMax); return tmp; } double computeSavings(tCustomer *i, tCustomer *j,tDepot dep) { //tVertexPair pair; double a = distance(i->coords,dep.coords); double b = distance(dep.coords, j->coords); double c = distance(i->coords, j->coords); //pair.from = i; //pair.to = j; //pair.from->degree = 0; //pair.to->degree = 0; //pair.from->parent->coords = dep.coords; //pair.to->parent->coords = dep.coords; //std::cout << i->demand << " " << j->demand << std::endl; /*pair.savings = a + b - c;*/ return (a + b - c); //return pair; } bool cycleDetected(tCustomer *from, tCustomer *to, tDepot dep) { tCustomer *current = from; //std::cout << "from: " << from << " to: " << to << "\n"; //while ((current->parent->coords.x != dep.coords.x) && (current->parent->coords.y != dep.coords.y)) { //int i = 0; while ((current->parent != NULL) && (current != current->parent)) { //std::cout << "current->parent: " <<current->parent << "\n"; if (current->parent == to) { return true; } //if ((current->parent->coords.x == to->parent->coords.x) && (current->parent->coords.y == to->parent->coords.y)) //{ // return true; //} current = current->parent; //i++; //if (i > 5) { // break; //} } return false; } //the Clarke-Wright heuristic void ClarkeWright(tCluster *cluster, tDepot dep, direction dir) { //std::cout << "Tu som\n"; //1. Identify a hub vertex h //2. VH = V - {h} tNode hub = dep.coords; //Should i compute starting cost here? //Starting cost std::vector<tVertexPair> sortlist; unsigned size = cluster->members.size(); for (unsigned i = 0; i < size; i++) { for (unsigned j = 0; j < size; j++) { if (j == i) { // j <= i continue; } tVertexPair tmp; tmp.savings = computeSavings(&cluster->members[i], &cluster->members[j], dep); tmp.from = &cluster->members[i]; tmp.to = &cluster->members[j]; tmp.from->degree = 0; tmp.to->degree = 0; //std::cout << "[" <<tmp.from->coords.x << ", " << tmp.from->coords.y << "]->"; //std::cout << "[" << tmp.to->coords.x << ", " << tmp.to->coords.y << "]\n"; sortlist.push_back(tmp); } } std::sort(sortlist.begin(),sortlist.end(),saving_sort_dec); //for (unsigned i = 0; i < sortlist.size(); i++) //{ // std::cout << i << ": " << sortlist[i].savings << "\n"; //} unsigned i = 0; tCustomer * actual_node = sortlist.front().to; sortlist.erase(sortlist.begin()); tCustomer *depot = new tCustomer; depot->coords = dep.coords; depot->parent = NULL; depot->demand = 0; //depot only depot->typeOfService = -1;//depot only tVertexPair start; start.from = depot; start.to = actual_node; cluster->route.push_back(start); while (size > 2) { //try vertex pair(i, j) in sortlist order //if (i < sortlist.size()) { for (i = 0; i < sortlist.size(); i++) { tVertexPair pair = sortlist[i]; if (pair.from == actual_node) { sortlist.erase(sortlist.begin() + i); if (!cycleDetected(pair.from, pair.to, dep)) { //std::cout << "!detected\n"; pair.from->degree += 1; pair.to->degree += 1; double cost = distance(pair.from->coords, pair.to->coords); //std::cout << "Add: [" << pair.from->coords.x << ", " << pair.from->coords.y << "]->"; //std::cout << "[" << pair.to->coords.x << ", " << pair.to->coords.y << "] cost: "<<cost<<"\n"; cluster->cost += cost; cluster->route.push_back(pair); //pair.from->parent->coords = dep.coords; //pair.to->parent->coords = pair.from->coords; pair.to->parent = pair.from; if (pair.from->degree == 2) { //std::cout << size << " pair.from->degree == 2\n"; size--; } if (pair.to->degree == 2){ //std::cout << size << " pair.to->degree == 2\n"; size--; } actual_node = pair.to; break; //break for } } } //std::cout << "Kontrola i++\n"; } if (!cluster->route.empty()) { tVertexPair end; end.to = depot; end.from = cluster->route.back().to; double cost = distance(end.from->coords, end.to->coords); //std::cout << "Add: [" << end.from->coords.x << ", " << end.from->coords.y << "]->"; //std::cout << "[" << end.to->coords.x << ", " << end.to->coords.y << "] cost: "<<cost<<"\n"; cluster->cost += cost; cost = distance(start.from->coords, start.to->coords); //std::cout << "Add: [" << start.from->coords.x << ", " << start.from->coords.y << "]->"; //std::cout << "[" << start.to->coords.x << ", " << start.to->coords.y << "] cost: " << cost << "\n"; cluster->cost += cost; cluster->route.push_back(end); //tVertexPair *current = &end; //tVertexPair *first = &start; //std::cout << cluster->route.size() << std::endl; //std::cout << "---------------\nBackward:\n"; //for (int i = cluster->route.size()-1; i >= 0; i--) //{ // tVertexPair *current = &cluster->route[i]; // std::cout << "[" << current->to->coords.x << ", " << current->to->coords.y << "]"; // std::cout << "->[" << current->from->coords.x << ", " << current->from->coords.y << "]\n"; //} //std::cout << "---------------\nFoward:\n"; //for (int i = 0; i < cluster->route.size(); i++) //{ // tVertexPair *current = &cluster->route[i]; // std::cout << "[" << current->from->coords.x << ", " << current->from->coords.y << "]"; // std::cout << "->[" << current->to->coords.x << ", " << current->to->coords.y << "]\n"; //} //std::cout << "---------------\n"; } } std::vector<tCluster> makeClusters(std::vector<tCustomer> customers, int capacity) { std::vector<tCluster> result; tCluster clust; tCustomer accCust; int id = 1; int Q = capacity; while (!customers.empty()){ accCust = customers.back(); customers.pop_back(); clust.id = id; clust.c_Delivery = Q; clust.c_Pickup = Q; clust.members.push_back(accCust); //0 - delivery, 1-pickup if (accCust.typeOfService == 0) { clust.c_Delivery -= accCust.demand; //std::cout <<"c_Delivery: " << clust.c_Delivery << "\n"; } else { clust.c_Pickup -= accCust.demand; //std::cout << "c_Pickup: "<<clust.c_Pickup << "\n"; } geometricalCenter(clust); if (!customers.empty()) { accCust = closestNode(clust.gc, customers); } while (1){ clust.members.push_back(accCust); geometricalCenter(clust); if ((accCust.typeOfService == 0)) { if ((clust.c_Delivery - accCust.demand) > 0) { clust.c_Delivery -= accCust.demand; } else { break; } } else { if ((clust.c_Pickup - accCust.demand) > 0) { clust.c_Pickup -= accCust.demand; } else { break; } } if (!customers.empty()) { accCust = closestNode(clust.gc, customers); } } //std::cout << customers.size() << "\n"; id++; result.push_back(clust); clust.members.clear(); } return result; } bool isLoadFeasibilityViolated(int ToS, int demand, int Q, int capacity) { if (ToS == 1 && ((Q + demand) <= capacity)) { //Q += demand; return false; } else if (ToS == 0 && ((Q - demand) >= 0)) { //Q -= demand; return false; } return true; } bool checkSumOfDemands(std::vector<tCustomer> * skippedList, int Q, int capacity) { int sumPickUp = 0; int sumDelivery = 0; for (unsigned i = 0; i < skippedList->size(); i++) { tCustomer * node = &(*skippedList)[i]; //0 - delivery, 1-pickup if (node->typeOfService == 0) { sumDelivery += node->demand; } else { sumPickUp += node->demand; } } if (Q + sumPickUp <= capacity && Q - sumDelivery >= 0) { return true; } return false; } void makeLink(std::vector<tVertexPair> * path, tCustomer * from, tCustomer * to) { tVertexPair * pair = new tVertexPair; pair->from = from; pair->to = to; //Savings mean distance (cost) :D :-/ >:-/ :-O pair->savings = distance(from->coords, to->coords); path->push_back(*pair); } void step2(std::vector<tCluster>& cluster, tDepot dep, int capacity) { double cost = 0.0; int Q = 100; std::vector<tCustomer> skippedList; std::vector<tVertexPair> path; for (unsigned i = 0; i < cluster.size(); i++) { ClarkeWright(&cluster[i], dep, CLOCKWISE); Q = 100; //std::cout<< "Cluster cost: " <<cluster[i].cost <<std::endl; //cost += cluster[i].cost; //1 = skip depo if (cluster[i].route.size() > 0){ tCustomer * current = cluster[i].route.front().from; for (unsigned j = 0; j < cluster[i].route.size(); j++) { tVertexPair * pair = &cluster[i].route[j]; //0 - delivery, 1-pickup int ToS = pair->to->typeOfService; if (isLoadFeasibilityViolated(ToS, pair->to->demand, Q, capacity)) { skippedList.push_back(*pair->to); } else { if (checkSumOfDemands(&skippedList, Q, capacity)) { for (unsigned j = 0; j < skippedList.size(); j++) { makeLink(&path, current, &skippedList[j]); current = &skippedList[j]; } skippedList.clear(); } else { Q = ToS > 0 ? Q += pair->to->demand : Q -= pair->to->demand; } makeLink(&path, current, pair->to); current = pair->to; } //std::cout << j << " to demand: " << curr->to->demand << " & "; //std::cout << j << ": "<< curr->from->demand << std::endl; //std::cout << "[" << curr->from->coords.x << ", " << curr->from->coords.y << "]"; //std::cout << "->[" << curr->to->coords.x << ", " << curr->to->coords.y << "]\n"; } } } tCustomer * depot = new tCustomer; depot->coords = dep.coords; depot->parent = NULL; depot->typeOfService = -1; depot->demand = 0; tCustomer * from = depot; Q = 100; while (!skippedList.empty()) { tCustomer current = skippedList.front(); skippedList.erase(skippedList.begin()); if (isLoadFeasibilityViolated(current.typeOfService, current.demand, Q, capacity)){ makeLink(&path, from, depot); Q = 100; makeLink(&path, depot, &current); } else { makeLink(&path, from, &current); } Q = current.typeOfService > 0 ? Q += current.demand : Q -= current.demand; from = &current; } for (unsigned i = 0; i < path.size(); i++) { cost += path[i].savings; } std::cout << cost << std::endl; std::cout << skippedList.size() << "\n"; //std::cout << "Total cost: "<< cost << std::endl; //ClarkeWright(cluster[0], dep, CLOCKWISE); } int main(int argc, char ** argv) { std::vector<tCustomer> customers; tDepot dep; std::vector<tCluster> clusters; if (argc < 2){ std::cerr << "Need filename!\n"; } if (processFile(argv[1], customers, dep) < 0){ return EXIT_FAILURE; } /*std::cout << customers.size()<<"\n";*/ //printStructures(customers, dep); std::sort(customers.begin(),customers.end(),distance_sort_up); //printStructures(customers, dep); clusters = makeClusters(customers,100); step2(clusters, dep, 100); //for (unsigned i = 0; i < clusters.size(); i++) //{ // std::cout << clusters[i].id <<" "<< clusters[i].members.size() << "\n"; //} return EXIT_SUCCESS; }
44d40e6d6fa8421c891088b59acaa18132902961
e8223e80fa0a039f1cdcc8cd1aa9cb48a7b1da45
/SOUI/src/control/SListbox.cpp
fbce6fdd2af5fbfc60dc8657f35ea9aee1f0a6b3
[ "MIT" ]
permissive
sz21/soui
99ab42e85b764fdb520eafe20b2721a077c2e7ca
370bb67b3e5d1c7c1be54cc3d24bfb3fbeb3fbe3
refs/heads/master
2021-07-04T02:36:27.159079
2017-09-25T14:51:05
2017-09-25T14:51:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
14,134
cpp
////////////////////////////////////////////////////////////////////////// // Class Name: SListBox // Description: A DuiWindow Based ListBox Control. // Creator: JinHui // Version: 2012.12.18 - 1.0 - Create ////////////////////////////////////////////////////////////////////////// #pragma once #include "souistd.h" #include "control/Slistbox.h" #include "SApp.h" #include "helper/mybuffer.h" #pragma warning(disable:4018) #pragma warning(disable:4267) namespace SOUI { SListBox::SListBox() : m_nItemHei(20) , m_iSelItem(-1) , m_iHoverItem(-1) , m_crItemBg(CR_INVALID) , m_crItemBg2(CR_INVALID) , m_crItemSelBg(RGBA(57,145,209,255)) , m_crItemHotBg(RGBA(57,145,209,128)) , m_crText(CR_INVALID) , m_crSelText(CR_INVALID) , m_pItemSkin(NULL) , m_pIconSkin(NULL) , m_ptIcon(-1,-1) , m_ptText(-1,-1) , m_bHotTrack(FALSE) { m_bFocusable = TRUE; m_evtSet.addEvent(EVENTID(EventLBSelChanging)); m_evtSet.addEvent(EVENTID(EventLBSelChanged)); m_evtSet.addEvent(EVENTID(EventLBDbClick)); } SListBox::~SListBox() { } int SListBox::GetCount() const { return m_arrItems.GetCount(); } int SListBox::GetCurSel() const { return m_iSelItem; } BOOL SListBox::SetCurSel(int nIndex) { if(nIndex >= GetCount()) return FALSE; if(nIndex < 0 ) nIndex =-1; if(m_iSelItem == nIndex) return 0; int nOldSelItem = m_iSelItem; m_iSelItem = nIndex; if(IsVisible(TRUE)) { if(nOldSelItem != -1) RedrawItem(nOldSelItem); if(m_iSelItem!=-1) RedrawItem(m_iSelItem); } return TRUE; } int SListBox::GetTopIndex() const { return m_ptOrigin.y / m_nItemHei; } BOOL SListBox::SetTopIndex(int nIndex) { if (nIndex < 0 || nIndex >= GetCount()) return FALSE; OnScroll(TRUE,SB_THUMBPOSITION, nIndex*m_nItemHei); return TRUE; } LPARAM SListBox::GetItemData(int nIndex) const { if (nIndex < 0 || nIndex >= GetCount()) return 0; return m_arrItems[nIndex]->lParam; } BOOL SListBox::SetItemData(int nIndex, LPARAM lParam) { if (nIndex < 0 || nIndex >= GetCount()) return FALSE; m_arrItems[nIndex]->lParam = lParam; return TRUE; } int SListBox::GetText(int nIndex, LPTSTR lpszBuffer) const { int nRet = GetTextLen(nIndex); if(nRet != LB_ERR) _tcscpy(lpszBuffer, m_arrItems[nIndex]->strText); return nRet; } int SListBox::GetText(int nIndex, SStringT& strText) const { int nRet = GetTextLen(nIndex); if(nRet != LB_ERR) strText = m_arrItems[nIndex]->strText; return nRet; } int SListBox::GetTextLen(int nIndex) const { if (nIndex < 0 || nIndex >= GetCount()) return LB_ERR; return m_arrItems[nIndex]->strText.GetLength(); } int SListBox::GetItemHeight(int nIndex) const { return m_nItemHei; } BOOL SListBox::SetItemHeight(int nIndex, int cyItemHeight) { if (cyItemHeight < 0 || nIndex < 0 || nIndex >= GetCount()) return FALSE; m_nItemHei = cyItemHeight; return TRUE; } void SListBox::DeleteAll() { for(int i=0; i < GetCount(); i++) { if (m_arrItems[i]) delete m_arrItems[i]; } m_arrItems.RemoveAll(); m_iSelItem=-1; m_iHoverItem=-1; SetViewSize(CSize(0,0)); Invalidate(); } BOOL SListBox::DeleteString(int nIndex) { if(nIndex<0 || nIndex>=GetCount()) return FALSE; if (m_arrItems[nIndex]) delete m_arrItems[nIndex]; m_arrItems.RemoveAt(nIndex); if(m_iSelItem==nIndex) m_iSelItem=-1; else if(m_iSelItem>nIndex) m_iSelItem--; if(m_iHoverItem==nIndex) m_iHoverItem=-1; else if(m_iHoverItem>nIndex) m_iHoverItem--; CRect rcClient; SWindow::GetClientRect(&rcClient); CSize szView(rcClient.Width(),GetCount()*m_nItemHei); if(szView.cy>rcClient.Height()) szView.cx-=GetSbWidth(); SetViewSize(szView); return TRUE; } int SListBox::AddString(LPCTSTR lpszItem, int nImage, LPARAM lParam) { return InsertString(-1, lpszItem, nImage, lParam); } int SListBox::InsertString(int nIndex, LPCTSTR lpszItem, int nImage, LPARAM lParam) { //SASSERT(lpszItem); LPLBITEM pItem = new LBITEM; pItem->strText = lpszItem; pItem->nImage = nImage; pItem->lParam = lParam; return InsertItem(nIndex, pItem); } void SListBox::EnsureVisible(int nIndex) { if(nIndex < 0 || nIndex >= GetCount()) return; CRect rcClient; GetClientRect(&rcClient); int iFirstVisible = (m_ptOrigin.y + m_nItemHei -1) / m_nItemHei; int nVisibleItems = rcClient.Height() / m_nItemHei; if(nIndex < iFirstVisible || nIndex > iFirstVisible+nVisibleItems-1) { int nOffset = GetScrollPos(TRUE); if(nIndex < iFirstVisible) nOffset = (nIndex-iFirstVisible)*m_nItemHei; else nOffset=(nIndex - iFirstVisible-nVisibleItems +1)*m_nItemHei; nOffset-=nOffset%m_nItemHei;//让当前行刚好显示 OnScroll(TRUE,SB_THUMBPOSITION,nOffset + GetScrollPos(TRUE)); } } //自动修改pt的位置为相对当前项的偏移量 int SListBox::HitTest(CPoint &pt) { CRect rcClient; GetClientRect(&rcClient); if(!rcClient.PtInRect(pt)) return -1; CPoint pt2=pt; pt2.y -= rcClient.top - m_ptOrigin.y; int nRet=pt2.y/m_nItemHei; if(nRet >= GetCount()) nRet=-1; else { pt.x-=rcClient.left; pt.y=pt2.y%m_nItemHei; } return nRet; } BOOL SListBox::CreateChildren(pugi::xml_node xmlNode) { if(!xmlNode) return TRUE; pugi::xml_node xmlItems=xmlNode.child(L"items"); if(xmlItems) { pugi::xml_node xmlItem= xmlItems.child(L"item"); while(xmlItem) { LPLBITEM pItemObj = new LBITEM; LoadItemAttribute(xmlItem, pItemObj); InsertItem(-1, pItemObj); xmlItem = xmlItem.next_sibling(); } } int nSelItem=xmlNode.attribute(L"curSel").as_int(-1); SetCurSel(nSelItem); return TRUE; } void SListBox::LoadItemAttribute(pugi::xml_node xmlNode, LPLBITEM pItem) { pItem->nImage=xmlNode.attribute(L"icon").as_int(pItem->nImage); pItem->lParam=xmlNode.attribute(L"data").as_uint(pItem->lParam); SStringW strText = tr(GETSTRING(xmlNode.attribute(L"text").value())); pItem->strText = S_CW2T(strText); } int SListBox::InsertItem(int nIndex, LPLBITEM pItem) { SASSERT(pItem); if(nIndex==-1 || nIndex>GetCount()) { nIndex = GetCount(); } m_arrItems.InsertAt(nIndex, pItem); if(m_iSelItem >= nIndex) m_iSelItem++; if(m_iHoverItem >= nIndex) m_iHoverItem++; CRect rcClient; SWindow::GetClientRect(&rcClient); CSize szView(rcClient.Width(),GetCount()*m_nItemHei); if(szView.cy>rcClient.Height()) szView.cx-=GetSbWidth(); SetViewSize(szView); return nIndex; } void SListBox::RedrawItem(int iItem) { if(!IsVisible(TRUE)) return; CRect rcClient; GetClientRect(&rcClient); int iFirstVisible = GetTopIndex(); int nPageItems=(rcClient.Height()+m_nItemHei-1)/m_nItemHei+1; if(iItem>=iFirstVisible && iItem<GetCount() && iItem<iFirstVisible+nPageItems) { CRect rcItem(0,0,rcClient.Width(),m_nItemHei); rcItem.OffsetRect(0,m_nItemHei*iItem-m_ptOrigin.y); rcItem.OffsetRect(rcClient.TopLeft()); IRenderTarget *pRT=GetRenderTarget(&rcItem,OLEDC_PAINTBKGND); SSendMessage(WM_ERASEBKGND,(WPARAM)(HDC)pRT); DrawItem(pRT,rcItem,iItem); ReleaseRenderTarget(pRT); } } void SListBox::DrawItem(IRenderTarget * pRT, CRect & rc, int iItem) { if (iItem < 0 || iItem >= GetCount()) return; BOOL bTextColorChanged = FALSE; int nBgImg = 0; COLORREF crOldText=RGBA(0xFF,0xFF,0xFF,0xFF); COLORREF crItemBg = m_crItemBg; COLORREF crText = m_crText; LPLBITEM pItem = m_arrItems[iItem]; CRect rcIcon, rcText; if (iItem % 2) { if (CR_INVALID != m_crItemBg2) crItemBg = m_crItemBg2; } if ( iItem == m_iSelItem) {//和下面那个if的条件分开,才会有sel和hot的区别 if (m_pItemSkin != NULL) nBgImg = 2; else if (CR_INVALID != m_crItemSelBg) crItemBg = m_crItemSelBg; if (CR_INVALID != m_crSelText) crText = m_crSelText; } else if ((iItem == m_iHoverItem || (m_iHoverItem==-1 && iItem== m_iSelItem)) && m_bHotTrack) { if (m_pItemSkin != NULL) nBgImg = 1; else if (CR_INVALID != m_crItemHotBg) crItemBg = m_crItemHotBg; if (CR_INVALID != m_crSelText) crText = m_crSelText; } if (CR_INVALID != crItemBg)//先画背景 pRT->FillSolidRect( rc, crItemBg); if (m_pItemSkin != NULL)//有skin,则覆盖背景 m_pItemSkin->Draw(pRT, rc, nBgImg); if (CR_INVALID != crText) { bTextColorChanged = TRUE; crOldText = pRT->SetTextColor(crText); } if (pItem->nImage != -1 && m_pIconSkin) { int nOffsetX =m_ptIcon.x, nOffsetY = m_ptIcon.y; CSize sizeSkin = m_pIconSkin->GetSkinSize(); rcIcon.SetRect(0, 0, sizeSkin.cx, sizeSkin.cy); if (m_ptIcon.x == -1) nOffsetX = m_nItemHei / 6; if (m_ptIcon.y == -1) nOffsetY = (m_nItemHei - sizeSkin.cy) / 2; //y 默认居中 rcIcon.OffsetRect(rc.left + nOffsetX, rc.top + nOffsetY); m_pIconSkin->Draw(pRT, rcIcon, pItem->nImage); } UINT align = DT_SINGLELINE; rcText = rc; if (m_ptText.x == -1) rcText.left = rcIcon.Width() > 0 ? rcIcon.right + m_nItemHei / 6 : rc.left; else rcText.left = rc.left + m_ptText.x; if (m_ptText.y == -1) align |= DT_VCENTER; else rcText.top = rc.top + m_ptText.y; pRT->DrawText(pItem->strText,-1,rcText,align); if (bTextColorChanged) pRT->SetTextColor(crOldText); } void SListBox::NotifySelChange( int nOldSel,int nNewSel) { EventLBSelChanging evt1(this); evt1.nOldSel=nOldSel; evt1.nNewSel=nNewSel; FireEvent(evt1); if(evt1.bCancel) return; m_iSelItem=nNewSel; if(nOldSel!=-1) RedrawItem(nOldSel); if(m_iSelItem!=-1) RedrawItem(m_iSelItem); EventLBSelChanged evt2(this); evt2.nOldSel=nOldSel; evt2.nNewSel=nNewSel; FireEvent(evt2); } void SListBox::OnPaint(IRenderTarget * pRT) { SPainter painter; BeforePaint(pRT,painter); int iFirstVisible = GetTopIndex(); int nPageItems = (m_rcClient.Height()+m_nItemHei-1)/m_nItemHei+1; for(int iItem = iFirstVisible; iItem<GetCount() && iItem <iFirstVisible+nPageItems; iItem++) { CRect rcItem(0,0,m_rcClient.Width(),m_nItemHei); rcItem.OffsetRect(0,m_nItemHei*iItem-m_ptOrigin.y); rcItem.OffsetRect(m_rcClient.TopLeft()); DrawItem(pRT,rcItem,iItem); } AfterPaint(pRT,painter); } void SListBox::OnSize(UINT nType,CSize size) { __super::OnSize(nType,size); CRect rcClient; SWindow::GetClientRect(&rcClient); CSize szView(rcClient.Width(),GetCount()*m_nItemHei); if(szView.cy>rcClient.Height()) szView.cx-=GetSbWidth(); SetViewSize(szView); } void SListBox::OnLButtonDown(UINT nFlags,CPoint pt) { SWindow::OnLButtonDown(nFlags,pt); if(!m_bHotTrack) { m_iHoverItem = HitTest(pt); if(m_iHoverItem!=m_iSelItem) NotifySelChange(m_iSelItem,m_iHoverItem); } } void SListBox::OnLButtonUp(UINT nFlags,CPoint pt) { if(m_bHotTrack) { m_iHoverItem = HitTest(pt); if(m_iHoverItem!=m_iSelItem) NotifySelChange(m_iSelItem,m_iHoverItem); } SWindow::OnLButtonUp(nFlags,pt); } void SListBox::OnLButtonDbClick(UINT nFlags,CPoint pt) { m_iHoverItem = HitTest(pt); if (m_iHoverItem != m_iSelItem) NotifySelChange(m_iSelItem, m_iHoverItem); EventLBDbClick evt2(this); evt2.nCurSel = m_iHoverItem; FireEvent(evt2); } void SListBox::OnMouseMove(UINT nFlags,CPoint pt) { int nOldHover=m_iHoverItem; m_iHoverItem = HitTest(pt); if(m_bHotTrack && nOldHover!=m_iHoverItem) { if(nOldHover!=-1) RedrawItem(nOldHover); if(m_iHoverItem!=-1) RedrawItem(m_iHoverItem); if(m_iSelItem!=-1) RedrawItem(m_iSelItem); } } void SListBox::OnKeyDown( TCHAR nChar, UINT nRepCnt, UINT nFlags ) { int nNewSelItem = -1; int iCurSel=m_iSelItem; if(m_bHotTrack && m_iHoverItem!=-1) iCurSel=m_iHoverItem; if (nChar == VK_DOWN && m_iSelItem < GetCount() - 1) nNewSelItem = iCurSel+1; else if (nChar == VK_UP && m_iSelItem > 0) nNewSelItem = iCurSel-1; if(nNewSelItem!=-1) { int iHover=m_iHoverItem; if(m_bHotTrack) m_iHoverItem=-1; EnsureVisible(nNewSelItem); NotifySelChange(m_iSelItem,nNewSelItem); if(iHover!=-1 && iHover != m_iSelItem && iHover != nNewSelItem) RedrawItem(iHover); } } void SListBox::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { SWindow *pOwner = GetOwner(); if (pOwner) pOwner->SSendMessage(WM_CHAR, nChar, MAKELONG(nFlags, nRepCnt)); } UINT SListBox::OnGetDlgCode() { return SC_WANTARROWS|SC_WANTCHARS; } void SListBox::OnDestroy() { DeleteAll(); __super::OnDestroy(); } void SListBox::OnShowWindow( BOOL bShow, UINT nStatus ) { if(!bShow) { m_iHoverItem=-1; } __super::OnShowWindow(bShow,nStatus); } void SListBox::OnMouseLeave() { __super::OnMouseLeave(); if(m_iHoverItem!=-1) { int nOldHover=m_iHoverItem; m_iHoverItem=-1; RedrawItem(nOldHover); } } }//namespace SOUI
1cd2c260f4543b5b69dcce3c723a4111e735fbd0
248768894f95465aad466f112166c32c9bc27cb7
/WiedzmakTheGame/MapObject.h
496b5df199745edf3d131277dafe116d151add76
[]
no_license
Sh1ftry/GameEngine
b8d77a563a30a5661723ccd52231b469d450eea6
4b4e47eaa7701afa481234482616234568d99256
refs/heads/master
2021-01-25T10:00:14.183281
2018-06-22T10:39:51
2018-06-22T10:39:51
123,332,989
0
0
null
null
null
null
UTF-8
C++
false
false
511
h
#pragma once #include <irrKlang/ik_ISoundEngine.h> /** * @brief Interface which represents every tile in a game, every square on a map is MapObject */ class MapObject { public: MapObject() = default; virtual bool is_passable() = 0; virtual bool interact() = 0; virtual bool on_pass(irrklang::ISoundEngine* soundEngine) = 0; virtual bool back() { return false; } virtual std::string description() { return "Hmph, nic ciekawego"; } virtual void next_line() {} virtual ~MapObject() = default; };
e297b521a96fe2ae8a19a69155b44b3622ea3284
53a742db596811a7e80789ad6651cdde4dfbedb9
/insert_sort.cpp
20f1543693e4c17bb83875b8b97e95f2281a405e
[]
no_license
hyfeng/hyf
a521976f978007ab2ec4862a1ec5e324f04d8267
a87bdffeb3835c77f5516c4e67743642d537de57
refs/heads/master
2016-09-06T08:47:25.076161
2015-04-09T14:26:51
2015-04-09T14:26:51
14,332,517
1
1
null
null
null
null
UTF-8
C++
false
false
492
cpp
#include <iostream> using namespace std; //the datatype T must implete operator < template<typename T> void insert_sort(T* array,int length){ T key; for(int j=1;j<length;++j){ key=array[j]; int i; for(i=j-1;i>=0;--i) if(key<array[i]) array[i+1]=array[i]; else break; array[i+1]=key; } } int main(){ int ad[5]={5,4,3,2,1}; for(int i=0;i<5;i++) cout<<ad[i]<<' '; cout<<endl; insert_sort(ad,5); for(int i=0;i<5;i++) cout<<ad[i]<<' '; cout<<endl; return 0; }
2fdf731eded1fac275e4dee987e1d0faa67dc617
ad273708d98b1f73b3855cc4317bca2e56456d15
/aws-cpp-sdk-robomaker/include/aws/robomaker/RoboMakerClient.h
799f8cc5c1fdc13a19da5616256a3395d773ee1d
[ "MIT", "Apache-2.0", "JSON" ]
permissive
novaquark/aws-sdk-cpp
b390f2e29f86f629f9efcf41c4990169b91f4f47
a0969508545bec9ae2864c9e1e2bb9aff109f90c
refs/heads/master
2022-08-28T18:28:12.742810
2020-05-27T15:46:18
2020-05-27T15:46:18
267,351,721
1
0
Apache-2.0
2020-05-27T15:08:16
2020-05-27T15:08:15
null
UTF-8
C++
false
false
102,099
h
/* * Copyright 2010-2017 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. */ #pragma once #include <aws/robomaker/RoboMaker_EXPORTS.h> #include <aws/robomaker/RoboMakerErrors.h> #include <aws/core/client/AWSError.h> #include <aws/core/client/ClientConfiguration.h> #include <aws/core/client/AWSClient.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/robomaker/model/BatchDescribeSimulationJobResult.h> #include <aws/robomaker/model/CancelDeploymentJobResult.h> #include <aws/robomaker/model/CancelSimulationJobResult.h> #include <aws/robomaker/model/CancelSimulationJobBatchResult.h> #include <aws/robomaker/model/CreateDeploymentJobResult.h> #include <aws/robomaker/model/CreateFleetResult.h> #include <aws/robomaker/model/CreateRobotResult.h> #include <aws/robomaker/model/CreateRobotApplicationResult.h> #include <aws/robomaker/model/CreateRobotApplicationVersionResult.h> #include <aws/robomaker/model/CreateSimulationApplicationResult.h> #include <aws/robomaker/model/CreateSimulationApplicationVersionResult.h> #include <aws/robomaker/model/CreateSimulationJobResult.h> #include <aws/robomaker/model/DeleteFleetResult.h> #include <aws/robomaker/model/DeleteRobotResult.h> #include <aws/robomaker/model/DeleteRobotApplicationResult.h> #include <aws/robomaker/model/DeleteSimulationApplicationResult.h> #include <aws/robomaker/model/DeregisterRobotResult.h> #include <aws/robomaker/model/DescribeDeploymentJobResult.h> #include <aws/robomaker/model/DescribeFleetResult.h> #include <aws/robomaker/model/DescribeRobotResult.h> #include <aws/robomaker/model/DescribeRobotApplicationResult.h> #include <aws/robomaker/model/DescribeSimulationApplicationResult.h> #include <aws/robomaker/model/DescribeSimulationJobResult.h> #include <aws/robomaker/model/DescribeSimulationJobBatchResult.h> #include <aws/robomaker/model/ListDeploymentJobsResult.h> #include <aws/robomaker/model/ListFleetsResult.h> #include <aws/robomaker/model/ListRobotApplicationsResult.h> #include <aws/robomaker/model/ListRobotsResult.h> #include <aws/robomaker/model/ListSimulationApplicationsResult.h> #include <aws/robomaker/model/ListSimulationJobBatchesResult.h> #include <aws/robomaker/model/ListSimulationJobsResult.h> #include <aws/robomaker/model/ListTagsForResourceResult.h> #include <aws/robomaker/model/RegisterRobotResult.h> #include <aws/robomaker/model/RestartSimulationJobResult.h> #include <aws/robomaker/model/StartSimulationJobBatchResult.h> #include <aws/robomaker/model/SyncDeploymentJobResult.h> #include <aws/robomaker/model/TagResourceResult.h> #include <aws/robomaker/model/UntagResourceResult.h> #include <aws/robomaker/model/UpdateRobotApplicationResult.h> #include <aws/robomaker/model/UpdateSimulationApplicationResult.h> #include <aws/core/client/AsyncCallerContext.h> #include <aws/core/http/HttpTypes.h> #include <future> #include <functional> namespace Aws { namespace Http { class HttpClient; class HttpClientFactory; } // namespace Http namespace Utils { template< typename R, typename E> class Outcome; namespace Threading { class Executor; } // namespace Threading } // namespace Utils namespace Auth { class AWSCredentials; class AWSCredentialsProvider; } // namespace Auth namespace Client { class RetryStrategy; } // namespace Client namespace RoboMaker { namespace Model { class BatchDescribeSimulationJobRequest; class CancelDeploymentJobRequest; class CancelSimulationJobRequest; class CancelSimulationJobBatchRequest; class CreateDeploymentJobRequest; class CreateFleetRequest; class CreateRobotRequest; class CreateRobotApplicationRequest; class CreateRobotApplicationVersionRequest; class CreateSimulationApplicationRequest; class CreateSimulationApplicationVersionRequest; class CreateSimulationJobRequest; class DeleteFleetRequest; class DeleteRobotRequest; class DeleteRobotApplicationRequest; class DeleteSimulationApplicationRequest; class DeregisterRobotRequest; class DescribeDeploymentJobRequest; class DescribeFleetRequest; class DescribeRobotRequest; class DescribeRobotApplicationRequest; class DescribeSimulationApplicationRequest; class DescribeSimulationJobRequest; class DescribeSimulationJobBatchRequest; class ListDeploymentJobsRequest; class ListFleetsRequest; class ListRobotApplicationsRequest; class ListRobotsRequest; class ListSimulationApplicationsRequest; class ListSimulationJobBatchesRequest; class ListSimulationJobsRequest; class ListTagsForResourceRequest; class RegisterRobotRequest; class RestartSimulationJobRequest; class StartSimulationJobBatchRequest; class SyncDeploymentJobRequest; class TagResourceRequest; class UntagResourceRequest; class UpdateRobotApplicationRequest; class UpdateSimulationApplicationRequest; typedef Aws::Utils::Outcome<BatchDescribeSimulationJobResult, Aws::Client::AWSError<RoboMakerErrors>> BatchDescribeSimulationJobOutcome; typedef Aws::Utils::Outcome<CancelDeploymentJobResult, Aws::Client::AWSError<RoboMakerErrors>> CancelDeploymentJobOutcome; typedef Aws::Utils::Outcome<CancelSimulationJobResult, Aws::Client::AWSError<RoboMakerErrors>> CancelSimulationJobOutcome; typedef Aws::Utils::Outcome<CancelSimulationJobBatchResult, Aws::Client::AWSError<RoboMakerErrors>> CancelSimulationJobBatchOutcome; typedef Aws::Utils::Outcome<CreateDeploymentJobResult, Aws::Client::AWSError<RoboMakerErrors>> CreateDeploymentJobOutcome; typedef Aws::Utils::Outcome<CreateFleetResult, Aws::Client::AWSError<RoboMakerErrors>> CreateFleetOutcome; typedef Aws::Utils::Outcome<CreateRobotResult, Aws::Client::AWSError<RoboMakerErrors>> CreateRobotOutcome; typedef Aws::Utils::Outcome<CreateRobotApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> CreateRobotApplicationOutcome; typedef Aws::Utils::Outcome<CreateRobotApplicationVersionResult, Aws::Client::AWSError<RoboMakerErrors>> CreateRobotApplicationVersionOutcome; typedef Aws::Utils::Outcome<CreateSimulationApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> CreateSimulationApplicationOutcome; typedef Aws::Utils::Outcome<CreateSimulationApplicationVersionResult, Aws::Client::AWSError<RoboMakerErrors>> CreateSimulationApplicationVersionOutcome; typedef Aws::Utils::Outcome<CreateSimulationJobResult, Aws::Client::AWSError<RoboMakerErrors>> CreateSimulationJobOutcome; typedef Aws::Utils::Outcome<DeleteFleetResult, Aws::Client::AWSError<RoboMakerErrors>> DeleteFleetOutcome; typedef Aws::Utils::Outcome<DeleteRobotResult, Aws::Client::AWSError<RoboMakerErrors>> DeleteRobotOutcome; typedef Aws::Utils::Outcome<DeleteRobotApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> DeleteRobotApplicationOutcome; typedef Aws::Utils::Outcome<DeleteSimulationApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> DeleteSimulationApplicationOutcome; typedef Aws::Utils::Outcome<DeregisterRobotResult, Aws::Client::AWSError<RoboMakerErrors>> DeregisterRobotOutcome; typedef Aws::Utils::Outcome<DescribeDeploymentJobResult, Aws::Client::AWSError<RoboMakerErrors>> DescribeDeploymentJobOutcome; typedef Aws::Utils::Outcome<DescribeFleetResult, Aws::Client::AWSError<RoboMakerErrors>> DescribeFleetOutcome; typedef Aws::Utils::Outcome<DescribeRobotResult, Aws::Client::AWSError<RoboMakerErrors>> DescribeRobotOutcome; typedef Aws::Utils::Outcome<DescribeRobotApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> DescribeRobotApplicationOutcome; typedef Aws::Utils::Outcome<DescribeSimulationApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> DescribeSimulationApplicationOutcome; typedef Aws::Utils::Outcome<DescribeSimulationJobResult, Aws::Client::AWSError<RoboMakerErrors>> DescribeSimulationJobOutcome; typedef Aws::Utils::Outcome<DescribeSimulationJobBatchResult, Aws::Client::AWSError<RoboMakerErrors>> DescribeSimulationJobBatchOutcome; typedef Aws::Utils::Outcome<ListDeploymentJobsResult, Aws::Client::AWSError<RoboMakerErrors>> ListDeploymentJobsOutcome; typedef Aws::Utils::Outcome<ListFleetsResult, Aws::Client::AWSError<RoboMakerErrors>> ListFleetsOutcome; typedef Aws::Utils::Outcome<ListRobotApplicationsResult, Aws::Client::AWSError<RoboMakerErrors>> ListRobotApplicationsOutcome; typedef Aws::Utils::Outcome<ListRobotsResult, Aws::Client::AWSError<RoboMakerErrors>> ListRobotsOutcome; typedef Aws::Utils::Outcome<ListSimulationApplicationsResult, Aws::Client::AWSError<RoboMakerErrors>> ListSimulationApplicationsOutcome; typedef Aws::Utils::Outcome<ListSimulationJobBatchesResult, Aws::Client::AWSError<RoboMakerErrors>> ListSimulationJobBatchesOutcome; typedef Aws::Utils::Outcome<ListSimulationJobsResult, Aws::Client::AWSError<RoboMakerErrors>> ListSimulationJobsOutcome; typedef Aws::Utils::Outcome<ListTagsForResourceResult, Aws::Client::AWSError<RoboMakerErrors>> ListTagsForResourceOutcome; typedef Aws::Utils::Outcome<RegisterRobotResult, Aws::Client::AWSError<RoboMakerErrors>> RegisterRobotOutcome; typedef Aws::Utils::Outcome<RestartSimulationJobResult, Aws::Client::AWSError<RoboMakerErrors>> RestartSimulationJobOutcome; typedef Aws::Utils::Outcome<StartSimulationJobBatchResult, Aws::Client::AWSError<RoboMakerErrors>> StartSimulationJobBatchOutcome; typedef Aws::Utils::Outcome<SyncDeploymentJobResult, Aws::Client::AWSError<RoboMakerErrors>> SyncDeploymentJobOutcome; typedef Aws::Utils::Outcome<TagResourceResult, Aws::Client::AWSError<RoboMakerErrors>> TagResourceOutcome; typedef Aws::Utils::Outcome<UntagResourceResult, Aws::Client::AWSError<RoboMakerErrors>> UntagResourceOutcome; typedef Aws::Utils::Outcome<UpdateRobotApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> UpdateRobotApplicationOutcome; typedef Aws::Utils::Outcome<UpdateSimulationApplicationResult, Aws::Client::AWSError<RoboMakerErrors>> UpdateSimulationApplicationOutcome; typedef std::future<BatchDescribeSimulationJobOutcome> BatchDescribeSimulationJobOutcomeCallable; typedef std::future<CancelDeploymentJobOutcome> CancelDeploymentJobOutcomeCallable; typedef std::future<CancelSimulationJobOutcome> CancelSimulationJobOutcomeCallable; typedef std::future<CancelSimulationJobBatchOutcome> CancelSimulationJobBatchOutcomeCallable; typedef std::future<CreateDeploymentJobOutcome> CreateDeploymentJobOutcomeCallable; typedef std::future<CreateFleetOutcome> CreateFleetOutcomeCallable; typedef std::future<CreateRobotOutcome> CreateRobotOutcomeCallable; typedef std::future<CreateRobotApplicationOutcome> CreateRobotApplicationOutcomeCallable; typedef std::future<CreateRobotApplicationVersionOutcome> CreateRobotApplicationVersionOutcomeCallable; typedef std::future<CreateSimulationApplicationOutcome> CreateSimulationApplicationOutcomeCallable; typedef std::future<CreateSimulationApplicationVersionOutcome> CreateSimulationApplicationVersionOutcomeCallable; typedef std::future<CreateSimulationJobOutcome> CreateSimulationJobOutcomeCallable; typedef std::future<DeleteFleetOutcome> DeleteFleetOutcomeCallable; typedef std::future<DeleteRobotOutcome> DeleteRobotOutcomeCallable; typedef std::future<DeleteRobotApplicationOutcome> DeleteRobotApplicationOutcomeCallable; typedef std::future<DeleteSimulationApplicationOutcome> DeleteSimulationApplicationOutcomeCallable; typedef std::future<DeregisterRobotOutcome> DeregisterRobotOutcomeCallable; typedef std::future<DescribeDeploymentJobOutcome> DescribeDeploymentJobOutcomeCallable; typedef std::future<DescribeFleetOutcome> DescribeFleetOutcomeCallable; typedef std::future<DescribeRobotOutcome> DescribeRobotOutcomeCallable; typedef std::future<DescribeRobotApplicationOutcome> DescribeRobotApplicationOutcomeCallable; typedef std::future<DescribeSimulationApplicationOutcome> DescribeSimulationApplicationOutcomeCallable; typedef std::future<DescribeSimulationJobOutcome> DescribeSimulationJobOutcomeCallable; typedef std::future<DescribeSimulationJobBatchOutcome> DescribeSimulationJobBatchOutcomeCallable; typedef std::future<ListDeploymentJobsOutcome> ListDeploymentJobsOutcomeCallable; typedef std::future<ListFleetsOutcome> ListFleetsOutcomeCallable; typedef std::future<ListRobotApplicationsOutcome> ListRobotApplicationsOutcomeCallable; typedef std::future<ListRobotsOutcome> ListRobotsOutcomeCallable; typedef std::future<ListSimulationApplicationsOutcome> ListSimulationApplicationsOutcomeCallable; typedef std::future<ListSimulationJobBatchesOutcome> ListSimulationJobBatchesOutcomeCallable; typedef std::future<ListSimulationJobsOutcome> ListSimulationJobsOutcomeCallable; typedef std::future<ListTagsForResourceOutcome> ListTagsForResourceOutcomeCallable; typedef std::future<RegisterRobotOutcome> RegisterRobotOutcomeCallable; typedef std::future<RestartSimulationJobOutcome> RestartSimulationJobOutcomeCallable; typedef std::future<StartSimulationJobBatchOutcome> StartSimulationJobBatchOutcomeCallable; typedef std::future<SyncDeploymentJobOutcome> SyncDeploymentJobOutcomeCallable; typedef std::future<TagResourceOutcome> TagResourceOutcomeCallable; typedef std::future<UntagResourceOutcome> UntagResourceOutcomeCallable; typedef std::future<UpdateRobotApplicationOutcome> UpdateRobotApplicationOutcomeCallable; typedef std::future<UpdateSimulationApplicationOutcome> UpdateSimulationApplicationOutcomeCallable; } // namespace Model class RoboMakerClient; typedef std::function<void(const RoboMakerClient*, const Model::BatchDescribeSimulationJobRequest&, const Model::BatchDescribeSimulationJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchDescribeSimulationJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CancelDeploymentJobRequest&, const Model::CancelDeploymentJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CancelDeploymentJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CancelSimulationJobRequest&, const Model::CancelSimulationJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CancelSimulationJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CancelSimulationJobBatchRequest&, const Model::CancelSimulationJobBatchOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CancelSimulationJobBatchResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateDeploymentJobRequest&, const Model::CreateDeploymentJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateDeploymentJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateFleetRequest&, const Model::CreateFleetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateFleetResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateRobotRequest&, const Model::CreateRobotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateRobotResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateRobotApplicationRequest&, const Model::CreateRobotApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateRobotApplicationResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateRobotApplicationVersionRequest&, const Model::CreateRobotApplicationVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateRobotApplicationVersionResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateSimulationApplicationRequest&, const Model::CreateSimulationApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateSimulationApplicationResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateSimulationApplicationVersionRequest&, const Model::CreateSimulationApplicationVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateSimulationApplicationVersionResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::CreateSimulationJobRequest&, const Model::CreateSimulationJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateSimulationJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DeleteFleetRequest&, const Model::DeleteFleetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteFleetResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DeleteRobotRequest&, const Model::DeleteRobotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteRobotResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DeleteRobotApplicationRequest&, const Model::DeleteRobotApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteRobotApplicationResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DeleteSimulationApplicationRequest&, const Model::DeleteSimulationApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteSimulationApplicationResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DeregisterRobotRequest&, const Model::DeregisterRobotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeregisterRobotResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DescribeDeploymentJobRequest&, const Model::DescribeDeploymentJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeDeploymentJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DescribeFleetRequest&, const Model::DescribeFleetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeFleetResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DescribeRobotRequest&, const Model::DescribeRobotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeRobotResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DescribeRobotApplicationRequest&, const Model::DescribeRobotApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeRobotApplicationResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DescribeSimulationApplicationRequest&, const Model::DescribeSimulationApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeSimulationApplicationResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DescribeSimulationJobRequest&, const Model::DescribeSimulationJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeSimulationJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::DescribeSimulationJobBatchRequest&, const Model::DescribeSimulationJobBatchOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeSimulationJobBatchResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListDeploymentJobsRequest&, const Model::ListDeploymentJobsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListDeploymentJobsResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListFleetsRequest&, const Model::ListFleetsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListFleetsResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListRobotApplicationsRequest&, const Model::ListRobotApplicationsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListRobotApplicationsResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListRobotsRequest&, const Model::ListRobotsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListRobotsResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListSimulationApplicationsRequest&, const Model::ListSimulationApplicationsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListSimulationApplicationsResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListSimulationJobBatchesRequest&, const Model::ListSimulationJobBatchesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListSimulationJobBatchesResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListSimulationJobsRequest&, const Model::ListSimulationJobsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListSimulationJobsResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::ListTagsForResourceRequest&, const Model::ListTagsForResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListTagsForResourceResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::RegisterRobotRequest&, const Model::RegisterRobotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > RegisterRobotResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::RestartSimulationJobRequest&, const Model::RestartSimulationJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > RestartSimulationJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::StartSimulationJobBatchRequest&, const Model::StartSimulationJobBatchOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartSimulationJobBatchResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::SyncDeploymentJobRequest&, const Model::SyncDeploymentJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > SyncDeploymentJobResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::TagResourceRequest&, const Model::TagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > TagResourceResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::UntagResourceRequest&, const Model::UntagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UntagResourceResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::UpdateRobotApplicationRequest&, const Model::UpdateRobotApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateRobotApplicationResponseReceivedHandler; typedef std::function<void(const RoboMakerClient*, const Model::UpdateSimulationApplicationRequest&, const Model::UpdateSimulationApplicationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateSimulationApplicationResponseReceivedHandler; /** * <p>This section provides documentation for the AWS RoboMaker API operations.</p> */ class AWS_ROBOMAKER_API RoboMakerClient : public Aws::Client::AWSJsonClient { public: typedef Aws::Client::AWSJsonClient BASECLASS; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ RoboMakerClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ RoboMakerClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ RoboMakerClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); virtual ~RoboMakerClient(); inline virtual const char* GetServiceClientName() const override { return "RoboMaker"; } /** * <p>Describes one or more simulation jobs.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/BatchDescribeSimulationJob">AWS * API Reference</a></p> */ virtual Model::BatchDescribeSimulationJobOutcome BatchDescribeSimulationJob(const Model::BatchDescribeSimulationJobRequest& request) const; /** * <p>Describes one or more simulation jobs.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/BatchDescribeSimulationJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::BatchDescribeSimulationJobOutcomeCallable BatchDescribeSimulationJobCallable(const Model::BatchDescribeSimulationJobRequest& request) const; /** * <p>Describes one or more simulation jobs.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/BatchDescribeSimulationJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void BatchDescribeSimulationJobAsync(const Model::BatchDescribeSimulationJobRequest& request, const BatchDescribeSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Cancels the specified deployment job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelDeploymentJob">AWS * API Reference</a></p> */ virtual Model::CancelDeploymentJobOutcome CancelDeploymentJob(const Model::CancelDeploymentJobRequest& request) const; /** * <p>Cancels the specified deployment job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelDeploymentJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CancelDeploymentJobOutcomeCallable CancelDeploymentJobCallable(const Model::CancelDeploymentJobRequest& request) const; /** * <p>Cancels the specified deployment job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelDeploymentJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CancelDeploymentJobAsync(const Model::CancelDeploymentJobRequest& request, const CancelDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Cancels the specified simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelSimulationJob">AWS * API Reference</a></p> */ virtual Model::CancelSimulationJobOutcome CancelSimulationJob(const Model::CancelSimulationJobRequest& request) const; /** * <p>Cancels the specified simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelSimulationJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CancelSimulationJobOutcomeCallable CancelSimulationJobCallable(const Model::CancelSimulationJobRequest& request) const; /** * <p>Cancels the specified simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelSimulationJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CancelSimulationJobAsync(const Model::CancelSimulationJobRequest& request, const CancelSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Cancels a simulation job batch. When you cancel a simulation job batch, you * are also cancelling all of the active simulation jobs created as part of the * batch. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelSimulationJobBatch">AWS * API Reference</a></p> */ virtual Model::CancelSimulationJobBatchOutcome CancelSimulationJobBatch(const Model::CancelSimulationJobBatchRequest& request) const; /** * <p>Cancels a simulation job batch. When you cancel a simulation job batch, you * are also cancelling all of the active simulation jobs created as part of the * batch. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelSimulationJobBatch">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CancelSimulationJobBatchOutcomeCallable CancelSimulationJobBatchCallable(const Model::CancelSimulationJobBatchRequest& request) const; /** * <p>Cancels a simulation job batch. When you cancel a simulation job batch, you * are also cancelling all of the active simulation jobs created as part of the * batch. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CancelSimulationJobBatch">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CancelSimulationJobBatchAsync(const Model::CancelSimulationJobBatchRequest& request, const CancelSimulationJobBatchResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deploys a specific version of a robot application to robots in a fleet.</p> * <p>The robot application must have a numbered <code>applicationVersion</code> * for consistency reasons. To create a new version, use * <code>CreateRobotApplicationVersion</code> or see <a * href="https://docs.aws.amazon.com/robomaker/latest/dg/create-robot-application-version.html">Creating * a Robot Application Version</a>. </p> <note> <p>After 90 days, deployment jobs * expire and will be deleted. They will no longer be accessible. </p> * </note><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateDeploymentJob">AWS * API Reference</a></p> */ virtual Model::CreateDeploymentJobOutcome CreateDeploymentJob(const Model::CreateDeploymentJobRequest& request) const; /** * <p>Deploys a specific version of a robot application to robots in a fleet.</p> * <p>The robot application must have a numbered <code>applicationVersion</code> * for consistency reasons. To create a new version, use * <code>CreateRobotApplicationVersion</code> or see <a * href="https://docs.aws.amazon.com/robomaker/latest/dg/create-robot-application-version.html">Creating * a Robot Application Version</a>. </p> <note> <p>After 90 days, deployment jobs * expire and will be deleted. They will no longer be accessible. </p> * </note><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateDeploymentJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateDeploymentJobOutcomeCallable CreateDeploymentJobCallable(const Model::CreateDeploymentJobRequest& request) const; /** * <p>Deploys a specific version of a robot application to robots in a fleet.</p> * <p>The robot application must have a numbered <code>applicationVersion</code> * for consistency reasons. To create a new version, use * <code>CreateRobotApplicationVersion</code> or see <a * href="https://docs.aws.amazon.com/robomaker/latest/dg/create-robot-application-version.html">Creating * a Robot Application Version</a>. </p> <note> <p>After 90 days, deployment jobs * expire and will be deleted. They will no longer be accessible. </p> * </note><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateDeploymentJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateDeploymentJobAsync(const Model::CreateDeploymentJobRequest& request, const CreateDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a fleet, a logical group of robots running the same robot * application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateFleet">AWS * API Reference</a></p> */ virtual Model::CreateFleetOutcome CreateFleet(const Model::CreateFleetRequest& request) const; /** * <p>Creates a fleet, a logical group of robots running the same robot * application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateFleet">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateFleetOutcomeCallable CreateFleetCallable(const Model::CreateFleetRequest& request) const; /** * <p>Creates a fleet, a logical group of robots running the same robot * application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateFleet">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateFleetAsync(const Model::CreateFleetRequest& request, const CreateFleetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobot">AWS * API Reference</a></p> */ virtual Model::CreateRobotOutcome CreateRobot(const Model::CreateRobotRequest& request) const; /** * <p>Creates a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateRobotOutcomeCallable CreateRobotCallable(const Model::CreateRobotRequest& request) const; /** * <p>Creates a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateRobotAsync(const Model::CreateRobotRequest& request, const CreateRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a robot application. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobotApplication">AWS * API Reference</a></p> */ virtual Model::CreateRobotApplicationOutcome CreateRobotApplication(const Model::CreateRobotApplicationRequest& request) const; /** * <p>Creates a robot application. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobotApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateRobotApplicationOutcomeCallable CreateRobotApplicationCallable(const Model::CreateRobotApplicationRequest& request) const; /** * <p>Creates a robot application. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobotApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateRobotApplicationAsync(const Model::CreateRobotApplicationRequest& request, const CreateRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a version of a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobotApplicationVersion">AWS * API Reference</a></p> */ virtual Model::CreateRobotApplicationVersionOutcome CreateRobotApplicationVersion(const Model::CreateRobotApplicationVersionRequest& request) const; /** * <p>Creates a version of a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobotApplicationVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateRobotApplicationVersionOutcomeCallable CreateRobotApplicationVersionCallable(const Model::CreateRobotApplicationVersionRequest& request) const; /** * <p>Creates a version of a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateRobotApplicationVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateRobotApplicationVersionAsync(const Model::CreateRobotApplicationVersionRequest& request, const CreateRobotApplicationVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationApplication">AWS * API Reference</a></p> */ virtual Model::CreateSimulationApplicationOutcome CreateSimulationApplication(const Model::CreateSimulationApplicationRequest& request) const; /** * <p>Creates a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateSimulationApplicationOutcomeCallable CreateSimulationApplicationCallable(const Model::CreateSimulationApplicationRequest& request) const; /** * <p>Creates a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateSimulationApplicationAsync(const Model::CreateSimulationApplicationRequest& request, const CreateSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a simulation application with a specific revision id.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationApplicationVersion">AWS * API Reference</a></p> */ virtual Model::CreateSimulationApplicationVersionOutcome CreateSimulationApplicationVersion(const Model::CreateSimulationApplicationVersionRequest& request) const; /** * <p>Creates a simulation application with a specific revision id.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationApplicationVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateSimulationApplicationVersionOutcomeCallable CreateSimulationApplicationVersionCallable(const Model::CreateSimulationApplicationVersionRequest& request) const; /** * <p>Creates a simulation application with a specific revision id.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationApplicationVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateSimulationApplicationVersionAsync(const Model::CreateSimulationApplicationVersionRequest& request, const CreateSimulationApplicationVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a simulation job.</p> <note> <p>After 90 days, simulation jobs expire * and will be deleted. They will no longer be accessible. </p> </note><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationJob">AWS * API Reference</a></p> */ virtual Model::CreateSimulationJobOutcome CreateSimulationJob(const Model::CreateSimulationJobRequest& request) const; /** * <p>Creates a simulation job.</p> <note> <p>After 90 days, simulation jobs expire * and will be deleted. They will no longer be accessible. </p> </note><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateSimulationJobOutcomeCallable CreateSimulationJobCallable(const Model::CreateSimulationJobRequest& request) const; /** * <p>Creates a simulation job.</p> <note> <p>After 90 days, simulation jobs expire * and will be deleted. They will no longer be accessible. </p> </note><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/CreateSimulationJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateSimulationJobAsync(const Model::CreateSimulationJobRequest& request, const CreateSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteFleet">AWS * API Reference</a></p> */ virtual Model::DeleteFleetOutcome DeleteFleet(const Model::DeleteFleetRequest& request) const; /** * <p>Deletes a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteFleet">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteFleetOutcomeCallable DeleteFleetCallable(const Model::DeleteFleetRequest& request) const; /** * <p>Deletes a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteFleet">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteFleetAsync(const Model::DeleteFleetRequest& request, const DeleteFleetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteRobot">AWS * API Reference</a></p> */ virtual Model::DeleteRobotOutcome DeleteRobot(const Model::DeleteRobotRequest& request) const; /** * <p>Deletes a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteRobot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteRobotOutcomeCallable DeleteRobotCallable(const Model::DeleteRobotRequest& request) const; /** * <p>Deletes a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteRobot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteRobotAsync(const Model::DeleteRobotRequest& request, const DeleteRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteRobotApplication">AWS * API Reference</a></p> */ virtual Model::DeleteRobotApplicationOutcome DeleteRobotApplication(const Model::DeleteRobotApplicationRequest& request) const; /** * <p>Deletes a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteRobotApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteRobotApplicationOutcomeCallable DeleteRobotApplicationCallable(const Model::DeleteRobotApplicationRequest& request) const; /** * <p>Deletes a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteRobotApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteRobotApplicationAsync(const Model::DeleteRobotApplicationRequest& request, const DeleteRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteSimulationApplication">AWS * API Reference</a></p> */ virtual Model::DeleteSimulationApplicationOutcome DeleteSimulationApplication(const Model::DeleteSimulationApplicationRequest& request) const; /** * <p>Deletes a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteSimulationApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteSimulationApplicationOutcomeCallable DeleteSimulationApplicationCallable(const Model::DeleteSimulationApplicationRequest& request) const; /** * <p>Deletes a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeleteSimulationApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteSimulationApplicationAsync(const Model::DeleteSimulationApplicationRequest& request, const DeleteSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deregisters a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeregisterRobot">AWS * API Reference</a></p> */ virtual Model::DeregisterRobotOutcome DeregisterRobot(const Model::DeregisterRobotRequest& request) const; /** * <p>Deregisters a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeregisterRobot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeregisterRobotOutcomeCallable DeregisterRobotCallable(const Model::DeregisterRobotRequest& request) const; /** * <p>Deregisters a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DeregisterRobot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeregisterRobotAsync(const Model::DeregisterRobotRequest& request, const DeregisterRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Describes a deployment job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeDeploymentJob">AWS * API Reference</a></p> */ virtual Model::DescribeDeploymentJobOutcome DescribeDeploymentJob(const Model::DescribeDeploymentJobRequest& request) const; /** * <p>Describes a deployment job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeDeploymentJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeDeploymentJobOutcomeCallable DescribeDeploymentJobCallable(const Model::DescribeDeploymentJobRequest& request) const; /** * <p>Describes a deployment job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeDeploymentJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeDeploymentJobAsync(const Model::DescribeDeploymentJobRequest& request, const DescribeDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Describes a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeFleet">AWS * API Reference</a></p> */ virtual Model::DescribeFleetOutcome DescribeFleet(const Model::DescribeFleetRequest& request) const; /** * <p>Describes a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeFleet">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeFleetOutcomeCallable DescribeFleetCallable(const Model::DescribeFleetRequest& request) const; /** * <p>Describes a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeFleet">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeFleetAsync(const Model::DescribeFleetRequest& request, const DescribeFleetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Describes a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeRobot">AWS * API Reference</a></p> */ virtual Model::DescribeRobotOutcome DescribeRobot(const Model::DescribeRobotRequest& request) const; /** * <p>Describes a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeRobot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeRobotOutcomeCallable DescribeRobotCallable(const Model::DescribeRobotRequest& request) const; /** * <p>Describes a robot.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeRobot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeRobotAsync(const Model::DescribeRobotRequest& request, const DescribeRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Describes a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeRobotApplication">AWS * API Reference</a></p> */ virtual Model::DescribeRobotApplicationOutcome DescribeRobotApplication(const Model::DescribeRobotApplicationRequest& request) const; /** * <p>Describes a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeRobotApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeRobotApplicationOutcomeCallable DescribeRobotApplicationCallable(const Model::DescribeRobotApplicationRequest& request) const; /** * <p>Describes a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeRobotApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeRobotApplicationAsync(const Model::DescribeRobotApplicationRequest& request, const DescribeRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Describes a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationApplication">AWS * API Reference</a></p> */ virtual Model::DescribeSimulationApplicationOutcome DescribeSimulationApplication(const Model::DescribeSimulationApplicationRequest& request) const; /** * <p>Describes a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeSimulationApplicationOutcomeCallable DescribeSimulationApplicationCallable(const Model::DescribeSimulationApplicationRequest& request) const; /** * <p>Describes a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeSimulationApplicationAsync(const Model::DescribeSimulationApplicationRequest& request, const DescribeSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Describes a simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationJob">AWS * API Reference</a></p> */ virtual Model::DescribeSimulationJobOutcome DescribeSimulationJob(const Model::DescribeSimulationJobRequest& request) const; /** * <p>Describes a simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeSimulationJobOutcomeCallable DescribeSimulationJobCallable(const Model::DescribeSimulationJobRequest& request) const; /** * <p>Describes a simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeSimulationJobAsync(const Model::DescribeSimulationJobRequest& request, const DescribeSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Describes a simulation job batch.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationJobBatch">AWS * API Reference</a></p> */ virtual Model::DescribeSimulationJobBatchOutcome DescribeSimulationJobBatch(const Model::DescribeSimulationJobBatchRequest& request) const; /** * <p>Describes a simulation job batch.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationJobBatch">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeSimulationJobBatchOutcomeCallable DescribeSimulationJobBatchCallable(const Model::DescribeSimulationJobBatchRequest& request) const; /** * <p>Describes a simulation job batch.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/DescribeSimulationJobBatch">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeSimulationJobBatchAsync(const Model::DescribeSimulationJobBatchRequest& request, const DescribeSimulationJobBatchResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list of deployment jobs for a fleet. You can optionally provide * filters to retrieve specific deployment jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListDeploymentJobs">AWS * API Reference</a></p> */ virtual Model::ListDeploymentJobsOutcome ListDeploymentJobs(const Model::ListDeploymentJobsRequest& request) const; /** * <p>Returns a list of deployment jobs for a fleet. You can optionally provide * filters to retrieve specific deployment jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListDeploymentJobs">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListDeploymentJobsOutcomeCallable ListDeploymentJobsCallable(const Model::ListDeploymentJobsRequest& request) const; /** * <p>Returns a list of deployment jobs for a fleet. You can optionally provide * filters to retrieve specific deployment jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListDeploymentJobs">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListDeploymentJobsAsync(const Model::ListDeploymentJobsRequest& request, const ListDeploymentJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list of fleets. You can optionally provide filters to retrieve * specific fleets. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListFleets">AWS * API Reference</a></p> */ virtual Model::ListFleetsOutcome ListFleets(const Model::ListFleetsRequest& request) const; /** * <p>Returns a list of fleets. You can optionally provide filters to retrieve * specific fleets. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListFleets">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListFleetsOutcomeCallable ListFleetsCallable(const Model::ListFleetsRequest& request) const; /** * <p>Returns a list of fleets. You can optionally provide filters to retrieve * specific fleets. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListFleets">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListFleetsAsync(const Model::ListFleetsRequest& request, const ListFleetsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list of robot application. You can optionally provide filters to * retrieve specific robot applications.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListRobotApplications">AWS * API Reference</a></p> */ virtual Model::ListRobotApplicationsOutcome ListRobotApplications(const Model::ListRobotApplicationsRequest& request) const; /** * <p>Returns a list of robot application. You can optionally provide filters to * retrieve specific robot applications.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListRobotApplications">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListRobotApplicationsOutcomeCallable ListRobotApplicationsCallable(const Model::ListRobotApplicationsRequest& request) const; /** * <p>Returns a list of robot application. You can optionally provide filters to * retrieve specific robot applications.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListRobotApplications">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListRobotApplicationsAsync(const Model::ListRobotApplicationsRequest& request, const ListRobotApplicationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list of robots. You can optionally provide filters to retrieve * specific robots.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListRobots">AWS * API Reference</a></p> */ virtual Model::ListRobotsOutcome ListRobots(const Model::ListRobotsRequest& request) const; /** * <p>Returns a list of robots. You can optionally provide filters to retrieve * specific robots.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListRobots">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListRobotsOutcomeCallable ListRobotsCallable(const Model::ListRobotsRequest& request) const; /** * <p>Returns a list of robots. You can optionally provide filters to retrieve * specific robots.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListRobots">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListRobotsAsync(const Model::ListRobotsRequest& request, const ListRobotsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list of simulation applications. You can optionally provide filters * to retrieve specific simulation applications. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationApplications">AWS * API Reference</a></p> */ virtual Model::ListSimulationApplicationsOutcome ListSimulationApplications(const Model::ListSimulationApplicationsRequest& request) const; /** * <p>Returns a list of simulation applications. You can optionally provide filters * to retrieve specific simulation applications. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationApplications">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListSimulationApplicationsOutcomeCallable ListSimulationApplicationsCallable(const Model::ListSimulationApplicationsRequest& request) const; /** * <p>Returns a list of simulation applications. You can optionally provide filters * to retrieve specific simulation applications. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationApplications">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListSimulationApplicationsAsync(const Model::ListSimulationApplicationsRequest& request, const ListSimulationApplicationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list simulation job batches. You can optionally provide filters to * retrieve specific simulation batch jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationJobBatches">AWS * API Reference</a></p> */ virtual Model::ListSimulationJobBatchesOutcome ListSimulationJobBatches(const Model::ListSimulationJobBatchesRequest& request) const; /** * <p>Returns a list simulation job batches. You can optionally provide filters to * retrieve specific simulation batch jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationJobBatches">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListSimulationJobBatchesOutcomeCallable ListSimulationJobBatchesCallable(const Model::ListSimulationJobBatchesRequest& request) const; /** * <p>Returns a list simulation job batches. You can optionally provide filters to * retrieve specific simulation batch jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationJobBatches">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListSimulationJobBatchesAsync(const Model::ListSimulationJobBatchesRequest& request, const ListSimulationJobBatchesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list of simulation jobs. You can optionally provide filters to * retrieve specific simulation jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationJobs">AWS * API Reference</a></p> */ virtual Model::ListSimulationJobsOutcome ListSimulationJobs(const Model::ListSimulationJobsRequest& request) const; /** * <p>Returns a list of simulation jobs. You can optionally provide filters to * retrieve specific simulation jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationJobs">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListSimulationJobsOutcomeCallable ListSimulationJobsCallable(const Model::ListSimulationJobsRequest& request) const; /** * <p>Returns a list of simulation jobs. You can optionally provide filters to * retrieve specific simulation jobs. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListSimulationJobs">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListSimulationJobsAsync(const Model::ListSimulationJobsRequest& request, const ListSimulationJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Lists all tags on a AWS RoboMaker resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListTagsForResource">AWS * API Reference</a></p> */ virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const; /** * <p>Lists all tags on a AWS RoboMaker resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListTagsForResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const Model::ListTagsForResourceRequest& request) const; /** * <p>Lists all tags on a AWS RoboMaker resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/ListTagsForResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListTagsForResourceAsync(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Registers a robot with a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/RegisterRobot">AWS * API Reference</a></p> */ virtual Model::RegisterRobotOutcome RegisterRobot(const Model::RegisterRobotRequest& request) const; /** * <p>Registers a robot with a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/RegisterRobot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::RegisterRobotOutcomeCallable RegisterRobotCallable(const Model::RegisterRobotRequest& request) const; /** * <p>Registers a robot with a fleet.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/RegisterRobot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void RegisterRobotAsync(const Model::RegisterRobotRequest& request, const RegisterRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Restarts a running simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/RestartSimulationJob">AWS * API Reference</a></p> */ virtual Model::RestartSimulationJobOutcome RestartSimulationJob(const Model::RestartSimulationJobRequest& request) const; /** * <p>Restarts a running simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/RestartSimulationJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::RestartSimulationJobOutcomeCallable RestartSimulationJobCallable(const Model::RestartSimulationJobRequest& request) const; /** * <p>Restarts a running simulation job.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/RestartSimulationJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void RestartSimulationJobAsync(const Model::RestartSimulationJobRequest& request, const RestartSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Starts a new simulation job batch. The batch is defined using one or more * <code>SimulationJobRequest</code> objects. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/StartSimulationJobBatch">AWS * API Reference</a></p> */ virtual Model::StartSimulationJobBatchOutcome StartSimulationJobBatch(const Model::StartSimulationJobBatchRequest& request) const; /** * <p>Starts a new simulation job batch. The batch is defined using one or more * <code>SimulationJobRequest</code> objects. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/StartSimulationJobBatch">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::StartSimulationJobBatchOutcomeCallable StartSimulationJobBatchCallable(const Model::StartSimulationJobBatchRequest& request) const; /** * <p>Starts a new simulation job batch. The batch is defined using one or more * <code>SimulationJobRequest</code> objects. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/StartSimulationJobBatch">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void StartSimulationJobBatchAsync(const Model::StartSimulationJobBatchRequest& request, const StartSimulationJobBatchResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Syncrhonizes robots in a fleet to the latest deployment. This is helpful if * robots were added after a deployment.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/SyncDeploymentJob">AWS * API Reference</a></p> */ virtual Model::SyncDeploymentJobOutcome SyncDeploymentJob(const Model::SyncDeploymentJobRequest& request) const; /** * <p>Syncrhonizes robots in a fleet to the latest deployment. This is helpful if * robots were added after a deployment.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/SyncDeploymentJob">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::SyncDeploymentJobOutcomeCallable SyncDeploymentJobCallable(const Model::SyncDeploymentJobRequest& request) const; /** * <p>Syncrhonizes robots in a fleet to the latest deployment. This is helpful if * robots were added after a deployment.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/SyncDeploymentJob">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void SyncDeploymentJobAsync(const Model::SyncDeploymentJobRequest& request, const SyncDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Adds or edits tags for a AWS RoboMaker resource.</p> <p>Each tag consists of * a tag key and a tag value. Tag keys and tag values are both required, but tag * values can be empty strings. </p> <p>For information about the rules that apply * to tag keys and tag values, see <a * href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">User-Defined * Tag Restrictions</a> in the <i>AWS Billing and Cost Management User Guide</i>. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/TagResource">AWS * API Reference</a></p> */ virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const; /** * <p>Adds or edits tags for a AWS RoboMaker resource.</p> <p>Each tag consists of * a tag key and a tag value. Tag keys and tag values are both required, but tag * values can be empty strings. </p> <p>For information about the rules that apply * to tag keys and tag values, see <a * href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">User-Defined * Tag Restrictions</a> in the <i>AWS Billing and Cost Management User Guide</i>. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/TagResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::TagResourceOutcomeCallable TagResourceCallable(const Model::TagResourceRequest& request) const; /** * <p>Adds or edits tags for a AWS RoboMaker resource.</p> <p>Each tag consists of * a tag key and a tag value. Tag keys and tag values are both required, but tag * values can be empty strings. </p> <p>For information about the rules that apply * to tag keys and tag values, see <a * href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">User-Defined * Tag Restrictions</a> in the <i>AWS Billing and Cost Management User Guide</i>. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/TagResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void TagResourceAsync(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Removes the specified tags from the specified AWS RoboMaker resource.</p> * <p>To remove a tag, specify the tag key. To change the tag value of an existing * tag key, use <a * href="https://docs.aws.amazon.com/robomaker/latest/dg/API_TagResource.html"> * <code>TagResource</code> </a>. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UntagResource">AWS * API Reference</a></p> */ virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const; /** * <p>Removes the specified tags from the specified AWS RoboMaker resource.</p> * <p>To remove a tag, specify the tag key. To change the tag value of an existing * tag key, use <a * href="https://docs.aws.amazon.com/robomaker/latest/dg/API_TagResource.html"> * <code>TagResource</code> </a>. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UntagResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UntagResourceOutcomeCallable UntagResourceCallable(const Model::UntagResourceRequest& request) const; /** * <p>Removes the specified tags from the specified AWS RoboMaker resource.</p> * <p>To remove a tag, specify the tag key. To change the tag value of an existing * tag key, use <a * href="https://docs.aws.amazon.com/robomaker/latest/dg/API_TagResource.html"> * <code>TagResource</code> </a>. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UntagResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UntagResourceAsync(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Updates a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UpdateRobotApplication">AWS * API Reference</a></p> */ virtual Model::UpdateRobotApplicationOutcome UpdateRobotApplication(const Model::UpdateRobotApplicationRequest& request) const; /** * <p>Updates a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UpdateRobotApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateRobotApplicationOutcomeCallable UpdateRobotApplicationCallable(const Model::UpdateRobotApplicationRequest& request) const; /** * <p>Updates a robot application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UpdateRobotApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateRobotApplicationAsync(const Model::UpdateRobotApplicationRequest& request, const UpdateRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Updates a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UpdateSimulationApplication">AWS * API Reference</a></p> */ virtual Model::UpdateSimulationApplicationOutcome UpdateSimulationApplication(const Model::UpdateSimulationApplicationRequest& request) const; /** * <p>Updates a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UpdateSimulationApplication">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateSimulationApplicationOutcomeCallable UpdateSimulationApplicationCallable(const Model::UpdateSimulationApplicationRequest& request) const; /** * <p>Updates a simulation application.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/UpdateSimulationApplication">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateSimulationApplicationAsync(const Model::UpdateSimulationApplicationRequest& request, const UpdateSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; void OverrideEndpoint(const Aws::String& endpoint); private: void init(const Aws::Client::ClientConfiguration& clientConfiguration); void BatchDescribeSimulationJobAsyncHelper(const Model::BatchDescribeSimulationJobRequest& request, const BatchDescribeSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CancelDeploymentJobAsyncHelper(const Model::CancelDeploymentJobRequest& request, const CancelDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CancelSimulationJobAsyncHelper(const Model::CancelSimulationJobRequest& request, const CancelSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CancelSimulationJobBatchAsyncHelper(const Model::CancelSimulationJobBatchRequest& request, const CancelSimulationJobBatchResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateDeploymentJobAsyncHelper(const Model::CreateDeploymentJobRequest& request, const CreateDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateFleetAsyncHelper(const Model::CreateFleetRequest& request, const CreateFleetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateRobotAsyncHelper(const Model::CreateRobotRequest& request, const CreateRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateRobotApplicationAsyncHelper(const Model::CreateRobotApplicationRequest& request, const CreateRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateRobotApplicationVersionAsyncHelper(const Model::CreateRobotApplicationVersionRequest& request, const CreateRobotApplicationVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateSimulationApplicationAsyncHelper(const Model::CreateSimulationApplicationRequest& request, const CreateSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateSimulationApplicationVersionAsyncHelper(const Model::CreateSimulationApplicationVersionRequest& request, const CreateSimulationApplicationVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateSimulationJobAsyncHelper(const Model::CreateSimulationJobRequest& request, const CreateSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteFleetAsyncHelper(const Model::DeleteFleetRequest& request, const DeleteFleetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteRobotAsyncHelper(const Model::DeleteRobotRequest& request, const DeleteRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteRobotApplicationAsyncHelper(const Model::DeleteRobotApplicationRequest& request, const DeleteRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteSimulationApplicationAsyncHelper(const Model::DeleteSimulationApplicationRequest& request, const DeleteSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeregisterRobotAsyncHelper(const Model::DeregisterRobotRequest& request, const DeregisterRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DescribeDeploymentJobAsyncHelper(const Model::DescribeDeploymentJobRequest& request, const DescribeDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DescribeFleetAsyncHelper(const Model::DescribeFleetRequest& request, const DescribeFleetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DescribeRobotAsyncHelper(const Model::DescribeRobotRequest& request, const DescribeRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DescribeRobotApplicationAsyncHelper(const Model::DescribeRobotApplicationRequest& request, const DescribeRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DescribeSimulationApplicationAsyncHelper(const Model::DescribeSimulationApplicationRequest& request, const DescribeSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DescribeSimulationJobAsyncHelper(const Model::DescribeSimulationJobRequest& request, const DescribeSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DescribeSimulationJobBatchAsyncHelper(const Model::DescribeSimulationJobBatchRequest& request, const DescribeSimulationJobBatchResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListDeploymentJobsAsyncHelper(const Model::ListDeploymentJobsRequest& request, const ListDeploymentJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListFleetsAsyncHelper(const Model::ListFleetsRequest& request, const ListFleetsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListRobotApplicationsAsyncHelper(const Model::ListRobotApplicationsRequest& request, const ListRobotApplicationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListRobotsAsyncHelper(const Model::ListRobotsRequest& request, const ListRobotsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListSimulationApplicationsAsyncHelper(const Model::ListSimulationApplicationsRequest& request, const ListSimulationApplicationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListSimulationJobBatchesAsyncHelper(const Model::ListSimulationJobBatchesRequest& request, const ListSimulationJobBatchesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListSimulationJobsAsyncHelper(const Model::ListSimulationJobsRequest& request, const ListSimulationJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListTagsForResourceAsyncHelper(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void RegisterRobotAsyncHelper(const Model::RegisterRobotRequest& request, const RegisterRobotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void RestartSimulationJobAsyncHelper(const Model::RestartSimulationJobRequest& request, const RestartSimulationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void StartSimulationJobBatchAsyncHelper(const Model::StartSimulationJobBatchRequest& request, const StartSimulationJobBatchResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void SyncDeploymentJobAsyncHelper(const Model::SyncDeploymentJobRequest& request, const SyncDeploymentJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void TagResourceAsyncHelper(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UntagResourceAsyncHelper(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UpdateRobotApplicationAsyncHelper(const Model::UpdateRobotApplicationRequest& request, const UpdateRobotApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UpdateSimulationApplicationAsyncHelper(const Model::UpdateSimulationApplicationRequest& request, const UpdateSimulationApplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; Aws::String m_uri; Aws::String m_configScheme; std::shared_ptr<Aws::Utils::Threading::Executor> m_executor; }; } // namespace RoboMaker } // namespace Aws
157d986d6faf36c55988ffd79d11d9948d45e6a1
cd949acf98a0c89c789bf2a0b520d1d12c988864
/include/PlottingTools.h
1b53b5878763f67535f36842e1c69fd3f52e48fa
[]
no_license
marcodeltutto/UBXSecAnaArchived
cd5f82ff862da157ec585d998bec46fdd99ce2bf
802a455adc717e4c98b1091dd78f2a1101484bb2
refs/heads/master
2021-09-07T15:53:44.012817
2018-02-25T14:48:28
2018-02-25T14:48:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
16,321
h
#ifndef PLOTINGTOOLS_H #define PLOTINGTOOLS_H void DrawPOT(double pot) { std::stringstream sstm2; sstm2 << "Accumulated POT: " << pot; std::string str = sstm2.str(); TLatex* pot_latex_2 = new TLatex(.10, .92, str.c_str()); pot_latex_2->SetTextFont(62); pot_latex_2->SetTextColor(kGray+2); pot_latex_2->SetNDC(); pot_latex_2->SetTextSize(1/30.); pot_latex_2->SetTextAlign(10);//left adjusted pot_latex_2->Draw(); } //********************************************************** TLegend* DrawTHStack(THStack *hs_trklen, double pot_scaling, bool _breakdownPlots, std::map<std::string,TH1D*> themap){ for (auto iter : themap) { if (iter.second == NULL || iter.first == "intimecosmic" || iter.first == "beam-off") continue; iter.second->Scale(pot_scaling); } if (themap["beam-off"] != NULL) { themap["beam-off"]->SetLineColor(kBlue+2); themap["beam-off"]->SetFillColor(kBlue+2); themap["beam-off"]->SetFillStyle(3004); hs_trklen->Add(themap["beam-off"]); } if (themap["intimecosmic"] != NULL) { themap["intimecosmic"]->SetLineColor(kBlue+2); themap["intimecosmic"]->SetFillColor(kBlue+2); themap["intimecosmic"]->SetFillStyle(3004); hs_trklen->Add(themap["intimecosmic"]); } if (_breakdownPlots) { themap["cosmic_nostopmu"]->SetLineColor(kBlue+2); themap["cosmic_nostopmu"]->SetFillColor(kBlue+2); hs_trklen->Add(themap["cosmic_nostopmu"]); themap["cosmic_stopmu"]->SetLineColor(kBlue); themap["cosmic_stopmu"]->SetFillColor(kBlue); hs_trklen->Add(themap["cosmic_stopmu"]); themap["outfv_nostopmu"]->SetLineColor(kGreen+3); themap["outfv_nostopmu"]->SetFillColor(kGreen+3); hs_trklen->Add(themap["outfv_nostopmu"]); themap["outfv_stopmu"]->SetLineColor(kGreen+2); themap["outfv_stopmu"]->SetFillColor(kGreen+2); hs_trklen->Add(themap["outfv_stopmu"]); themap["nc_proton"]->SetLineColor(kGray+2); themap["nc_proton"]->SetFillColor(kGray+2); hs_trklen->Add(themap["nc_proton"]); themap["nc_pion"]->SetLineColor(kGray+1); themap["nc_pion"]->SetFillColor(kGray+1); hs_trklen->Add(themap["nc_pion"]); themap["nc_other"]->SetLineColor(kGray); themap["nc_other"]->SetFillColor(kGray); hs_trklen->Add(themap["nc_other"]); } else { themap["cosmic"]->SetLineColor(kBlue+2); themap["cosmic"]->SetFillColor(kBlue+2); hs_trklen->Add(themap["cosmic"]); themap["outfv"]->SetLineColor(kGreen+2); themap["outfv"]->SetFillColor(kGreen+2); hs_trklen->Add(themap["outfv"]); themap["nc"]->SetLineColor(kGray); themap["nc"]->SetFillColor(kGray); hs_trklen->Add(themap["nc"]); } themap["anumu"]->SetLineColor(kOrange-3); themap["anumu"]->SetFillColor(kOrange-3); hs_trklen->Add(themap["anumu"]); themap["nue"]->SetLineColor(kMagenta+1); themap["nue"]->SetFillColor(kMagenta+1); hs_trklen->Add(themap["nue"]); if (_breakdownPlots) { themap["signal_nostopmu"]->SetLineColor(kRed+2); themap["signal_nostopmu"]->SetFillColor(kRed+2); hs_trklen->Add(themap["signal_nostopmu"]); themap["signal_stopmu"]->SetLineColor(kRed); themap["signal_stopmu"]->SetFillColor(kRed); hs_trklen->Add(themap["signal_stopmu"]); } else { themap["signal"]->SetLineColor(kRed); themap["signal"]->SetFillColor(kRed); hs_trklen->Add(themap["signal"]); } hs_trklen->Draw("hist"); //h_trklen_total->DrawCopy("hist"); //gStyle->SetHatchesLineWidth(1); themap["total"]->SetFillColor(kBlack); themap["total"]->SetFillStyle(3005); //themap["total"]->Draw("E2 same"); TLegend* leg2; if (_breakdownPlots){ leg2 = new TLegend(0.56,0.37,0.82,0.82,NULL,"brNDC"); } else { leg2 = new TLegend(0.56,0.54,0.82,0.82,NULL,"brNDC"); } std::stringstream sstm; // numu if (_breakdownPlots) { leg2->AddEntry(themap["signal_stopmu"],"#nu_{#mu} CC (stopping #mu)","f"); leg2->AddEntry(themap["signal_nostopmu"],"#nu_{#mu} CC (other)","f"); } else { sstm << "#nu_{#mu} CC (signal), " << std::setprecision(2) << themap["signal"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["signal"],sstm.str().c_str(),"f"); sstm.str(""); } // nue sstm << "#nu_{e}, #bar{#nu}_{e} CC, " << std::setprecision(2) << themap["nue"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["nue"],sstm.str().c_str(),"f"); sstm.str(""); // anumu sstm << "#bar{#nu}_{#mu} CC, " << std::setprecision(2) << themap["anumu"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["anumu"],sstm.str().c_str(),"f"); sstm.str(""); // nc, outfv, cosmic if (_breakdownPlots) { leg2->AddEntry(themap["nc_other"],"NC (other)","f"); leg2->AddEntry(themap["nc_pion"],"NC (pion)","f"); leg2->AddEntry(themap["nc_proton"],"NC (proton)","f"); leg2->AddEntry(themap["outfv_stopmu"],"OUTFV (stopping #mu)","f"); leg2->AddEntry(themap["outfv_nostopmu"],"OUTFV (other)","f"); leg2->AddEntry(themap["cosmic_stopmu"],"Cosmic (stopping #mu)","f"); leg2->AddEntry(themap["cosmic_nostopmu"],"Cosmic (other)","f"); if (themap["intimecosmic"] != NULL) { leg2->AddEntry(themap["intimecosmic"],"In-time cosmics","f"); } } else { sstm << "NC, " << std::setprecision(2) << themap["nc"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["nc"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "OUTFV, " << std::setprecision(2) << themap["outfv"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["outfv"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Cosmic, " << std::setprecision(2) << themap["cosmic"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["cosmic"],sstm.str().c_str(),"f"); sstm.str(""); } //leg2->AddEntry(themap["total"],"MC Stat Unc.","f"); leg2->Draw(); return leg2; } //********************************************************** TLegend* DrawTHStack2D(THStack *hs_trklen, double pot_scaling, bool _breakdownPlots, std::map<std::string,TH2D*> themap){ for (auto iter : themap) { if (iter.second == NULL || iter.first == "intimecosmic" || iter.first == "beam-off") continue; iter.second->Scale(pot_scaling); iter.second->SetLineWidth(1); } if (themap["beam-off"] != NULL) { themap["beam-off"]->SetLineColor(kBlack); themap["beam-off"]->SetFillColor(kOrange); //themap["beam-off"]->SetFillStyle(3004); hs_trklen->Add(themap["beam-off"]); } if (themap["intimecosmic"] != NULL) { themap["intimecosmic"]->SetLineColor(kBlack); themap["intimecosmic"]->SetFillColor(kBlue+2); themap["intimecosmic"]->SetFillStyle(3004); hs_trklen->Add(themap["intimecosmic"]); } if (false/*_breakdownPlots*/) { themap["cosmic_nostopmu"]->SetLineColor(kBlack); themap["cosmic_nostopmu"]->SetFillColor(kBlue+2); hs_trklen->Add(themap["cosmic_nostopmu"]); themap["cosmic_stopmu"]->SetLineColor(kBlack); themap["cosmic_stopmu"]->SetFillColor(kBlue); hs_trklen->Add(themap["cosmic_stopmu"]); themap["outfv_nostopmu"]->SetLineColor(kBlack); themap["outfv_nostopmu"]->SetFillColor(kGreen+3); hs_trklen->Add(themap["outfv_nostopmu"]); themap["outfv_stopmu"]->SetLineColor(kBlack); themap["outfv_stopmu"]->SetFillColor(kGreen+2); hs_trklen->Add(themap["outfv_stopmu"]); themap["nc_proton"]->SetLineColor(kBlack); themap["nc_proton"]->SetFillColor(kGray+2); hs_trklen->Add(themap["nc_proton"]); themap["nc_pion"]->SetLineColor(kBlack); themap["nc_pion"]->SetFillColor(kGray+1); hs_trklen->Add(themap["nc_pion"]); themap["nc_other"]->SetLineColor(kBlack); themap["nc_other"]->SetFillColor(kGray); hs_trklen->Add(themap["nc_other"]); } else { themap["cosmic"]->SetLineColor(kBlack); themap["cosmic"]->SetFillColor(kBlue+2); hs_trklen->Add(themap["cosmic"]); themap["outfv"]->SetLineColor(kBlack); themap["outfv"]->SetFillColor(kGreen+2); hs_trklen->Add(themap["outfv"]); themap["nc"]->SetLineColor(kBlack); themap["nc"]->SetFillColor(kGray); hs_trklen->Add(themap["nc"]); } themap["anumu"]->SetLineColor(kBlack); themap["anumu"]->SetFillColor(kOrange-3); hs_trklen->Add(themap["anumu"]); themap["nue"]->SetLineColor(kBlack); themap["nue"]->SetFillColor(kMagenta+1); hs_trklen->Add(themap["nue"]); if (false/*_breakdownPlots*/) { themap["signal_nostopmu"]->SetLineColor(kBlack); themap["signal_nostopmu"]->SetFillColor(kRed+2); hs_trklen->Add(themap["signal_nostopmu"]); themap["signal_stopmu"]->SetLineColor(kBlack); themap["signal_stopmu"]->SetFillColor(kRed); hs_trklen->Add(themap["signal_stopmu"]); } else { themap["signal"]->SetLineColor(kBlack); themap["signal"]->SetFillColor(kRed); hs_trklen->Add(themap["signal"]); } hs_trklen->Draw("lego1"); //h_trklen_total->DrawCopy("hist"); //gStyle->SetHatchesLineWidth(1); themap["total"]->SetFillColor(kBlack); themap["total"]->SetFillStyle(3005); //themap["total"]->Draw("E2 same"); TLegend* leg2; if (_breakdownPlots){ leg2 = new TLegend(0.56,0.37,0.82,0.82,NULL,"brNDC"); } else { leg2 = new TLegend(0.56,0.54,0.82,0.82,NULL,"brNDC"); } std::stringstream sstm; // numu if (_breakdownPlots) { leg2->AddEntry(themap["signal_stopmu"],"#nu_{#mu} CC (stopping #mu)","f"); leg2->AddEntry(themap["signal_nostopmu"],"#nu_{#mu} CC (other)","f"); } else { sstm << "#nu_{#mu} CC (signal), " << std::setprecision(2) << themap["signal"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["signal"],sstm.str().c_str(),"f"); sstm.str(""); } // nue sstm << "#nu_{e}, #bar{#nu}_{e} CC, " << std::setprecision(2) << themap["nue"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["nue"],sstm.str().c_str(),"f"); sstm.str(""); // anumu sstm << "#bar{#nu}_{#mu} CC, " << std::setprecision(2) << themap["anumu"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["anumu"],sstm.str().c_str(),"f"); sstm.str(""); // nc, outfv, cosmic if (_breakdownPlots) { leg2->AddEntry(themap["nc_other"],"NC (other)","f"); leg2->AddEntry(themap["nc_pion"],"NC (pion)","f"); leg2->AddEntry(themap["nc_proton"],"NC (proton)","f"); leg2->AddEntry(themap["outfv_stopmu"],"OUTFV (stopping #mu)","f"); leg2->AddEntry(themap["outfv_nostopmu"],"OUTFV (other)","f"); leg2->AddEntry(themap["cosmic_stopmu"],"Cosmic (stopping #mu)","f"); leg2->AddEntry(themap["cosmic_nostopmu"],"Cosmic (other)","f"); if (themap["intimecosmic"] != NULL) { leg2->AddEntry(themap["intimecosmic"],"In-time cosmics","f"); } } else { sstm << "NC, " << std::setprecision(2) << themap["nc"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["nc"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "OUTFV, " << std::setprecision(2) << themap["outfv"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["outfv"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Cosmic, " << std::setprecision(2) << themap["cosmic"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["cosmic"],sstm.str().c_str(),"f"); sstm.str(""); } //leg2->AddEntry(themap["total"],"MC Stat Unc.","f"); //leg2->Draw(); return leg2; } //********************************************************** TLegend* DrawTHStack2(THStack *hs_trklen, double pot_scaling, bool _breakdownPlots, std::map<std::string,TH1D*> themap){ for (auto iter : themap) { if (iter.second == NULL || iter.first == "intimecosmic" || iter.first == "beam-off") continue; iter.second->Scale(pot_scaling); } if (themap["beam-off"] != NULL) { themap["beam-off"]->SetLineColor(kBlue+2); themap["beam-off"]->SetFillColor(kBlue+2); themap["beam-off"]->SetFillStyle(3004); hs_trklen->Add(themap["beam-off"]); } themap["background"]->SetLineColor(kBlue+2); themap["background"]->SetFillColor(kBlue+2); hs_trklen->Add(themap["background"]); themap["signal"]->SetLineColor(kRed+2); themap["signal"]->SetFillColor(kRed+2); hs_trklen->Add(themap["signal"]); hs_trklen->Draw(); //themap["total"]->SetFillColor(kBlack); //themap["total"]->SetFillStyle(3005); //themap["total"]->Draw("E2 same"); TLegend* leg2; leg2 = new TLegend(0.13,0.69,0.45,0.87,NULL,"brNDC"); std::stringstream sstm; sstm << "Signal, " << std::setprecision(2) << themap["signal"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["signal"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Background, " << std::setprecision(2) << themap["background"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["background"],sstm.str().c_str(),"f"); sstm.str(""); //leg2->AddEntry(themap["total"],"MC Stat Unc.","f"); //leg2->Draw(); return leg2; } //********************************************************** TLegend* DrawTHStack3(THStack *hs_trklen, double pot_scaling, bool _breakdownPlots, std::map<std::string,TH1D*> themap){ for (auto iter : themap) { iter.second->Scale(pot_scaling); } themap["proton"]->SetLineColor(kBlue+2); themap["proton"]->SetFillColor(kBlue+2); hs_trklen->Add(themap["proton"]); themap["pion"]->SetLineColor(kGreen+2); themap["pion"]->SetFillColor(kGreen+2); hs_trklen->Add(themap["pion"]); themap["photon"]->SetLineColor(kOrange-3); themap["photon"]->SetFillColor(kOrange-3); hs_trklen->Add(themap["photon"]); themap["electron"]->SetLineColor(kMagenta+1); themap["electron"]->SetFillColor(kMagenta+1); hs_trklen->Add(themap["electron"]); themap["else"]->SetLineColor(kGray+2); themap["else"]->SetFillColor(kGray+2); hs_trklen->Add(themap["else"]); themap["muon"]->SetLineColor(kRed+2); themap["muon"]->SetFillColor(kRed+2); hs_trklen->Add(themap["muon"]); hs_trklen->Draw(); themap["total"]->SetFillColor(kBlack); themap["total"]->SetFillStyle(3005); themap["total"]->Draw("E2 same"); TLegend* leg2; leg2 = new TLegend(0.6475645,0.5136842,0.8767908,0.8336842,NULL,"brNDC"); std::stringstream sstm; sstm << "Muon, " << std::setprecision(2) << themap["muon"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["muon"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Proton, " << std::setprecision(2) << themap["proton"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["proton"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Pion, " << std::setprecision(2) << themap["pion"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["pion"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Photon, " << std::setprecision(2) << themap["photon"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["photon"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Electron, " << std::setprecision(2) << themap["electron"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["electron"],sstm.str().c_str(),"f"); sstm.str(""); sstm << "Other, " << std::setprecision(2) << themap["else"]->Integral() / themap["total"]->Integral()*100. << "%"; leg2->AddEntry(themap["else"],sstm.str().c_str(),"f"); sstm.str(""); leg2->AddEntry(themap["total"],"MC Stat Unc.","f"); leg2->Draw(); return leg2; } void DrawDataHisto(TH1D* histo) { histo->SetMarkerStyle(kFullCircle); histo->SetMarkerSize(0.6); histo->Draw("E1 same"); } void DrawDataHisto2D(TH2D* histo) { histo->SetMarkerStyle(kFullCircle); histo->SetMarkerSize(0.6); histo->Draw("E1 same"); } #endif
f2f7f0fcc0951158c16eea7807f015b674944514
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/httpd/gumtree/httpd_repos_function_2515_last_repos.cpp
a31c20e8c1c9166aa673751bd2d75792a7cd643d
[]
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
331
cpp
static int read_param(link_ctx *ctx) { if (skip_ws(ctx) && read_chr(ctx, ';')) { const char *name, *value = ""; if (read_pname(ctx, &name)) { read_pvalue(ctx, &value); /* value is optional */ apr_table_setn(ctx->params, name, value); return 1; } } return 0; }
4f212ec5055e6d773aa16e2366d20d15c9572d0c
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5670465267826688_1/C++/alexmat21/c.cpp
6f90efbe43aabdedcab69eab86e2c58a13ac6243
[]
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
2,440
cpp
// Created by alex_mat21. And it works! #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <queue> #include <cstring> #include <map> #include <set> #include <deque> #include <stack> #include <sstream> #include <stdio.h> #include <math.h> #include <bitset> #include <string> #include <iomanip> #include <cmath> #include <utility> #define FOR(i,n) for(int i=0,_n=n;i<_n;i++) #define FORR(i,s,n) for(int i=s,_n=n;i<_n;i++) #define mp make_pair #define vi vector<int> #define fs first #define sd second #define pii pair<int,int> using namespace std; int mult(int x,int y){ int t=1; if (x<0){ t=-t; x=-x; } if (y<0){ t=-t; y=-y; } if (y==1) return t*x; else if (x==1) return t*y; else if (y==2){ if (x==2) return -t; else if (x==3) return -t*4; else return t*3; } else if (y==3){ if (x==2) return t*4; else if (x==3) return -t; else return -t*2; } else { if (x==2) return -t*3; else if (x==3) return t*2; else return -t; } } int main (){ int a[10010]; int al[10010]; int ar[10010]; int t111; cin >> t111; for (int i111=0 ; i111<t111; i111++){ string s; long long l,n; long long n1,m1,x1,y1,k1,z1,per,p; cin >> l >>n; cin >> s; FOR(i,l){ if (s[i]=='i') a[i+1]=2; else if (s[i]=='j') a[i+1]=3; else a[i+1]=4; } al[0]=1; for(int i=1; i<=l ; i++){ al[i]=mult(al[i-1],a[i]); //cout << i << ' ' << al[i] << endl; } ar[l]=1; for(int i=l-1; i>=0 ; i--) ar[i]=mult(a[i+1],ar[i+1]); int t=0; per=1; p=al[l]; while (p!=1){ per++; p=mult(p,al[l]); } for (int i=0; i<=l ; i++){ n1=0; x1=1; while (n1<per && mult(x1,al[i])!=2){ n1++; x1=mult(x1,al[l]); } if (n1<per){ //cout << i <<' ' << n1 << ' ' << x1 << endl; for (int j=0; j<=l ; j++){ m1=0; y1=1; while (m1<per && mult(ar[j],y1)!=4){ m1++; y1=mult(y1,al[l]); } if (m1<per){ //cout << j <<' ' << m1 << ' ' << y1 << " !!!!"<< endl; k1=0; z1=1; while (k1<per && mult(mult(ar[i],z1),al[j])!=3){ k1++; z1=mult(z1,al[l]); } //cout << k1 << ' ' << z1 << " $$$"<< endl; if (k1<per && (n1+m1+k1+2-n)%per==0){ if (n1+m1+k1+2<=n ||(i<j && k1==per-1 && n1+m1+1<=n)){ t=1; break; } } } } } if (t) break; } if (t) cout << "Case #"<< i111 +1 << ": YES" << endl; else cout << "Case #"<< i111 +1 << ": NO" << endl; } return 0; }
84a278fbab40117f06bf0eaacd7d7128aa753bcc
d455e6f783b861b1ae36530864bd8f5e14daf997
/src/index_build.h
3c04c3340495893781eac8bf8ef97861ea92a838
[]
no_license
amallia/poly-ir-toolkit
5b72f1e35d78321049dd2f5347baa41ee2ff4fd5
8acdc59ffec5e173066ee651ab1cee8c2edd599c
refs/heads/master
2021-07-08T05:58:28.671246
2017-10-01T17:32:19
2017-10-01T17:32:19
105,459,810
2
1
null
null
null
null
UTF-8
C++
false
false
16,480
h
// Copyright (c) 2010, Roman Khmelichek // // 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 Roman Khmelichek 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 AUTHOR "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 AUTHOR 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. //============================================================================================================================================================== // Author(s): Roman Khmelichek // // Responsible for building the index. Writes out the lexicon to be used when doing query processing or merging indices. The index is chunkwise compressed and // also structured in blocks for efficiency and list caching. //============================================================================================================================================================== #ifndef INDEX_BUILD_H_ #define INDEX_BUILD_H_ #include <cassert> #include <stdint.h> #include "coding_policy.h" #include "coding_policy_helper.h" #include "configuration.h" #include "index_layout_parameters.h" /************************************************************************************************************************************************************** * InvertedListMetaData * **************************************************************************************************************************************************************/ class InvertedListMetaData { public: InvertedListMetaData(); InvertedListMetaData(const char* term, int term_len); InvertedListMetaData(const char* term, int term_len, int block_number, int chunk_number, int num_docs); ~InvertedListMetaData(); const char* term() const { return term_; } int term_len() const { return term_len_; } int num_layers() const { return num_layers_; } const int* num_docs() const { return num_docs_; } const int* num_chunks() const { return num_chunks_; } const int* num_chunks_last_block() const { return num_chunks_last_block_; } const int* num_blocks() const { return num_blocks_; } const int* block_numbers() const { return block_numbers_; } const int* chunk_numbers() const { return chunk_numbers_; } const float* score_thresholds() const { return score_thresholds_; } const uint32_t* external_index_offsets() const { return external_index_offsets_; } void increase_curr_layer() { ++num_layers_; } void set_curr_layer_num_docs(int num_docs) { assert(num_layers_ < kMaxLayers); num_docs_[num_layers_] = num_docs; } void increase_curr_layer_num_docs(int num_more_docs) { assert(num_layers_ < kMaxLayers); num_docs_[num_layers_] += num_more_docs; } void set_curr_layer_num_chunks(int num_chunks) { assert(num_layers_ < kMaxLayers); num_chunks_[num_layers_] = num_chunks; } void increase_curr_layer_num_chunks(int num_more_chunks) { assert(num_layers_ < kMaxLayers); num_chunks_[num_layers_] += num_more_chunks; } void set_curr_layer_num_chunks_last_block(int num_chunks_last_block) { assert(num_layers_ < kMaxLayers); num_chunks_last_block_[num_layers_] = num_chunks_last_block; } void increase_curr_layer_num_chunks_last_block(int num_more_chunks_last_block) { assert(num_layers_ < kMaxLayers); num_chunks_last_block_[num_layers_] += num_more_chunks_last_block; } void set_curr_layer_num_blocks(int num_blocks) { assert(num_layers_ < kMaxLayers); num_blocks_[num_layers_] = num_blocks; } void increase_curr_layer_num_blocks(int num_more_blocks) { assert(num_layers_ < kMaxLayers); num_blocks_[num_layers_] += num_more_blocks; } void set_curr_layer_offset(int block_number, int chunk_number) { assert(num_layers_ < kMaxLayers); block_numbers_[num_layers_] = block_number; chunk_numbers_[num_layers_] = chunk_number; } void set_curr_layer_threshold(float score_threshold) { assert(num_layers_ < kMaxLayers); score_thresholds_[num_layers_] = score_threshold; } void set_curr_layer_external_index_offset(uint32_t index_offset) { assert(num_layers_ < kMaxLayers); external_index_offsets_[num_layers_] = index_offset; } private: void Init(); char* term_; int term_len_; const static int kMaxLayers = MAX_LIST_LAYERS; // The max number of layers we support. int num_layers_; // Used to keep track of the current layer we're processing info for; // at the end, will hold the number of layers we have for a particular inverted list. int num_docs_[kMaxLayers]; int num_chunks_[kMaxLayers]; int num_chunks_last_block_[kMaxLayers]; int num_blocks_[kMaxLayers]; int block_numbers_[kMaxLayers]; int chunk_numbers_[kMaxLayers]; float score_thresholds_[kMaxLayers]; uint32_t external_index_offsets_[kMaxLayers]; // The integer offset into the external index where data for the current term layer starts. }; /************************************************************************************************************************************************************** * ChunkEncoder * * Assumes that all docIDs are in sorted, monotonically increasing order, so naturally, they are assumed to be d-gap coded. **************************************************************************************************************************************************************/ class ChunkEncoder { public: ChunkEncoder(uint32_t* doc_ids, uint32_t* frequencies, uint32_t* positions, unsigned char* contexts, int num_docs, int num_properties, uint32_t prev_chunk_last_doc_id, const CodingPolicy& doc_id_compressor, const CodingPolicy& frequency_compressor, const CodingPolicy& position_compressor); void CompressDocIds(uint32_t* doc_ids, int doc_ids_len, const CodingPolicy& doc_id_compressor); void CompressFrequencies(uint32_t* frequencies, int frequencies_len, const CodingPolicy& frequency_compressor); void CompressPositions(uint32_t* positions, int positions_len, const CodingPolicy& position_compressor); uint32_t first_doc_id() const { return first_doc_id_; } uint32_t last_doc_id() const { return last_doc_id_; } float max_score() const { return max_score_; } void set_max_score(float max_score) { max_score_ = max_score; } // Returns the total size of the compressed portions of this chunk in words. int size() const { return size_; } int num_docs() const { return num_docs_; } int num_properties() const { return num_properties_; } const uint32_t* compressed_doc_ids() const { return compressed_doc_ids_; } int compressed_doc_ids_len() const { return compressed_doc_ids_len_; } const uint32_t* compressed_frequencies() const { return compressed_frequencies_; } int compressed_frequencies_len() const { return compressed_frequencies_len_; } const uint32_t* compressed_positions() const { return compressed_positions_; } int compressed_positions_len() const { return compressed_positions_len_; } static const int kChunkSize = CHUNK_SIZE; static const int kMaxProperties = MAX_FREQUENCY_PROPERTIES; private: int num_docs_; // Number of unique documents included in this chunk. int num_properties_; // Indicates the total number of frequencies (also positions and contexts if they are included). // Also the same as the number of postings. int size_; // Size of the compressed chunk in bytes. uint32_t first_doc_id_; // Decoded first docID in this chunk. uint32_t last_doc_id_; // Decoded last docID in this chunk. float max_score_; // Maximum partial docID score within this chunk. // These buffers are used for compression of chunks. uint32_t compressed_doc_ids_[CompressedOutBufferUpperbound(kChunkSize)]; // Array of compressed docIDs. int compressed_doc_ids_len_; // Actual compressed length of docIDs in number of words. uint32_t compressed_frequencies_[CompressedOutBufferUpperbound(kChunkSize)]; // Array of compressed frequencies. int compressed_frequencies_len_; // Actual compressed length of frequencies in number of words. uint32_t compressed_positions_[CompressedOutBufferUpperbound(kChunkSize * kMaxProperties)]; // Array of compressed positions. int compressed_positions_len_; // Actual compressed length of positions in number of words. }; /************************************************************************************************************************************************************** * BlockEncoder * * Block header format: 4 byte unsigned integer representing the number of chunks in this block, * followed by compressed list of chunk sizes and chunk last docIDs. **************************************************************************************************************************************************************/ class BlockEncoder { public: BlockEncoder(const CodingPolicy& block_header_compressor); ~BlockEncoder(); // Attempts to add 'chunk' to the current block. // Returns true if 'chunk' was added, false if 'chunk' did not fit into the block. bool AddChunk(const ChunkEncoder& chunk); // Calling this compresses the header. // The header will already be compressed if AddChunk() returned false at one point. // So it's only to be used in the special case if this block was not filled to capacity. void Finalize(); void GetBlockBytes(unsigned char* block_bytes, int block_bytes_len); uint32_t num_chunks() const { return num_chunks_; } int num_block_header_bytes() const { return num_block_header_bytes_; } int num_doc_ids_bytes() const { return num_doc_ids_bytes_; } int num_frequency_bytes() const { return num_frequency_bytes_; } int num_positions_bytes() const { return num_positions_bytes_; } int num_wasted_space_bytes() const { return num_wasted_space_bytes_; } static const int kBlockSize = BLOCK_SIZE; private: void CopyChunkData(const ChunkEncoder& chunk); int CompressHeader(uint32_t* header, uint32_t* output, int header_len); static const int kChunkSizeLowerBound = MIN_COMPRESSED_CHUNK_SIZE; // The upper bound on the number of chunk properties in a block, // calculated by getting the max number of chunks in a block and multiplying by 2 properties per chunk. static const int kChunkPropertiesUpperbound = 2 * (kBlockSize / kChunkSizeLowerBound); // The upper bound on the number of chunk properties in a single block (sized for proper compression for various coding policies). static const int kChunkPropertiesCompressedUpperbound = CompressedOutBufferUpperbound(kChunkPropertiesUpperbound); const CodingPolicy& block_header_compressor_; uint32_t block_header_size_; // The size of the block header including the number of chunks; determined in 'Finalize()'. uint32_t num_chunks_; // The number of chunks contained within this block. uint32_t block_data_[kBlockSize / sizeof(uint32_t)]; // The compressed chunk data. int block_data_offset_; // Current offset within the 'block_data_'. int chunk_properties_uncompressed_size_; // Size of the 'chunk_properties_uncompressed_' buffer. uint32_t* chunk_properties_uncompressed_; // Holds the chunk last docIDs and chunk sizes. Needs to be dynamically allocated. int chunk_properties_uncompressed_offset_; // Current offset within the 'chunk_properties_uncompressed_' buffer. // This will require ~22KiB of memory. Alternative is to make dynamic allocations and resize if necessary. uint32_t chunk_properties_compressed_[kChunkPropertiesCompressedUpperbound]; int chunk_properties_compressed_len_; // The current actual size of the compressed chunk properties buffer. // The breakdown of bytes in this block. int num_block_header_bytes_; int num_doc_ids_bytes_; int num_frequency_bytes_; int num_positions_bytes_; int num_wasted_space_bytes_; }; /************************************************************************************************************************************************************** * IndexBuilder * **************************************************************************************************************************************************************/ class ExternalIndexBuilder; class IndexBuilder { public: IndexBuilder(const char* lexicon_filename, const char* index_filename, const CodingPolicy& block_header_compressor, ExternalIndexBuilder* external_index_builder = NULL); ~IndexBuilder(); void WriteBlocks(); void Add(const ChunkEncoder& chunk, const char* term, int term_len); void WriteLexicon(); void Finalize(); void FinalizeLayer(float score_threshold); uint64_t total_num_chunks() const { return total_num_chunks_; } uint64_t total_num_per_term_blocks() const { return total_num_per_term_blocks_; } uint64_t num_unique_terms() const { return num_unique_terms_; } uint64_t posting_count() const { return posting_count_; } uint64_t total_num_block_header_bytes() const { return total_num_block_header_bytes_; } uint64_t total_num_doc_ids_bytes() const { return total_num_doc_ids_bytes_; } uint64_t total_num_frequency_bytes() const { return total_num_frequency_bytes_; } uint64_t total_num_positions_bytes() const { return total_num_positions_bytes_; } uint64_t total_num_wasted_space_bytes() const { return total_num_wasted_space_bytes_; } private: // Buffer up blocks in memory before writing them out to disk. const int kBlocksBufferSize; BlockEncoder** blocks_buffer_; int blocks_buffer_offset_; BlockEncoder* curr_block_; int curr_block_number_; int curr_chunk_number_; bool insert_layer_offset_; int index_fd_; const int kLexiconBufferSize; InvertedListMetaData** lexicon_; int lexicon_offset_; int lexicon_fd_; const CodingPolicy& block_header_compressor_; // Not all indices need an external index to be built, so it's passed in as a pointer, which could be NULL. ExternalIndexBuilder* external_index_builder_; // Used to build an in-memory block header index during query processing (when the index is loaded into main memory). uint64_t total_num_chunks_; // The total number of chunks in this index. uint64_t total_num_per_term_blocks_; // The total number of per term blocks in this index // (as if each term had it's own block, not shared with other terms). // Index statistics. uint64_t num_unique_terms_; uint64_t posting_count_; // The breakdown of bytes in this index. uint64_t total_num_block_header_bytes_; uint64_t total_num_doc_ids_bytes_; uint64_t total_num_frequency_bytes_; uint64_t total_num_positions_bytes_; uint64_t total_num_wasted_space_bytes_; }; #endif /* INDEX_BUILD_H_ */
fc9d40d7753e00451fd4978e8dfc8a0b0e361989
820489b64b7c787643a1e803db968c9b0a7b2e8f
/SSP-EstructuraDeDatos/Time/main.cpp
89c089cbbd538040dff0ad3032092cbc6f8e496d
[]
no_license
Norzuiso/University
2ad452cd4fd85ee8062b56fe6bb7f0da8fa10427
3616aa385c9534e736cb5c3633983346adb3fb09
refs/heads/main
2023-08-01T06:04:34.047520
2021-09-17T02:45:09
2021-09-17T02:45:09
360,977,796
0
0
null
2021-05-22T21:29:06
2021-04-23T18:48:57
C
UTF-8
C++
false
false
557
cpp
#include <iostream> #include "Hora.h" using namespace std; int main() { Hora tiempo[10]; int hora = 0; int minuto = 0; int segundo = 0; cout << "Ingresa la hora" << endl; cin >> hora; cout << "Ingresa el minuto" << endl; cin >> minuto; cout << "Ingresa el segundo" << endl; cin >> segundo; tiempo[0].setTiem(hora, minuto, segundo); cout << "Tiempo en formato militar" << endl; tiempo[0].printMilitarFormat(); cout << "Tiempo en formato estandar" << endl; tiempo[0].printEstandarFormat(); }
0d3a6bd0c8c54452242b5b01c28936f72bd3f744
3d193be5bcbc0823c91fdb2504beef631d6da709
/gpu/command_buffer/service/feature_info.h
d633f02c3a7671d9a8d0f3c824c73842ab3a7c74
[ "BSD-3-Clause" ]
permissive
a402539/highweb-webcl-html5spec
7a4285a729fdf98b5eea7c19a288d26d4759d7cc
644216ea0c2db67af15471b42753d76e35082759
refs/heads/master
2020-03-22T14:01:34.091922
2016-04-26T05:06:00
2016-05-03T12:58:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,067
h
// Copyright (c) 2012 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 GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ #define GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ #include <memory> #include <string> #include "base/macros.h" #include "base/memory/ref_counted.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gles2_cmd_validation.h" #include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/gpu_export.h" namespace base { class CommandLine; } namespace gfx { struct GLVersionInfo; } namespace gpu { namespace gles2 { // FeatureInfo records the features that are available for a ContextGroup. class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { public: struct FeatureFlags { FeatureFlags(); bool chromium_framebuffer_multisample; bool chromium_sync_query; // Use glBlitFramebuffer() and glRenderbufferStorageMultisample() with // GL_EXT_framebuffer_multisample-style semantics, since they are exposed // as core GL functions on this implementation. bool use_core_framebuffer_multisample; bool multisampled_render_to_texture; // Use the IMG GLenum values and functions rather than EXT. bool use_img_for_multisampled_render_to_texture; bool chromium_screen_space_antialiasing; bool oes_standard_derivatives; bool oes_egl_image_external; bool oes_depth24; bool oes_compressed_etc1_rgb8_texture; bool packed_depth24_stencil8; bool npot_ok; bool enable_texture_float_linear; bool enable_texture_half_float_linear; bool angle_translated_shader_source; bool angle_pack_reverse_row_order; bool arb_texture_rectangle; bool angle_instanced_arrays; bool occlusion_query_boolean; bool use_arb_occlusion_query2_for_occlusion_query_boolean; bool use_arb_occlusion_query_for_occlusion_query_boolean; bool native_vertex_array_object; bool ext_texture_format_astc; bool ext_texture_format_atc; bool ext_texture_format_bgra8888; bool ext_texture_format_dxt1; bool ext_texture_format_dxt5; bool enable_shader_name_hashing; bool enable_samplers; bool ext_draw_buffers; bool nv_draw_buffers; bool ext_frag_depth; bool ext_shader_texture_lod; bool use_async_readpixels; bool map_buffer_range; bool ext_discard_framebuffer; bool angle_depth_texture; bool is_swiftshader; bool angle_texture_usage; bool ext_texture_storage; bool chromium_path_rendering; bool chromium_framebuffer_mixed_samples; bool blend_equation_advanced; bool blend_equation_advanced_coherent; bool ext_texture_rg; bool chromium_image_ycbcr_420v; bool chromium_image_ycbcr_422; bool emulate_primitive_restart_fixed_index; bool ext_render_buffer_format_bgra8888; bool ext_multisample_compatibility; bool ext_blend_func_extended; bool ext_read_format_bgra; }; FeatureInfo(); // Constructor with workarounds taken from the current process's CommandLine explicit FeatureInfo( const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds); // Constructor with workarounds taken from |command_line| FeatureInfo(const base::CommandLine& command_line, const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds); // Initializes the feature information. Needs a current GL context. bool Initialize(ContextType context_type, const DisallowedFeatures& disallowed_features); // Helper that defaults to no disallowed features and a GLES2 context. bool InitializeForTesting(); // Helper that defaults to a GLES2 context. bool InitializeForTesting(const DisallowedFeatures& disallowed_features); const Validators* validators() const { return &validators_; } ContextType context_type() const { return context_type_; } const std::string& extensions() const { return extensions_; } const FeatureFlags& feature_flags() const { return feature_flags_; } const GpuDriverBugWorkarounds& workarounds() const { return workarounds_; } const DisallowedFeatures& disallowed_features() const { return disallowed_features_; } const gfx::GLVersionInfo& gl_version_info() const { DCHECK(gl_version_info_.get()); return *(gl_version_info_.get()); } bool IsES3Capable() const; void EnableES3Validators(); bool IsES3Enabled() const { return unsafe_es3_apis_enabled_; } bool disable_shader_translator() const { return disable_shader_translator_; } bool IsWebGLContext() const; void EnableCHROMIUMColorBufferFloatRGBA(); void EnableCHROMIUMColorBufferFloatRGB(); void EnableEXTColorBufferFloat(); void EnableOESTextureFloatLinear(); void EnableOESTextureHalfFloatLinear(); private: friend class base::RefCounted<FeatureInfo>; friend class BufferManagerClientSideArraysTest; ~FeatureInfo(); void AddExtensionString(const char* s); void InitializeBasicState(const base::CommandLine* command_line); void InitializeFeatures(); Validators validators_; DisallowedFeatures disallowed_features_; ContextType context_type_; // The extensions string returned by glGetString(GL_EXTENSIONS); std::string extensions_; // Flags for some features FeatureFlags feature_flags_; // Flags for Workarounds. const GpuDriverBugWorkarounds workarounds_; // Whether the command line switch kEnableUnsafeES3APIs is passed in. bool enable_unsafe_es3_apis_switch_; bool unsafe_es3_apis_enabled_; bool chromium_color_buffer_float_rgba_available_; bool chromium_color_buffer_float_rgb_available_; bool ext_color_buffer_float_available_; bool oes_texture_float_linear_available_; bool oes_texture_half_float_linear_available_; bool disable_shader_translator_; std::unique_ptr<gfx::GLVersionInfo> gl_version_info_; DISALLOW_COPY_AND_ASSIGN(FeatureInfo); }; } // namespace gles2 } // namespace gpu #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_
fa6a573f221bb2345094c82235e045b41a263f9f
7324bc957e3f7dc4dcab464ed97b4a0688fbebd1
/LeetCode/66. Plus One.cpp
3a87b541b479a6e3af7c9daef919f8d73cfff1d5
[]
no_license
sungzh/leetcode
ca505c108f85bf719f667c5a283a0b6cf0238071
de7a480bdddbb30ed1a7c59f16bcc3337ebdff5e
refs/heads/master
2021-01-17T16:47:11.493866
2018-01-31T06:58:39
2018-01-31T06:58:39
63,408,814
2
0
null
null
null
null
UTF-8
C++
false
false
925
cpp
/* * Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. * * You may assume the integer do not contain any leading zero, except the number 0 itself. * * The digits are stored such that the most significant digit is at the head of the list. * */ /** * * Source: https://leetcode.com/problems/plus-one/ * * Description: Easy Question, no track * * Author: guozheng * * Data: 20170902 * */ #include<vector> using namespace std; class Solution { public: vector<int> plusOne(vector<int>& digits) { int carry = 1; for(int i = digits.size()-1; i >= 0; i--) { int val = (digits[i] + carry)%10; carry = (digits[i] + carry)/10; digits[i] = val; if(carry == 0) break; } if(carry == 1) { digits.insert(digits.begin(), 1); } return digits; } };
0ec15d6c7870b8d39fff6fa04923afc55b619224
80e7fabb18a540b59bef95f01b37dce6dc88b2b4
/Recursive/Q932_Beautiful_Array.cpp
5d5c671532a5986f0c07d6b8f6c51a73d0d1d8f5
[]
no_license
sktzwhj/algorithms
d8fce1fd12e0f46aa0417e0f998892c2273f7950
4b51e66a98931d174ee636969dee30cf0f397b00
refs/heads/master
2021-06-05T17:27:49.383709
2020-01-09T09:05:07
2020-01-09T09:05:07
102,172,473
0
0
null
null
null
null
UTF-8
C++
false
false
837
cpp
// // Created by wu061 on 3/11/18. // #include "headers.h" void print_vec(vector<int> vec) { for (auto val : vec) { cout << val << " "; } cout << endl; } class Solution { public: vector<int> beautifulArray(int N) { //idea: all odd one side and even on the other side. vector<int> ret; if (N == 1) { ret.push_back(1); return ret; } vector<int> left = beautifulArray((N + 1) / 2); vector<int> right = beautifulArray(N / 2); for (int i = 0; i < left.size(); i++) ret.push_back(2 * left[i] - 1); for (int j = 0; j < right.size(); j++) ret.push_back(2 * right[j]); return ret; } }; int main() { Solution s = Solution(); vector<int> beautiful_array = s.beautifulArray(4); print_vec(beautiful_array); }
bdecea8404bc61f16698eff43d6bf78d9c55b53e
ac5a9ba016bc6d68296608f9222330fbddf8f647
/src/core/DICe_Parser.h
9f9844ff175ce81269d7b3c979d269eedc814623
[ "BSD-2-Clause" ]
permissive
jrober/dice
b47d5e5489696ce46b0ce80c56662c007772493f
65e58ecb5b3373489bbf018c75c716a8be9eda6d
refs/heads/master
2021-01-24T20:25:48.048265
2016-07-19T18:18:35
2016-07-19T18:18:35
63,712,387
0
0
null
2016-07-19T16:59:10
2016-07-19T16:59:09
null
UTF-8
C++
false
false
16,493
h
// @HEADER // ************************************************************************ // // Digital Image Correlation Engine (DICe) // Copyright 2015 Sandia Corporation. // // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. // // 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 Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE // 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. // // Questions? Contact: Dan Turner ([email protected]) // // ************************************************************************ // @HEADER #ifndef DICE_PARSER_H #define DICE_PARSER_H #include <DICe.h> #include <DICe_Shape.h> #include <Teuchos_RCP.hpp> #include <Teuchos_ParameterList.hpp> namespace DICe { // input parameter names // using globals here to avoid misspellings /// Input parameter, location to place the output files const char* const output_folder = "output_folder"; /// Input parameter to specify output prefix const char* const output_prefix = "output_prefix"; /// Input parameter, location of the input images const char* const image_folder = "image_folder"; /// Input parameter, only for local DIC const char* const subset_size = "subset_size"; /// Input parameter, only for local DIC const char* const step_size = "step_size"; /// Optional input parameter to specify the x and y coordinates of the subset centroids const char* const subset_file = "subset_file"; /// Input parameter, only for constrained optimization DIC const char* const mesh_file = "mesh_file"; /// Input parameter, only for constrained optimization DIC const char* const time_force_file = "time_force_file"; /// Input parameter, only for constrained optimization DIC const char* const mesh_output_file = "mesh_output_file"; /// Input parameter, only for global DIC const char* const mesh_size = "mesh_size"; /// Input parameter, only for global DIC const char* const image_edge_buffer_size = "image_edge_buffer_size"; /// Input parameter const char* const print_timing = "print_timing"; /// Input parameter const char* const correlation_parameters_file = "correlation_parameters_file"; /// Input parameter const char* const physics_parameters_file = "physics_parameters_file"; // For simple two image correlation /// Input parameter const char* const reference_image = "reference_image"; /// Input parameter const char* const cine_file = "cine_file"; /// Input parameter const char* const cine_ref_index = "cine_ref_index"; /// Input parameter const char* const cine_start_index = "cine_start_index"; /// Input parameter const char* const cine_end_index = "cine_end_index"; /// Input parameter (multiple deformed images not allowed) const char* const deformed_images = "deformed_images"; // For image sequences /// Input parameter const char* const reference_image_index = "reference_image_index"; /// Input parameter const char* const num_images = "num_images"; /// Input parameter const char* const num_file_suffix_digits = "num_file_suffix_digits"; /// Input parameter const char* const image_file_extension = "image_file_extension"; /// Input parameter const char* const image_file_prefix = "image_file_prefix"; /// Input parameter const char* const separate_output_file_for_each_subset = "separate_output_file_for_each_subset"; /// Input parameter const char* const create_separate_run_info_file = "create_separate_run_info_file"; /// \brief Parses the options set in the command line when dice is invoked /// \param argc typical argument from main /// \param argv typical argument from main /// \param force_exit true if the executable should exit gracefully /// \param outStream [out] The output stream, gets set to cout or blackholeStream depending on command line options /// \param analysis_type Global, Local, Constrained Optimziation, ... DICE_LIB_DLL_EXPORT Teuchos::RCP<Teuchos::ParameterList> parse_command_line(int argc, char *argv[], bool & force_exit, Teuchos::RCP<std::ostream> & outStream, const Analysis_Type analysis_type=LOCAL_DIC); /// \brief Read the correlation parameters from a file /// \param paramFileName File name of the correlation parameters file DICE_LIB_DLL_EXPORT Teuchos::RCP<Teuchos::ParameterList> read_correlation_params(const std::string & paramFileName); /// \brief Read the physics parameters from a file /// \param paramFileName File name of the physics parameters file DICE_LIB_DLL_EXPORT Teuchos::RCP<Teuchos::ParameterList> read_physics_params(const std::string & paramFileName); /// struct to hold motion window around a subset to test for movement struct DICE_LIB_DLL_EXPORT Motion_Window_Params { /// constructor Motion_Window_Params(): start_x_(0), start_y_(0), end_x_(0), end_y_(0), tol_(-1.0), use_subset_id_(-1), use_motion_detection_(false), sub_image_id_(-1){}; /// upper left corner x coord int_t start_x_; /// upper left corner y coord int_t start_y_; /// lower right corner x coord int_t end_x_; /// lower right corner y coord int_t end_y_; /// tolerance for motion detection scalar_t tol_; /// point to another subsets' motion window if multiple subsets share one int_t use_subset_id_; /// use motion detection bool use_motion_detection_; /// this gets set after the window images are created and the id is known int_t sub_image_id_; }; /// Simple struct for passing info back and forth from read_subset_file: struct DICE_LIB_DLL_EXPORT Subset_File_Info { /// Generic constructor /// \param info_type optional type argument (assumes SUBSET_INFO) Subset_File_Info(const Subset_File_Info_Type info_type=SUBSET_INFO){ conformal_area_defs = Teuchos::rcp(new std::map<int_t,DICe::Conformal_Area_Def>()); coordinates_vector = Teuchos::rcp(new std::vector<int_t>()); neighbor_vector = Teuchos::rcp(new std::vector<int_t>()); id_sets_map = Teuchos::rcp(new std::map<int_t,std::vector<int_t> >()); force_simplex = Teuchos::rcp(new std::set<int_t>()); size_map = Teuchos::rcp(new std::map<int_t,std::pair<int_t,int_t> >()); displacement_map = Teuchos::rcp(new std::map<int_t,std::pair<scalar_t,scalar_t> >()); normal_strain_map = Teuchos::rcp(new std::map<int_t,std::pair<scalar_t,scalar_t> >()); shear_strain_map = Teuchos::rcp(new std::map<int_t,scalar_t>()); rotation_map = Teuchos::rcp(new std::map<int_t,scalar_t>()); seed_subset_ids = Teuchos::rcp(new std::map<int_t,int_t>()); path_file_names = Teuchos::rcp(new std::map<int_t,std::string>()); optical_flow_flags = Teuchos::rcp(new std::map<int_t,bool>()); skip_solve_flags = Teuchos::rcp(new std::map<int_t,std::vector<int_t> >()); motion_window_params = Teuchos::rcp(new std::map<int_t,Motion_Window_Params>()); num_motion_windows = 0; type = info_type; } /// Pointer to map of conformal subset defs (these are used to define conformal subsets) Teuchos::RCP<std::map<int_t,DICe::Conformal_Area_Def> > conformal_area_defs; /// Pointer to the vector of subset centroid coordinates Teuchos::RCP<std::vector<int_t> > coordinates_vector; /// Pointer to the vector of neighbor ids Teuchos::RCP<std::vector<int_t> > neighbor_vector; /// Pointer to a map that has vectos of subset ids (used to denote blocking subsets) Teuchos::RCP<std::map<int_t,std::vector<int_t> > > id_sets_map; /// Pointer to a set of ids that force simplex method Teuchos::RCP<std::set<int_t> > force_simplex; /// Type of information (subset or region of interest) Subset_File_Info_Type type; /// Pointer to a map of std::pairs of size values Teuchos::RCP<std::map<int_t,std::pair<int_t,int_t> > > size_map; /// Pointer to a map of initial guesses for displacement, the map index is the subset id Teuchos::RCP<std::map<int_t,std::pair<scalar_t,scalar_t> > > displacement_map; /// Pointer to a map of initial guesses for normal strain, the map index is the subset id Teuchos::RCP<std::map<int_t,std::pair<scalar_t,scalar_t> > > normal_strain_map; /// Pointer to a map of initial guesses for shear strain, the map index is the subset id Teuchos::RCP<std::map<int_t,scalar_t> > shear_strain_map; /// Pointer to a map of initial guesses for rotation, the map index is the subset id Teuchos::RCP<std::map<int_t,scalar_t> > rotation_map; /// Map that lists the subset ids for each of the seeds (first value is subset_id, second is roi_id) Teuchos::RCP<std::map<int_t,int_t> > seed_subset_ids; /// Map that lists the names of the path files for each subset Teuchos::RCP<std::map<int_t,std::string> > path_file_names; /// Map that turns on optical flow initializer for certain subsets Teuchos::RCP<std::map<int_t,bool> > optical_flow_flags; /// Map that turns off the solve (initialize only) for certain subsets Teuchos::RCP<std::map<int_t,std::vector<int_t> > > skip_solve_flags; /// Map that tests each frame for motion before performing DIC optimization Teuchos::RCP<std::map<int_t,Motion_Window_Params> > motion_window_params; /// number of motion windows int_t num_motion_windows; }; /// \brief Read a list of coordinates for correlation points from file /// \param fileName String name of the file that defines the subsets /// \param width The image width (used to check for valid coords) /// \param height The image height (used to check for valid coords) /// TODO add conformal subset notes here. DICE_LIB_DLL_EXPORT const Teuchos::RCP<Subset_File_Info> read_subset_file(const std::string & fileName, const int_t width, const int_t height); /// \brief Turns a string read from getline() into tokens /// \param dataFile fstream file to read line from (assumed to be open) /// \param delim Delimiter character /// \param capitalize true if the tokens should be automatically capitalized DICE_LIB_DLL_EXPORT Teuchos::ArrayRCP<std::string> tokenize_line(std::fstream &dataFile, const std::string & delim=" \t", const bool capitalize = true); /// \brief Read a circle from the input file /// \param dataFile fstream file to read line from (assumed to be open) DICE_LIB_DLL_EXPORT Teuchos::RCP<DICe::Circle> read_circle(std::fstream &dataFile); /// \brief Read a circle from the input file /// \param dataFile fstream file to read line from (assumed to be open) DICE_LIB_DLL_EXPORT Teuchos::RCP<DICe::Rectangle> read_rectangle(std::fstream &dataFile); /// \brief Read a polygon from the input file /// \param dataFile fstream file to read line from (assumed to be open) DICE_LIB_DLL_EXPORT Teuchos::RCP<DICe::Polygon> read_polygon(std::fstream &dataFile); /// \brief Read Several shapes from the subset file /// \param dataFile fstream file to read line from (assumed to be open) DICE_LIB_DLL_EXPORT multi_shape read_shapes(std::fstream & dataFile); /// \brief Converts params into string names of all the images in a sequence /// \param params Defines the prefix for the image names, number of images, etc. DICE_LIB_DLL_EXPORT const std::vector<std::string> decipher_image_file_names(Teuchos::RCP<Teuchos::ParameterList> params); /// \brief Creates a regular square grid of correlation points /// \param correlation_points Vector of global point coordinates /// \param neighbor_ids Vector of neighbor ids (established if there is a seed) /// \param params Used to determine the step size (spacing of points) /// \param width The image width /// \param height The image height /// \param subset_file_info Optional information from the subset file (ROIs, etc.) DICE_LIB_DLL_EXPORT void create_regular_grid_of_correlation_points(std::vector<int_t> & correlation_points, std::vector<int_t> & neighbor_ids, Teuchos::RCP<Teuchos::ParameterList> params, const int_t width, const int_t height, Teuchos::RCP<DICe::Subset_File_Info> subset_file_info=Teuchos::null); /// \brief Test to see that the point falls with the boundary of a conformal def and not in the excluded area /// \param x_coord X coordinate of the point in question /// \param y_coord Y coordinate of the point in question /// \param width Image width /// \param height Image height /// \param subset_size Size of the subset /// \param coords Set of valid coordinates in the area /// \param excluded_coords Set of coordinates that should be excluded DICE_LIB_DLL_EXPORT bool valid_correlation_point(const int_t x_coord, const int_t y_coord, const int_t width, const int_t height, const int_t subset_size, std::set<std::pair<int_t,int_t> > & coords, std::set<std::pair<int_t,int_t> > & excluded_coords); /// \brief Create template input files with lots of comments /// \param file_prefix The prefix used to name the template files DICE_LIB_DLL_EXPORT void generate_template_input_files(const std::string & file_prefix); /// \brief Determines if a string is a number /// \param s Input string DICE_LIB_DLL_EXPORT bool is_number(const std::string& s); /// Parser string const char* const parser_comment_char = "#"; /// Parser string const char* const parser_begin = "BEGIN"; /// Parser string const char* const parser_end = "END"; /// Parser string const char* const parser_subset_coordinates = "SUBSET_COORDINATES"; /// Parser string const char* const parser_region_of_interest = "REGION_OF_INTEREST"; /// Parser string const char* const parser_conformal_subset = "CONFORMAL_SUBSET"; /// Parser string const char* const parser_subset_id = "SUBSET_ID"; /// Parser string const char* const parser_boundary = "BOUNDARY"; /// Parser string const char* const parser_excluded = "EXCLUDED"; /// Parser string const char* const parser_obstructed = "OBSTRUCTED"; /// Parser string const char* const parser_blocking_subsets = "BLOCKING_SUBSETS"; /// Parser string const char* const parser_force_simplex = "FORCE_SIMPLEX"; /// Parser string const char* const parser_polygon = "POLYGON"; /// Parser string const char* const parser_circle = "CIRCLE"; /// Parser string const char* const parser_rectangle = "RECTANGLE"; /// Parser string const char* const parser_center = "CENTER"; /// Parser string const char* const parser_radius = "RADIUS"; /// Parser string const char* const parser_vertices = "VERTICES"; /// Parser string const char* const parser_width = "WIDTH"; /// Parser string const char* const parser_height = "HEIGHT"; /// Parser string const char* const parser_upper_left = "UPPER_LEFT"; /// Parser string const char* const parser_lower_right = "LOWER_RIGHT"; /// Parser string const char* const parser_seed = "SEED"; /// Parser string const char* const parser_use_optical_flow = "USE_OPTICAL_FLOW"; /// Parser string const char* const parser_use_path_file = "USE_PATH_FILE"; /// Parser string const char* const parser_skip_solve = "SKIP_SOLVE"; /// Parser string const char* const parser_test_for_motion = "TEST_FOR_MOTION"; /// Parser string const char* const parser_motion_window = "MOTION_WINDOW"; /// Parser string const char* const parser_location = "LOCATION"; /// Parser string const char* const parser_displacement = "DISPLACEMENT"; /// Parser string const char* const parser_normal_strain = "NORMAL_STRAIN"; /// Parser string const char* const parser_shear_strain = "SHEAR_STRAIN"; /// Parser string const char* const parser_rotation = "ROTATION"; }// End DICe Namespace #endif
4d9e9b70cbea1c2adb7eef4bc6024455e931a7d2
35e5d6f189855f95ac4f1fbd728dc15e4012136e
/tools/protobuf/test.pb.h
7a43dd85f2c750f40eb347fc1edef0dbca49065d
[]
no_license
dotheright/mylovelycodes
012517d85240b63c2b1c3f15580f9f314e591024
0e585b7d716f9f63a7b79dccbdf189193f4bf0c5
refs/heads/master
2020-12-22T20:55:51.965688
2018-10-05T10:09:09
2018-10-05T10:09:09
28,511,833
1
2
null
2016-06-21T20:23:55
2014-12-26T13:41:58
null
UTF-8
C++
false
true
10,721
h
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: test.proto #ifndef PROTOBUF_test_2eproto__INCLUDED #define PROTOBUF_test_2eproto__INCLUDED #include <string> #include <google/protobuf/stubs/common.h> #if GOOGLE_PROTOBUF_VERSION < 3004000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif #if 3004000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_table_driven.h> #include <google/protobuf/generated_message_util.h> #include <google/protobuf/metadata.h> #include <google/protobuf/message.h> #include <google/protobuf/repeated_field.h> // IWYU pragma: export #include <google/protobuf/extension_set.h> // IWYU pragma: export #include <google/protobuf/unknown_field_set.h> // @@protoc_insertion_point(includes) namespace Im { class helloworld; class helloworldDefaultTypeInternal; extern helloworldDefaultTypeInternal _helloworld_default_instance_; } // namespace Im namespace Im { namespace protobuf_test_2eproto { // Internal implementation detail -- do not call these. struct TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; static const ::google::protobuf::internal::ParseTable schema[]; static const ::google::protobuf::uint32 offsets[]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; static void InitDefaultsImpl(); }; void AddDescriptors(); void InitDefaults(); } // namespace protobuf_test_2eproto // =================================================================== class helloworld : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Im.helloworld) */ { public: helloworld(); virtual ~helloworld(); helloworld(const helloworld& from); inline helloworld& operator=(const helloworld& from) { CopyFrom(from); return *this; } #if LANG_CXX11 helloworld(helloworld&& from) noexcept : helloworld() { *this = ::std::move(from); } inline helloworld& operator=(helloworld&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const ::google::protobuf::Descriptor* descriptor(); static const helloworld& default_instance(); static inline const helloworld* internal_default_instance() { return reinterpret_cast<const helloworld*>( &_helloworld_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 0; void Swap(helloworld* other); friend void swap(helloworld& a, helloworld& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline helloworld* New() const PROTOBUF_FINAL { return New(NULL); } helloworld* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const helloworld& from); void MergeFrom(const helloworld& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(helloworld* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return NULL; } inline void* MaybeArenaPtr() const { return NULL; } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // required string str = 2; bool has_str() const; void clear_str(); static const int kStrFieldNumber = 2; const ::std::string& str() const; void set_str(const ::std::string& value); #if LANG_CXX11 void set_str(::std::string&& value); #endif void set_str(const char* value); void set_str(const char* value, size_t size); ::std::string* mutable_str(); ::std::string* release_str(); void set_allocated_str(::std::string* str); // required int32 id = 1; bool has_id() const; void clear_id(); static const int kIdFieldNumber = 1; ::google::protobuf::int32 id() const; void set_id(::google::protobuf::int32 value); // optional int32 opt = 3; bool has_opt() const; void clear_opt(); static const int kOptFieldNumber = 3; ::google::protobuf::int32 opt() const; void set_opt(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:Im.helloworld) private: void set_has_id(); void clear_has_id(); void set_has_str(); void clear_has_str(); void set_has_opt(); void clear_has_opt(); // helper for ByteSizeLong() size_t RequiredFieldsByteSizeFallback() const; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr str_; ::google::protobuf::int32 id_; ::google::protobuf::int32 opt_; friend struct protobuf_test_2eproto::TableStruct; }; // =================================================================== // =================================================================== #if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ // helloworld // required int32 id = 1; inline bool helloworld::has_id() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void helloworld::set_has_id() { _has_bits_[0] |= 0x00000002u; } inline void helloworld::clear_has_id() { _has_bits_[0] &= ~0x00000002u; } inline void helloworld::clear_id() { id_ = 0; clear_has_id(); } inline ::google::protobuf::int32 helloworld::id() const { // @@protoc_insertion_point(field_get:Im.helloworld.id) return id_; } inline void helloworld::set_id(::google::protobuf::int32 value) { set_has_id(); id_ = value; // @@protoc_insertion_point(field_set:Im.helloworld.id) } // required string str = 2; inline bool helloworld::has_str() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void helloworld::set_has_str() { _has_bits_[0] |= 0x00000001u; } inline void helloworld::clear_has_str() { _has_bits_[0] &= ~0x00000001u; } inline void helloworld::clear_str() { str_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); clear_has_str(); } inline const ::std::string& helloworld::str() const { // @@protoc_insertion_point(field_get:Im.helloworld.str) return str_.GetNoArena(); } inline void helloworld::set_str(const ::std::string& value) { set_has_str(); str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:Im.helloworld.str) } #if LANG_CXX11 inline void helloworld::set_str(::std::string&& value) { set_has_str(); str_.SetNoArena( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:Im.helloworld.str) } #endif inline void helloworld::set_str(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_str(); str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:Im.helloworld.str) } inline void helloworld::set_str(const char* value, size_t size) { set_has_str(); str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:Im.helloworld.str) } inline ::std::string* helloworld::mutable_str() { set_has_str(); // @@protoc_insertion_point(field_mutable:Im.helloworld.str) return str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string* helloworld::release_str() { // @@protoc_insertion_point(field_release:Im.helloworld.str) clear_has_str(); return str_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void helloworld::set_allocated_str(::std::string* str) { if (str != NULL) { set_has_str(); } else { clear_has_str(); } str_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), str); // @@protoc_insertion_point(field_set_allocated:Im.helloworld.str) } // optional int32 opt = 3; inline bool helloworld::has_opt() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void helloworld::set_has_opt() { _has_bits_[0] |= 0x00000004u; } inline void helloworld::clear_has_opt() { _has_bits_[0] &= ~0x00000004u; } inline void helloworld::clear_opt() { opt_ = 0; clear_has_opt(); } inline ::google::protobuf::int32 helloworld::opt() const { // @@protoc_insertion_point(field_get:Im.helloworld.opt) return opt_; } inline void helloworld::set_opt(::google::protobuf::int32 value) { set_has_opt(); opt_ = value; // @@protoc_insertion_point(field_set:Im.helloworld.opt) } #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) } // namespace Im // @@protoc_insertion_point(global_scope) #endif // PROTOBUF_test_2eproto__INCLUDED
36469908b184e7488d5e9011d6c020b296cbce3e
e8d169c4e5dec1480f4947f02bf83171480ec5e0
/spy.cc
bf2819f60061acaafc8d4ab6da9b8243920b5635
[ "MIT" ]
permissive
Finii/spy
fe8849cfaa700f8d4155a15b0ac327c88f2bd16c
a354ea4096bd38898360b5f9a738b05d33be7ae0
refs/heads/main
2023-08-07T22:27:03.523680
2021-09-23T12:03:50
2021-09-23T12:03:50
409,242,240
0
0
null
null
null
null
UTF-8
C++
false
false
4,205
cc
// spy.cc // // Small tool to observe the raw output of two sockets simultaneously // and print the data received in hexdump and ascii format. // With timestamps. // // My use: I have one Moxa terminal server to spy on a serial communication. // With a double-Y adaptor the RXD of the main connection in sent to one // Moxa port, while the TXD is sent to the other moxa port. // // Resulting is a tcpdump style log of the actual traffic on the rs232 lines. // // This very basic approach has several advantages over more sophisticated // techniques, the main being that it is always correct ;) // // Before this I used several different programs like netcat, socat, wireshark. // Well, none of these gives such a clear representation and is able to detect // cable issues and so on... // // Remark: Not really any error handling, do not use for production // // Compile hint: g++ -std=c++11 spy.cc -lpthread -lboost_system -o spy // // Fini 12/2017 #include <mutex> #include <thread> #include <string> #include <iostream> #include <boost/asio.hpp> #define BOOST_CHRONO_HEADER_ONLY #include <boost/chrono/chrono.hpp> #include <boost/chrono/time_point.hpp> #define BOOST_ALLOW_DEPRECATED_HEADERS #include <boost/chrono/io/time_point_io.hpp> std::mutex cerr_mutex; void hexdump(const void* ptr, const int buflen, const std::string& prompt, int color = 0) { std::lock_guard<std::mutex> lock(cerr_mutex); std::string indent(prompt.length(), ' '); if (color) fprintf(stderr, "\033[%dm", color); // By epatel @ stack overflow // https://stackoverflow.com/a/29865 auto buf = reinterpret_cast<const unsigned char*>(ptr); int i, j; for (i = 0; i < buflen; i += 16) { fprintf(stderr, "%s%06x: ", i ? indent.c_str() : prompt.c_str(), i); for (j = 0; j < 16; j++) if (i + j < buflen) fprintf(stderr, "%02x ", buf[i + j]); else fprintf(stderr, " "); fprintf(stderr, " "); for (j = 0; j < 16; j++) if (i + j < buflen) fprintf(stderr, "%c", isprint(buf[i + j]) ? buf[i + j] : '.'); fprintf(stderr, "\n"); } if (color) fprintf(stderr, "\033[0m"); } using boost::asio::ip::tcp; boost::asio::io_service io_service; struct dump_id { std::string prompt; int color; }; struct hostport { const char* host; const char* port; hostport(const char* h, const char* p) : host{ h } , port{ p } { } }; void dump_all_data(hostport dest, dump_id id, bool ping = false) { // Get a list of endpoints corresponding to the server name. tcp::resolver resolver(io_service); tcp::resolver::query query(dest.host, dest.port); tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); // Try each endpoint until we successfully establish a connection. tcp::socket socket(io_service); boost::asio::connect(socket, endpoint_iterator); const std::string dir = id.prompt; fprintf(stderr ,"Started %s ...\n", dir.c_str()); char b[10000]; auto response = boost::asio::buffer(b, 10000); std::stringstream s; do { if (ping) { // @@TODO@@: in fact we would need a read_some() with // timeout after this, which is to be implemented later socket.write_some(boost::asio::buffer("*", 1)); } s.str(""); int x = socket.read_some(response); s << boost::chrono::time_fmt(boost::chrono::timezone::local) << boost::chrono::system_clock::now() << dir; hexdump(b, x, s.str(), id.color); if (ping) sleep(1); // gosh, how cheap can code be } while (1); } int main(int argc, char* argv[]) { if (argc != 3 && argc != 5 && argc != 7) { std::cout << "Usage: spy <host> <port> [<host> <port>] [<host> <port>]\n\n"; std::cout << " The first two addresses are pure listening, the\n" " third address is used to ping the interface destination\n" " and needs a loopback adaptor to work.\n"; return 1; } std::thread t, t2; if (argc >= 5) { dump_id id{ " <<< ", 32 }; hostport dest{ argv[3], argv[4] }; t = std::thread{ dump_all_data, dest, id , false }; } if (argc >= 7) { dump_id id{ " --- ", 36 }; hostport dest{ argv[5], argv[6] }; t2 = std::thread{ dump_all_data, dest, id , true }; } dump_id id{ " >>> ", 31 }; hostport dest{ argv[1], argv[2] }; dump_all_data(dest, id); }
b8cb4c126d6d433f7186807bb172bec306520113
167b19ff2affb5f896f346f6a289e1265244b72c
/demos/demo_andy_opdracht/main.cpp
98f6844cf53d6ef9e706b3d38e810e90fffb9a20
[]
no_license
3BaFys-2014-2015/will-it-fly
615eae498022fef7fffe35d2185640cc290c5c82
9a401095dea696ede70089dcc8019a1ceba57228
refs/heads/master
2020-05-19T09:18:47.000066
2015-05-25T01:04:02
2015-05-25T01:04:02
33,547,244
0
11
null
2015-05-25T01:04:02
2015-04-07T14:12:58
C++
UTF-8
C++
false
false
4,526
cpp
#include <iostream> #include <cmath> #include <fstream> #include <algorithm> #include <wif_core/wif_core.hpp> #include <wif_algo/wif_algo.hpp> #include <wif_viz/wif_viz.hpp> int main() { double pi = 3.1415; { //Opdracht 12 double radius = 1; unsigned int num_lines = 100; wif_core::vector_2d_c midpoint(0, 0); wif_core::airfoil_c myAirfoil("wif_core/airfoils/n0012-il.dat"); myAirfoil = myAirfoil.get_circle_projection(num_lines, midpoint, radius, 0.0001); myAirfoil = myAirfoil.closed_merge(); double angle_in_degrees = 0; std::shared_ptr<wif_core::uniform_flow_c> myFlow = std::make_shared<wif_core::uniform_flow_c>((angle_in_degrees / 180) * pi, 1); bool Kutta = 0; wif_algo::calculation_results_c myResults = wif_algo::calculate_flow(myAirfoil, myFlow, Kutta); std::vector<wif_core::line_2d_c> mylines = myAirfoil.get_lines(); std::vector<wif_core::vector_2d_c> centers(num_lines); std::vector<double> angles(num_lines); std::vector<double> c_p_boven; std::vector<double> x_as_boven; std::vector<double> c_p_onder; std::vector<double> x_as_onder; for(unsigned int i = 0; i < num_lines; i++) { wif_core::line_2d_c temp_line = mylines[i]; centers[i] = temp_line.get_center_point(); if(temp_line.begin.x > temp_line.end.x && temp_line.begin.y > temp_line.end.y) { angles[i] = temp_line.get_angle() - pi / 2; } else if(temp_line.begin.x > temp_line.end.x && temp_line.begin.y < temp_line.end.y) { angles[i] = temp_line.get_angle() - pi / 2; } else if(temp_line.begin.x < temp_line.end.x && temp_line.begin.y > temp_line.end.y) { angles[i] = temp_line.get_angle() - pi / 2; } else if(temp_line.begin.x < temp_line.end.x && temp_line.begin.y < temp_line.end.y) { angles[i] = temp_line.get_angle() + (3 * pi) / 2; } else if(temp_line.begin.x == temp_line.end.x) { angles[i] = 0; } else if(temp_line.begin.y == temp_line.end.y) { angles[i] = pi / 2; } else { std::cout << i << " Not in any of these categories" << std::endl; } if(centers[i].y > 0) { c_p_boven.push_back(myResults.c_p[i]); x_as_boven.push_back(centers[i].x); } else if(centers[i].y < 0) { c_p_onder.push_back(myResults.c_p[i]); x_as_onder.push_back(centers[i].x); } } int num_elements_boven = c_p_boven.size(); int num_elements_onder = c_p_onder.size(); std::vector<vector<double>> c_p_data(3, std::vector<double>(c_p_onder.size())); std::vector<std::string> Legend(3); Legend[0] = "Bovenkant"; Legend[1] = "Onderkant"; Legend[2] = "Verschil"; c_p_boven.pop_back(); c_p_boven.erase(c_p_boven.begin()); std::reverse(c_p_onder.begin(), c_p_onder.end()); c_p_onder.pop_back(); c_p_data[0] = c_p_boven; c_p_data[1] = c_p_onder; std::vector<double> c_p_differences; for(unsigned int i = 0; i < c_p_boven.size(); i++) { c_p_differences.push_back(c_p_boven[i] - c_p_onder[i]); } c_p_data[2] = c_p_differences; std::shared_ptr<wif_viz::visualization_c> myRoot = wif_viz::create_visualization_root(myFlow, midpoint, midpoint); myRoot->plotVectors(c_p_data, x_as_onder, Legend, "cpbeno.png", "x", "cp", "Aantal panelen = 49, Alpha = 0"); } { // OPDRACHT 13 double radius = 1; wif_core::vector_2d_c midpoint(0, 0); wif_core::airfoil_c myAirfoil("wif_core/airfoils/n0012-il.dat"); double angle_in_degrees = 0; std::shared_ptr<wif_core::uniform_flow_c> myFlow = std::make_shared<wif_core::uniform_flow_c>((angle_in_degrees / 180) * pi, 1); bool Kutta = 0; int max_lines = 100; int step_size = 10; std::vector<double> x_as; std::vector<vector<double>> plotData(1); for(int i = 10; i <= max_lines; i += step_size) { unsigned int num_lines = i; myAirfoil = myAirfoil.get_circle_projection(num_lines, midpoint, radius, 0.0001); myAirfoil = myAirfoil.closed_merge(); wif_algo::calculation_results_c myResults = wif_algo::calculate_flow(myAirfoil, myFlow, Kutta); x_as.push_back(i); plotData[0].push_back(myResults.closed_body_check * 1000); std::cout << "Aantal lijnen: " << i << " Closed Body CheckSum: " << myResults.closed_body_check << std::endl; } std::vector<std::string> Legend(1); Legend[0] = "Som sigma*l"; std::shared_ptr<wif_viz::visualization_c> myRoot = wif_viz::create_visualization_root(myFlow, midpoint, midpoint); myRoot->plotVectors(plotData, x_as, Legend, "closedbodycheck.png", "N", "Sommen sigma*l * 10^3", "Gesloten lichaam check"); } return 0; }
4d1e129258ec88fd27574de41c66abeae11ebad5
d32424b20ae663a143464a9277f8090bd017a7f6
/leetcode/267-PalindromePermutationII.cpp
447ab917e89104bd40c05523295311e9b70fd805
[]
no_license
Vesion/Misirlou
a8df716c17a3072e5cf84b5e279c06e2eac9e6a7
95274c8ccb3b457d5e884bf26948b03967b40b32
refs/heads/master
2023-05-01T10:05:40.709033
2023-04-22T18:41:29
2023-04-22T18:43:05
51,061,447
1
0
null
null
null
null
UTF-8
C++
false
false
1,812
cpp
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <unordered_map> using namespace std; // Solution 1 : trivial backtracking class Solution { public: vector<string> generatePalindromes(string s) { unordered_map<char, int> m; for (char& c : s) m[c]++; int odds = 0; char odd = 0; for (auto& p : m) if (p.second & 1) { odd = p.first; ++odds; } if (odds > 1) return {}; int n = s.size(); vector<string> res; dfs(0, n/2, odd, m, "", res); return res; } void dfs(int start, int n, char odd, unordered_map<char,int>& m, string path, vector<string>& res) { if (start == n) { string r = path; reverse(r.begin(), r.end()); path = path + (odd ? string(1, odd) : "") + r; res.push_back(path); } for (auto& p : m) { if (p.second >= 2) { p.second -= 2; dfs(start+1, n, odd, m, path+p.first, res); p.second += 2; } } } }; // Solution 2 : use std::next_permutation class Solution_2 { public: vector<string> generatePalindromes(string s) { vector<int> m(128, 0); for (char c : s) m[c]++; int odd = 0; string oddc; string half; for (int i = 0; i < 128; ++i) { if (m[i]%2) { ++odd; oddc = i; } half += string(m[i]/2, i); } if (odd > 1) return {}; vector<string> res; do { string r = half; reverse(r.begin(), r.end()); res.push_back(half + (odd ? oddc : "") + r); } while (next_permutation(half.begin(), half.end())); return res; } }; int main() { return 0; }
1f48b6c2e7560eee4e6373a25a7d1cc117382fbf
58ab22b33c39aef4807b9f66b2158bd6138c7b04
/integrator/src/integratorsshworker.cpp
0aa8df5d1523b9a668ec60f0c73b0b5f708567a5
[]
no_license
sarovkalach/atlas_gui
4151d6bddbadb04c95b872ddc324debd2c51b854
4bb356622d72b84ecaecf6e02f4f6a7d1d5c9b65
refs/heads/master
2021-01-21T10:19:48.512219
2017-04-17T06:50:17
2017-04-17T06:50:17
83,409,677
0
1
null
2017-04-17T06:50:17
2017-02-28T08:42:50
C++
UTF-8
C++
false
false
6,890
cpp
#include "integratorsshworker.h" bool IntegratorSSHWorker::executeCommand(const QString &command, int waitMS, bool messageBox, bool closeProgramm){ executor_.start(command); bool finished = executor_.waitForFinished(waitMS); if (!finished){ if (closeProgramm){ cout<<"ERROR "; } else{ cout<<"WARNING "; } cout<<"in IntegratorSSHWorker::executeCommand(const QString &command, int waitMS, bool messageBox, bool closeProgramm) : line "<<__LINE__<<", file "<<__FILE__<<endl; cout<<"\tcan\'t execute command \""<<command.toStdString()<<"\""<<endl; if (messageBox){ if (closeProgramm){ QMessageBox::critical(Q_NULLPTR, tr("Command error"), tr("Can\'t execute command \"") + command + "\""); throw "QProcess command error"; } else{ QMessageBox::warning(Q_NULLPTR, tr("Command error"), tr("Can\'t execute command \"") + command + "\""); } } executor_.kill(); } return finished; } QString IntegratorSSHWorker::getUserName() const{ QSqlQuery query; QSqlQueryModel queryModel; query.prepare("SELECT login FROM atlas.users WHERE id=:ref"); query.bindValue(":ref", owner_); if (!query.exec()){ QMessageBox::critical(Q_NULLPTR, tr("Error"), tr("Sorry, can\'t receive your userName from Database.")); cout<<"ERROR in IntegratorSSHWorker::getUserName() const : line "<<__LINE__<<", file "<<__FILE__<<endl; cout<<"\tmay be it connected with bad setting of ownerID in this class or connection with Database suddenly was corrupted by evil force..."<<endl; cout<<"\townerID = "<<owner_<<endl; throw "Can\'t receive userName from Database"; } queryModel.setQuery(query); return queryModel.data(queryModel.index(0,0)).toString(); } bool IntegratorSSHWorker::tryToSSHFS(){ QString command; command = "mkdir "+sshfsDirName_; qDebug()<<"using command: "<<command; if (!executeCommand(command, 3000, 1, 0)) {return false;} command = "sshfs "+sshfsDirName_+" "+hostName_+":"; qDebug()<<"using command: "<<command; if (!executeCommand(command, 5000, 1, 0)) {return false;} QString userName = getUserName(); qDebug()<<"userName = "<<userName; command = "mkdir " + sshfsDirName_+ "/" +deFaultDirWithDataOnServer_ + "/" + userName; qDebug()<<"using command: "<<command; if (!executeCommand(command, 5000, 1, 0)) {return false;} return true; } bool IntegratorSSHWorker::findCatalogOnServer(const QString& path){ qDebug()<<"FROM findCatalogOnServer"; qDebug()<<"path_in = "<<path; string userPath = path.toStdString(); if (path[path.size()-1] == '/') userPath = path.toStdString().substr(0,path.size()-1); else userPath = path.toStdString(); cout<<"userPath = "<<userPath<<endl; bool dirOnServer = true; QString command; stringstream vss; int resInt = -1; while(1){ command = dirCheker_ + " " + serverRoot_ + "/" + QString::fromStdString(userPath); qDebug()<<"command = "<<command; executeCommand(command, 5000, 0,0); string res = executor_.readAllStandardOutput().toStdString(); cout<<"\tout = "<<res<<endl; resInt = -1; vss.str(res); vss>>resInt; if (resInt == 0) {break;} //директория существует else{ size_t found = userPath.find_first_of("/"); if (found < userPath.size()) userPath = userPath.substr( found+1 , userPath.size() ); else userPath = ""; } if (userPath.empty()){ dirOnServer = false; break; } vss.clear(); vss.str(""); } if (!dirOnServer){ QMessageBox::warning(Q_NULLPTR, tr("Attention"), tr("Your dir is not on Server. Please, choose another dir which belongs to the server folder (use SSHFS).")); return false; } catalogOnServerName_ = serverRoot_ + "/" + QString::fromStdString(userPath); return true; } QString IntegratorSSHWorker::createOutFileNameFromOne(const QString &file) const{ string res; string str = file.toStdString(); size_t found = str.find_last_of('.'); if (found != 0){ res = str.substr(0, found) + ".iout"; if (str == res) res += ".iout"; return QString::fromStdString(res); } else return QString::fromStdString(str) + ".iout"; } QString IntegratorSSHWorker::createOutFileName(const QString& allfiles) const{ if (inFiles_.size() == 1){ return createOutFileNameFromOne(allfiles); } else if (inFiles_.size() > 0){ QString nameWith_In; typename QStringList::const_iterator it = inFiles_.cbegin(); size_t found; string vs; string substr; for(; it != inFiles_.cend(); ++it){ vs = it->toStdString(); found = vs.find_last_of('.'); substr = vs.substr(found); if ( (found != 0) && (substr == ".in" || substr == ".iin") ){ nameWith_In = *it; break; } } if (nameWith_In.isEmpty()){ QString hashh; hashh = QString( QCryptographicHash::hash(allfiles.toStdString().c_str(), QCryptographicHash::Md5).toHex() ); return getUserName() + "_" + QDateTime().currentDateTime().toString("dd.mm.yyyy") + "_" + hashh + ".iout"; } else return createOutFileNameFromOne(nameWith_In); } else{ return getUserName() + ".iout"; } } bool IntegratorSSHWorker::insertRow(const TableIntegrElem& elem){ QSqlQuery query; query.prepare("INSERT INTO atlas.integrate (owner,date,in_file,out_file,integrator_id,comments,catalog) VALUES (:owner, :date, :in_file, :out_file, :integrator_id, :comments, :catalog)"); query.bindValue(":owner", owner_); query.bindValue(":date", QDateTime().currentDateTime().toString("MM.dd.yyyy")); QString allfiles; typename QStringList::const_iterator it = inFiles_.cbegin(); if (inFiles_.size() > 0){ allfiles = *it; ++it; for(; it != inFiles_.cend(); ++it){ allfiles += " ; " + *it; } qDebug()<<"allInFiles = "<<allfiles; } query.bindValue(":in_file", allfiles); QString outFileName = createOutFileName(allfiles); qDebug()<<"outFileName = "<<outFileName; query.bindValue(":out_file", outFileName); query.bindValue(":integrator_id", elem.id); query.bindValue(":comments", comment_); query.bindValue(":catalog", catalogOnServerName_); if (query.exec()){ rowId_ = query.lastInsertId().toInt(); return true; } else{ QMessageBox::warning(Q_NULLPTR, tr("SQL Database error"), tr("Can\'t execute query for inserting row in Database. May be your connection with Database has been broken?")); rowId_ = 0; return false; } } bool IntegratorSSHWorker::start(const QString& path, const TableIntegrElem& elem){ qDebug()<<"FROM IntegratorSSHWorker::start :"; qDebug()<<"path = "<<path; if (!findCatalogOnServer(path)) {return false;} if (!insertRow(elem)) {return false;} stringstream vss; vss<<rowId_; QString command; command = "ssh " + hostName_ + " "+ elem.ref + " " + QString::fromStdString(vss.str()) + ""; qDebug()<<"executing command = "<<command; return executeCommand(command, 5000, 1, 0); } QString IntegratorSSHWorker::init(){ if (tryToSSHFS()) return sshfsDirName_+ "/" +deFaultDirWithDataOnServer_ + "/" + getUserName(); else return ""; }
18a38a8eb7f64e5e8c5159e2923c8eef04e0fe1e
786de89be635eb21295070a6a3452f3a7fe6712c
/psddl_psana/tags/V00-00-08/src/lusi.ddl.cpp
d2615889e24bd23ff3f06fec49f1186b68ea5b0d
[]
no_license
connectthefuture/psdmrepo
85267cfe8d54564f99e17035efe931077c8f7a37
f32870a987a7493e7bf0f0a5c1712a5a030ef199
refs/heads/master
2021-01-13T03:26:35.494026
2015-09-03T22:22:11
2015-09-03T22:22:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,010
cpp
// *** Do not edit this file, it is auto-generated *** #include "psddl_psana/lusi.ddl.h" #include <cstddef> namespace Psana { namespace Lusi { std::vector<int> DiodeFexConfigV1::base_shape() const { std::vector<int> shape; shape.reserve(1); shape.push_back(NRANGES); return shape; } std::vector<int> DiodeFexConfigV1::scale_shape() const { std::vector<int> shape; shape.reserve(1); shape.push_back(NRANGES); return shape; } std::vector<int> DiodeFexConfigV2::base_shape() const { std::vector<int> shape; shape.reserve(1); shape.push_back(NRANGES); return shape; } std::vector<int> DiodeFexConfigV2::scale_shape() const { std::vector<int> shape; shape.reserve(1); shape.push_back(NRANGES); return shape; } IpmFexConfigV1::~IpmFexConfigV1() {} IpmFexConfigV2::~IpmFexConfigV2() {} std::vector<int> IpmFexV1::channel_shape() const { std::vector<int> shape; shape.reserve(1); shape.push_back(NCHANNELS); return shape; } } // namespace Lusi } // namespace Psana
[ "[email protected]@b967ad99-d558-0410-b138-e0f6c56caec7" ]
[email protected]@b967ad99-d558-0410-b138-e0f6c56caec7
08f19311c55be915b0bcfe07749ef6b5570ed281
0e5bd9ec1a8006d117f969042287ea2b45ae1ff4
/RoboMapping/PointFeatureDlg.h
fed449190a7b3fcc7f0ebfa7a14f9978180b4d66
[]
no_license
sven-glory/backup
22b9dc20d13f9ca2d30ba4eb0a5c4c1a516c1c73
f079f76872cda72c2d2bc6a01958bf044efe4930
refs/heads/master
2023-02-25T13:08:08.891726
2020-06-17T01:44:01
2020-06-17T01:44:01
334,567,040
0
0
null
null
null
null
GB18030
C++
false
false
647
h
#pragma once #include "PointFeature.h" // CPointFeatureDlg 对话框 class CPointFeatureDlg : public CDialogEx { DECLARE_DYNAMIC(CPointFeatureDlg) private: // int m_nIdx; CPointFeature* m_pFeature; public: CPointFeatureDlg(int nIdx, CPointFeature* pFeature, CWnd* pParent = NULL); // 标准构造函数 virtual ~CPointFeatureDlg(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_POINT_FEATURE }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP() public: virtual BOOL OnInitDialog(); virtual void OnOK(); float m_fX; float m_fY; int m_nIdx; };
4ce3939c2fd5a3d966b4c796ea628e8222de0de8
9f5242ec43c65ba0d032044cf655723a77ddc689
/src/compat/glibc_sanity.cpp
d73f32b40cdcc9d38d134b12d885361c53153eab
[ "MIT" ]
permissive
TScoin/Transend
22bb1691dc9b86ca7b9ceb4d9dd1be23eae29e7f
6f8f75dbba962dfe9fc9d85b79cebf20625f871d
refs/heads/master
2021-01-25T13:28:20.681340
2018-10-04T22:45:40
2018-10-04T22:45:40
123,572,575
14
8
MIT
2018-03-14T19:50:15
2018-03-02T11:43:38
C++
UTF-8
C++
false
false
1,801
cpp
// Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include "config/transend-config.h" #endif #include <cstddef> #if defined(HAVE_SYS_SELECT_H) #include <sys/select.h> #endif extern "C" void* memcpy(void* a, const void* b, size_t c); void* memcpy_int(void* a, const void* b, size_t c) { return memcpy(a, b, c); } namespace { // trigger: Use the memcpy_int wrapper which calls our internal memcpy. // A direct call to memcpy may be optimized away by the compiler. // test: Fill an array with a sequence of integers. memcpy to a new empty array. // Verify that the arrays are equal. Use an odd size to decrease the odds of // the call being optimized away. template <unsigned int T> bool sanity_test_memcpy() { unsigned int memcpy_test[T]; unsigned int memcpy_verify[T] = {}; for (unsigned int i = 0; i != T; ++i) memcpy_test[i] = i; memcpy_int(memcpy_verify, memcpy_test, sizeof(memcpy_test)); for (unsigned int i = 0; i != T; ++i) { if (memcpy_verify[i] != i) return false; } return true; } #if defined(HAVE_SYS_SELECT_H) // trigger: Call FD_SET to trigger __fdelt_chk. FORTIFY_SOURCE must be defined // as >0 and optimizations must be set to at least -O2. // test: Add a file descriptor to an empty fd_set. Verify that it has been // correctly added. bool sanity_test_fdelt() { fd_set fds; FD_ZERO(&fds); FD_SET(0, &fds); return FD_ISSET(0, &fds); } #endif } // anon namespace bool glibc_sanity_test() { #if defined(HAVE_SYS_SELECT_H) if (!sanity_test_fdelt()) return false; #endif return sanity_test_memcpy<1025>(); }
550e371048db3072ab0cc3a68183ed1471a570cb
b81669a96468e02234cd7660ae192181464147b6
/BoundaryCondition.h
e68f302272620f174873901a3e15fb85cf8fa547
[]
no_license
zyclincoln/Freud
63623ae145a8d269b919e8118165a0d1560eeeac
02c1d5f15cc1ce549832e5f41d620eac02520d8a
refs/heads/master
2022-11-23T04:16:12.541330
2020-07-29T08:10:48
2020-07-29T08:10:48
281,666,408
0
0
null
null
null
null
UTF-8
C++
false
false
669
h
#ifndef BOUNDARYCONDITION_H #define BOUNDARYCONDITION_H #include <QColor> #include <QPoint> #include "Field.h" class BoundaryCondition { public: BoundaryCondition(const QPoint last, const QPoint cur, const QColor& color, const int w, const int h): last_(last), cur_(cur), color_(color), w_(w), h_(h){ } virtual void apply_density(std::vector<Field<double, 1>>& d) { Q_UNUSED(d) }; virtual void apply_velocity(Field<double, 2>& v) { Q_UNUSED(v) }; protected: QPoint last_, cur_; int w_, h_; QColor color_; }; #endif // BOUNDARYCONDITION_H
157a4ac881b38fe12a656382dfdfdc4410a84eb5
105cea794f718d34d0c903f1b4b111fe44018d0e
/chrome/browser/ash/login/test/cryptohome_mixin.h
c8561cde52000fcb73d59cded4d0c48336c397ab
[ "BSD-3-Clause" ]
permissive
blueboxd/chromium-legacy
27230c802e6568827236366afe5e55c48bb3f248
e6d16139aaafff3cd82808a4660415e762eedf12
refs/heads/master.lion
2023-08-12T17:55:48.463306
2023-07-21T22:25:12
2023-07-21T22:25:12
242,839,312
164
12
BSD-3-Clause
2022-03-31T17:44:06
2020-02-24T20:44:13
null
UTF-8
C++
false
false
1,770
h
// Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_ASH_LOGIN_TEST_CRYPTOHOME_MIXIN_H_ #define CHROME_BROWSER_ASH_LOGIN_TEST_CRYPTOHOME_MIXIN_H_ #include <queue> #include "base/gtest_prod_util.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chromeos/ash/components/dbus/cryptohome/rpc.pb.h" #include "chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.h" #include "components/account_id/account_id.h" namespace ash { // Mixin that acts as a broker between tests and FakeUserDataAuthClient, // handling all interactions and transformations. class CryptohomeMixin : public InProcessBrowserTestMixin, public FakeUserDataAuthClient::TestApi { public: explicit CryptohomeMixin(InProcessBrowserTestMixinHost* host); CryptohomeMixin(const CryptohomeMixin&) = delete; CryptohomeMixin& operator=(const CryptohomeMixin&) = delete; ~CryptohomeMixin() override; void SetUpOnMainThread() override; void MarkUserAsExisting(const AccountId& user); std::string AddSession(const AccountId& user, bool authenticated); void AddGaiaPassword(const AccountId& user, std::string password); void AddCryptohomePin(const AccountId& user, const std::string& pin); void SetPinLocked(const AccountId& user, bool locked); bool HasPinFactor(const AccountId& user); void AddRecoveryFactor(const AccountId& user); bool HasRecoveryFactor(const AccountId& user); void SendLegacyFingerprintSuccessScan(); void SendLegacyFingerprintFailureScan(); void SendLegacyFingerprintFailureLockoutScan(); }; } // namespace ash #endif // CHROME_BROWSER_ASH_LOGIN_TEST_CRYPTOHOME_MIXIN_H_
eb1782fd80f38687dab99d0c29da90be7648b3f8
08b8cf38e1936e8cec27f84af0d3727321cec9c4
/data/crawl/git/hunk_3862.cpp
ec3f437f34025b9d5ec45af6d30d17c0c6bf7d84
[]
no_license
ccdxc/logSurvey
eaf28e9c2d6307140b17986d5c05106d1fd8e943
6b80226e1667c1e0760ab39160893ee19b0e9fb1
refs/heads/master
2022-01-07T21:31:55.446839
2018-04-21T14:12:43
2018-04-21T14:12:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,377
cpp
die("'%s' does not appear to be a git repository", argv[1]); /* put received options in sent_argv[] */ - sent_argc = 1; - sent_argv[0] = "git-upload-archive"; - for (p = buf;;) { + argv_array_push(&sent_argv, "git-upload-archive"); + for (;;) { /* This will die if not enough free space in buf */ - len = packet_read_line(0, p, (buf + sizeof buf) - p); + len = packet_read_line(0, buf, sizeof(buf)); if (len == 0) break; /* got a flush */ - if (sent_argc > MAX_ARGS - 2) - die("Too many options (>%d)", MAX_ARGS - 2); + if (sent_argv.argc > MAX_ARGS) + die("Too many options (>%d)", MAX_ARGS - 1); - if (p[len-1] == '\n') { - p[--len] = 0; + if (buf[len-1] == '\n') { + buf[--len] = 0; } - if (len < strlen(arg_cmd) || - strncmp(arg_cmd, p, strlen(arg_cmd))) - die("'argument' token or flush expected"); - len -= strlen(arg_cmd); - memmove(p, p + strlen(arg_cmd), len); - sent_argv[sent_argc++] = p; - p += len; - *p++ = 0; + if (prefixcmp(buf, arg_cmd)) + die("'argument' token or flush expected"); + argv_array_push(&sent_argv, buf + strlen(arg_cmd)); } - sent_argv[sent_argc] = NULL; /* parse all options sent by the client */ - return write_archive(sent_argc, sent_argv, prefix, 0, NULL, 1); + return write_archive(sent_argv.argc, sent_argv.argv, prefix, 0, NULL, 1); } __attribute__((format (printf, 1, 2)))
3e0c08fda958a9c4b74ad170b521e5feaa66d20b
284047fb958e867033fac5eb9893d0fce503d1cf
/chapter9/page327/main.cpp
f1a04ff8c6942a5db3128e914608904d565561dd
[]
no_license
liuxinyu123/cpp-primer
d8bbc4c209e077187221d6bdb12c1f88a0002cfb
5f27e737de13df705fb7f5a57a4a5ac07cb24200
refs/heads/master
2021-01-13T16:42:45.948833
2017-02-22T15:01:32
2017-02-22T15:01:32
77,421,962
1
0
null
null
null
null
UTF-8
C++
false
false
475
cpp
#include <iostream> #include <string> using std::cout; using std::endl; using std::string; int main (int argc, char *argv[]) { int i = 4; string s = std::to_string (i); cout << s << endl; //s.append("hh"); double d = stod (s); cout << d << endl; string str = "pi = 3.14il"; double d1 = stod(str.substr(str.find_first_of("+-.0123456789"))); //double d1 = stod(str, static_cast<size_t>(str.find_first_of("+-.0123456789"))); cout << d1 << endl; return 0; }
bbc13dde7e843e9c61facb4d6ee3bab7fe854b06
2e11ff13bf48d22ea364ca6fa3ead77846a441d0
/openGLtest2/openGLtest2/main.cpp
d0179b203fbeb44a85e0d7f3815a33d0c8486457
[]
no_license
WangDS-AGS/OpenGL-GLFW
c047f43c880906493e2b5d3b6a794aaed0f9f39a
64d4374f6066bf2461ce800b3fd8890d03624593
refs/heads/master
2020-03-26T13:10:21.391913
2018-09-05T08:20:54
2018-09-05T08:20:54
144,926,687
0
0
null
null
null
null
UTF-8
C++
false
false
34,706
cpp
// // main.cpp // openGLtest2 // // Created by 王道胜 on 2018/8/9. // Copyright © 2018年 王道胜. All rights reserved. // #include <iostream> #include <glad/glad.h> #include <GLFW/glfw3.h> #include <stb_image.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <learnopengl/filesystem.h> #include <learnopengl/shader_m.h> #include <learnopengl/camera.h> #include <learnopengl/model.h> #include <assimp/Importer.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #include <iostream> #define TEST_SCENE 0 #define BASIC_LIGHTING_DIFFUSE 0 #define BASIC_LIGHTING_SPECULAR 0 #define MATERIALS 0 #define LIGHTING_MAPS_DIFFUSE 0 #define LIGHTING_MAPS_SPECULAR 0 #define LIGHTING_MAPS_EMISSION 0 #define LIGHTING_CASTERS_DIR 0 #define LIGHTING_CASTERS_POINT 0 #define LIGHTING_CASTERS_SPOT 0 #define LIGHTING_CASTERS_SPOT_SOFT 0 #define MULTIPLE_LIGHT 0 #define LOAD_MODEL_TEST 1 //for chapter 3 model #define SHADER_ROOT_DIR "/Users/wangdaosheng/Desktop/X-Project/Xcode_Source/openGLtest2/shader/" void framebuffer_size_callback(GLFWwindow* window, int width, int height); void mouse_callback(GLFWwindow* window, double xpos, double ypos); void scroll_callback(GLFWwindow* window, double xoffset, double yoffset); void processInput(GLFWwindow *window); unsigned int loadTexture(const char *path); // settings const unsigned int SCR_WIDTH = 800; const unsigned int SCR_HEIGHT = 600; // camera Camera camera(glm::vec3(0.0f, 0.0f, 9.0f)); float lastX = SCR_WIDTH / 2.0f; float lastY = SCR_HEIGHT / 2.0f; bool firstMouse = true; // timing float deltaTime = 0.0f; float lastFrame = 0.0f; // lighting glm::vec3 lightPos(1.2f, 1.0f, 2.0f); int main() { // glfw: initialize and configure // ------------------------------ glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); #ifdef __APPLE__ glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // uncomment this statement to fix compilation on OS X #endif // glfw window creation // -------------------- GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL); if (window == NULL) { std::cout << "Failed to create GLFW window" << std::endl; glfwTerminate(); return -1; } glfwMakeContextCurrent(window); glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); glfwSetCursorPosCallback(window, mouse_callback); glfwSetScrollCallback(window, scroll_callback); // tell GLFW to capture our mouse glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); // glad: load all OpenGL function pointers // --------------------------------------- if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { std::cout << "Failed to initialize GLAD" << std::endl; return -1; } // configure global opengl state // ----------------------------- glEnable(GL_DEPTH_TEST); // build and compile our shader zprogram // ------------------------------------ #if TEST_SCENE Shader lightingShader(SHADER_ROOT_DIR"1.colors.vs", SHADER_ROOT_DIR"1.colors.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if BASIC_LIGHTING_DIFFUSE Shader lightingShader(SHADER_ROOT_DIR"2.1.basic_lighting.vs", SHADER_ROOT_DIR"2.1.basic_lighting.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if BASIC_LIGHTING_SPECULAR Shader lightingShader(SHADER_ROOT_DIR"2.2.basic_lighting.vs", SHADER_ROOT_DIR"2.2.basic_lighting.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if MATERIALS Shader lightingShader(SHADER_ROOT_DIR"3.1.materials.vs", SHADER_ROOT_DIR"3.1.materials.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LIGHTING_MAPS_DIFFUSE Shader lightingShader(SHADER_ROOT_DIR"4.1.lighting_maps.vs", SHADER_ROOT_DIR"4.1.lighting_maps.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LIGHTING_MAPS_SPECULAR Shader lightingShader(SHADER_ROOT_DIR"4.2.lighting_maps.vs", SHADER_ROOT_DIR"4.2.lighting_maps.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LIGHTING_MAPS_EMISSION Shader lightingShader(SHADER_ROOT_DIR"4.3.lighting_maps.vs", SHADER_ROOT_DIR"4.3.lighting_maps.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LIGHTING_CASTERS_DIR Shader lightingShader(SHADER_ROOT_DIR"5.1.light_casters.vs", SHADER_ROOT_DIR"5.1.light_casters.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LIGHTING_CASTERS_POINT Shader lightingShader(SHADER_ROOT_DIR"5.2.light_casters.vs", SHADER_ROOT_DIR"5.2.light_casters.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LIGHTING_CASTERS_SPOT Shader lightingShader(SHADER_ROOT_DIR"5.3.light_casters.vs", SHADER_ROOT_DIR"5.3.light_casters.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LIGHTING_CASTERS_SPOT_SOFT Shader lightingShader(SHADER_ROOT_DIR"5.4.light_casters.vs", SHADER_ROOT_DIR"5.4.light_casters.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if MULTIPLE_LIGHT Shader lightingShader(SHADER_ROOT_DIR"6.multiple_lights.vs", SHADER_ROOT_DIR"6.multiple_lights.fs"); Shader lampShader(SHADER_ROOT_DIR"1.lamp.vs",SHADER_ROOT_DIR"1.lamp.fs"); #endif #if LOAD_MODEL_TEST Shader ourShader(SHADER_ROOT_DIR"7.model_loading.vs", SHADER_ROOT_DIR"7.model_loading.fs"); Model ourModel(FileSystem::getPath("resources/objects/nanosuit/nanosuit.obj")); // load models #endif #if TEST_SCENE // set up vertex data (and buffer(s)) and configure vertex attributes // ------------------------------------------------------------------ float vertices[] = { -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, }; #endif #if BASIC_LIGHTING_DIFFUSE | BASIC_LIGHTING_SPECULAR | MATERIALS float vertices[] = { -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f }; #endif #if LIGHTING_MAPS_DIFFUSE | LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION | \ LIGHTING_CASTERS_DIR | LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | \ LIGHTING_CASTERS_SPOT_SOFT | MULTIPLE_LIGHT float vertices[] = { // positions // normals // texture coords -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }; #endif #if LIGHTING_CASTERS_DIR | LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | \ LIGHTING_CASTERS_SPOT_SOFT | MULTIPLE_LIGHT // positions all containers glm::vec3 cubePositions[] = { glm::vec3( 0.0f, 0.0f, 0.0f), glm::vec3( 2.0f, 5.0f, -15.0f), glm::vec3(-1.5f, -2.2f, -2.5f), glm::vec3(-3.8f, -2.0f, -12.3f), glm::vec3( 2.4f, -0.4f, -3.5f), glm::vec3(-1.7f, 3.0f, -7.5f), glm::vec3( 1.3f, -2.0f, -2.5f), glm::vec3( 1.5f, 2.0f, -2.5f), glm::vec3( 1.5f, 0.2f, -1.5f), glm::vec3(-1.3f, 1.0f, -1.5f) }; #endif #if MULTIPLE_LIGHT // positions of the point lights glm::vec3 pointLightPositions[] = { glm::vec3( 0.7f, 0.2f, 2.0f), glm::vec3( 2.3f, -3.3f, -4.0f), glm::vec3(-4.0f, 2.0f, -12.0f), glm::vec3( 0.0f, 0.0f, -3.0f) }; #endif // first, configure the cube's VAO (and VBO) unsigned int VBO, cubeVAO; glGenVertexArrays(1, &cubeVAO); glGenBuffers(1, &VBO); glBindBuffer(GL_ARRAY_BUFFER, VBO); #if !LOAD_MODEL_TEST glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); #endif glBindVertexArray(cubeVAO); #if TEST_SCENE // position attribute glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); #endif #if BASIC_LIGHTING_DIFFUSE | BASIC_LIGHTING_SPECULAR | MATERIALS // position attribute glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); // normal attribute glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)(3 * sizeof(float))); glEnableVertexAttribArray(1); #endif #if LIGHTING_MAPS_DIFFUSE | LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION | \ LIGHTING_CASTERS_DIR | LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | \ LIGHTING_CASTERS_SPOT_SOFT | MULTIPLE_LIGHT glBindVertexArray(cubeVAO); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(3 * sizeof(float))); glEnableVertexAttribArray(1); glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(6 * sizeof(float))); glEnableVertexAttribArray(2); #endif // second, configure the light's VAO (VBO stays the same; the vertices are the same for the light object which is also a 3D cube) unsigned int lightVAO; glGenVertexArrays(1, &lightVAO); glBindVertexArray(lightVAO); // we only need to bind to the VBO (to link it with glVertexAttribPointer), no need to fill it; the VBO's data already contains all we need (it's already bound, but we do it again for educational purposes) glBindBuffer(GL_ARRAY_BUFFER, VBO); #if TEST_SCENE glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); #endif #if BASIC_LIGHTING_DIFFUSE | BASIC_LIGHTING_SPECULAR | MATERIALS glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); #endif #if LIGHTING_MAPS_DIFFUSE | LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION | \ LIGHTING_CASTERS_DIR | LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | \ LIGHTING_CASTERS_SPOT_SOFT | MULTIPLE_LIGHT glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); // load textures (we now use a utility function to keep the code more organized) unsigned int diffuseMap = loadTexture(FileSystem::getPath("resources/textures/container2.png").c_str()); #if LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION | LIGHTING_CASTERS_DIR | \ LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | LIGHTING_CASTERS_SPOT_SOFT | \ MULTIPLE_LIGHT unsigned int specularMap = loadTexture(FileSystem::getPath("resources/textures/container2_specular.png").c_str()); #endif #if LIGHTING_MAPS_EMISSION unsigned int emissionMap = loadTexture(FileSystem::getPath("resources/textures/matrix.jpg").c_str()); #endif // shader configuration lightingShader.use(); lightingShader.setInt("material.diffuse", 0); #if LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION | LIGHTING_CASTERS_DIR | \ LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | LIGHTING_CASTERS_SPOT_SOFT | \ MULTIPLE_LIGHT lightingShader.setInt("material.specular", 1); #endif #if LIGHTING_MAPS_EMISSION lightingShader.setInt("material.emission", 2); #endif #endif // render loop // ----------- while (!glfwWindowShouldClose(window)) { // per-frame time logic // -------------------- float currentFrame = glfwGetTime(); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; // input // ----- processInput(window); // render // ------ glClearColor(0.1f, 0.1f, 0.1f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // be sure to activate shader when setting uniforms/drawing objects #if LOAD_MODEL_TEST ourShader.use(); #else lightingShader.use(); #endif #if TEST_SCENE lightingShader.setVec3("objectColor", 1.0f, 0.5f, 0.31f); lightingShader.setVec3("lightColor", 1.0f, 1.0f, 1.0f); // view/projection transformations glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); lightingShader.setMat4("projection", projection); lightingShader.setMat4("view", view); #endif #if BASIC_LIGHTING_DIFFUSE | BASIC_LIGHTING_SPECULAR | MATERIALS | \ LIGHTING_MAPS_DIFFUSE lightingShader.setVec3("objectColor", 1.0f, 0.5f, 0.31f); lightingShader.setVec3("lightColor", 1.0f, 1.0f, 1.0f); #endif #if LIGHTING_MAPS_DIFFUSE | LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION | \ LIGHTING_CASTERS_POINT lightingShader.setVec3("light.position", lightPos); #endif #if TEST_SCENE | BASIC_LIGHTING_DIFFUSE | BASIC_LIGHTING_SPECULAR | \ MATERIALS | LIGHTING_CASTERS_DIR | LIGHTING_CASTERS_SPOT | \ LIGHTING_CASTERS_SPOT_SOFT | MULTIPLE_LIGHT lightingShader.setVec3("lightPos", lightPos); #endif #if LIGHTING_CASTERS_DIR lightingShader.setVec3("light.direction", -0.2f, -1.0f, -0.3f); #endif #if LIGHTING_CASTERS_SPOT | LIGHTING_CASTERS_SPOT_SOFT lightingShader.setVec3("light.position", camera.Position); lightingShader.setVec3("light.direction", camera.Front); lightingShader.setFloat("light.cutOff", glm::cos(glm::radians(12.5f))); #endif #if LIGHTING_CASTERS_SPOT_SOFT lightingShader.setFloat("light.outerCutOff", glm::cos(glm::radians(17.5f))); #endif #if BASIC_LIGHTING_SPECULAR | MATERIALS | LIGHTING_MAPS_DIFFUSE | \ LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION | LIGHTING_CASTERS_DIR | \ LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | LIGHTING_CASTERS_SPOT_SOFT | \ MULTIPLE_LIGHT lightingShader.setVec3("viewPos", camera.Position); #endif #if MULTIPLE_LIGHT lightingShader.setFloat("material.shininess", 32.0f); #endif #if MATERIALS // light properties glm::vec3 lightColor; lightColor.x = sin(glfwGetTime() * 2.0f); lightColor.y = sin(glfwGetTime() * 0.7f); lightColor.z = sin(glfwGetTime() * 1.3f); glm::vec3 diffuseColor = lightColor * glm::vec3(0.5f); // decrease the influence glm::vec3 ambientColor = diffuseColor * glm::vec3(0.2f); // low influence #if 1 //material property test{light & material} // light properties lightingShader.setVec3("light.ambient", ambientColor); lightingShader.setVec3("light.diffuse", diffuseColor); lightingShader.setVec3("light.specular", 1.0f, 1.0f, 1.0f); // material properties lightingShader.setVec3("material.ambient", 1.0f, 0.5f, 0.31f); lightingShader.setVec3("material.diffuse", 1.0f, 0.5f, 0.31f); lightingShader.setVec3("material.specular", 0.5f, 0.5f, 0.5f); // specular lighting doesn't have full effect on this object's material lightingShader.setFloat("material.shininess", 32.0f); #else // light properties lightingShader.setVec3("light.ambient", 1.0f, 1.0f, 1.0f); // note that all light colors are set at full intensity lightingShader.setVec3("light.diffuse", 1.0f, 1.0f, 1.0f); lightingShader.setVec3("light.specular", 1.0f, 1.0f, 1.0f); // material properties lightingShader.setVec3("material.ambient", 0.0f, 0.1f, 0.06f); lightingShader.setVec3("material.diffuse", 0.0f, 0.50980392f, 0.50980392f); lightingShader.setVec3("material.specular", 0.50196078f, 0.50196078f, 0.50196078f); lightingShader.setFloat("material.shininess", 32.0f); #endif #endif #if LIGHTING_MAPS_DIFFUSE //lightingShader.setVec3("light.position", lightPos); //lightingShader.setVec3("viewPos", camera.Position); // light properties lightingShader.setVec3("light.ambient", 0.2f, 0.2f, 0.2f); lightingShader.setVec3("light.diffuse", 0.5f, 0.5f, 0.5f); lightingShader.setVec3("light.specular", 1.0f, 1.0f, 1.0f); // material properties lightingShader.setVec3("material.specular", 0.5f, 0.5f, 0.5f); lightingShader.setFloat("material.shininess", 64.0f); #endif #if LIGHTING_MAPS_SPECULAR | LIGHTING_MAPS_EMISSION // light properties lightingShader.setVec3("light.ambient", 0.2f, 0.2f, 0.2f); lightingShader.setVec3("light.diffuse", 0.5f, 0.5f, 0.5f); lightingShader.setVec3("light.specular", 1.0f, 1.0f, 1.0f); // material properties lightingShader.setFloat("material.shininess", 64.0f); #endif #if LIGHTING_CASTERS_DIR // light properties lightingShader.setVec3("light.ambient", 0.2f, 0.2f, 0.2f); lightingShader.setVec3("light.diffuse", 0.5f, 0.5f, 0.5f); lightingShader.setVec3("light.specular", 1.0f, 1.0f, 1.0f); // material properties lightingShader.setFloat("material.shininess", 32.0f); #endif #if LIGHTING_CASTERS_POINT // light properties lightingShader.setVec3("light.ambient", 0.2f, 0.2f, 0.2f); lightingShader.setVec3("light.diffuse", 0.5f, 0.5f, 0.5f); lightingShader.setVec3("light.specular", 1.0f, 1.0f, 1.0f); lightingShader.setFloat("light.constant", 1.0f); lightingShader.setFloat("light.linear", 0.09f); lightingShader.setFloat("light.quadratic", 0.032f); // material properties lightingShader.setFloat("material.shininess", 32.0f); #endif #if LIGHTING_CASTERS_SPOT | LIGHTING_CASTERS_SPOT_SOFT // light properties lightingShader.setVec3("light.ambient", 0.1f, 0.1f, 0.1f); // we configure the diffuse intensity slightly higher; the right lighting conditions differ with each lighting method and environment. // each environment and lighting type requires some tweaking to get the best out of your environment. lightingShader.setVec3("light.diffuse", 0.8f, 0.8f, 0.8f); lightingShader.setVec3("light.specular", 1.0f, 1.0f, 1.0f); lightingShader.setFloat("light.constant", 1.0f); lightingShader.setFloat("light.linear", 0.09f); lightingShader.setFloat("light.quadratic", 0.032f); // material properties lightingShader.setFloat("material.shininess", 32.0f); #endif #if MULTIPLE_LIGHT // directional light lightingShader.setVec3("dirLight.direction", -0.2f, -1.0f, -0.3f); lightingShader.setVec3("dirLight.ambient", 0.05f, 0.05f, 0.05f); lightingShader.setVec3("dirLight.diffuse", 0.4f, 0.4f, 0.4f); lightingShader.setVec3("dirLight.specular", 0.5f, 0.5f, 0.5f); // point light 1 lightingShader.setVec3("pointLights[0].position", pointLightPositions[0]); lightingShader.setVec3("pointLights[0].ambient", 0.05f, 0.05f, 0.05f); lightingShader.setVec3("pointLights[0].diffuse", 0.8f, 0.8f, 0.8f); lightingShader.setVec3("pointLights[0].specular", 1.0f, 1.0f, 1.0f); lightingShader.setFloat("pointLights[0].constant", 1.0f); lightingShader.setFloat("pointLights[0].linear", 0.09); lightingShader.setFloat("pointLights[0].quadratic", 0.032); // point light 2 lightingShader.setVec3("pointLights[1].position", pointLightPositions[1]); lightingShader.setVec3("pointLights[1].ambient", 0.05f, 0.05f, 0.05f); lightingShader.setVec3("pointLights[1].diffuse", 0.8f, 0.8f, 0.8f); lightingShader.setVec3("pointLights[1].specular", 1.0f, 1.0f, 1.0f); lightingShader.setFloat("pointLights[1].constant", 1.0f); lightingShader.setFloat("pointLights[1].linear", 0.09); lightingShader.setFloat("pointLights[1].quadratic", 0.032); // point light 3 lightingShader.setVec3("pointLights[2].position", pointLightPositions[2]); lightingShader.setVec3("pointLights[2].ambient", 0.05f, 0.05f, 0.05f); lightingShader.setVec3("pointLights[2].diffuse", 0.8f, 0.8f, 0.8f); lightingShader.setVec3("pointLights[2].specular", 1.0f, 1.0f, 1.0f); lightingShader.setFloat("pointLights[2].constant", 1.0f); lightingShader.setFloat("pointLights[2].linear", 0.09); lightingShader.setFloat("pointLights[2].quadratic", 0.032); // point light 4 lightingShader.setVec3("pointLights[3].position", pointLightPositions[3]); lightingShader.setVec3("pointLights[3].ambient", 0.05f, 0.05f, 0.05f); lightingShader.setVec3("pointLights[3].diffuse", 0.8f, 0.8f, 0.8f); lightingShader.setVec3("pointLights[3].specular", 1.0f, 1.0f, 1.0f); lightingShader.setFloat("pointLights[3].constant", 1.0f); lightingShader.setFloat("pointLights[3].linear", 0.09); lightingShader.setFloat("pointLights[3].quadratic", 0.032); // spotLight lightingShader.setVec3("spotLight.position", camera.Position); lightingShader.setVec3("spotLight.direction", camera.Front); lightingShader.setVec3("spotLight.ambient", 0.0f, 0.0f, 0.0f); lightingShader.setVec3("spotLight.diffuse", 1.0f, 1.0f, 1.0f); lightingShader.setVec3("spotLight.specular", 1.0f, 1.0f, 1.0f); lightingShader.setFloat("spotLight.constant", 1.0f); lightingShader.setFloat("spotLight.linear", 0.09); lightingShader.setFloat("spotLight.quadratic", 0.032); lightingShader.setFloat("spotLight.cutOff", glm::cos(glm::radians(12.5f))); lightingShader.setFloat("spotLight.outerCutOff", glm::cos(glm::radians(15.0f))); #endif // view/projection transformations glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); #if LOAD_MODEL_TEST ourShader.setMat4("projection", projection); ourShader.setMat4("view", view); #else lightingShader.setMat4("projection", projection); lightingShader.setMat4("view", view); #endif // world transformation glm::mat4 model; #if LOAD_MODEL_TEST ourShader.setMat4("model", model); #else lightingShader.setMat4("model", model); #endif #if LIGHTING_MAPS_DIFFUSE | LIGHTING_MAPS_SPECULAR | LIGHTING_CASTERS_DIR | \ LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | LIGHTING_CASTERS_SPOT_SOFT | \ MULTIPLE_LIGHT // bind diffuse map glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, diffuseMap); // bind specular map #endif #if LIGHTING_MAPS_SPECULAR | LIGHTING_CASTERS_DIR | LIGHTING_CASTERS_POINT | \ LIGHTING_CASTERS_SPOT | LIGHTING_CASTERS_SPOT_SOFT | MULTIPLE_LIGHT glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, specularMap); #endif #if LIGHTING_MAPS_EMISSION // bind emission map glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, emissionMap); #endif // render the cube glBindVertexArray(cubeVAO); #if LIGHTING_CASTERS_DIR | LIGHTING_CASTERS_POINT | LIGHTING_CASTERS_SPOT | \ LIGHTING_CASTERS_SPOT_SOFT | MULTIPLE_LIGHT for (unsigned int i = 0; i < 10; i++) { // calculate the model matrix for each object and pass it to shader before drawing glm::mat4 model; model = glm::translate(model, cubePositions[i]); float angle = 20.0f * i; model = glm::rotate(model, glm::radians(angle), glm::vec3(1.0f, 0.3f, 0.5f)); lightingShader.setMat4("model", model); glDrawArrays(GL_TRIANGLES, 0, 36); } #endif #if TEST_SCENE | BASIC_LIGHTING_DIFFUSE | BASIC_LIGHTING_SPECULAR | \ MATERIALS | LIGHTING_MAPS_DIFFUSE | LIGHTING_MAPS_SPECULAR | \ LIGHTING_MAPS_EMISSION | LIGHTING_CASTERS_POINT glDrawArrays(GL_TRIANGLES, 0, 36); // also draw the lamp object lampShader.use(); lampShader.setMat4("projection", projection); lampShader.setMat4("view", view); model = glm::mat4(); model = glm::translate(model, lightPos); model = glm::scale(model, glm::vec3(0.2f)); // a smaller cube lampShader.setMat4("model", model); glBindVertexArray(lightVAO); glDrawArrays(GL_TRIANGLES, 0, 36); #endif #if MULTIPLE_LIGHT lampShader.use(); lampShader.setMat4("projection", projection); lampShader.setMat4("view", view); // we now draw as many light bulbs as we have point lights. glBindVertexArray(lightVAO); for (unsigned int i = 0; i < 4; i++) { model = glm::mat4(); model = glm::translate(model, pointLightPositions[i]); model = glm::scale(model, glm::vec3(0.2f)); // Make it a smaller cube lampShader.setMat4("model", model); glDrawArrays(GL_TRIANGLES, 0, 36); } #endif #if LOAD_MODEL_TEST model = glm::translate(model, glm::vec3(0.0f, -1.75f, 0.0f)); // translate it down so it's at the center of the scene model = glm::scale(model, glm::vec3(0.2f, 0.2f, 0.2f)); // it's a bit too big for our scene, so scale it down ourShader.setMat4("model", model); ourModel.Draw(ourShader); #endif // glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.) // ------------------------------------------------------------------------------- glfwSwapBuffers(window); glfwPollEvents(); } // optional: de-allocate all resources once they've outlived their purpose: // ------------------------------------------------------------------------ glDeleteVertexArrays(1, &cubeVAO); glDeleteVertexArrays(1, &lightVAO); glDeleteBuffers(1, &VBO); // glfw: terminate, clearing all previously allocated GLFW resources. // ------------------------------------------------------------------ glfwTerminate(); return 0; } // process all input: query GLFW whether relevant keys are pressed/released this frame and react accordingly // --------------------------------------------------------------------------------------------------------- void processInput(GLFWwindow *window) { if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) glfwSetWindowShouldClose(window, true); if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS) camera.ProcessKeyboard(FORWARD, deltaTime); if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) camera.ProcessKeyboard(BACKWARD, deltaTime); if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS) camera.ProcessKeyboard(LEFT, deltaTime); if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS) camera.ProcessKeyboard(RIGHT, deltaTime); } // glfw: whenever the window size changed (by OS or user resize) this callback function executes // --------------------------------------------------------------------------------------------- void framebuffer_size_callback(GLFWwindow* window, int width, int height) { // make sure the viewport matches the new window dimensions; note that width and // height will be significantly larger than specified on retina displays. glViewport(0, 0, width, height); } // glfw: whenever the mouse moves, this callback is called // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xpos, double ypos) { if (firstMouse) { lastX = xpos; lastY = ypos; firstMouse = false; } float xoffset = xpos - lastX; float yoffset = lastY - ypos; // reversed since y-coordinates go from bottom to top lastX = xpos; lastY = ypos; camera.ProcessMouseMovement(xoffset, yoffset); } // glfw: whenever the mouse scroll wheel scrolls, this callback is called // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { camera.ProcessMouseScroll(yoffset); } // utility function for loading a 2D texture from file // --------------------------------------------------- unsigned int loadTexture(char const * path) { unsigned int textureID; glGenTextures(1, &textureID); int width, height, nrComponents; unsigned char *data = stbi_load(path, &width, &height, &nrComponents, 0); if (data) { GLenum format; if (nrComponents == 1) format = GL_RED; else if (nrComponents == 3) format = GL_RGB; else if (nrComponents == 4) format = GL_RGBA; glBindTexture(GL_TEXTURE_2D, textureID); glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, data); glGenerateMipmap(GL_TEXTURE_2D); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); stbi_image_free(data); } else { std::cout << "Texture failed to load at path: " << path << std::endl; stbi_image_free(data); } return textureID; }
fc6d502ac8946449c75b6c42553b053e222a3155
37860b1135d21e1af386ad414ce1ed192f23717b
/GCJPractice/B.cpp
67fa96300a568b981954f69582437ecc3d568c52
[]
no_license
bnuzhanyu/GCJ
d9e42882ef45908efd17b168c5c451f55524b872
db6a156be737349c8c35445bad8f3d8ff0ddc81e
refs/heads/master
2022-07-01T05:16:00.920563
2022-05-16T05:53:11
2022-05-16T05:53:11
83,320,956
0
0
null
null
null
null
UTF-8
C++
false
false
2,480
cpp
#include <iostream> #include <string.h> #include <algorithm> #include <cstdio> #include <map> #include <vector> #include <cmath> using namespace std; struct PUZZLE{ int pass[4]; PUZZLE(){ pass[0] = pass[1] = pass[2] = pass[3] = 0; } void set(int d, int v){ pass[d] = v;} int res(){ return pass[2]|(pass[0]<<1)|(pass[3]<<2)|(pass[1]<<3); } }; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; int minx=10010, miny=10010, maxx=-1, maxy=-1; vector<vector<PUZZLE> > puzzle; int R, C; void setPass(int x, int y, int d) { if(x>=0 && x<R && y>=0 && y<C) puzzle[x][y].set(d, 1); } void getPuzzle(char *path, int sx, int sy, int &ex, int& ey, int &d, bool check = false){ int len = strlen(path); int x = sx, y = sy; int i=0; while(i<len-1){ if(path[i] == 'W'){ if(check) setPass(x, y, d); x += dx[d]; y += dy[d]; maxx = max(x, maxx); minx = min(x, minx); maxy = max(y, maxy); miny = min(y, miny); } else if(path[i] == 'L'){ d++; d&=3; } else if(path[i] == 'R'){ d--; d&=3; } i++; } if(check) setPass(x, y, d); ex = x+dx[d]; ey = y+dy[d]; d=(d+2)&3; } const int MAXN = 10010; char path1[MAXN], path2[MAXN]; void ReadAndSolve(){ int T; scanf("%d", &T); for(int ca=1; ca<=T; ca++){ scanf("%s%s", path1, path2); minx=10010, miny=10010, maxx=-1, maxy=-1; int ex, ey, d = 0; getPuzzle(path1, -1, 0, ex, ey, d); getPuzzle(path2, ex, ey, ex, ey, d); R = maxx - minx + 1; C = maxy - miny + 1; puzzle.clear(); puzzle.resize(R); for(int i=0; i<R; i++) puzzle[i].resize(C); ex = -1, ey = 0 - minx, d = 0; getPuzzle(path1, -1, -miny, ex, ey, d, true); getPuzzle(path2, ex, ey, ex, ey, d, true); printf("Case #%d:\n", ca); for(int i=0; i<R; i++){ for(int j=0; j<C; j++) printf("%x", puzzle[i][j].res()); printf("\n"); } } } void UseStdIO() { ReadAndSolve(); } void UseFileIO(){ freopen("GCJPP-B-large.in", "r", stdin); freopen("GCJPP-B-large.out", "w", stdout); ReadAndSolve(); } int main() { //UseStdIO(); UseFileIO(); return 0; }
f2343aa8e6109f603da5ae8dd3dbfe3d4c51f27a
b6272bc7362e9fe3039c44719d217f548541fefa
/Utils/interface/ModifiedTH1.hpp
6665a5b6cc9e388394604bc971f392978054a340
[]
no_license
supergravity/vbf_analysis
4848457360109beca138c943d0ec21dc1216950c
69b9e86bc42b41814eda180fe1d9e2a05d3f05a9
refs/heads/master
2020-12-30T14:45:49.136295
2017-04-25T04:29:03
2017-04-25T04:29:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,848
hpp
#ifndef __MODIFIEDTH1_HPP__ #define __MODIFIEDTH1_HPP__ #include <string> #include <vector> #include <utility> #include "TH1.h" #include "TH1F.h" #include "TH1D.h" template <typename T> class ModifiedTH1 { public: ModifiedTH1 ( std::string name, int nbin, double min, double max ); ModifiedTH1 ( T* plot ); ModifiedTH1 ( const ModifiedTH1& modifiedTH1 ); ~ModifiedTH1 (); void ResetArtStyle (); void ConvertToLinePlot ( Color_t color, Style_t style ); void ConvertToFillPlot ( Color_t color, Style_t style ); void ConvertToPointPlot ( Color_t color, Style_t style, Size_t size ); void ConvertToBoxErrorPlot ( Color_t color, double transparency ); void Draw( std::string DrawOption ); void SetScaleWeight ( double scaleweight ); void SetXYaxis ( std::string xLabel, std::string yLabel, std::string invisible = "" ); void FillEvent ( double value, double weight ); void SetYaxisRange ( double ymin, double ymax ); void WriteInFile (); void AddPlot ( T* plot ); void Reset (); void SetBinContent ( std::vector<std::pair<double,double>> contentset ); T* GetObject () { return plot_; } const double GetWeightEventN ( double min, double max ); const double GetEventN (); const int GetNbinsX () { return nbin_; } const double GetMaxContent () { return plot_ -> GetMaximum(); } std::vector<std::pair<double,double>> GetBinContent (); std::pair<double,double> GetXRange () { return std::make_pair(plot_->GetXaxis()-> GetXmin(),plot_->GetXaxis()-> GetXmax()); } private: std::string name_; double nbin_; double min_; double max_; T* plot_; }; #include "vbf_analysis/Utils/src/ModifiedTH1.ipp" #endif
2ec4fbfe2098e47a9dcf2dd02c5f50ea905149bd
c8a2715172adaf4e0512e78d1d0079bf75076fee
/Carnivores 2/Game.cpp
d738676d39bef4dd9916d22fb4930f65257d4aab
[]
no_license
Rexhunter99/carnivores_original
011dbe7df60dc60b70e0e526a8c5134c8cfa176c
022cc1761ddd294df8aa0b8035edceecb84ecafb
refs/heads/master
2023-04-29T21:17:32.716043
2019-03-16T15:17:29
2019-03-16T15:22:20
189,130,815
0
2
null
2019-05-29T01:46:06
2019-05-29T01:46:05
null
UTF-8
C++
false
false
45,256
cpp
#include "Hunt.h" /*typedef struct tagAudioQuad { float x1,y1,z1; float x2,y2,z2; float x3,y3,z3; float x4,y4,z4; } AudioQuad; AudioQuad data[8192]; HMap[1024][1024]; */ bool ShowFaces = true; void UploadGeometry() { int x,y,xx,yy; byte temp; AudioFCount = 0; int MaxView = 18; int HalfView = (int)(MaxView/2)+1; for (x = 0; x < MaxView; x++) for (y = 0; y < MaxView; y++) { xx = (x - HalfView)*2; yy = (y - HalfView)*2; data[AudioFCount].x1 = (CCX+xx) * 256 - CameraX; data[AudioFCount].y1 = HMap[CCY+yy][CCX+xx] * ctHScale - CameraY; data[AudioFCount].z1 = (CCY+yy) * 256 - CameraZ; xx = ((x+1) - HalfView)*2; yy = (y - HalfView)*2; data[AudioFCount].x2 = (CCX+xx) * 256 - CameraX; data[AudioFCount].y2 = HMap[CCY+yy][CCX+xx] * ctHScale - CameraY; data[AudioFCount].z2 = (CCY+yy) * 256 - CameraZ; xx = ((x+1) - HalfView)*2; yy = ((y+1) - HalfView)*2; data[AudioFCount].x3 = (CCX+xx) * 256 - CameraX; data[AudioFCount].y3 = HMap[CCY+yy][CCX+xx] * ctHScale - CameraY; data[AudioFCount].z3 = (CCY+yy) * 256 - CameraZ; xx = (x - HalfView)*2; yy = ((y+1) - HalfView)*2; data[AudioFCount].x4 = (CCX+xx) * 256 - CameraX; data[AudioFCount].y4 = HMap[CCY+yy][CCX+xx] * ctHScale - CameraY; data[AudioFCount].z4 = (CCY+yy) * 256 - CameraZ; AudioFCount++; } // MessageBeep(-1); if (ShowFaces) { wsprintf(logt,"Audio_UpdateGeometry: %i faces uploaded\n", AudioFCount); PrintLog(logt); ShowFaces = false;} } void SetupRes() { if (!HARD3D) if (OptRes>5) OptRes=5; if (OptRes==0) { WinW = 320; WinH=240; } if (OptRes==1) { WinW = 400; WinH=300; } if (OptRes==2) { WinW = 512; WinH=384; } if (OptRes==3) { WinW = 640; WinH=480; } if (OptRes==4) { WinW = 800; WinH=600; } if (OptRes==5) { WinW =1024; WinH=768; } if (OptRes==6) { WinW =1280; WinH=1024; } if (OptRes==7) { WinW =1600; WinH=1200; } } float GetLandOH(int x, int y) { return (float)(HMapO[y][x]) * ctHScale; } float GetLandOUH(int x, int y) { if (FMap[y][x] & fmReverse) return (float)((int)(HMap[y][x+1]+HMap[y+1][x])/2.f)*ctHScale; else return (float)((int)(HMap[y][x]+HMap[y+1][x+1])/2.f)*ctHScale; } float GetLandUpH(float x, float y) { int CX = (int)x / 256; int CY = (int)y / 256; if (!(FMap[CY][CX] & fmWaterA)) return GetLandH(x,y); return (float)(WaterList[ WMap[CY][CX] ].wlevel * ctHScale); } float GetLandH(float x, float y) { int CX = (int)x / 256; int CY = (int)y / 256; int dx = (int)x % 256; int dy = (int)y % 256; int h1 = HMap[CY][CX]; int h2 = HMap[CY][CX+1]; int h3 = HMap[CY+1][CX+1]; int h4 = HMap[CY+1][CX]; if (FMap[CY][CX] & fmReverse) { if (256-dx>dy) h3 = h2+h4-h1; else h1 = h2+h4-h3; } else { if (dx>dy) h4 = h1+h3-h2; else h2 = h1+h3-h4; } float h = (float) (h1 * (256-dx) + h2 * dx) * (256-dy) + (h4 * (256-dx) + h3 * dx) * dy; return (h / 256.f / 256.f) * ctHScale; } float GetLandLt(float x, float y) { int CX = (int)x / 256; int CY = (int)y / 256; int dx = (int)x % 256; int dy = (int)y % 256; int h1 = LMap[CY][CX]; int h2 = LMap[CY][CX+1]; int h3 = LMap[CY+1][CX+1]; int h4 = LMap[CY+1][CX]; float h = (float) (h1 * (256-dx) + h2 * dx) * (256-dy) + (h4 * (256-dx) + h3 * dx) * dy; return (h / 256.f / 256.f); } float GetLandLt2(float x, float y) { int CX = ((int)x / 512)*2 - CCX; int CY = ((int)y / 512)*2 - CCY; int dx = (int)x % 512; int dy = (int)y % 512; int h1 = VMap[CY+128][CX+128].Light; int h2 = VMap[CY+128][CX+2+128].Light; int h3 = VMap[CY+2+128][CX+2+128].Light; int h4 = VMap[CY+2+128][CX+128].Light; float h = (float) (h1 * (512-dx) + h2 * dx) * (512-dy) + (h4 * (512-dx) + h3 * dx) * dy; return (h / 512.f / 512.f); } void CalcModelGroundLight(TModel *mptr, float x0, float z0, int FI) { float ca = cos(FI * pi / 2); float sa = sin(FI * pi / 2); for (int v=0; v<mptr->VCount; v++) { float x = mptr->gVertex[v].x * ca + mptr->gVertex[v].z * sa + x0; float z = mptr->gVertex[v].z * ca - mptr->gVertex[v].x * sa + z0; mptr->VLight[0][v] = GetLandLt2(x, z) - 128; } } BOOL PointOnBound(float &H, float px, float py, float cx, float cy, float oy, TBound *bound, int angle) { px-=cx; py-=cy; float ca = (float) cos(angle*pi / 2.f); float sa = (float) sin(angle*pi / 2.f); BOOL _on = FALSE; H=-1000; for (int o=0; o<8; o++) { if (bound[o].a<0) continue; if (bound[o].y2 + oy > PlayerY + 128) continue; float a,b; float ccx = bound[o].cx*ca + bound[o].cy*sa; float ccy = bound[o].cy*ca - bound[o].cx*sa; if (angle & 1) { a = bound[o].b; b = bound[o].a; } else { a = bound[o].a; b = bound[o].b; } if ( ( fabs(px - ccx) < a) && (fabs(py - ccy) < b) ) { _on=TRUE; if (H < bound[o].y2) H = bound[o].y2; } } return _on; } BOOL PointUnBound(float &H, float px, float py, float cx, float cy, float oy, TBound *bound, int angle) { px-=cx; py-=cy; float ca = (float) cos(angle*pi / 2.f); float sa = (float) sin(angle*pi / 2.f); BOOL _on = FALSE; H=+1000; for (int o=0; o<8; o++) { if (bound[o].a<0) continue; if (bound[o].y1 + oy < PlayerY + 128) continue; float a,b; float ccx = bound[o].cx*ca + bound[o].cy*sa; float ccy = bound[o].cy*ca - bound[o].cx*sa; if (angle & 1) { a = bound[o].b; b = bound[o].a; } else { a = bound[o].a; b = bound[o].b; } if ( ( fabs(px - ccx) < a) && (fabs(py - ccy) < b) ) { _on=TRUE; if (H > bound[o].y1) H = bound[o].y1; } } return _on; } float GetLandCeilH(float CameraX, float CameraZ) { float h,hh; h = GetLandH(CameraX, CameraZ) + 20480; int ccx = (int)CameraX / 256; int ccz = (int)CameraZ / 256; for (int z=-4; z<=4; z++) for (int x=-4; x<=4; x++) if (OMap[ccz+z][ccx+x]!=255) { int ob = OMap[ccz+z][ccx+x]; float CR = (float)MObjects[ob].info.Radius - 1.f; float oz = (ccz+z) * 256.f + 128.f; float ox = (ccx+x) * 256.f + 128.f; float LandY = GetLandOH(ccx+x, ccz+z); if (!(MObjects[ob].info.flags & ofBOUND)) { if (MObjects[ob].info.YLo + LandY > h) continue; if (MObjects[ob].info.YLo + LandY < PlayerY+100) continue; } float r = CR+1; if (MObjects[ob].info.flags & ofBOUND) { float hh; if (PointUnBound(hh, CameraX, CameraZ, ox, oz, LandY, MObjects[ob].bound, ((FMap[ccz+z][ccx+x] >> 2) & 3) ) ) if (h > LandY + hh) h = LandY + hh; } else { if (MObjects[ob].info.flags & ofCIRCLE) r = (float) sqrt( (ox-CameraX)*(ox-CameraX) + (oz-CameraZ)*(oz-CameraZ) ); else r = (float) max( fabs(ox-CameraX) , fabs(oz-CameraZ) ); if (r<CR) h = MObjects[ob].info.YLo + LandY; } } return h; } float GetLandQH(float CameraX, float CameraZ) { float h,hh; h = GetLandH(CameraX, CameraZ); hh = GetLandH(CameraX-90.f, CameraZ-90.f); if (hh>h) h=hh; hh = GetLandH(CameraX+90.f, CameraZ-90.f); if (hh>h) h=hh; hh = GetLandH(CameraX-90.f, CameraZ+90.f); if (hh>h) h=hh; hh = GetLandH(CameraX+90.f, CameraZ+90.f); if (hh>h) h=hh; hh = GetLandH(CameraX+128.f, CameraZ); if (hh>h) h=hh; hh = GetLandH(CameraX-128.f, CameraZ); if (hh>h) h=hh; hh = GetLandH(CameraX, CameraZ+128.f); if (hh>h) h=hh; hh = GetLandH(CameraX, CameraZ-128.f); if (hh>h) h=hh; int ccx = (int)CameraX / 256; int ccz = (int)CameraZ / 256; for (int z=-4; z<=4; z++) for (int x=-4; x<=4; x++) if (OMap[ccz+z][ccx+x]!=255) { int ob = OMap[ccz+z][ccx+x]; float CR = (float)MObjects[ob].info.Radius - 1.f; float oz = (ccz+z) * 256.f + 128.f; float ox = (ccx+x) * 256.f + 128.f; float LandY = GetLandOH(ccx+x, ccz+z); if (!(MObjects[ob].info.flags & ofBOUND)) { if (MObjects[ob].info.YHi + LandY < h) continue; if (MObjects[ob].info.YHi + LandY > PlayerY+128) continue; //if (MObjects[ob].info.YLo + LandY > PlayerY+256) continue; } float r = CR+1; if (MObjects[ob].info.flags & ofBOUND) { float hh; if (PointOnBound(hh, CameraX, CameraZ, ox, oz, LandY, MObjects[ob].bound, ((FMap[ccz+z][ccx+x] >> 2) & 3) ) ) if (h < LandY + hh) h = LandY + hh; } else { if (MObjects[ob].info.flags & ofCIRCLE) r = (float) sqrt( (ox-CameraX)*(ox-CameraX) + (oz-CameraZ)*(oz-CameraZ) ); else r = (float) max( fabs(ox-CameraX) , fabs(oz-CameraZ) ); if (r<CR) h = MObjects[ob].info.YHi + LandY; } } return h; } float GetLandHObj(float CameraX, float CameraZ) { float h; h = 0; int ccx = (int)CameraX / 256; int ccz = (int)CameraZ / 256; for (int z=-3; z<=3; z++) for (int x=-3; x<=3; x++) if (OMap[ccz+z][ccx+x]!=255) { int ob = OMap[ccz+z][ccx+x]; float CR = (float)MObjects[ob].info.Radius - 1.f; float oz = (ccz+z) * 256.f + 128.f; float ox = (ccx+x) * 256.f + 128.f; if (MObjects[ob].info.YHi + GetLandOH(ccx+x, ccz+z) < h) continue; if (MObjects[ob].info.YLo + GetLandOH(ccx+x, ccz+z) > PlayerY+256) continue; float r; if (MObjects[ob].info.flags & ofCIRCLE) r = (float) sqrt( (ox-CameraX)*(ox-CameraX) + (oz-CameraZ)*(oz-CameraZ) ); else r = (float) max( fabs(ox-CameraX) , fabs(oz-CameraZ) ); if (r<CR) h = MObjects[ob].info.YHi + GetLandOH(ccx+x, ccz+z); } return h; } float GetLandQHNoObj(float CameraX, float CameraZ) { float h,hh; h = GetLandH(CameraX, CameraZ); hh = GetLandH(CameraX-90.f, CameraZ-90.f); if (hh>h) h=hh; hh = GetLandH(CameraX+90.f, CameraZ-90.f); if (hh>h) h=hh; hh = GetLandH(CameraX-90.f, CameraZ+90.f); if (hh>h) h=hh; hh = GetLandH(CameraX+90.f, CameraZ+90.f); if (hh>h) h=hh; hh = GetLandH(CameraX+128.f, CameraZ); if (hh>h) h=hh; hh = GetLandH(CameraX-128.f, CameraZ); if (hh>h) h=hh; hh = GetLandH(CameraX, CameraZ+128.f); if (hh>h) h=hh; hh = GetLandH(CameraX, CameraZ-128.f); if (hh>h) h=hh; return h; } void ProcessCommandLine() { for (int a=0; a<__argc; a++) { LPSTR s = __argv[a]; if (strstr(s,"x=")) { PlayerX = (float)atof(&s[2])*256.f; LockLanding = TRUE; } if (strstr(s,"y=")) { PlayerZ = (float)atof(&s[2])*256.f; LockLanding = TRUE; } if (strstr(s,"reg=")) TrophyRoom.RegNumber = atoi(&s[4]); if (strstr(s,"prj=")) strcpy(ProjectName, (s+4)); if (strstr(s,"din=")) TargetDino = (atoi(&s[4])*1024); if (strstr(s,"wep=")) WeaponPres = atoi(&s[4]); if (strstr(s,"dtm=")) OptDayNight = atoi(&s[4]); if (strstr(s,"-debug")) DEBUG = TRUE; if (strstr(s,"-double")) DoubleAmmo = TRUE; if (strstr(s,"-radar")) RadarMode = TRUE; if (strstr(s,"-tranq")) Tranq = TRUE; if (strstr(s,"-observ")) ObservMode = TRUE; } } void AddWCircle(float x, float z, float scale) { WCircles[WCCount].pos.x = x; WCircles[WCCount].pos.z = z; WCircles[WCCount].pos.y = GetLandUpH(x, z); WCircles[WCCount].FTime = 0; WCircles[WCCount].scale = scale; WCCount++; } void AddShipTask(int cindex) { TCharacter *cptr = &Characters[cindex]; BOOL TROPHYON = (GetLandUpH(cptr->pos.x, cptr->pos.z) - GetLandH(cptr->pos.x, cptr->pos.z) < 100) && (!Tranq); if (TROPHYON) { ShipTask.clist[ShipTask.tcount] = cindex; ShipTask.tcount++; AddVoicev(ShipModel.SoundFX[3].length, ShipModel.SoundFX[3].lpData, 256); } //===== trophy =======// SYSTEMTIME st; GetLocalTime(&st); int t=0; for (t=0; t<23; t++) if (!TrophyRoom.Body[t].ctype) break; float score = (float)DinoInfo[Characters[cindex].CType].BaseScore; if (TrophyRoom.Last.success>1) score*=(1.f + TrophyRoom.Last.success / 10.f); if (!(TargetDino & (1<<Characters[cindex].AI)) ) score/=2.f; if (Tranq ) score *= 1.25f; if (RadarMode) score *= 0.70f; if (ScentMode) score *= 0.80f; if (CamoMode ) score *= 0.85f; TrophyRoom.Score+=(int)score; if (!Tranq) { TrophyTime = 20 * 1000; TrophyBody = t; TrophyRoom.Body[t].ctype = Characters[cindex].CType; TrophyRoom.Body[t].scale = Characters[cindex].scale; TrophyRoom.Body[t].weapon = CurrentWeapon; TrophyRoom.Body[t].score = (int)score; TrophyRoom.Body[t].phase = (RealTime & 3); TrophyRoom.Body[t].time = (st.wHour<<10) + st.wMinute; TrophyRoom.Body[t].date = (st.wYear<<20) + (st.wMonth<<10) + st.wDay; TrophyRoom.Body[t].range = VectorLength( SubVectors(Characters[cindex].pos, PlayerPos) ) / 64.f; PrintLog("Trophy added: "); PrintLog(DinoInfo[Characters[cindex].CType].Name); PrintLog("\n"); } } void InitShip(int cindex) { TCharacter *cptr = &Characters[cindex]; Ship.DeltaY = 2048.f + DinoInfo[cptr->CType].ShDelta * cptr->scale; Ship.pos.x = PlayerX - 90*256; if (Ship.pos.x < 256) Ship.pos.x = PlayerX + 90*256; Ship.pos.z = PlayerZ - 90*256; if (Ship.pos.z < 256) Ship.pos.z = PlayerZ + 90*256; Ship.pos.y = GetLandUpH(Ship.pos.x, Ship.pos.z) + Ship.DeltaY + 1024; Ship.tgpos.x = cptr->pos.x; Ship.tgpos.z = cptr->pos.z; Ship.tgpos.y = GetLandUpH(Ship.tgpos.x, Ship.tgpos.z) + Ship.DeltaY; Ship.State = 0; Ship.retpos = Ship.pos; Ship.cindex = cindex; Ship.FTime = 0; } void HideWeapon() { TWeapon *wptr = &Weapon; if (UNDERWATER && !wptr->state) return; if (ObservMode || TrophyMode) return; if (wptr->state == 0) { if (!ShotsLeft[CurrentWeapon]) return; if (WeapInfo[CurrentWeapon].Optic) OPTICMODE = TRUE; AddVoicev(wptr->chinfo[CurrentWeapon].SoundFX[0].length, wptr->chinfo[CurrentWeapon].SoundFX[0].lpData, 256); wptr->FTime = 0; wptr->state = 1; BINMODE = FALSE; MapMode = FALSE; wptr->shakel = 0.2f; return; } if (wptr->state!=2 || wptr->FTime!=0) return; AddVoicev(wptr->chinfo[CurrentWeapon].SoundFX[2].length, wptr->chinfo[CurrentWeapon].SoundFX[2].lpData, 256); wptr->state = 3; wptr->FTime = 0; OPTICMODE = FALSE; return ; } void InitGameInfo() { for (int c=0; c<32; c++) { DinoInfo[c].Scale0 = 800; DinoInfo[c].ScaleA = 600; DinoInfo[c].ShDelta = 0; } /* WeapInfo[0].Name = "Shotgun"; WeapInfo[0].Power = 1.5f; WeapInfo[0].Prec = 1.1f; WeapInfo[0].Loud = 0.3f; WeapInfo[0].Rate = 1.6f; WeapInfo[0].Shots = 6; WeapInfo[1].Name = "X-Bow"; WeapInfo[1].Power = 1.1f; WeapInfo[1].Prec = 0.7f; WeapInfo[1].Loud = 1.9f; WeapInfo[1].Rate = 1.2f; WeapInfo[1].Shots = 8; WeapInfo[2].Name = "Sniper Rifle"; WeapInfo[2].Power = 1.0f; WeapInfo[2].Prec = 1.8f; WeapInfo[2].Loud = 0.6f; WeapInfo[2].Rate = 1.0f; WeapInfo[2].Shots = 6; DinoInfo[ 0].Name = "Moschops"; DinoInfo[ 0].Health0 = 2; DinoInfo[ 0].Mass = 0.15f; DinoInfo[ 1].Name = "Galimimus"; DinoInfo[ 1].Health0 = 2; DinoInfo[ 1].Mass = 0.1f; DinoInfo[ 2].Name = "Dimorphodon"; DinoInfo[ 2].Health0 = 1; DinoInfo[ 2].Mass = 0.05f; DinoInfo[ 3].Name = "Dimetrodon"; DinoInfo[ 3].Health0 = 2; DinoInfo[ 3].Mass = 0.22f; DinoInfo[ 5].Name = "Parasaurolophus"; DinoInfo[ 5].Mass = 1.5f; DinoInfo[ 5].Length = 5.8f; DinoInfo[ 5].Radius = 320.f; DinoInfo[ 5].Health0 = 5; DinoInfo[ 5].BaseScore = 6; DinoInfo[ 5].SmellK = 0.8f; DinoInfo[ 4].HearK = 1.f; DinoInfo[ 4].LookK = 0.4f; DinoInfo[ 5].ShDelta = 48; DinoInfo[ 6].Name = "Pachycephalosaurus"; DinoInfo[ 6].Mass = 0.8f; DinoInfo[ 6].Length = 4.5f; DinoInfo[ 6].Radius = 280.f; DinoInfo[ 6].Health0 = 4; DinoInfo[ 6].BaseScore = 8; DinoInfo[ 6].SmellK = 0.4f; DinoInfo[ 5].HearK = 0.8f; DinoInfo[ 5].LookK = 0.6f; DinoInfo[ 6].ShDelta = 36; DinoInfo[ 7].Name = "Stegosaurus"; DinoInfo[ 7].Mass = 7.f; DinoInfo[ 7].Length = 7.f; DinoInfo[ 7].Radius = 480.f; DinoInfo[ 7].Health0 = 5; DinoInfo[ 7].BaseScore = 7; DinoInfo[ 7].SmellK = 0.4f; DinoInfo[ 6].HearK = 0.8f; DinoInfo[ 6].LookK = 0.6f; DinoInfo[ 7].ShDelta = 128; DinoInfo[ 8].Name = "Allosaurus"; DinoInfo[ 8].Mass = 0.5; DinoInfo[ 8].Length = 4.2f; DinoInfo[ 8].Radius = 256.f; DinoInfo[ 8].Health0 = 3; DinoInfo[ 8].BaseScore = 12; DinoInfo[ 8].Scale0 = 1000; DinoInfo[ 8].ScaleA = 600; DinoInfo[ 8].SmellK = 1.0f; DinoInfo[ 7].HearK = 0.3f; DinoInfo[ 7].LookK = 0.5f; DinoInfo[ 8].ShDelta = 32; DinoInfo[ 8].DangerCall = TRUE; DinoInfo[ 9].Name = "Chasmosaurus"; DinoInfo[ 9].Mass = 3.f; DinoInfo[ 9].Length = 5.0f; DinoInfo[ 9].Radius = 400.f; DinoInfo[ 9].Health0 = 8; DinoInfo[ 9].BaseScore = 9; DinoInfo[ 9].SmellK = 0.6f; DinoInfo[ 8].HearK = 0.5f; DinoInfo[ 8].LookK = 0.4f; //DinoInfo[ 8].ShDelta = 148; DinoInfo[ 9].ShDelta = 108; DinoInfo[10].Name = "Velociraptor"; DinoInfo[10].Mass = 0.3f; DinoInfo[10].Length = 4.0f; DinoInfo[10].Radius = 256.f; DinoInfo[10].Health0 = 3; DinoInfo[10].BaseScore = 16; DinoInfo[10].ScaleA = 400; DinoInfo[10].SmellK = 1.0f; DinoInfo[ 9].HearK = 0.5f; DinoInfo[ 9].LookK = 0.4f; DinoInfo[10].ShDelta =-24; DinoInfo[10].DangerCall = TRUE; DinoInfo[11].Name = "T-Rex"; DinoInfo[11].Mass = 6.f; DinoInfo[11].Length = 12.f; DinoInfo[11].Radius = 400.f; DinoInfo[11].Health0 = 1024; DinoInfo[11].BaseScore = 20; DinoInfo[11].SmellK = 0.85f; DinoInfo[10].HearK = 0.8f; DinoInfo[10].LookK = 0.8f; DinoInfo[11].ShDelta = 168; DinoInfo[11].DangerCall = TRUE; DinoInfo[ 4].Name = "Brahiosaurus"; DinoInfo[ 4].Mass = 9.f; DinoInfo[ 4].Length = 12.f; DinoInfo[ 4].Radius = 400.f; DinoInfo[ 4].Health0 = 1024; DinoInfo[ 4].BaseScore = 0; DinoInfo[ 4].SmellK = 0.85f; DinoInfo[16].HearK = 0.8f; DinoInfo[16].LookK = 0.8f; DinoInfo[ 4].ShDelta = 168; DinoInfo[ 4].DangerCall = FALSE; */ LoadResourcesScript(); } void InitEngine() { DEBUG = FALSE; WATERANI = TRUE; NODARKBACK = TRUE; LoDetailSky = TRUE; CORRECTION = TRUE; FOGON = TRUE; FOGENABLE = TRUE; Clouds = TRUE; SKY = TRUE; GOURAUD = TRUE; MODELS = TRUE; TIMER = DEBUG; BITMAPP = FALSE; MIPMAP = TRUE; NOCLIP = FALSE; CLIP3D = TRUE; SLOW = FALSE; LOWRESTX = FALSE; MORPHP = TRUE; MORPHA = TRUE; _GameState = 0; RadarMode = FALSE; fnt_BIG = CreateFont( 23, 10, 0, 0, 600, 0,0,0, #ifdef __rus RUSSIAN_CHARSET, #else ANSI_CHARSET, #endif OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, NULL); fnt_Small = CreateFont( 14, 5, 0, 0, 100, 0,0,0, #ifdef __rus RUSSIAN_CHARSET, #else ANSI_CHARSET, #endif OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, NULL); fnt_Midd = CreateFont( 16, 7, 0, 0, 550, 0,0,0, #ifdef __rus RUSSIAN_CHARSET, #else ANSI_CHARSET, #endif OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, NULL); Heap = HeapCreate( 0, 60000000, 64000000 ); if( Heap == NULL ) { MessageBox(hwndMain,"Error creating heap.","Error",IDOK); return; } Textures[255] = (TEXTURE*) _HeapAlloc(Heap, 0, sizeof(TEXTURE)); WaterR = 10; WaterG = 38; WaterB = 46; WaterA = 10; TargetDino = 1<<10; TargetCall = 10; WeaponPres = 1; MessageList.timeleft = 0; InitGameInfo(); CreateVideoDIB(); CreateFadeTab(); CreateDivTable(); InitClips(); TrophyRoom.RegNumber=0; PlayerX = (ctMapSize / 3) * 256; PlayerZ = (ctMapSize / 3) * 256; ProcessCommandLine(); switch (OptDayNight) { case 0: SunShadowK = 0.7; Sun3dPos.x = - 4048; Sun3dPos.y = + 2048; Sun3dPos.z = - 4048; break; case 1: SunShadowK = 0.5; Sun3dPos.x = - 2048; Sun3dPos.y = + 4048; Sun3dPos.z = - 2048; break; case 2: SunShadowK = -0.7; Sun3dPos.x = + 3048; Sun3dPos.y = + 3048; Sun3dPos.z = + 3048; break; } LoadTrophy(); ProcessCommandLine(); //ctViewR = 72; //ctViewR1 = 28; //ctViewRM = 24; ctViewR = 42 + (int)(OptViewR / 8)*2; ctViewR1 = 28; ctViewRM = 24; Soft_Persp_K = 1.5f; HeadY = 220; FogsList[0].fogRGB = 0x000000; FogsList[0].YBegin = 0; FogsList[0].Transp = 000; FogsList[0].FLimit = 000; FogsList[127].fogRGB = 0x00504000; FogsList[127].Mortal = FALSE; FogsList[127].Transp = 460; FogsList[127].FLimit = 200; FillMemory( FogsMap, sizeof(FogsMap), 0); PrintLog("Init Engine: Ok.\n"); } void ShutDownEngine() { ReleaseDC(hwndMain,hdcMain); } void ProcessSyncro() { RealTime = timeGetTime(); srand( (unsigned) RealTime ); if (SLOW) RealTime/=4; TimeDt = RealTime - PrevTime; if (TimeDt<0) TimeDt = 10; if (TimeDt>10000) TimeDt = 10; if (TimeDt>1000) TimeDt = 1000; PrevTime = RealTime; Takt++; if (!PAUSE) if (MyHealth) MyHealth+=TimeDt*4; if (MyHealth>MAX_HEALTH) MyHealth = MAX_HEALTH; } void AddBloodTrail(TCharacter *cptr) { if (BloodTrail.Count>508) { memcpy(&BloodTrail.Trail[0], &BloodTrail.Trail[1], 510*sizeof(TBloodP)); BloodTrail.Count--; } BloodTrail.Trail[BloodTrail.Count].LTime = 210000; BloodTrail.Trail[BloodTrail.Count].pos = cptr->pos; BloodTrail.Trail[BloodTrail.Count].pos.x+=siRand(32); BloodTrail.Trail[BloodTrail.Count].pos.z+=siRand(32); BloodTrail.Trail[BloodTrail.Count].pos.y = GetLandH(BloodTrail.Trail[BloodTrail.Count].pos.x, BloodTrail.Trail[BloodTrail.Count].pos.z)+4; BloodTrail.Count++; } void MakeCall() { if (!TargetDino) return; if (UNDERWATER) return; if (ObservMode || TrophyMode) return; if (CallLockTime) return; CallLockTime=1024*3; NextCall+=(RealTime % 2)+1; NextCall%=3; AddVoicev(fxCall[TargetCall-10][NextCall].length, fxCall[TargetCall-10][NextCall].lpData, 256); float dmin = 512*256; int ai = -1; for (int c=0; c<ChCount; c++) { TCharacter *cptr = &Characters[c]; if (DinoInfo[AI_to_CIndex[TargetCall] ].DangerCall) if (cptr->AI<10) { cptr->State=2; cptr->AfraidTime = (10 + rRand(5)) * 1024; } if (cptr->AI!=TargetCall) continue; if (cptr->AfraidTime) continue; if (cptr->State) continue; float d = VectorLength(SubVectors(PlayerPos, cptr->pos)); if (d < ctViewR * 400) { if (rRand(128) > 32) if (d<dmin) { dmin = d; ai = c; } cptr->tgx = PlayerX + siRand(1800); cptr->tgz = PlayerZ + siRand(1800); } } if (ai!=-1) { answpos = SubVectors(Characters[ai].pos, PlayerPos); answpos.x/=-3.f; answpos.y/=-3.f; answpos.z/=-3.f; answpos = SubVectors(PlayerPos, answpos); answtime = 2000 + rRand(2000); answcall = TargetCall; } } DWORD ColorSum(DWORD C1, DWORD C2) { DWORD R,G,B; R = min(255, ((C1>> 0) & 0xFF) + ((C2>> 0) & 0xFF)); G = min(255, ((C1>> 8) & 0xFF) + ((C2>> 8) & 0xFF)); B = min(255, ((C1>>16) & 0xFF) + ((C2>>16) & 0xFF)); return R + (G<<8) + (B<<16); } #define partBlood 1 #define partWater 2 #define partGround 3 #define partBubble 4 void AddElements(float x, float y, float z, int etype, int cnt) { if (ElCount > 30) { memcpy(&Elements[0], &Elements[1], (ElCount-1) * sizeof(TElements)); ElCount--; } Elements[ElCount].EDone = 0; Elements[ElCount].Type = etype; Elements[ElCount].ECount = min(30, cnt); int c; switch (etype) { case partBlood: #ifdef _d3d Elements[ElCount].RGBA = 0xE0600000; Elements[ElCount].RGBA2= 0x20300000; #else Elements[ElCount].RGBA = 0xE0000060; Elements[ElCount].RGBA2= 0x20000030; #endif break; case partGround: #ifdef _d3d Elements[ElCount].RGBA = 0xF0F09E55; Elements[ElCount].RGBA2= 0x10F09E55; #else Elements[ElCount].RGBA = 0xF0559EF0; Elements[ElCount].RGBA2= 0x10559EF0; #endif break; case partBubble: c = WaterList[ WMap[ (int)z / 256][ (int)x / 256] ].fogRGB; #ifdef _d3d c = ColorSum( ((c & 0xFEFEFE)>>1) , 0x152020); #else c = ColorSum( ((c & 0xFEFEFE)>>1) , 0x202015); #endif Elements[ElCount].RGBA = 0x70000000 + (ColorSum(c, ColorSum(c,c))); Elements[ElCount].RGBA2= 0x40000000 + (ColorSum(c, c)); break; case partWater: c = WaterList[ WMap[ (int)z / 256][ (int)x / 256] ].fogRGB; #ifdef _d3d c = ColorSum( ((c & 0xFEFEFE)>>1) , 0x152020); #else c = ColorSum( ((c & 0xFEFEFE)>>1) , 0x202015); #endif Elements[ElCount].RGBA = 0xB0000000 + ( ColorSum(c, ColorSum(c,c)) ); Elements[ElCount].RGBA2 = 0x40000000 + (c); break; } Elements[ElCount].RGBA = conv_xGx(Elements[ElCount].RGBA); Elements[ElCount].RGBA2 = conv_xGx(Elements[ElCount].RGBA2); float al = siRand(128) / 128.f * pi / 4.f; float ss = sin(al); float cc = cos(al); for (int e=0; e<Elements[ElCount].ECount; e++) { Elements[ElCount].EList[e].pos.x = x; Elements[ElCount].EList[e].pos.y = y; Elements[ElCount].EList[e].pos.z = z; Elements[ElCount].EList[e].R = 6 + rRand(5); Elements[ElCount].EList[e].Flags = 0; float v; switch (etype) { case partBlood: v = e * 6 + rRand(96) + 220; Elements[ElCount].EList[e].speed.x =ss*ca*v + siRand(32); Elements[ElCount].EList[e].speed.y =cc * (v * 3); Elements[ElCount].EList[e].speed.z =ss*sa*v + siRand(32); break; case partGround: Elements[ElCount].EList[e].speed.x =siRand(52)-sa*64; Elements[ElCount].EList[e].speed.y =rRand(100) + 600 + e * 20; Elements[ElCount].EList[e].speed.z =siRand(52)+ca*64; break; case partWater: Elements[ElCount].EList[e].speed.x =siRand(32); Elements[ElCount].EList[e].speed.y =rRand(80) + 400 + e * 40; Elements[ElCount].EList[e].speed.z =siRand(32); break; case partBubble: Elements[ElCount].EList[e].speed.x =siRand(40); Elements[ElCount].EList[e].speed.y =rRand(140) + 20; Elements[ElCount].EList[e].speed.z =siRand(40); break; } } ElCount++; } void MakeShot(float ax, float ay, float az, float bx, float by, float bz) { int sres; if (!WeapInfo[CurrentWeapon].Fall) sres = TraceShot(ax, ay, az, bx, by, bz); else { Vector3d dl; float dy = 40.f * ctViewR / 36.f; dl.x = (bx-ax) / 3; dl.y = (by-ay) / 3; dl.z = (bz-az) / 3; bx = ax + dl.x; by = ay + dl.y - dy / 2; bz = az + dl.z; sres = TraceShot(ax, ay, az, bx, by, bz); if (sres!=-1) goto ENDTRACE; ax = bx; ay = by; az = bz; bx = ax + dl.x; by = ay + dl.y - dy * 3; bz = az + dl.z; sres = TraceShot(ax, ay, az, bx, by, bz); if (sres!=-1) goto ENDTRACE; ax = bx; ay = by; az = bz; bx = ax + dl.x; by = ay + dl.y - dy * 5; bz = az + dl.z; sres = TraceShot(ax, ay, az, bx, by, bz); if (sres!=-1) goto ENDTRACE; ax = bx; ay = by; az = bz; } ENDTRACE: if (sres==-1) return; int mort = (sres & 0xFF00) && (Characters[ShotDino].Health); sres &= 0xFF; if (sres == tresGround) AddElements(bx, by, bz, partGround, 6 + WeapInfo[CurrentWeapon].Power*4); if (sres == tresModel) AddElements(bx, by, bz, partGround, 6 + WeapInfo[CurrentWeapon].Power*4); if (sres == tresWater) { AddElements(bx, by, bz, partWater, 4 + WeapInfo[CurrentWeapon].Power*3); //AddElements(bx, GetLandH(bx, bz), bz, partBubble); AddWCircle(bx, bz, 1.2); AddWCircle(bx, bz, 1.2); } if (sres!=tresChar) return; AddElements(bx, by, bz, partBlood, 4 + WeapInfo[CurrentWeapon].Power*4); if (!Characters[ShotDino].Health) return; //======= character damage =========// if (mort) Characters[ShotDino].Health = 0; else Characters[ShotDino].Health-=WeapInfo[CurrentWeapon].Power; if (Characters[ShotDino].Health<0) Characters[ShotDino].Health=0; if (!Characters[ShotDino].Health) { if (Characters[ShotDino].AI>=10) { TrophyRoom.Last.success++; AddShipTask(ShotDino); } if (Characters[ShotDino].AI<10) Characters_AddSecondaryOne(Characters[ShotDino].CType); } else { Characters[ShotDino].AfraidTime = 60*1000; if (Characters[ShotDino].AI!=AI_TREX || Characters[ShotDino].State==0) Characters[ShotDino].State = 2; if (Characters[ShotDino].AI != AI_BRACH) Characters[ShotDino].BloodTTime+=90000; } if (Characters[ShotDino].AI==AI_TREX) if (Characters[ShotDino].State) Characters[ShotDino].State = 5; else Characters[ShotDino].State = 1; } void RemoveCharacter(int index) { if (index==-1) return; memcpy( &Characters[index], &Characters[index+1], (255 - index) * sizeof(TCharacter) ); ChCount--; if (DemoPoint.CIndex > index) DemoPoint.CIndex--; for (int c=0; c<ShipTask.tcount; c++) if (ShipTask.clist[c]>index) ShipTask.clist[c]--; } void AnimateShip() { if (Ship.State==-1) { SetAmbient3d(0,0, 0,0,0); if (!ShipTask.tcount) return; InitShip(ShipTask.clist[0]); memcpy(&ShipTask.clist[0], &ShipTask.clist[1], 250*4); ShipTask.tcount--; return; } SetAmbient3d(ShipModel.SoundFX[0].length, ShipModel.SoundFX[0].lpData, Ship.pos.x, Ship.pos.y, Ship.pos.z); int _TimeDt = TimeDt; //====== get up/down time acceleration ===========// if (Ship.FTime) { int am = ShipModel.Animation[0].AniTime; if (Ship.FTime < 500) _TimeDt = TimeDt * (Ship.FTime + 48) / 548; if (am-Ship.FTime < 500) _TimeDt = TimeDt * (am-Ship.FTime + 48) / 548; if (_TimeDt<2) _TimeDt=2; } //=================================== float L = VectorLength( SubVectors(Ship.tgpos, Ship.pos) ); float L2 = sqrt ( (Ship.tgpos.x - Ship.pos.x) * (Ship.tgpos.x - Ship.pos.x) + (Ship.tgpos.x - Ship.pos.x) * (Ship.tgpos.x - Ship.pos.x) ); Ship.pos.y+=0.3f*(float)cos(RealTime / 256.f); Ship.tgalpha = FindVectorAlpha(Ship.tgpos.x - Ship.pos.x, Ship.tgpos.z - Ship.pos.z); float currspeed; float dalpha = (float)fabs(Ship.tgalpha - Ship.alpha); float drspd = dalpha; if (drspd>pi) drspd = 2*pi - drspd; //====== fly more away if I near =============// if (Ship.State) if (Ship.speed>1) if (L<4000) if (VectorLength(SubVectors(PlayerPos, Ship.pos))<(ctViewR+2)*256) { Ship.tgpos.x += (float)cos(Ship.alpha) * 256*6.f; Ship.tgpos.z += (float)sin(Ship.alpha) * 256*6.f; Ship.tgpos.y = GetLandUpH(Ship.tgpos.x, Ship.tgpos.z) + Ship.DeltaY; Ship.tgpos.y = max(Ship.tgpos.y, GetLandUpH(Ship.pos.x, Ship.pos.z) + Ship.DeltaY); } //==============================// //========= animate down ==========// if (Ship.State==3) { Ship.FTime+=_TimeDt; if (Ship.FTime>=ShipModel.Animation[0].AniTime) { Ship.FTime=ShipModel.Animation[0].AniTime-1; Ship.State=2; AddVoicev(ShipModel.SoundFX[4].length, ShipModel.SoundFX[4].lpData, 256); AddVoice3d(ShipModel.SoundFX[1].length, ShipModel.SoundFX[1].lpData, Ship.pos.x, Ship.pos.y, Ship.pos.z); } return; } //========= get body on board ==========// if (Ship.State) { if (Ship.cindex!=-1) { DeltaFunc(Characters[Ship.cindex].pos.y, Ship.pos.y-650 - (Ship.DeltaY-2048), _TimeDt / 3.f); DeltaFunc(Characters[Ship.cindex].beta, 0, TimeDt / 4048.f); DeltaFunc(Characters[Ship.cindex].gamma, 0, TimeDt / 4048.f); } if (Ship.State==2) { Ship.FTime-=_TimeDt; if (Ship.FTime<0) Ship.FTime=0; if (Ship.FTime==0) if (fabs(Characters[Ship.cindex].pos.y - (Ship.pos.y-650 - (Ship.DeltaY-2048))) < 1.f) { Ship.State = 1; AddVoicev(ShipModel.SoundFX[5].length, ShipModel.SoundFX[5].lpData, 256); AddVoice3d(ShipModel.SoundFX[2].length, ShipModel.SoundFX[2].lpData, Ship.pos.x, Ship.pos.y, Ship.pos.z); } return; } } //=====================================// //====== speed ===============// float vspeed = 1.f + L / 128.f; if (vspeed > 24) vspeed = 24; if (Ship.State) vspeed = 24; if (fabs(dalpha) > 0.4) vspeed = 0.f; float _s = Ship.speed; if (vspeed>Ship.speed) DeltaFunc(Ship.speed, vspeed, TimeDt / 200.f); else Ship.speed = vspeed; if (Ship.speed>0 && _s==0) AddVoice3d(ShipModel.SoundFX[2].length, ShipModel.SoundFX[2].lpData, Ship.pos.x, Ship.pos.y, Ship.pos.z); //====== fly ===========// float l = TimeDt * Ship.speed / 16.f; if (fabs(dalpha) < 0.4) if (l<L) { if (l>L2) l = L2 * 0.5f; if (L2<0.1) l = 0; Ship.pos.x += (float)cos(Ship.alpha)*l; Ship.pos.z += (float)sin(Ship.alpha)*l; } else { if (Ship.State) { Ship.State = -1; RemoveCharacter(Ship.cindex); return; } else { Ship.pos = Ship.tgpos; Ship.State = 3; Ship.FTime = 1; Ship.tgpos = Ship.retpos; Ship.tgpos.y = GetLandUpH(Ship.tgpos.x, Ship.tgpos.z) + Ship.DeltaY; Ship.tgpos.y = max(Ship.tgpos.y, GetLandUpH(Ship.pos.x, Ship.pos.z) + Ship.DeltaY); Characters[Ship.cindex].StateF = 0xFF; AddVoice3d(ShipModel.SoundFX[1].length, ShipModel.SoundFX[1].lpData, Ship.pos.x, Ship.pos.y, Ship.pos.z); } } //======= y movement ============// float h = GetLandUpH(Ship.pos.x, Ship.pos.z); DeltaFunc(Ship.pos.y, Ship.tgpos.y, TimeDt / 4.f); if (Ship.pos.y < h + 1024) { if (Ship.State) if (Ship.cindex!=-1) Characters[Ship.cindex].pos.y+= h + 1024 - Ship.pos.y; Ship.pos.y = h + 1024; } //======= rotation ============// if (Ship.tgalpha > Ship.alpha) currspeed = 0.1f + (float)fabs(drspd)/2.f; else currspeed =-0.1f - (float)fabs(drspd)/2.f; if (fabs(dalpha) > pi) currspeed=-currspeed; DeltaFunc(Ship.rspeed, currspeed, (float)TimeDt / 420.f); float rspd=Ship.rspeed * TimeDt / 1024.f; if (fabs(drspd) < fabs(rspd)) { Ship.alpha = Ship.tgalpha; Ship.rspeed/=2; } else { Ship.alpha+=rspd; if (Ship.State) if (Ship.cindex!=-1) Characters[Ship.cindex].alpha+=rspd; } if (Ship.alpha<0) Ship.alpha+=pi*2; if (Ship.alpha>pi*2) Ship.alpha-=pi*2; //======== move body ===========// if (Ship.State) { if (Ship.cindex!=-1) { Characters[Ship.cindex].pos.x = Ship.pos.x; Characters[Ship.cindex].pos.z = Ship.pos.z; } if (L>1000) Ship.tgpos.y+=TimeDt / 12.f; } else { Ship.tgpos.x = Characters[Ship.cindex].pos.x; Ship.tgpos.z = Characters[Ship.cindex].pos.z; Ship.tgpos.y = GetLandUpH(Ship.tgpos.x, Ship.tgpos.z) + Ship.DeltaY; Ship.tgpos.y = max(Ship.tgpos.y, GetLandUpH(Ship.pos.x, Ship.pos.z) + Ship.DeltaY); } } void ProcessTrophy() { TrophyBody = -1; for (int c=0; c<ChCount; c++) { Vector3d p = Characters[c].pos; p.x+=Characters[c].lookx * 256*2.5f; p.z+=Characters[c].lookz * 256*2.5f; if (VectorLength( SubVectors(p, PlayerPos) ) < 148) TrophyBody = c; } if (TrophyBody==-1) return; TrophyBody = Characters[TrophyBody].State; } void AnimateElements() { for (int eg=0; eg<ElCount; eg++) { if (Elements[eg].Type == partGround) { int a1 = Elements[eg].RGBA >> 24; a1-=TimeDt/4; if (a1<0) a1=0; Elements[eg].RGBA = (Elements[eg].RGBA & 0x00FFFFFF) + (a1<<24); int a2 = Elements[eg].RGBA2>> 24; a2-=TimeDt/4; if (a2<0) a2=0; Elements[eg].RGBA2= (Elements[eg].RGBA2 & 0x00FFFFFF) + (a2<<24); if (a1 == 0 && a2==0) Elements[eg].ECount = 0; } if (Elements[eg].Type == partWater) if (Elements[eg].EDone == Elements[eg].ECount) Elements[eg].ECount = 0; if (Elements[eg].Type == partBubble) if (Elements[eg].EDone == Elements[eg].ECount) Elements[eg].ECount = 0; if (Elements[eg].Type == partBlood) if ((Takt & 3)==0) if (Elements[eg].EDone == Elements[eg].ECount) { int a1 = Elements[eg].RGBA >> 24; a1--; if (a1<0) a1=0; Elements[eg].RGBA = (Elements[eg].RGBA & 0x00FFFFFF) + (a1<<24); int a2 = Elements[eg].RGBA2>> 24; a2--; if (a2<0) a2=0; Elements[eg].RGBA2= (Elements[eg].RGBA2 & 0x00FFFFFF) + (a2<<24); if (a1 == 0 && a2==0) Elements[eg].ECount = 0; } //====== remove finished process =========// if (!Elements[eg].ECount) { memcpy(&Elements[eg], &Elements[eg+1], (ElCount+1-eg) * sizeof(TElements)); ElCount--; eg--; continue; } for (int e=0; e<Elements[eg].ECount; e++) { if (Elements[eg].EList[e].Flags) continue; Elements[eg].EList[e].pos.x+=Elements[eg].EList[e].speed.x * TimeDt / 1000.f; Elements[eg].EList[e].pos.y+=Elements[eg].EList[e].speed.y * TimeDt / 1000.f; Elements[eg].EList[e].pos.z+=Elements[eg].EList[e].speed.z * TimeDt / 1000.f; float h; h = GetLandUpH(Elements[eg].EList[e].pos.x, Elements[eg].EList[e].pos.z); BOOL OnWater = GetLandH(Elements[eg].EList[e].pos.x, Elements[eg].EList[e].pos.z) < h; switch (Elements[eg].Type) { case partBubble: Elements[eg].EList[e].speed.y += 2.0 * 256 * TimeDt / 1000.f; if (Elements[eg].EList[e].speed.y > 824) Elements[eg].EList[e].speed.y = 824; if (Elements[eg].EList[e].pos.y > h) { AddWCircle(Elements[eg].EList[e].pos.x, Elements[eg].EList[e].pos.z, 0.6); Elements[eg].EDone++; Elements[eg].EList[e].Flags = 1; if (OnWater) Elements[eg].EList[e].pos.y-= 10240; } break; default: Elements[eg].EList[e].speed.y -= 9.8 * 256 * TimeDt / 1000.f; if (Elements[eg].EList[e].pos.y < h) { if (OnWater) AddWCircle(Elements[eg].EList[e].pos.x, Elements[eg].EList[e].pos.z, 0.6); Elements[eg].EDone++; Elements[eg].EList[e].Flags = 1; if (OnWater) Elements[eg].EList[e].pos.y-= 10240; else Elements[eg].EList[e].pos.y = h + 4; } break; } //== switch ==// } // for(e) // } // for(eg) // for (int b=0; b<BloodTrail.Count; b++) { BloodTrail.Trail[b].LTime-=TimeDt; if (BloodTrail.Trail[b].LTime<=0) { memcpy(&BloodTrail.Trail[b], &BloodTrail.Trail[b+1], (511-b)*sizeof(TBloodP)); BloodTrail.Count--; b--; } } } void AnimateProcesses() { AnimateElements(); if ((Takt & 63)==0) { float al2 = CameraAlpha + siRand(60) * pi / 180.f; float c2 = cos(al2); float s2 = sin(al2); float l = 1024 + rRand(3120); float xx = CameraX + s2 * l; float zz = CameraZ - c2 * l; if (GetLandUpH(xx,zz) > GetLandH(xx,zz)+256) AddElements(xx, GetLandH(xx,zz), zz, 4, 6 + rRand(6)); } if (Takt & 1) { Wind.alpha+=siRand(16) / 4096.f; Wind.speed+=siRand(400) / 6400.f; } if (Wind.speed< 4.f) Wind.speed=4.f; if (Wind.speed>18.f) Wind.speed=18.f; Wind.nv.x = (float) sin(Wind.alpha); Wind.nv.z = (float)-cos(Wind.alpha); Wind.nv.y = 0.f; if (answtime) { answtime-=TimeDt; if (answtime<=0) { answtime = 0; int r = rRand(128) % 3; AddVoice3d(fxCall[answcall-10][r].length, fxCall[answcall-10][r].lpData, answpos.x, answpos.y, answpos.z); } } if (CallLockTime) { CallLockTime-=TimeDt; if (CallLockTime<0) CallLockTime=0; } CheckAfraid(); AnimateShip(); if (TrophyMode) ProcessTrophy(); for (int w=0; w<WCCount; w++) { if (WCircles[w].scale > 1) WCircles[w].FTime+=(int)(TimeDt*3 / WCircles[w].scale); else WCircles[w].FTime+=TimeDt*3; if (WCircles[w].FTime >= 2000) { memcpy(&WCircles[w], &WCircles[w+1], sizeof(TWCircle) * (WCCount+1-w) ); w--; WCCount--; } } if (ExitTime) { ExitTime-=TimeDt; if (ExitTime<=0) { TrophyRoom.Total.time +=TrophyRoom.Last.time; TrophyRoom.Total.smade +=TrophyRoom.Last.smade; TrophyRoom.Total.success+=TrophyRoom.Last.success; TrophyRoom.Total.path +=TrophyRoom.Last.path; if (MyHealth) SaveTrophy(); else LoadTrophy(); DoHalt(""); } } } void RemoveCurrentTrophy() { int p = 0; if (!TrophyMode) return; if (!TrophyRoom.Body[TrophyBody].ctype) return; PrintLog("Trophy removed: "); PrintLog(DinoInfo[TrophyRoom.Body[TrophyBody].ctype].Name); PrintLog("\n"); for (int c=0; c<TrophyBody; c++) if (TrophyRoom.Body[c].ctype) p++; TrophyRoom.Body[TrophyBody].ctype = 0; if (TrophyMode) { memcpy(&Characters[p], &Characters[p+1], (250-p) * sizeof(TCharacter) ); ChCount--; } TrophyTime = 0; TrophyBody = -1; } void LoadTrophy() { int pr = TrophyRoom.RegNumber; FillMemory(&TrophyRoom, sizeof(TrophyRoom), 0); TrophyRoom.RegNumber = pr; DWORD l; char fname[128]; int rn = TrophyRoom.RegNumber; wsprintf(fname, "trophy0%d.sav", TrophyRoom.RegNumber); HANDLE hfile = CreateFile(fname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hfile==INVALID_HANDLE_VALUE) { PrintLog("===> Error loading trophy!\n"); return; } ReadFile(hfile, &TrophyRoom, sizeof(TrophyRoom), &l, NULL); ReadFile(hfile, &OptAgres, 4, &l, NULL); ReadFile(hfile, &OptDens , 4, &l, NULL); ReadFile(hfile, &OptSens , 4, &l, NULL); ReadFile(hfile, &OptRes, 4, &l, NULL); ReadFile(hfile, &FOGENABLE, 4, &l, NULL); ReadFile(hfile, &OptText , 4, &l, NULL); ReadFile(hfile, &OptViewR, 4, &l, NULL); ReadFile(hfile, &SHADOWS3D, 4, &l, NULL); ReadFile(hfile, &OptMsSens, 4, &l, NULL); ReadFile(hfile, &OptBrightness, 4, &l, NULL); ReadFile(hfile, &KeyMap, sizeof(KeyMap), &l, NULL); ReadFile(hfile, &REVERSEMS, 4, &l, NULL); ReadFile(hfile, &ScentMode, 4, &l, NULL); ReadFile(hfile, &CamoMode, 4, &l, NULL); ReadFile(hfile, &RadarMode, 4, &l, NULL); ReadFile(hfile, &Tranq , 4, &l, NULL); ReadFile(hfile, &OPT_ALPHA_COLORKEY, 4, &l, NULL); ReadFile(hfile, &OptSys , 4, &l, NULL); ReadFile(hfile, &OptSound , 4, &l, NULL); ReadFile(hfile, &OptRender, 4, &l, NULL); SetupRes(); CloseHandle(hfile); TrophyRoom.RegNumber = rn; PrintLog("Trophy Loaded.\n"); // TrophyRoom.Score = 299; } void SaveTrophy() { DWORD l; char fname[128]; wsprintf(fname, "trophy0%d.sav", TrophyRoom.RegNumber); int r = TrophyRoom.Rank; TrophyRoom.Rank = 0; if (TrophyRoom.Score >= 100) TrophyRoom.Rank = 1; if (TrophyRoom.Score >= 300) TrophyRoom.Rank = 2; HANDLE hfile = CreateFile(fname, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hfile == INVALID_HANDLE_VALUE) { PrintLog("==>> Error saving trophy!\n"); return; } WriteFile(hfile, &TrophyRoom, sizeof(TrophyRoom), &l, NULL); WriteFile(hfile, &OptAgres, 4, &l, NULL); WriteFile(hfile, &OptDens , 4, &l, NULL); WriteFile(hfile, &OptSens , 4, &l, NULL); WriteFile(hfile, &OptRes, 4, &l, NULL); WriteFile(hfile, &FOGENABLE, 4, &l, NULL); WriteFile(hfile, &OptText , 4, &l, NULL); WriteFile(hfile, &OptViewR, 4, &l, NULL); WriteFile(hfile, &SHADOWS3D, 4, &l, NULL); WriteFile(hfile, &OptMsSens, 4, &l, NULL); WriteFile(hfile, &OptBrightness, 4, &l, NULL); WriteFile(hfile, &KeyMap, sizeof(KeyMap), &l, NULL); WriteFile(hfile, &REVERSEMS, 4, &l, NULL); WriteFile(hfile, &ScentMode, 4, &l, NULL); WriteFile(hfile, &CamoMode , 4, &l, NULL); WriteFile(hfile, &RadarMode, 4, &l, NULL); WriteFile(hfile, &Tranq , 4, &l, NULL); WriteFile(hfile, &OPT_ALPHA_COLORKEY, 4, &l, NULL); WriteFile(hfile, &OptSys , 4, &l, NULL); WriteFile(hfile, &OptSound , 4, &l, NULL); WriteFile(hfile, &OptRender, 4, &l, NULL); CloseHandle(hfile); PrintLog("Trophy Saved.\n"); }
66425d2fa2f6c1779e769c230b47f147e3d7d527
648ff4a50370ed2af605f8380280fb3013a7c79d
/Practica2/Practica2/DynArrayClass.h
d0372bc2545f859158d1809a5e165a2b915e297a
[]
no_license
N4bi/Practica2
1e2924e1afca0ae3ca8b5560b3b390eb94db4d3a
aee4f777be0645b69879884c7b4dcf1460463fdc
refs/heads/master
2020-05-18T15:14:15.432277
2015-06-08T20:06:25
2015-06-08T20:06:25
34,529,627
0
0
null
null
null
null
UTF-8
C++
false
false
4,264
h
#ifndef __DynArrayClass__ #define __DynArrayClass__ #include <stdio.h> #include <assert.h> #include "Utils.h" #include"Log.h" #define DYNARRAY_BLOCK_SIZE 16 template <class typedata> class dynArrayClass { private: typedata* data; unsigned int numElements; unsigned int allocatedMemory; public: dynArrayClass() : allocatedMemory(0), numElements(0), data(NULL) { reallocate(DYNARRAY_BLOCK_SIZE); } dynArrayClass(const int MemorySize) : allocatedMemory(0), numElements(0), data(NULL) { reallocate(MemorySize); } ~dynArrayClass() { if (data != NULL) { delete[] data; } } const unsigned int getCapacity() const { return allocatedMemory; } const unsigned int count() const { return numElements; } bool shrink() { if (numElements < allocatedMemory) { reallocate(numElements + 1); return true; } return false; } void reallocate(const int nwSize) { typedata* tmp = data; allocatedMemory = nwSize; data = new typedata[allocatedMemory]; numElements = MIN(allocatedMemory, numElements); if (tmp != NULL) { for (int i = 0; i < numElements; ++i) data[i] = tmp[i]; delete[] tmp; } } void push(const typedata& value) { if (numElements >= allocatedMemory) { reallocate(allocatedMemory + DYNARRAY_BLOCK_SIZE); } data[numElements++] = value; } bool pop(typedata& value) { if (numElements > 0) { value = data[--numElements]; return true } return false; } void clear() { numElements = 0; } bool insert(int new_value, unsigned int position) { if (position <= numElements) { TYPE *tmp = new TYPE[allocatedMemory]; for (unsigned int i = 0; i < numElements; i++) { tmp[i] = data[i]; } if (numElements == allocatedMemory) reallocate(allocatedMemory + 1); for (unsigned int i = 0; i < position; i++) { data[i] = tmp[i]; } data[position] = new_value; for (unsigned int i = position; i < numElements; i++) { data[i + 1] = tmp[i]; } numElements++; delete[] tmp; return true; } return false; } void mirror() { for (int n = 0; n < (numElements - 1) / 2; n++) { swap(data[n], data[numElements - 1 - n]); } } typedata& operator[] (const unsigned int index) { if (index < numElements) { return data[index]; } else { assert(false); } } const typedata& operator[] (const unsigned int index) const { if (index < numElements) { return data[index]; } else { assert(false); } } typedata* at(unsigned int index) { typedata* result = NULL; if (index < numElements) result = &data[index]; return result; } const typedata* at(unsigned int index) const { typedata* result = NULL; if (index < numElements) result = &data[index]; return result; } void bubbleSortOld() { int counter = 0; bool done = false; while (done == false) { done = true; for (int n = 0; n < numElements - 1; n++) { counter++; if (data[n] > data[n + 1]) { Swap(data[n], data[n + 1]); done = false; } } } printf(" BubbleSort Old \n %i\n", counter); } void bubbleSort() { int counter = 0; bool done = false; int loops = 1; while (done == false) { done = true; for (int n = 0; n < numElements - loops; n++) { counter++; if (data[n] > data[n + 1]) { Swap(data[n], data[n + 1]); done = false; } } loops++; } printf(" BubbleSort \n %i\n", counter); } typedata bubbleSortOptimized() { int retrn = 0; int count; int last = numElements - 2; while (last != 0) { count = last; last = 0; for (int i = 0; i < count; i++) { retrn++; if (data[i] > data[i + 1]) { swap(data[i], data[i + 1]); last = i; } } } return retrn; } int bubbleSortSuperOptimized() { int counter = 0; int last = numElements; for (int i = 0; i < last - 1; i++) { for (int j = i + 1; j < last; j++) { counter++; if (data[i]>data[j]) { swap(data[i], data[j]); last = j; } } } return counter; } void flip() { typedata* start = &data[0]; typedata* end = &data[numElements - 1]; while (start < end) swap(*start++, *end--); } }; #endif // __DynArrayClass__
b66b8b8a31f7e5d3fae8892e282c57c520567d54
6a73419531cdd6bde65603dd9f2d77f4bcd5cb39
/Tile.h
a9d4cf1b2a8acf6410ee3f32ecc1e8dec569a3c2
[]
no_license
jasonwarta/Minesweeper
bd419d135b3a5afbb7c2036fcb249dc14cdf58f9
1652d4f4618ae484b4b02e1c0aa0b4dc37668803
refs/heads/master
2021-01-11T05:57:20.376651
2016-10-27T05:23:18
2016-10-27T05:23:18
72,073,708
0
0
null
null
null
null
UTF-8
C++
false
false
3,983
h
#ifndef TILE_H_INCLUDED #define TILE_H_INCLUDED #include <ostream> #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <sstream> using std::ostream; using std::cout; using std::endl; using std::rand; using std::string; using std::stringstream; class Tile { public: enum Type{ MINE, GROUND, BORDER }; /* * Default Tile constructor * Sets type to Tile::GROUND * Sets adjacentMines to 0, revealed to false, and marked to false */ Tile(); /* * Tile constructor * Takes a Tile::Type * Tets the type to passed value * Sets adjacenetMines to 0, revealed to false, and marked to false */ Tile(Type t); /* * Tile constructor * Takes a Tile::Type, bool for revealed, bool for marked * Sets adjacenetMines to 0, and the other values to passed values */ Tile(Type t, bool revealed, bool marked, int cover); /* * Tile copy constructor */ Tile(const Tile &other); /* * Tile destructor * sets tile to default values */ ~Tile(); /* * RemoveMine function * Sets type to Tile::GROUND */ void removeMine(); /* * PlaceMine function * Sets type to Tile::MINE */ void placeMine(); /* * SetType function * Sets type to passed Type * Must pass Tile::Type * Valid Types are Tile::GROUND, Tile::MINE, Tile::BORDER */ void setType(Type t); /* * GetType function * Returns Tile::Type */ Type getType(); /* * GetAdjacentMines function * Returns int adjacentMines */ int getAdjacentMines(); /* * Reveal function * Sets revealed to true */ void reveal(); /* * SetRevealed function * Sets revealed to the passed boolean */ void setRevealed(bool r); /* * GetRevealed function * Returns boolean revealed */ bool getRevealed(); /* * SetMarked function * Sets marked to the passed boolean */ void setMarked(bool m); /* * GetMarked functioin * Returns bool marked */ bool getMarked(); /* * Mark function * Sets marked to true */ void mark(); /* * Pre-increment operator * Incremenets the adjacentMines value of the Tile */ Tile& operator++(); /* * Post-increment operator * Increments the adjacenentMines value of the Tile */ Tile operator++(int i); /* * Pre-decrement operator * Decrements the adjacentMines value of the Tile */ Tile& operator--(); /* * Post-decrement operator * Decrements the adjacentMines value of the Tile */ Tile operator--(int i); /* * Assignment opreator * Returns a copy of the right hand side value * Calls the copy constructor */ Tile * operator=(const Tile &rhs) const; /* * Insertion operator * Prints out a Tile representation * Defaults to cout * Prints "[x]" for Mined Tiles * Prints "[n]" for all other Tiles, where 'n' is the adjacentMines value */ friend ostream& operator<<(ostream &os, const Tile &rhs); /* * GetCover function * Returns int * Cover var is randomized when map is seeded * Allows different types of grass/shrubs */ int getCover(); /* * Checked function * Returns bool * Tracks tiles that have been checked * For recursive tile clearing */ bool checked(); /* * Check function * Sets check bool to true */ void check(); /* * Detonate function * Sets detonated bool to true */ void detonate(); /* * SetDetonated function * Takes a bool * Sets detonated to the passed value */ void setDetonated(bool b); /* * Detonated function * Returns bool * Informs of detonated status * Used for map displaying, to show a crater or not */ bool detonated(); /* * Print function * Default to cout */ void print(ostream &os = cout); /* * AdjacentMines function * Returns a string with the number of adjacenet mines */ string adjacentMines(); /* * GetTile function * Returns an int */ int getTile(); private: int adjacentMines_; Type type_; bool revealed_; bool marked_; bool detonated_; int cover_; bool checked_; }; #endif
cd99a4194be82d8414ce591ebbde9bc84cb558fb
e4f85676da4b6a7d8eaa56e7ae8910e24b28b509
/content/browser/payments/payment_app_provider_impl.cc
9f6e027e9d085ee6a1fe61027360276d967a9487
[ "BSD-3-Clause" ]
permissive
RyoKodama/chromium
ba2b97b20d570b56d5db13fbbfb2003a6490af1f
c421c04308c0c642d3d1568b87e9b4cd38d3ca5d
refs/heads/ozone-wayland-dev
2023-01-16T10:47:58.071549
2017-09-27T07:41:58
2017-09-27T07:41:58
105,863,448
0
0
null
2017-10-05T07:55:32
2017-10-05T07:55:32
null
UTF-8
C++
false
false
15,643
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 "content/browser/payments/payment_app_provider_impl.h" #include "content/browser/payments/payment_app_context_impl.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_metrics.h" #include "content/browser/service_worker/service_worker_version.h" #include "content/browser/storage_partition_impl.h" #include "content/common/service_worker/service_worker_status_code.h" #include "content/common/service_worker/service_worker_utils.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "mojo/common/time.mojom.h" namespace content { namespace { using ServiceWorkerStartCallback = base::OnceCallback<void(scoped_refptr<ServiceWorkerVersion>, ServiceWorkerStatusCode)>; // Note that one and only one of the callbacks from this class must/should be // called. class RespondWithCallbacks : public payments::mojom::PaymentHandlerResponseCallback { public: RespondWithCallbacks( ServiceWorkerMetrics::EventType event_type, scoped_refptr<ServiceWorkerVersion> service_worker_version, PaymentAppProvider::InvokePaymentAppCallback callback) : service_worker_version_(service_worker_version), invoke_payment_app_callback_(std::move(callback)), binding_(this), weak_ptr_factory_(this) { request_id_ = service_worker_version->StartRequest( event_type, base::BindOnce(&RespondWithCallbacks::OnErrorStatus, weak_ptr_factory_.GetWeakPtr())); } RespondWithCallbacks( ServiceWorkerMetrics::EventType event_type, scoped_refptr<ServiceWorkerVersion> service_worker_version, PaymentAppProvider::PaymentEventResultCallback callback) : service_worker_version_(service_worker_version), payment_event_result_callback_(std::move(callback)), binding_(this), weak_ptr_factory_(this) { request_id_ = service_worker_version->StartRequest( event_type, base::BindOnce(&RespondWithCallbacks::OnErrorStatus, weak_ptr_factory_.GetWeakPtr())); } payments::mojom::PaymentHandlerResponseCallbackPtr CreateInterfacePtrAndBind() { payments::mojom::PaymentHandlerResponseCallbackPtr callback_proxy; binding_.Bind(mojo::MakeRequest(&callback_proxy)); return callback_proxy; } void OnResponseForPaymentRequest( payments::mojom::PaymentHandlerResponsePtr response, base::Time dispatch_event_time) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); service_worker_version_->FinishRequest(request_id_, false, std::move(dispatch_event_time)); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(std::move(invoke_payment_app_callback_), std::move(response))); CloseClientWindows(); delete this; } void OnResponseForCanMakePayment(bool can_make_payment, base::Time dispatch_event_time) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); service_worker_version_->FinishRequest(request_id_, false, std::move(dispatch_event_time)); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(std::move(payment_event_result_callback_), can_make_payment)); delete this; } void OnResponseForAbortPayment(bool payment_aborted, base::Time dispatch_event_time) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); service_worker_version_->FinishRequest(request_id_, false, std::move(dispatch_event_time)); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(std::move(payment_event_result_callback_), payment_aborted)); CloseClientWindows(); delete this; } void OnErrorStatus(ServiceWorkerStatusCode service_worker_status) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(service_worker_status != SERVICE_WORKER_OK); if (event_type_ == ServiceWorkerMetrics::EventType::PAYMENT_REQUEST) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(std::move(invoke_payment_app_callback_), payments::mojom::PaymentHandlerResponse::New())); } else if (event_type_ == ServiceWorkerMetrics::EventType::CAN_MAKE_PAYMENT || event_type_ == ServiceWorkerMetrics::EventType::ABORT_PAYMENT) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(std::move(payment_event_result_callback_), false)); } if (event_type_ == ServiceWorkerMetrics::EventType::PAYMENT_REQUEST || event_type_ == ServiceWorkerMetrics::EventType::ABORT_PAYMENT) { CloseClientWindows(); } delete this; } int request_id() { return request_id_; } private: ~RespondWithCallbacks() override {} // Close all the windows in the payment handler service worker scope. // Note that this will close not only the windows opened through // PaymentRequestEvent.openWindow and Clients.openWindow(), but also the // windows opened through typing the url in the ominibox only if they are in // the payment handler service worker scope. void CloseClientWindows() { std::vector<std::pair<int, int>> ids; for (const auto& controllee : service_worker_version_->controllee_map()) { if (controllee.second->provider_type() == SERVICE_WORKER_PROVIDER_FOR_WINDOW) { ids.emplace_back(std::make_pair(controllee.second->process_id(), controllee.second->frame_id())); } } if (ids.size() == 0) return; BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(&RespondWithCallbacks::CloseClientWindowsOnUIThread, ids)); } static void CloseClientWindowsOnUIThread( const std::vector<std::pair<int, int>>& ids) { for (const auto& id : ids) { RenderFrameHost* frame_host = RenderFrameHost::FromID(id.first, id.second); if (frame_host == nullptr) continue; WebContents* web_contents = WebContents::FromRenderFrameHost(frame_host); if (web_contents == nullptr) continue; web_contents->Close(); } } int request_id_; ServiceWorkerMetrics::EventType event_type_; scoped_refptr<ServiceWorkerVersion> service_worker_version_; PaymentAppProvider::InvokePaymentAppCallback invoke_payment_app_callback_; PaymentAppProvider::PaymentEventResultCallback payment_event_result_callback_; mojo::Binding<payments::mojom::PaymentHandlerResponseCallback> binding_; base::WeakPtrFactory<RespondWithCallbacks> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(RespondWithCallbacks); }; void DidGetAllPaymentAppsOnIO( PaymentAppProvider::GetAllPaymentAppsCallback callback, PaymentAppProvider::PaymentApps apps) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(std::move(callback), base::Passed(std::move(apps)))); } void GetAllPaymentAppsOnIO( scoped_refptr<PaymentAppContextImpl> payment_app_context, PaymentAppProvider::GetAllPaymentAppsCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); payment_app_context->payment_app_database()->ReadAllPaymentApps( base::BindOnce(&DidGetAllPaymentAppsOnIO, std::move(callback))); } void DispatchAbortPaymentEvent( PaymentAppProvider::PaymentEventResultCallback callback, scoped_refptr<ServiceWorkerVersion> active_version, ServiceWorkerStatusCode service_worker_status) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (service_worker_status != SERVICE_WORKER_OK) { std::move(callback).Run(false); return; } DCHECK(active_version); int event_finish_id = active_version->StartRequest( ServiceWorkerMetrics::EventType::CAN_MAKE_PAYMENT, base::BindOnce(&ServiceWorkerUtils::NoOpStatusCallback)); // This object self-deletes after either success or error callback is invoked. RespondWithCallbacks* invocation_callbacks = new RespondWithCallbacks(ServiceWorkerMetrics::EventType::ABORT_PAYMENT, active_version, std::move(callback)); active_version->event_dispatcher()->DispatchAbortPaymentEvent( invocation_callbacks->request_id(), invocation_callbacks->CreateInterfacePtrAndBind(), active_version->CreateSimpleEventCallback(event_finish_id)); } void DispatchCanMakePaymentEvent( payments::mojom::CanMakePaymentEventDataPtr event_data, PaymentAppProvider::PaymentEventResultCallback callback, scoped_refptr<ServiceWorkerVersion> active_version, ServiceWorkerStatusCode service_worker_status) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (service_worker_status != SERVICE_WORKER_OK) { std::move(callback).Run(false); return; } DCHECK(active_version); int event_finish_id = active_version->StartRequest( ServiceWorkerMetrics::EventType::CAN_MAKE_PAYMENT, base::BindOnce(&ServiceWorkerUtils::NoOpStatusCallback)); // This object self-deletes after either success or error callback is invoked. RespondWithCallbacks* invocation_callbacks = new RespondWithCallbacks( ServiceWorkerMetrics::EventType::CAN_MAKE_PAYMENT, active_version, std::move(callback)); active_version->event_dispatcher()->DispatchCanMakePaymentEvent( invocation_callbacks->request_id(), std::move(event_data), invocation_callbacks->CreateInterfacePtrAndBind(), active_version->CreateSimpleEventCallback(event_finish_id)); } void DispatchPaymentRequestEvent( payments::mojom::PaymentRequestEventDataPtr event_data, PaymentAppProvider::InvokePaymentAppCallback callback, scoped_refptr<ServiceWorkerVersion> active_version, ServiceWorkerStatusCode service_worker_status) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (service_worker_status != SERVICE_WORKER_OK) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(std::move(callback), payments::mojom::PaymentHandlerResponse::New())); return; } DCHECK(active_version); int event_finish_id = active_version->StartRequest( ServiceWorkerMetrics::EventType::PAYMENT_REQUEST, base::BindOnce(&ServiceWorkerUtils::NoOpStatusCallback)); // This object self-deletes after either success or error callback is invoked. RespondWithCallbacks* invocation_callbacks = new RespondWithCallbacks(ServiceWorkerMetrics::EventType::PAYMENT_REQUEST, active_version, std::move(callback)); active_version->event_dispatcher()->DispatchPaymentRequestEvent( invocation_callbacks->request_id(), std::move(event_data), invocation_callbacks->CreateInterfacePtrAndBind(), active_version->CreateSimpleEventCallback(event_finish_id)); } void DidFindRegistrationOnIO( ServiceWorkerStartCallback callback, ServiceWorkerStatusCode service_worker_status, scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (service_worker_status != SERVICE_WORKER_OK) { std::move(callback).Run(nullptr, service_worker_status); return; } ServiceWorkerVersion* active_version = service_worker_registration->active_version(); DCHECK(active_version); auto done_callback = base::AdaptCallbackForRepeating( base::BindOnce(std::move(callback), make_scoped_refptr(active_version))); active_version->RunAfterStartWorker( ServiceWorkerMetrics::EventType::PAYMENT_REQUEST, base::BindOnce(done_callback, service_worker_status), done_callback); } void FindRegistrationOnIO( scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, int64_t registration_id, ServiceWorkerStartCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); service_worker_context->FindReadyRegistrationForIdOnly( registration_id, base::Bind(&DidFindRegistrationOnIO, base::Passed(std::move(callback)))); } void StartServiceWorkerForDispatch(BrowserContext* browser_context, int64_t registration_id, ServiceWorkerStartCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( BrowserContext::GetDefaultStoragePartition(browser_context)); scoped_refptr<ServiceWorkerContextWrapper> service_worker_context = partition->GetServiceWorkerContext(); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::BindOnce(&FindRegistrationOnIO, std::move(service_worker_context), registration_id, std::move(callback))); } } // namespace // static PaymentAppProvider* PaymentAppProvider::GetInstance() { return PaymentAppProviderImpl::GetInstance(); } // static PaymentAppProviderImpl* PaymentAppProviderImpl::GetInstance() { DCHECK_CURRENTLY_ON(BrowserThread::UI); return base::Singleton<PaymentAppProviderImpl>::get(); } void PaymentAppProviderImpl::GetAllPaymentApps( BrowserContext* browser_context, GetAllPaymentAppsCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( BrowserContext::GetDefaultStoragePartition(browser_context)); scoped_refptr<PaymentAppContextImpl> payment_app_context = partition->GetPaymentAppContext(); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::BindOnce(&GetAllPaymentAppsOnIO, payment_app_context, std::move(callback))); } void PaymentAppProviderImpl::InvokePaymentApp( BrowserContext* browser_context, int64_t registration_id, payments::mojom::PaymentRequestEventDataPtr event_data, InvokePaymentAppCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); StartServiceWorkerForDispatch( browser_context, registration_id, base::BindOnce(&DispatchPaymentRequestEvent, std::move(event_data), std::move(callback))); } void PaymentAppProviderImpl::CanMakePayment( BrowserContext* browser_context, int64_t registration_id, payments::mojom::CanMakePaymentEventDataPtr event_data, PaymentEventResultCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); StartServiceWorkerForDispatch( browser_context, registration_id, base::BindOnce(&DispatchCanMakePaymentEvent, std::move(event_data), std::move(callback))); } void PaymentAppProviderImpl::AbortPayment(BrowserContext* browser_context, int64_t registration_id, PaymentEventResultCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); StartServiceWorkerForDispatch( browser_context, registration_id, base::BindOnce(&DispatchAbortPaymentEvent, std::move(callback))); } PaymentAppProviderImpl::PaymentAppProviderImpl() {} PaymentAppProviderImpl::~PaymentAppProviderImpl() {} } // namespace content
bfc4d489d45d85fd657ddbdbe0460dc1eab62060
4352b5c9e6719d762e6a80e7a7799630d819bca3
/tutorials/eulerVortex.twitch/eulerVortex.cyclic.twitch.test.test/processor2/3.48/U
e78d5fd9aef415644f55014c9577f5573e01f398
[]
no_license
dashqua/epicProject
d6214b57c545110d08ad053e68bc095f1d4dc725
54afca50a61c20c541ef43e3d96408ef72f0bcbc
refs/heads/master
2022-02-28T17:20:20.291864
2019-10-28T13:33:16
2019-10-28T13:33:16
184,294,390
1
0
null
null
null
null
UTF-8
C++
false
false
117,324
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "3.48"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField nonuniform List<vector> 5625 ( (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.447199 0) (0.894401 0.447199 0) (0.894402 0.447199 0) (0.894402 0.447198 0) (0.894403 0.447197 0) (0.894404 0.447195 0) (0.894405 0.447194 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894402 0.447199 0) (0.894402 0.447198 0) (0.894403 0.447197 0) (0.894404 0.447196 0) (0.894406 0.447195 0) (0.894406 0.447193 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894402 0.447199 0) (0.894403 0.447198 0) (0.894404 0.447197 0) (0.894405 0.447196 0) (0.894407 0.447194 0) (0.894408 0.447192 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894402 0.447199 0) (0.894403 0.447199 0) (0.894404 0.447198 0) (0.894405 0.447197 0) (0.894407 0.447195 0) (0.894409 0.447193 0) (0.89441 0.44719 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.894401 0.447201 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894402 0.4472 0) (0.894404 0.447199 0) (0.894405 0.447198 0) (0.894406 0.447196 0) (0.894408 0.447194 0) (0.89441 0.447192 0) (0.894413 0.447189 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.894401 0.447201 0) (0.894402 0.447201 0) (0.894403 0.4472 0) (0.894404 0.447199 0) (0.894406 0.447198 0) (0.894408 0.447197 0) (0.89441 0.447194 0) (0.894412 0.447191 0) (0.894415 0.447188 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.894401 0.447201 0) (0.894402 0.447201 0) (0.894403 0.447201 0) (0.894405 0.4472 0) (0.894407 0.447199 0) (0.894409 0.447197 0) (0.894412 0.447194 0) (0.894415 0.447191 0) (0.894418 0.447187 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447202 0) (0.8944 0.447202 0) (0.8944 0.447202 0) (0.8944 0.447202 0) (0.894401 0.447202 0) (0.894402 0.447202 0) (0.894404 0.447202 0) (0.894406 0.447201 0) (0.894408 0.447199 0) (0.894411 0.447197 0) (0.894414 0.447195 0) (0.894417 0.447191 0) (0.894421 0.447188 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447202 0) (0.894399 0.447202 0) (0.894399 0.447202 0) (0.8944 0.447203 0) (0.8944 0.447203 0) (0.8944 0.447203 0) (0.894401 0.447203 0) (0.894403 0.447203 0) (0.894404 0.447203 0) (0.894407 0.447202 0) (0.89441 0.4472 0) (0.894413 0.447198 0) (0.894417 0.447196 0) (0.89442 0.447193 0) (0.894423 0.44719 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.8944 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447202 0) (0.894399 0.447202 0) (0.894399 0.447203 0) (0.894399 0.447203 0) (0.894399 0.447204 0) (0.8944 0.447204 0) (0.894401 0.447205 0) (0.894403 0.447205 0) (0.894405 0.447205 0) (0.894407 0.447204 0) (0.894411 0.447202 0) (0.894415 0.447201 0) (0.894418 0.447199 0) (0.894422 0.447197 0) (0.894425 0.447195 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447202 0) (0.894399 0.447202 0) (0.894399 0.447202 0) (0.894398 0.447203 0) (0.894398 0.447204 0) (0.894398 0.447205 0) (0.894399 0.447205 0) (0.8944 0.447206 0) (0.894401 0.447207 0) (0.894403 0.447207 0) (0.894405 0.447207 0) (0.894408 0.447206 0) (0.894412 0.447206 0) (0.894416 0.447205 0) (0.894419 0.447204 0) (0.894423 0.447203 0) (0.894425 0.447203 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447202 0) (0.894398 0.447202 0) (0.894398 0.447203 0) (0.894398 0.447204 0) (0.894398 0.447205 0) (0.894398 0.447206 0) (0.894398 0.447207 0) (0.894399 0.447208 0) (0.894401 0.447209 0) (0.894402 0.44721 0) (0.894405 0.44721 0) (0.894408 0.44721 0) (0.894412 0.447211 0) (0.894416 0.44721 0) (0.89442 0.447211 0) (0.894422 0.447212 0) (0.894422 0.447217 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894398 0.447202 0) (0.894398 0.447203 0) (0.894397 0.447204 0) (0.894397 0.447205 0) (0.894397 0.447206 0) (0.894397 0.447208 0) (0.894397 0.447209 0) (0.894398 0.447211 0) (0.8944 0.447212 0) (0.894402 0.447213 0) (0.894405 0.447215 0) (0.894408 0.447216 0) (0.894412 0.447217 0) (0.894416 0.447219 0) (0.894418 0.447222 0) (0.894418 0.447227 0) (0.894415 0.447238 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447202 0) (0.894398 0.447202 0) (0.894397 0.447203 0) (0.894397 0.447204 0) (0.894396 0.447205 0) (0.894396 0.447207 0) (0.894396 0.447208 0) (0.894396 0.44721 0) (0.894396 0.447212 0) (0.894397 0.447214 0) (0.894399 0.447216 0) (0.894401 0.447218 0) (0.894404 0.44722 0) (0.894407 0.447223 0) (0.89441 0.447226 0) (0.894413 0.44723 0) (0.894413 0.447238 0) (0.894409 0.44725 0) (0.894401 0.447269 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894398 0.447202 0) (0.894398 0.447203 0) (0.894397 0.447204 0) (0.894396 0.447205 0) (0.894395 0.447207 0) (0.894395 0.447209 0) (0.894394 0.44721 0) (0.894394 0.447213 0) (0.894394 0.447216 0) (0.894395 0.447218 0) (0.894397 0.447221 0) (0.894399 0.447225 0) (0.894401 0.447228 0) (0.894404 0.447233 0) (0.894406 0.447239 0) (0.894406 0.447247 0) (0.894403 0.447261 0) (0.894393 0.447282 0) (0.894377 0.447314 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894398 0.447202 0) (0.894397 0.447203 0) (0.894397 0.447204 0) (0.894396 0.447205 0) (0.894395 0.447206 0) (0.894394 0.447208 0) (0.894393 0.447211 0) (0.894392 0.447212 0) (0.894392 0.447216 0) (0.894392 0.44722 0) (0.894393 0.447223 0) (0.894394 0.447228 0) (0.894396 0.447233 0) (0.894398 0.447238 0) (0.894399 0.447246 0) (0.894398 0.447256 0) (0.894395 0.447271 0) (0.894386 0.447293 0) (0.894368 0.447327 0) (0.89434 0.447378 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447202 0) (0.894398 0.447202 0) (0.894397 0.447203 0) (0.894396 0.447204 0) (0.894395 0.447206 0) (0.894393 0.447208 0) (0.894392 0.44721 0) (0.894391 0.447213 0) (0.89439 0.447216 0) (0.894389 0.44722 0) (0.894389 0.447225 0) (0.894389 0.44723 0) (0.89439 0.447236 0) (0.894391 0.447243 0) (0.894392 0.447251 0) (0.89439 0.447262 0) (0.894387 0.447279 0) (0.894377 0.447302 0) (0.894359 0.447338 0) (0.894329 0.44739 0) (0.894283 0.447466 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894398 0.447202 0) (0.894397 0.447203 0) (0.894396 0.447203 0) (0.894395 0.447205 0) (0.894393 0.447207 0) (0.894392 0.44721 0) (0.89439 0.447212 0) (0.894388 0.447216 0) (0.894387 0.44722 0) (0.894386 0.447225 0) (0.894385 0.447231 0) (0.894385 0.447238 0) (0.894385 0.447246 0) (0.894384 0.447255 0) (0.894382 0.447267 0) (0.894377 0.447284 0) (0.894368 0.447309 0) (0.894349 0.447345 0) (0.894318 0.447398 0) (0.89427 0.447475 0) (0.894198 0.447585 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894396 0.447203 0) (0.894395 0.447204 0) (0.894393 0.447206 0) (0.894392 0.447209 0) (0.89439 0.447212 0) (0.894387 0.447215 0) (0.894385 0.44722 0) (0.894383 0.447225 0) (0.894381 0.447231 0) (0.89438 0.447238 0) (0.894378 0.447247 0) (0.894377 0.447257 0) (0.894375 0.44727 0) (0.894369 0.447288 0) (0.894358 0.447312 0) (0.89434 0.447349 0) (0.894309 0.447402 0) (0.894259 0.447478 0) (0.894184 0.447589 0) (0.894078 0.447745 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447202 0) (0.894398 0.447202 0) (0.894397 0.447203 0) (0.894395 0.447204 0) (0.894394 0.447206 0) (0.894392 0.447207 0) (0.894389 0.447211 0) (0.894387 0.447214 0) (0.894384 0.447218 0) (0.894381 0.447223 0) (0.894378 0.44723 0) (0.894376 0.447238 0) (0.894374 0.447246 0) (0.89437 0.447257 0) (0.894366 0.447271 0) (0.894361 0.447289 0) (0.89435 0.447314 0) (0.894331 0.447349 0) (0.8943 0.447401 0) (0.89425 0.447476 0) (0.894174 0.447584 0) (0.894064 0.447739 0) (0.89391 0.447954 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894398 0.447202 0) (0.894397 0.447202 0) (0.894396 0.447203 0) (0.894394 0.447205 0) (0.894392 0.447207 0) (0.89439 0.447209 0) (0.894387 0.447213 0) (0.894384 0.447217 0) (0.89438 0.447222 0) (0.894376 0.447228 0) (0.894372 0.447236 0) (0.894369 0.447246 0) (0.894365 0.447256 0) (0.89436 0.44727 0) (0.894352 0.447288 0) (0.894342 0.447313 0) (0.894323 0.447347 0) (0.894292 0.447396 0) (0.894243 0.447468 0) (0.894168 0.447572 0) (0.894056 0.447722 0) (0.893898 0.447933 0) (0.893681 0.448227 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894396 0.447203 0) (0.894395 0.447204 0) (0.894392 0.447206 0) (0.89439 0.447208 0) (0.894388 0.447211 0) (0.894383 0.447215 0) (0.894379 0.44722 0) (0.894376 0.447226 0) (0.894371 0.447234 0) (0.894366 0.447242 0) (0.89436 0.447255 0) (0.894354 0.447268 0) (0.894346 0.447286 0) (0.894335 0.447309 0) (0.894316 0.447342 0) (0.894286 0.447389 0) (0.894239 0.447456 0) (0.894165 0.447553 0) (0.894054 0.447695 0) (0.893895 0.447898 0) (0.893673 0.448183 0) (0.893374 0.448574 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894395 0.447204 0) (0.894393 0.447205 0) (0.894391 0.447207 0) (0.894388 0.447209 0) (0.894385 0.447213 0) (0.89438 0.447218 0) (0.894375 0.447223 0) (0.89437 0.447231 0) (0.894364 0.44724 0) (0.894358 0.447251 0) (0.89435 0.447264 0) (0.89434 0.447282 0) (0.894328 0.447304 0) (0.89431 0.447335 0) (0.894282 0.447378 0) (0.894236 0.44744 0) (0.894166 0.447531 0) (0.894059 0.447662 0) (0.893902 0.447852 0) (0.893679 0.448123 0) (0.893374 0.448498 0) (0.89297 0.44901 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894396 0.447202 0) (0.894394 0.447204 0) (0.894392 0.447206 0) (0.894389 0.447208 0) (0.894385 0.447211 0) (0.894381 0.447215 0) (0.894376 0.447221 0) (0.89437 0.447228 0) (0.894363 0.447236 0) (0.894356 0.447246 0) (0.894347 0.44726 0) (0.894337 0.447276 0) (0.894324 0.447297 0) (0.894305 0.447326 0) (0.894278 0.447365 0) (0.894236 0.447421 0) (0.89417 0.447503 0) (0.894069 0.447623 0) (0.893918 0.447798 0) (0.8937 0.448049 0) (0.893395 0.448403 0) (0.892982 0.448891 0) (0.892444 0.449551 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894395 0.447203 0) (0.894393 0.447204 0) (0.894391 0.447206 0) (0.894387 0.447209 0) (0.894382 0.447213 0) (0.894377 0.447217 0) (0.894371 0.447224 0) (0.894364 0.447232 0) (0.894356 0.447241 0) (0.894346 0.447254 0) (0.894335 0.447269 0) (0.894321 0.447289 0) (0.894303 0.447315 0) (0.894277 0.447351 0) (0.894237 0.447401 0) (0.894176 0.447474 0) (0.894082 0.447581 0) (0.893941 0.447738 0) (0.893732 0.447965 0) (0.893435 0.448292 0) (0.893025 0.448749 0) (0.892478 0.449375 0) (0.891774 0.450211 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894396 0.447202 0) (0.894394 0.447204 0) (0.894392 0.447205 0) (0.894388 0.447207 0) (0.894384 0.44721 0) (0.894379 0.447215 0) (0.894373 0.44722 0) (0.894366 0.447227 0) (0.894357 0.447236 0) (0.894347 0.447248 0) (0.894335 0.447262 0) (0.894321 0.44728 0) (0.894303 0.447304 0) (0.894277 0.447335 0) (0.89424 0.44738 0) (0.894184 0.447444 0) (0.894099 0.447538 0) (0.893968 0.447677 0) (0.893774 0.447879 0) (0.893492 0.448171 0) (0.893094 0.448588 0) (0.892553 0.449169 0) (0.891839 0.449959 0) (0.890931 0.451002 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894395 0.447203 0) (0.894393 0.447204 0) (0.89439 0.447206 0) (0.894386 0.447208 0) (0.894381 0.447212 0) (0.894376 0.447217 0) (0.894368 0.447223 0) (0.894359 0.447231 0) (0.894349 0.447241 0) (0.894337 0.447254 0) (0.894322 0.44727 0) (0.894303 0.447292 0) (0.89428 0.44732 0) (0.894245 0.447359 0) (0.894194 0.447415 0) (0.894117 0.447496 0) (0.893999 0.447615 0) (0.893822 0.447791 0) (0.893559 0.448049 0) (0.893184 0.448421 0) (0.892662 0.448947 0) (0.891958 0.449674 0) (0.891041 0.450654 0) (0.889889 0.451934 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447201 0) (0.894396 0.447202 0) (0.894394 0.447203 0) (0.894392 0.447204 0) (0.894388 0.447207 0) (0.894384 0.447209 0) (0.894378 0.447213 0) (0.894371 0.447219 0) (0.894363 0.447226 0) (0.894352 0.447234 0) (0.89434 0.447246 0) (0.894325 0.447261 0) (0.894307 0.447279 0) (0.894283 0.447305 0) (0.894252 0.447338 0) (0.894206 0.447386 0) (0.894136 0.447455 0) (0.894032 0.447556 0) (0.893873 0.447706 0) (0.893636 0.447928 0) (0.893289 0.448253 0) (0.892797 0.448718 0) (0.89212 0.449373 0) (0.891219 0.450271 0) (0.89006 0.451467 0) (0.888623 0.453014 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894398 0.447201 0) (0.894397 0.447201 0) (0.894396 0.447202 0) (0.894393 0.447203 0) (0.89439 0.447205 0) (0.894386 0.447208 0) (0.894381 0.44721 0) (0.894375 0.447215 0) (0.894366 0.447221 0) (0.894356 0.447229 0) (0.894344 0.447239 0) (0.894329 0.447251 0) (0.894311 0.447268 0) (0.894288 0.447289 0) (0.894259 0.447318 0) (0.894218 0.447359 0) (0.894157 0.447417 0) (0.894065 0.447502 0) (0.893925 0.447627 0) (0.893714 0.447814 0) (0.893402 0.448091 0) (0.892951 0.448494 0) (0.892316 0.449069 0) (0.891451 0.449873 0) (0.890314 0.450965 0) (0.88887 0.452404 0) (0.88711 0.454236 0) (0.894399 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894398 0.4472 0) (0.894398 0.447201 0) (0.894397 0.447202 0) (0.894395 0.447203 0) (0.894392 0.447203 0) (0.894389 0.447206 0) (0.894384 0.447208 0) (0.894378 0.447212 0) (0.894371 0.447217 0) (0.894361 0.447223 0) (0.894349 0.447231 0) (0.894335 0.447243 0) (0.894317 0.447256 0) (0.894296 0.447275 0) (0.894268 0.4473 0) (0.894231 0.447333 0) (0.894177 0.447382 0) (0.894097 0.447451 0) (0.893977 0.447555 0) (0.893793 0.447709 0) (0.893518 0.44794 0) (0.893112 0.448281 0) (0.892532 0.448775 0) (0.891725 0.449477 0) (0.890638 0.450449 0) (0.889223 0.451759 0) (0.887454 0.453461 0) (0.885337 0.45559 0) (0.894399 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447201 0) (0.894398 0.447201 0) (0.894397 0.447201 0) (0.894396 0.447202 0) (0.894394 0.447203 0) (0.894391 0.447204 0) (0.894387 0.447206 0) (0.894382 0.447209 0) (0.894375 0.447213 0) (0.894366 0.447218 0) (0.894355 0.447225 0) (0.894342 0.447234 0) (0.894325 0.447246 0) (0.894304 0.447262 0) (0.894279 0.447283 0) (0.894244 0.447311 0) (0.894197 0.44735 0) (0.894129 0.447407 0) (0.894025 0.44749 0) (0.893868 0.447616 0) (0.893631 0.447804 0) (0.893277 0.448086 0) (0.892758 0.4485 0) (0.892023 0.449099 0) (0.89101 0.449944 0) (0.889661 0.451105 0) (0.887929 0.452649 0) (0.885798 0.454626 0) (0.883304 0.457046 0) (0.894398 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894398 0.447201 0) (0.894397 0.447201 0) (0.894395 0.447202 0) (0.894393 0.447203 0) (0.894389 0.447205 0) (0.894385 0.447206 0) (0.894379 0.447209 0) (0.894371 0.447214 0) (0.894361 0.44722 0) (0.894349 0.447227 0) (0.894333 0.447237 0) (0.894314 0.447249 0) (0.89429 0.447268 0) (0.894259 0.44729 0) (0.894218 0.447322 0) (0.894158 0.447368 0) (0.894071 0.447434 0) (0.893938 0.447534 0) (0.893737 0.447685 0) (0.893433 0.447912 0) (0.892983 0.448252 0) (0.89233 0.448751 0) (0.89141 0.449468 0) (0.890156 0.450472 0) (0.888506 0.451837 0) (0.886417 0.453627 0) (0.883898 0.455879 0) (0.881025 0.458563 0) (0.894398 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894398 0.447201 0) (0.894397 0.447201 0) (0.894394 0.447202 0) (0.894392 0.447203 0) (0.894388 0.447205 0) (0.894383 0.447207 0) (0.894376 0.44721 0) (0.894368 0.447215 0) (0.894357 0.447221 0) (0.894342 0.447229 0) (0.894325 0.44724 0) (0.894302 0.447253 0) (0.894274 0.447273 0) (0.894237 0.447298 0) (0.894186 0.447334 0) (0.894112 0.447386 0) (0.894002 0.447465 0) (0.893835 0.447583 0) (0.89358 0.447763 0) (0.893195 0.448035 0) (0.89263 0.44844 0) (0.891817 0.449033 0) (0.890682 0.44988 0) (0.88915 0.451056 0) (0.887159 0.452637 0) (0.884683 0.454678 0) (0.881764 0.457185 0) (0.878535 0.460077 0) (0.894398 0.447199 0) (0.894399 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894397 0.447201 0) (0.894396 0.447202 0) (0.894394 0.447202 0) (0.894391 0.447203 0) (0.894387 0.447205 0) (0.894381 0.447207 0) (0.894373 0.447211 0) (0.894364 0.447216 0) (0.894351 0.447222 0) (0.894335 0.44723 0) (0.894315 0.447242 0) (0.894289 0.447257 0) (0.894257 0.447277 0) (0.894212 0.447305 0) (0.894151 0.447347 0) (0.894059 0.447406 0) (0.893921 0.447497 0) (0.893712 0.447637 0) (0.893392 0.447849 0) (0.892913 0.448171 0) (0.892211 0.448649 0) (0.891212 0.449345 0) (0.889828 0.450333 0) (0.887982 0.451692 0) (0.885615 0.453494 0) (0.882731 0.455776 0) (0.879424 0.458498 0) (0.875894 0.461511 0) (0.894398 0.447199 0) (0.894398 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894397 0.447201 0) (0.894395 0.447202 0) (0.894393 0.447202 0) (0.89439 0.447204 0) (0.894385 0.447205 0) (0.894379 0.447208 0) (0.89437 0.447211 0) (0.894359 0.447217 0) (0.894345 0.447223 0) (0.894328 0.447231 0) (0.894305 0.447244 0) (0.894276 0.44726 0) (0.894238 0.447282 0) (0.894185 0.447312 0) (0.89411 0.447359 0) (0.893998 0.447428 0) (0.893827 0.447533 0) (0.893567 0.447695 0) (0.89317 0.447944 0) (0.892581 0.448321 0) (0.891721 0.448878 0) (0.890506 0.449685 0) (0.88884 0.450822 0) (0.886643 0.45237 0) (0.883875 0.454388 0) (0.880581 0.456886 0) (0.876922 0.459759 0) (0.873181 0.462776 0) (0.894397 0.447199 0) (0.894398 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894398 0.4472 0) (0.894398 0.447201 0) (0.894397 0.447201 0) (0.894395 0.447201 0) (0.894392 0.447203 0) (0.894389 0.447203 0) (0.894384 0.447206 0) (0.894376 0.447208 0) (0.894367 0.447211 0) (0.894355 0.447217 0) (0.89434 0.447224 0) (0.894319 0.447233 0) (0.894294 0.447245 0) (0.89426 0.447261 0) (0.894217 0.447286 0) (0.894154 0.447319 0) (0.894064 0.447371 0) (0.893926 0.44745 0) (0.893717 0.44757 0) (0.893397 0.447758 0) (0.892912 0.448046 0) (0.892194 0.448482 0) (0.891153 0.449125 0) (0.889693 0.45005 0) (0.887712 0.451341 0) (0.885136 0.453077 0) (0.881952 0.455296 0) (0.878264 0.457961 0) (0.874323 0.460896 0) (0.870489 0.463779 0) (0.894397 0.447199 0) (0.894398 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894398 0.447201 0) (0.894397 0.447201 0) (0.894394 0.447202 0) (0.894391 0.447202 0) (0.894387 0.447204 0) (0.894382 0.447206 0) (0.894374 0.447208 0) (0.894364 0.447212 0) (0.894351 0.447217 0) (0.894333 0.447224 0) (0.894311 0.447233 0) (0.894283 0.447246 0) (0.894245 0.447263 0) (0.894194 0.447289 0) (0.894121 0.447327 0) (0.894011 0.447383 0) (0.893846 0.447472 0) (0.893591 0.447611 0) (0.893203 0.447826 0) (0.892614 0.448156 0) (0.891748 0.448655 0) (0.890501 0.449386 0) (0.888767 0.450434 0) (0.886442 0.451879 0) (0.883465 0.453792 0) (0.879867 0.456182 0) (0.875833 0.45895 0) (0.871706 0.461835 0) (0.867915 0.464435 0) (0.894397 0.447199 0) (0.894398 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894399 0.4472 0) (0.894397 0.447201 0) (0.894396 0.447201 0) (0.894394 0.447202 0) (0.89439 0.447202 0) (0.894386 0.447204 0) (0.89438 0.447206 0) (0.894372 0.447208 0) (0.89436 0.447212 0) (0.894346 0.447217 0) (0.894328 0.447224 0) (0.894303 0.447233 0) (0.894271 0.447246 0) (0.894228 0.447264 0) (0.894169 0.447292 0) (0.894084 0.447332 0) (0.893953 0.447395 0) (0.893754 0.447495 0) (0.893447 0.447651 0) (0.892979 0.447896 0) (0.892274 0.448271 0) (0.891239 0.448836 0) (0.889764 0.449658 0) (0.887729 0.450827 0) (0.885034 0.452422 0) (0.881644 0.454494 0) (0.877655 0.457011 0) (0.873347 0.459798 0) (0.869156 0.462507 0) (0.865549 0.464674 0) (0.894397 0.447199 0) (0.894398 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.447201 0) (0.894397 0.4472 0) (0.894396 0.447201 0) (0.894393 0.447202 0) (0.89439 0.447202 0) (0.894385 0.447204 0) (0.894379 0.447205 0) (0.894369 0.447208 0) (0.894357 0.447212 0) (0.894342 0.447217 0) (0.894322 0.447223 0) (0.894294 0.447232 0) (0.89426 0.447246 0) (0.894211 0.447265 0) (0.894142 0.447293 0) (0.894042 0.447337 0) (0.893888 0.447407 0) (0.893651 0.447518 0) (0.893285 0.447693 0) (0.892726 0.447969 0) (0.891889 0.448389 0) (0.890669 0.449021 0) (0.88894 0.449936 0) (0.886579 0.451222 0) (0.883497 0.452954 0) (0.879699 0.455156 0) (0.875364 0.45774 0) (0.870879 0.460448 0) (0.866758 0.462855 0) (0.863464 0.46446 0) (0.894396 0.447199 0) (0.894398 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894397 0.447201 0) (0.894395 0.4472 0) (0.894392 0.447202 0) (0.89439 0.447202 0) (0.894384 0.447203 0) (0.894377 0.447205 0) (0.894367 0.447208 0) (0.894354 0.447211 0) (0.894337 0.447216 0) (0.894315 0.447223 0) (0.894286 0.447231 0) (0.894247 0.447245 0) (0.894193 0.447264 0) (0.894114 0.447294 0) (0.893997 0.447342 0) (0.893816 0.447418 0) (0.893536 0.447541 0) (0.893102 0.447734 0) (0.892443 0.448041 0) (0.89146 0.448508 0) (0.890034 0.449205 0) (0.888031 0.45021 0) (0.885325 0.451607 0) (0.881846 0.453457 0) (0.87766 0.455749 0) (0.873048 0.458328 0) (0.8685 0.460853 0) (0.864581 0.46284 0) (0.861706 0.463783 0) (0.894396 0.447199 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894397 0.447201 0) (0.894395 0.447201 0) (0.894392 0.447201 0) (0.894388 0.447202 0) (0.894383 0.447203 0) (0.894375 0.447205 0) (0.894364 0.447207 0) (0.894352 0.447211 0) (0.894333 0.447215 0) (0.894309 0.447222 0) (0.894278 0.44723 0) (0.894235 0.447242 0) (0.894174 0.447263 0) (0.894084 0.447294 0) (0.893948 0.447345 0) (0.893736 0.447427 0) (0.89341 0.447563 0) (0.8929 0.447775 0) (0.89213 0.448112 0) (0.890986 0.448624 0) (0.889337 0.449385 0) (0.887041 0.450473 0) (0.883975 0.451967 0) (0.880103 0.45391 0) (0.87557 0.456242 0) (0.870767 0.458737 0) (0.866276 0.460977 0) (0.862675 0.462449 0) (0.860296 0.462661 0) (0.894396 0.447199 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.447201 0) (0.894397 0.4472 0) (0.894394 0.447201 0) (0.894392 0.447201 0) (0.894387 0.447202 0) (0.894382 0.447203 0) (0.894374 0.447205 0) (0.894363 0.447207 0) (0.894349 0.44721 0) (0.894329 0.447213 0) (0.894304 0.447219 0) (0.89427 0.447228 0) (0.894222 0.44724 0) (0.894154 0.44726 0) (0.894052 0.447292 0) (0.893896 0.447347 0) (0.89365 0.447435 0) (0.893269 0.447582 0) (0.89268 0.447814 0) (0.891786 0.44818 0) (0.890469 0.448736 0) (0.888582 0.449553 0) (0.885977 0.450717 0) (0.882544 0.452291 0) (0.878298 0.454292 0) (0.873472 0.456608 0) (0.868576 0.458938 0) (0.864261 0.460807 0) (0.861072 0.46169 0) (0.859232 0.461129 0) (0.894396 0.447199 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894396 0.447201 0) (0.894395 0.4472 0) (0.894391 0.447201 0) (0.894387 0.447202 0) (0.894381 0.447202 0) (0.894373 0.447204 0) (0.894361 0.447206 0) (0.894346 0.447208 0) (0.894326 0.447212 0) (0.894299 0.447217 0) (0.894262 0.447224 0) (0.89421 0.447237 0) (0.894134 0.447257 0) (0.894018 0.447289 0) (0.89384 0.447348 0) (0.893557 0.447441 0) (0.893118 0.447598 0) (0.89244 0.447849 0) (0.891416 0.44824 0) (0.889912 0.448836 0) (0.887773 0.449706 0) (0.884849 0.450931 0) (0.881053 0.452562 0) (0.876459 0.454584 0) (0.871414 0.456822 0) (0.866528 0.45891 0) (0.862491 0.460339 0) (0.859783 0.460591 0) (0.8585 0.459239 0) (0.894396 0.447199 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894397 0.4472 0) (0.894397 0.447201 0) (0.894394 0.4472 0) (0.894391 0.447201 0) (0.894387 0.447202 0) (0.89438 0.447202 0) (0.894371 0.447203 0) (0.89436 0.447204 0) (0.894344 0.447207 0) (0.894323 0.447209 0) (0.894294 0.447214 0) (0.894254 0.44722 0) (0.894198 0.447232 0) (0.894114 0.447253 0) (0.893983 0.447285 0) (0.89378 0.447346 0) (0.893459 0.447445 0) (0.892956 0.44761 0) (0.892183 0.447878 0) (0.891019 0.448293 0) (0.889319 0.448922 0) (0.886919 0.449835 0) (0.883672 0.451106 0) (0.879522 0.452768 0) (0.874624 0.454767 0) (0.869438 0.456869 0) (0.864661 0.458652 0) (0.860985 0.459591 0) (0.8588 0.459189 0) (0.858074 0.457043 0) (0.894395 0.4472 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447199 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894396 0.4472 0) (0.894393 0.4472 0) (0.894391 0.447201 0) (0.894386 0.447201 0) (0.894379 0.447202 0) (0.894371 0.447202 0) (0.894359 0.447203 0) (0.894342 0.447205 0) (0.894321 0.447207 0) (0.89429 0.44721 0) (0.894248 0.447217 0) (0.894186 0.447227 0) (0.894093 0.447247 0) (0.893948 0.447281 0) (0.893718 0.447342 0) (0.893355 0.447445 0) (0.892785 0.447619 0) (0.891911 0.4479 0) (0.890601 0.448334 0) (0.888697 0.44899 0) (0.886029 0.449935 0) (0.88246 0.451232 0) (0.877979 0.452897 0) (0.872828 0.454827 0) (0.867581 0.456739 0) (0.863002 0.458169 0) (0.859749 0.45859 0) (0.858108 0.457529 0) (0.857925 0.454599 0) (0.894395 0.4472 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447201 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894396 0.4472 0) (0.894393 0.4472 0) (0.894391 0.4472 0) (0.894386 0.447201 0) (0.894379 0.447201 0) (0.89437 0.447202 0) (0.894358 0.447202 0) (0.894341 0.447202 0) (0.894319 0.447205 0) (0.894287 0.447207 0) (0.894242 0.447211 0) (0.894175 0.447221 0) (0.894073 0.44724 0) (0.893911 0.447275 0) (0.893654 0.447335 0) (0.893245 0.447443 0) (0.892605 0.447622 0) (0.891627 0.447914 0) (0.890165 0.448363 0) (0.888051 0.449035 0) (0.885114 0.449999 0) (0.881232 0.451304 0) (0.876447 0.452938 0) (0.871102 0.454758 0) (0.865873 0.456434 0) (0.861564 0.457478 0) (0.858777 0.457371 0) (0.857684 0.45566 0) (0.858024 0.451959 0) (0.894395 0.4472 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894397 0.4472 0) (0.894396 0.447201 0) (0.894394 0.4472 0) (0.89439 0.4472 0) (0.894386 0.4472 0) (0.894379 0.4472 0) (0.89437 0.4472 0) (0.894357 0.447201 0) (0.89434 0.4472 0) (0.894318 0.447201 0) (0.894284 0.447203 0) (0.894236 0.447206 0) (0.894165 0.447215 0) (0.894053 0.447231 0) (0.893874 0.447266 0) (0.893589 0.447328 0) (0.893135 0.447437 0) (0.892421 0.447618 0) (0.891334 0.447916 0) (0.889717 0.448374 0) (0.887392 0.449054 0) (0.884186 0.450022 0) (0.880007 0.451311 0) (0.874955 0.452883 0) (0.869473 0.454556 0) (0.864332 0.455962 0) (0.86035 0.456602 0) (0.858051 0.45597 0) (0.8575 0.453627 0) (0.858341 0.449176 0) (0.894395 0.4472 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447199 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894398 0.4472 0) (0.894397 0.4472 0) (0.894396 0.4472 0) (0.894394 0.4472 0) (0.89439 0.4472 0) (0.894386 0.4472 0) (0.894379 0.447199 0) (0.894371 0.447199 0) (0.894358 0.447199 0) (0.894341 0.447198 0) (0.894317 0.447197 0) (0.894283 0.447199 0) (0.894232 0.447199 0) (0.894156 0.447209 0) (0.894034 0.447223 0) (0.893837 0.447255 0) (0.893523 0.447316 0) (0.893022 0.447427 0) (0.892234 0.447608 0) (0.891035 0.447907 0) (0.889263 0.448367 0) (0.886727 0.449044 0) (0.883261 0.449999 0) (0.878803 0.451252 0) (0.873524 0.452732 0) (0.867964 0.454223 0) (0.86297 0.455336 0) (0.859355 0.455569 0) (0.857554 0.454427 0) (0.85753 0.451477 0) (0.858848 0.446303 0) (0.894396 0.4472 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894398 0.4472 0) (0.894398 0.4472 0) (0.894396 0.447199 0) (0.894394 0.4472 0) (0.894391 0.447199 0) (0.894386 0.447199 0) (0.894379 0.447199 0) (0.894371 0.447198 0) (0.894359 0.447196 0) (0.894341 0.447196 0) (0.894317 0.447194 0) (0.894283 0.447193 0) (0.894229 0.447194 0) (0.894147 0.4472 0) (0.894017 0.447213 0) (0.893802 0.447244 0) (0.893458 0.447302 0) (0.892908 0.447411 0) (0.892046 0.447591 0) (0.890737 0.447886 0) (0.888811 0.44834 0) (0.886068 0.449003 0) (0.882352 0.449928 0) (0.877639 0.451121 0) (0.872177 0.452483 0) (0.866591 0.453767 0) (0.86179 0.454574 0) (0.858565 0.454409 0) (0.857261 0.45278 0) (0.857744 0.449254 0) (0.859522 0.443392 0) (0.894396 0.447201 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894398 0.4472 0) (0.894396 0.447199 0) (0.894395 0.4472 0) (0.894391 0.447198 0) (0.894386 0.447199 0) (0.89438 0.447198 0) (0.894372 0.447197 0) (0.894359 0.447195 0) (0.894343 0.447192 0) (0.894319 0.447191 0) (0.894283 0.447189 0) (0.894227 0.447187 0) (0.89414 0.447192 0) (0.894001 0.447203 0) (0.893769 0.44723 0) (0.893394 0.447286 0) (0.892797 0.44739 0) (0.891862 0.447565 0) (0.890442 0.447849 0) (0.888366 0.448293 0) (0.885426 0.44893 0) (0.881474 0.449807 0) (0.876534 0.450919 0) (0.870928 0.45214 0) (0.865363 0.453201 0) (0.860787 0.4537 0) (0.857964 0.453153 0) (0.857148 0.451068 0) (0.858116 0.447001 0) (0.860335 0.440485 0) (0.894396 0.447201 0) (0.894397 0.4472 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.447199 0) (0.894398 0.4472 0) (0.894396 0.447199 0) (0.894394 0.447199 0) (0.894392 0.447199 0) (0.894387 0.447198 0) (0.894381 0.447197 0) (0.894373 0.447196 0) (0.894361 0.447193 0) (0.894345 0.44719 0) (0.89432 0.447186 0) (0.894285 0.447184 0) (0.894227 0.447181 0) (0.894135 0.447183 0) (0.893987 0.447192 0) (0.893738 0.447215 0) (0.893333 0.447268 0) (0.89269 0.447365 0) (0.891684 0.447531 0) (0.890157 0.4478 0) (0.887935 0.448221 0) (0.88481 0.448823 0) (0.880641 0.449637 0) (0.875501 0.450648 0) (0.869791 0.45171 0) (0.864283 0.452537 0) (0.859953 0.452734 0) (0.857532 0.45183 0) (0.857188 0.449326 0) (0.85862 0.444758 0) (0.861268 0.437634 0) (0.894396 0.447201 0) (0.894397 0.447201 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.894398 0.4472 0) (0.894397 0.447199 0) (0.894395 0.447199 0) (0.894392 0.447198 0) (0.894388 0.447197 0) (0.894382 0.447196 0) (0.894374 0.447194 0) (0.894364 0.447192 0) (0.894347 0.447188 0) (0.894322 0.447182 0) (0.894287 0.447179 0) (0.894229 0.447175 0) (0.894131 0.447172 0) (0.893974 0.447181 0) (0.89371 0.4472 0) (0.893277 0.447245 0) (0.892589 0.447335 0) (0.891517 0.44749 0) (0.889888 0.447738 0) (0.887528 0.448126 0) (0.884232 0.448683 0) (0.879865 0.449418 0) (0.874554 0.450311 0) (0.868773 0.451202 0) (0.863354 0.451792 0) (0.859279 0.451699 0) (0.857245 0.450466 0) (0.857355 0.447585 0) (0.859234 0.442563 0) (0.862299 0.434882 0) (0.894397 0.447201 0) (0.894398 0.447201 0) (0.894398 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.447199 0) (0.894397 0.447199 0) (0.894395 0.447199 0) (0.894393 0.447198 0) (0.894389 0.447197 0) (0.894384 0.447195 0) (0.894377 0.447192 0) (0.894366 0.44719 0) (0.894351 0.447185 0) (0.894327 0.447179 0) (0.894291 0.447174 0) (0.894232 0.447169 0) (0.894129 0.447163 0) (0.893965 0.447168 0) (0.893687 0.447184 0) (0.893227 0.447221 0) (0.892497 0.447301 0) (0.891361 0.44744 0) (0.88964 0.447663 0) (0.887149 0.44801 0) (0.883698 0.44851 0) (0.879162 0.449155 0) (0.873703 0.449915 0) (0.867881 0.450624 0) (0.862571 0.450983 0) (0.858749 0.450616 0) (0.857083 0.449085 0) (0.857623 0.445874 0) (0.859932 0.440451 0) (0.863404 0.432271 0) (0.894397 0.447201 0) (0.894398 0.447201 0) (0.894399 0.447201 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447199 0) (0.894397 0.447199 0) (0.894395 0.447199 0) (0.894393 0.447198 0) (0.89439 0.447196 0) (0.894386 0.447194 0) (0.894379 0.447191 0) (0.894369 0.447188 0) (0.894355 0.447183 0) (0.894331 0.447176 0) (0.894295 0.447169 0) (0.894236 0.447162 0) (0.894131 0.447155 0) (0.893958 0.447154 0) (0.893669 0.447167 0) (0.893184 0.447196 0) (0.892414 0.447261 0) (0.891222 0.447382 0) (0.889417 0.447576 0) (0.886809 0.447876 0) (0.883219 0.448306 0) (0.878538 0.448853 0) (0.872959 0.449466 0) (0.867115 0.449988 0) (0.861927 0.450123 0) (0.858351 0.449507 0) (0.857024 0.447711 0) (0.857965 0.444217 0) (0.860689 0.438454 0) (0.864565 0.429841 0) (0.894397 0.447201 0) (0.894398 0.447201 0) (0.894399 0.447201 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894398 0.447199 0) (0.894398 0.447199 0) (0.894396 0.447198 0) (0.894394 0.447198 0) (0.894391 0.447196 0) (0.894387 0.447194 0) (0.894382 0.44719 0) (0.894372 0.447186 0) (0.89436 0.447181 0) (0.894336 0.447174 0) (0.894301 0.447164 0) (0.894242 0.447156 0) (0.894135 0.447147 0) (0.893955 0.447142 0) (0.893654 0.447148 0) (0.893151 0.447169 0) (0.892345 0.447218 0) (0.891103 0.447318 0) (0.889224 0.447478 0) (0.886513 0.447723 0) (0.882802 0.448074 0) (0.878 0.448516 0) (0.872328 0.448976 0) (0.866475 0.449305 0) (0.861412 0.449229 0) (0.858071 0.44839 0) (0.857048 0.446364 0) (0.858357 0.442635 0) (0.861482 0.436598 0) (0.86576 0.427629 0) (0.894398 0.447202 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.8944 0.447201 0) (0.894399 0.447199 0) (0.894398 0.447199 0) (0.894397 0.447198 0) (0.894395 0.447197 0) (0.894393 0.447196 0) (0.894389 0.447192 0) (0.894384 0.447191 0) (0.894376 0.447184 0) (0.894364 0.447179 0) (0.894344 0.44717 0) (0.894308 0.447161 0) (0.894249 0.44715 0) (0.894142 0.44714 0) (0.893955 0.447129 0) (0.893645 0.44713 0) (0.893126 0.447141 0) (0.892289 0.447173 0) (0.891004 0.447248 0) (0.889065 0.447371 0) (0.886268 0.447557 0) (0.882453 0.447819 0) (0.877556 0.448149 0) (0.871816 0.448454 0) (0.865964 0.448588 0) (0.861017 0.448311 0) (0.857892 0.447278 0) (0.857138 0.445064 0) (0.858775 0.441144 0) (0.862283 0.434904 0) (0.866966 0.425667 0) (0.894399 0.447202 0) (0.894399 0.447201 0) (0.894399 0.447201 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447201 0) (0.894399 0.447199 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.894398 0.447199 0) (0.894398 0.447198 0) (0.894396 0.447196 0) (0.894395 0.447196 0) (0.894392 0.447192 0) (0.894387 0.447189 0) (0.894381 0.447184 0) (0.89437 0.447177 0) (0.894351 0.447168 0) (0.894316 0.447157 0) (0.894257 0.447145 0) (0.89415 0.447133 0) (0.893961 0.447117 0) (0.893642 0.447111 0) (0.893112 0.447114 0) (0.892251 0.447127 0) (0.890928 0.447171 0) (0.888942 0.447258 0) (0.886078 0.44738 0) (0.88218 0.447547 0) (0.877207 0.447754 0) (0.871424 0.44791 0) (0.865577 0.44785 0) (0.860733 0.447381 0) (0.857798 0.446185 0) (0.85728 0.443822 0) (0.859197 0.439762 0) (0.863062 0.433384 0) (0.868155 0.423978 0) (0.894399 0.447202 0) (0.894399 0.447201 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.894399 0.4472 0) (0.8944 0.447199 0) (0.894399 0.447198 0) (0.894398 0.447198 0) (0.894397 0.447196 0) (0.894396 0.447195 0) (0.894394 0.447192 0) (0.894392 0.447188 0) (0.894385 0.447183 0) (0.894376 0.447176 0) (0.894359 0.447167 0) (0.894325 0.447155 0) (0.894267 0.44714 0) (0.894161 0.447126 0) (0.893971 0.447108 0) (0.893645 0.447092 0) (0.893108 0.447085 0) (0.892232 0.447082 0) (0.89088 0.447093 0) (0.888859 0.447138 0) (0.885948 0.447198 0) (0.881987 0.447265 0) (0.87696 0.447342 0) (0.871151 0.447349 0) (0.865318 0.447106 0) (0.86055 0.446449 0) (0.857775 0.445115 0) (0.857458 0.442652 0) (0.85961 0.438501 0) (0.863795 0.43205 0) (0.869296 0.422574 0) (0.8944 0.447202 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.894401 0.447201 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.447198 0) (0.894399 0.447198 0) (0.894398 0.447197 0) (0.894398 0.447195 0) (0.894397 0.447193 0) (0.894395 0.447187 0) (0.89439 0.447183 0) (0.894382 0.447175 0) (0.894367 0.447166 0) (0.894336 0.447153 0) (0.894278 0.447137 0) (0.894174 0.44712 0) (0.893985 0.4471 0) (0.893656 0.447075 0) (0.893113 0.447056 0) (0.892231 0.447038 0) (0.890859 0.447016 0) (0.888815 0.447014 0) (0.885877 0.44701 0) (0.881879 0.446979 0) (0.876816 0.44692 0) (0.870996 0.446779 0) (0.865181 0.446368 0) (0.860468 0.445531 0) (0.857809 0.444074 0) (0.857656 0.441555 0) (0.859999 0.437372 0) (0.864456 0.430906 0) (0.870351 0.421458 0) (0.8944 0.447202 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447199 0) (0.8944 0.447198 0) (0.8944 0.447198 0) (0.894399 0.447197 0) (0.8944 0.447195 0) (0.894399 0.447192 0) (0.894398 0.447187 0) (0.894395 0.447183 0) (0.894388 0.447174 0) (0.894375 0.447165 0) (0.894347 0.447152 0) (0.894291 0.447135 0) (0.894188 0.447114 0) (0.894003 0.447093 0) (0.893674 0.44706 0) (0.893129 0.447029 0) (0.892247 0.446995 0) (0.89087 0.446943 0) (0.888814 0.446889 0) (0.885868 0.446822 0) (0.881857 0.446695 0) (0.87678 0.446499 0) (0.870958 0.446206 0) (0.865163 0.445642 0) (0.860484 0.44464 0) (0.857892 0.443066 0) (0.857856 0.440528 0) (0.860353 0.436378 0) (0.865031 0.429962 0) (0.871285 0.420623 0) (0.894401 0.447202 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.447197 0) (0.894401 0.447199 0) (0.894402 0.447196 0) (0.894401 0.447194 0) (0.894401 0.447193 0) (0.894402 0.447187 0) (0.8944 0.447183 0) (0.894395 0.447174 0) (0.894383 0.447164 0) (0.894358 0.447152 0) (0.894306 0.447134 0) (0.894205 0.447111 0) (0.894023 0.447086 0) (0.8937 0.447048 0) (0.893158 0.447004 0) (0.89228 0.446952 0) (0.89091 0.446873 0) (0.888857 0.446768 0) (0.885917 0.446636 0) (0.88192 0.446418 0) (0.876852 0.446087 0) (0.871037 0.44564 0) (0.865258 0.444931 0) (0.860593 0.443787 0) (0.858024 0.442101 0) (0.858051 0.439564 0) (0.860656 0.435512 0) (0.865506 0.429219 0) (0.872066 0.420059 0) (0.894402 0.447202 0) (0.894401 0.447201 0) (0.894401 0.447201 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.894401 0.4472 0) (0.894401 0.447198 0) (0.894401 0.447198 0) (0.894402 0.447197 0) (0.894403 0.447194 0) (0.894404 0.447193 0) (0.894405 0.447188 0) (0.894405 0.447182 0) (0.894402 0.447176 0) (0.894392 0.447164 0) (0.894369 0.447152 0) (0.894322 0.447134 0) (0.894225 0.44711 0) (0.894047 0.447081 0) (0.893732 0.447039 0) (0.893197 0.446983 0) (0.89233 0.446913 0) (0.890978 0.446808 0) (0.888945 0.446656 0) (0.886026 0.446456 0) (0.882064 0.446151 0) (0.877032 0.445692 0) (0.871235 0.445093 0) (0.865461 0.444242 0) (0.860795 0.442974 0) (0.858207 0.441189 0) (0.858232 0.438658 0) (0.860894 0.434755 0) (0.86587 0.428672 0) (0.872675 0.419765 0) (0.894402 0.447202 0) (0.894401 0.447201 0) (0.894401 0.447201 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.894401 0.447201 0) (0.894399 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894402 0.447198 0) (0.894402 0.447198 0) (0.894404 0.447197 0) (0.894405 0.447195 0) (0.894406 0.447192 0) (0.89441 0.447189 0) (0.894409 0.447183 0) (0.894409 0.447177 0) (0.894401 0.447165 0) (0.894381 0.447153 0) (0.894337 0.447135 0) (0.894245 0.44711 0) (0.894074 0.447076 0) (0.893769 0.447032 0) (0.893248 0.446966 0) (0.892397 0.446878 0) (0.891071 0.446749 0) (0.889076 0.446554 0) (0.886197 0.446287 0) (0.882287 0.4459 0) (0.877316 0.445322 0) (0.871554 0.44457 0) (0.865776 0.443583 0) (0.861081 0.442205 0) (0.858442 0.440337 0) (0.858407 0.437811 0) (0.861056 0.434083 0) (0.866108 0.428298 0) (0.8731 0.419733 0) (0.894403 0.447202 0) (0.894402 0.447201 0) (0.894401 0.447201 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.894401 0.447199 0) (0.894401 0.4472 0) (0.894402 0.447198 0) (0.894403 0.447198 0) (0.894405 0.447198 0) (0.894406 0.447196 0) (0.894409 0.447192 0) (0.894413 0.44719 0) (0.894414 0.447184 0) (0.894415 0.447177 0) (0.89441 0.447168 0) (0.894393 0.447154 0) (0.894352 0.447136 0) (0.894267 0.447111 0) (0.894103 0.447076 0) (0.893811 0.447027 0) (0.893308 0.446954 0) (0.89248 0.446849 0) (0.891187 0.446697 0) (0.889245 0.446464 0) (0.886428 0.446135 0) (0.882585 0.445669 0) (0.877695 0.444982 0) (0.871993 0.444086 0) (0.866206 0.44296 0) (0.861451 0.44148 0) (0.858726 0.439544 0) (0.858586 0.437031 0) (0.861147 0.433482 0) (0.866204 0.428058 0) (0.873327 0.41994 0) (0.894403 0.447201 0) (0.894402 0.447201 0) (0.894401 0.447201 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894402 0.4472 0) (0.894402 0.447198 0) (0.894404 0.447198 0) (0.894406 0.447198 0) (0.894408 0.447196 0) (0.894411 0.447194 0) (0.894415 0.44719 0) (0.894419 0.447186 0) (0.89442 0.447179 0) (0.894418 0.44717 0) (0.894405 0.447157 0) (0.894369 0.44714 0) (0.89429 0.447113 0) (0.894136 0.447077 0) (0.893856 0.447026 0) (0.893376 0.446944 0) (0.89258 0.446828 0) (0.891328 0.446654 0) (0.889448 0.446386 0) (0.886714 0.446003 0) (0.882959 0.445462 0) (0.878167 0.444676 0) (0.872545 0.443646 0) (0.866758 0.442383 0) (0.861911 0.440805 0) (0.859059 0.438811 0) (0.858772 0.436311 0) (0.86118 0.43294 0) (0.866153 0.42791 0) (0.873336 0.420339 0) (0.894404 0.447201 0) (0.894402 0.447201 0) (0.894401 0.447201 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.447199 0) (0.894402 0.447199 0) (0.894403 0.447199 0) (0.894404 0.447198 0) (0.894406 0.447198 0) (0.894411 0.447196 0) (0.894412 0.447195 0) (0.894417 0.44719 0) (0.894423 0.447188 0) (0.894427 0.44718 0) (0.894426 0.447173 0) (0.894416 0.447159 0) (0.894385 0.447144 0) (0.894314 0.447117 0) (0.89417 0.44708 0) (0.893905 0.447026 0) (0.89345 0.446941 0) (0.892692 0.446812 0) (0.89149 0.446622 0) (0.88968 0.446324 0) (0.887048 0.445891 0) (0.883404 0.445286 0) (0.878723 0.444411 0) (0.873203 0.443255 0) (0.867432 0.44186 0) (0.862474 0.440185 0) (0.859444 0.438137 0) (0.858968 0.435651 0) (0.861174 0.43245 0) (0.865974 0.427824 0) (0.873114 0.420867 0) (0.894404 0.447201 0) (0.894403 0.447201 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.894401 0.447199 0) (0.894401 0.4472 0) (0.8944 0.447199 0) (0.894402 0.4472 0) (0.894403 0.447199 0) (0.894405 0.447199 0) (0.894407 0.447198 0) (0.894411 0.447197 0) (0.894415 0.447195 0) (0.89442 0.447192 0) (0.894427 0.447189 0) (0.894432 0.447184 0) (0.894434 0.447175 0) (0.894426 0.447163 0) (0.894401 0.447148 0) (0.894336 0.447123 0) (0.894205 0.447086 0) (0.893957 0.44703 0) (0.893529 0.446942 0) (0.892813 0.446803 0) (0.891669 0.446599 0) (0.889939 0.44628 0) (0.887423 0.445803 0) (0.883915 0.445139 0) (0.879363 0.444193 0) (0.873958 0.442922 0) (0.868225 0.441393 0) (0.863154 0.439623 0) (0.859898 0.437527 0) (0.859178 0.435048 0) (0.861138 0.432 0) (0.865694 0.427772 0) (0.872674 0.421467 0) (0.894404 0.447201 0) (0.894403 0.447201 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894403 0.4472 0) (0.894403 0.447199 0) (0.894405 0.447199 0) (0.894407 0.447199 0) (0.894412 0.447196 0) (0.894416 0.447196 0) (0.894422 0.447193 0) (0.89443 0.44719 0) (0.894437 0.447186 0) (0.894441 0.447179 0) (0.894436 0.447169 0) (0.894415 0.447152 0) (0.894358 0.44713 0) (0.894239 0.447092 0) (0.894011 0.447037 0) (0.893612 0.446948 0) (0.892941 0.446803 0) (0.891866 0.446587 0) (0.890221 0.446253 0) (0.88783 0.445741 0) (0.884481 0.445025 0) (0.880081 0.444021 0) (0.874806 0.442656 0) (0.869132 0.440995 0) (0.863958 0.439119 0) (0.860442 0.436981 0) (0.859413 0.434507 0) (0.861081 0.431581 0) (0.865338 0.427728 0) (0.872052 0.422087 0) (0.894404 0.447201 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.894401 0.447199 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.894403 0.4472 0) (0.894403 0.447199 0) (0.894406 0.447199 0) (0.894408 0.447199 0) (0.894413 0.447197 0) (0.894417 0.447197 0) (0.894425 0.447195 0) (0.894433 0.447192 0) (0.89444 0.447188 0) (0.894447 0.447182 0) (0.894446 0.447173 0) (0.89443 0.447159 0) (0.894379 0.447138 0) (0.894275 0.447101 0) (0.894066 0.447046 0) (0.893696 0.446957 0) (0.893073 0.446811 0) (0.892071 0.446586 0) (0.890524 0.446242 0) (0.888263 0.445707 0) (0.88509 0.444947 0) (0.880872 0.443895 0) (0.875742 0.442462 0) (0.870145 0.440677 0) (0.86489 0.438683 0) (0.861097 0.436496 0) (0.859699 0.434027 0) (0.861011 0.431199 0) (0.864926 0.427669 0) (0.871293 0.422677 0) (0.894405 0.447201 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.894402 0.447199 0) (0.8944 0.4472 0) (0.894404 0.4472 0) (0.894403 0.447199 0) (0.894406 0.447199 0) (0.894409 0.4472 0) (0.894413 0.447198 0) (0.894418 0.447197 0) (0.894426 0.447196 0) (0.894435 0.447194 0) (0.894443 0.44719 0) (0.894453 0.447187 0) (0.894453 0.447177 0) (0.894443 0.447166 0) (0.8944 0.447146 0) (0.894306 0.447112 0) (0.894121 0.447057 0) (0.89378 0.446969 0) (0.893208 0.446825 0) (0.89228 0.446596 0) (0.890841 0.446245 0) (0.888719 0.445702 0) (0.885731 0.444908 0) (0.881719 0.443813 0) (0.876761 0.442334 0) (0.871259 0.44045 0) (0.865951 0.438327 0) (0.861887 0.436069 0) (0.860067 0.433607 0) (0.860951 0.430859 0) (0.864468 0.42759 0) (0.870434 0.423189 0) (0.894405 0.4472 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.894401 0.447201 0) (0.894399 0.447199 0) (0.894401 0.447201 0) (0.894401 0.4472 0) (0.8944 0.447199 0) (0.894403 0.4472 0) (0.894404 0.447199 0) (0.894406 0.4472 0) (0.894409 0.4472 0) (0.894414 0.447199 0) (0.894419 0.447199 0) (0.894428 0.447197 0) (0.894437 0.447196 0) (0.894445 0.447193 0) (0.894458 0.44719 0) (0.89446 0.447182 0) (0.894453 0.447172 0) (0.89442 0.447155 0) (0.894337 0.447124 0) (0.894173 0.447072 0) (0.893866 0.446987 0) (0.893342 0.446843 0) (0.892491 0.446616 0) (0.891166 0.446263 0) (0.889187 0.44572 0) (0.886394 0.444911 0) (0.882613 0.443781 0) (0.877855 0.442267 0) (0.872468 0.440318 0) (0.867134 0.438069 0) (0.862823 0.435708 0) (0.860554 0.43324 0) (0.860934 0.430565 0) (0.863988 0.427501 0) (0.869501 0.423601 0) (0.894405 0.4472 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.894401 0.447201 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.447199 0) (0.894403 0.4472 0) (0.894404 0.4472 0) (0.894406 0.4472 0) (0.894409 0.447199 0) (0.894414 0.447199 0) (0.894419 0.447199 0) (0.894428 0.4472 0) (0.894438 0.447197 0) (0.894447 0.447196 0) (0.894461 0.447194 0) (0.894467 0.447188 0) (0.894463 0.447179 0) (0.894437 0.447163 0) (0.894367 0.447136 0) (0.894222 0.447087 0) (0.893951 0.447007 0) (0.893475 0.446868 0) (0.8927 0.446646 0) (0.891491 0.446295 0) (0.889668 0.445758 0) (0.88707 0.444954 0) (0.883535 0.443803 0) (0.879012 0.442263 0) (0.873769 0.440275 0) (0.868437 0.437922 0) (0.863911 0.435435 0) (0.861193 0.432922 0) (0.861005 0.430306 0) (0.863513 0.427414 0) (0.868521 0.423919 0) (0.894405 0.4472 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894402 0.447201 0) (0.894402 0.4472 0) (0.894405 0.4472 0) (0.894405 0.4472 0) (0.894409 0.4472 0) (0.894415 0.447201 0) (0.89442 0.447199 0) (0.894428 0.447201 0) (0.894438 0.447198 0) (0.89445 0.447199 0) (0.894462 0.447197 0) (0.894471 0.447192 0) (0.894472 0.447188 0) (0.894453 0.447173 0) (0.894394 0.447148 0) (0.894267 0.447103 0) (0.894029 0.447028 0) (0.893604 0.446898 0) (0.892907 0.446684 0) (0.891807 0.446341 0) (0.890147 0.445814 0) (0.88775 0.445027 0) (0.884468 0.443876 0) (0.880213 0.442324 0) (0.875156 0.440315 0) (0.869852 0.43789 0) (0.865149 0.435273 0) (0.862008 0.432668 0) (0.861215 0.430074 0) (0.863092 0.427328 0) (0.867524 0.42416 0) (0.894405 0.4472 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.894399 0.447199 0) (0.894402 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.894402 0.447201 0) (0.894402 0.447199 0) (0.894405 0.4472 0) (0.894406 0.447201 0) (0.894409 0.447199 0) (0.894415 0.447201 0) (0.894419 0.447201 0) (0.894429 0.447201 0) (0.894439 0.447201 0) (0.89445 0.4472 0) (0.894464 0.447203 0) (0.894475 0.447196 0) (0.894478 0.447194 0) (0.894466 0.447182 0) (0.894418 0.447161 0) (0.894309 0.447122 0) (0.894102 0.44705 0) (0.893728 0.446929 0) (0.893106 0.446728 0) (0.892115 0.446399 0) (0.890618 0.445891 0) (0.888428 0.445124 0) (0.885401 0.443999 0) (0.881437 0.442452 0) (0.876611 0.440434 0) (0.87138 0.437969 0) (0.866536 0.435241 0) (0.863008 0.432507 0) (0.861609 0.429878 0) (0.862787 0.427234 0) (0.866552 0.424335 0) (0.894405 0.4472 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447201 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894399 0.4472 0) (0.894402 0.4472 0) (0.894398 0.4472 0) (0.894402 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894402 0.447201 0) (0.894405 0.4472 0) (0.894405 0.4472 0) (0.894409 0.447201 0) (0.894414 0.447201 0) (0.894419 0.447201 0) (0.894429 0.447202 0) (0.894438 0.447203 0) (0.894451 0.447202 0) (0.894464 0.447205 0) (0.894477 0.447202 0) (0.894484 0.4472 0) (0.894475 0.44719 0) (0.894439 0.447174 0) (0.894348 0.447141 0) (0.894169 0.447074 0) (0.893842 0.446963 0) (0.893294 0.446777 0) (0.892411 0.446465 0) (0.891071 0.445983 0) (0.889094 0.445246 0) (0.886325 0.444161 0) (0.88266 0.442642 0) (0.878112 0.440635 0) (0.873012 0.438153 0) (0.868075 0.435341 0) (0.864198 0.432468 0) (0.862217 0.429743 0) (0.862662 0.427137 0) (0.865672 0.424447 0) ) ; boundaryField { emptyPatches_empt { type empty; } top_cyc { type cyclic; } bottom_cyc { type cyclic; } inlet_cyc { type cyclic; } outlet_cyc { type cyclic; } procBoundary2to0 { type processor; value nonuniform List<vector> 75 ( (0.894405 0.447199 0) (0.894403 0.4472 0) (0.894402 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894401 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.447201 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.447199 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894402 0.4472 0) (0.8944 0.447199 0) (0.894403 0.447201 0) (0.894404 0.447201 0) (0.894405 0.4472 0) (0.89441 0.447201 0) (0.894414 0.447201 0) (0.894418 0.447202 0) (0.894428 0.447203 0) (0.894437 0.447204 0) (0.894451 0.447206 0) (0.894464 0.447205 0) (0.894478 0.447207 0) (0.894488 0.447205 0) (0.894482 0.447199 0) (0.894458 0.447185 0) (0.894382 0.447157 0) (0.89423 0.4471 0) (0.893949 0.446999 0) (0.893469 0.446827 0) (0.892693 0.446539 0) (0.891498 0.446085 0) (0.889733 0.445387 0) (0.887231 0.444354 0) (0.88387 0.442887 0) (0.879631 0.440916 0) (0.87473 0.438438 0) (0.869759 0.435572 0) (0.865585 0.432573 0) (0.863056 0.429706 0) (0.862767 0.42706 0) (0.864962 0.424501 0) ) ; } procBoundary2to0throughtop_cyc { type processorCyclic; value nonuniform List<vector> 75 ( (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894401 0.4472 0) (0.894401 0.447199 0) (0.894401 0.447199 0) (0.894402 0.447198 0) (0.894402 0.447197 0) (0.894403 0.447196 0) (0.894404 0.447195 0) ) ; } procBoundary2to3 { type processor; value nonuniform List<vector> 75 ( (0.894406 0.447192 0) (0.894408 0.44719 0) (0.89441 0.447189 0) (0.894412 0.447187 0) (0.894415 0.447185 0) (0.894418 0.447184 0) (0.894421 0.447183 0) (0.894424 0.447184 0) (0.894426 0.447187 0) (0.894427 0.447194 0) (0.894425 0.447206 0) (0.894419 0.447225 0) (0.894407 0.447255 0) (0.894386 0.447298 0) (0.894351 0.447361 0) (0.894297 0.44745 0) (0.894216 0.447573 0) (0.894098 0.447739 0) (0.893933 0.44796 0) (0.893705 0.44825 0) (0.893397 0.448623 0) (0.892988 0.449098 0) (0.892452 0.44969 0) (0.891765 0.450418 0) (0.890896 0.451298 0) (0.889815 0.452342 0) (0.888496 0.453559 0) (0.886915 0.454943 0) (0.885058 0.456479 0) (0.882927 0.458134 0) (0.880542 0.459853 0) (0.877946 0.461561 0) (0.87521 0.463159 0) (0.872425 0.464538 0) (0.869697 0.465583 0) (0.867133 0.466192 0) (0.864826 0.466289 0) (0.862846 0.465833 0) (0.861232 0.464819 0) (0.859995 0.463273 0) (0.859123 0.461242 0) (0.858591 0.458785 0) (0.858368 0.455961 0) (0.85842 0.452833 0) (0.858718 0.44946 0) (0.859233 0.445901 0) (0.859945 0.442212 0) (0.860832 0.43845 0) (0.861878 0.434677 0) (0.863069 0.430948 0) (0.864389 0.427322 0) (0.865821 0.423855 0) (0.867345 0.420604 0) (0.86894 0.417617 0) (0.870578 0.414944 0) (0.872237 0.412624 0) (0.873886 0.410695 0) (0.875498 0.409184 0) (0.877036 0.408103 0) (0.878457 0.407448 0) (0.87971 0.40719 0) (0.880746 0.407297 0) (0.88153 0.407739 0) (0.88204 0.408494 0) (0.882261 0.409537 0) (0.882177 0.410817 0) (0.881763 0.41226 0) (0.881025 0.413784 0) (0.880004 0.415314 0) (0.87876 0.416771 0) (0.877359 0.418079 0) (0.875853 0.419188 0) (0.874282 0.420086 0) (0.87268 0.420798 0) (0.871092 0.421345 0) ) ; } procBoundary2to3throughinlet_cyc { type processorCyclic; value nonuniform List<vector> 75 ( (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.8944 0.4472 0) (0.894399 0.4472 0) (0.894399 0.4472 0) (0.894399 0.447199 0) (0.894399 0.447199 0) (0.894399 0.447199 0) (0.894399 0.447199 0) (0.894398 0.447199 0) (0.894398 0.447199 0) (0.894398 0.447199 0) (0.894397 0.447199 0) (0.894397 0.447199 0) (0.894397 0.447199 0) (0.894396 0.447199 0) (0.894396 0.447199 0) (0.894395 0.447199 0) (0.894395 0.447199 0) (0.894395 0.447199 0) (0.894394 0.447199 0) (0.894394 0.447199 0) (0.894394 0.447199 0) (0.894394 0.447199 0) (0.894393 0.4472 0) (0.894393 0.4472 0) (0.894393 0.4472 0) (0.894393 0.4472 0) (0.894394 0.447201 0) (0.894394 0.447201 0) (0.894394 0.447201 0) (0.894395 0.447201 0) (0.894395 0.447202 0) (0.894396 0.447202 0) (0.894396 0.447202 0) (0.894397 0.447202 0) (0.894398 0.447203 0) (0.894399 0.447203 0) (0.8944 0.447203 0) (0.894401 0.447203 0) (0.894401 0.447203 0) (0.894402 0.447203 0) (0.894403 0.447203 0) (0.894404 0.447202 0) (0.894405 0.447202 0) (0.894405 0.447202 0) (0.894406 0.447202 0) (0.894406 0.447201 0) (0.894407 0.447201 0) (0.894407 0.447201 0) (0.894407 0.4472 0) (0.894407 0.4472 0) (0.894407 0.4472 0) (0.894407 0.4472 0) (0.894407 0.447199 0) ) ; } } // ************************************************************************* //
[ "tdg@debian" ]
tdg@debian
591d1061719a0893f3f0a08d17e04de37f3f445f
46cce0f5350dd7bef7a22bb0a1246f003f40916c
/qt-patches/5.1.1/qtbase/src/plugins/platforms/linuxfb/qvirtualscreen.h
40f3461759f80669170f9340aa915f90b4400f74
[]
no_license
veodev/av_training
6e65d43b279d029c85359027b5c68bd251ad24ff
ecb8c3cdc58679ada38c30df36a01751476f9015
refs/heads/master
2020-04-28T22:23:39.485893
2019-09-23T13:16:29
2019-09-23T13:16:29
175,615,879
0
0
null
null
null
null
UTF-8
C++
false
false
2,659
h
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QPLATFORMINTEGRATION_MINIMAL_H #define QPLATFORMINTEGRATION_MINIMAL_H #include <qpa/qplatformintegration.h> #include <qpa/qplatformscreen.h> QT_BEGIN_NAMESPACE class QVirtualScreen : public QPlatformScreen { public: QVirtualScreen(const QRect &geometry) : mGeometry(geometry) , mDepth(32) , mFormat(QImage::Format_ARGB32_Premultiplied) , mPhysicalSize(geometry.size()) {} QRect geometry() const { return mGeometry; } int depth() const { return mDepth; } QImage::Format format() const { return mFormat; } public: QRect mGeometry; int mDepth; QImage::Format mFormat; QSize mPhysicalSize; }; QT_END_NAMESPACE #endif
a78086d351c9693f26c884a8125bfbc0a737f6bf
bb698c8ea25f04f1ee3b9a1d73ffb7c1c60dc7fc
/src/MobileShellExtLauncher/pch.h
b39f564740510d56fcc7a7c33c704c975d87eef6
[ "MIT" ]
permissive
ADeltaX/MobileShell
604e4c2366a61e899ba2b4674a7982e19a413aa6
74892d7beec7df24671ed2e3d12ac03465da174c
refs/heads/xamlhost
2021-08-03T06:33:19.839282
2019-11-10T04:18:58
2019-11-10T04:18:58
174,632,273
366
35
MIT
2021-07-23T05:05:45
2019-03-09T01:03:43
C++
UTF-8
C++
false
false
5,608
h
/* MIT License Copyright (c) 2019 Gustave Monce - @gus33000 - gus33000.me 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. Readapted from: https://raw.githubusercontent.com/gus33000/RegistryRT/master/pch.h */ #pragma once #include <Windows.h> #include <winnt.h> #include <ppltasks.h> #include <winrt/base.h> #include <algorithm> using namespace winrt; typedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; PWSTR Buffer; } UNICODE_STRING; typedef struct _PEB_LDR_DATA { BYTE Reserved1[8]; PVOID Reserved2[3]; LIST_ENTRY InMemoryOrderModuleList; } PEB_LDR_DATA, * PPEB_LDR_DATA; typedef struct _RTL_USER_PROCESS_PARAMETERS { BYTE Reserved1[16]; PVOID Reserved2[10]; UNICODE_STRING ImagePathName; UNICODE_STRING CommandLine; } RTL_USER_PROCESS_PARAMETERS, * PRTL_USER_PROCESS_PARAMETERS; typedef struct _PEB { BYTE Reserved1[2]; BYTE BeingDebugged; BYTE Reserved2[1]; PVOID Reserved3[2]; PPEB_LDR_DATA Ldr; PRTL_USER_PROCESS_PARAMETERS ProcessParameters; PVOID Reserved4[3]; PVOID AtlThunkSListPtr; PVOID Reserved5; ULONG Reserved6; PVOID Reserved7; ULONG Reserved8; ULONG AtlThunkSListPtr32; PVOID Reserved9[45]; BYTE Reserved10[96]; PVOID PostProcessInitRoutine; BYTE Reserved11[128]; PVOID Reserved12[1]; ULONG SessionId; } PEB, * PPEB; typedef struct _MY_PEB_LDR_DATA { ULONG Length; BOOL Initialized; PVOID SsHandle; LIST_ENTRY InLoadOrderModuleList; LIST_ENTRY InMemoryOrderModuleList; LIST_ENTRY InInitializationOrderModuleList; } MY_PEB_LDR_DATA, * PMY_PEB_LDR_DATA; typedef struct _MY_LDR_DATA_TABLE_ENTRY { LIST_ENTRY InLoadOrderLinks; LIST_ENTRY InMemoryOrderLinks; LIST_ENTRY InInitializationOrderLinks; PVOID DllBase; PVOID EntryPoint; ULONG SizeOfImage; UNICODE_STRING FullDllName; UNICODE_STRING BaseDllName; } MY_LDR_DATA_TABLE_ENTRY, * PMY_LDR_DATA_TABLE_ENTRY; inline winrt::hstring Str(UNICODE_STRING US) { wchar_t* str = (wchar_t*)malloc(US.Length + sizeof(wchar_t)); memcpy(str, US.Buffer, US.Length); str[US.Length / sizeof(wchar_t)] = 0; winrt::hstring ret(str); free(str); return ret; } inline winrt::hstring Str(const char* char_array) { std::string s_str = std::string(char_array); std::wstring wid_str = std::wstring(s_str.begin(), s_str.end()); const wchar_t* w_char = wid_str.c_str(); return winrt::hstring(w_char); } inline winrt::hstring ToLower(winrt::hstring str) { std::wstring wid_str = str.data(); std::transform(wid_str.begin(), wid_str.end(), wid_str.begin(), ::tolower); return winrt::hstring(wid_str.c_str()); } inline PEB* NtCurrentPeb() { #ifdef _M_X64 return (PEB*)(__readgsqword(0x60)); #elif _M_IX86 return (PEB*)(__readfsdword(0x30)); #elif _M_ARM return *(PEB**)(_MoveFromCoprocessor(15, 0, 13, 0, 2) + 0x30); #elif _M_ARM64 return *(PEB**)(__getReg(18) + 0x60); // TEB in x18 #elif _M_IA64 return *(PEB**)(_rdteb() + 0x60); #elif _M_ALPHA return *(PEB**)(_rdteb() + 0x30); #elif _M_MIPS return *(PEB**)((*(char**)(0x7ffff030)) + 0x30); #elif _M_PPC // winnt.h of the period uses __builtin_get_gpr13() or __gregister_get(13) depending on _MSC_VER return *(PEB**)(__gregister_get(13) + 0x30); #else #error "This architecture is currently unsupported" #endif }; #define IMAGE_DIRECTORY_ENTRY_EXPORT 0 inline FARPROC GetProcAddressNew(winrt::hstring dll, winrt::hstring func) { dll = ToLower(dll); func = ToLower(func); auto Ldr = (PMY_PEB_LDR_DATA)(NtCurrentPeb()->Ldr); auto NextModule = Ldr->InLoadOrderModuleList.Flink; auto TableEntry = (PMY_LDR_DATA_TABLE_ENTRY)NextModule; while (TableEntry->DllBase != NULL) { PVOID base = TableEntry->DllBase; winrt::hstring dllName = ToLower(Str(TableEntry->BaseDllName)); auto PE = (PIMAGE_NT_HEADERS)((ULONG_PTR)base + ((PIMAGE_DOS_HEADER)base)->e_lfanew); auto exportdirRVA = PE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress; TableEntry = (PMY_LDR_DATA_TABLE_ENTRY)TableEntry->InLoadOrderLinks.Flink; if (exportdirRVA == 0) continue; if (dllName != dll) continue; auto Exports = (PIMAGE_EXPORT_DIRECTORY)((ULONG_PTR)base + exportdirRVA); auto Names = (PDWORD)((PCHAR)base + Exports->AddressOfNames); auto Ordinals = (PUSHORT)((ULONG_PTR)base + Exports->AddressOfNameOrdinals); auto Functions = (PDWORD)((ULONG_PTR)base + Exports->AddressOfFunctions); for (UINT32 iterator = 0; iterator < Exports->NumberOfNames; iterator++) { winrt::hstring funcName = ToLower(Str((PCSTR)(Names[iterator] + (ULONG_PTR)base))); if (funcName != func) continue; USHORT ordTblIndex = Ordinals[iterator]; return (FARPROC)((ULONG_PTR)base + Functions[ordTblIndex]); } } return NULL; }
a11e0616b33145a42a19eb2cd12a1346f6c07576
5032f37ec71db5a6321bc319d82ccd307c48c825
/newgame/game_Object.h
c49583639ecdace0d6c95f53f8f8b20dca7237da
[]
no_license
nmng108/snakegame0.1
4dae421ced7a714c640c9d4a941ab56260b0ef78
863d3795d09e9e88f0443f924b8395c8813c3a00
refs/heads/main
2023-03-21T04:52:25.797894
2021-03-16T05:43:01
2021-03-16T05:43:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,271
h
#ifndef GAME_OBJECT_H #define GAME_OBJECT_H #include <iostream> #include <ctime> #include <vector> #include "SDL_utils.h" using namespace std; enum Direction { Freeze, Up, Down, Left, Right } ; struct Point{ int x, y; }; enum object { Snake, SnakeHEAD, Wall, Fruit, Blank }; class snake { public: Point HEAD; vector <Point> body; void event_handle(SDL_Event &event, bool &in_game, bool &running); void Move(Direction &old_DIRECTION, int column, int row); void update_in_array(); // undefined bool eatFruit(Point fruit); void getLonger(); Direction DIRECTION = Freeze; bool CRASH(); //return 1 if happening accident private: Point old_Point; int body_CELL=1; }; class Map { //include map, wall and fruit public: int row, column; //use in snake::move<void> Map(int getCOL, int getROW) { row = getROW; column = getCOL; } vector<vector<object>> board; void create_Map(); //include wall(or not) Point getFruit(snake SNAKE); Point fruit; vector<vector<object>> show_in_2Darray(snake SNAKE); //take fruit, snake::body+HEAD, }; void render_with_2Darray(vector<vector<object>> MAP, int side_of_aUnit, SDL_Renderer *ren); #endif // GAME_OBJECT_H
bfce5e915780bbb8c662518d3ea1eb8875308f72
3a35c8ab42f4b39a0f0cab2a54347e27f961debd
/16orders/orders.cpp
c533e7c964a11fb7d2925aaed46bb34567336028
[]
no_license
ayushinigam98/DQ
2aaabac7beaf4f2908b6681065957784b542addf
259568a6bafeb57c9d894eb3669733db53388cb0
refs/heads/main
2023-08-03T19:18:40.339702
2021-08-27T09:08:44
2021-08-27T09:08:44
388,118,455
0
0
null
null
null
null
UTF-8
C++
false
false
1,523
cpp
#include <iostream> using namespace std; void print(int arr[], int n) { cout<<endl; for(int i=0; i<n; i++) { cout<<arr[i]<<" "; } cout<<endl; } void record(int id, int &head, int arr[], int N) { if(head == -1) { head = 0; arr[head] = id; } else { head = (head+1)%N; arr[head] = id; } } int get_last(int i, int head, int arr[], int N) { return arr[(head - (i-1) + N)%N]; } int main() { cout<<"max No. of elements in that can be stored: "<<endl; int N; cin>>N; int arr[N]; int head = -1; int opt; bool loop = true; while(loop) { cout<<"---------"<<endl; cout<<"1. store record ID"<<endl; cout<<"2. get ith from the end record"<<endl; cout<<"3. leave"<<endl; cout<<"---------"<<endl; cin>>opt; switch (opt) { case 1: cout<<"get the id: "; int id; cin>>id; record(id, head, arr, N); print(arr, N); break; case 2: cout<<"get i: "; int i; cin>>i; cout<<get_last(i, head, arr, N)<<endl; break; case 3: loop = false; break; default: cout<<"unknown"<<endl; } } return 0; }
3885b2d72273f268571df228027ea3fc9da5360c
7d4eb3ddd0022efb44a0b512b0e887772efcd8b9
/5_MoreOnTemplates/iProduct.h
d63352977a96f9bb2aa982d9287b8fef6f707210
[]
no_license
Ebyy/More_C_PlusPlus
55cb9b8fe447f12efbde9ab3882f031bef404a24
f9f27a6d0bb1ddec8a6c355ce3e23ac6ddb09cc7
refs/heads/master
2020-06-02T08:25:17.395974
2019-07-08T15:16:41
2019-07-08T15:16:41
191,098,047
0
0
null
null
null
null
UTF-8
C++
false
false
939
h
/* ============================================================================ Name : iProduct.h Author : Eberechi Ogunedo Email : [email protected] Student # : 117277160 Course Code : OOP345 Section : SCC Date : July 5, 2019 Workshop : Workshop 6 - Lab ============================================================================ */ /* ============================================================================ Description : iProduct header file with interface ============================================================================ */ #ifndef MYPROD_INTERFACE #define MYPROD_INTERFACE #include <iostream> namespace sict { //iProduct interface class iProduct { public: virtual double price()const = 0; virtual void display(std::ostream&)const = 0; }; std::ostream& operator<<(std::ostream&, const iProduct&); iProduct* readRecord(std::ifstream&); } #endif
e3512ba8dd118ce947ecc46a6e107ed7715a2f7e
c1ff870879152fba2b54eddfb7591ec322eb3061
/plugins/render/ogreRender/3rdParty/ogre/OgreMain/src/OgreAtomicScalar.cpp
c2c545af0fd930e66d31df1cadc77124e71079fb
[ "MIT", "LicenseRef-scancode-free-unknown" ]
permissive
MTASZTAKI/ApertusVR
1a9809fb7af81c3cd7fb732ed481ebe4ce66fefa
424ec5515ae08780542f33cc4841a8f9a96337b3
refs/heads/0.9
2022-12-11T20:03:42.926813
2019-10-11T09:29:45
2019-10-11T09:29:45
73,708,854
188
55
MIT
2022-12-11T08:53:21
2016-11-14T13:48:00
C++
UTF-8
C++
false
false
2,701
cpp
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2016 Torus Knot Software Ltd 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 "OgreStableHeaders.h" #include "OgreAtomicScalar.h" #ifdef NEED_TO_INIT_INTERLOCKEDCOMPAREEXCHANGE64WRAPPER namespace Ogre { InterlockedCompareExchange64Wrapper::func_InterlockedCompareExchange64 InterlockedCompareExchange64Wrapper::Ogre_InterlockedCompareExchange64; InterlockedCompareExchange64Wrapper::InterlockedCompareExchange64Wrapper() { Ogre_InterlockedCompareExchange64 = NULL; // In win32 we will get InterlockedCompareExchange64 function address, in XP we will get NULL - as the function doesn't exist there. #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) HINSTANCE kernel32Dll = LoadLibrary("KERNEL32.DLL"); Ogre_InterlockedCompareExchange64 = (func_InterlockedCompareExchange64)GetProcAddress(kernel32Dll, "InterlockedCompareExchange64"); #endif // In WinRT we can't LoadLibrary("KERNEL32.DLL") - but on the other hand we don't have the issue - as InterlockedCompareExchange64 exist on // all WinRT platforms (if not - add to the #if below) #if (OGRE_PLATFORM == OGRE_PLATFORM_WINRT) Ogre_InterlockedCompareExchange64 = _InterlockedCompareExchange64; #endif } // Here we call the InterlockedCompareExchange64Wrapper constructor so Ogre_InterlockedCompareExchange64 will be init once when the program loads. InterlockedCompareExchange64Wrapper interlockedCompareExchange64Wrapper; } #endif
12a30e9fe9c4fe60cacd4b390676564ca828fde2
2eba3b3b3f979c401de3f45667461c41f9b3537a
/root/meta/evolution/signedchar.h
1c0c0c9577d7040f90cc55b28e38942c7e84870c
[]
no_license
root-project/roottest
a8e36a09f019fa557b4ebe3dd72cf633ca0e4c08
134508460915282a5d82d6cbbb6e6afa14653413
refs/heads/master
2023-09-04T08:09:33.456746
2023-08-28T12:36:17
2023-08-29T07:02:27
50,793,033
41
105
null
2023-09-06T10:55:45
2016-01-31T20:15:51
C++
UTF-8
C++
false
false
292
h
#include <list> struct TQuality { unsigned char m_FiredPlanes; char m_QualityTabNumber; char m_QualityValue; char m_logsector; char m_logsegment; signed char m_tower; // signed int m_intTower; // std::list<signed char> m_list; // std::list<signed int> m_intlist; };
c1dcaafd95f25bd565ba737d762fd910afcf21a5
17f2dd4fde9cbcd9b3b0cd101fc740d3495bbe80
/514 - тех. пр. B5/B5-6/common/streamFunction.cpp
75e3cbe5ebab018c875e13898626f456611d68c8
[ "Apache-2.0" ]
permissive
NekoSilverFox/CPP
0a7f48b50ee1769bb5ba318fb6fb6c6c342e5544
c6797264fceda4a65ac3452acca496e468d1365a
refs/heads/master
2021-11-11T17:48:48.514822
2021-11-01T20:30:31
2021-11-01T20:30:31
230,780,197
11
7
null
2021-04-11T22:24:56
2019-12-29T17:12:19
C++
UTF-8
C++
false
false
685
cpp
#include "streamFunction.hpp" #include <iostream> std::istream& jianing::sf::rmw(std::istream& istr) { if (!istr.good()) { return istr; } while (std::isblank(istr.peek())) { istr.get(); } return istr; } void jianing::sf::istreamNotEof(std::istream& istr, const char* err_msg) { if (!istr.eof()) { throw std::invalid_argument(err_msg); } } void jianing::sf::istreamNotEofAndFail(std::istream& istr, const char* err_msg) { if ((!istr.eof()) && (istr.fail())) { throw std::runtime_error(err_msg); } } void jianing::sf::istreamBad(std::istream& istr, const char* err_msg) { if (istr.bad()) { throw std::runtime_error(err_msg); } }
4a43b899b002a8a51489478d69c198b40974fef4
7581db0625dfe7ca8b7e829c7f95dfc2503e5e00
/fboss/agent/platforms/sai/SaiBcmWedge40Platform.cpp
de23de214639eaf45e20f4f3f85374a8ecad3c51
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
midopooler/fboss
53e8e33693116356b1ac35bc3ff0d87d3e378dd3
c8d08dd4255e97e5977f53712e7c91a7d045a0cb
refs/heads/master
2022-09-22T13:54:44.231859
2020-05-31T18:56:46
2020-05-31T18:58:34
268,364,523
0
0
NOASSERTION
2020-05-31T21:08:39
2020-05-31T21:08:39
null
UTF-8
C++
false
false
1,451
cpp
/* * Copyright (c) 2004-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #include "fboss/agent/platforms/sai/SaiBcmWedge40Platform.h" #include "fboss/agent/hw/switch_asics/Trident2Asic.h" #include "fboss/agent/platforms/common/wedge40/Wedge40PlatformMapping.h" #include <cstdio> #include <cstring> namespace facebook::fboss { SaiBcmWedge40Platform::SaiBcmWedge40Platform( std::unique_ptr<PlatformProductInfo> productInfo) : SaiBcmPlatform( std::move(productInfo), std::make_unique<Wedge40PlatformMapping>()) { asic_ = std::make_unique<Trident2Asic>(); } std::vector<PortID> SaiBcmWedge40Platform::masterLogicalPortIds() const { constexpr std::array<int, 16> kMasterLogicalPortIds = { 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61}; std::vector<PortID> portIds; portIds.reserve(kMasterLogicalPortIds.size()); std::for_each( kMasterLogicalPortIds.begin(), kMasterLogicalPortIds.end(), [&portIds](auto portId) { portIds.emplace_back(PortID(portId)); }); return portIds; } HwAsic* SaiBcmWedge40Platform::getAsic() const { return asic_.get(); } SaiBcmWedge40Platform::~SaiBcmWedge40Platform() {} } // namespace facebook::fboss
9412dc0e09f3bc6a086d7a56ddbfc66102b6827a
a1809f8abdb7d0d5bbf847b076df207400e7b08a
/Simpsons Hit&Run/tools/statepropbuilder/src/statepropdata.cpp
20d6aac1522773398454058f6342f757f4f6feec
[]
no_license
RolphWoggom/shr.tar
556cca3ff89fff3ff46a77b32a16bebca85acabf
147796d55e69f490fb001f8cbdb9bf7de9e556ad
refs/heads/master
2023-07-03T19:15:13.649803
2021-08-27T22:24:13
2021-08-27T22:24:13
400,380,551
8
0
null
null
null
null
UTF-8
C++
false
false
8,371
cpp
#include <string.h> #include <p3d/utility.hpp> #include <p3d/anim/animatedobject.hpp> #include <constants/chunkids.hpp> #include <p3d/chunkfile.hpp> #include "stateprop/statepropdata.hpp" //============================================================================= // Class Declarations // Prop //============================================================================= CStatePropData::CStatePropData( ) : m_ObjectFactory( NULL ), m_NumStates(0), m_StateData(NULL) { } CStatePropData::~CStatePropData() { if (m_ObjectFactory) { m_ObjectFactory->Release(); } unsigned int i = 0; for( i; i < m_NumStates; i++ ) { delete m_StateData[i]; } delete m_StateData; } //============================================================================= //State Data //============================================================================= //Get unsigned int CStatePropData::GetNumberOfStates() { return m_NumStates; } StateData CStatePropData::GetStateData( unsigned int state ) { return ( * (m_StateData[ state ]) ) ; } //============================================================================= //Transition Data //============================================================================= //Get TransitionData CStatePropData::GetTransitionData( int state ) { return m_StateData[state]->transitionData; } //============================================================================= //Visibility Data //============================================================================= //Get VisibilityData CStatePropData::GetVisibilityData( int state , int index) { return ( m_StateData[state]->visibilityData[index] ); } //============================================================================= //Frame controller data //============================================================================= //Get FrameControllerData CStatePropData::GetFrameControllerData( int state, int fc ) { return m_StateData[state]->frameControllerData[fc]; } //============================================================================= //Event data //============================================================================= //Get unsigned int CStatePropData::GetNumberOfEvents( int state ) { return m_StateData[state]->numEvents; } EventData CStatePropData::GetEventData( int state , int eventindex ) { return m_StateData[state]->eventData[eventindex]; } //============================================================================= //Callback Data //============================================================================= //Get unsigned int CStatePropData::GetNumberOfCallbacks( int state ) { return m_StateData[state]->numCallbacks; } CallbackData CStatePropData::GetCallbackData( int state , int eventindex ) { return m_StateData[state]->callbackData[eventindex]; } //============================================================================= // Class Declarations // PropLoader //============================================================================= CStatePropDataLoader::CStatePropDataLoader() : tSimpleChunkHandler(StateProp::STATEPROP) { } //------------------------------------------------------------------------- tEntity* CStatePropDataLoader::LoadObject(tChunkFile* f, tEntityStore* store) { CStatePropData* statePropData = new CStatePropData(); unsigned int version = f->GetLong(); //get the name char buf[256]; f->GetPString(buf); statePropData->SetName(buf); //get the object factory f->GetPString(buf); statePropData->m_ObjectFactory = p3d::find<tAnimatedObjectFactory>(store, buf); if ( statePropData->m_ObjectFactory ) { statePropData->m_ObjectFactory->AddRef(); } //get the num states statePropData->m_NumStates = f->GetLong(); statePropData->m_StateData = new StateData*[statePropData->m_NumStates]; memset(statePropData->m_StateData,0,statePropData->m_NumStates*sizeof(StateData*)); unsigned int currState; unsigned int i; for ( currState = 0; currState < statePropData->m_NumStates; currState++ ) { f->BeginChunk(); //get name f->GetPString(buf); bool autoTransition = ( f->GetLong() != 0 ); unsigned int toState = f->GetLong(); unsigned int numDrawables = f->GetLong(); unsigned int numFrameControllers = f->GetLong(); unsigned int numEvents = f->GetLong(); unsigned int numCallbacks = f->GetLong(); float onFrame = f->GetFloat(); //give me memory dammit int memsize = ( sizeof(StateData) ) + ( sizeof(VisibilityData) * numDrawables ) + ( sizeof(FrameControllerData) * numFrameControllers ) + ( sizeof(EventData) * numEvents ) + ( sizeof(CallbackData) * numCallbacks ); unsigned char* memptr = new unsigned char[ memsize ]; memset( memptr,0, memsize ); statePropData->m_StateData[currState] = (StateData*)memptr; statePropData->m_StateData[currState]->numEvents = numEvents; statePropData->m_StateData[currState]->numCallbacks = numCallbacks; //Transition data statePropData->m_StateData[currState]->transitionData.autoTransition = autoTransition; statePropData->m_StateData[currState]->transitionData.onFrame = onFrame; statePropData->m_StateData[currState]->transitionData.toState = toState; //Visibility data statePropData->m_StateData[currState]->visibilityData = (VisibilityData*) ( memptr + sizeof(StateData) ); for ( i=0; i < numDrawables; i++ ) { f->BeginChunk(); f->GetPString(buf); VisibilityData *p = &(statePropData->m_StateData[currState]->visibilityData[i]); p->isVisible = (f->GetLong() != 0); f->EndChunk(); } //FrameController data statePropData->m_StateData[currState]->frameControllerData = (FrameControllerData*) ( memptr + sizeof(StateData) + ( sizeof(VisibilityData) * numDrawables ) ); for ( i=0; i < numFrameControllers; i++ ) { f->BeginChunk(); f->GetPString(buf); FrameControllerData* p = &(statePropData->m_StateData[currState]->frameControllerData[i]); p->isCyclic = ( f->GetLong() != 0 ); p->numberOfCycles = f->GetLong(); p->holdFrame = ( f->GetLong() != 0 ); p->minFrame = f->GetFloat(); p->maxFrame = f->GetFloat(); p->relativeSpeed = f->GetFloat(); f->EndChunk(); } //Event data statePropData->m_StateData[currState]->eventData = (EventData*) ( memptr + sizeof(StateData) + ( sizeof(VisibilityData) * numDrawables ) + ( sizeof(FrameControllerData) * numFrameControllers ) ); for ( i=0; i < numEvents; i++ ) { f->BeginChunk(); EventData* p = &(statePropData->m_StateData[currState]->eventData[i]); memcpy( p->eventName , f->GetPString(buf) , 64 ); p->toState = f->GetLong(); p->eventID = f->GetLong(); f->EndChunk(); } //Callback data statePropData->m_StateData[currState]->callbackData = (CallbackData*) ( memptr + sizeof(StateData) + ( sizeof(VisibilityData) * numDrawables ) + ( sizeof(FrameControllerData) * numFrameControllers ) + ( sizeof(EventData) * numEvents ) ); for ( i=0; i < numCallbacks; i++ ) { f->BeginChunk(); CallbackData* p = &(statePropData->m_StateData[currState]->callbackData[i]); memcpy( p->callbackName , f->GetPString(buf) , 64 ); p->callbackID = f->GetLong(); p->onFrame = f->GetFloat(); f->EndChunk(); } f->EndChunk(); } return statePropData; }
61ff9284111e2c36677c316e6449cf47bbfb8ae0
715cf8257d0c8240ef5a7f2d949145c29eb3638a
/src/main.cpp
b209fa8630f490d932821b7d2e83a313aae9d114
[]
no_license
jifengthu/High-Frequency-Trading-OrderBook
8965dade49ce88d200fcc30f38216436e8976447
b1ca30607fa54770c0078f06fe1e7ce315fa1eaa
refs/heads/master
2023-03-16T14:14:54.924624
2018-04-23T15:51:14
2018-04-23T15:51:14
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,562
cpp
// // main.cpp // WTLCapitalInterview // // Created by Sumanta Bose on 22/7/17. // Copyright © 2017 Sumanta Bose. All rights reserved. // #include <iostream> #include <fstream> #include <sstream> #include <string> #include <stdlib.h> #include "messageHandler.hpp" #include "inventoryManager.hpp" using namespace std; int main(int argc, const char * argv[]) { WTLinventory inventory; inventory.totalProfit = 0; messageData inMsg; // inMsg is the messageData object encapsulating one row of message data. std::ifstream messageStream("_MessageBook.txt"); std::ofstream orderBook("_OrderBook.txt",ios::out); std::ofstream logBook("_LogBook.txt",ios::out); logBook << "Message no.\tMessage Line\tOrderBook before transaction\tOrderBook after transaction\tProfit from transaction\tRemark\n"; int messageRow = 1, cellID, value = 0; long int profit; std::string messageLine, messageCell, orderDetails; // Message stream starts to get read here while(std::getline(messageStream,messageLine)) // Loop until last line of message stream { std::stringstream lineStream(messageLine); // Read each message line cout << "Message row no." << messageRow << ":\n" << messageLine << endl; // For test purposes //logBook << "Msg #" << messageRow << "\t" << messageLine << "\t"; // Old code. Error: Prints CR messagePrinter(logBook, messageLine, messageRow); //New code bool decision = true; value = 0; cellID = 0; // cellID: 0(action), 1(orderid), 2(side), 3(quantity) and 4(price) while(std::getline(lineStream,messageCell,',') && cellID < 6) // Loop & QC until last cell of message line { switch (cellID) { case 0: if (!actionQCcheck(messageCell[0])) { cout << "Invalid Action." << endl; logBook << "\t\t\tInvalid Action."; decision = false; } else { inMsg.action = messageCell[0]; cout << "Action = " << inMsg.action << endl; } break; case 1: if (!intQCcheck(messageCell)) { cout << "Invalid Order ID." << endl; if (!decision) { logBook << " Invalid Order ID."; } else { logBook << "\t\t\tInvalid Order ID."; } decision = false; } else if (inventory.duplicateOIDcheck(mySTOLL(messageCell),inMsg.action)) { cout << "Duplicate Order ID." << endl; if (!decision) { logBook << " Duplicate Order ID."; } else { logBook << "\t\t\tDuplicate Order ID."; } decision = false; } else { inMsg.orderid = mySTOLL(messageCell); cout << "Order ID = " << inMsg.orderid << endl; } break; case 2: if (!sideQCcheck(messageCell[0])) { cout << "Invalid Side." << endl; if (!decision) { logBook << " Invalid Side."; } else { logBook << "\t\t\tInvalid Side."; } decision = false; } else { inMsg.side = messageCell[0]; cout << "Side = " << inMsg.side << endl; } break; case 3: if (!intQCcheck(messageCell)) { cout << "Invalid Quantity." << endl; if (!decision) { logBook << " Invalid Quantity."; } else { logBook << "\t\t\tInvalid Quantity."; } decision = false; } else { inMsg.quantity = mySTOL(messageCell); cout << "Quantity = " << inMsg.quantity << endl; } break; case 4: carriageReturnCorrector(messageCell); // To get rid of the carriage return at the end if (!intQCcheck(messageCell)) { cout << "Invalid Price." << endl; if (!decision) { logBook << " Invalid Price."; } else { logBook << "\t\t\tInvalid Price."; } decision = false; } else { inMsg.price = mySTOL(messageCell); cout << "Price = " << inMsg.price << endl; } break; default: cout << "Invalid message length." << endl; if (!decision) { logBook << " Invalid message length."; } else { logBook << "\t\t\tInvalid message length."; } decision = false; break; } cellID ++ ; // Increment cellID to read the next message cell } // One row of message is read at this point if(!decision) // Quality Control check point. { cout << "Message QC check failed at row " << messageRow << ". Message ignored." << endl; logBook << " Message ignored." << endl; } else // Message QC check passed. Inventory will be updated now. { cout << "Message QC check passed." << endl; switch (inMsg.side) { case 'S': switch (inMsg.action) { case 'A': inventory.sellInventoryAdd(inMsg); break; case 'X': if (!inventory.sellInventoryDelete(inMsg)) { cout << "Delete Error: Order ID or Side or Quantity or Price mismatch." << endl; logBook << "\t\t\tDelete Error: Order ID or Side or Quantity or Price mismatch.\n"; value = 1; } break; case 'M': if (!inventory.sellInventoryModify(inMsg)) { cout << "Modify Error: Order ID or Side mismatch." << endl; logBook << "\t\t\tModify Error: Order ID or Side mismatch.\n"; value = 1; } break; default: cout << "inMsg.action switch error.\n"; break; } break; case 'B': switch (inMsg.action) { case 'A': inventory.buyInventoryAdd(inMsg); break; case 'X': if (!inventory.buyInventoryDelete(inMsg)) { cout << "Delete Error: Order ID or Side or Quantity or Price mismatch." << endl; logBook << "\t\t\tDelete Error: Order ID or Side or Quantity or Price mismatch.\n"; value = 1; } break; case 'M': if (!inventory.buyInventoryModify(inMsg)) { cout << "Modify Error: Order ID or Side mismatch." << endl; logBook << "\t\t\tModify Error: Order ID or Side mismatch.\n"; value = 1; } break; default: cout << "inMsg.action switch error.\n"; break; } break; default: cout << "inMsg.side switch error.\n"; break; } // For the sake of record, we will record the OrderBook before transaction. orderDetails = inventory.orderBookExtractor(); if (!value) logBook << orderDetails << "\t"; // Initial inventory is updated at this point. Inventory transaction will take place now. profit = inventory.inventoryTransaction(); // Inventory transaction is complete at this point. OrderBook will be updated now. orderDetails = inventory.orderBookExtractor(); orderBook << orderDetails << endl; if (!value) logBook << orderDetails << "\t Transaction Profit = " << profit << "\tOkay done." << endl; } // Next message line will be read from the stream and the cycle repeated. messageRow++; // Increment message row number. cout << endl; } inventory.sellInventoryPrintList(); inventory.buyInventoryPrintList(); messageStream.close(); orderBook.close(); logBook << "\t\t\t\tTOTAL PROFIT = " << inventory.totalProfit << endl; logBook.close(); cout << "TOTAL PROFIT = " << inventory.totalProfit << endl; return 0; }
1d072612815f3dfd8c22cac68e7bda9905a84fdb
82f40c93f5f0f226b77053d934d7ac4b8071b59f
/userSource/Example 1/25.u29.391.cpp
150ec2700fc35963766896ad4468c37b838d8bf7
[]
no_license
sihcpro/DetectSimilarCodeWeb
eb6cd4074efb4abf6deaf0fc6f8597789dffc96c
52456d6e06116b01c2b3866155a63dd90a4b8633
refs/heads/master
2020-03-19T02:58:55.691679
2018-06-01T07:24:03
2018-06-01T07:24:03
135,682,312
0
0
null
null
null
null
UTF-8
C++
false
false
579
cpp
#include <bits/stdc++.h> using namespace std; long a[500005],b[500005]; int main() { long i,j,n,m,kq=2000000000,dem=0,c1,c2; cin>>n>>m; cin>>c1>>c2; for (i=1;i<=n;i++) scanf("%ld",&a[i]); for (i=1;i<=m;i++) scanf("%ld",&b[i]); sort(a+1,a+n+1); sort(b+1,b+m+1); i=1,j=1; while (i<=n && j<=m) { if (abs(a[i]-b[j])<kq) { dem=1; kq=abs(a[i]-b[j]); } else if (abs(a[i]-b[j])==kq) dem++; if (a[i]<=b[j]) i++; else j++; } cout<<kq+abs(c1-c2)<<" "<<dem; return 0; }
ce9be3919c56537e6cafb8f5b3c9b456e98c2696
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/rtorrent/gumtree/rtorrent_repos_function_93.cpp
dc530171d85d563e866aa8beba542a6b326e8cf3
[]
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
189
cpp
torrent::File* xmlrpc_find_file(core::Download* download, uint32_t index) { if (index >= download->file_list()->size_files()) return NULL; return (*download->file_list())[index]; }
de123db7da6c3cfb32082074a576a1fe76b03152
7c9f444293dbb5bd08b7ca4a287d0099bf75e6c7
/SnakeGraphics/include/SymbolTranslation.h
75737a516577c9f7e7e6f315021c7cfd2b976f2a
[]
no_license
bogdanfacaianu/SnakeProject
9896c5e82800daea8da5bd79a3580459aceb1d92
d749d336f3f108e05889aaa3b91779da8b97ae1b
refs/heads/master
2021-01-12T17:47:12.927649
2018-10-08T17:59:59
2018-10-08T17:59:59
69,391,426
0
0
null
null
null
null
UTF-8
C++
false
false
423
h
#pragma once #include <SDL.h> #include <Texture.h> #include <Item.h> class SymbolTranslation{ private: char symbol; Texture texture; SDL_Renderer* renderer; public: // Constructor SymbolTranslation(char sym, SDL_Renderer* requiredRenderer); // accessors SDL_Texture* GetTexture(); char GetSymbol(); // Texture management depending on given symbol void ConvertToTextureFromSymbol(); ~SymbolTranslation(); };
964f955c6796200c08589eb27aec3d4d5ec66db6
d0ddd04acf99e361dcdce133093714808ed36e2e
/app/main.cpp
3a9750c987c5bb68a1c1b12ffc8ec507274d7d1c
[]
no_license
karthikns/munip
e9021394c9a0aa93f1458f36a4e3899b9f4d6ae7
3feda4f939aed7792b09a44d4b16af5767ac0f66
refs/heads/master
2020-08-07T02:22:40.924705
2010-06-11T02:09:55
2010-06-11T02:09:55
213,258,295
0
0
null
null
null
null
UTF-8
C++
false
false
198
cpp
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow *mw = new MainWindow(); mw->show(); return app.exec(); }
[ "krishna_ggk@e0e46c49-be69-4f5a-ad62-21024a331aea" ]
krishna_ggk@e0e46c49-be69-4f5a-ad62-21024a331aea
b7ada03f977baaa9b4154fb96d1f7b1ced83eb83
6436d1e6c23f9f43a8025889dc4414a3ad66acf2
/CvGameCoreDLL/Boost-1.32.0/include/boost/spirit/fusion/algorithm/transform.hpp
e07c23e6f52c29e9706cc31cdbe6305d20e2634f
[ "MIT" ]
permissive
dguenms/Dawn-of-Civilization
b710195c4f46fe11d9229182c3b1e07b77f42637
a305e7846d085d6edf1e9c472e8dfceee1c07dd4
refs/heads/develop
2023-09-04T04:57:00.086384
2023-09-01T15:24:28
2023-09-01T15:24:28
45,362,597
116
121
MIT
2023-02-08T00:18:53
2015-11-01T23:52:28
C++
UTF-8
C++
false
false
1,584
hpp
/*============================================================================= Copyright (c) 2003 Joel de Guzman Use, modification and distribution is subject to 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) ==============================================================================*/ #if !defined(FUSION_ALGORITHM_TRANSFORM_HPP) #define FUSION_ALGORITHM_TRANSFORM_HPP #include <boost/spirit/fusion/sequence/transform_view.hpp> namespace boost { namespace fusion { namespace meta { template <typename Sequence, typename F> struct transform { typedef transform_view<Sequence, F> type; }; } namespace function { struct transform { template <typename Sequence, typename F> struct apply : meta::transform<Sequence, F> {}; template <typename Sequence, typename F> typename apply<Sequence const, F>::type operator()(Sequence const& seq, F const& f) const { return transform_view<Sequence const, F>(seq, f); } template <typename Sequence, typename F> typename apply<Sequence, F>::type operator()(Sequence& seq, F const& f) const { return transform_view<Sequence, F>(seq, f); } }; } function::transform const transform = function::transform(); }} #endif
[ "Leoreth@94cdc8ef-5f1a-49b8-8b82-819f55b6d80d" ]
Leoreth@94cdc8ef-5f1a-49b8-8b82-819f55b6d80d
de886520dfef96df64ccf4bd09270f0388c15c66
5cad8d9664c8316cce7bc57128ca4b378a93998a
/CI/rule/pclint/pclint_include/include_linux/c++/4.8.2/java/awt/image/RenderedImage.h
f47ca93cc0a131d7dc7057a80381ca57145d1e8f
[ "LicenseRef-scancode-unknown-license-reference", "GPL-2.0-only", "GPL-3.0-only", "curl", "Zlib", "LicenseRef-scancode-warranty-disclaimer", "OpenSSL", "GPL-1.0-or-later", "MIT", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-openssl", "LicenseRef-scancode-ssleay-windows", "BSD-3-Clause", "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-c-obs
0c60d61e16de5c0d8d3c0abc9446b5269e7462d4
fcd0bf67f209cc96cf73197e9c0df143b1d097c4
refs/heads/master
2023-09-05T11:42:28.709499
2023-08-05T08:52:56
2023-08-05T08:52:56
163,231,391
41
21
Apache-2.0
2023-06-28T07:18:06
2018-12-27T01:15:05
C
UTF-8
C++
false
false
1,731
h
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __java_awt_image_RenderedImage__ #define __java_awt_image_RenderedImage__ #pragma interface #include <java/lang/Object.h> #include <gcj/array.h> extern "Java" { namespace java { namespace awt { class Rectangle; namespace image { class ColorModel; class Raster; class RenderedImage; class SampleModel; class WritableRaster; } } } } class java::awt::image::RenderedImage : public ::java::lang::Object { public: virtual ::java::util::Vector * getSources() = 0; virtual ::java::lang::Object * getProperty(::java::lang::String *) = 0; virtual JArray< ::java::lang::String * > * getPropertyNames() = 0; virtual ::java::awt::image::ColorModel * getColorModel() = 0; virtual ::java::awt::image::SampleModel * getSampleModel() = 0; virtual jint getWidth() = 0; virtual jint getHeight() = 0; virtual jint getMinX() = 0; virtual jint getMinY() = 0; virtual jint getNumXTiles() = 0; virtual jint getNumYTiles() = 0; virtual jint getMinTileX() = 0; virtual jint getMinTileY() = 0; virtual jint getTileWidth() = 0; virtual jint getTileHeight() = 0; virtual jint getTileGridXOffset() = 0; virtual jint getTileGridYOffset() = 0; virtual ::java::awt::image::Raster * getTile(jint, jint) = 0; virtual ::java::awt::image::Raster * getData() = 0; virtual ::java::awt::image::Raster * getData(::java::awt::Rectangle *) = 0; virtual ::java::awt::image::WritableRaster * copyData(::java::awt::image::WritableRaster *) = 0; static ::java::lang::Class class$; } __attribute__ ((java_interface)); #endif // __java_awt_image_RenderedImage__
69fa7b837c4621fd172fb2317e3fd770b1028f10
141744c5cdcc7b6bca16d89ca4773e2ce10ceb43
/contest7/bai2.cpp
d98fe627a32f3b6177487e4852a3c27bd0e6a99e
[]
no_license
truong02bp/C-
d193b1f6f28d22c5c57f74d397b7785378eff102
82971ec24602ce84c652e04b1f7eb487a882aa1c
refs/heads/master
2023-03-07T16:25:59.091612
2020-08-08T07:28:21
2020-08-08T07:28:21
263,206,451
1
0
null
null
null
null
UTF-8
C++
false
false
656
cpp
#include<iostream> using namespace std; int stack[100005],top=0,n; string s; int main() { int t; cin >> t; while (t--) { cin >> s; if (s=="PUSH") { cin >> n; stack[top++]=n; } else if (s=="POP") { if (top>0) top--; } else if (s=="PRINT") { if (top>0) cout << stack[top-1]; else cout << "NONE"; cout << endl; } } return 0; }
1092217d05fbc9223a37eec2c04d6fe1b8f16838
e557a1625afae681c46a1c2959704b2f7b30ba35
/Simple.cpp
4d8bd216d47209b9cc93da21c4a2d35dadf0fb5f
[]
no_license
pythonicrane/ComptuerGraphics
fec10f805c1580986f52d0e22446d5d10344718b
d0566331d8a4960952db83ca66bb315d24d9e217
refs/heads/master
2021-09-10T08:07:54.639827
2018-03-22T16:06:11
2018-03-22T16:06:11
113,451,886
1
1
null
null
null
null
GB18030
C++
false
false
1,119
cpp
/** *计算机图形学第三版第二章概述例子 *@author ZhaoHeln 2017年11月30日 17:18:30 */ #include<gl/glut.h> void init(void) { glutSetColor(0, 0.0f, 0.0f, 0.0f); glutSetColor(1, 1.0f, 0.0f, 0.0f); glutSetColor(2, 0.0f, 1.0f, 0.0f); glutSetColor(3, 0.0f, 0.0f, 1.0f); glClearColor(1.0, 1.0, 1.0, 0.5);//窗口背景颜色 glMatrixMode(GL_PROJECTION);//矩阵模型,接下来做什么操作 gluOrtho2D(0.0, 200.0, 0.0, 150.0);//2D正交投影 } void lineSegment(void) { glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 0.0, 0.0); glBegin(GL_POINT); glVertex2i(50, 100); glVertex2i(75, 150); glVertex2i(100, 200); glEnd(); glFlush(); } int main(int argc, char** argv) { /*GLUT初始化*/ glutInit(&argc, argv);//第一个调用的函数, glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);//显示方式 glutInitWindowPosition(50, 100);//显示位置 glutInitWindowSize(400, 300);//窗口大小 glutCreateWindow("An Example OpenGL Program");//创建窗口并赋值窗口名字 init();//初始化 glutDisplayFunc(lineSegment);//调用显示函数 glutMainLoop();//循环调用 return 0; }
a001b92e4d99c7865a37224e36aaefb5c7fb3870
93ffc648c8d82c883143787d2b97619174bede7e
/base.h
9f205437cd9a9b70659a5b41a107eadcfdf7ceaa
[]
no_license
quenio/Gomoku
83654ffaad6ce7f704461fabd328aac298ba2389
eef34a1fada9ac3c8aebb6b423c98c7490bd5ce2
refs/heads/master
2021-03-27T19:06:15.115124
2015-09-15T12:33:59
2015-09-15T12:33:59
41,604,685
0
0
null
null
null
null
UTF-8
C++
false
false
151
h
// Copyright (c) 2015 Quenio Cesar Machado dos Santos. All rights reserved. #pragma once #include <vector> #include <iostream> using namespace std;
a4a58ae9473cfcd428612fbdbc056b08374e7609
00d915eb08da05557b149daa272ad30f77ca4d9a
/platforms/posix/src/px4_daemon/pipe_protocol.h
0f8012cdfd72c1206133edad2819848ce8dc1129
[ "BSD-3-Clause" ]
permissive
airmind/OpenMindPX
4d187a88810907c1338356bdfa451ebd048cff58
ee16c248270e1fc4e9ab7f71ec3699ee1df565c3
refs/heads/master
2021-01-15T10:19:53.627390
2018-11-06T07:29:18
2018-11-06T07:29:18
56,114,887
5
5
BSD-3-Clause
2018-09-20T02:04:13
2016-04-13T02:39:10
C++
UTF-8
C++
false
false
3,347
h
/**************************************************************************** * * Copyright (C) 2016 PX4 Development Team. 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 PX4 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 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. * ****************************************************************************/ /** * @file pipe_protocol.h * * @author Julian Oes <[email protected]> * @author Beat Küng <[email protected]> */ #pragma once #include <stdint.h> #include <string> namespace px4_daemon { static const unsigned RECV_PIPE_PATH_LEN = 64; // The packet size is no more than 512 bytes, because that is the minimum guaranteed size // for a pipe to avoid interleaving of messages when multiple clients write at the same time // (atomic writes). struct client_send_packet_s { struct message_header_s { uint64_t client_uuid; enum class e_msg_id : int { EXECUTE, KILL } msg_id; unsigned payload_length; } header; union { struct execute_msg_s { uint8_t is_atty; uint8_t cmd[512 - sizeof(message_header_s) - sizeof(uint8_t)]; } execute_msg; struct kill_msg_s { int cmd_id; } kill_msg; } payload; }; // We have per client receiver a pipe with the uuid in its file path. struct client_recv_packet_s { struct message_header_s { enum class e_msg_id : int { RETVAL, STDOUT } msg_id; unsigned payload_length; } header; union { struct retval_msg_s { int retval; } retval_msg; struct stdout_msg_s { uint8_t text[512 - sizeof(message_header_s)]; ///< null-terminated string (payload_length includes the null) } stdout_msg; } payload; }; unsigned get_client_send_packet_length(const client_send_packet_s *packet); unsigned get_client_recv_packet_length(const client_recv_packet_s *packet); int get_client_recv_pipe_path(const uint64_t uuid, char *path, const size_t path_len); std::string get_client_send_pipe_path(int instance_id); } // namespace px4_daemon
a74a06445bc4404d0be53f8864e56b0bd70040d2
66048faaa021871720642907f79aaddb9f08f41e
/tesseract/tesseract_urdf/test/tesseract_urdf_visual_unit.cpp
0b84e20da61967292a71c05309d6794371fa7b98
[]
no_license
loongsunchan/tesseract
14effec6f10a34da77ca9af32924abeda6097343
d6397ad1e8b2d532581e9c3cf03c6ec5ae2ecf1c
refs/heads/master
2020-08-01T12:53:44.202602
2019-09-25T04:31:44
2019-09-25T15:59:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,460
cpp
#include <tesseract_common/macros.h> TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include <gtest/gtest.h> #include <Eigen/Geometry> TESSERACT_COMMON_IGNORE_WARNINGS_POP #include <tesseract_urdf/visual.h> #include "tesseract_urdf_common_unit.h" TEST(TesseractURDFUnit, parse_visual) { { std::unordered_map<std::string, tesseract_scene_graph::Material::Ptr> empty_available_materials; std::string str = "<visual extra=\"0 0 0\">" " <origin xyz=\"1 2 3\" rpy=\"0 0 0\" />" " <geometry>" " <box size=\"1 2 3\" />" " </geometry>" " <material name=\"Cyan\">" " <color rgba=\"0 1.0 1.0 1.0\"/>" " </material>" "</visual>"; std::vector<tesseract_scene_graph::Visual::Ptr> elem; auto status = runTest<std::vector<tesseract_scene_graph::Visual::Ptr>>( elem, str, "visual", locateResource, empty_available_materials); EXPECT_TRUE(*status); EXPECT_TRUE(elem.size() == 1); EXPECT_TRUE(elem[0]->geometry != nullptr); EXPECT_TRUE(elem[0]->material != nullptr); EXPECT_FALSE(elem[0]->origin.isApprox(Eigen::Isometry3d::Identity(), 1e-8)); } { std::unordered_map<std::string, tesseract_scene_graph::Material::Ptr> empty_available_materials; std::string str = "<visual>" " <geometry>" " <box size=\"1 2 3\" />" " </geometry>" " <material name=\"Cyan\">" " <color rgba=\"0 1.0 1.0 1.0\"/>" " </material>" "</visual>"; std::vector<tesseract_scene_graph::Visual::Ptr> elem; auto status = runTest<std::vector<tesseract_scene_graph::Visual::Ptr>>( elem, str, "visual", locateResource, empty_available_materials); EXPECT_TRUE(*status); EXPECT_TRUE(elem.size() == 1); EXPECT_TRUE(elem[0]->geometry != nullptr); EXPECT_TRUE(elem[0]->material != nullptr); EXPECT_TRUE(elem[0]->origin.isApprox(Eigen::Isometry3d::Identity(), 1e-8)); } { std::unordered_map<std::string, tesseract_scene_graph::Material::Ptr> empty_available_materials; std::string str = "<visual>" " <geometry>" " <box size=\"1 2 3\" />" " </geometry>" "</visual>"; std::vector<tesseract_scene_graph::Visual::Ptr> elem; auto status = runTest<std::vector<tesseract_scene_graph::Visual::Ptr>>( elem, str, "visual", locateResource, empty_available_materials); EXPECT_TRUE(*status); EXPECT_TRUE(elem.size() == 1); EXPECT_TRUE(elem[0]->geometry != nullptr); EXPECT_TRUE(elem[0]->material != nullptr); EXPECT_TRUE(elem[0]->origin.isApprox(Eigen::Isometry3d::Identity(), 1e-8)); } { std::unordered_map<std::string, tesseract_scene_graph::Material::Ptr> empty_available_materials; std::string str = "<visual>" " <material name=\"Cyan\">" " <color rgba=\"0 1.0 1.0 1.0\"/>" " </material>" "</visual>"; std::vector<tesseract_scene_graph::Visual::Ptr> elem; auto status = runTest<std::vector<tesseract_scene_graph::Visual::Ptr>>( elem, str, "visual", locateResource, empty_available_materials); EXPECT_FALSE(*status); } }
cdd59003a839c832fe3b2a9f64d5a9a71669f6de
10301a09cf507631eab5961ba96c365b2e960067
/whsk2/GameScript.cpp
762814531a97a4b5316c25231eb42be55a8ab933
[]
no_license
mrjoe3012/whsk2
499d3c48b3bd55b4c5b7b845e1eeb1d14acb6fec
610b5e329deae66a11be7e8f9758cadd7cc66789
refs/heads/master
2023-01-19T21:33:44.922390
2020-11-23T23:21:41
2020-11-23T23:21:41
315,150,778
0
0
null
null
null
null
UTF-8
C++
false
false
23
cpp
#include "GameScript.h"
4ba05b8dd82ee9d617038d9c2871bc3801c71ad5
cb2b59cc92a68969fa485206284bdee24335c636
/example/39_ofxCvGUI/src/ofApp.h
43fe1cea97b3575c856f41e65d9a8f461b52ed73
[ "MIT" ]
permissive
hrhm2/idd_medilab15
f646c0932767f49e73953109b31ecb7f5bdce04d
e3d7d66600167e2a6679979e1bf8d22591e9e2de
refs/heads/master
2021-01-21T20:39:15.340213
2015-05-19T07:15:27
2015-05-19T07:15:27
34,304,645
0
0
null
2015-04-21T04:42:56
2015-04-21T04:42:56
null
UTF-8
C++
false
false
527
h
#pragma once #include "ofMain.h" #include "ofxGui.h" class ofApp : public ofBaseApp { public: void setup(); void update(); void draw(); void resetBackgroundPressed(); ofVideoGrabber cam; ofxCv::ContourFinder contourFinder; ofxCv::RunningBackground background; ofImage thresholded; ofxPanel gui; ofxFloatSlider bgThresh; // 背景差分の閾値 ofxFloatSlider contourThresh; // 輪郭抽出の閾値 ofxButton resetBackgroundButton; // 背景リセットボタン };
e2f560baa85acf57821f19860e2fcff09a0db166
25be2e874264b4b556dfc60042049a9f79ae9a0b
/cloud-disk/include/socketservice.h
d60a04e79ca927313196c1d1ff06481a1d8d2182
[]
no_license
yoyao/C
126fe95afa045edfce9bb2d1a0535ded6d3d1864
269d5c091748a1921fad04b687e1ceb5a37aa0c3
refs/heads/master
2022-02-19T21:31:42.811145
2022-02-17T11:26:08
2022-02-17T11:26:08
59,096,783
0
0
null
null
null
null
UTF-8
C++
false
false
1,070
h
#ifndef SOCKETSERVICE_H #define SOCKETSERVICE_H #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> #include <string.h> #include <errno.h> #include "include/socketclientex.h" class SocketService { public: SocketService(); ~SocketService(); int Bind(); int Listen(int n); int Accept(); int ReuseAddress(); void SetTcpMd5(bool isuse); std::string getAddr() const; void setAddr(const std::string &value); uint16_t getPort() const; void setPort(const uint16_t &value); int getFd() const; std::string getMd5Pwd() const; void setMd5Pwd(const std::string &value); private: int setMd5Signature(); int Init(); void SockaddrToString(const sockaddr_in *saddr, std::string &address, int &port); void StringToSockaddr(sockaddr_in *saddr, const std::string &address, int port); private: struct sockaddr_in sock_addr; struct tcp_md5sig md5sig; bool ismd5; std::string md5_pwd; int fd; std::string addr; uint16_t port; }; #endif // SOCKETSERVICE_H
f9d3773dbf8212dfaaed9b82dc807155a9d00fe7
ac3c13ba53ce6818c6ed23cc1e9275a7135c1a34
/document/Building Android Games with Cocos2d-x/B04193_08_01/Classes/GameOverScene.h
7d17f14a697e78f4534dfd2aa86a85bafca273a8
[]
no_license
vienbk91/SnackGame
24ca392bd13f91470c033ec2182fa754480d3576
595d5c65cd458d578f7cdf9594f86ff4abb910f2
refs/heads/master
2021-01-01T18:42:05.813274
2015-07-28T10:20:02
2015-07-28T10:20:02
39,768,128
0
1
null
null
null
null
UTF-8
C++
false
false
424
h
#ifndef __GameOver_SCENE_H__ #define __GameOver_SCENE_H__ #include "cocos2d.h" #include "HelloWorldScene.h" class GameOver : public cocos2d::Layer { public: static cocos2d::Scene* createScene(); virtual bool init(); void exitPause(cocos2d::Ref* pSender); CREATE_FUNC(GameOver); private: cocos2d::Sprite* sprLogo; cocos2d::Director *director; cocos2d::Size visibleSize; }; #endif // __Pause_SCENE_H__
159e9378a89daf34b0844cd91dd6bf4bd9f2984a
7c77b69d0bed2a726138f8ae4cf85a4ab29cc674
/Basic C++ Practice/average_score_of_three_classes.cpp
e10ecc6dbf9e58a9ea35d61f2c3c9075ed430ead
[]
no_license
yentim0519/Cpp-Practice
e91cb08876df1ca29a15b6c472766766de3df845
2489b2df825d4b20e8a3463f0bceb6b573a0dc3e
refs/heads/master
2020-12-20T16:44:20.902326
2020-04-25T16:02:01
2020-04-25T16:02:01
236,142,445
0
0
null
null
null
null
UTF-8
C++
false
false
742
cpp
#include <iostream> using namespace std; // main() 是程序开始执行的地方 int main() { int i, j, k; float a[3][4][3] = {}; for(i = 0; i<3; ++i) { float one_class_score = 0; for(j = 0; j<4; ++j) { float one_student_total_score = 0; for(k = 0; k<3; ++k) { cin >> a[i][j][k]; one_student_total_score = one_student_total_score + a[i][j][k]; } cout << "第" << i+1 << "班,第" << j+1 << "位學生的平均成績是:" << one_student_total_score/3 << endl; one_class_score = one_class_score + one_student_total_score/3; } cout << "第" << i+1 << "班的平均成績是:" << one_class_score/4 << endl; } return 0; }
afffccdc412d056d9f158cda3252a180e55aaa53
d2a0df7f7e68bb0fa97e1497526d20b9ecff5060
/src/ch2_collection_partitioning.cxx
ee6296da22d0ec50675da3c32c33e64ee3b4501a
[ "MIT" ]
permissive
miquelramirez/cpp_functional_programming
022fb7015713356508d44a2eb52cfaafacd42c19
5a403c1a562a56cc077f7734abe39317c057c90d
refs/heads/master
2020-06-22T07:30:58.998044
2019-07-23T03:22:59
2019-07-23T03:22:59
197,671,880
0
0
null
null
null
null
UTF-8
C++
false
false
2,407
cxx
// // Created by bowman on 19/07/19. // #include <iostream> #include <algorithm> #include <iterator> #include <vector> #include <string> enum Gender{ MALE, FEMALE, OTHER }; class Person { private: //attributes std::string _name; Gender _gender; bool _selected; public: Person(std::string name, Gender g) : _name(name), _gender(g), _selected(false) { } bool is_female() const { return _gender == Gender::FEMALE; } std::string name() const { return _name; } bool selected() const { return _selected; } void select() { _selected = true; } void deselect() { _selected = false; } }; void init_population(std::vector<Person>& pop_vec) { pop_vec.emplace_back(Person("Peter", MALE)); pop_vec.emplace_back(Person("Martha", FEMALE)); pop_vec.emplace_back(Person("Jane", FEMALE)); pop_vec.emplace_back(Person("David", MALE)); pop_vec.emplace_back(Person("Rose", FEMALE)); pop_vec.emplace_back(Person("Tom", MALE)); } int main(int argc, char** argv) { std::vector<Person> bunch; init_population(bunch); std::cout << "std::partition():" << std::endl; std::partition(bunch.begin(), bunch.end(), [](const Person& p){ return p.is_female();} ); for(const Person& p : bunch){ std::cout << p.name() << std::endl; } bunch.clear(); init_population(bunch); std::cout << "std::stable_partition():" << std::endl; std::stable_partition(bunch.begin(), bunch.end(), [](const Person& p){ return p.is_female();} ); for(const Person& p : bunch){ std::cout << p.name() << std::endl; } bunch.clear(); init_population(bunch); bunch[3].select(); std::cout << "Moving selected items to specific point" << std::endl; for(const Person& p : bunch){ std::cout << p.name() << std::endl; } std::cout << bunch[3].name() << " selected, move to first position" << std::endl; auto is_selected = [](const Person& p) { return p.selected();}; auto is_not_selected = [](const Person& p) { return !p.selected(); }; auto destination = bunch.begin(); std::stable_partition(bunch.begin(), destination, is_not_selected); std::stable_partition(destination, bunch.end(), is_selected); for(const Person& p : bunch){ std::cout << p.name() << std::endl; } return 0; }
b7dcf77808a8c13099f4b66714b403a184ed9c89
7569574767dd194a830e60e215ceadffa115b855
/include/MocotoPrimaryGeneratorAction.hh
5ff7efcd1387b9ed1bbf18d30f7a207f15d0e744
[]
no_license
zhwren/Mocoto
06f29c1fc74629f6411ad1191db780bfeaddb112
33394cbac73907266149f1c677e3037baf31378d
refs/heads/master
2021-01-17T13:30:30.825257
2016-07-04T09:04:08
2016-07-04T09:04:08
40,347,280
0
0
null
null
null
null
UTF-8
C++
false
false
3,323
hh
/*********************************************************** * _ooOoo_ * * o8888888o * * 88" . "88 * * (| -_- |) * * O\ = /O * * ____/`---'\____ * * . ' \\| |// `. * * / \\||| : |||// \ * * / _||||| -:- |||||- \ * * | | \\\ - /// | | * * | \_| ''\---/'' | | * * \ .-\__ `-` ___/-. / * * ___`. .' /--.--\ `. . __ * * ."" '< `.____<|>_/___.' >'"". * * | | : `- \`.;` _ /`;.`/ - ` : | | * * \ \ `-. \_ __\ /__ _/ .-` / / * * ======`-.____`-.___\_____/___.-`____.-'====== * * `=---=' * * * * ............................................. * * Buddha bless me, No bug forever * * * ************************************************************ * Author : ZhuHaiWen * * Email : [email protected]/[email protected] * * Last modified: 2015-11-06 13:50:1446789037 * Filename : MocotoPrimaryGeneratorAction.hh * Phone Number : 18625272373 * * Discription : * ***********************************************************/ #ifndef MocotoPrimaryGeneratorAction_h #define MocotoPrimaryGeneratorAction_h 1 #include "G4VUserPrimaryGeneratorAction.hh" #include "G4ThreeVector.hh" #include "globals.hh" #include "TString.h" class TFile; class G4Event; class G4ParticleGun; class G4ParticleTable; class G4ParticleDefinition; class MocotoPrimaryGeneratorMessenger; class MocotoPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction { public: MocotoPrimaryGeneratorAction(); ~MocotoPrimaryGeneratorAction(); virtual void GeneratePrimaries(G4Event*); private: TFile* file; G4int nofParticles; G4String particleName; G4double particleEnergy; G4ThreeVector position; G4ParticleGun* fParticleGun; G4ParticleDefinition* particle; G4ParticleTable* particleTable; G4ThreeVector momentumDirection; MocotoPrimaryGeneratorMessenger* messenger; G4ThreeVector generateDelteAngle; public: void SetGeneratorEnergy(G4double i) { particleEnergy = i; } void SetParticle(TString i) { particleName = i; } void SetPosition(G4ThreeVector pos) { position = pos; } void SetDeltaThetaPhi(G4ThreeVector delta) { generateDelteAngle = delta; } void SetMomentumDirection(G4ThreeVector direction) { momentumDirection = direction; } private: G4ThreeVector ParticleMomentum(); void GetSpectrumFromFile(); }; #endif
751237354bbcb78e202350fc86f10baec0a3bb45
9b4cbe623d7603a40eea66ce077bfb550afa887a
/src/entity/position.h
0b5ba109baeee80c13047d40c34f07662bab0352
[]
no_license
LuiCat/DanmakuLyrica
26a73a6bc9d0af2114d33a0ffa2e3c61b52e1295
8841222a0549cfcbfddbfb43085fd429c23ad8b9
refs/heads/master
2020-12-24T16:24:17.688502
2017-11-26T15:59:26
2017-11-26T15:59:26
22,305,856
2
0
null
null
null
null
UTF-8
C++
false
false
379
h
#ifndef POSITION_H #define POSITION_H class Position { protected: double x, y; public: Position(); Position(double _x, double _y); double getX() const; double getY() const; void setX(double value); void setY(double value); void setPosition(double _x, double _y); double distanceTo(const Position& another) const; }; #endif // POSITION_H
b7fcfd00428da83f30f49bec93ad369738453f9f
bb7645bab64acc5bc93429a6cdf43e1638237980
/Official Windows Platform Sample/Windows 8.1 desktop samples/[C++]-Windows 8.1 desktop samples/Dynamic DPI sample/C++/SampleEngine.cpp
15fd54930164120872af46d8c5d4048bf3595295
[ "MIT" ]
permissive
Violet26/msdn-code-gallery-microsoft
3b1d9cfb494dc06b0bd3d509b6b4762eae2e2312
df0f5129fa839a6de8f0f7f7397a8b290c60ffbb
refs/heads/master
2020-12-02T02:00:48.716941
2020-01-05T22:39:02
2020-01-05T22:39:02
230,851,047
1
0
MIT
2019-12-30T05:06:00
2019-12-30T05:05:59
null
UTF-8
C++
false
false
4,905
cpp
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A //// PARTICULAR PURPOSE. //// //// Copyright (c) Microsoft Corporation. All rights reserved #include "pch.h" #include "SampleEngine.h" using namespace std; using namespace Microsoft::WRL; using namespace D2D1; CSampleEngine::CSampleEngine() { m_pointerOver = nullptr; } CSampleEngine::~CSampleEngine() { ReleaseElementResources(); m_elements.clear(); m_deviceResources.reset(); } void CSampleEngine::ReleaseElementResources() { for_each(begin(m_elements), end(m_elements), [&](const SPSampleElementBase& item) { item->ReleaseDeviceResources(); item->ReleaseDeviceIndependentResources(); }); } void CSampleEngine::Init() { } void CSampleEngine::Update() { } template <class T> std::shared_ptr<T> CSampleEngine::CreateElement() { SPSceneElement newElement(new T(this)); return newElement; } void CSampleEngine::AddElement(SPSampleElementBase element) { m_elementlock.Enter(); m_elements.push_back(element); m_elementlock.Exit(); } void CSampleEngine::Draw() { D2D1_RECT_F rect; auto factory = m_deviceResources->GetD2DFactory(); m_elementlock.Enter(); for_each(begin(m_elements),end(m_elements), [&](const SPSampleElementBase& item) { item->Tick(); item->DoDraw(); rect.top = item->Top(); rect.left = item->Left(); rect.right = item->Left() + item->GetWidth(); rect.bottom = item->Top() + item->GetHeight(); if (nullptr == item->m_bounds) { DX::ThrowIfFailed(factory->CreateRectangleGeometry(rect, item->m_bounds.ReleaseAndGetAddressOf())); } }); m_elementlock.Exit(); } CSampleElementBase* CSampleEngine::FindElement(float x, float y) { CSampleElementBase* found = nullptr; m_elementlock.Enter(); for (std::vector<SPSampleElementBase>::iterator it = m_elements.begin(); it != m_elements.end(); ++it) { auto item = it->get(); BOOL contains; DX::ThrowIfFailed(item->m_bounds->FillContainsPoint(Point2F(x, y), Matrix3x2F::Identity(), &contains)); if (contains) { found = item; break; } } m_elementlock.Exit(); return found; } float CSampleEngine::GetPointerX() { return m_pointerCurrentX; } float CSampleEngine::GetPointerY() { return m_pointerCurrentY; } void CSampleEngine::PointerDown(float x, float y) { CSampleElementBase* found = FindElement(x,y); if (found != nullptr) { found->OnPointerDown(x, y); } } void CSampleEngine::PointerUpdate(float x, float y) { m_pointerCurrentX = x; m_pointerCurrentY = y; CSampleElementBase* found = FindElement(x, y); if ((m_pointerOver != nullptr && m_pointerOver != found)) { m_pointerOver->OnPointerLeave(); m_pointerOver = nullptr; } if (found != nullptr) { if (m_pointerOver == nullptr) { m_pointerOver = found; found->OnPointerEnter(); } found->OnPointerUpdate(x, y); } } void CSampleEngine::PointerUp(float x, float y) { CSampleElementBase* found = FindElement(x, y); if (found != nullptr) { found->OnPointerUp(x, y); } } void CSampleEngine::CreateDeviceIndependentResources(const std::shared_ptr<DeviceResources>& deviceResources) { m_deviceResources = deviceResources; m_elementlock.Enter(); for (std::vector<SPSampleElementBase>::iterator it = m_elements.begin(); it != m_elements.end(); ++it) { auto item = it->get(); item->CreateDeviceIndependentResources(deviceResources); } m_elementlock.Exit(); } void CSampleEngine::ReleaseDeviceIndependentResources() { if (m_elements.size() > 0) { m_elementlock.Enter(); for (std::vector<SPSampleElementBase>::iterator it = m_elements.begin(); it != m_elements.end(); ++it) { auto item = it->get(); item->ReleaseDeviceIndependentResources(); } m_elementlock.Exit(); } } void CSampleEngine::CreateDeviceResources() { m_elementlock.Enter(); for (std::vector<SPSampleElementBase>::iterator it = m_elements.begin(); it != m_elements.end(); ++it) { auto item = it->get(); item->CreateDeviceResources(); } m_elementlock.Exit(); } void CSampleEngine::ReleaseDeviceResources() { if (m_elements.size() > 0) { m_elementlock.Enter(); for (std::vector<SPSampleElementBase>::iterator it = m_elements.begin(); it != m_elements.end(); ++it) { auto item = it->get(); item->ReleaseDeviceResources(); } m_elementlock.Exit(); } }
af24b6ba59355d423720538b0da1e82eafdbfd9b
8e2cc8f17fa329a2b965253753aeedf1e47767e1
/Data_Structures/circles.cc
7ec3dc9dcbe13753a588fa81f389553dd3b54c6b
[]
no_license
Gonsa02/Jutge_PRO1
5c982cf3bd98c545037920bfe80a101123d5e3f3
b79bf6ca269c03c38a4388e8a672e39fa0aec18d
refs/heads/main
2023-02-14T15:16:44.111795
2021-01-14T10:18:23
2021-01-14T10:18:23
328,963,610
0
0
null
null
null
null
UTF-8
C++
false
false
649
cc
#include <iostream> #include <cmath> #include <vector> using namespace std; struct Point { double x, y; }; double dist(const Point& a, const Point& b) { double dist_x = a.x - b.x, dist_y = a.y - b.y; return sqrt(pow(dist_x,2)+pow(dist_y,2)); } void move(Point& p1, const Point& p2) { p1.x += p2.x; p1.y += p2.y; } struct Circle { Point center; double radius; }; void scale(Circle& c, double sca) { c.radius *= sca; } void move(Circle& c, const Point& p) { move(c.center, p); } bool is_inside(const Point& p, const Circle& c){ int distance = dist(c.center, p); if (distance > c.radius) return false; else return true; }
d5f79668257822b695c3d8a744748a7c090e5207
92781f5ad9ce00a842c50399ecc3c797e8352193
/geo 3D (异面直线的距离).cpp
e1b5661c3422accb7a18e2b56f82eafe6e29e809
[]
no_license
meteorcloudy/ACM_Template
207b3016d7ccec19743b77cfa56ea9cfc500fd67
3dc3a09e10681eb7e29d0e98a5ca1589afe26519
refs/heads/master
2020-06-01T13:31:06.588372
2015-12-02T08:23:39
2015-12-02T08:23:39
9,473,861
0
0
null
null
null
null
UTF-8
C++
false
false
2,627
cpp
#include <iostream> #include <stdio.h> #include <math.h> #include <string.h> #include <algorithm> #include <stdlib.h> #include <string> #include <queue> #include <vector> #include <set> #define maxn #define eps 1e-8 #define oo 1000000000 #define clearAll(a) memset(a,0,sizeof(a)) #define sq(a) ((a)*(a)) using namespace std; typedef long long ll; struct Vect { double x,y,z; Vect() { x=y=z=0.0f; } Vect(double _x,double _y,double _z) : x(_x),y(_y),z(_z) {} double operator * (Vect v) { return x*v.x+y*v.y+z*v.z; } Vect operator & (Vect v) { return Vect(y*v.z-v.y*z,-(x*v.z-v.x*z),x*v.y-v.x*y); } Vect operator + (Vect v) { return Vect(x+v.x,y+v.y,z+v.z); } Vect operator * (double l) { Vect res(x*l,y*l,z*l); return res; } Vect operator - (Vect v) { return Vect(x-v.x,y-v.y,z-v.z); } double length() { return sqrt(sq(x)+sq(y)+sq(z)); } }; typedef Vect Point; struct Line { Point a,b; Line() {} Line(Point &x,Point &y) { a=x; b=y; } Point operator & (Line &s) { Vect x=b-a,y=s.b-s.a,z=s.a-a; double t=(y&z).length()/(y&x).length(); return a+x*t; } }; struct Plane { Point a,b,c; Plane() {} Plane(Point _a,Point _b,Point _c) { a=_a; b=_b; c=_c; } Vect pverti() { return (a-b)&(b-c); } }; Point find(Line l,Plane s) { Point tmp=(s.a-s.b)&(s.b-s.c); double t1=(tmp.x*(s.a.x-l.a.x)+tmp.y*(s.a.y-l.a.y)+tmp.z*(s.a.z-l.a.z)); double t2=(tmp.x*(l.b.x-l.a.x)); t2+=(tmp.y*(l.b.y-l.a.y)); t2+=(tmp.z*(l.b.z-l.a.z)); double t=t1/t2; tmp.x=l.a.x+(l.b.x-l.a.x)*t; tmp.y=l.a.y+(l.b.y-l.a.y)*t; tmp.z=l.a.z+(l.b.z-l.a.z)*t; return tmp; } Point p[5][2]; Vect v[5]; Point p1,p2; int main() { freopen("C:\\Users\\py\\Desktop\\input.txt","r",stdin); //freopen("C:\\Users\\py\\Desktop\\output.txt","w",stdout); int tt; scanf("%d",&tt); while (tt--) { int n; for (int i=1;i<=2;i++) for (int j=0;j<2;j++) scanf("%lf%lf%lf",&p[i][j].x,&p[i][j].y,&p[i][j].z); for (int i=1;i<=2;i++) v[i]=p[i][1]-p[i][0]; double ans = oo; Vect dir = v[1]&v[2]; Vect w = p[1][0]-p[2][0]; ans = fabs(dir*w/dir.length()); Line l1(p[1][0],p[1][1]); Line l2(p[2][0],p[2][1]); p2 = find(l2,Plane(p[1][0],p[1][1],p[1][1]+dir)); p1 = find(l1,Plane(p[2][0],p[2][1],p[2][1]+dir)); printf("%.6f\n",ans); printf("%.6f %.6f %.6f ",p1.x,p1.y,p1.z); printf("%.6f %.6f %.6f\n",p2.x,p2.y,p2.z); } return 0; }
619a553a438079efd35f61b2d5dc5aeb660d42c1
915f19cac1161b440e1fc8ae076c9146ea5baa5d
/unpacker.cpp
dc706270e2b522b57571243ba5a51a257cc09d80
[]
no_license
fengjixuchui/ANBU
63199f6a52496e6c5f22fef9e118892937c55a7e
ef7b36819e9e8764bdda2ca4732dafbd46449268
refs/heads/master
2020-05-17T17:24:38.059913
2019-04-26T10:30:22
2019-04-26T10:30:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,428
cpp
/* * Compile: make PIN_ROOT="<path_to_pin>" */ #include "unpacker.h" FILE* logfile; // log file handler pe_file* pe_file_entropy; /* * KNOB class to create arguments with PIN * on this case, we will create an argument * string for the user if wants to save * logs in a file. */ KNOB<string> KnobLogFile( KNOB_MODE_WRITEONCE, "pintool", "l", // command accepted (-l) "unpacker.log", // value of the command, log file name "log file" ); /* * argument to activate the Debug mode */ KNOB<string> KnobDebugFile( KNOB_MODE_WRITEONCE, "pintool", "d", // command accepted (-d) "false", "start debug mode" ); /* * PIN Exception handler function */ EXCEPT_HANDLING_RESULT ExceptionHandler(THREADID tid, EXCEPTION_INFO *pExceptInfo, PHYSICAL_CONTEXT *pPhysCtxt, VOID *v) { EXCEPTION_CODE c = PIN_GetExceptionCode(pExceptInfo); EXCEPTION_CLASS cl = PIN_GetExceptionClass(c); fprintf(stderr, "Exception class: 0x%x\n", (unsigned int)cl); fprintf(logfile, "Exception class: 0x%x\n", (unsigned int)cl); fprintf(stderr,"Exception string: %s\n", PIN_ExceptionToString(pExceptInfo).c_str()); fprintf(logfile, "Exception string: %s\n", PIN_ExceptionToString(pExceptInfo).c_str()); return EHR_UNHANDLED; } int main(int argc, char *argv[]) { fprintf(stderr, "+--<<< ANBU by F9 >>>>--+\n"); /* * As we will use symbols... */ PIN_InitSymbols(); /* * Function to initialize the Pintool * always called before almost any other PIN * function (only PIN_InitSymbols can be before) */ if (PIN_Init(argc, argv)) { usage(); return 1; } if (strcmp(KnobDebugFile.Value().c_str(), "true") == 0) { DEBUG_MODE debug; debug._type = DEBUG_CONNECTION_TYPE_TCP_SERVER; debug._options = DEBUG_MODE_OPTION_STOP_AT_ENTRY; PIN_SetDebugMode(&debug); } // open log file to append fprintf(stderr, "[INFO] File name: %s\n", KnobLogFile.Value().c_str()); logfile = fopen(KnobLogFile.Value().c_str(), "w"); if (!logfile) { fprintf(stderr, "[ERROR] failed to open '%s'\n", KnobLogFile.Value().c_str()); return 1; } PIN_AddInternalExceptionHandler(ExceptionHandler, NULL); fprintf(logfile, "+--<<< ANBU by F9 >>>>--+\n"); fprintf(stderr, "------ unpacking binary ------\n"); fprintf(logfile, "------ unpacking binary ------\n"); enum_syscalls(); init_common_syscalls(); syscall_t sc[256] = { 0 }; /* * Add instrumentation function for Syscalls entry and exit */ PIN_AddSyscallEntryFunction(&syscall_entry, &sc); PIN_AddSyscallExitFunction(&syscall_exit, &sc); /* * Add instrumentation function at Instruction tracer level * in opposite to TRACE instrumentation, this goes to an * instruction granularity. */ INS_AddInstrumentFunction(instrument_mem_cflow, NULL); /* * Add instrumentation for IMG loading. */ IMG_AddInstrumentFunction(get_addresses_from_images, NULL); /* * RUN the program and never return */ PIN_StartProgram(); return 1; } void usage() { fprintf(stderr, "[ERROR] Parameters error, please check next help line(s)\n"); fprintf(stderr, "pin -t <pintool_path> [-l <logname>] -- application\n"); fprintf(stderr, "Commands: \n"); fprintf(stderr, "\t+ -t <pintool_path> (MANDATORY): necessary flag for PIN to specify a pintool\n"); fprintf(stderr, "\t+ -l <logname> (OPTIONAL): specify name for a log file\n"); fprintf(stderr, "\t+ -d true (OPTIONAL): start debug mode\n"); fprintf(stderr, "\n"); }
4719420642b1b36649263b385ceb4d569e9b845c
424edae758b07b7d7465869780cd59322a3e8366
/src/sketch_sep24a.ino
9a6f5e7ffc1a0220158c6808642f0fae78019075
[]
no_license
sirchallen/Gizmo_project
8414115bf317544861f3ba64584ed767f0f31e69
38a79a70d4336c43df3095063be3962e13ceeab9
refs/heads/master
2020-03-29T10:21:48.487343
2018-09-26T02:24:46
2018-09-26T02:24:46
149,801,363
0
0
null
null
null
null
UTF-8
C++
false
false
1,965
ino
#include <Arduino.h> extern HardwareSerial Serial; #define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on ping sensor. #define ECHO_PIN 11 // Arduino pin tied to echo pin on ping sensor. #define MAX_DISTANCE 400 // Maximum distance (in cm) to ping. void setup() { Serial.begin(115200); pinMode(TRIGGER_PIN, OUTPUT); pinMode(ECHO_PIN, INPUT); } void loop() { unsigned long pingTime; unsigned long maxPingTime = MAX_DISTANCE * 58; digitalWrite(TRIGGER_PIN, LOW); delayMicroseconds(4); // Wait for pin to go low. digitalWrite(TRIGGER_PIN, HIGH); // Set trigger pin high, this tells the sensor to send out a ping. delayMicroseconds(10); // Wait long enough for the sensor to realize the trigger pin is high. Sensor specs say to wait 10uS. digitalWrite(TRIGGER_PIN, LOW); pingTime = pulseIn(ECHO_PIN, HIGH, maxPingTime); Serial.println(pingTime/148); delay(50); } //boolean ping_trigger() { // digitalWrite(TRIGGER_PIN, LOW); // Set the trigger pin low, should already be low, but this will make sure it is. // delayMicroseconds(4); // Wait for pin to go low. // digitalWrite(TRIGGER_PIN, HIGH); // Set trigger pin high, this tells the sensor to send out a ping. // delayMicroseconds(10); // Wait long enough for the sensor to realize the trigger pin is high. Sensor specs say to wait 10uS. // digitalWrite(TRIGGER_PIN, LOW); // Set trigger pin back to low. // // if (digitalRead(ECHO_PIN)) return false; // Previous ping hasn't finished, abort. // _max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!) // while (!digitalRead(ECHO_PIN)) // Wait for ping to start. // if (micros() > _max_time) return false; // Took too long to start, abort. //}
259b30d9d04aa893972e28a66fe773a788fa98c1
28f74849d3416f5588e944b7fdf12200027acb9e
/w06_h02_interstellar/src/Mover.cpp
e598549309cd2222edaf5e1d66d90fbaa4b94481
[]
no_license
twotabsofacid/scans421_dtOF_2018
288b1f7e904773d23a489b637def2b7623b3b6cd
c7594d6d39509d434f8a7289a43c8131ec7c12dc
refs/heads/master
2021-09-26T14:47:18.032682
2018-10-31T01:04:13
2018-10-31T01:04:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,697
cpp
// // Mover.cpp // // Created by Tyler Henry on 10/4/18. // #include "Mover.hpp" Mover::Mover() { pos = glm::vec2( ofRandom(ofGetWidth()), ofRandom(ofGetHeight()) ); mass = ofRandom(1,5); vel = glm::vec2(0,0); acc = glm::vec2(0,0); } Mover::Mover(glm::vec2 _pos, float _mass){ pos = _pos; mass = _mass; vel = glm::vec2(0,0); acc = glm::vec2(0,0); } void Mover::applyForce(glm::vec2 force) { // force = mass * acceleration // acc = force / mass acc += force/mass; } void Mover::applyDampingForce(float strength) { // slows the Mover float length = glm::length(vel); // speed / "magnitude" of current velocity if (length != 0.0){ // avoid illegal division by 0 glm::vec2 direction = vel / length; // normalize velocity to make speed 1 applyForce( -direction * strength ); // scale speed and apply force away from velocity } } glm::vec2 Mover::getForce(glm::vec2 _pos, float _mass) { // calculate a force of attraction on mover glm::vec2 dir = pos - _pos; // the target is the attractor float distance = glm::length(dir); glm::vec2 force = glm::vec2(0,0); // default to 0 force if (distance > 0) { // avoid division by 0 // we'll model gravity: // from http://natureofcode.com/book/chapter-2-forces/#chapter02_section9 // // gravity magnitude = (G * mass1 * mass2) / (distance * distance) // // where G = gravitational constant // we'll "clamp" the distance between 5 and 25 // to prevent super-massive or super-micro gravity forces // ... this is a hack to keep things in equilibrium! float distanceMod = ofClamp(distance, 5., 25.); float strength = (G * mass * _mass) / (distanceMod * distanceMod); glm::vec2 dirNorm = dir / distance; // normalized direction force = dirNorm * strength; } return force; } void Mover::update() { vel += acc; pos += vel; acc *= 0; } void Mover::draw() { ofPushStyle(); // interpolate between colors! ofColor cSlow = ofColor::fromHex(0xC1D5FF); // hex format: 0xRRGGBB ofColor cFast = ofColor::fromHex(0xFF4831); float percent = ofMap(glm::length(vel), 0., 7., 0., 1., true); // mix based on speed ofColor color = cSlow.lerp(cFast, percent); // "lerp" == interpolate ofSetColor(color); ofDrawCircle(pos, mass * 2.0); // base radius on mass ofPopStyle(); }
9bc61a07f76cf61339f0308527f3457f32644692
099f2181439ba42a5fbeb774a182faf3db9bad8c
/problems/019-remove-nth-node-from-end-of-list.cpp
7baa01ba8992173d52e3618c2abc66ac5129d520
[]
no_license
luchenqun/leet-code
76a9193e315975b094225d15f0281d0d462c2ee7
38b3f660e5173ad175b8451a730bf4ee3f03a66b
refs/heads/master
2021-07-09T09:49:36.068938
2019-01-15T07:15:22
2019-01-15T07:15:22
102,130,497
1
0
null
null
null
null
UTF-8
C++
false
false
1,054
cpp
/* * [19] Remove Nth Node From End of List * * https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/description/ * https://leetcode.com/problems/remove-nth-node-from-end-of-list/discuss/ * * algorithms * Medium (28.07%) * Total Accepted: 3.7K * Total Submissions: 13.1K * Testcase Example: '[1,2,3,4,5]\n2' * * 给定一个链表,删除链表的倒数第 n 个节点,并且返回链表的头结点。 * 示例: * 给定一个链表: 1->2->3->4->5, 和 n = 2. * 当删除了倒数第二个节点后,链表变为 1->2->3->5. * 说明: * 给定的 n 保证是有效的。 * 进阶: * 你能尝试使用一趟扫描实现吗? */ #include <iostream> #include <string> using namespace std; /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { } }; int main() { Solution s; return 0; }
0811016ec262b0fbe1a5051db459c191d8f947f4
0c0b9fb6df7340df22c3fb19a650d9d29ccee98b
/Actions/Undo.cpp
f3d95fb3e73c63f7bcc03886ba3a600168a7d5d4
[]
no_license
ahmedasad236/Logic_Simulator
ae6221807b2f2f7a94383536b87c9d103e64d46f
1677928c8d3e065df5cdfbb5cc1765767e90383c
refs/heads/master
2023-07-14T11:04:12.153267
2021-08-02T03:03:39
2021-08-02T03:03:39
391,799,239
2
1
null
null
null
null
UTF-8
C++
false
false
1,645
cpp
#include "Undo.h" #include "..\AllActions.h" using namespace std; undo::undo(ApplicationManager* pApp) :Action(pApp) { pAct = NULL; } void undo::ReadActionParameters() { } void undo::Execute() { if (pManager->getActionListSize() >= 1) { ActionType LA = pManager->getTheLastActionDone(); switch (LA) { case ADD_Buff: pAct = new AddBUFFER(pManager); break; case ADD_INV: pAct = new AddNOTgate(pManager); break; case ADD_AND_GATE_2: pAct = new AddANDgate2(pManager); break; case ADD_OR_GATE_2: pAct = new AddORgate2(pManager); break; case ADD_NAND_GATE_2: pAct = new AddNANDgate2(pManager); break; case ADD_NOR_GATE_2: pAct = new AddNORgate2(pManager); break; case ADD_XNOR_GATE_2: pAct = new AddXNORgate2(pManager); break; case ADD_XOR_GATE_2: pAct = new AddXORgate2(pManager); break; case ADD_AND_GATE_3: pAct = new AddANDgate3(pManager); break; case ADD_NOR_GATE_3: pAct = new AddNORgate3(pManager); break; case ADD_XOR_GATE_3: pAct = new AddXORgate3(pManager); break; case ADD_Switch: pAct = new AddSWITCH(pManager); break; case ADD_LED: pAct = new AddLED(pManager); break; case ADD_CONNECTION: pAct = new AddConnection(pManager); break; case ADD_Label: pAct = new Label(pManager); break; case EDIT_CONNECTION: pAct = new Edit(pManager); break; case PASTE: pAct = new Paste(pManager); break; case DEL: pAct = new Delete(pManager); break; } if (pAct != NULL) { pAct->Undo(); delete pAct; pAct = NULL; } } } void undo::Undo() { } void undo::Redo() { } undo::~undo() { }
23f50945831472505e75198068597b09426a3b4b
6cd4545abd639726dcc460fa25954c928065d274
/combine.ino
ad3182e4ac8d18c77e0cc3557a2fcf9be0831913
[]
no_license
bboken/Smart-flower-pot
843ee035658d1adb499973d169bdf8daa111e2f6
44c67d96d93acb4028ae72838bfb3727c9407eb0
refs/heads/main
2023-08-19T12:46:56.757970
2021-09-30T06:57:43
2021-09-30T06:57:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,772
ino
// 1. Set the camera to JEPG output mode. // 2. if server.on("/capture", HTTP_GET, serverCapture),it can take photo and send to the Web. // 3.if server.on("/stream", HTTP_GET, serverStream),it can take photo continuously as video //streaming and send to the Web. //led bar #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif const int Led = D10; Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, Led, NEO_GRB + NEO_KHZ800); int ledType = 0; bool isAuto = false; const int t[] = {0,170,250}; //gy30 //#include <Wire.h> //BH1750 IIC Mode #include <math.h> const int BH1750address = 0x23; //setting i2c address byte buff[2]; uint16_t val=0; char str[80]; String temp; int Llevel=0; //water check #define Grove_Water_Sensor A0 // Attach Water sensor to Arduino Digital Pin 8 bool haveWater = false; char *WaterStr[] = {"Water level: Empty","Water level: Low","Water level: Medium","Water level: High"}; int WaterState = 0; int waterVal = 0; const int ledPin = D2; //cam #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <ESP8266WebServer.h> #include <ESP8266mDNS.h> #include <Wire.h> #include <ArduCAM.h> #include <SPI.h> #include "memorysaver.h" #if !(defined ESP8266 ) #error Please select the ArduCAM ESP8266 UNO board in the Tools/Board #endif //This demo can only work on OV5642_MINI_5MP or OV5642_MINI_5MP_BIT_ROTATION_FIXED //or OV5640_MINI_5MP_PLUS or ARDUCAM_SHIELD_V2 platform. #if !(defined (OV5642_MINI_5MP) || defined (OV5642_MINI_5MP_BIT_ROTATION_FIXED) || defined (OV5642_MINI_5MP_PLUS) ||(defined (ARDUCAM_SHIELD_V2) && defined (OV5642_CAM))) #error Please select the hardware platform and camera module in the ../libraries/ArduCAM/memorysaver.h file #endif // set GPIO16 as the slave select : const int CS = D9; //you can change the value of wifiType to select Station or AP mode. //Default is AP mode. int wifiType = 0; // 0:Station 1:AP //AP mode configuration //Default is arducam_esp8266.If you want,you can change the AP_aaid to your favorite name const char *AP_ssid = "arducam_esp8266"; //Default is no password.If you want to set password,put your password here const char *AP_password = ""; //Station mode you should put your ssid and password const char* ssid = "wingwing-2.4G"; // Put your SSID here const char* password = "12341234"; // Put your PASSWORD here ESP8266WebServer server(80); ArduCAM myCAM(OV5642, CS); void start_capture(){ myCAM.clear_fifo_flag(); delay(0); myCAM.start_capture(); } void camCapture(ArduCAM myCAM){ WiFiClient client = server.client(); yield(); size_t len = myCAM.read_fifo_length(); if (len >= MAX_FIFO_SIZE){ Serial.println("Over size."); return; }else if (len == 0 ){ Serial.println("Size is 0."); return; } myCAM.CS_LOW(); myCAM.set_fifo_burst(); #if !(defined (OV5642_MINI_5MP_PLUS) ||(defined (ARDUCAM_SHIELD_V2) && defined (OV5642_CAM))) SPI.transfer(0xFF); #endif if (!client.connected()) return; String response = "HTTP/1.1 200 OK\r\n"; response += "Content-Type: image/jpeg\r\n"; response += "Content-Length: " + String(len) + "\r\n\r\n"; server.sendContent(response); static const size_t bufferSize = 4096; static uint8_t buffer[bufferSize] = {0xFF}; yield(); while (len) { size_t will_copy = (len < bufferSize) ? len : bufferSize; myCAM.transferBytes(&buffer[0], &buffer[0], will_copy); if (!client.connected()) break; client.write(&buffer[0], will_copy); len -= will_copy; } myCAM.CS_HIGH(); } //web void serverCapture(){ delay(0); start_capture(); Serial.println("CAM Capturing"); int total_time = 0; total_time = millis(); while (!myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK)); total_time = millis() - total_time; Serial.print("capture total_time used (in miliseconds):"); Serial.println(total_time, DEC); total_time = 0; Serial.println("CAM Capture Done!"); total_time = millis(); camCapture(myCAM); total_time = millis() - total_time; Serial.print("send total_time used (in miliseconds):"); Serial.println(total_time, DEC); Serial.println("CAM send Done!"); } void serverStream(){ WiFiClient client = server.client(); String response = "HTTP/1.1 200 OK\r\n"; response += "Content-Type: multipart/x-mixed-replace; boundary=frame\r\n\r\n"; server.sendContent(response); while (1){ start_capture(); while (!myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK)); size_t len = myCAM.read_fifo_length(); if (len >= MAX_FIFO_SIZE){ Serial.println("Over size."); continue; }else if (len == 0 ){ Serial.println("Size is 0."); continue; } myCAM.CS_LOW(); myCAM.set_fifo_burst(); #if !(defined (OV5642_MINI_5MP_PLUS) ||(defined (ARDUCAM_SHIELD_V2) && defined (OV5642_CAM))) SPI.transfer(0xFF); #endif if (!client.connected()) break; response = "--frame\r\n"; response += "Content-Type: image/jpeg\r\n\r\n"; server.sendContent(response); static const size_t bufferSize = 4096; static uint8_t buffer[bufferSize] = {0xFF}; while (len) { size_t will_copy = (len < bufferSize) ? len : bufferSize; myCAM.transferBytes(&buffer[0], &buffer[0], will_copy); if (!client.connected()) break; client.write(&buffer[0], will_copy); len -= will_copy; } myCAM.CS_HIGH(); if (!client.connected()) break; } } void getLight(){ Serial.println("getLight"); Serial.print(lightCheck(),DEC); server.send(200, "text/plain", String(lightLevel())); } void getWater(){ Serial.println("getWater"); Serial.println(waterVal); server.send(200, "text/plain", String(waterCheck())); } void getLedMod(){ Serial.println("getLedMod"); server.send(200, "text/plain", String(isAuto)); } void getLedType(){ Serial.println("getLedType"); server.send(200, "text/plain", String(ledType)); } void setLedAutoOn(){ Serial.println("setLedAutoOn"); isAuto = true; server.send(200, "text/plain", String(isAuto)); } void setLedAutoOff(){ Serial.println("setLedAutoOff"); isAuto = false; server.send(200, "text/plain", String(isAuto)); } void lightLV0(){ Serial.println("lightLV0"); ledType = 0; server.send(200, "text/plain", String(ledType)); } void lightLV1(){ Serial.println("lightLV1"); ledType = 1; server.send(200, "text/plain", String(ledType)); } void lightLV2(){ Serial.println("lightLV2"); ledType = 2; server.send(200, "text/plain", String(ledType)); } void lightLV3(){ Serial.println("lightLV3"); ledType = 3; server.send(200, "text/plain", String(ledType)); } void handleNotFound(){ String message = "Server is running!\n\n"; message += "URI: "; message += server.uri(); message += "\nMethod: "; message += (server.method() == HTTP_GET)?"GET":"POST"; message += "\nArguments: "; message += server.args(); message += "\n"; server.send(200, "text/plain", message); if (server.hasArg("ql")){ int ql = server.arg("ql").toInt(); myCAM.OV5642_set_JPEG_size(ql); delay(1000); Serial.println("QL change to: " + server.arg("ql")); } } void setup() { //server & cam uint8_t vid, pid; uint8_t temp; #if defined(__SAM3X8E__) Wire1.begin(); #else Wire.begin(); #endif Serial.begin(115200); Serial.println("ArduCAM Start!"); // set the CS as an output: pinMode(CS, OUTPUT); // initialize SPI: SPI.begin(); SPI.setFrequency(4000000); //4MHz //Check if the ArduCAM SPI bus is OK myCAM.write_reg(ARDUCHIP_TEST1, 0x55); temp = myCAM.read_reg(ARDUCHIP_TEST1); if (temp != 0x55){ Serial.println("SPI1 interface Error!"); while(1); } //Check if the camera module type is OV5642 myCAM.wrSensorReg16_8(0xff, 0x01); myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid); myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid); if((vid != 0x56) || (pid != 0x42)){ Serial.println("Can't find OV5642 module!"); while(1); } else Serial.println("OV5642 detected."); //Change to JPEG capture mode and initialize the OV5642 module myCAM.set_format(JPEG); myCAM.InitCAM(); myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK); //VSYNC is active HIGH myCAM.OV5642_set_JPEG_size(OV5642_320x240); delay(1000); if (wifiType == 0){ if(!strcmp(ssid,"SSID")){ Serial.println("Please set your SSID"); while(1); } if(!strcmp(password,"PASSWORD")){ Serial.println("Please set your PASSWORD"); while(1); } // Connect to WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println("WiFi connected"); Serial.println(""); Serial.println(WiFi.localIP()); }else if (wifiType == 1){ Serial.println(); Serial.println(); Serial.print("Share AP: "); Serial.println(AP_ssid); Serial.print("The password is: "); Serial.println(AP_password); WiFi.mode(WIFI_AP); WiFi.softAP(AP_ssid, AP_password); Serial.println(""); Serial.println(WiFi.softAPIP()); } //water check Serial.println(); Serial.println("Start Water_Sensor"); pinMode(Grove_Water_Sensor, INPUT); pinMode(ledPin, OUTPUT); Serial.println("End Water_Sensor"); //gy-30 //led bar Serial.println("Start Led"); strip.begin(); strip.setBrightness(50); strip.show(); // Initialize all pixels to 'off' Serial.println(); Serial.println("Led line"); Serial.println("Start Led"); delay(0); // Start the server server.on("/capture", HTTP_GET, serverCapture); //server.on("/stream", HTTP_GET, serverStream); server.on("/level=0", HTTP_GET, lightLV0); server.on("/level=1", HTTP_GET, lightLV1); server.on("/level=2", HTTP_GET, lightLV2); //server.on("/level=3", HTTP_GET, lightLV3); server.on("/atuoL=ON", HTTP_GET, setLedAutoOn); server.on("/atuoL=OFF", HTTP_GET, setLedAutoOff); server.on("/getLight", HTTP_GET, getLight); server.on("/getWater", HTTP_GET, getWater); server.on("/getLedMod", HTTP_GET, getLedMod); server.on("/getLedType", HTTP_GET, getLedType); server.onNotFound(handleNotFound); server.begin(); Serial.println("Server started"); } unsigned long previousMillis = 0; const long interval = 2000; void loop() { delay(0); unsigned long currentMillis = millis(); server.handleClient(); if (currentMillis - previousMillis >= interval) { previousMillis = currentMillis; waterCheck(); //led lightLevel(); if(!isAuto) colorWipe(strip.Color(t[ledType], t[ledType], t[ledType]), 1); else{ //Serial.println("new client"); if(val < 120) colorWipe(strip.Color(t[2], t[2], t[2]), 1); else if(val < 200) colorWipe(strip.Color(t[1], t[1], t[1]), 1); else colorWipe(strip.Color(t[0], t[0], t[0]), 1); } } } // gy30 int lightLevel(){ int str_len = sprintf(str, "%d", lightCheck()); //Serial.print(lightCheck(),DEC); temp = str; int L = temp.toInt(); if(L<30){return 0;} if(L<120){return 1;} if(L<200){return 2;} if(L<300){return 3;} if(L>300){return 4;} } uint16_t lightCheck(){ delay(0); BH1750_Init(BH1750address); delay(200); if(2==BH1750_Read(BH1750address)) { val=((buff[0]<<8)|buff[1])/1.2; return val; } return 0; } void BH1750_Init(int address) { Wire.beginTransmission(address); Wire.write(0x10); //1lx reolution 120ms Wire.endTransmission(); } int BH1750_Read(int address) { int z=0; Wire.beginTransmission(address); Wire.requestFrom(address, 2); while(Wire.available()) { buff[z] = Wire.read(); // receive one byte z++; } Wire.endTransmission(); return z; } //water check String waterCheck(){ //Serial.println("waterCheck"); //Serial.println(analogRead(Grove_Water_Sensor)); delay(0); waterVal = analogRead(Grove_Water_Sensor); Serial.println(waterVal); if( waterVal <= 200) { WaterState =0;//>25% haveWater = false; }else if( waterVal > 200 && waterVal <=300) { WaterState =1;//~25-50% haveWater = false; }else if( waterVal > 300 && waterVal <=400) { WaterState =2;//~50-75% haveWater = true; }else if( waterVal > 400) { WaterState =3;//75%~ haveWater = true; } if(haveWater){ digitalWrite(ledPin, LOW); }else{ digitalWrite(ledPin, HIGH); } return WaterStr[WaterState]; } //led bar void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t k=0; k<strip.numPixels(); k++) { strip.setPixelColor(k, c); strip.show(); delay(wait); } }
285193587f52c33652be7562b27bbb793327fcc1
8681c91756b2941035db515b621e32480d35ec11
/Editors/LevelEditor/Edit/ESceneSpawnTools.h
6da63359850e7fd73ebd5255109578cc45866157
[]
no_license
MaoZeDongXiJinping/xray-2212
1f3206c803c5fbc506114606424e2e834ffc51c0
e143f01368c67b997f4be0dcdafb22f792bf485c
refs/heads/main
2023-07-17T09:53:01.301852
2021-09-06T17:00:23
2021-09-06T17:00:23
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,829
h
//--------------------------------------------------------------------------- #ifndef ESceneSpawnToolsH #define ESceneSpawnToolsH #include "ESceneCustomOTools.h" class ESceneSpawnTools: public ESceneCustomOTools { typedef ESceneCustomOTools inherited; friend class CSpawnPoint; protected: // controls virtual void CreateControls (); virtual void RemoveControls (); enum{ flPickSpawnType = (1<<30), flShowSpawnType = (1<<31), }; Flags32 m_Flags; // icon list DEFINE_MAP (shared_str,ref_shader,ShaderMap,ShaderPairIt); ShaderMap m_Icons; ref_shader CreateIcon (shared_str name); ref_shader GetIcon (shared_str name); public: ESceneSpawnTools (); virtual ~ESceneSpawnTools (); // definition IC LPCSTR ClassName (){return "spawn";} IC LPCSTR ClassDesc (){return "Spawn";} IC int RenderPriority (){return 1;} void FillProp (LPCSTR pref, PropItemVec& items); virtual void Clear (bool bSpecific=false){inherited::Clear(bSpecific);m_Flags.zero();} // IO virtual bool IsNeedSave (){return true;} virtual bool Load (IReader&); virtual void Save (IWriter&); virtual bool LoadSelection (IReader&); virtual void SaveSelection (IWriter&); virtual CCustomObject* CreateObject (LPVOID data, LPCSTR name); }; //--------------------------------------------------------------------------- // refs class ISE_Abstract; typedef ISE_Abstract* (__stdcall *Tcreate_entity) (LPCSTR section); typedef void (__stdcall *Tdestroy_entity) (ISE_Abstract *&); extern Tcreate_entity create_entity; extern Tdestroy_entity destroy_entity; //--------------------------------------------------------------------------- #endif
a594bccb3c77a2f49523538c3855cfe6098143e5
7ed28dffc9e1287cf504fdef5967a85fe9f564e7
/AtCoder/ABC155/e.cpp
5f643492d7f57ec065c6c1effefdbff00de91824
[ "MIT" ]
permissive
Takumi1122/data-structure-algorithm
0d9cbb921315c94d559710181cdf8e3a1b8e62e5
6b9f26e4dbba981f034518a972ecfc698b86d837
refs/heads/master
2021-06-29T20:30:37.464338
2021-04-17T02:01:44
2021-04-17T02:01:44
227,387,243
0
0
null
2020-02-23T12:27:52
2019-12-11T14:37:49
C++
UTF-8
C++
false
false
661
cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; int dp[1000005][2]; int main() { string s; cin >> s; reverse(s.begin(), s.end()); s += '0'; int n = s.size(); rep(i, n + 1) rep(j, 2) dp[i][j] = INF; dp[0][0] = 0; rep(i, n) rep(j, 2) { int x = s[i] - '0'; x += j; rep(a, 10) { int ni = i + 1, nj = 0; int b = a - x; if (b < 0) { nj = 1; b += 10; } dp[ni][nj] = min(dp[ni][nj], dp[i][j] + a + b); } } int ans = dp[n][0]; cout << ans << endl; return 0; }
691d3235f371c66960dd9ef6c853f666ef6732b4
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/CMake/CMake-gumtree/Kitware_CMake_repos_basic_block_block_17856.cpp
0f76bc47beab683f1442f44fdce096ba760a54a1
[]
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
221
cpp
(size_t b = 0; b < 256; ++b) { uint32_t r = s == 0 ? b : crc32_table[s - 1][b]; for (size_t i = 0; i < 8; ++i) { if (r & 1) r = (r >> 1) ^ poly32; else r >>= 1; } crc32_table[s][b] = r; }
4e91e6b21f1bd3f122fd4a553c49b1138471dd5a
8c3209c8d0866d3d203c89c127c58395c8edd421
/63.cpp
7d91d81b48126a7c07a8531aaf4aa1fb02ea6a83
[]
no_license
Mr-Second/The-sword-refers-to-offer
87ca87139f1424cedf72e1cca879f6e9a4ca88f4
897ea13a740a1d232a76f7562b70ec64027a614e
refs/heads/master
2022-12-08T05:36:08.723852
2020-09-06T07:39:51
2020-09-06T07:39:51
281,876,206
1
0
null
null
null
null
UTF-8
C++
false
false
627
cpp
/* https://leetcode-cn.com/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-ii-lcof/ */ class Solution { public: int singleNumber(vector<int>& nums) { int res = 0; for(int i = 0; i < 32; i++) { int bitNum = 0; int shift = 1 << i; for(auto num: nums) { if((num & shift) != 0) //判断该位1的个数 bitNum++; } if((bitNum % 3) != 0) //如果该位1的个数不是3的倍数,说明那个数提供了一个1 res |= shift; //或运算即给该位赋值 } return res; } };
e2261bdafcee0ae68279a2a5fdf6954119d792d8
4edebfdf213e7dc212d4d045c67d3196837b52e0
/Contest 13º semana/C.cpp
a806643c7dbcc80c9b7f8d5e5b5334016756d161
[]
no_license
PauloMiranda98/Grupo-Preparatorio-para-OBI-2019
4e0a36ddea1d3d73ba933123e6c150d7986ef495
8de297de2411ac9e7ea2446eed64f6dbf1f2e402
refs/heads/master
2020-05-05T04:45:08.042664
2020-04-21T14:15:51
2020-04-21T14:15:51
179,723,613
8
0
null
null
null
null
UTF-8
C++
false
false
1,060
cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; const int INF = 0x3f3f3f3f; const int MAXN = 1010; vector<pii> adj[MAXN]; int n, m; int dist[MAXN]; int pai[MAXN]; void Dijkstra(int s){ for(int i=0; i<=n; i++){ dist[i] = INF; pai[i] = -1; } dist[s] = 0; priority_queue< pii, vector<pii>, greater<pii> > st; st.push(pii(dist[s], s)); while(!st.empty()){ int w = st.top().first; int u = st.top().second; st.pop(); if(w > dist[u]) continue; for(pii p: adj[u]){ int edge = p.first; int to = p.second; if(w+edge < dist[to]){ dist[to] = w + edge; pai[to] = u; st.push(pii(dist[to], to)); } } } } int main(){ cin >> n; cin >> m; for(int i=0; i<m; i++){ int a, b, w; cin >> a >> b >> w; adj[a].push_back(pii(w, b)); adj[b].push_back(pii(w, a)); } int s; cin >> s; Dijkstra(s); int mn = INF; int mx = 0; for(int i=1; i<=n; i++){ if(i != s){ mn = min(mn, dist[i]); mx = max(mx, dist[i]); } } cout << mx - mn << endl; return 0; }
0617c716ad3259cd8c939c963aeb22714bf6f88b
e572189d60a70df27b95fc84b63cc24048b90d09
/bjoj/12004.cpp
de174824a725431fef976661392601a7975b22d8
[]
no_license
namhong2001/Algo
00f70a0f6132ddf7a024aa3fc98ec999fef6d825
a58f0cb482b43c6221f0a2dd926dde36858ab37e
refs/heads/master
2020-05-22T12:29:30.010321
2020-05-17T06:16:14
2020-05-17T06:16:14
186,338,640
0
0
null
null
null
null
UTF-8
C++
false
false
893
cpp
#include <iostream> #include <vector> using namespace std; vector<vector<int>> adj; int N, M; vector<bool> checked; vector<bool> closed; void dfs(int here) { if (closed[here] || checked[here]) return; checked[here] = true; for (int there : adj[here]) { dfs(there); } } bool check() { checked.assign(N, false); for (int i=0; i<N; ++i) { if (!closed[i]) { dfs(i); break; } } for (int i=0; i<N; ++i) { if (!closed[i] && !checked[i]) return false; } return true; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin >> N >> M; adj.resize(N); closed.assign(N, false); for (int i=0; i<M; ++i) { int u, v; cin >> u >> v; u--, v--; adj[u].push_back(v); adj[v].push_back(u); } for (int i=0; i<N; ++i) { cout << (check() ? "YES" : "NO") << '\n'; int a; cin >> a; a--; closed[a] = true; } return 0; }
733b4092f78c4419cc4240344587d4c62edd5848
3b65b755b472a71d705fe48bb0f2a2b33345686b
/klee/include/klee/Constraints.h
ed8076bdb78afd827398d413c9d56972e0d450a4
[ "NCSA" ]
permissive
ntauth/kleespectre
40b32a86e4e8ae6e2beac942d5750c34509b4f4d
0eca358b27cf7cd624fd4cbd49e187d57cf835dc
refs/heads/master
2022-04-06T01:41:25.070063
2020-02-28T05:05:00
2020-02-28T05:05:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,307
h
//===-- Constraints.h -------------------------------------------*- C++ -*-===// // // The KLEE Symbolic Virtual Machine // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef KLEE_CONSTRAINTS_H #define KLEE_CONSTRAINTS_H #include "klee/Expr.h" // FIXME: Currently we use ConstraintManager for two things: to pass // sets of constraints around, and to optimize constraints. We should // move the first usage into a separate data structure // (ConstraintSet?) which ConstraintManager could embed if it likes. namespace klee { class ExprVisitor; class ConstraintManager { public: typedef std::vector< ref<Expr> > constraints_ty; typedef constraints_ty::iterator iterator; typedef constraints_ty::const_iterator const_iterator; ConstraintManager(): isSensitive(false) {} // create from constraints with no optimization explicit ConstraintManager(const std::vector< ref<Expr> > &_constraints) : constraints(_constraints), isSensitive(false) {} ConstraintManager(const ConstraintManager &cs) : constraints(cs.constraints), isSensitive(cs.isSensitive) {} typedef std::vector< ref<Expr> >::const_iterator constraint_iterator; // given a constraint which is known to be valid, attempt to // simplify the existing constraint set void simplifyForValidConstraint(ref<Expr> e); ref<Expr> simplifyExpr(ref<Expr> e) const; void addConstraint(ref<Expr> e); void setSensitve() {isSensitive = true;} bool empty() const { return constraints.empty(); } ref<Expr> back() const { return constraints.back(); } constraint_iterator begin() const { return constraints.begin(); } constraint_iterator end() const { return constraints.end(); } size_t size() const { return constraints.size(); } bool operator==(const ConstraintManager &other) const { return constraints == other.constraints; } private: std::vector< ref<Expr> > constraints; public: bool isSensitive; // returns true iff the constraints were modified bool rewriteConstraints(ExprVisitor &visitor); void addConstraintInternal(ref<Expr> e); }; } #endif /* KLEE_CONSTRAINTS_H */
b65934c5a5373339760954ae8583bfcb501a4d90
37cee300511669b4642a1a91518de3b974d1874b
/src/common.h
f05a86240f55cc5d737cea66f6441f5e308639d5
[ "MIT" ]
permissive
azmy60/aluspointer
cf2041f960f40e1850e867b19c3904bc3ec1a369
e0faf00d3189ccc2e602f9d947c993cbfdb1810a
refs/heads/master
2023-03-02T04:41:59.162943
2021-02-11T17:53:25
2021-02-11T17:53:25
324,576,579
0
0
null
null
null
null
UTF-8
C++
false
false
713
h
#ifndef COMMON_H #define COMMON_H #include <xcb/xcb.h> #include <memory> #include <string> namespace aluspointer { template<typename T> struct ReplyDeleter { void operator()(T* p) const { if(p) free(p); } }; template<typename T> using reply_ptr = std::unique_ptr<T, ReplyDeleter<T>>; extern xcb_connection_t *connection; extern xcb_screen_t *screen; inline void flush() { xcb_flush(connection); } extern xcb_atom_t _NET_CLIENT_LIST; extern xcb_atom_t _NET_WM_WINDOW_TYPE; extern xcb_atom_t _NET_WM_WINDOW_TYPE_NORMAL; xcb_atom_t locate_atom(std::string name); } #endif // COMMON_H
ce096384bed9db5fc52f9c72e7f52bffca197a76
678be6205c5551440be54a6a1343e31d95753862
/c++direct2dapp/c++direct2dapp/pistol.cpp
a2d42e3c7404cb7d24c1e8475b680036827ff98c
[]
no_license
nugyflex/C--Project
deef50ddd25ce84c53373f162e7efe1937524792
40a19a3c32e35b728dc3afadc6bd6cb02e022a86
refs/heads/master
2021-01-19T02:41:13.935335
2016-06-17T07:58:06
2016-06-17T07:58:06
39,937,701
0
0
null
null
null
null
UTF-8
C++
false
false
357
cpp
#include "pistol.h" pistol::pistol(float _x, float _y, Graphics * gfx) : Gun(_x, _y, gfx) { } pistol::~pistol() { } void pistol::load() { width = 12; height = 6; image = new SpriteSheet(L"pistol.png", 12, 6, 0, 1, gfx); hitMarker = new SpriteSheet(L"hitmarker.png", 11, 11, 0, 1, gfx); maxCooldown = 15; coolDown = 0; damage = 4; hasLatch = true; }
c8afd1b96a4a74d7d6a1f7dd8b510a8ea44976bf
e24848cd35e7ae5f79057da987631b8e3a965f62
/src/scheduling/DatabaseScheduler.h
e0ac7a63afd004171c9c820fc031c4de001a7bda
[ "MIT" ]
permissive
tomsvobodadotcom/water-it
110ff2ae75b2b4e34ab2ca22bdb6cd2939d87779
af3f0db154a0ec3a6087346da34575e6b5c59cfd
refs/heads/master
2020-03-12T01:53:06.979775
2018-05-12T08:55:45
2018-05-12T08:55:45
130,387,126
0
0
null
null
null
null
UTF-8
C++
false
false
677
h
#ifndef DATABASE_SCHEDULER_H #define DATABASE_SCHEDULER_H namespace Scheduling { /** * Scheduler that fetch current values from MySql database */ class DatabaseScheduler : public IScheduler { public: /** * Database scheduler constructor */ DatabaseScheduler(); /** * Return current schedule * @param schedule Reference to schedule that will be settings * @return Success if schedule was set. If return FALSE, schedule is untouched. */ bool getSchedule(Schedule &schedule) override; /** * Scheduler destructor */ ~DatabaseScheduler(); /* * @TODO more! */ }; } #endif // DATABASE_SCHEDULER_H
5494e6cfb21bb0ea9fc4c0fc79cdfd447340ceef
5013750dde6990bf5d384cfd806b0d411f04d675
/leetcode/c++/974. Subarray Sums Divisible by K.cpp
3ed1aea3c31436c4f9568d19ecfa1e0c3583797c
[]
no_license
543877815/algorithm
2c403319f83630772ac94e67b35a27e71227d2db
612b2e43fc6e1a2a746401288e1b89689e908926
refs/heads/master
2022-10-11T10:31:17.049279
2022-09-25T15:11:46
2022-09-25T15:11:46
188,680,726
2
0
null
null
null
null
UTF-8
C++
false
false
1,826
cpp
// 哈希表+前缀和 // 时间复杂度:O(n) // 空间复杂度:O(n) class Solution { public: int subarraysDivByK(vector<int> &nums, int k) { int n = nums.size(); int presum = 0, res = 0; unordered_map<int, int> record; record[0] = 1; for (int i = 0; i < n; i++) { presum += nums[i]; int key = (presum % k + k) % k; // 防止被除数是负数的情况 if (record.find(key) != record.end()) { res += record[key]; } record[key]++; } return res; } }; // 时间复杂度:O(logn) // 空间复杂度:O(n) class Solution { public: void search(vector<int> &arr, int left, int right, int &res) { int middle = left + (right - left) / 2; if (left <= right) { if (arr[middle] > arr[middle+1] && arr[middle] > arr[middle-1] ) { res = middle; } else { search(arr, left, middle - 1, res); search(arr, middle + 1, right, res); } } } int peakIndexInMountainArray(vector<int>& arr) { int n = arr.size(); int left = 1, right = n - 2; int res = 0; search(arr, left, right, res); return res; } }; // 二分查找非递归 // 时间复杂度:O(logn) // 空间复杂度:O(1) class Solution { public: int peakIndexInMountainArray(vector<int>& arr) { int n = arr.size(); int left = 1, right = n - 2, res = 0; while (left <= right) { int mid = (left + right) / 2; if (arr[mid] > arr[mid + 1]) { res = mid; right = mid - 1; } else { left = mid + 1; } } return res; } };
6c34563abf2afa9699c094f86cd556f222b7218c
b7994619e48c411f199def05c0c7cb7ac657d3c4
/ChronoChat/controller.hpp
ca92c82ab61d5a41c61b30c8c01e71f073123e7e
[]
no_license
sijiahi/ndn_app_old
a9fc0fa7402098a8d7e38b04fc1482721efe009f
73f85cd88c469ec05166c7729fca0f5d72976c7b
refs/heads/master
2023-01-24T22:31:47.250074
2020-12-14T07:21:49
2020-12-14T07:21:49
314,401,555
2
0
null
null
null
null
UTF-8
C++
false
false
5,056
hpp
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013, Regents of the University of California * Yingdi Yu * * BSD license, See the LICENSE file for more information * * Author: Yingdi Yu <[email protected]> * Qiuhan Ding <[email protected]> */ #ifndef CHRONOCHAT_CONTROLLER_HPP #define CHRONOCHAT_CONTROLLER_HPP #include <QDialog> #include <QMenu> #include <QSystemTrayIcon> #include <QtSql/QSqlDatabase> #include "setting-dialog.hpp" #include "start-chat-dialog.hpp" #include "profile-editor.hpp" #include "invitation-dialog.hpp" #include "invitation-request-dialog.hpp" #include "contact-panel.hpp" #include "browse-contact-dialog.hpp" #include "add-contact-panel.hpp" #include "chat-dialog.hpp" #include "chatroom-discovery-backend.hpp" #include "discovery-panel.hpp" #include "nfd-connection-checker.hpp" #ifndef Q_MOC_RUN #include "common.hpp" #include "invitation.hpp" #include "controller-backend.hpp" #endif namespace chronochat { class Controller : public QDialog { Q_OBJECT public: // public methods Controller(QWidget* parent = nullptr); virtual ~Controller(); private: // private methods std::string getDBName(); void openDB(); void initialize(); void loadConf(); void saveConf(); void createActions(); void createTrayIcon(); void updateMenu(); std::string getRandomString(); void addChatDialog(const QString& chatroomName, ChatDialog* chatDialog); void updateDiscoveryList(const chronochat::ChatroomInfo& chatroomName, bool isAdd); signals: void shutdownBackend(); void shutdownDiscoveryBackend(); void updateLocalPrefix(); void closeDBModule(); void localPrefixUpdated(const QString& localPrefix); void localPrefixConfigured(const QString& prefix); void identityUpdated(const QString& identity); void refreshBrowseContact(); void invitationInterest(const ndn::Name& prefix, const ndn::Interest& interest, size_t routingPrefixOffset); void discoverChatroomChanged(const chronochat::ChatroomInfo& chatroomInfo, bool isAdd); void addChatroom(QString chatroomName); void removeChatroom(QString chatroomName); void respondChatroomInfoRequest(ChatroomInfo chatroomInfo, bool isManager); void nfdReconnect(); void shutdownNfdChecker(); private slots: void onIdentityUpdated(const QString& identity); void onIdentityUpdatedContinued(); void onNickUpdated(const QString& nick); void onLocalPrefixUpdated(const QString& localPrefix); void onLocalPrefixConfigured(const QString& prefix); void onStartChatAction(); void onSettingsAction(); void onProfileEditorAction(); void onAddContactAction(); void onContactListAction(); void onDirectAdd(); void onMinimizeAction(); void onQuitAction(); void onChatroomDiscoveryAction(); void onStartChatroom(const QString& chatroom, bool secured); void onStartChatroom2(chronochat::Invitation invitation, bool secured); void onShowChatMessage(const QString& chatroomName, const QString& from, const QString& data); void onResetIcon(); void onRemoveChatDialog(const QString& chatroom); void onWarning(const QString& msg); void onNfdError(); void onNfdReconnect(); void onChatroomInfoRequest(std::string chatroomName, bool isManager); private: // private member typedef std::map<std::string, QAction*> ChatActionList; typedef std::map<std::string, ChatDialog*> ChatDialogList; // Communication Name m_localPrefix; bool m_localPrefixDetected; bool m_isInConnectionDetection; // Tray QAction* m_startChatroom; //QAction* m_discoveryAction; QAction* m_minimizeAction; QAction* m_settingsAction; QAction* m_editProfileAction; QAction* m_contactListAction; QAction* m_addContactAction; QAction* m_updateLocalPrefixAction; QAction* m_quitAction; QAction* m_chatroomDiscoveryAction; QMenu* m_trayIconMenu; QMenu* m_closeMenu; QSystemTrayIcon* m_trayIcon; ChatActionList m_chatActionList; ChatActionList m_closeActionList; // Dialogs SettingDialog* m_settingDialog; StartChatDialog* m_startChatDialog; ProfileEditor* m_profileEditor; InvitationDialog* m_invitationDialog; InvitationRequestDialog* m_invitationRequestDialog; ContactPanel* m_contactPanel; BrowseContactDialog* m_browseContactDialog; AddContactPanel* m_addContactPanel; ChatDialogList m_chatDialogList; DiscoveryPanel* m_discoveryPanel; // Conf Name m_identity; std::string m_nick; QSqlDatabase m_db; // Backend ControllerBackend m_backend; ChatroomDiscoveryBackend* m_chatroomDiscoveryBackend; NfdConnectionChecker* m_nfdConnectionChecker; }; } // namespace chronochat #endif // CHRONOCHAT_CONTROLLER_HPP
de9140d28e798a41f2400bf2776d0794a41c490c
a277f9426603317fedc590e00ab342f484c398a2
/src/types/exception.hh
ce725c9c96dd40755e60e3bf50a3d5e8df1287aa
[ "Apache-2.0" ]
permissive
Alexey-Ershov/runos
484765aa9d36dc05d883cf7c9019dc9ecec4eaa9
dfbf8f74d7f45d25f0d4fad743b51f572ec272c9
refs/heads/master
2020-03-21T13:47:02.391760
2018-06-09T09:41:05
2018-06-09T09:41:05
138,624,928
0
0
Apache-2.0
2018-06-25T16:58:48
2018-06-25T16:58:48
null
UTF-8
C++
false
false
889
hh
#pragma once #include <stdexcept> #include <boost/exception/exception.hpp> #include <boost/exception/error_info.hpp> #include <boost/throw_exception.hpp> namespace runos { typedef boost::error_info< struct tag_error_msg, const char* > errinfo_msg; #define RUNOS_THROW(x) BOOST_THROW_EXCEPTION(x) struct exception : virtual boost::exception , virtual std::exception { const char* what() const noexcept override; }; struct logic_error : virtual exception { }; struct invalid_argument : virtual logic_error { }; struct domain_error : virtual logic_error { }; struct length_error : virtual logic_error { }; struct out_of_range : virtual logic_error { }; struct runtime_error : virtual exception { }; struct range_error : virtual runtime_error { }; struct overflow_error : virtual runtime_error { }; struct underflow_error : virtual runtime_error { }; }
ae46cfb316f81b030d00a2d01d9d945d03b97605
a99eeca18024032ec0f137a28227744f9a2ce6d5
/nxlib/nxnntppool.cpp
bfdb1933790b0e82fa9eed7315cf21de0dc2f160
[]
no_license
xrmb/nxtv
d65edbba233a2da652c3ad023ca3e073c64129ba
f970bbaae81787c1dfa9b247e625e6449776c76e
refs/heads/master
2016-09-06T21:53:31.789355
2011-12-21T03:40:13
2011-12-21T03:40:32
1,852,941
1
0
null
null
null
null
UTF-8
C++
false
false
10,408
cpp
#include "nxlib.h" #include "nxthread.h" /*static*/NXNNTPPool* NXNNTPPool::m_i = NULL; unsigned long __stdcall NXNNTPPooler(void* nxthread) { NXThread<NXNNTP>* t = reinterpret_cast<NXThread<NXNNTP>*>(nxthread); if(!t) { return 1; } NXNNTP* nxnntp = t->data(); if(!nxnntp) { return t->exit(1); } int cid = nxnntp->cid(); for(;;) { if(NXLOG.thread) printf("thread:\t%02d thread suspended\n", cid); t->suspend(); if(NXLOG.thread) printf("thread:\t%02d thread running\n", cid); if(t->terminated()) { if(NXLOG.thread) printf("thread:\t%02d thread terminating\n", cid); break; } int r; switch(nxnntp->busy()) { case 1: r = nxnntp->tget(); break; case 2: r = nxnntp->thead(); break; case 3: r = nxnntp->tmhead(); break; default: R(-1, "thread %02d running but nothing to-do", cid); break; } } return t->exit(0); } unsigned long __stdcall NXNNTPPoolIdleDisconnect(void* nxthread) { NXThread<NXNNTPPool>* t = reinterpret_cast<NXThread<NXNNTPPool>*>(nxthread); if(!t) { return 1; } NXNNTPPool* pool = t->data(); if(!pool) { return t->exit(1); } for(;;) { t->suspend(10000); if(t->terminated()) break; pool->idledisconnect(); } return t->exit(0); } NXNNTPPool::NXNNTPPool() { m_count = 0; m_nxnntp = NULL; m_tp = NULL; m_tid = NULL; m_mutex = new NXMutex("NXNNTPPool"); if(m_i) R(-1, "multiple instances of %s", "NXNNTPPool"); m_i = this; } int NXNNTPPool::init(int count) { WSADATA m_wsad; int r = WSAStartup(MAKEWORD(2, 2), &m_wsad); if(r != NO_ERROR) return R(-1, "WSAStartup error %d", r); if(count < 1) count = 1; if(count > NXMAXCONN) count = NXMAXCONN; m_count = count; m_nxnntp = (NXNNTP**)NXcalloc(m_count, sizeof(NXNNTP*)); for(int i = 0; i < m_count; i++) { m_nxnntp[i] = new NXNNTP(i); } m_tp = new NXThreadPool<NXNNTP>(m_count, NXNNTPPooler, m_nxnntp); m_tid = new NXThread<NXNNTPPool>(NXNNTPPoolIdleDisconnect, this); return 0; } NXNNTPPool::~NXNNTPPool() { if(m_i == this) m_i = NULL; delete m_tp; m_tp = NULL; delete m_tid; m_tid = NULL; delete m_mutex; m_mutex = NULL; for(int i = 0; i < m_count; i++) { delete m_nxnntp[i]; m_nxnntp[i] = NULL; } NXfree(m_nxnntp); m_nxnntp = NULL; WSACleanup(); } void NXNNTPPool::shutdown() { for(int i = 0; i < m_count; i++) { m_nxnntp[i]->giveup(); } } int NXNNTPPool::get(const char* msgid) { NXMutexLocker ml(m_mutex, "aget", msgid); NXThread<NXNNTP>* t = NULL; for(int i = 0; i < m_count; i++) { if(m_nxnntp[i]->busy(msgid) == 1) { if(NXLOG.thread) printf("thread:\t%02d thread running, waiting for aget %s\n", i, msgid); t = m_tp->thread(i); if(!t) return R(-1, "no such thread"); t->request(); t->waitforsuspend(); int r = m_nxnntp[i]->agret(); t->release(); return r; } } t = m_tp->waitforidle(true); if(!t) return R(-1, "no idle thread"); NXNNTP* n = t->data(); n->aget(msgid); if(NXLOG.thread) printf("thread:\t%02d thread resume in %s\n", n->cid(), "get"); if(NXLOG.get) printf("pool:\t%02d accepted %s %s\n", n->cid(), "get", msgid); t->resume(); ml.unlock(); t->waitforsuspend(); int r = n->agret(); t->release(); return r; } /* return: >0x10000 ... connection now working on it >0x20000 ... connection already working on it =0 ... all connections busy */ int NXNNTPPool::aget(const char* msgid) { NXMutexLocker ml(m_mutex, "aget", msgid); for(int i = 0; i < m_count; i++) { if(NXLOG.thread) printf("thread:\t%02d suspended %d, busy %d\n", i, m_tp->suspended(i), m_nxnntp[i]->busy(msgid)); if(m_nxnntp[i]->busy(msgid) == 1) { if(NXLOG.get > 1) printf("pool:\t%02d working on %s\n", i, msgid); return 0x10000 + i; } } NXThread<NXNNTP>* t = m_tp->idle(); if(t) { NXNNTP* n = t->data(); n->aget(msgid); if(NXLOG.thread) printf("thread:\t%02d thread resume in %s\n", n->cid(), "aget"); if(NXLOG.get) printf("pool:\t%02d accepted %s %s\n", n->cid(), "aget", msgid); t->resume(); return 0x20000 + n->cid(); } return 0; } int NXNNTPPool::bhead(int* ok, const char** msgids, int count, NXCbBatchRequest* cb) { return breq(false, ok, msgids, count, NULL, 0, cb); } int NXNNTPPool::bget(int* ok, const char** msgids, int count, char* data, size_t datalen, NXCbBatchRequest* cb) { return breq(true, ok, msgids, count, data, datalen, cb); } int NXNNTPPool::breq(bool gorh, int* ok, const char** msgids, int count, char* data, size_t datalen, NXCbBatchRequest* cb) { if(count == 0) return 0; NXLFSMessageCache* cache = NXLFSMessageCache::i(); if(!cache) return R(-1, "no cache"); bool usestack = true; auto_free<int> afassign; if(count*sizeof(int) > 256*1024) { usestack = false; } int* assign = usestack ? (int*)NXalloca(sizeof(int)*count) : afassign.get(count); if(!assign) return R(-2, "out of memory"); memset(assign, -1, sizeof(int)*count); bool* tused = (bool*)NXalloca(sizeof(bool)*m_count); // note: no ptr check due to stack alloca memset(tused, 0, sizeof(bool)*m_count); memset(ok, -1, sizeof(int)*count); if(data) memset(data, 0, (sizeof(NXPart)+datalen)*count); NXThread<NXNNTP>* t = NULL; int r = 0; //--- get/head all msgids --- for(int pos = 0; pos < count; pos++) { if(msgids[pos] == NULL) continue; t = m_tp->waitforidle(true, tused); if(!t) return R(-2, "no idle thread"); NXNNTP* n = t->data(); int cid = n->cid(); //--- check if this thread did a head check for us --- if(tused[cid]) { for(int nr = 0; nr < pos; nr++) { if(assign[nr] == cid) { ok[nr] = gorh ? n->agret() : n->ahret(); t->release(); tused[cid] = false; assign[nr] = -1; if(ok[nr] == 0 && data) { if(cache->find(msgids[nr], (NXPart*)(data+nr*(sizeof(NXPart)+datalen)), datalen) < 0) ok[nr] = -99; } if(cb) cb(nr); break; } } pos--; continue; } //--- assign get/head request to thread --- if(gorh) { if(n->aget(msgids[pos])) { r = R(-3, "aget error"); t->release(); break; } if(NXLOG.get) printf("pool:\t%02d accepted %s %s\n", cid, "get", msgids[pos]); } else { if(n->ahead(msgids[pos])) { r = R(-4, "ahead error"); t->release(); break; } if(NXLOG.head) printf("pool:\t%02d accepted %s %s\n", cid, "head", msgids[pos]); } assign[pos] = cid; tused[cid] = true; if(NXLOG.thread) printf("thread:\t%02d thread resume in %s\n", n->cid(), gorh ? "bget" : "bhead"); t->resume(); } //--- wait for all requests to finish --- for(int nr = 0; nr < count; nr++) { int i = assign[nr]; if(i >= 0 && i < m_count) { t = m_tp->thread(i); t->waitforsuspend(); ok[nr] = gorh ? t->data()->agret() : t->data()->ahret(); t->release(); if(ok[nr] == 0 && data) { if(cache->find(msgids[nr], (NXPart*)(data+nr*(sizeof(NXPart)+datalen)), datalen) < 0) ok[nr] = -99; } if(cb) cb(nr); } } if(r) return r; for(int nr = 0; nr < count; nr++) { if(ok[nr] && msgids[nr]) r++; } return r; } int NXNNTPPool::bmhead(int* ok, const char** msgids, int count, NXCbBatchRequest* cb) { if(count == 0) return 0; bool usestack = true; auto_free<int> afassign; if(count*sizeof(int) > 256*1024) { usestack = false; } int* assign = usestack ? (int*)NXalloca(sizeof(int)*count) : afassign.get(count); if(!assign) return R(-2, "out of memory"); memset(assign, -1, sizeof(int)*count); bool* tused = (bool*)NXalloca(sizeof(bool)*m_count); // note: no ptr check due to stack alloc memset(tused, 0, sizeof(bool)*m_count); memset(ok, -1, sizeof(int)*count); NXThread<NXNNTP>* t = NULL; int r = 0; //--- get/head all msgids --- for(int pos = 0; pos < count; pos += NXMHEAD) { t = m_tp->waitforidle(true, tused); if(!t) return R(-1, "no idle thread"); NXNNTP* n = t->data(); int cid = n->cid(); //--- check if this thread did a head check for us --- if(tused[cid]) { for(int nr = 0; nr < pos; nr += NXMHEAD) { if(assign[nr] == cid) { int c = nr+NXMHEAD > count ? count % NXMHEAD : NXMHEAD; n->amhret(ok+nr, c); t->release(); tused[cid] = false; for(int j = 0; j < c; j++) { assign[nr+j] = -1; } if(cb) cb(nr); break; } } pos -= NXMHEAD; continue; } //--- assign get/head request to thread --- int c = pos+NXMHEAD > count ? count % NXMHEAD : NXMHEAD; if(n->amhead(msgids+pos, c)) { //--- todo: add random error to amhead and see if that works --- r = R(-2, "amhead error"); t->release(); break; } if(NXLOG.head) printf("pool:\t%02d accepted %s %d..%d\n", cid, "mhead", pos, pos+c); assign[pos] = cid; tused[cid] = true; if(NXLOG.thread) printf("thread:\t%02d thread resume in %s\n", n->cid(), "bmhead"); t->resume(); } //--- wait for all requests to finish --- for(int nr = 0; nr < count; nr += NXMHEAD) { int i = assign[nr]; if(i >= 0 && i < m_count) { t = m_tp->thread(i); t->waitforsuspend(); int c = nr+NXMHEAD > count ? count % NXMHEAD : NXMHEAD; t->data()->amhret(ok+nr, c); t->release(); } } if(r) return r; for(int nr = 0; nr < count; nr++) { if(ok[nr]) r++; } return r; } void NXNNTPPool::idledisconnect() { NXMutexLocker ml(m_mutex, "idledisconnect", "n/a"); for(int i = 0; i < m_count; i++) { m_nxnntp[i]->idledisconnect(); } } int NXNNTPPool::idlecount() const { NXMutexLocker ml(m_mutex, "idlecount", "n/a"); int ic = 0; for(int i = 0; i < m_count; i++) { if(!m_nxnntp[i]->busy()) { ic++; } } return ic; }
bbce3b6051e6754c4023a10e1883a74af42be68b
b12116ed9891f6eec0de489de6647a6885edb38c
/IxSystem/include/ThreadMutex.h
772cc9be0afd28ce5d67372c61a9bbd35e72409b
[]
no_license
CrackDoc/IxSystem
41e5c357698c7d72b7756be75416bf1fde21547a
b8dd09927e7237e9673e49ce59bcb835b881a49e
refs/heads/main
2023-06-14T01:02:19.820019
2021-07-13T08:02:41
2021-07-13T08:02:41
366,927,255
0
0
null
null
null
null
GB18030
C++
false
false
1,256
h
/** * @file ThreadMutex.h * @brief 线程互斥量 * * @note 适用于windows、linux、vxworks,配合GUARD使用 * * @author crack * @date 2020-07-08 * @version 1.0.0.0 * @CopyRight IxLab */ #ifndef _THREAD_MUTEX_H_ #define _THREAD_MUTEX_H_ #include "IxSystemExport.h" #if defined(WIN32) || defined(__linux__) #include <pthread.h> typedef pthread_mutex_t ThreadMutexHandle; #elif defined VXWORKS #endif /** * @class CThreadMutex * @brief 线程互斥量 * @note 线程互斥量 */ class SYSTEM_EXPORT CThreadMutex { public: CThreadMutex(); ~CThreadMutex(); /** * @fn bool Acquire() * @brief 获取线程互斥量 * @return bool 成功返回true,失败返回false */ bool Acquire() const; /** * @fn bool Release() * @brief 释放线程互斥量 * @return bool 成功返回true,失败返回false */ bool Release() const; /** * @fn ThreadMutexHandle& GetHandle() * @brief 获取线程互斥量的句柄 * @return ThreadMutexHandle& 线程互斥量的句柄 */ ThreadMutexHandle& GetHandle(); private: mutable ThreadMutexHandle m_hHandle; ///<线程互斥量句柄 }; #endif
6a3075771b3c4dfa97f6827c5080a86128ee4e14
678fae1de6a2e75d4db8745cdd7c4474504b5c2b
/libhamjet/src/Math.cpp
2aeae85fbb90a2b9b156069f6d3d56077dff2ffb
[]
no_license
pulponite/hamjet
71d2facf0bb01d7207b8a08eccf1125d2843f62f
bf1248640aa1190705a7b2d47671de97b0d1481e
refs/heads/master
2021-01-21T13:29:47.690465
2016-05-18T20:48:52
2016-05-18T20:48:52
54,406,863
1
0
null
null
null
null
UTF-8
C++
false
false
28
cpp
#include "Hamjet/Math.hpp"
d1d3dc70ff80530db5c449fae051d985f84fc53b
765955dd005b1a1536a28741d4c41f69459665bf
/OpenGLProject/Render/Renderer.h
47ac7c33d78efc62180805b54dad33973744ab90
[]
no_license
ljgdsq/OpenGLProject
6053d513f718b680073b30d1744ce224100937bf
f038502a147eb046ba6a5a94e6ac29a435867946
refs/heads/master
2021-07-15T14:11:55.582222
2021-07-13T10:11:13
2021-07-13T10:11:13
251,212,037
0
0
null
null
null
null
UTF-8
C++
false
false
778
h
#pragma once #include "Shader.h" #include "../Render/Renderer.h" class Renderer { public: Renderer(); Renderer(Shader* shader); virtual void Draw(); virtual void InitData(); virtual ~Renderer(); protected: unsigned int VAO; unsigned int VBO; unsigned int EBO; Shader* shader; }; #define RENDERER_BASE_CONSTRUCTOR_IMPL(TypeName) \ TypeName::TypeName() \ { \ InitData(); \ }; #define RENDERER_BASE_SUPER_DRAW() \ Renderer::Draw(); #define RENDERER_BASE_SUPER_INITDATA() \ Renderer::InitData(); #define RENDERER_BASE_DECLARE(TypeName) \ public:\ void Draw();\ void InitData();\ TypeName();
6c8ef80dea96fc8b6d77c93fa5c150fa0a8fe7e1
f5a8254ab9f6b68768d4309e48a387a142935162
/CommBasicObjects/smartsoft/src-gen/CommBasicObjects/CommBumperStateACE.cc
5fb91c94bf82e4d88ed10905399b312878f392ca
[ "BSD-3-Clause" ]
permissive
canonical-robots/DomainModelsRepositories
9839a3f4a305d3a94d4a284d7ba208cd1e5bf87f
68b9286d84837e5feb7b200833b158ab9c2922a4
refs/heads/master
2022-12-26T16:33:58.843240
2020-10-02T08:54:50
2020-10-02T08:54:50
287,251,257
0
0
BSD-3-Clause
2020-08-13T10:39:30
2020-08-13T10:39:29
null
UTF-8
C++
false
false
1,691
cc
//-------------------------------------------------------------------------- // Code generated by the SmartSoft MDSD Toolchain // The SmartSoft Toolchain has been developed by: // // Service Robotics Research Center // University of Applied Sciences Ulm // Prittwitzstr. 10 // 89075 Ulm (Germany) // // Information about the SmartSoft MDSD Toolchain is available at: // www.servicerobotik-ulm.de // // Please do not modify this file. It will be re-generated // running the code generator. //-------------------------------------------------------------------------- #include "CommBasicObjects/CommBumperStateACE.hh" #include <ace/SString.h> #include "CommBasicObjects/enumBumperStateTypeData.hh" // serialization operator for element CommBumperState ACE_CDR::Boolean operator<<(ACE_OutputCDR &cdr, const CommBasicObjectsIDL::CommBumperState &data) { ACE_CDR::Boolean good_bit = true; // serialize list-element bumperState good_bit = good_bit && cdr.write_long(data.bumperState); return good_bit; } // de-serialization operator for element CommBumperState ACE_CDR::Boolean operator>>(ACE_InputCDR &cdr, CommBasicObjectsIDL::CommBumperState &data) { ACE_CDR::Boolean good_bit = true; // deserialize type element bumperState good_bit = good_bit && cdr.read_long(data.bumperState); return good_bit; } // serialization operator for CommunicationObject CommBumperState ACE_CDR::Boolean operator<<(ACE_OutputCDR &cdr, const CommBasicObjects::CommBumperState &obj) { return cdr << obj.get(); } // de-serialization operator for CommunicationObject CommBumperState ACE_CDR::Boolean operator>>(ACE_InputCDR &cdr, CommBasicObjects::CommBumperState &obj) { return cdr >> obj.set(); }
979f7d17c310aa3b6eaf4112e490eb9b810ec895
8e96896ee8f97e166d3d1bed1832ee3b1b8ba253
/Server/Src/AccountServer/AccountManager.cpp
522d820d6e2d92f59b977bcf31500abbde20d5e4
[]
no_license
AngusChiang/GameProject3
57cc5c360fe88fc91c3f6fdac656de79ba81a582
a6a030430c27cc20d09cd47f440647114043bf2d
refs/heads/master
2022-11-12T16:10:44.597207
2020-07-04T14:15:05
2020-07-04T14:15:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,550
cpp
#include "stdafx.h" #include "AccountManager.h" #include <regex> CAccountObjectMgr::CAccountObjectMgr() { m_IsRun = FALSE; m_pThread = NULL; m_bCrossChannel = FALSE; m_u64MaxID = 0; } CAccountObjectMgr::~CAccountObjectMgr() { m_IsRun = FALSE; m_pThread = NULL; m_bCrossChannel = FALSE; } BOOL CAccountObjectMgr::LoadCacheAccount() { std::string strHost = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_ip"); UINT32 nPort = CConfigFile::GetInstancePtr()->GetIntValue("mysql_acc_svr_port"); std::string strUser = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_user"); std::string strPwd = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_pwd"); std::string strDb = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_db_name"); m_bCrossChannel = CConfigFile::GetInstancePtr()->GetIntValue("account_cross_channel"); CppMySQL3DB tDBConnection; if(!tDBConnection.open(strHost.c_str(), strUser.c_str(), strPwd.c_str(), strDb.c_str(), nPort)) { CLog::GetInstancePtr()->LogError("LoadCacheAccount Error: Can not open mysql database! Reason:%s", tDBConnection.GetErrorMsg()); return FALSE; } CppMySQLQuery QueryResult = tDBConnection.querySQL("select * from account"); CAccountObject* pTempObject = NULL; while(!QueryResult.eof()) { pTempObject = AddAccountObject(QueryResult.getInt64Field("id"), QueryResult.getStringField("name"), QueryResult.getIntField("channel")); ERROR_RETURN_FALSE(pTempObject != NULL); pTempObject->m_strPassword = QueryResult.getStringField("password"); pTempObject->m_uCreateTime = CommonFunc::DateStringToTime(QueryResult.getStringField("create_time")); pTempObject->m_uSealTime = CommonFunc::DateStringToTime(QueryResult.getStringField("seal_end_time")); pTempObject->m_dwLastSvrID[0] = QueryResult.getIntField("lastsvrid1"); pTempObject->m_dwLastSvrID[1] = QueryResult.getIntField("lastsvrid2"); if(m_u64MaxID < (UINT64)QueryResult.getInt64Field("id")) { m_u64MaxID = (UINT64)QueryResult.getInt64Field("id"); } QueryResult.nextRow(); } tDBConnection.close(); return TRUE; } CAccountObject* CAccountObjectMgr::GetAccountObjectByID( UINT64 AccountID ) { return GetByKey(AccountID); } CAccountObject* CAccountObjectMgr::CreateAccountObject(const std::string& strName, const std::string& strPwd, UINT32 dwChannel) { m_u64MaxID += 1; CAccountObject* pObj = InsertAlloc(m_u64MaxID); ERROR_RETURN_NULL(pObj != NULL); pObj->m_strName = strName; pObj->m_strPassword = strPwd; pObj->m_ID = m_u64MaxID; pObj->m_dwChannel = dwChannel; pObj->m_nLoginCount = 1; pObj->m_uCreateTime = CommonFunc::GetCurrTime(); if (m_bCrossChannel) { m_mapNameObj.insert(std::make_pair(strName, pObj)); } else { m_mapNameObj.insert(std::make_pair(strName + CommonConvert::IntToString(dwChannel), pObj)); } m_ArrChangedAccount.push(pObj); return pObj; } BOOL CAccountObjectMgr::ReleaseAccountObject(UINT64 AccountID ) { return Delete(AccountID); } BOOL CAccountObjectMgr::SealAccount(UINT64 uAccountID, const std::string& strName, UINT32 dwChannel, BOOL bSeal, UINT32 dwSealTime) { CAccountObject* pAccObj = NULL; if (uAccountID == 0) { pAccObj = GetAccountObject(strName, dwChannel); } else { pAccObj = GetAccountObjectByID(uAccountID); } if (pAccObj == NULL) { return FALSE; } if (bSeal) { pAccObj->m_uSealTime = CommonFunc::GetCurrTime() + dwSealTime; } else { pAccObj->m_uSealTime = 0; } m_ArrChangedAccount.push(pAccObj); return TRUE; } BOOL CAccountObjectMgr::SetLastServer(UINT64 uAccountID, INT32 ServerID) { ERROR_RETURN_FALSE(uAccountID != 0); CAccountObject* pAccObj = GetAccountObjectByID(uAccountID); ERROR_RETURN_FALSE(pAccObj != NULL); if (pAccObj->m_dwLastSvrID[0] == ServerID) { return TRUE; } pAccObj->m_dwLastSvrID[1] = pAccObj->m_dwLastSvrID[0]; pAccObj->m_dwLastSvrID[0] = ServerID; m_ArrChangedAccount.push(pAccObj); return TRUE; } CAccountObject* CAccountObjectMgr::AddAccountObject(UINT64 u64ID, const CHAR* pStrName, UINT32 dwChannel) { CAccountObject* pObj = InsertAlloc(u64ID); ERROR_RETURN_NULL(pObj != NULL); pObj->m_strName = pStrName; pObj->m_ID = u64ID; pObj->m_dwChannel = dwChannel; if (m_bCrossChannel) { m_mapNameObj.insert(std::make_pair(pObj->m_strName, pObj)); } else { m_mapNameObj.insert(std::make_pair(pObj->m_strName + CommonConvert::IntToString(dwChannel), pObj)); } return pObj; } BOOL CAccountObjectMgr::SaveAccountThread() { std::string strHost = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_ip"); UINT32 nPort = CConfigFile::GetInstancePtr()->GetIntValue("mysql_acc_svr_port"); std::string strUser = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_user"); std::string strPwd = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_pwd"); std::string strDb = CConfigFile::GetInstancePtr()->GetStringValue("mysql_acc_svr_db_name"); m_bCrossChannel = CConfigFile::GetInstancePtr()->GetIntValue("account_cross_channel"); CppMySQL3DB tDBConnection; if (!tDBConnection.open(strHost.c_str(), strUser.c_str(), strPwd.c_str(), strDb.c_str(), nPort)) { CLog::GetInstancePtr()->LogError("SaveAccountChange Error: Can not open mysql database! Reason:%s", tDBConnection.GetErrorMsg()); return FALSE; } while(IsRun()) { CAccountObject* pAccount = NULL; CHAR szSql[SQL_BUFF_LEN] = { 0 }; if (m_ArrChangedAccount.size()) { if (!tDBConnection.ping()) { if (!tDBConnection.reconnect()) { CommonFunc::Sleep(1000); continue; } } while (m_ArrChangedAccount.pop(pAccount) && (pAccount != NULL)) { snprintf(szSql, SQL_BUFF_LEN, "replace into account(id, name, password, lastsvrid1, lastsvrid2, channel, create_time, seal_end_time) values('%lld','%s','%s','%d','%d', '%d', '%s','%s')", pAccount->m_ID, pAccount->m_strName.c_str(), pAccount->m_strPassword.c_str(), pAccount->m_dwLastSvrID[0], pAccount->m_dwLastSvrID[1], pAccount->m_dwChannel, CommonFunc::TimeToString(pAccount->m_uCreateTime).c_str(), CommonFunc::TimeToString(pAccount->m_uSealTime).c_str()); if (tDBConnection.execSQL(szSql) > 0) { continue; } CLog::GetInstancePtr()->LogError("CAccountMsgHandler::SaveAccountChange Failed! Reason: %s", tDBConnection.GetErrorMsg()); } } CommonFunc::Sleep(10); } return TRUE; } BOOL CAccountObjectMgr::Init() { ERROR_RETURN_FALSE(LoadCacheAccount()); m_IsRun = TRUE; m_pThread = new std::thread(&CAccountObjectMgr::SaveAccountThread, this); ERROR_RETURN_FALSE(m_pThread != NULL); return TRUE; } BOOL CAccountObjectMgr::Uninit() { m_IsRun = FALSE; m_pThread->join(); delete m_pThread; m_mapNameObj.clear(); Clear(); return TRUE; } BOOL CAccountObjectMgr::IsRun() { return m_IsRun; } BOOL CAccountObjectMgr::CheckAccountName(const std::string& strName) { if (strName.size() < 6) { return FALSE; } if (!std::regex_match(strName.c_str(), std::regex("([a-zA-Z0-9]+)"))) { return FALSE; } return TRUE; } CAccountObject* CAccountObjectMgr::GetAccountObject(const std::string& name, UINT32 dwChannel ) { if (m_bCrossChannel) { auto itor = m_mapNameObj.find(name); if (itor != m_mapNameObj.end()) { return itor->second; } } else { auto itor = m_mapNameObj.find(name + CommonConvert::IntToString(dwChannel)); if (itor != m_mapNameObj.end()) { return itor->second; } } return NULL; }
48958bfd2d99f76bd0d49e7d0fb50563220cf5e9
56faa945655349a2c529b5076139ad823db2e516
/leetcode/hard/483.cpp
9e7e10cbaf47f91c431d7581c685fd6ee6c0c051
[]
no_license
lijinpei/leetcode
61e3fec4ec935ec0d3a8048e5df6c022b3663545
9833469506f4802009398b6217e510e35b188c95
refs/heads/master
2018-10-17T08:28:08.716683
2018-08-02T16:30:50
2018-08-02T16:30:50
120,696,376
0
0
null
null
null
null
UTF-8
C++
false
false
986
cpp
#include <string> #include <cstdint> #include <limits> class Solution { public: std::string smallestGoodBase(const std::string & n_) { int64_t n = std::stoll(n_); auto ok = [&](int64_t k) -> int64_t { auto nv = [&](int64_t b) -> int64_t { int64_t ret = 1; int64_t max = (std::numeric_limits<int64_t>::max() - 1) / b; for (int i = 2; i < k; ++i) { if (ret >= max) { return -1; } ret = ret * b + 1; } return ret; }; int64_t l = 2; int64_t h = n; int64_t v; while (l < h) { int64_t m = l + (h - l) / 2; v = nv(m); if (v == n) { return m; } if (v < 0 || v > n) { h = m; } else { l = m + 1; } } return 0; }; for (int i = 63; i >= 1; --i) { int64_t ret = ok(i); if (ret) { return std::to_string(ret); } } return ""; } };
81c5a19a53982077902ef03bab6f96c8888d8a30
238b18192b3602b3f6c92e8b54f933286d10172e
/music/mainwindow.cpp
21e8283ffc66fac9cd2989af299e1caa03aa45ed
[]
no_license
shivakasu/Qt
0de593079a65a1acd5987093e22971d61ff3999b
d2ac2acc803720a6a8f0f51f533b7963d5f7744a
refs/heads/master
2021-01-19T10:59:35.947565
2017-04-28T04:42:41
2017-04-28T04:42:41
72,016,926
0
0
null
null
null
null
UTF-8
C++
false
false
16,652
cpp
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtWidgets> #include <QMediaMetaData> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->listView->hide(); layout()->setSizeConstraint(QLayout::SetFixedSize); now1=0;now2=0;total1=0;total2=0;volumn=0;playrate=1.0;loadinfo=false; tobgblue(); player = new QMediaPlayer; musiclist = new QMediaPlaylist; musiclist->setPlaybackMode(QMediaPlaylist::Sequential); player->setPlaylist(musiclist); player->setVolume(30); ui->songProgress->setRange(0,0); disableplay(); connect(player,SIGNAL(positionChanged(qint64)),this,SLOT(positionChanged(qint64))); connect(player,SIGNAL(durationChanged(qint64)),this,SLOT(durationChanged(qint64))); connect(player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(Loadinfo(QMediaPlayer::MediaStatus))); connect(musiclist,SIGNAL(mediaInserted(int,int)),this,SLOT(disableplay())); connect(musiclist,SIGNAL(mediaRemoved(int,int)),this,SLOT(disableplay())); connect(ui->actionImport_local_files,SIGNAL(triggered()),this,SLOT(importsongs())); connect(ui->actionPlay,SIGNAL(triggered()),this,SLOT(toPlay())); connect(ui->actionPause,SIGNAL(triggered()),this,SLOT(toPause())); connect(ui->actionStop,SIGNAL(triggered()),this,SLOT(toStop())); connect(ui->actionNext,SIGNAL(triggered()),this,SLOT(on_nextButton_clicked())); connect(ui->actionPrevious,SIGNAL(triggered()),this,SLOT(on_previousButton_clicked())); connect(ui->actionFaster,SIGNAL(triggered()),this,SLOT(faster())); connect(ui->actionSlower,SIGNAL(triggered()),this,SLOT(slower())); connect(ui->actionAddprogress,SIGNAL(triggered()),this,SLOT(addProgress())); connect(ui->actionSubprograss,SIGNAL(triggered()),this,SLOT(subProgress())); connect(ui->actionbgblue,SIGNAL(triggered()),this,SLOT(tobgblue())); connect(ui->actionbgyellow,SIGNAL(triggered()),this,SLOT(tobgyellow())); connect(ui->actionbggreen,SIGNAL(triggered()),this,SLOT(tobggreen())); connect(ui->actionRandom,SIGNAL(triggered()),this,SLOT(torandom())); connect(ui->actionLoop,SIGNAL(triggered()),this,SLOT(toloop())); connect(ui->actionCurrentItemInLoop,SIGNAL(triggered()),this,SLOT(tooneloop())); connect(ui->actionSequential,SIGNAL(triggered()),this,SLOT(toseq())); connect(ui->actionClear_list,SIGNAL(triggered()),this,SLOT(clearlist())); connect(ui->action_Qt,SIGNAL(triggered()),this,SLOT(aboutQt())); connect(ui->actionGong,SIGNAL(triggered()),this,SLOT(aboutGong())); connect(ui->action_Auther,SIGNAL(triggered()),this,SLOT(aboutAuther())); } MainWindow::~MainWindow() { delete ui; } //volumn void MainWindow::on_volumnBar_valueChanged(int position) { player->setVolume(position); volumnMatch(); } void MainWindow::volumnMatch() { if(ui->volumnBar->value()==0) ui->volumnButton->setIcon(QIcon(":/image/novolumnimage")); else if(ui->volumnBar->value()>60) ui->volumnButton->setIcon(QIcon(":/image/bigvolumnimage")); else if(ui->volumnBar->value()>30) ui->volumnButton->setIcon(QIcon(":/image/middlevolumnimage")); else ui->volumnButton->setIcon(QIcon(":/image/smallvolumnimage")); } void MainWindow::on_volumnButton_clicked() { if(ui->volumnBar->value()!=0){ volumn = ui->volumnBar->value(); ui->volumnBar->setValue(0); }else{ ui->volumnBar->setValue(volumn); } player->setVolume(ui->volumnBar->value()); volumnMatch(); } //play void MainWindow::toPlay() { loadinfo=false; player->play(); ui->playButton->setIcon(QIcon(":/image/waitimage")); } void MainWindow::toPause() { player->pause(); ui->playButton->setIcon(QIcon(":/image/playimage")); } void MainWindow::toStop() { player->stop(); ui->playButton->setIcon(QIcon(":/image/playimage")); } void MainWindow::on_playButton_clicked() { loadinfo=false; if(player->state()!=QMediaPlayer::PlayingState) toPlay(); else if(player->state()==QMediaPlayer::PlayingState) toPause(); } void MainWindow::on_nextButton_clicked() { loadinfo=false; if(musiclist->isEmpty()) return; musiclist->next(); } void MainWindow::on_previousButton_clicked() { loadinfo=false; if(musiclist->isEmpty()) return; musiclist->previous(); } //progress void MainWindow::positionChanged(qint64 position) { ui->songProgress->setValue(position); now1 = position/1000/60; now2 = position/1000 - now1*60; UpdateTime(); } void MainWindow::durationChanged(qint64 duration) { ui->songProgress->setRange(0,duration); total1 = duration/1000/60; total2 = duration/1000 - total1*60; UpdateTime(); } void MainWindow::UpdateTime(){ QString time = QString::number(now1)+":"+QString::number(now2)+"\\"+QString::number(total1)+":"+QString::number(total2); ui->timelabel->setText(time); } //进度加5秒 void MainWindow::addProgress() { qint64 position = player->position(); if(player->duration()-position<5000) return; else player->setPosition(position+5000); } //进度减5秒 void MainWindow::subProgress() { qint64 position = player->position(); if(position<5000) return; else player->setPosition(position-5000); } //蓝色背景 void MainWindow::tobgblue() { QPixmap pixmap = QPixmap(":/image/bgblue").scaled(this->size()); QPalette palette(this->palette()); palette.setBrush(QPalette::Background, QBrush(pixmap)); this->setPalette(palette); ui->actionbgblue->setChecked(true); ui->actionbggreen->setChecked(false); ui->actionbgyellow->setChecked(false); } //黄色背景 void MainWindow::tobgyellow() { QPixmap pixmap = QPixmap(":/image/bgyellow").scaled(this->size()); QPalette palette(this->palette()); palette.setBrush(QPalette::Background, QBrush(pixmap)); this->setPalette(palette); ui->actionbgblue->setChecked(false); ui->actionbggreen->setChecked(false); ui->actionbgyellow->setChecked(true); } //绿色背景 void MainWindow::tobggreen() { QPixmap pixmap = QPixmap(":/image/bggreen").scaled(this->size()); QPalette palette(this->palette()); palette.setBrush(QPalette::Background, QBrush(pixmap)); this->setPalette(palette); ui->actionbgblue->setChecked(false); ui->actionbggreen->setChecked(true); ui->actionbgyellow->setChecked(false); } //下拉列表 void MainWindow::on_listButton_clicked() { if(ui->listView->isHidden()){ ui->listView->show(); ui->listButton->setIcon(QIcon(":/image/listUp")); } else{ ui->listView->hide(); ui->listButton->setIcon(QIcon(":/image/listDown")); } } //列表循环 void MainWindow::toloop() { musiclist->setPlaybackMode(QMediaPlaylist::Loop); ui->modelButton->setIcon(QIcon(":/image/loop")); } //顺序播放 void MainWindow::toseq() { musiclist->setPlaybackMode(QMediaPlaylist::Sequential); ui->modelButton->setIcon(QIcon(":/image/seq")); } //单曲循环 void MainWindow::tooneloop() { musiclist->setPlaybackMode(QMediaPlaylist::CurrentItemInLoop); ui->modelButton->setIcon(QIcon(":/image/oneloop")); } //随机播放 void MainWindow::torandom() { musiclist->setPlaybackMode(QMediaPlaylist::Random); ui->modelButton->setIcon(QIcon(":/image/random")); } //选择播放模式 void MainWindow::on_modelButton_clicked() { switch(musiclist->playbackMode()){ case QMediaPlaylist::Random: toloop(); break; case QMediaPlaylist::Loop: tooneloop(); break; case QMediaPlaylist::CurrentItemInLoop: toseq(); break; case QMediaPlaylist::Sequential: torandom(); break; default:break; } } //关于本程序 void MainWindow::aboutGong() { QMessageBox message(QMessageBox::NoIcon, "About Auther",tr("<h1>共产主义</h1>\ <p><font color=\"white\">----------------------------------------------------------------------------------------</font></p>\ <p>共产主义社会最根本的特征表现为三点。一是物质财富极大丰富,消费资料按需分配;二是社会关系高度和谐,人们精神境界极大提高;三是每个人自由而全面的发展,人类实现从必然王国向自由王国的飞跃。共产主义是人类最美好、最理想的社会,曾有无数志士仁人为之实现付出了自己最宝贵的生命,但它的最终实现仍是一个遥远而漫长的过程。共产主义社会的整体实现不是一蹴而就的事,但它一定会实现。只要我们志存高远,脚踏实地,发扬“愚公移山”的精神,总有那么一天,共产主义理想社会定会变成真真现实。</p>\ <p>共产主义是通过消灭生产资料私人占有制,去消除社会隔阂和阶级,以把全人类从压迫和贫困中解放的思想,并建立没有阶级制度、没有生产资料私有制、没有政府,以及集体生产的社会。</p>\ <p>马克思充分研究了人类的历史、经济和科技的发展,发现人类社会是以物质生产为基础的,现有生产力所决定的分工造成的不同人的经济地位决定了不同人的社会地位,人们之间的经济关系决定了整个社会的形态,法律、道德等上层建筑只是由经济地位决定的人们的社会地位的反映。</p>\ <p>“这个世界在最初并没有真实<br>\ 也没有谎言<br>\ 只有俨然存在的事实<br>\ 可是,<br>\ 存在于这个世界的所有事物<br>\ 只会将对自己有利的\"事实\"误认为真实而活<br>\ 因为不这么做<br>\ 也没有其他生存的理由了<br>\ 但实际上,对于占据了大半个世界的无力存在来说<br>\ 不适合用来肯定自己的\"事实\"<br>\ 才是所有的真实”</p>\ <p><font color=\"white\">-------------------------------------------</font>---马克思</p>")); message.setIconPixmap(QPixmap(":/image/Gong")); message.exec(); } //关于作者 void MainWindow::aboutAuther() { QMessageBox message(QMessageBox::NoIcon, "About Auther",tr("<h1>习近平</h1>\ <p><font color=\"white\">-------------------------------------------------------</font></p>\ <p>习近平,1953年6月生,陕西富平人,1969年1月参加工作,1974年1月加入中国共产党,清华大学人文社会学院马克思主义理论与思想政治教育专业毕业,在职研究生学历,法学博士学位。</p>\ <p>中共中央总书记,国家主席,中共中央军事委员会主席,国家中央军事委员会主席。</p>\ <p>第十五届中央候补委员,十六届、十七届、十八届中央委员,十七届中央政治局委员、常委、中央书记处书记,十八届中央政治局委员、常委、中央委员会总书记。第十一届全国人大第一次会议当选为中华人民共和国副主席。十七届五中全会增补为中共中央军事委员会副主席。第十一届全国人大常委会第十七次会议任命为中华人民共和国中央军事委员会副主席。十八届一中全会任中共中央军事委员会主席。第十二届全国人大第一次会议当选为中华人民共和国主席、中华人民共和国中央军事委员会主席。</p>\ <p>“我决定了,从今天起,我要选择一条不会让自己后悔的路。我要创造出属于自己的忍道!”</p>\ <p><font color=\"white\">-------------------------------------------</font>---习近平</p>")); message.setIconPixmap(QPixmap(":/image/auther")); message.exec(); } //关于Qt void MainWindow::aboutQt() { QMessageBox::aboutQt(NULL, "About Qt"); } //导入本地歌曲 void MainWindow::importsongs() { loadinfo=true; QString initialName=QDir::homePath(); QStringList pathList=QFileDialog::getOpenFileNames(this, tr("选择文件"), initialName, tr("MP3 Files (*.mp3)")); for(int i=0; i<pathList.size(); ++i) { QString path=QDir::toNativeSeparators(pathList.at(i)); if(!path.isEmpty()) { musiclist->addMedia(QUrl::fromLocalFile(path)); } } musiclist->setCurrentIndex(0); } //加载歌曲信息 void MainWindow::Loadinfo(QMediaPlayer::MediaStatus status) { bool changed = true; if(status==QMediaPlayer::LoadedMedia){ changed=false; QString info = player->metaData(QMediaMetaData::Title).toString()+" ---- "+player->metaData(QMediaMetaData::Author).toString(); ui->songInfo->setText(info); if(loadinfo){ bool exist = false; QString s1 = player->metaData(QMediaMetaData::Title).toString(); for(int i=0;i<ui->listView->rowCount();i++) { if(ui->listView->item(i,0)->text() == s1){ exist = true; break; } } if(!exist){ int rownum=ui->listView->rowCount();//行数 ui->listView->insertRow(rownum);//插入空行 QString s2 = player->metaData(QMediaMetaData::Author).toString(); QString s3 = player->metaData(QMediaMetaData::AlbumTitle).toString(); QString s4 = player->metaData(QMediaMetaData::Year).toString(); int s = player->metaData(QMediaMetaData::Duration).toInt(); int min = s/1000/60; int sec = s/1000 - min*60; QString s5 = QString::number(min)+"\:"+QString::number(sec); ui->listView->setItem(rownum, 0, new QTableWidgetItem(s1)); ui->listView->setItem(rownum, 1, new QTableWidgetItem(s2)); ui->listView->setItem(rownum, 2, new QTableWidgetItem(s3)); ui->listView->setItem(rownum, 3, new QTableWidgetItem(s4)); ui->listView->setItem(rownum, 4, new QTableWidgetItem(s5)); if(rownum%2==1){ for(int i=0;i<ui->listView->columnCount();i++){ QTableWidgetItem *item = ui->listView->item(rownum,i); item->setBackgroundColor(QColor(240,255,240)); } } } } } if(loadinfo){ if(changed) musiclist->setCurrentIndex(musiclist->currentIndex()); else if(musiclist->currentIndex()<musiclist->mediaCount()-1){ musiclist->next(); } } // toPlay(); } //播放速率增加 void MainWindow::faster() { if(playrate>=3.0) return; else{ playrate+=0.1; playratechange(); } } //播放速率减小 void MainWindow::slower() { if(playrate<=0) return; else{ playrate-=0.1; playratechange(); } } //显示播放速率 void MainWindow::playratechange() { player->setPlaybackRate(playrate); if(playrate==1.0) ui->playrateLabel->setText(""); else ui->playrateLabel->setText(" x"+QString::number(playrate)); } //表单为空时禁用按钮 void MainWindow::disableplay() { if(musiclist->mediaCount()==0){ ui->playButton->setDisabled(true); ui->nextButton->setDisabled(true); ui->previousButton->setDisabled(true); ui->actionClear_list->setDisabled(true); ui->songInfo->setText("----"); } else{ ui->playButton->setEnabled(true); ui->nextButton->setEnabled(true); ui->previousButton->setEnabled(true); ui->actionClear_list->setEnabled(true); } } //表单双击选歌 void MainWindow::on_listView_doubleClicked(const QModelIndex &index) { loadinfo=false; musiclist->setCurrentIndex(index.row()); } //表单右键 void MainWindow::on_listView_customContextMenuRequested(const QPoint &pos) { QMenu *popMenu = new QMenu(ui->listView); QAction *action_del = new QAction("移除",this); popMenu->addAction(action_del); connect(action_del,SIGNAL(triggered()),this,SLOT(deleterow())); popMenu->exec(QCursor::pos()); } //删除一首歌 void MainWindow::deleterow() { int rownow = ui->listView->currentRow(); ui->listView->removeRow(rownow); musiclist->removeMedia(rownow); } //清空歌单 void MainWindow::clearlist() { switch(QMessageBox::question(NULL, "清空列表", "确认清空整个歌单?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No)){ case QMessageBox::Yes: disableplay(); musiclist->clear(); ui->listView->clearContents(); ui->listView->setRowCount(0); break; case QMessageBox::No: break; } }
b8221e11e2b0e35ae857f218c6ae2ba0ddf4de2a
cd81282f3ce2832a91f76d7af832d57708f51186
/MJ-Slave/personage.cpp
db1ad3f71207296599e3e5f590a70f87ce524545
[]
no_license
CedricEmery/MJ-Slave
46e468cc730880ce0057ab0d4cea197179355a58
3d1788d22d11ebdac4746e080fc65a0d207ef535
refs/heads/master
2021-01-01T18:33:56.786490
2013-09-30T22:01:15
2013-09-30T22:01:15
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,709
cpp
#include "personage.h" personage::personage() { setNom("Nouveau Personnage"); setIsPJ(false); } personage::personage(QList<gift> gift, QList<spell> spell, QList<skill> skill, QList<specialSkill> specialSkill, QList<attaque> attaque , QList<QString> langue, QList<QString> particularite, QList<QString> sens, QList<QString> environement , QList<QString> organisationSociale, QList<QString> tresor, QList<QString> region, QString nom, QString type , QString sousType, QString sauvegarde, int xp, int initiative, int resistanceFisique, int vigueur, int volontee , int CA, int CAContact, int CADepourvu, int PVMax, int PV, int deplacement, int force, int dexterite , int constitution, int intelligence, int sagesse, int charisme, int BBA, int BMO, int DMD, bool isPJ) { for(int i = 0; i < gift.size(); i++) { addGift(gift[i]); } for(int i = 0; i < spell.size(); i++) { addSpell(spell[i]); } for(int i = 0; i < skill.size(); i++) { addSkill(skill[i]); } for(int i = 0; i < specialSkill.size(); i++) { addSpecialSkill(specialSkill[i]); } for(int i = 0; i < attaque.size(); i++) { addAttaque(attaque[i]); } for(int i = 0; i < langue.size(); i++) { addLangue(langue[i]); } for(int i = 0; i < particularite.size(); i++) { addParticularite(particularite[i]); } for(int i = 0; i < sens.size(); i++) { addSens(sens[i]); } for(int i = 0; i < environement.size(); i++) { addEnvironement(environement[i]); } for(int i = 0; i < organisationSociale.size(); i++) { addOrganisationSociale(organisationSociale[i]); } for(int i = 0; i < tresor.size(); i++) { addTresor(tresor[i]); } for(int i = 0; i < region.size(); i++) { addRegion(region[i]); } setNom(nom); setType(type); setSousType(sousType); setSauvegarde(sauvegarde); setXP(xp); setInitiative(initiative); setResistanceFisique(resistanceFisique); setVigueur(vigueur); setVolontee(volontee); setCA(CA); setCAContact(CAContact); setCADepourvu(CADepourvu); setPVMax(PVMax); setPV(PV); setDeplacement(deplacement); setForce(force); setDexterite(dexterite); setConstitution(constitution); setIntelligence(intelligence); setSagesse(sagesse); setCharisme(charisme); setBBA(BBA); setBMO(BMO); setDMD(DMD); setIsPJ(isPJ); } void personage::addGift(gift gift) { m_gift.append(gift); } void personage::delGift(int idTab) { if (idTab >= 0 && idTab < m_gift.size()) m_gift.removeAt(idTab); } void personage::setGift(int idTab, gift gift) { if (idTab >= 0 && idTab < m_gift.size()) m_gift[idTab] = gift; } gift personage::getSpecificGift(int idTab) { if (idTab >= 0 && idTab < m_gift.size()) return m_gift[idTab]; } QList<gift> personage::getGift() { return m_gift; } void personage::addSpell(spell spell) { m_spell.append(spell); } void personage::delSpell(int idTab) { if (idTab >= 0 && idTab < m_spell.size()) m_spell.removeAt(idTab); } void personage::setSpell(int idTab, spell spell) { if (idTab >= 0 && idTab < m_spell.size()) m_spell[idTab] = spell; } spell personage::getSpecificSpell(int idTab) { if (idTab >= 0 && idTab < m_spell.size()) return m_spell[idTab]; } QList<spell> personage::getSpell() { return m_spell; } void personage::addSkill(skill skill) { m_skill.append(skill); } void personage::delSkill(int idTab) { if (idTab >= 0 && idTab < m_skill.size()) m_skill.removeAt(idTab); } void personage::setSkill(int idTab, skill skill) { if (idTab >= 0 && idTab < m_skill.size()) m_skill[idTab] = skill; } skill personage::getSpecificSkill(int idTab) { if (idTab >= 0 && idTab < m_skill.size()) return m_skill[idTab]; } QList<skill> personage::getSkill() { return m_skill; } void personage::addSpecialSkill(specialSkill specialSkill) { m_specialSkill.append(specialSkill); } void personage::delSpecialSkill(int idTab) { if (idTab >= 0 && idTab < m_specialSkill.size()) m_specialSkill.removeAt(idTab); } void personage::setSpecialSkill(int idTab, specialSkill specialSkill) { if (idTab >= 0 && idTab < m_specialSkill.size()) m_specialSkill[idTab] = specialSkill; } specialSkill personage::getSpecificSpecialSkill(int idTab) { if (idTab >= 0 && idTab < m_specialSkill.size()) return m_specialSkill[idTab]; } QList<specialSkill> personage::getSpecialSkill() { return m_specialSkill; } void personage::addAttaque(attaque attaque) { m_attaque.append(attaque); } void personage::delAttaque(int idTab) { if (idTab >= 0 && idTab < m_attaque.size()) m_attaque.removeAt(idTab); } void personage::setAttaque(int idTab, attaque attaque) { if (idTab >= 0 && idTab < m_attaque.size()) m_attaque[idTab] = attaque; } attaque personage::getSpecificAttaque(int idTab) { if (idTab >= 0 && idTab < m_attaque.size()) return m_attaque[idTab]; } QList<attaque> personage::getAttaque() { return m_attaque; } void personage::addLangue(QString langue) { m_langue.append(langue); } void personage::delLangue(int idTab) { if (idTab >= 0 && idTab < m_langue.size()) m_langue.removeAt(idTab); } void personage::setLangue(int idTab, QString langue) { if (idTab >= 0 && idTab < m_langue.size()) m_langue[idTab] = langue; } QString personage::getSpecificLangue(int idTab) { if (idTab >= 0 && idTab < m_langue.size()) return m_langue[idTab]; } QList<QString> personage::getLangue() { return m_langue; } void personage::addParticularite(QString particularite) { m_particularite.append(particularite); } void personage::delParticularite(int idTab) { if (idTab >= 0 && idTab < m_particularite.size()) m_particularite.removeAt(idTab); } void personage::setParticularite(int idTab, QString particularite) { if (idTab >= 0 && idTab < m_particularite.size()) m_particularite[idTab] = particularite; } QString personage::getSpecificParticularite(int idTab) { if (idTab >= 0 && idTab < m_particularite.size()) return m_particularite[idTab]; } QList<QString> personage::getParticularite() { return m_particularite; } void personage::addSens(QString sens) { m_sens.append(sens); } void personage::delSens(int idTab) { if (idTab >= 0 && idTab < m_sens.size()) m_sens.removeAt(idTab); } void personage::setSens(int idTab, QString sens) { if (idTab >= 0 && idTab < m_sens.size()) m_sens[idTab] = sens; } QString personage::getSpecificSens(int idTab) { if (idTab >= 0 && idTab < m_sens.size()) return m_sens[idTab]; } QList<QString> personage::getSens() { return m_sens; } void personage::addEnvironement(QString environement) { m_environement.append(environement); } void personage::delEnvironement(int idTab) { if (idTab >= 0 && idTab < m_environement.size()) m_environement.removeAt(idTab); } void personage::setEnvironement(int idTab, QString environement) { if (idTab >= 0 && idTab < m_environement.size()) m_environement[idTab] = environement; } QString personage::getSpecificEnvironement(int idTab) { if (idTab >= 0 && idTab < m_environement.size()) return m_environement[idTab]; } QList<QString> personage::getEnvironement() { return m_environement; } void personage::addOrganisationSociale(QString organisationSociale) { m_organisationSociale.append(organisationSociale); } void personage::delOrganisationSociale(int idTab) { if (idTab >= 0 && idTab < m_organisationSociale.size()) m_organisationSociale.removeAt(idTab); } void personage::setOrganisationSociale(int idTab, QString organisationSociale) { if (idTab >= 0 && idTab < m_organisationSociale.size()) m_organisationSociale[idTab] = organisationSociale; } QString personage::getSpecificOrganisationSociale(int idTab) { if (idTab >= 0 && idTab < m_organisationSociale.size()) return m_organisationSociale[idTab]; } QList<QString> personage::getOrganisationSociale() { return m_organisationSociale; } void personage::addTresor(QString tresor) { m_tresor.append(tresor); } void personage::delTresor(int idTab) { if (idTab >= 0 && idTab < m_tresor.size()) m_tresor.removeAt(idTab); } void personage::setTresor(int idTab, QString tresor) { if (idTab >= 0 && idTab < m_tresor.size()) m_tresor[idTab] = tresor; } QString personage::getSpecificTresor(int idTab) { if (idTab >= 0 && idTab < m_tresor.size()) return m_tresor[idTab]; } QList<QString> personage::getTresor() { return m_tresor; } void personage::addRegion(QString region) { m_region.append(region); } void personage::delRegion(int idTab) { if (idTab >= 0 && idTab < m_region.size()) m_region.removeAt(idTab); } void personage::setRegion(int idTab, QString region) { if (idTab >= 0 && idTab < m_region.size()) m_region[idTab] = region; } QString personage::getSpecificRegion(int idTab) { if (idTab >= 0 && idTab < m_region.size()) return m_region[idTab]; } QList<QString> personage::getRegion() { return m_region; } void personage::setNom(QString nom) { m_nom = nom; } QString personage::getNom() { return m_nom; } void personage::setType(QString type) { m_type = type; } QString personage::getType() { return m_type; } void personage::setSousType(QString sousType) { m_sousType = sousType; } QString personage::getSousType() { return m_sousType; } void personage::setSauvegarde(QString sauvegarde) { m_sauvegarde = sauvegarde; } QString personage::getSauvegarde() { return m_sauvegarde; } void personage::setXP(int xp) { m_xp = xp; } int personage::getXP() { return m_xp; } void personage::setInitiative(int initiative) { m_initiative = initiative; } int personage::getInitiative() { return m_initiative; } void personage::setResistanceFisique(int resistanceFisique) { m_resistanceFisique = resistanceFisique; } int personage::getResistanceFisique() { return m_resistanceFisique; } void personage::setVigueur(int vigueur) { m_vigueur = vigueur; } int personage::getVigueur() { return m_vigueur; } void personage::setVolontee(int volontee) { m_volontee = volontee; } int personage::getVolontee() { return m_volontee; } void personage::setCA(int CA) { m_CA = CA; } int personage::getCA() { return m_CA; } void personage::setCAContact(int CAContact) { m_CAContact = CAContact; } int personage::getCAContact() { return m_CAContact; } void personage::setCADepourvu(int CADepourvu) { m_CADepourvu = CADepourvu; } int personage::getCADepourvu() { return m_CADepourvu; } void personage::setPVMax(int PVMax) { m_PVMax = PVMax; } int personage::getPVMax() { return m_PVMax; } void personage::setPV(int PV) { m_PV = PV; } int personage::getPV() { return m_PV; } void personage::setDeplacement(int deplacement) { m_deplacement = deplacement; } int personage::getDeplacement() { return m_deplacement; } void personage::setForce(int force) { m_force = force; } int personage::getForce() { return m_force; } void personage::setDexterite(int dexterite) { m_dexterite = dexterite; } int personage::getDexterite() { return m_dexterite; } void personage::setConstitution(int constitution) { m_constitution = constitution; } int personage::getConstitution() { return m_constitution; } void personage::setIntelligence(int intelligence) { m_intelligence = intelligence; } int personage::getIntelligence() { return m_intelligence; } void personage::setSagesse(int sagesse) { m_sagesse = sagesse; } int personage::getSagesse() { return m_sagesse; } void personage::setCharisme(int charisme) { m_charisme = charisme; } int personage::getCharisme() { return m_charisme; } void personage::setBBA(int BBA) { m_BBA = BBA; } int personage::getBBA() { return m_BBA; } void personage::setBMO(int BMO) { m_BMO = BMO; } int personage::getBMO() { return m_BMO; } void personage::setDMD(int DMD) { m_DMD = DMD; } int personage::getDMD() { return m_DMD; } int personage::blesser(int nbDegas) { setPV(getPV()-nbDegas); return getPV(); } void personage::setIsPJ(bool isPJ) { m_isPJ = isPJ; } bool personage::getIsPJ() { return m_isPJ; }
7eef537770745a4bd497711908fbc4e17c1b21da
c612f9fd2fba45dfeaf2cb27884b30f520287f77
/ash/app_list/views/assistant/assistant_privacy_info_view.h
7d0fa1aa44909ac2c77d2c70638ddd331eaf7315
[ "BSD-3-Clause" ]
permissive
Turno/chromium
c498ab6d3c058d737b17439029989f69f58fe9c7
4e5eb9aba6c91df5e965f3eecd76c3ae17b0b216
refs/heads/master
2022-12-07T22:58:55.989642
2020-08-10T12:03:21
2020-08-10T12:03:21
286,471,394
1
0
BSD-3-Clause
2020-08-10T12:39:55
2020-08-10T12:39:54
null
UTF-8
C++
false
false
1,284
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 ASH_APP_LIST_VIEWS_ASSISTANT_ASSISTANT_PRIVACY_INFO_VIEW_H_ #define ASH_APP_LIST_VIEWS_ASSISTANT_ASSISTANT_PRIVACY_INFO_VIEW_H_ #include "ash/app_list/views/privacy_info_view.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/styled_label_listener.h" namespace ash { class AppListViewDelegate; class SearchResultPageView; // View representing Assistant's privacy info in the Launcher. class AssistantPrivacyInfoView : public PrivacyInfoView { public: AssistantPrivacyInfoView(AppListViewDelegate* view_delegate, SearchResultPageView* search_result_page_view); AssistantPrivacyInfoView(const AssistantPrivacyInfoView&) = delete; AssistantPrivacyInfoView& operator=(const AssistantPrivacyInfoView&) = delete; ~AssistantPrivacyInfoView() override; // PrivacyInfoView: void CloseButtonPressed() override; void LinkClicked() override; private: AppListViewDelegate* const view_delegate_; SearchResultPageView* const search_result_page_view_; }; } // namespace ash #endif // ASH_APP_LIST_VIEWS_ASSISTANT_ASSISTANT_PRIVACY_INFO_VIEW_H_
7489d35ea22c39c757881d6d35538f5a290e4d42
99a173c4815348b9eded47912837e8bf2af9fffe
/RFHUtil/Ims.h
31f62c39165ffed4ad8607c0f1b15b587238971e
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
juancsargo/mq-rfhutil
05705bfd9e3585bf604e0669a98ce8e8182efa82
a82a65559fd3496f80f53803e9e97d50881a119a
refs/heads/master
2023-08-14T04:44:16.719651
2021-10-11T11:03:58
2021-10-11T11:03:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,204
h
/* Copyright (c) IBM Corporation 2000, 2018 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. Contributors: Jim MacNair - Initial Contribution */ #if !defined(AFX_IMS_H__F77B1EFE_F98E_4795_BDF2_7B9EEB9FECCA__INCLUDED_) #define AFX_IMS_H__F77B1EFE_F98E_4795_BDF2_7B9EEB9FECCA__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Ims.h : header file // #define IMS_NO_CONV 0 #define IMS_IN_CONV 1 #define IMS_ARCHITECT 2 #define IMS_COMMIT_FIRST 0 #define IMS_SEND_FIRST 1 #define IMS_SEC_CHECK 0 #define IMS_SEC_FULL 1 ///////////////////////////////////////////////////////////////////////////// // CIms dialog class CIms : public CPropertyPage { DECLARE_DYNCREATE(CIms) // Construction public: int getFloatEncoding(); void updateFields(const char *newFormat, int newCcsid, int newEncoding, int newPdEncoding, int newFloatEncoding); void restoreTransInstanceId(); void saveTransInstanceId(); int buildIMSheader(unsigned char * header, int ccsid, int encodeType); void clearIMSheader(); void UpdatePageData(); void setNextFormat(char * nextFormat, int * charType, int * encoding); void getFormat(char * mqformat); void freeCurrentHeader(const int callee); int getPdEncoding(); int getEncoding(); int getCcsid(); int getIMSlength(); int parseIMSheader(unsigned char * imsData, int dataLen, int ccsid, int encodeType); void createHeader(int ccsid, int encodeType); CIms(); ~CIms(); DataArea* pDoc; // Dialog Data //{{AFX_DATA(CIms) enum { IDD = IDD_IMS }; CString m_IIH_codepage; CString m_IIH_authenticator; int m_IIH_commit_mode; CString m_IIH_format; int m_IIH_encode_int; int m_IIH_encode_pd; int m_IIH_encode_float; CString m_IIH_lterm; CString m_IIH_map_name; int m_IIH_trans_state; CString m_IIH_reply_format; int m_IIH_security_scope; CString m_IIH_trans_id; BOOL m_IIH_include_header; BOOL m_IIH_no_reply_format; BOOL m_IIH_pass_expiration; BOOL m_IIH_add_length; //}}AFX_DATA // Overrides // ClassWizard generate virtual function overrides //{{AFX_VIRTUAL(CIms) public: virtual BOOL OnKillActive(); virtual BOOL OnSetActive(); virtual BOOL PreTranslateMessage(MSG* pMsg); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL PreCreateWindow(CREATESTRUCT& cs); //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CIms) virtual BOOL OnInitDialog(); afx_msg void OnIihNoConversation(); afx_msg void OnIihNoReplyFormat(); afx_msg void OnIihPassExpiration(); afx_msg void OnIihPdEncodeHost(); afx_msg void OnIihPdEncodePc(); afx_msg void OnChangeIihReplyFormat(); afx_msg void OnIihSecCheck(); afx_msg void OnIihSecFull(); afx_msg void OnIihSendFirst(); afx_msg void OnChangeIihTransId(); afx_msg void OnIihArchitected(); afx_msg void OnChangeIihAuthenticator(); afx_msg void OnIihCommitFirst(); afx_msg void OnChangeIihFormat(); afx_msg void OnIihInConversation(); afx_msg void OnIihIncludeHeader(); afx_msg void OnIihIntEncodeHost(); afx_msg void OnIihIntEncodePc(); afx_msg void OnChangeIihLterm(); afx_msg void OnChangeIihMapName(); afx_msg void OnChangeIihCodepage(); afx_msg void OnIihAddLength(); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: int imsEncodeType; int imsCcsid; LONG OnSetPageFocus(UINT wParam, LONG lParam); CString saveIMStransId; void enableDisplay(); BOOL m_save_include_header; BOOL GetToolTipText(UINT id, NMHDR *pTTTStruct, LRESULT *pResult); int imsLength; unsigned char * imsHeader; }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_IMS_H__F77B1EFE_F98E_4795_BDF2_7B9EEB9FECCA__INCLUDED_)
4dab029c979c6de8a3072e2d2c7f2458a43cac1a
673ff32dba9aa805e790b9dc75b969410c5ccc70
/src/utils/CommonUtils.h
3998f15bcf9a78da2f75fb218c72306f5f6aad02
[]
no_license
zwting/opengl_proj
cf2b50b4fd4b63f595421dee83658ab5a59a69f6
e83fb9b9db9d068a9f30297d0ac280de53730d30
refs/heads/master
2021-08-28T20:57:29.142249
2021-08-23T16:12:56
2021-08-23T16:12:56
246,360,458
0
0
null
null
null
null
UTF-8
C++
false
false
1,524
h
#pragma once #include <string> #include <fstream> #include <cassert> #include <sstream> #include "Time.h" #include "MathType.h" #include "glm/gtx/norm.hpp" class CommonUtils { public: static std::string ReadTextFromFile(const char* path) { assert(path != nullptr); std::fstream f(path, std::ios_base::in); std::stringstream buffer; buffer << f.rdbuf(); return buffer.str(); } static std::string CombinePath(const std::string& path, const std::string& fileName) { if (!path.empty() && !fileName.empty()) { char lastOfPath = path[path.size() - 1]; if (lastOfPath == '\\' || lastOfPath == '/') { return path + fileName; } return path + '/' + fileName; } if (path.empty()) { return fileName; } if(fileName.empty()) { return path; } return nullptr; } static float Clamp01(float val) { return Clamp(val, 0, 1); } static float Clamp(float val, float min, float max) { if (val < min) return min; if (val > max) return max; return val; } static void IdentityMat(mat4x4& mat) { mat[0][0] = mat[1][1] = mat[2][2] = mat[3][3] = 1; mat[0][1] = mat[0][2] = mat[0][3] = 0; mat[1][0] = mat[1][2] = mat[1][3] = 0; mat[2][0] = mat[2][1] = mat[2][3] = 0; mat[3][0] = mat[3][1] = mat[3][2] = 0; } static quaternion FromDirectionTo(const vec3& u, const vec3& v) { float norm_u_v = glm::sqrt(glm::length2(u) * glm::length2(v)); vec3 w = glm::cross(u, v); return glm::normalize(quaternion(norm_u_v + glm::dot(u, v), w.x, w.y, w.z)); } };